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

MIPS: mscc: Add serval support

Add a device trees and FIT image support for the Microsemi Serval SoC
which belongs to same family of the Ocelot SoC.

It is based on the work of Lars Povlsen <lars.povlsen@microchip.com>.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>

authored by

Gregory CLEMENT and committed by
Thomas Bogendoerfer
fe005201 f84778f7

+351 -1
+4 -1
arch/mips/boot/dts/mscc/Makefile
··· 5 5 jaguar2_pcb118.dtb \ 6 6 luton_pcb091.dtb \ 7 7 ocelot_pcb120.dtb \ 8 - ocelot_pcb123.dtb 8 + ocelot_pcb123.dtb \ 9 + serval_pcb105.dtb \ 10 + serval_pcb106.dtb 11 + 9 12 10 13 obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
+153
arch/mips/boot/dts/mscc/serval.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 + /* 3 + * Copyright (c) 2018 Microsemi Corporation 4 + */ 5 + 6 + / { 7 + #address-cells = <1>; 8 + #size-cells = <1>; 9 + compatible = "mscc,serval"; 10 + 11 + cpus { 12 + #address-cells = <1>; 13 + #size-cells = <0>; 14 + 15 + cpu@0 { 16 + compatible = "mips,mips24KEc"; 17 + device_type = "cpu"; 18 + clocks = <&cpu_clk>; 19 + reg = <0>; 20 + }; 21 + }; 22 + 23 + aliases { 24 + serial0 = &uart0; 25 + gpio0 = &gpio; 26 + }; 27 + 28 + cpuintc: interrupt-controller { 29 + #address-cells = <0>; 30 + #interrupt-cells = <1>; 31 + interrupt-controller; 32 + compatible = "mti,cpu-interrupt-controller"; 33 + }; 34 + 35 + cpu_clk: cpu-clock { 36 + compatible = "fixed-clock"; 37 + #clock-cells = <0>; 38 + clock-frequency = <416666666>; 39 + }; 40 + 41 + ahb_clk: ahb-clk { 42 + compatible = "fixed-factor-clock"; 43 + #clock-cells = <0>; 44 + clocks = <&cpu_clk>; 45 + clock-div = <2>; 46 + clock-mult = <1>; 47 + }; 48 + 49 + ahb: ahb { 50 + compatible = "simple-bus"; 51 + #address-cells = <1>; 52 + #size-cells = <1>; 53 + ranges; 54 + 55 + interrupt-parent = <&intc>; 56 + 57 + cpu_ctrl: syscon@70000000 { 58 + compatible = "mscc,ocelot-cpu-syscon", "syscon"; 59 + reg = <0x70000000 0x2c>; 60 + }; 61 + 62 + intc: interrupt-controller@70000070 { 63 + compatible = "mscc,serval-icpu-intr"; 64 + reg = <0x70000070 0x70>; 65 + #interrupt-cells = <1>; 66 + interrupt-controller; 67 + interrupt-parent = <&cpuintc>; 68 + interrupts = <2>; 69 + }; 70 + 71 + uart0: serial@70100000 { 72 + pinctrl-0 = <&uart_pins>; 73 + pinctrl-names = "default"; 74 + compatible = "ns16550a"; 75 + reg = <0x70100000 0x20>; 76 + interrupts = <6>; 77 + clocks = <&ahb_clk>; 78 + reg-io-width = <4>; 79 + reg-shift = <2>; 80 + 81 + status = "disabled"; 82 + }; 83 + 84 + uart2: serial@70100800 { 85 + pinctrl-0 = <&uart2_pins>; 86 + pinctrl-names = "default"; 87 + compatible = "ns16550a"; 88 + reg = <0x70100800 0x20>; 89 + interrupts = <7>; 90 + clocks = <&ahb_clk>; 91 + reg-io-width = <4>; 92 + reg-shift = <2>; 93 + 94 + status = "disabled"; 95 + }; 96 + 97 + gpio: pinctrl@71070034 { 98 + compatible = "mscc,serval-pinctrl"; 99 + reg = <0x71070034 0x28>; 100 + gpio-controller; 101 + #gpio-cells = <2>; 102 + gpio-ranges = <&gpio 0 0 22>; 103 + 104 + sgpio_pins: sgpio-pins { 105 + pins = "GPIO_0", "GPIO_2", "GPIO_3", "GPIO_1"; 106 + function = "sg0"; 107 + }; 108 + 109 + i2c_pins: i2c-pins { 110 + pins = "GPIO_6", "GPIO_7"; 111 + function = "twi"; 112 + }; 113 + 114 + uart_pins: uart-pins { 115 + pins = "GPIO_26", "GPIO_27"; 116 + function = "uart"; 117 + }; 118 + 119 + uart2_pins: uart2-pins { 120 + pins = "GPIO_13", "GPIO_14"; 121 + function = "uart2"; 122 + }; 123 + 124 + cs1_pins: cs1-pins { 125 + pins = "GPIO_8"; 126 + function = "si"; 127 + }; 128 + 129 + irqext0_pins: irqext0-pins { 130 + pins = "GPIO_28"; 131 + function = "irq0"; 132 + }; 133 + 134 + irqext1_pins: irqext1-pins { 135 + pins = "GPIO_29"; 136 + function = "irq1"; 137 + }; 138 + }; 139 + 140 + i2c0: i2c@70100400 { 141 + compatible = "mscc,ocelot-i2c", "snps,designware-i2c"; 142 + status = "disabled"; 143 + pinctrl-0 = <&i2c_pins>; 144 + pinctrl-names = "default"; 145 + reg = <0x70100400 0x100>, <0x70000190 0x8>; 146 + #address-cells = <1>; 147 + #size-cells = <0>; 148 + interrupts = <8>; 149 + clock-frequency = <100000>; 150 + clocks = <&ahb_clk>; 151 + }; 152 + }; 153 + };
+127
arch/mips/boot/dts/mscc/serval_common.dtsi
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 + /* 3 + * Copyright (c) 2020 Microsemi Corporation 4 + */ 5 + 6 + #include "serval.dtsi" 7 + 8 + / { 9 + aliases { 10 + serial0 = &uart0; 11 + i2c104 = &i2c104; 12 + i2c105 = &i2c105; 13 + i2c106 = &i2c106; 14 + i2c107 = &i2c107; 15 + i2c108 = &i2c108; 16 + i2c109 = &i2c109; 17 + }; 18 + 19 + chosen { 20 + stdout-path = "serial0:115200n8"; 21 + }; 22 + 23 + i2c0_imux: i2c0-imux{ 24 + compatible = "i2c-mux-pinctrl"; 25 + #address-cells = <1>; 26 + #size-cells = <0>; 27 + i2c-parent = <&i2c0>; 28 + pinctrl-names = 29 + "i2c104", "i2c105", "i2c106", "i2c107", 30 + "i2c108", "i2c109", "idle"; 31 + pinctrl-0 = <&i2cmux_0>; 32 + pinctrl-1 = <&i2cmux_1>; 33 + pinctrl-2 = <&i2cmux_2>; 34 + pinctrl-3 = <&i2cmux_3>; 35 + pinctrl-4 = <&i2cmux_4>; 36 + pinctrl-5 = <&i2cmux_5>; 37 + pinctrl-6 = <&i2cmux_pins_i>; 38 + i2c104: i2c_sfp0@0 { 39 + reg = <0>; 40 + #address-cells = <1>; 41 + #size-cells = <0>; 42 + }; 43 + i2c105: i2c_sfp1@1 { 44 + reg = <1>; 45 + #address-cells = <1>; 46 + #size-cells = <0>; 47 + }; 48 + i2c106: i2c_sfp2@2 { 49 + reg = <2>; 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + }; 53 + i2c107: i2c_sfp3@3 { 54 + reg = <3>; 55 + #address-cells = <1>; 56 + #size-cells = <0>; 57 + }; 58 + i2c108: i2c_sfp4@4 { 59 + reg = <4>; 60 + #address-cells = <1>; 61 + #size-cells = <0>; 62 + }; 63 + i2c109: i2c_sfp5@5 { 64 + reg = <5>; 65 + #address-cells = <1>; 66 + #size-cells = <0>; 67 + }; 68 + }; 69 + 70 + }; 71 + 72 + &uart0 { 73 + status = "okay"; 74 + }; 75 + 76 + &uart2 { 77 + status = "okay"; 78 + }; 79 + 80 + &gpio { 81 + i2c_pins: i2c-pins { 82 + pins = "GPIO_7"; /* No "default" scl for i2c0 */ 83 + function = "twi"; 84 + }; 85 + i2cmux_pins_i: i2cmux-pins-i { 86 + pins = "GPIO_11", "GPIO_12", "GPIO_18", "GPIO_19", 87 + "GPIO_20", "GPIO_21"; 88 + function = "twi_scl_m"; 89 + output-low; 90 + }; 91 + i2cmux_0: i2cmux-0 { 92 + pins = "GPIO_11"; 93 + function = "twi_scl_m"; 94 + output-high; 95 + }; 96 + i2cmux_1: i2cmux-1 { 97 + pins = "GPIO_12"; 98 + function = "twi_scl_m"; 99 + output-high; 100 + }; 101 + i2cmux_2: i2cmux-2 { 102 + pins = "GPIO_18"; 103 + function = "twi_scl_m"; 104 + output-high; 105 + }; 106 + i2cmux_3: i2cmux-3 { 107 + pins = "GPIO_19"; 108 + function = "twi_scl_m"; 109 + output-high; 110 + }; 111 + i2cmux_4: i2cmux-4 { 112 + pins = "GPIO_20"; 113 + function = "twi_scl_m"; 114 + output-high; 115 + }; 116 + i2cmux_5: i2cmux-5 { 117 + pins = "GPIO_21"; 118 + function = "twi_scl_m"; 119 + output-high; 120 + }; 121 + }; 122 + 123 + &i2c0 { 124 + status = "okay"; 125 + i2c-sda-hold-time-ns = <300>; 126 + }; 127 +
+17
arch/mips/boot/dts/mscc/serval_pcb105.dts
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 + /* 3 + * Copyright (c) 2018 Microsemi Corporation 4 + */ 5 + 6 + /dts-v1/; 7 + #include "serval_common.dtsi" 8 + 9 + / { 10 + model = "Serval PCB105 Reference Board"; 11 + compatible = "mscc,serval-pcb105", "mscc,serval"; 12 + 13 + aliases { 14 + }; 15 + 16 + }; 17 +
+17
arch/mips/boot/dts/mscc/serval_pcb106.dts
··· 1 + // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 + /* 3 + * Copyright (c) 2018 Microsemi Corporation 4 + */ 5 + 6 + /dts-v1/; 7 + #include "serval_common.dtsi" 8 + 9 + / { 10 + model = "Serval PCB106 Reference Board"; 11 + compatible = "mscc,serval-pcb106", "mscc,serval"; 12 + 13 + aliases { 14 + }; 15 + 16 + }; 17 +
+8
arch/mips/generic/Kconfig
··· 94 94 from Microsemi in the FIT kernel image. 95 95 This requires u-boot on the platform. 96 96 97 + config FIT_IMAGE_FDT_SERVAL 98 + bool "Include FDT for Microsemi Serval development platforms" 99 + select SOC_VCOREIII 100 + help 101 + Enable this to include the FDT for the Serval development platforms 102 + from Microsemi in the FIT kernel image. 103 + This requires u-boot on the platform. 104 + 97 105 config BOARD_INGENIC 98 106 bool "Support boards based on Ingenic SoCs" 99 107 select MACH_INGENIC_GENERIC
+1
arch/mips/generic/Platform
··· 22 22 its-$(CONFIG_FIT_IMAGE_FDT_OCELOT) += board-ocelot.its.S 23 23 its-$(CONFIG_FIT_IMAGE_FDT_LUTON) += board-luton.its.S 24 24 its-$(CONFIG_FIT_IMAGE_FDT_JAGUAR2) += board-jaguar2.its.S 25 + its-$(CONFIG_FIT_IMAGE_FDT_SERVAL) += board-serval.its.S 25 26 its-$(CONFIG_FIT_IMAGE_FDT_XILFPGA) += board-xilfpga.its.S
+24
arch/mips/generic/board-serval.its.S
··· 1 + /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */ 2 + / { 3 + images { 4 + fdt@serval_pcb105 { 5 + description = "MSCC Serval PCB105 Device Tree"; 6 + data = /incbin/("boot/dts/mscc/serval_pcb105.dtb"); 7 + type = "flat_dt"; 8 + arch = "mips"; 9 + compression = "none"; 10 + hash@0 { 11 + algo = "sha1"; 12 + }; 13 + }; 14 + }; 15 + 16 + configurations { 17 + pcb105 { 18 + description = "Serval Linux kernel"; 19 + kernel = "kernel@0"; 20 + fdt = "fdt@serval_pcb105"; 21 + ramdisk = "ramdisk"; 22 + }; 23 + }; 24 + };