All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
@ 2015-01-08  5:44 Joonyoung Shim
  2015-01-08  5:44 ` [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT Joonyoung Shim
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-08  5:44 UTC (permalink / raw)
  To: u-boot

Some exynos boards require special handling of SD4_nRESET_OUT line for
eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.

This will support eMMC reset using DT from reset_misc of samsung common
board file and each board files can support eMMC reset on non DT case.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
 board/samsung/odroid/odroid.c                  |  2 +-
 doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt

diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
index c04ab3c..3218463 100644
--- a/board/samsung/common/board.c
+++ b/board/samsung/common/board.c
@@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
 	return 0;
 }
 
+__weak void exynos_reset_misc(void) {}
+
 #if defined CONFIG_EXYNOS_TMU
 /* Boot Time Thermal Analysis for SoC temperature threshold breach */
 static void boot_temp_check(void)
@@ -400,3 +402,28 @@ int misc_init_r(void)
 	return 0;
 }
 #endif
+
+void reset_misc(void)
+{
+#ifdef CONFIG_OF_CONTROL
+	struct gpio_desc gpio = {};
+	int node;
+
+	node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
+			"samsung,emmc-reset");
+	if (node < 0)
+		return;
+
+	gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
+				   GPIOD_IS_OUT);
+
+	if (dm_gpio_is_valid(&gpio)) {
+		/* Reset eMMC*/
+		dm_gpio_set_value(&gpio, 0);
+		mdelay(10);
+		dm_gpio_set_value(&gpio, 1);
+	}
+#else
+	exynos_reset_misc();
+#endif
+}
diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
index 3f43e17..db35945 100644
--- a/board/samsung/odroid/odroid.c
+++ b/board/samsung/odroid/odroid.c
@@ -516,7 +516,7 @@ int board_usb_init(int index, enum usb_init_type init)
 }
 #endif
 
-void reset_misc(void)
+void exynos_reset_misc(void)
 {
 	/* Reset eMMC*/
 	gpio_set_value(EXYNOS4X12_GPIO_K12, 0);
diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
new file mode 100644
index 0000000..e48e508
--- /dev/null
+++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
@@ -0,0 +1,15 @@
+* Samsung eMMC reset
+
+Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
+memory to perform complete reboot.
+
+Required properties:
+- compatible: should be "samsung,emmc-reset"
+- reset-gpio: gpio chip for eMMC reset.
+
+Example:
+
+emmc-reset {
+        compatible = "samsung,emmc-reset";
+        reset-gpio = <&gpk1 2 0>;
+};
-- 
1.9.1

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

* [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT
  2015-01-08  5:44 [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Joonyoung Shim
@ 2015-01-08  5:44 ` Joonyoung Shim
  2015-01-08 18:20   ` Simon Glass
  2015-01-08  5:44 ` [U-Boot] [PATCH 3/3] Odroid-XU3: " Joonyoung Shim
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-08  5:44 UTC (permalink / raw)
  To: u-boot

This needs for special handling of SD4_nRESET_OUT line for eMMC memory
to perform complete reboot on Odroid X2/U3 boards.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 arch/arm/dts/exynos4412-odroid.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/dts/exynos4412-odroid.dts b/arch/arm/dts/exynos4412-odroid.dts
index ecb3e23..519a7dd 100644
--- a/arch/arm/dts/exynos4412-odroid.dts
+++ b/arch/arm/dts/exynos4412-odroid.dts
@@ -90,4 +90,9 @@
 			reg = <0x125B0000 0x100>;
 		};
 	};
+
+	emmc-reset {
+		compatible = "samsung,emmc-reset";
+		reset-gpio = <&gpk1 2 0>;
+	};
 };
-- 
1.9.1

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

* [U-Boot] [PATCH 3/3] Odroid-XU3: Add eMMC-reset node on DT
  2015-01-08  5:44 [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Joonyoung Shim
  2015-01-08  5:44 ` [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT Joonyoung Shim
@ 2015-01-08  5:44 ` Joonyoung Shim
  2015-01-08 18:18 ` [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Simon Glass
  2015-01-08 23:23 ` Sjoerd Simons
  3 siblings, 0 replies; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-08  5:44 UTC (permalink / raw)
  To: u-boot

This needs for special handling of SD4_nRESET_OUT line for eMMC memory
to perform complete reboot on Odroid XU3 board.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
 arch/arm/dts/exynos5422-odroidxu3.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/dts/exynos5422-odroidxu3.dts b/arch/arm/dts/exynos5422-odroidxu3.dts
index 8f46637..d0a8621 100644
--- a/arch/arm/dts/exynos5422-odroidxu3.dts
+++ b/arch/arm/dts/exynos5422-odroidxu3.dts
@@ -46,4 +46,9 @@
 	mmc at 12220000 {
 		fifoth_val = <0x201f0020>;
 	};
+
+	emmc-reset {
+		compatible = "samsung,emmc-reset";
+		reset-gpio = <&gpd1 0 0>;
+	};
 };
-- 
1.9.1

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-08  5:44 [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Joonyoung Shim
  2015-01-08  5:44 ` [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT Joonyoung Shim
  2015-01-08  5:44 ` [U-Boot] [PATCH 3/3] Odroid-XU3: " Joonyoung Shim
@ 2015-01-08 18:18 ` Simon Glass
  2015-01-09  7:31   ` Joonyoung Shim
  2015-01-08 23:23 ` Sjoerd Simons
  3 siblings, 1 reply; 19+ messages in thread
From: Simon Glass @ 2015-01-08 18:18 UTC (permalink / raw)
  To: u-boot

Hi Joonyoung,

On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> Some exynos boards require special handling of SD4_nRESET_OUT line for
> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>
> This will support eMMC reset using DT from reset_misc of samsung common
> board file and each board files can support eMMC reset on non DT case.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>  board/samsung/odroid/odroid.c                  |  2 +-
>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>  3 files changed, 43 insertions(+), 1 deletion(-)
>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>
> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
> index c04ab3c..3218463 100644
> --- a/board/samsung/common/board.c
> +++ b/board/samsung/common/board.c
> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>         return 0;
>  }
>
> +__weak void exynos_reset_misc(void) {}
> +
>  #if defined CONFIG_EXYNOS_TMU
>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>  static void boot_temp_check(void)
> @@ -400,3 +402,28 @@ int misc_init_r(void)
>         return 0;
>  }
>  #endif
> +
> +void reset_misc(void)
> +{
> +#ifdef CONFIG_OF_CONTROL

I think all Samsung boards have this defined, so this #ifdef can be removed.

> +       struct gpio_desc gpio = {};
> +       int node;
> +
> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
> +                       "samsung,emmc-reset");
> +       if (node < 0)
> +               return;
> +
> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
> +                                  GPIOD_IS_OUT);
> +
> +       if (dm_gpio_is_valid(&gpio)) {
> +               /* Reset eMMC*/
> +               dm_gpio_set_value(&gpio, 0);
> +               mdelay(10);

That's a very long reset! Is that what it needs?

> +               dm_gpio_set_value(&gpio, 1);
> +       }
> +#else
> +       exynos_reset_misc();

So I don't think you need this function.

> +#endif
> +}
> diff --git a/board/samsung/odroid/odroid.c b/board/samsung/odroid/odroid.c
> index 3f43e17..db35945 100644
> --- a/board/samsung/odroid/odroid.c
> +++ b/board/samsung/odroid/odroid.c
> @@ -516,7 +516,7 @@ int board_usb_init(int index, enum usb_init_type init)
>  }
>  #endif
>
> -void reset_misc(void)
> +void exynos_reset_misc(void)
>  {
>         /* Reset eMMC*/
>         gpio_set_value(EXYNOS4X12_GPIO_K12, 0);
> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
> new file mode 100644
> index 0000000..e48e508
> --- /dev/null
> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
> @@ -0,0 +1,15 @@
> +* Samsung eMMC reset
> +
> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
> +memory to perform complete reboot.
> +
> +Required properties:
> +- compatible: should be "samsung,emmc-reset"
> +- reset-gpio: gpio chip for eMMC reset.
> +
> +Example:
> +
> +emmc-reset {
> +        compatible = "samsung,emmc-reset";
> +        reset-gpio = <&gpk1 2 0>;
> +};
> --
> 1.9.1
>

Regards,
Simon

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

* [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT
  2015-01-08  5:44 ` [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT Joonyoung Shim
@ 2015-01-08 18:20   ` Simon Glass
  2015-01-09  7:30     ` Joonyoung Shim
  0 siblings, 1 reply; 19+ messages in thread
From: Simon Glass @ 2015-01-08 18:20 UTC (permalink / raw)
  To: u-boot

Hi,

On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> This needs for special handling of SD4_nRESET_OUT line for eMMC memory
> to perform complete reboot on Odroid X2/U3 boards.
>
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> ---
>  arch/arm/dts/exynos4412-odroid.dts | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/dts/exynos4412-odroid.dts b/arch/arm/dts/exynos4412-odroid.dts
> index ecb3e23..519a7dd 100644
> --- a/arch/arm/dts/exynos4412-odroid.dts
> +++ b/arch/arm/dts/exynos4412-odroid.dts
> @@ -90,4 +90,9 @@
>                         reg = <0x125B0000 0x100>;
>                 };
>         };
> +
> +       emmc-reset {
> +               compatible = "samsung,emmc-reset";
> +               reset-gpio = <&gpk1 2 0>;
> +       };
>  };

Shouldn't this go in the relevant sdhci node instead of its own node?

Regards,
Simon

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-08  5:44 [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Joonyoung Shim
                   ` (2 preceding siblings ...)
  2015-01-08 18:18 ` [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Simon Glass
@ 2015-01-08 23:23 ` Sjoerd Simons
  2015-01-09  4:21   ` Jaehoon Chung
  3 siblings, 1 reply; 19+ messages in thread
From: Sjoerd Simons @ 2015-01-08 23:23 UTC (permalink / raw)
  To: u-boot

On Thu, 2015-01-08 at 14:44 +0900, Joonyoung Shim wrote:
> Some exynos boards require special handling of SD4_nRESET_OUT line for
> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
> 
> This will support eMMC reset using DT from reset_misc of samsung common
> board file and each board files can support eMMC reset on non DT case.
> 
> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
> new file mode 100644
> index 0000000..e48e508
> --- /dev/null
> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
> @@ -0,0 +1,15 @@
> +* Samsung eMMC reset
> +
> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
> +memory to perform complete reboot.

Nitpick, on XU3 the line you apparently need to twiddle is
SD0_nRESET_OUT.

Is this type of usage of this pin specific to the Odroid Exynos boards
or potentially on more boards? (Sorry for the simple questions, but my
exynos documentation just says the line exists not what its intended
usage is). 

Fwiw, I did a quick check in the linux code and it doesn't seem to be
using those pins for currently for any boards. However my X2 does
successfully reset/reboot in u-boot and linux, so it seems optional
there. The XU3 does fail to reset itself, so it seems required for that
board.

> +Required properties:
> +- compatible: should be "samsung,emmc-reset"
> +- reset-gpio: gpio chip for eMMC reset.
> +
> +Example:
> +
> +emmc-reset {
> +        compatible = "samsung,emmc-reset";
> +        reset-gpio = <&gpk1 2 0>;
> +};


-- 
Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150109/555ec0f6/attachment.bin>

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-08 23:23 ` Sjoerd Simons
@ 2015-01-09  4:21   ` Jaehoon Chung
  2015-01-09  7:42     ` Joonyoung Shim
  0 siblings, 1 reply; 19+ messages in thread
From: Jaehoon Chung @ 2015-01-09  4:21 UTC (permalink / raw)
  To: u-boot

On 01/09/2015 08:23 AM, Sjoerd Simons wrote:
> On Thu, 2015-01-08 at 14:44 +0900, Joonyoung Shim wrote:
>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>
>> This will support eMMC reset using DT from reset_misc of samsung common
>> board file and each board files can support eMMC reset on non DT case.
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> 
>> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
>> new file mode 100644
>> index 0000000..e48e508
>> --- /dev/null
>> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
>> @@ -0,0 +1,15 @@
>> +* Samsung eMMC reset
>> +
>> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
>> +memory to perform complete reboot.
> 
> Nitpick, on XU3 the line you apparently need to twiddle is
> SD0_nRESET_OUT.
> 
> Is this type of usage of this pin specific to the Odroid Exynos boards
> or potentially on more boards? (Sorry for the simple questions, but my
> exynos documentation just says the line exists not what its intended
> usage is). 

In case of Exynos4, eMMC can be used with sdhci controller or dw-mmc controller.
So Pin name should be used to SD0 or SD4.

But Exynos5 is only supported the dw-mmc controller.
(So eMMC is used pin-name as "SD0".)

Best Regards,
Jaehoon Chung
> 
> Fwiw, I did a quick check in the linux code and it doesn't seem to be
> using those pins for currently for any boards. However my X2 does
> successfully reset/reboot in u-boot and linux, so it seems optional
> there. The XU3 does fail to reset itself, so it seems required for that
> board.
> 
>> +Required properties:
>> +- compatible: should be "samsung,emmc-reset"
>> +- reset-gpio: gpio chip for eMMC reset.
>> +
>> +Example:
>> +
>> +emmc-reset {
>> +        compatible = "samsung,emmc-reset";
>> +        reset-gpio = <&gpk1 2 0>;
>> +};
> 
> 
> 
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
> 

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

* [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT
  2015-01-08 18:20   ` Simon Glass
@ 2015-01-09  7:30     ` Joonyoung Shim
  0 siblings, 0 replies; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-09  7:30 UTC (permalink / raw)
  To: u-boot

+Cc Jaehoon,

On 01/09/2015 03:20 AM, Simon Glass wrote:
> Hi,
> 
> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>> This needs for special handling of SD4_nRESET_OUT line for eMMC memory
>> to perform complete reboot on Odroid X2/U3 boards.
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>> ---
>>  arch/arm/dts/exynos4412-odroid.dts | 5 +++++
>>  1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm/dts/exynos4412-odroid.dts b/arch/arm/dts/exynos4412-odroid.dts
>> index ecb3e23..519a7dd 100644
>> --- a/arch/arm/dts/exynos4412-odroid.dts
>> +++ b/arch/arm/dts/exynos4412-odroid.dts
>> @@ -90,4 +90,9 @@
>>                         reg = <0x125B0000 0x100>;
>>                 };
>>         };
>> +
>> +       emmc-reset {
>> +               compatible = "samsung,emmc-reset";
>> +               reset-gpio = <&gpk1 2 0>;
>> +       };
>>  };
> 
> Shouldn't this go in the relevant sdhci node instead of its own node?
> 

Jaehoon, is it reasonable?

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-08 18:18 ` [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Simon Glass
@ 2015-01-09  7:31   ` Joonyoung Shim
  2015-01-09  7:48     ` Minkyu Kang
  2015-01-09 11:13     ` Jaehoon Chung
  0 siblings, 2 replies; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-09  7:31 UTC (permalink / raw)
  To: u-boot

+Cc Jaehoon,

On 01/09/2015 03:18 AM, Simon Glass wrote:
> Hi Joonyoung,
> 
> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>
>> This will support eMMC reset using DT from reset_misc of samsung common
>> board file and each board files can support eMMC reset on non DT case.
>>
>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>> ---
>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>  board/samsung/odroid/odroid.c                  |  2 +-
>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>
>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>> index c04ab3c..3218463 100644
>> --- a/board/samsung/common/board.c
>> +++ b/board/samsung/common/board.c
>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>         return 0;
>>  }
>>
>> +__weak void exynos_reset_misc(void) {}
>> +
>>  #if defined CONFIG_EXYNOS_TMU
>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>  static void boot_temp_check(void)
>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>         return 0;
>>  }
>>  #endif
>> +
>> +void reset_misc(void)
>> +{
>> +#ifdef CONFIG_OF_CONTROL
> 
> I think all Samsung boards have this defined, so this #ifdef can be removed.
> 

OK, if it is true, we can remove this and i will not to support non DT case.

>> +       struct gpio_desc gpio = {};
>> +       int node;
>> +
>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>> +                       "samsung,emmc-reset");
>> +       if (node < 0)
>> +               return;
>> +
>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>> +                                  GPIOD_IS_OUT);
>> +
>> +       if (dm_gpio_is_valid(&gpio)) {
>> +               /* Reset eMMC*/
>> +               dm_gpio_set_value(&gpio, 0);
>> +               mdelay(10);
> 
> That's a very long reset! Is that what it needs?
> 

Jaehoon, is there any guide about wait time of reset at eMMC spec?

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09  4:21   ` Jaehoon Chung
@ 2015-01-09  7:42     ` Joonyoung Shim
  2015-01-09  7:50       ` Sjoerd Simons
  0 siblings, 1 reply; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-09  7:42 UTC (permalink / raw)
  To: u-boot

Hi,

On 01/09/2015 01:21 PM, Jaehoon Chung wrote:
> On 01/09/2015 08:23 AM, Sjoerd Simons wrote:
>> On Thu, 2015-01-08 at 14:44 +0900, Joonyoung Shim wrote:
>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>
>>> This will support eMMC reset using DT from reset_misc of samsung common
>>> board file and each board files can support eMMC reset on non DT case.
>>>
>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>
>>> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
>>> new file mode 100644
>>> index 0000000..e48e508
>>> --- /dev/null
>>> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
>>> @@ -0,0 +1,15 @@
>>> +* Samsung eMMC reset
>>> +
>>> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
>>> +memory to perform complete reboot.
>>
>> Nitpick, on XU3 the line you apparently need to twiddle is
>> SD0_nRESET_OUT.
>>

Then, i think it's better to omit "SD4_".

>> Is this type of usage of this pin specific to the Odroid Exynos boards
>> or potentially on more boards? (Sorry for the simple questions, but my
>> exynos documentation just says the line exists not what its intended
>> usage is). 
> 
> In case of Exynos4, eMMC can be used with sdhci controller or dw-mmc controller.
> So Pin name should be used to SD0 or SD4.
> 
> But Exynos5 is only supported the dw-mmc controller.
> (So eMMC is used pin-name as "SD0".)
> 

I can find only "SD_4_nRESET_OUT" from exynos4412 user manual and only
"SD_0__nRESET_OUT" from exynos5422 user manual.

> Best Regards,
> Jaehoon Chung
>>
>> Fwiw, I did a quick check in the linux code and it doesn't seem to be
>> using those pins for currently for any boards. However my X2 does
>> successfully reset/reboot in u-boot and linux, so it seems optional
>> there. The XU3 does fail to reset itself, so it seems required for that
>> board.
>>

I checked upstream u-boot and hardkernel u-boot and i found codes to
reset eMMC using gpio.

upstream u-boot: reset_misc() of board/samsung/odroid/odroid.c
hardkernel u-boot: reset_cpu() of arch/arm/cpu/armv7/exynos/reset.c

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09  7:31   ` Joonyoung Shim
@ 2015-01-09  7:48     ` Minkyu Kang
  2015-01-09 11:13     ` Jaehoon Chung
  1 sibling, 0 replies; 19+ messages in thread
From: Minkyu Kang @ 2015-01-09  7:48 UTC (permalink / raw)
  To: u-boot

On 09/01/15 16:31, Joonyoung Shim wrote:
> +Cc Jaehoon,
> 
> On 01/09/2015 03:18 AM, Simon Glass wrote:
>> Hi Joonyoung,
>>
>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>
>>> This will support eMMC reset using DT from reset_misc of samsung common
>>> board file and each board files can support eMMC reset on non DT case.
>>>
>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>> ---
>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>
>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>> index c04ab3c..3218463 100644
>>> --- a/board/samsung/common/board.c
>>> +++ b/board/samsung/common/board.c
>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>         return 0;
>>>  }
>>>
>>> +__weak void exynos_reset_misc(void) {}
>>> +
>>>  #if defined CONFIG_EXYNOS_TMU
>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>  static void boot_temp_check(void)
>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>         return 0;
>>>  }
>>>  #endif
>>> +
>>> +void reset_misc(void)
>>> +{
>>> +#ifdef CONFIG_OF_CONTROL
>>
>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>
> 
> OK, if it is true, we can remove this and i will not to support non DT case.

It's OK.

Thanks,
Minkyu Kang.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09  7:42     ` Joonyoung Shim
@ 2015-01-09  7:50       ` Sjoerd Simons
  2015-01-10  6:41         ` Joonyoung Shim
  0 siblings, 1 reply; 19+ messages in thread
From: Sjoerd Simons @ 2015-01-09  7:50 UTC (permalink / raw)
  To: u-boot

On Fri, 2015-01-09 at 16:42 +0900, Joonyoung Shim wrote:
> Hi,
> 
> On 01/09/2015 01:21 PM, Jaehoon Chung wrote:
> > On 01/09/2015 08:23 AM, Sjoerd Simons wrote:
> >> On Thu, 2015-01-08 at 14:44 +0900, Joonyoung Shim wrote:
> >>> Some exynos boards require special handling of SD4_nRESET_OUT line for
> >>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
> >>>
> >>> This will support eMMC reset using DT from reset_misc of samsung common
> >>> board file and each board files can support eMMC reset on non DT case.
> >>>
> >>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
> >>
> >>> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
> >>> new file mode 100644
> >>> index 0000000..e48e508
> >>> --- /dev/null
> >>> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
> >>> @@ -0,0 +1,15 @@
> >>> +* Samsung eMMC reset
> >>> +
> >>> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
> >>> +memory to perform complete reboot.
> >>
> >> Nitpick, on XU3 the line you apparently need to twiddle is
> >> SD0_nRESET_OUT.
> >>
> 
> Then, i think it's better to omit "SD4_".
> 
> >> Is this type of usage of this pin specific to the Odroid Exynos boards
> >> or potentially on more boards? (Sorry for the simple questions, but my
> >> exynos documentation just says the line exists not what its intended
> >> usage is). 
> > 
> > In case of Exynos4, eMMC can be used with sdhci controller or dw-mmc controller.
> > So Pin name should be used to SD0 or SD4.
> > 
> > But Exynos5 is only supported the dw-mmc controller.
> > (So eMMC is used pin-name as "SD0".)
> > 
> 
> I can find only "SD_4_nRESET_OUT" from exynos4412 user manual and only
> "SD_0__nRESET_OUT" from exynos5422 user manual.
> 
> > Best Regards,
> > Jaehoon Chung
> >>
> >> Fwiw, I did a quick check in the linux code and it doesn't seem to be
> >> using those pins for currently for any boards. However my X2 does
> >> successfully reset/reboot in u-boot and linux, so it seems optional
> >> there. The XU3 does fail to reset itself, so it seems required for that
> >> board.
> >>
> 
> I checked upstream u-boot and hardkernel u-boot and i found codes to
> reset eMMC using gpio.
> 
> upstream u-boot: reset_misc() of board/samsung/odroid/odroid.c
> hardkernel u-boot: reset_cpu() of arch/arm/cpu/armv7/exynos/reset.c

Yeah u-boot does it, but linux upstream kernel does not. Hence wondering
about the requirements.

-- 
Sjoerd Simons <sjoerd.simons@collabora.co.uk>
Collabora Ltd.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6170 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150109/c45692aa/attachment.bin>

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09  7:31   ` Joonyoung Shim
  2015-01-09  7:48     ` Minkyu Kang
@ 2015-01-09 11:13     ` Jaehoon Chung
  2015-01-10  6:53       ` Joonyoung Shim
  1 sibling, 1 reply; 19+ messages in thread
From: Jaehoon Chung @ 2015-01-09 11:13 UTC (permalink / raw)
  To: u-boot

On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
> +Cc Jaehoon,
> 
> On 01/09/2015 03:18 AM, Simon Glass wrote:
>> Hi Joonyoung,
>>
>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>
>>> This will support eMMC reset using DT from reset_misc of samsung common
>>> board file and each board files can support eMMC reset on non DT case.
>>>
>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>> ---
>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>
>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>> index c04ab3c..3218463 100644
>>> --- a/board/samsung/common/board.c
>>> +++ b/board/samsung/common/board.c
>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>         return 0;
>>>  }
>>>
>>> +__weak void exynos_reset_misc(void) {}
>>> +
>>>  #if defined CONFIG_EXYNOS_TMU
>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>  static void boot_temp_check(void)
>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>         return 0;
>>>  }
>>>  #endif
>>> +
>>> +void reset_misc(void)
>>> +{
>>> +#ifdef CONFIG_OF_CONTROL
>>
>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>
> 
> OK, if it is true, we can remove this and i will not to support non DT case.
> 
>>> +       struct gpio_desc gpio = {};
>>> +       int node;
>>> +
>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>> +                       "samsung,emmc-reset");
>>> +       if (node < 0)
>>> +               return;
>>> +
>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>> +                                  GPIOD_IS_OUT);
>>> +
>>> +       if (dm_gpio_is_valid(&gpio)) {
>>> +               /* Reset eMMC*/
>>> +               dm_gpio_set_value(&gpio, 0);
>>> +               mdelay(10);
>>
>> That's a very long reset! Is that what it needs?
>>
> 
> Jaehoon, is there any guide about wait time of reset at eMMC spec?

Well, I'm not sure, but as Simon's comments, it's long time.
(Minimum is 1us...Maximum isn't defined.)

Best Regards,
Jaehoon Chung

> 
> Thanks.
> 

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09  7:50       ` Sjoerd Simons
@ 2015-01-10  6:41         ` Joonyoung Shim
  0 siblings, 0 replies; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-10  6:41 UTC (permalink / raw)
  To: u-boot

Hi Sjoerd,

On 01/09/2015 04:50 PM, Sjoerd Simons wrote:
> On Fri, 2015-01-09 at 16:42 +0900, Joonyoung Shim wrote:
>> Hi,
>>
>> On 01/09/2015 01:21 PM, Jaehoon Chung wrote:
>>> On 01/09/2015 08:23 AM, Sjoerd Simons wrote:
>>>> On Thu, 2015-01-08 at 14:44 +0900, Joonyoung Shim wrote:
>>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>>
>>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>>> board file and each board files can support eMMC reset on non DT case.
>>>>>
>>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>
>>>>> diff --git a/doc/device-tree-bindings/exynos/emmc-reset.txt b/doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>> new file mode 100644
>>>>> index 0000000..e48e508
>>>>> --- /dev/null
>>>>> +++ b/doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>> @@ -0,0 +1,15 @@
>>>>> +* Samsung eMMC reset
>>>>> +
>>>>> +Some exynos boards require special handling of SD4_nRESET_OUT line for eMMC
>>>>> +memory to perform complete reboot.
>>>>
>>>> Nitpick, on XU3 the line you apparently need to twiddle is
>>>> SD0_nRESET_OUT.
>>>>
>>
>> Then, i think it's better to omit "SD4_".
>>
>>>> Is this type of usage of this pin specific to the Odroid Exynos boards
>>>> or potentially on more boards? (Sorry for the simple questions, but my
>>>> exynos documentation just says the line exists not what its intended
>>>> usage is). 
>>>
>>> In case of Exynos4, eMMC can be used with sdhci controller or dw-mmc controller.
>>> So Pin name should be used to SD0 or SD4.
>>>
>>> But Exynos5 is only supported the dw-mmc controller.
>>> (So eMMC is used pin-name as "SD0".)
>>>
>>
>> I can find only "SD_4_nRESET_OUT" from exynos4412 user manual and only
>> "SD_0__nRESET_OUT" from exynos5422 user manual.
>>
>>> Best Regards,
>>> Jaehoon Chung
>>>>
>>>> Fwiw, I did a quick check in the linux code and it doesn't seem to be
>>>> using those pins for currently for any boards. However my X2 does
>>>> successfully reset/reboot in u-boot and linux, so it seems optional
>>>> there. The XU3 does fail to reset itself, so it seems required for that
>>>> board.
>>>>
>>
>> I checked upstream u-boot and hardkernel u-boot and i found codes to
>> reset eMMC using gpio.
>>
>> upstream u-boot: reset_misc() of board/samsung/odroid/odroid.c
>> hardkernel u-boot: reset_cpu() of arch/arm/cpu/armv7/exynos/reset.c
> 
> Yeah u-boot does it, but linux upstream kernel does not. Hence wondering
> about the requirements.
> 

I didn't test Odroid X2 board but my Odroid U3 board cannot reboot
without controlling nRESET_OUT gpio on upstream linux kernel.

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-09 11:13     ` Jaehoon Chung
@ 2015-01-10  6:53       ` Joonyoung Shim
  2015-01-10 17:46         ` Simon Glass
  0 siblings, 1 reply; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-10  6:53 UTC (permalink / raw)
  To: u-boot

On 01/09/2015 08:13 PM, Jaehoon Chung wrote:
> On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
>> +Cc Jaehoon,
>>
>> On 01/09/2015 03:18 AM, Simon Glass wrote:
>>> Hi Joonyoung,
>>>
>>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>
>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>> board file and each board files can support eMMC reset on non DT case.
>>>>
>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>> ---
>>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>
>>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>>> index c04ab3c..3218463 100644
>>>> --- a/board/samsung/common/board.c
>>>> +++ b/board/samsung/common/board.c
>>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>>         return 0;
>>>>  }
>>>>
>>>> +__weak void exynos_reset_misc(void) {}
>>>> +
>>>>  #if defined CONFIG_EXYNOS_TMU
>>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>>  static void boot_temp_check(void)
>>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>>         return 0;
>>>>  }
>>>>  #endif
>>>> +
>>>> +void reset_misc(void)
>>>> +{
>>>> +#ifdef CONFIG_OF_CONTROL
>>>
>>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>>
>>
>> OK, if it is true, we can remove this and i will not to support non DT case.
>>
>>>> +       struct gpio_desc gpio = {};
>>>> +       int node;
>>>> +
>>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>>> +                       "samsung,emmc-reset");
>>>> +       if (node < 0)
>>>> +               return;
>>>> +
>>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>>> +                                  GPIOD_IS_OUT);
>>>> +
>>>> +       if (dm_gpio_is_valid(&gpio)) {
>>>> +               /* Reset eMMC*/
>>>> +               dm_gpio_set_value(&gpio, 0);
>>>> +               mdelay(10);
>>>
>>> That's a very long reset! Is that what it needs?
>>>
>>
>> Jaehoon, is there any guide about wait time of reset at eMMC spec?
> 
> Well, I'm not sure, but as Simon's comments, it's long time.
> (Minimum is 1us...Maximum isn't defined.)
> 

This just comes from reset_misc() of board/samsung/odroid/odroid.c file.
Even, hardkernel u-boot waits 50msec.

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-10  6:53       ` Joonyoung Shim
@ 2015-01-10 17:46         ` Simon Glass
  2015-01-12  1:45           ` Jaehoon Chung
  0 siblings, 1 reply; 19+ messages in thread
From: Simon Glass @ 2015-01-10 17:46 UTC (permalink / raw)
  To: u-boot

Hi,


On 9 January 2015 at 23:53, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> On 01/09/2015 08:13 PM, Jaehoon Chung wrote:
>> On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
>>> +Cc Jaehoon,
>>>
>>> On 01/09/2015 03:18 AM, Simon Glass wrote:
>>>> Hi Joonyoung,
>>>>
>>>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>>
>>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>>> board file and each board files can support eMMC reset on non DT case.
>>>>>
>>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>> ---
>>>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>>
>>>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>>>> index c04ab3c..3218463 100644
>>>>> --- a/board/samsung/common/board.c
>>>>> +++ b/board/samsung/common/board.c
>>>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>>>         return 0;
>>>>>  }
>>>>>
>>>>> +__weak void exynos_reset_misc(void) {}
>>>>> +
>>>>>  #if defined CONFIG_EXYNOS_TMU
>>>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>>>  static void boot_temp_check(void)
>>>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>>>         return 0;
>>>>>  }
>>>>>  #endif
>>>>> +
>>>>> +void reset_misc(void)
>>>>> +{
>>>>> +#ifdef CONFIG_OF_CONTROL
>>>>
>>>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>>>
>>>
>>> OK, if it is true, we can remove this and i will not to support non DT case.
>>>
>>>>> +       struct gpio_desc gpio = {};
>>>>> +       int node;
>>>>> +
>>>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>>>> +                       "samsung,emmc-reset");
>>>>> +       if (node < 0)
>>>>> +               return;
>>>>> +
>>>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>>>> +                                  GPIOD_IS_OUT);
>>>>> +
>>>>> +       if (dm_gpio_is_valid(&gpio)) {
>>>>> +               /* Reset eMMC*/
>>>>> +               dm_gpio_set_value(&gpio, 0);
>>>>> +               mdelay(10);
>>>>
>>>> That's a very long reset! Is that what it needs?
>>>>
>>>
>>> Jaehoon, is there any guide about wait time of reset at eMMC spec?
>>
>> Well, I'm not sure, but as Simon's comments, it's long time.
>> (Minimum is 1us...Maximum isn't defined.)
>>
>
> This just comes from reset_misc() of board/samsung/odroid/odroid.c file.
> Even, hardkernel u-boot waits 50msec.

The only info I have immediately to hand is the 'JEDEC Standard No.
84-A441' (eMMC) and it says a 1uS pulse is required. So can we change
this to udelay(1)?

Regards,
Simon

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-10 17:46         ` Simon Glass
@ 2015-01-12  1:45           ` Jaehoon Chung
  2015-01-12  4:45             ` Joonyoung Shim
  0 siblings, 1 reply; 19+ messages in thread
From: Jaehoon Chung @ 2015-01-12  1:45 UTC (permalink / raw)
  To: u-boot

On 01/11/2015 02:46 AM, Simon Glass wrote:
> Hi,
> 
> 
> On 9 January 2015 at 23:53, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>> On 01/09/2015 08:13 PM, Jaehoon Chung wrote:
>>> On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
>>>> +Cc Jaehoon,
>>>>
>>>> On 01/09/2015 03:18 AM, Simon Glass wrote:
>>>>> Hi Joonyoung,
>>>>>
>>>>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>>>
>>>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>>>> board file and each board files can support eMMC reset on non DT case.
>>>>>>
>>>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>>> ---
>>>>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>>>
>>>>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>>>>> index c04ab3c..3218463 100644
>>>>>> --- a/board/samsung/common/board.c
>>>>>> +++ b/board/samsung/common/board.c
>>>>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>>>>         return 0;
>>>>>>  }
>>>>>>
>>>>>> +__weak void exynos_reset_misc(void) {}
>>>>>> +
>>>>>>  #if defined CONFIG_EXYNOS_TMU
>>>>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>>>>  static void boot_temp_check(void)
>>>>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>>>>         return 0;
>>>>>>  }
>>>>>>  #endif
>>>>>> +
>>>>>> +void reset_misc(void)
>>>>>> +{
>>>>>> +#ifdef CONFIG_OF_CONTROL
>>>>>
>>>>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>>>>
>>>>
>>>> OK, if it is true, we can remove this and i will not to support non DT case.
>>>>
>>>>>> +       struct gpio_desc gpio = {};
>>>>>> +       int node;
>>>>>> +
>>>>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>>>>> +                       "samsung,emmc-reset");
>>>>>> +       if (node < 0)
>>>>>> +               return;
>>>>>> +
>>>>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>>>>> +                                  GPIOD_IS_OUT);
>>>>>> +
>>>>>> +       if (dm_gpio_is_valid(&gpio)) {
>>>>>> +               /* Reset eMMC*/
>>>>>> +               dm_gpio_set_value(&gpio, 0);
>>>>>> +               mdelay(10);
>>>>>
>>>>> That's a very long reset! Is that what it needs?
>>>>>
>>>>
>>>> Jaehoon, is there any guide about wait time of reset at eMMC spec?
>>>
>>> Well, I'm not sure, but as Simon's comments, it's long time.
>>> (Minimum is 1us...Maximum isn't defined.)
>>>
>>
>> This just comes from reset_misc() of board/samsung/odroid/odroid.c file.
>> Even, hardkernel u-boot waits 50msec.
> 
> The only info I have immediately to hand is the 'JEDEC Standard No.
> 84-A441' (eMMC) and it says a 1uS pulse is required. So can we change
> this to udelay(1)?

It's minimum value, that's not problem that 10msec is set.
But if change this value, i think good that it changes to greater value than 1us.

Best Regards,
Jaehoon Chung
> 
> Regards,
> Simon
> 

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-12  1:45           ` Jaehoon Chung
@ 2015-01-12  4:45             ` Joonyoung Shim
  2015-01-12 15:54               ` Simon Glass
  0 siblings, 1 reply; 19+ messages in thread
From: Joonyoung Shim @ 2015-01-12  4:45 UTC (permalink / raw)
  To: u-boot

On 01/12/2015 10:45 AM, Jaehoon Chung wrote:
> On 01/11/2015 02:46 AM, Simon Glass wrote:
>> Hi,
>>
>>
>> On 9 January 2015 at 23:53, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>> On 01/09/2015 08:13 PM, Jaehoon Chung wrote:
>>>> On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
>>>>> +Cc Jaehoon,
>>>>>
>>>>> On 01/09/2015 03:18 AM, Simon Glass wrote:
>>>>>> Hi Joonyoung,
>>>>>>
>>>>>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>>>>
>>>>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>>>>> board file and each board files can support eMMC reset on non DT case.
>>>>>>>
>>>>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>>>> ---
>>>>>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>>>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>>>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>>>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>>>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>>>>
>>>>>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>>>>>> index c04ab3c..3218463 100644
>>>>>>> --- a/board/samsung/common/board.c
>>>>>>> +++ b/board/samsung/common/board.c
>>>>>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>>>>>         return 0;
>>>>>>>  }
>>>>>>>
>>>>>>> +__weak void exynos_reset_misc(void) {}
>>>>>>> +
>>>>>>>  #if defined CONFIG_EXYNOS_TMU
>>>>>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>>>>>  static void boot_temp_check(void)
>>>>>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>>>>>         return 0;
>>>>>>>  }
>>>>>>>  #endif
>>>>>>> +
>>>>>>> +void reset_misc(void)
>>>>>>> +{
>>>>>>> +#ifdef CONFIG_OF_CONTROL
>>>>>>
>>>>>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>>>>>
>>>>>
>>>>> OK, if it is true, we can remove this and i will not to support non DT case.
>>>>>
>>>>>>> +       struct gpio_desc gpio = {};
>>>>>>> +       int node;
>>>>>>> +
>>>>>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>>>>>> +                       "samsung,emmc-reset");
>>>>>>> +       if (node < 0)
>>>>>>> +               return;
>>>>>>> +
>>>>>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>>>>>> +                                  GPIOD_IS_OUT);
>>>>>>> +
>>>>>>> +       if (dm_gpio_is_valid(&gpio)) {
>>>>>>> +               /* Reset eMMC*/
>>>>>>> +               dm_gpio_set_value(&gpio, 0);
>>>>>>> +               mdelay(10);
>>>>>>
>>>>>> That's a very long reset! Is that what it needs?
>>>>>>
>>>>>
>>>>> Jaehoon, is there any guide about wait time of reset at eMMC spec?
>>>>
>>>> Well, I'm not sure, but as Simon's comments, it's long time.
>>>> (Minimum is 1us...Maximum isn't defined.)
>>>>
>>>
>>> This just comes from reset_misc() of board/samsung/odroid/odroid.c file.
>>> Even, hardkernel u-boot waits 50msec.
>>
>> The only info I have immediately to hand is the 'JEDEC Standard No.
>> 84-A441' (eMMC) and it says a 1uS pulse is required. So can we change
>> this to udelay(1)?
> 
> It's minimum value, that's not problem that 10msec is set.
> But if change this value, i think good that it changes to greater value than 1us.
> 

Actually, i don't have any idea about proper wait time, so i will use
just current 10msec with TODO comments until getting right guide about
wait time. Is it ok?

Thanks.

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

* [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT
  2015-01-12  4:45             ` Joonyoung Shim
@ 2015-01-12 15:54               ` Simon Glass
  0 siblings, 0 replies; 19+ messages in thread
From: Simon Glass @ 2015-01-12 15:54 UTC (permalink / raw)
  To: u-boot

Hi,

On 11 January 2015 at 20:45, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
> On 01/12/2015 10:45 AM, Jaehoon Chung wrote:
>> On 01/11/2015 02:46 AM, Simon Glass wrote:
>>> Hi,
>>>
>>>
>>> On 9 January 2015 at 23:53, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>> On 01/09/2015 08:13 PM, Jaehoon Chung wrote:
>>>>> On 01/09/2015 04:31 PM, Joonyoung Shim wrote:
>>>>>> +Cc Jaehoon,
>>>>>>
>>>>>> On 01/09/2015 03:18 AM, Simon Glass wrote:
>>>>>>> Hi Joonyoung,
>>>>>>>
>>>>>>> On 7 January 2015 at 22:44, Joonyoung Shim <jy0922.shim@samsung.com> wrote:
>>>>>>>> Some exynos boards require special handling of SD4_nRESET_OUT line for
>>>>>>>> eMMC memory to perform complete reboot e.g. Odroid X2/U3/XU3 boards.
>>>>>>>>
>>>>>>>> This will support eMMC reset using DT from reset_misc of samsung common
>>>>>>>> board file and each board files can support eMMC reset on non DT case.
>>>>>>>>
>>>>>>>> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
>>>>>>>> ---
>>>>>>>>  board/samsung/common/board.c                   | 27 ++++++++++++++++++++++++++
>>>>>>>>  board/samsung/odroid/odroid.c                  |  2 +-
>>>>>>>>  doc/device-tree-bindings/exynos/emmc-reset.txt | 15 ++++++++++++++
>>>>>>>>  3 files changed, 43 insertions(+), 1 deletion(-)
>>>>>>>>  create mode 100644 doc/device-tree-bindings/exynos/emmc-reset.txt
>>>>>>>>
>>>>>>>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c
>>>>>>>> index c04ab3c..3218463 100644
>>>>>>>> --- a/board/samsung/common/board.c
>>>>>>>> +++ b/board/samsung/common/board.c
>>>>>>>> @@ -40,6 +40,8 @@ __weak int exynos_power_init(void)
>>>>>>>>         return 0;
>>>>>>>>  }
>>>>>>>>
>>>>>>>> +__weak void exynos_reset_misc(void) {}
>>>>>>>> +
>>>>>>>>  #if defined CONFIG_EXYNOS_TMU
>>>>>>>>  /* Boot Time Thermal Analysis for SoC temperature threshold breach */
>>>>>>>>  static void boot_temp_check(void)
>>>>>>>> @@ -400,3 +402,28 @@ int misc_init_r(void)
>>>>>>>>         return 0;
>>>>>>>>  }
>>>>>>>>  #endif
>>>>>>>> +
>>>>>>>> +void reset_misc(void)
>>>>>>>> +{
>>>>>>>> +#ifdef CONFIG_OF_CONTROL
>>>>>>>
>>>>>>> I think all Samsung boards have this defined, so this #ifdef can be removed.
>>>>>>>
>>>>>>
>>>>>> OK, if it is true, we can remove this and i will not to support non DT case.
>>>>>>
>>>>>>>> +       struct gpio_desc gpio = {};
>>>>>>>> +       int node;
>>>>>>>> +
>>>>>>>> +       node = fdt_node_offset_by_compatible(gd->fdt_blob, 0,
>>>>>>>> +                       "samsung,emmc-reset");
>>>>>>>> +       if (node < 0)
>>>>>>>> +               return;
>>>>>>>> +
>>>>>>>> +       gpio_request_by_name_nodev(gd->fdt_blob, node, "reset-gpio", 0, &gpio,
>>>>>>>> +                                  GPIOD_IS_OUT);
>>>>>>>> +
>>>>>>>> +       if (dm_gpio_is_valid(&gpio)) {
>>>>>>>> +               /* Reset eMMC*/
>>>>>>>> +               dm_gpio_set_value(&gpio, 0);
>>>>>>>> +               mdelay(10);
>>>>>>>
>>>>>>> That's a very long reset! Is that what it needs?
>>>>>>>
>>>>>>
>>>>>> Jaehoon, is there any guide about wait time of reset at eMMC spec?
>>>>>
>>>>> Well, I'm not sure, but as Simon's comments, it's long time.
>>>>> (Minimum is 1us...Maximum isn't defined.)
>>>>>
>>>>
>>>> This just comes from reset_misc() of board/samsung/odroid/odroid.c file.
>>>> Even, hardkernel u-boot waits 50msec.
>>>
>>> The only info I have immediately to hand is the 'JEDEC Standard No.
>>> 84-A441' (eMMC) and it says a 1uS pulse is required. So can we change
>>> this to udelay(1)?
>>
>> It's minimum value, that's not problem that 10msec is set.
>> But if change this value, i think good that it changes to greater value than 1us.
>>
>
> Actually, i don't have any idea about proper wait time, so i will use
> just current 10msec with TODO comments until getting right guide about
> wait time. Is it ok?

Find with me, you are just moving code. I think you should also
mention that the eMMC spec says 1us and someone should test it.

Regards,
Simon

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

end of thread, other threads:[~2015-01-12 15:54 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08  5:44 [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Joonyoung Shim
2015-01-08  5:44 ` [U-Boot] [PATCH 2/3] Odroid: Add eMMC-reset node on DT Joonyoung Shim
2015-01-08 18:20   ` Simon Glass
2015-01-09  7:30     ` Joonyoung Shim
2015-01-08  5:44 ` [U-Boot] [PATCH 3/3] Odroid-XU3: " Joonyoung Shim
2015-01-08 18:18 ` [U-Boot] [PATCH 1/3] samsung: board: support eMMC reset using DT Simon Glass
2015-01-09  7:31   ` Joonyoung Shim
2015-01-09  7:48     ` Minkyu Kang
2015-01-09 11:13     ` Jaehoon Chung
2015-01-10  6:53       ` Joonyoung Shim
2015-01-10 17:46         ` Simon Glass
2015-01-12  1:45           ` Jaehoon Chung
2015-01-12  4:45             ` Joonyoung Shim
2015-01-12 15:54               ` Simon Glass
2015-01-08 23:23 ` Sjoerd Simons
2015-01-09  4:21   ` Jaehoon Chung
2015-01-09  7:42     ` Joonyoung Shim
2015-01-09  7:50       ` Sjoerd Simons
2015-01-10  6:41         ` Joonyoung Shim

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.