Skip to contentSkip to conversation

powerpc/p1023rds: Disable nor flash node and enable nand flash node

PATCH Superseded Chunhe Lan 3 participants 3 messages Aug 30, 2011

v5 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Chunhe Lan

author
#0 lore raw

PATCH v5 2/2 powerpc/p1023rds: Disable nor flash node and enable nand flash node

In the p1023rds, when system boots from nor flash, kernel only accesses nor flash and can not access nand flash with BR0/OR0; when system boots from nand flash, kernel only accesses nand flash and can not access nor flash with BR0/OR0.

Default device tree nor and nand node should have the following structure:

	Example:

		nor_flash: nor at 0,0 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "cfi-flash";
			reg = <0x0 0x0 0x02000000>;
			bank-width = <2>;
			device-width = <1>;
			status = "okay";

			partition at 0 {
				label = "ramdisk";
				reg = <0x00000000 0x01c00000>;
			};
		}

		nand_flash: nand at 1,0 {
			#address-cells = <1>;
			#size-cells = <1>;
			compatible = "fsl,p1023-fcm-nand",
				     "fsl,elbc-fcm-nand";
			reg = <0x2 0x0 0x00040000>;
			status = "disabled";

			u-boot-nand at 0 {
				/* This location must not be altered  */
				/* 1MB for u-boot Bootloader Image */
				reg = <0x0 0x00100000>;
				read-only;
			};
		}

When booting from nor flash, the status of nor node is null that means it is enabled and the status of nand node is disabled in the default dts file, so do not do anything.

But, when booting from nand flash, need to do some operations:

o the status of nor node should be disabled.
o the status of nand node should be enabled.

---
 board/freescale/p1023rds/p1023rds.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
board/freescale/p1023rds/p1023rds.c +5 -0
index 8cfd199..c99ccee 100644
@@ -158,5 +158,10 @@ void ft_board_setup(void *blob, bd_t *bd)
 	size = getenv_bootm_size();
 
 	fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+#ifdef CONFIG_NAND_U_BOOT
+	do_fixup_by_path_string(fdt, "nor_flash", "status", "disabled");
+	do_fixup_by_path_string(fdt, "nand_flash", "status", "okay");
+#endif
 }
 #endif
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH v5 2/2 powerpc/p1023rds: Disable nor flash node and enable nand flash node

Dear Chunhe Lan,

In message <[email protected]> you wrote:
...

Quoted 1 line
			status = "okay";

...

Quoted 1 line

When booting from nor flash, the status of nor node is null that means it

Description does not match code.

Quoted 1 line

is enabled and the status of nand node is disabled in the default dts file,

...

Quoted 4 lines

But, when booting from nand flash, need to do some operations:

o the status of nor node should be disabled.
o the status of nand node should be enabled.

Make this:

o Disable the NOR node by setting status = "disabled";
o Enable the NAND node by setting status = "okay";

Quoted 4 lines
---
 board/freescale/p1023rds/p1023rds.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

This is patch v5, but there is no change log. This is MANDATORY!

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Making files is easy under  the  UNIX  operating  system.  Therefore,
users  tend  to  create  numerous  files  using large amounts of file
space. It has been said that the only standard thing about  all  UNIX
systems  is  the  message-of-the-day  telling users to clean up their
files.                            -- System V.2 administrator's guide
#2 lore raw

PATCH v5 2/2 powerpc/p1023rds: Disable nor flash node and enable nand flash node

Quoted 11 lines · Wolfgang Denk

Dear Chunhe Lan,

In message <[email protected]> you wrote:
...

Quoted 1 line
			status = "okay";

...

Quoted 2 lines

When booting from nor flash, the status of nor node is null that means it

Description does not match code.

I rewrite it.

Quoted 5 lines
Quoted 2 lines

is enabled and the status of nand node is disabled in the default dts file,

...

Quoted 2 lines

But, when booting from nand flash, need to do some operations:

Quoted 7 lines
Quoted 2 lines

o the status of nor node should be disabled.
o the status of nand node should be enabled.

Make this:

o Disable the NOR node by setting status = "disabled";
o Enable the NAND node by setting status = "okay";

I rewrite it.

Quoted 6 lines
Quoted 4 lines
---
 board/freescale/p1023rds/p1023rds.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

This is patch v5, but there is no change log. This is MANDATORY!

    OK.
    Thanks.

    -Jack Lan
Quoted 3 lines

Best regards,

Wolfgang Denk