From 1c09cfa37b167d64da2a182058b04780789f6201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= Date: Thu, 19 Apr 2018 16:23:55 +0200 Subject: mb/sifive: Add HiFive Unleashed mainboard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I52ef2da9148809923c90178a00ba94babba8d2f8 Signed-off-by: Jonathan Neuschäfer Reviewed-on: https://review.coreboot.org/25790 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich --- src/mainboard/sifive/hifive-unleashed/Kconfig | 33 ++++++++++++++++++++++ src/mainboard/sifive/hifive-unleashed/Kconfig.name | 2 ++ src/mainboard/sifive/hifive-unleashed/Makefile.inc | 18 ++++++++++++ .../sifive/hifive-unleashed/board_info.txt | 6 ++++ .../sifive/hifive-unleashed/devicetree.cb | 16 +++++++++++ src/mainboard/sifive/hifive-unleashed/mainboard.c | 27 ++++++++++++++++++ src/mainboard/sifive/hifive-unleashed/memlayout.ld | 16 +++++++++++ src/mainboard/sifive/hifive-unleashed/romstage.c | 26 +++++++++++++++++ 8 files changed, 144 insertions(+) create mode 100644 src/mainboard/sifive/hifive-unleashed/Kconfig create mode 100644 src/mainboard/sifive/hifive-unleashed/Kconfig.name create mode 100644 src/mainboard/sifive/hifive-unleashed/Makefile.inc create mode 100644 src/mainboard/sifive/hifive-unleashed/board_info.txt create mode 100644 src/mainboard/sifive/hifive-unleashed/devicetree.cb create mode 100644 src/mainboard/sifive/hifive-unleashed/mainboard.c create mode 100644 src/mainboard/sifive/hifive-unleashed/memlayout.ld create mode 100644 src/mainboard/sifive/hifive-unleashed/romstage.c (limited to 'src/mainboard/sifive/hifive-unleashed') diff --git a/src/mainboard/sifive/hifive-unleashed/Kconfig b/src/mainboard/sifive/hifive-unleashed/Kconfig new file mode 100644 index 0000000000..5e49f19758 --- /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 0000000000..1ee3793974 --- /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 0000000000..27ddcbad87 --- /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 0000000000..2ad7d59354 --- /dev/null +++ b/src/mainboard/sifive/hifive-unleashed/board_info.txt @@ -0,0 +1,6 @@ +Category: eval +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 0000000000..1c9f79ad92 --- /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 0000000000..ab4d6aec88 --- /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 +#include +#include + +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 0000000000..d1a6d65a00 --- /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 diff --git a/src/mainboard/sifive/hifive-unleashed/romstage.c b/src/mainboard/sifive/hifive-unleashed/romstage.c new file mode 100644 index 0000000000..b30b73665b --- /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 +#include + +void main(void) +{ + console_init(); + + /* TODO: Follow Section 6.3 (FSBL) of the FU540 manual */ + + run_ramstage(); +} -- cgit v1.2.3