All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: matthew.leach@codethink.co.uk, k.kozlowski@samsung.com,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@lists.codethink.co.uk,
	Ben Dooks <ben.dooks@codethink.co.uk>
Subject: [[PATCH v2] 02/11] ARM: Samsung: fixup endian issues in cpu detection
Date: Tue, 21 Jun 2016 11:20:23 +0100	[thread overview]
Message-ID: <1466504432-24187-3-git-send-email-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <1466504432-24187-1-git-send-email-ben.dooks@codethink.co.uk>

If the system is built for big endian, then the cpu identificaiton register
will be read in the wrong order. Fix this by using readl_relaxed() on the
register.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/plat-samsung/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 71333bb..bd12a55 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -29,14 +29,14 @@ EXPORT_SYMBOL(samsung_rev);
 
 void __init s3c64xx_init_cpu(void)
 {
-	samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
+	samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0x118);
 	if (!samsung_cpu_id) {
 		/*
 		 * S3C6400 has the ID register in a different place,
 		 * and needs a write before it can be read.
 		 */
-		__raw_writel(0x0, S3C_VA_SYS + 0xA1C);
-		samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
+		writel_relaxed(0x0, S3C_VA_SYS + 0xA1C);
+		samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
 	}
 
 	samsung_cpu_rev = 0;
@@ -46,7 +46,7 @@ void __init s3c64xx_init_cpu(void)
 
 void __init s5p_init_cpu(void __iomem *cpuid_addr)
 {
-	samsung_cpu_id = __raw_readl(cpuid_addr);
+	samsung_cpu_id = readl_relaxed(cpuid_addr);
 	samsung_cpu_rev = samsung_cpu_id & 0xFF;
 
 	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
-- 
2.8.1

WARNING: multiple messages have this Message-ID (diff)
From: ben.dooks@codethink.co.uk (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [[PATCH v2] 02/11] ARM: Samsung: fixup endian issues in cpu detection
Date: Tue, 21 Jun 2016 11:20:23 +0100	[thread overview]
Message-ID: <1466504432-24187-3-git-send-email-ben.dooks@codethink.co.uk> (raw)
In-Reply-To: <1466504432-24187-1-git-send-email-ben.dooks@codethink.co.uk>

If the system is built for big endian, then the cpu identificaiton register
will be read in the wrong order. Fix this by using readl_relaxed() on the
register.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 arch/arm/plat-samsung/cpu.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index 71333bb..bd12a55 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -29,14 +29,14 @@ EXPORT_SYMBOL(samsung_rev);
 
 void __init s3c64xx_init_cpu(void)
 {
-	samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0x118);
+	samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0x118);
 	if (!samsung_cpu_id) {
 		/*
 		 * S3C6400 has the ID register in a different place,
 		 * and needs a write before it can be read.
 		 */
-		__raw_writel(0x0, S3C_VA_SYS + 0xA1C);
-		samsung_cpu_id = __raw_readl(S3C_VA_SYS + 0xA1C);
+		writel_relaxed(0x0, S3C_VA_SYS + 0xA1C);
+		samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
 	}
 
 	samsung_cpu_rev = 0;
@@ -46,7 +46,7 @@ void __init s3c64xx_init_cpu(void)
 
 void __init s5p_init_cpu(void __iomem *cpuid_addr)
 {
-	samsung_cpu_id = __raw_readl(cpuid_addr);
+	samsung_cpu_id = readl_relaxed(cpuid_addr);
 	samsung_cpu_rev = samsung_cpu_id & 0xFF;
 
 	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
-- 
2.8.1

  parent reply	other threads:[~2016-06-21 10:20 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-21 10:20 Exynos big-endian repost Ben Dooks
2016-06-21 10:20 ` Ben Dooks
2016-06-21 10:20 ` [[PATCH v2] 01/11] ARM: EXYNOS: fixup debug macros for big-endian Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:15   ` Krzysztof Kozlowski
2016-06-21 11:15     ` Krzysztof Kozlowski
2016-06-21 10:20 ` Ben Dooks [this message]
2016-06-21 10:20   ` [[PATCH v2] 02/11] ARM: Samsung: fixup endian issues in cpu detection Ben Dooks
2016-06-21 11:16   ` Krzysztof Kozlowski
2016-06-21 11:16     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 03/11] ARM: EXYNOS: fixups for big-endian operation Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:16   ` Krzysztof Kozlowski
2016-06-21 11:16     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 04/11] ARM: EXYNOS: fixup endian in pm/pmu Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:16   ` Krzysztof Kozlowski
2016-06-21 11:16     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 05/11] ARM: EXYNOS: Enable ARCH_SUPPORTS_BIG_ENDIAN explicitly Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:17   ` Krzysztof Kozlowski
2016-06-21 11:17     ` Krzysztof Kozlowski
2016-08-10 14:02   ` Krzysztof Kozlowski
2016-08-10 14:02     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 06/11] ARM: Samsung: fixup usage of __raw IO Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:17   ` Krzysztof Kozlowski
2016-06-21 11:17     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 07/11] ARM: EXYNOS: fixup for __raw operations in suspend.c Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 11:17   ` Krzysztof Kozlowski
2016-06-21 11:17     ` Krzysztof Kozlowski
2016-06-21 10:20 ` [[PATCH v2] 08/11] irqchip: exynos: fix usage of __raw IO Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-23 18:53   ` Jason Cooper
2016-06-23 18:53     ` Jason Cooper
2016-06-21 10:20 ` [[PATCH v2] 09/11] irqchip/s3c24xx: fixup IO accessors for big endian Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 10:20 ` [[PATCH v2] 10/11] [V2] memory: samsung: endian fixes for IO Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-21 10:20 ` [[PATCH v2] 11/11] hwrng: exynos - fixup IO accesors Ben Dooks
2016-06-21 10:20   ` Ben Dooks
2016-06-22 10:37   ` Herbert Xu
2016-06-22 10:37     ` Herbert Xu
2016-06-22 10:37     ` Herbert Xu
2016-06-22 11:53     ` Ben Dooks
2016-06-22 11:53       ` Ben Dooks

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=1466504432-24187-3-git-send-email-ben.dooks@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@lists.codethink.co.uk \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=matthew.leach@codethink.co.uk \
    /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.