From dc2427ab20d71258c21379ebc575f05ac9d10141 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Wed, 8 Apr 2026 00:34:45 +0200 Subject: sunxi: spl: fix SPL_SUNXI_LED active low configuration The newly introduced Allwinner SPL LED "framework" defined a SPL_SUNXI_LED_STATUS_STATE Kconfig symbol, that was supposed to denote the active-low vs. active-high polarity of the LED. However this is a bool symbol, so it will simply vanish if not defined, and we cannot use it directly inside a C statement. Filter the symbol through the IS_ENABLED() macro, which will return 0 if the symbol is not defined, which is the intended value here. Since the STATUS_STATE name is a bit confusing, rename it to ACTIVE_HIGH on the way, because that is its real meaning. Also the LED_STATUS_BIT name for the GPIO number is similarly a remnant of the old status LED code, so rename it to LED_STATUS_GPIO as well. This fixes configuring LEDs with active-low polarity. Fixes: 256557dd9aae ("sunxi: remove usage of legacy LED API") Signed-off-by: Andre Przywara Reviewed-by: Paul Kocialkowski Closes: https://lore.kernel.org/u-boot/adfMQBPdntWy1KIq@shepard/ Acked-by: Quentin Schulz --- arch/arm/mach-sunxi/Kconfig | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 89f0e77bcdb..07d7ea2b7ad 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -1245,15 +1245,17 @@ config SPL_SUNXI_LED_STATUS if SPL_SUNXI_LED_STATUS -config SPL_SUNXI_LED_STATUS_BIT +config SPL_SUNXI_LED_STATUS_GPIO int "GPIO number for GPIO status LED" help GPIO number for the GPIO controlling the GPIO status LED in SPL. -config SPL_SUNXI_LED_STATUS_STATE - bool "GPIO status LED initial state is on" +config SPL_SUNXI_LED_STATUS_ACTIVE_HIGH + bool "GPIO status LED is active high" + default y help - Whether the initial state of the status LED in SPL must be on or off. + Whether the GPIO of the status LED must be set high or low to turn + the LED on. endif # SPL_SUNXI_LED_STATUS -- cgit v1.2.3 From 5a24cc0740e1afcca830dd83d9f1062034fff2d6 Mon Sep 17 00:00:00 2001 From: Jernej Skrabec Date: Sun, 5 Apr 2026 21:59:26 +0200 Subject: sunxi: H616: dram: fix LPDDR3 TPR6 parsing Allwinner's DRAM initialisation code defines a parameter named TPR6, presumably containing some "Vref" parameter, but containing values for *all* DRAM types. The runtime code selects one byte based on the DRAM type used. This selection code was wrong for LPDDR3, the value is encoded in bits [23:16], not [15:8]. Fix that in the code, which also aligns it with the very similar code for the A133 and A523. Signed-off-by: Jernej Skrabec Reported-by: Philippe Simons Reviewed-by: Andre Przywara Reviewed-by: Paul Kocialkowski --- arch/arm/mach-sunxi/dram_sun50i_h616.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-sunxi/dram_sun50i_h616.c b/arch/arm/mach-sunxi/dram_sun50i_h616.c index 3345c9b8e82..42a0550e015 100644 --- a/arch/arm/mach-sunxi/dram_sun50i_h616.c +++ b/arch/arm/mach-sunxi/dram_sun50i_h616.c @@ -975,7 +975,7 @@ static bool mctl_phy_init(const struct dram_para *para, val = para->tpr6 & 0xff; break; case SUNXI_DRAM_TYPE_LPDDR3: - val = para->tpr6 >> 8 & 0xff; + val = para->tpr6 >> 16 & 0xff; break; case SUNXI_DRAM_TYPE_LPDDR4: val = para->tpr6 >> 24 & 0xff; -- cgit v1.2.3 From 7ad8e387d6d56bc07a978a8e888fdf5276325be5 Mon Sep 17 00:00:00 2001 From: Andre Przywara Date: Mon, 27 Apr 2026 15:29:50 +0200 Subject: sunxi: H616: dram: drop default TPR6 Kconfig value CONFIG_DRAM_SUNXI_TPR6 is the only DRAM config parameter that has a non-zero default value. Since we need to provide a value for all the other parameters anyway, avoiding TPR6 makes no real difference. To make matters worse, TPR6 is a compound value covering multiple DRAM types, but also spans over three SoCs, which makes it hard to find one good default value. Drop the default from Kconfig, and put some explicit values in the defconfigs for the few boards that were relying on the default so far. The value is taken from one BSP, only the lower byte matters anyway for those boards, all using DDR3 DRAM. Signed-off-by: Andre Przywara Reviewed-by: Jernej Skrabec Reviewed-by: Paul Kocialkowski --- arch/arm/mach-sunxi/Kconfig | 1 - 1 file changed, 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig index 07d7ea2b7ad..ceba96b61a5 100644 --- a/arch/arm/mach-sunxi/Kconfig +++ b/arch/arm/mach-sunxi/Kconfig @@ -151,7 +151,6 @@ config DRAM_SUNXI_TPR3 config DRAM_SUNXI_TPR6 hex "DRAM TPR6 parameter" - default 0x3300c080 help TPR6 value from vendor DRAM settings. -- cgit v1.2.3