diff mbox

[U-Boot,2/2,v3] powerpc/p1023rds: Enable nand node and disable nor node

Message ID 1313562267-24649-1-git-send-email-Chunhe.Lan@freescale.com
State Superseded
Headers show

Commit Message

Chunhe Lan Aug. 17, 2011, 6:24 a.m. UTC
In the p1023rds, accessing exclusively nor flash or nand flash
device by BR0/OR0. When booting from nor flash, nand node is
disabled and nor node is enabled in the default dtb. So, when
booting from nand flash, nand node should be enabled and nor
node should be disabled.

Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
---
 board/freescale/p1023rds/p1023rds.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Comments

Kumar Gala Aug. 28, 2011, 6:14 p.m. UTC | #1
On Aug 17, 2011, at 1:24 AM, Chunhe Lan wrote:

> In the p1023rds, accessing exclusively nor flash or nand flash
> device by BR0/OR0. When booting from nor flash, nand node is
> disabled and nor node is enabled in the default dtb. So, when
> booting from nand flash, nand node should be enabled and nor
> node should be disabled.

Fix where you break the line, should like more like (use upto 75 chars per line):

    In the p1023rds, accessing exclusively nor flash or nand flash device by
    BR0/OR0. When booting from nor flash, nand node is disabled and nor node
    is enabled in the default dtb. So, when booting from nand flash, nand
    node should be enabled and nor node should be disabled.

> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>

Can you provide example of what the device tree looks like for the two cases.

> ---
> board/freescale/p1023rds/p1023rds.c |   10 ++++++++++
> 1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/board/freescale/p1023rds/p1023rds.c b/board/freescale/p1023rds/p1023rds.c
> index 8cfd199..2fec3ee 100644
> --- a/board/freescale/p1023rds/p1023rds.c
> +++ b/board/freescale/p1023rds/p1023rds.c
> @@ -146,6 +146,14 @@ int board_eth_init(bd_t *bis)
> 	return pci_eth_init(bis);
> }
> 
> +void fdt_fixup_flash(void *fdt)
> +{
> +#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
> +}
> +

No need for a separate function, just put the two line in ft_board_setup()

> #if defined(CONFIG_OF_BOARD_SETUP)
> void ft_board_setup(void *blob, bd_t *bd)
> {
> @@ -158,5 +166,7 @@ void ft_board_setup(void *blob, bd_t *bd)
> 	size = getenv_bootm_size();
> 
> 	fdt_fixup_memory(blob, (u64)base, (u64)size);
> +
> +	fdt_fixup_flash(blob);
> }
> #endif
> -- 
> 1.5.6.5
Lan Chunhe-B25806 Aug. 29, 2011, 2:53 a.m. UTC | #2
On Mon, 29 Aug 2011 02:14:20 +0800, Kumar Gala <kumar.gala@freescale.com>  
wrote:

>
> On Aug 17, 2011, at 1:24 AM, Chunhe Lan wrote:
>
>> In the p1023rds, accessing exclusively nor flash or nand flash
>> device by BR0/OR0. When booting from nor flash, nand node is
>> disabled and nor node is enabled in the default dtb. So, when
>> booting from nand flash, nand node should be enabled and nor
>> node should be disabled.
>
> Fix where you break the line, should like more like (use upto 75 chars  
> per line):

      OK.

>     In the p1023rds, accessing exclusively nor flash or nand flash  
> device by
>     BR0/OR0. When booting from nor flash, nand node is disabled and nor  
> node
>     is enabled in the default dtb. So, when booting from nand flash, nand
>     node should be enabled and nor node should be disabled.
>
>> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
>
> Can you provide example of what the device tree looks like for the two  
> cases.

    OK.

>> ---
>> board/freescale/p1023rds/p1023rds.c |   10 ++++++++++
>> 1 files changed, 10 insertions(+), 0 deletions(-)
>>
>> diff --git a/board/freescale/p1023rds/p1023rds.c  
>> b/board/freescale/p1023rds/p1023rds.c
>> index 8cfd199..2fec3ee 100644
>> --- a/board/freescale/p1023rds/p1023rds.c
>> +++ b/board/freescale/p1023rds/p1023rds.c
>> @@ -146,6 +146,14 @@ int board_eth_init(bd_t *bis)
>> 	return pci_eth_init(bis);
>> }
>>
>> +void fdt_fixup_flash(void *fdt)
>> +{
>> +#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
>> +}
>> +
>
> No need for a separate function, just put the two line in  
> ft_board_setup()

     OK.

    Thanks.

    -Jack Lan

>> #if defined(CONFIG_OF_BOARD_SETUP)
>> void ft_board_setup(void *blob, bd_t *bd)
>> {
>> @@ -158,5 +166,7 @@ void ft_board_setup(void *blob, bd_t *bd)
>> 	size = getenv_bootm_size();
>>
>> 	fdt_fixup_memory(blob, (u64)base, (u64)size);
>> +
>> +	fdt_fixup_flash(blob);
>> }
>> #endif
>> --
>> 1.5.6.5
>
diff mbox

Patch

diff --git a/board/freescale/p1023rds/p1023rds.c b/board/freescale/p1023rds/p1023rds.c
index 8cfd199..2fec3ee 100644
--- a/board/freescale/p1023rds/p1023rds.c
+++ b/board/freescale/p1023rds/p1023rds.c
@@ -146,6 +146,14 @@  int board_eth_init(bd_t *bis)
 	return pci_eth_init(bis);
 }
 
+void fdt_fixup_flash(void *fdt)
+{
+#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
+}
+
 #if defined(CONFIG_OF_BOARD_SETUP)
 void ft_board_setup(void *blob, bd_t *bd)
 {
@@ -158,5 +166,7 @@  void ft_board_setup(void *blob, bd_t *bd)
 	size = getenv_bootm_size();
 
 	fdt_fixup_memory(blob, (u64)base, (u64)size);
+
+	fdt_fixup_flash(blob);
 }
 #endif