diff options
author | Jayachandran C <jayachandranc@netlogicmicro.com> | 2012-07-13 12:23:22 -0400 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2012-08-22 17:46:37 -0400 |
commit | 2f6528e15a4592c762a690c1320518368593ae75 (patch) | |
tree | 6fd1aafd2586875f2905398a1e0ab8f5c571142a /arch/mips/netlogic | |
parent | a9f16821205d7561bf9d622855e1aa95e5c77f0c (diff) |
MIPS: Netlogic: Add support for built in DTB
Provide a config option to embed a device tree for XLP evaluation
boards. This DTB will be used if the firmware does not pass in a
device tree pointer.
Signed-off-by: Jayachandran C <jayachandranc@netlogicmicro.com>
Patchwork: http://patchwork.linux-mips.org/patch/4103/
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r-- | arch/mips/netlogic/Kconfig | 15 | ||||
-rw-r--r-- | arch/mips/netlogic/Makefile | 1 | ||||
-rw-r--r-- | arch/mips/netlogic/dts/Makefile | 4 | ||||
-rw-r--r-- | arch/mips/netlogic/xlp/setup.c | 12 |
4 files changed, 31 insertions, 1 deletions
diff --git a/arch/mips/netlogic/Kconfig b/arch/mips/netlogic/Kconfig index 75bec44b5856..8059eb76f8eb 100644 --- a/arch/mips/netlogic/Kconfig +++ b/arch/mips/netlogic/Kconfig | |||
@@ -1,2 +1,17 @@ | |||
1 | if NLM_XLP_BOARD || NLM_XLR_BOARD | ||
2 | |||
3 | if NLM_XLP_BOARD | ||
4 | config DT_XLP_EVP | ||
5 | bool "Built-in device tree for XLP EVP/SVP boards" | ||
6 | default y | ||
7 | help | ||
8 | Add an FDT blob for XLP EVP and SVP boards into the kernel. | ||
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 | ||
12 | endif | ||
13 | |||
1 | config NLM_COMMON | 14 | config NLM_COMMON |
2 | bool | 15 | bool |
16 | |||
17 | endif | ||
diff --git a/arch/mips/netlogic/Makefile b/arch/mips/netlogic/Makefile index 36d169b2ca6d..7602d1386614 100644 --- a/arch/mips/netlogic/Makefile +++ b/arch/mips/netlogic/Makefile | |||
@@ -1,3 +1,4 @@ | |||
1 | obj-$(CONFIG_NLM_COMMON) += common/ | 1 | obj-$(CONFIG_NLM_COMMON) += common/ |
2 | obj-$(CONFIG_CPU_XLR) += xlr/ | 2 | obj-$(CONFIG_CPU_XLR) += xlr/ |
3 | obj-$(CONFIG_CPU_XLP) += xlp/ | 3 | obj-$(CONFIG_CPU_XLP) += xlp/ |
4 | obj-$(CONFIG_CPU_XLP) += dts/ | ||
diff --git a/arch/mips/netlogic/dts/Makefile b/arch/mips/netlogic/dts/Makefile new file mode 100644 index 000000000000..67ae3fe296f0 --- /dev/null +++ b/arch/mips/netlogic/dts/Makefile | |||
@@ -0,0 +1,4 @@ | |||
1 | obj-$(CONFIG_DT_XLP_EVP) := xlp_evp.dtb.o | ||
2 | |||
3 | $(obj)/%.dtb: $(obj)/%.dts | ||
4 | $(call if_changed,dtc) | ||
diff --git a/arch/mips/netlogic/xlp/setup.c b/arch/mips/netlogic/xlp/setup.c index 0d2d679c6c56..d8997098defd 100644 --- a/arch/mips/netlogic/xlp/setup.c +++ b/arch/mips/netlogic/xlp/setup.c | |||
@@ -57,6 +57,7 @@ unsigned long nlm_common_ebase = 0x0; | |||
57 | /* default to uniprocessor */ | 57 | /* default to uniprocessor */ |
58 | uint32_t nlm_coremask = 1, nlm_cpumask = 1; | 58 | uint32_t nlm_coremask = 1, nlm_cpumask = 1; |
59 | int nlm_threads_per_core = 1; | 59 | int nlm_threads_per_core = 1; |
60 | extern u32 __dtb_start[]; | ||
60 | 61 | ||
61 | static void nlm_linux_exit(void) | 62 | static void nlm_linux_exit(void) |
62 | { | 63 | { |
@@ -97,9 +98,18 @@ void __init prom_init(void) | |||
97 | { | 98 | { |
98 | void *fdtp; | 99 | void *fdtp; |
99 | 100 | ||
100 | fdtp = (void *)(long)fw_arg0; | ||
101 | xlp_mmu_init(); | 101 | xlp_mmu_init(); |
102 | nlm_hal_init(); | 102 | nlm_hal_init(); |
103 | |||
104 | /* | ||
105 | * If no FDT pointer is passed in, use the built-in FDT. | ||
106 | * device_tree_init() does not handle CKSEG0 pointers in | ||
107 | * 64-bit, so convert pointer. | ||
108 | */ | ||
109 | fdtp = (void *)(long)fw_arg0; | ||
110 | if (!fdtp) | ||
111 | fdtp = __dtb_start; | ||
112 | fdtp = phys_to_virt(__pa(fdtp)); | ||
103 | early_init_devtree(fdtp); | 113 | early_init_devtree(fdtp); |
104 | 114 | ||
105 | nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1)); | 115 | nlm_common_ebase = read_c0_ebase() & (~((1 << 12) - 1)); |