add support for Enclustra Mercury AA1 SoMs
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. This is supposed to be the first step to upstream several of Enclustras SoC FPGA Modules. There are still things to be modified. So, this is supposed to start the discussion and also to clarify some of my open issues.
The DT approach is partly based on dts/upstream, which are (going to be) upstreamed to the linux kernel.
---
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 extra env settings
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
arch/arm/dts/socfpga_arria10.dtsi | 42 ++- .../socfpga_arria10_enclustra_mercury_aa1.dts | 103 ++++++ .../socfpga_arria10_mercury_aa1-u-boot.dtsi | 19 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 305 ++++++++++++++++++ arch/arm/mach-socfpga/Kconfig | 9 + 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 +++++++++++ board/enclustra/mercury_aa1/fpga.its | 32 ++ .../socfpga_enclustra_mercury_aa1_defconfig | 86 +++++ doc/board/enclustra/index.rst | 9 + doc/board/enclustra/mercury-aa1.rst | 227 +++++++++++++ doc/board/index.rst | 1 + include/configs/socfpga_mercury_aa1.h | 23 ++ 25 files changed, 1476 insertions(+), 11 deletions(-) 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 board/enclustra/mercury_aa1/fpga.its 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.25.1
PATCH 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 | 204 ++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 3 files changed, 214 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 +204 -0
204 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.25.1
PATCH 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 +++++++++++++++++++ doc/board/enclustra/mercury-aa1.rst | 8 +- include/configs/socfpga_mercury_aa1.h | 33 +++++++ 8 files changed, 191 insertions(+), 5 deletions(-) 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 +F: board/enclustra/mercury_aa1/ +F: board/enclustra/common/ +F: configs/socfpga_enclustra_mercury_aa1_defconfig +F: doc/board/enclustra/mercury-aa1.rst +F: 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
doc/board/enclustra/mercury-aa1.rst +3 -5
@@ -165,7 +165,7 @@ The demo shows booting a AA1 + ST1 setup and stopping at the u-boot shell. Here is the console output:: - U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 08 2024 - 14:03:59 +0000) + U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 27 2024 - 14:03:59 +0000) FPGA: Checking FPGA configuration setting ... FPGA: Start to program peripheral/full bitstream ... FPGA: Early Release Succeeded.
@@ -173,7 +173,7 @@ Here is the console output:: FPGA: Start to program peripheral/full bitstream ... FPGA: Early Release Succeeded. - U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 08 2024 - 14:03:59 +0000) + U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 27 2024 - 14:03:59 +0000) DDRCAL: Success DDRCAL: Scrubbing ECC RAM (2048 MiB). DDRCAL: Scrubbing ECC RAM done.
@@ -184,7 +184,7 @@ Here is the console output:: Trying to boot from MMC1 - U-Boot 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 08 2024 - 14:03:59 +0000)socfpga_arria10 + U-Boot 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 27 2024 - 14:03:59 +0000)socfpga_arria10 CPU: Altera SoCFPGA Arria 10 BOOT: SD/MMC External Transceiver (1.8V)
@@ -197,8 +197,6 @@ Here is the console output:: Out: serial Err: serial Model: Enclustra Mercury+ AA1 - ethaddr set to 20:B0:F7:06:0D:BE - eth1addr set to 20:B0:F7:06:0D:BF Net: eth0: ethernet@ff800000 =>
include/configs/socfpga_mercury_aa1.h new file +33 -0
@@ -0,0 +1,33 @@ +/* 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 + +/* +* Serial / UART configurations +*/ +#define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} + +/* +* L4 OSC1 Timer 0 +*/ +/* reload value when timer count to zero */ +#define TIMER_LOAD_VAL 0xFFFFFFFF + +/* The rest of the configuration is shared */ +#include <configs/socfpga_common.h> + +#endif /* __CONFIG_SOCFGPA_MERCURY_AA1_H__ */
Signature · 1 line
2.25.1
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
On 10/13/24 4:32 PM, Lothar Rubusch wrote:
[...]
board/enclustra/mercury_aa1/MAINTAINERS line 10
Quoted 12 lines
+++ b/board/enclustra/mercury_aa1/MAINTAINERS
board/enclustra/mercury_aa1/MAINTAINERS new file +10
-0@@ -0,0 +1,10 @@ +Enclustra Mercury+ AA1 +M: Lothar Rubusch <[email protected]> +S: Maintained +F: board/enclustra/mercury_aa1/ +F: board/enclustra/common/ +F: configs/socfpga_enclustra_mercury_aa1_defconfig +F: doc/board/enclustra/mercury-aa1.rst +F: include/configs/socfpga_mercury_aa1.h +N: enclustra +N: mercury_aa1
I think the N: will match on all the files listed in F: above too, so you can remove the F:
Quoted 28 lines
board/enclustra/mercury_aa1/fpga.its new file +22
-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"; + };
board/enclustra/mercury_aa1/fpga.its line 32
Quoted 10 lines
board/enclustra/mercury_aa1/fpga.its new file +10
-0+ }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; +};
Can this be generated using binman instead ?
[...]
doc/board/enclustra/mercury-aa1.rst The demo shows booting a AA1 + ST1 setup and stopping at the u-boot shell. · line 168
Quoted 10 lines
doc/board/enclustra/mercury-aa1.rst +1
-1@@ -165,7 +165,7 @@ The demo shows booting a AA1 + ST1 setup and stopping at the u-boot shell. Here is the console output:: - U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 08 2024 - 14:03:59 +0000) + U-Boot SPL 2024.10-rc4-00416-gf0b9c383e6c3 (Sep 27 2024 - 14:03:59 +0000)
Remove the commit hash and timestamp from the examples, so they wouldn't get updated randomly. Also, this change(s) should be in patch 1/10 I think.
[...]
Quoted 18 lines
include/configs/socfpga_mercury_aa1.h new file +12
-0@@ -0,0 +1,33 @@ +/* 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> + +/*
include/configs/socfpga_mercury_aa1.h line 22
Quoted 10 lines
include/configs/socfpga_mercury_aa1.h new file +10
-0+* U-Boot general configurations +*/ + +/* Memory configurations */ +#define PHYS_SDRAM_1_SIZE 0x80000000 + +/* +* Serial / UART configurations +*/ +#define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
Maybe the default baudrate table is OK too ?
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
On Mon, Oct 14, 2024 at 8:42 PM Marek Vasut <[email protected]> wrote:
[...]
Quoted 32 lines
Quoted 32 lines
board/enclustra/mercury_aa1/fpga.its new file +26
-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";
Quoted 8 lines
board/enclustra/mercury_aa1/fpga.its line 32
Quoted 6 lines
board/enclustra/mercury_aa1/fpga.its new file +6
-0+ config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; +};Can this be generated using binman instead ?
This would a oportunity for me to learn the binman tool. Great idea! I need to read a bit more on binman to get a better understanding. I'll give it a try and let you know. Thank you.
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
Quoted 45 lines · Lothar Rubusch
On Mon, Oct 14, 2024 at 8:42 PM Marek Vasut <[email protected]> wrote:
[...]
Quoted 32 lines
Quoted 32 lines
board/enclustra/mercury_aa1/fpga.its new file +26
-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";Quoted 8 lines
board/enclustra/mercury_aa1/fpga.its line 32
Quoted 6 lines
board/enclustra/mercury_aa1/fpga.its new file +6
-0+ config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; +};Can this be generated using binman instead ?
Quoted 3 lines
This would a oportunity for me to learn the binman tool. Great idea! I need to read a bit more on binman to get a better understanding. I'll give it a try and let you know. Thank you.
This commit might help:
5fccc2891e28 ("ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM")
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
Hi
Quoted 47 lines · Marek Vasut
Quoted 45 lines · Lothar Rubusch
On Mon, Oct 14, 2024 at 8:42 PM Marek Vasut <[email protected]> wrote:
[...]
Quoted 40 lines
Quoted 28 lines
board/enclustra/mercury_aa1/fpga.its new file +22
-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"; + };board/enclustra/mercury_aa1/fpga.its line 32
Quoted 10 lines
board/enclustra/mercury_aa1/fpga.its new file +10
-0+ }; + + configurations { + default = "config-1"; + config-1 { + description = "Boot with FPGA early IO release config"; + fpga = "fpga-periph-1", "fpga-core-1"; + }; + }; +};Can this be generated using binman instead ?
Quoted 9 lines
Quoted 3 lines
This would a oportunity for me to learn the binman tool. Great idea! I need to read a bit more on binman to get a better understanding. I'll give it a try and let you know. Thank you.
This commit might help:
5fccc2891e28("ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM")
I face a problem here. First, to apply binman stances in the .dtsi and integrating it as -u-boot.dtsi is very interesting and I actually like the solution to bind everything togerther in this way.
But, I face the situation where the very design specific bitstream(s) for the FPGA are actually not supposed to be upstreamed. Having u-boot binaries and bitstream as .itb separate, allows to build the u-boot part even w/o the bitstream, i.e. the u-boot setup can be quite generic, can be tested and verified building. Is this still possible if binman requires it as binary blob? On the otherhand it allows to wrap the FPGA logic and exchange the .itb separately when developing a design w/o the need to modify the bootloader.
So, I'd like to hear your opinion on that. Would the .itb appraoch be acceptable in this case? Is there still a better way? Does it make sense to make a separate binman setup instead?
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
On 10/23/24 10:10 PM, Lothar Rubusch wrote:
Hi,
sorry for the late reply.
Quoted 16 lines
Quoted 11 lines
Quoted 5 lines
Quoted 1 line
Can this be generated using binman instead ?
This would a oportunity for me to learn the binman tool. Great idea! I need to read a bit more on binman to get a better understanding. I'll give it a try and let you know. Thank you.
This commit might help:
5fccc2891e28("ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM")I face a problem here. First, to apply binman stances in the .dtsi and integrating it as
-u-boot.dtsiis very interesting and I actually like the solution to bind everything togerther in this way.
Quoted 6 lines
But, I face the situation where the very design specific bitstream(s) for the FPGA are actually not supposed to be upstreamed. Having u-boot binaries and bitstream as .itb separate, allows to build the u-boot part even w/o the bitstream, i.e. the u-boot setup can be quite generic, can be tested and verified building. Is this still possible if binman requires it as binary blob?
I believe so, U-Boot CI does use binman to build e.g. imx8m targets which do require extra firmware, but during the CI build that extra firmware is replaced by blank empty files by binman. It does print some sort of warning that the files are missing ... try e.g. 'make imx8mp_dhcom_pdk3_defconfig ; make' and you should see the behavior locally too.
Quoted 7 lines
On the otherhand it allows to
wrap the FPGA logic and exchange the .itb separately when developing a design w/o the need to modify the bootloader.So, I'd like to hear your opinion on that. Would the .itb appraoch be acceptable in this case? Is there still a better way? Does it make sense to make a separate binman setup instead?
The SPL .its handling was dropped now that the last user was switched to the binman method, but I hope the above will let you switch to the binman method too ?
8efc954fc77e ("Makefile: Drop SPL_FIT_SOURCE support")
Re: [PATCH 02/10] ARM: socfpga: add Mercury+ AA1 SoM support
Hi, sorry also from my side for the delay.. I guess, bringing Altera/Intel DTS to the kernel is getting a longer story. But I even can see light now. I keep you guys up-to-date, if any news.
Quoted 30 lines · Marek Vasut
On 10/23/24 10:10 PM, Lothar Rubusch wrote:
Hi,
sorry for the late reply.
Quoted 16 lines
Quoted 11 lines
Quoted 5 lines
Quoted 1 line
Can this be generated using binman instead ?
This would a oportunity for me to learn the binman tool. Great idea! I need to read a bit more on binman to get a better understanding. I'll give it a try and let you know. Thank you.
This commit might help:
5fccc2891e28("ARM: dts: stm32: Generate u-boot.itb using binman on DH STM32 DHSOM")I face a problem here. First, to apply binman stances in the .dtsi and integrating it as
-u-boot.dtsiis very interesting and I actually like the solution to bind everything togerther in this way.Quoted 6 lines
But, I face the situation where the very design specific bitstream(s) for the FPGA are actually not supposed to be upstreamed. Having u-boot binaries and bitstream as .itb separate, allows to build the u-boot part even w/o the bitstream, i.e. the u-boot setup can be quite generic, can be tested and verified building. Is this still possible if binman requires it as binary blob?
Quoted 7 lines
I believe so, U-Boot CI does use binman to build e.g. imx8m targets which do require extra firmware, but during the CI build that extra firmware is replaced by blank empty files by binman. It does print some sort of warning that the files are missing ... try e.g. 'make
imx8mp_dhcom_pdk3_defconfig; make' and you should see the behavior locally too.
I totally got the u-boot log wrong. The build runs through with or without blobs. So, there is no open issue from my side.
If I build w/o blobs, I see the warning in red - it's actually just a warning and not an error as I initially thought. So, the current setup as is, actually builds on binman. It is ready when you are.
I'm issuing a version 5 now, just for having the document/typo fixes excluded, as Simon asked.
Best,
L
PATCH 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.
--- .../socfpga_arria10_enclustra_mercury_aa1.dts | 86 +++++ .../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 + 5 files changed, 449 insertions(+) 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.dts new file +86 -0
@@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/dts-v1/; + +/* The arria10 family */ +#include "socfpga/socfpga_arria10_mercury_aa1.dtsi" + +/ { + aliases { + ethernet0 = &gmac0; + serial0 = &uart0; + serial1 = &uart1; + i2c0 = &i2c1; + i2c1 = &i2c0; + spi0 = &qspi; + }; +}; + +&qspi { + bootph-all; + status = "okay"; + flash0: s25fl512s@0 { + bootph-all; + + cdns,page-size = <256>; + cdns,block-size = <16>; + + cdns,tshsl-ns = <200>; + cdns,tsd2d-ns = <255>; + cdns,tchsh-ns = <20>; + cdns,tslch-ns = <20>; + }; +}; + +/* Carrier board support */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_PE1) +# include "socfpga/socfpga_enclustra_mercury_pe1.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_PE3) +# include "socfpga/socfpga_enclustra_mercury_pe3.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_ST1) +# include "socfpga/socfpga_enclustra_mercury_st1.dtsi" +#endif + +/* 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_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 +F: arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts +F: arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h F: board/enclustra/mercury_aa1/ F: board/enclustra/common/ F: configs/socfpga_enclustra_mercury_aa1_defconfig
Signature · 1 line
2.25.1
Re: [PATCH 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
On 10/13/24 4:32 PM, Lothar Rubusch wrote:
[...]
Quoted 41 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +35
-0@@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/dts-v1/; + +/* The arria10 family */ +#include "socfpga/socfpga_arria10_mercury_aa1.dtsi" + +/ { + aliases { + ethernet0 = &gmac0; + serial0 = &uart0; + serial1 = &uart1; + i2c0 = &i2c1; + i2c1 = &i2c0; + spi0 = &qspi; + }; +}; + +&qspi { + bootph-all; + status = "okay"; + flash0: s25fl512s@0 { + bootph-all; + + cdns,page-size = <256>; + cdns,block-size = <16>; + + cdns,tshsl-ns = <200>; + cdns,tsd2d-ns = <255>; + cdns,tchsh-ns = <20>; + cdns,tslch-ns = <20>; + };
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts line 45
Quoted 10 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +10
-0+}; + +/* Carrier board support */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_PE1) +# include "socfpga/socfpga_enclustra_mercury_pe1.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_PE3) +# include "socfpga/socfpga_enclustra_mercury_pe3.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_ST1) +# include "socfpga/socfpga_enclustra_mercury_st1.dtsi" +#endif
Can this be moved to socfpga_arria10_mercury_aa1-u-boot.dtsi instead , as this is likely not going to be part of the upstream socfpga_arria10_mercury_aa1.dts ?
[...]
board/enclustra/mercury_aa1/MAINTAINERS line 5
Quoted 10 lines
board/enclustra/mercury_aa1/MAINTAINERS +2
-0@@ -1,6 +1,8 @@ Enclustra Mercury+ AA1 M: Lothar Rubusch <[email protected]> S: Maintained +F: arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts +F: arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h
Are the F:s needed with the N:s below ?
Quoted 3 lines
board/enclustra/mercury_aa1/MAINTAINERS +0
-0F: board/enclustra/mercury_aa1/ F: board/enclustra/common/ F: configs/socfpga_enclustra_mercury_aa1_defconfig
[...]
Re: [PATCH 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
Quoted 52 lines · Marek Vasut
On 10/13/24 4:32 PM, Lothar Rubusch wrote:
[...]
Quoted 47 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +41
-0@@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/dts-v1/; + +/* The arria10 family */ +#include "socfpga/socfpga_arria10_mercury_aa1.dtsi" + +/ { + aliases { + ethernet0 = &gmac0; + serial0 = &uart0; + serial1 = &uart1; + i2c0 = &i2c1; + i2c1 = &i2c0; + spi0 = &qspi; + }; +}; + +&qspi { + bootph-all; + status = "okay"; + flash0: s25fl512s@0 { + bootph-all; + + cdns,page-size = <256>; + cdns,block-size = <16>; + + cdns,tshsl-ns = <200>; + cdns,tsd2d-ns = <255>; + cdns,tchsh-ns = <20>; + cdns,tslch-ns = <20>; + }; +}; + +/* Carrier board support */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_PE1) +# include "socfpga/socfpga_enclustra_mercury_pe1.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_PE3)
Quoted 8 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts line 45
Quoted 4 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +4
-0+# include "socfpga/socfpga_enclustra_mercury_pe3.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_ST1) +# include "socfpga/socfpga_enclustra_mercury_st1.dtsi" +#endifCan this be moved to
socfpga_arria10_mercury_aa1-u-boot.dtsiinstead , as this is likely not going to be part of the upstreamsocfpga_arria10_mercury_aa1.dts?
I may try to put more of this content into a ...-u-boot.dtsi and then try to take more advantage out of the u-boot DT generation process. I will have a look on what I could improve to match the u-boot DT generation approach still a bit better.
I was orienting myself a bit by the other arria10 devices there. But I think .dts in dts/upstream will definitely not work with the current approach, and as a .dts file due to this bitstream loading and muxing situation needed to be done in SPL and u-boot only. I'll see if I can figure out.
Re: [PATCH 03/10] ARM: dts: socfpga: add Mercury+ AA1 for u-boot dts
Quoted 67 lines · Lothar Rubusch
Quoted 52 lines · Marek Vasut
On 10/13/24 4:32 PM, Lothar Rubusch wrote:
[...]
Quoted 47 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +41
-0@@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/dts-v1/; + +/* The arria10 family */ +#include "socfpga/socfpga_arria10_mercury_aa1.dtsi" + +/ { + aliases { + ethernet0 = &gmac0; + serial0 = &uart0; + serial1 = &uart1; + i2c0 = &i2c1; + i2c1 = &i2c0; + spi0 = &qspi; + }; +}; + +&qspi { + bootph-all; + status = "okay"; + flash0: s25fl512s@0 { + bootph-all; + + cdns,page-size = <256>; + cdns,block-size = <16>; + + cdns,tshsl-ns = <200>; + cdns,tsd2d-ns = <255>; + cdns,tchsh-ns = <20>; + cdns,tslch-ns = <20>; + }; +}; + +/* Carrier board support */ +#if IS_ENABLED(CONFIG_ENCLUSTRA_PE1) +# include "socfpga/socfpga_enclustra_mercury_pe1.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_PE3)Quoted 8 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts line 45
Quoted 4 lines
arch/arm/dts/socfpga_arria10_enclustra_mercury_aa1.dts new file +4
-0+# include "socfpga/socfpga_enclustra_mercury_pe3.dtsi" +#elif IS_ENABLED(CONFIG_ENCLUSTRA_ST1) +# include "socfpga/socfpga_enclustra_mercury_st1.dtsi" +#endifCan this be moved to
socfpga_arria10_mercury_aa1-u-boot.dtsiinstead , as this is likely not going to be part of the upstreamsocfpga_arria10_mercury_aa1.dts?I may try to put more of this content into a
...-u-boot.dtsiand then try to take more advantage out of the u-boot DT generation process. I will have a look on what I could improve to match the u-boot DT generation approach still a bit better.
Quoted 5 lines
I was orienting myself a bit by the other arria10 devices there. But I think .dts in dts/upstream will definitely not work with the current approach, and as a .dts file due to this bitstream loading and muxing situation needed to be done in SPL and u-boot only. I'll see if I can figure out.
Thank you !
PATCH 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 | 29 ++- 4 files changed, 241 insertions(+), 3 deletions(-) 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 = "encl,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 +26 -3
@@ -149,9 +149,32 @@ Alternative boot media are possible as officially documented by Enclustra. * QSPI Note: eMMC and QSPI can be flashed from off the u-boot shell. Usually after -flashing, the coorect boot mode needs to be set by a BSEL switch. Approaches -are described consistently in the official Enclustra documentation according to -their releases mentioned as links. +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
Signature · 1 line
2.25.1
Re: [PATCH 04/10] ARM: socfpga: add Enclustra storage switch
On 10/13/24 4:32 PM, Lothar Rubusch wrote:
[...]
Quoted 24 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +18
-0@@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#include <command.h> +#include <env.h> +#include <init.h> +#include <dm.h> +#include <dm/uclass.h> +#include <asm-generic/gpio.h> +#include <asm/io.h> + +/* Pin muxing */ +#define ALTERA_NONE 0 +#define ALTERA_MMC 1 +#define ALTERA_QSPI 2
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c line 28
Quoted 10 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +10
-0+#define ALTERA_EMMC 3 +#define MMC_CLK_DIV 0x9 +#define QSPI_CLK_DIV 0x384 +#define ALTERA_PINMUX_OFFS 0xffd07200 +#define ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE 0xFFD04078 + +static int altera_current_storage =ALTERA_NONE ; + +static const struct udevice_id altera_set_storage_match[] = { + { .compatible ="encl,altera_set_storage" },
DT bindings indicate the prefix is incorrect:
Documentation/devicetree/bindings/vendor-prefixes.yaml: "^enclustra,.*":Documentation/devicetree/bindings/vendor-prefixes.yaml: description: Enclustra GmbH
Quoted 25 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +25
-0+ { } +}; + +U_BOOT_DRIVER (altera_set_storage) = { + .name ="altera_set_storage" , + .id =UCLASS_MISC , + .of_match = altera_set_storage_match, +}; + +static void enclustra_mercury_aa1_write (const u32 *pinmux_arr,int len) +{ +u32 i, offset, value; + +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +static void enclustra_mercury_aa1_set_mux_mmc (void ) +{ +static const u32 pinmux_arr[] = {0x0c ,0x8 ,// IO4 connected to SDMMC +0x10 ,0x8 ,// IO5 +0x14 ,0x8 ,// IO6
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c line 63
Quoted 10 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +10
-0+0x18 ,0x8 ,// IO7 +0x1c ,0x8 ,// IO8 +0x20 ,0x8 ,// IO9 +0x24 ,0xf ,// IO10 connected to GPIO +0x28 ,0xf ,// IO11 +0x2c ,0xf ,// IO12 +0x30 ,0xf ,// IO13 +0x34 ,0xf ,// IO14 + 0x38, 0xf}; // IO15 +enclustra_mercury_aa1_write (pinmux_arr,sizeof (pinmux_arr) /sizeof (u32));
Try ARRAY_SIZE()
[...]
Quoted 9 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +9
-0+static int altera_set_storage_cmd (struct cmd_tbl *cmdtp,int flag, +int argc,char *const argv[]) +{ +struct udevice *dev; +int ret; + + ret =uclass_get_device_by_driver (UCLASS_MISC , +DM_DRIVER_GET (altera_set_storage), &dev); +if (ret)
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c line 180
Quoted 10 lines
board/enclustra/mercury_aa1/aa1_set_storage_cmd.c new file +10
-0+return ret; + +if (argc !=2 ) +return CMD_RET_USAGE ; + +if (!strcmp (argv[1 ],"MMC" ) || !strcmp (argv[1 ],"mmc" )) +return altera_set_storage (dev,ALTERA_MMC ); +else if (!strcmp (argv[1 ],"QSPI" ) || !strcmp (argv[1 ],"qspi" )) +return altera_set_storage (dev,ALTERA_QSPI ); +else if (!strcmp (argv[1 ],"EMMC" ) || !strcmp (argv[1 ],"emmc" ))
Try strcasecmp()
PATCH 5/10 ARM: socfpga: add Mercury+ AA1 extra env settings
In reply to Lothar RubuschProvide an initial environment for boot scripts to operate.
--- include/configs/socfpga_mercury_aa1.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
include/configs/socfpga_mercury_aa1.h +1 -11
@@ -16,18 +16,8 @@/* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x80000000 -/* -* Serial / UART configurations -*/ -#define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} - -/* -* L4 OSC1 Timer 0 -*/ -/* reload value when timer count to zero */ -#define TIMER_LOAD_VAL 0xFFFFFFFF -/* 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.25.1
Re: [PATCH 05/10] ARM: socfpga: add Mercury+ AA1 extra env settings
Quoted 13 lines · Lothar Rubusch
Provide an initial environment for boot scripts to operate.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>--- include/configs/socfpga_mercury_aa1.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)include/configs/socfpga_mercury_aa1.h +0
-0
include/configs/socfpga_mercury_aa1.h line 22
Quoted 7 lines
include/configs/socfpga_mercury_aa1.h +0
-4@@ -16,18 +16,8 @@/* Memory configurations */ #define PHYS_SDRAM_1_SIZE 0x80000000 -/* -* Serial / UART configurations -*/ -#define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200}
This was added in 2/10 and now it is removed here, please only add code once and don't add code only to remove it later.
PATCH 6/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 +# +# NB: 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 +# +# NB: The needed variables need to be set in the environment. +bridge enable +fatload mmc $devnum:$distro_bootpart $kernel_addr_r zImage +fatload mmc $devnum:$distro_bootpart $fdt_addr_r $fdtfile +bootz $kernel_addr_r - $fdt_addr_r
Signature · 1 line
2.25.1
Re: [PATCH 06/10] ARM: socfpga: add Mercury+ AA1 boot scripts
Quoted 36 lines · Lothar Rubusch
Add 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.
Signed-off-by Lothar Rubusch <[email protected]>--- 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 +# +# NB: 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_rboard/enclustra/bootscripts/sd-aa1.cmd new file +0
-0
board/enclustra/bootscripts/sd-aa1.cmd line 9
Quoted 9 lines
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 +# +# NB: The needed variables need to be set in the environment. +bridge enable +fatload mmc $devnum:$distro_bootpart $kernel_addr_r zImage +fatload mmc $devnum:$distro_bootpart $fdt_addr_r $fdtfile +bootz $kernel_addr_r - $fdt_addr_r
Use plain 'load' command with FS_GENERIC
PATCH 7/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 + doc/board/enclustra/mercury-aa1.rst | 2 + drivers/misc/Kconfig | 2 +- 12 files changed, 347 insertions(+), 2 deletions(-) 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
doc/board/enclustra/mercury-aa1.rst +2 -0
@@ -220,6 +220,8 @@ Here is the console output:: Out: serial Err: serial Model: Enclustra Mercury+ AA1 + ethaddr set to 20:B0:F7:06:0D:BE + eth1addr set to 20:B0:F7:06:0D:BF Net: eth0: ethernet@ff800000 =>
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.25.1
PATCH 8/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 and Enclustra SoC FPGA boards. + board. config GATEWORKS_SC bool "Gateworks System Controller Support"
Signature · 1 line
2.25.1
Re: [PATCH 08/10] misc: atsha204a: update kconfig description
Quoted 14 lines · Lothar Rubusch
The 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.
Signed-off-by Lothar Rubusch <[email protected]>--- drivers/misc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/Kconfig +0
-0
drivers/misc/Kconfig config ATSHA204A · line 79
Quoted 8 lines
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 and Enclustra SoC FPGA boards. + board. config GATEWORKS_SC bool "Gateworks System Controller Support"
This should be squashed into 7/10 ?
PATCH 9/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.25.1
PATCH 10/10 ARM: socfpga: update function call to modern API
In reply to Lothar RubuschFrom: Lothar Rubusch <[email protected]>
Remove 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.25.1