From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gregory CLEMENT Date: Tue, 09 Oct 2018 13:22:05 +0200 Subject: [U-Boot] [PATCH 3/6] MSCC: add board support for the VCoreIII based evaluation boards In-Reply-To: <236689d0-5593-fe51-6895-41fbc72e3cad@gmail.com> (Daniel Schwierzeck's message of "Wed, 26 Sep 2018 21:28:01 +0200") References: <20180925130108.19211-1-gregory.clement@bootlin.com> <20180925130108.19211-4-gregory.clement@bootlin.com> <236689d0-5593-fe51-6895-41fbc72e3cad@gmail.com> Message-ID: <87h8hvjrfm.fsf@bootlin.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Daniel, On mer., sept. 26 2018, Daniel Schwierzeck wrote: > On 25.09.2018 15:01, Gregory CLEMENT wrote: >> Adding the support for 3 boards sharing common code: >> - PCB120 and PCB 123 for Ocelot chip >> - PCB 91 for Luton chip >> [...] >> diff --git a/board/mscc/ocelot/Kconfig b/board/mscc/ocelot/Kconfig >> new file mode 100644 >> index 0000000000..0804f5081d >> --- /dev/null >> +++ b/board/mscc/ocelot/Kconfig >> @@ -0,0 +1,24 @@ >> +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) >> + >> +config SYS_VENDOR >> + default "mscc" >> + >> +if SOC_OCELOT >> + >> +config SYS_BOARD >> + default "ocelot" >> + >> +config SYS_CONFIG_NAME >> + default "ocelot" >> + >> +endif >> + >> +if SOC_LUTON >> + >> +config SYS_BOARD >> + default "luton" >> + >> +config SYS_CONFIG_NAME >> + default "luton" >> + > > this is already defined in board/mscc/luton/Kconfig I removed it > >> +endif >> diff --git a/board/mscc/ocelot/Makefile b/board/mscc/ocelot/Makefile >> new file mode 100644 >> index 0000000000..f6a665ca83 >> --- /dev/null >> +++ b/board/mscc/ocelot/Makefile >> @@ -0,0 +1,5 @@ >> +# SPDX-License-Identifier: (GPL-2.0+ OR MIT) >> + >> +obj-$(CONFIG_SOC_OCELOT) := ocelot.o >> +obj-y += ../common/board.o >> + >> diff --git a/board/mscc/ocelot/ocelot.c b/board/mscc/ocelot/ocelot.c >> new file mode 100644 >> index 0000000000..971fa93d07 >> --- /dev/null >> +++ b/board/mscc/ocelot/ocelot.c >> @@ -0,0 +1,38 @@ >> +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) >> +/* >> + * Copyright (c) 2018 Microsemi Corporation >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +DECLARE_GLOBAL_DATA_PTR; >> + >> +void external_cs_manage(struct udevice *dev, bool enable) >> +{ >> + u32 cs = spi_chip_select(dev); >> + /* IF_SI0_OWNER, select the owner of the SI interface >> + * Encoding: 0: SI Slave >> + * 1: SI Boot Master >> + * 2: SI Master Controller >> + */ > > style issues like indentation and multi-line comments I fixed it Gregory > >> + if (!enable) { >> + writel(ICPU_SW_MODE_SW_PIN_CTRL_MODE | >> + ICPU_SW_MODE_SW_SPI_CS(BIT(cs)), >> + REG_CFG(ICPU_SW_MODE)); >> + writel((readl(REG_CFG(ICPU_GENERAL_CTRL)) >> + & ~ICPU_GENERAL_CTRL_IF_SI_OWNER_M) | >> + ICPU_GENERAL_CTRL_IF_SI_OWNER(2), >> + REG_CFG(ICPU_GENERAL_CTRL)); >> + } else { >> + writel(0, REG_CFG(ICPU_SW_MODE)); >> + writel((readl(REG_CFG(ICPU_GENERAL_CTRL)) & >> + ~ICPU_GENERAL_CTRL_IF_SI_OWNER_M) | >> + ICPU_GENERAL_CTRL_IF_SI_OWNER(1), >> + REG_CFG(ICPU_GENERAL_CTRL)); >> + } >> +} >> > > -- > - Daniel > -- Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com