summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@chromium.org>2021-06-24 17:17:39 +0800
committerCommit Bot <commit-bot@chromium.org>2021-06-25 03:42:30 +0000
commitb409fd3b5ac6a82b6851f2e9af49761ee2d4766c (patch)
tree780a069f10a57222362a209abee19b27b7de9076
parentcf92cf3c6c4135b511c8f7f6bc83036167b7c735 (diff)
downloadchrome-ec-b409fd3b5ac6a82b6851f2e9af49761ee2d4766c.tar.gz
chip/mt_scp: move rv32i specific to common folder
BRANCH=none BUG=b:191835814 TEST=make BOARD=asurada_scp && make BOARD=cherry_scp && make BOARD=kukui_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I35e9fd5f7d3e83d35d09a093be09b194c821f63e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2985060 Reviewed-by: Eric Yilun Lin <yllin@google.com>
-rw-r--r--board/asurada_scp/build.mk2
-rw-r--r--board/cherry_scp/build.mk4
-rw-r--r--chip/mt8192_scp/build.mk28
-rw-r--r--chip/mt_scp/build.mk9
-rw-r--r--chip/mt_scp/config_chip.h4
-rw-r--r--chip/mt_scp/rv32i_common/build.mk28
-rw-r--r--chip/mt_scp/rv32i_common/cache.c (renamed from chip/mt8192_scp/cache.c)0
-rw-r--r--chip/mt_scp/rv32i_common/cache.h (renamed from chip/mt8192_scp/cache.h)0
-rw-r--r--chip/mt_scp/rv32i_common/clock.c (renamed from chip/mt8192_scp/clock.c)0
-rw-r--r--chip/mt_scp/rv32i_common/clock_chip.h (renamed from chip/mt8192_scp/clock_chip.h)0
-rw-r--r--chip/mt_scp/rv32i_common/config_chip.h (renamed from chip/mt8192_scp/config_chip.h)0
-rw-r--r--chip/mt_scp/rv32i_common/csr.h (renamed from chip/mt8192_scp/csr.h)0
-rw-r--r--chip/mt_scp/rv32i_common/gpio.c (renamed from chip/mt8192_scp/gpio.c)0
-rw-r--r--chip/mt_scp/rv32i_common/hostcmd.c (renamed from chip/mt8192_scp/hostcmd.c)0
-rw-r--r--chip/mt_scp/rv32i_common/hostcmd.h (renamed from chip/mt8192_scp/hostcmd.h)0
-rw-r--r--chip/mt_scp/rv32i_common/hrtimer.c (renamed from chip/mt8192_scp/hrtimer.c)0
-rw-r--r--chip/mt_scp/rv32i_common/intc.c (renamed from chip/mt8192_scp/intc.c)0
-rw-r--r--chip/mt_scp/rv32i_common/ipi.c (renamed from chip/mt8192_scp/ipi.c)0
-rw-r--r--chip/mt_scp/rv32i_common/ipi_chip.h (renamed from chip/mt8192_scp/ipi_chip.h)0
-rw-r--r--chip/mt_scp/rv32i_common/ipi_table.c (renamed from chip/mt8192_scp/ipi_table.c)0
-rw-r--r--chip/mt_scp/rv32i_common/memmap.c (renamed from chip/mt8192_scp/memmap.c)0
-rw-r--r--chip/mt_scp/rv32i_common/memmap.h (renamed from chip/mt8192_scp/memmap.h)0
-rw-r--r--chip/mt_scp/rv32i_common/registers.h (renamed from chip/mt8192_scp/registers.h)0
-rw-r--r--chip/mt_scp/rv32i_common/system.c (renamed from chip/mt8192_scp/system.c)0
-rw-r--r--chip/mt_scp/rv32i_common/uart.c (renamed from chip/mt8192_scp/uart.c)0
-rw-r--r--chip/mt_scp/rv32i_common/uart_regs.h (renamed from chip/mt8192_scp/uart_regs.h)0
-rw-r--r--chip/mt_scp/rv32i_common/watchdog.c (renamed from chip/mt8192_scp/watchdog.c)0
27 files changed, 42 insertions, 33 deletions
diff --git a/board/asurada_scp/build.mk b/board/asurada_scp/build.mk
index 1040ffe553..f3c4a82a10 100644
--- a/board/asurada_scp/build.mk
+++ b/board/asurada_scp/build.mk
@@ -6,6 +6,6 @@
# Board specific files build
#
-CHIP:=mt8192_scp
+CHIP:=mt_scp
CHIP_VARIANT:=mt8192
BASEBOARD:=mtscp-rv32i
diff --git a/board/cherry_scp/build.mk b/board/cherry_scp/build.mk
index 85f3ca810c..0d6c33755f 100644
--- a/board/cherry_scp/build.mk
+++ b/board/cherry_scp/build.mk
@@ -6,6 +6,6 @@
# Board specific files build
#
-CHIP:=mt8192_scp
-CHIP_VARIANT:=mt8192
+CHIP:=mt_scp
+CHIP_VARIANT:=mt8195
BASEBOARD:=mtscp-rv32i
diff --git a/chip/mt8192_scp/build.mk b/chip/mt8192_scp/build.mk
deleted file mode 100644
index aef19efd39..0000000000
--- a/chip/mt8192_scp/build.mk
+++ /dev/null
@@ -1,28 +0,0 @@
-# -*- makefile -*-
-# Copyright 2020 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# SCP specific files build
-#
-
-CORE:=riscv-rv32i
-
-# Required chip modules
-chip-y+=cache.o
-chip-y+=clock.o
-chip-y+=gpio.o
-chip-y+=intc.o
-chip-y+=memmap.o
-chip-y+=system.o
-chip-y+=uart.o
-
-ifeq ($(CONFIG_IPI),y)
-$(out)/RW/chip/$(CHIP)/ipi_table.o: $(out)/ipi_table_gen.inc
-endif
-
-# Optional chip modules
-chip-$(CONFIG_COMMON_TIMER)+=hrtimer.o
-chip-$(CONFIG_IPI)+=ipi.o ipi_table.o
-chip-$(CONFIG_WATCHDOG)+=watchdog.o
-chip-$(HAS_TASK_HOSTCMD)+=hostcmd.o
diff --git a/chip/mt_scp/build.mk b/chip/mt_scp/build.mk
index 2f791a5476..3e8f63b5a2 100644
--- a/chip/mt_scp/build.mk
+++ b/chip/mt_scp/build.mk
@@ -9,8 +9,13 @@
# Required chip modules
chip-y=
-ifeq ($(CHIP_VARIANT),mt8183)
CPPFLAGS+=-Ichip/$(CHIP)/$(CHIP_VARIANT)
dirs-y+=chip/$(CHIP)/$(CHIP_VARIANT)
-include chip/$(CHIP)/$(CHIP_VARIANT)/build.mk
+# Each chip variant can provide specific build.mk if any
+-include chip/$(CHIP)/$(CHIP_VARIANT)/build.mk
+
+ifeq ($(CHIP_VARIANT),$(filter $(CHIP_VARIANT),mt8192 mt8195))
+CPPFLAGS+=-Ichip/$(CHIP)/rv32i_common
+dirs-y+=chip/$(CHIP)/rv32i_common
+include chip/$(CHIP)/rv32i_common/build.mk
endif
diff --git a/chip/mt_scp/config_chip.h b/chip/mt_scp/config_chip.h
index 91be11dff2..112920a4c6 100644
--- a/chip/mt_scp/config_chip.h
+++ b/chip/mt_scp/config_chip.h
@@ -6,3 +6,7 @@
#ifdef CHIP_VARIANT_MT8183
#include "mt8183/config_chip.h"
#endif
+
+#if defined(CHIP_VARIANT_MT8192) || defined(CHIP_VARIANT_MT8195)
+#include "rv32i_common/config_chip.h"
+#endif
diff --git a/chip/mt_scp/rv32i_common/build.mk b/chip/mt_scp/rv32i_common/build.mk
new file mode 100644
index 0000000000..3c09548a8c
--- /dev/null
+++ b/chip/mt_scp/rv32i_common/build.mk
@@ -0,0 +1,28 @@
+# -*- makefile -*-
+# Copyright 2020 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# SCP specific files build
+#
+
+CORE:=riscv-rv32i
+
+# Required chip modules
+chip-y+=rv32i_common/cache.o
+chip-y+=rv32i_common/clock.o
+chip-y+=rv32i_common/gpio.o
+chip-y+=rv32i_common/intc.o
+chip-y+=rv32i_common/memmap.o
+chip-y+=rv32i_common/system.o
+chip-y+=rv32i_common/uart.o
+
+ifeq ($(CONFIG_IPI),y)
+$(out)/RW/chip/$(CHIP)/rv32i_common/ipi_table.o: $(out)/ipi_table_gen.inc
+endif
+
+# Optional chip modules
+chip-$(CONFIG_COMMON_TIMER)+=rv32i_common/hrtimer.o
+chip-$(CONFIG_IPI)+=rv32i_common/ipi.o rv32i_common/ipi_table.o
+chip-$(CONFIG_WATCHDOG)+=rv32i_common/watchdog.o
+chip-$(HAS_TASK_HOSTCMD)+=rv32i_common/hostcmd.o
diff --git a/chip/mt8192_scp/cache.c b/chip/mt_scp/rv32i_common/cache.c
index 62147590fe..62147590fe 100644
--- a/chip/mt8192_scp/cache.c
+++ b/chip/mt_scp/rv32i_common/cache.c
diff --git a/chip/mt8192_scp/cache.h b/chip/mt_scp/rv32i_common/cache.h
index 13e5ad1a42..13e5ad1a42 100644
--- a/chip/mt8192_scp/cache.h
+++ b/chip/mt_scp/rv32i_common/cache.h
diff --git a/chip/mt8192_scp/clock.c b/chip/mt_scp/rv32i_common/clock.c
index a460d818c7..a460d818c7 100644
--- a/chip/mt8192_scp/clock.c
+++ b/chip/mt_scp/rv32i_common/clock.c
diff --git a/chip/mt8192_scp/clock_chip.h b/chip/mt_scp/rv32i_common/clock_chip.h
index ee1c22be92..ee1c22be92 100644
--- a/chip/mt8192_scp/clock_chip.h
+++ b/chip/mt_scp/rv32i_common/clock_chip.h
diff --git a/chip/mt8192_scp/config_chip.h b/chip/mt_scp/rv32i_common/config_chip.h
index ac53d51732..ac53d51732 100644
--- a/chip/mt8192_scp/config_chip.h
+++ b/chip/mt_scp/rv32i_common/config_chip.h
diff --git a/chip/mt8192_scp/csr.h b/chip/mt_scp/rv32i_common/csr.h
index 7c767d0592..7c767d0592 100644
--- a/chip/mt8192_scp/csr.h
+++ b/chip/mt_scp/rv32i_common/csr.h
diff --git a/chip/mt8192_scp/gpio.c b/chip/mt_scp/rv32i_common/gpio.c
index 0ca3e3ac25..0ca3e3ac25 100644
--- a/chip/mt8192_scp/gpio.c
+++ b/chip/mt_scp/rv32i_common/gpio.c
diff --git a/chip/mt8192_scp/hostcmd.c b/chip/mt_scp/rv32i_common/hostcmd.c
index 42a463ee56..42a463ee56 100644
--- a/chip/mt8192_scp/hostcmd.c
+++ b/chip/mt_scp/rv32i_common/hostcmd.c
diff --git a/chip/mt8192_scp/hostcmd.h b/chip/mt_scp/rv32i_common/hostcmd.h
index b93f1e725d..b93f1e725d 100644
--- a/chip/mt8192_scp/hostcmd.h
+++ b/chip/mt_scp/rv32i_common/hostcmd.h
diff --git a/chip/mt8192_scp/hrtimer.c b/chip/mt_scp/rv32i_common/hrtimer.c
index 89ffaa2fca..89ffaa2fca 100644
--- a/chip/mt8192_scp/hrtimer.c
+++ b/chip/mt_scp/rv32i_common/hrtimer.c
diff --git a/chip/mt8192_scp/intc.c b/chip/mt_scp/rv32i_common/intc.c
index bd7416c31e..bd7416c31e 100644
--- a/chip/mt8192_scp/intc.c
+++ b/chip/mt_scp/rv32i_common/intc.c
diff --git a/chip/mt8192_scp/ipi.c b/chip/mt_scp/rv32i_common/ipi.c
index 462865be83..462865be83 100644
--- a/chip/mt8192_scp/ipi.c
+++ b/chip/mt_scp/rv32i_common/ipi.c
diff --git a/chip/mt8192_scp/ipi_chip.h b/chip/mt_scp/rv32i_common/ipi_chip.h
index 3484358a86..3484358a86 100644
--- a/chip/mt8192_scp/ipi_chip.h
+++ b/chip/mt_scp/rv32i_common/ipi_chip.h
diff --git a/chip/mt8192_scp/ipi_table.c b/chip/mt_scp/rv32i_common/ipi_table.c
index 8fe3f1e598..8fe3f1e598 100644
--- a/chip/mt8192_scp/ipi_table.c
+++ b/chip/mt_scp/rv32i_common/ipi_table.c
diff --git a/chip/mt8192_scp/memmap.c b/chip/mt_scp/rv32i_common/memmap.c
index a666bb23d7..a666bb23d7 100644
--- a/chip/mt8192_scp/memmap.c
+++ b/chip/mt_scp/rv32i_common/memmap.c
diff --git a/chip/mt8192_scp/memmap.h b/chip/mt_scp/rv32i_common/memmap.h
index 0857c9a89e..0857c9a89e 100644
--- a/chip/mt8192_scp/memmap.h
+++ b/chip/mt_scp/rv32i_common/memmap.h
diff --git a/chip/mt8192_scp/registers.h b/chip/mt_scp/rv32i_common/registers.h
index a64c446c8c..a64c446c8c 100644
--- a/chip/mt8192_scp/registers.h
+++ b/chip/mt_scp/rv32i_common/registers.h
diff --git a/chip/mt8192_scp/system.c b/chip/mt_scp/rv32i_common/system.c
index 0e12154f6d..0e12154f6d 100644
--- a/chip/mt8192_scp/system.c
+++ b/chip/mt_scp/rv32i_common/system.c
diff --git a/chip/mt8192_scp/uart.c b/chip/mt_scp/rv32i_common/uart.c
index 2479bb8711..2479bb8711 100644
--- a/chip/mt8192_scp/uart.c
+++ b/chip/mt_scp/rv32i_common/uart.c
diff --git a/chip/mt8192_scp/uart_regs.h b/chip/mt_scp/rv32i_common/uart_regs.h
index 1a421a413b..1a421a413b 100644
--- a/chip/mt8192_scp/uart_regs.h
+++ b/chip/mt_scp/rv32i_common/uart_regs.h
diff --git a/chip/mt8192_scp/watchdog.c b/chip/mt_scp/rv32i_common/watchdog.c
index 72ca5edad8..72ca5edad8 100644
--- a/chip/mt8192_scp/watchdog.c
+++ b/chip/mt_scp/rv32i_common/watchdog.c