Skip to content

Commit

Permalink
powerpc/boot: Expose Kconfig symbols to wrapper
Browse files Browse the repository at this point in the history
Currently the wrapper is built without including anything in
$(src)/include/, which means there are no CONFIG_ symbols defined.
This means the platform specific serial drivers were never enabled.

We now copy the definitions into the boot directory, so any C file can
now include autoconf.h to depend on configuration options.

Fixes: 866bfc7 ("powerpc: conditionally compile platform-specific serial drivers")
Signed-off-by: Joel Stanley <[email protected]>
[mpe: Fix to use $(objtree) to find autoconf.h]
Signed-off-by: Michael Ellerman <[email protected]>
  • Loading branch information
shenki authored and mpe committed Oct 13, 2018
1 parent 719736e commit 5e9dcb6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions arch/powerpc/boot/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@ fdt_sw.c
fdt_wip.c
libfdt.h
libfdt_internal.h
autoconf.h

7 changes: 6 additions & 1 deletion arch/powerpc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,14 @@ $(obj)/empty.c:
$(obj)/zImage.coff.lds $(obj)/zImage.ps3.lds : $(obj)/%: $(srctree)/$(src)/%.S
$(Q)cp $< $@

$(obj)/serial.c: $(obj)/autoconf.h

$(obj)/autoconf.h: $(obj)/%: $(objtree)/include/generated/%
$(Q)cp $< $@

clean-files := $(zlib-) $(zlibheader-) $(zliblinuxheader-) \
$(zlib-decomp-) $(libfdt) $(libfdtheader) \
empty.c zImage.coff.lds zImage.ps3.lds zImage.lds
autoconf.h empty.c zImage.coff.lds zImage.ps3.lds zImage.lds

quiet_cmd_bootcc = BOOTCC $@
cmd_bootcc = $(BOOTCC) -Wp,-MD,$(depfile) $(BOOTCFLAGS) -c -o $@ $<
Expand Down
1 change: 1 addition & 0 deletions arch/powerpc/boot/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "stdio.h"
#include "io.h"
#include "ops.h"
#include "autoconf.h"

static int serial_open(void)
{
Expand Down

0 comments on commit 5e9dcb6

Please sign in to comment.