From: grant.likely@secretlab.ca (Grant Likely)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/7] arm-dt: Allow CONFIG_OF on ARM
Date: Fri, 19 Feb 2010 12:27:16 -0700 [thread overview]
Message-ID: <20100219192705.15318.63737.stgit@angua> (raw)
In-Reply-To: <20100219185953.15318.4850.stgit@angua>
From: Jeremy Kerr <jeremy.kerr@canonical.com>
Add some basic empty infrastructure for DT support on ARM.
Signed-off-by: Jeremy Kerr <jeremy.kerr@canonical.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/arm/Kconfig | 6 ++++++
arch/arm/include/asm/prom.h | 19 +++++++++++++++++++
arch/arm/kernel/Makefile | 1 +
arch/arm/kernel/devtree.c | 34 ++++++++++++++++++++++++++++++++++
4 files changed, 60 insertions(+), 0 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 4c33ca8..5a8edc2 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1258,6 +1258,12 @@ endmenu
menu "Boot options"
+config OF
+ bool "Device tree support"
+ select OF_FLATTREE
+ help
+ Support for OpenFirmware-style device trees
+
# 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..20b42fb
--- /dev/null
+++ b/arch/arm/include/asm/prom.h
@@ -0,0 +1,19 @@
+/*
+ * arch/arm/include/asm/prom.h
+ *
+ * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com>
+ *
+ * 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
+
+#include <asm/setup.h>
+
+/* _ALIGN expects upwards alignment */
+#define _ALIGN(addr, size) (((addr)+((size)-1))&(~((size)-1)))
+
+#endif
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index dd00f74..35c8bdf 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -38,6 +38,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_CRUNCH) += crunch.o crunch-bits.o
AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
new file mode 100644
index 0000000..5909d08
--- /dev/null
+++ b/arch/arm/kernel/devtree.c
@@ -0,0 +1,34 @@
+/*
+ * linux/arch/arm/kernel/devtree.c
+ *
+ * Copyright (C) 2009 Canonical Ltd. <jeremy.kerr@canonical.com>
+ *
+ * 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/errno.h>
+#include <linux/types.h>
+#include <linux/bootmem.h>
+#include <linux/of.h>
+#include <linux/of_fdt.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);
+}
+
+u64 __init early_init_dt_alloc_memory_arch(u64 size, u64 align)
+{
+ return __pa(__alloc_bootmem(size, align, __pa(MAX_DMA_ADDRESS)));
+}
+
+void early_init_dt_scan_chosen_arch(unsigned long node) { }
+
+void early_init_dt_setup_initrd_arch(unsigned long start,
+ unsigned long end) { }
next prev parent reply other threads:[~2010-02-19 19:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-19 19:26 [PATCH 0/7] Add basic ARM device tree support Grant Likely
2010-02-19 19:27 ` [PATCH 1/7] arm-dt: Add ATAG_DEVTREE tag Grant Likely
2010-02-19 19:27 ` Grant Likely [this message]
2010-02-19 19:27 ` [PATCH 3/7] arm-dt: add devictree node reference to dev_archdata Grant Likely
2010-02-19 19:27 ` [PATCH 4/7] arm/devicetree: Reserve memory used by dtb blob Grant Likely
2010-02-19 19:28 ` [PATCH 5/7] arm-dt: unflatten device tree Grant Likely
2010-02-19 19:29 ` [RFC/PATCH 6/7] arm/devicetree: Allow .dtb to be carried in the zImage payload Grant Likely
2010-02-19 19:29 ` [PATCH 7/7] arm/boot/hack: set uImage load address to 0x81000000 Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100219192705.15318.63737.stgit@angua \
--to=grant.likely@secretlab.ca \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).