add support for Enclustra Mercury AA1 SoMs
v5 cover add support for Enclustra Mercury AA1 SoMs
Introduce the support for three variants of Enclustra's Intel Mercury AA1 (with Intel Arria10) SoMs and additional configs.
The DT approach is partly based on dts/upstream, which are (going to be) upstreamed to the linux kernel.
---
v4 -> v5:
- exclude typo / wording fixes for binman.rst, gdb.rst and binman/entries.rst
- implicitely builds using binman
v3 -> v4:
- fix wrong mail address in v2 and author
- update scripts for stdboot and generic load
- clean up patch organization (patch 7/10 was malformed and almost empty, added and removed stances,..)
- fix binding used for "enclustra,altera_set_storage"
- separate u-boot specific part of .dts to a socfpga_arria10_mercury_aa1-u-boot.dtsi file
- integrate fpga.itb build with binman in the -u-boot.dtsi file note:
1. due to binman, now the build will need binman build (i.e. requirements) and is build then with "make NO_PYTHON=1"
2. the fpga bitstream files bitstream.core.rbf and bitstream.periph.rbf are generated by a particular Quartus design, so they can't be committed here. This makes the build fail, if build with binman.
For testing, thus build with
"make CONFIG_BINMAN=n"
- fix some typos in binman and gdb documentation (additional patch)
v2 -> v3:
- update of DT concept to work with dts/upstream
- update of DT parts in arch/arm/dts, because of:
-- the handoff initialization of the Arria10 SoC
-- the fpga loader for the bitstream in the DTS
-- the adjustments to access the boot media, from where to load the fpga.itb -- and to mux media for booting, e.g. QSPI off, when booting from MMC
- implementation of kconfig options to combine SoM .dtsi file, carrier board .dtsi files, boot-mode parts, and so on resulting in a single .dts file located in arch/arm/dts because of the above mentioned reasons
- adjustents to (better) satisfy dtb checks
- updated MAINTAINERS
- updated documentation
- update to use standard boot and environment as only environment, removal of explicit variables and environment files
- removal of duplicate codes
- cleanup and implement altera_set_storage (boot media switch command in u-boot shell) based on DM
- fix spansion flash access to allow flashing from off the u-boot shell, this patch was already presented separately, the fix is actively needed for the AA1 SoM
- sort lists in several files alfabetically
- update boot commands using && instead of ;
v1 -> v2:
- removal si5338 driver
- removal si5338 driver usage
- rename .c file for the boot cmd, build conditionally
- add separate .c file for late boot init to read MAC address from eeprom
- keep DT approach for u-boot under discussion
- fix issues in doc
- update MAINTAINERS to cover doc
---
Lothar Rubusch (10):
doc: board: enclustra: add Enclustra Mercury+ AA1
ARM: socfpga: add Mercury+ AA1 SoM support
ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
ARM: socfpga: add Enclustra storage switch
ARM: socfpga: add Mercury+ AA1 boot scripts
ARM: socfpga: AA1: support MAC from secure eeprom
misc: atsha204a: update kconfig description
ARM: dts: arria10: update according to DTSpec
ARM: socfpga: update function call to modern API
ARM: socfpga: apply binman approach to fpga parts
arch/arm/dts/socfpga_arria10.dtsi | 42 ++- ..._arria10_enclustra_mercury_aa1-u-boot.dtsi | 89 +++++ .../socfpga_arria10_enclustra_mercury_aa1.dts | 62 ++++ .../socfpga_arria10_mercury_aa1-u-boot.dtsi | 19 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 305 ++++++++++++++++++ arch/arm/mach-socfpga/Kconfig | 10 + arch/arm/mach-socfpga/misc_arria10.c | 2 - board/enclustra/bootscripts/qspi-aa1.cmd | 12 + board/enclustra/bootscripts/sd-aa1.cmd | 9 + board/enclustra/common/Kconfig | 25 ++ board/enclustra/common/Makefile | 7 + board/enclustra/common/enclustra_mac.h | 48 +++ board/enclustra/common/mac_atsha204.c | 102 ++++++ board/enclustra/common/mac_common.c | 52 +++ board/enclustra/common/mac_ds28.c | 93 ++++++ board/enclustra/mercury_aa1/Kconfig | 52 +++ board/enclustra/mercury_aa1/MAINTAINERS | 12 + board/enclustra/mercury_aa1/Makefile | 10 + .../mercury_aa1/aa1_board_late_init.c | 17 + .../mercury_aa1/aa1_set_storage_cmd.c | 190 +++++++++++ .../socfpga_enclustra_mercury_aa1_defconfig | 86 +++++ doc/board/enclustra/index.rst | 9 + doc/board/enclustra/mercury-aa1.rst | 230 +++++++++++++ doc/board/index.rst | 1 + drivers/misc/Kconfig | 2 +- include/configs/socfpga_mercury_aa1.h | 23 ++ 26 files changed, 1497 insertions(+), 12 deletions(-) create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h create mode 100644 board/enclustra/bootscripts/qspi-aa1.cmd create mode 100644 board/enclustra/bootscripts/sd-aa1.cmd create mode 100644 board/enclustra/common/Kconfig create mode 100644 board/enclustra/common/Makefile create mode 100644 board/enclustra/common/enclustra_mac.h create mode 100644 board/enclustra/common/mac_atsha204.c create mode 100644 board/enclustra/common/mac_common.c create mode 100644 board/enclustra/common/mac_ds28.c create mode 100644 board/enclustra/mercury_aa1/Kconfig create mode 100644 board/enclustra/mercury_aa1/MAINTAINERS create mode 100644 board/enclustra/mercury_aa1/Makefile create mode 100644 board/enclustra/mercury_aa1/aa1_board_late_init.c create mode 100644 board/enclustra/mercury_aa1/aa1_set_storage_cmd.c create mode 100644 configs/socfpga_enclustra_mercury_aa1_defconfig create mode 100644 doc/board/enclustra/index.rst create mode 100644 doc/board/enclustra/mercury-aa1.rst create mode 100644 include/configs/socfpga_mercury_aa1.h
Signature · 1 line
2.39.2
PATCH v5 1/10 doc: board: enclustra: add Enclustra Mercury+ AA1
Start documentation section for Enclustra. Cover Enclustra Intel SoMs and related carrier board setups. The section covers the Mercury+ AA1 SoM (Intel/arria10).
--- doc/board/enclustra/index.rst | 9 ++ doc/board/enclustra/mercury-aa1.rst | 202 ++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 3 files changed, 212 insertions(+) create mode 100644 doc/board/enclustra/index.rst create mode 100644 doc/board/enclustra/mercury-aa1.rst
doc/board/enclustra/index.rst new file +9 -0
@@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Enclustra +========= + +.. toctree:: + :maxdepth: 2 + + mercury-aa1
doc/board/enclustra/mercury-aa1.rst new file +202 -0
202 lines not on this page · raw message
doc/board/index.rst +1 -0
@@ -25,6 +25,7 @@ Board-specific doc congatec/index coreboot/index emulation/index + enclustra/index gateworks/index google/index highbank/index
Signature · 1 line
2.39.2
PATCH v5 2/10 ARM: socfpga: add Mercury+ AA1 SoM support
In reply to Lothar RubuschIntroduce support for the Enclustra SoMs: Mercury+ AA1 (Intel/Arria10)
Cover general board files for SD/MMC and QSPI boot modes. Integrate the boards to kconfig. All build variants will depend on Quartus handoff files, thus they depend on the particular Quartus design. The approach is covered in the according documentation part.
Additionally add configuration for SD/MMC boot and QSPI bootmodes. Register additional targets in kconfig.
--- arch/arm/mach-socfpga/Kconfig | 9 ++ board/enclustra/common/Makefile | 4 + board/enclustra/mercury_aa1/Kconfig | 15 ++++ board/enclustra/mercury_aa1/MAINTAINERS | 10 +++ board/enclustra/mercury_aa1/fpga.its | 32 +++++++ .../socfpga_enclustra_mercury_aa1_defconfig | 85 +++++++++++++++++++ include/configs/socfpga_mercury_aa1.h | 23 +++++ 7 files changed, 178 insertions(+) create mode 100644 board/enclustra/common/Makefile create mode 100644 board/enclustra/mercury_aa1/Kconfig create mode 100644 board/enclustra/mercury_aa1/MAINTAINERS create mode 100644 board/enclustra/mercury_aa1/fpga.its create mode 100644 configs/socfpga_enclustra_mercury_aa1_defconfig create mode 100644 include/configs/socfpga_mercury_aa1.h
arch/arm/mach-socfpga/Kconfig +9 -0
@@ -184,6 +184,10 @@ config TARGET_SOCFPGA_EBV_SOCRATES bool "EBV SoCrates (Cyclone V)" select TARGET_SOCFPGA_CYCLONE5 +config TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + bool "Enclustra Mercury+ AA1" + select TARGET_SOCFPGA_ARRIA10 + config TARGET_SOCFPGA_IS1 bool "IS1 (Cyclone V)" select TARGET_SOCFPGA_CYCLONE5
@@ -237,6 +241,7 @@ config SYS_BOARD default "de10-standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD default "is1" if TARGET_SOCFPGA_IS1 default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK + default "mercury_aa1" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 default "n5x-socdk" if TARGET_SOCFPGA_N5X_SOCDK default "secu1" if TARGET_SOCFPGA_ARRIA5_SECU1 default "sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
@@ -256,6 +261,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 "enclustra" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 default "google" if TARGET_SOCFPGA_CHAMELEONV3 default "keymile" if TARGET_SOCFPGA_ARRIA5_SECU1 default "softing" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
@@ -283,6 +289,7 @@ config SYS_CONFIG_NAME default "socfpga_de10_standard" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD default "socfpga_is1" if TARGET_SOCFPGA_IS1 default "socfpga_mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK + default "socfpga_mercury_aa1" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 default "socfpga_n5x_socdk" if TARGET_SOCFPGA_N5X_SOCDK default "socfpga_sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT default "socfpga_socrates" if TARGET_SOCFPGA_EBV_SOCRATES
@@ -290,4 +297,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/enclustra/mercury_aa1/Kconfig" + endif
board/enclustra/common/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2024 Enclustra GmbH + +# Common for several Enclustra modules
board/enclustra/mercury_aa1/Kconfig new file +15 -0
@@ -0,0 +1,15 @@ +if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + +config SYS_CPU + default "armv7" + +config SYS_BOARD + default "mercury_aa1" + +config SYS_VENDOR + default "enclustra" + +config SYS_CONFIG_NAME + default "socfpga_mercury_aa1" + +endif
board/enclustra/mercury_aa1/MAINTAINERS new file +10 -0
@@ -0,0 +1,10 @@ +Enclustra Mercury+ AA1 +M: Lothar Rubusch <[email protected]> +S: Maintained +N: board/enclustra/mercury_aa1/ +N: board/enclustra/common/ +N: configs/socfpga_enclustra_mercury_aa1_defconfig +N: doc/board/enclustra/mercury-aa1.rst +N: include/configs/socfpga_mercury_aa1.h +N: enclustra +N: mercury_aa1
board/enclustra/mercury_aa1/fpga.its new file +32 -0
@@ -0,0 +1,32 @@ +/dts-v1/; + +/ { + description = "FIT image with FPGA bistream"; + #address-cells = <1>; + + images { + fpga-periph-1 { + description = "FPGA peripheral bitstream"; + data = /incbin/("../../../bitstream.periph.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + + fpga-core-1 { + description = "FPGA core bitstream"; + data = /incbin/("../../../bitstream.core.rbf"); + type = "fpga"; + arch = "arm"; + compression = "none"; + }; + }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; +};
configs/socfpga_enclustra_mercury_aa1_defconfig new file +85 -0
85 lines not on this page · raw message
include/configs/socfpga_mercury_aa1.h new file +23 -0
@@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#ifndef __CONFIG_SOCFGPA_MERCURY_AA1_H__ +#define __CONFIG_SOCFGPA_MERCURY_AA1_H__ + +#include <asm/arch/base_addr_a10.h> + +/* +* U-Boot general configurations +*/ + +/* Memory configurations */ +#define PHYS_SDRAM_1_SIZE 0x80000000 + +/* The rest of the configuration is shared */ +#include <configs/socfpga_common.h> +#include <config_distro_bootcmd.h> + +#endif /* __CONFIG_SOCFGPA_MERCURY_AA1_H__ */
Signature · 1 line
2.39.2
PATCH v5 3/10 ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
In reply to Lothar RubuschIntroduce u-boot specific device-tree files for Enclustra Mercury+ AA1 SoMs (Intel/arria10).
Generic device-tree fragments for linux and U-boot shall be provided in dts/upstream. The selection of the generic device-tree fragments depends on a selected boot-mode and a selected carrier board.
On Intel/Arria10 a handoff setup is needed for initialization of various clock / pinmux / DRAM settings only used by U-Boot provided by the current patch.
--- ..._arria10_enclustra_mercury_aa1-u-boot.dtsi | 45 +++ .../socfpga_arria10_enclustra_mercury_aa1.dts | 45 +++ .../socfpga_arria10_mercury_aa1-u-boot.dtsi | 19 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 305 ++++++++++++++++++ board/enclustra/mercury_aa1/Kconfig | 37 +++ board/enclustra/mercury_aa1/MAINTAINERS | 2 + 6 files changed, 453 insertions(+) create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi new file +45 -0
@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Lothar Rubusch <[email protected]> + */ + +/* Arria10 handoff (u-boot) */ +#include "socfpga_arria10_mercury_aa1_handoff.h" +#include "socfpga_arria10-handoff.dtsi" +#include "socfpga_arria10_handoff_u-boot.dtsi" +#include "socfpga_arria10_mercury_aa1-u-boot.dtsi" + +/* Specific boot-mode (u-boot) */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_SDMMC) || IS_ENABLED(CONFIG_ENCLUSTRA_EMMC) + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + phandlepart = <&mmc 1>; + }; +}; + +&fpga_mgr { + bootph-all; + firmware-loader = <&fs_loader0>; + altr,bitstream = "fpga.itb"; +}; + +#elif IS_ENABLED(CONFIG_ENCLUSTRA_QSPI) + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + sfconfig = <0 0 50000000 3>; + }; +}; + +&fpga_mgr { + bootph-all; + firmware-loader = <&fs_loader0>; + altr,bitstream = "300000"; +}; + +#endif
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +45 -0
45 lines not on this page · raw message
arch/arm/dts/socfpga_arria10_mercury_aa1-u-boot.dtsi +19 -0
@@ -33,6 +33,21 @@ bootph-all; }; +&l4_main_clk { + bootph-all; +}; + +&qspi_clk { + bootph-all; +}; + +&qspi { + bootph-all; + flash0: s25fl512s@0 { + bootph-all; + }; +}; + &mmc { bootph-all; };
@@ -52,3 +67,7 @@ &uart1 { bootph-all; }; + +&watchdog1 { + bootph-all; +};
arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h new file +305 -0
305 lines not on this page · raw message
board/enclustra/mercury_aa1/Kconfig +37 -0
@@ -12,4 +12,41 @@ config SYS_VENDOR config SYS_CONFIG_NAME default "socfpga_mercury_aa1" +choice + prompt "Mercury+ AA1 base-board" + default ENCLUSTRA_PE1 + help + Select the base-board for Mercury+ AA1. + +config ENCLUSTRA_PE1 + bool "Mercury+ PE1" + +config ENCLUSTRA_PE3 + bool "Mercury+ PE3" + +config ENCLUSTRA_ST1 + bool "Mercury+ ST1" + +config ENCLUSTRA_CUSTOM_BASE + bool "Customized base-board" + +endchoice + +choice + prompt "Mercury+ AA1 boot-mode" + default ENCLUSTRA_SDMMC + help + Select the boot-mode for the Mercury+ AA1 setup. + +config ENCLUSTRA_SDMMC + bool "SD card" + +config ENCLUSTRA_EMMC + bool "eMMC" + +config ENCLUSTRA_QSPI + bool "QSPI flash" + +endchoice + endif
board/enclustra/mercury_aa1/MAINTAINERS +2 -0
@@ -1,6 +1,8 @@ Enclustra Mercury+ AA1 M: Lothar Rubusch <[email protected]> S: Maintained +N: arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts +N: arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h N: board/enclustra/mercury_aa1/ N: board/enclustra/common/ N: configs/socfpga_enclustra_mercury_aa1_defconfig
Signature · 1 line
2.39.2
RE: [PATCH v4 v5 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
Hi,
Quoted 72 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Lothar Rubusch <[email protected]>
Sent: Wednesday, November 20, 2024 6:47 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH v4 v5 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u- boot dtsIntroduce u-boot specific device-tree files for Enclustra Mercury+ AA1 SoMs (Intel/arria10).
Generic device-tree fragments for linux and U-boot shall be provided in dts/upstream. The selection of the generic device-tree fragments depends on a selected boot-mode and a selected carrier board.
On Intel/Arria10 a handoff setup is needed for initialization of various clock / pinmux / DRAM settings only used by U-Boot provided by the current patch.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>--- ..._arria10_enclustra_mercury_aa1-u-boot.dtsi | 45 +++ .../socfpga_arria10_enclustra_mercury_aa1.dts | 45 +++ .../socfpga_arria10_mercury_aa1-u-boot.dtsi | 19 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 305 ++++++++++++++++++ board/enclustra/mercury_aa1/Kconfig | 37 +++ board/enclustra/mercury_aa1/MAINTAINERS | 2 + 6 files changed, 453 insertions(+) create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1- u-boot.dtsi create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h(quoted diff) +0
-0
boot.dtsib/arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi
new file mode 100644
index 0000000000..6e38286572arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi new file +25
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Lothar Rubusch <[email protected]> */ + +/* Arria10 handoff (u-boot) */ +#include "socfpga_arria10_mercury_aa1_handoff.h" +#include "socfpga_arria10-handoff.dtsi" +#include "socfpga_arria10_handoff_u-boot.dtsi" +#include "socfpga_arria10_mercury_aa1-u-boot.dtsi" + +/* Specific boot-mode (u-boot) */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_SDMMC) || +IS_ENABLED(CONFIG_ENCLUSTRA_EMMC) + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + phandlepart = <&mmc 1>; + }; +}; + +&fpga_mgr { + bootph-all; + firmware-loader = <&fs_loader0>;
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi line 35
Quoted 10 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi new file +10
-0+ altr,bitstream = "fpga.itb"; +}; + +#elif IS_ENABLED(CONFIG_ENCLUSTRA_QSPI) + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + sfconfig = <0 0 50000000 3>;
The RAW read implementation for fs_loader is not upstream yet, I afraid this might not working, you want help to upstream?
[...]
Best regards,
TF
Re: [PATCH v4 v5 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
Quoted 79 lines · Tien Fong
Hi,
Quoted 76 lines
-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Lothar Rubusch <[email protected]>
Sent: Wednesday, November 20, 2024 6:47 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [PATCH v4 v5 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u- boot dtsIntroduce u-boot specific device-tree files for Enclustra Mercury+ AA1 SoMs (Intel/arria10).
Generic device-tree fragments for linux and U-boot shall be provided in dts/upstream. The selection of the generic device-tree fragments depends on a selected boot-mode and a selected carrier board.
On Intel/Arria10 a handoff setup is needed for initialization of various clock / pinmux / DRAM settings only used by U-Boot provided by the current patch.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>--- ..._arria10_enclustra_mercury_aa1-u-boot.dtsi | 45 +++ .../socfpga_arria10_enclustra_mercury_aa1.dts | 45 +++ .../socfpga_arria10_mercury_aa1-u-boot.dtsi | 19 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 305 ++++++++++++++++++ board/enclustra/mercury_aa1/Kconfig | 37 +++ board/enclustra/mercury_aa1/MAINTAINERS | 2 + 6 files changed, 453 insertions(+) create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1- u-boot.dtsi create mode 100644 arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h(quoted diff) +0
-0
boot.dtsib/arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi
new file mode 100644
index 0000000000..6e38286572arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi new file +29
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Lothar Rubusch <[email protected]> */ + +/* Arria10 handoff (u-boot) */ +#include "socfpga_arria10_mercury_aa1_handoff.h" +#include "socfpga_arria10-handoff.dtsi" +#include "socfpga_arria10_handoff_u-boot.dtsi" +#include "socfpga_arria10_mercury_aa1-u-boot.dtsi" + +/* Specific boot-mode (u-boot) */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_SDMMC) || +IS_ENABLED(CONFIG_ENCLUSTRA_EMMC) + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + phandlepart = <&mmc 1>; + }; +}; + +&fpga_mgr { + bootph-all; + firmware-loader = <&fs_loader0>; + altr,bitstream = "fpga.itb"; +}; + +#elif IS_ENABLED(CONFIG_ENCLUSTRA_QSPI)
Quoted 9 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi line 35
Quoted 6 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi new file +6
-0+ +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + sfconfig = <0 0 50000000 3>;The RAW read implementation for
fs_loaderis not upstream yet, I afraid this might not working, you want help to upstream?
Same answer here, as in my other reply. I appreciate your answer and bringing it up again. If this continues, for sure there will be technical issues. In this case I'll keep you in the loop. Thanx
Quoted 4 lines
[...]
Best regards,
TF
PATCH v5 4/10 ARM: socfpga: add Enclustra storage switch
In reply to Lothar RubuschSome of Enclustra's Intel SoMs need gpio muxing for setting up the boot media. This can be done by switching dip switches and also in software. The image in this case can be loaded from SD card, and flashed to the eMMC or QSPI. After, the dip switches can set the boot select accordingly. With altera_set_storage MMC|EMMC|QSPI from off the u-boot shell, the media is usually switched.
--- .../socfpga_arria10_enclustra_mercury_aa1.dts | 17 ++ board/enclustra/mercury_aa1/Makefile | 8 + .../mercury_aa1/aa1_set_storage_cmd.c | 190 ++++++++++++++++++ doc/board/enclustra/mercury-aa1.rst | 25 +++ 4 files changed, 240 insertions(+) create mode 100644 board/enclustra/mercury_aa1/Makefile create mode 100644 board/enclustra/mercury_aa1/aa1_set_storage_cmd.c
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts +17 -0
@@ -5,6 +5,8 @@ /dts-v1/; +#include <dt-bindings/gpio/gpio.h> + /* The arria10 family */ #include "socfpga/socfpga_arria10_mercury_aa1.dtsi"
@@ -17,6 +19,13 @@ i2c1 = &i2c0; spi0 = &qspi; }; + + altera_set_storage { + compatible = "enclustra,altera_set_storage"; + status = "okay"; + oe-gpios = <&portb 5 GPIO_ACTIVE_HIGH>; + sel-gpios = <&portc 6 GPIO_ACTIVE_HIGH>; + }; }; &qspi {
@@ -35,6 +44,14 @@ }; }; +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + /* Carrier board support */ #if IS_ENABLED(CONFIG_ENCLUSTRA_PE1) # include "socfpga/socfpga_enclustra_mercury_pe1.dtsi"
board/enclustra/mercury_aa1/Makefile new file +8 -0
@@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2024 Enclustra GmbH + +ifeq ($(CONFIG_SPL_BUILD),) + +obj-y += aa1_set_storage_cmd.o + +endif
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +190 -0
190 lines not on this page · raw message
doc/board/enclustra/mercury-aa1.rst +25 -0
@@ -151,6 +151,31 @@ Alternative boot media are possible as officially documented by Enclustra. Note: eMMC and QSPI can be flashed from off the u-boot shell. Usually after flashing, the correct boot mode needs to be set by a BSEL switch. +In the u-boot shell use the following command to switch between the boot media. +This can be used to flash e.g. eMMC or QSPI with an image file stored on the SD +card. Approaches are described in detail in the official Enclustra +documentation according to their releases mentioned as links. + + .. code-block:: bash + + Hit any key to stop autoboot: 0 + => altera_set_storage + altera_set_storage - Set non volatile memory access + Usage: + altera_set_storage <MMC|QSPI|EMMC> - Set access for the selected memory device + => altera_set_storage QSPI + => sf probe + SF: Detected s25fl512s with page size 256 Bytes, erase size 256 KiB, total 64 MiB + => altera_set_storage MMC + => mmc rescan + => mmc list + mmc@ff808000: 0 (SD) + => altera_set_storage EMMC + => mmc rescan + => mmc list + mmc@ff808000: 0 (eMMC) + => + Before turning on the setup, make sure to have the correct voltage configured at the carrier board, using the jumpers on the voltage pin header. Also make sure to have switched to the correct boot media using typically some dip
Signature · 1 line
2.39.2
PATCH v5 5/10 ARM: socfpga: add Mercury+ AA1 boot scripts
In reply to Lothar RubuschAdd bootscripts to boot Enclustra SoMs from MicroSD card or QSPI flash. MicroSD card as bood device here covers the cases of sdmmc or emmc as such boot media.
--- board/enclustra/bootscripts/qspi-aa1.cmd | 12 ++++++++++++ board/enclustra/bootscripts/sd-aa1.cmd | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 board/enclustra/bootscripts/qspi-aa1.cmd create mode 100644 board/enclustra/bootscripts/sd-aa1.cmd
board/enclustra/bootscripts/qspi-aa1.cmd new file +12 -0
@@ -0,0 +1,12 @@ +# This is an example input file for boot.scr generation. +# Generate boot.scr +# ./tools/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d board/enclustra/bootscripts/qspi-aa1.cmd boot.scr +# +# Note: The needed variables need to be set in the environment. +bridge enable +sf probe +sf read $kernel_addr_r $qspi_offset_addr_kernel $kernel_size +sf read $fdt_addr_r $qspi_offset_addr_devicetree $fdt_size +sf read $rootfs_addr_r $qspi_offset_addr_rootfs $rootfs_size +run fdtload_qspi +bootm $kernel_addr_r $rootfs_addr_r $fdt_addr_r
board/enclustra/bootscripts/sd-aa1.cmd new file +9 -0
@@ -0,0 +1,9 @@ +# This is an example input file for boot.scr generation. +# Generate boot.scr +# ./tools/mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "U-boot mmc start script" -d board/enclustra/bootscripts/sd-aa1.cmd boot.scr +# +# Note: The needed variables need to be set in the environment. +bridge enable +load mmc $devnum:$distro_bootpart $kernel_addr_r Image +load mmc $devnum:$distro_bootpart $fdt_addr_r $fdtfile +booti $kernel_addr_r - $fdt_addr_r
Signature · 1 line
2.39.2
PATCH v5 6/10 ARM: socfpga: AA1: support MAC from secure eeprom
In reply to Lothar RubuschSeveral Enclustra devices store MAC address in a secure eeprom device. In most cases this is the atsha204a (alternatively DS28). The atsha204a device is preconfigured accordingly. Reading then is based on u-boot's atsha204a driver. Add such support for Enclustra's AA1 SoMs.
--- arch/arm/mach-socfpga/Kconfig | 2 +- board/enclustra/common/Kconfig | 25 +++++ board/enclustra/common/Makefile | 3 + board/enclustra/common/enclustra_mac.h | 48 +++++++++ board/enclustra/common/mac_atsha204.c | 102 ++++++++++++++++++ board/enclustra/common/mac_common.c | 52 +++++++++ board/enclustra/common/mac_ds28.c | 93 ++++++++++++++++ board/enclustra/mercury_aa1/Makefile | 2 + .../mercury_aa1/aa1_board_late_init.c | 17 +++ .../socfpga_enclustra_mercury_aa1_defconfig | 1 + 10 files changed, 344 insertions(+), 1 deletion(-) create mode 100644 board/enclustra/common/Kconfig create mode 100644 board/enclustra/common/enclustra_mac.h create mode 100644 board/enclustra/common/mac_atsha204.c create mode 100644 board/enclustra/common/mac_common.c create mode 100644 board/enclustra/common/mac_ds28.c create mode 100644 board/enclustra/mercury_aa1/aa1_board_late_init.c
arch/arm/mach-socfpga/Kconfig +1 -1
@@ -297,6 +297,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/enclustra/mercury_aa1/Kconfig" +source "board/enclustra/common/Kconfig" endif
board/enclustra/common/Kconfig new file +25 -0
@@ -0,0 +1,25 @@ +config ENCLUSTRA_EEPROM_MAC + bool "Enclustra MAC address" + select ATSHA204A + depends on TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + default y + help + Reads the MAC address out of the EEPROM and configures the MAC + addresses in the environment. + +choice + prompt "Enclustra EEPROM device" + depends on ENCLUSTRA_EEPROM_MAC + default ENCLUSTRA_EEPROM_MAC_ATSHA204 if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + help + Specify the device where the MAC is stored. + +config ENCLUSTRA_EEPROM_MAC_ATSHA204 + bool "MAC stored in 'ATSHA204'" + +config ENCLUSTRA_EEPROM_MAC_DS28 + bool "MAC stored in 'DS28'" + +endchoice + +source "board/enclustra/mercury_aa1/Kconfig"
board/enclustra/common/Makefile +3 -0
@@ -2,3 +2,6 @@ # Copyright (c) 2024 Enclustra GmbH # Common for several Enclustra modules +obj-$(CONFIG_ENCLUSTRA_EEPROM_MAC) += mac_common.o +obj-$(CONFIG_ENCLUSTRA_EEPROM_MAC_ATSHA204) += mac_atsha204.o +obj-$(CONFIG_ENCLUSTRA_EEPROM_MAC_DS28) += mac_ds28.o
board/enclustra/common/enclustra_mac.h new file +48 -0
48 lines not on this page · raw message
board/enclustra/common/mac_atsha204.c new file +102 -0
102 lines not on this page · raw message
board/enclustra/common/mac_common.c new file +52 -0
52 lines not on this page · raw message
board/enclustra/common/mac_ds28.c new file +93 -0
93 lines not on this page · raw message
board/enclustra/mercury_aa1/Makefile +2 -0
@@ -6,3 +6,5 @@ ifeq ($(CONFIG_SPL_BUILD),) obj-y += aa1_set_storage_cmd.o endif + +obj-y += aa1_board_late_init.o
board/enclustra/mercury_aa1/aa1_board_late_init.c new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#include <env.h> +#include <init.h> +#include <dm/uclass.h> +#include <dm.h> + +#include "../common/enclustra_mac.h" + +int board_late_init (void ) +{ +return enclustra_setup_mac_address (); +}
configs/socfpga_enclustra_mercury_aa1_defconfig +1 -0
@@ -28,6 +28,7 @@ CONFIG_SYS_CONSOLE_IS_IN_ENV=y CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE=y CONFIG_SYS_CONSOLE_ENV_OVERWRITE=y CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_BOARD_LATE_INIT=y CONFIG_CLOCKS=y CONFIG_SPL_PAD_TO=0x40000 CONFIG_SPL_NO_BSS_LIMIT=y
Signature · 1 line
2.39.2
PATCH v5 7/10 misc: atsha204a: update kconfig description
In reply to Lothar RubuschThe atsha204a crypto chip is not only on the Turris Omnia board. Extend the description of the atsha204a kconfig to cover also other boards. As an example the Enclustra Mercury+ AA1 SoM.
--- drivers/misc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/Kconfig +1 -1
@@ -73,7 +73,7 @@ config ATSHA204A help Enable support for I2C connected Atmel's ATSHA204A CryptoAuthentication module found for example on the Turris Omnia - board. + board and Enclustra SoC FPGA boards. config GATEWORKS_SC bool "Gateworks System Controller Support"
Signature · 1 line
2.39.2
PATCH v5 8/10 ARM: dts: arria10: update according to DTSpec
In reply to Lothar RubuschUpdate node-names according to DTspec. Add labels for compatibility and/or add missing nodes in order to make the file compatible with the corresponding counterpart in dts/upstream. Eventually the u-boot local file then can be replaced by the dts/upstream, and eventually removed.
--- arch/arm/dts/socfpga_arria10.dtsi | 42 ++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 9 deletions(-)
arch/arm/dts/socfpga_arria10.dtsi +33 -9
@@ -15,13 +15,13 @@ #size-cells = <0>; enable-method = "altr,socfpga-a10-smp"; - cpu@0 { + cpu0: cpu@0 { compatible = "arm,cortex-a9"; device_type = "cpu"; reg = <0>; next-level-cache = <&L2>; }; - cpu@1 { + cpu1: cpu@1 { compatible = "arm,cortex-a9"; device_type = "cpu"; reg = <1>;
@@ -29,7 +29,16 @@ }; }; - intc: intc@ffffd000 { + pmu: pmu@ff111000 { + compatible = "arm,cortex-a9-pmu"; + interrupt-parent = <&intc>; + interrupts = <0 124 4>, <0 125 4>; + interrupt-affinity = <&cpu0>, <&cpu1>; + reg = <0xff111000 0x1000>, + <0xff113000 0x1000>; + }; + + intc: interrupt-controller@ffffd000 { compatible = "arm,cortex-a9-gic"; #interrupt-cells = <3>; interrupt-controller;
@@ -73,7 +82,7 @@ }; }; - base_fpga_region { + fpga-region { #address-cells = <0x1>; #size-cells = <0x1>;
@@ -638,7 +647,7 @@ reg = <0xffcfb100 0x80>; }; - L2: l2-cache@fffff000 { + L2: cache-controller@fffff000 { compatible = "arm,pl310-cache"; reg = <0xfffff000 0x1000>; interrupts = <0 18 IRQ_TYPE_LEVEL_HIGH>;
@@ -649,7 +658,7 @@ arm,shared-override; }; - mmc: dwmmc0@ff808000 { + mmc: mmc@ff808000 { #address-cells = <1>; #size-cells = <0>; compatible = "altr,socfpga-dw-mshc";
@@ -662,7 +671,7 @@ status = "disabled"; }; - nand: nand@ffb90000 { + nand: nand-controller@ffb90000 { #address-cells = <1>; #size-cells = <0>; compatible = "altr,socfpga-denali-nand";
@@ -729,6 +738,16 @@ <37 IRQ_TYPE_LEVEL_HIGH>; }; + sdmmca-ecc@ff8c2c00 { + compatible = "altr,socfpga-sdmmc-ecc"; + reg = <0xff8c2c00 0x400>; + altr,ecc-parent = <&mmc>; + interrupts = <15 IRQ_TYPE_LEVEL_HIGH>, + <47 IRQ_TYPE_LEVEL_HIGH>, + <16 IRQ_TYPE_LEVEL_HIGH>, + <48 IRQ_TYPE_LEVEL_HIGH>; + }; + dma-ecc@ff8c8000 { compatible = "altr,socfpga-dma-ecc"; reg = <0xff8c8000 0x400>;
@@ -760,6 +779,11 @@ resets = <&rst QSPI_RESET>, <&rst QSPI_OCP_RESET>; reset-names = "qspi", "qspi-ocp"; status = "disabled"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0x0>; + }; }; rst: rstmgr@ffd05000 {
@@ -828,7 +852,7 @@ reset-names = "timer"; }; - uart0: serial0@ffc02000 { + uart0: serial@ffc02000 { compatible = "snps,dw-apb-uart"; reg = <0xffc02000 0x100>; interrupts = <0 110 IRQ_TYPE_LEVEL_HIGH>;
@@ -839,7 +863,7 @@ status = "disabled"; }; - uart1: serial1@ffc02100 { + uart1: serial@ffc02100 { compatible = "snps,dw-apb-uart"; reg = <0xffc02100 0x100>; interrupts = <0 111 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.2
PATCH v5 9/10 ARM: socfpga: update function call to modern API
In reply to Lothar RubuschRemove arguments in the function call. The call's argument list differs from its definition, which breaks compilation. The removed arguments are obtained from device-tree declaration.
--- arch/arm/mach-socfpga/misc_arria10.c | 2 -- 1 file changed, 2 deletions(-)
arch/arm/mach-socfpga/misc_arria10.c +0 -2
@@ -214,8 +214,6 @@ int qspi_flash_software_reset(void)/* Get the flash info */ ret =spi_flash_probe_bus_cs (CONFIG_SF_DEFAULT_BUS ,CONFIG_SF_DEFAULT_CS , -CONFIG_SF_DEFAULT_SPEED , -CONFIG_SF_DEFAULT_MODE , &flash);if (ret) {
Signature · 1 line
2.39.2
PATCH v5 10/10 ARM: socfpga: apply binman approach to fpga parts
In reply to Lothar RubuschConvert the .its based approach to binman instruction covered in the device tree generation. This reduces additional instructions and integrates the former separate build step into building the u-boot.
--- ..._arria10_enclustra_mercury_aa1-u-boot.dtsi | 44 +++++++++++++++++++ arch/arm/mach-socfpga/Kconfig | 1 + board/enclustra/mercury_aa1/fpga.its | 32 -------------- doc/board/enclustra/mercury-aa1.rst | 3 ++ 4 files changed, 48 insertions(+), 32 deletions(-) delete mode 100644 board/enclustra/mercury_aa1/fpga.its
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1-u-boot.dtsi +44 -0
@@ -18,6 +18,10 @@ compatible = "u-boot,fs-loader"; phandlepart = <&mmc 1>; }; + + binman: binman { + multiple-images; + }; }; &fpga_mgr {
@@ -43,3 +47,43 @@ }; #endif + +&binman { + u-boot { + filename = "fpga.itb"; + + fit { + description = "FIT image with FPGA bistream"; + fit,external-offset = <0>; + #address-cells = <1>; + + images { + fpga-periph-1 { + description = "FPGA peripheral bitstream"; + type = "fpga"; + compression = "none"; + blob-ext { + filename = "bitstream.periph.rbf"; + }; + }; + + fpga-core-1 { + description = "FPGA core bitstream"; + type = "fpga"; + compression = "none"; + blob-ext { + filename = "bitstream.core.rbf"; + }; + }; + }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; + }; + }; +};
arch/arm/mach-socfpga/Kconfig +1 -0
@@ -186,6 +186,7 @@ config TARGET_SOCFPGA_EBV_SOCRATES config TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 bool "Enclustra Mercury+ AA1" + select BINMAN select TARGET_SOCFPGA_ARRIA10 config TARGET_SOCFPGA_IS1
board/enclustra/mercury_aa1/fpga.its deleted +0 -32
@@ -1,32 +0,0 @@ -/dts-v1/; - -/ { - description = "FIT image with FPGA bistream"; - #address-cells = <1>; - - images { - fpga-periph-1 { - description = "FPGA peripheral bitstream"; - data = /incbin/("../../../bitstream.periph.rbf"); - type = "fpga"; - arch = "arm"; - compression = "none"; - }; - - fpga-core-1 { - description = "FPGA core bitstream"; - data = /incbin/("../../../bitstream.core.rbf"); - type = "fpga"; - arch = "arm"; - compression = "none"; - }; - }; - - configurations { - default = "config-1"; - config-1 { - description = "Boot with FPGA early IO release config"; - fpga = "fpga-periph-1", "fpga-core-1"; - }; - }; -};
doc/board/enclustra/mercury-aa1.rst +3 -0
@@ -66,6 +66,9 @@ Build u-boot. Source your favorite toolchain for ARM first. $ make socfpga_enclustra_mercury_aa1_defconfig $ make -j8 +Note: Call ``make`` with ``NO_PYTHON=1`` where python tools unnecessarily falls +back into additional python setup. + Setup and compile a boot script as needed. Depending on the boot-mode select ``sd-aa1.cmd`` for SD/eMMC, or ``qspi-aa1.cmd`` for QSPI flash.
Signature · 1 line
2.39.2