diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-12-17 23:07:20 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-12-20 00:18:00 -0500 |
commit | e2dc87a1dc7e2ece822eaf703d00f2ecb7c3bc70 (patch) | |
tree | b6cc04b765d379abf7fb363c8f11edaaba5952ee /arch/powerpc/boot | |
parent | a4da2e3ec84cda635ac441efbe781a38d2ee41ee (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/Makefile | 39 | ||||
-rwxr-xr-x | arch/powerpc/boot/wrapper | 2 |
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 | ||
115 | hostprogs-y := addnote addRamDisk hack-coff mktree | 115 | hostprogs-y := addnote addRamDisk hack-coff mktree dtc |
116 | 116 | ||
117 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) | 117 | targets += $(patsubst $(obj)/%,%,$(obj-boot) wrapper.a) |
118 | extra-y := $(obj)/wrapper.a $(obj-plat) $(obj)/empty.o \ | 118 | extra-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 | ||
121 | wrapper :=$(srctree)/$(src)/wrapper | 121 | wrapper :=$(srctree)/$(src)/wrapper |
122 | wrapperbits := $(extra-y) $(addprefix $(obj)/,addnote hack-coff mktree) \ | 122 | wrapperbits := $(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 | |||
129 | dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o srcpos.o checks.o | ||
130 | dtc-objs += dtc-lexer.lex.o dtc-parser.tab.o | ||
131 | dtc-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 | |||
137 | HOSTCFLAGS += -I$(src)/dtc-src/ -I$(src)/libfdt/ | ||
138 | |||
139 | targets += dtc-src/dtc-parser.tab.c | ||
140 | targets += dtc-src/dtc-lexer.lex.c | ||
141 | |||
142 | ifdef DTC_GENPARSER | ||
143 | BISON = bison | ||
144 | FLEX = flex | ||
145 | |||
146 | quiet_cmd_bison = BISON $@ | ||
147 | cmd_bison = $(BISON) -o$@ -d $<; cp $@ $@_shipped | ||
148 | quiet_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) | ||
158 | endif | ||
159 | |||
160 | ############# | ||
126 | # Bits for building various flavours of zImage | 161 | # Bits for building various flavours of zImage |
127 | 162 | ||
128 | ifneq ($(CROSS32_COMPILE),) | 163 | ifneq ($(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" |
128 | fi | 128 | fi |
129 | 129 | ||
130 | if [ -z "$kernel" ]; then | 130 | if [ -z "$kernel" ]; then |