* [PATCH v2 2/6] arm/dt: Allow CONFIG_OF on ARM
[not found] ` <20110131203626.15105.64302.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
@ 2011-01-31 21:04 ` Grant Likely
2011-01-31 21:04 ` [PATCH v2 3/6] arm/dt: consolidate atags setup into setup_machine_atags Grant Likely
` (3 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2011-01-31 21:04 UTC (permalink / raw)
To: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, Russell King,
Catalin Marinas, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, buytenh@
From: Jeremy Kerr <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Add some basic empty infrastructure for DT support on ARM.
Signed-off-by: Jeremy Kerr <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
arch/arm/Kconfig | 7 ++++++
arch/arm/include/asm/prom.h | 25 ++++++++++++++++++++++
arch/arm/include/asm/setup.h | 2 ++
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/devtree.c | 47 ++++++++++++++++++++++++++++++++++++++++++
arch/arm/kernel/setup.c | 2 +-
6 files changed, 83 insertions(+), 1 deletions(-)
create mode 100644 arch/arm/include/asm/prom.h
create mode 100644 arch/arm/kernel/devtree.c
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 5cff165..d8a330f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1586,6 +1586,13 @@ endmenu
menu "Boot options"
+config USE_OF
+ bool "Flattened Device Tree support"
+ select OF
+ select OF_EARLY_FLATTREE
+ help
+ Include support for flattened device tree machine descriptions.
+
# Compressed boot loader in ROM. Yes, we really want to ask about
# TEXT and BSS so we preserve their values in the config files.
config ZBOOT_ROM_TEXT
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
new file mode 100644
index 0000000..8f1037f
--- /dev/null
+++ b/arch/arm/include/asm/prom.h
@@ -0,0 +1,25 @@
+/*
+ * arch/arm/include/asm/prom.h
+ *
+ * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+#ifndef __ASMARM_PROM_H
+#define __ASMARM_PROM_H
+
+#ifdef CONFIG_OF
+
+#include <asm/setup.h>
+#include <asm/irq.h>
+
+static inline void irq_dispose_mapping(unsigned int virq)
+{
+ return;
+}
+
+#endif /* CONFIG_OF */
+#endif /* ASMARM_PROM_H */
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index f1e5a9b..06c4d0e 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -221,6 +221,8 @@ extern struct meminfo meminfo;
#define bank_phys_end(bank) ((bank)->start + (bank)->size)
#define bank_phys_size(bank) (bank)->size
+extern int arm_add_memory(unsigned long start, unsigned long size);
+
#endif /* __KERNEL__ */
#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 185ee82..8df05fd 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -43,6 +43,7 @@ obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
obj-$(CONFIG_KGDB) += kgdb.o
obj-$(CONFIG_ARM_UNWIND) += unwind.o
obj-$(CONFIG_HAVE_TCM) += tcm.o
+obj-$(CONFIG_OF) += devtree.o
obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
obj-$(CONFIG_SWP_EMULATE) += swp_emulate.o
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 0000000..ac48da2
--- /dev/null
+++ b/arch/arm/kernel/devtree.c
@@ -0,0 +1,47 @@
+/*
+ * linux/arch/arm/kernel/devtree.c
+ *
+ * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/bootmem.h>
+#include <linux/memblock.h>
+#include <linux/of.h>
+#include <linux/of_fdt.h>
+#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+
+#include <asm/setup.h>
+#include <asm/page.h>
+
+void __init early_init_dt_add_memory_arch(u64 base, u64 size)
+{
+ arm_add_memory(base, size);
+}
+
+void * __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+ return __va(memblock_alloc(size, align));
+}
+
+/**
+ * irq_create_of_mapping - Hook to resolve OF irq specifier into a Linux irq#
+ *
+ * Currently the mapping mechanism is trivial; simple flat hwirq numbers are
+ * mapped 1:1 onto Linux irq numbers. Cascaded irq controllers are not
+ * supported.
+ */
+unsigned int irq_create_of_mapping(struct device_node *controller,
+ const u32 *intspec, unsigned int intsize)
+{
+ return intspec[0];
+}
+EXPORT_SYMBOL_GPL(irq_create_of_mapping);
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 420b8d6..d211609 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -443,7 +443,7 @@ static struct machine_desc * __init setup_machine(unsigned int nr)
return list;
}
-static int __init arm_add_memory(unsigned long start, unsigned long size)
+int __init arm_add_memory(unsigned long start, unsigned long size)
{
struct membank *bank = &meminfo.bank[meminfo.nr_banks];
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 3/6] arm/dt: consolidate atags setup into setup_machine_atags
[not found] ` <20110131203626.15105.64302.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2011-01-31 21:04 ` [PATCH v2 2/6] arm/dt: Allow CONFIG_OF on ARM Grant Likely
@ 2011-01-31 21:04 ` Grant Likely
2011-01-31 21:04 ` [PATCH v2 4/6] arm/dt: probe for platforms via the device tree Grant Likely
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2011-01-31 21:04 UTC (permalink / raw)
To: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, Russell King,
Catalin Marinas, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, buytenh@
In preparation for adding device tree support, this patch consolidates
all of the atag-specific setup into a single function.
Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
arch/arm/kernel/setup.c | 68 ++++++++++++++++++++++++-----------------------
1 files changed, 35 insertions(+), 33 deletions(-)
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index d211609..cbc1836 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -424,25 +424,6 @@ void cpu_init(void)
: "r14");
}
-static struct machine_desc * __init setup_machine(unsigned int nr)
-{
- struct machine_desc *list;
-
- /*
- * locate machine in the list of supported machines.
- */
- list = lookup_machine_type(nr);
- if (!list) {
- printk("Machine configuration botched (nr %d), unable "
- "to continue.\n", nr);
- while (1);
- }
-
- printk("Machine: %s\n", list->name);
-
- return list;
-}
-
int __init arm_add_memory(unsigned long start, unsigned long size)
{
struct membank *bank = &meminfo.bank[meminfo.nr_banks];
@@ -796,21 +777,23 @@ static void __init squash_mem_tags(struct tag *tag)
tag->hdr.tag = ATAG_NONE;
}
-void __init setup_arch(char **cmdline_p)
+static struct machine_desc * __init setup_machine_tags(unsigned int nr)
{
struct tag *tags = (struct tag *)&init_tags;
struct machine_desc *mdesc;
char *from = default_command_line;
- unwind_init();
-
- setup_processor();
- mdesc = setup_machine(machine_arch_type);
- machine_desc = mdesc;
- machine_name = mdesc->name;
+ /*
+ * locate machine in the list of supported machines.
+ */
+ mdesc = lookup_machine_type(nr);
+ if (!mdesc) {
+ printk("Machine configuration botched (nr %d), unable "
+ "to continue.\n", nr);
+ while (1);
+ }
- if (mdesc->soft_reboot)
- reboot_setup("s");
+ printk("Machine: %s\n", mdesc->name);
if (__atags_pointer)
tags = phys_to_virt(__atags_pointer);
@@ -838,16 +821,35 @@ void __init setup_arch(char **cmdline_p)
parse_tags(tags);
}
- init_mm.start_code = (unsigned long) _text;
- init_mm.end_code = (unsigned long) _etext;
- init_mm.end_data = (unsigned long) _edata;
- init_mm.brk = (unsigned long) _end;
-
/* parse_early_param needs a boot_command_line */
strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
+
+ return mdesc;
+}
+
+
+void __init setup_arch(char **cmdline_p)
+{
+ struct machine_desc *mdesc;
+
+ unwind_init();
+
+ setup_processor();
+ mdesc = setup_machine_tags(machine_arch_type);
+ machine_desc = mdesc;
+ machine_name = mdesc->name;
+
+ if (mdesc->soft_reboot)
+ reboot_setup("s");
+
+ init_mm.start_code = (unsigned long) _text;
+ init_mm.end_code = (unsigned long) _etext;
+ init_mm.end_data = (unsigned long) _edata;
+ init_mm.brk = (unsigned long) _end;
+
*cmdline_p = cmd_line;
parse_early_param();
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 4/6] arm/dt: probe for platforms via the device tree
[not found] ` <20110131203626.15105.64302.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2011-01-31 21:04 ` [PATCH v2 2/6] arm/dt: Allow CONFIG_OF on ARM Grant Likely
2011-01-31 21:04 ` [PATCH v2 3/6] arm/dt: consolidate atags setup into setup_machine_atags Grant Likely
@ 2011-01-31 21:04 ` Grant Likely
[not found] ` <20110131210410.15105.63595.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
2011-01-31 21:04 ` [PATCH v2 5/6] arm/dt: Basic versatile devicetree support Grant Likely
2011-01-31 21:04 ` [PATCH v2 6/6] arm/dt: Basic tegra " Grant Likely
4 siblings, 1 reply; 9+ messages in thread
From: Grant Likely @ 2011-01-31 21:04 UTC (permalink / raw)
To: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, Russell King,
Catalin Marinas, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, buytenh@
If a dtb is passed to the kernel then the kernel needs to iterate
through compiled-in mdescs looking for one that matches and move the
dtb data to a safe location before it gets accidentally overwritten by
the kernel.
This patch creates a new function, setup_machine_fdt() which is
analogous to the setup_machine_atags() created in the previous patch.
It does all the early setup needed to use a device tree machine
description. It also creates arm_unflatten_device_tree() which copies
the dtb into an allocated buffer and unflattens it into the live-tree
representation.
v2: Changed to save the dtb by copying into an allocated buffer.
- Since the dtb will very likely be passed in the first 16k of ram
where the interrupt vectors live, memblock_reserve() is
insufficient to protect the dtb data.
[based on work originally written by Jeremy Kerr <jeremy.kerr-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>]
Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
arch/arm/include/asm/mach/arch.h | 2 +
arch/arm/include/asm/prom.h | 11 +++++
arch/arm/include/asm/setup.h | 1
arch/arm/kernel/devtree.c | 87 ++++++++++++++++++++++++++++++++++++++
arch/arm/kernel/setup.c | 10 +++-
arch/arm/mm/init.c | 8 +++
6 files changed, 117 insertions(+), 2 deletions(-)
diff --git a/arch/arm/include/asm/mach/arch.h b/arch/arm/include/asm/mach/arch.h
index 3a0893a..2ed24e7 100644
--- a/arch/arm/include/asm/mach/arch.h
+++ b/arch/arm/include/asm/mach/arch.h
@@ -22,6 +22,8 @@ struct machine_desc {
unsigned int nr; /* architecture number */
const char *name; /* architecture name */
unsigned long boot_params; /* tagged list */
+ const char **dt_compat; /* array of device tree
+ * 'compatible' strings */
unsigned int nr_irqs; /* number of IRQs */
diff --git a/arch/arm/include/asm/prom.h b/arch/arm/include/asm/prom.h
index 8f1037f..6ba62a8 100644
--- a/arch/arm/include/asm/prom.h
+++ b/arch/arm/include/asm/prom.h
@@ -21,5 +21,16 @@ static inline void irq_dispose_mapping(unsigned int virq)
return;
}
+extern void arm_unflatten_device_tree(void);
+extern struct machine_desc *setup_machine_fdt(unsigned int dt_phys);
+
+#else /* CONFIG_OF */
+
+static void arm_unflatten_device_tree(void) { }
+static inline struct machine_desc *setup_machine_fdt(unsigned int dt_phys)
+{
+ return NULL;
+}
+
#endif /* CONFIG_OF */
#endif /* ASMARM_PROM_H */
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h
index 06c4d0e..1cec82a 100644
--- a/arch/arm/include/asm/setup.h
+++ b/arch/arm/include/asm/setup.h
@@ -222,6 +222,7 @@ extern struct meminfo meminfo;
#define bank_phys_size(bank) (bank)->size
extern int arm_add_memory(unsigned long start, unsigned long size);
+extern char cmd_line[COMMAND_LINE_SIZE];
#endif /* __KERNEL__ */
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
index ac48da2..07b75bb 100644
--- a/arch/arm/kernel/devtree.c
+++ b/arch/arm/kernel/devtree.c
@@ -21,6 +21,7 @@
#include <asm/setup.h>
#include <asm/page.h>
+#include <asm/mach/arch.h>
void __init early_init_dt_add_memory_arch(u64 base, u64 size)
{
@@ -45,3 +46,89 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
return intspec[0];
}
EXPORT_SYMBOL_GPL(irq_create_of_mapping);
+
+extern struct machine_desc __arch_info_begin, __arch_info_end;
+
+/**
+ * arm_unflatten_device_tree - Copy dtb into a safe area and unflatten it.
+ *
+ * Copies the dtb out of initial memory and into an allocated block so that
+ * it doesn't get overwritten by the kernel and then unflatten it into the
+ * live tree representation.
+ */
+void __init arm_unflatten_device_tree(void)
+{
+ struct boot_param_header *devtree;
+ u32 dtb_size;
+
+ if (!initial_boot_params)
+ return;
+
+ /* Save the dtb to an allocated buffer */
+ dtb_size = be32_to_cpu(initial_boot_params->totalsize);
+ devtree = early_init_dt_alloc_memory_arch(dtb_size, SZ_4K);
+ if (!devtree) {
+ printk("Unable to allocate memory for device tree\n");
+ while(1);
+ }
+ pr_info("relocating device tree from 0x%p to 0x%p, length 0x%x\n",
+ initial_boot_params, devtree, dtb_size);
+ memmove(devtree, initial_boot_params, dtb_size);
+ initial_boot_params = devtree;
+
+ unflatten_device_tree();
+}
+
+/**
+ * setup_machine_fdt - Machine setup when an dtb was passed to the kernel
+ * @dt_phys: physical address of dt blob
+ *
+ * If a dtb was passed to the kernel in r2, then use it to choose the
+ * correct machine_desc and to setup the system.
+ */
+struct machine_desc * __init setup_machine_fdt(unsigned int dt_phys)
+{
+ struct boot_param_header *devtree = phys_to_virt(dt_phys);
+ struct machine_desc *mdesc, *mdesc_best = NULL;
+ unsigned int score, mdesc_score = ~1;
+ unsigned long dt_root;
+ const char *model;
+
+ /* check device tree validity */
+ if (!dt_phys || be32_to_cpu(devtree->magic) != OF_DT_HEADER)
+ return NULL;
+
+ /* Search the mdescs for the 'best' compatible value match */
+ initial_boot_params = devtree;
+
+ dt_root = of_get_flat_dt_root();
+ for (mdesc = &__arch_info_begin; mdesc < &__arch_info_end; mdesc++) {
+ score = of_flat_dt_match(dt_root, mdesc->dt_compat);
+ if (score > 0 && score < mdesc_score) {
+ mdesc_best = mdesc;
+ mdesc_score = score;
+ }
+ }
+ if (!mdesc_best) {
+ printk("Machine not supported, unable to continue.\n");
+ while (1);
+ }
+
+ model = of_get_flat_dt_prop(dt_root, "model", NULL);
+ if (!model)
+ model = of_get_flat_dt_prop(dt_root, "compatible", NULL);
+ if (!model)
+ model = "<unknown>";
+ pr_info("Machine: %s, model: %s\n", mdesc_best->name, model);
+
+ /* Retrieve various information from the /chosen node */
+ of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
+ /* Initialize {size,address}-cells info */
+ of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ /* Setup memory, calling early_init_dt_add_memory_arch */
+ of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+ /* Save command line for /proc/cmdline */
+ strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
+
+ return mdesc_best;
+}
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index cbc1836..68e0204 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -20,6 +20,7 @@
#include <linux/screen_info.h>
#include <linux/init.h>
#include <linux/kexec.h>
+#include <linux/of_fdt.h>
#include <linux/crash_dump.h>
#include <linux/root_dev.h>
#include <linux/cpu.h>
@@ -42,6 +43,7 @@
#include <asm/cachetype.h>
#include <asm/tlbflush.h>
+#include <asm/prom.h>
#include <asm/mach/arch.h>
#include <asm/mach/irq.h>
#include <asm/mach/time.h>
@@ -125,7 +127,7 @@ EXPORT_SYMBOL(elf_platform);
static const char *cpu_name;
static const char *machine_name;
-static char __initdata cmd_line[COMMAND_LINE_SIZE];
+char cmd_line[COMMAND_LINE_SIZE];
struct machine_desc *machine_desc __initdata;
static char default_command_line[COMMAND_LINE_SIZE] __initdata = CONFIG_CMDLINE;
@@ -838,7 +840,9 @@ void __init setup_arch(char **cmdline_p)
unwind_init();
setup_processor();
- mdesc = setup_machine_tags(machine_arch_type);
+ mdesc = setup_machine_fdt(__atags_pointer);
+ if (!mdesc)
+ mdesc = setup_machine_tags(machine_arch_type);
machine_desc = mdesc;
machine_name = mdesc->name;
@@ -859,6 +863,8 @@ void __init setup_arch(char **cmdline_p)
paging_init(mdesc);
request_standard_resources(mdesc);
+ arm_unflatten_device_tree();
+
#ifdef CONFIG_SMP
if (is_smp())
smp_init_cpus();
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index 5164069..62ff2e8 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -71,6 +71,14 @@ static int __init parse_tag_initrd2(const struct tag *tag)
__tagtable(ATAG_INITRD2, parse_tag_initrd2);
+#ifdef CONFIG_OF_FLATTREE
+void __init early_init_dt_setup_initrd_arch(unsigned long start, unsigned long end)
+{
+ phys_initrd_start = start;
+ phys_initrd_size = end - start + 1;
+}
+#endif /* CONFIG_OF_FLATTREE */
+
/*
* This keeps memory configuration data used by a couple memory
* initialization functions, as well as show_mem() for the skipping
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 5/6] arm/dt: Basic versatile devicetree support
[not found] ` <20110131203626.15105.64302.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
` (2 preceding siblings ...)
2011-01-31 21:04 ` [PATCH v2 4/6] arm/dt: probe for platforms via the device tree Grant Likely
@ 2011-01-31 21:04 ` Grant Likely
2011-01-31 21:04 ` [PATCH v2 6/6] arm/dt: Basic tegra " Grant Likely
4 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2011-01-31 21:04 UTC (permalink / raw)
To: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, Russell King,
Catalin Marinas, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, buytenh@
This patch adds adds very basic support for booting versatile with a
device tree. It simply allows the existing machine_descs to match
against the versatile ab & pb compatible values so that the kernel can
boot. Kernel parameters and the initrd pointer is read out of the
tree instead of atags.
This is not complete device tree support. This change will be
reverted when a new machine_desc is added that can populate the
versatile device registrations directly from data in the tree instead
of using hard coded data. That change will be made in a future patch.
Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
arch/arm/mach-versatile/versatile_ab.c | 6 ++++++
arch/arm/mach-versatile/versatile_pb.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-versatile/versatile_ab.c b/arch/arm/mach-versatile/versatile_ab.c
index aa9730f..62053df 100644
--- a/arch/arm/mach-versatile/versatile_ab.c
+++ b/arch/arm/mach-versatile/versatile_ab.c
@@ -33,6 +33,11 @@
#include "core.h"
+static const char *versatile_ab_match[] __initdata = {
+ "arm,versatile-ab",
+ NULL,
+};
+
MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100,
@@ -40,4 +45,5 @@ MACHINE_START(VERSATILE_AB, "ARM-Versatile AB")
.init_irq = versatile_init_irq,
.timer = &versatile_timer,
.init_machine = versatile_init,
+ .dt_compat = versatile_ab_match,
MACHINE_END
diff --git a/arch/arm/mach-versatile/versatile_pb.c b/arch/arm/mach-versatile/versatile_pb.c
index bf46964..eba12fa 100644
--- a/arch/arm/mach-versatile/versatile_pb.c
+++ b/arch/arm/mach-versatile/versatile_pb.c
@@ -106,6 +106,11 @@ static void __init versatile_pb_init(void)
}
}
+static const char *versatile_pb_match[] __initdata = {
+ "arm,versatile-pb",
+ NULL,
+};
+
MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
/* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
.boot_params = 0x00000100,
@@ -113,4 +118,5 @@ MACHINE_START(VERSATILE_PB, "ARM-Versatile PB")
.init_irq = versatile_init_irq,
.timer = &versatile_timer,
.init_machine = versatile_pb_init,
+ .dt_compat = versatile_pb_match,
MACHINE_END
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 6/6] arm/dt: Basic tegra devicetree support
[not found] ` <20110131203626.15105.64302.stgit-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org>
` (3 preceding siblings ...)
2011-01-31 21:04 ` [PATCH v2 5/6] arm/dt: Basic versatile devicetree support Grant Likely
@ 2011-01-31 21:04 ` Grant Likely
4 siblings, 0 replies; 9+ messages in thread
From: Grant Likely @ 2011-01-31 21:04 UTC (permalink / raw)
To: nicolas.pitre-QSEj5FYQhm4dnm+yROfE0A, Russell King,
Catalin Marinas, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, buytenh@
This patch adds adds very basic support for booting tegra with a
device tree. It simply allows the existing machine_descs to match
against the tegra compatible values so that the kernel can boot.
Kernel parameters and the initrd pointer is read out of the tree
instead of atags.
This is not complete device tree support. This change will be
reverted when a new machine_desc is added that can populate the
device registrations directly from data in the tree instead of using
hard coded data. That change will be made in a future patch.
v2: Fixed cut-and-paste error in commit text
Signed-off-by: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---
arch/arm/mach-tegra/board-harmony.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index b9dbdb1..99884e9 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -113,6 +113,11 @@ static void __init tegra_harmony_init(void)
platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
}
+static const char * tegra_harmony_board_compat[] = {
+ "nvidia,harmony",
+ NULL
+};
+
MACHINE_START(HARMONY, "harmony")
.boot_params = 0x00000100,
.fixup = tegra_harmony_fixup,
@@ -120,4 +125,5 @@ MACHINE_START(HARMONY, "harmony")
.init_machine = tegra_harmony_init,
.map_io = tegra_map_common_io,
.timer = &tegra_timer,
+ .dt_compat = tegra_harmony_board_compat,
MACHINE_END
^ permalink raw reply related [flat|nested] 9+ messages in thread