Skip to contentSkip to conversation

bmips: add BCM6358 support

PATCH Superseded Álvaro Fernández Rojas 5 participants 11 messages Feb 21, 2016 – Apr 11, 2016 4 messages not in the archive

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 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).

---
v2: Use a different approach for remapping internal registers

 arch/mips/bmips/setup.c                    | 29 +++++++++++++++++------
 arch/mips/include/asm/mach-bmips/ioremap.h | 37 ++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-bmips/ioremap.h
arch/mips/bmips/setup.c +22 -7
index 3553528..f834a86 100644
@@ -18,6 +18,7 @@
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/smp.h>
+#include <linux/types.h>
 #include <asm/addrspace.h>
 #include <asm/bmips.h>
 #include <asm/bootinfo.h>
@@ -35,9 +36,12 @@
 
 static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;
 
+phys_addr_t bmips_internal_registers;
+
 struct bmips_quirk {
-	const char		*compatible;
-	void			(*quirk_fn)(void);
+	const char *compatible;
+	void (*quirk_fn)(void);
+	const phys_addr_t regs;
 };
 
 static void kbase_setup(void)
@@ -95,17 +99,27 @@ static void bcm6328_quirks(void)
 		bcm63xx_fixup_cpu1();
 }
 
+static void bcm6358_quirks(void)
+{
+	/*
+	 * BCM6358 needs special handling for its shared TLB, so
+	 * disable SMP for now
+	 */
+	bmips_smp_enabled = 0;
+}
+
 static void bcm6368_quirks(void)
 {
 	bcm63xx_fixup_cpu1();
 }
 
 static const struct bmips_quirk bmips_quirk_list[] = {
-	{ "brcm,bcm3384-viper",		&bcm3384_viper_quirks		},
-	{ "brcm,bcm33843-viper",	&bcm3384_viper_quirks		},
-	{ "brcm,bcm6328",		&bcm6328_quirks			},
-	{ "brcm,bcm6368",		&bcm6368_quirks			},
-	{ "brcm,bcm63168",		&bcm6368_quirks			},
+	{ "brcm,bcm3384-viper", &bcm3384_viper_quirks, 0 },
+	{ "brcm,bcm33843-viper", &bcm3384_viper_quirks, 0 },
+	{ "brcm,bcm6328", &bcm6328_quirks, 0 },
+	{ "brcm,bcm6358", &bcm6358_quirks, 0xfffe0000 },
+	{ "brcm,bcm6368", &bcm6368_quirks, 0 },
+	{ "brcm,bcm63168", &bcm6368_quirks, 0 },
 	{ },
 };
 
@@ -162,6 +176,7 @@ void __init plat_mem_setup(void)
 	for (q = bmips_quirk_list; q->quirk_fn; q++) {
 		if (of_flat_dt_is_compatible(of_get_flat_dt_root(),
 					     q->compatible)) {
+			bmips_internal_registers = q->regs;
 			q->quirk_fn();
 		}
 	}
arch/mips/include/asm/mach-bmips/ioremap.h new file +37 -0
new file mode 100644
index 0000000..5ffca94
@@ -0,0 +1,37 @@
+#ifndef __ASM_MACH_BMIPS_IOREMAP_H
+#define __ASM_MACH_BMIPS_IOREMAP_H
+
+#include <linux/types.h>
+
+extern phys_addr_t bmips_internal_registers;
+
+static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr,
+					     phys_addr_t size)
+{
+	return phys_addr;
+}
+
+static inline int is_bmips_internal_registers(phys_addr_t offset)
+{
+	if (bmips_internal_registers != 0 && offset >= bmips_internal_registers)
+		return 1;
+	else
+		return 0;
+}
+
+static inline void __iomem *plat_ioremap(phys_addr_t offset,
+					 unsigned long size,
+					 unsigned long flags)
+{
+	if (is_bmips_internal_registers(offset))
+		return (void __iomem *) offset;
+
+	return NULL;
+}
+
+static inline int plat_iounmap(const volatile void __iomem *addr)
+{
+	return is_bmips_internal_registers((unsigned long) addr);
+}
+
+#endif /* __ASM_MACH_BMIPS_IOREMAP_H */
Signature · 1 line
1.9.1
#1 lore raw
Quoted 29 lines · Álvaro Fernández Rojas

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).

---
v2: Use a different approach for remapping internal registers

 arch/mips/bmips/setup.c                    | 29 +++++++++++++++++------
 arch/mips/include/asm/mach-bmips/ioremap.h | 37 ++++++++++++++++++++++++++++++
 2 files changed, 59 insertions(+), 7 deletions(-)
 create mode 100644 arch/mips/include/asm/mach-bmips/ioremap.h
arch/mips/bmips/setup.c +1 -0
index 3553528..f834a86 100644
@@ -18,6 +18,7 @@
 #include <linux/of_fdt.h>
 #include <linux/of_platform.h>
 #include <linux/smp.h>
+#include <linux/types.h>
 #include <asm/addrspace.h>
 #include <asm/bmips.h>
 #include <asm/bootinfo.h>
@@ -35,9 +36,12 @@
 
 static const unsigned long kbase = VMLINUX_LOAD_ADDRESS & 0xfff00000;

arch/mips/bmips/setup.c line 45

Quoted 10 lines
arch/mips/bmips/setup.c +5 -2
 
+phys_addr_t bmips_internal_registers;
+
 struct bmips_quirk {
-	const char		*compatible;
-	void			(*quirk_fn)(void);
+	const char *compatible;
+	void (*quirk_fn)(void);
+	const phys_addr_t regs;
 };

That does not scale very well to having some sort of generic quirk function here.

Quoted 56 lines
arch/mips/bmips/setup.c +16 -5
 static void kbase_setup(void)
@@ -95,17 +99,27 @@ static void bcm6328_quirks(void)
 		bcm63xx_fixup_cpu1();
 }
 
+static void bcm6358_quirks(void)
+{
+	/*
+	 * BCM6358 needs special handling for its shared TLB, so
+	 * disable SMP for now
+	 */
+	bmips_smp_enabled = 0;
+}
+
 static void bcm6368_quirks(void)
 {
 	bcm63xx_fixup_cpu1();
 }
 
 static const struct bmips_quirk bmips_quirk_list[] = {
-	{ "brcm,bcm3384-viper",		&bcm3384_viper_quirks		},
-	{ "brcm,bcm33843-viper",	&bcm3384_viper_quirks		},
-	{ "brcm,bcm6328",		&bcm6328_quirks			},
-	{ "brcm,bcm6368",		&bcm6368_quirks			},
-	{ "brcm,bcm63168",		&bcm6368_quirks			},
+	{ "brcm,bcm3384-viper", &bcm3384_viper_quirks, 0 },
+	{ "brcm,bcm33843-viper", &bcm3384_viper_quirks, 0 },
+	{ "brcm,bcm6328", &bcm6328_quirks, 0 },
+	{ "brcm,bcm6358", &bcm6358_quirks, 0xfffe0000 },
+	{ "brcm,bcm6368", &bcm6368_quirks, 0 },
+	{ "brcm,bcm63168", &bcm6368_quirks, 0 },
 	{ },
 };
 
@@ -162,6 +176,7 @@ void __init plat_mem_setup(void)
 	for (q = bmips_quirk_list; q->quirk_fn; q++) {
 		if (of_flat_dt_is_compatible(of_get_flat_dt_root(),
 					     q->compatible)) {
+			bmips_internal_registers = q->regs;
 			q->quirk_fn();
 		}
 	}
arch/mips/include/asm/mach-bmips/ioremap.h new file +7 -0
new file mode 100644
index 0000000..5ffca94
@@ -0,0 +1,37 @@
+#ifndef __ASM_MACH_BMIPS_IOREMAP_H
+#define __ASM_MACH_BMIPS_IOREMAP_H
+
+#include <linux/types.h>
+
+extern phys_addr_t bmips_internal_registers;
+

arch/mips/include/asm/mach-bmips/ioremap.h line 17

Quoted 10 lines
arch/mips/include/asm/mach-bmips/ioremap.h new file +10 -0
+static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr,
+					     phys_addr_t size)
+{
+	return phys_addr;
+}
+
+static inline int is_bmips_internal_registers(phys_addr_t offset)
+{
+	if (bmips_internal_registers != 0 && offset >= bmips_internal_registers)
+		return 1;

Humm, we should probably just use a hardcoded constant here, and just pick one which works for all SoCs, so the 3368 base address for
instance: 0xfff8_0000 seems like a good candidate, and also works for other DSL SoCs too.

Signature · 5 lines
Florian
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH v3 1/2 bmips: add BCM6358 support

In reply to a message not in the archive

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.

---
v3: Use a hardcoded constant for is_bmips_internal_registers (BCM3368 base
address)
v2: Use a different approach for remapping internal registers

 arch/mips/bmips/setup.c                    | 10 +++++++++
 arch/mips/include/asm/mach-bmips/ioremap.h | 33 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-bmips/ioremap.h
arch/mips/bmips/setup.c +10 -0
index 3553528..38b5bd5 100644
@@ -95,6 +95,15 @@ static void bcm6328_quirks(void)
 		bcm63xx_fixup_cpu1();
 }
 
+static void bcm6358_quirks(void)
+{
+	/*
+	 * BCM6358 needs special handling for its shared TLB, so
+	 * disable SMP for now
+	 */
+	bmips_smp_enabled = 0;
+}
+
 static void bcm6368_quirks(void)
 {
 	bcm63xx_fixup_cpu1();
@@ -104,6 +113,7 @@ static const struct bmips_quirk bmips_quirk_list[] = {
 	{ "brcm,bcm3384-viper",		&bcm3384_viper_quirks		},
 	{ "brcm,bcm33843-viper",	&bcm3384_viper_quirks		},
 	{ "brcm,bcm6328",		&bcm6328_quirks			},
+	{ "brcm,bcm6358",		&bcm6358_quirks			},
 	{ "brcm,bcm6368",		&bcm6368_quirks			},
 	{ "brcm,bcm63168",		&bcm6368_quirks			},
 	{ },
arch/mips/include/asm/mach-bmips/ioremap.h new file +33 -0
new file mode 100644
index 0000000..29c7a7b
@@ -0,0 +1,33 @@
+#ifndef __ASM_MACH_BMIPS_IOREMAP_H
+#define __ASM_MACH_BMIPS_IOREMAP_H
+
+#include <linux/types.h>
+
+static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr, phys_addr_t size)
+{
+	return phys_addr;
+}
+
+static inline int is_bmips_internal_registers(phys_addr_t offset)
+{
+	if (offset >= 0xfff80000)
+		return 1;
+
+	return 0;
+}
+
+static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size,
+					 unsigned long flags)
+{
+	if (is_bmips_internal_registers(offset))
+		return (void __iomem *)offset;
+
+	return NULL;
+}
+
+static inline int plat_iounmap(const volatile void __iomem *addr)
+{
+	return is_bmips_internal_registers((unsigned long)addr);
+}
+
+#endif /* __ASM_MACH_BMIPS_IOREMAP_H */
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#5 lore raw

PATCH v3 2/2 bmips: add device tree example for BCM6358

In reply to a message not in the archive

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 111 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 +++++++++
 5 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts
Documentation/devicetree/bindings/mips/brcm/soc.txt +1 -1
index 7bab90c..e58a4f6 100644
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible: "brcm,bcm3384", "brcm,bcm33843"
               "brcm,bcm3384-viper", "brcm,bcm33843-viper"
-              "brcm,bcm6328", "brcm,bcm6368",
+              "brcm,bcm6328", "brcm,bcm6358", "brcm,bcm6368",
               "brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7358", "brcm,bcm7360",
               "brcm,bcm7362", "brcm,bcm7420", "brcm,bcm7425"
 
arch/mips/bmips/Kconfig +4 -0
index e2c4fd6..264328d 100644
@@ -21,6 +21,10 @@ config DT_BCM93384WVG_VIPER
 	bool "BCM93384WVG Viper CPU (EXPERIMENTAL)"
 	select BUILTIN_DTB
 
+config DT_BCM96358NB4SER
+	bool "BCM96358NB4SER"
+	select BUILTIN_DTB
+
 config DT_BCM96368MVWG
 	bool "BCM96368MVWG"
 	select BUILTIN_DTB
arch/mips/boot/dts/brcm/Makefile +2 -0
index eabeb60..fda9d38 100644
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_DT_BCM93384WVG)		+= bcm93384wvg.dtb
 dtb-$(CONFIG_DT_BCM93384WVG_VIPER)	+= bcm93384wvg_viper.dtb
+dtb-$(CONFIG_DT_BCM96358NB4SER)		+= bcm96358nb4ser.dtb
 dtb-$(CONFIG_DT_BCM96368MVWG)		+= bcm96368mvwg.dtb
 dtb-$(CONFIG_DT_BCM9EJTAGPRB)		+= bcm9ejtagprb.dtb
 dtb-$(CONFIG_DT_BCM97125CBMB)		+= bcm97125cbmb.dtb
@@ -14,6 +15,7 @@ dtb-$(CONFIG_DT_BCM97435SVMB)		+= bcm97435svmb.dtb
 dtb-$(CONFIG_DT_NONE)			+= \
 						bcm93384wvg.dtb		\
 						bcm93384wvg_viper.dtb	\
+						bcm96358nb4ser.dtb	\
 						bcm96368mvwg.dtb	\
 						bcm9ejtagprb.dtb	\
 						bcm97125cbmb.dtb	\
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +111 -0

111 lines not on this page · raw message

arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +46 -0

46 lines not on this page · raw message

Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer Acked-by on v3 2/2
#6 lore raw

Re: [PATCH v3 2/2] bmips: add device tree example for BCM6358

Quoted 10 lines · Álvaro Fernández Rojas

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

Quoted 8 lines
 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 111 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 +++++++++
 5 files changed, 164 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts
#7 lore raw

PATCH v4 1/2 bmips: add BCM6358 support

In reply to Álvaro Fernández Rojas

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.

---
v4: no changes, resend
v3: Use a hardcoded constant for is_bmips_internal_registers (BCM3368 base
address)
v2: Use a different approach for remapping internal registers

 arch/mips/bmips/setup.c                    | 10 +++++++++
 arch/mips/include/asm/mach-bmips/ioremap.h | 33 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-bmips/ioremap.h
arch/mips/bmips/setup.c +10 -0
index 3553528..38b5bd5 100644
@@ -95,6 +95,15 @@ static void bcm6328_quirks(void)
 		bcm63xx_fixup_cpu1();
 }
 
+static void bcm6358_quirks(void)
+{
+	/*
+	 * BCM6358 needs special handling for its shared TLB, so
+	 * disable SMP for now
+	 */
+	bmips_smp_enabled = 0;
+}
+
 static void bcm6368_quirks(void)
 {
 	bcm63xx_fixup_cpu1();
@@ -104,6 +113,7 @@ static const struct bmips_quirk bmips_quirk_list[] = {
 	{ "brcm,bcm3384-viper",		&bcm3384_viper_quirks		},
 	{ "brcm,bcm33843-viper",	&bcm3384_viper_quirks		},
 	{ "brcm,bcm6328",		&bcm6328_quirks			},
+	{ "brcm,bcm6358",		&bcm6358_quirks			},
 	{ "brcm,bcm6368",		&bcm6368_quirks			},
 	{ "brcm,bcm63168",		&bcm6368_quirks			},
 	{ },
arch/mips/include/asm/mach-bmips/ioremap.h new file +33 -0
new file mode 100644
index 0000000..29c7a7b
@@ -0,0 +1,33 @@
+#ifndef __ASM_MACH_BMIPS_IOREMAP_H
+#define __ASM_MACH_BMIPS_IOREMAP_H
+
+#include <linux/types.h>
+
+static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr, phys_addr_t size)
+{
+	return phys_addr;
+}
+
+static inline int is_bmips_internal_registers(phys_addr_t offset)
+{
+	if (offset >= 0xfff80000)
+		return 1;
+
+	return 0;
+}
+
+static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size,
+					 unsigned long flags)
+{
+	if (is_bmips_internal_registers(offset))
+		return (void __iomem *)offset;
+
+	return NULL;
+}
+
+static inline int plat_iounmap(const volatile void __iomem *addr)
+{
+	return is_bmips_internal_registers((unsigned long)addr);
+}
+
+#endif /* __ASM_MACH_BMIPS_IOREMAP_H */
Signature · 1 line
2.1.4
#9 lore raw

PATCH v4 2/2 bmips: add device tree example for BCM6358

In reply to a message not in the archive

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v4: Device tree improvements:
- Switch to native-endian for syscon.
- Switch to bcm6345-l1-intc interrupt controller.
- Add ehci and ohci nodes.
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 130 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 ++++++++
 5 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts
Documentation/devicetree/bindings/mips/brcm/soc.txt +1 -1
index 7bab90c..e58a4f6 100644
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible: "brcm,bcm3384", "brcm,bcm33843"
               "brcm,bcm3384-viper", "brcm,bcm33843-viper"
-              "brcm,bcm6328", "brcm,bcm6368",
+              "brcm,bcm6328", "brcm,bcm6358", "brcm,bcm6368",
               "brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7358", "brcm,bcm7360",
               "brcm,bcm7362", "brcm,bcm7420", "brcm,bcm7425"
 
arch/mips/bmips/Kconfig +4 -0
index e2c4fd6..264328d 100644
@@ -21,6 +21,10 @@ config DT_BCM93384WVG_VIPER
 	bool "BCM93384WVG Viper CPU (EXPERIMENTAL)"
 	select BUILTIN_DTB
 
+config DT_BCM96358NB4SER
+	bool "BCM96358NB4SER"
+	select BUILTIN_DTB
+
 config DT_BCM96368MVWG
 	bool "BCM96368MVWG"
 	select BUILTIN_DTB
arch/mips/boot/dts/brcm/Makefile +2 -0
index eabeb60..fda9d38 100644
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_DT_BCM93384WVG)		+= bcm93384wvg.dtb
 dtb-$(CONFIG_DT_BCM93384WVG_VIPER)	+= bcm93384wvg_viper.dtb
+dtb-$(CONFIG_DT_BCM96358NB4SER)		+= bcm96358nb4ser.dtb
 dtb-$(CONFIG_DT_BCM96368MVWG)		+= bcm96368mvwg.dtb
 dtb-$(CONFIG_DT_BCM9EJTAGPRB)		+= bcm9ejtagprb.dtb
 dtb-$(CONFIG_DT_BCM97125CBMB)		+= bcm97125cbmb.dtb
@@ -14,6 +15,7 @@ dtb-$(CONFIG_DT_BCM97435SVMB)		+= bcm97435svmb.dtb
 dtb-$(CONFIG_DT_NONE)			+= \
 						bcm93384wvg.dtb		\
 						bcm93384wvg_viper.dtb	\
+						bcm96358nb4ser.dtb	\
 						bcm96368mvwg.dtb	\
 						bcm9ejtagprb.dtb	\
 						bcm97125cbmb.dtb	\
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +130 -0

130 lines not on this page · raw message

arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +46 -0

46 lines not on this page · raw message

Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#11 lore raw

Re: [PATCH v4 2/2] bmips: add device tree example for BCM6358

In reply to a message not in the archive
Quoted 76 lines · Álvaro Fernández Rojas

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v4: Device tree improvements:
- Switch to native-endian for syscon.
- Switch to bcm6345-l1-intc interrupt controller.
- Add ehci and ohci nodes.
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 130 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 ++++++++
 5 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts
Documentation/devicetree/bindings/mips/brcm/soc.txt +1 -1
index 7bab90c..e58a4f6 100644
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible: "brcm,bcm3384", "brcm,bcm33843"
               "brcm,bcm3384-viper", "brcm,bcm33843-viper"
-              "brcm,bcm6328", "brcm,bcm6368",
+              "brcm,bcm6328", "brcm,bcm6358", "brcm,bcm6368",
               "brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7358", "brcm,bcm7360",
               "brcm,bcm7362", "brcm,bcm7420", "brcm,bcm7425"
 
arch/mips/bmips/Kconfig +4 -0
index e2c4fd6..264328d 100644
@@ -21,6 +21,10 @@ config DT_BCM93384WVG_VIPER
 	bool "BCM93384WVG Viper CPU (EXPERIMENTAL)"
 	select BUILTIN_DTB
 
+config DT_BCM96358NB4SER
+	bool "BCM96358NB4SER"
+	select BUILTIN_DTB
+
 config DT_BCM96368MVWG
 	bool "BCM96368MVWG"
 	select BUILTIN_DTB
arch/mips/boot/dts/brcm/Makefile +2 -0
index eabeb60..fda9d38 100644
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_DT_BCM93384WVG)		+= bcm93384wvg.dtb
 dtb-$(CONFIG_DT_BCM93384WVG_VIPER)	+= bcm93384wvg_viper.dtb
+dtb-$(CONFIG_DT_BCM96358NB4SER)		+= bcm96358nb4ser.dtb
 dtb-$(CONFIG_DT_BCM96368MVWG)		+= bcm96368mvwg.dtb
 dtb-$(CONFIG_DT_BCM9EJTAGPRB)		+= bcm9ejtagprb.dtb
 dtb-$(CONFIG_DT_BCM97125CBMB)		+= bcm97125cbmb.dtb
@@ -14,6 +15,7 @@ dtb-$(CONFIG_DT_BCM97435SVMB)		+= bcm97435svmb.dtb
 dtb-$(CONFIG_DT_NONE)			+= \
 						bcm93384wvg.dtb		\
 						bcm93384wvg_viper.dtb	\
+						bcm96358nb4ser.dtb	\
 						bcm96368mvwg.dtb	\
 						bcm9ejtagprb.dtb	\
 						bcm97125cbmb.dtb	\
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +0 -0
new file mode 100644
index 0000000..5dc8432

arch/mips/boot/dts/brcm/bcm6358.dtsi line 10

Quoted 10 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +10 -0
@@ -0,0 +1,130 @@
+/ {
+	#address-cells = <1>;
+	#size-cells = <1>;
+	compatible = "brcm,bcm6358";
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		mips-hpt-frequency = <150000000>;

I guess this is already defined for MIPS, but there is a generic timer freq property defined in ePAPR.

Quoted 6 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +6 -0
+
+		cpu@0 {
+			compatible = "brcm,bmips4350";
+			device_type = "cpu";
+			reg = <0>;
+		};

arch/mips/boot/dts/brcm/bcm6358.dtsi line 26

Quoted 10 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +10 -0
+
+		cpu@1 {
+			compatible = "brcm,bmips4350";
+			device_type = "cpu";
+			reg = <1>;
+		};
+	};
+
+	clocks {
+		periph_clk: periph_clk {

No underscores in node names.

arch/mips/boot/dts/brcm/bcm6358.dtsi line 35

Quoted 9 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +9 -0
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency = <50000000>;
+		};
+	};
+
+	aliases {
+		uart0 = &uart0;
+		uart1 = &uart1;

Alias names should be serialN.

arch/mips/boot/dts/brcm/bcm6358.dtsi line 38

Quoted 3 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +3 -0
+	};
+
+	cpu_intc: cpu_intc {

This should also be "interrupt-controller".

arch/mips/boot/dts/brcm/bcm6358.dtsi line 51

Quoted 13 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +13 -0
+		#address-cells = <0>;
+		compatible = "mti,cpu-interrupt-controller";
+
+		interrupt-controller;
+		#interrupt-cells = <1>;
+	};
+
+	ubus {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		compatible = "simple-bus";
+		ranges;

Would be preferred to limit this to 0xfffe0000 (or appropriate range) if in fact all peripherals fall within this range.

Quoted 50 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +50 -0
+
+		periph_cntl: syscon@fffe0000 {
+			compatible = "syscon";
+			reg = <0xfffe0000 0xc>;
+			native-endian;
+		};
+
+		reboot: syscon-reboot@fffe0008 {
+			compatible = "syscon-reboot";
+			regmap = <&periph_cntl>;
+			offset = <0x8>;
+			mask = <0x1>;
+		};
+
+		periph_intc: interrupt-controller@fffe000c {
+			compatible = "brcm,bcm6345-l1-intc";
+			reg = <0xfffe000c 0x8>,
+			      <0xfffe0038 0x8>;
+
+			interrupt-controller;
+			#interrupt-cells = <1>;
+
+			interrupt-parent = <&cpu_intc>;
+			interrupts = <2>, <3>;
+		};
+
+		leds0: led-controller@fffe00d0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "brcm,bcm6358-leds";
+			reg = <0xfffe00d0 0x8>;
+
+			status = "disabled";
+		};
+
+		uart0: serial@fffe0100 {
+			compatible = "brcm,bcm6345-uart";
+			reg = <0xfffe0100 0x18>;
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <2>;
+
+			clocks = <&periph_clk>;
+
+			status = "disabled";
+		};
+
+		uart1: serial@fffe0120 {
+			compatible = "brcm,bcm6345-uart";
+			reg = <0xfffe0120 0x18>;

arch/mips/boot/dts/brcm/bcm6358.dtsi line 111

Quoted 10 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +10 -0
+
+			interrupt-parent = <&periph_intc>;
+			interrupts = <3>;
+
+			clocks = <&periph_clk>;
+
+			status = "disabled";
+		};
+
+		ehci0: usb@fffe1300 {

Why the numbering? Is there more than 1 EHCI?

arch/mips/boot/dts/brcm/bcm6358.dtsi line 112

Quoted 1 line
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +1 -0
+			compatible = "brcm,bcm6358-ehci", "generic-ehci";

Is this documented?

arch/mips/boot/dts/brcm/bcm6358.dtsi line 120

Quoted 8 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +8 -0
+			reg = <0xfffe1300 0x100>;
+			big-endian;
+			interrupt-parent = <&periph_intc>;
+			interrupts = <10>;
+			status = "disabled";
+		};
+
+		ohci0: usb@fffe1400 {

More than 1 OHCI?

arch/mips/boot/dts/brcm/bcm6358.dtsi line 121

Quoted 1 line
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +1 -0
+			compatible = "brcm,bcm6358-ohci", "generic-ohci";

Is this documented?

Quoted 15 lines
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +9 -0
+			reg = <0xfffe1400 0x100>;
+			big-endian;
+			no-big-frame-no;
+			interrupt-parent = <&periph_intc>;
+			interrupts = <5>;
+			status = "disabled";
+		};
+	};
+};
arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +0 -0
new file mode 100644
index 0000000..f412117

arch/mips/boot/dts/brcm/bcm96358nb4ser.dts line 6

Quoted 6 lines
arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +6 -0
@@ -0,0 +1,46 @@
+/dts-v1/;
+
+/include/ "bcm6358.dtsi"
+
+/ {
+	compatible = "sfr,nb4-ser", "brcm,bcm6358";

Is sfr,nb4-ser documented?

Quoted 43 lines
arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +40 -0
+	model = "SFR Neufbox 4 (Sercomm)";
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x00000000 0x02000000>;
+	};
+
+	chosen {
+		stdout-path = &uart0;
+	};
+};
+
+&leds0 {
+	status = "ok";
+
+	led@0 {
+		reg = <0>;
+		active-low;
+		label = "nb4-ser:white:alarm";
+	};
+	led@2 {
+		reg = <2>;
+		active-low;
+		label = "nb4-ser:white:tv";
+	};
+	led@3 {
+		reg = <3>;
+		active-low;
+		label = "nb4-ser:white:tel";
+	};
+	led@4 {
+		reg = <4>;
+		active-low;
+		label = "nb4-ser:white:adsl";
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
Signature · 1 line
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#12 lore raw

PATCH 1/2 bmips: add BCM6358 support

In reply to Álvaro Fernández Rojas

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.

---
v5: no changes, resend
v4: no changes, resend
v3: Use a hardcoded constant for is_bmips_internal_registers (BCM3368 base
address)
v2: Use a different approach for remapping internal registers

 arch/mips/bmips/setup.c                    | 10 +++++++++
 arch/mips/include/asm/mach-bmips/ioremap.h | 33 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 arch/mips/include/asm/mach-bmips/ioremap.h
arch/mips/bmips/setup.c +10 -0
index 3553528..38b5bd5 100644
@@ -95,6 +95,15 @@ static void bcm6328_quirks(void)
 		bcm63xx_fixup_cpu1();
 }
 
+static void bcm6358_quirks(void)
+{
+	/*
+	 * BCM6358 needs special handling for its shared TLB, so
+	 * disable SMP for now
+	 */
+	bmips_smp_enabled = 0;
+}
+
 static void bcm6368_quirks(void)
 {
 	bcm63xx_fixup_cpu1();
@@ -104,6 +113,7 @@ static const struct bmips_quirk bmips_quirk_list[] = {
 	{ "brcm,bcm3384-viper",		&bcm3384_viper_quirks		},
 	{ "brcm,bcm33843-viper",	&bcm3384_viper_quirks		},
 	{ "brcm,bcm6328",		&bcm6328_quirks			},
+	{ "brcm,bcm6358",		&bcm6358_quirks			},
 	{ "brcm,bcm6368",		&bcm6368_quirks			},
 	{ "brcm,bcm63168",		&bcm6368_quirks			},
 	{ },
arch/mips/include/asm/mach-bmips/ioremap.h new file +33 -0
new file mode 100644
index 0000000..29c7a7b
@@ -0,0 +1,33 @@
+#ifndef __ASM_MACH_BMIPS_IOREMAP_H
+#define __ASM_MACH_BMIPS_IOREMAP_H
+
+#include <linux/types.h>
+
+static inline phys_addr_t fixup_bigphys_addr(phys_addr_t phys_addr, phys_addr_t size)
+{
+	return phys_addr;
+}
+
+static inline int is_bmips_internal_registers(phys_addr_t offset)
+{
+	if (offset >= 0xfff80000)
+		return 1;
+
+	return 0;
+}
+
+static inline void __iomem *plat_ioremap(phys_addr_t offset, unsigned long size,
+					 unsigned long flags)
+{
+	if (is_bmips_internal_registers(offset))
+		return (void __iomem *)offset;
+
+	return NULL;
+}
+
+static inline int plat_iounmap(const volatile void __iomem *addr)
+{
+	return is_bmips_internal_registers((unsigned long)addr);
+}
+
+#endif /* __ASM_MACH_BMIPS_IOREMAP_H */
Signature · 6 lines
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#13 lore raw

PATCH 2/2 bmips: add device tree example for BCM6358

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v5: more device tree improvements
- There is just ohci/ehci node.
- Avoid using underscores in node names.
- Use interrupt-controller for cpu_intc.
- Rename uart aliases to serial.
v4: Device tree improvements:
- Switch to native-endian for syscon.
- Switch to bcm6345-l1-intc interrupt controller.
- Add ehci and ohci nodes.
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 130 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 ++++++++
 5 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts
Documentation/devicetree/bindings/mips/brcm/soc.txt +1 -1
index 7bab90c..e58a4f6 100644
@@ -4,7 +4,7 @@ Required properties:
 
 - compatible: "brcm,bcm3384", "brcm,bcm33843"
               "brcm,bcm3384-viper", "brcm,bcm33843-viper"
-              "brcm,bcm6328", "brcm,bcm6368",
+              "brcm,bcm6328", "brcm,bcm6358", "brcm,bcm6368",
               "brcm,bcm7125", "brcm,bcm7346", "brcm,bcm7358", "brcm,bcm7360",
               "brcm,bcm7362", "brcm,bcm7420", "brcm,bcm7425"
 
arch/mips/bmips/Kconfig +4 -0
index e2c4fd6..264328d 100644
@@ -21,6 +21,10 @@ config DT_BCM93384WVG_VIPER
 	bool "BCM93384WVG Viper CPU (EXPERIMENTAL)"
 	select BUILTIN_DTB
 
+config DT_BCM96358NB4SER
+	bool "BCM96358NB4SER"
+	select BUILTIN_DTB
+
 config DT_BCM96368MVWG
 	bool "BCM96368MVWG"
 	select BUILTIN_DTB
arch/mips/boot/dts/brcm/Makefile +2 -0
index eabeb60..fda9d38 100644
@@ -1,5 +1,6 @@
 dtb-$(CONFIG_DT_BCM93384WVG)		+= bcm93384wvg.dtb
 dtb-$(CONFIG_DT_BCM93384WVG_VIPER)	+= bcm93384wvg_viper.dtb
+dtb-$(CONFIG_DT_BCM96358NB4SER)		+= bcm96358nb4ser.dtb
 dtb-$(CONFIG_DT_BCM96368MVWG)		+= bcm96368mvwg.dtb
 dtb-$(CONFIG_DT_BCM9EJTAGPRB)		+= bcm9ejtagprb.dtb
 dtb-$(CONFIG_DT_BCM97125CBMB)		+= bcm97125cbmb.dtb
@@ -14,6 +15,7 @@ dtb-$(CONFIG_DT_BCM97435SVMB)		+= bcm97435svmb.dtb
 dtb-$(CONFIG_DT_NONE)			+= \
 						bcm93384wvg.dtb		\
 						bcm93384wvg_viper.dtb	\
+						bcm96358nb4ser.dtb	\
 						bcm96368mvwg.dtb	\
 						bcm9ejtagprb.dtb	\
 						bcm97125cbmb.dtb	\
arch/mips/boot/dts/brcm/bcm6358.dtsi new file +130 -0

130 lines not on this page · raw message

arch/mips/boot/dts/brcm/bcm96358nb4ser.dts new file +46 -0

46 lines not on this page · raw message

Signature · 1 line
2.1.4
maintainer Acked-by on v1 2/2
#14 lore raw

Re: [PATCH 2/2] bmips: add device tree example for BCM6358

Quoted 19 lines · Álvaro Fernández Rojas

This adds a device tree example for SFR Neufbox4 (Sercomm version), which also serves as a real example for brcm,bcm6358-leds.

---
v5: more device tree improvements
- There is just ohci/ehci node.
- Avoid using underscores in node names.
- Use interrupt-controller for cpu_intc.
- Rename uart aliases to serial.
v4: Device tree improvements:
- Switch to native-endian for syscon.
- Switch to bcm6345-l1-intc interrupt controller.
- Add ehci and ohci nodes.
v3: Device tree fixes
- Use interrupt-controller instead of periph_intc.
- Use led@# instead of naming the LEDs.
v2: Remove led0 alias and use stdout-path only

Quoted 8 lines
 .../devicetree/bindings/mips/brcm/soc.txt          |   2 +-
 arch/mips/bmips/Kconfig                            |   4 +
 arch/mips/boot/dts/brcm/Makefile                   |   2 +
 arch/mips/boot/dts/brcm/bcm6358.dtsi               | 130 +++++++++++++++++++++
 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts         |  46 ++++++++
 5 files changed, 183 insertions(+), 1 deletion(-)
 create mode 100644 arch/mips/boot/dts/brcm/bcm6358.dtsi
 create mode 100644 arch/mips/boot/dts/brcm/bcm96358nb4ser.dts

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html