summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-04-15 18:16:54 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-30 06:08:07 -0700
commit3c49473cd607bc5debbbbd22118bad18d11b8611 (patch)
treefd1fa234a159a3436559b8f3a79a81615041bd50 /chip
parent631000bdf478b8ad206753f4ffeb2af879129866 (diff)
downloadchrome-ec-3c49473cd607bc5debbbbd22118bad18d11b8611.tar.gz
mt_scp: Generate IPI tables with util gen_ipi_table.
IPI table is board-specific. This CL removes the original IPI table in chip layer, and uses gen_ipi_table to generate the table for each board to reduce the maintenance effort. TEST=make BOARD=kukui_scp, and see build/kukui_scp/ipi_table_gen.inc exists. Push to Kukui, and see SCP boots. TEST=modify IPI_COUNT in board.h and see it generates a new ipi_table_gen.inc BUG=b:130508869 BRANCH=None Change-Id: I0c05319447d15917e8833aa80d61166c4e396370 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1568890 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/mt_scp/build.mk5
-rw-r--r--chip/mt_scp/ipi_table.c30
2 files changed, 10 insertions, 25 deletions
diff --git a/chip/mt_scp/build.mk b/chip/mt_scp/build.mk
index af1ba08170..aecdb8beaf 100644
--- a/chip/mt_scp/build.mk
+++ b/chip/mt_scp/build.mk
@@ -12,6 +12,11 @@ CFLAGS_CPU+=-march=armv7e-m -mcpu=cortex-m4
# Required chip modules
chip-y=clock.o gpio.o memmap.o system.o uart.o
+ifeq ($(CONFIG_IPI),y)
+$(out)/RO/chip/$(CHIP)/ipi_table.o: $(out)/ipi_table_gen.inc
+$(out)/RW/chip/$(CHIP)/ipi_table.o: $(out)/ipi_table_gen.inc
+endif
+
# Optional chip modules
chip-$(CONFIG_COMMON_TIMER)+=hrtimer.o
chip-$(CONFIG_I2C)+=i2c.o
diff --git a/chip/mt_scp/ipi_table.c b/chip/mt_scp/ipi_table.c
index aaeadb40d5..8569ab24a7 100644
--- a/chip/mt_scp/ipi_table.c
+++ b/chip/mt_scp/ipi_table.c
@@ -53,35 +53,15 @@ const int ipi_wakeup_undefined;
#endif /* PASS == 2 */
/*
- * Table to hold all the IPI handler function pointer.
+ * Include generated IPI table (by util/gen_ipi_table). The contents originate
+ * from IPI_COUNT definition in board.h
*/
-table(ipi_handler_t, ipi_handler_table,
- ipi_x_func(handler, ipi_arguments, 0)
- ipi_x_func(handler, ipi_arguments, 1)
- ipi_x_func(handler, ipi_arguments, 2)
- ipi_x_func(handler, ipi_arguments, 3)
- ipi_x_func(handler, ipi_arguments, 4)
- ipi_x_func(handler, ipi_arguments, 5)
- ipi_x_func(handler, ipi_arguments, 6)
- ipi_x_func(handler, ipi_arguments, 7)
-);
-
-/*
- * Table to hold all the wake-up bool address.
- */
-table(int*, ipi_wakeup_table,
- ipi_x_var(wakeup, 0)
- ipi_x_var(wakeup, 1)
- ipi_x_var(wakeup, 2)
- ipi_x_var(wakeup, 3)
- ipi_x_var(wakeup, 4)
- ipi_x_var(wakeup, 5)
- ipi_x_var(wakeup, 6)
- ipi_x_var(wakeup, 7)
-);
+#include "ipi_table_gen.inc"
#if PASS == 1
#undef PASS
#define PASS 2
#include "ipi_table.c"
+BUILD_ASSERT(ARRAY_SIZE(ipi_handler_table) == IPI_COUNT);
+BUILD_ASSERT(ARRAY_SIZE(ipi_wakeup_table) == IPI_COUNT);
#endif