summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHakim Giydan <hgiydan@marvell.com>2016-09-08 10:30:53 -0700
committerMartin Roth <martinroth@google.com>2016-09-13 16:56:18 +0200
commit65c7ccc8b1567394e6118bf66a301462602262e0 (patch)
treef02de220ffa0f638a6752fec647246ec236affe5
parent449368c2f08387923575b802cc40d0538d636439 (diff)
downloadcoreboot-65c7ccc8b1567394e6118bf66a301462602262e0.tar.xz
google/rotor: Add support for the Rotor mainboard
Change-Id: I1f97b6f159a0ac36c96636066332ba355c056186 Signed-off-by: Hakim Giydan <hgiydan@marvell.com> Reviewed-on: https://review.coreboot.org/15507 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
-rw-r--r--src/mainboard/google/rotor/Kconfig44
-rw-r--r--src/mainboard/google/rotor/Kconfig.name2
-rw-r--r--src/mainboard/google/rotor/Makefile.inc28
-rw-r--r--src/mainboard/google/rotor/board.h28
-rw-r--r--src/mainboard/google/rotor/board_info.txt3
-rw-r--r--src/mainboard/google/rotor/bootblock.c54
-rw-r--r--src/mainboard/google/rotor/chromeos.c39
-rw-r--r--src/mainboard/google/rotor/chromeos.fmd27
-rw-r--r--src/mainboard/google/rotor/devicetree.cb18
-rw-r--r--src/mainboard/google/rotor/mainboard.c31
-rw-r--r--src/mainboard/google/rotor/memlayout.ld16
-rw-r--r--src/mainboard/google/rotor/reset.c22
12 files changed, 312 insertions, 0 deletions
diff --git a/src/mainboard/google/rotor/Kconfig b/src/mainboard/google/rotor/Kconfig
new file mode 100644
index 0000000000..daf2ed2518
--- /dev/null
+++ b/src/mainboard/google/rotor/Kconfig
@@ -0,0 +1,44 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2016 Marvell, 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.
+##
+
+if BOARD_GOOGLE_ROTOR
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+ def_bool y
+ select SOC_MARVELL_MVMAP2315
+ select MAINBOARD_HAS_CHROMEOS
+ select BOARD_ROMSIZE_KB_4096
+
+config CHROMEOS
+ select VBOOT_MOCK_SECDATA
+
+config MAINBOARD_DIR
+ string
+ default google/rotor
+
+config MAINBOARD_PART_NUMBER
+ string
+ default "rotor"
+
+config GBB_HWID
+ string
+ depends on CHROMEOS
+ default "ROTOR TEST 1234"
+
+config DRAM_SIZE_MB
+ int
+ default 232
+
+endif # BOARD_MARVELL_ROTOR
diff --git a/src/mainboard/google/rotor/Kconfig.name b/src/mainboard/google/rotor/Kconfig.name
new file mode 100644
index 0000000000..710c2dd3b2
--- /dev/null
+++ b/src/mainboard/google/rotor/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_GOOGLE_ROTOR
+ bool "Rotor"
diff --git a/src/mainboard/google/rotor/Makefile.inc b/src/mainboard/google/rotor/Makefile.inc
new file mode 100644
index 0000000000..e0015e3426
--- /dev/null
+++ b/src/mainboard/google/rotor/Makefile.inc
@@ -0,0 +1,28 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2016 Marvell, 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.
+##
+
+bootblock-y += bootblock.c
+bootblock-y += memlayout.ld
+bootblock-y += reset.c
+bootblock-$(CONFIG_CHROMEOS) += chromeos.c
+
+ramstage-y += mainboard.c
+ramstage-y += memlayout.ld
+ramstage-y += reset.c
+ramstage-$(CONFIG_CHROMEOS) += chromeos.c
+
+romstage-y += memlayout.ld
+romstage-y += reset.c
+romstage-$(CONFIG_CHROMEOS) += chromeos.c
diff --git a/src/mainboard/google/rotor/board.h b/src/mainboard/google/rotor/board.h
new file mode 100644
index 0000000000..726317266b
--- /dev/null
+++ b/src/mainboard/google/rotor/board.h
@@ -0,0 +1,28 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#ifndef __COREBOOT_SRC_MAINBOARD_GOOGLE_ROTOR_BOARD_H
+#define __COREBOOT_SRC_MAINBOARD_GOOGLE_ROTOR_BOARD_H
+
+#include <stdint.h>
+
+#include <soc/pinmux.h>
+
+#define PINMUX_APB_UART0_TXD PINMUX(165, 1, 1, 0, 0, PULLUP)
+#define PINMUX_APB_UART0_RXD PINMUX(166, 1, 1, 0, 0, PULLUP)
+#define PINMUX_APB_UART1_TXD PINMUX(176, 1, 1, 0, 0, PULLUP)
+#define PINMUX_APB_UART1_RXD PINMUX(177, 1, 1, 0, 0, PULLUP)
+
+#endif /* __COREBOOT_SRC_MAINBOARD_GOOGLE_ROTOR_BOARD_H */
diff --git a/src/mainboard/google/rotor/board_info.txt b/src/mainboard/google/rotor/board_info.txt
new file mode 100644
index 0000000000..27011b2e1c
--- /dev/null
+++ b/src/mainboard/google/rotor/board_info.txt
@@ -0,0 +1,3 @@
+Category: laptop
+ROM protocol: parallel flash
+Flashrom support: y
diff --git a/src/mainboard/google/rotor/bootblock.c b/src/mainboard/google/rotor/bootblock.c
new file mode 100644
index 0000000000..aa47677c66
--- /dev/null
+++ b/src/mainboard/google/rotor/bootblock.c
@@ -0,0 +1,54 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#include <stddef.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <arch/io.h>
+#include <bootblock_common.h>
+#include <console/console.h>
+#include <soc/clock.h>
+#include <soc/pinmux.h>
+
+#include "board.h"
+
+struct mvmap2315_pinmux board_pinmux[] = {
+ PINMUX_APB_UART0_TXD,
+ PINMUX_APB_UART0_RXD,
+ PINMUX_APB_UART1_TXD,
+ PINMUX_APB_UART1_RXD,
+};
+
+static void pinmux_init(void)
+{
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(board_pinmux); i++)
+ set_pinmux(board_pinmux[i]);
+}
+
+void bootblock_mainboard_early_init(void)
+{
+ /* enable APB/UART0 clock */
+ setbits_le32(&mvmap2315_apmu_clk->uartclk0_clkgenconfig,
+ MVMAP2315_UART_CLK_EN);
+
+ /* enable APB/UART1 clock */
+ setbits_le32(&mvmap2315_apmu_clk->uartclk1_clkgenconfig,
+ MVMAP2315_UART_CLK_EN);
+
+ pinmux_init();
+}
diff --git a/src/mainboard/google/rotor/chromeos.c b/src/mainboard/google/rotor/chromeos.c
new file mode 100644
index 0000000000..e03114f4e2
--- /dev/null
+++ b/src/mainboard/google/rotor/chromeos.c
@@ -0,0 +1,39 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#include <boot/coreboot_tables.h>
+#include <bootmode.h>
+
+#include "board.h"
+
+void fill_lb_gpios(struct lb_gpios *gpios)
+{
+ /*TODO: implement fill_lb_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/rotor/chromeos.fmd b/src/mainboard/google/rotor/chromeos.fmd
new file mode 100644
index 0000000000..f4a2819f7b
--- /dev/null
+++ b/src/mainboard/google/rotor/chromeos.fmd
@@ -0,0 +1,27 @@
+FLASH@0x0 0x400000 {
+ WP_RO@0x0 0x200000 {
+ RO_SECTION@0x0 0x1f0000 {
+ BOOTBLOCK@0 128K
+ COREBOOT(CBFS)@0x20000 0xe0000
+ FMAP@0x100000 0x1000
+ GBB@0x101000 0xeef00
+ RO_FRID@0x1eff00 0x100
+ }
+ RO_VPD@0x1f0000 0x10000
+ }
+ RW_SECTION_A@0x200000 0x78000 {
+ VBLOCK_A@0x0 0x2000
+ FW_MAIN_A(CBFS)@0x2000 0x75f00
+ RW_FWID_A@0x77f00 0x100
+ }
+ RW_SHARED@0x278000 0x4000 {
+ SHARED_DATA@0x0 0x4000
+ }
+ RW_ELOG@0x27c000 0x4000
+ RW_SECTION_B@0x280000 0x78000 {
+ VBLOCK_B@0x0 0x2000
+ FW_MAIN_B(CBFS)@0x2000 0x75f00
+ RW_FWID_B@0x77f00 0x100
+ }
+ RW_VPD@0x2f8000 0x8000
+}
diff --git a/src/mainboard/google/rotor/devicetree.cb b/src/mainboard/google/rotor/devicetree.cb
new file mode 100644
index 0000000000..e2eccf0dce
--- /dev/null
+++ b/src/mainboard/google/rotor/devicetree.cb
@@ -0,0 +1,18 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2016 Marvell, 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.
+##
+
+chip soc/marvell/mvmap2315
+ device cpu_cluster 0 on end
+end
diff --git a/src/mainboard/google/rotor/mainboard.c b/src/mainboard/google/rotor/mainboard.c
new file mode 100644
index 0000000000..92d29e8877
--- /dev/null
+++ b/src/mainboard/google/rotor/mainboard.c
@@ -0,0 +1,31 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#include <device/device.h>
+
+static void mainboard_init(device_t dev)
+{
+ /* TODO: implement mainboard_init */
+}
+
+static void mainboard_enable(device_t dev)
+{
+ dev->ops->init = &mainboard_init;
+}
+
+struct chip_operations mainboard_ops = {
+ .name = "rotor",
+ .enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/google/rotor/memlayout.ld b/src/mainboard/google/rotor/memlayout.ld
new file mode 100644
index 0000000000..05a44968c1
--- /dev/null
+++ b/src/mainboard/google/rotor/memlayout.ld
@@ -0,0 +1,16 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#include <soc/memlayout.ld>
diff --git a/src/mainboard/google/rotor/reset.c b/src/mainboard/google/rotor/reset.c
new file mode 100644
index 0000000000..37c2db7c19
--- /dev/null
+++ b/src/mainboard/google/rotor/reset.c
@@ -0,0 +1,22 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Marvell, 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.
+ */
+
+#include <reset.h>
+#include <soc/reset.h>
+
+void hard_reset(void)
+{
+ mvmap2315_reset();
+}