summaryrefslogtreecommitdiff
path: root/arch
AgeCommit message (Collapse)Author
2022-02-04sunxi: move non-essential code out of s_init()Andre Przywara
So far all Allwinner based boards were doing some not-so-lowlevel-setup in lowlevel's s_init() routine. This includes the initial clock, timer and pinmux setup, among other things. This is clearly out of the "absolute bare minimum to get started" scope that lowlevel_init.S suggests for this function. Since we have an SPL, which is called right after s_init(), move those calls to our board_init_f() function. As we overwrite this only for the SPL, this has the added benefit of not doing this setup *again* shortly afterwards, when running U-Boot proper. This makes gpio_init() to be called from the SPL only, so pull this code into a CONFIG_SPL_BUILD protected part to avoid build warnings. Reviewed-by: Samuel Holland <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Simon Glass <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2022-02-03armv8: start.S: remove CONFIG_SYS_RESET_SCTRL codeAndre Przywara
There is some code that tries to "reset" the SCTLR_ELx register early in the boot process. The idea seems to be to guarantee some sane settings that U-Boot actually relies on, for instance running in little-endian mode, with the MMU off initially. However the current code has multiple problems: - For a start, no platform or config defines the symbol that would enable that code. - The code itself really only works if the bits that it tries to clear are already cleared: - If we run in big-endian mode initially, any previous loads would have been wrong already. That applies to the (optional) relocation code, but more prominently to the mask that it uses to clear those bits: "ldr x1, =0xfdfffffa" looks innocent, but actually involves a memory access to the literal pool, using the current endianness. - If we run with the MMU enabled, we are probably doomed already. We *could* hope that we are running with an identity mapping, but would need to do some cache maintenance to avoid losing dirty cache lines. - The idea of doing a read-modify-write of SCTLR is somewhat questionable to begin with, because as the owner of the current exception level we should initialise all bits of this register with a certain fixed value. - The code is unnecessarily complicated, and the function name is misspelled. While those problems *could* admittedly be fixed, the point that is does not seem to be used at all at the moment tells me we should just remove this code, and be it to not give a bad example. If people care, I could introduce some proper SCTLR initialisation code. We are about to work this out for the boot-wrapper[1] as we speak, but apparently we got away without doing this in U-Boot ever since, so it might not be worth the potential trouble. [1] https://lore.kernel.org/linux-arm-kernel/[email protected]/ Signed-off-by: Andre Przywara <[email protected]>
2022-02-03armv8: spl: Fix build with LINUX_KERNEL_IMAGE_HEADERAlper Nebi Yasak
Setting LINUX_KERNEL_IMAGE_HEADER=y attempts to include an ARM64 Linux kernel image header at the start of both U-Boot proper and SPL binaries. However, some definitions that the image header uses are not included by the SPL linker script, resulting in a build error. Include them the way they are included in U-Boot proper's linker script to fix the error. Signed-off-by: Alper Nebi Yasak <[email protected]>
2022-02-01arm: dts: ls1028a-qds: declare in-band autoneg for Ethernet portsVladimir Oltean
The commit in the Fixes: tag below broke traffic through switch ports where the SERDES protocol requires in-band autoneg and this requirement isn't described in the device tree: SGMII, QSGMII, USXGMII (with 2500Base-X, in-band autoneg isn't supported). The LS1028A-QDS boards are not yet ready for syncing their device trees with Linux, since Ethernet is missing there (but has been submitted): https://lore.kernel.org/lkml/[email protected]/ When agreement is reached for the Ethernet support in Linux, there will be a sync for these boards as well. For now, just enable in-band autoneg to fix the breakage. Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info") Cc: Ramon Fried <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: sync device tree with LinuxVladimir Oltean
Allow device trees to be reused between Linux and U-Boot. The source for these device trees is linux-next as of commit bd8a9cd624c6 ("arm64: dts: ls1028a-rdb: update copyright"), which was chosen because some changes needed to be done to the Linux DTs too, before they could be shared: https://lore.kernel.org/linux-arm-kernel/[email protected]/T/#m6f63c92e75fa79a01144b2c2c6dc4776e7971395 There are two more commits on the RDB device tree which haven't been picked up yet, because they have dependencies on the SoC device tree: dd3d936a1b17 ("arm64: dts: ls1028a: add ftm_alarm1 node to be used as wakeup source") b2e2d3e02fb6 ("arm64: dts: ls1028a-rdb: enable pwm0") These will be picked up on the next resync. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: enable PCIe controllers from U-Boot dtsiVladimir Oltean
Reuse the scheme implemented by the Kontron SL28 boards in commit d08011d7f9b4 ("arm: dts: ls1028a: disable the PCIe controller by default") and move the 'status = "okay"' lines for the PCIe controllers inside a separate U-Boot dtsi for the LS1028A-RDB board. This way, the existing Linux device tree can simply be dropped in. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: disable I2C buses 1 through 7Vladimir Oltean
There is no I2C peripheral on these buses on the reference design board, and the Linux device tree does not enable them either. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: disable DSPI nodesVladimir Oltean
There is no SPI peripheral on the LS1028A-RDB, therefore no reason to enable these nodes in the U-Boot device tree (and Linux does not enable them either). Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: sync Ethernet device tree nodes with LinuxVladimir Oltean
In a bit of a blunder, the blamed commit in the Fixes: tag below made the mscc_felix switch driver look at the 'managed = "in-band-status"' device tree property, forgetting that the U-Boot device tree had not been updated to include that property, whereas the Linux one does. The switch is therefore described in the device tree as not requiring in-band autoneg, but the PHY driver for VSC8514 (drivers/net/phy/mscc.c) still enables that feature. This results in a mismatch => no traffic. This patch is a copy-paste of the Ethernet device tree nodes from Linux, which resolves that issue. The device tree update also renames the Ethernet PHY labels. Fixes: e3789a726269 ("net: dsa: felix: configure the in-band autoneg property based on OF node info") Cc: Ramon Fried <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: sort nodes alphabeticallyVladimir Oltean
The nodes in the NXP LS1028A-RDB device tree are out of order, regroup them alphabetically to have a simple delta when the Linux device tree is brought in. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: lx2160a-rdb: use Linux compatible string for RTCVladimir Oltean
During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LX2160A-RDB to use the compatible string that was established in Linux. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm: dts: ls1028a-rdb: use Linux compatible string for RTCVladimir Oltean
During this board's sync with Linux device trees, it was observed that it doesn't use the same compatible string for the RTC node as in U-Boot. This change makes the RTC compatible strings match, for a smoother sync. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Michael Walle <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: dts: ls1028a-qds: use Linux compatible string for RTCVladimir Oltean
The LS1028A-QDS board won't be synced with the Linux device trees right now, since those are currently still in progress (Ethernet is missing). However, while we're at converting the RDB, it can be observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the QDS to use the compatible string that was established in Linux. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm: dts: lx2160a-qds: use Linux compatible string for RTCVladimir Oltean
During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LX2160A-QDS to use the compatible string that was established in Linux. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm: dts: ls1088a-rdb: use Linux compatible string for RTCVladimir Oltean
During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LS1088A-RDB to use the compatible string that was established in Linux. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm: dts: ls1088a-qds: use Linux compatible string for RTCVladimir Oltean
During the LS1028A-RDB sync with Linux device trees, it was observed that the same RTC is present on the two boards, and the wrong compatible string is used in both places. This change updates the RTC from the LS1088A-QDS to use the compatible string that was established in Linux. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Priyanka Jain <[email protected]> Reviewed-by: Michael Walle <[email protected]>
2022-02-01arm/expu1/seli8: adapt dts NOR partition table to the latest usedAleksandar Gerasimovski
Even not used by u-boot, this has to be inline with the hw and kernel dts. U-boot partition table is defined by MTDPARTS_DEFAULT Kconfig. Signed-off-by: Aleksandar Gerasimovski <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01arm: ls1021a: limit debug eth phy speed to 100MbpsAleksandar Gerasimovski
Beside that mounted rgmii debug phy is 1000Mbps capable, the debug link between the piggy board and the phy is 100Mbps only. This leads to longer link establishment time when working in debug mode, as phy tries to autoneg 1000Mbps. This patch fixes the speed to 100Mbps and allows smother link establishment time for the debug interface. Signed-off-by: Aleksandar Gerasimovski <[email protected]> Reviewed-by: Priyanka Jain <[email protected]>
2022-02-01board: traverse: add initial Ten64 supportMathew McBride
The Ten64 is a networking-oriented MiniITX board using the NXP LS1088A SoC. This patch provides the bare minimum to support Ten64 boards under U-Boot for distroboot. Some related drivers have not yet been submitted and this basic support lacks some of the opinionated defaults provided by our firmware distribution. Signed-off-by: Mathew McBride <[email protected]> [Rebased] Signed-off-by: Priyanka Jain <[email protected]>
2022-01-31arm: kirkwood: Pogoplug-V4 : Add Kconfig filesTony Dinh
Add Kconfig files for Pogoplug V4 board Signed-off-by: Tony Dinh <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Reviewed-by: Pali Rohár <[email protected]>
2022-01-31arm: kirkwood: Pogoplug-V4 : Add DTS filesTony Dinh
Add DTS files for Pogoplug V4 board Reviewed-by: Stefan Roese <[email protected]> Signed-off-by: Tony Dinh <[email protected]> Reviewed-by: Pali Rohár <[email protected]>
2022-01-30sunxi: Fix H616 DRAM read calibration for dual rankJernej Skrabec
Although it isn't known what bit 0 in PHY reg 8 does, it's obvious that it has to be set before read calibration and cleared afterwards. This is already done for first rank, but not for second (copy & paste error.) Fix it. Fixes: f4317dbd06b6 ("sunxi: Add H616 DRAM support") Signed-off-by: Jernej Skrabec <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2022-01-30sunxi: fix H616 DRAM ODT supportJernej Skrabec
Kconfig symbol is missing CONFIG_ prefix, so compiler will always skip ODT configuration. Fix symbol name. Fixes: f4317dbd06b6 ("sunxi: Add H616 DRAM support") Signed-off-by: Jernej Skrabec <[email protected]> Reviewed-by: Andre Przywara <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2022-01-30sunxi: Add option to prevent booting on power plug-inChris Morgan
For sunxi boards with the AXP209, AXP221, AXP809, and AXP818 PMICs (plus possibly others, I only confirmed the datasheets for these), it is sometimes desirable to not boot whenever the device is plugged in. An example would be when using the NTC CHIP inside a PocketCHIP. This provides a configurable option to check if bit 0 of register 0 of the PMIC says it was powered because of a power button press (0) or a plug-in event (1). If the value is 1 and this option is selected, the device shuts down shortly after printing a message to console stating the reason why it's shutting down. Powering up the board with the power button is not affected. Signed-off-by: Chris Morgan <[email protected]> [Andre: reword to speak of boot, remove #ifdefs] Signed-off-by: Andre Przywara <[email protected]>
2022-01-30sunxi: gpio: Fix up pointer arithmeticAndre Przywara
The calls for flipping bits in the Allwinner pin controller registers were using unnecessarily complex pointer arithmetic. Improve readability by simplifying the expression. Signed-off-by: Andre Przywara <[email protected]>
2022-01-30sunxi: gpio: Add per-bank drive and pull settersSamuel Holland
The GPIO and pinctrl drivers need these setters for pin configuration. Since they are DM drivers, they should not be using hardcoded base addresses. Factor out variants of the setter functions which take a pointer to the GPIO bank's MMIO registers. Signed-off-by: Samuel Holland <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2022-01-30sunxi: gpio: Return void from setter functionsSamuel Holland
The return values of these functions are always zero, and they are never checked. Since they are not needed, remove them. Signed-off-by: Samuel Holland <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Andre Przywara <[email protected]>
2022-01-28ARM: dts: k3-am642-sk: Disable cpsw_port1 in SPLVignesh Raghavendra
ROM supports cpsw_port2 for Ethernet boot and SPL stages continue to download images on the same port, therefore there is no need to enable cpsw_port1. Disable the same. Signed-off-by: Vignesh Raghavendra <[email protected]>
2022-01-25sandbox: eth-raw: fix building with musl libraryHeinrich Schuchardt
The definition of struct udphdr in include netinet/udp.h in the musl library differs from the definition in the glibc library. To use the same definition with musl the symbol _GNU_SOURCE has to be defined. Reported-by: Milan P. Stanić <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Tested-by: Milan P. Stanić <[email protected]>
2022-01-25x86: Move acpi_get_rsdp_addr() ACPI tables to the writerSimon Glass
Move this over to use a writer file, moving the code from the x86 implementation. There is no need to store a separate variable since we can simply access the ACPI context. With this, the original monolithic x86 function for writing ACPI tables is gone. Note that QEMU has its own implementation. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move device-specific ACPI tables to a writer functionSimon Glass
Move this over to use a writer function, moving the code from the x86 implementation. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: acpi: Update acpi_fill_csrt() to use acpi_ctxSimon Glass
Update this function to the newer style, so we can avoid passing and returning an address through this function. Also move this function out of the x86 code so it can be used by other archs. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2022-01-25x86: Move CSRT table to a writer functionSimon Glass
Move this table over to use a writer function, moving the code from the x86 implementation. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move TCPA table to a writer functionSimon Glass
Move this table over to use a writer function, for x86 only. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move MADT table to a writer functionSimon Glass
Move this table over to use a writer function, for x86 only. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move TPM2 table to a writer functionSimon Glass
Move this table over to use a writer function, for x86 only. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move SSDT table to a writer functionSimon Glass
Move this table over to use a writer function, moving the code from the x86 implementation. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move FACP table into separate functionsSimon Glass
Each board has its own way of creating this table. Rather than calling the acpi_create_fadt() function for each one from a common acpi_write_fadt() function, just move the writer into the board-specific code. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]>
2022-01-25x86: Move FADT table to a writer functionSimon Glass
Move this table over to use a writer function, for x86 only. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move GNVS table to a writer functionSimon Glass
Move this table over to use a writer function, for x86 only. Handle the two cases Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move DSDT table to a writer functionSimon Glass
Move this table over to use a writer function, moving the code from the x86 implementation. Add a pointer to the DSDT in struct acpi_ctx so we can reference it later. Disable this table for sandbox since we don't actually compile real ASL code. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move FACS table to a writer functionSimon Glass
Move this table over to use a writer function, moving the code from the x86 implementation. Add a pointer to the DSDT in struct acpi_ctx so we can reference it later. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Move base tables to a writer functionSimon Glass
Use the new ACPI writer to write the base tables at the start of the area, moving this code from the x86 implementation. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Use the ACPI table writerSimon Glass
Use the new ACPI writer to write the ACPI tables. At present this is all done in one monolithic function. Future work will split this out. Unfortunately the QFW write_acpi_tables() function conflicts with the 'writer' version, so disable that for sandbox. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: acpi: Split out context creation from base tablesSimon Glass
At present acpi_setup_base_tables() both sets up the ACPI context and writes out the base tables. We want to use an ACPI writer to write the base tables, so split this function into two, with acpi_setup_ctx() doing the context set, and acpi_setup_base_tables() just doing the base tables. Disable the writer's write_acpi_tables() function for now, to avoid build errors. It is enabled in a following patch. Signed-off-by: Simon Glass <[email protected]>
2022-01-25acpi: Move acpi_fill_header() to the generic headerSimon Glass
This function is not x86-specific so move it into the common header file. Signed-off-by: Simon Glass <[email protected]>
2022-01-25acpi: Use finer-grained control of ACPI-table generationSimon Glass
Rather than keying everything off ACPIGEN, use the main GENERATE_ACPI_TABLE option to determine whether the core ACPI code is included. Make sure these option are not enabled in SPL/TPL since we never generate tables there. Signed-off-by: Simon Glass <[email protected]>
2022-01-25sandbox: Allow building with GENERATE_ACPI_TABLESimon Glass
At present this option is missing a header file, a function prototype and the qfw driver needs a header included. Fix these problems so we can enable this option on sandbox. This will increase the build coverage. Signed-off-by: Simon Glass <[email protected]>
2022-01-25x86: Tidy up use of CONFIG_ACPIGENSimon Glass
This is enabled for quite a few boards which don't create ACPI tables. Tidy this up by dropping the option for some boards. Signed-off-by: Simon Glass <[email protected]>
2022-01-25arm: Allow supporting ACPI-table generationSimon Glass
Some ARM boards are using ACPI now. It seems that U-Boot should support this method. Add ARM to the list of archs which can generate ACPI tables. Signed-off-by: Simon Glass <[email protected]>