linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bodonoghue@codehermit.ie>
To: cbouatmailru@gmail.com
Cc: Scott Wood <scottwood@freescale.com>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] [POWERPC] 8xx: timebase frequency should not depend on bus-frequency
Date: Fri, 22 Feb 2008 13:01:21 +0000	[thread overview]
Message-ID: <20080222130121.1794a06b@neuromancer.mindspace> (raw)
In-Reply-To: <20080221234136.GA3545@zarina>

On Fri, 22 Feb 2008 02:41:36 +0300
Anton Vorontsov <cbouatmailru@gmail.com> wrote:

> On Thu, Feb 21, 2008 at 03:20:10PM -0600, Scott Wood wrote:
> > Anton Vorontsov wrote:
> > > On Thu, Feb 21, 2008 at 02:06:58PM -0600, Scott Wood wrote:
> > >> Current u-boots don't support device trees at all on 8xx.
> > > 
> > > Yes, vanilla u-boots. I assume many of us use some u-boot hacks to
> > > actually boot with the device tree (no, not cuboots)... ;-)
> > 
> > Fine, but don't expect misbehavior from out-of-tree u-boots to be used 
> > as justification for the kernel ignoring device tree content. :-)
> 
> You got me wrong, maybe I wasn't clear enough: it wasn't justification of
> any kind. It's was just a remark regarding u-boot still not supporting
> fdt for 8xx (20 lines of code we're lazy to cleanup, write annotation
> to the patch and send it ;-).

Hey Anton.

I won't make any comment on what Linux should do with an older version of
u-boot.

However, just to let you know, there are a couple of patches to do a more modern
fdt on 8xx- sent to the u-boot list in the last <= ~ 10 days.

Using those patches - which incorporate the changes suggested by Scott re:
get_tbclk()- the timebase-frequency field is indeed stuffed with u-boot's
get_tbclk(); - see below.

u-boot/cpu/mpc8xx/fdt.c

void ft_cpu_setup(void *blob, bd_t *bd)
{
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                "timebase-frequency", get_tbclk(), 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                "bus-frequency", bd->bi_busfreq, 1);
        do_fixup_by_prop_u32(blob, "device_type", "cpu", 4,
                "clock-frequency", bd->bi_intfreq, 1);
        do_fixup_by_compat_u32(blob, "fsl,cpm-brg", "clock-frequency",
                gd->brg_clk, 1);

        /* Fixup ethernet MAC addresses */
        fdt_fixup_ethernet(blob, bd);

        fdt_fixup_memory(blob, (u64)bd->bi_memstart, (u64)bd->bi_memsize);
}

Adding fdt support to an 8xx board is then as simple as defining

/* pass open firmware flat tree */
#define CONFIG_OF_LIBFDT        1
#define CONFIG_OF_BOARD_SETUP   1


In your u-boot/include/configs/MySuperBoard.h

Best,
Bryan

      reply	other threads:[~2008-02-22 13:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-21 19:45 [PATCH] [POWERPC] 8xx: timebase frequency should not depend on bus-frequency Anton Vorontsov
2008-02-21 19:48 ` Scott Wood
2008-02-21 19:59   ` Anton Vorontsov
2008-02-21 20:06     ` Scott Wood
2008-02-21 21:13       ` Anton Vorontsov
2008-02-21 21:20         ` Scott Wood
2008-02-21 23:41           ` Anton Vorontsov
2008-02-22 13:01             ` Bryan O'Donoghue [this message]

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=20080222130121.1794a06b@neuromancer.mindspace \
    --to=bodonoghue@codehermit.ie \
    --cc=cbouatmailru@gmail.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=scottwood@freescale.com \
    /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;
as well as URLs for NNTP newsgroup(s).