[Pdbg] [PATCH 16/18] main: Use auto-generated device tree headers
Amitay Isaacs
amitay at ozlabs.org
Wed May 16 16:17:34 AEST 2018
From: Amitay Isaacs <amitay at gmail.com>
Signed-off-by: Amitay Isaacs <amitay at gmail.com>
---
Makefile.am | 4 +++-
src/main.c | 32 ++++++++++++--------------------
2 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index d87ab9f..a3a0331 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,6 +15,8 @@ DT = fake.dts \
DT_objects = $(DT:.dts=.dtb.o)
DT_headers = $(DT:.dts=.dt.h)
+BUILT_SOURCES = $(DT_headers)
+
pdbg_SOURCES = \
src/main.c src/cfam.c src/scom.c src/reg.c src/mem.c src/thread.c \
src/ring.c src/htm.c src/options_ at ARCH@.c
@@ -89,4 +91,4 @@ p9z-fsi.dtb: p9z-fsi.dts p9-fsi.dtsi
%.dtb.o: %.dtb
$(AM_V_CC)$(CC) -c $(srcdir)/template.S -DSYMBOL_PREFIX=$(shell echo $@ | tr '.-' '_') -DFILENAME=\"$<\" -o $@
-MOSTLYCLEANFILES = *.dtb
+MOSTLYCLEANFILES = *.dtb *.dt.h
diff --git a/src/main.c b/src/main.c
index 6e28a03..b007728 100644
--- a/src/main.c
+++ b/src/main.c
@@ -48,6 +48,18 @@
#define PR_ERROR(x, args...) \
fprintf(stderr, "%s: " x, __FUNCTION__, ##args)
+#include "fake.dt.h"
+
+#include "p8-i2c.dt.h"
+#include "p8-fsi.dt.h"
+#include "p8-host.dt.h"
+
+#include "p9w-fsi.dt.h"
+#include "p9r-fsi.dt.h"
+#include "p9z-fsi.dt.h"
+#include "p9-kernel.dt.h"
+#include "p9-host.dt.h"
+
#define THREADS_PER_CORE 8
static enum backend backend = KERNEL;
@@ -347,26 +359,6 @@ void for_each_target_release(char *class)
}
}
-/* TODO: It would be nice to have a more dynamic way of doing this */
-extern unsigned char _binary_p8_i2c_dtb_o_start;
-extern unsigned char _binary_p8_i2c_dtb_o_end;
-extern unsigned char _binary_p8_fsi_dtb_o_start;
-extern unsigned char _binary_p8_fsi_dtb_o_end;
-extern unsigned char _binary_p9w_fsi_dtb_o_start;
-extern unsigned char _binary_p9w_fsi_dtb_o_end;
-extern unsigned char _binary_p9r_fsi_dtb_o_start;
-extern unsigned char _binary_p9r_fsi_dtb_o_end;
-extern unsigned char _binary_p9z_fsi_dtb_o_start;
-extern unsigned char _binary_p9z_fsi_dtb_o_end;
-extern unsigned char _binary_p9_kernel_dtb_o_start;
-extern unsigned char _binary_p9_kernel_dtb_o_end;
-extern unsigned char _binary_fake_dtb_o_start;
-extern unsigned char _binary_fake_dtb_o_end;
-extern unsigned char _binary_p8_host_dtb_o_start;
-extern unsigned char _binary_p8_host_dtb_o_end;
-extern unsigned char _binary_p9_host_dtb_o_start;
-extern unsigned char _binary_p9_host_dtb_o_end;
-
static int target_selection(void)
{
struct pdbg_target *fsi, *pib, *chip, *thread;
--
2.17.0
More information about the Pdbg
mailing list