diff options
author | Rob Herring <rob.herring@calxeda.com> | 2013-08-26 11:14:32 -0400 |
---|---|---|
committer | Rob Herring <rob.herring@calxeda.com> | 2013-10-09 12:38:11 -0400 |
commit | d5189cc57b1d231b6dc745de6b68881901d0c5c4 (patch) | |
tree | 34f320b0493fe082cb31d764d8e98b99a38321ae /arch/arm64 | |
parent | 56dc1f474add364b07254ad9690f4e244ca65ef4 (diff) |
arm64: use early_init_dt_scan
Convert arm64 to use new early_init_dt_scan function.
Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/kernel/setup.c | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 055cfb80e05c..4a5f6243ade2 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -124,37 +124,19 @@ static void __init setup_processor(void) | |||
124 | 124 | ||
125 | static void __init setup_machine_fdt(phys_addr_t dt_phys) | 125 | static void __init setup_machine_fdt(phys_addr_t dt_phys) |
126 | { | 126 | { |
127 | struct boot_param_header *devtree; | ||
128 | unsigned long dt_root; | 127 | unsigned long dt_root; |
129 | 128 | ||
130 | /* Check we have a non-NULL DT pointer */ | 129 | if (!dt_phys || !early_init_dt_scan(phys_to_virt(dt_phys))) { |
131 | if (!dt_phys) { | ||
132 | early_print("\n" | ||
133 | "Error: NULL or invalid device tree blob\n" | ||
134 | "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n" | ||
135 | "\nPlease check your bootloader.\n"); | ||
136 | |||
137 | while (true) | ||
138 | cpu_relax(); | ||
139 | |||
140 | } | ||
141 | |||
142 | devtree = phys_to_virt(dt_phys); | ||
143 | |||
144 | /* Check device tree validity */ | ||
145 | if (be32_to_cpu(devtree->magic) != OF_DT_HEADER) { | ||
146 | early_print("\n" | 130 | early_print("\n" |
147 | "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" | 131 | "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" |
148 | "Expected 0x%x, found 0x%x\n" | 132 | "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n" |
149 | "\nPlease check your bootloader.\n", | 133 | "\nPlease check your bootloader.\n", |
150 | dt_phys, devtree, OF_DT_HEADER, | 134 | dt_phys, phys_to_virt(dt_phys)); |
151 | be32_to_cpu(devtree->magic)); | ||
152 | 135 | ||
153 | while (true) | 136 | while (true) |
154 | cpu_relax(); | 137 | cpu_relax(); |
155 | } | 138 | } |
156 | 139 | ||
157 | initial_boot_params = devtree; | ||
158 | dt_root = of_get_flat_dt_root(); | 140 | dt_root = of_get_flat_dt_root(); |
159 | 141 | ||
160 | machine_name = of_get_flat_dt_prop(dt_root, "model", NULL); | 142 | machine_name = of_get_flat_dt_prop(dt_root, "model", NULL); |
@@ -163,13 +145,6 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys) | |||
163 | if (!machine_name) | 145 | if (!machine_name) |
164 | machine_name = "<unknown>"; | 146 | machine_name = "<unknown>"; |
165 | pr_info("Machine: %s\n", machine_name); | 147 | pr_info("Machine: %s\n", machine_name); |
166 | |||
167 | /* Retrieve various information from the /chosen node */ | ||
168 | of_scan_flat_dt(early_init_dt_scan_chosen, boot_command_line); | ||
169 | /* Initialize {size,address}-cells info */ | ||
170 | of_scan_flat_dt(early_init_dt_scan_root, NULL); | ||
171 | /* Setup memory, calling early_init_dt_add_memory_arch */ | ||
172 | of_scan_flat_dt(early_init_dt_scan_memory, NULL); | ||
173 | } | 148 | } |
174 | 149 | ||
175 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) | 150 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) |