All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI
@ 2018-06-11 19:00 Carlo Caione
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators Carlo Caione
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Carlo Caione @ 2018-06-11 19:00 UTC (permalink / raw)
  To: u-boot

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

Changelog:

V2:
- Add Reviewed-by
- Expand comment on PATCH 2/3

V3:
- More Reviewed-by + Acked-by
- New PATCH 4/4

Carlo Caione (4):
  rk3288: veyron: Init boot-on regulators
  rk3288: Disable JTAG function from sdmmc0 IO
  rockchip: veyron: Set vcc33_sd regulator value
  rk3288: Convert register defines to const uintptr_t

 arch/arm/mach-rockchip/rk3288-board.c | 26 ++++++++++++++++++++++++--
 1 file changed, 24 insertions(+), 2 deletions(-)

-- 
2.17.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators
  2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
@ 2018-06-11 19:00 ` Carlo Caione
  2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 2/4] rk3288: Disable JTAG function from sdmmc0 IO Carlo Caione
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Carlo Caione @ 2018-06-11 19:00 UTC (permalink / raw)
  To: u-boot

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.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
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 2/4] rk3288: Disable JTAG function from sdmmc0 IO
  2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators Carlo Caione
@ 2018-06-11 19:00 ` Carlo Caione
  2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 3/4] rockchip: veyron: Set vcc33_sd regulator value Carlo Caione
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Carlo Caione @ 2018-06-11 19:00 UTC (permalink / raw)
  To: u-boot

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
---
 arch/arm/mach-rockchip/rk3288-board.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c
index 0365793009..bf24d8e074 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,11 @@ int board_early_init_f(void)
 	}
 	rk_setreg(GRF_SOC_CON2, 1 << 0);
 
+	/*
+	 * Disable JTAG on sdmmc0 IO. The SDMMC won't work until this bit is
+	 * cleared
+	 */
+	rk_clrreg(GRF_SOC_CON0, 1 << 12);
+
 	return 0;
 }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 3/4] rockchip: veyron: Set vcc33_sd regulator value
  2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators Carlo Caione
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 2/4] rk3288: Disable JTAG function from sdmmc0 IO Carlo Caione
@ 2018-06-11 19:00 ` Carlo Caione
  2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t Carlo Caione
  2018-06-24  9:06 ` [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
  4 siblings, 1 reply; 11+ messages in thread
From: Carlo Caione @ 2018-06-11 19:00 UTC (permalink / raw)
  To: u-boot

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>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.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 bf24d8e074..0e83c0a947 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 get 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__);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t
  2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
                   ` (2 preceding siblings ...)
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 3/4] rockchip: veyron: Set vcc33_sd regulator value Carlo Caione
@ 2018-06-11 19:00 ` Carlo Caione
  2018-07-09  3:05   ` Simon Glass
  2018-06-24  9:06 ` [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
  4 siblings, 1 reply; 11+ messages in thread
From: Carlo Caione @ 2018-06-11 19:00 UTC (permalink / raw)
  To: u-boot

From: Carlo Caione <carlo@endlessm.com>

No functional change but at least we can now guarantee type safety.

Signed-off-by: Carlo Caione <carlo@endlessm.com>
---
 arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-rockchip/rk3288-board.c b/arch/arm/mach-rockchip/rk3288-board.c
index 0e83c0a947..9c4f7f219f 100644
--- a/arch/arm/mach-rockchip/rk3288-board.c
+++ b/arch/arm/mach-rockchip/rk3288-board.c
@@ -317,11 +317,10 @@ U_BOOT_CMD(
 	""
 );
 
-#define GRF_SOC_CON0 0xff770244
-#define GRF_SOC_CON2 0xff77024c
-
 int board_early_init_f(void)
 {
+	const uintptr_t GRF_SOC_CON0 = 0xff770244;
+	const uintptr_t GRF_SOC_CON2 = 0xff77024c;
 	struct udevice *pinctrl;
 	struct udevice *dev;
 	int ret;
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI
  2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
                   ` (3 preceding siblings ...)
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t Carlo Caione
@ 2018-06-24  9:06 ` Carlo Caione
  4 siblings, 0 replies; 11+ messages in thread
From: Carlo Caione @ 2018-06-24  9:06 UTC (permalink / raw)
  To: u-boot

On Mon, 2018-06-11 at 20:00 +0100, Carlo Caione wrote:
> 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

Hey Philipp,
any comment on this v3?

Thanks.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t Carlo Caione
@ 2018-07-09  3:05   ` Simon Glass
  2018-07-13 10:26     ` Dr. Philipp Tomsich
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Glass @ 2018-07-09  3:05 UTC (permalink / raw)
  To: u-boot

On 11 June 2018 at 13:00, Carlo Caione <carlo@caione.org> wrote:
> From: Carlo Caione <carlo@endlessm.com>
>
> No functional change but at least we can now guarantee type safety.
>
> Signed-off-by: Carlo Caione <carlo@endlessm.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

I'm not sure this affects type safety. The value in the #define has
the same value (and type) as your variables.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [U-Boot, v3, 1/4] rk3288: veyron: Init boot-on regulators
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators Carlo Caione
@ 2018-07-13 10:25   ` Philipp Tomsich
  0 siblings, 0 replies; 11+ messages in thread
From: Philipp Tomsich @ 2018-07-13 10:25 UTC (permalink / raw)
  To: u-boot

> 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>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [U-Boot, v3, 2/4] rk3288: Disable JTAG function from sdmmc0 IO
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 2/4] rk3288: Disable JTAG function from sdmmc0 IO Carlo Caione
@ 2018-07-13 10:25   ` Philipp Tomsich
  0 siblings, 0 replies; 11+ messages in thread
From: Philipp Tomsich @ 2018-07-13 10:25 UTC (permalink / raw)
  To: u-boot

> 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>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [U-Boot, v3, 3/4] rockchip: veyron: Set vcc33_sd regulator value
  2018-06-11 19:00 ` [U-Boot] [PATCH v3 3/4] rockchip: veyron: Set vcc33_sd regulator value Carlo Caione
@ 2018-07-13 10:25   ` Philipp Tomsich
  0 siblings, 0 replies; 11+ messages in thread
From: Philipp Tomsich @ 2018-07-13 10:25 UTC (permalink / raw)
  To: u-boot

> 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>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
>  arch/arm/mach-rockchip/rk3288-board.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 

Applied to u-boot-rockchip, thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t
  2018-07-09  3:05   ` Simon Glass
@ 2018-07-13 10:26     ` Dr. Philipp Tomsich
  0 siblings, 0 replies; 11+ messages in thread
From: Dr. Philipp Tomsich @ 2018-07-13 10:26 UTC (permalink / raw)
  To: u-boot


> On 9 Jul 2018, at 05:05, Simon Glass <sjg@chromium.org> wrote:
> 
> On 11 June 2018 at 13:00, Carlo Caione <carlo@caione.org> wrote:
>> From: Carlo Caione <carlo@endlessm.com>
>> 
>> No functional change but at least we can now guarantee type safety.
>> 
>> Signed-off-by: Carlo Caione <carlo@endlessm.com>
>> ---
>> arch/arm/mach-rockchip/rk3288-board.c | 5 ++---
>> 1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> I'm not sure this affects type safety. The value in the #define has
> the same value (and type) as your variables.

I prefer this as locally defined const variables, so I’ve squashed this onto 2/4.

Philipp.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-07-13 10:26 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11 19:00 [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione
2018-06-11 19:00 ` [U-Boot] [PATCH v3 1/4] rk3288: veyron: Init boot-on regulators Carlo Caione
2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
2018-06-11 19:00 ` [U-Boot] [PATCH v3 2/4] rk3288: Disable JTAG function from sdmmc0 IO Carlo Caione
2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
2018-06-11 19:00 ` [U-Boot] [PATCH v3 3/4] rockchip: veyron: Set vcc33_sd regulator value Carlo Caione
2018-07-13 10:25   ` [U-Boot] [U-Boot, v3, " Philipp Tomsich
2018-06-11 19:00 ` [U-Boot] [PATCH v3 4/4] rk3288: Convert register defines to const uintptr_t Carlo Caione
2018-07-09  3:05   ` Simon Glass
2018-07-13 10:26     ` Dr. Philipp Tomsich
2018-06-24  9:06 ` [U-Boot] [PATCH v3 0/4] rk3288: veyron: Enable SDMMC when booting from SPI Carlo Caione

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.