public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] tegra: enable NAND on Harmony
@ 2012-07-30 17:37 Stephen Warren
  2012-07-30 20:34 ` Simon Glass
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Stephen Warren @ 2012-07-30 17:37 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 board/nvidia/dts/tegra20-harmony.dts |   10 ++++++++++
 include/configs/harmony.h            |    9 ++++++++-
 2 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/board/nvidia/dts/tegra20-harmony.dts b/board/nvidia/dts/tegra20-harmony.dts
index c351954..ca5facb 100644
--- a/board/nvidia/dts/tegra20-harmony.dts
+++ b/board/nvidia/dts/tegra20-harmony.dts
@@ -54,4 +54,14 @@
 	usb at c5004000 {
 		status = "disabled";
 	};
+
+	nand-controller at 70008000 {
+		nvidia,wp-gpios = <&gpio 23 0>;		/* PC7 */
+		nvidia,width = <8>;
+		nvidia,timing = <26 100 20 80 20 10 12 10 70>;
+		nand at 0 {
+			reg = <0>;
+			compatible = "hynix,hy27uf4g2b", "nand-flash";
+		};
+	};
 };
diff --git a/include/configs/harmony.h b/include/configs/harmony.h
index d0555c1..85059b9 100644
--- a/include/configs/harmony.h
+++ b/include/configs/harmony.h
@@ -62,8 +62,15 @@
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
 
+/* NAND support */
+#define CONFIG_CMD_NAND
+#define CONFIG_TEGRA_NAND
+#define CONFIG_SYS_MAX_NAND_DEVICE	1
+#define CONFIG_SYS_NAND_BASE	TEGRA20_NAND_BASE
+
 /* Environment not stored */
-#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_ENV_IS_IN_NAND
+#define CONFIG_ENV_OFFSET	(SZ_512M - SZ_128K) /* 128K sector size */
 
 /* USB Host support */
 #define CONFIG_USB_EHCI
-- 
1.7.0.4

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

* [U-Boot] [PATCH] tegra: enable NAND on Harmony
  2012-07-30 17:37 [U-Boot] [PATCH] tegra: enable NAND on Harmony Stephen Warren
@ 2012-07-30 20:34 ` Simon Glass
  2012-07-31  5:53 ` Thierry Reding
  2012-08-10 23:32 ` Scott Wood
  2 siblings, 0 replies; 5+ messages in thread
From: Simon Glass @ 2012-07-30 20:34 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 30, 2012 at 6:37 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

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

(nice to have a commit message though)

> ---
>  board/nvidia/dts/tegra20-harmony.dts |   10 ++++++++++
>  include/configs/harmony.h            |    9 ++++++++-
>  2 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/board/nvidia/dts/tegra20-harmony.dts b/board/nvidia/dts/tegra20-harmony.dts
> index c351954..ca5facb 100644
> --- a/board/nvidia/dts/tegra20-harmony.dts
> +++ b/board/nvidia/dts/tegra20-harmony.dts
> @@ -54,4 +54,14 @@
>         usb at c5004000 {
>                 status = "disabled";
>         };
> +
> +       nand-controller at 70008000 {
> +               nvidia,wp-gpios = <&gpio 23 0>;         /* PC7 */
> +               nvidia,width = <8>;
> +               nvidia,timing = <26 100 20 80 20 10 12 10 70>;
> +               nand at 0 {
> +                       reg = <0>;
> +                       compatible = "hynix,hy27uf4g2b", "nand-flash";
> +               };
> +       };
>  };
> diff --git a/include/configs/harmony.h b/include/configs/harmony.h
> index d0555c1..85059b9 100644
> --- a/include/configs/harmony.h
> +++ b/include/configs/harmony.h
> @@ -62,8 +62,15 @@
>  #define CONFIG_CMD_EXT2
>  #define CONFIG_CMD_FAT
>
> +/* NAND support */
> +#define CONFIG_CMD_NAND
> +#define CONFIG_TEGRA_NAND
> +#define CONFIG_SYS_MAX_NAND_DEVICE     1
> +#define CONFIG_SYS_NAND_BASE   TEGRA20_NAND_BASE
> +
>  /* Environment not stored */
> -#define CONFIG_ENV_IS_NOWHERE
> +#define CONFIG_ENV_IS_IN_NAND
> +#define CONFIG_ENV_OFFSET      (SZ_512M - SZ_128K) /* 128K sector size */
>
>  /* USB Host support */
>  #define CONFIG_USB_EHCI
> --
> 1.7.0.4
>

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

* [U-Boot] [PATCH] tegra: enable NAND on Harmony
  2012-07-30 17:37 [U-Boot] [PATCH] tegra: enable NAND on Harmony Stephen Warren
  2012-07-30 20:34 ` Simon Glass
@ 2012-07-31  5:53 ` Thierry Reding
  2012-08-10 23:32 ` Scott Wood
  2 siblings, 0 replies; 5+ messages in thread
From: Thierry Reding @ 2012-07-31  5:53 UTC (permalink / raw)
  To: u-boot

On Mon, Jul 30, 2012 at 11:37:52AM -0600, Stephen Warren wrote:
> diff --git a/include/configs/harmony.h b/include/configs/harmony.h
[...]
>  /* Environment not stored */
> -#define CONFIG_ENV_IS_NOWHERE
> +#define CONFIG_ENV_IS_IN_NAND
> +#define CONFIG_ENV_OFFSET	(SZ_512M - SZ_128K) /* 128K sector size */

Perhaps the comment should be updated now.

Also on a semi-related note, do you think it would be useful to define
some kind of common layout for NAND content? I noticed that there is now
an open-source implementation of nvflash that could be used to bootstrap
U-Boot. That combined with the NAND support in U-Boot could be used to
streamline the bootstrapping of boards.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120731/10e0dc3a/attachment.pgp>

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

* [U-Boot] [PATCH] tegra: enable NAND on Harmony
  2012-07-30 17:37 [U-Boot] [PATCH] tegra: enable NAND on Harmony Stephen Warren
  2012-07-30 20:34 ` Simon Glass
  2012-07-31  5:53 ` Thierry Reding
@ 2012-08-10 23:32 ` Scott Wood
  2012-08-13 16:24   ` Stephen Warren
  2 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2012-08-10 23:32 UTC (permalink / raw)
  To: u-boot

On 07/30/2012 12:37 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  board/nvidia/dts/tegra20-harmony.dts |   10 ++++++++++
>  include/configs/harmony.h            |    9 ++++++++-
>  2 files changed, 18 insertions(+), 1 deletions(-)
> 
> diff --git a/board/nvidia/dts/tegra20-harmony.dts b/board/nvidia/dts/tegra20-harmony.dts
> index c351954..ca5facb 100644
> --- a/board/nvidia/dts/tegra20-harmony.dts
> +++ b/board/nvidia/dts/tegra20-harmony.dts
> @@ -54,4 +54,14 @@
>  	usb at c5004000 {
>  		status = "disabled";
>  	};
> +
> +	nand-controller at 70008000 {
> +		nvidia,wp-gpios = <&gpio 23 0>;		/* PC7 */
> +		nvidia,width = <8>;
> +		nvidia,timing = <26 100 20 80 20 10 12 10 70>;
> +		nand at 0 {
> +			reg = <0>;
> +			compatible = "hynix,hy27uf4g2b", "nand-flash";
> +		};
> +	};
>  };

Where is the binding for a generic "nand-flash" compatible?

-Scott

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

* [U-Boot] [PATCH] tegra: enable NAND on Harmony
  2012-08-10 23:32 ` Scott Wood
@ 2012-08-13 16:24   ` Stephen Warren
  0 siblings, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2012-08-13 16:24 UTC (permalink / raw)
  To: u-boot

On 08/10/2012 05:32 PM, Scott Wood wrote:
> On 07/30/2012 12:37 PM, Stephen Warren wrote:

>> diff --git a/board/nvidia/dts/tegra20-harmony.dts b/board/nvidia/dts/tegra20-harmony.dts

>> +	nand-controller at 70008000 {
...
>> +		nand at 0 {
>> +			reg = <0>;
>> +			compatible = "hynix,hy27uf4g2b", "nand-flash";
> 
> Where is the binding for a generic "nand-flash" compatible?

I don't know if there is one. This patch was cribbed from one by Simon
(CC'd) for Seaboard. Simon do you know the answer?

That said, it seems like it's quite reasonable to create or assume such
a binding, since NAND flash appears self-describing.

That said, looking for precedence in the Linux kernel indicates some
inconsistencies. There exist:

* Many (ARM and PowerPC) bindings that have no node for the NAND chip
itself, but rather the NAND controller has children that describe the
partitioning of the NAND chip.

* Many (I think only PowerPC) bindings that have a node for the NAND
chip, but containing little but #address/#size-cells, and this node then
contains children that describe the partitioning.

* I guess there is at least one PowerPC example just like this patch,
that contains a child node containing a compatible value describing the
flash model number.

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

end of thread, other threads:[~2012-08-13 16:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 17:37 [U-Boot] [PATCH] tegra: enable NAND on Harmony Stephen Warren
2012-07-30 20:34 ` Simon Glass
2012-07-31  5:53 ` Thierry Reding
2012-08-10 23:32 ` Scott Wood
2012-08-13 16:24   ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox