[2/2] Always build a skiboot-nofsp.lid
diff mbox series

Message ID 20190715020714.9320-2-stewart@linux.ibm.com
State New
Headers show
Series
  • [1/2] FSP: Move all FSP code under platforms/ibm-fsp/
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot-dco success Signed-off-by present
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot fail Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success Successfully applied on branch master (4db38a36b31045f0a116d388ddeac850b38c8680)

Commit Message

Stewart Smith July 15, 2019, 2:07 a.m. UTC
This means that we never re-introduce FSP dependencies that would cause
a link failure. Due to building in parallel, this should be about a zero
cost to build time too.

Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
---
 Makefile.main          | 32 ++++++++++++++++++++++++++++++--
 asm/real_map-nofsp.S   | 20 ++++++++++++++++++++
 platforms/Makefile.inc |  3 +++
 3 files changed, 53 insertions(+), 2 deletions(-)
 create mode 100644 asm/real_map-nofsp.S

Comments

Oliver O'Halloran July 26, 2019, 5:06 a.m. UTC | #1
On Mon, 2019-07-15 at 12:07 +1000, Stewart Smith wrote:
> This means that we never re-introduce FSP dependencies that would cause
> a link failure. Due to building in parallel, this should be about a zero
> cost to build time too.

I don't really see the point. We've always supported all the platforms
with a single image so why stop doing that now?

If you want to ensure there's no dependencies between platform and core
code then make a skiboot.lid that doesn't include any of the platform
code rather than just skipping the FSP stuff.
Stewart Smith July 29, 2019, 1:34 a.m. UTC | #2
"Oliver O'Halloran" <oohall@gmail.com> writes:
> On Mon, 2019-07-15 at 12:07 +1000, Stewart Smith wrote:
>> This means that we never re-introduce FSP dependencies that would cause
>> a link failure. Due to building in parallel, this should be about a zero
>> cost to build time too.
>
> I don't really see the point. We've always supported all the platforms
> with a single image so why stop doing that now?
>
> If you want to ensure there's no dependencies between platform and core
> code then make a skiboot.lid that doesn't include any of the platform
> code rather than just skipping the FSP stuff.

I have a WIP patch that does pretty much exactly that.

I'm not terribly attached to this patch in its own right, was more of a
"hey, prove that the work moving things around actually worked".

Patch
diff mbox series

diff --git a/Makefile.main b/Makefile.main
index 2a8b48986957..bffe6209ecaf 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -215,6 +215,7 @@  include/asm-offsets.h: asm/asm-offsets.s
 	$(call Q,GN, $(SRC)/make_offsets.sh $< >$@, $@)
 
 TARGET = skiboot
+TARGET_NOFSP = skiboot-nofsp
 
 include $(SRC)/asm/Makefile.inc
 include $(SRC)/core/Makefile.inc
@@ -249,12 +250,20 @@  pflash-coverity:
 
 all: $(SUBDIRS) $(TARGET).lid $(TARGET).lid.xz $(TARGET).map extract-gcov
 all: $(TARGET).lid.stb $(TARGET).lid.xz.stb
+all: $(TARGET_NOFSP).lid $(TARGET_NOFSP).lid.xz $(TARGET_NOFSP).map $(TARGET_NOFSP).lid.xz.stb
+
+BASE_OBJS := $(ASM) $(CORE) $(HW) $(LIBFDT) $(LIBXZ) $(LIBFLASH) $(LIBSTB)
+BASE_OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) $(LIBPORE)
+OBJS += $(BASE_OBJS) $(PLATFORMS)
+NO_FSP_OBJS += $(BASE_OBJS) $(NO_FSP_PLATFORMS)
 
-OBJS := $(ASM) $(CORE) $(HW) $(PLATFORMS) $(LIBFDT) $(LIBXZ) $(LIBFLASH) $(LIBSTB)
-OBJS += $(LIBC) $(CCAN) $(DEVSRC_OBJ) $(LIBPORE)
 OBJS_NO_VER = $(OBJS)
 ALL_OBJS = $(OBJS) version.o
 
+NO_FSP_ALL_OBJS = $(NO_FSP_OBJS) version.o
+NO_FSP_ALL_OBJS_1 = $(TARGET_NOFSP).tmp.a asm/dummy_map.o
+NO_FSP_ALL_OBJS_2 = $(TARGET_NOFSP).tmp.a asm/real_map-nofsp.o
+
 ALL_OBJS_1 = $(TARGET).tmp.a asm/dummy_map.o
 ALL_OBJS_2 = $(TARGET).tmp.a asm/real_map.o
 
@@ -270,18 +279,37 @@  $(TARGET).lid.stb: $(TARGET).lid libstb/create-container
 $(TARGET).lid.xz.stb: $(TARGET).lid.xz libstb/create-container
 	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
 
+$(TARGET_NOFSP).lid.stb: $(TARGET_NOFSP).lid libstb/create-container
+	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
+
+$(TARGET_NOFSP).lid.xz.stb: $(TARGET_NOFSP).lid.xz libstb/create-container
+	$(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
+
 $(TARGET).tmp.a: $(ALL_OBJS)
 	@rm -f $(TARGET).tmp.a
 	$(call Q,AR, $(AR) rcsTPD $@ $(ALL_OBJS), $@)
 
+$(TARGET_NOFSP).tmp.a: $(NO_FSP_ALL_OBJS)
+	@rm -f $(TARGET_NOFSP).tmp.a
+	$(call Q,AR, $(AR) rcsTPD $@ $(NO_FSP_ALL_OBJS), $@)
+
 $(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL)
 	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_1), $@)
 
+$(TARGET_NOFSP).tmp.elf: $(NO_FSP_ALL_OBJS_1) $(TARGET).lds $(KERNEL)
+	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(NO_FSP_ALL_OBJS_1), $@)
+
 asm/real_map.o : $(TARGET).tmp.map
 
+asm/real_map-nofsp.o : $(TARGET_NOFSP).tmp.map
+
 $(TARGET).elf: $(ALL_OBJS_2) $(TARGET).lds $(KERNEL)
 	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(ALL_OBJS_2), $@)
 
+$(TARGET_NOFSP).elf: $(NO_FSP_ALL_OBJS_2) $(TARGET).lds $(KERNEL)
+	$(call Q,LD, $(LD) $(LDFLAGS_FINAL) -o $@ -T $(TARGET).lds $(NO_FSP_ALL_OBJS_2), $@)
+
+
 $(SUBDIRS):
 	$(call Q,MKDIR,mkdir -p $@, $@)
 
diff --git a/asm/real_map-nofsp.S b/asm/real_map-nofsp.S
new file mode 100644
index 000000000000..4ab9c229fa69
--- /dev/null
+++ b/asm/real_map-nofsp.S
@@ -0,0 +1,20 @@ 
+/* Copyright 2013-2014 IBM Corp.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * 	http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+	.section ".sym_map","a"
+	.incbin "skiboot-nofsp.tmp.map"
+ 
diff --git a/platforms/Makefile.inc b/platforms/Makefile.inc
index 3269532a3bdc..85c9f1899ac0 100644
--- a/platforms/Makefile.inc
+++ b/platforms/Makefile.inc
@@ -2,6 +2,7 @@  PLATDIR = platforms
 
 SUBDIRS += $(PLATDIR)
 PLATFORMS = $(PLATDIR)/built-in.a
+NO_FSP_PLATFORMS = $(PLATDIR)/nofsp-built-in.a
 
 include $(SRC)/$(PLATDIR)/ibm-fsp/Makefile.inc
 include $(SRC)/$(PLATDIR)/rhesus/Makefile.inc
@@ -10,3 +11,5 @@  include $(SRC)/$(PLATDIR)/mambo/Makefile.inc
 include $(SRC)/$(PLATDIR)/qemu/Makefile.inc
 
 $(PLATFORMS): $(IBM_FSP) $(RHESUS) $(ASTBMC) $(MAMBO) $(QEMU)
+
+$(NO_FSP_PLATFORMS): $(RHESUS) $(ASTBMC) $(MAMBO) $(QEMU)