[Skiboot] [PATCH v5 8/9] npu: Move npu.o and npu-hw-procedules.o under CONIFG_P8

Nicholas Piggin npiggin at gmail.com
Mon Dec 20 23:22:51 AEDT 2021

From: Stewart Smith <stewart at flamingspork.com>

Make the P8 NPU code depend on CONFIG_P8. This requires converting
a low level function to a no-op because the HMI NPU handling is not
so cleanly layered.

This saves an extra 6kb of skiboot.lid.xz.

Reviewed-by: Dan Horák <dan at danny.cz>
Signed-off-by: Stewart Smith <stewart at flamingspork.com>
 hw/Makefile.inc | 3 ++-
 include/npu.h   | 7 +++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/Makefile.inc b/hw/Makefile.inc
index 7327cec35..ca548799d 100644
--- a/hw/Makefile.inc
+++ b/hw/Makefile.inc
@@ -4,13 +4,14 @@ HW_OBJS  = xscom.o chiptod.o lpc.o lpc-uart.o psi.o sbe.o
 HW_OBJS += homer.o slw.o occ.o fsi-master.o centaur.o imc.o
 HW_OBJS += nx.o nx-rng.o nx-crypto.o nx-compress.o nx-842.o nx-gzip.o
 HW_OBJS += sfc-ctrl.o fake-rtc.o bt.o p8-i2c.o prd.o
-HW_OBJS += dts.o lpc-rtc.o npu.o npu-hw-procedures.o xive.o phb4.o
+HW_OBJS += dts.o lpc-rtc.o xive.o phb4.o
 HW_OBJS += fake-nvram.o lpc-mbox.o npu2.o npu2-hw-procedures.o
 HW_OBJS += npu2-common.o npu2-opencapi.o phys-map.o sbe-p9.o capp.o
 HW_OBJS += occ-sensor.o vas.o dio-p9.o lpc-port80h.o cache-p9.o
 HW_OBJS += npu-opal.o ocmb.o xive2.o pau.o pau-hw-procedures.o
 ifeq ($(CONFIG_P8),1)
 HW_OBJS += phb3.o sbe-p8.o slw-p8.o
+HW_OBJS += npu.o npu-hw-procedures.o
diff --git a/include/npu.h b/include/npu.h
index 50cc9c9fc..f5707282c 100644
--- a/include/npu.h
+++ b/include/npu.h
@@ -153,7 +153,14 @@ int64_t npu_dev_procedure(void *dev, struct pci_cfg_reg_filter *pcrf,
 			  uint32_t offset, uint32_t len, uint32_t *data,
 			  bool write);
+#ifdef CONFIG_P8
 void npu_set_fence_state(struct npu *p, bool fence);
+static inline void npu_set_fence_state(struct npu *p __unused, bool fence __unused)
+	/* Should never be called */
 void npu_dev_procedure_reset(struct npu_dev *dev);
 #define NPUDBG(p, fmt, a...)	prlog(PR_DEBUG, "NPU%d: " fmt, \

More information about the Skiboot mailing list