[coreboot-gerrit] Patch set updated for coreboot: google/rotor: Add support for the Rotor mainboard

hakim giydan (hgiydan@marvell.com) gerrit at coreboot.org
Mon Aug 8 21:19:22 CEST 2016


hakim giydan (hgiydan at marvell.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15507

-gerrit

commit 36eabf9242ab156e9517223b55a4a62b88b6f470
Author: Hakim Giydan <hgiydan at marvell.com>
Date:   Mon Aug 8 12:17:05 2016 -0700

    google/rotor: Add support for the Rotor mainboard
    
    Change-Id: I1f97b6f159a0ac36c96636066332ba355c056186
    Signed-off-by: Hakim Giydan <hgiydan at marvell.com>
---
 src/mainboard/google/rotor/Kconfig        | 44 +++++++++++++++++++++++++
 src/mainboard/google/rotor/Kconfig.name   |  2 ++
 src/mainboard/google/rotor/Makefile.inc   | 28 ++++++++++++++++
 src/mainboard/google/rotor/board.h        | 28 ++++++++++++++++
 src/mainboard/google/rotor/board_info.txt |  3 ++
 src/mainboard/google/rotor/bootblock.c    | 54 +++++++++++++++++++++++++++++++
 src/mainboard/google/rotor/chromeos.c     | 39 ++++++++++++++++++++++
 src/mainboard/google/rotor/chromeos.fmd   | 27 ++++++++++++++++
 src/mainboard/google/rotor/devicetree.cb  | 18 +++++++++++
 src/mainboard/google/rotor/mainboard.c    | 31 ++++++++++++++++++
 src/mainboard/google/rotor/memlayout.ld   | 16 +++++++++
 src/mainboard/google/rotor/reset.c        | 22 +++++++++++++
 12 files changed, 312 insertions(+)

diff --git a/src/mainboard/google/rotor/Kconfig b/src/mainboard/google/rotor/Kconfig
new file mode 100644
index 0000000..daf2ed2
--- /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 0000000..710c2dd
--- /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 0000000..e0015e3
--- /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 0000000..6e09ba2
--- /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 <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)
+
+#define BOARD_PINMUX_LENGTH	(sizeof(board_pinmux) / sizeof(board_pinmux[0]))
+
+#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 0000000..27011b2
--- /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 0000000..ee878db
--- /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 < BOARD_PINMUX_LENGTH; 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 0000000..e03114f
--- /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 0000000..f4a2819
--- /dev/null
+++ b/src/mainboard/google/rotor/chromeos.fmd
@@ -0,0 +1,27 @@
+FLASH at 0x0 0x400000 {
+	WP_RO at 0x0 0x200000 {
+		RO_SECTION at 0x0 0x1f0000 {
+			BOOTBLOCK at 0 128K
+			COREBOOT(CBFS)@0x20000 0xe0000
+			FMAP at 0x100000 0x1000
+			GBB at 0x101000 0xeef00
+			RO_FRID at 0x1eff00 0x100
+		}
+		RO_VPD at 0x1f0000 0x10000
+	}
+	RW_SECTION_A at 0x200000 0x78000 {
+		VBLOCK_A at 0x0 0x2000
+		FW_MAIN_A(CBFS)@0x2000 0x75f00
+		RW_FWID_A at 0x77f00 0x100
+	}
+	RW_SHARED at 0x278000 0x4000 {
+		SHARED_DATA at 0x0 0x4000
+	}
+	RW_ELOG at 0x27c000 0x4000
+	RW_SECTION_B at 0x280000 0x78000 {
+		VBLOCK_B at 0x0 0x2000
+		FW_MAIN_B(CBFS)@0x2000 0x75f00
+		RW_FWID_B at 0x77f00 0x100
+	}
+	RW_VPD at 0x2f8000 0x8000
+}
diff --git a/src/mainboard/google/rotor/devicetree.cb b/src/mainboard/google/rotor/devicetree.cb
new file mode 100644
index 0000000..e2eccf0
--- /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 0000000..92d29e8
--- /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 0000000..05a4496
--- /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 0000000..37c2db7
--- /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();
+}



More information about the coreboot-gerrit mailing list