summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-08-29 09:56:00 -0600
committerTom Rini <[email protected]>2026-08-29 09:56:00 -0600
commit856a00aeb61c1d4e7825257e54219599f8e34a6c (patch)
tree0b02f08085d5db33af937a34e861e86c7d60fa84 /board
parent043b4280138d45c50340c0f899935b83be4375b7 (diff)
parented58bafd0b24e15b734c624bdaf00b876e5d32e6 (diff)
Merge tag 'u-boot-rockchip-2027.01-20260828' of https://git.u-boot-project.org/u-boot/custodians/u-boot-rockchip into nextnext
- Fixed possible SPI hangs when only PICO is routed (TX-only), - Added support for ROC-RK3399-PC-PLUS (via roc-pc-rk3399_defconfig)
Diffstat (limited to 'board')
-rw-r--r--board/firefly/roc-pc-rk3399/roc-pc-rk3399.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
index 6937a27176f..5a71e94ae1e 100644
--- a/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
+++ b/board/firefly/roc-pc-rk3399/roc-pc-rk3399.c
@@ -5,14 +5,24 @@
#include <dm.h>
#include <env.h>
+#include <fdtdec.h>
+#include <i2c.h>
+#include <image.h>
#include <log.h>
#include <spl_gpio.h>
+#include <asm/global_data.h>
#include <asm/io.h>
#include <asm/arch-rockchip/cru.h>
#include <asm/arch-rockchip/gpio.h>
#include <asm/arch-rockchip/grf_rk3399.h>
+#define ROC_PC_MP8859_BUS "i2c@ff160000"
+#define ROC_PC_MP8859_ADDR 0x66
+#define ROC_PC_PLUS_FDTFILE "rockchip/rk3399-roc-pc-plus.dtb"
+
+DECLARE_GLOBAL_DATA_PTR;
+
#ifdef CONFIG_XPL_BUILD
#define PMUGRF_BASE 0xff320000
@@ -54,4 +64,36 @@ void led_setup(void)
spl_gpio_output(gpio0, GPIO(BANK_B, 5), 1);
}
+static bool is_roc_pc_plus(void)
+{
+ struct udevice *bus, *dev;
+
+ if (!(CONFIG_IS_ENABLED(I2C) && CONFIG_IS_ENABLED(DM_I2C)))
+ return false;
+
+ if (uclass_get_device_by_name(UCLASS_I2C, ROC_PC_MP8859_BUS, &bus))
+ return false;
+
+ return dm_i2c_probe(bus, ROC_PC_MP8859_ADDR, 0, &dev);
+}
+
+int board_fit_config_name_match(const char *name)
+{
+ if (is_roc_pc_plus())
+ return strcmp(name, ROC_PC_PLUS_FDTFILE);
+
+ return strcmp(name, CONFIG_DEFAULT_FDT_FILE);
+}
+
#endif
+
+int rk_board_late_init(void)
+{
+ if (!fdt_node_check_compatible(gd->fdt_blob, 0,
+ "firefly,roc-rk3399-pc-plus"))
+ env_set("fdtfile", ROC_PC_PLUS_FDTFILE);
+ else
+ env_set("fdtfile", CONFIG_DEFAULT_FDT_FILE);
+
+ return 0;
+}