diff options
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/kernel/devtree.c | 47 | ||||
-rw-r--r-- | arch/arm/kernel/setup.c | 2 |
3 files changed, 49 insertions, 1 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 8d95446150a3..908c78cb1d1c 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -44,6 +44,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o | |||
44 | obj-$(CONFIG_KGDB) += kgdb.o | 44 | obj-$(CONFIG_KGDB) += kgdb.o |
45 | obj-$(CONFIG_ARM_UNWIND) += unwind.o | 45 | obj-$(CONFIG_ARM_UNWIND) += unwind.o |
46 | obj-$(CONFIG_HAVE_TCM) += tcm.o | 46 | obj-$(CONFIG_HAVE_TCM) += tcm.o |
47 | obj-$(CONFIG_OF) += devtree.o | ||
47 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 48 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
48 | obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o | 49 | obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o |
49 | CFLAGS_swp_emulate.o := -Wa,-march=armv7-a | 50 | CFLAGS_swp_emulate.o := -Wa,-march=armv7-a |
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c new file mode 100644 index 000000000000..75e3df85b88c --- /dev/null +++ b/arch/arm/kernel/devtree.c | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/devtree.c | ||
3 | * | ||
4 | * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/init.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/errno.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/bootmem.h> | ||
16 | #include <linux/memblock.h> | ||
17 | #include <linux/of.h> | ||
18 | #include <linux/of_fdt.h> | ||
19 | #include <linux/of_irq.h> | ||
20 | #include <linux/of_platform.h> | ||
21 | |||
22 | #include <asm/setup.h> | ||
23 | #include <asm/page.h> | ||
24 | |||
25 | void __init early_init_dt_add_memory_arch(u64 base, u64 size) | ||
26 | { | ||
27 | arm_add_memory(base, size); | ||
28 | } | ||
29 | |||
30 | void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align) | ||
31 | { | ||
32 | return alloc_bootmem_align(size, align); | ||
33 | } | ||
34 | |||
35 | /** | ||
36 | * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq# | ||
37 | * | ||
38 | * Currently the mapping mechanism is trivial; simple flat hwirq numbers are | ||
39 | * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not | ||
40 | * supported. | ||
41 | */ | ||
42 | unsigned int irq_create_of_mapping(struct device_node *controller, | ||
43 | const u32 *intspec, unsigned int intsize) | ||
44 | { | ||
45 | return intspec[0]; | ||
46 | } | ||
47 | EXPORT_SYMBOL_GPL(irq_create_of_mapping); | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 006c1e884eaf..109997e3fe4a 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -466,7 +466,7 @@ static struct machine_desc * __init setup_machine(unsigned int nr) | |||
466 | /* can't use cpu_relax() here as it may require MMU setup */; | 466 | /* can't use cpu_relax() here as it may require MMU setup */; |
467 | } | 467 | } |
468 | 468 | ||
469 | static int __init arm_add_memory(phys_addr_t start, unsigned long size) | 469 | int __init arm_add_memory(phys_addr_t start, unsigned long size) |
470 | { | 470 | { |
471 | struct membank *bank = &meminfo.bank[meminfo.nr_banks]; | 471 | struct membank *bank = &meminfo.bank[meminfo.nr_banks]; |
472 | 472 | ||