[U-Boot] [PATCH 0/3] rk3288: veyron: Enable SDMMC when booting from SPI

From: Carlo Caione carlo@endlessm.com
These patches toghether with the previously submitted patch [0] enable the chromebook veyron jerry to use the SDMMC interface when U-Boot is not chainloaded by depthcharge but booted directly from SPI.
[0] https://marc.info/?l=u-boot&m=152836928803742&w=2
Carlo Caione (3): rk3288: veyron: Init boot-on regulators rk3288: Disable JTAG function from sdmmc0 IO rockchip: veyron: Set vcc33_sd regulator value
arch/arm/mach-rockchip/rk3288-board.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)

From: Carlo Caione carlo@endlessm.com
Use regulators_enable_boot_on() to init all the regulators with regulator-boot-on property.
Signed-off-by: Carlo Caione carlo@endlessm.com --- arch/arm/mach-rockchip/rk3288-board.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c index 8c128d4f94..0365793009 100644 --- a/arch/arm/mach-rockchip/rk3288-board.c +++ b/arch/arm/mach-rockchip/rk3288-board.c @@ -122,6 +122,12 @@ static int veyron_init(void) if (IS_ERR_VALUE(ret)) return ret;
+ ret = regulators_enable_boot_on(false); + if (ret) { + debug("%s: Cannot enable boot on regulators\n", __func__); + return ret; + } + return 0; } #endif

On 7 June 2018 at 04:39, Carlo Caione carlo@caione.org wrote:
From: Carlo Caione carlo@endlessm.com
Use regulators_enable_boot_on() to init all the regulators with regulator-boot-on property.
Signed-off-by: Carlo Caione carlo@endlessm.com
arch/arm/mach-rockchip/rk3288-board.c | 6 ++++++ 1 file changed, 6 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

From: Carlo Caione carlo@endlessm.com
The GRF_SOC_CON0.grf_force_jtag bit is automatically set at boot and it is preventing the SDMMC to work correctly. Disable the JTAG function on the assumption that a working SD has higher priority over JTAG.
Signed-off-by: Carlo Caione carlo@endlessm.com --- arch/arm/mach-rockchip/rk3288-board.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c index 0365793009..7499201b73 100644 --- a/arch/arm/mach-rockchip/rk3288-board.c +++ b/arch/arm/mach-rockchip/rk3288-board.c @@ -307,6 +307,7 @@ U_BOOT_CMD( "" );
+#define GRF_SOC_CON0 0xff770244 #define GRF_SOC_CON2 0xff77024c
int board_early_init_f(void) @@ -339,5 +340,8 @@ int board_early_init_f(void) } rk_setreg(GRF_SOC_CON2, 1 << 0);
+ /* Disable JTAG */ + rk_clrreg(GRF_SOC_CON0, 1 << 12); + return 0; }

On 7 June 2018 at 04:39, Carlo Caione carlo@caione.org wrote:
From: Carlo Caione carlo@endlessm.com
The GRF_SOC_CON0.grf_force_jtag bit is automatically set at boot and it is preventing the SDMMC to work correctly. Disable the JTAG function on the assumption that a working SD has higher priority over JTAG.
Signed-off-by: Carlo Caione carlo@endlessm.com
arch/arm/mach-rockchip/rk3288-board.c | 4 ++++ 1 file changed, 4 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
But please expand your comment to explain why you are disabling JTAG.
Regards, Simon

From: Carlo Caione carlo@endlessm.com
On the veyron board the vcc33_sd regulator is used as vmmc-supply for the SD card. This regulator is powered in the MMC core during power on but its value is never actually set.
In the veyron platform the reset value for the LDO output is 1.8V while the standard (min and max) value for this regulator defined in the DTS is 3.3V. When the MMC core enable the regulator without setting its value, the output is automatically set to 1.8V instead of 3.3V.
With this patch we preemptively set the value to 3.3V.
Signed-off-by: Carlo Caione carlo@endlessm.com --- arch/arm/mach-rockchip/rk3288-board.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c index 7499201b73..2e95249bbe 100644 --- a/arch/arm/mach-rockchip/rk3288-board.c +++ b/arch/arm/mach-rockchip/rk3288-board.c @@ -122,6 +122,16 @@ static int veyron_init(void) if (IS_ERR_VALUE(ret)) return ret;
+ ret = regulator_get_by_platname("vcc33_sd", &dev); + if (ret) { + debug("Cannot set regulator name\n"); + return ret; + } + + ret = regulator_set_value(dev, 3300000); + if (ret) + return ret; + ret = regulators_enable_boot_on(false); if (ret) { debug("%s: Cannot enable boot on regulators\n", __func__);

On 7 June 2018 at 04:39, Carlo Caione carlo@caione.org wrote:
From: Carlo Caione carlo@endlessm.com
On the veyron board the vcc33_sd regulator is used as vmmc-supply for the SD card. This regulator is powered in the MMC core during power on but its value is never actually set.
In the veyron platform the reset value for the LDO output is 1.8V while the standard (min and max) value for this regulator defined in the DTS is 3.3V. When the MMC core enable the regulator without setting its value, the output is automatically set to 1.8V instead of 3.3V.
With this patch we preemptively set the value to 3.3V.
Signed-off-by: Carlo Caione carlo@endlessm.com
arch/arm/mach-rockchip/rk3288-board.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org
participants (2)
-
Carlo Caione
-
Simon Glass