public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH][v1] mpc8260: move FDT memory node fixup into common CPU code.
Date: Fri, 04 Sep 2009 09:50:56 -0500	[thread overview]
Message-ID: <1252075856.6005.55.camel@localhost.localdomain> (raw)
In-Reply-To: <loom.20090904T163357-846@post.gmane.org>

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

  reply	other threads:[~2009-09-04 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2009-09-06  9:05 ` Heiko Schocher
2009-09-07 14:18   ` Marcel Ziswiler
2009-09-07 15:16     ` Heiko Schocher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1252075856.6005.55.camel@localhost.localdomain \
    --to=ptyser@xes-inc.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox