rockchip: display PMIC variant properly + misc fixes for Theobroma boards
cover rockchip: display PMIC variant properly + misc fixes for Theobroma boards
This fixes how the Rockchip PMIC variant is shown for all but RK808 by stripping the LSB.
Also fix the size of the environment on Jaguar to match the default (smaller) size.
Fix SPL_PAD_TO on Ringneck.
Remove duplicated default value of ENV_OFFSET in puma defconfig.
Remove unnecessary override of the fit offset in u-boot dtsi for Puma and Ringneck.
---
Quentin Schulz (5):
rockchip: jaguar-rk3588: use default env size for Rockchip on MMC
rockchip: rk3399-puma: remove default value from defconfig
rockchip: rk3399-puma: remove unnecessary simple-bin:fit:offset override
rockchip: px30-ringneck: Update SPL_PAD_TO Kconfig option
power: rk8xx: properly print all supported PMICs name
arch/arm/dts/px30-ringneck-haikou-u-boot.dtsi | 8 -------- arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi | 6 ------ configs/jaguar-rk3588_defconfig | 1 - configs/puma-rk3399_defconfig | 1 - configs/ringneck-px30_defconfig | 2 +- drivers/power/pmic/rk8xx.c | 4 ++-- 6 files changed, 3 insertions(+), 19 deletions(-)
---
base-commit: 8887ffb625f65475fd6619f8b05fb7a5a12b016b
change-id: 20240524-misc-tsd-e08551c01c8a
Best regards,
Signature · 1 line
Quentin Schulz <[email protected]>
PATCH 1/5 rockchip: jaguar-rk3588: use default env size for Rockchip on MMC
From: Quentin Schulz <[email protected]>
The default env size is 0x8000 when building for Rockchip SoCs with support for environment stored in MMC.
Jaguar hasn't entered mass production just yet, so it's a breaking change we can afford in the name of consistency.
--- configs/jaguar-rk3588_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/jaguar-rk3588_defconfig +0 -1
@@ -5,7 +5,6 @@ CONFIG_ARCH_ROCKCHIP=y CONFIG_SPL_GPIO=y CONFIG_SF_DEFAULT_SPEED=24000000 CONFIG_SF_DEFAULT_MODE=0x2000 -CONFIG_ENV_SIZE=0x1f000 CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3588-jaguar" CONFIG_ROCKCHIP_RK3588=y CONFIG_ROCKCHIP_BOOT_MODE_REG=0x0
Signature · 1 line
2.45.1
PATCH 2/5 rockchip: rk3399-puma: remove default value from defconfig
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
CONFIG_ENV_OFFSET already defaults to 0x3F8000, however it is stored in lowercase hexdigits instead of uppercase like in the defconfig.
No change in behavior intended.
--- configs/puma-rk3399_defconfig | 1 - 1 file changed, 1 deletion(-)
configs/puma-rk3399_defconfig +0 -1
@@ -6,7 +6,6 @@ CONFIG_SPL_GPIO=y CONFIG_NR_DRAM_BANKS=1 CONFIG_SF_DEFAULT_SPEED=20000000 CONFIG_ENV_SIZE=0x3000 -CONFIG_ENV_OFFSET=0x3F8000 CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3399-puma-haikou" CONFIG_DM_RESET=y CONFIG_ROCKCHIP_RK3399=y
Signature · 1 line
2.45.1
PATCH 3/5 rockchip: rk3399-puma: remove unnecessary simple-bin:fit:offset override
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
Since commit 6007b69d544e ("rockchip: rk3399-puma: Update SPL_PAD_TO Kconfig option"), SPL_PAD_TO matches (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512 and the default value for simple-bin:fit:offset in rockchip-u-boot.dtsi is SPL_PAD_TO, so let's remove this override.
--- arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi | 6 ------ 1 file changed, 6 deletions(-)
arch/arm/dts/rk3399-puma-haikou-u-boot.dtsi +0 -6
@@ -33,12 +33,6 @@ }; &binman { - simple-bin { - fit { - offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; - }; - }; - #ifdef CONFIG_ROCKCHIP_SPI_IMAGE simple-bin-spi { fit {
Signature · 1 line
2.45.1
PATCH 4/5 rockchip: px30-ringneck: Update SPL_PAD_TO Kconfig option
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
On px30-ringneck the FIT payload is located at sector 0x200 compared to the more Rockchip common sector 0x4000 offset:
SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
Because FIT payload is located at sector 0x200 and the TPL+SPL is located at sector 64, the combined size of TPL+SPL cannot take up more than 224KiB:
(0x200 - 64) x 512 = 0x38000 (224 KiB)
Adjust SPL_PAD_TO to match the used 0x200 sector offset.
While at it, update the px30-ringneck-u-boot.dtsi to remove the now unnecessary override of simple-bin:fit:offset since SPL_PAD_TO matches with the current formula.
--- arch/arm/dts/px30-ringneck-haikou-u-boot.dtsi | 8 -------- configs/ringneck-px30_defconfig | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-)
arch/arm/dts/px30-ringneck-haikou-u-boot.dtsi +0 -8
@@ -15,14 +15,6 @@ }; }; -&binman { - simple-bin { - fit { - offset = <((CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512)>; - }; - }; -}; - &emmc_clk { bootph-all; };
configs/ringneck-px30_defconfig +1 -1
@@ -25,7 +25,7 @@ CONFIG_DEFAULT_FDT_FILE="rockchip/px30-ringneck-haikou.dtb" CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_MISC_INIT_R=y CONFIG_SPL_MAX_SIZE=0x20000 -CONFIG_SPL_PAD_TO=0x0 +CONFIG_SPL_PAD_TO=0x38000 CONFIG_SPL_BOARD_INIT=y CONFIG_SPL_BOOTROM_SUPPORT=y # CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
Signature · 1 line
2.45.1
PATCH 5/5 power: rk8xx: properly print all supported PMICs name
In reply to Quentin SchulzFrom: Quentin Schulz <[email protected]>
The ID of the PMIC is stored in the 2 16b registers but the only part that matters right now is the 3 MSB, which make the 3 digits (in hex) of the part number.
Right now, only RK808 was properly displayed, with this all currently supported PMICs should display the proper part number.
Tested on RK806 (RK3588 Jaguar), RK808 (RK3399 Puma) and RK809 (PX30 Ringneck).
--- drivers/power/pmic/rk8xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/pmic/rk8xx.c +2 -2
@@ -277,10 +277,10 @@ static int rk8xx_probe(struct udevice *dev)return ret; priv->variant = ((msb <<8 ) | lsb) &RK8XX_ID_MSK ; - show_variant = priv->variant; +/* All currently supported PMICs store the variant in the 3 MSB */ + show_variant = priv->variant >>4 ;switch (priv->variant) {case RK808_ID : - show_variant =0x808 ;/* RK808 hardware ID is 0 */ break ;case RK805_ID :case RK816_ID :
Signature · 1 line
2.45.1
Re: [PATCH next 5/5] power: rk8xx: properly print all supported PMICs name
Hello Quentin,
Thanks for fixing this issue! Please see my comments below.
Quoted 22 lines · Quentin Schulz
From: Quentin Schulz <[email protected]>
The ID of the PMIC is stored in the 2 16b registers but the only part that matters right now is the 3 MSB, which make the 3 digits (in hex) of the part number.
Right now, only RK808 was properly displayed, with this all currently supported PMICs should display the proper part number.
Tested on RK806 (RK3588 Jaguar), RK808 (RK3399 Puma) and RK809 (PX30 Ringneck).
Signed-off-by Quentin Schulz <[email protected]>--- drivers/power/pmic/rk8xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/power/pmic/rk8xx.c +0
-0
drivers/power/pmic/rk8xx.c static int rk8xx_probe(struct udevice *dev) · line 281
Quoted 6 lines
drivers/power/pmic/rk8xx.c +2
-1@@ -277,10 +277,10 @@ static int rk8xx_probe(struct udevice *dev)return ret; priv->variant = ((msb <<8 ) | lsb) &RK8XX_ID_MSK ; - show_variant = priv->variant; +/* All currently supported PMICs store the variant in the 3 MSB */ + show_variant = priv->variant >>4 ;
It would be better to use bitfield_shift() to produce the shift value from RK8XX_ID_MSK, instead of using 4 as the hardcoded value. Or even better, just use bitfield_extract_by_mask() directly.
drivers/power/pmic/rk8xx.c static int rk8xx_probe(struct udevice *dev) · line 286
Quoted 6 lines
drivers/power/pmic/rk8xx.c +0
-1switch (priv->variant) {case RK808_ID : - show_variant =0x808 ;/* RK808 hardware ID is 0 */ break ;case RK805_ID :case RK816_ID :
I'd suggest that show_variant is also used in the following line, instead of priv-variant, for consistency with the printing of the known PMIC variant:
315 printf("Unknown PMIC: RK%x!!\n", priv->variant);