linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Sven Luther <sven.luther@wanadoo.fr>
Cc: linuxppc-dev list <linuxppc-dev@lists.linuxppc.org>
Subject: Re: OF properties access ?
Date: Mon, 19 Jan 2004 20:04:21 +1100	[thread overview]
Message-ID: <1074503060.812.44.camel@gaston> (raw)
In-Reply-To: <20040118145158.GA7011@iliana>


>
> void pegasos_set_l2cr(void)
> {
>         struct device_node *root = find_path_device("/");
>         char *machine;
>         struct device_node *np;
>         int l2cr_value;

What about "unsigned int" above and not doing int/unsigned int
conversions and such ? (Dunno if it explains your problem at
this point but it's worth fixing anyway)

>         /* On Pegasos, enable the l2 cache if needed, as the OF forgets * it */
>         if (root == NULL) return;
>         machine = get_property(root, "model", NULL);
>         if (machine == NULL) return;
>         if (strncmp(machine, "Pegasos", 7) == 0) {
>                 /* Enable L2 cache if needed */
>                 np = find_devices ("cpus");
>                 if (np == NULL)
>                         np = find_type_devices("cpu");
>                 if (np != NULL) {
>                         unsigned int *l2cr = (unsigned int *)
>                                 get_property (np, "l2cr", NULL);
>                         if (l2cr == NULL) return;
>                         l2cr_value = *l2cr;
>                         if (!(l2cr_value & 0x80000000)) {
>                                 _set_L2CR(0);
>                                 _set_L2CR(l2cr_value | 0x80000000);
>                         }
>                 }
>         }
> }
>
> Does not die, but also does not seem to enable the l2cr thingy, but
> then, i don't know how fiable the info from /proc/sys/kernel/l2cr is :
>
> 0x00000000:  L2 disabled, no parity, no instn only, no data only,
> default replacement

The value is reliable, the text explanation of the bits isn't on this
CPU.

Ben.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  parent reply	other threads:[~2004-01-19  9:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-13 11:46 OF properties access ? Sven Luther
2004-01-15  1:49 ` Benjamin Herrenschmidt
2004-01-15  7:44   ` Sven Luther
2004-01-17  3:48     ` Benjamin Herrenschmidt
2004-01-18 12:07       ` Sven Luther
2004-01-18 23:21         ` Benjamin Herrenschmidt
2004-01-18 14:32           ` Sven Luther
2004-01-18 14:51             ` Sven Luther
2004-01-18 15:05               ` Sven Luther
2004-01-19  9:05                 ` Benjamin Herrenschmidt
2004-01-18 22:22                   ` Sven Luther
2004-01-19  9:04               ` Benjamin Herrenschmidt [this message]
2004-01-19  1:35             ` Dan Malek
2004-01-19  9:01             ` Benjamin Herrenschmidt
2004-01-19 10:17               ` Sven Luther
2004-01-19 11:42                 ` Benjamin Herrenschmidt
2004-01-19 12:06                   ` Sven Luther
2004-01-19 21:36                     ` Benjamin Herrenschmidt

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=1074503060.812.44.camel@gaston \
    --to=benh@kernel.crashing.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=sven.luther@wanadoo.fr \
    /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).