diff mbox

[RFC,1/2] config: introduce CONFIG_FSP in Makefiles

Message ID 1460549184-24312-1-git-send-email-clg@fr.ibm.com
State RFC
Headers show

Commit Message

Cédric Le Goater April 13, 2016, 12:06 p.m. UTC
Here is a quick patch to remove support of FSP based systems in
skiboot. The goal is to reduce the size of skiboot which is limited to
1MB on OpenPOWER systems.

To activate support, one needs to add CONFIG_FSP=1 to the make command
line.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
---
 Makefile.main          |    4 ++++
 hw/Makefile.inc        |    2 ++
 platforms/Makefile.inc |    4 ++++
 3 files changed, 10 insertions(+)

Comments

Stewart Smith May 10, 2016, 5:27 a.m. UTC | #1
Cédric Le Goater <clg@fr.ibm.com> writes:
> Here is a quick patch to remove support of FSP based systems in
> skiboot. The goal is to reduce the size of skiboot which is limited to
> 1MB on OpenPOWER systems.
>
> To activate support, one needs to add CONFIG_FSP=1 to the make command
> line.
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>

This is similar to my initial patch for it:
id:1447881172-16680-1-git-send-email-stewart@linux.vnet.ibm.com
https://patchwork.ozlabs.org/patch/546209/

However... we do have the possibility of just using xz compressed
skiboot instead! The hostboot support for this was merged, although
there were going to be some changes made so that it didn't require
changes to PNOR layout.

Elizabeth - are these changes going in soon?
Elizabeth Liner May 10, 2016, 4:01 p.m. UTC | #2
Stewart,

I'm hoping to get to the changes some time this month, but I'm not sure if
I have the time at this moment.
However, I can try to make this a priority if you think it would be useful
for the skiboot team.

Best,
Elizabeth
--
Elizabeth Liner
Power Firmware Development - Hostboot
IBM Systems & Technology Group - Austin, TX
eliner@us.ibm.com
512-286-6493




From:	Stewart Smith <stewart@linux.vnet.ibm.com>
To:	Cédric Le Goater <clg@fr.ibm.com>, skiboot@lists.ozlabs.org,
            Elizabeth Liner/Austin/IBM@IBMUS
Cc:	Cédric Le Goater <clg@fr.ibm.com>
Date:	05/10/2016 12:27 AM
Subject:	Re: [RFC PATCH 1/2] config: introduce CONFIG_FSP in Makefiles



Cédric Le Goater <clg@fr.ibm.com> writes:
> Here is a quick patch to remove support of FSP based systems in
> skiboot. The goal is to reduce the size of skiboot which is limited to
> 1MB on OpenPOWER systems.
>
> To activate support, one needs to add CONFIG_FSP=1 to the make command
> line.
>
> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>

This is similar to my initial patch for it:
id:1447881172-16680-1-git-send-email-stewart@linux.vnet.ibm.com
https://patchwork.ozlabs.org/patch/546209/

However... we do have the possibility of just using xz compressed
skiboot instead! The hostboot support for this was merged, although
there were going to be some changes made so that it didn't require
changes to PNOR layout.

Elizabeth - are these changes going in soon?

--
Stewart Smith
OPAL Architect, IBM.
Cédric Le Goater May 10, 2016, 4:16 p.m. UTC | #3
On 05/10/2016 07:27 AM, Stewart Smith wrote:
> Cédric Le Goater <clg@fr.ibm.com> writes:
>> Here is a quick patch to remove support of FSP based systems in
>> skiboot. The goal is to reduce the size of skiboot which is limited to
>> 1MB on OpenPOWER systems.
>>
>> To activate support, one needs to add CONFIG_FSP=1 to the make command
>> line.
>>
>> Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
> 
> This is similar to my initial patch for it:
> id:1447881172-16680-1-git-send-email-stewart@linux.vnet.ibm.com
> https://patchwork.ozlabs.org/patch/546209/

Ah. Sorry I missed that one and from what I read below it might not 
be useful.

Thanks

C.

> However... we do have the possibility of just using xz compressed
> skiboot instead! The hostboot support for this was merged, although
> there were going to be some changes made so that it didn't require
> changes to PNOR layout.
> 
> Elizabeth - are these changes going in soon?
>
Stewart Smith May 11, 2016, 1:54 a.m. UTC | #4
Elizabeth Liner <eliner@us.ibm.com> writes:
> I'm hoping to get to the changes some time this month, but I'm not sure if
> I have the time at this moment.
> However, I can try to make this a priority if you think it would be useful
> for the skiboot team.

It would be useful - even in just a testing capacity, as I'd like to
start doing test runs with a GCOV enabled skiboot so that we can get
code coverage data out of op-test-framework. However, building with GCOV
bloats the binary size to ~1.5MB - which isn't a problem on an FSP
machine, but is for OpenPOWER where we only have the 1MB partition. But
the xz compression will make this work.

Plus, we're getting close to the 1MB size anyway, and I'd prefer to just
compress it on flash (as this also speeds up boot time) than start
having config options to not build everything into skiboot (as this
enables developers/ODMs to get things horribly wrong).
Elizabeth Liner May 11, 2016, 2:39 p.m. UTC | #5
Okay, I will definitely try to get at least a working version done this
month then.
I'll let you know when I have something up in GitHub.

Best,
Elizabeth
--
Elizabeth Liner
Power Firmware Development - Hostboot
IBM Systems & Technology Group - Austin, TX
eliner@us.ibm.com
512-286-6493




From:	Stewart Smith <stewart@linux.vnet.ibm.com>
To:	Elizabeth Liner/Austin/IBM@IBMUS
Cc:	Cédric Le Goater <clg@fr.ibm.com>, skiboot@lists.ozlabs.org
Date:	05/10/2016 08:55 PM
Subject:	Re: [RFC PATCH 1/2] config: introduce CONFIG_FSP in Makefiles



Elizabeth Liner <eliner@us.ibm.com> writes:
> I'm hoping to get to the changes some time this month, but I'm not sure
if
> I have the time at this moment.
> However, I can try to make this a priority if you think it would be
useful
> for the skiboot team.

It would be useful - even in just a testing capacity, as I'd like to
start doing test runs with a GCOV enabled skiboot so that we can get
code coverage data out of op-test-framework. However, building with GCOV
bloats the binary size to ~1.5MB - which isn't a problem on an FSP
machine, but is for OpenPOWER where we only have the 1MB partition. But
the xz compression will make this work.

Plus, we're getting close to the 1MB size anyway, and I'd prefer to just
compress it on flash (as this also speeds up boot time) than start
having config options to not build everything into skiboot (as this
enables developers/ODMs to get things horribly wrong).

--
Stewart Smith
OPAL Architect, IBM.
Elizabeth Liner July 12, 2016, 2:19 p.m. UTC | #6
Hey Stewart,

I was able to work on the XZ changes and recently got it merged and
reviewed:
	Hostboot p8 review:
https://ralgit01.raleigh.ibm.com/gerrit1/#/c/24609/
	Op-build pull request:
https://github.com/open-power/op-build/pull/520
	Open-power/pnor pull request:
https://github.com/open-power/pnor/pull/48

So now, you should be able to compress and decompress a section without
additional pnor changes with op-build/master-next.  However we currently
are not automatically processing if a section is compressed or not, so if
you need hostboot to decompress the image, I'll have to add in some
additional functionality.  The skiboot image will be processed though.  Let
me know if you have any trouble with the compression/decompression or if
you want to add in another section.

Also, here's the compression command that works with the xz decompressor:
xz --check=crc32 $image

Best,
Elizabeth
--
Elizabeth Liner
Power Firmware Development - Hostboot
IBM Systems & Technology Group - Austin, TX
eliner@us.ibm.com
512-286-6493




From:	Stewart Smith <stewart@linux.vnet.ibm.com>
To:	Elizabeth Liner/Austin/IBM@IBMUS
Cc:	Cédric Le Goater <clg@fr.ibm.com>, skiboot@lists.ozlabs.org
Date:	05/10/2016 08:55 PM
Subject:	Re: [RFC PATCH 1/2] config: introduce CONFIG_FSP in Makefiles



Elizabeth Liner <eliner@us.ibm.com> writes:
> I'm hoping to get to the changes some time this month, but I'm not sure
if
> I have the time at this moment.
> However, I can try to make this a priority if you think it would be
useful
> for the skiboot team.

It would be useful - even in just a testing capacity, as I'd like to
start doing test runs with a GCOV enabled skiboot so that we can get
code coverage data out of op-test-framework. However, building with GCOV
bloats the binary size to ~1.5MB - which isn't a problem on an FSP
machine, but is for OpenPOWER where we only have the 1MB partition. But
the xz compression will make this work.

Plus, we're getting close to the 1MB size anyway, and I'd prefer to just
compress it on flash (as this also speeds up boot time) than start
having config options to not build everything into skiboot (as this
enables developers/ODMs to get things horribly wrong).

--
Stewart Smith
OPAL Architect, IBM.
Patrick Williams July 12, 2016, 4:04 p.m. UTC | #7
On Tue, Jul 12, 2016 at 09:19:21AM -0500, Elizabeth Liner wrote:
> 
> Hey Stewart,
> 
> I was able to work on the XZ changes and recently got it merged and
> reviewed:
> 	Hostboot p8 review:
> https://ralgit01.raleigh.ibm.com/gerrit1/#/c/24609/
> 	Op-build pull request:
> https://github.com/open-power/op-build/pull/520
> 	Open-power/pnor pull request:
> https://github.com/open-power/pnor/pull/48
> 
> So now, you should be able to compress and decompress a section without
> additional pnor changes with op-build/master-next.  However we currently
> are not automatically processing if a section is compressed or not, so if
> you need hostboot to decompress the image, I'll have to add in some
> additional functionality.  The skiboot image will be processed though.  Let
> me know if you have any trouble with the compression/decompression or if
> you want to add in another section.

Since we no longer need PNOR flags to enable this, I wonder if we should
enable this by default for the skiboot partition.  Any opinions on this?

> 
> Also, here's the compression command that works with the xz decompressor:
> xz --check=crc32 $image
> 
> Best,
> Elizabeth
> --
> Elizabeth Liner
> Power Firmware Development - Hostboot
> IBM Systems & Technology Group - Austin, TX
> eliner@us.ibm.com
> 512-286-6493
> 
> 
> 
> 
> From:	Stewart Smith <stewart@linux.vnet.ibm.com>
> To:	Elizabeth Liner/Austin/IBM@IBMUS
> Cc:	Cédric Le Goater <clg@fr.ibm.com>, skiboot@lists.ozlabs.org
> Date:	05/10/2016 08:55 PM
> Subject:	Re: [RFC PATCH 1/2] config: introduce CONFIG_FSP in Makefiles
> 
> 
> 
> Elizabeth Liner <eliner@us.ibm.com> writes:
> > I'm hoping to get to the changes some time this month, but I'm not sure
> if
> > I have the time at this moment.
> > However, I can try to make this a priority if you think it would be
> useful
> > for the skiboot team.
> 
> It would be useful - even in just a testing capacity, as I'd like to
> start doing test runs with a GCOV enabled skiboot so that we can get
> code coverage data out of op-test-framework. However, building with GCOV
> bloats the binary size to ~1.5MB - which isn't a problem on an FSP
> machine, but is for OpenPOWER where we only have the 1MB partition. But
> the xz compression will make this work.
> 
> Plus, we're getting close to the 1MB size anyway, and I'd prefer to just
> compress it on flash (as this also speeds up boot time) than start
> having config options to not build everything into skiboot (as this
> enables developers/ODMs to get things horribly wrong).
> 
> --
> Stewart Smith
> OPAL Architect, IBM.
> 
> 



> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
Stewart Smith July 12, 2016, 10:01 p.m. UTC | #8
Patrick Williams <patrick@stwcx.xyz> writes:
> On Tue, Jul 12, 2016 at 09:19:21AM -0500, Elizabeth Liner wrote:
>> 
>> Hey Stewart,
>> 
>> I was able to work on the XZ changes and recently got it merged and
>> reviewed:
>> 	Hostboot p8 review:
>> https://ralgit01.raleigh.ibm.com/gerrit1/#/c/24609/
>> 	Op-build pull request:
>> https://github.com/open-power/op-build/pull/520
>> 	Open-power/pnor pull request:
>> https://github.com/open-power/pnor/pull/48
>> 
>> So now, you should be able to compress and decompress a section without
>> additional pnor changes with op-build/master-next.  However we currently
>> are not automatically processing if a section is compressed or not, so if
>> you need hostboot to decompress the image, I'll have to add in some
>> additional functionality.  The skiboot image will be processed though.  Let
>> me know if you have any trouble with the compression/decompression or if
>> you want to add in another section.
>
> Since we no longer need PNOR flags to enable this, I wonder if we should
> enable this by default for the skiboot partition.  Any opinions on
> this?

I think we should. It ever so slightly speeds up boot plus it'll mean
we'll detect corruption in the skiboot partition.

Current skiboot master builds a skiboot.lid.xz alongside skiboot.lid -
and I can backport that if it makes it easier.
Stewart Smith July 12, 2016, 10:02 p.m. UTC | #9
Elizabeth Liner <eliner@us.ibm.com> writes:
> Hey Stewart,
>
> I was able to work on the XZ changes and recently got it merged and
> reviewed:
> 	Hostboot p8 review:
> https://ralgit01.raleigh.ibm.com/gerrit1/#/c/24609/
> 	Op-build pull request:
> https://github.com/open-power/op-build/pull/520
> 	Open-power/pnor pull request:
> https://github.com/open-power/pnor/pull/48

Yep, I've been playing with it over the past week or so :)
Patrick Williams July 12, 2016, 10:10 p.m. UTC | #10
On Wed, Jul 13, 2016 at 08:01:42AM +1000, Stewart Smith wrote:
> Patrick Williams <patrick@stwcx.xyz> writes:
> >
> > Since we no longer need PNOR flags to enable this, I wonder if we should
> > enable this by default for the skiboot partition.  Any opinions on
> > this?
> 
> I think we should. It ever so slightly speeds up boot plus it'll mean
> we'll detect corruption in the skiboot partition.
> 
> Current skiboot master builds a skiboot.lid.xz alongside skiboot.lid -
> and I can backport that if it makes it easier.

Backport not required. The PNOR recipe already does the compression if
BR2_TARGET_SKIBOOT_XZ is set.  We just need someone to make a pull
request with that set on all the supported machines.

https://github.com/open-power/op-build/blob/master/openpower/package/openpower-pnor/Config.in#L38
Stewart Smith July 12, 2016, 10:15 p.m. UTC | #11
Patrick Williams <patrick@stwcx.xyz> writes:
> On Wed, Jul 13, 2016 at 08:01:42AM +1000, Stewart Smith wrote:
>> Patrick Williams <patrick@stwcx.xyz> writes:
>> >
>> > Since we no longer need PNOR flags to enable this, I wonder if we should
>> > enable this by default for the skiboot partition.  Any opinions on
>> > this?
>> 
>> I think we should. It ever so slightly speeds up boot plus it'll mean
>> we'll detect corruption in the skiboot partition.
>> 
>> Current skiboot master builds a skiboot.lid.xz alongside skiboot.lid -
>> and I can backport that if it makes it easier.
>
> Backport not required. The PNOR recipe already does the compression if
> BR2_TARGET_SKIBOOT_XZ is set.  We just need someone to make a pull
> request with that set on all the supported machines.
>
> https://github.com/open-power/op-build/blob/master/openpower/package/openpower-pnor/Config.in#L38

Sweet. I blame the cold on forgetting that was there.

I don't mind who puts in the pull req for it, if I don't see one some
point today, I'll whip one up.
diff mbox

Patch

Index: skiboot.git/hw/Makefile.inc
===================================================================
--- skiboot.git.orig/hw/Makefile.inc
+++ skiboot.git/hw/Makefile.inc
@@ -9,7 +9,9 @@  HW_OBJS += phb3.o sfc-ctrl.o fake-rtc.o
 HW_OBJS += dts.o lpc-rtc.o npu.o npu-hw-procedures.o
 HW=hw/built-in.o
 
+ifeq ($(CONFIG_FSP),1)
 include $(SRC)/hw/fsp/Makefile.inc
+endif
 include $(SRC)/hw/ec/Makefile.inc
 include $(SRC)/hw/ast-bmc/Makefile.inc
 include $(SRC)/hw/ipmi/Makefile.inc
Index: skiboot.git/platforms/Makefile.inc
===================================================================
--- skiboot.git.orig/platforms/Makefile.inc
+++ skiboot.git/platforms/Makefile.inc
@@ -1,9 +1,13 @@ 
+# -*-Makefile-*-
+
 PLATDIR = platforms
 
 SUBDIRS += $(PLATDIR)
 PLATFORMS = $(PLATDIR)/built-in.o
 
+ifeq ($(CONFIG_FSP),1)
 include $(SRC)/$(PLATDIR)/ibm-fsp/Makefile.inc
+endif
 include $(SRC)/$(PLATDIR)/rhesus/Makefile.inc
 include $(SRC)/$(PLATDIR)/astbmc/Makefile.inc
 include $(SRC)/$(PLATDIR)/mambo/Makefile.inc
Index: skiboot.git/Makefile.main
===================================================================
--- skiboot.git.orig/Makefile.main
+++ skiboot.git/Makefile.main
@@ -65,6 +65,10 @@  CFLAGS += -Wl,--oformat,elf64-powerpc
 CFLAGS += $(call try-cflag,$(CC),-mabi=elfv1)
 CFLAGS += $(call try-cflag,$(CC),-std=gnu11)
 
+ifeq ($(CONFIG_FSP),1)
+CFLAGS += -DCONFIG_FSP
+endif
+
 ifeq ($(SKIBOOT_GCOV),1)
 CFLAGS += -fprofile-arcs -ftest-coverage -DSKIBOOT_GCOV=1
 endif