MIPS: add support for Microsemi MIPS SoCs
Subsystems (4)
Alexandre Belloni
maintainerPATCH v5 2/5 MIPS: mscc: add ocelot dtsi
In reply to Alexandre BelloniAdd a device tree include file for the Microsemi Ocelot SoC.
--- arch/mips/boot/dts/Makefile | 1 + arch/mips/boot/dts/mscc/Makefile | 1 + arch/mips/boot/dts/mscc/ocelot.dtsi | 117 ++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 arch/mips/boot/dts/mscc/Makefile create mode 100644 arch/mips/boot/dts/mscc/ocelot.dtsi
arch/mips/boot/dts/Makefile +1 -0
@@ -4,6 +4,7 @@ subdir-y += cavium-octeon subdir-y += img subdir-y += ingenic subdir-y += lantiq +subdir-y += mscc subdir-y += mti subdir-y += netlogic subdir-y += ni
arch/mips/boot/dts/mscc/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
arch/mips/boot/dts/mscc/ocelot.dtsi new file +117 -0
117 lines not on this page · raw message
Signature · 1 line
2.16.2
Alexandre Belloni
maintainerPATCH v5 3/5 MIPS: mscc: add ocelot PCB123 device tree
In reply to Alexandre BelloniAdd a device tree for the Microsemi Ocelot PCB123 evaluation board.
--- arch/mips/boot/dts/mscc/Makefile | 2 ++ arch/mips/boot/dts/mscc/ocelot_pcb123.dts | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 arch/mips/boot/dts/mscc/ocelot_pcb123.dts
arch/mips/boot/dts/mscc/Makefile +2 -0
@@ -1 +1,3 @@ +dtb-$(CONFIG_LEGACY_BOARD_OCELOT) += ocelot_pcb123.dtb + obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
arch/mips/boot/dts/mscc/ocelot_pcb123.dts new file +27 -0
@@ -0,0 +1,27 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2017 Microsemi Corporation */ + +/dts-v1/; + +#include "ocelot.dtsi" + +/ { + compatible = "mscc,ocelot-pcb123", "mscc,ocelot"; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x0e000000>; + }; +}; + +&uart0 { + status = "okay"; +}; + +&uart2 { + status = "okay"; +};
Signature · 1 line
2.16.2
Alexandre Belloni
maintainerv5 cover MIPS: add support for Microsemi MIPS SoCs
Hi,
This patch series adds initial support for the Microsemi MIPS SoCs. It is currently focusing on the Microsemi Ocelot (VSC7513, VSC7514).
Changes in v5:
- reworked the DT to remove ocelot_measure_hpt_freq()
- fixed the memory node (memory@0)
- fixed indentation
- board-ocelot.config:
o require CONFIG_CPU_MIPS32_R2
o removed CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER
o removed CONFIG_SQUASHFS because generic_defconfig has # CONFIG_MISC_FILESYSTEMS is not set
- removed DMA_NONCOHERENT from MSCC_OCELOT
Alexandre Belloni (5):
dt-bindings: mips: Add bindings for Microsemi SoCs
MIPS: mscc: add ocelot dtsi
MIPS: mscc: add ocelot PCB123 device tree
MIPS: generic: Add support for Microsemi Ocelot
MAINTAINERS: Add entry for Microsemi MIPS SoCs
Documentation/devicetree/bindings/mips/mscc.txt | 43 +++++++++ MAINTAINERS | 9 ++ arch/mips/Makefile | 4 + arch/mips/boot/dts/Makefile | 1 + arch/mips/boot/dts/mscc/Makefile | 3 + arch/mips/boot/dts/mscc/ocelot.dtsi | 117 ++++++++++++++++++++++++ arch/mips/boot/dts/mscc/ocelot_pcb123.dts | 27 ++++++ arch/mips/configs/generic/board-ocelot.config | 36 ++++++++ arch/mips/generic/Kconfig | 16 ++++ arch/mips/generic/Makefile | 1 + arch/mips/generic/board-ocelot.c | 67 ++++++++++++++ 11 files changed, 324 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/mscc.txt create mode 100644 arch/mips/boot/dts/mscc/Makefile create mode 100644 arch/mips/boot/dts/mscc/ocelot.dtsi create mode 100644 arch/mips/boot/dts/mscc/ocelot_pcb123.dts create mode 100644 arch/mips/configs/generic/board-ocelot.config create mode 100644 arch/mips/generic/board-ocelot.c
Signature · 1 line
2.16.2
Alexandre Belloni
maintainerPATCH v5 1/5 dt-bindings: mips: Add bindings for Microsemi SoCs
Add bindings for Microsemi SoCs. Currently only Ocelot is supported.
--- Documentation/devicetree/bindings/mips/mscc.txt | 43 +++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Documentation/devicetree/bindings/mips/mscc.txt
Documentation/devicetree/bindings/mips/mscc.txt new file +43 -0
@@ -0,0 +1,43 @@ +* Microsemi MIPS CPUs + +Boards with a SoC of the Microsemi MIPS family shall have the following +properties: + +Required properties: +- compatible: "mscc,ocelot" + + +* Other peripherals: + +o CPU chip regs: + +The SoC has a few registers (DEVCPU_GCB:CHIP_REGS) handling miscellaneous +functionalities: chip ID, general purpose register for software use, reset +controller, hardware status and configuration, efuses. + +Required properties: +- compatible: Should be "mscc,ocelot-chip-regs", "simple-mfd", "syscon" +- reg : Should contain registers location and length + +Example: + syscon@71070000 { + compatible = "mscc,ocelot-chip-regs", "simple-mfd", "syscon"; + reg = <0x71070000 0x1c>; + }; + + +o CPU system control: + +The SoC has a few registers (ICPU_CFG:CPU_SYSTEM_CTRL) handling configuration of +the CPU: 8 general purpose registers, reset control, CPU en/disabling, CPU +endianness, CPU bus control, CPU status. + +Required properties: +- compatible: Should be "mscc,ocelot-cpu-syscon", "syscon" +- reg : Should contain registers location and length + +Example: + syscon@70000000 { + compatible = "mscc,ocelot-cpu-syscon", "syscon"; + reg = <0x70000000 0x2c>; + };
Signature · 1 line
2.16.2
Alexandre Belloni
maintainerPATCH v5 4/5 MIPS: generic: Add support for Microsemi Ocelot
In reply to Alexandre BelloniIntroduce support for the MIPS based Microsemi Ocelot SoCs.
--- arch/mips/Makefile | 4 ++ arch/mips/configs/generic/board-ocelot.config | 36 ++++++++++++++ arch/mips/generic/Kconfig | 16 +++++++ arch/mips/generic/Makefile | 1 + arch/mips/generic/board-ocelot.c | 67 +++++++++++++++++++++++++++ 5 files changed, 124 insertions(+) create mode 100644 arch/mips/configs/generic/board-ocelot.config create mode 100644 arch/mips/generic/board-ocelot.c
arch/mips/Makefile +4 -0
@@ -543,6 +543,10 @@ generic_defconfig: # now that the boards have been converted to use the generic kernel they are # wrappers around the generic rules above. # +.PHONY: ocelot_defconfig +ocelot_defconfig: + $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=ocelot + .PHONY: sead3_defconfig sead3_defconfig: $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=sead-3
arch/mips/configs/generic/board-ocelot.config new file +36 -0
@@ -0,0 +1,36 @@ +# require CONFIG_32BIT=y +# require CONFIG_CPU_MIPS32_R2=y + +CONFIG_LEGACY_BOARD_OCELOT=y + +CONFIG_MTD=y +CONFIG_MTD_CMDLINE_PARTS=y +CONFIG_MTD_BLOCK=y +CONFIG_MTD_M25P80=y +CONFIG_MTD_NAND=y +CONFIG_MTD_NAND_PLATFORM=y +CONFIG_MTD_SPI_NOR=y +CONFIG_MTD_UBI=y + +CONFIG_BLK_DEV_LOOP=y +CONFIG_BLK_DEV_RAM=y + +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y + +CONFIG_GPIO_SYSFS=y + +CONFIG_I2C=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_MUX=y + +CONFIG_SPI=y +CONFIG_SPI_BITBANG=y +CONFIG_SPI_DESIGNWARE=y +CONFIG_SPI_SPIDEV=y + +CONFIG_POWER_RESET=y +CONFIG_POWER_RESET_OCELOT_RESET=y + +CONFIG_MAGIC_SYSRQ=y
arch/mips/generic/Kconfig +16 -0
@@ -27,6 +27,22 @@ config LEGACY_BOARD_SEAD3 Enable this to include support for booting on MIPS SEAD-3 FPGA-based development boards, which boot using a legacy boot protocol. +comment "MSCC Ocelot doesn't work with SEAD3 enabled" + depends on LEGACY_BOARD_SEAD3 + +config LEGACY_BOARD_OCELOT + bool "Support MSCC Ocelot boards" + depends on LEGACY_BOARD_SEAD3=n + select LEGACY_BOARDS + select MSCC_OCELOT + +config MSCC_OCELOT + bool + select GPIOLIB + select MSCC_OCELOT_IRQ + select SYS_HAS_EARLY_PRINTK + select USE_GENERIC_EARLY_PRINTK_8250 + comment "FIT/UHI Boards" config FIT_IMAGE_FDT_BOSTON
arch/mips/generic/Makefile +1 -0
@@ -14,5 +14,6 @@ obj-y += proc.o obj-$(CONFIG_YAMON_DT_SHIM) += yamon-dt.o obj-$(CONFIG_LEGACY_BOARD_SEAD3) += board-sead3.o +obj-$(CONFIG_LEGACY_BOARD_OCELOT) += board-ocelot.o obj-$(CONFIG_KEXEC) += kexec.o obj-$(CONFIG_VIRT_BOARD_RANCHU) += board-ranchu.o
arch/mips/generic/board-ocelot.c new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
2.16.2
Alexandre Belloni
maintainerPATCH v5 5/5 MAINTAINERS: Add entry for Microsemi MIPS SoCs
In reply to Alexandre BelloniAdd myself as a maintainer for the Microsemi MIPS SoCs.
--- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
@@ -9156,6 +9156,15 @@ S: Maintained F: drivers/usb/misc/usb251xb.c F: Documentation/devicetree/bindings/usb/usb251xb.txt +MICROSEMI MIPS SOCS +M: Alexandre Belloni <[email protected]> +L: [email protected] +S: Maintained +F: arch/mips/generic/board-ocelot.c +F: arch/mips/configs/generic/board-ocelot.config +F: arch/mips/boot/dts/mscc/ +F: Documentation/devicetree/bindings/mips/mscc.txt + MICROSEMI SMART ARRAY SMARTPQI DRIVER (smartpqi) M: Don Brace <[email protected]> L: [email protected]
Signature · 1 line
2.16.2
Re: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi
In reply to Alexandre Belloniarch/mips/boot/dts/mscc/ocelot.dtsi line 1
Quoted 7 lines · Alexandre Belloni
arch/mips/boot/dts/mscc/ocelot.dtsi new file +1
-0@@ -0,0 +1,117 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT)
Niggle: there should be a space after // for consistency with other files. Same in patch 3.
Cheers
James
Alexandre Belloni
maintainerRe: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi
Quoted 12 lines · James Hogan
arch/mips/boot/dts/mscc/ocelot.dtsi line 1
Quoted 7 lines · Alexandre Belloni
arch/mips/boot/dts/mscc/ocelot.dtsi new file +1
-0@@ -0,0 +1,117 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT)Niggle: there should be a space after // for consistency with other files. Same in patch 3.
Ah, yes...
If that is the only thing left, I can resend right away
Signature · 3 lines
Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH v5 4/5] MIPS: generic: Add support for Microsemi Ocelot
In reply to Alexandre Belloniarch/mips/Makefile generic_defconfig: · line 548
Quoted 11 lines · Alexandre Belloni
arch/mips/Makefile +3
-0@@ -543,6 +543,10 @@ generic_defconfig: # now that the boards have been converted to use the generic kernel they are # wrappers around the generic rules above. # +.PHONY: ocelot_defconfig +ocelot_defconfig: + $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=ocelot
FYI this conflicts with https://patchwork.linux-mips.org/patch/18596/,
but can be trivially fixed up when applied to the following, so no need for you to rebase:
arch/mips/Makefile +3 -0
@@ -565,6 +565,9 @@ generic_defconfig: # now that the boards have been converted to use the generic kernel they are # wrappers around the generic rules above. # +legacy_defconfigs += ocelot_defconfig +ocelot_defconfig-y := 32r2el_defconfig BOARDS=ocelot + legacy_defconfigs += sead3_defconfig sead3_defconfig-y := 32r2el_defconfig BOARDS=sead-3
arch/mips/configs/generic/board-ocelot.config line 1
Quoted 11 lines
arch/mips/Makefile +1
-0+ .PHONY: sead3_defconfig sead3_defconfig: $(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=sead-3arch/mips/configs/generic/board-ocelot.config new file +1
-0@@ -0,0 +1,36 @@ +# require CONFIG_32BIT=y
That should be implied now by CPU_SUPPORTS_64BIT_KERNEL=n since CONFIG_CPU_MIPS32_R2=y.
arch/mips/configs/generic/board-ocelot.config
Quoted 7 lines
arch/mips/configs/generic/board-ocelot.config new file +6
-0+# require CONFIG_CPU_MIPS32_R2=y +static __init bool ocelot_detect(void) +{ + u32 rev; + + rev = __raw_readl((void *)DEVCPU_GCB_CHIP_REGS_CHIP_ID);
How about a TLB check first, a bit like _kvm_mips_host_tlb_inv() in arch/mips/kvm/tlb.c, i.e.:
int idx; /* Look for the TLB entry set up by redboot before trying to use it */ write_c0_entryhi(DEVCPU_GCB_CHIP_REGS_CHIP_ID); mtc0_tlbw_hazard(); tlb_probe(); tlb_probe_hazard(); idx = read_c0_index(); if (idx < 0) return 0; /* A TLB entry exists, lets assume its usable and check the CHIP ID */ rev = __raw_readl((void __iomem *)DEVCPU_GCB_CHIP_REGS_CHIP_ID);
(That assumes that if a TLB entry exists that it will be usable, which isn't technically complete since the entry may not be marked valid, but its probably sufficient in practice).
Incidentally you need to use __iomem there to avoid the following sparse error:
arch/mips/generic/board-ocelot.c:21:28: warning: incorrect type in argument 1 (different address spaces)arch/mips/generic/board-ocelot.c:21:28: expected void const volatile [noderef] <asn:2>*memarch/mips/generic/board-ocelot.c:21:28: got void *<noident>
Cheers
James
Re: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi
In reply to Alexandre BelloniQuoted 14 lines · Alexandre Belloni
Quoted 12 lines · James Hogan
arch/mips/boot/dts/mscc/ocelot.dtsi line 1
Quoted 7 lines · Alexandre Belloni
arch/mips/boot/dts/mscc/ocelot.dtsi new file +1
-0@@ -0,0 +1,117 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT)Niggle: there should be a space after // for consistency with other files. Same in patch 3.
Quoted 3 lines
Ah, yes...
If that is the only thing left, I can resend right away
There are a couple of irqchip patches from v2 which have gone from the latest versions:
https://patchwork.linux-mips.org/project/linux-mips/list/?series=568
and the vendor prefix too from v4:
https://patchwork.linux-mips.org/project/linux-mips/list/?series=856
I presume they're all still relevant. Were you expecting the irqchip ones to go through MIPS too? We'd need an ack from the irqchip folk if so.
Cheers
James
Alexandre Belloni
maintainerRe: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi
Quoted 15 lines · James Hogan
Quoted 14 lines · Alexandre Belloni
Quoted 12 lines · James Hogan
arch/mips/boot/dts/mscc/ocelot.dtsi line 1
Quoted 7 lines · Alexandre Belloni
arch/mips/boot/dts/mscc/ocelot.dtsi new file +1
-0@@ -0,0 +1,117 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT)Niggle: there should be a space after // for consistency with other files. Same in patch 3.
Quoted 8 lines
Quoted 3 lines
Ah, yes...
If that is the only thing left, I can resend right away
There are a couple of irqchip patches from v2 which have gone from the latest versions:
https://patchwork.linux-mips.org/project/linux-mips/list/?series=568
I'll get those through the irqchip tree.
Quoted 3 lines
and the vendor prefix too from v4:
https://patchwork.linux-mips.org/project/linux-mips/list/?series=856
My mistake, I prepared my series from that patch, excluded instead of from that patch, included.
Quoted 6 lines
I presume they're all still relevant. Were you expecting the irqchip ones to go through MIPS too? We'd need an ack from the irqchip folk if so.
Cheers
James
Signature · 3 lines
Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Re: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi
In reply to Alexandre BelloniQuoted 53 lines · Alexandre Belloni
Add a device tree include file for the Microsemi Ocelot SoC.
Cc Rob Herring <[email protected]>Signed-off-by Alexandre Belloni <[email protected]>--- arch/mips/boot/dts/Makefile | 1 + arch/mips/boot/dts/mscc/Makefile | 1 + arch/mips/boot/dts/mscc/ocelot.dtsi | 117 ++++++++++++++++++++++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 arch/mips/boot/dts/mscc/Makefile create mode 100644 arch/mips/boot/dts/mscc/ocelot.dtsiarch/mips/boot/dts/Makefile +1
-0@@ -4,6 +4,7 @@ subdir-y += cavium-octeon subdir-y += img subdir-y += ingenic subdir-y += lantiq +subdir-y += mscc subdir-y += mti subdir-y += netlogic subdir-y += niarch/mips/boot/dts/mscc/Makefile new file +1
-0@@ -0,0 +1 @@ +obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))arch/mips/boot/dts/mscc/ocelot.dtsi new file +15
-0@@ -0,0 +1,117 @@ +//SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2017 Microsemi Corporation */ + +/ { + #address-cells = <1>; + #size-cells = <1>; + compatible = "mscc,ocelot"; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "mips,mips24KEc"; + device_type = "cpu";
arch/mips/boot/dts/mscc/ocelot.dtsi line 25
Quoted 10 lines
arch/mips/boot/dts/mscc/ocelot.dtsi new file +10
-0+ clocks = <&cpu_clk>; + reg = <0>; + }; + }; + + aliases { + serial0 = &uart0; + }; + + cpuintc: interrupt-controller@0 {
Please compile with W=1 and fix any issues like this one which is a unit-address without a reg property. Drop the unit-address.
Quoted 4 lines
arch/mips/boot/dts/mscc/ocelot.dtsi new file +4
-0+ #address-cells = <0>; + #interrupt-cells = <1>; + interrupt-controller; + compatible = "mti,cpu-interrupt-controller";
MIPS DT W=1 warnings (was Re: [PATCH v5 2/5] MIPS: mscc: add ocelot dtsi)
Hi Rob,
Quoted 2 lines · Rob Herring
Please compile with W=1 and fix any issues like this one which is a unit-address without a reg property. Drop the unit-address.
I was just giving the BMIPS W=1 DT warnings a look, and a few look spurious. I'd value your opinion on their legitimacy (its hard to care about W=1 if spurious or seemingly pedantic warnings are going to be common). e.g.
1)arch/mips/boot/dts/brcm/bcm9ejtagprb.dtb: Warning (unit_address_vs_reg): Node /ubus/syscon-reboot@10000068 has a unit name, but no reg property
due to:
periph_cntl: syscon@fff8c000 {
compatible = "syscon";
reg = <0xfff8c000 0xc>;
native-endian;
};reboot: syscon-reboot@fff8c008 {
compatible = "syscon-reboot";
regmap = <&periph_cntl>;
offset = <0x8>;
mask = <0x1>;
};That doesn't seem to take regmap into account. Would you strictly drop the unit-address in this case, or is there a way the DT compiler can be fixed (i presume offset and mask are binding specific, so the best it could do is probably to allow the unit-address due to the regmap without checking the actual address)?
2)arch/mips/boot/dts/brcm/bcm9ejtagprb.dtb: Warning (simple_bus_reg): Node /ubus/syscon-reboot@10000068 missing or empty reg/ranges property
Same code as above. Should syscon-reboot be outside of the simple-bus that both nodes are in, or is it fine there? There's a similar warning from a DTS which has a syscon property instead of regmap.
3)arch/mips/boot/dts/brcm/bcm97425svmb.dtb: Warning (simple_bus_reg): Node /rdb@10000000/spi@41c000 simple-bus unit address format error, expected "419920"
qspi: spi@41c000 {
#address-cells = <0x1>;
#size-cells = <0x0>;
compatible = "brcm,spi-bcm-qspi",
"brcm,spi-brcmstb-qspi";
clocks = <&upg_clk>;
reg = <0x419920 0x4 0x41c200 0x188 0x41c000 0x50>;
reg-names = "cs_reg", "hif_mspi", "bspi";
...Well 41c000 is one of the reg entries, just not the first. I presume bspi is the "main" one, perhaps that should come first since we have reg-names, but even that could potentially confuse driver code if it didn't find reg resources by name (in this case it does appear to, so perhaps that would fine)?
Thanks
James