diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2007-03-01 14:34:03 +0000 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2007-03-01 14:34:03 +0000 |
commit | 8444eeea45b86374106d4619db89cd3cbb64ec90 (patch) | |
tree | 162b559c3a040ba38d207552d2cb7185960d84ff | |
parent | 31042efaf0ac16f8b19e255f88c843665127f61b (diff) | |
download | ptxdist-8444eeea45b86374106d4619db89cd3cbb64ec90.tar.gz ptxdist-8444eeea45b86374106d4619db89cd3cbb64ec90.tar.xz |
* powerpc: add device tree compiler and oftree support
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@7025 33e552b5-05e3-0310-8538-816dae2090ed
-rw-r--r-- | patches/dtc-git-20070301/generic/dtc-no-error-without-chosen-node.diff | 32 | ||||
-rw-r--r-- | rules/Kconfig | 1 | ||||
-rw-r--r-- | rules/dtc.in | 27 | ||||
-rw-r--r-- | rules/dtc.make | 93 | ||||
-rw-r--r-- | rules/host-dtc.in | 10 | ||||
-rw-r--r-- | rules/host-dtc.make | 97 | ||||
-rw-r--r-- | rules/hosttools.in | 1 |
7 files changed, 261 insertions, 0 deletions
diff --git a/patches/dtc-git-20070301/generic/dtc-no-error-without-chosen-node.diff b/patches/dtc-git-20070301/generic/dtc-no-error-without-chosen-node.diff new file mode 100644 index 000000000..8cc55df29 --- /dev/null +++ b/patches/dtc-git-20070301/generic/dtc-no-error-without-chosen-node.diff @@ -0,0 +1,32 @@ +# +# Submitted-By: Sascha Hauer <s.hauer@pengutronix.de> +# Committed-By: Sascha Hauer <s.hauer@pengutronix.de> +# +# Do not bail out with an error when the chosen node is +# missing. U-Boot expects to have a dtb without chosen +# node, so this is a common usecase and not an error +# +# State: +# +# not submitted +# + +--- + livetree.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: dtc-git-20070301/livetree.c +=================================================================== +--- dtc-git-20070301.orig/livetree.c ++++ dtc-git-20070301/livetree.c +@@ -588,8 +588,8 @@ static int check_chosen(struct node *roo + + chosen = get_subnode(root, "chosen"); + if (! chosen) { +- ERRMSG("Missing /chosen node\n"); +- return 0; ++ WARNMSG("Missing /chosen node\n"); ++ return ok; + } + + CHECK_HAVE_WARN_STRING(chosen, "bootargs"); diff --git a/rules/Kconfig b/rules/Kconfig index a126699eb..d848e8243 100644 --- a/rules/Kconfig +++ b/rules/Kconfig @@ -40,6 +40,7 @@ endmenu menu "Core (Kernel, libc, locales) " source "rules/klibc.in" source "rules/kernel.in" +source "rules/dtc.in" source "rules/libc.in" source "rules/gcclibs.in" source "rules/locales.in" diff --git a/rules/dtc.in b/rules/dtc.in new file mode 100644 index 000000000..0b9df8032 --- /dev/null +++ b/rules/dtc.in @@ -0,0 +1,27 @@ +menuconfig DTC + bool + depends on ARCH_PPC + select HOST_DTC + select KERNEL + prompt "Build device tree " + default y + help + Select this to build a device tree for your board. + You will find the device tree binary blob under + images/oftree in your workspace. + + +config DTC_OFTREE_DTS + string "source dts file" + depends on DTC + default "${KERNEL_DIR}/arch/powerpc/boot/dts/pcm030.dts" + help + Select the dts file to use for the device tree binary + blob generation. Default is to use the one shipped with + the kernel. + +config DTC_EXTRA_ARGS + string "extra options passed to dtc" + depends on DTC + default "-V 0x10" + diff --git a/rules/dtc.make b/rules/dtc.make new file mode 100644 index 000000000..27333169b --- /dev/null +++ b/rules/dtc.make @@ -0,0 +1,93 @@ +# -*-makefile-*- +# $Id: template 6655 2007-01-02 12:55:21Z rsc $ +# +# Copyright (C) 2007 by Sascha Hauer +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_DTC) += dtc + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +dtc_get: $(STATEDIR)/dtc.get + +$(STATEDIR)/dtc.get: $(dtc_get_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +$(DTC_SOURCE): + @$(call targetinfo, $@) + @$(call get, DTC) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +dtc_extract: $(STATEDIR)/dtc.extract + +$(STATEDIR)/dtc.extract: $(dtc_extract_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +dtc_prepare: $(STATEDIR)/dtc.prepare + +$(STATEDIR)/dtc.prepare: $(dtc_prepare_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +dtc_compile: $(STATEDIR)/dtc.compile + +$(STATEDIR)/dtc.compile: $(dtc_compile_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +dtc_install: $(STATEDIR)/dtc.install + +$(STATEDIR)/dtc.install: $(dtc_install_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +dtc_targetinstall: $(STATEDIR)/dtc.targetinstall + +$(STATEDIR)/dtc.targetinstall: $(dtc_targetinstall_deps_default) + @$(call targetinfo, $@) + PATH=$(HOST_PATH) dtc $(PTXCONF_DTC_EXTRA_ARGS) -I dts -O dtb \ + $(PTXCONF_DTC_OFTREE_DTS) > $(IMAGEDIR)/oftree + + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +dtc_clean: + rm -rf $(STATEDIR)/dtc.* + rm -rf $(IMAGEDIR)/dtc_* + rm -rf $(DTC_DIR) + +# vim: syntax=make diff --git a/rules/host-dtc.in b/rules/host-dtc.in new file mode 100644 index 000000000..c017131d8 --- /dev/null +++ b/rules/host-dtc.in @@ -0,0 +1,10 @@ +menuconfig HOST_DTC + depends on ARCH_PPC + bool + prompt "device tree compiler (dtc)" + default y + help + Kernels compiled with arch=powerpc need a device tree + for startup. The device tree compiler (DTC) is used + to generate this tree from a dts (device tree source) + file usually shipped with the kernel. diff --git a/rules/host-dtc.make b/rules/host-dtc.make new file mode 100644 index 000000000..8a2819781 --- /dev/null +++ b/rules/host-dtc.make @@ -0,0 +1,97 @@ +# -*-makefile-*- +# $Id$ +# +# Copyright (C) 2007 by Sascha Hauer +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +HOST_PACKAGES-$(PTXCONF_HOST_DTC) += host-dtc + +# +# Paths and names +# +HOST_DTC_VERSION := git-20070301 +HOST_DTC := dtc-$(HOST_DTC_VERSION) +HOST_DTC_SUFFIX := tar.gz +HOST_DTC_URL := http://www.pengutronix.de/software/ptxdist/temporary-src/$(HOST_DTC).$(HOST_DTC_SUFFIX) +HOST_DTC_SOURCE := $(SRCDIR)/$(HOST_DTC).$(HOST_DTC_SUFFIX) +HOST_DTC_DIR := $(HOST_BUILDDIR)/$(HOST_DTC) + +# ---------------------------------------------------------------------------- +# Get +# ---------------------------------------------------------------------------- + +host-dtc_get: $(STATEDIR)/host-dtc.get + +$(STATEDIR)/host-dtc.get: $(host-dtc_get_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +$(HOST_DTC_SOURCE): + @$(call targetinfo, $@) + @$(call get, HOST_DTC) + +# ---------------------------------------------------------------------------- +# Extract +# ---------------------------------------------------------------------------- + +host-dtc_extract: $(STATEDIR)/host-dtc.extract + +$(STATEDIR)/host-dtc.extract: $(host-dtc_extract_deps_default) + @$(call targetinfo, $@) + @$(call clean, $(HOST_DTC_DIR)) + @$(call extract, HOST_DTC, $(HOST_BUILDDIR)) + @$(call patchin, HOST_DTC, $(HOST_DTC_DIR)) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +host-dtc_prepare: $(STATEDIR)/host-dtc.prepare + +HOST_DTC_PATH := PATH=$(HOST_PATH) +HOST_DTC_ENV := $(HOST_ENV) + +$(STATEDIR)/host-dtc.prepare: $(host-dtc_prepare_deps_default) + @$(call targetinfo, $@) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Compile +# ---------------------------------------------------------------------------- + +host-dtc_compile: $(STATEDIR)/host-dtc.compile + +$(STATEDIR)/host-dtc.compile: $(host-dtc_compile_deps_default) + @$(call targetinfo, $@) + cd $(HOST_DTC_DIR) && $(HOST_DTC_PATH) $(MAKE) $(PARALLELMFLAGS) + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +host-dtc_install: $(STATEDIR)/host-dtc.install + +$(STATEDIR)/host-dtc.install: $(host-dtc_install_deps_default) + @$(call targetinfo, $@) + cp $(HOST_DTC_DIR)/dtc $(PTXCONF_HOST_PREFIX)/bin/dtc + @$(call touch, $@) + +# ---------------------------------------------------------------------------- +# Clean +# ---------------------------------------------------------------------------- + +host-dtc_clean: + rm -rf $(STATEDIR)/host-dtc.* + rm -rf $(HOST_DTC_DIR) + +# vim: syntax=make diff --git a/rules/hosttools.in b/rules/hosttools.in index 3bafda20c..76ffb5201 100644 --- a/rules/hosttools.in +++ b/rules/hosttools.in @@ -33,6 +33,7 @@ source "rules/host-mico.in" source "rules/host-qte.in" source "rules/host-slirp.in" source "rules/host-cmake.in" +source "rules/host-dtc.in" comment "------------------------------" comment "Scripting Languages " |