Skip to contentSkip to conversation

Add new equipment from CSSI

PATCH Superseded Christophe Leroy 2 participants 9 messages Jan 30, 2023

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add new equipment from CSSI

This series adds a new CPU board called CMPC885 which is used on two equipments called MCR3000 second generation and MIAE/VGoIP devices, manufactured by former CSSI company now called CS GROUP France.

This new board has a mpc 885 cpu.

The three first patches of the series update the already included MCR3000 board in order to get more similarities.

Christophe Leroy (7):
board: MCR3000: Use lowercase filename
board: MCR3000: Modernise the settings to properly work on lastest
u-boot version
board: MCR3000: Remove update of non-existing e1-wan DT node driver, gpio: Add support for MPC 8xx CPU ports
spi, mpc8xx: Add support for chipselect via GPIO and fixups
board: cssi: Add new board MCR3000_2G
board: cssi: Add MIAE & VGoIP devices

 arch/powerpc/Kconfig                          |    1 +
 arch/powerpc/cpu/mpc8xx/Kconfig               |    4 +
 arch/powerpc/dts/Makefile                     |    1 +
 arch/powerpc/dts/cmpc885.dts                  |   94 ++
 arch/powerpc/include/asm/arch-mpc8xx/gpio.h   |   12 +
 board/cssi/CMPC885/Kconfig                    |   23 +
 board/cssi/{MCR3000 => CMPC885}/Makefile      |    6 +-
 board/cssi/CMPC885/cmpc885.c                  | 1106 +++++++++++++++++
 board/cssi/CMPC885/nand.c                     |   47 +
 board/cssi/CMPC885/sdram.c                    |  107 ++
 board/cssi/CMPC885/u-boot.lds                 |   95 ++
 board/cssi/MAINTAINERS                        |    2 +
 board/cssi/MCR3000/Makefile                   |    2 +-
 board/cssi/MCR3000/{MCR3000.c => mcr3000.c}   |   12 -
 .../{MCR3000_defconfig => CMPC885_defconfig}  |   83 +-
 configs/MCR3000_defconfig                     |    8 +-
 drivers/gpio/Kconfig                          |    7 +
 drivers/gpio/Makefile                         |    1 +
 drivers/gpio/mpc8xx_gpio.c                    |  351 ++++++
 drivers/spi/mpc8xx_spi.c                      |   96 +-
 include/configs/CMPC885.h                     |   69 +
 include/configs/MCR3000.h                     |   42 +-
 22 files changed, 2056 insertions(+), 113 deletions(-)
 create mode 100644 arch/powerpc/dts/cmpc885.dts
 create mode 100644 arch/powerpc/include/asm/arch-mpc8xx/gpio.h
 create mode 100644 board/cssi/CMPC885/Kconfig
 copy board/cssi/{MCR3000 => CMPC885}/Makefile (52%)
 create mode 100644 board/cssi/CMPC885/cmpc885.c
 create mode 100644 board/cssi/CMPC885/nand.c
 create mode 100644 board/cssi/CMPC885/sdram.c
 create mode 100644 board/cssi/CMPC885/u-boot.lds
 rename board/cssi/MCR3000/{MCR3000.c => mcr3000.c} (90%)
 copy configs/{MCR3000_defconfig => CMPC885_defconfig} (52%)
 create mode 100644 drivers/gpio/mpc8xx_gpio.c
 create mode 100644 include/configs/CMPC885.h
Signature · 1 line
2.38.1
#1 lore raw

PATCH 1/7 board: MCR3000: Use lowercase filename

Rename MCR3000.c to mcr3000.c to be more in line with other boards.

---
 board/cssi/MCR3000/Makefile                 | 2 +-
 board/cssi/MCR3000/{MCR3000.c => mcr3000.c} | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename board/cssi/MCR3000/{MCR3000.c => mcr3000.c} (100%)
board/cssi/MCR3000/Makefile +1 -1
index 68d6812a89a..7803016af3a 100644
@@ -4,5 +4,5 @@
 # Christophe Leroy <[email protected]>
 #
 
-obj-y += MCR3000.o
+obj-y += mcr3000.o
 obj-$(CONFIG_CMD_NAND) += nand.o
board/cssi/MCR3000/mcr3000.c renamed from board/cssi/MCR3000/MCR3000.c +0 -0
similarity index 100%
rename from board/cssi/MCR3000/MCR3000.c
rename to board/cssi/MCR3000/mcr3000.c
Signature · 1 line
2.38.1
#2 lore raw

PATCH 2/7 board: MCR3000: Modernise the settings to properly work on lastest u-boot version

In reply to Christophe Leroy

Both U-boot and Linux kernel have grown over the last releases and don't fit anymore in the 2M EPROM of the board.

So, rework the setup to allow storing the Linux kernel image on the UBIFS NAND Flash.

Also add support to FIT images as this is what the Linux kernel look like nowadays.

Also increase CONFIG_SYS_BOOTMAPSZ to 32Mbytes and define CONFIG_SYS_BOOTM_LEN with the same value, otherwise it defaults to 8M which is not sufficient anymore with nowadays Linux kernels.

---
 configs/MCR3000_defconfig |  8 ++++++--
 include/configs/MCR3000.h | 42 ++++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 25 deletions(-)
configs/MCR3000_defconfig +6 -2
index 6c41d7c88d1..2e9d8c24329 100644
@@ -20,6 +20,7 @@ CONFIG_SYS_SCCR=0x00C20000
 CONFIG_SYS_SCCR_MASK=0x60000000
 CONFIG_SYS_DER=0x2002000F
 CONFIG_SYS_MONITOR_LEN=327680
+CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_MONITOR_BASE=0x04000000
 CONFIG_BOOTDELAY=5
@@ -35,11 +36,12 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PBSIZE=278
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
-CONFIG_SYS_BOOTM_LEN=0x800000
+CONFIG_SYS_BOOTM_LEN=0x2000000
 # CONFIG_CMD_IMI is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_ECHO is not set
 # CONFIG_CMD_ITEST is not set
@@ -50,6 +52,8 @@ CONFIG_CMD_MII=y
 CONFIG_MII_INIT=y
 CONFIG_CMD_PING=y
 # CONFIG_CMD_SLEEP is not set
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FLASH=y
@@ -80,6 +84,7 @@ CONFIG_SYS_BR7_PRELIM=0x1C000001
 CONFIG_SYS_OR7_PRELIM=0xFFFF810A
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
@@ -89,5 +94,4 @@ CONFIG_MPC8XX_FEC=y
 # CONFIG_PCI is not set
 CONFIG_DM_SERIAL=y
 CONFIG_WDT=y
-CONFIG_SHA256=y
 CONFIG_LZMA=y
include/configs/MCR3000.h +19 -23

74 lines not on this page · raw message

Signature · 1 line
2.38.1
#3 lore raw

Re: [PATCH 2/7] board: MCR3000: Modernise the settings to properly work on lastest u-boot version

Quoted 122 lines · Christophe Leroy

Both U-boot and Linux kernel have grown over the last releases and don't fit anymore in the 2M EPROM of the board.

So, rework the setup to allow storing the Linux kernel image on the UBIFS NAND Flash.

Also add support to FIT images as this is what the Linux kernel look like nowadays.

Also increase CONFIG_SYS_BOOTMAPSZ to 32Mbytes and define CONFIG_SYS_BOOTM_LEN with the same value, otherwise it defaults to 8M which is not sufficient anymore with nowadays Linux kernels.

---
 configs/MCR3000_defconfig |  8 ++++++--
 include/configs/MCR3000.h | 42 ++++++++++++++++++---------------------
 2 files changed, 25 insertions(+), 25 deletions(-)
configs/MCR3000_defconfig +6 -2
index 6c41d7c88d1..2e9d8c24329 100644
@@ -20,6 +20,7 @@ CONFIG_SYS_SCCR=0x00C20000
 CONFIG_SYS_SCCR_MASK=0x60000000
 CONFIG_SYS_DER=0x2002000F
 CONFIG_SYS_MONITOR_LEN=327680
+CONFIG_FIT=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_SYS_MONITOR_BASE=0x04000000
 CONFIG_BOOTDELAY=5
@@ -35,11 +36,12 @@ CONFIG_HUSH_PARSER=y
 CONFIG_SYS_PBSIZE=278
 # CONFIG_CMD_BDI is not set
 # CONFIG_CMD_CONSOLE is not set
-CONFIG_SYS_BOOTM_LEN=0x800000
+CONFIG_SYS_BOOTM_LEN=0x2000000
 # CONFIG_CMD_IMI is not set
 CONFIG_CMD_ASKENV=y
 # CONFIG_CMD_LOADB is not set
 # CONFIG_CMD_LOADS is not set
+CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND=y
 # CONFIG_CMD_ECHO is not set
 # CONFIG_CMD_ITEST is not set
@@ -50,6 +52,8 @@ CONFIG_CMD_MII=y
 CONFIG_MII_INIT=y
 CONFIG_CMD_PING=y
 # CONFIG_CMD_SLEEP is not set
+CONFIG_CMD_MTDPARTS=y
+CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_FLASH=y
@@ -80,6 +84,7 @@ CONFIG_SYS_BR7_PRELIM=0x1C000001
 CONFIG_SYS_OR7_PRELIM=0xFFFF810A
 # CONFIG_MMC is not set
 CONFIG_MTD=y
+CONFIG_DM_MTD=y
 CONFIG_MTD_NOR_FLASH=y
 CONFIG_FLASH_CFI_DRIVER=y
 CONFIG_SYS_FLASH_CFI=y
@@ -89,5 +94,4 @@ CONFIG_MPC8XX_FEC=y
 # CONFIG_PCI is not set
 CONFIG_DM_SERIAL=y
 CONFIG_WDT=y
-CONFIG_SHA256=y
 CONFIG_LZMA=y
include/configs/MCR3000.h +9 -20
index b0809332bb5..62c3404415c 100644
@@ -12,45 +12,40 @@
 #define CONFIG_EXTRA_ENV_SETTINGS					\
 	"sdram_type=SDRAM\0"						\
 	"flash_type=AM29LV160DB\0"					\
-	"loadaddr=0x400000\0"						\
-	"filename=uImage.lzma\0"					\
-	"nfsroot=/opt/ofs\0"						\
+	"loadaddr=0x1200000\0"						\
+	"filename=mcr3000.itb\0"					\
 	"dhcp_ip=ip=:::::eth0:dhcp\0"					\
 	"console_args=console=ttyCPM0,115200N8\0"			\
+	"loadkernel=ubi part nand0;ubifsmount ubi0;"			\
+		"ubifsload ${loadaddr} /boot/${filename};"		\
+		"ubifsumount; ubi detach\0"				\
+	"bootcmd=run flashboot\0" 					\
 	"flashboot=setenv bootargs "					\
 		"${console_args} "					\
 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
 		"mcr3k:eth0:off;"					\
 		"${ofl_args}; "						\
-		"bootm 0x04060000 - 0x04050000\0"			\
+		"run loadkernel; "					\
+		"bootm ${loadaddr}\0"                                   \
 	"tftpboot=setenv bootargs "					\
 		"${console_args} "					\
 		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
 		"mcr3k:eth0:off "					\
 		"${ofl_args}; "						\
 		"tftp ${loadaddr} ${filename};"				\
-		"tftp 0xf00000 mcr3000.dtb;"				\
-		"bootm ${loadaddr} - 0xf00000\0"			\
-	"netboot=dhcp ${loadaddr} ${filename};"				\
-		"tftp 0xf00000 mcr3000.dtb;"				\
-		"setenv bootargs "					\
-		"root=/dev/nfs rw "					\
-		"${console_args} "					\
-		"${dhcp_ip};"						\
-		"bootm ${loadaddr} - 0xf00000\0"			\
-	"nfsboot=setenv bootargs "					\
-		"root=/dev/nfs rw nfsroot=${serverip}:${nfsroot} "	\
-		"${console_args} "					\
-		"ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:"	\
-		"mcr3k:eth0:off;"					\
-		"bootm 0x04060000 - 0x04050000\0"			\
+		"bootm ${loadaddr}\0"                                   \
 	"dhcpboot=dhcp ${loadaddr} ${filename};"			\
-		"tftp 0xf00000 mcr3000.dtb;"				\
 		"setenv bootargs "					\
 		"${console_args} "					\

include/configs/MCR3000.h line 48

Quoted 10 lines
include/configs/MCR3000.h +7 -1
 		"${dhcp_ip} "						\
 		"${ofl_args}; "						\
-		"bootm ${loadaddr} - 0xf00000\0"
+		"bootm ${loadaddr}\0"					\
+	"update=echo 'Updating ubi image'; "				\
+		"if tftp 0x2000 $ubifile; then "			\
+		"nand erase.chip; "					\
+		"nand write 0x2000 0x00 $filesize; "			\
+		"fi;\0 "
+

I would like to see this move instead to using the plain text environment as can be see in commits such as 5c3f6a320678 ("dragonboard410c: Migrate to using CONFIG_EXTRA_ENV_TEXT").

Signature · 1 line
Tom
#4 lore raw

PATCH 3/7 board: MCR3000: Remove update of non-existing e1-wan DT node

In reply to Christophe Leroy

e1-wan device-tree node doesn't exist. Remove related update to avoid following warning at startup:

Loading Device Tree to 007fa000, end 007ff951 ... OK
Unable to update property /localbus/e1-wan:data-rate, err=FDT_ERR_NOTFOUND Unable to update property /localbus/e1-wan:channel-phase, err=FDT_ERR_NOTFOUND Unable to update property /localbus/e1-wan:rising-edge-sync-pulse, err=FDT_ERR_NOTFOUND

---
 board/cssi/MCR3000/mcr3000.c | 12 ------------
 1 file changed, 12 deletions(-)
board/cssi/MCR3000/mcr3000.c +0 -12
index c20e8714949..ecc244cc124 100644
@@ -58,8 +58,6 @@ static const uint cs1_dram_table_66[] = {
 
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
-	const char *sync = "receive";
-
 	ft_cpu_setup(blob, bd);
 
 	/* BRG */
@@ -72,16 +70,6 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	/* Bus Frequency for CPM */
 	do_fixup_by_path_u32(blob, "/soc", "bus-frequency", bd->bi_busfreq, 1);
 
-	/* E1 interface - Set data rate */
-	do_fixup_by_path_u32(blob, "/localbus/e1-wan", "data-rate", 2, 1);
-
-	/* E1 interface - Set channel phase to 0 */
-	do_fixup_by_path_u32(blob, "/localbus/e1-wan", "channel-phase", 0, 1);
-
-	/* E1 interface - rising edge sync pulse transmit */
-	do_fixup_by_path(blob, "/localbus/e1-wan", "rising-edge-sync-pulse",
-			 sync, strlen(sync), 1);
-
 	return 0;
 }
 
Signature · 1 line
2.38.1
#5 lore raw

PATCH 4/7 driver, gpio: Add support for MPC 8xx CPU ports

In reply to Christophe Leroy

Ports A, C and D are 16 bits ports.
Ports B and E are 32 bits ports.

The "compatible" is used to determine each port type.

This patch was originally written by Charles Frey who's email address is not valid anymore as he left the company.

---
 arch/powerpc/Kconfig                        |   1 +
 arch/powerpc/include/asm/arch-mpc8xx/gpio.h |  12 +
 drivers/gpio/Kconfig                        |   7 +
 drivers/gpio/Makefile                       |   1 +
 drivers/gpio/mpc8xx_gpio.c                  | 351 ++++++++++++++++++++
 5 files changed, 372 insertions(+)
 create mode 100644 arch/powerpc/include/asm/arch-mpc8xx/gpio.h
 create mode 100644 drivers/gpio/mpc8xx_gpio.c
arch/powerpc/Kconfig +1 -0
index c355a954537..7238da196ec 100644
@@ -28,6 +28,7 @@ config MPC85xx
 
 config MPC8xx
 	bool "MPC8xx"
+	select CREATE_ARCH_SYMLINK
 	select BOARD_EARLY_INIT_F
 	imply CMD_REGINFO
 	imply WDT_MPC8xx
arch/powerpc/include/asm/arch-mpc8xx/gpio.h new file +12 -0
new file mode 100644
index 00000000000..6b73acbaee7
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+
+#ifndef _MPC8XX_GPIO_H_
+#define _MPC8XX_GPIO_H_
+
+struct mpc8xx_gpio_plat {
+	ulong addr;
+	unsigned long size;
+	uint ngpios;
+};
+
+#endif	/* MPC8XX_GPIO_H_ */
drivers/gpio/Kconfig +7 -0
index ff87fbfb397..92c5d96843a 100644
@@ -534,6 +534,13 @@ config MPC8XXX_GPIO
 	  value setting, the open-drain feature, which can configure individual
 	  GPIOs to work as open-drain outputs, is supported.
 
+config MPC8XX_GPIO
+	bool "Freescale MPC8XX GPIO driver"
+	depends on DM_GPIO
+	help
+	  This driver supports parallel IO ports from MPC8XX CPUs.
+	  Each GPIO bank is identified by its own entry in the device tree.
+
 config MPC83XX_SPISEL_BOOT
 	bool "Freescale MPC83XX SPISEL_BOOT driver"
 	depends on DM_GPIO && ARCH_MPC830X
drivers/gpio/Makefile +1 -0
index 7235714fcc0..baceb54d318 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_DM644X_GPIO)	+= da8xx_gpio.o
 obj-$(CONFIG_ALTERA_PIO)	+= altera_pio.o
 obj-$(CONFIG_MPC83XX_GPIO)	+= mpc83xx_gpio.o
 obj-$(CONFIG_MPC8XXX_GPIO)	+= mpc8xxx_gpio.o
+obj-$(CONFIG_MPC8XX_GPIO)	+= mpc8xx_gpio.o
 obj-$(CONFIG_MPC83XX_SPISEL_BOOT)	+= mpc83xx_spisel_boot.o
 obj-$(CONFIG_SH_GPIO_PFC)	+= sh_pfc.o
 obj-$(CONFIG_OMAP_GPIO)	+= omap_gpio.o
drivers/gpio/mpc8xx_gpio.c new file +351 -0

351 lines not on this page · raw message

Signature · 1 line
2.38.1
#6 lore raw

PATCH 5/7 spi, mpc8xx: Add support for chipselect via GPIO and fixups

In reply to Christophe Leroy

This patch fixes the mpc8xx SPI driver:
- A stub callbacks for mode and speed,
- Use chip selects defined as GPIOs,
- Write proper value to disable relocation, other it fails on mpc885,
- Don't modify ports setup, ports can be different from one board to another and are already set by board_early_init_r().

This patch was originally written by Charles Frey who's email address is not valid anymore as he left the company.

---
 drivers/spi/mpc8xx_spi.c | 96 ++++++++++++++++++++++++----------------
 1 file changed, 59 insertions(+), 37 deletions(-)
drivers/spi/mpc8xx_spi.c +59 -37
index 0026ad23e37..d84d7aea888 100644
@@ -24,12 +24,29 @@
 
 #include <asm/cpm_8xx.h>
 #include <asm/io.h>
+#include <asm/gpio.h>
 
 #define CPM_SPI_BASE_RX	CPM_SPI_BASE
 #define CPM_SPI_BASE_TX	(CPM_SPI_BASE + sizeof(cbd_t))
 
 #define MAX_BUFFER	0x104
 
+struct mpc8xx_priv {
+	spi_t __iomem *spi;
+	struct gpio_desc gpios[16];
+	int max_cs;
+};
+
+static int mpc8xx_spi_set_mode(struct udevice *dev, uint mod)
+{
+	return 0;
+}
+
+static int mpc8xx_spi_set_speed(struct udevice *dev, uint speed)
+{
+	return 0;
+}
+
 static int mpc8xx_spi_probe(struct udevice *dev)
 {
 	immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
@@ -38,42 +55,9 @@ static int mpc8xx_spi_probe(struct udevice *dev)
 	cbd_t __iomem *tbdf, *rbdf;
 
 	/* Disable relocation */
-	out_be16(&spi->spi_rpbase, 0);
+	out_be16(&spi->spi_rpbase, 0x1d80);
 
 /* 1 */
-	/* ------------------------------------------------
-	 * Initialize Port B SPI pins -> page 34-8 MPC860UM
-	 * (we are only in Master Mode !)
-	 * ------------------------------------------------ */
-
-	/* --------------------------------------------
-	 * GPIO or per. Function
-	 * PBPAR[28] = 1 [0x00000008] -> PERI: (SPIMISO)
-	 * PBPAR[29] = 1 [0x00000004] -> PERI: (SPIMOSI)
-	 * PBPAR[30] = 1 [0x00000002] -> PERI: (SPICLK)
-	 * PBPAR[31] = 0 [0x00000001] -> GPIO: (CS for PCUE/CCM-EEPROM)
-	 * -------------------------------------------- */
-	clrsetbits_be32(&cp->cp_pbpar, 0x00000001, 0x0000000E);	/* set  bits */
-
-	/* ----------------------------------------------
-	 * In/Out or per. Function 0/1
-	 * PBDIR[28] = 1 [0x00000008] -> PERI1: SPIMISO
-	 * PBDIR[29] = 1 [0x00000004] -> PERI1: SPIMOSI
-	 * PBDIR[30] = 1 [0x00000002] -> PERI1: SPICLK
-	 * PBDIR[31] = 1 [0x00000001] -> GPIO OUT: CS for PCUE/CCM-EEPROM
-	 * ---------------------------------------------- */
-	setbits_be32(&cp->cp_pbdir, 0x0000000F);
-
-	/* ----------------------------------------------
-	 * open drain or active output
-	 * PBODR[28] = 1 [0x00000008] -> open drain: SPIMISO
-	 * PBODR[29] = 0 [0x00000004] -> active output SPIMOSI
-	 * PBODR[30] = 0 [0x00000002] -> active output: SPICLK
-	 * PBODR[31] = 0 [0x00000001] -> active output GPIO OUT: CS for PCUE/CCM
-	 * ---------------------------------------------- */
-
-	clrsetbits_be16(&cp->cp_pbodr, 0x00000007, 0x00000008);
-
 	/* Initialize the parameter ram.
 	 * We need to make sure many things are initialized to zero
 	 */
@@ -143,6 +127,22 @@ static int mpc8xx_spi_probe(struct udevice *dev)
 	return 0;
 }
 
+static void mpc8xx_spi_cs_activate(struct udevice *dev)
+{
+	struct mpc8xx_priv *priv = dev_get_priv(dev->parent);
+	struct dm_spi_slave_plat *platdata = dev_get_parent_plat(dev);
+
+	dm_gpio_set_value(&priv->gpios[platdata->cs], 1);
+}
+
+static void mpc8xx_spi_cs_deactivate(struct udevice *dev)
+{
+	struct mpc8xx_priv *priv = dev_get_priv(dev->parent);
+	struct dm_spi_slave_plat *platdata = dev_get_parent_plat(dev);
+
+	dm_gpio_set_value(&priv->gpios[platdata->cs], 0);
+}
+
 static int mpc8xx_spi_xfer(struct udevice *dev, unsigned int bitlen,
 			    const void *dout, void *din, unsigned long flags)
 {
@@ -159,7 +159,8 @@ static int mpc8xx_spi_xfer(struct udevice *dev, unsigned int bitlen,
 	rbdf = (cbd_t __iomem *)&cp->cp_dpmem[CPM_SPI_BASE_RX];
 
 	/* Set CS for device */
-	clrbits_be32(&cp->cp_pbdat, 0x0001);
+	if (flags & SPI_XFER_BEGIN)
+		mpc8xx_spi_cs_activate(dev);
 
 	/* Setting tx bd status and data length */
 	out_be32(&tbdf->cbd_bufaddr, (ulong)dout);
@@ -186,21 +187,40 @@ static int mpc8xx_spi_xfer(struct udevice *dev, unsigned int bitlen,
 	for (tm = 0; tm < 1000; ++tm) {
 		if (in_8(&cp->cp_spie) & SPI_TXB)	/* Tx Buffer Empty */
 			break;
+
 		if ((in_be16(&tbdf->cbd_sc) & BD_SC_READY) == 0)
 			break;
 		udelay(1000);
 	}
+
 	if (tm >= 1000)
 		printf("*** spi_xfer: Time out while xferring to/from SPI!\n");
 
 	/* Clear CS for device */
-	setbits_be32(&cp->cp_pbdat, 0x0001);
+	if (flags & SPI_XFER_END)
+		mpc8xx_spi_cs_deactivate(dev);
 
-	return count;
+	return 0;
 }
 
+static int mpc8xx_spi_ofdata_to_platdata(struct udevice *dev)
+{
+	struct mpc8xx_priv *priv = dev_get_priv(dev);
+	int ret;
+
+	ret = gpio_request_list_by_name(dev, "gpios", priv->gpios,
+					ARRAY_SIZE(priv->gpios), GPIOD_IS_OUT);
+	if (ret < 0)
+		return ret;
+
+	priv->max_cs = ret;
+
+	return 0;
+}
 static const struct dm_spi_ops mpc8xx_spi_ops = {
 	.xfer		= mpc8xx_spi_xfer,
+	.set_speed	= mpc8xx_spi_set_speed,
+	.set_mode	= mpc8xx_spi_set_mode,
 };
 
 static const struct udevice_id mpc8xx_spi_ids[] = {
@@ -212,6 +232,8 @@ U_BOOT_DRIVER(mpc8xx_spi) = {
 	.name	= "mpc8xx_spi",
 	.id	= UCLASS_SPI,
 	.of_match = mpc8xx_spi_ids,
+	.of_to_plat = mpc8xx_spi_ofdata_to_platdata,
 	.ops	= &mpc8xx_spi_ops,
 	.probe	= mpc8xx_spi_probe,
+	.priv_auto = sizeof(struct mpc8xx_priv),
 };
Signature · 1 line
2.38.1
#7 lore raw

PATCH 6/7 board: cssi: Add new board MCR3000_2G

In reply to Christophe Leroy

This adds a new board from CS GROUP. The board is called MCR3000_2G, and has a CPU board called CMPC885.

That CPU board is shared with another equipment that will be added in a later patch.

That board stores Ethernet MAC addresses in an EEPROM which is accessed using SPI bus.

This patch was originally written by Charles Frey who's email address is not valid anymore as he left the company.

---
 arch/powerpc/cpu/mpc8xx/Kconfig |   4 +
 arch/powerpc/dts/Makefile       |   1 +
 arch/powerpc/dts/cmpc885.dts    |  94 ++++
 board/cssi/CMPC885/Kconfig      |  23 +
 board/cssi/CMPC885/Makefile     |  10 +
 board/cssi/CMPC885/cmpc885.c    | 830 ++++++++++++++++++++++++++++++++
 board/cssi/CMPC885/nand.c       |  47 ++
 board/cssi/CMPC885/sdram.c      | 107 ++++
 board/cssi/CMPC885/u-boot.lds   |  95 ++++
 board/cssi/MAINTAINERS          |   2 +
 configs/CMPC885_defconfig       | 104 ++++
 include/configs/CMPC885.h       |  69 +++
 12 files changed, 1386 insertions(+)
 create mode 100644 arch/powerpc/dts/cmpc885.dts
 create mode 100644 board/cssi/CMPC885/Kconfig
 create mode 100644 board/cssi/CMPC885/Makefile
 create mode 100644 board/cssi/CMPC885/cmpc885.c
 create mode 100644 board/cssi/CMPC885/nand.c
 create mode 100644 board/cssi/CMPC885/sdram.c
 create mode 100644 board/cssi/CMPC885/u-boot.lds
 create mode 100644 configs/CMPC885_defconfig
 create mode 100644 include/configs/CMPC885.h
arch/powerpc/cpu/mpc8xx/Kconfig +4 -0
index d63071104c4..9ea59b01eb9 100644
@@ -11,6 +11,9 @@ choice
 config TARGET_MCR3000
 	bool "Support MCR3000 board from CSSI"
 
+config TARGET_CMPC885
+	bool "Support CMPC885 board from CSSI"
+
 endchoice
 
 choice
@@ -86,4 +89,5 @@ config SYS_DER
 
 source "board/cssi/MCR3000/Kconfig"
 
+source "board/cssi/CMPC885/Kconfig"
 endmenu
arch/powerpc/dts/Makefile +1 -0
index a4b0d7ddc4f..26b592b85db 100644
@@ -29,6 +29,7 @@ dtb-$(CONFIG_TARGET_TUGE1) += kmtuge1.dtb
 dtb-$(CONFIG_TARGET_TUXX1) += kmtuxa1.dtb
 dtb-$(CONFIG_TARGET_MCR3000) += mcr3000.dtb
 dtb-$(CONFIG_TARGET_GAZERBEAM) += gazerbeam.dtb
+dtb-$(CONFIG_TARGET_CMPC885) += cmpc885.dtb
 
 include $(srctree)/scripts/Makefile.dts
 
arch/powerpc/dts/cmpc885.dts new file +94 -0

94 lines not on this page · raw message

board/cssi/CMPC885/Kconfig new file +23 -0
new file mode 100644
index 00000000000..50902a64bbb
@@ -0,0 +1,23 @@
+if TARGET_CMPC885
+
+config SYS_BOARD
+	default "CMPC885"
+
+config SYS_VENDOR
+	default "cssi"
+
+config SYS_CONFIG_NAME
+	default "CMPC885"
+
+config TEXT_BASE
+	default 0x40000000
+
+config CPLD_BASE
+	hex
+	default 0xc8000000
+
+config FPGA_BASE
+	hex
+	default 0xd0000000
+
+endif
board/cssi/CMPC885/Makefile new file +10 -0
new file mode 100644
index 00000000000..6c055097cdd
@@ -0,0 +1,10 @@
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (C) 2010-2020 CS Group
+# Charles Frey <[email protected]>
+# Christophe Leroy <[email protected]>
+#
+
+obj-y += cmpc885.o
+obj-y += sdram.o
+obj-$(CONFIG_CMD_NAND) += nand.o
board/cssi/CMPC885/cmpc885.c new file +830 -0

830 lines not on this page · raw message

board/cssi/CMPC885/nand.c new file +47 -0

47 lines not on this page · raw message

board/cssi/CMPC885/sdram.c new file +107 -0

107 lines not on this page · raw message

board/cssi/CMPC885/u-boot.lds new file +95 -0

95 lines not on this page · raw message

board/cssi/MAINTAINERS +2 -0
index 7d237b0b209..8dac30653e5 100644
@@ -4,3 +4,5 @@ S:	Maintained
 F:	board/cssi/
 F:	include/configs/MCR3000.h
 F:	configs/MCR3000_defconfig
+F:	include/configs/CMPC885.h
+F:	configs/CMPC885_defconfig
configs/CMPC885_defconfig new file +104 -0

104 lines not on this page · raw message

include/configs/CMPC885.h new file +69 -0

69 lines not on this page · raw message

Signature · 1 line
2.38.1
#8 lore raw

PATCH 7/7 board: cssi: Add MIAE & VGoIP devices

In reply to Christophe Leroy

This adds support for the MIAE and VGoIP devices. Those devices have the same CPU board that the MCR3000_2G board.

The devices are very modular, they are provided with interchangeable front and back panels.

Linux kernel is shipped with a device tree which contains all possible setups, and U-boot eliminates unrelated nodes based on detected hardware.

This patch was originally written by Charles Frey who's email address is not valid anymore as he left the company.

---
 board/cssi/CMPC885/cmpc885.c | 286 ++++++++++++++++++++++++++++++++++-
 1 file changed, 281 insertions(+), 5 deletions(-)
board/cssi/CMPC885/cmpc885.c +281 -5
index 2c19d9b6165..367696bcdd6 100644
@@ -29,8 +29,16 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define BOARD_CMPC885		"cmpc885"
 #define BOARD_MCR3000_2G	"mcr3k_2g"
+#define BOARD_VGOIP		"vgoip"
+#define BOARD_MIAE		"miae"
 
 #define TYPE_MCR	0x22
+#define TYPE_MIAE	0x23
+
+#define FAR_CASRSA     2
+#define FAR_VGOIP      4
+#define FAV_CLA        7
+#define FAV_SRSA       8
 
 #define ADDR_CPLD_R_RESET		((unsigned short __iomem *)CONFIG_CPLD_BASE)
 #define ADDR_CPLD_R_ETAT		((unsigned short __iomem *)(CONFIG_CPLD_BASE + 2))
@@ -38,6 +46,12 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define ADDR_FPGA_R_BASE		((unsigned char  __iomem *)CONFIG_FPGA_BASE)
 #define ADDR_FPGA_R_ALARMES_IN		((unsigned char  __iomem *)CONFIG_FPGA_BASE + 0x31)
+#define ADDR_FPGA_R_FAV			((unsigned char  __iomem *)CONFIG_FPGA_BASE + 0x44)
+
+#define PATH_PHY2			"/soc@ff000000/mdio@e00/ethernet-phy@2"
+#define PATH_PHY3			"/soc@ff000000/mdio@e00/ethernet-phy@3"
+#define PATH_ETH1			"/soc@ff000000/ethernet@1e00"
+#define FIBER_PHY PATH_PHY2
 
 #define FPGA_R_ACQ_AL_FAV	0x04
 #define R_ETAT_PRES_BASE	0x0040
@@ -45,15 +59,68 @@ DECLARE_GLOBAL_DATA_PTR;
 #define R_RESET_STATUS		0x0400
 #define R_RST_STATUS		0x0004
 
+static int fdt_set_node_and_value(void *blob, char *node, const char *prop,
+				  void *var, int size)
+{
+	int ret, off;
+
+	off = fdt_path_offset(blob, node);
+
+	if (off < 0) {
+		printf("Cannot find %s node err:%s\n", node, fdt_strerror(off));
+
+		return off;
+	}
+
+	ret = fdt_setprop(blob, off, prop, var, size);
+
+	if (ret < 0)
+		printf("Cannot set %s/%s prop err: %s\n", node, prop, fdt_strerror(ret));
+
+	return ret;
+}
+
+/* Checks front/rear id and remove unneeded nodes from the blob */
+static void ft_cleanup(void *blob, uint32_t id, const char *prop, const char *compatible)
+{
+	int off;
+
+	off = fdt_node_offset_by_compatible(blob, -1, compatible);
+
+	while (off != -FDT_ERR_NOTFOUND) {
+		const struct fdt_property *ids;
+		int nb_ids, idx;
+		int tmp = -1;
+
+		ids = fdt_get_property(blob, off, prop, &nb_ids);
+
+		for (idx = 0; idx < nb_ids; idx += 4) {
+			if (*((uint32_t *)&ids->data[idx]) == id)
+				break;
+		}
+
+		if (idx >= nb_ids)
+			fdt_del_node(blob, off);
+		else
+			tmp = off;
+
+		off = fdt_node_offset_by_compatible(blob, tmp, compatible);
+	}
+
+	fdt_set_node_and_value(blob, "/", prop, &id, sizeof(uint32_t));
+}
+
 int ft_board_setup(void *blob, struct bd_info *bd)
 {
+	u8 fav_id, far_id;
+
 	const char *sync = "receive";
 
 	ft_cpu_setup(blob, bd);
 
 	/* BRG */
-	do_fixup_by_path_u32(blob, "/soc/cpm", "brg-frequency",
-			     bd->bi_busfreq, 1);
+	do_fixup_by_path_u32(blob, "/soc/cpm", "brg-frequency", bd->bi_busfreq, 1);
+
 	/* MAC addr */
 	fdt_fixup_ethernet(blob);
 
@@ -67,8 +134,33 @@ int ft_board_setup(void *blob, struct bd_info *bd)
 	do_fixup_by_path_u32(blob, "/localbus/e1", "channel-phase", 0, 1);
 
 	/* E1 interface - rising edge sync pulse transmit */
-	do_fixup_by_path(blob, "/localbus/e1", "rising-edge-sync-pulse",
-			 sync, strlen(sync), 1);
+	do_fixup_by_path(blob, "/localbus/e1", "rising-edge-sync-pulse", sync, strlen(sync), 1);
+
+	/* MIAE only */
+	if (!(in_be16(ADDR_CPLD_R_ETAT) & R_ETAT_PRES_BASE) || in_8(ADDR_FPGA_R_BASE) != TYPE_MIAE)
+		return 0;
+
+	far_id = in_8(ADDR_FPGA_R_BASE + 0x43) >> 5;
+	ft_cleanup(blob, (u32)far_id, "far-id", "cs,mia-far");
+
+	/*
+	 * special case, with CASRSA (far_id: 2)
+	 * FAV-SRSA register itself as FAV-CLA
+	 */
+	fav_id = in_8(ADDR_FPGA_R_BASE + 0x44) >> 5;
+
+	if (far_id == FAR_CASRSA && fav_id == FAV_CLA)
+		fav_id = FAV_SRSA;
+
+	ft_cleanup(blob, (u32)fav_id, "fav-id", "cs,mia-fav");
+
+	if (far_id == FAR_CASRSA) {
+		/* switch to phy3 with gpio, we'll only use phy3 */
+		immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
+		cpm8xx_t __iomem *cp = (cpm8xx_t __iomem *)&immr->im_cpm;
+
+		setbits_be32(&cp->cp_pedat, 0x00002000);
+	}
 
 	return 0;
 }
@@ -80,8 +172,18 @@ int checkboard(void)
 	/* Is a motherboard present ? */
 	if (in_be16(ADDR_CPLD_R_ETAT) & R_ETAT_PRES_BASE) {
 		switch (in_8(ADDR_FPGA_R_BASE)) {
+			int far_id;
 		case TYPE_MCR:
 			printf("MCR3000_2G (CS GROUP)\n");
+			break;
+		case TYPE_MIAE:
+			far_id = in_8(ADDR_FPGA_R_BASE + 0x43) >> 5;
+
+			if (far_id == FAR_VGOIP)
+				printf("VGoIP (CS GROUP)\n");
+			else
+				printf("MIAE (CS GROUP)\n");
+
 			break;
 		default:
 			printf("Unknown\n");
@@ -149,7 +251,8 @@ static int setup_mac(void)
 
 int misc_init_r(void)
 {
-	u8 val;
+	u8 val, tmp, far_id;
+	int count = 3;
 
 	val = in_8(ADDR_FPGA_R_BASE);
 
@@ -165,6 +268,31 @@ int misc_init_r(void)
 			env_set("config", BOARD_MCR3000_2G);
 			env_set("hostname", BOARD_MCR3000_2G);
 			break;
+
+		case TYPE_MIAE:
+			do {
+				tmp = in_8(ADDR_FPGA_R_BASE + 0x41);
+				count--;
+				mdelay(10); /* 10msec wait */
+			} while (count && tmp != in_8(ADDR_FPGA_R_BASE + 0x41));
+
+			if (!count) {
+				printf("Cannot read the reset factory switch position\n");
+				hang();
+			}
+
+			if (tmp & 0x1)
+				env_set_default("Factory settings switch ON", 0);
+
+			env_set("config", BOARD_MIAE);
+			far_id = in_8(ADDR_FPGA_R_BASE + 0x43) >> 5;
+
+			if (far_id == FAR_VGOIP)
+				env_set("hostname", BOARD_VGOIP);
+			else
+				env_set("hostname", BOARD_MIAE);
+			break;
+
 		default:
 			env_set("config", BOARD_CMPC885);
 			env_set("hostname", BOARD_CMPC885);
@@ -488,6 +616,150 @@ static void iop_setup_cmpc885(void)
 	clrbits_be32(&cp->cp_peso, 0x00031980);
 }
 
+static void iop_setup_miae(void)
+{
+	immap_t __iomem *immr = (immap_t __iomem *)CONFIG_SYS_IMMR;
+	iop8xx_t __iomem *iop = &immr->im_ioport;
+	cpm8xx_t __iomem *cp = &immr->im_cpm;
+
+	/* Wait reset on FPGA_F */
+	udelay(100);
+
+	/* Set the front panel LED color to red */
+	clrbits_8(ADDR_FPGA_R_FAV, 0x02);
+
+	/* We must initialize data before changing direction */
+	setbits_be16(&iop->iop_pcdat, 0x0888);
+	setbits_be16(&iop->iop_pddat, 0x0201);
+	setbits_be32(&cp->cp_pbdat, 0x00021510);
+	setbits_be32(&cp->cp_pedat, 0x00000002);
+
+	/*
+	 * PAPAR[13] = 1 [0x0004] -> GPIO: (RXD2)
+	 * PAPAR[12] = 1 [0x0008] -> GPIO: (TXD2)
+	 * PAPAR[9]  = 1 [0x0040] -> GPIO: (TDM1O)
+	 * PAPAR[8]  = 1 [0x0080] -> GPIO: (TDM1I)
+	 * PAPAR[7]  = 1 [0x0100] -> GPIO: (TDM_BCLK_MPC)
+	 * PAPAR[6]  = 1 [0x0200] -> GPIO: (CLK2)
+	 */
+	setbits_be16(&iop->iop_papar, 0x03CC);
+
+	/*
+	 * PBODR[16] = 0 [0x00008000] -> GPIO: (L1ST4)
+	 */
+	clrbits_be16(&cp->cp_pbodr, 0x00008000);
+
+	/*
+	 * PBDIR[27] = 1 [0x00000010] -> GPIO: (WR_TEMP2)
+	 * PBDIR[26] = 1 [0x00000020] -> GPIO: (BRG02)
+	 * PBDIR[23] = 1 [0x00000100] -> GPIO: (CS_TEMP2)
+	 * PBDIR[18] = 1 [0x00002000] -> GPIO: (RTS2)
+	 * PBDIR[16] = 0 [0x00008000] -> GPIO: (L1ST4)
+	 * PBDIR[15] = 1 [0x00010000] -> GPIO: (BRG03)
+	 * PBDIR[14] = 1 [0x00020000] -> GPIO: (CS_TEMP)
+	 */
+	clrsetbits_be32(&cp->cp_pbdir, 0x0003A130, 0x00032130);
+
+	/*
+	 * PBPAR[20] = 1 [0x00000800] -> GPIO: (SMRXD2)
+	 * PBPAR[17] = 1 [0x00004000] -> GPIO: (L1ST3)
+	 * PBPAR[16] = 1 [0x00008000] -> GPIO: (L1ST4)
+	 */
+	setbits_be32(&cp->cp_pbpar, 0x0000C800);
+
+	/*
+	 * PCPAR[14] = 1 [0x0002] -> GPIO: (L1ST2)
+	 */
+	setbits_be16(&iop->iop_pcpar, 0x0002);
+
+	/*
+	 * PDPAR[14] = 1 [0x0002] -> GPIO: (TDM_FS_MPC)
+	 * PDPAR[11] = 1 [0x0010] -> GPIO: (RXD3)
+	 * PDPAR[10] = 1 [0x0020] -> GPIO: (TXD3)
+	 * PDPAR[9]  = 1 [0x0040] -> GPIO: (TXD4)
+	 * PDPAR[7]  = 1 [0x0100] -> GPIO: (RTS3)
+	 * PDPAR[5]  = 1 [0x0400] -> GPIO: (CLK8)
+	 * PDPAR[3]  = 1 [0x1000] -> GPIO: (CLK7)
+	 */
+	setbits_be16(&iop->iop_pdpar, 0x1572);
+
+	/*
+	 * PEPAR[27] = 1 [0x00000010] -> GPIO: (R2_RXER)
+	 * PEPAR[26] = 1 [0x00000020] -> GPIO: (R2_CRS_DV)
+	 * PEPAR[25] = 1 [0x00000040] -> GPIO: (RXD4)
+	 * PEPAR[24] = 1 [0x00000080] -> GPIO: (BRG01)
+	 * PEPAR[23] = 1 [0x00000100] -> GPIO: (L1ST1)
+	 * PEPAR[22] = 1 [0x00000200] -> GPIO: (R2_RXD1)
+	 * PEPAR[21] = 1 [0x00000400] -> GPIO: (R2_RXD0)
+	 * PEPAR[20] = 1 [0x00000800] -> GPIO: (SMTXD2)
+	 * PEPAR[19] = 1 [0x00001000] -> GPIO: (R2_TXEN)
+	 * PEPAR[17] = 1 [0x00004000] -> GPIO: (CLK5)
+	 * PEPAR[16] = 1 [0x00008000] -> GPIO: (R2_REF_CLK)
+	 * PEPAR[15] = 1 [0x00010000] -> GPIO: (R2_TXD1)
+	 * PEPAR[14] = 1 [0x00020000] -> GPIO: (R2_TXD0)
+	 */
+	setbits_be32(&cp->cp_pepar, 0x0003DFF0);
+
+	/*
+	 * PADIR[9]  = 1 [0x0040] -> GPIO: (TDM1O)
+	 * PADIR[8]  = 1 [0x0080] -> GPIO: (TDM1I)
+	 * PADIR[5]  = 0 [0x0400] -> GPIO: ()
+	 */
+	clrsetbits_be16(&iop->iop_padir, 0x04C0, 0x00C0);
+
+	/*
+	 * PCDIR[15] = 1 [0x0001] -> GPIO: (WP_EEPROM2)
+	 * PCDIR[14] = 1 [0x0002] -> GPIO: (L1ST2)
+	 * PCDIR[13] = 0 [0x0004] -> GPIO: ()
+	 * PCDIR[12] = 1 [0x0008] -> GPIO: (CS_EEPROM2)
+	 * PCDIR[8]  = 1 [0x0080] -> GPIO: (CS_CODEC_2)
+	 * PCDIR[4]  = 1 [0x0800] -> GPIO: (CS_CODEC_1)
+	 */
+	clrsetbits_be16(&iop->iop_pcdir, 0x088F, 0x088B);
+
+	/*
+	 * PDDIR[9]  = 1 [0x0040] -> GPIO: (TXD4)
+	 * PDDIR[6]  = 1 [0x0200] -> GPIO: (CS_CODEC_3)
+	 */
+	setbits_be16(&iop->iop_pddir, 0x0240);
+
+	/*
+	 * PEDIR[30] = 1 [0x00000002] -> GPIO: (FPGA_FIRMWARE)
+	 * PEDIR[27] = 1 [0x00000010] -> GPIO: (R2_RXER)
+	 * PEDIR[26] = 1 [0x00000020] -> GPIO: (R2_CRS_DV)
+	 * PEDIR[23] = 1 [0x00000100] -> GPIO: (L1ST1)
+	 * PEDIR[22] = 1 [0x00000200] -> GPIO: (R2_RXD1)
+	 * PEDIR[21] = 1 [0x00000400] -> GPIO: (R2_RXD0)
+	 * PEDIR[19] = 1 [0x00001000] -> GPIO: (R2_TXEN)
+	 * PEDIR[18] = 1 [0x00002000] -> GPIO: (PE18)
+	 * PEDIR[16] = 1 [0x00008000] -> GPIO: (R2_REF_CLK)
+	 * PEDIR[15] = 1 [0x00010000] -> GPIO: (R2_TXD1)
+	 * PEDIR[14] = 1 [0x00020000] -> GPIO: (R2_TXD0)
+	 */
+	setbits_be32(&cp->cp_pedir, 0x0003B732);
+
+	/*
+	 * PAODR[10] = 1 [0x0020] -> GPIO: (INIT_FPGA_F)
+	 */
+	setbits_be16(&iop->iop_paodr, 0x0020);
+
+	/*
+	 * PEODR[30] = 1 [0x00000002] -> GPIO: (FPGA_FIRMWARE)
+	 * PEODR[18] = 0 [0x00002000] -> GPIO: (PE18)
+	 */
+	clrsetbits_be32(&cp->cp_peodr, 0x00002002, 0x00000002);
+
+	/*
+	 * PESO[24] = 1 [0x00000080] -> GPIO: (BRG01)
+	 * PESO[23] = 1 [0x00000100] -> GPIO: (L1ST1)
+	 * PESO[20] = 1 [0x00000800] -> GPIO: (SMTXD2)
+	 * PESO[19] = 1 [0x00001000] -> GPIO: (R2_TXEN)
+	 * PESO[15] = 1 [0x00010000] -> GPIO: (R2_TXD1)
+	 * PESO[14] = 1 [0x00020000] -> GPIO: (R2_TXD0)
+	 */
+	setbits_be32(&cp->cp_peso, 0x00031980);
+}
+
 int board_early_init_f(void)
 {
 	return 0;
@@ -818,6 +1090,10 @@ int board_early_init_r(void)
 			iop_setup_mcr();
 			break;
 
+		case TYPE_MIAE:
+			iop_setup_miae();
+			break;
+
 		default:
 			break;
 		}
Signature · 1 line
2.38.1