From: Bartlomiej Sieka <tur@semihalf.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] [PATCH 2/2] Migrate 5xxx boards from CONFIG_OF_FLAT_TREE to CONFIG_OF_LIBFDT
Date: Tue, 04 Sep 2007 18:34:44 +0200 [thread overview]
Message-ID: <46DD8924.3030505@semihalf.com> (raw)
In-Reply-To: <20070904134845.20181.48009.stgit@trillian.cg.shawcable.net>
Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Affects boards: icecube (lite5200), jupiter, motionpro, tqm5200
>
> Tested on: lite5200b
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
Hi Grant,
Thanks for including motionpro changes with this patch; see my comments
below.
[...]
> diff --git a/cpu/mpc5xxx/cpu.c b/cpu/mpc5xxx/cpu.c
> index 1eac2bb..e8a928a 100644
> --- a/cpu/mpc5xxx/cpu.c
> +++ b/cpu/mpc5xxx/cpu.c
> @@ -25,14 +25,18 @@
> * CPU specific code for the MPC5xxx CPUs
> */
>
> +#undef DEBUG
> +
Is this needed?
> #include <common.h>
> #include <watchdog.h>
> #include <command.h>
> #include <mpc5xxx.h>
> +#include <asm/io.h>
> #include <asm/processor.h>
>
> -#if defined(CONFIG_OF_FLAT_TREE)
> -#include <ft_build.h>
> +#if defined(CONFIG_OF_LIBFDT)
> +#include <libfdt.h>
> +#include <libfdt_env.h>
Are we using this?
> #endif
>
> DECLARE_GLOBAL_DATA_PTR;
> @@ -109,31 +113,46 @@ unsigned long get_tbclk (void)
> return (tbclk);
> }
>
> +
> /* ------------------------------------------------------------------------- */
>
> -#ifdef CONFIG_OF_FLAT_TREE
> -void
> -ft_cpu_setup(void *blob, bd_t *bd)
> +#ifdef CONFIG_OF_LIBFDT
> +static void do_fixup(void *fdt, const char *node, const char *prop,
> + const void *val, int len, int create)
> +{
> +#if defined(DEBUG)
> + int i;
> + debug("Updating property '%s/%s' = ", node, prop);
> + for (i = 0; i < len; i++)
> + debug(" %.2x", *(u8*)(val+i));
> + debug("\n");
> +#endif
> + int rc = fdt_find_and_setprop(fdt, node, prop, val, len, create);
> + if (rc)
> + printf("Unable to update property %s:%s, err=%s\n",
> + node, prop, fdt_strerror(rc));
> +}
> +
> +static void do_fixup_u32(void *fdt, const char *node, const char *prop,
> + u32 val, int create)
> +{
> + val = cpu_to_be32(val);
Shouldn't this be cpu_to_fdt32()? In such a case we need libfdt_env.h of
course.
> + do_fixup(fdt, node, prop, &val, sizeof(val), create);
> +}
I don't think do_fixup() and do_fixup_u32() should be in
cpu/mpc5xxx/cpu.c - they can and should be used by 83xx (and others)
without modification. Is libfdt really out of the question because of
printf() calls?
Regards,
Bartlomiej
next prev parent reply other threads:[~2007-09-04 16:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-04 13:48 [U-Boot-Users] [PATCH 0/2] Move to LIBFDT for mpc5xxx platforms Grant Likely
2007-09-04 13:48 ` [U-Boot-Users] [PATCH 1/2] libfdt: add convenience function fdt_find_and_setprop() Grant Likely
2007-09-04 13:48 ` [U-Boot-Users] [PATCH 2/2] Migrate 5xxx boards from CONFIG_OF_FLAT_TREE to CONFIG_OF_LIBFDT Grant Likely
2007-09-04 16:34 ` Bartlomiej Sieka [this message]
2007-09-04 16:48 ` Grant Likely
2007-09-07 14:19 ` Grant Likely
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=46DD8924.3030505@semihalf.com \
--to=tur@semihalf.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.