blob: f6eb7e8f4c938c9cb6966924e38525d47e2c33dd [file] [log] [blame]
Paul Mackerras14cf11a2005-09-26 16:04:21 +10001/*
2 * PowerPC version
3 * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org)
4 *
5 * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au)
6 * and Cort Dougan (PReP) (cort@cs.nmt.edu)
7 * Copyright (C) 1996 Paul Mackerras
Paul Mackerras14cf11a2005-09-26 16:04:21 +10008 *
9 * Derived from "arch/i386/mm/init.c"
10 * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds
11 *
12 * Dave Engebretsen <engebret@us.ibm.com>
13 * Rework for PPC64 port.
14 *
15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License
17 * as published by the Free Software Foundation; either version
18 * 2 of the License, or (at your option) any later version.
19 *
20 */
21
Benjamin Herrenschmidtcec08e72008-04-30 15:41:48 +100022#undef DEBUG
23
Paul Mackerras14cf11a2005-09-26 16:04:21 +100024#include <linux/signal.h>
25#include <linux/sched.h>
26#include <linux/kernel.h>
27#include <linux/errno.h>
28#include <linux/string.h>
29#include <linux/types.h>
30#include <linux/mman.h>
31#include <linux/mm.h>
32#include <linux/swap.h>
33#include <linux/stddef.h>
34#include <linux/vmalloc.h>
35#include <linux/init.h>
36#include <linux/delay.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100037#include <linux/highmem.h>
38#include <linux/idr.h>
39#include <linux/nodemask.h>
40#include <linux/module.h>
Randy Dunlapc9cf5522006-06-27 02:53:52 -070041#include <linux/poison.h>
Yinghai Lu95f72d12010-07-12 14:36:09 +100042#include <linux/memblock.h>
David Gibsona4fe3ce2009-10-26 19:24:31 +000043#include <linux/hugetlb.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090044#include <linux/slab.h>
Paul Mackerras18569c12017-01-30 21:21:34 +110045#include <linux/of_fdt.h>
46#include <linux/libfdt.h>
Oliver O'Halloranb584c252017-06-28 11:32:33 +100047#include <linux/memremap.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100048
49#include <asm/pgalloc.h>
50#include <asm/page.h>
51#include <asm/prom.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100052#include <asm/rtas.h>
53#include <asm/io.h>
54#include <asm/mmu_context.h>
55#include <asm/pgtable.h>
56#include <asm/mmu.h>
Linus Torvalds7c0f6ba2016-12-24 11:46:01 -080057#include <linux/uaccess.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100058#include <asm/smp.h>
59#include <asm/machdep.h>
60#include <asm/tlb.h>
61#include <asm/eeh.h>
62#include <asm/processor.h>
63#include <asm/mmzone.h>
64#include <asm/cputable.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100065#include <asm/sections.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100066#include <asm/iommu.h>
Paul Mackerras14cf11a2005-09-26 16:04:21 +100067#include <asm/vdso.h>
David Gibson800fc3e2005-11-16 15:43:48 +110068
69#include "mmu_decl.h"
Paul Mackerras14cf11a2005-09-26 16:04:21 +100070
Michael Ellerman4e003742017-10-19 15:08:43 +110071#ifdef CONFIG_PPC_BOOK3S_64
Aneesh Kumar K.Vdd1842a2016-04-29 23:25:49 +100072#if H_PGTABLE_RANGE > USER_VSID_RANGE
Paul Mackerras14cf11a2005-09-26 16:04:21 +100073#warning Limited user VSID range means pagetable space is wasted
74#endif
Michael Ellerman4e003742017-10-19 15:08:43 +110075#endif /* CONFIG_PPC_BOOK3S_64 */
Paul Mackerras14cf11a2005-09-26 16:04:21 +100076
Kumar Gala37dd2ba2008-04-22 04:22:34 +100077phys_addr_t memstart_addr = ~0;
Sonny Rao79c30952010-08-19 18:08:09 +000078EXPORT_SYMBOL_GPL(memstart_addr);
Kumar Gala37dd2ba2008-04-22 04:22:34 +100079phys_addr_t kernstart_addr;
Sonny Rao79c30952010-08-19 18:08:09 +000080EXPORT_SYMBOL_GPL(kernstart_addr);
Kumar Galad7917ba2008-04-16 05:52:22 +100081
Andy Whitcroftd29eff72007-10-16 01:24:17 -070082#ifdef CONFIG_SPARSEMEM_VMEMMAP
83/*
84 * Given an address within the vmemmap, determine the pfn of the page that
85 * represents the start of the section it is within. Note that we have to
86 * do this by hand as the proffered address may not be correctly aligned.
87 * Subtraction of non-aligned pointers produces undefined results.
88 */
Michael Ellerman09de9ff2008-05-08 14:27:07 +100089static unsigned long __meminit vmemmap_section_start(unsigned long page)
Andy Whitcroftd29eff72007-10-16 01:24:17 -070090{
91 unsigned long offset = page - ((unsigned long)(vmemmap));
92
93 /* Return the pfn of the start of the section. */
94 return (offset / sizeof(struct page)) & PAGE_SECTION_MASK;
95}
96
97/*
98 * Check if this vmemmap page is already initialised. If any section
99 * which overlaps this vmemmap page is initialised then this page is
100 * initialised already.
101 */
Michael Ellerman09de9ff2008-05-08 14:27:07 +1000102static int __meminit vmemmap_populated(unsigned long start, int page_size)
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700103{
104 unsigned long end = start + page_size;
Li Zhong16a05bf2014-06-11 16:23:39 +0800105 start = (unsigned long)(pfn_to_page(vmemmap_section_start(start)));
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700106
107 for (; start < end; start += (PAGES_PER_SECTION * sizeof(struct page)))
Li Zhong16a05bf2014-06-11 16:23:39 +0800108 if (pfn_valid(page_to_pfn((struct page *)start)))
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700109 return 1;
110
111 return 0;
112}
113
Anshuman Khandual39e46752017-04-06 19:44:50 +0530114/*
115 * vmemmap virtual address space management does not have a traditonal page
116 * table to track which virtual struct pages are backed by physical mapping.
117 * The virtual to physical mappings are tracked in a simple linked list
118 * format. 'vmemmap_list' maintains the entire vmemmap physical mapping at
119 * all times where as the 'next' list maintains the available
120 * vmemmap_backing structures which have been deleted from the
121 * 'vmemmap_global' list during system runtime (memory hotplug remove
122 * operation). The freed 'vmemmap_backing' structures are reused later when
123 * new requests come in without allocating fresh memory. This pointer also
124 * tracks the allocated 'vmemmap_backing' structures as we allocate one
125 * full page memory at a time when we dont have any.
126 */
Mark Nelson91eea672010-04-21 16:21:03 +0000127struct vmemmap_backing *vmemmap_list;
Li Zhongbd8cb032014-06-11 16:23:36 +0800128static struct vmemmap_backing *next;
Anshuman Khandual39e46752017-04-06 19:44:50 +0530129
130/*
131 * The same pointer 'next' tracks individual chunks inside the allocated
132 * full page during the boot time and again tracks the freeed nodes during
133 * runtime. It is racy but it does not happen as they are separated by the
134 * boot process. Will create problem if some how we have memory hotplug
135 * operation during boot !!
136 */
Li Zhongbd8cb032014-06-11 16:23:36 +0800137static int num_left;
138static int num_freed;
Mark Nelson91eea672010-04-21 16:21:03 +0000139
140static __meminit struct vmemmap_backing * vmemmap_list_alloc(int node)
141{
Li Zhongbd8cb032014-06-11 16:23:36 +0800142 struct vmemmap_backing *vmem_back;
143 /* get from freed entries first */
144 if (num_freed) {
145 num_freed--;
146 vmem_back = next;
147 next = next->list;
148
149 return vmem_back;
150 }
Mark Nelson91eea672010-04-21 16:21:03 +0000151
152 /* allocate a page when required and hand out chunks */
Li Zhongbd8cb032014-06-11 16:23:36 +0800153 if (!num_left) {
Mark Nelson91eea672010-04-21 16:21:03 +0000154 next = vmemmap_alloc_block(PAGE_SIZE, node);
155 if (unlikely(!next)) {
156 WARN_ON(1);
157 return NULL;
158 }
159 num_left = PAGE_SIZE / sizeof(struct vmemmap_backing);
160 }
161
162 num_left--;
163
164 return next++;
165}
166
167static __meminit void vmemmap_list_populate(unsigned long phys,
168 unsigned long start,
169 int node)
170{
171 struct vmemmap_backing *vmem_back;
172
173 vmem_back = vmemmap_list_alloc(node);
174 if (unlikely(!vmem_back)) {
175 WARN_ON(1);
176 return;
177 }
178
179 vmem_back->phys = phys;
180 vmem_back->virt_addr = start;
181 vmem_back->list = vmemmap_list;
182
183 vmemmap_list = vmem_back;
184}
185
Li Zhong71b0bfe2014-06-11 16:23:38 +0800186int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node)
187{
188 unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
189
190 /* Align to the page size of the linear mapping. */
191 start = _ALIGN_DOWN(start, page_size);
192
193 pr_debug("vmemmap_populate %lx..%lx, node %d\n", start, end, node);
194
195 for (; start < end; start += page_size) {
Oliver O'Halloranb584c252017-06-28 11:32:33 +1000196 struct vmem_altmap *altmap;
Li Zhong71b0bfe2014-06-11 16:23:38 +0800197 void *p;
David Gibson1dace6c2016-02-09 13:32:42 +1000198 int rc;
Li Zhong71b0bfe2014-06-11 16:23:38 +0800199
200 if (vmemmap_populated(start, page_size))
201 continue;
202
Oliver O'Halloranb584c252017-06-28 11:32:33 +1000203 /* altmap lookups only work at section boundaries */
204 altmap = to_vmem_altmap(SECTION_ALIGN_DOWN(start));
205
206 p = __vmemmap_alloc_block_buf(page_size, node, altmap);
Li Zhong71b0bfe2014-06-11 16:23:38 +0800207 if (!p)
208 return -ENOMEM;
209
210 vmemmap_list_populate(__pa(p), start, node);
211
212 pr_debug(" * %016lx..%016lx allocated at %p\n",
213 start, start + page_size, p);
214
David Gibson1dace6c2016-02-09 13:32:42 +1000215 rc = vmemmap_create_mapping(start, page_size, __pa(p));
216 if (rc < 0) {
Joe Perchesf2c2cbc2016-10-24 21:00:08 -0700217 pr_warn("%s: Unable to create vmemmap mapping: %d\n",
218 __func__, rc);
David Gibson1dace6c2016-02-09 13:32:42 +1000219 return -EFAULT;
220 }
Li Zhong71b0bfe2014-06-11 16:23:38 +0800221 }
222
223 return 0;
224}
225
226#ifdef CONFIG_MEMORY_HOTPLUG
Li Zhongbd8cb032014-06-11 16:23:36 +0800227static unsigned long vmemmap_list_free(unsigned long start)
228{
229 struct vmemmap_backing *vmem_back, *vmem_back_prev;
230
231 vmem_back_prev = vmem_back = vmemmap_list;
232
233 /* look for it with prev pointer recorded */
234 for (; vmem_back; vmem_back = vmem_back->list) {
235 if (vmem_back->virt_addr == start)
236 break;
237 vmem_back_prev = vmem_back;
238 }
239
240 if (unlikely(!vmem_back)) {
241 WARN_ON(1);
242 return 0;
243 }
244
245 /* remove it from vmemmap_list */
246 if (vmem_back == vmemmap_list) /* remove head */
247 vmemmap_list = vmem_back->list;
248 else
249 vmem_back_prev->list = vmem_back->list;
250
251 /* next point to this freed entry */
252 vmem_back->list = next;
253 next = vmem_back;
254 num_freed++;
255
256 return vmem_back->phys;
257}
258
Li Zhong71b0bfe2014-06-11 16:23:38 +0800259void __ref vmemmap_free(unsigned long start, unsigned long end)
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700260{
Benjamin Herrenschmidtcec08e72008-04-30 15:41:48 +1000261 unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000262 unsigned long page_order = get_order(page_size);
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700263
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700264 start = _ALIGN_DOWN(start, page_size);
265
Li Zhong71b0bfe2014-06-11 16:23:38 +0800266 pr_debug("vmemmap_free %lx...%lx\n", start, end);
Benjamin Herrenschmidt32a74942009-07-23 23:15:58 +0000267
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700268 for (; start < end; start += page_size) {
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000269 unsigned long nr_pages, addr;
Oliver O'Halloranb584c252017-06-28 11:32:33 +1000270 struct vmem_altmap *altmap;
271 struct page *section_base;
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000272 struct page *page;
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700273
Li Zhong71b0bfe2014-06-11 16:23:38 +0800274 /*
275 * the section has already be marked as invalid, so
276 * vmemmap_populated() true means some other sections still
277 * in this page, so skip it.
278 */
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700279 if (vmemmap_populated(start, page_size))
280 continue;
281
Li Zhong71b0bfe2014-06-11 16:23:38 +0800282 addr = vmemmap_list_free(start);
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000283 if (!addr)
284 continue;
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700285
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000286 page = pfn_to_page(addr >> PAGE_SHIFT);
Oliver O'Halloranb584c252017-06-28 11:32:33 +1000287 section_base = pfn_to_page(vmemmap_section_start(start));
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000288 nr_pages = 1 << page_order;
Mark Nelson91eea672010-04-21 16:21:03 +0000289
Oliver O'Halloranb584c252017-06-28 11:32:33 +1000290 altmap = to_vmem_altmap((unsigned long) section_base);
291 if (altmap) {
292 vmem_altmap_free(altmap, nr_pages);
293 } else if (PageReserved(page)) {
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000294 /* allocated from bootmem */
295 if (page_size < PAGE_SIZE) {
296 /*
297 * this shouldn't happen, but if it is
298 * the case, leave the memory there
299 */
300 WARN_ON_ONCE(1);
301 } else {
302 while (nr_pages--)
303 free_reserved_page(page++);
304 }
305 } else {
306 free_pages((unsigned long)(__va(addr)), page_order);
Li Zhong71b0bfe2014-06-11 16:23:38 +0800307 }
Oliver O'Hallorand7d9b612017-06-28 11:32:32 +1000308
309 vmemmap_remove_mapping(start, page_size);
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700310 }
Andy Whitcroftd29eff72007-10-16 01:24:17 -0700311}
Li Zhong71b0bfe2014-06-11 16:23:38 +0800312#endif
Nathan Fontenotf7e33342013-09-27 10:18:09 -0500313void register_page_bootmem_memmap(unsigned long section_nr,
314 struct page *start_page, unsigned long size)
315{
316}
Benjamin Herrenschmidtcd3db0c2010-07-06 15:39:02 -0700317
Alexey Kardashevskiy8e0861fa2013-08-28 18:37:42 +1000318/*
319 * We do not have access to the sparsemem vmemmap, so we fallback to
320 * walking the list of sparsemem blocks which we already maintain for
321 * the sake of crashdump. In the long run, we might want to maintain
322 * a tree if performance of that linear walk becomes a problem.
323 *
324 * realmode_pfn_to_page functions can fail due to:
325 * 1) As real sparsemem blocks do not lay in RAM continously (they
326 * are in virtual address space which is not available in the real mode),
327 * the requested page struct can be split between blocks so get_page/put_page
328 * may fail.
329 * 2) When huge pages are used, the get_page/put_page API will fail
330 * in real mode as the linked addresses in the page struct are virtual
331 * too.
332 */
333struct page *realmode_pfn_to_page(unsigned long pfn)
334{
335 struct vmemmap_backing *vmem_back;
336 struct page *page;
337 unsigned long page_size = 1 << mmu_psize_defs[mmu_vmemmap_psize].shift;
338 unsigned long pg_va = (unsigned long) pfn_to_page(pfn);
339
340 for (vmem_back = vmemmap_list; vmem_back; vmem_back = vmem_back->list) {
341 if (pg_va < vmem_back->virt_addr)
342 continue;
343
Li Zhongbd8cb032014-06-11 16:23:36 +0800344 /* After vmemmap_list entry free is possible, need check all */
345 if ((pg_va + sizeof(struct page)) <=
346 (vmem_back->virt_addr + page_size)) {
347 page = (struct page *) (vmem_back->phys + pg_va -
Alexey Kardashevskiy8e0861fa2013-08-28 18:37:42 +1000348 vmem_back->virt_addr);
Li Zhongbd8cb032014-06-11 16:23:36 +0800349 return page;
350 }
Alexey Kardashevskiy8e0861fa2013-08-28 18:37:42 +1000351 }
352
Li Zhongbd8cb032014-06-11 16:23:36 +0800353 /* Probably that page struct is split between real pages */
Alexey Kardashevskiy8e0861fa2013-08-28 18:37:42 +1000354 return NULL;
355}
356EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
357
Aneesh Kumar K.V7e7dc662017-06-28 11:39:28 +0530358#else
Alexey Kardashevskiy8e0861fa2013-08-28 18:37:42 +1000359
360struct page *realmode_pfn_to_page(unsigned long pfn)
361{
362 struct page *page = pfn_to_page(pfn);
363 return page;
364}
365EXPORT_SYMBOL_GPL(realmode_pfn_to_page);
366
Aneesh Kumar K.V7e7dc662017-06-28 11:39:28 +0530367#endif /* CONFIG_SPARSEMEM_VMEMMAP */
Michael Ellerman1a01dc82016-07-26 20:09:30 +1000368
Michael Ellerman4e003742017-10-19 15:08:43 +1100369#ifdef CONFIG_PPC_BOOK3S_64
Michael Ellerman1fd6c022017-10-24 17:48:49 +0200370static bool disable_radix = !IS_ENABLED(CONFIG_PPC_RADIX_MMU_DEFAULT);
371
Michael Ellermanc610ec62016-07-26 21:29:30 +1000372static int __init parse_disable_radix(char *p)
373{
Michael Ellerman1fd6c022017-10-24 17:48:49 +0200374 bool val;
375
376 if (strlen(p) == 0)
377 val = true;
378 else if (kstrtobool(p, &val))
379 return -EINVAL;
380
381 disable_radix = val;
382
Michael Ellermanc610ec62016-07-26 21:29:30 +1000383 return 0;
384}
385early_param("disable_radix", parse_disable_radix);
386
Paul Mackerras18569c12017-01-30 21:21:34 +1100387/*
Paul Mackerrascc3d2942017-01-30 21:21:36 +1100388 * If we're running under a hypervisor, we need to check the contents of
389 * /chosen/ibm,architecture-vec-5 to see if the hypervisor is willing to do
390 * radix. If not, we clear the radix feature bit so we fall back to hash.
Paul Mackerras18569c12017-01-30 21:21:34 +1100391 */
Michael Ellerman75599522017-08-08 21:44:08 +1000392static void __init early_check_vec5(void)
Paul Mackerras18569c12017-01-30 21:21:34 +1100393{
394 unsigned long root, chosen;
395 int size;
396 const u8 *vec5;
Suraj Jitindar Singh014d02c2017-02-28 17:03:48 +1100397 u8 mmu_supported;
Paul Mackerras18569c12017-01-30 21:21:34 +1100398
399 root = of_get_flat_dt_root();
400 chosen = of_get_flat_dt_subnode_by_name(root, "chosen");
Suraj Jitindar Singh014d02c2017-02-28 17:03:48 +1100401 if (chosen == -FDT_ERR_NOTFOUND) {
Paul Mackerrascc3d2942017-01-30 21:21:36 +1100402 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
Suraj Jitindar Singh014d02c2017-02-28 17:03:48 +1100403 return;
404 }
405 vec5 = of_get_flat_dt_prop(chosen, "ibm,architecture-vec-5", &size);
406 if (!vec5) {
407 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
408 return;
409 }
410 if (size <= OV5_INDX(OV5_MMU_SUPPORT)) {
411 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
412 return;
413 }
414
415 /* Check for supported configuration */
416 mmu_supported = vec5[OV5_INDX(OV5_MMU_SUPPORT)] &
417 OV5_FEAT(OV5_MMU_SUPPORT);
418 if (mmu_supported == OV5_FEAT(OV5_MMU_RADIX)) {
419 /* Hypervisor only supports radix - check enabled && GTSE */
420 if (!early_radix_enabled()) {
421 pr_warn("WARNING: Ignoring cmdline option disable_radix\n");
422 }
423 if (!(vec5[OV5_INDX(OV5_RADIX_GTSE)] &
424 OV5_FEAT(OV5_RADIX_GTSE))) {
425 pr_warn("WARNING: Hypervisor doesn't support RADIX with GTSE\n");
426 }
427 /* Do radix anyway - the hypervisor said we had to */
428 cur_cpu_spec->mmu_features |= MMU_FTR_TYPE_RADIX;
429 } else if (mmu_supported == OV5_FEAT(OV5_MMU_HASH)) {
430 /* Hypervisor only supports hash - disable radix */
431 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
432 }
Paul Mackerras18569c12017-01-30 21:21:34 +1100433}
434
Michael Ellerman1a01dc82016-07-26 20:09:30 +1000435void __init mmu_early_init_devtree(void)
436{
Michael Ellermanc610ec62016-07-26 21:29:30 +1000437 /* Disable radix mode based on kernel command line. */
Paul Mackerrasfc36a902017-03-21 12:38:02 +1100438 if (disable_radix)
Aneesh Kumar K.V5a25b6f2016-07-27 13:19:01 +1000439 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
Michael Ellermanbacf9cf2016-07-26 21:31:59 +1000440
Paul Mackerras18569c12017-01-30 21:21:34 +1100441 /*
442 * Check /chosen/ibm,architecture-vec-5 if running as a guest.
443 * When running bare-metal, we can use radix if we like
444 * even though the ibm,architecture-vec-5 property created by
445 * skiboot doesn't have the necessary bits set.
446 */
Suraj Jitindar Singh014d02c2017-02-28 17:03:48 +1100447 if (!(mfmsr() & MSR_HV))
Paul Mackerras18569c12017-01-30 21:21:34 +1100448 early_check_vec5();
449
Aneesh Kumar K.Vb8f1b4f2016-07-23 14:42:35 +0530450 if (early_radix_enabled())
Michael Ellerman2537b092016-07-26 21:55:27 +1000451 radix__early_init_devtree();
452 else
Michael Ellermanbacf9cf2016-07-26 21:31:59 +1000453 hash__early_init_devtree();
Michael Ellerman1a01dc82016-07-26 20:09:30 +1000454}
Michael Ellerman4e003742017-10-19 15:08:43 +1100455#endif /* CONFIG_PPC_BOOK3S_64 */