Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12593
-gerrit
commit e6debd0209c8a833707cca1f3ad117452a48f2d3
Author: david <david_wu(a)quantatw.com>
Date: Mon Nov 23 20:24:54 2015 +0800
google/lars: SPD change for Proto board
Update Memory ID for Proto board
Update detection of single/dual channel memory to use SPD Index (Memory ID)
Remove boardid.h as it is no longer needed
BUG=None
BRANCH=None
TEST=Build and Boot Lars (Proto)
Change-Id: I100b0fec4bf555c261e30140109cb0f36576130c
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 24a4fddf4f1a4441fca8783cfa451e220ff986d8
Original-Change-Id: I636e881cb3fb9a0056edea2bc34a861a59b91c8f
Original-Signed-off-by: David Wu <David_Wu(a)quantatw.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/313903
Original-Commit-Ready: David Wu <david_wu(a)quantatw.com>
Original-Tested-by: David Wu <david_wu(a)quantatw.com>
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
Original-Reviewed-by: Subrata Banik <subrata.banik(a)intel.com>
---
src/mainboard/google/lars/boardid.h | 27 ---------------------------
src/mainboard/google/lars/spd/Makefile.inc | 8 ++++----
src/mainboard/google/lars/spd/spd.c | 27 ++++++++-------------------
src/mainboard/google/lars/spd/spd.h | 1 +
4 files changed, 13 insertions(+), 50 deletions(-)
diff --git a/src/mainboard/google/lars/boardid.h b/src/mainboard/google/lars/boardid.h
deleted file mode 100644
index 0c6de8b..0000000
--- a/src/mainboard/google/lars/boardid.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is part of the coreboot project.
- *
- * Copyright (C) 2013 Google Inc.
- * Copyright (C) 2015 Intel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- * GNU General Public License for more details.
- */
-
-#ifndef _BOARDID_H_
-#define _BOARDID_H_
-
-#define SCRD_SKU1 0x3
-#define SCRD_SKU2 0x4
-#define SCRD_SKU3 0x1
-#define SCRD_SKU4 0x2
-#define SCRD_SKU5 0x5
-#define SCRD_SKU6 0x6
-
-#endif
diff --git a/src/mainboard/google/lars/spd/Makefile.inc b/src/mainboard/google/lars/spd/Makefile.inc
index cbe1c3d..4b9c376 100644
--- a/src/mainboard/google/lars/spd/Makefile.inc
+++ b/src/mainboard/google/lars/spd/Makefile.inc
@@ -18,10 +18,10 @@ romstage-y += spd.c
SPD_BIN = $(obj)/spd.bin
-SPD_SOURCES = hynix_dimm_H9CCNNN8JTBLAR-NUD-1G-1866 # 0b0000
-SPD_SOURCES += hynix_dimm_H9CCNNNBLTBLAR-NUD-2G-1866 # 0b0001
-SPD_SOURCES += samsung_dimm_K4E8E324EB-EGCF-1G-1866 # 0b0010
-SPD_SOURCES += samsung_dimm_K4E6E304EB-EGCF-2G-1866 # 0b0011
+SPD_SOURCES = hynix_dimm_H9CCNNN8JTBLAR-NUD-1G-1866 # 0b0000 Single Channel 2GB
+SPD_SOURCES += hynix_dimm_H9CCNNNBLTBLAR-NUD-2G-1866 # 0b0001 Dual Channel 8GB
+SPD_SOURCES += samsung_dimm_K4E8E324EB-EGCF-1G-1866 # 0b0010 Dual Channel 4GB
+SPD_SOURCES += empty # 0b0011
SPD_SOURCES += empty # 0b0100
SPD_SOURCES += empty # 0b0101
SPD_SOURCES += empty # 0b0110
diff --git a/src/mainboard/google/lars/spd/spd.c b/src/mainboard/google/lars/spd/spd.c
index d352969..b8d8cd0 100644
--- a/src/mainboard/google/lars/spd/spd.c
+++ b/src/mainboard/google/lars/spd/spd.c
@@ -15,14 +15,12 @@
*/
#include <arch/byteorder.h>
-#include <boardid.h>
#include <cbfs.h>
#include <console/console.h>
#include <soc/pei_data.h>
#include <soc/romstage.h>
#include <string.h>
-#include "../boardid.h"
#include "spd.h"
static void mainboard_print_spd_info(uint8_t spd[])
@@ -81,17 +79,11 @@ void mainboard_fill_spd_data(struct pei_data *pei_data)
{
char *spd_file;
size_t spd_file_len;
- int spd_index, sku_id;
+ int spd_index, spd_span;
spd_index = pei_data->mem_cfg_id;
- /*
- * XXX: This is incorrect usage.The Board ID should be the revision ID
- * and not SKU ID but on SCRD it indicates SKU.
- */
- sku_id = board_id();
printk(BIOS_INFO, "SPD index %d\n", spd_index);
- printk(BIOS_INFO, "Board ID %d\n", sku_id);
/* Load SPD data from CBFS */
spd_file = cbfs_boot_map_with_leak("spd.bin", CBFS_TYPE_SPD,
@@ -110,16 +102,13 @@ void mainboard_fill_spd_data(struct pei_data *pei_data)
}
/* Assume same memory in both channels */
- spd_index *= SPD_LEN;
- memcpy(pei_data->spd_data[0][0], spd_file + spd_index, SPD_LEN);
- /*
- * XXX: This is incorrect usage. mem_cfg should be used here instead of
- * SKU ID. The current implementation of mem_config does not
- * support channel population.
- */
-
- if (sku_id != SCRD_SKU1)
- memcpy(pei_data->spd_data[1][0], spd_file + spd_index, SPD_LEN);
+ spd_span = spd_index * SPD_LEN;
+ memcpy(pei_data->spd_data[0][0], spd_file + spd_span, SPD_LEN);
+
+ if (spd_index != HYNIX_SINGLE_CHAN) {
+ memcpy(pei_data->spd_data[1][0], spd_file + spd_span, SPD_LEN);
+ printk(BIOS_INFO, "Dual channel SPD detected writing second channel\n");
+ }
/* Make sure a valid SPD was found */
if (pei_data->spd_data[0][0][0] == 0)
diff --git a/src/mainboard/google/lars/spd/spd.h b/src/mainboard/google/lars/spd/spd.h
index babadd2..c4b2b56 100644
--- a/src/mainboard/google/lars/spd/spd.h
+++ b/src/mainboard/google/lars/spd/spd.h
@@ -30,4 +30,5 @@
#define SPD_PART_LEN 18
#define SPD_MANU_OFF 148
+#define HYNIX_SINGLE_CHAN 0x0
#endif
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12587
-gerrit
commit 200c1c05ccdf49255908844fbc491b378349c121
Author: Yidi Lin <yidi.lin(a)mediatek.com>
Date: Fri Jul 31 17:10:40 2015 +0800
mediatek/mt8173: Add a stub implementation of the MT8173 SoC
BUG=chrome-os-partner:36682
TEST=emerge-oak coreboot
BRANCH=none
Change-Id: I748752d5abca813a0469d3a76e4d40fcbeb9b959
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: ece2f412d94f071a6f5f1dbed4dfaea504da9e1a
Original-Change-Id: I1dd5567a10d20840313703cfcd328bec591b4941
Original-Signed-off-by: Yidi Lin <yidi.lin(a)mediatek.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/292558
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/oak/Kconfig | 49 ++++++
src/mainboard/google/oak/Kconfig.name | 2 +
src/mainboard/google/oak/Makefile.inc | 31 ++++
src/mainboard/google/oak/bootblock.c | 33 ++++
src/mainboard/google/oak/chromeos.c | 40 +++++
src/mainboard/google/oak/devicetree.cb | 24 +++
src/mainboard/google/oak/mainboard.c | 38 +++++
src/mainboard/google/oak/memlayout.ld | 1 +
src/mainboard/google/oak/romstage.c | 38 +++++
src/soc/mediatek/mt8173/Kconfig | 49 ++++++
src/soc/mediatek/mt8173/Makefile.inc | 50 ++++++
src/soc/mediatek/mt8173/bootblock.c | 24 +++
src/soc/mediatek/mt8173/cbfs.c | 25 +++
src/soc/mediatek/mt8173/cbmem.c | 27 ++++
src/soc/mediatek/mt8173/include/soc/addressmap.h | 62 ++++++++
src/soc/mediatek/mt8173/include/soc/infracfg.h | 56 +++++++
src/soc/mediatek/mt8173/include/soc/mcucfg.h | 111 +++++++++++++
src/soc/mediatek/mt8173/include/soc/memlayout.ld | 53 +++++++
src/soc/mediatek/mt8173/include/soc/pericfg.h | 96 ++++++++++++
src/soc/mediatek/mt8173/include/soc/spm.h | 163 +++++++++++++++++++
src/soc/mediatek/mt8173/include/soc/timer.h | 75 +++++++++
src/soc/mediatek/mt8173/soc.c | 49 ++++++
src/soc/mediatek/mt8173/timer.c | 65 ++++++++
src/soc/mediatek/mt8173/uart.c | 189 +++++++++++++++++++++++
24 files changed, 1350 insertions(+)
diff --git a/src/mainboard/google/oak/Kconfig b/src/mainboard/google/oak/Kconfig
new file mode 100644
index 0000000..a7904ca
--- /dev/null
+++ b/src/mainboard/google/oak/Kconfig
@@ -0,0 +1,49 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright 2015 MediaTek Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+if BOARD_GOOGLE_OAK
+
+config BOARD_SPECIFIC_OPTIONS
+ def_bool y
+ select SOC_MEDIATEK_MT8173
+ select CHROMEOS_VBNV_EC
+ select EC_GOOGLE_CHROMEEC
+ select EC_GOOGLE_CHROMEEC_SPI
+ select EC_SOFTWARE_SYNC
+ select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select MAINBOARD_DO_NATIVE_VGA_INIT
+ select VIRTUAL_DEV_SWITCH
+
+config MAINBOARD_DIR
+ string
+ default google/oak
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "oak"
+
+config DRAM_SIZE_MB
+ int
+ default 2048
+
+config EC_GOOGLE_CHROMEEC_SPI_BUS
+ hex
+ default 0
+
+endif # BOARD_GOOGLE_OAK
diff --git a/src/mainboard/google/oak/Kconfig.name b/src/mainboard/google/oak/Kconfig.name
new file mode 100644
index 0000000..49e27d7
--- /dev/null
+++ b/src/mainboard/google/oak/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_GOOGLE_OAK
+ bool "Oak"
diff --git a/src/mainboard/google/oak/Makefile.inc b/src/mainboard/google/oak/Makefile.inc
new file mode 100644
index 0000000..dbfc1db
--- /dev/null
+++ b/src/mainboard/google/oak/Makefile.inc
@@ -0,0 +1,31 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright 2015 MediaTek Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+bootblock-y += bootblock.c
+bootblock-y += memlayout.ld
+bootblock-y += chromeos.c
+
+romstage-y += chromeos.c
+romstage-y += romstage.c
+romstage-y += memlayout.ld
+
+ramstage-y += mainboard.c
+ramstage-y += chromeos.c
+ramstage-y += memlayout.ld
+
diff --git a/src/mainboard/google/oak/bootblock.c b/src/mainboard/google/oak/bootblock.c
new file mode 100644
index 0000000..ddd71b3
--- /dev/null
+++ b/src/mainboard/google/oak/bootblock.c
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/io.h>
+#include <bootblock_common.h>
+#include <delay.h>
+#include <soc/pericfg.h>
+
+void bootblock_mainboard_early_init(void)
+{
+ /* Clear UART0 power down signal */
+ clrbits_le32(&mt8173_pericfg->pdn0_set, PERICFG_UART0_PDN);
+}
+
+void bootblock_mainboard_init(void)
+{
+}
diff --git a/src/mainboard/google/oak/chromeos.c b/src/mainboard/google/oak/chromeos.c
new file mode 100644
index 0000000..8d45a13
--- /dev/null
+++ b/src/mainboard/google/oak/chromeos.c
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <boot/coreboot_tables.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void fill_lb_gpios(struct lb_gpios *gpios)
+{
+}
+
+int get_developer_mode_switch(void)
+{
+ return 0;
+}
+
+int get_recovery_mode_switch(void)
+{
+ return 0;
+}
+
+int get_write_protect_state(void)
+{
+ return 0;
+}
diff --git a/src/mainboard/google/oak/devicetree.cb b/src/mainboard/google/oak/devicetree.cb
new file mode 100644
index 0000000..75045c6
--- /dev/null
+++ b/src/mainboard/google/oak/devicetree.cb
@@ -0,0 +1,24 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright 2015 MediaTek Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+chip soc/mediatek/mt8173
+ device cpu_cluster 0 on
+ device cpu 0 on end
+ end
+end
diff --git a/src/mainboard/google/oak/mainboard.c b/src/mainboard/google/oak/mainboard.c
new file mode 100644
index 0000000..6e0617e
--- /dev/null
+++ b/src/mainboard/google/oak/mainboard.c
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/cache.h>
+#include <arch/io.h>
+#include <boardid.h>
+#include <boot/coreboot_tables.h>
+#include <device/device.h>
+
+static void mainboard_init(device_t dev)
+{
+}
+
+static void mainboard_enable(device_t dev)
+{
+ dev->ops->init = &mainboard_init;
+}
+
+struct chip_operations mainboard_ops = {
+ .name = "oak",
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/google/oak/memlayout.ld b/src/mainboard/google/oak/memlayout.ld
new file mode 100644
index 0000000..ead7f47
--- /dev/null
+++ b/src/mainboard/google/oak/memlayout.ld
@@ -0,0 +1 @@
+#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/oak/romstage.c b/src/mainboard/google/oak/romstage.c
new file mode 100644
index 0000000..268f15f
--- /dev/null
+++ b/src/mainboard/google/oak/romstage.c
@@ -0,0 +1,38 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#include <arch/cache.h>
+#include <arch/cpu.h>
+#include <arch/exception.h>
+#include <arch/io.h>
+
+#include <cbfs.h>
+#include <console/console.h>
+#include <delay.h>
+#include <program_loading.h>
+#include <romstage_handoff.h>
+#include <symbols.h>
+
+void main(void)
+{
+ /* init uart baudrate when pll on */
+ console_init();
+ exception_init();
+
+ run_ramstage();
+}
diff --git a/src/soc/mediatek/mt8173/Kconfig b/src/soc/mediatek/mt8173/Kconfig
new file mode 100644
index 0000000..0f0b134
--- /dev/null
+++ b/src/soc/mediatek/mt8173/Kconfig
@@ -0,0 +1,49 @@
+config SOC_MEDIATEK_MT8173
+ bool
+ default n
+ select ARM64_A53_ERRATUM_843419
+ select ARCH_BOOTBLOCK_ARMV8_64
+ select ARCH_RAMSTAGE_ARMV8_64
+ select ARCH_ROMSTAGE_ARMV8_64
+ select ARCH_VERSTAGE_ARMV8_64
+ select BOOTBLOCK_CONSOLE
+ select HAVE_UART_SPECIAL
+ select SPI_ATOMIC_SEQUENCING
+ select HAVE_MONOTONIC_TIMER
+ select GENERIC_UDELAY
+ select HAS_PRECBMEM_TIMESTAMP_REGION
+
+if SOC_MEDIATEK_MT8173
+
+config DEBUG_SOC_DRIVER
+ bool "The top level switch for soc driver debug message"
+ default n
+ select DEBUG_DRAM
+ select DEBUG_I2C
+ select DEBUG_PMIC
+ select DEBUG_PMIC_WRAP
+
+config DEBUG_DRAM
+ bool "Output verbose DRAM related debug message"
+ default n
+ help
+ This option enables additional DRAM related debug messages.
+
+config DEBUG_I2C
+ bool "Output verbose I2C related debug message"
+ default n
+ help
+ This option enables I2C related debug message.
+
+config DEBUG_PMIC
+ bool "Output verbose PMIC related debug message"
+ default n
+ help
+ This option enables PMIC related debug message.
+
+config DEBUG_PMIC_WRAP
+ bool "Output verbose PMIC WRAP related debug message"
+ default n
+ help
+ This option enables PMIC WRAP related debug message.
+endif
diff --git a/src/soc/mediatek/mt8173/Makefile.inc b/src/soc/mediatek/mt8173/Makefile.inc
new file mode 100644
index 0000000..74a7618
--- /dev/null
+++ b/src/soc/mediatek/mt8173/Makefile.inc
@@ -0,0 +1,50 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright 2015 MediaTek Inc.
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; version 2 of the License.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+##
+
+ifeq ($(CONFIG_SOC_MEDIATEK_MT8173),y)
+
+bootblock-y += bootblock.c
+bootblock-y += cbfs.c
+bootblock-y += timer.c
+
+ifeq ($(CONFIG_BOOTBLOCK_CONSOLE),y)
+bootblock-$(CONFIG_DRIVERS_UART) += uart.c
+endif
+
+################################################################################
+
+romstage-y += cbfs.c
+romstage-y += timer.c
+
+romstage-$(CONFIG_DRIVERS_UART) += uart.c
+romstage-y += cbmem.c
+
+################################################################################
+
+ramstage-y += cbmem.c
+ramstage-y += cbfs.c
+ramstage-y += soc.c
+ramstage-y += timer.c
+ramstage-$(CONFIG_DRIVERS_UART) += uart.c
+
+################################################################################
+
+CPPFLAGS_common += -Isrc/soc/mediatek/mt8173/include
+
+endif
diff --git a/src/soc/mediatek/mt8173/bootblock.c b/src/soc/mediatek/mt8173/bootblock.c
new file mode 100644
index 0000000..232a655
--- /dev/null
+++ b/src/soc/mediatek/mt8173/bootblock.c
@@ -0,0 +1,24 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <bootblock_common.h>
+
+void bootblock_soc_init(void)
+{
+}
diff --git a/src/soc/mediatek/mt8173/cbfs.c b/src/soc/mediatek/mt8173/cbfs.c
new file mode 100644
index 0000000..71f7ef5
--- /dev/null
+++ b/src/soc/mediatek/mt8173/cbfs.c
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <boot_device.h>
+
+const struct region_device *boot_device_ro(void)
+{
+ return NULL;
+}
diff --git a/src/soc/mediatek/mt8173/cbmem.c b/src/soc/mediatek/mt8173/cbmem.c
new file mode 100644
index 0000000..9a8ae7c
--- /dev/null
+++ b/src/soc/mediatek/mt8173/cbmem.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <cbmem.h>
+#include <stddef.h>
+#include <symbols.h>
+
+void *cbmem_top(void)
+{
+ return (void *)((uintptr_t) _dram + (CONFIG_DRAM_SIZE_MB << 20));
+}
diff --git a/src/soc/mediatek/mt8173/include/soc/addressmap.h b/src/soc/mediatek/mt8173/include/soc/addressmap.h
new file mode 100644
index 0000000..37a22ab
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/addressmap.h
@@ -0,0 +1,62 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_INCLUDE_SOC_ADDRESS_MAP_H__
+#define __SOC_MEDIATEK_MT8173_INCLUDE_SOC_ADDRESS_MAP_H__
+
+#include <stddef.h>
+#include <stdint.h>
+
+enum {
+ VER_BASE = 0x08000000,
+ IO_PHYS = 0x10000000,
+ DDR_BASE = 0x40000000
+};
+
+enum {
+ CKSYS_BASE = IO_PHYS,
+ INFRACFG_AO_BASE = IO_PHYS + 0x1000,
+ PERI_CON_BASE = IO_PHYS + 0x3000,
+ CHA_DRAMCAO_BASE = IO_PHYS + 0x4000,
+ GPIO_BASE = IO_PHYS + 0x5000,
+ SPM_BASE = IO_PHYS + 0x6000,
+ RGU_BASE = IO_PHYS + 0x7000,
+ GPT_BASE = IO_PHYS + 0x8000,
+ PMIC_WRAP_BASE = IO_PHYS + 0xD000,
+ CHA_DDRPHY_BASE = IO_PHYS + 0xF000,
+ CHB_DRAMCAO_BASE = IO_PHYS + 0x11000,
+ CHB_DDRPHY_BASE = IO_PHYS + 0x12000,
+ MCUCFG_BASE = IO_PHYS + 0x200000,
+ EMI_BASE = IO_PHYS + 0x203000,
+ EFUSE_BASE = IO_PHYS + 0x206000,
+ APMIXED_BASE = IO_PHYS + 0x209000,
+ CHA_DRAMCNAO_BASE = IO_PHYS + 0x20E000,
+ CHB_DRAMCNAO_BASE = IO_PHYS + 0x213000,
+ ANA_MIPI_CS1_BASE = IO_PHYS + 0x218000,
+ UART0_BASE = IO_PHYS + 0x1002000,
+ SPI_BASE = IO_PHYS + 0x100A000,
+ I2C_BASE = IO_PHYS + 0x1007000,
+ I2C_DMA_BASE = IO_PHYS + 0x1000080,
+ SFLASH_REG_BASE = IO_PHYS + 0x100D000,
+ SSUSB_MAC_BASE = IO_PHYS + 0x1270000,
+ SSUSB_IPPC_BASE = IO_PHYS + 0x1280700,
+ SSUSB_SIF_BASE = IO_PHYS + 0x1290800,
+};
+
+#endif /* __SOC_MEDIATEK_MT8173_INCLUDE_SOC_ADDRESS_MAP_H___ */
diff --git a/src/soc/mediatek/mt8173/include/soc/infracfg.h b/src/soc/mediatek/mt8173/include/soc/infracfg.h
new file mode 100644
index 0000000..5761420
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/infracfg.h
@@ -0,0 +1,56 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_INFRACFG_H__
+#define __SOC_MEDIATEK_MT8173_INFRACFG_H__
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+struct mt8173_infracfg_regs {
+ u32 top_ckmuxsel;
+ u32 reserved0;
+ u32 top_ckdiv1;
+ u32 reserved1;
+ u32 top_dcmctl;
+ u32 top_dcmdbc;
+ u32 reserved2[6];
+ u32 infra_rst0;
+ u32 infra_rst1;
+ u32 reserved3[2];
+ u32 infra_pdn0;
+ u32 infra_pdn1;
+ u32 reserved4[118];
+ u32 topaxi_prot_en;
+ u32 topaxi_prot_sta0;
+ u32 topaxi_prot_sta1; /* 0x228 */
+};
+
+check_member(mt8173_infracfg_regs, infra_pdn0, 0x40);
+check_member(mt8173_infracfg_regs, topaxi_prot_sta1, 0x228);
+
+static struct mt8173_infracfg_regs *const mt8173_infracfg =
+ (void *)INFRACFG_AO_BASE;
+
+enum {
+ INFRA_PMIC_WRAP_RST = 1 << 7,
+ L2C_SRAM_PDN = 1 << 7
+};
+
+#endif /* __SOC_MEDIATEK_MT8173_INFRACFG_H__ */
diff --git a/src/soc/mediatek/mt8173/include/soc/mcucfg.h b/src/soc/mediatek/mt8173/include/soc/mcucfg.h
new file mode 100644
index 0000000..5ac3474
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/mcucfg.h
@@ -0,0 +1,111 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_MCUCFG_H__
+#define __SOC_MEDIATEK_MT8173_MCUCFG_H__
+
+#include <soc/addressmap.h>
+
+struct mt8173_mcucfg_regs {
+ u32 mp0_ca7l_cache_config;
+ struct {
+ u32 mem_delsel0;
+ u32 mem_delsel1;
+ } mp0_cpu[4];
+ u32 mp0_cache_mem_delsel0;
+ u32 mp0_cache_mem_delsel1;
+ u32 mp0_axi_config;
+ u32 mp0_misc_config[10];
+ u32 mp0_ca7l_cfg_dis;
+ u32 mp0_ca7l_clken_ctrl;
+ u32 mp0_ca7l_rst_ctrl;
+ u32 mp0_ca7l_misc_config;
+ u32 mp0_ca7l_dbg_pwr_ctrl;
+ u32 mp0_rw_rsvd0;
+ u32 mp0_rw_rsvd1;
+ u32 mp0_ro_rsvd;
+ u32 reserved0_0[100];
+ u32 mp1_cpucfg;
+ u32 mp1_miscdbg;
+ u32 reserved0_1[13];
+ u32 mp1_rst_ctl;
+ u32 mp1_clkenm_div;
+ u32 reserved0_2[7];
+ u32 mp1_config_res;
+ u32 reserved0_3[101];
+ u32 mp0_rst_status; /* 0x400 */
+ u32 mp0_dbg_ctrl;
+ u32 mp0_dbg_flag;
+ u32 mp0_ca7l_ir_mon;
+ struct {
+ u32 pc_lw;
+ u32 pc_hw;
+ u32 fp_arch32;
+ u32 sp_arch32;
+ u32 fp_arch64_lw;
+ u32 fp_arch64_hw;
+ u32 sp_arch64_lw;
+ u32 sp_arch64_hw;
+ } mp0_dbg_core[4];
+ u32 dfd_ctrl;
+ u32 dfd_cnt_l;
+ u32 dfd_cnt_h;
+ u32 misccfg_mp0_rw_rsvd;
+ u32 misccfg_sec_vio_status0;
+ u32 misccfg_sec_vio_status1;
+ u32 reserved1[22];
+ u32 misccfg_rw_rsvd; /* 0x500 */
+ u32 mcusys_dbg_mon_sel_a;
+ u32 mcusys_dbg_mon;
+ u32 reserved2[61];
+ u32 mcusys_config_a; /* 0x600 */
+ u32 mcusys_config1_a;
+ u32 mcusys_gic_peribase_a;
+ u32 reserved3;
+ u32 sec_range0_start; /* 0x610 */
+ u32 sec_range0_end;
+ u32 sec_range_enable;
+ u32 reserved4;
+ u32 int_pol_ctl[8]; /* 0x620 */
+ u32 aclken_div; /* 0x640 */
+ u32 pclken_div;
+ u32 l2c_sram_ctrl;
+ u32 armpll_jit_ctrl;
+ u32 cci_addrmap; /* 0x650 */
+ u32 cci_config;
+ u32 cci_periphbase;
+ u32 cci_nevntcntovfl;
+ u32 cci_clk_ctrl; /* 0x660 */
+ u32 cci_acel_s1_ctrl;
+ u32 bus_fabric_dcm_ctrl;
+ u32 reserved5;
+ u32 xgpt_ctl; /* 0x670 */
+ u32 xgpt_idx;
+ u32 ptpod2_ctl0;
+ u32 ptpod2_ctl1;
+ u32 mcusys_revid;
+ u32 mcusys_rw_rsvd0;
+ u32 mcusys_rw_rsvd1;
+};
+
+check_member(mt8173_mcucfg_regs, mcusys_rw_rsvd1, 0x688);
+
+static struct mt8173_mcucfg_regs * const mt8173_mcucfg = (void *)MCUCFG_BASE;
+
+#endif /* __SOC_MEDIATEK_MT8173_MCUCFG_H__ */
diff --git a/src/soc/mediatek/mt8173/include/soc/memlayout.ld b/src/soc/mediatek/mt8173/include/soc/memlayout.ld
new file mode 100644
index 0000000..a703808
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/memlayout.ld
@@ -0,0 +1,53 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <memlayout.h>
+
+#include <arch/header.ld>
+
+/*
+ * SRAM_L2C is the half part of L2 cache that we borrow it to be used as SRAM.
+ * It will be returned before starting the ramstage.
+ * SRAM_L2C and SRAM can be cached, but only SRAM is DMA-able.
+ */
+#define SRAM_L2C_START(addr) SYMBOL(sram_l2c, addr)
+#define SRAM_L2C_END(addr) SYMBOL(esram_l2c, addr)
+
+SECTIONS
+{
+ SRAM_L2C_START(0x000C0000)
+ BOOTBLOCK(0x000C1000, 85K)
+ VERSTAGE(0x000D7000, 114K)
+ PRERAM_CBFS_CACHE(0x000F6000, 16K)
+ SRAM_L2C_END(0x00100000)
+
+ SRAM_START(0x00100000)
+ VBOOT2_WORK(0x00100000, 12K)
+ PRERAM_CBMEM_CONSOLE(0x00103000, 16K)
+ TIMESTAMP(0x00107000, 4K)
+ ROMSTAGE(0x00108000, 92K)
+ STACK(0x00124000, 16K)
+ TTB(0x00128000, 28K)
+ DMA_COHERENT(0x0012F000, 4K)
+ SRAM_END(0x00130000)
+
+ DRAM_START(0x40000000)
+ POSTRAM_CBFS_CACHE(0x40100000, 1M)
+ RAMSTAGE(0x40200000, 256K)
+}
diff --git a/src/soc/mediatek/mt8173/include/soc/pericfg.h b/src/soc/mediatek/mt8173/include/soc/pericfg.h
new file mode 100644
index 0000000..d2ea0de
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/pericfg.h
@@ -0,0 +1,96 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_PERICFG_H__
+#define __SOC_MEDIATEK_MT8173_PERICFG_H__
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+struct mt8173_pericfg_regs {
+ u32 rst0;
+ u32 rst1;
+ u32 pdn0_set;
+ u32 pdn1_set;
+ u32 pdn0_clr;
+ u32 pdn1_clr;
+ u32 pdn0_sta;
+ u32 pdn1_sta;
+ u32 pdn_md1_set;
+ u32 pdn_md2_set;
+ u32 pdn_md1_clr;
+ u32 pdn_md2_clr;
+ u32 pdn_md1_sta;
+ u32 pdn_md2_sta;
+ u32 pdn_md_mask;
+ u32 reserved0[5];
+ u32 dcmctl;
+ u32 dcmdbc;
+ u32 dcmfsel;
+ u32 cksel;
+ u32 reserved1[104];
+ u32 axi_bus_ctl1;
+ u32 axi_bus_ctl2;
+ u32 axi_bus_ctl3;
+ u32 axi_si0_ctl;
+ u32 axi_si1_ctl;
+ u32 axi_mi_sta;
+ u32 reserved2[58];
+ u32 axi_ahb_lmt_con1;
+ u32 axi_ahb_lmt_con2;
+ u32 axi_ahb_lmt_con3;
+ u32 axi_ahb_lmt_con4;
+ u32 axi_ahb_lmt_con5;
+ u32 axi_ahb_lmt_con6;
+ u32 reserved3[2];
+ u32 axi_axi_lmt_con1;
+ u32 axi_axi_lmt_con2;
+ u32 axi_axi_lmt_con3;
+ u32 axi_axi_lmt_con4;
+ u32 axi_axi_lmt_con5;
+ u32 axi_axi_lmt_con6;
+ u32 axi_axi_lmt_con7;
+ u32 axi_axi_lmt_con8;
+ u32 axi_axi_lmt_con9;
+ u32 reserved4[47];
+ u32 usb_wakeup_dec_con0;
+ u32 usb_wakeup_dec_con1;
+ u32 usb_wakeup_dec_con2;
+ u32 uart_ck_source_sel;
+ u32 reserved5[1];
+ u32 usb_wakeup_dec_con3a;
+ u32 reserved6[58];
+ u32 ssusb_rst;
+ u32 ssusb_pdn_set;
+ u32 ssusb_pdn_clr;
+ u32 ssusb_pdn_sta;
+};
+
+static struct mt8173_pericfg_regs * const mt8173_pericfg =
+ (void *)PERI_CON_BASE;
+
+/*
+ * UART power down control
+ */
+
+enum {
+ PERICFG_UART0_PDN = 1 << 19
+};
+
+#endif /* __SOC_MEDIATEK_MT8173_PERICFG_H__ */
diff --git a/src/soc/mediatek/mt8173/include/soc/spm.h b/src/soc/mediatek/mt8173/include/soc/spm.h
new file mode 100644
index 0000000..a4d6d64
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/spm.h
@@ -0,0 +1,163 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_SPM_H__
+#define __SOC_MEDIATEK_MT8173_SPM_H__
+
+#include <soc/addressmap.h>
+#include <stddef.h>
+
+enum {
+ SPM_PROJECT_CODE = 0xb16
+};
+
+struct mt8173_spm_regs {
+ u32 poweron_config_set;
+ u32 reserved1[3];
+ u32 power_on_val0; /* 0x010 */
+ u32 power_on_val1;
+ u32 reserved2[58];
+ u32 clk_settle; /* 0x100 */
+ u32 reserved3[63];
+ u32 ca7_cpu0_pwr_con; /* 0x200 */
+ u32 ca7_dbg_pwr_con;
+ u32 ca7_cputop_pwr_con;
+ u32 reserved4;
+ u32 vde_pwr_con; /* 0x210 */
+ u32 mfg_pwr_con;
+ u32 ca7_cpu1_pwr_con; /* 0x218 */
+ u32 ca7_cpu2_pwr_con;
+ u32 ca7_cpu3_pwr_con; /* 0x220 */
+ u32 reserved5[3];
+ u32 ven_pwr_con; /* 0x230 */
+ u32 ifr_pwr_con;
+ u32 isp_pwr_con;
+ u32 dis_pwr_con;
+ u32 dpy_pwr_con; /* 0x240 */
+ u32 ca7_cputop_l2_pdn; /* 0x244 */
+ u32 ca7_cputop_l2_sleep;
+ u32 reserved6[4];
+ struct { /* 0x25c */
+ u32 l1_pdn;
+ u32 reserved;
+ } ca7_cpu[4];
+ u32 gcpu_sram_con; /* 0x27c */
+ u32 dpy2_pwr_con; /* 0x280 */
+ u32 md_pwr_con;
+ u32 reserved11[2];
+ u32 mcu_pwr_con; /* 0x290 */
+ u32 ifr_sramrom_con;
+ u32 mjc_pwr_con;
+ u32 audio_pwr_con;
+ u32 ca15_cpu_pwr_con[4]; /* 0x2a0 */
+ u32 ca15_cputop_pwr_con; /* 0x2b0 */
+ u32 ca15_l1_pwr_con; /* 0x2b4 */
+ u32 ca15_l2_pwr_con; /* 0x2b8 */
+ u32 reserved12;
+ u32 mfg_2d_pwr_con; /* 0x2c0 */
+ u32 mfg_async_pwr_con;
+ u32 vpu_sram_con;
+ u32 reserved13[17];
+ u32 pcm_con0; /* 0x310 */
+ u32 pcm_con1;
+ u32 pcm_im_ptr;
+ u32 pcm_im_len;
+ u32 pcm_reg_data_ini; /* 0x320 */
+ u32 reserved14[7];
+ u32 pcm_event_vector0; /* 0x340 */
+ u32 pcm_event_vector1;
+ u32 pcm_event_vector2;
+ u32 pcm_event_vector3;
+ u32 reserved15;
+ u32 pcm_mas_pause_mask; /* 0x354 */
+ u32 pcm_pwr_io_en;
+ u32 pcm_timer_val;
+ u32 pcm_timer_out;
+ u32 reserved16[7];
+ u32 pcm_reg_data[16]; /* 0x380 */
+ u32 pcm_event_reg_sta;
+ u32 pcm_fsm_sta;
+ u32 pcm_im_host_rw_ptr;
+ u32 pcm_im_host_rw_dat;
+ u32 pcm_event_vector4;
+ u32 pcm_event_vector5;
+ u32 pcm_event_vector6;
+ u32 pcm_event_vector7;
+ u32 pcm_sw_int_set;
+ u32 pcm_sw_int_clear;
+ u32 reserved17[6];
+ u32 clk_con; /* 0x400 */
+ u32 sleep_dual_vcore_pwr_con; /* 0x404 */
+ u32 sleep_ptpod2_con;
+ u32 reserved18[125];
+ u32 apmcu_pwrctl; /* 0x600 */
+ u32 ap_dvfs_con_set;
+ u32 ap_stanby_con;
+ u32 pwr_status; /* 0x60c */
+ u32 pwr_status_2nd; /* 0x610 */
+ u32 ap_bsi_req;
+ u8 reserved19[0x720 - 0x618];
+ u32 sleep_timer_sta; /* 0x720 */
+ u32 reserved20[15];
+ u32 sleep_twam_con; /* 0x760 */
+ u32 sleep_twam_status0;
+ u32 sleep_twam_status1;
+ u32 sleep_twam_status2;
+ u32 sleep_twam_status3; /* 0x770 */
+ u32 reserved21[39];
+ u32 sleep_wakeup_event_mask; /* 0x810 */
+ u32 sleep_cpu_wakeup_event;
+ u32 sleep_md32_wakeup_event_mask;
+ u32 reserved22[2];
+ u32 pcm_wdt_timer_val; /* 0x824 */
+ u32 pcm_wdt_timer_out;
+ u32 reserved23;
+ u32 pcm_md32_mailbox; /* 0x830 */
+ u32 pcm_md32_irq;
+ u32 reserved24[50];
+ u32 sleep_isr_mask; /* 0x900 */
+ u32 sleep_isr_status;
+ u32 reserved25[2];
+ u32 sleep_isr_raw_sta; /* 0x910 */
+ u32 sleep_md32_isr_raw_sta;
+ u32 sleep_wakeup_misc;
+ u32 sleep_bus_protect_rdy;
+ u32 sleep_subsys_idle_sta; /* 0x920 */
+ u8 reserved26[0xb00 - 0x924];
+ u32 pcm_reserve; /* 0xb00 */
+ u32 pcm_reserve2;
+ u32 pcm_flags;
+ u32 pcm_src_req;
+ u32 reserved27[4];
+ u32 pcm_debug_con; /* 0xb20 */
+ u32 reserved28[3];
+ u32 ca7_cpu_irq_mask[4]; /* 0xb30 */
+ u32 ca15_cpu_irq_mask[4];
+ u32 reserved29[4];
+ u32 pcm_pasr_dpd[4]; /* 0xb60 */
+ u8 reserved30[0xf00 - 0xb70];
+ u32 sleep_ca7_wfi_en[4]; /* 0xf00 */
+ u32 sleep_ca15_wfi_en[4];
+};
+
+check_member(mt8173_spm_regs, sleep_ca15_wfi_en[3], 0xf1c);
+
+static struct mt8173_spm_regs * const mt8173_spm = (void *)SPM_BASE;
+
+#endif /* __SOC_MEDIATEK_MT8173_SPM_H__ */
diff --git a/src/soc/mediatek/mt8173/include/soc/timer.h b/src/soc/mediatek/mt8173/include/soc/timer.h
new file mode 100644
index 0000000..b38feb0
--- /dev/null
+++ b/src/soc/mediatek/mt8173/include/soc/timer.h
@@ -0,0 +1,75 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __SOC_MEDIATEK_MT8173_TIMER_H__
+#define __SOC_MEDIATEK_MT8173_TIMER_H__
+
+#include <soc/addressmap.h>
+#include <types.h>
+
+struct mt8173_gpt_regs {
+ u32 irqen;
+ u32 irqsta;
+ u32 irqack;
+ u32 reserved0;
+ u32 gpt1_con;
+ u32 gpt1_clk;
+ u32 gpt1_cnt;
+ u32 gpt1_compare;
+ u32 gpt2_con;
+ u32 gpt2_clk;
+ u32 gpt2_cnt;
+ u32 gpt2_compare;
+ u32 gpt3_con;
+ u32 gpt3_clk;
+ u32 gpt3_cnt;
+ u32 gpt3_compare;
+ u32 gpt4_con;
+ u32 gpt4_clk;
+ u32 gpt4_cnt;
+ u32 gpt4_compare;
+ u32 gpt5_con;
+ u32 gpt5_clk;
+ u32 gpt5_cnt;
+ u32 gpt5_compare;
+ u32 gpt6_con;
+ u32 gpt6_clk;
+ u32 gpt6_cntl;
+ u32 gpt6_comparel;
+ u32 reserved1[2];
+ u32 gpt6_cnth;
+ u32 gpt6_compareh;
+ u32 apxgpt_irqmask;
+ u32 apxgpt_irqmask1;
+};
+
+static struct mt8173_gpt_regs * const mt8173_gpt = (void *)GPT_BASE;
+
+enum {
+ GPT_CON_EN = 0x01,
+ GPT_CON_CLR = 0x02,
+ GPT_MODE_ONE_SHOT = 0x00,
+ GPT_MODE_REPEAT = 0x10,
+ GPT_MODE_KEEP_GO = 0x20,
+ GPT_MODE_FREERUN = 0x30,
+ GPT_SYS_CLK = 0x00,
+ GPT_SYS_RTC = 0x01,
+};
+
+#endif /* __SOC_MEDIATEK_MT8173_TIMER_H__ */
diff --git a/src/soc/mediatek/mt8173/soc.c b/src/soc/mediatek/mt8173/soc.c
new file mode 100644
index 0000000..643c622
--- /dev/null
+++ b/src/soc/mediatek/mt8173/soc.c
@@ -0,0 +1,49 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <cpu/cpu.h>
+#include <console/console.h>
+#include <device/device.h>
+
+#include <symbols.h>
+
+static void soc_read_resources(device_t dev)
+{
+ ram_resource(dev, 0, (uintptr_t)_dram / KiB,
+ CONFIG_DRAM_SIZE_MB * KiB);
+}
+
+static void soc_init(device_t dev)
+{
+}
+
+static struct device_operations soc_ops = {
+ .read_resources = soc_read_resources,
+ .init = soc_init,
+};
+
+static void enable_soc_dev(device_t dev)
+{
+ dev->ops = &soc_ops;
+}
+
+struct chip_operations soc_mediatek_mt8173_ops = {
+ CHIP_NAME("SOC Mediatek MT8173\n")
+ .enable_dev = enable_soc_dev,
+};
diff --git a/src/soc/mediatek/mt8173/timer.c b/src/soc/mediatek/mt8173/timer.c
new file mode 100644
index 0000000..d23c230
--- /dev/null
+++ b/src/soc/mediatek/mt8173/timer.c
@@ -0,0 +1,65 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/io.h>
+#include <console/console.h>
+#include <timer.h>
+#include <delay.h>
+#include <thread.h>
+
+#include <soc/addressmap.h>
+#include <soc/mcucfg.h>
+#include <soc/timer.h>
+
+#define GPT4_MHZ 13
+
+void timer_monotonic_get(struct mono_time *mt)
+{
+ mono_time_set_usecs(mt, read32(&mt8173_gpt->gpt4_cnt) / GPT4_MHZ);
+}
+
+/**
+ * init_timer - initialize timer
+ */
+void init_timer(void)
+{
+ /* Set XGPT_IDX to 0, then the bit field of XGPT_CTL will be programmed
+ * with following definition.
+ *
+ * [10: 8] Clock mode
+ * 100: 26Mhz / 4
+ * 010: 26Mhz / 2
+ * 001: 26Mhz
+ * [ 1: 1] Halt-on-debug enable bit
+ * [ 0: 0] XGPT enable bit
+ */
+ write32(&mt8173_mcucfg->xgpt_idx, 0);
+ /* Set clock mode to 13Mhz and enable XGPT */
+ write32(&mt8173_mcucfg->xgpt_ctl, (0x1 | ((26 / GPT4_MHZ) << 8)));
+
+ /* Disable GPT4 and clear the counter */
+ clrbits_le32(&mt8173_gpt->gpt4_con, GPT_CON_EN);
+ setbits_le32(&mt8173_gpt->gpt4_con, GPT_CON_CLR);
+
+ /* Set clock source to system clock and set clock divider to 1 */
+ write32(&mt8173_gpt->gpt4_clk, GPT_SYS_CLK | 0x0);
+ /* Set operation mode to FREERUN mode and enable GTP4 */
+ write32(&mt8173_gpt->gpt4_con, GPT_CON_EN | GPT_MODE_FREERUN);
+}
+
diff --git a/src/soc/mediatek/mt8173/uart.c b/src/soc/mediatek/mt8173/uart.c
new file mode 100644
index 0000000..bd239c7
--- /dev/null
+++ b/src/soc/mediatek/mt8173/uart.c
@@ -0,0 +1,189 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2015 MediaTek Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/io.h>
+#include <boot/coreboot_tables.h>
+#include <console/console.h> /* for __console definition */
+#include <console/uart.h>
+#include <drivers/uart/uart8250reg.h>
+#include <stdint.h>
+
+#include <soc/addressmap.h>
+
+struct mtk_uart {
+ union {
+ uint32_t thr; /* Transmit holding register. */
+ uint32_t rbr; /* Receive buffer register. */
+ uint32_t dll; /* Divisor latch lsb. */
+ };
+ union {
+ uint32_t ier; /* Interrupt enable register. */
+ uint32_t dlm; /* Divisor latch msb. */
+ };
+ union {
+ uint32_t iir; /* Interrupt identification register. */
+ uint32_t fcr; /* FIFO control register. */
+ uint32_t efr; /* Enhanced feature register. */
+ };
+ uint32_t lcr; /* Line control register. */
+ union {
+ uint32_t mcr; /* Modem control register. */
+ uint32_t xn1; /* XON1 */
+ };
+ union {
+ uint32_t lsr; /* Line status register. */
+ uint32_t xn2; /* XON2 */
+ };
+ union {
+ uint32_t msr; /* Modem status register. */
+ uint32_t xf1; /* XOFF1 */
+ };
+ union {
+ uint32_t scr; /* Scratch register. */
+ uint32_t xf2; /* XOFF2 */
+ };
+ uint32_t autobaud_en; /* Enable auto baudrate. */
+ uint32_t highspeed; /* High speed UART. */
+} __attribute__ ((packed));
+
+/* Peripheral Reset and Power Down registers */
+struct mtk_peri_globalcon {
+ uint32_t rst0;
+ uint32_t rst1;
+ uint32_t pdn0_set;
+ uint32_t pdn1_set;
+ uint32_t pdn0_clr;
+ uint32_t pdn1_clr;
+ uint32_t pdn0_sta;
+ uint32_t pdn1_sta;
+ uint32_t pdn_md1_set;
+ uint32_t pdn_md2_set;
+ uint32_t pdn_md1_clr;
+ uint32_t pdn_md2_clr;
+ uint32_t pdn_md1_sta;
+ uint32_t pdn_md2_sta;
+ uint32_t pdn_md_mask;
+} __attribute__ ((packed));
+
+static struct mtk_uart *const uart_ptr = (void *)UART0_BASE;
+
+static void mtk_uart_tx_flush(void);
+static int mtk_uart_tst_byte(void);
+
+static void mtk_uart_init(void)
+{
+ /* Use a hardcoded divisor for now. */
+ const unsigned uartclk = 26 * MHz;
+ const unsigned baudrate = CONFIG_TTYS0_BAUD;
+ const uint8_t line_config = UART8250_LCR_WLS_8; /* 8n1 */
+ unsigned highspeed, quot, divisor, remainder;
+
+ if (baudrate <= 115200) {
+ highspeed = 0;
+ quot = 16;
+ } else {
+ highspeed = 2;
+ quot = 4;
+ }
+
+ /* Set divisor DLL and DLH */
+ divisor = uartclk / (quot * baudrate);
+ remainder = uartclk % (quot * baudrate);
+
+ if (remainder >= (quot / 2) * baudrate)
+ divisor += 1;
+
+ mtk_uart_tx_flush();
+
+ /* Disable interrupts. */
+ write8(&uart_ptr->ier, 0);
+ /* Force DTR and RTS to high. */
+ write8(&uart_ptr->mcr, UART8250_MCR_DTR | UART8250_MCR_RTS);
+ /* Set High speed UART register. */
+ write8(&uart_ptr->highspeed, highspeed);
+ /* Set line configuration, access divisor latches. */
+ write8(&uart_ptr->lcr, UART8250_LCR_DLAB | line_config);
+ /* Set the divisor. */
+ write8(&uart_ptr->dll, divisor & 0xff);
+ write8(&uart_ptr->dlm, (divisor >> 8) & 0xff);
+ /* Hide the divisor latches. */
+ write8(&uart_ptr->lcr, line_config);
+ /* Enable FIFOs, and clear receive and transmit. */
+ write8(&uart_ptr->fcr,
+ UART8250_FCR_FIFO_EN | UART8250_FCR_CLEAR_RCVR |
+ UART8250_FCR_CLEAR_XMIT);
+
+}
+
+static void mtk_uart_tx_byte(unsigned char data)
+{
+ while (!(read8(&uart_ptr->lsr) & UART8250_LSR_THRE));
+ write8(&uart_ptr->thr, data);
+}
+
+static void mtk_uart_tx_flush(void)
+{
+ while (!(read8(&uart_ptr->lsr) & UART8250_LSR_TEMT));
+}
+
+static unsigned char mtk_uart_rx_byte(void)
+{
+ if (!mtk_uart_tst_byte())
+ return 0;
+ return read8(&uart_ptr->rbr);
+}
+
+static int mtk_uart_tst_byte(void)
+{
+ return (read8(&uart_ptr->lsr) & UART8250_LSR_DR) == UART8250_LSR_DR;
+}
+
+void uart_init(int idx)
+{
+ mtk_uart_init();
+}
+
+unsigned char uart_rx_byte(int idx)
+{
+ return mtk_uart_rx_byte();
+}
+
+void uart_tx_byte(int idx, unsigned char data)
+{
+ mtk_uart_tx_byte(data);
+}
+
+void uart_tx_flush(int idx)
+{
+ mtk_uart_tx_flush();
+}
+
+#ifndef __PRE_RAM__
+void uart_fill_lb(void *data)
+{
+ struct lb_serial serial;
+ serial.type = LB_SERIAL_TYPE_MEMORY_MAPPED;
+ serial.baseaddr = UART0_BASE;
+ serial.baud = default_baudrate();
+ serial.regwidth = 1;
+ lb_add_serial(&serial, data);
+
+ lb_add_console(LB_TAG_CONSOLE_SERIAL8250MEM, data);
+}
+#endif
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12586
-gerrit
commit 4f4949db0f010349708f233a10e16255800977c1
Author: Mary Ruthven <mruthven(a)chromium.org>
Date: Fri Nov 13 14:05:27 2015 -0800
cbfs_spi: enable CBFS access in early romstage
Currently the CBFS mmap cannot be accessed at the beginning of romstage
because it waits until DRAM is initialized. This change first loads CBFS
into SRAM and then switches to using DRAM as the backing once it is
initialized.
BUG=chromium:210230
BRANCH=none
TEST=confirm that the cbfs can be access at the beginning and end of
romstage on different boards.
Change-Id: I9fdaef392349c27ba1c19d4cd07e8ee0ac92dddc
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: ccaaba266386c7d5cc62de63bdca81a0cc7c4d83
Original-Change-Id: Idabfab99765b52069755e1d1aa61bbee39501796
Original-Signed-off-by: Mary Ruthven <mruthven(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/312577
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/include/memlayout.h | 8 +++++---
src/include/symbols.h | 4 ++++
src/lib/cbfs_spi.c | 7 +++++++
src/soc/qualcomm/ipq806x/include/soc/memlayout.ld | 15 ++-------------
4 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/src/include/memlayout.h b/src/include/memlayout.h
index 0344297..899836c 100644
--- a/src/include/memlayout.h
+++ b/src/include/memlayout.h
@@ -79,9 +79,11 @@
/* Use either CBFS_CACHE (unified) or both (PRERAM|POSTRAM)_CBFS_CACHE */
#define CBFS_CACHE(addr, size) REGION(cbfs_cache, addr, size, 4)
-/* TODO: This only works if you never access CBFS in romstage before RAM is up!
- * If you need to change that assumption, you have some work ahead of you... */
-#if defined(__PRE_RAM__) && !ENV_ROMSTAGE
+#if ENV_ROMSTAGE
+ #define PRERAM_CBFS_CACHE(addr, size) CBFS_CACHE(addr, size)
+ #define POSTRAM_CBFS_CACHE(addr, size) \
+ REGION(dram_cbfs_cache, addr, size, 4)
+#elif defined(__PRE_RAM__)
#define PRERAM_CBFS_CACHE(addr, size) CBFS_CACHE(addr, size)
#define POSTRAM_CBFS_CACHE(addr, size) \
REGION(unused_cbfs_cache, addr, size, 4)
diff --git a/src/include/symbols.h b/src/include/symbols.h
index 52fea48..bf875ae 100644
--- a/src/include/symbols.h
+++ b/src/include/symbols.h
@@ -41,6 +41,10 @@ extern u8 _stack[];
extern u8 _estack[];
#define _stack_size (_estack - _stack)
+extern u8 _dram_cbfs_cache[];
+extern u8 _edram_cbfs_cache[];
+#define _dram_cbfs_cache_size (_edram_cbfs_cache - _dram_cbfs_cache)
+
extern u8 _cbfs_cache[];
extern u8 _ecbfs_cache[];
#define _cbfs_cache_size (_ecbfs_cache - _cbfs_cache)
diff --git a/src/lib/cbfs_spi.c b/src/lib/cbfs_spi.c
index 31a2e79..82c3b83 100644
--- a/src/lib/cbfs_spi.c
+++ b/src/lib/cbfs_spi.c
@@ -22,6 +22,7 @@
#include <boot_device.h>
#include <spi_flash.h>
#include <symbols.h>
+#include <cbmem.h>
static struct spi_flash *spi_flash_info;
@@ -42,6 +43,12 @@ static const struct region_device_ops spi_ops = {
static struct mmap_helper_region_device mdev =
MMAP_HELPER_REGION_INIT(&spi_ops, 0, CONFIG_ROM_SIZE);
+static void initialize_mdev(int unused)
+{
+ mmap_helper_device_init(&mdev, _dram_cbfs_cache, _dram_cbfs_cache_size);
+}
+ROMSTAGE_CBMEM_INIT_HOOK(initialize_mdev);
+
void boot_device_init(void)
{
int bus = CONFIG_BOOT_MEDIA_SPI_BUS;
diff --git a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld b/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld
index 60fb582..6ff2b77 100644
--- a/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld
+++ b/src/soc/qualcomm/ipq806x/include/soc/memlayout.ld
@@ -38,16 +38,7 @@ SECTIONS
QCA_SHARED_RAM(2A03F000, 4K)
*/
STACK(0x2A040000, 16K)
-#ifdef __PRE_RAM__
- /*
- * ipq8064 is different from most other ARM platforms: it loads the
- * proprietary DRAM initialization code from CBFS (as opposed to compiling
- * it in into rombase). As a result CBFS needs to be used before DRAM is
- * availale, which means CBFS cache must be in SRAM, which in turn means
- * that PRERAM_CBFS_CACHE description can not be used here.
- */
- CBFS_CACHE(0x2A044000, 93K)
-#endif
+ PRERAM_CBFS_CACHE(0x2A044000, 93K)
TTB_SUBTABLES(0x2A05B800, 2K)
TTB(0x2A05C000, 16K)
SRAM_END(0x2A060000)
@@ -55,8 +46,6 @@ SECTIONS
DRAM_START(0x40000000)
RAMSTAGE(0x40640000, 128K)
SYMBOL(memlayout_cbmem_top, 0x59F80000)
-#ifndef __PRE_RAM__
- CBFS_CACHE(0x59F80000, 384K)
-#endif
+ POSTRAM_CBFS_CACHE(0x59F80000, 384K)
DMA_COHERENT(0x5A000000, 2M)
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/12585
-gerrit
commit 7f4951843bf42c6c42aa4729c095bb2d66fd9f28
Author: Jimmy Huang <jimmy.huang(a)mediatek.com>
Date: Fri Jul 31 17:10:49 2015 +0800
arch/arm64: introduce mmu to bootblock and romstage
We need mmu interfaces in these two stages for,
1. bootblock: to support mmu initialization in bootblock
2. romstage: to be able to add dram range to mmu table
BRANCH=none
BUG=none
TEST=build pass
Change-Id: I56dea5f958a48b875579f546ba17a5dd6eaf159c
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: cf72736bda2233f8e0bdd7a8ca3245f1d941ee86
Original-Change-Id: I1e27c0a0a878f7bc0ff8712bee640ec3fd8dbb8b
Original-Signed-off-by: Jimmy Huang <jimmy.huang(a)mediatek.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/292665
Original-Commit-Ready: Yidi Lin <yidi.lin(a)mediatek.com>
Original-Tested-by: Yidi Lin <yidi.lin(a)mediatek.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/arch/arm64/armv8/Makefile.inc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/arch/arm64/armv8/Makefile.inc b/src/arch/arm64/armv8/Makefile.inc
index 53d0e46..f026a99 100644
--- a/src/arch/arm64/armv8/Makefile.inc
+++ b/src/arch/arm64/armv8/Makefile.inc
@@ -30,6 +30,8 @@ endif
bootblock-y += cache.c
bootblock-y += cache_helpers.S
bootblock-y += cpu.S
+bootblock-y += mmu.c
+
bootblock-$(CONFIG_BOOTBLOCK_CONSOLE) += exception.c
bootblock-generic-ccopts += $(armv8_flags)
@@ -65,6 +67,7 @@ romstage-y += cache.c
romstage-y += cache_helpers.S
romstage-y += cpu.S
romstage-y += exception.c
+romstage-y += mmu.c
romstage-generic-ccopts += $(armv8_flags)