lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230227105806.2394101-5-sergio.paracuellos@gmail.com>
Date:   Mon, 27 Feb 2023 11:57:58 +0100
From:   Sergio Paracuellos <sergio.paracuellos@...il.com>
To:     linux-mips@...r.kernel.org
Cc:     tsbogend@...ha.franken.de, john@...ozen.org,
        linux-kernel@...r.kernel.org, git@...nthomson.fastmail.com.au
Subject: [PATCH 04/12] mips: ralink: rt3883: define RT3883_SYSC_BASE with __iomem

So that RT3883_SYSC_BASE can be used later in multiple functions without
needing to repeat this __iomem declaration each time

Signed-off-by: Sergio Paracuellos <sergio.paracuellos@...il.com>
---
 arch/mips/include/asm/mach-ralink/rt3883.h | 4 +++-
 arch/mips/ralink/rt3883.c                  | 7 +++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/mach-ralink/rt3883.h b/arch/mips/include/asm/mach-ralink/rt3883.h
index f250de9c055b..ad25d5e8d2dc 100644
--- a/arch/mips/include/asm/mach-ralink/rt3883.h
+++ b/arch/mips/include/asm/mach-ralink/rt3883.h
@@ -10,8 +10,10 @@
 
 #include <linux/bitops.h>
 
+#define IOMEM(x)		((void __iomem *)(KSEG1ADDR(x)))
+
 #define RT3883_SDRAM_BASE	0x00000000
-#define RT3883_SYSC_BASE	0x10000000
+#define RT3883_SYSC_BASE	IOMEM(0x10000000)
 #define RT3883_TIMER_BASE	0x10000100
 #define RT3883_INTC_BASE	0x10000200
 #define RT3883_MEMC_BASE	0x10000300
diff --git a/arch/mips/ralink/rt3883.c b/arch/mips/ralink/rt3883.c
index d9875f146d66..fa215c07558d 100644
--- a/arch/mips/ralink/rt3883.c
+++ b/arch/mips/ralink/rt3883.c
@@ -72,15 +72,14 @@ void __init ralink_of_remap(void)
 
 void __init prom_soc_init(struct ralink_soc_info *soc_info)
 {
-	void __iomem *sysc = (void __iomem *) KSEG1ADDR(RT3883_SYSC_BASE);
 	const char *name;
 	u32 n0;
 	u32 n1;
 	u32 id;
 
-	n0 = __raw_readl(sysc + RT3883_SYSC_REG_CHIPID0_3);
-	n1 = __raw_readl(sysc + RT3883_SYSC_REG_CHIPID4_7);
-	id = __raw_readl(sysc + RT3883_SYSC_REG_REVID);
+	n0 = __raw_readl(RT3883_SYSC_BASE + RT3883_SYSC_REG_CHIPID0_3);
+	n1 = __raw_readl(RT3883_SYSC_BASE + RT3883_SYSC_REG_CHIPID4_7);
+	id = __raw_readl(RT3883_SYSC_BASE + RT3883_SYSC_REG_REVID);
 
 	if (n0 == RT3883_CHIP_NAME0 && n1 == RT3883_CHIP_NAME1) {
 		soc_info->compatible = "ralink,rt3883-soc";
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ