summaryrefslogtreecommitdiff
path: root/recipes-bsp
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2021-11-12 15:23:32 +0100
committerQuentin Schulz <quentin.schulz@theobroma-systems.com>2021-11-16 15:26:59 +0100
commit0ca1b573460ab861f61dcf40620cf165a3fb8308 (patch)
tree3544f5e89e6539766e18e74623daacda026e81a8 /recipes-bsp
add layer for RK3399 Puma Haikou
This is the initial support for RK3399 Puma Haikou in Yocto. Mid-term, most of the files and/or modifications required here will be moved to upstream layers such as meta-rockchip for example. Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Diffstat (limited to 'recipes-bsp')
-rw-r--r--recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend5
-rw-r--r--recipes-bsp/u-boot/files/0001-power-Tidy-up-undef-of-CONFIG_DM_PMIC.patch354
-rw-r--r--recipes-bsp/u-boot/files/0002-power-pmic-Consistently-depend-on-DM_PMIC.patch312
-rw-r--r--recipes-bsp/u-boot/files/0003-power-pmic-fan53555-allow-dm-be-omitted-by-SPL.patch56
-rw-r--r--recipes-bsp/u-boot/files/0004-configs-puma-rk3399-slim-down-SPL-size.patch52
-rw-r--r--recipes-bsp/u-boot/files/0005-configs-puma-rk3399-increase-max-size-for-SPL-stack.patch39
-rw-r--r--recipes-bsp/u-boot/u-boot%.bbappend9
7 files changed, 827 insertions, 0 deletions
diff --git a/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
new file mode 100644
index 0000000..2bfae48
--- /dev/null
+++ b/recipes-bsp/trusted-firmware-a/trusted-firmware-a_%.bbappend
@@ -0,0 +1,5 @@
+fixup_rk3399_baudrate() {
+ sed -i "s/#define RK3399_BAUDRATE\s\+[0-9]\+/#define RK3399_BAUDRATE ${RK_CONSOLE_BAUD}/" ${S}/plat/rockchip/rk3399/rk3399_def.h
+}
+
+do_patch[postfuncs] += "fixup_rk3399_baudrate"
diff --git a/recipes-bsp/u-boot/files/0001-power-Tidy-up-undef-of-CONFIG_DM_PMIC.patch b/recipes-bsp/u-boot/files/0001-power-Tidy-up-undef-of-CONFIG_DM_PMIC.patch
new file mode 100644
index 0000000..d2147af
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0001-power-Tidy-up-undef-of-CONFIG_DM_PMIC.patch
@@ -0,0 +1,354 @@
+From 50fd1754f38110b3c87452edf6bc9836a3b94224 Mon Sep 17 00:00:00 2001
+From: Simon Glass <sjg@chromium.org>
+Date: Sun, 8 Aug 2021 12:20:25 -0600
+Subject: [PATCH] power: Tidy up #undef of CONFIG_DM_PMIC
+
+Add a proper Kconfig option for SPL so we can remove the hack in some of
+the board config files.
+
+This involves adding CONFIG_SPL_DM_PMIC to some of the configs as well
+as updateing the Makefile rule for PMIC_RK8XX to exclude SPL.
+
+Signed-off-by: Simon Glass <sjg@chromium.org>
+Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
+[trini: Add SPL_PMIC_RK8XX, enable when needed, handle undef of
+ CONFIG_DM_PMIC_PFUZE100 as well]
+Signed-off-by: Tom Rini <trini@konsulko.com>
+
+Upstream-Status: Backport [7abf178bb815df7d7e1f6c5db202e02ae7d9489f]
+---
+ configs/imx8mm-cl-iot-gate_defconfig | 1 +
+ configs/imx8mm_beacon_defconfig | 1 +
+ configs/imx8mm_evk_defconfig | 1 +
+ configs/imx8mm_venice_defconfig | 1 +
+ configs/imx8mn_evk_defconfig | 1 +
+ configs/nanopi-r2s-rk3328_defconfig | 1 +
+ configs/odroid-go2_defconfig | 1 +
+ configs/puma-rk3399_defconfig | 1 +
+ configs/roc-cc-rk3328_defconfig | 1 +
+ configs/rock-pi-e-rk3328_defconfig | 1 +
+ configs/rock64-rk3328_defconfig | 1 +
+ configs/tinker-rk3288_defconfig | 1 +
+ configs/tinker-s-rk3288_defconfig | 1 +
+ configs/verdin-imx8mm_defconfig | 1 +
+ drivers/power/pmic/Kconfig | 22 ++++++++++++++++++++++
+ drivers/power/pmic/Makefile | 4 ++--
+ include/configs/imx8mp_evk.h | 2 --
+ include/configs/imx8mq_evk.h | 6 ------
+ include/configs/imx8mq_phanbell.h | 6 ------
+ include/configs/pico-imx8mq.h | 5 -----
+ 20 files changed, 38 insertions(+), 21 deletions(-)
+
+diff --git a/configs/imx8mm-cl-iot-gate_defconfig b/configs/imx8mm-cl-iot-gate_defconfig
+index f46f45bda9..ff15158dfa 100644
+--- a/configs/imx8mm-cl-iot-gate_defconfig
++++ b/configs/imx8mm-cl-iot-gate_defconfig
+@@ -102,6 +102,7 @@ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_POWER_DOMAIN=y
+ CONFIG_IMX8M_POWER_DOMAIN=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_DM_PMIC_BD71837=y
+ CONFIG_SPL_DM_PMIC_BD71837=y
+ CONFIG_DM_REGULATOR=y
+diff --git a/configs/imx8mm_beacon_defconfig b/configs/imx8mm_beacon_defconfig
+index 6f272ef9bc..a88706adf8 100644
+--- a/configs/imx8mm_beacon_defconfig
++++ b/configs/imx8mm_beacon_defconfig
+@@ -97,6 +97,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_DM_PMIC_BD71837=y
+ CONFIG_SPL_DM_PMIC_BD71837=y
+ CONFIG_DM_REGULATOR=y
+diff --git a/configs/imx8mm_evk_defconfig b/configs/imx8mm_evk_defconfig
+index a06c6f9794..00660135c7 100644
+--- a/configs/imx8mm_evk_defconfig
++++ b/configs/imx8mm_evk_defconfig
+@@ -74,6 +74,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_SPL_DM_PMIC_PCA9450=y
+ CONFIG_DM_REGULATOR=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/imx8mm_venice_defconfig b/configs/imx8mm_venice_defconfig
+index daffcc46d5..17593e0952 100644
+--- a/configs/imx8mm_venice_defconfig
++++ b/configs/imx8mm_venice_defconfig
+@@ -95,6 +95,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_DM_PMIC_BD71837=y
+ CONFIG_SPL_DM_PMIC_BD71837=y
+ CONFIG_DM_PMIC_MP5416=y
+diff --git a/configs/imx8mn_evk_defconfig b/configs/imx8mn_evk_defconfig
+index 469bef0e6d..81710bbccb 100644
+--- a/configs/imx8mn_evk_defconfig
++++ b/configs/imx8mn_evk_defconfig
+@@ -75,6 +75,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_SPL_DM_PMIC_PCA9450=y
+ CONFIG_DM_REGULATOR=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/nanopi-r2s-rk3328_defconfig b/configs/nanopi-r2s-rk3328_defconfig
+index 52996266a1..d033d56029 100644
+--- a/configs/nanopi-r2s-rk3328_defconfig
++++ b/configs/nanopi-r2s-rk3328_defconfig
+@@ -66,6 +66,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/odroid-go2_defconfig b/configs/odroid-go2_defconfig
+index f5b03a30ab..ee6e2ee156 100644
+--- a/configs/odroid-go2_defconfig
++++ b/configs/odroid-go2_defconfig
+@@ -81,6 +81,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_DM_REGULATOR_FIXED=y
+ CONFIG_REGULATOR_RK8XX=y
+diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
+index 1466090cc3..2011e8b2ab 100644
+--- a/configs/puma-rk3399_defconfig
++++ b/configs/puma-rk3399_defconfig
+@@ -67,6 +67,7 @@ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+ CONFIG_PHY_ROCKCHIP_TYPEC=y
+ CONFIG_DM_PMIC_FAN53555=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_SPL_DM_REGULATOR_FIXED=y
+diff --git a/configs/roc-cc-rk3328_defconfig b/configs/roc-cc-rk3328_defconfig
+index 8ddde6b147..e0babb6b3d 100644
+--- a/configs/roc-cc-rk3328_defconfig
++++ b/configs/roc-cc-rk3328_defconfig
+@@ -69,6 +69,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/rock-pi-e-rk3328_defconfig b/configs/rock-pi-e-rk3328_defconfig
+index ce932acb8c..e2cb1a5dc9 100644
+--- a/configs/rock-pi-e-rk3328_defconfig
++++ b/configs/rock-pi-e-rk3328_defconfig
+@@ -70,6 +70,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/rock64-rk3328_defconfig b/configs/rock64-rk3328_defconfig
+index 9653848cf6..4c45823e0b 100644
+--- a/configs/rock64-rk3328_defconfig
++++ b/configs/rock64-rk3328_defconfig
+@@ -68,6 +68,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_DM_REGULATOR_FIXED=y
+diff --git a/configs/tinker-rk3288_defconfig b/configs/tinker-rk3288_defconfig
+index 196348ac6f..7a1f8cc587 100644
+--- a/configs/tinker-rk3288_defconfig
++++ b/configs/tinker-rk3288_defconfig
+@@ -64,6 +64,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_DM_REGULATOR_FIXED=y
+ CONFIG_SPL_DM_REGULATOR_FIXED=y
+diff --git a/configs/tinker-s-rk3288_defconfig b/configs/tinker-s-rk3288_defconfig
+index 3720caabde..257208bccb 100644
+--- a/configs/tinker-s-rk3288_defconfig
++++ b/configs/tinker-s-rk3288_defconfig
+@@ -64,6 +64,7 @@ CONFIG_PINCTRL=y
+ CONFIG_SPL_PINCTRL=y
+ CONFIG_DM_PMIC=y
+ CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_DM_REGULATOR_FIXED=y
+ CONFIG_SPL_DM_REGULATOR_FIXED=y
+diff --git a/configs/verdin-imx8mm_defconfig b/configs/verdin-imx8mm_defconfig
+index d969370e25..5af111870c 100644
+--- a/configs/verdin-imx8mm_defconfig
++++ b/configs/verdin-imx8mm_defconfig
+@@ -91,6 +91,7 @@ CONFIG_PINCTRL_IMX8M=y
+ CONFIG_POWER_DOMAIN=y
+ CONFIG_IMX8M_POWER_DOMAIN=y
+ CONFIG_DM_PMIC=y
++CONFIG_SPL_DM_PMIC=y
+ CONFIG_SPL_DM_PMIC_PCA9450=y
+ CONFIG_DM_PMIC_PFUZE100=y
+ CONFIG_DM_REGULATOR=y
+diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
+index 583fd3ddcd..9d06a58830 100644
+--- a/drivers/power/pmic/Kconfig
++++ b/drivers/power/pmic/Kconfig
+@@ -10,6 +10,19 @@ config DM_PMIC
+ - 'drivers/power/pmic/pmic-uclass.c'
+ - 'include/power/pmic.h'
+
++config SPL_DM_PMIC
++ bool "Enable Driver Model for PMIC drivers (UCLASS_PMIC) in SPL"
++ depends on SPL_DM
++ default y if DM_PMIC
++ ---help---
++ This config enables the driver-model PMIC support in SPL.
++ UCLASS_PMIC - designed to provide an I/O interface for PMIC devices.
++ For the multi-function PMIC devices, this can be used as parent I/O
++ device for each IC's interface. Then, each children uses its parent
++ for read/write. For detailed description, please refer to the files:
++ - 'drivers/power/pmic/pmic-uclass.c'
++ - 'include/power/pmic.h'
++
+ config PMIC_CHILDREN
+ bool "Allow child devices for PMICs"
+ depends on DM_PMIC
+@@ -195,6 +208,15 @@ config PMIC_RK8XX
+ accessed via an I2C interface. The device is used with Rockchip SoCs.
+ This driver implements register read/write operations.
+
++config SPL_PMIC_RK8XX
++ bool "Enable support for Rockchip PMIC RK8XX"
++ depends on DM_PMIC
++ ---help---
++ The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs,
++ an RTC and two low Rds (resistance (drain to source)) switches. It is
++ accessed via an I2C interface. The device is used with Rockchip SoCs.
++ This driver implements register read/write operations.
++
+ config PMIC_S2MPS11
+ bool "Enable Driver Model for PMIC Samsung S2MPS11"
+ depends on DM_PMIC
+diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
+index 89099fde57..285231463a 100644
+--- a/drivers/power/pmic/Makefile
++++ b/drivers/power/pmic/Makefile
+@@ -3,7 +3,7 @@
+ # Copyright (C) 2012 Samsung Electronics
+ # Lukasz Majewski <l.majewski@samsung.com>
+
+-obj-$(CONFIG_DM_PMIC) += pmic-uclass.o
++obj-$(CONFIG_$(SPL_TPL_)DM_PMIC) += pmic-uclass.o
+ obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o
+ obj-$(CONFIG_$(SPL_)DM_PMIC_DA9063) += da9063.o
+ obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
+@@ -19,7 +19,7 @@ obj-$(CONFIG_PMIC_ACT8846) += act8846.o
+ obj-$(CONFIG_PMIC_AS3722) += as3722.o as3722_gpio.o
+ obj-$(CONFIG_PMIC_MAX8997) += max8997.o
+ obj-$(CONFIG_PMIC_PM8916) += pm8916.o
+-obj-$(CONFIG_PMIC_RK8XX) += rk8xx.o
++obj-$(CONFIG_$(SPL_TPL_)PMIC_RK8XX) += rk8xx.o
+ obj-$(CONFIG_PMIC_RN5T567) += rn5t567.o
+ obj-$(CONFIG_PMIC_TPS65090) += tps65090.o
+ obj-$(CONFIG_PMIC_S5M8767) += s5m8767.o
+diff --git a/include/configs/imx8mp_evk.h b/include/configs/imx8mp_evk.h
+index d1bc09e825..f25454d9a6 100644
+--- a/include/configs/imx8mp_evk.h
++++ b/include/configs/imx8mp_evk.h
+@@ -30,8 +30,6 @@
+ #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
+ #undef CONFIG_DM_MMC
+-#undef CONFIG_DM_PMIC
+-#undef CONFIG_DM_PMIC_PFUZE100
+
+ #define CONFIG_POWER
+ #define CONFIG_POWER_I2C
+diff --git a/include/configs/imx8mq_evk.h b/include/configs/imx8mq_evk.h
+index 1861ebad18..a76db4ffbc 100644
+--- a/include/configs/imx8mq_evk.h
++++ b/include/configs/imx8mq_evk.h
+@@ -41,8 +41,6 @@
+ #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
+ #undef CONFIG_DM_MMC
+-#undef CONFIG_DM_PMIC
+-#undef CONFIG_DM_PMIC_PFUZE100
+
+ #define CONFIG_SYS_I2C
+ #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
+@@ -144,8 +142,4 @@
+
+ #define CONFIG_OF_SYSTEM_SETUP
+
+-#ifndef CONFIG_SPL_BUILD
+-#define CONFIG_DM_PMIC
+-#endif
+-
+ #endif
+diff --git a/include/configs/imx8mq_phanbell.h b/include/configs/imx8mq_phanbell.h
+index 66c2c3a8d8..c5b6219066 100644
+--- a/include/configs/imx8mq_phanbell.h
++++ b/include/configs/imx8mq_phanbell.h
+@@ -38,8 +38,6 @@
+ #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
+ #undef CONFIG_DM_MMC
+-#undef CONFIG_DM_PMIC
+-#undef CONFIG_DM_PMIC_PFUZE100
+
+ #define CONFIG_SYS_I2C
+ #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
+@@ -189,8 +187,4 @@
+
+ #define CONFIG_OF_SYSTEM_SETUP
+
+-#ifndef CONFIG_SPL_BUILD
+-#define CONFIG_DM_PMIC
+-#endif
+-
+ #endif
+diff --git a/include/configs/pico-imx8mq.h b/include/configs/pico-imx8mq.h
+index 7a5891652f..e898d80bbb 100644
+--- a/include/configs/pico-imx8mq.h
++++ b/include/configs/pico-imx8mq.h
+@@ -38,7 +38,6 @@
+ #define CONFIG_SPL_ABORT_ON_RAW_IMAGE
+
+ #undef CONFIG_DM_MMC
+-#undef CONFIG_DM_PMIC
+
+ #define CONFIG_SYS_I2C
+ #define CONFIG_SYS_I2C_MXC_I2C1 /* enable I2C bus 1 */
+@@ -168,10 +167,6 @@
+
+ #define CONFIG_OF_SYSTEM_SETUP
+
+-#ifndef CONFIG_SPL_BUILD
+-#define CONFIG_DM_PMIC
+-#endif
+-
+ #define CONFIG_SYS_BOOTM_LEN SZ_128M
+
+ #endif
+--
+2.33.1
+
diff --git a/recipes-bsp/u-boot/files/0002-power-pmic-Consistently-depend-on-DM_PMIC.patch b/recipes-bsp/u-boot/files/0002-power-pmic-Consistently-depend-on-DM_PMIC.patch
new file mode 100644
index 0000000..1c01cec
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0002-power-pmic-Consistently-depend-on-DM_PMIC.patch
@@ -0,0 +1,312 @@
+From 96b374f5822043fd2360a76b9aa94afe894561b6 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Fri, 8 Oct 2021 00:17:14 -0500
+Subject: [PATCH] power: pmic: Consistently depend on DM_PMIC
+
+Kconfig symbols for two PMIC drivers (PMIC_AS3722 and DM_PMIC_MC34708)
+were missing a dependency on DM_PMIC. To fix this inconsistency, and to
+keep it from happening again, wrap the driver section with "if DM_PMIC"
+instead of using a "depends on DM_PMIC" clause for each driver.
+
+Reviewed-by: Igor Opaniuk <igor.opaniuk@foundries.io>
+Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
+Signed-off-by: Samuel Holland <samuel@sholland.org>
+Signed-off-by: Andre Przywara <andre.przywara@arm.com>
+
+Upstream-Status: Backport [7f51b554be381c99a24d37945038099a82d7993e]
+---
+ drivers/power/pmic/Kconfig | 45 ++++++++------------------------------
+ 1 file changed, 9 insertions(+), 36 deletions(-)
+
+diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
+index 9d06a58830..71833c34ab 100644
+--- a/drivers/power/pmic/Kconfig
++++ b/drivers/power/pmic/Kconfig
+@@ -10,10 +10,12 @@ config DM_PMIC
+ - 'drivers/power/pmic/pmic-uclass.c'
+ - 'include/power/pmic.h'
+
++if DM_PMIC
++
+ config SPL_DM_PMIC
+ bool "Enable Driver Model for PMIC drivers (UCLASS_PMIC) in SPL"
+ depends on SPL_DM
+- default y if DM_PMIC
++ default y
+ ---help---
+ This config enables the driver-model PMIC support in SPL.
+ UCLASS_PMIC - designed to provide an I/O interface for PMIC devices.
+@@ -25,7 +27,6 @@ config SPL_DM_PMIC
+
+ config PMIC_CHILDREN
+ bool "Allow child devices for PMICs"
+- depends on DM_PMIC
+ default y
+ ---help---
+ This allows PMICs to support child devices (such as regulators) in
+@@ -35,7 +36,6 @@ config PMIC_CHILDREN
+
+ config SPL_PMIC_CHILDREN
+ bool "Allow child devices for PMICs in SPL"
+- depends on DM_PMIC
+ default y
+ ---help---
+ This allows PMICs to support child devices (such as regulators) in
+@@ -46,7 +46,7 @@ config SPL_PMIC_CHILDREN
+
+ config PMIC_ACT8846
+ bool "Enable support for the active-semi 8846 PMIC"
+- depends on DM_PMIC && DM_I2C
++ depends on DM_I2C
+ ---help---
+ This PMIC includes 4 DC/DC step-down buck regulators and 8 low-dropout
+ regulators (LDOs). It also provides some GPIO, reset and battery
+@@ -55,14 +55,13 @@ config PMIC_ACT8846
+
+ config DM_PMIC_DA9063
+ bool "Enable Driver Model for the Dialog DA9063 PMIC"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC DA9063. The driver implements read/write operations.
+
+ config SPL_DM_PMIC_DA9063
+ bool "Enable Driver Model for the Dialog DA9063 PMIC in SPL"
+- depends on DM_PMIC && SPL
++ depends on SPL
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC DA9063. The driver implements read/write operations.
+@@ -77,14 +76,12 @@ config PMIC_AS3722
+
+ config DM_PMIC_BD71837
+ bool "Enable Driver Model for PMIC BD71837"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC BD71837. The driver implements read/write operations.
+
+ config SPL_DM_PMIC_BD71837
+ bool "Enable Driver Model for PMIC BD71837 in SPL stage"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass
+ features for PMIC BD71837. The driver implements read/write
+@@ -92,7 +89,7 @@ config SPL_DM_PMIC_BD71837
+
+ config DM_PMIC_FAN53555
+ bool "Enable support for OnSemi FAN53555"
+- depends on DM_PMIC && DM_REGULATOR && DM_I2C
++ depends on DM_REGULATOR && DM_I2C
+ select DM_REGULATOR_FAN53555
+ help
+ This config enables implementation of driver-model PMIC
+@@ -106,14 +103,12 @@ config DM_PMIC_FAN53555
+
+ config DM_PMIC_MP5416
+ bool "Enable Driver Model for PMIC MP5416"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC MP5416. The driver implements read/write operations.
+
+ config SPL_DM_PMIC_MP5416
+ bool "Enable Driver Model for PMIC MP5416 in SPL stage"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass
+ features for PMIC MP5416. The driver implements read/write
+@@ -121,56 +116,48 @@ config SPL_DM_PMIC_MP5416
+
+ config DM_PMIC_PCA9450
+ bool "Enable Driver Model for PMIC PCA9450"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC PCA9450. The driver implements read/write operations.
+
+ config SPL_DM_PMIC_PCA9450
+ bool "Enable Driver Model for PMIC PCA9450"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC PCA9450 in SPL. The driver implements read/write operations.
+
+ config DM_PMIC_PFUZE100
+ bool "Enable Driver Model for PMIC PFUZE100"
+- depends on DM_PMIC
+ ---help---
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC PFUZE100. The driver implements read/write operations.
+
+ config SPL_DM_PMIC_PFUZE100
+ bool "Enable Driver Model for PMIC PFUZE100 in SPL"
+- depends on DM_PMIC
+ ---help---
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC PFUZE100 in SPL. The driver implements read/write operations.
+
+ config DM_PMIC_MAX77686
+ bool "Enable Driver Model for PMIC MAX77686"
+- depends on DM_PMIC
+ ---help---
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC MAX77686. The driver implements read/write operations.
+
+ config DM_PMIC_MAX8998
+ bool "Enable Driver Model for PMIC MAX8998"
+- depends on DM_PMIC
+ ---help---
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC MAX8998. The driver implements read/write operations.
+
+ config DM_PMIC_MC34708
+ bool "Enable Driver Model for PMIC MC34708"
+- depends on DM_PMIC
+ help
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC MC34708. The driver implements read/write operations.
+
+ config PMIC_MAX8997
+ bool "Enable Driver Model for PMIC MAX8997"
+- depends on DM_PMIC
+ ---help---
+ This config enables implementation of driver-model pmic uclass features
+ for PMIC MAX8997. The driver implements read/write operations.
+@@ -185,7 +172,6 @@ config PMIC_MAX8997
+
+ config PMIC_PM8916
+ bool "Enable Driver Model for Qualcomm PM8916 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The PM8916 is a PMIC connected to one (or several) processors
+ with SPMI bus. It has 2 slaves with several peripherals:
+@@ -201,7 +187,6 @@ config PMIC_PM8916
+
+ config PMIC_RK8XX
+ bool "Enable support for Rockchip PMIC RK8XX"
+- depends on DM_PMIC
+ ---help---
+ The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs,
+ an RTC and two low Rds (resistance (drain to source)) switches. It is
+@@ -210,7 +195,6 @@ config PMIC_RK8XX
+
+ config SPL_PMIC_RK8XX
+ bool "Enable support for Rockchip PMIC RK8XX"
+- depends on DM_PMIC
+ ---help---
+ The Rockchip RK808 PMIC provides four buck DC-DC convertors, 8 LDOs,
+ an RTC and two low Rds (resistance (drain to source)) switches. It is
+@@ -219,7 +203,6 @@ config SPL_PMIC_RK8XX
+
+ config PMIC_S2MPS11
+ bool "Enable Driver Model for PMIC Samsung S2MPS11"
+- depends on DM_PMIC
+ ---help---
+ The Samsung S2MPS11 PMIC provides:
+ - 38 adjustable LDO regulators
+@@ -233,7 +216,6 @@ config PMIC_S2MPS11
+
+ config DM_PMIC_SANDBOX
+ bool "Enable Driver Model for emulated Sandbox PMIC"
+- depends on DM_PMIC
+ ---help---
+ Enable the driver for Sandbox PMIC emulation. The emulated PMIC device
+ depends on two drivers:
+@@ -258,7 +240,6 @@ config DM_PMIC_SANDBOX
+
+ config PMIC_S5M8767
+ bool "Enable Driver Model for the Samsung S5M8767 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The S5M8767 PMIC provides a large array of LDOs and BUCKs for use
+ as a SoC power controller. It also provides 32KHz clock outputs. This
+@@ -267,7 +248,6 @@ config PMIC_S5M8767
+
+ config PMIC_RN5T567
+ bool "Enable driver for Ricoh RN5T567 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The RN5T567 is a PMIC with 4 step-down DC/DC converters, 5 LDO
+ regulators Real-Time Clock and 4 GPIOs. This driver provides
+@@ -275,7 +255,6 @@ config PMIC_RN5T567
+
+ config PMIC_TPS65090
+ bool "Enable driver for Texas Instruments TPS65090 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The TPS65090 is a PMIC containing several LDOs, DC to DC convertors,
+ FETs and a battery charger. This driver provides register access
+@@ -284,21 +263,18 @@ config PMIC_TPS65090
+
+ config PMIC_PALMAS
+ bool "Enable driver for Texas Instruments PALMAS PMIC"
+- depends on DM_PMIC
+ ---help---
+ The PALMAS is a PMIC containing several LDOs, SMPS.
+ This driver binds the pmic children.
+
+ config PMIC_LP873X
+ bool "Enable driver for Texas Instruments LP873X PMIC"
+- depends on DM_PMIC
+ ---help---
+ The LP873X is a PMIC containing couple of LDOs and couple of SMPS.
+ This driver binds the pmic children.
+
+ config PMIC_LP87565
+ bool "Enable driver for Texas Instruments LP87565 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The LP87565 is a PMIC containing a bunch of SMPS.
+ This driver binds the pmic children.
+@@ -312,7 +288,6 @@ config POWER_MC34VR500
+
+ config DM_PMIC_TPS65910
+ bool "Enable driver for Texas Instruments TPS65910 PMIC"
+- depends on DM_PMIC
+ ---help---
+ The TPS65910 is a PMIC containing 3 buck DC-DC converters, one boost
+ DC-DC converter, 8 LDOs and a RTC. This driver binds the SMPS and LDO
+@@ -320,7 +295,7 @@ config DM_PMIC_TPS65910
+
+ config PMIC_STPMIC1
+ bool "Enable support for STMicroelectronics STPMIC1 PMIC"
+- depends on DM_PMIC && DM_I2C
++ depends on DM_I2C
+ select SYSRESET_CMD_POWEROFF if CMD_POWEROFF && !ARM_PSCI_FW
+ ---help---
+ The STPMIC1 PMIC provides 4 BUCKs, 6 LDOs, 1 VREF and 2 power switches.
+@@ -329,28 +304,26 @@ config PMIC_STPMIC1
+
+ config SPL_PMIC_PALMAS
+ bool "Enable driver for Texas Instruments PALMAS PMIC"
+- depends on DM_PMIC
+ help
+ The PALMAS is a PMIC containing several LDOs, SMPS.
+ This driver binds the pmic children in SPL.
+
+ config SPL_PMIC_LP873X
+ bool "Enable driver for Texas Instruments LP873X PMIC"
+- depends on DM_PMIC
+ help
+ The LP873X is a PMIC containing couple of LDOs and couple of SMPS.
+ This driver binds the pmic children in SPL.
+
+ config SPL_PMIC_LP87565
+ bool "Enable driver for Texas Instruments LP87565 PMIC"
+- depends on DM_PMIC
+ help
+ The LP87565 is a PMIC containing a bunch of SMPS.
+ This driver binds the pmic children in SPL.
+
+ config PMIC_TPS65941
+ bool "Enable driver for Texas Instruments TPS65941 PMIC"
+- depends on DM_PMIC
+ help
+ The TPS65941 is a PMIC containing a bunch of SMPS & LDOs.
+ This driver binds the pmic children.
++
++endif
+--
+2.33.1
+
diff --git a/recipes-bsp/u-boot/files/0003-power-pmic-fan53555-allow-dm-be-omitted-by-SPL.patch b/recipes-bsp/u-boot/files/0003-power-pmic-fan53555-allow-dm-be-omitted-by-SPL.patch
new file mode 100644
index 0000000..7042df2
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0003-power-pmic-fan53555-allow-dm-be-omitted-by-SPL.patch
@@ -0,0 +1,56 @@
+From 169d7bca39b96a69fddbe83d7bd56af9582dc417 Mon Sep 17 00:00:00 2001
+From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+Date: Wed, 10 Nov 2021 14:44:50 +0100
+Subject: [PATCH] power: pmic/fan53555: allow dm be omitted by SPL
+
+Allow the dm driver be omitted by SPL.
+
+Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+
+Upstream-Status: Submitted [https://lists.denx.de/pipermail/u-boot/2021-November/466977.html]
+---
+ drivers/power/pmic/Kconfig | 14 ++++++++++++++
+ drivers/power/pmic/Makefile | 2 +-
+ 2 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/power/pmic/Kconfig b/drivers/power/pmic/Kconfig
+index 71833c34ab..1439f87e51 100644
+--- a/drivers/power/pmic/Kconfig
++++ b/drivers/power/pmic/Kconfig
+@@ -101,6 +101,20 @@ config DM_PMIC_FAN53555
+ The driver implements read/write operations for use with the FAN53555
+ regulator driver and binds the regulator driver to its node.
+
++config SPL_DM_PMIC_FAN53555
++ bool "Enable support for OnSemi FAN53555 in SPL"
++ depends on SPL_DM_REGULATOR && SPL_DM_I2C
++ select DM_REGULATOR_FAN53555
++ help
++ This config enables implementation of driver-model PMIC
++ uclass features for the FAN53555 regulator. The FAN53555 is
++ a (family of) single-output regulators that supports
++ transitioning between two different output voltages based on
++ an voltage selection pin.
++
++ The driver implements read/write operations for use with the FAN53555
++ regulator driver and binds the regulator driver to its node.
++
+ config DM_PMIC_MP5416
+ bool "Enable Driver Model for PMIC MP5416"
+ help
+diff --git a/drivers/power/pmic/Makefile b/drivers/power/pmic/Makefile
+index 285231463a..8a42b018e8 100644
+--- a/drivers/power/pmic/Makefile
++++ b/drivers/power/pmic/Makefile
+@@ -4,7 +4,7 @@
+ # Lukasz Majewski <l.majewski@samsung.com>
+
+ obj-$(CONFIG_$(SPL_TPL_)DM_PMIC) += pmic-uclass.o
+-obj-$(CONFIG_DM_PMIC_FAN53555) += fan53555.o
++obj-$(CONFIG_$(SPL_)DM_PMIC_FAN53555) += fan53555.o
+ obj-$(CONFIG_$(SPL_)DM_PMIC_DA9063) += da9063.o
+ obj-$(CONFIG_DM_PMIC_MAX77686) += max77686.o
+ obj-$(CONFIG_DM_PMIC_MAX8998) += max8998.o
+--
+2.33.1
+
diff --git a/recipes-bsp/u-boot/files/0004-configs-puma-rk3399-slim-down-SPL-size.patch b/recipes-bsp/u-boot/files/0004-configs-puma-rk3399-slim-down-SPL-size.patch
new file mode 100644
index 0000000..7217583
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0004-configs-puma-rk3399-slim-down-SPL-size.patch
@@ -0,0 +1,52 @@
+From 2382a4676781c4bce81bc084c8600aa9d248a99c Mon Sep 17 00:00:00 2001
+From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+Date: Wed, 10 Nov 2021 14:51:12 +0100
+Subject: [PATCH] configs/puma-rk3399: slim down SPL size
+
+With some toolchains, the SPL is too big and fails in random ways.
+Removing support for I2C DM - which is anyway not used in SPL, see
+device tree - allows to save previous bytes.
+
+Proper way to do this would be to migrate over to TPL.
+
+Upstream-Status: Inappropriate[OE-Specific]
+This was not an issue on Debian11 and Fedora35 aarch64 GCCs.
+https://debian.pkgs.org/11/debian-main-amd64/gcc-aarch64-linux-gnu_10.2.1-1_amd64.deb.html
+https://fedora.pkgs.org/35/fedora-x86_64/gcc-aarch64-linux-gnu-11.2.1-1.fc35.x86_64.rpm.html
+
+Since most - if not all - RK3399-based devices in U-Boot are now using
+a TPL in addition to an SPL which isn't the case for Puma SoM.
+Upstream will be migrated to TPL instead of simply applying this patch.
+
+Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+---
+ configs/puma-rk3399_defconfig | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
+index 2011e8b2ab..0c90ce4318 100644
+--- a/configs/puma-rk3399_defconfig
++++ b/configs/puma-rk3399_defconfig
+@@ -46,6 +46,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+ CONFIG_SYS_MMC_ENV_DEV=1
+ CONFIG_SPL_DM_SEQ_ALIAS=y
+ CONFIG_ROCKCHIP_GPIO=y
++# CONFIG_SPL_DM_I2C is not set
+ CONFIG_SYS_I2C_ROCKCHIP=y
+ CONFIG_MISC=y
+ CONFIG_ROCKCHIP_EFUSE=y
+@@ -65,9 +66,10 @@ CONFIG_ETH_DESIGNWARE=y
+ CONFIG_GMAC_ROCKCHIP=y
+ CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+ CONFIG_PHY_ROCKCHIP_TYPEC=y
++# CONFIG_SPL_DM_PMIC is not set
++# CONFIG_SPL_PMIC_CHILDREN is not set
+ CONFIG_DM_PMIC_FAN53555=y
+ CONFIG_PMIC_RK8XX=y
+-CONFIG_SPL_PMIC_RK8XX=y
+ CONFIG_SPL_DM_REGULATOR=y
+ CONFIG_REGULATOR_PWM=y
+ CONFIG_SPL_DM_REGULATOR_FIXED=y
+--
+2.33.1
+
diff --git a/recipes-bsp/u-boot/files/0005-configs-puma-rk3399-increase-max-size-for-SPL-stack.patch b/recipes-bsp/u-boot/files/0005-configs-puma-rk3399-increase-max-size-for-SPL-stack.patch
new file mode 100644
index 0000000..af06c6c
--- /dev/null
+++ b/recipes-bsp/u-boot/files/0005-configs-puma-rk3399-increase-max-size-for-SPL-stack.patch
@@ -0,0 +1,39 @@
+From f3c07768cd1b55b47271f9a4dbbd24f186d28c3a Mon Sep 17 00:00:00 2001
+From: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+Date: Wed, 10 Nov 2021 10:17:49 +0100
+Subject: [PATCH] configs: puma-rk3399: increase max size for SPL stack
+
+This was borrowed from other RK3399-based boards. Without this patch,
+the SPL is failing in random ways and fails to boot U-Boot proper in
+most cases.
+
+Upstream-Status: Inappropriate[OE-Specific]
+This was not an issue on Debian11 and Fedora35 aarch64 GCCs.
+https://debian.pkgs.org/11/debian-main-amd64/gcc-aarch64-linux-gnu_10.2.1-1_amd64.deb.html
+https://fedora.pkgs.org/35/fedora-x86_64/gcc-aarch64-linux-gnu-11.2.1-1.fc35.x86_64.rpm.html
+
+Since most - if not all - RK3399-based devices in U-Boot are now using
+a TPL in addition to an SPL which isn't the case for Puma SoM.
+Upstream will be migrated to TPL instead of simply applying this patch.
+
+Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
+---
+ configs/puma-rk3399_defconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configs/puma-rk3399_defconfig b/configs/puma-rk3399_defconfig
+index 1466090cc3..eee3989e76 100644
+--- a/configs/puma-rk3399_defconfig
++++ b/configs/puma-rk3399_defconfig
+@@ -20,7 +20,7 @@ CONFIG_DISPLAY_BOARDINFO_LATE=y
+ CONFIG_MISC_INIT_R=y
+ # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+ CONFIG_SPL_STACK_R=y
+-CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x4000
++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+ CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
+ CONFIG_SPL_I2C_SUPPORT=y
+ CONFIG_SPL_POWER_SUPPORT=y
+--
+2.30.2
+
diff --git a/recipes-bsp/u-boot/u-boot%.bbappend b/recipes-bsp/u-boot/u-boot%.bbappend
new file mode 100644
index 0000000..23f0cd6
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot%.bbappend
@@ -0,0 +1,9 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
+
+SRC_URI:append:puma-haikou = " \
+ file://0001-power-Tidy-up-undef-of-CONFIG_DM_PMIC.patch \
+ file://0002-power-pmic-Consistently-depend-on-DM_PMIC.patch \
+ file://0003-power-pmic-fan53555-allow-dm-be-omitted-by-SPL.patch \
+ file://0004-configs-puma-rk3399-slim-down-SPL-size.patch \
+ file://0005-configs-puma-rk3399-increase-max-size-for-SPL-stack.patch \
+"