summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-18 08:06:10 -0600
committerTom Rini <[email protected]>2025-12-18 08:06:10 -0600
commit930eff5416ea98ebd09cec73f5d06a7033b4d52e (patch)
tree55a54df2e4ee0314b1180d033c7a7bb34726b47a /board
parenta333d9e59f6675c9541c34643f334dbf50898647 (diff)
parent6f419247baa45917fcdd67062e271b8884d8c7aa (diff)
Merge tag 'u-boot-socfpga-next-20251217' of https://source.denx.de/u-boot/custodians/u-boot-socfpga into next
This pull request brings together a set of fixes and enhancements across the SoCFPGA platform family, with a focus on MMC/SPL robustness, EFI boot enablement, and Agilex5 SD/eMMC support. CI: https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/28776 Highlights: * SPL / MMC: o Fix Kconfig handling for SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE o Correct raw sector calculations and respect explicit sector values when loading U-Boot from MMC in SPL o Adjust raw MMC loading logic for SoCFPGA platforms * EFI boot: o Permit EFI booting on SoCFPGA platforms o Disable mkeficapsule tool build for Arria 10 where unsupported * Agilex5: o Upgrade SDHCI controller from SD4HC to SD6HC o Enable MMC and Cadence SDHCI support in defconfig o Add dedicated eMMC device tree and defconfig for Agilex5 SoCDK o Revert incorrect GPIO configuration for SDIO_SEL o Refine U-Boot DT handling for SD and eMMC boot variants * SPI: o Allow disabling the DesignWare SPI driver in SPL via Kconfig * Board / configuration fixes: o Enable random MAC address generation for Cyclone V o Fix DE0-Nano-SoC boot configuration o Remove obsolete or conflicting options from multiple legacy SoCFPGA defconfigs
Diffstat (limited to 'board')
-rw-r--r--board/radxa/rock5b-rk3588/Kconfig5
-rw-r--r--board/radxa/rock5b-rk3588/MAINTAINERS3
-rw-r--r--board/radxa/rock5b-rk3588/rock5b-rk3588.c64
-rw-r--r--board/rockchip/rockchip-ramboot.config1
4 files changed, 71 insertions, 2 deletions
diff --git a/board/radxa/rock5b-rk3588/Kconfig b/board/radxa/rock5b-rk3588/Kconfig
index 41dfe2402b1..98d63011783 100644
--- a/board/radxa/rock5b-rk3588/Kconfig
+++ b/board/radxa/rock5b-rk3588/Kconfig
@@ -9,4 +9,9 @@ config SYS_VENDOR
config SYS_CONFIG_NAME
default "rock5b-rk3588"
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select ADC
+ select SPL_ADC
+
endif
diff --git a/board/radxa/rock5b-rk3588/MAINTAINERS b/board/radxa/rock5b-rk3588/MAINTAINERS
index 4460c9971a9..c8a43769105 100644
--- a/board/radxa/rock5b-rk3588/MAINTAINERS
+++ b/board/radxa/rock5b-rk3588/MAINTAINERS
@@ -5,5 +5,4 @@ S: Maintained
F: board/radxa/rock5b-rk3588
F: include/configs/rock5b-rk3588.h
F: configs/rock5b-rk3588_defconfig
-F: arch/arm/dts/rk3588-rock-5b.dts
-F: arch/arm/dts/rk3588-rock-5b-u-boot.dtsi
+F: arch/arm/dts/rk3588-rock-5b*
diff --git a/board/radxa/rock5b-rk3588/rock5b-rk3588.c b/board/radxa/rock5b-rk3588/rock5b-rk3588.c
index fc2f69db224..2c172d04499 100644
--- a/board/radxa/rock5b-rk3588/rock5b-rk3588.c
+++ b/board/radxa/rock5b-rk3588/rock5b-rk3588.c
@@ -3,8 +3,72 @@
* Copyright (c) 2023-2024 Collabora Ltd.
*/
+#include <adc.h>
+#include <env.h>
#include <fdtdec.h>
#include <fdt_support.h>
+#include <asm/arch-rockchip/sdram.h>
+#include <linux/errno.h>
+
+#define PMU1GRF_BASE 0xfd58a000
+#define OS_REG2_REG 0x208
+
+#define HW_ID_CHANNEL 5
+
+struct board_model {
+ unsigned int dram;
+ unsigned int low;
+ unsigned int high;
+ const char *fdtfile;
+};
+
+static const struct board_model board_models[] = {
+ { LPDDR5, 926, 1106, "rockchip/rk3588-rock-5t.dtb" },
+ { LPDDR5, 4005, 4185, "rockchip/rk3588-rock-5b-plus.dtb" },
+};
+
+static const struct board_model *get_board_model(void)
+{
+ unsigned int val, dram_type;
+ int i, ret;
+
+ dram_type = rockchip_sdram_type(PMU1GRF_BASE + OS_REG2_REG);
+
+ ret = adc_channel_single_shot("adc@fec10000", HW_ID_CHANNEL, &val);
+ if (ret)
+ return NULL;
+
+ for (i = 0; i < ARRAY_SIZE(board_models); i++) {
+ unsigned int dram = board_models[i].dram;
+ unsigned int min = board_models[i].low;
+ unsigned int max = board_models[i].high;
+
+ if (dram == dram_type && min <= val && val <= max)
+ return &board_models[i];
+ }
+
+ return NULL;
+}
+
+int rk_board_late_init(void)
+{
+ const struct board_model *model = get_board_model();
+
+ if (model)
+ env_set("fdtfile", model->fdtfile);
+
+ return 0;
+}
+
+int board_fit_config_name_match(const char *name)
+{
+ const struct board_model *model = get_board_model();
+
+ if (model && !strcmp(name, model->fdtfile))
+ return 0;
+
+ return -EINVAL;
+}
#ifdef CONFIG_OF_BOARD_SETUP
int ft_board_setup(void *blob, struct bd_info *bd)
diff --git a/board/rockchip/rockchip-ramboot.config b/board/rockchip/rockchip-ramboot.config
new file mode 100644
index 00000000000..312363e542b
--- /dev/null
+++ b/board/rockchip/rockchip-ramboot.config
@@ -0,0 +1 @@
+CONFIG_ROCKCHIP_MASKROM_IMAGE=y