linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: PL310 errata workarounds
Date: Mon, 17 Mar 2014 16:32:04 +0000	[thread overview]
Message-ID: <20140317163204.GC21483@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <20140316152953.GX21483@n2100.arm.linux.org.uk>

On Sun, Mar 16, 2014 at 03:29:53PM +0000, Russell King - ARM Linux wrote:
> Okay, I've been going through the various initialisations of the L2x0
> cache code, and there's some really fun stuff going on here:

Here's OMAP4 - thankfully I have an OMAP4430 SDP to be able to investigate
what goes on here.  We have this code:

        /*
         * 16-way associativity, parity disabled
         * Way size - 32KB (es1.0)
         * Way size - 64KB (es2.0 +)
         */
        aux_ctrl = L310_AUX_CTRL_ASSOCIATIVITY_16 |
                   L310_AUX_CTRL_CACHE_REPLACE_RR |
                   L310_AUX_CTRL_NS_LOCKDOWN |
                   L310_AUX_CTRL_NS_INT_CTRL;

        if (omap_rev() == OMAP4430_REV_ES1_0) {
                aux_ctrl |= L310_AUX_CTRL_WAY_SIZE(2);
        } else {
                aux_ctrl |= L310_AUX_CTRL_WAY_SIZE(3) |
                            L310_AUX_CTRL_SHARED_OVERRIDE |
                            L310_AUX_CTRL_DATA_PREFETCH |
                            L310_AUX_CTRL_INSTR_PREFETCH |
                            L310_AUX_CTRL_EARLY_BRESP;
        }
        if (omap_rev() != OMAP4430_REV_ES1_0)
                omap_smc1(0x109, aux_ctrl);

        /* Enable PL310 L2 Cache controller */
        omap_smc1(0x102, 0x1);

        if (of_have_populated_dt())
                l2x0_of_init(aux_ctrl, L2X0_AUX_CTRL_MASK);
        else
                l2x0_init(l2cache_base, aux_ctrl, L2X0_AUX_CTRL_MASK);

Now, with my changes to add a "write_sec" hook into the code (to allow
secure-only registers to be written) we appear to be able to kill all
the above code on OMAP4430 ES2.2 - the following messages are from my
replacement L2x0 code with write_sec implemented for OMAP, and the
explicit SMC ops above commented out.

L2C: platform provided aux values match the hardware, so have no effect.  Please remove them.
L2C: platform provided aux values permit register corruption.
L2C-310 errata 727915 769419 enabled
L2C-310 cache controller enabled, 16 ways, 1024 kB
L2C-310: CACHE_ID 0x410000c4, AUX_CTRL 0x7e470000

The first message is produced by:
        old_aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
        if (old_aux != ((old_aux & aux_mask) | aux_val)) {
		pr_err("L2C: platform modifies aux control register: 0x%08x -> 0x%08x\n",
                       old_aux, (old_aux & aux_mask) | aux_val);
        } else if (aux_mask != ~0U && aux_val != 0) {
                pr_alert("L2C: platform provided aux values match the hardware, so have no effect.  Please remove them.\n");
        }

Later on I have:
        if (aux_val & aux_mask)
                pr_alert("L2C: platform provided aux values permit register corruption.\n");
...
        aux = readl_relaxed(l2x0_base + L2X0_AUX_CTRL);
        if (aux != ((aux & aux_mask) | aux_val))
                pr_err("L2C: DT/platform modifies aux control register: 0x%08x -> 0x%08x\n",
                       aux, (aux & aux_mask) | aux_val);

The two pr_alert()s are to provide sufficient motivation to people to
remove aux value configuration which actually matches the hardware.

Annoyingly I can't check the actual configuration registers because it
seems that someone along the way has broken ethernet (KSZ8851) in
recent kernels on this board... so I can't mount the fs with devmem2 on
to read the L2's registers.

I would try and quote some of the kernel messages for that, but: (a)
busybox grep doesn't understand the -<number> argument to give lines of
context, and (b) busybox less doesn't allow searching the kernel log...
So all I can say is that these kernel messages exist:

ks8851 spi1.0: message enable is 0
ks8851 spi1.0 eth0: revision 0, MAC 08:00:28:01:4d:c6, IRQ 194, has EEPROM

and dhcp fails - the ethernet interface doesn't even establish a link with
the connected switch... it just gets better and better.  Why is the modern
ARM kernel a perpetual struggle to make everything work.

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

  parent reply	other threads:[~2014-03-17 16:32 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 14:48 PL310 errata workarounds Russell King - ARM Linux
2014-03-14 15:01 ` Russell King - ARM Linux
2014-03-14 16:02   ` Rob Herring
2014-03-14 17:57     ` Russell King - ARM Linux
2014-03-14 19:14       ` Rob Herring
2014-03-14 20:32         ` Russell King - ARM Linux
2014-03-19 21:22         ` Marek Vasut
2014-03-19 21:35           ` Rob Herring
2014-03-19 21:46             ` Russell King - ARM Linux
2014-03-19 21:54               ` Marek Vasut
2014-03-16 11:52     ` Russell King - ARM Linux
2014-03-17 15:04       ` Rob Herring
2014-03-17 15:37         ` Russell King - ARM Linux
2014-03-17 17:29           ` Catalin Marinas
2014-03-17 19:44             ` Russell King - ARM Linux
2014-03-17 21:09               ` Nicolas Pitre
2014-03-17 21:14                 ` Russell King - ARM Linux
2014-03-17 21:54                   ` Nicolas Pitre
2014-03-16 15:29 ` Russell King - ARM Linux
2014-03-17 14:00   ` Rob Herring
2014-03-17 14:40     ` Russell King - ARM Linux
2014-03-18 11:22     ` *READ THIS IF YOUR SOC HAS A L2 CACHE* PL310 auxctrl settings Russell King - ARM Linux
2014-03-28 12:51       ` Maxime Coquelin
2014-03-28 13:02         ` Russell King - ARM Linux
2014-03-28 13:32           ` Maxime Coquelin
2014-03-18 17:26     ` PL310 errata workarounds Russell King - ARM Linux
2014-03-19 21:52       ` Marek Vasut
2014-03-19 22:51         ` Russell King - ARM Linux
2014-03-19 23:05           ` FEC ethernet issues [Was: PL310 errata workarounds] Marek Vasut
2014-03-20  4:01             ` Marek Vasut
2014-03-20 22:27               ` Fabio Estevam
2014-03-20 23:06                 ` Russell King - ARM Linux
2014-03-21  0:24                   ` Troy Kisky
2014-03-21  1:18                     ` Russell King - ARM Linux
2014-03-21  1:36                       ` Fabio Estevam
2014-03-21  1:43                         ` Fabio Estevam
2014-03-21 16:37                           ` Bernd Faust
     [not found]                           ` <CANBf9eNZB+BVBDkgWNxxGs-ndQ-mYCc6+bfVdS-8T-QLpSZ3GA@mail.gmail.com>
2014-03-21 17:32                             ` Russell King - ARM Linux
2014-03-23 11:38                               ` Bernd Faust
2014-03-23 13:44                                 ` Russell King - ARM Linux
2014-03-24 17:57                               ` robert.daniels at vantagecontrols.com
2014-03-24 20:21                                 ` Marek Vasut
2014-03-24 22:37                                   ` robert.daniels at vantagecontrols.com
2014-03-24 23:44                                     ` Russell King - ARM Linux
2014-03-25  1:02                                       ` Marek Vasut
2014-03-25 23:10                                         ` Russell King - ARM Linux
2014-03-26  0:11                                       ` Russell King - ARM Linux
2014-04-01  9:26                                         ` Russell King - ARM Linux
2014-04-01 14:00                                           ` Eric Nelson
2014-04-01 17:29                                             ` Russell King - ARM Linux
2014-04-01 18:11                                               ` Eric Nelson
2014-04-02  2:26                                               ` fugang.duan at freescale.com
2014-04-01 19:38                                           ` robert.daniels at vantagecontrols.com
2014-04-01 22:51                                             ` Russell King - ARM Linux
2014-04-02  0:37                                               ` robert.daniels at vantagecontrols.com
2014-04-02  3:19                                               ` fugang.duan at freescale.com
2014-04-02  8:59                                                 ` Russell King - ARM Linux
2014-04-02  9:40                                                   ` fugang.duan at freescale.com
2014-04-02 10:46                                                     ` Russell King - ARM Linux
2014-04-02 11:33                                                       ` fugang.duan at freescale.com
2014-04-02 16:51                                                         ` Russell King - ARM Linux
2014-04-03  2:41                                                           ` fugang.duan at freescale.com
2014-04-03  8:56                                                             ` Russell King - ARM Linux
2014-04-03  9:55                                                               ` fugang.duan at freescale.com
2014-04-03 10:32                                                                 ` Russell King - ARM Linux
2014-04-03 13:36                                                                   ` Shawn Guo
2014-04-03 13:45                                                                     ` Russell King - ARM Linux
2014-04-03 14:00                                                                       ` Shawn Guo
2014-04-04 20:21                                               ` robert.daniels at vantagecontrols.com
2014-04-29  9:26                                                 ` Jaccon Bastiaansen
     [not found]                                                 ` <CAGzjT4d8H6YE6P6A1E4aHiPAenJFvZH01LHXaNzVwhF2MRBvWQ@mail.gmail.com>
2014-05-02 11:41                                                   ` Russell King - ARM Linux
2014-05-08  9:23                                                     ` Jaccon Bastiaansen
2014-03-21 15:50           ` PL310 errata workarounds Frank Li
2014-03-21 17:12             ` Russell King - ARM Linux
2014-03-17 16:32   ` Russell King - ARM Linux [this message]
2014-03-17 16:51     ` Russell King - ARM Linux

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=20140317163204.GC21483@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).