[coreboot-gerrit] Change in coreboot[master]: mb/sifive: Add HiFive Unleashed mainboard

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Mon Apr 23 16:23:38 CEST 2018


Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/25790


Change subject: mb/sifive: Add HiFive Unleashed mainboard
......................................................................

mb/sifive: Add HiFive Unleashed mainboard

Change-Id: I52ef2da9148809923c90178a00ba94babba8d2f8
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
A src/mainboard/sifive/Kconfig
A src/mainboard/sifive/Kconfig.name
A src/mainboard/sifive/hifive-unleashed/Kconfig
A src/mainboard/sifive/hifive-unleashed/Kconfig.name
A src/mainboard/sifive/hifive-unleashed/Makefile.inc
A src/mainboard/sifive/hifive-unleashed/board_info.txt
A src/mainboard/sifive/hifive-unleashed/devicetree.cb
A src/mainboard/sifive/hifive-unleashed/mainboard.c
A src/mainboard/sifive/hifive-unleashed/memlayout.ld
A src/mainboard/sifive/hifive-unleashed/romstage.c
10 files changed, 161 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/25790/1

diff --git a/src/mainboard/sifive/Kconfig b/src/mainboard/sifive/Kconfig
new file mode 100644
index 0000000..1527705
--- /dev/null
+++ b/src/mainboard/sifive/Kconfig
@@ -0,0 +1,16 @@
+if VENDOR_SIFIVE
+
+choice
+	prompt "Mainboard model"
+
+source "src/mainboard/sifive/*/Kconfig.name"
+
+endchoice
+
+source "src/mainboard/sifive/*/Kconfig"
+
+config MAINBOARD_VENDOR
+	string
+	default "SiFive"
+
+endif # VENDOR_SIFIVE
diff --git a/src/mainboard/sifive/Kconfig.name b/src/mainboard/sifive/Kconfig.name
new file mode 100644
index 0000000..4cc741e
--- /dev/null
+++ b/src/mainboard/sifive/Kconfig.name
@@ -0,0 +1,2 @@
+config VENDOR_SIFIVE
+	bool "SiFive"
diff --git a/src/mainboard/sifive/hifive-unleashed/Kconfig b/src/mainboard/sifive/hifive-unleashed/Kconfig
new file mode 100644
index 0000000..5e49f19
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/Kconfig
@@ -0,0 +1,33 @@
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2018 Jonathan Neuschäfer
+#
+# 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_SIFIVE_HIFIVE_UNLEASHED
+
+config BOARD_SPECIFIC_OPTIONS # dummy
+	def_bool y
+	select SOC_SIFIVE_FU540
+	select BOARD_ROMSIZE_KB_32768
+
+config MAINBOARD_DIR
+	string
+	default sifive/hifive-unleashed
+
+config MAX_CPUS
+	int
+	default 4
+
+config MAINBOARD_PART_NUMBER
+	string
+	default "HiFive Unleashed"
+
+endif
diff --git a/src/mainboard/sifive/hifive-unleashed/Kconfig.name b/src/mainboard/sifive/hifive-unleashed/Kconfig.name
new file mode 100644
index 0000000..1ee3793
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/Kconfig.name
@@ -0,0 +1,2 @@
+config BOARD_SIFIVE_HIFIVE_UNLEASHED
+	bool "HiFive Unleashed"
diff --git a/src/mainboard/sifive/hifive-unleashed/Makefile.inc b/src/mainboard/sifive/hifive-unleashed/Makefile.inc
new file mode 100644
index 0000000..27ddcba
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/Makefile.inc
@@ -0,0 +1,18 @@
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2018 Jonathan Neuschäfer
+#
+# 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.
+
+romstage-y += romstage.c
+
+bootblock-y += memlayout.ld
+romstage-y += memlayout.ld
+ramstage-y += memlayout.ld
diff --git a/src/mainboard/sifive/hifive-unleashed/board_info.txt b/src/mainboard/sifive/hifive-unleashed/board_info.txt
new file mode 100644
index 0000000..7d3e171
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/board_info.txt
@@ -0,0 +1,5 @@
+ROM package: SOIC-16
+ROM protocol: SPI
+ROM socketed: n
+Flashrom support: n
+Board URL: https://www.crowdsupply.com/sifive/hifive-unleashed
diff --git a/src/mainboard/sifive/hifive-unleashed/devicetree.cb b/src/mainboard/sifive/hifive-unleashed/devicetree.cb
new file mode 100644
index 0000000..1c9f79a
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/devicetree.cb
@@ -0,0 +1,16 @@
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2018 Jonathan Neuschäfer
+#
+# 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/sifive/fu540
+	device cpu_cluster 0 on  end
+end
diff --git a/src/mainboard/sifive/hifive-unleashed/mainboard.c b/src/mainboard/sifive/hifive-unleashed/mainboard.c
new file mode 100644
index 0000000..ab4d6ae
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/mainboard.c
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Jonathan Neuschäfer
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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>
+#include <bootblock_common.h>
+#include <timestamp.h>
+
+static void mainboard_enable(device_t dev)
+{
+}
+
+struct chip_operations mainboard_ops = {
+	.name = CONFIG_MAINBOARD_PART_NUMBER,
+	.enable_dev = mainboard_enable,
+};
diff --git a/src/mainboard/sifive/hifive-unleashed/memlayout.ld b/src/mainboard/sifive/hifive-unleashed/memlayout.ld
new file mode 100644
index 0000000..d1a6d65
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/memlayout.ld
@@ -0,0 +1,16 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2018 Jonathan Neuschäfer
+ *
+ * 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/sifive/hifive-unleashed/romstage.c b/src/mainboard/sifive/hifive-unleashed/romstage.c
new file mode 100644
index 0000000..b30b736
--- /dev/null
+++ b/src/mainboard/sifive/hifive-unleashed/romstage.c
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2013 Google, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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 <console/console.h>
+#include <program_loading.h>
+
+void main(void)
+{
+	console_init();
+
+	/* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */
+
+	run_ramstage();
+}

-- 
To view, visit https://review.coreboot.org/25790
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I52ef2da9148809923c90178a00ba94babba8d2f8
Gerrit-Change-Number: 25790
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180423/c7428dd4/attachment-0001.html>


More information about the coreboot-gerrit mailing list