linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper
@ 2018-10-09 23:28 Joel Stanley
  2018-10-09 23:28 ` [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Joel Stanley
  2018-10-09 23:28 ` [PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper Joel Stanley
  0 siblings, 2 replies; 7+ messages in thread
From: Joel Stanley @ 2018-10-09 23:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Oliver O'Halloran

While doing some work on the wrapper I noticed we no longer get serial
output on a powernv system. This is because we compile out the opal
code.

As it turns out, none of the system-specific serial outputs will be
compiled in. This series fixes that. Tested on Qemu powernv, Romulus and
Palmetto.

Joel Stanley (2):
  powerpc/boot: Expose Kconfig symbols to wrapper
  powerpc/boot: Fix opal console in boot wrapper

 arch/powerpc/boot/.gitignore | 1 +
 arch/powerpc/boot/Makefile   | 7 ++++++-
 arch/powerpc/boot/opal.c     | 8 --------
 arch/powerpc/boot/serial.c   | 1 +
 4 files changed, 8 insertions(+), 9 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper
  2018-10-09 23:28 [PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper Joel Stanley
@ 2018-10-09 23:28 ` Joel Stanley
  2018-10-10 12:28   ` Michael Ellerman
  2018-10-15  4:01   ` [1/2] " Michael Ellerman
  2018-10-09 23:28 ` [PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper Joel Stanley
  1 sibling, 2 replies; 7+ messages in thread
From: Joel Stanley @ 2018-10-09 23:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Oliver O'Halloran

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: 866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
 arch/powerpc/boot/.gitignore | 1 +
 arch/powerpc/boot/Makefile   | 7 ++++++-
 arch/powerpc/boot/serial.c   | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/.gitignore b/arch/powerpc/boot/.gitignore
index f92d0530ceb1..32034a0cc554 100644
--- a/arch/powerpc/boot/.gitignore
+++ b/arch/powerpc/boot/.gitignore
@@ -44,4 +44,5 @@ fdt_sw.c
 fdt_wip.c
 libfdt.h
 libfdt_internal.h
+autoconf.h
 
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
index 0fb96c26136f..eeed74e0dfca 100644
--- a/arch/powerpc/boot/Makefile
+++ b/arch/powerpc/boot/Makefile
@@ -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)/%: $(srctree)/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 $@ $<
diff --git a/arch/powerpc/boot/serial.c b/arch/powerpc/boot/serial.c
index 48e3743faedf..f045f8494bf9 100644
--- a/arch/powerpc/boot/serial.c
+++ b/arch/powerpc/boot/serial.c
@@ -18,6 +18,7 @@
 #include "stdio.h"
 #include "io.h"
 #include "ops.h"
+#include "autoconf.h"
 
 static int serial_open(void)
 {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper
  2018-10-09 23:28 [PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper Joel Stanley
  2018-10-09 23:28 ` [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Joel Stanley
@ 2018-10-09 23:28 ` Joel Stanley
  1 sibling, 0 replies; 7+ messages in thread
From: Joel Stanley @ 2018-10-09 23:28 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Oliver O'Halloran

As of commit 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit
boot wrapper") the opal code is hidden behind CONFIG_PPC64_BOOT_WRAPPER,
but the boot wrapper avoids include/linux, so it does not get the normal
Kconfig flags.

We can drop the guard entirely as in commit f8e8e69cea49 ("powerpc/boot:
Only build OPAL code when necessary") the makefile only includes opal.c
in the build if CONFIG_PPC64_BOOT_WRAPPER is set.

Fixes: 10c77dba40ff ("powerpc/boot: Fix build failure in 32-bit boot wrapper")
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
I wrote this patch before the kconfig one. We could use autoconf.h, or
fold this in, but I think the clean up of the redundant ifdef is cleaner.

 arch/powerpc/boot/opal.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/powerpc/boot/opal.c b/arch/powerpc/boot/opal.c
index 0272570d02de..dfb199ef5b94 100644
--- a/arch/powerpc/boot/opal.c
+++ b/arch/powerpc/boot/opal.c
@@ -13,8 +13,6 @@
 #include <libfdt.h>
 #include "../include/asm/opal-api.h"
 
-#ifdef CONFIG_PPC64_BOOT_WRAPPER
-
 /* Global OPAL struct used by opal-call.S */
 struct opal {
 	u64 base;
@@ -101,9 +99,3 @@ int opal_console_init(void *devp, struct serial_console_data *scdp)
 
 	return 0;
 }
-#else
-int opal_console_init(void *devp, struct serial_console_data *scdp)
-{
-	return -1;
-}
-#endif /* __powerpc64__ */
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper
  2018-10-09 23:28 ` [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Joel Stanley
@ 2018-10-10 12:28   ` Michael Ellerman
  2018-10-11  0:02     ` Michael Ellerman
  2018-10-15  4:01   ` [1/2] " Michael Ellerman
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2018-10-10 12:28 UTC (permalink / raw)
  To: Joel Stanley, linuxppc-dev; +Cc: Oliver O'Halloran

Joel Stanley <joel@jms.id.au> writes:
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index 0fb96c26136f..eeed74e0dfca 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -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)/%: $(srctree)/include/generated/%
> +	$(Q)cp $< $@
> +

This gives me:
  make[2]: *** No rule to make target '../include/generated/autoconf.h', needed by 'arch/powerpc/boot/autoconf.h'.  Stop.

The ../ is $(srctree).

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper
  2018-10-10 12:28   ` Michael Ellerman
@ 2018-10-11  0:02     ` Michael Ellerman
  2018-10-11  0:06       ` Joel Stanley
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2018-10-11  0:02 UTC (permalink / raw)
  To: Joel Stanley, linuxppc-dev; +Cc: Oliver O'Halloran

Michael Ellerman <mpe@ellerman.id.au> writes:
> Joel Stanley <joel@jms.id.au> writes:
>> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
>> index 0fb96c26136f..eeed74e0dfca 100644
>> --- a/arch/powerpc/boot/Makefile
>> +++ b/arch/powerpc/boot/Makefile
>> @@ -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)/%: $(srctree)/include/generated/%
>> +	$(Q)cp $< $@
>> +
>
> This gives me:
>   make[2]: *** No rule to make target '../include/generated/autoconf.h', needed by 'arch/powerpc/boot/autoconf.h'.  Stop.
>
> The ../ is $(srctree).

Seems autoconf.h is in objtree:

  ~/linux$ make O=build prepare
  ...
  ~/linux$ find . -name autoconf.h
  ./drivers/staging/rtl8723bs/include/autoconf.h
  ./tools/testing/radix-tree/generated/autoconf.h
  ./build/include/generated/autoconf.h


So I'll fix that up.

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper
  2018-10-11  0:02     ` Michael Ellerman
@ 2018-10-11  0:06       ` Joel Stanley
  0 siblings, 0 replies; 7+ messages in thread
From: Joel Stanley @ 2018-10-11  0:06 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: Oliver O'Halloran, linuxppc-dev

On Thu, 11 Oct 2018 at 10:32, Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Michael Ellerman <mpe@ellerman.id.au> writes:
> > Joel Stanley <joel@jms.id.au> writes:
> >> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> >> index 0fb96c26136f..eeed74e0dfca 100644
> >> --- a/arch/powerpc/boot/Makefile
> >> +++ b/arch/powerpc/boot/Makefile
> >> @@ -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)/%: $(srctree)/include/generated/%
> >> +    $(Q)cp $< $@
> >> +
> >
> > This gives me:
> >   make[2]: *** No rule to make target '../include/generated/autoconf.h', needed by 'arch/powerpc/boot/autoconf.h'.  Stop.
> >
> > The ../ is $(srctree).
>
> Seems autoconf.h is in objtree:
>
>   ~/linux$ make O=build prepare
>   ...
>   ~/linux$ find . -name autoconf.h
>   ./drivers/staging/rtl8723bs/include/autoconf.h
>   ./tools/testing/radix-tree/generated/autoconf.h
>   ./build/include/generated/autoconf.h

Ah. That's obvious now that you point it out. Obviously myself and
0day do in-tree builds.

> So I'll fix that up.

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [1/2] powerpc/boot: Expose Kconfig symbols to wrapper
  2018-10-09 23:28 ` [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Joel Stanley
  2018-10-10 12:28   ` Michael Ellerman
@ 2018-10-15  4:01   ` Michael Ellerman
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2018-10-15  4:01 UTC (permalink / raw)
  To: Joel Stanley, linuxppc-dev; +Cc: Oliver O'Halloran

On Tue, 2018-10-09 at 23:28:02 UTC, Joel Stanley wrote:
> 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: 866bfc75f40e ("powerpc: conditionally compile platform-specific serial drivers")
> Signed-off-by: Joel Stanley <joel@jms.id.au>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5e9dcb6188a40e604e66dc30fab30c

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-10-15  4:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-09 23:28 [PATCH 0/2] powerpc/boot: Fix serial output in boot wrapper Joel Stanley
2018-10-09 23:28 ` [PATCH 1/2] powerpc/boot: Expose Kconfig symbols to wrapper Joel Stanley
2018-10-10 12:28   ` Michael Ellerman
2018-10-11  0:02     ` Michael Ellerman
2018-10-11  0:06       ` Joel Stanley
2018-10-15  4:01   ` [1/2] " Michael Ellerman
2018-10-09 23:28 ` [PATCH 2/2] powerpc/boot: Fix opal console in boot wrapper Joel Stanley

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).