All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Packham <judge.packham@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] powerpc: Retain compatible property for L2 cache
Date: Fri, 2 Dec 2016 20:35:07 +1300	[thread overview]
Message-ID: <CAFOYHZBP8ASS8xCZDERF_X=L_aYLadABjNRE2Cd4apqO22+Xbg@mail.gmail.com> (raw)
In-Reply-To: <CAFOYHZD5JrrC=d9-kZd6tLiZHynJFjS3AtbkaPS9b9Pfy-s5hQ@mail.gmail.com>

On 2/12/2016 6:34 AM, "york sun" <york.sun@nxp.com> wrote:
>
> On 11/30/2016 11:47 PM, Chris Packham wrote:
> > On Thu, Dec 1, 2016 at 6:18 AM, york sun <york.sun@nxp.com> wrote:
> >> On 11/28/2016 07:10 PM, Chris Packham wrote:
> >>> Instead of setting the compatible property to "cache", append the
> >>> desired value retaining what may already be set in the current
property.
> >>>
> >>> Signed-off-by: Chris Packham <judge.packham@gmail.com>
> >>> ---
> >>
> >> <snip>
> >>
> >>>
> >>>  arch/powerpc/cpu/mpc85xx/fdt.c | 3 ++-
> >>>  1 file changed, 2 insertions(+), 1 deletion(-)
> >>>
> >>> diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c
b/arch/powerpc/cpu/mpc85xx/fdt.c
> >>> index 047c972ac78e..f31df41836d5 100644
> >>> --- a/arch/powerpc/cpu/mpc85xx/fdt.c
> >>> +++ b/arch/powerpc/cpu/mpc85xx/fdt.c
> >>> @@ -337,7 +337,8 @@ static inline void ft_fixup_l2cache(void *blob)
> >>>                       fdt_setprop_cell(blob, l2_off, "cache-size",
size);
> >>>                       fdt_setprop_cell(blob, l2_off, "cache-sets",
num_sets);
> >>>                       fdt_setprop_cell(blob, l2_off, "cache-level",
2);
> >>> -                     fdt_setprop(blob, l2_off, "compatible",
"cache", 6);
> >>> +                     if (fdt_node_check_compatible(blob, l2_off,
"cache") == 1)
> >>> +                             fdt_appendprop_string(blob, l2_off,
"compatible", "cache");
> >>>               }
> >>>
> >>>               if (l3_off < 0) {
> >>>
> >>
> >> You drop fdt_setprop, check the compatible "cache" and append it with
> >> "cache" again? I thought you wanted
> >>
> >> compatible = "fsl,t2080-l2-cache-controller", "cache";
> >
> > I already have "fsl,t2080-l2-cache-controller" in my dts. Really I just
want
> >
> >    fdt_appendprop_string(blob, l2_off, "compatible", "cache");
>
> I see.
>
> >
> > But the check is necessary because we run through this block multiple
> > times (once per CPU). My initial version was
> >
> >   struct cpu_type *cpu = identify_cpu(SVR_SOC_VER(get_svr()));
> >   int len;
> >   char buf[40];
> >
> >   len = sprintf(buf,
> > "fsl,%c%s-l2-cache-controller",tolower(cpu->name[0]), cpu->name + 1) +
> > 1;
> >   len += sprintf(buf + len, "cache") + 1;
> >
> >   fdt_setprop(blob, l2_off, "compatible", buf, len);
> >
> > But that's more code.
> >
>
> Ideally we don't have to fix up dts. Since if we have to do it, I like
> the long version better. If the dts doesn't have correct compatible, the
> kernel won't take it, right?
>

Ok. I'll post a v2 based on the long version. As it's a repeat of code in
another block I'll see if i can extract it to a helper function.

  parent reply	other threads:[~2016-12-02  7:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  9:43 [U-Boot] T2080 l2-cache-controller compatible string overwritten by ft_fixup_l2cache Chris Packham
2016-11-23 17:41 ` york sun
2016-11-28 23:52   ` [U-Boot] [PATCH] arch: powerpc: Retain compatible property for L2 cache Chris Packham
2016-11-29  3:10   ` [U-Boot] [PATCH] " Chris Packham
2016-11-30 17:18     ` york sun
2016-12-01  7:47       ` Chris Packham
2016-12-01 17:34         ` york sun
     [not found]           ` <CAFOYHZA7ycTE3rTQJiAgBBVBUFW9_QemAcCra33VnfGiWn0Arg@mail.gmail.com>
     [not found]             ` <CAFOYHZD5JrrC=d9-kZd6tLiZHynJFjS3AtbkaPS9b9Pfy-s5hQ@mail.gmail.com>
2016-12-02  7:35               ` Chris Packham [this message]
2016-12-02  8:22                 ` [U-Boot] [PATCH v2] " Chris Packham
2016-12-20 17:16                   ` york sun

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='CAFOYHZBP8ASS8xCZDERF_X=L_aYLadABjNRE2Cd4apqO22+Xbg@mail.gmail.com' \
    --to=judge.packham@gmail.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.