Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: BMIPS: Add BCM6358 support

BCM6358 has a shared TLB which conflicts with current SMP support, so it must
be disabled for now.
BCM6358 uses >= 0xfffe0000 addresses for internal registers, which need to be
remapped (by using a simplified version of BRCM63xx ioremap.h).
However, 0xfff80000 is a better address, since it also covers BCM3368, leaving
the possibility to add it in the future.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Cc: f.fainelli@gmail.com
Cc: jogo@openwrt.org
Cc: cernekee@gmail.com
Cc: robh@kernel.org
Cc: simon@fire.lp0.eu
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/13040/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Álvaro Fernández Rojas and committed by
Ralf Baechle
3604b451 65b2849a

+43
+10
arch/mips/bmips/setup.c
··· 95 95 bcm63xx_fixup_cpu1(); 96 96 } 97 97 98 + static void bcm6358_quirks(void) 99 + { 100 + /* 101 + * BCM6358 needs special handling for its shared TLB, so 102 + * disable SMP for now 103 + */ 104 + bmips_smp_enabled = 0; 105 + } 106 + 98 107 static void bcm6368_quirks(void) 99 108 { 100 109 bcm63xx_fixup_cpu1(); ··· 113 104 { "brcm,bcm3384-viper", &bcm3384_viper_quirks }, 114 105 { "brcm,bcm33843-viper", &bcm3384_viper_quirks }, 115 106 { "brcm,bcm6328", &bcm6328_quirks }, 107 + { "brcm,bcm6358", &bcm6358_quirks }, 116 108 { "brcm,bcm6368", &bcm6368_quirks }, 117 109 { "brcm,bcm63168", &bcm6368_quirks }, 118 110 { },
+33
arch/mips/include/asm/mach-bmips/ioremap.h
··· 1 + #ifndef __ASM_MACH_BMIPS_IOREMAP_H 2 + #define __ASM_MACH_BMIPS_IOREMAP_H 3 + 4 + #include <linux/types.h> 5 + 6 + static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr, phys_addr_t size) 7 + { 8 + return phys_addr; 9 + } 10 + 11 + static inline int is_bmips_internal_registers(phys_addr_t offset) 12 + { 13 + if (offset >= 0xfff80000) 14 + return 1; 15 + 16 + return 0; 17 + } 18 + 19 + static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size, 20 + unsigned long flags) 21 + { 22 + if (is_bmips_internal_registers(offset)) 23 + return (void __iomem *)offset; 24 + 25 + return NULL; 26 + } 27 + 28 + static inline int plat_iounmap(const volatile void __iomem *addr) 29 + { 30 + return is_bmips_internal_registers((unsigned long)addr); 31 + } 32 + 33 + #endif /* __ASM_MACH_BMIPS_IOREMAP_H */