aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-13arm: kirkwood: Add CONFIG_SUPPORT_PASSING_ATAGSTony Dinh
Add CONFIG_SUPPORT_PASSING_ATAGS and friends to support legacy image method of booting. Debian and OpenWrt installer use uImage with appended DTB for these Kirkwood boards. Signed-off-by: Tony Dinh <mibodhi@gmail.com> Reviewed-by: Stefan Roese <sr@denx.de>
2022-09-12Merge tag 'dm-pull-12sep22' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-dm Binman VPL support (patch was lost) Add board_rng_seed() as a temporary solution
2022-09-12binman: Add VPL supportSimon Glass
Add support for U-Boot's Verifying Program Loader phase. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-09-12fdt_support: add optional board_rng_seed() hookRasmus Villemoes
A recurring theme on LKML is the boot process deadlocking due to some process blocking waiting for random numbers, while the kernel's Cryptographic Random Number Generator (crng) is not initalized yet, but that very blocking means no activity happens that would generate the entropy necessary to finalize seeding the crng. This is not a problem on boards that have a good hwrng (when the kernel is configured to trust it), whether in the CPU or in a TPM or elsewhere. However, that's far from all boards out there. Moreover, there are consumers in the kernel that try to obtain random numbers very early, before the kernel has had any chance to initialize any hwrng or other peripherals. Allow a board to provide a board_rng_seed() function, which is responsible for providing a value to be put into the rng-seed property under the /chosen node. The board code is responsible for how to actually obtain those bytes. - One possibility is for the board to load a seed "file" from somewhere (it need not be a file in a filesystem of course), and then ensure that that the same seed file does not get used on subsequent boots. * One way to do that is to delete the file, or otherwise mark it as invalid, then rely on userspace to create a new one, and living with the possibility of not finding a seed file during some boots. * Another is to use the scheme used by systemd-boot and create a new seed file immediately, but in a way that the seed passed to the kernel and the new (i.e. next) seed cannot be deduced from each other, see the explanation at https://lore.kernel.org/lkml/20190929090512.GB13049@gardel-login/ and the current code at https://github.com/systemd/systemd/blob/main/src/boot/efi/random-seed.c - The board may have an hwrng from which some bytes can be read; while the kernel can also do that, doing it in U-Boot and providing a seed ensures that even very early users in the kernel get good random numbers. - If the board has a sensor of some sort (temperature, humidity, GPS, RTC, whatever), mixing in a reading of that doesn't hurt. - etc. etc. These can of course be combined. The rng-seed property is mixed into the pool used by the linux kernel's CRNG very early during boot. Whether it then actually contributes towards the kernel considering the CRNG initialized depends on whether the kernel has been configured with CONFIG_RANDOM_TRUST_BOOTLOADER (nowadays overridable via the random.trust_bootloader command line option). But that's for the BSP developer to ultimately decide. So, if the board needs to have all that logic, why not also just have it do the actual population of /chosen/rng-seed in ft_board_setup(), which is not that many extra lines of code? I considered that, but decided handling this logically belongs in fdt_chosen(). Also, apart from saving the board code from the few lines of boilerplate, doing it in ft_board_setup() is too late for at least some use cases. For example, I want to allow the board logic to decide ok, let's pass back this buffer and use that as seed, but also let's set random.trust_bootloader=n so no entropy is credited. This requires the rng-seed handling to happen before bootargs handling. For example, during the very first boot, the board might not have a proper seed file, but the board could still return (a hash of) some CPU serial# or whatnot, so that at least no two boards ever get the same seed - the kernel always mixes in the value passed in rng-seed, but if it is not "trusted", the kernel would still go through the same motions as it would if no rng-seed was passed before considering its CRNG initialized. I.e., by returning that unique-to-this-board value and setting random.trust_bootloader=n, the board would be no worse off than if board_rng_seed() returned nothing at all. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2022-09-09Merge tag 'efi-2022-10-rc5' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2022-10-rc5 Documentation: * man-page for tftpput UEFI: * fix driver binding protocol for block IO devices * don't delete invalid handles * add a unit test for the EFI Conformance Profile Table Other: * correct short text for tftpboot
2022-09-09efi_driver: don't bind internal block devicesHeinrich Schuchardt
UEFI block devices can either mirror U-Boot's internal devices or be provided by an EFI application like iPXE. When ConnectController() is invoked for the EFI_BLOCK_IO_PROTOCOL interface for such an application provided device we create a virtual U-Boot block device of type "efi_blk". Currently we do not call ConnectController() when handles for U-Boot's internal block devices are created. If an EFI application calls ConnectController() for a handle relating to an internal block device, we erroneously create an extra "efi_blk" block device. E.g. the UEFI shell has a command 'connect -r' which calls ConnectController() for all handles with device path protocol. In the Supported() method of our EFI_DRIVER_BINDING_PROTOCOL return EFI_UNSUPPORTED when dealing with an U-Boot internal device. Reported-by: Etienne Carriere <etienne.carriere@linaro.org> Fixes: commit 05ef48a2484b ("efi_driver: EFI block driver") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org> Tested-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-09lib: efi_loader: don't delete invalid handlesEtienne Carriere
Change efi_delete_handle() to not free EFI handles twice. This change tries to resolved an issue seen since U-Boot v2022.07 in which ExitBootService() attempts to release some EFI handles twice. The issue was seen booting a EFI shell that invokes 'connect -r' and then boots a Linux kernel. Execution of connect command makes EFI subsystem to bind a block device for each root block devices EFI handles. However these EFI device handles are already bound to a driver and we can have 2 registered devices relating to the same EFI handler. On ExitBootService(), the loop removing the devices makes these EFI handles to be released twice which corrupts memory. This patch prevents the memory release operation caused by the issue but but does not resolve the underlying problem. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Add log message. Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-09efi_selftest: unit test for EFI Conformance Profile TableHeinrich Schuchardt
Add a new unit test to test the integrity of the EFI Conformance Profile Table. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2022-09-09efi_selftest: export efi_st_get_config_table()Heinrich Schuchardt
We can use efi_st_get_config_table() in multiple unit tests. Export the function. Export system-table and boot-services. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-09-09doc: man-page for tftpputHeinrich Schuchardt
Provide a man-page for the tftpput command. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-09cmd: correct short text for tftpbootHeinrich Schuchardt
The command's name is a misnomer. The command loads a file but does not run (boot) it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-09cmd: fix tftpput commandHeinrich Schuchardt
Calling tftpput with less than 2 arguments must lead to a failure. If tftpput is called with two arguments, these are the address and the size of the file to be transferred. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-09-08Merge tag 'u-boot-stm32-20220907' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-stm - simplify the STM32MP15x package parsing code - remove test on CONFIG_DM_REGULATOR in stm32mp1 board and enable CONFIG_DM_REGULATOR for stm32f769-disco - handle ck_usbo_48m clock provided by USBPHYC to fix the command 'usb start' after alignment with Linux kernel v5.19 DT (clocks = <&usbphyc>) - Fix SYS_HZ_CLOCK value for stih410-b2260 board - Switch STMM32MP15x DHSOM to FMC2 EBI driver - Remove hwlocks from pinctrl in STM32MP15x to avoid issue with kernel
2022-09-07Merge tag 'fsl-qoriq-2022-9-7' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq - Pali's patch not in my patchwork, got missed. - Sean's patch pending for sometime, I just fix conflict when apply Sean's patch, so pick up.
2022-09-07Merge tag 'dm-pull-7sep22' of https://source.denx.de/u-boot/custodians/u-boot-dmTom Rini
binman fixes for bintool support
2022-09-07net: fm: Add support for FIT firmwareSean Anderson
Fman microcode is executable code (AFAICT) loaded into a coprocessor. As such, if verified boot is enabled, it must be verified like other executable code. However, this is not currently done. This commit adds verified boot functionality by encapsulating the microcode in a FIT, which can then be signed/verified as normal. By default we allow fallback to unencapsulated firmware, but if CONFIG_FIT_SIGNATURE is enabled, then we make it mandatory. Because existing Layerscape do not use this config (instead enabling CONFIG_CHAIN_OF_TRUST), this should not break any existing boards. An example (mildly-abbreviated) its is provided below: / { #address-cells = <1>; images { firmware { data = /incbin/(/path/to/firmware); type = "firmware"; arch = "arm64"; compression = "none"; signature { algo = "sha256,rsa2048"; key-name-hint = "your key name"; }; }; }; configurations { default = "conf"; conf { description = "Load FMAN microcode"; fman = "firmware"; }; }; }; Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07net: Convert fit verification to use fit_get_data_*Sean Anderson
Several ethernet drivers load firmware from FIT images. Convert them to use the fit_get_data helpers. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07cmd: fpga: Convert to use fit_get_data_nodeSean Anderson
This converts the FIT loading process of the fpga command to use fit_get_data_node. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07ARMv8/sec_firmware: Convert to use fit_get_data_conf_propSean Anderson
This reduces sec_firmware_get_data to a single call to fit_get_data_conf_prop. I think sec_firmware_check_copy_loadable could also be converted, but it does not map as straightforwardly, so I have left it for a future cleanup. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07image: fit: Add some helpers for getting dataSean Anderson
Several different firmware users have repetitive code to extract the firmware data from a FIT. Add some helper functions to reduce the amount of repetition. fit_conf_get_prop_node (eventually) calls fdt_check_node_offset_, so we can avoid an explicit if. In general, this version avoids printing on error because the callers are typically library functions, and because the FIT code generally has (debug) prints of its own. One difference in these helpers is that they use fit_image_get_data_and_size instead of fit_image_get_data, as the former handles external data correctly. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07ARMv8/sec_firmware: Remove SEC_FIRMWARE_FIT_CNF_NAMESean Anderson
The config to use for FIT images can be better specified by enabling CONFIG_MULTI_DTB_FIT and implementing board_fit_config_name_match. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07board: freescale: p1_p2_rdb_pc: Calculate offsets for eSDHC boot sectorPali Rohár
Correctly calculate offsets between SPL and proper U-Boot when new config option CONFIG_FSL_PREPBL_ESDHC_BOOT_SECTOR for generating eSDHC boot sector is enabled. Otherwise SPL would not be able to boot proper U-Boot. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07board: freescale: p1_p2_rdb_pc: Delete watchdog max6370 node in load_default ↵Pali Rohár
mode CPLD in load_default mode ignores watchdog reset signal. It does not reset board when watchdog triggers reset signal. Detect load_default mode by GPIO7 - LOAD_DEFAULT_N and delete watchdog max6370 node from device to prevent registering driver for non-working watchdog. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-07board: freescale: p1_p2_rdb_pc: Add env commands norlowerboot, norupperboot, ↵Pali Rohár
sd2boot and defboot All *boot env commands overrides default boot source location via i2c. After board reset without power off, BootROM then starts booting U-Boot from this specified location instead of the default one. Add new env command defboot which reverts boot location to the default value, which in most cases is configurable by HW DIP switches. And add new env commands norlowerboot, norupperboot, sd2boot to boot from other locations. norlowerboot would instruct BootROM to boot from lower NOR bank, norupperboot from upper NOR bank and sd2boot from SD card with alternative configuration. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06ARM: dts: stm32mp15: remove hwlocks from pinctrlEtienne Carriere
Removes hwlocks properties from stm32mp151 pinctrl node. These locks could be used for other purpose, depending on board and software configuration hence do not enforce their use to protect pinctrl devices. This patch is an alignment with Linux device tree with v6.0 as the hwsem support wasn’t yet added in pincontrol in kernel. It avoids issues when the Linux kernel is started with the U-Boot device tree. Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-06ARM: stm32: Switch DHSOM to FMC2 EBI driverMarek Vasut
Perform long overdue conversion of ad-hoc FMC2 EBI bus initialization to upstream FMC2 EBI driver. No functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-06Merge https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini
2022-09-06Merge tag 'fsl-qoriq-2022-9-6' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq Reset fixes for p1_p2_rdb_pc Fix use after free issue fix in fsl_enetc.c Fix for fsl ddr: make bank_addr_bits reflect actual bits sl28 board update
2022-09-06configs: stih410-b2260: Fix SYS_HZ_CLOCK valuePatrice Chotard
SYS_HZ_CLOCK was wrongly set to 1GHz whereas it's set to 750MHz by default by bootrom. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Grzegorz Szymaszek <gszymaszek@short.pl>
2022-09-06configs: stm32: Enable CONFIG_DM_REGULATOR for stm32f769-discoPatrice Chotard
Since commit 5bc6f8c2a97e("video: stm32: remove test on CONFIG_DM_REGULATOR") backlight was broken with the following message at boot: stm32-display-dsi dsi@40016c00: Warning: cannot get phy dsi supply stm32_display display-controller@40016800: panel panel enable backlight error -38 DM_REGULATOR flag must be enabled to fix this issue Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-06ARM: dts: stm32: Fix display-timings settings for stm32f746-discoPatrice Chotard
Since commit ef4ce6df3289 "video: stm32: stm32_ltdc: fix data enable polarity" The panel display output wasn't functional anymore. Device tree display-timings de-active property value must be updated to 1. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-09-06clk: stm32mp: handle ck_usbo_48m clock provided by USBPHYCPatrick Delaunay
Handle the input clock of RCC USB_PHY_48, provided by USBPHYC and named "ck_usbo_48m". Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-09-06phy: stm32-usbphyc: usbphyc is a clock provider of ck_usbo_48m clockPatrick Delaunay
ck_usbo_48m is generated by usbphyc PLL and used by OTG controller for Full-Speed use cases with dedicated Full-Speed transceiver. ck_usbo_48m is available as soon as the PLL is enabled. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-09-06phy: stm32-usbphyc: add counter of PLL consumerPatrick Delaunay
Add the counter of the PLL user n_pll_cons managed by the 2 functions stm32_usbphyc_pll_enable / stm32_usbphyc_pll_disable. This counter allow to remove the function stm32_usbphyc_is_init and it is a preliminary step for ck_usbo_48m introduction. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-09-06board: stm32mp1: remove test on CONFIG_DM_REGULATORPatrick Delaunay
The tests on CONFIG_DM_REGULATOR, added to avoid compilation issues, can now be removed, they are no more needed since the commit 16cc5ad0b439 ("power: regulator: add dummy helper"). Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-09-06stm32mp: simplify the STM32MP15x package parsing codePatrick Delaunay
Simplify the package parsing code for STM32MP15X as package can be affected with get_cpu_package() result. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-09-06board: freescale: p1_p2_rdb_pc: Turn off watchdog before resetPali Rohár
P1/P2 RDB boards have external max6370 watchdog connected to CPLD and this watchdog is not deactivated on board reset. So if it is active during board reset, it can trigger another reset when CPU is booting U-Boot. To prevent possible infinite reset loop caused by external watchdog, turn it off before reset. Do it via a new board_reset_prepare() callback which is called from do_reset() function before any reset sequence. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: freescale: p1_p2_rdb_pc: Avoid usage of CPLD's system reset registerPali Rohár
CPLD's system reset register is buggy and requires workaround in U-Boot. So use this kind of board reset only when there is no other reset option. Introduce a new board_reset_last() callback which is last-stage board-specific reset and implement CPLD's system reset in this new board_reset_last() callback instead of board_reset() callback. Fixes: 20fb58fc5a1c ("board: freescale: p1_p2_rdb_pc: Implement board_reset()") Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: freescale: p1_p2_rdb_pc: Add workaround for non-working watchdogPali Rohár
If watchdog timer was already set to non-disabled value then it means that watchdog timer was already activated, has already expired and caused CPU reset. If this happened then due to CPLD firmware bug, writing to wd_cfg register has no effect and therefore it is not possible to reactivate watchdog timer again. Watchdog starts working again after CPU reset via non-watchdog method. Implement this workaround (reset CPU when it was reset by watchdog) to make watchdog usable again. Watchdog timer logic on these P1/P2 RDB boards is connected to CPLD, not to SoC itself. Note that reset does not occur immediately after calling do_reset(), but after few ms later as real reset is done by CPLD. So it is normal that function do_reset() returns. Therefore hangs after calling do_reset() to prevent CPU execution of the rest U-Boot code. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: freescale: p1_p2_rdb_pc: Add workaround for board reset reboot loopPali Rohár
CPLD's system reset register on P1/P2 RDB boards is not autocleared after flipping it. If this register is set to one in 100ms after reset starts then CPLD triggers another CPU reset. This means that trying to reset board via CPLD system reset register cause reboot loop. To prevent this reboot loop, the only workaround is to try to clear CPLD's system reset register as early as possible. U-Boot is already doing it in its board_early_init_f() function, which seems to be enough as register is cleared prior CPLD triggers another reset. But board_early_init_f() is not called from SPL and therefore usage of SPL can cause reboot loop. To prevent reboot loop when using SPL, call board_early_init_f() function in SPL too. For accessing CPLD memory space it is needed to have CPLD entry in TLB. With this change it is possible to trigger board reset via CPLD's system reset register on P2020 RDB board. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06RISC-V: enable CONFIG_SYSRESET_SBI by defaultHeinrich Schuchardt
System reset via the SRST extension in the SBI should be the default. The driver checks if the extension is available when probing. So there is no risk in enabling it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-06cmd/sbi: format KVM versionHeinrich Schuchardt
Format the KVM implementation number in a human readable form. With the patch output of the sbi command for Linux 5.19.1 looks like: => sbi SBI 0.3 KVM 5.19.1 Machine: Vendor ID 0 Architecture ID 7005c Implementation ID 7005c Extensions: SBI Base Functionality Timer Extension IPI Extension RFENCE Extension Hart State Management Extension System Reset Extension Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-06riscv: dts: sifive: Synchronize FU740 and Unmatched DTIcenowy Zheng
These DT files are synchronized from Linux 5.19. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-06dt-bindings: clock: sifive: sync FU740 PRCI clock binding headerIcenowy Zheng
This commit sychronizes the header file for FU740 PRCI clocks with the one from Linux 5.19. The constant values are the same, but all constant names are changed (most are just prefixed with FU740_). Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2022-09-06net: enetc: Fix use after free issue in fsl_enetc.cSiarhei Yasinski
If ethernet connected to SFP, like this: &enetc_port0 { phy-connection-type = "sgmii"; sfp = <&sfp0>; managed = "in-band-status"; status = "okay"; }; Then enetc_config_phy returns -ENODEV and the memory containing the mdio interface is freed. It's better to unregister and free mdio resources. Signed-off-by: Siarhei Yasinski <siarhei.yasinski@sintecs.eu> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ramon Fried <rfried.dev@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06ddr: fsl: Make bank_addr_bits reflect actual bitsSean Anderson
In both the Freescale DDR controller and the SPD spec, bank address bits are stored as the number of bank address bits minus 2. For example, if a chip had 8 banks (3 total bank address bits), the value of bank_addr_bits would be 1. This is rather surprising for users configuring their memory manually, since they can't set bank_addr_bits to the actual number of bank address bits. Rectify this. There is at least one example of this kind of mistake already, in board/freescale/t102xrdb/ddr.c. The documented MT40A512M8HX has two bank address bits, but bank_addr_bits was set to 2, implying 4 bank address bits. Such a value is reserved in BA_BITS_CS, but I suspect the controller simply ignores the top bit, making this kind of mistake harmless, if misleading. Fixes: e8a7f1c32b5 ("powerpc/t1023rdb: Add T1023 RDB board support") Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06ddr: fsl: Reduce the size of interactive optionsSean Anderson
The interactive mode uses large several tables of options which can be configured. However, much of the contents of these tables are repetetive. For example, no struct is larger than half a kilobyte, so the offset only takes up 9 bits. Similarly, the size is only ever 4 or 8, and printhex is a boolean. Reduce the size of these fields. This reduces the size of the options tables by around 10 KiB. However, the largest contributor to the size of the options tables is the use of a pointer for the strings. A better approach would be to use a separate array of strings, and store an integer index in the options tables. However, this would require a large re-architecting of this file. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: sl28: remove COUNTER_FREQUENCY_REALMichael Walle
The frequency of the system counter is static which is given by the COUNTER_FREQUENCY option. Remove COUNTER_FREQUENCY_REAL. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: sl28: support dynamic promptsMichael Walle
Depending on the boot source, set different CLI prompts. This will help the user to figure out in which mode the bootloader was started. There are two special modes: failsafe and SDHC boot. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Peng Fan <peng.fan@nxp.com>
2022-09-06board: sl28: add user friendly names for the boot sourcesMichael Walle
During startup the SPL will print where the u-boot proper is read from. Instead of using the default names, provide more user friendly names. Signed-off-by: Michael Walle <michael@walle.cc> Signed-off-by: Peng Fan <peng.fan@nxp.com>