Skip to content

Commit a2cab95

Browse files
john-thotsbogend
authored andcommitted
mips: ralink: mt7621: define MT7621_SYSC_BASE with __iomem
So that MT7621_SYSC_BASE can be used later in multiple functions without needing to repeat this __iomem declaration each time Signed-off-by: John Thomson <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent f466fad commit a2cab95

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

arch/mips/include/asm/mach-ralink/mt7621.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
#ifndef _MT7621_REGS_H_
88
#define _MT7621_REGS_H_
99

10+
#define IOMEM(x) ((void __iomem *)(KSEG1ADDR(x)))
11+
1012
#define MT7621_PALMBUS_BASE 0x1C000000
1113
#define MT7621_PALMBUS_SIZE 0x03FFFFFF
1214

13-
#define MT7621_SYSC_BASE 0x1E000000
15+
#define MT7621_SYSC_BASE IOMEM(0x1E000000)
1416

1517
#define SYSC_REG_CHIP_NAME0 0x00
1618
#define SYSC_REG_CHIP_NAME1 0x04

arch/mips/ralink/mt7621.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ static void soc_dev_init(struct ralink_soc_info *soc_info, u32 rev)
126126

127127
void __init prom_soc_init(struct ralink_soc_info *soc_info)
128128
{
129-
void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE);
130129
unsigned char *name = NULL;
131130
u32 n0;
132131
u32 n1;
@@ -154,8 +153,8 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info)
154153
__sync();
155154
}
156155

157-
n0 = __raw_readl(sysc + SYSC_REG_CHIP_NAME0);
158-
n1 = __raw_readl(sysc + SYSC_REG_CHIP_NAME1);
156+
n0 = __raw_readl(MT7621_SYSC_BASE + SYSC_REG_CHIP_NAME0);
157+
n1 = __raw_readl(MT7621_SYSC_BASE + SYSC_REG_CHIP_NAME1);
159158

160159
if (n0 == MT7621_CHIP_NAME0 && n1 == MT7621_CHIP_NAME1) {
161160
name = "MT7621";
@@ -164,7 +163,7 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info)
164163
panic("mt7621: unknown SoC, n0:%08x n1:%08x\n", n0, n1);
165164
}
166165
ralink_soc = MT762X_SOC_MT7621AT;
167-
rev = __raw_readl(sysc + SYSC_REG_CHIP_REV);
166+
rev = __raw_readl(MT7621_SYSC_BASE + SYSC_REG_CHIP_REV);
168167

169168
snprintf(soc_info->sys_type, RAMIPS_SYS_TYPE_LEN,
170169
"MediaTek %s ver:%u eco:%u",

0 commit comments

Comments
 (0)