aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2007-12-17 23:07:20 -0500
committerPaul Mackerras <paulus@samba.org>2007-12-20 00:18:00 -0500
commite2dc87a1dc7e2ece822eaf703d00f2ecb7c3bc70 (patch)
treeb6cc04b765d379abf7fb363c8f11edaaba5952ee /arch/powerpc/boot
parenta4da2e3ec84cda635ac441efbe781a38d2ee41ee (diff)
[POWERPC] Use embedded dtc in kernel builds
This patch alters the kernel makefiles to build dtc from the sources embedded in the previous patch. It also changes the arch/powerpc/boot/wrapper script to use the embedded dtc, rather than expecting a copy of dtc already installed on the system. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r--arch/powerpc/boot/Makefile39
-rwxr-xr-xarch/powerpc/boot/wrapper2
2 files changed, 38 insertions, 3 deletions
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index af01b4f8ade0..9149bb8ed03c 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -112,17 +112,52 @@ $(patsubst %.S,%.o, $(filter %.S, $(src-boot))): %.o: %.S FORCE
112$(obj)/wrapper.a: $(obj-wlib) FORCE 112$(obj)/wrapper.a: $(obj-wlib) FORCE
113 $(call if_changed,bootar) 113 $(call if_changed,bootar)
114 114
115hostprogs-y := addnote addRamDisk hack-coff mktree 115hostprogs-y := addnote addRamDisk hack-coff mktree dtc
116 116
117targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) 117targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a)
118extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ 118extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \
119 $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds 119 $(obj)/zImage.lds $(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds
120 120
121wrapper :=$(srctree)/$(src)/wrapper 121wrapper :=$(srctree)/$(src)/wrapper
122wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ 122wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree dtc) \
123 $(wrapper) FORCE 123 $(wrapper) FORCE
124 124
125############# 125#############
126# Bits for building dtc
127# DTC_GENPARSER := 1 # Uncomment to rebuild flex/bison output
128
129dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o
130dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o
131dtc-objs := $(addprefix dtc-src/, $(dtc-objs))
132
133# prerequisites on generated files needs to be explicit
134$(obj)/dtc-src/dtc-parser.tab.o: $(obj)/dtc-src/dtc-parser.tab.c $(obj)/dtc-src/dtc-parser.tab.h
135$(obj)/dtc-src/dtc-lexer.lex.o: $(obj)/dtc-src/dtc-lexer.lex.c $(obj)/dtc-src/dtc-parser.tab.h
136
137HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/
138
139targets += dtc-src/dtc-parser.tab.c
140targets += dtc-src/dtc-lexer.lex.c
141
142ifdef DTC_GENPARSER
143BISON = bison
144FLEX = flex
145
146quiet_cmd_bison = BISON $@
147 cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped
148quiet_cmd_flex = FLEX $@
149 cmd_flex = $(FLEX) -o$@ $<; cp $@ $@_shipped
150
151$(obj)/dtc-src/dtc-parser.tab.c: $(src)/dtc-src/dtc-parser.y FORCE
152 $(call if_changed,bison)
153
154$(obj)/dtc-src/dtc-parser.tab.h: $(obj)/dtc-src/dtc-parser.tab.c
155
156$(obj)/dtc-src/dtc-lexer.lex.c: $(src)/dtc-src/dtc-lexer.l FORCE
157 $(call if_changed,flex)
158endif
159
160#############
126# Bits for building various flavours of zImage 161# Bits for building various flavours of zImage
127 162
128ifneq ($(CROSS32_COMPILE),) 163ifneq ($(CROSS32_COMPILE),)
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index a591ced47875..f961cdeb97a2 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -124,7 +124,7 @@ if [ -n "$dts" ]; then
124 if [ -z "$dtb" ]; then 124 if [ -z "$dtb" ]; then
125 dtb="$platform.dtb" 125 dtb="$platform.dtb"
126 fi 126 fi
127 dtc -O dtb -o "$dtb" -b 0 -V 16 "$dts" 127 $object/dtc -O dtb -o "$dtb" -b 0 "$dts"
128fi 128fi
129 129
130if [ -z "$kernel" ]; then 130if [ -z "$kernel" ]; then