public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
@ 2009-09-04 14:37 Marcel ziswiler
  2009-09-04 14:50 ` Peter Tyser
  2009-09-06  9:05 ` Heiko Schocher
  0 siblings, 2 replies; 5+ messages in thread
From: Marcel ziswiler @ 2009-09-04 14:37 UTC (permalink / raw)
  To: u-boot

Move the memory node fixup of the MPC8260ADS, ids8247 and muas3001 boards into
common mpc8260 CPU code.
Remove Ethernet node fixup from muas3001 board and modify its config for the
common mpc8260 code to use generic Ethernet fixup.

Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
---
 board/freescale/mpc8260ads/mpc8260ads.c |   13 --------
 board/ids8247/ids8247.c                 |   16 ----------
 board/muas3001/muas3001.c               |   51 +-----------------------------
 cpu/mpc8260/cpu.c                       |    1 +
 include/configs/muas3001.h              |    1 +
 5 files changed, 4 insertions(+), 78 deletions(-)

diff --git a/board/freescale/mpc8260ads/mpc8260ads.c b/board/freescale/mpc8260ad
s/mpc8260ads.c
index 49a88bb..be55626 100644
--- a/board/freescale/mpc8260ads/mpc8260ads.c
+++ b/board/freescale/mpc8260ads/mpc8260ads.c
@@ -550,24 +550,11 @@ void pci_init_board(void)
 #endif

 #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
-void ft_blob_update(void *blob, bd_t *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       if (ret < 0) {
-               printf("ft_blob_update(): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror(ret));
-       }
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup(blob, bd);
 #ifdef CONFIG_PCI
        ft_pci_setup(blob, bd);
 #endif
-       ft_blob_update(blob, bd);
 }
 #endif
diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
index 79fe9da..d621833 100644
--- a/board/ids8247/ids8247.c
+++ b/board/ids8247/ids8247.c
@@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
 #endif /* CONFIG_CMD_NAND */

 #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
-/*
- * update "memory" property in the blob
- */
-void ft_blob_update(void *blob, bd_t *bd)
-{
-       int ret;
-
-       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
-
-       if (ret < 0) {
-               printf("ft_blob_update(): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror(ret));
-       }
-}
-
 void ft_board_setup(void *blob, bd_t *bd)
 {
        ft_cpu_setup( blob, bd);
-       ft_blob_update(blob, bd);
 }
 #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c
index 8f83dd9..79c7a4c 100644
--- a/board/muas3001/muas3001.c
+++ b/board/muas3001/muas3001.c
@@ -308,26 +308,9 @@ int board_early_init_r (void)
 void ft_blob_update (void *blob, bd_t *bd)
 {
        int ret, nodeoffset = 0;
-       ulong memory_data[2] = {0};
        ulong flash_data[4] = {0};
-       ulong freq = 0;
-       ulong   speed = 0;
+       ulong speed = 0;

-       memory_data[0] = cpu_to_be32 (bd->bi_memstart);
-       memory_data[1] = cpu_to_be32 (bd->bi_memsize);
-
-       nodeoffset = fdt_path_offset (blob, "/memory");
-       if (nodeoffset >= 0) {
-               ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
-                                       sizeof(memory_data));
-       if (ret < 0)
-               printf ("ft_blob_update): cannot set /memory/reg "
-                       "property err:%s\n", fdt_strerror (ret));
-       } else {
-               /* memory node is required in dts */
-               printf ("ft_blob_update(): cannot find /memory node "
-                       "err:%s\n", fdt_strerror(nodeoffset));
-       }
        /* update Flash addr, size */
        flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
        flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
@@ -339,40 +322,10 @@ void ft_blob_update (void *blob, bd_t *bd)
                printf ("ft_blob_update): cannot set /localbus/ranges "
                        "property err:%s\n", fdt_strerror(ret));
        } else {
-               /* memory node is required in dts */
+               /* localbus node is required in dts */
                printf ("ft_blob_update(): cannot find /localbus node "
                        "err:%s\n", fdt_strerror (nodeoffset));
        }
-       /* MAC Adresse */
-       nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
-       if (nodeoffset >= 0) {
-               uchar ethaddr[6];
-               eth_getenv_enetaddr("ethaddr", ethaddr);
-               ret = fdt_setprop (blob, nodeoffset, "mac-address", ethaddr,
-                                       sizeof (uchar) * 6);
-       if (ret < 0)
-               printf ("ft_blob_update): cannot set /soc/cpm/ethernet/mac-addre
ss "
-                       "property err:%s\n", fdt_strerror (ret));
-       } else {
-               /* memory node is required in dts */
-               printf ("ft_blob_update(): cannot find /soc/cpm/ethernet node "
-                       "err:%s\n", fdt_strerror (nodeoffset));
-       }
-
-       /* brg clock */
-       nodeoffset = fdt_path_offset (blob, "/soc/cpm/brg");
-       if (nodeoffset >= 0) {
-               freq = cpu_to_be32 (bd->bi_brgfreq);
-               ret = fdt_setprop (blob, nodeoffset, "clock-frequency", &freq,
-                                       sizeof (unsigned long));
-       if (ret < 0)
-               printf ("ft_blob_update): cannot set /soc/cpm/brg/clock-frequenc
y "
-                       "property err:%s\n", fdt_strerror (ret));
-       } else {
-               /* memory node is required in dts */
-               printf ("ft_blob_update(): cannot find /soc/cpm/brg/clock-freque
ncy node "
-                       "err:%s\n", fdt_strerror (nodeoffset));
-       }

        /* baudrate */
        nodeoffset = fdt_path_offset (blob, "/soc/cpm/serial");
diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
index 17e6248..aedbf29 100644
--- a/cpu/mpc8260/cpu.c
+++ b/cpu/mpc8260/cpu.c
@@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
                "timebase-frequency", OF_TBCLK, 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                "clock-frequency", bd->bi_intfreq, 1);
+       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
 }
 #endif /* CONFIG_OF_LIBFDT */

diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h
index f031a17..22b22bd 100644
--- a/include/configs/muas3001.h
+++ b/include/configs/muas3001.h
@@ -74,6 +74,7 @@

 #define CONFIG_ETHER_INDEX     1
 #define CONFIG_ETHER_ON_FCC1
+#define CONFIG_HAS_ETH1
 #define FCC_ENET

 /*
--
1.4.4.4

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

* [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
  2009-09-04 14:37 [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code Marcel ziswiler
@ 2009-09-04 14:50 ` Peter Tyser
  2009-09-06  9:05 ` Heiko Schocher
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Tyser @ 2009-09-04 14:50 UTC (permalink / raw)
  To: u-boot

Thanks for cleaning this up Marcel.  I had a few comments though.  Your
patch appears to be line wrapped.  Please use git to send the patch or
configure your email client not to line-wrap.

On Fri, 2009-09-04 at 14:37 +0000, Marcel ziswiler wrote:
> Move the memory node fixup of the MPC8260ADS, ids8247 and muas3001 boards into
> common mpc8260 CPU code.

Shouldn't the mgcoge board also have the same change?

> Remove Ethernet node fixup from muas3001 board and modify its config for the
> common mpc8260 code to use generic Ethernet fixup.

The board-specific ethernet modifications should be in a separate patch
as that change is unrelated to the general FDT memory cleanup cleanup.
Otherwise the change looks good to me.

Best,
Peter

> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
> ---
>  board/freescale/mpc8260ads/mpc8260ads.c |   13 --------
>  board/ids8247/ids8247.c                 |   16 ----------
>  board/muas3001/muas3001.c               |   51 +-----------------------------
>  cpu/mpc8260/cpu.c                       |    1 +
>  include/configs/muas3001.h              |    1 +
>  5 files changed, 4 insertions(+), 78 deletions(-)
> 
> diff --git a/board/freescale/mpc8260ads/mpc8260ads.c b/board/freescale/mpc8260ad
> s/mpc8260ads.c
> index 49a88bb..be55626 100644
> --- a/board/freescale/mpc8260ads/mpc8260ads.c
> +++ b/board/freescale/mpc8260ads/mpc8260ads.c
> @@ -550,24 +550,11 @@ void pci_init_board(void)
>  #endif
> 
>  #if defined(CONFIG_OF_LIBFDT) && defined(CONFIG_OF_BOARD_SETUP)
> -void ft_blob_update(void *blob, bd_t *bd)
> -{
> -       int ret;
> -
> -       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
> -
> -       if (ret < 0) {
> -               printf("ft_blob_update(): cannot set /memory/reg "
> -                       "property err:%s\n", fdt_strerror(ret));
> -       }
> -}
> -
>  void ft_board_setup(void *blob, bd_t *bd)
>  {
>         ft_cpu_setup(blob, bd);
>  #ifdef CONFIG_PCI
>         ft_pci_setup(blob, bd);
>  #endif
> -       ft_blob_update(blob, bd);
>  }
>  #endif
> diff --git a/board/ids8247/ids8247.c b/board/ids8247/ids8247.c
> index 79fe9da..d621833 100644
> --- a/board/ids8247/ids8247.c
> +++ b/board/ids8247/ids8247.c
> @@ -400,24 +400,8 @@ int board_nand_init(struct nand_chip *nand)
>  #endif /* CONFIG_CMD_NAND */
> 
>  #if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT)
> -/*
> - * update "memory" property in the blob
> - */
> -void ft_blob_update(void *blob, bd_t *bd)
> -{
> -       int ret;
> -
> -       ret = fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
> -
> -       if (ret < 0) {
> -               printf("ft_blob_update(): cannot set /memory/reg "
> -                       "property err:%s\n", fdt_strerror(ret));
> -       }
> -}
> -
>  void ft_board_setup(void *blob, bd_t *bd)
>  {
>         ft_cpu_setup( blob, bd);
> -       ft_blob_update(blob, bd);
>  }
>  #endif /* defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_OF_LIBFDT) */
> diff --git a/board/muas3001/muas3001.c b/board/muas3001/muas3001.c
> index 8f83dd9..79c7a4c 100644
> --- a/board/muas3001/muas3001.c
> +++ b/board/muas3001/muas3001.c
> @@ -308,26 +308,9 @@ int board_early_init_r (void)
>  void ft_blob_update (void *blob, bd_t *bd)
>  {
>         int ret, nodeoffset = 0;
> -       ulong memory_data[2] = {0};
>         ulong flash_data[4] = {0};
> -       ulong freq = 0;
> -       ulong   speed = 0;
> +       ulong speed = 0;
> 
> -       memory_data[0] = cpu_to_be32 (bd->bi_memstart);
> -       memory_data[1] = cpu_to_be32 (bd->bi_memsize);
> -
> -       nodeoffset = fdt_path_offset (blob, "/memory");
> -       if (nodeoffset >= 0) {
> -               ret = fdt_setprop (blob, nodeoffset, "reg", memory_data,
> -                                       sizeof(memory_data));
> -       if (ret < 0)
> -               printf ("ft_blob_update): cannot set /memory/reg "
> -                       "property err:%s\n", fdt_strerror (ret));
> -       } else {
> -               /* memory node is required in dts */
> -               printf ("ft_blob_update(): cannot find /memory node "
> -                       "err:%s\n", fdt_strerror(nodeoffset));
> -       }
>         /* update Flash addr, size */
>         flash_data[2] = cpu_to_be32 (CONFIG_SYS_FLASH_BASE);
>         flash_data[3] = cpu_to_be32 (CONFIG_SYS_FLASH_SIZE);
> @@ -339,40 +322,10 @@ void ft_blob_update (void *blob, bd_t *bd)
>                 printf ("ft_blob_update): cannot set /localbus/ranges "
>                         "property err:%s\n", fdt_strerror(ret));
>         } else {
> -               /* memory node is required in dts */
> +               /* localbus node is required in dts */
>                 printf ("ft_blob_update(): cannot find /localbus node "
>                         "err:%s\n", fdt_strerror (nodeoffset));
>         }
> -       /* MAC Adresse */
> -       nodeoffset = fdt_path_offset (blob, "/soc/cpm/ethernet");
> -       if (nodeoffset >= 0) {
> -               uchar ethaddr[6];
> -               eth_getenv_enetaddr("ethaddr", ethaddr);
> -               ret = fdt_setprop (blob, nodeoffset, "mac-address", ethaddr,
> -                                       sizeof (uchar) * 6);
> -       if (ret < 0)
> -               printf ("ft_blob_update): cannot set /soc/cpm/ethernet/mac-addre
> ss "
> -                       "property err:%s\n", fdt_strerror (ret));
> -       } else {
> -               /* memory node is required in dts */
> -               printf ("ft_blob_update(): cannot find /soc/cpm/ethernet node "
> -                       "err:%s\n", fdt_strerror (nodeoffset));
> -       }
> -
> -       /* brg clock */
> -       nodeoffset = fdt_path_offset (blob, "/soc/cpm/brg");
> -       if (nodeoffset >= 0) {
> -               freq = cpu_to_be32 (bd->bi_brgfreq);
> -               ret = fdt_setprop (blob, nodeoffset, "clock-frequency", &freq,
> -                                       sizeof (unsigned long));
> -       if (ret < 0)
> -               printf ("ft_blob_update): cannot set /soc/cpm/brg/clock-frequenc
> y "
> -                       "property err:%s\n", fdt_strerror (ret));
> -       } else {
> -               /* memory node is required in dts */
> -               printf ("ft_blob_update(): cannot find /soc/cpm/brg/clock-freque
> ncy node "
> -                       "err:%s\n", fdt_strerror (nodeoffset));
> -       }
> 
>         /* baudrate */
>         nodeoffset = fdt_path_offset (blob, "/soc/cpm/serial");
> diff --git a/cpu/mpc8260/cpu.c b/cpu/mpc8260/cpu.c
> index 17e6248..aedbf29 100644
> --- a/cpu/mpc8260/cpu.c
> +++ b/cpu/mpc8260/cpu.c
> @@ -318,6 +318,7 @@ void ft_cpu_setup (void *blob, bd_t *bd)
>                 "timebase-frequency", OF_TBCLK, 1);
>         do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
>                 "clock-frequency", bd->bi_intfreq, 1);
> +       fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
>  }
>  #endif /* CONFIG_OF_LIBFDT */
> 
> diff --git a/include/configs/muas3001.h b/include/configs/muas3001.h
> index f031a17..22b22bd 100644
> --- a/include/configs/muas3001.h
> +++ b/include/configs/muas3001.h
> @@ -74,6 +74,7 @@
> 
>  #define CONFIG_ETHER_INDEX     1
>  #define CONFIG_ETHER_ON_FCC1
> +#define CONFIG_HAS_ETH1
>  #define FCC_ENET
> 
>  /*
> --
> 1.4.4.4
> 
> 
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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

* [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
  2009-09-04 14:37 [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code Marcel ziswiler
  2009-09-04 14:50 ` Peter Tyser
@ 2009-09-06  9:05 ` Heiko Schocher
  2009-09-07 14:18   ` Marcel Ziswiler
  1 sibling, 1 reply; 5+ messages in thread
From: Heiko Schocher @ 2009-09-06  9:05 UTC (permalink / raw)
  To: u-boot

Hello Marcel,

Marcel ziswiler wrote:
> Move the memory node fixup of the MPC8260ADS, ids8247 and muas3001 boards into
> common mpc8260 CPU code.
> Remove Ethernet node fixup from muas3001 board and modify its config for the
> common mpc8260 code to use generic Ethernet fixup.

Thanks for cleaning up, but ...

> Signed-off-by: Marcel Ziswiler <marcel.ziswiler@noser.com>
> ---
>  board/freescale/mpc8260ads/mpc8260ads.c |   13 --------
>  board/ids8247/ids8247.c                 |   16 ----------
>  board/muas3001/muas3001.c               |   51 +-----------------------------
>  cpu/mpc8260/cpu.c                       |    1 +
>  include/configs/muas3001.h              |    1 +
>  5 files changed, 4 insertions(+), 78 deletions(-)

... I couldn;t apply your patch, because your patch is line wrapped.
Can you fix your mailer?

Also, there is one more 826x based board (mgcoge) with should be fixed
too, can you add this board to your patch?

TIA,

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
  2009-09-06  9:05 ` Heiko Schocher
@ 2009-09-07 14:18   ` Marcel Ziswiler
  2009-09-07 15:16     ` Heiko Schocher
  0 siblings, 1 reply; 5+ messages in thread
From: Marcel Ziswiler @ 2009-09-07 14:18 UTC (permalink / raw)
  To: u-boot

Hi Heiko

Heiko Schocher <hs <at> denx.de> writes:
> ... I couldn;t apply your patch, because your patch is line wrapped.
> Can you fix your mailer?

Sorry, obviously gmane can't be used for patch submission. Unfortunately I am
not in a very Linux friendly environment right now, meaning M$ proxies and such.
Trying to find a cleaner submission path will take me some time. Stay tuned.

Cheers

Marcel

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

* [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
  2009-09-07 14:18   ` Marcel Ziswiler
@ 2009-09-07 15:16     ` Heiko Schocher
  0 siblings, 0 replies; 5+ messages in thread
From: Heiko Schocher @ 2009-09-07 15:16 UTC (permalink / raw)
  To: u-boot

Hello Marc,

Marcel Ziswiler wrote:
> Heiko Schocher <hs <at> denx.de> writes:
>> ... I couldn;t apply your patch, because your patch is line wrapped.
>> Can you fix your mailer?
> 
> Sorry, obviously gmane can't be used for patch submission. Unfortunately I am
> not in a very Linux friendly environment right now, meaning M$ proxies and such.
> Trying to find a cleaner submission path will take me some time. Stay tuned.

OK, and please hold me on cc:

thanks!

bye
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

end of thread, other threads:[~2009-09-07 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-04 14:37 [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code Marcel ziswiler
2009-09-04 14:50 ` Peter Tyser
2009-09-06  9:05 ` Heiko Schocher
2009-09-07 14:18   ` Marcel Ziswiler
2009-09-07 15:16     ` Heiko Schocher

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