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

MIPS: Netlogic: Support for multiple built-in device trees

This enables us to have a default device tree per SoC family to be built
into the kernel. The default device tree for XLP3xx has been added as part
of this change. Later this can be used to provide support default boards
for XLP2xx and XLP9xx SoCs.

Kconfig options are provided for each default device tree so that just the
needed ones can be selected to be built into the kernel.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Patchwork: http://patchwork.linux-mips.org/patch/5023/
Acked-by: John Crispin <blogic@openwrt.org>

authored by

Jayachandran C and committed by
Ralf Baechle
035114fb 033e6f28

+158 -8
+13 -4
arch/mips/netlogic/Kconfig
··· 2 2 3 3 if NLM_XLP_BOARD 4 4 config DT_XLP_EVP 5 - bool "Built-in device tree for XLP EVP/SVP boards" 5 + bool "Built-in device tree for XLP EVP boards" 6 6 default y 7 7 help 8 - Add an FDT blob for XLP EVP and SVP boards into the kernel. 8 + Add an FDT blob for XLP EVP boards into the kernel. 9 9 This DTB will be used if the firmware does not pass in a DTB 10 - pointer to the kernel. The corresponding DTS file is at 11 - arch/mips/netlogic/dts/xlp_evp.dts 10 + pointer to the kernel. The corresponding DTS file is at 11 + arch/mips/netlogic/dts/xlp_evp.dts 12 + 13 + config DT_XLP_SVP 14 + bool "Built-in device tree for XLP SVP boards" 15 + default y 16 + help 17 + Add an FDT blob for XLP VP boards into the kernel. 18 + This DTB will be used if the firmware does not pass in a DTB 19 + pointer to the kernel. The corresponding DTS file is at 20 + arch/mips/netlogic/dts/xlp_svp.dts 12 21 13 22 config NLM_MULTINODE 14 23 bool "Support for multi-chip boards"
+1
arch/mips/netlogic/dts/Makefile
··· 1 1 obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o 2 + obj-$(CONFIG_DT_XLP_SVP) += xlp_svp.dtb.o
+1 -1
arch/mips/netlogic/dts/xlp_evp.dts
··· 20 20 #address-cells = <2>; 21 21 #size-cells = <1>; 22 22 compatible = "simple-bus"; 23 - ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 23 + ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 24 24 1 0 0 0x16000000 0x01000000>; // GBU chipselects 25 25 26 26 serial0: serial@30000 {
+124
arch/mips/netlogic/dts/xlp_svp.dts
··· 1 + /* 2 + * XLP3XX Device Tree Source for SVP boards 3 + */ 4 + 5 + /dts-v1/; 6 + / { 7 + model = "netlogic,XLP-SVP"; 8 + compatible = "netlogic,xlp"; 9 + #address-cells = <2>; 10 + #size-cells = <2>; 11 + 12 + memory { 13 + device_type = "memory"; 14 + reg = <0 0x00100000 0 0x0FF00000 // 255M at 1M 15 + 0 0x20000000 0 0xa0000000 // 2560M at 512M 16 + 0 0xe0000000 0 0x40000000>; 17 + }; 18 + 19 + soc { 20 + #address-cells = <2>; 21 + #size-cells = <1>; 22 + compatible = "simple-bus"; 23 + ranges = <0 0 0 0x18000000 0x04000000 // PCIe CFG 24 + 1 0 0 0x16000000 0x01000000>; // GBU chipselects 25 + 26 + serial0: serial@30000 { 27 + device_type = "serial"; 28 + compatible = "ns16550"; 29 + reg = <0 0x30100 0xa00>; 30 + reg-shift = <2>; 31 + reg-io-width = <4>; 32 + clock-frequency = <133333333>; 33 + interrupt-parent = <&pic>; 34 + interrupts = <17>; 35 + }; 36 + serial1: serial@31000 { 37 + device_type = "serial"; 38 + compatible = "ns16550"; 39 + reg = <0 0x31100 0xa00>; 40 + reg-shift = <2>; 41 + reg-io-width = <4>; 42 + clock-frequency = <133333333>; 43 + interrupt-parent = <&pic>; 44 + interrupts = <18>; 45 + }; 46 + i2c0: ocores@32000 { 47 + compatible = "opencores,i2c-ocores"; 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + reg = <0 0x32100 0xa00>; 51 + reg-shift = <2>; 52 + reg-io-width = <4>; 53 + clock-frequency = <32000000>; 54 + interrupt-parent = <&pic>; 55 + interrupts = <30>; 56 + }; 57 + i2c1: ocores@33000 { 58 + compatible = "opencores,i2c-ocores"; 59 + #address-cells = <1>; 60 + #size-cells = <0>; 61 + reg = <0 0x33100 0xa00>; 62 + reg-shift = <2>; 63 + reg-io-width = <4>; 64 + clock-frequency = <32000000>; 65 + interrupt-parent = <&pic>; 66 + interrupts = <31>; 67 + 68 + rtc@68 { 69 + compatible = "dallas,ds1374"; 70 + reg = <0x68>; 71 + }; 72 + 73 + dtt@4c { 74 + compatible = "national,lm90"; 75 + reg = <0x4c>; 76 + }; 77 + }; 78 + pic: pic@4000 { 79 + interrupt-controller; 80 + #address-cells = <0>; 81 + #interrupt-cells = <1>; 82 + reg = <0 0x4000 0x200>; 83 + }; 84 + 85 + nor_flash@1,0 { 86 + compatible = "cfi-flash"; 87 + #address-cells = <1>; 88 + #size-cells = <1>; 89 + bank-width = <2>; 90 + reg = <1 0 0x1000000>; 91 + 92 + partition@0 { 93 + label = "x-loader"; 94 + reg = <0x0 0x100000>; /* 1M */ 95 + read-only; 96 + }; 97 + 98 + partition@100000 { 99 + label = "u-boot"; 100 + reg = <0x100000 0x100000>; /* 1M */ 101 + }; 102 + 103 + partition@200000 { 104 + label = "kernel"; 105 + reg = <0x200000 0x500000>; /* 5M */ 106 + }; 107 + 108 + partition@700000 { 109 + label = "rootfs"; 110 + reg = <0x700000 0x800000>; /* 8M */ 111 + }; 112 + 113 + partition@f00000 { 114 + label = "env"; 115 + reg = <0xf00000 0x100000>; /* 1M */ 116 + read-only; 117 + }; 118 + }; 119 + }; 120 + 121 + chosen { 122 + bootargs = "console=ttyS0,115200 rdinit=/sbin/init"; 123 + }; 124 + };
+19 -3
arch/mips/netlogic/xlp/setup.c
··· 56 56 struct nlm_soc_info nlm_nodes[NLM_NR_NODES]; 57 57 cpumask_t nlm_cpumask = CPU_MASK_CPU0; 58 58 unsigned int nlm_threads_per_core; 59 - extern u32 __dtb_start[]; 59 + extern u32 __dtb_xlp_evp_begin[], __dtb_xlp_svp_begin[], __dtb_start[]; 60 60 61 61 static void nlm_linux_exit(void) 62 62 { ··· 82 82 * 64-bit, so convert pointer. 83 83 */ 84 84 fdtp = (void *)(long)fw_arg0; 85 - if (!fdtp) 86 - fdtp = __dtb_start; 85 + if (!fdtp) { 86 + switch (current_cpu_data.processor_id & 0xff00) { 87 + #ifdef CONFIG_DT_XLP_SVP 88 + case PRID_IMP_NETLOGIC_XLP3XX: 89 + fdtp = __dtb_xlp_svp_begin; 90 + break; 91 + #endif 92 + #ifdef CONFIG_DT_XLP_EVP 93 + case PRID_IMP_NETLOGIC_XLP8XX: 94 + fdtp = __dtb_xlp_evp_begin; 95 + break; 96 + #endif 97 + default: 98 + /* Pick a built-in if any, and hope for the best */ 99 + fdtp = __dtb_start; 100 + break; 101 + } 102 + } 87 103 fdtp = phys_to_virt(__pa(fdtp)); 88 104 early_init_devtree(fdtp); 89 105 }