summaryrefslogtreecommitdiff
path: root/board/nuvoton
diff options
context:
space:
mode:
authorJim Liu <jim.t90615@gmail.com>2022-04-19 08:32:19 +0300
committerTom Rini <trini@konsulko.com>2022-05-05 16:28:47 +0300
commit84335544ead850efa80139cf9aa8e83eb6bfdfb4 (patch)
treef07f81d9a03bdfbd97cb8340c94fc3149167bcc2 /board/nuvoton
parent1739a6db5403d187902dcebca548de0644c8078f (diff)
downloadu-boot-84335544ead850efa80139cf9aa8e83eb6bfdfb4.tar.xz
arm: nuvoton: Add support for Nuvoton NPCM750 BMC
Add basic support for the Nuvoton NPCM750 EVB (Poleg). Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Diffstat (limited to 'board/nuvoton')
-rw-r--r--board/nuvoton/poleg_evb/Kconfig25
-rw-r--r--board/nuvoton/poleg_evb/MAINTAINERS7
-rw-r--r--board/nuvoton/poleg_evb/Makefile1
-rw-r--r--board/nuvoton/poleg_evb/poleg_evb.c48
4 files changed, 81 insertions, 0 deletions
diff --git a/board/nuvoton/poleg_evb/Kconfig b/board/nuvoton/poleg_evb/Kconfig
new file mode 100644
index 0000000000..d3f4c1dd81
--- /dev/null
+++ b/board/nuvoton/poleg_evb/Kconfig
@@ -0,0 +1,25 @@
+if TARGET_POLEG
+
+config SYS_BOARD
+ default "poleg_evb"
+
+config SYS_VENDOR
+ default "nuvoton"
+
+config SYS_CONFIG_NAME
+ default "poleg"
+
+choice
+ prompt "Target board select"
+ default TARGET_POLEG_EVB
+
+config TARGET_POLEG_EVB
+ bool "Poleg EVB"
+ help
+ poleg EVB is Nuvoton evaluation board for NPCM750 SoC,
+ supports general functions of Basebase Management
+ Controller(BMC).
+
+endchoice
+
+endif
diff --git a/board/nuvoton/poleg_evb/MAINTAINERS b/board/nuvoton/poleg_evb/MAINTAINERS
new file mode 100644
index 0000000000..8797295c41
--- /dev/null
+++ b/board/nuvoton/poleg_evb/MAINTAINERS
@@ -0,0 +1,7 @@
+Poleg EVB
+M: Stanley Chu <yschu@nuvoton.com>
+M: Jim Liu <JJLIU0@nuvoton.com>
+S: Maintained
+F: board/nuvoton/poleg_evb/
+F: include/configs/poleg.h
+F: configs/poleg_evb_defconfig
diff --git a/board/nuvoton/poleg_evb/Makefile b/board/nuvoton/poleg_evb/Makefile
new file mode 100644
index 0000000000..377433d60a
--- /dev/null
+++ b/board/nuvoton/poleg_evb/Makefile
@@ -0,0 +1 @@
+obj-y := poleg_evb.o
diff --git a/board/nuvoton/poleg_evb/poleg_evb.c b/board/nuvoton/poleg_evb/poleg_evb.c
new file mode 100644
index 0000000000..aef142a881
--- /dev/null
+++ b/board/nuvoton/poleg_evb/poleg_evb.c
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ *
+ * Copyright (c) 2021 Nuvoton Technology Corp.
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <asm/io.h>
+#include <asm/arch/gcr.h>
+#include <asm/mach-types.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int board_init(void)
+{
+ return 0;
+}
+
+int dram_init(void)
+{
+ struct npcm_gcr *gcr = (struct npcm_gcr *)NPCM_GCR_BA;
+
+ int ramsize = (readl(&gcr->intcr3) >> 8) & 0x7;
+
+ switch (ramsize) {
+ case 0:
+ gd->ram_size = 0x08000000; /* 128 MB. */
+ break;
+ case 1:
+ gd->ram_size = 0x10000000; /* 256 MB. */
+ break;
+ case 2:
+ gd->ram_size = 0x20000000; /* 512 MB. */
+ break;
+ case 3:
+ gd->ram_size = 0x40000000; /* 1024 MB. */
+ break;
+ case 4:
+ gd->ram_size = 0x80000000; /* 2048 MB. */
+ break;
+
+ default:
+ break;
+ }
+
+ return 0;
+}