Skip to contentSkip to conversation

ARM: socfpga: Add initial support for the ABB SECU board

PATCH Superseded Marek Vasut 2 participants 3 messages Feb 19, 2020 – Mar 4, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 ARM: socfpga: Add initial support for the ABB SECU board

From: Holger Brunck <[email protected]>

Add initial support for the ABB SECU board, which is an ArriaV-based SoCFPGA system with ethernet and booting from Denali NAND.

Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>

---
V2: Use CONFIG_SYS_I2C_EEPROM_ADDR in printf() in ivm.c
Enable CONFIG_SYS_NAND_USE_FLASH_BBT

---
 arch/arm/dts/Makefile                   |   1 +
 arch/arm/dts/socfpga_arria5_secu1.dts   | 130 +++++
 arch/arm/mach-socfpga/Kconfig           |  10 +
 board/keymile/Kconfig                   |  11 +-
 board/keymile/common/ivm.c              |  19 +-
 board/keymile/secu1/Makefile            |   7 +
 board/keymile/secu1/qts/iocsr_config.h  | 694 ++++++++++++++++++++++++
 board/keymile/secu1/qts/pinmux_config.h | 218 ++++++++
 board/keymile/secu1/qts/pll_config.h    |  83 +++
 board/keymile/secu1/qts/sdram_config.h  | 327 +++++++++++
 board/keymile/secu1/socfpga.c           |  67 +++
 configs/socfpga_secu1_defconfig         |  84 +++
 include/configs/socfpga_arria5_secu1.h  | 131 +++++
 13 files changed, 1778 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_arria5_secu1.dts
 create mode 100644 board/keymile/secu1/Makefile
 create mode 100644 board/keymile/secu1/qts/iocsr_config.h
 create mode 100644 board/keymile/secu1/qts/pinmux_config.h
 create mode 100644 board/keymile/secu1/qts/pll_config.h
 create mode 100644 board/keymile/secu1/qts/sdram_config.h
 create mode 100644 board/keymile/secu1/socfpga.c
 create mode 100644 configs/socfpga_secu1_defconfig
 create mode 100644 include/configs/socfpga_arria5_secu1.h
arch/arm/dts/Makefile +1 -0
index be4cf029d0..9c593b2c98 100644
@@ -333,6 +333,7 @@ dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_agilex_socdk.dtb			\
+	socfpga_arria5_secu1.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_socdk_sdmmc.dtb			\
 	socfpga_cyclone5_mcvevk.dtb			\
arch/arm/dts/socfpga_arria5_secu1.dts new file +130 -0

130 lines not on this page · raw message

arch/arm/mach-socfpga/Kconfig +10 -0
index 969698c83f..38d6c1b2ba 100644
@@ -96,6 +96,11 @@ config TARGET_SOCFPGA_ARRIA10_SOCDK
 	bool "Altera SOCFPGA SoCDK (Arria 10)"
 	select TARGET_SOCFPGA_ARRIA10
 
+config TARGET_SOCFPGA_ARRIA5_SECU1
+	bool "ABB SECU1 (Arria V)"
+	select TARGET_SOCFPGA_ARRIA5
+	select VENDOR_KM
+
 config TARGET_SOCFPGA_ARRIA5_SOCDK
 	bool "Altera SOCFPGA SoCDK (Arria V)"
 	select TARGET_SOCFPGA_ARRIA5
@@ -158,6 +163,7 @@ config SYS_BOARD
 	default "de10-nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
 	default "is1" if TARGET_SOCFPGA_IS1
 	default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
+	default "secu1" if TARGET_SOCFPGA_ARRIA5_SECU1
 	default "sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
 	default "socrates" if TARGET_SOCFPGA_EBV_SOCRATES
 	default "sr1500" if TARGET_SOCFPGA_SR1500
@@ -173,6 +179,7 @@ config SYS_VENDOR
 	default "aries" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "devboards" if TARGET_SOCFPGA_DEVBOARDS_DBM_SOC1
 	default "ebv" if TARGET_SOCFPGA_EBV_SOCRATES
+	default "keymile" if TARGET_SOCFPGA_ARRIA5_SECU1
 	default "softing" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "terasic" if TARGET_SOCFPGA_TERASIC_DE1_SOC
@@ -184,6 +191,7 @@ config SYS_SOC
 
 config SYS_CONFIG_NAME
 	default "socfpga_agilex_socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
+	default "socfpga_arria5_secu1" if TARGET_SOCFPGA_ARRIA5_SECU1
 	default "socfpga_arria5_socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "socfpga_arria10_socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "socfpga_cyclone5_socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -199,4 +207,6 @@ config SYS_CONFIG_NAME
 	default "socfpga_stratix10_socdk" if TARGET_SOCFPGA_STRATIX10_SOCDK
 	default "socfpga_vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
 
+source "board/keymile/Kconfig"
+
 endif
board/keymile/Kconfig +8 -3
index 634dbbe097..7f4cad86aa 100644
@@ -14,6 +14,7 @@ menu "KM Board Setup"
 config KM_PNVRAM
 	hex "Pseudo RAM"
 	default 0x80000
+	depends on !ARCH_SOCFPGA
 	help
 	  Start address of the pseudo non-volatile RAM for application.
 
@@ -21,6 +22,7 @@ config KM_PHRAM
 	hex "Physical RAM"
 	default 0x17F000 if ARM
 	default 0x100000 if PPC
+	depends on !ARCH_SOCFPGA
 	help
 	  Start address of the physical RAM, which is the mounted /var folder.
 
@@ -29,6 +31,7 @@ config KM_RESERVED_PRAM
 	default 0x801000 if KIRKWOOD
 	default 0x0 if MPC83xx
 	default 0x1000 if MPC85xx
+	depends on !ARCH_SOCFPGA
 	help
 	  Reserved physical RAM area at the end of memory for special purposes.
 
@@ -37,6 +40,7 @@ config KM_CRAMFS_ADDR
 	default 0x2400000 if KIRKWOOD
 	default 0xC00000 if MPC83xx
 	default 0x2000000 if MPC85xx
+	depends on !ARCH_SOCFPGA
 	help
 	  Start address of the CRAMFS containing the Linux kernel.
 
@@ -44,13 +48,13 @@ config KM_KERNEL_ADDR
 	hex "Kernel Load Address"
 	default 0x2000000 if KIRKWOOD
 	default 0x400000 if MPC83xx
-	default 0x1000000 if MPC85xx
+	default 0x1000000 if MPC85xx || ARCH_SOCFPGA
 	help
 	  Address where to load Linux kernel in RAM.
 
 config KM_FDT_ADDR
 	hex "FDT Load Address"
-	default 0x23E0000 if KIRKWOOD
+	default 0x23E0000 if KIRKWOOD || ARCH_SOCFPGA
 	default 0xB80000 if MPC83xx
 	default 0x1F80000 if MPC85xx
 	help
@@ -71,7 +75,7 @@ config KM_DEF_NETDEV
 config KM_COMMON_ETH_INIT
 	bool "Common Ethernet Initialization"
 	default y if KIRKWOOD || MPC83xx
-	default n if MPC85xx
+	default n if MPC85xx || ARCH_SOCFPGA
 	help
 	  Use the Ethernet initialization implemented in common code, which
 	  detects if a Piggy board is present.
@@ -91,6 +95,7 @@ config KM_MVEXTSW_ADDR
 
 config KM_IVM_BUS
 	int "IVM I2C Bus"
+	default 0 if ARCH_SOCFPGA
 	default 1 if KIRKWOOD || MPC85xx
 	default 2 if MPC83xx
 	help
board/keymile/common/ivm.c +18 -1
index fee7f03c8c..60b89fe348 100644
@@ -328,7 +328,24 @@ static int ivm_populate_env(unsigned char *buf, int len, int mac_address_offset)
 int ivm_read_eeprom(unsigned char *buf, int len, int mac_address_offset)
 {
 	int ret;
+#ifdef CONFIG_DM_I2C
+	struct udevice *eedev = NULL;
+
+	ret = i2c_get_chip_for_busnum(CONFIG_KM_IVM_BUS,
+				      CONFIG_SYS_I2C_EEPROM_ADDR, 1, &eedev);
+	if (ret) {
+		printf("failed to get device for EEPROM at address 0x%02x\n",
+		       CONFIG_SYS_I2C_EEPROM_ADDR);
+		return 1;
+	}
 
+	ret = dm_i2c_read(eedev, 0, buf, len);
+	if (ret != 0) {
+		printf("Error: Unable to read from I2C EEPROM at address %02X:%02X\n",
+		       CONFIG_SYS_I2C_EEPROM_ADDR, 0);
+		return 1;
+	}
+#else
 	i2c_set_bus_num(CONFIG_KM_IVM_BUS);
 	/* add deblocking here */
 	i2c_make_abort();
@@ -338,6 +355,6 @@ int ivm_read_eeprom(unsigned char *buf, int len, int mac_address_offset)
 		printf("Error reading EEprom\n");
 		return -2;
 	}
-
+#endif
 	return ivm_populate_env(buf, len, mac_address_offset);
 }
board/keymile/secu1/Makefile new file +7 -0
new file mode 100644
index 0000000000..4704d59e48
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2020 ABB
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	:= socfpga.o ../common/ivm.o
board/keymile/secu1/qts/iocsr_config.h new file +694 -0

694 lines not on this page · raw message

board/keymile/secu1/qts/pinmux_config.h new file +218 -0

218 lines not on this page · raw message

board/keymile/secu1/qts/pll_config.h new file +83 -0

83 lines not on this page · raw message

board/keymile/secu1/qts/sdram_config.h new file +327 -0

327 lines not on this page · raw message

board/keymile/secu1/socfpga.c new file +67 -0

67 lines not on this page · raw message

configs/socfpga_secu1_defconfig new file +84 -0

84 lines not on this page · raw message

include/configs/socfpga_arria5_secu1.h new file +131 -0

131 lines not on this page · raw message

Signature · 1 line
2.24.1
#1 lore raw

PATCH v2 1/1 ARM: socfpga: Add initial support for the ABB SECU board

Quoted 11 lines · Marek Vasut

From: Holger Brunck <[email protected]>

Add initial support for the ABB SECU board, which is an ArriaV-based SoCFPGA system with ethernet and booting from Denali NAND.

Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>

---
V2: Use CONFIG_SYS_I2C_EEPROM_ADDR in printf() in ivm.c
Enable CONFIG_SYS_NAND_USE_FLASH_BBT

Quoted 14 lines
---
 arch/arm/dts/Makefile                   |   1 +
 arch/arm/dts/socfpga_arria5_secu1.dts   | 130 +++++
 arch/arm/mach-socfpga/Kconfig           |  10 +
 board/keymile/Kconfig                   |  11 +-
 board/keymile/common/ivm.c              |  19 +-
 board/keymile/secu1/Makefile            |   7 +
 board/keymile/secu1/qts/iocsr_config.h  | 694 ++++++++++++++++++++++++
 board/keymile/secu1/qts/pinmux_config.h | 218 ++++++++
 board/keymile/secu1/qts/pll_config.h    |  83 +++
 board/keymile/secu1/qts/sdram_config.h  | 327 +++++++++++
 board/keymile/secu1/socfpga.c           |  67 +++
 configs/socfpga_secu1_defconfig         |  84 +++
 include/configs/socfpga_arria5_secu1.h  | 131 +++++

So, this is missing MAINTAINERS file. I will just manually add it:

$ cat board/keymile/secu1/MAINTAINERS
ABB SECU1 BOARD
M:      Holger Brunck <[email protected]>
S:      Maintained
F:      include/configs/socfpga_arria5_secu1.h
F:      configs/socfpga_secu1_defconfig

is that OK ?

#2 lore raw

PATCH v2 1/1 ARM: socfpga: Add initial support for the ABB SECU board

Quoted 30 lines · Marek Vasut
Quoted 19 lines

From: Holger Brunck <[email protected]>

Add initial support for the ABB SECU board, which is an ArriaV-based SoCFPGA system with ethernet and booting from Denali NAND.

Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>

---
V2: Use CONFIG_SYS_I2C_EEPROM_ADDR in printf() in ivm.c
Enable CONFIG_SYS_NAND_USE_FLASH_BBT

---
 arch/arm/dts/Makefile                   |   1 +
 arch/arm/dts/socfpga_arria5_secu1.dts   | 130 +++++
 arch/arm/mach-socfpga/Kconfig           |  10 +
 board/keymile/Kconfig                   |  11 +-
 board/keymile/common/ivm.c              |  19 +-
 board/keymile/secu1/Makefile            |   7 +
 board/keymile/secu1/qts/iocsr_config.h  | 694
Quoted 1 line

++++++++++++++++++++++++ board/keymile/secu1/qts/pinmux_config.h |

218 ++++++++

Quoted 5 lines
 board/keymile/secu1/qts/pll_config.h    |  83 +++
 board/keymile/secu1/qts/sdram_config.h  | 327 +++++++++++
 board/keymile/secu1/socfpga.c           |  67 +++
 configs/socfpga_secu1_defconfig         |  84 +++
 include/configs/socfpga_arria5_secu1.h  | 131 +++++

So, this is missing MAINTAINERS file. I will just manually add it:

Quoted 8 lines
$ cat board/keymile/secu1/MAINTAINERS
ABB SECU1 BOARD
M:      Holger Brunck <[email protected]>
S:      Maintained
F:      include/configs/socfpga_arria5_secu1.h
F:      configs/socfpga_secu1_defconfig

is that OK ?

yes, thank you.

Best regards
Holger