From d27b7a1c777abe1bc103c983d0af082345457e7d Mon Sep 17 00:00:00 2001 From: Wadim Egorov Date: Wed, 30 Jul 2025 17:42:14 +0200 Subject: board: phytec: phycore-am62x: Add watchdog start to bootcmd Allows run-time control over watchdog auto-start and the timeout via setting the environment variable watchdog_timeout_ms. A value of zero means "do not start". Use CONFIG_WATCHDOG_TIMEOUT_MSECS as initial value. Users can enable the watchdog to monitor the boot process until userspace or OS takes over to serve the watchdog. Signed-off-by: Wadim Egorov --- include/env/phytec/watchdog.env | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 include/env/phytec/watchdog.env (limited to 'include') diff --git a/include/env/phytec/watchdog.env b/include/env/phytec/watchdog.env new file mode 100644 index 00000000000..f2e65baf1e9 --- /dev/null +++ b/include/env/phytec/watchdog.env @@ -0,0 +1,11 @@ +watchdog_timeout_ms=CONFIG_WATCHDOG_TIMEOUT_MSECS +start_watchdog= + if test ${watchdog_timeout_ms} -gt 0; then; + if test -z "${watchdog}"; then; + echo No watchdog device set, skipping watchdog start; + else; + wdt dev ${watchdog}; + wdt start ${watchdog_timeout_ms}; + echo Watchdog started, timeout ${watchdog_timeout_ms} ms; + fi; + fi; -- cgit v1.2.3 From e8eab15d14a9fd17ee5e99cc045ca15ff5aa8eb1 Mon Sep 17 00:00:00 2001 From: Wadim Egorov Date: Wed, 30 Jul 2025 17:42:17 +0200 Subject: include: env: phytec: k3: Add deprecation warning to legacy boot flow We switched towards standard boot with still keeping a fallback using legacy boot command alive. Add a deprecation warning to make it more clear that we will remove it in future versions. Signed-off-by: Wadim Egorov --- include/env/phytec/k3_mmc.env | 3 ++- include/env/phytec/k3_net.env | 3 ++- include/env/phytec/k3_spi.env | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/env/phytec/k3_mmc.env b/include/env/phytec/k3_mmc.env index 3f67e312f65..95d0204b6da 100644 --- a/include/env/phytec/k3_mmc.env +++ b/include/env/phytec/k3_mmc.env @@ -14,7 +14,8 @@ mmcargs=setenv bootargs console=${console} earlycon=${earlycon} ${optargs} mmcloadimage=load mmc ${mmcdev}:${mmcpart} ${kernel_addr_r} Image mmcloadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} -mmcboot=if test ${doraucboot} = 1; then run raucinit; fi; +mmcboot=echo DEPRECATION WARNING: mmcboot will be removed in future versions. Use standard boot instead.; + if test ${doraucboot} = 1; then run raucinit; fi; run mmcargs; mmc dev ${mmcdev}; mmc rescan; diff --git a/include/env/phytec/k3_net.env b/include/env/phytec/k3_net.env index 4d5c703cae9..669787928a2 100644 --- a/include/env/phytec/k3_net.env +++ b/include/env/phytec/k3_net.env @@ -12,7 +12,8 @@ netargs=setenv bootargs console=${console} root=/dev/nfs ip=dhcp rw nfsroot=${serverip}:${nfsroot},vers=4,tcp ${optargs} netloadimage=${get_cmd} ${kernel_addr_r} ${serverip}:/Image netloadfdt=${get_cmd} ${fdt_addr_r} ${serverip}:/${fdtfile} -netboot=run netargs; +netboot=echo DEPRECATION WARNING: netboot will be removed in future versions. Use standard boot instead.; + run netargs; setenv autoload no; dhcp; run netloadimage; diff --git a/include/env/phytec/k3_spi.env b/include/env/phytec/k3_spi.env index 8e9cfce3b4c..28fe69b4e57 100644 --- a/include/env/phytec/k3_spi.env +++ b/include/env/phytec/k3_spi.env @@ -10,7 +10,9 @@ spiargs=setenv bootargs console=${console} earlycon=${earlycon} ${optargs} spiloadimage=sf read ${kernel_addr_r} ${spi_image_addr} ${size_kern} spiloadfdt=sf read ${fdt_addr_r} ${spi_fdt_addr} ${size_fdt} spiloadramdisk=sf read ${ramdisk_addr_r} ${spi_ramdisk_addr} ${size_fs} -spiboot=run spiargs; + +spiboot=echo DEPRECATION WARNING: spiboot will be removed in future versions. Use standard boot instead.; + run spiargs; sf probe; run spiloadimage; run spiloadfdt; -- cgit v1.2.3 From cb76b208390d98658fc8e97c28dc0080a65c63bc Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Wed, 6 Aug 2025 08:55:02 -0600 Subject: timer: fttmr010_timer: Remove unused driver This driver is unused. Remove it. Signed-off-by: Tom Rini --- include/faraday/fttmr010.h | 61 ---------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 include/faraday/fttmr010.h (limited to 'include') diff --git a/include/faraday/fttmr010.h b/include/faraday/fttmr010.h deleted file mode 100644 index 5b1bef38c77..00000000000 --- a/include/faraday/fttmr010.h +++ /dev/null @@ -1,61 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * (C) Copyright 2009 Faraday Technology - * Po-Yu Chuang - */ - -/* - * Timer - */ -#ifndef __FTTMR010_H -#define __FTTMR010_H - -struct fttmr010 { - unsigned int timer1_counter; /* 0x00 */ - unsigned int timer1_load; /* 0x04 */ - unsigned int timer1_match1; /* 0x08 */ - unsigned int timer1_match2; /* 0x0c */ - unsigned int timer2_counter; /* 0x10 */ - unsigned int timer2_load; /* 0x14 */ - unsigned int timer2_match1; /* 0x18 */ - unsigned int timer2_match2; /* 0x1c */ - unsigned int timer3_counter; /* 0x20 */ - unsigned int timer3_load; /* 0x24 */ - unsigned int timer3_match1; /* 0x28 */ - unsigned int timer3_match2; /* 0x2c */ - unsigned int cr; /* 0x30 */ - unsigned int interrupt_state; /* 0x34 */ - unsigned int interrupt_mask; /* 0x38 */ - unsigned int revision; /* 0x3c */ -}; - -/* - * Timer Control Register - */ -#define FTTMR010_TM3_UPDOWN (1 << 11) -#define FTTMR010_TM2_UPDOWN (1 << 10) -#define FTTMR010_TM1_UPDOWN (1 << 9) -#define FTTMR010_TM3_OFENABLE (1 << 8) -#define FTTMR010_TM3_CLOCK (1 << 7) -#define FTTMR010_TM3_ENABLE (1 << 6) -#define FTTMR010_TM2_OFENABLE (1 << 5) -#define FTTMR010_TM2_CLOCK (1 << 4) -#define FTTMR010_TM2_ENABLE (1 << 3) -#define FTTMR010_TM1_OFENABLE (1 << 2) -#define FTTMR010_TM1_CLOCK (1 << 1) -#define FTTMR010_TM1_ENABLE (1 << 0) - -/* - * Timer Interrupt State & Mask Registers - */ -#define FTTMR010_TM3_OVERFLOW (1 << 8) -#define FTTMR010_TM3_MATCH2 (1 << 7) -#define FTTMR010_TM3_MATCH1 (1 << 6) -#define FTTMR010_TM2_OVERFLOW (1 << 5) -#define FTTMR010_TM2_MATCH2 (1 << 4) -#define FTTMR010_TM2_MATCH1 (1 << 3) -#define FTTMR010_TM1_OVERFLOW (1 << 2) -#define FTTMR010_TM1_MATCH2 (1 << 1) -#define FTTMR010_TM1_MATCH1 (1 << 0) - -#endif /* __FTTMR010_H */ -- cgit v1.2.3 From b5da53046c303d7cff586b366f225dc4c3b64686 Mon Sep 17 00:00:00 2001 From: "Lucien.Jheng" Date: Sun, 17 Aug 2025 23:02:03 +0800 Subject: misc: fs_loader: Add request_firmware_into_buf_via_script() for flexible firmware loading via U-Boot script This commit introduces a new API, request_firmware_into_buf_via_script(), to the fs_loader framework. This function allows firmware to be loaded into memory using a user-defined U-Boot script, providing greater flexibility for firmware loading scenarios that cannot be handled by static file paths or device/partition selection alone. Key features: - The API runs a specified U-Boot script (by name), which is responsible for loading the firmware into memory by any means (e.g., load from MMC, USB, network, etc.). - The script must set two environment variables: 'fw_addr' (the memory address where the firmware is loaded) and 'fw_size' (the size of the firmware in bytes). - The function validates these variables, copies the firmware into a newly allocated buffer (using memdup), and returns the pointer via the provided double pointer argument. - The maximum allowed firmware size is checked to prevent buffer overflows. - The environment variables are cleared after use to avoid stale data. - Detailed error messages are provided for all failure conditions to aid debugging. Usage example: 1. Define a U-Boot script in the environment that loads the firmware and sets the required variables: => env set my_fw_script 'load mmc 0:1 ${loadaddr} firmware.bin && env set fw_addr ${loadaddr} && env set fw_size ${filesize}' 2. In your code, call the new API: void *fw_buf = NULL; int ret = request_firmware_into_buf_via_script(&fw_buf, 0x46000000, "my_fw_script"); if (ret < 0) return ret; This approach allows board integrators and users to customize the firmware loading process without modifying the source code, simply by changing the script in the U-Boot environment. Signed-off-by: Lucien.Jheng Reviewed-by: Marek Vasut [trini: Fix printf of size_t needing to use %zx] Signed-off-by: Tom Rini --- include/fs_loader.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'include') diff --git a/include/fs_loader.h b/include/fs_loader.h index 5eb5b7ab4a1..a433be1eb99 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -64,4 +64,28 @@ int request_firmware_into_buf(struct udevice *dev, * Return: 0 on success, negative value on error */ int get_fs_loader(struct udevice **dev); + +/** + * request_firmware_into_buf_via_script() - + * Load firmware using a U-Boot script and copy to buffer + * @buf: Pointer to a pointer where the firmware buffer will be stored. + * @max_size: Maximum allowed size for the firmware to be loaded. + * @script_name: Name of the U-Boot script to execute for firmware loading. + * + * Executes a U-Boot script (@script_name) that loads firmware into + * memory and sets the environment variables 'fw_addr' (address) and + * 'fw_size' (size in bytes). On success, copies the firmware + * from the given address to user buffer @buf. + * + * The script must set these environment variables: + * fw_addr - Address where firmware is loaded in memory + * fw_size - Size of the firmware in bytes + * + * The script should be defined in the U-Boot environment, for example: + * env set script_name 'load mmc 0:1 ${loadaddr} firmware.bin && + * env set fw_addr ${loadaddr} && env set fw_size ${filesize} + * Return: 0 on success, negative value on error. + */ +int request_firmware_into_buf_via_script(void **buf, size_t max_size, + const char *script_name); #endif -- cgit v1.2.3 From 9d875d674ff830a6036153a4c390c75267e775b6 Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Fri, 4 Jul 2025 15:50:21 -0600 Subject: power: Split *POWER_LEGACY portion of out to new header The commends in include/power/pmic.h say that once SPL_DM_PMIC exists we should update things. This has been true for some time, so let us update this to have the legacy portions in their own header, which should not be directly included. This cleans up the logic within the file too slightly. Signed-off-by: Tom Rini --- include/power/pmic.h | 89 ++---------------------------------------- include/power/pmic_legacy.h | 94 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 86 deletions(-) create mode 100644 include/power/pmic_legacy.h (limited to 'include') diff --git a/include/power/pmic.h b/include/power/pmic.h index 636221692d0..4aee07383a9 100644 --- a/include/power/pmic.h +++ b/include/power/pmic.h @@ -17,76 +17,9 @@ enum { PMIC_I2C, PMIC_SPI, PMIC_NONE}; -/* TODO: Change to !CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ #if CONFIG_IS_ENABLED(POWER_LEGACY) -enum { I2C_PMIC, I2C_NUM, }; -enum { PMIC_READ, PMIC_WRITE, }; -enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, }; - -enum { - PMIC_CHARGER_DISABLE, - PMIC_CHARGER_ENABLE, -}; - -struct p_i2c { - unsigned char addr; - unsigned char *buf; - unsigned char tx_num; -}; - -struct p_spi { - unsigned int cs; - unsigned int mode; - unsigned int bitlen; - unsigned int clk; - unsigned int flags; - u32 (*prepare_tx)(u32 reg, u32 *val, u32 write); -}; - -struct pmic; -struct power_fg { - int (*fg_battery_check) (struct pmic *p, struct pmic *bat); - int (*fg_battery_update) (struct pmic *p, struct pmic *bat); -}; - -struct power_chrg { - int (*chrg_type) (struct pmic *p); - int (*chrg_bat_present) (struct pmic *p); - int (*chrg_state) (struct pmic *p, int state, int current); -}; - -struct power_battery { - struct battery *bat; - int (*battery_init) (struct pmic *bat, struct pmic *p1, - struct pmic *p2, struct pmic *p3); - int (*battery_charge) (struct pmic *bat); - /* Keep info about power devices involved with battery operation */ - struct pmic *chrg, *fg, *muic; -}; - -struct pmic { - const char *name; - unsigned char bus; - unsigned char interface; - unsigned char sensor_byte_order; - unsigned int number_of_regs; - union hw { - struct p_i2c i2c; - struct p_spi spi; - } hw; - - void (*low_power_mode) (void); - struct power_battery *pbat; - struct power_chrg *chrg; - struct power_fg *fg; - - struct pmic *parent; - struct list_head list; -}; -#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */ - -/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ -#if defined(CONFIG_DM_PMIC) || !CONFIG_IS_ENABLED(POWER_LEGACY) +#include +#else /** * U-Boot PMIC Framework * ===================== @@ -308,23 +241,7 @@ struct uc_pmic_priv { uint trans_len; }; -#endif /* DM_PMIC */ - -/* TODO: Change to CONFIG_IS_ENABLED(DM_PMIC) when SPL_DM_PMIC exists */ -#if CONFIG_IS_ENABLED(POWER_LEGACY) - -/* Legacy API, do not use */ -int pmic_init(unsigned char bus); -int power_init_board(void); -int pmic_dialog_init(unsigned char bus); -int check_reg(struct pmic *p, u32 reg); -struct pmic *pmic_alloc(void); -struct pmic *pmic_get(const char *s); -int pmic_probe(struct pmic *p); -int pmic_reg_read(struct pmic *p, u32 reg, u32 *val); -int pmic_reg_write(struct pmic *p, u32 reg, u32 val); -int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on); -#endif /* CONFIG_IS_ENABLED(POWER_LEGACY) */ +#endif #define pmic_i2c_addr (p->hw.i2c.addr) #define pmic_i2c_tx_num (p->hw.i2c.tx_num) diff --git a/include/power/pmic_legacy.h b/include/power/pmic_legacy.h new file mode 100644 index 00000000000..7c244060b4a --- /dev/null +++ b/include/power/pmic_legacy.h @@ -0,0 +1,94 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2014-2015 Samsung Electronics + * Przemyslaw Marczak + * + * Copyright (C) 2011-2012 Samsung Electronics + * Lukasz Majewski + */ + +#ifndef __POWER_PMIC_LEGACY_H__ +#define __POWER_PMIC_LEGACY_H__ + +#ifndef __CORE_PMIC_H_ +#error "Do not include directly" +#endif + +enum { I2C_PMIC, I2C_NUM, }; +enum { PMIC_READ, PMIC_WRITE, }; +enum { PMIC_SENSOR_BYTE_ORDER_LITTLE, PMIC_SENSOR_BYTE_ORDER_BIG, }; + +enum { + PMIC_CHARGER_DISABLE, + PMIC_CHARGER_ENABLE, +}; + +struct p_i2c { + unsigned char addr; + unsigned char *buf; + unsigned char tx_num; +}; + +struct p_spi { + unsigned int cs; + unsigned int mode; + unsigned int bitlen; + unsigned int clk; + unsigned int flags; + u32 (*prepare_tx)(u32 reg, u32 *val, u32 write); +}; + +struct pmic; +struct power_fg { + int (*fg_battery_check) (struct pmic *p, struct pmic *bat); + int (*fg_battery_update) (struct pmic *p, struct pmic *bat); +}; + +struct power_chrg { + int (*chrg_type) (struct pmic *p); + int (*chrg_bat_present) (struct pmic *p); + int (*chrg_state) (struct pmic *p, int state, int current); +}; + +struct power_battery { + struct battery *bat; + int (*battery_init) (struct pmic *bat, struct pmic *p1, + struct pmic *p2, struct pmic *p3); + int (*battery_charge) (struct pmic *bat); + /* Keep info about power devices involved with battery operation */ + struct pmic *chrg, *fg, *muic; +}; + +struct pmic { + const char *name; + unsigned char bus; + unsigned char interface; + unsigned char sensor_byte_order; + unsigned int number_of_regs; + union hw { + struct p_i2c i2c; + struct p_spi spi; + } hw; + + void (*low_power_mode) (void); + struct power_battery *pbat; + struct power_chrg *chrg; + struct power_fg *fg; + + struct pmic *parent; + struct list_head list; +}; + +/* Legacy API, do not use */ +int pmic_init(unsigned char bus); +int power_init_board(void); +int pmic_dialog_init(unsigned char bus); +int check_reg(struct pmic *p, u32 reg); +struct pmic *pmic_alloc(void); +struct pmic *pmic_get(const char *s); +int pmic_probe(struct pmic *p); +int pmic_reg_read(struct pmic *p, u32 reg, u32 *val); +int pmic_reg_write(struct pmic *p, u32 reg, u32 val); +int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on); + +#endif -- cgit v1.2.3 From 58b8ff0b663a7491c1964e1e3a8d1d88ef707077 Mon Sep 17 00:00:00 2001 From: Andrew Goodbody Date: Thu, 7 Aug 2025 17:35:22 +0100 Subject: power: regulator: tps65910: Cannot test unsigned for being negative The code in tps65910_regulator.c treats the field supply in struct tps65910_regulator_pdata as an int and even tests the value for being negative so change it from a u32 to int so that the code all works as expected. This issue was found by Smatch. Signed-off-by: Andrew Goodbody Signed-off-by: Peng Fan --- include/power/tps65910_pmic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/power/tps65910_pmic.h b/include/power/tps65910_pmic.h index 2026ec2f426..8fa02f33ab1 100644 --- a/include/power/tps65910_pmic.h +++ b/include/power/tps65910_pmic.h @@ -123,7 +123,7 @@ enum { /* platform data */ struct tps65910_regulator_pdata { - u32 supply; /* regulator supply voltage in uV */ + int supply; /* regulator supply voltage in uV */ uint unit; /* unit-address according to DT */ }; -- cgit v1.2.3 From 9065b87f35018a4e993e7dfb8a8ec29474785f76 Mon Sep 17 00:00:00 2001 From: Primoz Fiser Date: Thu, 28 Aug 2025 13:24:04 +0200 Subject: power: pmic: pca9450: Add support for system reset The family of PCA9450 PMICs have the ability to perform system resets. Restarting via PMIC is preferred method of restarting the system as all the peripherals are brought to a know state after a power-cycle. The PCA9450 features a cold restart procedure which is initiated by an I2C command 0x14 to the SW_RST register. Support in Linux for restarting via PCA9450 PMIC has been added by Linux commit 6157e62b07d9 ("regulator: pca9450: Add restart handler"). Now add support for it also in the U-Boot via sysreset framework. Signed-off-by: Primoz Fiser Reviewed-by: Paul Geurts Signed-off-by: Peng Fan --- include/power/pca9450.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/power/pca9450.h b/include/power/pca9450.h index e5ab09fb8c8..9119ef793b1 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -75,4 +75,6 @@ enum { #define PCA9450_PMIC_RESET_WDOG_B_CFG_WARM 0x40 #define PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12 0x80 +#define PCA9450_SW_RST_COLD_RST 0x14 + #endif -- cgit v1.2.3 From ad197b31b3f88d53c349995d8bbaeba4b18b8f2b Mon Sep 17 00:00:00 2001 From: Primoz Fiser Date: Thu, 28 Aug 2025 13:24:05 +0200 Subject: power: pmic: pca9450: Add support for reset status PCA9450 PMIC supports reading the reset status from the PWRON_STAT register. Bits 7-4 give indication of the PMIC reset cause: - PWRON (BIT7) - Power ON triggered by PMIC_ON_REQ input line, - WDOGB (BIT6) - Boot after cold reset by WDOGB pin (watchdog reset), - SW_RST (BIT5) - Boot after cold reset initiated by the software, - PMIC_RST (BIT4) - Boot after PMIC_RST_B input line trigger. Add support for reading reset status via the sysreset framework in a convenient printable format. Signed-off-by: Primoz Fiser Reviewed-by: Paul Geurts Signed-off-by: Peng Fan --- include/power/pca9450.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/power/pca9450.h b/include/power/pca9450.h index 9119ef793b1..41b7f95c034 100644 --- a/include/power/pca9450.h +++ b/include/power/pca9450.h @@ -75,6 +75,11 @@ enum { #define PCA9450_PMIC_RESET_WDOG_B_CFG_WARM 0x40 #define PCA9450_PMIC_RESET_WDOG_B_CFG_COLD_LDO12 0x80 +#define PCA9450_PWRON_STAT_PWRON_MASK 0x80 +#define PCA9450_PWRON_STAT_WDOG_MASK 0x40 +#define PCA9450_PWRON_STAT_SW_RST_MASK 0x20 +#define PCA9450_PWRON_STAT_PMIC_RST_MASK 0x10 + #define PCA9450_SW_RST_COLD_RST 0x14 #endif -- cgit v1.2.3 From 7118d961cccdb3cf86f3e2eebf19c476bba5aca9 Mon Sep 17 00:00:00 2001 From: Frieder Schrempf Date: Mon, 25 Aug 2025 15:54:26 +0200 Subject: imx: kontron-sl-mx6ul: Enable standard boot and disable legacy distro boot Disable the legacy distro boot and use bootstd instead. Signed-off-by: Frieder Schrempf --- include/configs/kontron-sl-mx6ul.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include') diff --git a/include/configs/kontron-sl-mx6ul.h b/include/configs/kontron-sl-mx6ul.h index 015df01db4e..e2152eb05ed 100644 --- a/include/configs/kontron-sl-mx6ul.h +++ b/include/configs/kontron-sl-mx6ul.h @@ -24,22 +24,10 @@ /* Board and environment settings */ #define CFG_MXC_UART_BASE UART4_BASE -/* Boot order for distro boot */ -#define BOOT_TARGET_DEVICES(func) \ - func(MMC, mmc, 1) \ - func(MMC, mmc, 0) \ - func(UBIFS, ubifs, 0, UBI, boot) \ - func(USB, usb, 0) \ - func(PXE, pxe, na) \ - func(DHCP, dhcp, na) -#include - /* MMC Configs */ #ifdef CONFIG_FSL_USDHC #define CFG_SYS_FSL_ESDHC_ADDR USDHC1_BASE_ADDR #define CFG_SYS_FSL_USDHC_NUM 2 #endif -#define CFG_EXTRA_ENV_SETTINGS BOOTENV - #endif /* __KONTRON_MX6UL_CONFIG_H */ -- cgit v1.2.3 From 28d6f787b0deb3f66118857297a855233eba18d1 Mon Sep 17 00:00:00 2001 From: Benjamin Hahn Date: Tue, 2 Sep 2025 08:07:32 +0200 Subject: Add imx8mp-libra-fpsc board Add new imx8mp-libra-fpsc board. Bootph tags as well as USB device tree nodes are in u-boot.dtsi for now and will be removed when upstreamed. The Libra i.MX 8M Plus FPSC is a single board computer. It uses an i.MX 8M Plus FPSC [1] System on Module which utilizes the FPSC standard [2]. [1] https://www.phytec.eu/en/produkte/system-on-modules/phycore-imx-8m-plus-fpsc [2] https://www.phytec.eu/en/produkte/system-on-modules/fpsc Signed-off-by: Benjamin Hahn Reviewed-by: Teresa Remmet Tested-by: Teresa Remmet Signed-off-by: Yannic Moog --- include/configs/imx8mp-libra-fpsc.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 include/configs/imx8mp-libra-fpsc.h (limited to 'include') diff --git a/include/configs/imx8mp-libra-fpsc.h b/include/configs/imx8mp-libra-fpsc.h new file mode 100644 index 00000000000..cde91dc3642 --- /dev/null +++ b/include/configs/imx8mp-libra-fpsc.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * + * Copyright (C) 2025 PHYTEC Messtechnik GmbH + */ + +#ifndef __IMX8MP_LIBRA_FPSC_H +#define __IMX8MP_LIBRA_FPSC_H + +#include +#include + +#define CFG_SYS_UBOOT_BASE \ + (QSPI0_AMBA_BASE + CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512) + +/* Link Definitions */ + +#define CFG_SYS_INIT_RAM_ADDR 0x40000000 +#define CFG_SYS_INIT_RAM_SIZE SZ_512K + +#define CFG_SYS_SDRAM_BASE 0x40000000 + +#define PHYS_SDRAM 0x40000000 +#define PHYS_SDRAM_SIZE (SZ_2G + SZ_1G) /* 3GB */ +#define PHYS_SDRAM_2 0x100000000 +#define PHYS_SDRAM_2_SIZE (SZ_4G + SZ_1G) /* 5GB */ + +#endif /* __IMX8MP_LIBRA_FPSC_H */ -- cgit v1.2.3 From c9d4e82670ec4e4bab5681710de4240a3fb42fe8 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 3 Sep 2025 16:22:26 +0200 Subject: env: Fix up indent Replace #define with #define to be consistent in the entire file. No functional change. Signed-off-by: Marek Vasut Reviewed-by: Tom Rini --- include/env_default.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/env_default.h b/include/env_default.h index 9caf22cdd1d..ae2cfbcbc45 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -79,10 +79,10 @@ const char default_environment[] = { #ifdef CONFIG_USE_BOOTFILE "bootfile=" CONFIG_BOOTFILE "\0" #endif -#ifdef CONFIG_SYS_LOAD_ADDR +#ifdef CONFIG_SYS_LOAD_ADDR "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR)"\0" #endif -#ifdef CONFIG_ENV_VARS_UBOOT_CONFIG +#ifdef CONFIG_ENV_VARS_UBOOT_CONFIG "arch=" CONFIG_SYS_ARCH "\0" #ifdef CONFIG_SYS_CPU "cpu=" CONFIG_SYS_CPU "\0" -- cgit v1.2.3 From 6dfd14e1228e6e14462f377987bc896d6b7f1dd5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 3 Sep 2025 00:01:55 +0200 Subject: mkimage: Add support for bundling TFA BL31 in mkimage -f auto Introduce two new parameters to be used with mkimage -f auto to bundle TFA BL31 image into fitImage, using auto-generated fitImage. Add -y to specify TFA BL31 file name and -Y to specify TFA BL31 load and entry point address. This is meant to be used with systems which boot all of TFA BL31, Linux and its DT from a single fitImage, all booted by U-Boot. Example invocation: " $ mkimage -E -A arm64 -C none -e 0x50200000 -a 0x50200000 -f auto \ -d arch/arm64/boot/Image \ -b arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dtb \ -y ../tfa/build/rcar_gen4/release/bl31.bin -Y 0x46400000 \ /path/to/output/fitImage " Documentation update and test are also included, the test validates both positive and negative test cases, where fitImage does not include TFA BL31 and does include TFA BL31 blobs. Signed-off-by: Marek Vasut --- include/image.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/image.h b/include/image.h index b695cc39447..fc2f2487095 100644 --- a/include/image.h +++ b/include/image.h @@ -1104,6 +1104,7 @@ int booti_setup(ulong image, ulong *relocated_addr, ulong *size, #define FIT_STANDALONE_PROP "standalone" #define FIT_SCRIPT_PROP "script" #define FIT_PHASE_PROP "phase" +#define FIT_TFA_BL31_PROP "tfa-bl31" #define FIT_MAX_HASH_LEN HASH_MAX_DIGEST_SIZE -- cgit v1.2.3 From 8db442e1a03b048fd34651b3e48ffdcc0bf7868b Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Wed, 3 Sep 2025 16:20:52 +0200 Subject: env: Remove usb_ignorelist and env_fdt_path from ifdef CONFIG_ENV_VARS_UBOOT_CONFIG The CONFIG_ENV_VARS_UBOOT_CONFIG should protect only U-Boot configuration variables in environment, those are arch, cpu, board, board_name, vendor, soc. It should certainly not hide usb_ignorelist or env_fdt_path from the environment. Fix it. Signed-off-by: Marek Vasut Reviewed-by: Tom Rini --- include/env_default.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/env_default.h b/include/env_default.h index ae2cfbcbc45..7f8dc1c35a7 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -97,6 +97,7 @@ const char default_environment[] = { #ifdef CONFIG_SYS_SOC "soc=" CONFIG_SYS_SOC "\0" #endif +#endif #ifdef CONFIG_USB_HOST "usb_ignorelist=" #ifdef CONFIG_USB_KEYBOARD @@ -111,7 +112,6 @@ const char default_environment[] = { #ifdef CONFIG_ENV_IMPORT_FDT "env_fdt_path=" CONFIG_ENV_FDT_PATH "\0" #endif -#endif #if defined(CONFIG_BOOTCOUNT_BOOTLIMIT) && (CONFIG_BOOTCOUNT_BOOTLIMIT > 0) "bootlimit=" __stringify(CONFIG_BOOTCOUNT_BOOTLIMIT)"\0" #endif -- cgit v1.2.3 From 08ccc1f56cc70c4116abac3d1cbe392b867d10bf Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Thu, 11 Sep 2025 08:59:40 +0200 Subject: ioport: Add resource check helpers Add resource_overlaps() and resource_contains() helpers. Code copied from kernel source. Signed-off-by: Patrice Chotard Reviewed-by: Patrick Delaunay --- include/linux/ioport.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include') diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 85288c3729a..c12a7f70ad7 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -135,6 +135,22 @@ static inline unsigned long resource_type(const struct resource *res) return res->flags & IORESOURCE_TYPE_BITS; } +/* True iff r1 completely contains r2 */ +static inline bool resource_contains(struct resource *r1, struct resource *r2) +{ + if (resource_type(r1) != resource_type(r2)) + return false; + if (r1->flags & IORESOURCE_UNSET || r2->flags & IORESOURCE_UNSET) + return false; + return r1->start <= r2->start && r1->end >= r2->end; +} + +/* True if any part of r1 overlaps r2 */ +static inline bool resource_overlaps(struct resource *r1, struct resource *r2) +{ + return r1->start <= r2->end && r1->end >= r2->start; +} + /* Convenience shorthand with allocation */ #define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) #define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl) -- cgit v1.2.3 From 63585689686fee83b382edacad249a4ec35d7c3d Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Mon, 8 Sep 2025 16:34:02 +0800 Subject: misc: fs_loader: allow returning actual firmware data size in request_firmware_into_buf_via_script() It's important to return the actual firmware data size as some firmware files may have no checksum and need the size as the only way for firmware validation check. Signed-off-by: Weijie Gao --- include/fs_loader.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/fs_loader.h b/include/fs_loader.h index a433be1eb99..1cf6d6dd05f 100644 --- a/include/fs_loader.h +++ b/include/fs_loader.h @@ -71,6 +71,7 @@ int get_fs_loader(struct udevice **dev); * @buf: Pointer to a pointer where the firmware buffer will be stored. * @max_size: Maximum allowed size for the firmware to be loaded. * @script_name: Name of the U-Boot script to execute for firmware loading. + * @retsize: Return the actual firmware data size (optional). * * Executes a U-Boot script (@script_name) that loads firmware into * memory and sets the environment variables 'fw_addr' (address) and @@ -87,5 +88,6 @@ int get_fs_loader(struct udevice **dev); * Return: 0 on success, negative value on error. */ int request_firmware_into_buf_via_script(void **buf, size_t max_size, - const char *script_name); + const char *script_name, + size_t *retsize); #endif -- cgit v1.2.3 From 30fbbde2cdfaebb1db47d7c0d457a32e3c6552c3 Mon Sep 17 00:00:00 2001 From: Jim Liu Date: Wed, 10 Sep 2025 10:16:17 +0800 Subject: arm: nuvoton: remove unused parameter remove CFG_SYS_BOOTM_LEN parameter Signed-off-by: Jim Liu --- include/configs/arbel.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/arbel.h b/include/configs/arbel.h index b5f684e88fe..63112baf9b2 100644 --- a/include/configs/arbel.h +++ b/include/configs/arbel.h @@ -8,7 +8,6 @@ #define CFG_SYS_SDRAM_BASE 0x0 #define CFG_SYS_BOOTMAPSZ (192 << 20) -#define CFG_SYS_BOOTM_LEN (20 << 20) #define CFG_SYS_INIT_RAM_ADDR CFG_SYS_SDRAM_BASE #define CFG_SYS_INIT_RAM_SIZE 0x8000 -- cgit v1.2.3 From 409c73ef6368b07d4dbdf8391a0b9c7682dcf4b4 Mon Sep 17 00:00:00 2001 From: Randolph Lin Date: Thu, 21 Aug 2025 19:31:22 +0800 Subject: include: configs: andes: Remove fdt_high env variable Remove the fdt_high environment variable, as a value of all ones indicates using the FDT in place. This setting is incorrect for the current board. Signed-off-by: Randolph Lin Reviewed-by: Leo Yu-Chi Liang --- include/configs/voyager.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/voyager.h b/include/configs/voyager.h index f6630b07ec9..0e5fed99dd0 100644 --- a/include/configs/voyager.h +++ b/include/configs/voyager.h @@ -26,7 +26,6 @@ #include #define CFG_EXTRA_ENV_SETTINGS \ - "fdt_high=0xffffffffffffffff\0" \ "initrd_high=0xffffffffffffffff\0" \ "kernel_addr_r=0x400600000\0" \ "kernel_comp_addr_r=0x404600000\0" \ -- cgit v1.2.3 From d141a41feb005a9f6a830006f1a4b66d1a3a3cd2 Mon Sep 17 00:00:00 2001 From: Jamie Gibbons Date: Tue, 2 Sep 2025 11:10:58 +0100 Subject: board: microchip: icicle: rename all icicle files to generic Make all Icicle Kit files generic. This supports the addition of upcoming support for other MPFS boards. Signed-off-by: Jamie Gibbons Reviewed-by: Leo Yu-Chi Liang Reviewed-by: Leo Yu-Chi Liang --- include/configs/microchip_mpfs_generic.h | 32 ++++++++++++++++++++++++++++++++ include/configs/microchip_mpfs_icicle.h | 32 -------------------------------- 2 files changed, 32 insertions(+), 32 deletions(-) create mode 100644 include/configs/microchip_mpfs_generic.h delete mode 100644 include/configs/microchip_mpfs_icicle.h (limited to 'include') diff --git a/include/configs/microchip_mpfs_generic.h b/include/configs/microchip_mpfs_generic.h new file mode 100644 index 00000000000..0077f6a5f95 --- /dev/null +++ b/include/configs/microchip_mpfs_generic.h @@ -0,0 +1,32 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright (C) 2019 Microchip Technology Inc. + * Padmarao Begari + */ + +#ifndef __CONFIG_H +#define __CONFIG_H + +#include + +#define CFG_SYS_SDRAM_BASE 0x80000000 + +/* Environment options */ + +#define BOOT_TARGET_DEVICES(func) \ + func(MMC, mmc, 0) \ + func(DHCP, dhcp, na) + +#include + +#define CFG_EXTRA_ENV_SETTINGS \ + "bootm_size=0x10000000\0" \ + "kernel_addr_r=0x84000000\0" \ + "fdt_addr_r=0x88000000\0" \ + "scriptaddr=0x88100000\0" \ + "pxefile_addr_r=0x88200000\0" \ + "ramdisk_addr_r=0x88300000\0" \ + "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ + BOOTENV + +#endif /* __CONFIG_H */ diff --git a/include/configs/microchip_mpfs_icicle.h b/include/configs/microchip_mpfs_icicle.h deleted file mode 100644 index 0077f6a5f95..00000000000 --- a/include/configs/microchip_mpfs_icicle.h +++ /dev/null @@ -1,32 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Copyright (C) 2019 Microchip Technology Inc. - * Padmarao Begari - */ - -#ifndef __CONFIG_H -#define __CONFIG_H - -#include - -#define CFG_SYS_SDRAM_BASE 0x80000000 - -/* Environment options */ - -#define BOOT_TARGET_DEVICES(func) \ - func(MMC, mmc, 0) \ - func(DHCP, dhcp, na) - -#include - -#define CFG_EXTRA_ENV_SETTINGS \ - "bootm_size=0x10000000\0" \ - "kernel_addr_r=0x84000000\0" \ - "fdt_addr_r=0x88000000\0" \ - "scriptaddr=0x88100000\0" \ - "pxefile_addr_r=0x88200000\0" \ - "ramdisk_addr_r=0x88300000\0" \ - "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ - BOOTENV - -#endif /* __CONFIG_H */ -- cgit v1.2.3 From 62f1afbe7a8ae8f8b9e85c5ea4eb446b97892a7c Mon Sep 17 00:00:00 2001 From: Vivian Wang Date: Mon, 15 Sep 2025 07:45:49 +0800 Subject: riscv: qemu: Remove fdt_high default Setting fdt_high to all ones is discouraged and does not appear to be useful for RISC-V QEMU. Moreover, it causes a boot failure when the FDT generated internally by QEMU is used while booting. Remove it to allow U-Boot to pick a suitable address and relocate the FDT. Closes: https://lore.kernel.org/u-boot/8397369a-9b0b-4798-9c30-3a81165657d6@iscas.ac.cn Signed-off-by: Vivian Wang Reviewed-by: Tom Rini Reviewed-by: Lukas Auer Reviewed-by: Leo Yu-Chi Liang --- include/configs/qemu-riscv.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h index cf4fcb90b04..dad59cc0d58 100644 --- a/include/configs/qemu-riscv.h +++ b/include/configs/qemu-riscv.h @@ -32,7 +32,6 @@ #define CFG_EXTRA_ENV_SETTINGS \ CFG_STD_DEVICES_SETTINGS \ - "fdt_high=0xffffffffffffffff\0" \ "initrd_high=0xffffffffffffffff\0" \ "kernel_addr_r=0x84000000\0" \ "kernel_comp_addr_r=0x88000000\0" \ -- cgit v1.2.3 From ecced05f679e1920ffd3e1bd57334bd6442194c4 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Wed, 10 Sep 2025 09:12:39 +0200 Subject: lib: Tidy up comments for vsprintf functions Some of the functions in this file do not follow the normal style. Fix this so that things are more consistent. Signed-off-by: Simon Glass Signed-off-by: Heinrich Schuchardt --- include/vsprintf.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/vsprintf.h b/include/vsprintf.h index 9da6ce7cc4d..3cb335515e4 100644 --- a/include/vsprintf.h +++ b/include/vsprintf.h @@ -11,7 +11,7 @@ #include /** - * simple_strtoul - convert a string to an unsigned long + * simple_strtoul() - convert a string to an unsigned long * * @cp: The string to be converted * @endp: Updated to point to the first character not converted @@ -32,7 +32,7 @@ ulong simple_strtoul(const char *cp, char **endp, unsigned int base); /** - * hex_strtoul - convert a string in hex to an unsigned long + * hex_strtoul() - convert a string in hex to an unsigned long * * @cp: The string to be converted * @endp: Updated to point to the first character not converted @@ -45,7 +45,7 @@ ulong simple_strtoul(const char *cp, char **endp, unsigned int base); unsigned long hextoul(const char *cp, char **endp); /** - * hex_strtoull - convert a string in hex to an unsigned long long + * hex_strtoull() - convert a string in hex to an unsigned long long * * @cp: The string to be converted * @endp: Updated to point to the first character not converted @@ -58,7 +58,7 @@ unsigned long hextoul(const char *cp, char **endp); unsigned long long hextoull(const char *cp, char **endp); /** - * dec_strtoul - convert a string in decimal to an unsigned long + * dec_strtoul() - convert a string in decimal to an unsigned long * * @cp: The string to be converted * @endp: Updated to point to the first character not converted @@ -71,7 +71,7 @@ unsigned long long hextoull(const char *cp, char **endp); unsigned long dectoul(const char *cp, char **endp); /** - * strict_strtoul - convert a string to an unsigned long strictly + * strict_strtoul() - convert a string to an unsigned long strictly * @cp: The string to be converted * @base: The number base to use (0 for the default) * @res: The converted result value @@ -100,6 +100,7 @@ unsigned long dectoul(const char *cp, char **endp); * */ int strict_strtoul(const char *cp, unsigned int base, unsigned long *res); + unsigned long long simple_strtoull(const char *cp, char **endp, unsigned int base); long simple_strtol(const char *cp, char **endp, unsigned int base); @@ -178,7 +179,7 @@ void panic(const char *fmt, ...) void panic_str(const char *str) __attribute__ ((noreturn)); /** - * Format a string and place it in a buffer + * sprintf() - Format a string and place it in a buffer * * @buf: The buffer to place the result into * @fmt: The format string to use @@ -193,7 +194,7 @@ int sprintf(char *buf, const char *fmt, ...) __attribute__ ((format (__printf__, 2, 3))); /** - * Format a string and place it in a buffer (va_list version) + * vsprintf() - Format a string and place it in a buffer (va_list version) * * @buf: The buffer to place the result into * @fmt: The format string to use @@ -232,7 +233,7 @@ char *simple_itoa(ulong val); char *simple_xtoa(ulong num); /** - * Format a string and place it in a buffer + * scnprintf() - Format a string and place it in a buffer * * @buf: The buffer to place the result into * @size: The size of the buffer, including the trailing null space @@ -248,7 +249,7 @@ int scnprintf(char *buf, size_t size, const char *fmt, ...) __attribute__ ((format (__printf__, 3, 4))); /** - * Format a string and place it in a buffer (base function) + * vsnprintf() - Format a string and place it in a buffer (base function) * * @buf: The buffer to place the result into * @size: The size of the buffer, including the trailing null space @@ -273,7 +274,7 @@ int scnprintf(char *buf, size_t size, const char *fmt, ...) int vsnprintf(char *buf, size_t size, const char *fmt, va_list args); /** - * Format a string and place it in a buffer (va_list version) + * vscnprintf() - Format a string and place it in a buffer (va_list version) * * @buf: The buffer to place the result into * @size: The size of the buffer, including the trailing null space @@ -349,7 +350,7 @@ const char **str_to_list(const char *instr); void str_free_list(const char **ptr); /** - * vsscanf - Unformat a buffer into a list of arguments + * vsscanf() - Unformat a buffer into a list of arguments * @inp: input buffer * @fmt0: format of buffer * @ap: arguments @@ -357,7 +358,7 @@ void str_free_list(const char **ptr); int vsscanf(const char *inp, char const *fmt0, va_list ap); /** - * sscanf - Unformat a buffer into a list of arguments + * sscanf() - Unformat a buffer into a list of arguments * @buf: input buffer * @fmt: formatting of buffer * @...: resulting arguments -- cgit v1.2.3 From e246e2b65885e6d5fd052ec2acdf2b07a53171f0 Mon Sep 17 00:00:00 2001 From: Kunihiko Hayashi Date: Wed, 10 Sep 2025 18:23:26 +0900 Subject: configs: qemu-sbsa: Define GIC register base address If GICV3 is enabled, GICD_BASE and GICR_BASE are needed at arch/arm/cpu/armv8/start.S. Signed-off-by: Kunihiko Hayashi --- include/configs/qemu-sbsa.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/configs/qemu-sbsa.h b/include/configs/qemu-sbsa.h index aff78160e12..669d0fe7c58 100644 --- a/include/configs/qemu-sbsa.h +++ b/include/configs/qemu-sbsa.h @@ -86,4 +86,8 @@ #define CFG_SYS_INIT_RAM_ADDR SBSA_MEM_BASE_ADDR #define CFG_SYS_INIT_RAM_SIZE 0x1000000 +/* Generic Interrupt Controller Definitions */ +#define GICD_BASE SBSA_GIC_DIST_BASE_ADDR +#define GICR_BASE SBSA_GIC_REDIST_BASE_ADDR + #endif /* __CONFIG_H */ -- cgit v1.2.3 From b717a4090fb0fda4814bbc9d9a91396710294cfb Mon Sep 17 00:00:00 2001 From: John Ripple Date: Tue, 9 Sep 2025 13:53:22 -0600 Subject: imx8: Add ahab_commit command The ahab_commit command allows the user to commit into the SECO fuses that control the SRK key revocation information. This is used to Revoke compromised SRK keys. To use ahab_commit, the boot container must be built with an SRK revocation bit mask that is not 0x0. For the SPSDK provided by NXP, this means setting the 'srk_revoke_mask' option in the config file used to sign the boot container. The 'ahab_commit 0x10' can then be used to commit the SRK revocation information into the SECO fuses. Signed-off-by: John Ripple --- include/firmware/imx/sci/sci.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/firmware/imx/sci/sci.h b/include/firmware/imx/sci/sci.h index 588f3671103..876d52cac35 100644 --- a/include/firmware/imx/sci/sci.h +++ b/include/firmware/imx/sci/sci.h @@ -144,6 +144,7 @@ int sc_seco_secvio_dgo_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data); int sc_seco_secvio_config(sc_ipc_t ipc, u8 id, u8 access, u32 *data0, u32 *data1, u32 *data2, u32 *data3, u32 *data4, u8 size); +int sc_seco_commit(sc_ipc_t ipc, u32 *info); #else /* PM API*/ static inline int sc_pm_set_resource_power_mode(sc_ipc_t ipc, sc_rsrc_t resource, @@ -383,6 +384,11 @@ static inline int sc_seco_secvio_config(sc_ipc_t ipc, u8 id, u8 access, u32 *dat return -EOPNOTSUPP; } +static inline int sc_seco_commit(sc_ipc_t ipc, u32 *info) +{ + return -EOPNOTSUPP; +} + static inline void sc_pm_reboot(sc_ipc_t ipc, sc_pm_reset_type_t type) { } -- cgit v1.2.3 From 5289b6e5540e571afd81482305e5623e9124ea66 Mon Sep 17 00:00:00 2001 From: Guillaume Ranquet Date: Thu, 11 Sep 2025 15:50:26 +0200 Subject: android: boot: fix wrong end of header in v3/v4 parsing The android boot header is page aligned but the current code made the assumption that the header was always smaller than the current header format. When the page_size is defined as 2048, as this is the case with the cuttlefish target, the current code sets the end of the header in the middle of it as the v3 and v4 headers are respectively 2112 and 2128 bytes long. Fix that by aligning to page_size Fixes: 1115027d2f75 ("android: boot: update android_image_get_data to support v3, v4") Signed-off-by: Guillaume Ranquet --- include/android_image.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/android_image.h b/include/android_image.h index 96820709b42..a2d80499ba3 100644 --- a/include/android_image.h +++ b/include/android_image.h @@ -21,6 +21,8 @@ #define ANDR_BOOT_ARGS_SIZE 512 #define ANDR_BOOT_EXTRA_ARGS_SIZE 1024 #define VENDOR_BOOT_MAGIC "VNDRBOOT" +#define ANDR_VENDOR_BOOT_V3_SIZE 2112 /* sz(andr_vnd_boot_img_hdr) - sz(vendor_ramdisk_table*) */ +#define ANDR_VENDOR_BOOT_V4_SIZE 2128 /* sz(andr_vnd_boot_img_hdr) */ #define ANDR_VENDOR_BOOT_MAGIC_SIZE 8 #define ANDR_VENDOR_BOOT_ARGS_SIZE 2048 #define ANDR_VENDOR_BOOT_NAME_SIZE 16 -- cgit v1.2.3 From 998c6cc450e61152b6d0e800989d2d19358e25c2 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 23 Sep 2025 10:14:55 +0800 Subject: imx95: Add get_reset_reason() to retrieve the LM/system last booted/shutdown reasons System Manager provides the last booted and shutdown reasons of the logical machines (LM) and system using the SCMI misc protocol (Protocol ID: 0x84, Message ID: 0xA). This path adds get_reset_reason() to query and print these reasons in SPL and U-Boot. Signed-off-by: Peng Fan Signed-off-by: Alice Guo Reviewed-by: Ye Li --- include/scmi_nxp_protocols.h | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 include/scmi_nxp_protocols.h (limited to 'include') diff --git a/include/scmi_nxp_protocols.h b/include/scmi_nxp_protocols.h new file mode 100644 index 00000000000..fe6ecd6a7cf --- /dev/null +++ b/include/scmi_nxp_protocols.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* + * Copyright 2025 NXP + */ + +#ifndef _SCMI_NXP_PROTOCOLS_H +#define _SCMI_NXP_PROTOCOLS_H + +#include +#include + +enum scmi_imx_protocol { + SCMI_IMX_PROTOCOL_ID_MISC = 0x84, +}; + +#define SCMI_PAYLOAD_LEN 100 + +#define SCMI_ARRAY(X, Y) ((SCMI_PAYLOAD_LEN - (X)) / sizeof(Y)) + +#define SCMI_IMX_MISC_RESET_REASON 0xA + +struct scmi_imx_misc_reset_reason_in { +#define MISC_REASON_FLAG_SYSTEM BIT(0) + u32 flags; +}; + +struct scmi_imx_misc_reset_reason_out { + s32 status; + /* Boot reason flags */ +#define MISC_BOOT_FLAG_VLD BIT(31) +#define MISC_BOOT_FLAG_ORG_VLD BIT(28) +#define MISC_BOOT_FLAG_ORIGIN GENMASK(27, 24) +#define MISC_BOOT_FLAG_O_SHIFT 24 +#define MISC_BOOT_FLAG_ERR_VLD BIT(23) +#define MISC_BOOT_FLAG_ERR_ID GENMASK(22, 8) +#define MISC_BOOT_FLAG_E_SHIFT 8 +#define MISC_BOOT_FLAG_REASON GENMASK(7, 0) + u32 bootflags; + /* Shutdown reason flags */ +#define MISC_SHUTDOWN_FLAG_VLD BIT(31) +#define MISC_SHUTDOWN_FLAG_EXT_LEN GENMASK(30, 29) +#define MISC_SHUTDOWN_FLAG_ORG_VLD BIT(28) +#define MISC_SHUTDOWN_FLAG_ORIGIN GENMASK(27, 24) +#define MISC_SHUTDOWN_FLAG_O_SHIFT 24 +#define MISC_SHUTDOWN_FLAG_ERR_VLD BIT(23) +#define MISC_SHUTDOWN_FLAG_ERR_ID GENMASK(22, 8) +#define MISC_SHUTDOWN_FLAG_E_SHIFT 8 +#define MISC_SHUTDOWN_FLAG_REASON GENMASK(7, 0) + u32 shutdownflags; + /* Array of extended info words */ +#define MISC_MAX_EXTINFO SCMI_ARRAY(16, u32) + u32 extInfo[MISC_MAX_EXTINFO]; +}; + +#endif -- cgit v1.2.3 From 3d4e14f4c903819b15ec7e83a29d175692557b3f Mon Sep 17 00:00:00 2001 From: Ye Li Date: Tue, 23 Sep 2025 10:15:04 +0800 Subject: imx94_evk: Add i.MX943 EVK board support Add board-level code and defconfig for the i.MX943 EVK board, supporting multiple SOM variants: 19x19 LPDDR5, 19x19 LPDDR4 and 15x15 LPDDR4. Signed-off-by: Ye Li Signed-off-by: Alice Guo Acked-by: Peng Fan Reviewed-by: Jacky Bai --- include/configs/imx94_evk.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/configs/imx94_evk.h (limited to 'include') diff --git a/include/configs/imx94_evk.h b/include/configs/imx94_evk.h new file mode 100644 index 00000000000..f93c3c4e4a8 --- /dev/null +++ b/include/configs/imx94_evk.h @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2025 NXP + */ + +#ifndef __IMX94_EVK_H +#define __IMX94_EVK_H + +#include +#include +#include + +#define CFG_SYS_INIT_RAM_ADDR 0x90000000 +#define CFG_SYS_INIT_RAM_SIZE 0x200000 + +#define CFG_SYS_SDRAM_BASE 0x90000000 +#define PHYS_SDRAM 0x90000000 +#define PHYS_SDRAM_SIZE 0x70000000UL /* 2GB - 256MB DDR */ +#define PHYS_SDRAM_2_SIZE 0x180000000 /* 8GB */ + +/* Using ULP WDOG for reset */ +#define WDOG_BASE_ADDR WDG3_BASE_ADDR + +#endif -- cgit v1.2.3 From e54bf98c3afc6dc6e6ce9496c217cb1c660aac4d Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:54 +0200 Subject: malloc.h: be a bit more consistent with macro definitions Currrently, malloc and free are function-like macros, while calloc, realloc and memalign are object-like macros. Usually, this doesn't matter, but it does when the identifiers appear without a following open parenthesis, such as when their address is taken for building the export table. Adding calloc or realloc to that table breaks the build on sandbox due to this inconsistency. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/malloc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/malloc.h b/include/malloc.h index 9e0be482416..3979fc62830 100644 --- a/include/malloc.h +++ b/include/malloc.h @@ -904,11 +904,11 @@ void *realloc_simple(void *ptr, size_t size); # define mALLOPt dlmallopt /* Ensure that U-Boot actually uses these too */ -#define calloc dlcalloc +#define calloc(x,y) dlcalloc(x,y) #define free(ptr) dlfree(ptr) #define malloc(x) dlmalloc(x) -#define memalign dlmemalign -#define realloc dlrealloc +#define memalign(a,x) dlmemalign(a,x) +#define realloc(p,x) dlrealloc(p,x) #define valloc dlvalloc #define pvalloc dlpvalloc #define mallinfo() dlmallinfo() -- cgit v1.2.3 From 0933358163a3c0ef13577853194769504cfb39ea Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:55 +0200 Subject: _exports.h: drop creating dummy i2c entries and fixup config dependency There's really no good reason to create stub entries that would call a function that doesn't even return anything sensible. The existence of these two i2c_* functions depends on CONFIG_IS_ENABLED(SYS_I2C_LEGACY), which does depend on !DM_I2C, but is not equivalent to it. They are probably rather hard to use unless CMD_I2C and something in U-Boot has called "i2c dev foo" to set the current i2c bus before calling the standalone app, so keep that dependency. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/_exports.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index 1af946fac32..39278a34942 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -1,7 +1,6 @@ /* * You need to use #ifdef around functions that may not exist * in the final configuration (such as i2c). - * use a dummyfunction as first parameter to EXPORT_FUNC. * As an example see the CONFIG_CMD_I2C section below */ #ifndef EXPORT_FUNC @@ -43,12 +42,9 @@ EXPORT_FUNC(simple_strtol, long, simple_strtol, const char *, char **, unsigned int) EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) -#if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C) +#if defined(CONFIG_CMD_I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY) EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) -#else - EXPORT_FUNC(dummy, void, i2c_write, void) - EXPORT_FUNC(dummy, void, i2c_read, void) #endif #if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI) -- cgit v1.2.3 From 475a72f6471194633fd85a813547bebe846611e0 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:56 +0200 Subject: _exports.h: simplify condition for including spi functions As for the i2c functions, drop the dummy entries that, if ever used, would just have the standalone app get some random content in the return register. While deprecated, the spi_{setup,free}_slave functions do exist even with CONFIG_DM_SPI - and a standalone app can't really do anything but refer to a spi device via a (bus, cs) pair. Eventually, one should probably export some function that could allow a standalone app to get a struct udevice* corresponding to either a full DT path, an alias, or perhaps a label (provided one builds with -@), and then export functions that can operate on that. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/_exports.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index 39278a34942..c1511903088 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -47,19 +47,10 @@ EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) #endif -#if !defined(CONFIG_CMD_SPI) || defined(CONFIG_DM_SPI) - EXPORT_FUNC(dummy, void, spi_setup_slave, void) - EXPORT_FUNC(dummy, void, spi_free_slave, void) -#else +#if defined(CONFIG_CMD_SPI) EXPORT_FUNC(spi_setup_slave, struct spi_slave *, spi_setup_slave, unsigned int, unsigned int, unsigned int, unsigned int) EXPORT_FUNC(spi_free_slave, void, spi_free_slave, struct spi_slave *) -#endif -#ifndef CONFIG_CMD_SPI - EXPORT_FUNC(dummy, void, spi_claim_bus, void) - EXPORT_FUNC(dummy, void, spi_release_bus, void) - EXPORT_FUNC(dummy, void, spi_xfer, void) -#else EXPORT_FUNC(spi_claim_bus, int, spi_claim_bus, struct spi_slave *) EXPORT_FUNC(spi_release_bus, void, spi_release_bus, struct spi_slave *) EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *, -- cgit v1.2.3 From eb178c849c25024225941db79c1c3b9681a46a80 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:57 +0200 Subject: _exports.h: drop the last dummy entries Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/_exports.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index c1511903088..21afb8d37f8 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -20,9 +20,6 @@ int, interrupt_handler_t, void*) EXPORT_FUNC(irq_free_handler, void, free_hdlr, int) -#else - EXPORT_FUNC(dummy, void, install_hdlr, void) - EXPORT_FUNC(dummy, void, free_hdlr, void) #endif EXPORT_FUNC(malloc, void *, malloc, size_t) #if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) -- cgit v1.2.3 From bdbaaee65c69eebe1ee47296fa2fb12a4677697c Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:09:59 +0200 Subject: exports.h: make sure declarations are in sync with the actual exports After finishing a later patch in this series, I discovered I had neglected to update the list of declarations in exports.h to match. But then I realized I wasn't the first to do that. Use the existing mechanism and DRY it out. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/exports.h | 36 +++--------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/exports.h b/include/exports.h index 23cc3a66c20..bcf170dca87 100644 --- a/include/exports.h +++ b/include/exports.h @@ -26,39 +26,9 @@ struct spi_slave; int jumptable_init(void); /* These are declarations of exported functions available in C code */ -unsigned long get_version(void); -int getc(void); -int tstc(void); -void putc(const char); -void puts(const char*); -int printf(const char* fmt, ...); -void install_hdlr(int, interrupt_handler_t, void*); -void free_hdlr(int); -void *malloc(size_t); -#if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) -void free(void*); -#endif -void __udelay(unsigned long); -unsigned long get_timer(unsigned long); -int vprintf(const char *, va_list); -unsigned long simple_strtoul(const char *cp, char **endp, unsigned int base); -int strict_strtoul(const char *cp, unsigned int base, unsigned long *res); -char *env_get(const char *name); -int env_set(const char *varname, const char *value); -long simple_strtol(const char *cp, char **endp, unsigned int base); -int strcmp(const char *cs, const char *ct); -unsigned long ustrtoul(const char *cp, char **endp, unsigned int base); -unsigned long long ustrtoull(const char *cp, char **endp, unsigned int base); -#if defined(CONFIG_CMD_I2C) && !CONFIG_IS_ENABLED(DM_I2C) -int i2c_write (uchar, uint, int , uchar* , int); -int i2c_read (uchar, uint, int , uchar* , int); -#endif -#ifdef CONFIG_PHY_AQUANTIA -struct mii_dev *mdio_get_current_dev(void); -struct phy_device *phy_find_by_mask(struct mii_dev *bus, unsigned phy_mask); -struct phy_device *mdio_phydev_for_ethname(const char *ethname); -int miiphy_set_current_dev(const char *devname); -#endif +#define EXPORT_FUNC(impl, res, func, ...) res func(__VA_ARGS__); +#include <_exports.h> +#undef EXPORT_FUNC void app_startup(char * const *); -- cgit v1.2.3 From 2ef6c17f7f46a908e99e24de53d2c153dc1972ab Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:10:00 +0200 Subject: _exports.h: reorganize a bit The current list of exported functions is somewhat of a mess. Reorganize them so that related functionality is kept together: - console I/O: move vprintf next to printf and the getc/putc functions - integer parsing: move the *strto* functions together - standard string.h stuff: move memset() and strcpy() next to strcmp() - time: move mdelay() next to udelay() and get_timer() Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/_exports.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index 21afb8d37f8..f1b11c1e380 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -15,6 +15,7 @@ EXPORT_FUNC(flush, void, flush, void) #endif EXPORT_FUNC(printf, int, printf, const char*, ...) + EXPORT_FUNC(vprintf, int, vprintf, const char *, va_list) #if (defined(CONFIG_X86) && !defined(CONFIG_X86_64)) || defined(CONFIG_PPC) EXPORT_FUNC(irq_install_handler, void, install_hdlr, int, interrupt_handler_t, void*) @@ -25,9 +26,9 @@ #if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) EXPORT_FUNC(free, void, free, void *) #endif + EXPORT_FUNC(mdelay, void, mdelay, unsigned long msec) EXPORT_FUNC(udelay, void, udelay, unsigned long) EXPORT_FUNC(get_timer, unsigned long, get_timer, unsigned long) - EXPORT_FUNC(vprintf, int, vprintf, const char *, va_list) EXPORT_FUNC(do_reset, int, do_reset, struct cmd_tbl *, int , int , char * const []) EXPORT_FUNC(env_get, char *, env_get, const char*) @@ -38,7 +39,13 @@ const char *, unsigned int , unsigned long *) EXPORT_FUNC(simple_strtol, long, simple_strtol, const char *, char **, unsigned int) + EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul, + const char *, char **, unsigned int) + EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull, + const char *, char **, unsigned int) + EXPORT_FUNC(memset, void *, memset, void *, int, size_t) EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) + EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src) #if defined(CONFIG_CMD_I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY) EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) @@ -53,13 +60,6 @@ EXPORT_FUNC(spi_xfer, int, spi_xfer, struct spi_slave *, unsigned int, const void *, void *, unsigned long) #endif - EXPORT_FUNC(ustrtoul, unsigned long, ustrtoul, - const char *, char **, unsigned int) - EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull, - const char *, char **, unsigned int) - EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src) - EXPORT_FUNC(mdelay, void, mdelay, unsigned long msec) - EXPORT_FUNC(memset, void *, memset, void *, int, size_t) #ifdef CONFIG_PHY_AQUANTIA EXPORT_FUNC(mdio_get_current_dev, struct mii_dev *, mdio_get_current_dev, void) -- cgit v1.2.3 From d95706158203db0b2281e134e8dfbad87e3d668c Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:10:01 +0200 Subject: _exports.h: export standard memory/string handling functions The current list of exported functions lacks quite a few bog-standard C library functions that we might as well expose, since U-Boot certainly has them implemented anyway. There's no reason a standalone application should have its own strlen() implementation or link in a copy from some tiny libc. For a customer's standalone app, this means it goes from 95K to 10K. More importantly, we can ditch the custom toolchain including a newlibc used to build the standalone app and just use the same toolchain as used to build u-boot itself. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/_exports.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/_exports.h b/include/_exports.h index f1b11c1e380..a23fc001421 100644 --- a/include/_exports.h +++ b/include/_exports.h @@ -23,6 +23,8 @@ EXPORT_FUNC(irq_free_handler, void, free_hdlr, int) #endif EXPORT_FUNC(malloc, void *, malloc, size_t) + EXPORT_FUNC(realloc, void *, realloc, void *, size_t) + EXPORT_FUNC(calloc, void *, calloc, size_t, size_t) #if !CONFIG_IS_ENABLED(SYS_MALLOC_SIMPLE) EXPORT_FUNC(free, void, free, void *) #endif @@ -43,9 +45,21 @@ const char *, char **, unsigned int) EXPORT_FUNC(ustrtoull, unsigned long long, ustrtoull, const char *, char **, unsigned int) + EXPORT_FUNC(memcmp, int, memcmp, const void *, const void *, size_t) + EXPORT_FUNC(memcpy, void *, memcpy, void *, const void *, size_t) + EXPORT_FUNC(memmove, void *, memmove, void *, const void *, size_t) EXPORT_FUNC(memset, void *, memset, void *, int, size_t) + EXPORT_FUNC(strchr, char *, strchr, const char *cs, int c) + EXPORT_FUNC(strlen, size_t, strlen, const char *s) + EXPORT_FUNC(strncmp, int, strncmp, const char *cs, const char *ct, size_t n) + EXPORT_FUNC(strncpy, char *, strncpy, char *dest, const char *src, size_t n) + EXPORT_FUNC(strnlen, size_t, strnlen, const char *s, size_t n) EXPORT_FUNC(strcmp, int, strcmp, const char *cs, const char *ct) EXPORT_FUNC(strcpy, char *, strcpy, char *dest, const char *src) + EXPORT_FUNC(sprintf, int, sprintf, char *, const char *, ...) + EXPORT_FUNC(snprintf, int, snprintf, char *, size_t, const char *, ...) + EXPORT_FUNC(vsprintf, int, vsprintf, char *, const char *, va_list) + EXPORT_FUNC(vsnprintf, int, vsnprintf, char *, size_t, const char *, va_list) #if defined(CONFIG_CMD_I2C) && CONFIG_IS_ENABLED(SYS_I2C_LEGACY) EXPORT_FUNC(i2c_write, int, i2c_write, uchar, uint, int , uchar * , int) EXPORT_FUNC(i2c_read, int, i2c_read, uchar, uint, int , uchar * , int) -- cgit v1.2.3 From 07588f4ad9b80e73726fd7ecb8e17e21785322a0 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 19 Sep 2025 12:10:02 +0200 Subject: exports.h: bump XF_VERSION There have been quite a few changes to _exports.h since the last update of XF_VERSION, also before the previous patches in this series. I doubt the mechanism is actually being used in practice, it is simply too fragile: Not only does the list of exported functions depend on .config, so with the same XF_VERSION the jump table entries could have different offsets. But getting to the jump table itself from gd to even call the ->get_version() is fragile, since offsetof(gd_t, jt) can, and does, change. For example, as recently as commit d9902107027 ("global_data: Remove jump table in SPL"). One really must build one's standalone app against the proper U-Boot version and config.h. But for good measure, do bump it now. Signed-off-by: Rasmus Villemoes Reviewed-by: Tom Rini --- include/exports.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/exports.h b/include/exports.h index bcf170dca87..12abb35643e 100644 --- a/include/exports.h +++ b/include/exports.h @@ -40,7 +40,7 @@ struct jt_funcs { #undef EXPORT_FUNC }; -#define XF_VERSION 9 +#define XF_VERSION 10 #if defined(CONFIG_X86) extern gd_t *global_data; -- cgit v1.2.3 From c4e9554015ebe919a480a54e508461af7a3e9fc8 Mon Sep 17 00:00:00 2001 From: Alif Zakuan Yuslaimi Date: Mon, 8 Sep 2025 19:11:14 -0700 Subject: include: dt-bindings: clk: agilex: Add Agilex clock definitions header file Introduce header file to define the clock indexes for the Agilex platform. Signed-off-by: Alif Zakuan Yuslaimi Reviewed-by: Tien Fong Chee --- include/dt-bindings/clock/agilex-clock.h | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 include/dt-bindings/clock/agilex-clock.h (limited to 'include') diff --git a/include/dt-bindings/clock/agilex-clock.h b/include/dt-bindings/clock/agilex-clock.h new file mode 100644 index 00000000000..a6252180516 --- /dev/null +++ b/include/dt-bindings/clock/agilex-clock.h @@ -0,0 +1,71 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (C) 2025 Altera Corporation + */ + +#ifndef __AGILEX_CLOCK_H +#define __AGILEX_CLOCK_H + +/* fixed rate clocks */ +#define AGILEX_OSC1 0 +#define AGILEX_CB_INTOSC_HS_DIV2_CLK 1 +#define AGILEX_CB_INTOSC_LS_CLK 2 +#define AGILEX_L4_SYS_FREE_CLK 3 +#define AGILEX_F2S_FREE_CLK 4 + +/* PLL clocks */ +#define AGILEX_MAIN_PLL_CLK 5 +#define AGILEX_MAIN_PLL_C0_CLK 6 +#define AGILEX_MAIN_PLL_C1_CLK 7 +#define AGILEX_MAIN_PLL_C2_CLK 8 +#define AGILEX_MAIN_PLL_C3_CLK 9 +#define AGILEX_PERIPH_PLL_CLK 10 +#define AGILEX_PERIPH_PLL_C0_CLK 11 +#define AGILEX_PERIPH_PLL_C1_CLK 12 +#define AGILEX_PERIPH_PLL_C2_CLK 13 +#define AGILEX_PERIPH_PLL_C3_CLK 14 +#define AGILEX_MPU_FREE_CLK 15 +#define AGILEX_MPU_CCU_CLK 16 +#define AGILEX_BOOT_CLK 17 + +/* fixed factor clocks */ +#define AGILEX_L3_MAIN_FREE_CLK 18 +#define AGILEX_NOC_FREE_CLK 19 +#define AGILEX_S2F_USR0_CLK 20 +#define AGILEX_NOC_CLK 21 +#define AGILEX_EMAC_A_FREE_CLK 22 +#define AGILEX_EMAC_B_FREE_CLK 23 +#define AGILEX_EMAC_PTP_FREE_CLK 24 +#define AGILEX_GPIO_DB_FREE_CLK 25 +#define AGILEX_SDMMC_FREE_CLK 26 +#define AGILEX_S2F_USER0_FREE_CLK 27 +#define AGILEX_S2F_USER1_FREE_CLK 28 +#define AGILEX_PSI_REF_FREE_CLK 29 + +/* Gate clocks */ +#define AGILEX_MPU_CLK 30 +#define AGILEX_MPU_PERIPH_CLK 31 +#define AGILEX_L4_MAIN_CLK 32 +#define AGILEX_L4_MP_CLK 33 +#define AGILEX_L4_SP_CLK 34 +#define AGILEX_CS_AT_CLK 35 +#define AGILEX_CS_TRACE_CLK 36 +#define AGILEX_CS_PDBG_CLK 37 +#define AGILEX_CS_TIMER_CLK 38 +#define AGILEX_S2F_USER0_CLK 39 +#define AGILEX_EMAC0_CLK 40 +#define AGILEX_EMAC1_CLK 41 +#define AGILEX_EMAC2_CLK 42 +#define AGILEX_EMAC_PTP_CLK 43 +#define AGILEX_GPIO_DB_CLK 44 +#define AGILEX_NAND_CLK 45 +#define AGILEX_PSI_REF_CLK 46 +#define AGILEX_S2F_USER1_CLK 47 +#define AGILEX_SDMMC_CLK 48 +#define AGILEX_SPI_M_CLK 49 +#define AGILEX_USB_CLK 50 +#define AGILEX_NAND_X_CLK 51 +#define AGILEX_NAND_ECC_CLK 52 +#define AGILEX_NUM_CLKS 53 + +#endif /* __AGILEX_CLOCK_H */ -- cgit v1.2.3 From 70ae44f3713427be5368d0829b97cafbd01ef1f5 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 22 Sep 2025 14:29:22 +0200 Subject: linux/kernel.h: Update upper_NN_bits() and lower_NN_bits() macros Synchronize upper_NN_bits() and lower_NN_bits() macros with Linux 6.16 commit 118d777c4cb4 ("wordpart.h: Add REPEAT_BYTE_U32()"). This fixes the lower_32_bits() macros and assures it works with 64bit systems correctly. This also adds 16bit variants of these macros, which will be used by the Airoha PHY driver. Signed-off-by: Marek Vasut Reviewed-by: Tom Rini --- include/linux/kernel.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e0443ecac84..44a639a5e4e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -111,7 +111,19 @@ * lower_32_bits - return bits 0-31 of a number * @n: the number we're accessing */ -#define lower_32_bits(n) ((u32)(n)) +#define lower_32_bits(n) ((u32)((n) & 0xffffffff)) + +/** + * upper_16_bits - return bits 16-31 of a number + * @n: the number we're accessing + */ +#define upper_16_bits(n) ((u16)((n) >> 16)) + +/** + * lower_16_bits - return bits 0-15 of a number + * @n: the number we're accessing + */ +#define lower_16_bits(n) ((u16)((n) & 0xffff)) /* * abs() handles unsigned and signed longs, ints, shorts and chars. For all -- cgit v1.2.3 From 601cebc29d2a41846bbad36453b97b065db656dd Mon Sep 17 00:00:00 2001 From: Tom Rini Date: Mon, 15 Sep 2025 13:05:48 -0600 Subject: cmd: spl: Remove ATAG support from this command While we continue to have some systems which support extremely legacy OS booting methods, we do not have use cases for supporting this in Falcon mode anymore. Remove this support and references from the documentation. Co-developed-by: Anshul Dalal Signed-off-by: Tom Rini --- include/cmd_spl.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include') diff --git a/include/cmd_spl.h b/include/cmd_spl.h index 51ec12edb90..45ea91e9bce 100644 --- a/include/cmd_spl.h +++ b/include/cmd_spl.h @@ -8,7 +8,6 @@ #define SPL_EXPORT (0x00000001) #define SPL_EXPORT_FDT (0x00000001) -#define SPL_EXPORT_ATAGS (0x00000002) -#define SPL_EXPORT_LAST SPL_EXPORT_ATAGS +#define SPL_EXPORT_LAST SPL_EXPORT_FDT #endif /* _NAND_SPL_H_ */ -- cgit v1.2.3