mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom.net>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Olof Johansson <olof@lixom.net>
Subject: [PATCH] ARM: ux500: check platform in ux500_l2x0_init
Date: Tue, 25 Jun 2013 18:30:31 -0700	[thread overview]
Message-ID: <1372210231-22900-1-git-send-email-olof@lixom.net> (raw)

Add compatible checks for ux500. This should probably be moved to generic
DT-based probing whenever DT is populated instead, but until then at
least don't panic all non-ux500 multiplatform machines.

Signed-off-by: Olof Johansson <olof@lixom.net>
---

Linus, I'll apply this directly if you ack it, let me know.


-Olof

 arch/arm/mach-ux500/cache-l2x0.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/mach-ux500/cache-l2x0.c b/arch/arm/mach-ux500/cache-l2x0.c
index f58615b..3facc1e 100644
--- a/arch/arm/mach-ux500/cache-l2x0.c
+++ b/arch/arm/mach-ux500/cache-l2x0.c
@@ -39,6 +39,15 @@ static int __init ux500_l2x0_init(void)
 {
 	u32 aux_val = 0x3e000000;
 
+	/* Ick. I wish there was a single compatible value to compare for,
+	 * but there isn't.
+	 */
+	if (!of_machine_is_compatible("st-ericsson,u8500") &&
+	    !of_machine_is_compatible("st-ericsson,u8540") &&
+	    !of_machine_is_compatible("st-ericsson,u9500") &&
+	    !of_machine_is_compatible("st-ericsson,u8540"))
+		return -ENODEV;
+
 	if (cpu_is_u8500_family() || cpu_is_ux540_family())
 		l2x0_base = __io_address(U8500_L2CC_BASE);
 	else
-- 
1.8.1.192.gc4361b8


             reply	other threads:[~2013-06-26  1:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  1:30 Olof Johansson [this message]
2013-06-26 19:46 ` Linus Walleij
2013-06-26 22:49   ` Olof Johansson

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=1372210231-22900-1-git-send-email-olof@lixom.net \
    --to=olof@lixom.net \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®