add support for Enclustra Mercury AA1 SoMs
Subsystems (5)
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. I verified boot on SD card and emmc is booting, as also checkpatch is mostly fine and I hope the git comments are reasonable.
Open Issues I still have:
- checkpatch.pl: CONFIG options for env settings in include/configs/socfpga_mercury_aa1.h show up as error at checkpatch.pl.
Additionally an env file as demo is provided, along with instructions. Although, I noticed, when providing a uboot.env file as binary, this replaces the default (socfpga) environment. Is there a way to just append some settings by a compiled uboot.env? As this happens to be, when declared in include/configs. Also other boards (still) used to have settings in board header files in include/configs. So, do I need to remove CONFIG_ entries in this file, or may it be acceptable?
- MAC address from secure eeprom: The implementation does not bring in a new driver. It uses actually the ATSHA204a driver following DM and already
existing in uboot. Function is verified. Is this usage ok?
- Si53338 driver: This is a new clock generator driver with partly generated code. To be honest, I'm not sure if this should be even be upstreamed. Fact
is, the SoMs work w/o this driver. Optional features may need that driver on the system later. It's a nice to have, but also quite specific.
- DT: We don't have upstream kernel DT fragments, so that's also why we still use the classic location here. The bigger problem is, I have 3x (slightly)
different AA1 modules. All can be combined with three different baseboards. Most of those combinations support several bootmodes (SD, eMMC, QSPI) with yet another .dtsi fragment. What is the best way to deal with this situation? For sure I don't like to bring in all combinations as particular new DT setups. Hence, the current approach is to have a top level "enclustra-aa1.dts" including particular .dtsi elements. In combination then using .dtbos and a boot.scr approach. I feel a fit image can be part of the solution, but I'm unsure. I'm unsure if this is part of the BSP later, say a yocto setup, or part of the bootloader. Is it enough to just provide the .dtsi elementst or also an .its file for a demo? In the documentation .rst file currently I refere to the described. Do I need to improve this setup, and what would be the desired approach for this situation?
- uImage: uImage was the classic approach at Enclustra. Anyway this goes into the same direction as above: A more advanced approach would involve a fit
image, as e.g. the "image.ub" Xilinx is doing. But is this needed? Doesn't it also depend on the specific customer and project? Hence, a similar question, is there anything missing? What would be additionally needed? Or, is the current setup is enough?
- Maintainer: checkpatch.pl complains about a missing maintainer entry for the new board. So, I registered myself, since I have access to this hardware.
Unsure here, please let me know how to procede.
Lothar Rubusch (9):
doc: board: enclustra: add Enclustra Intel AA1 SoM
ARM: dts: socfpga: add Enclustra Intel AA1
ARM: socfpga: add Enclustra AA1 SoM support
ARM: socfpga: add Enclustra AA1 extra env settings
ARM: socfpga: add Enclustra AA1 demo env files
ARM: socfpga: add Enclustra AA1 boot scripts
ARM: socfpga: AA1: support MAC from secure eeprom
ARM: socfpga: add si5338 clock generator support
ARM: socfpga: make AA1 use si5338 clock gen
arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi | 15 + arch/arm/dts/Makefile | 2 + arch/arm/dts/enclustra-aa1.dts | 32 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 307 ++++++++++++ .../dts/socfpga_enclustra_mercury_aa1.dtsi | 179 +++++++ ...cfpga_enclustra_mercury_aa1_qspi_boot.dtsi | 18 + ...fpga_enclustra_mercury_aa1_sdmmc_boot.dtsi | 18 + .../dts/socfpga_enclustra_mercury_pe1.dtsi | 7 + .../dts/socfpga_enclustra_mercury_pe3.dtsi | 8 + .../dts/socfpga_enclustra_mercury_st1.dtsi | 8 + arch/arm/mach-socfpga/Kconfig | 9 + board/enclustra/bootscripts/qspi-aa1.cmd | 12 + board/enclustra/bootscripts/sd-aa1.cmd | 10 + board/enclustra/common/Kconfig | 24 + board/enclustra/common/Makefile | 7 + board/enclustra/common/enclustra_mac.h | 48 ++ board/enclustra/common/mac_atsha204.c | 97 ++++ board/enclustra/common/mac_common.c | 54 +++ board/enclustra/common/mac_ds28.c | 88 ++++ board/enclustra/mercury_aa1/Kconfig | 15 + board/enclustra/mercury_aa1/MAINTAINERS | 10 + board/enclustra/mercury_aa1/Makefile | 4 + board/enclustra/mercury_aa1/bitstream.its | 32 ++ board/enclustra/mercury_aa1/mercury_aa1.c | 199 ++++++++ board/enclustra/mercury_aa1/mercury_aa1.env | 65 +++ .../socfpga_enclustra_mercury_aa1_defconfig | 81 ++++ doc/board/enclustra/index.rst | 9 + doc/board/enclustra/mercury-aa1.rst | 209 +++++++++ doc/board/index.rst | 1 + drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/skyworks/Kconfig | 10 + drivers/clk/skyworks/Makefile | 3 + drivers/clk/skyworks/Si5338-RevB-Registers.h | 441 ++++++++++++++++++ drivers/clk/skyworks/si5338_clkgen.c | 177 +++++++ drivers/clk/skyworks/si5338_clkgen.h | 18 + drivers/misc/Kconfig | 2 +- include/configs/socfpga_mercury_aa1.h | 68 +++ 40 files changed, 2316 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi create mode 100644 arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi create mode 100644 arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi create mode 100644 arch/arm/dts/enclustra-aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1_qspi_boot.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1_sdmmc_boot.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_pe1.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_pe3.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_st1.dtsi 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/bitstream.its create mode 100644 board/enclustra/mercury_aa1/mercury_aa1.c create mode 100644 board/enclustra/mercury_aa1/mercury_aa1.env 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 drivers/clk/skyworks/Kconfig create mode 100644 drivers/clk/skyworks/Makefile create mode 100644 drivers/clk/skyworks/Si5338-RevB-Registers.h create mode 100644 drivers/clk/skyworks/si5338_clkgen.c create mode 100644 drivers/clk/skyworks/si5338_clkgen.h create mode 100644 include/configs/socfpga_mercury_aa1.h
Signature · 1 line
2.25.1
PATCH 1/9 doc: board: enclustra: add Enclustra Intel AA1 SoM
Start documentation section for Enclustra. Cover Enclustra Intel SoMs and related carrier board setups.
- Mercury AA1 (Arria10)
--- doc/board/enclustra/index.rst | 9 ++ doc/board/enclustra/mercury-aa1.rst | 209 ++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 3 files changed, 219 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 +209 -0
209 lines not on this page · raw message
doc/board/index.rst +1 -0
@@ -24,6 +24,7 @@ Board-specific doc congatec/index coreboot/index emulation/index + enclustra/index gateworks/index google/index highbank/index
Signature · 1 line
2.25.1
Re: [PATCH 1/9] doc: board: enclustra: add Enclustra Intel AA1 SoM
On 9/12/24 8:06 AM, Lothar Rubusch wrote:
[...]
Quoted 17 lines
doc/board/enclustra/mercury-aa1.rst new file +17
-0+Mercury AA1 Module (Arria1 10) +============================== + +- SoM: https://www.enclustra.com/en/products/system-on-chip-modules/mercury-aa1/ +- Carrier board Mercury+ ST1: https://www.enclustra.com/en/products/base-boards/mercury-st1/ +- Carrier board Mercury+ PE1: https://www.enclustra.com/en/products/base-boards/mercury-pe1-200-300-400/ +- Carrier board Mercury+ PE3: https://www.enclustra.com/en/products/base-boards/mercury-pe3/ + +There are slightly different variants of the AA1 SoM, going by the identifier. + +- Me-aa1-270-2i2-d11e-nfx3 +- Me-aa1-270-3e4-d11e-nfx3 +- Me-aa1-480-2i3-d12e-nfx3 + +The u-boot setup is specific to a quartus design. Generate handoff files from +the design. Pass them to a python script to produce a handoff.h file. This is +needed as input for building the device-tree for u-boot. Eventually, building
doc/board/enclustra/mercury-aa1.rst line 30
Quoted 10 lines
doc/board/enclustra/mercury-aa1.rst new file +10
-0+the final u-boot depends on the particular Quartus design, the particular +carrier board, the selected boot media and boot mode. + +Enclustra provides reference design examples which can be built with yocto +using their meta-layer. + +- Reference Design AA1 on ST1: https://github.com/enclustra/Mercury_AA1_ST1_Reference_Design +- Reference Design AA1 on PE1: https://github.com/enclustra/Mercury_AA1_PE1_Reference_Design +- Reference Design AA1 on PE3: https://github.com/enclustra/Mercury_AA1_PE3_Reference_Design +- Yocto meta-layer: https://github.com/enclustra/meta-enclustra-socfpga
OpenEmbedded .
Quoted 5 lines
doc/board/enclustra/mercury-aa1.rst new file +5
-0+Quick Start +----------- + +- Setup and build a Quartus design project +- Obtain the hps.xml file from the Quartus design project
doc/board/enclustra/mercury-aa1.rst line 46
Quoted 10 lines
doc/board/enclustra/mercury-aa1.rst new file +10
-0+- Generate the handoff.h file for u-boot +- Adjust the device-tree file according to your setup +- Build u-boot +- Flash u-boot + +Build U-Boot +------------ + +The Quartus design produces a design specific ``hps.xml``, an ``emif.xml`` and +a corresponding ``id`` file contained in a folder ``handoff``.
s@folder@directory@ on unix systems.
[...]
doc/board/enclustra/mercury-aa1.rst line 105
Quoted 10 lines
+.. code-block:: bash
doc/board/enclustra/mercury-aa1.rst new file +9
-0+ + $ sudo fdisk /dev/sda + n,p,1,2048,+20M + t,1,c + n,p,2,409600,+1M + t,2,a2 + n,p,3,425984,<REST> + t,3,83 + w
Have a look at 'sfdisk' tool, scriptable fdisk , that is preferable .
[...]
doc/board/enclustra/mercury-aa1.rst line 156
Quoted 10 lines
doc/board/enclustra/mercury-aa1.rst new file +10
-0+Boot Media +---------- + +Alternative boot media are possible as officially documented by Enclustra. + +* Micro-SD card +* eMMC +* QSPI + +NB: eMMC and QSPI can be flashed from off the u-boot shell. Usually after
What does 'NB:' stand for ?
doc/board/enclustra/mercury-aa1.rst line 158
Quoted 2 lines
doc/board/enclustra/mercury-aa1.rst new file +2
-0+flashing, the coorect boot mode needs to be set by a BSEL switch. Approaches +are described consistently in the offical Enclustra documentation according to
"official", typo, run the docs through e.g. aspell to catch those typos.
[...]
Re: [PATCH 1/9] doc: board: enclustra: add Enclustra Intel AA1 SoM
Quoted 25 lines · Marek Vasut
On 9/12/24 8:06 AM, Lothar Rubusch wrote:
[...]Quoted 21 lines
doc/board/enclustra/mercury-aa1.rst new file +21
-0+Mercury AA1 Module (Arria1 10) +============================== + +- SoM: https://www.enclustra.com/en/products/system-on-chip-modules/mercury-aa1/ +- Carrier board Mercury+ ST1: https://www.enclustra.com/en/products/base-boards/mercury-st1/ +- Carrier board Mercury+ PE1: https://www.enclustra.com/en/products/base-boards/mercury-pe1-200-300-400/ +- Carrier board Mercury+ PE3: https://www.enclustra.com/en/products/base-boards/mercury-pe3/ + +There are slightly different variants of the AA1 SoM, going by the identifier. + +- Me-aa1-270-2i2-d11e-nfx3 +- Me-aa1-270-3e4-d11e-nfx3 +- Me-aa1-480-2i3-d12e-nfx3 + +The u-boot setup is specific to a quartus design. Generate handoff files from +the design. Pass them to a python script to produce a handoff.h file. This is +needed as input for building the device-tree for u-boot. Eventually, building +the final u-boot depends on the particular Quartus design, the particular +carrier board, the selected boot media and boot mode. + +Enclustra provides reference design examples which can be built with yocto
Quoted 9 lines
doc/board/enclustra/mercury-aa1.rst line 30
Quoted 6 lines
doc/board/enclustra/mercury-aa1.rst new file +6
-0+using their meta-layer. + +- Reference Design AA1 on ST1: https://github.com/enclustra/Mercury_AA1_ST1_Reference_Design +- Reference Design AA1 on PE1: https://github.com/enclustra/Mercury_AA1_PE1_Reference_Design +- Reference Design AA1 on PE3: https://github.com/enclustra/Mercury_AA1_PE3_Reference_Design +- Yocto meta-layer: https://github.com/enclustra/meta-enclustra-socfpgaOpenEmbedded .
Ok
Quoted 9 lines
Quoted 9 lines
doc/board/enclustra/mercury-aa1.rst new file +9
-0+Quick Start +----------- + +- Setup and build a Quartus design project +- Obtain the hps.xml file from the Quartus design project +- Generate the handoff.h file for u-boot +- Adjust the device-tree file according to your setup +- Build u-boot +- Flash u-boot
Quoted 9 lines
doc/board/enclustra/mercury-aa1.rst line 46
Quoted 6 lines
doc/board/enclustra/mercury-aa1.rst new file +6
-0+ +Build U-Boot +------------ + +The Quartus design produces a design specific ``hps.xml``, an ``emif.xml`` and +a corresponding ``id`` file contained in a folder ``handoff``.s@folder@directory@ on unix systems.
Ok
Quoted 13 lines
[...]
doc/board/enclustra/mercury-aa1.rst line 105
Quoted 10 lines
+.. code-block:: bash
doc/board/enclustra/mercury-aa1.rst new file +9
-0+ + $ sudo fdisk /dev/sda + n,p,1,2048,+20M + t,1,c + n,p,2,409600,+1M + t,2,a2 + n,p,3,425984,<REST> + t,3,83 + w
Quoted 2 lines
Have a look at 'sfdisk' tool, scriptable fdisk , that is preferable .
Ok, ich changed it using sfdisk
Quoted 15 lines
[...]
doc/board/enclustra/mercury-aa1.rst line 156
Quoted 10 lines
doc/board/enclustra/mercury-aa1.rst new file +10
-0+Boot Media +---------- + +Alternative boot media are possible as officially documented by Enclustra. + +* Micro-SD card +* eMMC +* QSPI + +NB: eMMC and QSPI can be flashed from off the u-boot shell. Usually afterWhat does 'NB:' stand for ?
I'll change this for "Note:"
Quoted 5 lines
doc/board/enclustra/mercury-aa1.rst line 158
Quoted 2 lines
doc/board/enclustra/mercury-aa1.rst new file +2
-0+flashing, the coorect boot mode needs to be set by a BSEL switch. Approaches +are described consistently in the offical Enclustra documentation according to"official", typo, run the docs through e.g. aspell to catch those typos.
Thank you for the review and the hints. I'll apply the changes in the next version of this set.
Quoted 1 line
[...]
PATCH 2/9 ARM: dts: socfpga: add Enclustra Intel AA1
In reply to Lothar RubuschIntroduce device-tree files for Enclustra Intel AA1 SoMs and related support.
- Mercury AA1
The setup depends on a selected boot mode. Various fragments for SD/MMC and QSPI flash boot are provided.
In combination, the following Enclustra carrier boards are supported:
- ST1
- PE1
- PE3
--- arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi | 15 + arch/arm/dts/Makefile | 2 + arch/arm/dts/enclustra-aa1.dts | 32 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 307 ++++++++++++++++++ .../dts/socfpga_enclustra_mercury_aa1.dtsi | 179 ++++++++++ ...cfpga_enclustra_mercury_aa1_qspi_boot.dtsi | 18 + ...fpga_enclustra_mercury_aa1_sdmmc_boot.dtsi | 18 + .../dts/socfpga_enclustra_mercury_pe1.dtsi | 7 + .../dts/socfpga_enclustra_mercury_pe3.dtsi | 8 + .../dts/socfpga_enclustra_mercury_st1.dtsi | 8 + 12 files changed, 622 insertions(+) create mode 100644 arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi create mode 100644 arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi create mode 100644 arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi create mode 100644 arch/arm/dts/enclustra-aa1.dts create mode 100644 arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1_qspi_boot.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_aa1_sdmmc_boot.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_pe1.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_pe3.dtsi create mode 100644 arch/arm/dts/socfpga_enclustra_mercury_st1.dtsi
arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { + model = "Enclustra Mercury+ AA1"; + + memory@0 { + name = "memory"; + device_type = "memory"; + reg = <0x0 0x80000000>; /* 2GB */ + }; +};
arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { + model = "Enclustra Mercury+ AA1"; + + memory@0 { + name = "memory"; + device_type = "memory"; + reg = <0x0 0x80000000>; /* 2GB */ + }; +};
arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi new file +15 -0
@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { + model = "Enclustra Mercury+ AA1"; + + /* The module is equipped with 4Gbyte RAM but U-Boot limits the size to 2 Gbyte */ + memory@0 { + name = "memory"; + device_type = "memory"; + reg = <0x0 0x80000000>; /* 2GB */ + }; +};
arch/arm/dts/Makefile +2 -0
@@ -414,6 +414,8 @@ dtb-$(CONFIG_ARCH_SOCFPGA) += \ socfpga_n5x_socdk.dtb \ socfpga_stratix10_socdk.dtb +dtb-$(CONFIG_TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1) += enclustra-aa1.dtb + dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb \ dra72-evm-revc.dtb dra71-evm.dtb dra76-evm.dtb dtb-$(CONFIG_TARGET_AM57XX_EVM) += am57xx-beagle-x15.dtb \
arch/arm/dts/enclustra-aa1.dts new file +32 -0
@@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/dts-v1/; + +/* arria10 family - NB: keep the order of the includes */ +#include "socfpga_arria10.dtsi" +#include "socfpga_arria10-u-boot.dtsi" + +/* The generated handoff.h goes here */ +#include "socfpga_arria10_mercury_aa1_handoff.h" + +/* Generic arria10 glue */ +#include "socfpga_arria10-handoff.dtsi" +#include "socfpga_arria10_handoff_u-boot.dtsi" +#include "socfpga_enclustra_mercury_aa1.dtsi" + +/* Select the boot mode: sd/mmc or qspi */ +//#include "socfpga_enclustra_mercury_aa1_qspi_boot.dtsi" +#include "socfpga_enclustra_mercury_aa1_sdmmc_boot.dtsi" + +/* Select the carrier board */ +//#include "socfpga_enclustra_mercury_st1.dtsi" +#include "socfpga_enclustra_mercury_pe1.dtsi" +//#include "socfpga_enclustra_mercury_pe3.dtsi" + +/* Select the type of AA1 module */ +//#include "ME-AA1-270-2I2-D11E-NFX3.dtsi" +//#include "ME-AA1-270-3E4-D11E-NFX3.dtsi" +#include "ME-AA1-480-2I3-D12E-NFX3.dtsi"
arch/arm/dts/socfpga_arria10_mercury_aa1_handoff.h new file +307 -0
307 lines not on this page · raw message
arch/arm/dts/socfpga_enclustra_mercury_aa1.dtsi new file +179 -0
179 lines not on this page · raw message
arch/arm/dts/socfpga_enclustra_mercury_aa1_qspi_boot.dtsi new file +18 -0
@@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { + 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"; +};
arch/arm/dts/socfpga_enclustra_mercury_aa1_sdmmc_boot.dtsi new file +18 -0
@@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { + fs_loader0: fs-loader { + bootph-all; + compatible = "u-boot,fs-loader"; + phandlepart = <&mmc 1>; + }; +}; + +&fpga_mgr { + bootph-all; + firmware-loader = <&fs_loader0>; + altr,bitstream = "bitstream.itb"; +};
arch/arm/dts/socfpga_enclustra_mercury_pe1.dtsi new file +7 -0
@@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +/ { +};
arch/arm/dts/socfpga_enclustra_mercury_pe3.dtsi new file +8 -0
@@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +&i2c_encl_fpga { + status = "okay"; +};
arch/arm/dts/socfpga_enclustra_mercury_st1.dtsi new file +8 -0
@@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * Copyright (C) 2024 Enclustra GmbH - https://www.enclustra.com + */ + +&i2c_encl_fpga { + status = "okay"; +};
Signature · 1 line
2.25.1
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 16 lines · Lothar Rubusch
Introduce device-tree files for Enclustra Intel AA1 SoMs and related support.
- Mercury AA1
The setup depends on a selected boot mode. Various fragments for SD/MMC and QSPI flash boot are provided.
In combination, the following Enclustra carrier boards are supported:
- ST1
- PE1
- PE3Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>
Quoted 13 lines
--- arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi | 15 + arch/arm/dts/Makefile | 2 + arch/arm/dts/enclustra-aa1.dts | 32 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 307 ++++++++++++++++++ .../dts/socfpga_enclustra_mercury_aa1.dtsi | 179 ++++++++++ ...cfpga_enclustra_mercury_aa1_qspi_boot.dtsi | 18 + ...fpga_enclustra_mercury_aa1_sdmmc_boot.dtsi | 18 + .../dts/socfpga_enclustra_mercury_pe1.dtsi | 7 + .../dts/socfpga_enclustra_mercury_pe3.dtsi | 8 + .../dts/socfpga_enclustra_mercury_st1.dtsi | 8 +
Is there any chance to upstream these DTs to Linux first , and then let them all trickle into U-Boot through dts/upstream/ ?
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 31 lines · Marek Vasut
Quoted 16 lines · Lothar Rubusch
Introduce device-tree files for Enclustra Intel AA1 SoMs and related support.
- Mercury AA1
The setup depends on a selected boot mode. Various fragments for SD/MMC and QSPI flash boot are provided.
In combination, the following Enclustra carrier boards are supported:
- ST1
- PE1
- PE3Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>Quoted 13 lines
--- arch/arm/dts/ME-AA1-270-2I2-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-270-3E4-D11E-NFX3.dtsi | 14 + arch/arm/dts/ME-AA1-480-2I3-D12E-NFX3.dtsi | 15 + arch/arm/dts/Makefile | 2 + arch/arm/dts/enclustra-aa1.dts | 32 ++ .../dts/socfpga_arria10_mercury_aa1_handoff.h | 307 ++++++++++++++++++ .../dts/socfpga_enclustra_mercury_aa1.dtsi | 179 ++++++++++ ...cfpga_enclustra_mercury_aa1_qspi_boot.dtsi | 18 + ...fpga_enclustra_mercury_aa1_sdmmc_boot.dtsi | 18 + .../dts/socfpga_enclustra_mercury_pe1.dtsi | 7 + .../dts/socfpga_enclustra_mercury_pe3.dtsi | 8 + .../dts/socfpga_enclustra_mercury_st1.dtsi | 8 +
Quoted 2 lines
Is there any chance to upstream these DTs to Linux first , and then let them all trickle into U-Boot through dts/upstream/ ?
This is the tricky one. In principle, as it is supposed to be build on our side this is not the case. For the kernel, we prefer to work with DT overlays (.dtbo) where on the u-boot side we only need some basic functionality and not everything declared. So, currently there are differences.
Another point here for me to understand would be the following. If I upstream some DT files to the kernel it might take time until they go to anything released there. So, upstreaming u-boot would wait on that kernel release, right? In such case, I really prefer to upstream the DT files as is to u-boot first. Then / In parallel try to upstream the files to the kernel. And update the u-boot DT set to point to the kernel DT files when they are released. Could this be an approach?
Anyway, it might be that next week, I might discuss that directly in person to get a better idea what could be a way for me with those u-boot files. I'm coming back to this topic then. If you find some time, please let me know what you think about it.
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
In reply to Marek VasutFirst of all a huge thank you for the time you spend in reviewing the patches so far. This is highly appreciate!!
On Fri, Sep 13, 2024 at 1:11 AM Marek Vasut <[email protected]> wrote:
[...]
Quoted 2 lines
Is there any chance to upstream these DTs to Linux first , and then let them all trickle into U-Boot through dts/upstream/ ?
Preparing the DTS patches for Linux kernel, I noticed I will need the handoff setup for u-boot. AFAIK there is currently no single handoff.h or handoff.dtsi file in the kernel repo.
Shall I add the files to my DTS patches and ask for upstreaming of the handoff files into the kernel?
Example:
In specific for u-boot I need a .dts setup like this. Those files are currently not in the kernel:
#include "socfpga_arria10_mercury_aa1_handoff.h"
#include "socfpga_arria10-handoff.dtsi"
#include "socfpga_arria10_handoff_u-boot.dtsi"
...Since this seems to be common for all socfpga setups (arria10 and cyclone5), I guess the situation is already known by a common approach. How to deal with this situation in u-boot dts/upstream?
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
On 9/26/24 12:49 AM, Lothar Rubusch wrote:
Hi,
Quoted 9 lines
First of all a huge thank you for the time you spend in reviewing the patches so far. This is highly appreciate!!
On Fri, Sep 13, 2024 at 1:11 AM Marek Vasut <[email protected]> wrote:
[...]Quoted 2 lines
Is there any chance to upstream these DTs to Linux first , and then let them all trickle into U-Boot through dts/upstream/ ?
Quoted 6 lines
Preparing the DTS patches for Linux kernel, I noticed I will need the handoff setup for u-boot. AFAIK there is currently no single
handoff.horhandoff.dtsifile in the kernel repo.Shall I add the files to my DTS patches and ask for upstreaming of the handoff files into the kernel?
Are the handoff files really used by Linux for anything , or do they contain various clock/pinmux/DRAM settings only used by U-Boot ? If the later, place them into U-Boot and include them from -u-boot.dtsi file.
Quoted 11 lines
Example:
In specific for u-boot I need a .dts setup like this. Those files are currently not in the kernel:#include "socfpga_arria10_mercury_aa1_handoff.h" #include "socfpga_arria10-handoff.dtsi" #include "socfpga_arria10_handoff_u-boot.dtsi" ...Since this seems to be common for all socfpga setups (arria10 and cyclone5), I guess the situation is already known by a common approach. How to deal with this situation in u-boot dts/upstream?
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 4 lines · Marek Vasut
On 9/26/24 12:49 AM, Lothar Rubusch wrote:
Hi,
[...]
Quoted 6 lines
Quoted 2 lines
Shall I add the files to my DTS patches and ask for upstreaming of the handoff files into the kernel?
Are the handoff files really used by Linux for anything , or do they contain various clock/pinmux/DRAM settings only used by U-Boot ? If the later, place them into U-Boot and include them from
-u-boot.dtsifile.
Similar to the other socfpga targets, the handoff files are just relevant to u-boot. So, I'll keep them in arch/arm/dts.
My particular situation then is as follows. The .dts file just includes several .dtsi files. I place this .dts file into arch/arm/dts. The first includes contain the "handoff setup". Then I include adjustments (.dtsi fragments) to the selected base-board and boot-mode. Both can vary that's why I really would prefer to allow for a Kconfig option on that, in contrary to provide a set of .dts files for all possible combinations.
Example:
$ cat ./arch/arm/dts/socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dts /dts-v1/; /* will be taken from /arch/arm/dts */ #include "socfpga_arria10_mercury_aa1_handoff.h" #include "socfpga_arria10-handoff.dtsi" #include "socfpga_arria10_handoff_u-boot.dtsi"
/* will be taken from /dts/upstream */
#include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_arria10_mercury_aa1.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_bootmode_sdmmc.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_pe1.dtsi"
Ideally, now I like to have the first part as default device tree. DEFAULT_DEVICE_TREE=socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dts When doing so, I noticed I cannot enable CONFIG_OF_UPSTREAM anymore, the files in arch/arm/dts won't be found anymore.
Then I have the issue how to access the generic .dtsi files used for boot-mode or base board. These files are identical to the kernel DT why I would prefer to use them from dts/upstream. Including them like ../../../../../... works, but... I think there must be a better way. Ideally I like to setup some Kconfig choice for base board selection and one for boot-mode.
1.) In the documentation control.rst I read that the u-boot.dts is combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi by Kconfig option, and similar a boot-mode?
2.) Is there a way to enable CONFIG_OF_UPSTREAM and use explicit DTS from arch/arm/dts for the u-boot?
3.) What would be the best possibility to have a u-boot.dts with handoff setup in arch/arm/dts and append .dtsi files from the general dts/upstream - in case are there other boards are doing something similar?
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 9 lines · Lothar Rubusch
Quoted 4 lines · Marek Vasut
On 9/26/24 12:49 AM, Lothar Rubusch wrote:
Hi,
[...]
Quoted 3 lines
Quoted 2 lines
Shall I add the files to my DTS patches and ask for upstreaming of the handoff files into the kernel?
Quoted 6 lines
Quoted 3 lines
Are the handoff files really used by Linux for anything , or do they contain various clock/pinmux/DRAM settings only used by U-Boot ? If the later, place them into U-Boot and include them from
-u-boot.dtsifile.Similar to the other socfpga targets, the handoff files are just relevant to u-boot. So, I'll keep them in
arch/arm/dts.
Right
Quoted 10 lines
My particular situation then is as follows. The .dts file just includes several .dtsi files. I place this .dts file into
arch/arm/dts. The first includes contain the "handoff setup". Then I include adjustments (.dtsi fragments) to the selected base-board and boot-mode. Both can vary that's why I really would prefer to allow for aKconfigoption on that, in contrary to provide a set of .dts files for all possible combinations.Example:
$ cat ./arch/arm/dts/socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dts
Upstream DT named this way into Linux:
socfpga_arria10_mercury_aa1_pe1_sdmmc.dts
And then in U-Boot, implement the extras which include whatever you need, name the file:
socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dtsi
The U-Boot build system will combine the two DTs, the build system should automatically append matching -u-boot.dtsi content to any .dts file.
I am not sure if this also works if the .dts file is in dts/upstream/* while the -u-boot.dtsi is in arch/*/dts/ , but there is now definitely a use case for such a setup, it is probably a matter of tweaking the Makefiles .
Quoted 11 lines
/dts-v1/;
/* will be taken from /arch/arm/dts */
#include "socfpga_arria10_mercury_aa1_handoff.h"
#include "socfpga_arria10-handoff.dtsi"
#include "socfpga_arria10_handoff_u-boot.dtsi"/* will be taken from /dts/upstream */
#include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_arria10_mercury_aa1.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_bootmode_sdmmc.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_pe1.dtsi"
Quoted 8 lines
Ideally, now I like to have the first part as default device tree. DEFAULT_DEVICE_TREE=socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dts When doing so, I noticed I cannot enable
CONFIG_OF_UPSTREAManymore, the files inarch/arm/dtswon't be found anymore.
Then I have the issue how to access the generic .dtsi files used for boot-mode or base board. These files are identical to the kernel DT why I would prefer to use them from dts/upstream. Including them like ../../../../../... works, but... I think there must be a better way.
Look at how the -u-boot.dtsi are automatically added on top of .dts files, that might be a start.
Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?
The -u-boot.dtsi is preprocessed by C preprocessor, just like all the other DTs, so you can have a -u-boot.dtsi file which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:
#if IS_ENABLED(...)
#include ...
#else ...
...
#endif
Quoted 2 lines
2.) Is there a way to enable
CONFIG_OF_UPSTREAMand use explicit DTS fromarch/arm/dtsfor the u-boot?
This I do not know.
Quoted 4 lines
3.) What would be the best possibility to have a
u-boot.dtswith handoff setup inarch/arm/dtsand append .dtsi files from the general dts/upstream - in case are there other boards are doing something similar?
See above, maybe some of it helps.
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 84 lines · Marek Vasut
Quoted 9 lines · Lothar Rubusch
Quoted 4 lines · Marek Vasut
On 9/26/24 12:49 AM, Lothar Rubusch wrote:
Hi,
[...]
Quoted 3 lines
Quoted 2 lines
Shall I add the files to my DTS patches and ask for upstreaming of the handoff files into the kernel?
Quoted 6 lines
Quoted 3 lines
Are the handoff files really used by Linux for anything , or do they contain various clock/pinmux/DRAM settings only used by U-Boot ? If the later, place them into U-Boot and include them from
-u-boot.dtsifile.Similar to the other socfpga targets, the handoff files are just relevant to u-boot. So, I'll keep them in
arch/arm/dts.Right
Quoted 10 lines
My particular situation then is as follows. The .dts file just includes several .dtsi files. I place this .dts file into
arch/arm/dts. The first includes contain the "handoff setup". Then I include adjustments (.dtsi fragments) to the selected base-board and boot-mode. Both can vary that's why I really would prefer to allow for aKconfigoption on that, in contrary to provide a set of .dts files for all possible combinations.Example:
$ cat ./arch/arm/dts/socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dtsUpstream DT named this way into Linux:
socfpga_arria10_mercury_aa1_pe1_sdmmc.dtsAnd then in U-Boot, implement the extras which include whatever you need, name the file:
socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dtsiThe U-Boot build system will combine the two DTs, the build system should automatically append matching
-u-boot.dtsicontent to any .dts file.I am not sure if this also works if the .dts file is in dts/upstream/* while the
-u-boot.dtsiis inarch/*/dts/, but there is now definitely a use case for such a setup, it is probably a matter of tweaking the Makefiles .Quoted 11 lines
/dts-v1/;
/* will be taken from /arch/arm/dts */
#include "socfpga_arria10_mercury_aa1_handoff.h"
#include "socfpga_arria10-handoff.dtsi"
#include "socfpga_arria10_handoff_u-boot.dtsi"/* will be taken from /dts/upstream */
#include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_arria10_mercury_aa1.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_bootmode_sdmmc.dtsi" #include "../../../dts/upstream/src/arm/intel/socfpga/socfpga_enclustra_mercury_pe1.dtsi"Quoted 8 lines
Ideally, now I like to have the first part as default device tree. DEFAULT_DEVICE_TREE=socfpga_arria10_mercury_aa1_pe1_sdmmc-u-boot.dts When doing so, I noticed I cannot enable
CONFIG_OF_UPSTREAManymore, the files inarch/arm/dtswon't be found anymore.
Then I have the issue how to access the generic .dtsi files used for boot-mode or base board. These files are identical to the kernel DT why I would prefer to use them from dts/upstream. Including them like ../../../../../... works, but... I think there must be a better way.Look at how the
-u-boot.dtsiare automatically added on top of .dts files, that might be a start.Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?The
-u-boot.dtsiis preprocessed by C preprocessor, just like all the other DTs, so you can have a-u-boot.dtsifile which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:
Quoted 5 lines
#if
IS_ENABLED(...)
#include ...
#else ...
...
#endif
Going through the include list setup by the Makefile made me find my mistake. Currently I may use u-boot specific stuff in arch/arm/dts and include generic .dtsi fragments from dts/upstream. Note: I'm not setting CONFIG_OF_UPSTREAM since I'm using the regular include list which already contains dts/upstream/src/arm/intel. Is this ok? Or, shall I try a different approach, which involves having CONFIG_OF_UPSTREAM explicitely set in the defconfig?
Quoted 6 lines
Quoted 4 lines
3.) What would be the best possibility to have a
u-boot.dtswith handoff setup inarch/arm/dtsand append .dtsi files from the general dts/upstream - in case are there other boards are doing something similar?See above, maybe some of it helps.
Yes. This helped. I can set base-board and boot mode now by Kconfig option with a generic .dts file. Note, it may still take some time, since I'd like to test the stuff still a bit on hardware before submitting something to the list.
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
On 9/28/24 12:47 AM, Lothar Rubusch wrote:
[...]
Quoted 19 lines
Quoted 13 lines
Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?The
-u-boot.dtsiis preprocessed by C preprocessor, just like all the other DTs, so you can have a-u-boot.dtsifile which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:Quoted 5 lines
#if
IS_ENABLED(...)
#include ...
#else ...
...
#endif
Quoted 7 lines
Going through the include list setup by the
Makefilemade me find my mistake. Currently I may use u-boot specific stuff inarch/arm/dtsand include generic .dtsi fragments from dts/upstream. Note: I'm not settingCONFIG_OF_UPSTREAMsince I'm using the regular include list which already contains dts/upstream/src/arm/intel. Is this ok? Or, shall I try a different approach, which involves havingCONFIG_OF_UPSTREAMexplicitely set in the defconfig?
I'm not quite sure I understand the question. Once this platform DTs land in mainline and the DTs get synchronized into U-Boot, you should then set CONFIG_OF_UPSTREAM. Until then, you could patch the DTs into dts/upstream/ to test the result with OF_UPSTREAM enabled .
Quoted 11 lines
Quoted 6 lines
Quoted 4 lines
3.) What would be the best possibility to have a
u-boot.dtswith handoff setup inarch/arm/dtsand append .dtsi files from the general dts/upstream - in case are there other boards are doing something similar?See above, maybe some of it helps.
Yes. This helped. I can set base-board and boot mode now by
Kconfigoption with a generic .dts file. Note, it may still take some time, since I'd like to test the stuff still a bit on hardware before submitting something to the list.
Sure
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 32 lines · Marek Vasut
On 9/28/24 12:47 AM, Lothar Rubusch wrote:
[...]
Quoted 19 lines
Quoted 13 lines
Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?The
-u-boot.dtsiis preprocessed by C preprocessor, just like all the other DTs, so you can have a-u-boot.dtsifile which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:Quoted 5 lines
#if
IS_ENABLED(...)
#include ...
#else ...
...
#endifQuoted 7 lines
Going through the include list setup by the
Makefilemade me find my mistake. Currently I may use u-boot specific stuff inarch/arm/dtsand include generic .dtsi fragments from dts/upstream. Note: I'm not settingCONFIG_OF_UPSTREAMsince I'm using the regular include list which already contains dts/upstream/src/arm/intel. Is this ok? Or, shall I try a different approach, which involves havingCONFIG_OF_UPSTREAMexplicitely set in the defconfig?
Quoted 5 lines
I'm not quite sure I understand the question. Once this platform DTs land in mainline and the DTs get synchronized into U-Boot, you should then set
CONFIG_OF_UPSTREAM. Until then, you could patch the DTs into dts/upstream/ to test the result withOF_UPSTREAMenabled .
Ah, sorry. I did not explain well. Currently I patch the DTs which should go to kernel/mainline into my local u-boot:
dts/upstream/src/arm/intel/socfpga/ as a preparation for my test builds.
For U-boot I will need to build a devicetree file from archarm/dts. I cannot rely just on the upstream fragments for u-boot. Imagine settings like initial fpga bitstream loading, handoff file setup for initialization, etc. In parts I may use .dtsi files from dts/upstream, though, but most of the u-boot particular devicetree setup will reside in arch/arm/dts, I guess (you may see later in the patches).
I noticed when setting the option CONFIG_OF_UPSTREAM in make menuconfig, it prepends dts/upstream/ to the included paths of the devicetree files. The resulting path for the .dts was then dts/upstream/arch/arm/dts/ and could not be found anymore. When I don't activate CONFIG_OF_UPSTREAM, dts/upstream is in the Makefile's include list anyway so that I easily can include from both locations.
In conclusion, currently I'm calling a .dts for building the u-boot DT from arch/arm/dts. The file includes upstream stuff as .dtsi fragment from dts/upstream and handoff from local. CONFIG_OF_UPSTREAM does not seem to be necessary in this case.
This approach currently works for me. If you strongly disagree, I may invest more time to find a way (or why there is currently no way) with CONFIG_OF_UPSTREAM.
This was my question about. Anyway you may wait on v3 to understand better in source what I'm doing, or if I'm just messing around.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
3.) What would be the best possibility to have a
u-boot.dtswith handoff setup inarch/arm/dtsand append .dtsi files from the general dts/upstream - in case are there other boards are doing something similar?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
See above, maybe some of it helps.
Yes. This helped. I can set base-board and boot mode now by
Kconfigoption with a generic .dts file. Note, it may still take some time, since I'd like to test the stuff still a bit on hardware before submitting something to the list.Sure
I still found some bugs. When it's working (again), I'll let you guys know..
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 39 lines · Lothar Rubusch
Quoted 32 lines · Marek Vasut
On 9/28/24 12:47 AM, Lothar Rubusch wrote:
[...]
Quoted 19 lines
Quoted 13 lines
Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?The
-u-boot.dtsiis preprocessed by C preprocessor, just like all the other DTs, so you can have a-u-boot.dtsifile which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:Quoted 5 lines
#if
IS_ENABLED(...)
#include ...
#else ...
...
#endifQuoted 7 lines
Going through the include list setup by the
Makefilemade me find my mistake. Currently I may use u-boot specific stuff inarch/arm/dtsand include generic .dtsi fragments from dts/upstream. Note: I'm not settingCONFIG_OF_UPSTREAMsince I'm using the regular include list which already contains dts/upstream/src/arm/intel. Is this ok? Or, shall I try a different approach, which involves havingCONFIG_OF_UPSTREAMexplicitely set in the defconfig?Quoted 5 lines
I'm not quite sure I understand the question. Once this platform DTs land in mainline and the DTs get synchronized into U-Boot, you should then set
CONFIG_OF_UPSTREAM. Until then, you could patch the DTs into dts/upstream/ to test the result withOF_UPSTREAMenabled .
Quoted 4 lines
Ah, sorry. I did not explain well. Currently I patch the DTs which should go to kernel/mainline into my local u-boot:
dts/upstream/src/arm/intel/socfpga/ as a preparation for my test builds.
OK
Quoted 6 lines
For U-boot I will need to build a devicetree file from archarm/dts. I cannot rely just on the upstream fragments for u-boot. Imagine settings like initial fpga bitstream loading, handoff file setup for initialization, etc. In parts I may use .dtsi files from dts/upstream, though, but most of the u-boot particular devicetree setup will reside in
arch/arm/dts, I guess (you may see later in the patches).
You should be able to use dts/upstream/src/arm/intel/socfpga/ with -u-boot.dtsi from arch/arm/dts/ for this purpose, right ?
Quoted 6 lines
I noticed when setting the option
CONFIG_OF_UPSTREAMinmake menuconfig, it prependsdts/upstream/to the included paths of the devicetree files. The resulting path for the .dts was then dts/upstream/arch/arm/dts/ and could not be found anymore. When I don't activateCONFIG_OF_UPSTREAM, dts/upstream is in the Makefile's include list anyway so that I easily can include from both locations.
+CC Sumit
Quoted 11 lines
In conclusion, currently I'm calling a .dts for building the u-boot DT from
arch/arm/dts. The file includes upstream stuff as .dtsi fragment from dts/upstream and handoff from local.CONFIG_OF_UPSTREAMdoes not seem to be necessary in this case.This approach currently works for me. If you strongly disagree, I may invest more time to find a way (or why there is currently no way) with
CONFIG_OF_UPSTREAM.This was my question about. Anyway you may wait on v3 to understand better in source what I'm doing, or if I'm just messing around.
I'll wait for V3, sure, good luck.
Sorry for the delayed reply.
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Quoted 55 lines · Marek Vasut
Quoted 39 lines · Lothar Rubusch
Quoted 32 lines · Marek Vasut
On 9/28/24 12:47 AM, Lothar Rubusch wrote:
[...]
Quoted 19 lines
Quoted 13 lines
Quoted 7 lines
Ideally I like to setup some
Kconfigchoice for base board selection and one for boot-mode.1.) In the documentation
control.rstI read that theu-boot.dtsis combined of several elements. Is there a way to take this base .dts, then add a base board .dtsi byKconfigoption, and similar a boot-mode?The
-u-boot.dtsiis preprocessed by C preprocessor, just like all the other DTs, so you can have a-u-boot.dtsifile which contains C preprocessor conditional statements in it to conditionally include other .dtsi files:Quoted 5 lines
#if
IS_ENABLED(...)
#include ...
#else ...
...
#endifQuoted 7 lines
Going through the include list setup by the
Makefilemade me find my mistake. Currently I may use u-boot specific stuff inarch/arm/dtsand include generic .dtsi fragments from dts/upstream. Note: I'm not settingCONFIG_OF_UPSTREAMsince I'm using the regular include list which already contains dts/upstream/src/arm/intel. Is this ok? Or, shall I try a different approach, which involves havingCONFIG_OF_UPSTREAMexplicitely set in the defconfig?Quoted 5 lines
I'm not quite sure I understand the question. Once this platform DTs land in mainline and the DTs get synchronized into U-Boot, you should then set
CONFIG_OF_UPSTREAM. Until then, you could patch the DTs into dts/upstream/ to test the result withOF_UPSTREAMenabled .Quoted 4 lines
Ah, sorry. I did not explain well. Currently I patch the DTs which should go to kernel/mainline into my local u-boot:
dts/upstream/src/arm/intel/socfpga/ as a preparation for my test builds.OK
Quoted 6 lines
For U-boot I will need to build a devicetree file from archarm/dts. I cannot rely just on the upstream fragments for u-boot. Imagine settings like initial fpga bitstream loading, handoff file setup for initialization, etc. In parts I may use .dtsi files from dts/upstream, though, but most of the u-boot particular devicetree setup will reside in
arch/arm/dts, I guess (you may see later in the patches).
Quoted 2 lines
You should be able to use dts/upstream/src/arm/intel/socfpga/ with
-u-boot.dtsifromarch/arm/dts/for this purpose, right ?
Yeah that's a possibility. But are there any plans on pushing currently U-Boot specific DT bits to upstream DT (Linux kernel source)?
Quoted 10 lines
Quoted 7 lines
I noticed when setting the option
CONFIG_OF_UPSTREAMinmake menuconfig, it prependsdts/upstream/to the included paths of the devicetree files. The resulting path for the .dts was then dts/upstream/arch/arm/dts/ and could not be found anymore. When I don't activateCONFIG_OF_UPSTREAM, dts/upstream is in the Makefile's include list anyway so that I easily can include from both locations.+CC Sumit
Yeah that's true it's done on purpose to allow reuse of DT sources includes (.dtsi or header files) even when CONFIG_OF_UPSTREAM isn't enabled.
-Sumit
Quoted 14 lines
Quoted 11 lines
In conclusion, currently I'm calling a .dts for building the u-boot DT from
arch/arm/dts. The file includes upstream stuff as .dtsi fragment from dts/upstream and handoff from local.CONFIG_OF_UPSTREAMdoes not seem to be necessary in this case.This approach currently works for me. If you strongly disagree, I may invest more time to find a way (or why there is currently no way) with
CONFIG_OF_UPSTREAM.This was my question about. Anyway you may wait on v3 to understand better in source what I'm doing, or if I'm just messing around.
I'll wait for V3, sure, good luck.
Sorry for the delayed reply.
Re: [PATCH 2/9] ARM: dts: socfpga: add Enclustra Intel AA1
Dear U-boot community!
Quoted 16 lines · Sumit Garg
Quoted 14 lines · Marek Vasut
Quoted 11 lines · Lothar Rubusch
Quoted 4 lines · Marek Vasut
Quoted 1 line · Lothar Rubusch
Quoted 1 line
[...]
For U-boot I will need to build a devicetree file from archarm/dts. I cannot rely just on the upstream fragments for u-boot. Imagine settings like initial fpga bitstream loading, handoff file setup for initialization, etc. In parts I may use .dtsi files from dts/upstream, though, but most of the u-boot particular devicetree setup will reside in
arch/arm/dts, I guess (you may see later in the patches).
Quoted 7 lines
Quoted 2 lines
You should be able to use dts/upstream/src/arm/intel/socfpga/ with
-u-boot.dtsifromarch/arm/dts/for this purpose, right ?Yeah that's a possibility. But are there any plans on pushing currently U-Boot specific DT bits to upstream DT (Linux kernel source)?
Hum, I have certain requirements when working with Arria10 Socfpga SoMs. Here, I need..
- to do the handoff initialization from DTS (only in u-boot)
- to setup a fpga loader for the bitstream in the DTS (only in u-boot/spl)
- to adjust the boot media, needed for u-boot to know from where to load the fpga.itb
- and to mux the boot-mode in the DT, e.g. QSPI off when booting from MMC, and vice versa
So, time has passed a bit. I don't need different memory declarations. I don't need DTBOs, but I'm applying the #if IS_ENABLED(CONFIG_..) approach, just great! This reduces complexity by far and I can load the major part from dts/upstream. For the rest I noticed the Google Chameleon HW takes a somehow similar approach and I tried to align my DTS setup to use common base for the handoff and early init approach, which reduces the need to add additional files.
Nevertheless, I have to not enable CONFIG_OF_UPSTREAM, since I need to keep the .dts file to reside in arch/arm/dts then taking some of the .dtsi files from dts/upstream. This works and I'll present my solution very soon.
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
I noticed when setting the option
CONFIG_OF_UPSTREAMinmake menuconfig, it prependsdts/upstream/to the included paths of the devicetree files. The resulting path for the .dts was then dts/upstream/arch/arm/dts/ and could not be found anymore. When I don't activateCONFIG_OF_UPSTREAM, dts/upstream is in the Makefile's include list anyway so that I easily can include from both locations.
Quoted 7 lines
Quoted 2 lines
+CC Sumit
Yeah that's true it's done on purpose to allow reuse of DT sources includes (.dtsi or header files) even when
CONFIG_OF_UPSTREAMisn't enabled.
As I said to me this comes in very handy.
So, as an update, I started upstreaming of my DTS parts to the kernel, at least Marek should be in CC, here.
To the u-boot v3 patch set I prepared further brush ups. I changed over to using standard boot env, and currently pretend removing all of the manually provided env. I tried to get further rid of deprecated things and after a major rework of the DT approach now I have mainly one blocking issue.
I'm not sure, perhaps I'll send you the patches together with the
question: The altera_set_storage command in the u-boot env was working with the old GPIO API and without using the DM. So, I defined a small U_BOOT_DRIVER(). I don't want to have DT binding for that device, but rather coming up, when I call uclass_get_device_by_driver(). Nevertheless, this function now does not give me a valid device back.
IMHO I don't even need an extra bind() or probe(), anyway I tried with/without explicit bind(), with probe(), I tried even to do a crafted binding in the DT with the of_match table. But seems I'm missing something essential. I saw other drivers could use GPIOs relatively simple. Do you know an example where I could have a look at?
Then I would use this device and simply implement the altera_set_storage functionaly by the modern GPIO API on the device. I'm a bit unsure what I'm doing wrong here. Perhaps I may show the patches with this issue?
Best regards,
L
PATCH 3/9 ARM: socfpga: add Enclustra AA1 SoM support
In reply to Lothar RubuschIntroduce initial support for the Enclustra SoMs:
- Mercury AA1
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/Kconfig | 1 + board/enclustra/common/Makefile | 4 + board/enclustra/mercury_aa1/Kconfig | 15 ++ board/enclustra/mercury_aa1/MAINTAINERS | 10 + board/enclustra/mercury_aa1/Makefile | 4 + board/enclustra/mercury_aa1/bitstream.its | 32 +++ board/enclustra/mercury_aa1/mercury_aa1.c | 185 ++++++++++++++++++ .../socfpga_enclustra_mercury_aa1_defconfig | 78 ++++++++ include/configs/socfpga_mercury_aa1.h | 33 ++++ 10 files changed, 371 insertions(+) create mode 100644 board/enclustra/common/Kconfig 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/Makefile create mode 100644 board/enclustra/mercury_aa1/bitstream.its create mode 100644 board/enclustra/mercury_aa1/mercury_aa1.c 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
@@ -221,6 +221,10 @@ config TARGET_SOCFPGA_TERASIC_SOCKIT bool "Terasic SoCkit (Cyclone V)" select TARGET_SOCFPGA_CYCLONE5 +config TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + bool "Enclustra Mercury+ AA1" + select TARGET_SOCFPGA_ARRIA10 + endchoice config SYS_BOARD
@@ -244,6 +248,7 @@ config SYS_BOARD default "sr1500" if TARGET_SOCFPGA_SR1500 default "stratix10-socdk" if TARGET_SOCFPGA_STRATIX10_SOCDK default "vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA + default "mercury_aa1" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 config SYS_VENDOR default "intel" if TARGET_SOCFPGA_AGILEX5_SOCDK
@@ -264,6 +269,7 @@ config SYS_VENDOR default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_NANO default "terasic" if TARGET_SOCFPGA_TERASIC_DE10_STANDARD default "terasic" if TARGET_SOCFPGA_TERASIC_SOCKIT + default "enclustra" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 config SYS_SOC default "socfpga"
@@ -289,5 +295,8 @@ config SYS_CONFIG_NAME default "socfpga_sr1500" if TARGET_SOCFPGA_SR1500 default "socfpga_stratix10_socdk" if TARGET_SOCFPGA_STRATIX10_SOCDK default "socfpga_vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA + default "socfpga_mercury_aa1" if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + +source "board/enclustra/common/Kconfig" endif
board/enclustra/common/Kconfig new file +1 -0
@@ -0,0 +1 @@ +source "board/enclustra/mercury_aa1/Kconfig"
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: include/configs/socfpga_mercury_aa1.h +F: configs/socfpga_enclustra_mercury_aa1_defconfig +F: arch/arm/dts/socfpga_enclustra_mercury_aa1.dtsi +F: arch/arm/dts/socfpga_enclustra_mercury_aa1_emmc_boot.dtsi +F: arch/arm/dts/socfpga_enclustra_mercury_aa1_qspi_boot.dtsi
board/enclustra/mercury_aa1/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2024 Enclustra GmbH + +obj-y += mercury_aa1.o
board/enclustra/mercury_aa1/bitstream.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"; + }; + }; +};
board/enclustra/mercury_aa1/mercury_aa1.c new file +185 -0
185 lines not on this page · raw message
configs/socfpga_enclustra_mercury_aa1_defconfig new file +78 -0
78 lines not on this page · raw message
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 3/9] ARM: socfpga: add Enclustra AA1 SoM support
Quoted 14 lines · Lothar Rubusch
Introduce initial support for the Enclustra SoMs:
- Mercury AA1
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.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>
[snip]
Quoted 100 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +94
-0@@ -0,0 +1,185 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#include <command.h> +#include <env.h> +#include <init.h> +#include <dm/uclass.h> +#include <asm-generic/gpio.h> +#include <asm/io.h> + +/* Pin muxing */ +#if !defined(CONFIG_SPL_BUILD ) + +#define ALTERA_NONE 0 +#define ALTERA_MMC 1 +#define ALTERA_QSPI 2 +#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 ; + +#endif + +#if !defined(CONFIG_SPL_BUILD ) + +static void set_mux_mmc (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x8 ,// IO4 connected to SDMMC +0x10 ,0x8 ,// IO5 +0x14 ,0x8 ,// IO6 +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 +u32 len, i, offset, value; + + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +static void set_mux_emmc (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x8 ,// IO4 +0x10 ,0x8 ,// IO5 +0x14 ,0x8 ,// IO6 +0x18 ,0x8 ,// IO7 +0x1c ,0x8 ,// IO8 +0x20 ,0x8 ,// IO9 +0x24 ,0xf ,// IO10 +0x28 ,0xf ,// IO11 +0x2c ,0x8 ,// IO12 +0x30 ,0x8 ,// IO13 +0x34 ,0x8 ,// IO14 +0x38 ,0x8 };// IO15 +u32 len, i, offset, value; + + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +static void set_mux_qspi (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x4 ,// IO4 connected to QSPI +0x10 ,0x4 ,// IO5 +0x14 ,0x4 ,// IO6 +0x18 ,0x4 ,// IO7 +0x1c ,0x4 ,// IO8 +0x20 ,0x4 ,// IO9 +0x24 ,0xf ,// IO10 +0x28 ,0xf ,// IO11 +0x2c ,0xf ,// IO12 +0x30 ,0xf ,// IO13 +0x34 ,0xf ,// IO14 +0x38 ,0xf };// IO15 +u32 len, i, offset, value;
board/enclustra/mercury_aa1/mercury_aa1.c line 104
Quoted 10 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +10
-0+ + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +void altera_set_storage (int store)
Should be static?
Quoted 50 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +50
-0+{ +unsigned int gpio_flash_sel; +unsigned int gpio_flash_oe; + +if (store == altera_current_storage) +return ; + +if (gpio_lookup_name ("portb5" ,NULL ,NULL , &gpio_flash_oe)) { +printf ("ERROR: GPIO not found\n" ); +return ; + } + +if (gpio_request (gpio_flash_oe,"flash_oe" )) { +printf ("ERROR: GPIO request failed\n" ); +return ; + } + +if (gpio_lookup_name ("portc6" ,NULL ,NULL , &gpio_flash_sel)) { +printf ("ERROR: GPIO not found\n" ); +return ; + } + +if (gpio_request (gpio_flash_sel,"flash_sel" )) { +printf ("ERROR: GPIO request failed\n" ); +return ; + } + +switch (store) { +case ALTERA_MMC : +set_mux_mmc (); +gpio_direction_output (gpio_flash_sel,0 ); +gpio_direction_output (gpio_flash_oe,0 ); + altera_current_storage =ALTERA_MMC ; +writel (MMC_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +case ALTERA_EMMC : +set_mux_emmc (); +gpio_direction_output (gpio_flash_sel,1 ); +gpio_direction_output (gpio_flash_oe,1 ); + altera_current_storage =ALTERA_EMMC ; +writel (MMC_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +case ALTERA_QSPI : +set_mux_qspi (); +gpio_direction_output (gpio_flash_sel,1 ); +gpio_direction_output (gpio_flash_oe,0 ); + altera_current_storage =ALTERA_QSPI ; +writel (QSPI_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +default :
board/enclustra/mercury_aa1/mercury_aa1.c line 164
Quoted 10 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +10
-0+ altera_current_storage =ALTERA_NONE ; +break ; + } + +gpio_free (gpio_flash_sel); +gpio_free (gpio_flash_oe); +} + +int altera_set_storage_cmd (struct cmd_tbl *cmdtp,int flag, +int argc,char *const argv[])
Same?
Quoted 11 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +11
-0+{ +if (argc !=2 ) +return CMD_RET_USAGE ; + +if (!strcmp (argv[1 ],"MMC" )) +altera_set_storage (ALTERA_MMC ); +else if (!strcmp (argv[1 ],"QSPI" )) +altera_set_storage (ALTERA_QSPI ); +else if (!strcmp (argv[1 ],"EMMC" )) +altera_set_storage (ALTERA_EMMC ); +else
board/enclustra/mercury_aa1/mercury_aa1.c line 185
Quoted 10 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +10
-0+return CMD_RET_USAGE ; + + return CMD_RET_SUCCESS; +} + +U_BOOT_CMD (altera_set_storage,2 ,0 , altera_set_storage_cmd, +"Set non volatile memory access" , +"<MMC|QSPI|EMMC> - Set access for the selected memory device" ); + +#endif
The entire file seems to be for just adding the cmd. Perhaps rename this file to reflect that and have the Makefile only even build this when CONFIG_SPL_BUILD is not set. And then yes, the later patch will need to be refactored slightly.
Also, the MAINTAINERS entry doesn't cover the documentation (which I'm glad to see being added at the start!) nor the clock driver.
Signature · 1 line
Tom
Re: [PATCH 3/9] ARM: socfpga: add Enclustra AA1 SoM support
Quoted 216 lines · Tom Rini
Quoted 14 lines · Lothar Rubusch
Introduce initial support for the Enclustra SoMs:
- Mercury AA1
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.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>[snip]
Quoted 100 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +94
-0@@ -0,0 +1,185 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#include <command.h> +#include <env.h> +#include <init.h> +#include <dm/uclass.h> +#include <asm-generic/gpio.h> +#include <asm/io.h> + +/* Pin muxing */ +#if !defined(CONFIG_SPL_BUILD ) + +#define ALTERA_NONE 0 +#define ALTERA_MMC 1 +#define ALTERA_QSPI 2 +#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 ; + +#endif + +#if !defined(CONFIG_SPL_BUILD ) + +static void set_mux_mmc (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x8 ,// IO4 connected to SDMMC +0x10 ,0x8 ,// IO5 +0x14 ,0x8 ,// IO6 +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 +u32 len, i, offset, value; + + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +static void set_mux_emmc (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x8 ,// IO4 +0x10 ,0x8 ,// IO5 +0x14 ,0x8 ,// IO6 +0x18 ,0x8 ,// IO7 +0x1c ,0x8 ,// IO8 +0x20 ,0x8 ,// IO9 +0x24 ,0xf ,// IO10 +0x28 ,0xf ,// IO11 +0x2c ,0x8 ,// IO12 +0x30 ,0x8 ,// IO13 +0x34 ,0x8 ,// IO14 +0x38 ,0x8 };// IO15 +u32 len, i, offset, value; + + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +static void set_mux_qspi (void ) +{ +u32 pinmux_arr[] = {0x0c ,0x4 ,// IO4 connected to QSPI +0x10 ,0x4 ,// IO5 +0x14 ,0x4 ,// IO6 +0x18 ,0x4 ,// IO7 +0x1c ,0x4 ,// IO8 +0x20 ,0x4 ,// IO9 +0x24 ,0xf ,// IO10 +0x28 ,0xf ,// IO11 +0x2c ,0xf ,// IO12 +0x30 ,0xf ,// IO13 +0x34 ,0xf ,// IO14 +0x38 ,0xf };// IO15 +u32 len, i, offset, value;board/enclustra/mercury_aa1/mercury_aa1.c line 104
Quoted 10 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +10
-0+ + len =sizeof (pinmux_arr) /sizeof (u32); +for (i =0 ; i < len; i +=2 ) { + offset = pinmux_arr[i]; + value = pinmux_arr[i +1 ]; +writel (value,ALTERA_PINMUX_OFFS + offset); + } +} + +void altera_set_storage (int store)Should be static?
Quoted 50 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +50
-0+{ +unsigned int gpio_flash_sel; +unsigned int gpio_flash_oe; + +if (store == altera_current_storage) +return ; + +if (gpio_lookup_name ("portb5" ,NULL ,NULL , &gpio_flash_oe)) { +printf ("ERROR: GPIO not found\n" ); +return ; + } + +if (gpio_request (gpio_flash_oe,"flash_oe" )) { +printf ("ERROR: GPIO request failed\n" ); +return ; + } + +if (gpio_lookup_name ("portc6" ,NULL ,NULL , &gpio_flash_sel)) { +printf ("ERROR: GPIO not found\n" ); +return ; + } + +if (gpio_request (gpio_flash_sel,"flash_sel" )) { +printf ("ERROR: GPIO request failed\n" ); +return ; + } + +switch (store) { +case ALTERA_MMC : +set_mux_mmc (); +gpio_direction_output (gpio_flash_sel,0 ); +gpio_direction_output (gpio_flash_oe,0 ); + altera_current_storage =ALTERA_MMC ; +writel (MMC_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +case ALTERA_EMMC : +set_mux_emmc (); +gpio_direction_output (gpio_flash_sel,1 ); +gpio_direction_output (gpio_flash_oe,1 ); + altera_current_storage =ALTERA_EMMC ; +writel (MMC_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +case ALTERA_QSPI : +set_mux_qspi (); +gpio_direction_output (gpio_flash_sel,1 ); +gpio_direction_output (gpio_flash_oe,0 ); + altera_current_storage =ALTERA_QSPI ; +writel (QSPI_CLK_DIV ,ALTERA_CLKMGR_MAINPLL_CNTR6CLK_BASE ); +break ; +default :board/enclustra/mercury_aa1/mercury_aa1.c line 164
Quoted 10 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +10
-0+ altera_current_storage =ALTERA_NONE ; +break ; + } + +gpio_free (gpio_flash_sel); +gpio_free (gpio_flash_oe); +} + +int altera_set_storage_cmd (struct cmd_tbl *cmdtp,int flag, +int argc,char *const argv[])Same?
Quoted 21 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +21
-0+{ +if (argc !=2 ) +return CMD_RET_USAGE ; + +if (!strcmp (argv[1 ],"MMC" )) +altera_set_storage (ALTERA_MMC ); +else if (!strcmp (argv[1 ],"QSPI" )) +altera_set_storage (ALTERA_QSPI ); +else if (!strcmp (argv[1 ],"EMMC" )) +altera_set_storage (ALTERA_EMMC ); +else +return CMD_RET_USAGE ; + +return CMD_RET_SUCCESS ; +} + +U_BOOT_CMD (altera_set_storage,2 ,0 , altera_set_storage_cmd, +"Set non volatile memory access" , +"<MMC|QSPI|EMMC> - Set access for the selected memory device" ); + +#endif
(...)
Quoted 3 lines
The entire file seems to be for just adding the cmd. Perhaps rename this file to reflect that and have the
Makefileonly even build this whenCONFIG_SPL_BUILDis not set.
Agree. I applied the above changes/fixed the above mentioned issues. It looks cleaner now. I prepare this in the next version of this patch set. Thank you for the hint. I would name it as aa1_set_storage_cmd() is this ok?
(...)
Quoted 2 lines
Also, the
MAINTAINERSentry doesn't cover the documentation (which I'm glad to see being added at the start!) nor the clock driver.
Added.
Re: [PATCH 3/9] ARM: socfpga: add Enclustra AA1 SoM support
Quoted 19 lines · Lothar Rubusch
Quoted 18 lines · Tom Rini
Quoted 14 lines · Lothar Rubusch
Introduce initial support for the Enclustra SoMs:
- Mercury AA1
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.
Signed-off-by Andreas Buerkler <[email protected]>Signed-off-by Lothar Rubusch <[email protected]>[snip]
[snip]
Quoted 10 lines
Quoted 9 lines
board/enclustra/mercury_aa1/mercury_aa1.c line 185
Quoted 5 lines
board/enclustra/mercury_aa1/mercury_aa1.c new file +5
-0+U_BOOT_CMD (altera_set_storage,2 ,0 , altera_set_storage_cmd, +"Set non volatile memory access" , +"<MMC|QSPI|EMMC> - Set access for the selected memory device" ); + +#endif The entire file seems to be for just adding the cmd. Perhaps rename this file to reflect that and have the
Makefileonly even build this whenCONFIG_SPL_BUILDis not set.
Quoted 3 lines
Agree. It looks cleaner now. I prepare this in the next version of this patch set. Thank you for the hint. I would name it as
aa1_set_storage_cmd()is this ok?
Yes, the name sounds fine. Thanks!
Signature · 1 line
Tom
PATCH 4/9 ARM: socfpga: add Enclustra AA1 extra env settings
In reply to Lothar RubuschAdd command files for boot scripts and initial boot environment.
--- include/configs/socfpga_mercury_aa1.h | 35 +++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
include/configs/socfpga_mercury_aa1.h +35 -0
@@ -21,6 +21,41 @@*/ #define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600, 115200} +/* U-Boot environment */ +#define CFG_EXTRA_ENV_SETTINGS \ + "bitstream_size=0xD00000\0" \ + "bootargs=earlycon console=ttyS0,115200 rw rootwait root=/dev/mmcblk0p3\0" \ + "bootargs_qspi=earlycon console=ttyS0,115200 rw root=/dev/ram0\0" \ + "bootm_size=0x0a000000\0" \ + "env_size=0x80000\0" \ + "fdt_addr_r=0x10000000\0" \ + "fdtfile=system.dtb\0" \ + "fdtload=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${bootdir}/${fdtfile}; load ${devtype} ${devnum}:${distro_bootpart} ${fdto_addr_r} ${bootdir}/${fdtofile}; fdt addr $fdt_addr_r; fdt resize 8192; fdt apply $fdto_addr_r\0" \ + "fdtload_qspi=sf probe; sf read ${fdt_addr_r} ${qspi_offset_addr_devicetree} ${fdt_size}; sf read ${fdto_addr_r} ${qspi_offset_addr_dtoverlay} ${fdto_size}; fdt addr ${fdt_addr_r}; fdt resize 8192; fdt apply ${fdto_addr_r}\0" \ + "fdto_addr_r=0x100c0000\0" \ + "fdtofile=socfpga_enclustra_mercury_XXX_overlay.dtbo\0" \ + "fdto_size=0x40000\0" \ + "fdt_size=0x40000\0" \ + "kernel_addr_r=0x11000000\0" \ + "kernel_size=0x1000000\0" \ + "qspiboot=source ${scriptaddr}\0" \ + "qspiload=setenv bootargs ${bootargs_qspi}; sf probe; sf read ${scriptaddr} ${qspi_offset_addr_boot_script} ${scriptsize}\0" \ + "qspi_offset_addr_bitstream=0x300000\0" \ + "qspi_offset_addr_boot_script=0x200000\0" \ + "qspi_offset_addr_devicetree=0x280000\0" \ + "qspi_offset_addr_dtoverlay=0x2c0000\0" \ + "qspi_offset_addr_kernel=0x1000000\0" \ + "qspi_offset_addr_rootfs=0x2000000\0" \ + "qspi_offset_addr_spl=0x0\0" \ + "qspi_offset_addr_uboot=0x100000\0" \ + "qspi_offset_addr_uboot_env=0x180000\0" \ + "rootfs_addr_r=0x12000000\0" \ + "rootfs_size=0x2000000\0" \ + "scriptaddr=0x10800000\0" \ + "scriptsize=0x80000\0" \ + "spl_size=0x100000\0" \ + "uboot_size=0x80000\0" +/* * L4 OSC1 Timer 0 */
Signature · 1 line
2.25.1
PATCH 5/9 ARM: socfpga: add Enclustra AA1 demo env files
In reply to Lothar RubuschProvide additional uboot.env text environment files meant as a generic demo. The default environment uses a uboot.env. The default environment works somehow. This environment provides better support but only shows one possible approach used in the Enclustra reference design setups.
--- board/enclustra/mercury_aa1/mercury_aa1.env | 65 +++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 board/enclustra/mercury_aa1/mercury_aa1.env
board/enclustra/mercury_aa1/mercury_aa1.env new file +65 -0
@@ -0,0 +1,65 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2024 Enclustra GmbH + * <[email protected]> + * + * This is an example configuration file for uboot.env generation. + * + * Given ENV_FAT_FILE defaults to "uboot.env" and ENV_SIZE defaults to 0x80000 + * (see configuration options). Then adjust the configuration to your needs and + * build the a binary .env file as follows + * $ ./tools/mkenvimage -s 0x80000 -o uboot.env ./board/enclustra/mercury_aa1/mercury_aa1.env + * + * NB: Without providing this binary uboot.env the board is supposed to come up + * with the generic environment based on the architecture. This can be helpful + * when upgrading and/or recuding environments. + */ +bitstream_size=0xD00000 +bootargs=earlycon console=ttyS0,115200 rw rootwait root=/dev/mmcblk0p3 +bootargs_qspi=earlycon console=ttyS0,115200 rw root=/dev/ram0 +bootm_size=0x0a000000 +devnum=0 +devtype=mmc +distro_bootpart=1 +env_size=0x80000 +fdt_addr_r=0x10000000 +fdtfile=system.dtb +fdtload= + load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${bootdir}/${fdtfile}; + load ${devtype} ${devnum}:${distro_bootpart} ${fdto_addr_r} ${bootdir}/${fdtofile}; + fdt addr $fdt_addr_r; + fdt resize 8192; + fdt apply $fdto_addr_r +fdtload_qspi= + sf probe; + sf read ${fdt_addr_r} ${qspi_offset_addr_devicetree} ${fdt_size}; + sf read ${fdto_addr_r} ${qspi_offset_addr_dtoverlay} ${fdto_size}; + fdt addr ${fdt_addr_r}; + fdt resize 8192; + fdt apply ${fdto_addr_r} +fdto_addr_r=0x100c0000 +fdtofile=socfpga_enclustra_mercury_sdmmc_overlay.dtbo +fdto_size=0x40000 +fdt_size=0x40000 +kernel_addr_r=0x11000000 +kernel_size=0x1000000 +qspiboot=source ${scriptaddr} +qspiload= + setenv bootargs ${bootargs_qspi}; + sf probe; + sf read ${scriptaddr} ${qspi_offset_addr_boot_script} ${scriptsize} +qspi_offset_addr_bitstream=0x300000 +qspi_offset_addr_boot_script=0x200000 +qspi_offset_addr_devicetree=0x280000 +qspi_offset_addr_dtoverlay=0x2c0000 +qspi_offset_addr_kernel=0x1000000 +qspi_offset_addr_rootfs=0x2000000 +qspi_offset_addr_spl=0x0 +qspi_offset_addr_uboot=0x100000 +qspi_offset_addr_uboot_env=0x180000 +rootfs_addr_r=0x12000000 +rootfs_size=0x2000000 +scriptaddr=0x10800000 +scriptsize=0x80000 +spl_size=0x100000 +uboot_size=0x80000
Signature · 1 line
2.25.1
PATCH 6/9 ARM: socfpga: add Enclustra AA1 boot scripts
In reply to Lothar RubuschAdd support to boot Enclustra SoMs from MMC, SD or QSPI flash.
--- board/enclustra/bootscripts/qspi-aa1.cmd | 12 ++++++++++++ board/enclustra/bootscripts/sd-aa1.cmd | 10 ++++++++++ 2 files changed, 22 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 +10 -0
@@ -0,0 +1,10 @@ +# 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 Image +fatload mmc $devnum:$distro_bootpart $fdt_addr_r $fdtfile +run fdtload +bootm $kernel_addr_r - $fdt_addr_r
Signature · 1 line
2.25.1
PATCH 7/9 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.
--- board/enclustra/common/Kconfig | 23 +++++ board/enclustra/common/Makefile | 3 + board/enclustra/common/enclustra_mac.h | 48 +++++++++ board/enclustra/common/mac_atsha204.c | 97 +++++++++++++++++++ board/enclustra/common/mac_common.c | 54 +++++++++++ board/enclustra/common/mac_ds28.c | 88 +++++++++++++++++ board/enclustra/mercury_aa1/mercury_aa1.c | 7 ++ .../socfpga_enclustra_mercury_aa1_defconfig | 1 + drivers/misc/Kconfig | 2 +- 9 files changed, 322 insertions(+), 1 deletion(-) 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
board/enclustra/common/Kconfig +23 -0
@@ -1 +1,24 @@ +config ENCLUSTRA_EEPROM_MAC + bool "Enclustra MAC address" + select ATSHA204A + default y if TARGET_SOCFPGA_ENCLUSTRA_MERCURY_AA1 + 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 +97 -0
97 lines not on this page · raw message
board/enclustra/common/mac_common.c new file +54 -0
54 lines not on this page · raw message
board/enclustra/common/mac_ds28.c new file +88 -0
88 lines not on this page · raw message
board/enclustra/mercury_aa1/mercury_aa1.c +7 -0
@@ -11,6 +11,8 @@#include <asm-generic/gpio.h> #include <asm/io.h> +#include "../common/enclustra_mac.h" +/* Pin muxing */ #if !defined(CONFIG_SPL_BUILD )
@@ -27,6 +29,11 @@ static int altera_current_storage = ALTERA_NONE;#endif +int board_late_init (void ) +{ +return enclustra_setup_mac_address (); +} +#if !defined(CONFIG_SPL_BUILD )static void set_mux_mmc (void )
configs/socfpga_enclustra_mercury_aa1_defconfig +1 -0
@@ -26,6 +26,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
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/9 ARM: socfpga: add si5338 clock generator support
In reply to Lothar RubuschThe si5338 clock generator is needed on some Enclustra Socfpga SoMs. Introduce minimal support of this device.
--- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/skyworks/Kconfig | 10 + drivers/clk/skyworks/Makefile | 3 + drivers/clk/skyworks/Si5338-RevB-Registers.h | 441 +++++++++++++++++++ drivers/clk/skyworks/si5338_clkgen.c | 177 ++++++++ drivers/clk/skyworks/si5338_clkgen.h | 18 + 7 files changed, 651 insertions(+) create mode 100644 drivers/clk/skyworks/Kconfig create mode 100644 drivers/clk/skyworks/Makefile create mode 100644 drivers/clk/skyworks/Si5338-RevB-Registers.h create mode 100644 drivers/clk/skyworks/si5338_clkgen.c create mode 100644 drivers/clk/skyworks/si5338_clkgen.h
drivers/clk/Kconfig +1 -0
@@ -259,6 +259,7 @@ source "drivers/clk/qcom/Kconfig" source "drivers/clk/renesas/Kconfig" source "drivers/clk/sunxi/Kconfig" source "drivers/clk/sifive/Kconfig" +source "drivers/clk/skyworks/Kconfig" source "drivers/clk/starfive/Kconfig" source "drivers/clk/stm32/Kconfig" source "drivers/clk/tegra/Kconfig"
drivers/clk/Makefile +1 -0
@@ -44,6 +44,7 @@ obj-$(CONFIG_CLK_QCOM) += qcom/ obj-$(CONFIG_CLK_RENESAS) += renesas/ obj-$(CONFIG_$(SPL_TPL_)CLK_SCMI) += clk_scmi.o obj-$(CONFIG_CLK_SIFIVE) += sifive/ +obj-$(CONFIG_CLK_SKYWORKS_SI5338) += skyworks/ obj-$(CONFIG_CLK_SUNXI) += sunxi/ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/ obj-$(CONFIG_CLK_VERSACLOCK) += clk_versaclock.o
drivers/clk/skyworks/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +# SPDX-License-Identifier: GPL-2.0 + +config CLK_SKYWORKS_SI5338 + bool "Skyworks SI5338 clock generator" + depends on CLK + depends on DM_I2C + depends on SPL_I2C + help + Configure the SI5338 clock generator device. The SI5338 is needed on + some Enclustra Socfpga SoMs.
drivers/clk/skyworks/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_CLK_SKYWORKS_SI5338) += si5338_clkgen.o
drivers/clk/skyworks/Si5338-RevB-Registers.h new file +441 -0
441 lines not on this page · raw message
drivers/clk/skyworks/si5338_clkgen.c new file +177 -0
177 lines not on this page · raw message
drivers/clk/skyworks/si5338_clkgen.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* +* Copyright (C) 2024 Enclustra GmbH +* <[email protected]> +*/ + +#ifndef __SI5338_CLKGEN_H +#define __SI5338_CLKGEN_H + +int si5338_init (void ); + +struct reg_data { +unsigned char reg_addr; +unsigned char reg_val; +unsigned char reg_mask; +}; + +#endif /* __SI5338_CLKGEN_H */
Signature · 1 line
2.25.1
Re: [PATCH 8/9] ARM: socfpga: add si5338 clock generator support
Quoted 10 lines · Lothar Rubusch
The si5338 clock generator is needed on some Enclustra Socfpga SoMs. Introduce minimal support of this device.
Signed-off-by Lothar Rubusch <[email protected]>--- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/skyworks/Kconfig | 10 + drivers/clk/skyworks/Makefile | 3 + drivers/clk/skyworks/Si5338-RevB-Registers.h | 441 +++++++++++++++++++
Is there a matching Linux driver which could be imported instead ?
Re: [PATCH 8/9] ARM: socfpga: add si5338 clock generator support
Quoted 13 lines · Marek Vasut
Quoted 10 lines · Lothar Rubusch
The si5338 clock generator is needed on some Enclustra Socfpga SoMs. Introduce minimal support of this device.
Signed-off-by Lothar Rubusch <[email protected]>--- drivers/clk/Kconfig | 1 + drivers/clk/Makefile | 1 + drivers/clk/skyworks/Kconfig | 10 + drivers/clk/skyworks/Makefile | 3 + drivers/clk/skyworks/Si5338-RevB-Registers.h | 441 +++++++++++++++++++
Quoted 1 line
Is there a matching Linux driver which could be imported instead ?
Well, not that I'm aware of. To be honest, I removed the si5338 related patches. I'm unsure about the approach. The idea is to initialize the clock generator. This is supposed to be done as early as possible. So, at Enclustra u-boot/spl or similar would be preferable. In case I'll present this separately.
PATCH 9/9 ARM: socfpga: make AA1 use si5338 clock gen
In reply to Lothar RubuschApply usage of the si5338 clock generator in Enclustra's AA1 SoM as it has such a chip.
--- board/enclustra/mercury_aa1/mercury_aa1.c | 7 +++++++ configs/socfpga_enclustra_mercury_aa1_defconfig | 2 ++ 2 files changed, 9 insertions(+)
board/enclustra/mercury_aa1/mercury_aa1.c +7 -0
@@ -10,6 +10,7 @@#include <dm/uclass.h> #include <asm-generic/gpio.h> #include <asm/io.h> +#include <dm.h> #include "../common/enclustra_mac.h"
@@ -31,6 +32,12 @@ static int altera_current_storage = ALTERA_NONE;int board_late_init (void ) { +struct udevice *si5338; + +if (IS_ENABLED (CONFIG_CLK_SKYWORKS_SI5338 )) +uclass_get_device_by_driver (UCLASS_CLK ,DM_DRIVER_GET (si5338_clkgen), + &si5338); +return enclustra_setup_mac_address (); }
configs/socfpga_enclustra_mercury_aa1_defconfig +2 -0
@@ -38,6 +38,7 @@ CONFIG_SPL_SYS_MALLOC_SIZE=0x15000 CONFIG_SPL_ENV_SUPPORT=y CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img" CONFIG_SPL_FPGA=y +CONFIG_SPL_I2C=y CONFIG_SPL_SPI_LOAD=y CONFIG_SYS_SPI_U_BOOT_OFFS=0x100000 CONFIG_CMD_ASKENV=y
@@ -58,6 +59,7 @@ CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" CONFIG_SYS_RELOC_GD_ENV_ADDR=y CONFIG_VERSION_VARIABLE=y CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_CLK_SKYWORKS_SI5338=y CONFIG_DWAPB_GPIO=y CONFIG_SYS_I2C_DW=y CONFIG_MISC=y
Signature · 1 line
2.25.1