diff options
Diffstat (limited to 'arch/mips/include/asm/mach-bcm63xx/ioremap.h')
-rw-r--r-- | arch/mips/include/asm/mach-bcm63xx/ioremap.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-bcm63xx/ioremap.h b/arch/mips/include/asm/mach-bcm63xx/ioremap.h new file mode 100644 index 00000000000..ef94ba73646 --- /dev/null +++ b/arch/mips/include/asm/mach-bcm63xx/ioremap.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef BCM63XX_IOREMAP_H_ | ||
2 | #define BCM63XX_IOREMAP_H_ | ||
3 | |||
4 | #include <bcm63xx_cpu.h> | ||
5 | |||
6 | static inline phys_t fixup_bigphys_addr(phys_t phys_addr, phys_t size) | ||
7 | { | ||
8 | return phys_addr; | ||
9 | } | ||
10 | |||
11 | static inline int is_bcm63xx_internal_registers(phys_t offset) | ||
12 | { | ||
13 | switch (bcm63xx_get_cpu_id()) { | ||
14 | case BCM6338_CPU_ID: | ||
15 | case BCM6345_CPU_ID: | ||
16 | case BCM6348_CPU_ID: | ||
17 | case BCM6358_CPU_ID: | ||
18 | if (offset >= 0xfff00000) | ||
19 | return 1; | ||
20 | break; | ||
21 | case BCM6368_CPU_ID: | ||
22 | if (offset >= 0xb0000000 && offset < 0xb1000000) | ||
23 | return 1; | ||
24 | break; | ||
25 | } | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | static inline void __iomem *plat_ioremap(phys_t offset, unsigned long size, | ||
30 | unsigned long flags) | ||
31 | { | ||
32 | if (is_bcm63xx_internal_registers(offset)) | ||
33 | return (void __iomem *)offset; | ||
34 | return NULL; | ||
35 | } | ||
36 | |||
37 | static inline int plat_iounmap(const volatile void __iomem *addr) | ||
38 | { | ||
39 | return is_bcm63xx_internal_registers((unsigned long)addr); | ||
40 | } | ||
41 | |||
42 | #endif /* BCM63XX_IOREMAP_H_ */ | ||