mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH v3 02/10] RISC-V: add Erizo SoC support
Date: Tue, 18 Dec 2018 10:19:35 +0300	[thread overview]
Message-ID: <20181218071943.2560-3-antonynpavlov@gmail.com> (raw)
In-Reply-To: <20181218071943.2560-1-antonynpavlov@gmail.com>

Erizo is an opensource hardware SoC for FPGA.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/riscv/Kconfig               | 11 ++++++++
 arch/riscv/Makefile              |  2 ++
 arch/riscv/dts/Makefile          |  2 ++
 arch/riscv/dts/erizo-generic.dts | 14 ++++++++++
 arch/riscv/dts/erizo.dtsi        | 46 ++++++++++++++++++++++++++++++++
 arch/riscv/mach-erizo/Kconfig    | 11 ++++++++
 arch/riscv/mach-erizo/Makefile   |  3 +++
 7 files changed, 89 insertions(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c9719dfeca..ee532ac11a 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -15,6 +15,15 @@ config ARCH_TEXT_BASE
 
 menu "Machine selection"
 
+choice
+	prompt "System type"
+	default MACH_ERIZO
+
+config MACH_ERIZO
+	bool "erizo family"
+
+endchoice
+
 choice
 	prompt "Base ISA"
 	default ARCH_RV32I
@@ -51,4 +60,6 @@ config BUILTIN_DTB_NAME
 	string "DTB to build into the barebox image"
 	depends on BUILTIN_DTB
 
+source arch/riscv/mach-erizo/Kconfig
+
 endmenu
diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile
index 28eb414452..d5a392de05 100644
--- a/arch/riscv/Makefile
+++ b/arch/riscv/Makefile
@@ -11,6 +11,8 @@ cflags-y += -Wall -Wstrict-prototypes \
 LDFLAGS += $(ldflags-y)
 LDFLAGS_barebox += -nostdlib
 
+machine-$(CONFIG_MACH_ERIZO)	:= erizo
+
 TEXT_BASE = $(CONFIG_TEXT_BASE)
 CPPFLAGS += -DTEXT_BASE=$(CONFIG_TEXT_BASE)
 
diff --git a/arch/riscv/dts/Makefile b/arch/riscv/dts/Makefile
index 0a88af1603..903fe8ff34 100644
--- a/arch/riscv/dts/Makefile
+++ b/arch/riscv/dts/Makefile
@@ -3,6 +3,8 @@ ifneq ($(BUILTIN_DTB),)
 obj-dtb-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o
 endif
 
+obj-dtb-$(CONFIG_BOARD_ERIZO_GENERIC) += erizo-generic.dtb.o
+
 # just to build a built-in.o. Otherwise compilation fails when no devicetree is
 # created.
 obj- += dummy.o
diff --git a/arch/riscv/dts/erizo-generic.dts b/arch/riscv/dts/erizo-generic.dts
new file mode 100644
index 0000000000..d1f8d57168
--- /dev/null
+++ b/arch/riscv/dts/erizo-generic.dts
@@ -0,0 +1,14 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include "erizo.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	model = "generic Erizo SoC board";
+	compatible = "miet-riscv-workgroup,erizo-generic-board";
+
+	memory@0 {
+		device_type = "memory";
+		reg = <0x80000000 0x00800000>;
+	};
+};
diff --git a/arch/riscv/dts/erizo.dtsi b/arch/riscv/dts/erizo.dtsi
new file mode 100644
index 0000000000..07534798ac
--- /dev/null
+++ b/arch/riscv/dts/erizo.dtsi
@@ -0,0 +1,46 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+/dts-v1/;
+
+/ {
+	compatible = "miet-riscv-workgroup,erizo";
+
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	clocks {
+		ref_clk: ref_clk {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			clock-frequency = <24000000>;
+		};
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "cliffordwolf,picorv32";
+			clocks = <&ref_clk>;
+			reg = <0>;
+		};
+	};
+
+	uart0: uart@90000000 {
+		compatible = "ns16550a";
+		reg = <0x90000000 0x20>;
+		reg-shift = <2>;
+		clocks = <&ref_clk>;
+	};
+
+	gpio0: gpio@91000000 {
+		compatible = "wd,mbl-gpio";
+		reg-names = "dat", "dirout";
+		reg = <0x91000000 0x4>,
+			<0x91000004 0x4>;
+		#gpio-cells = <2>;
+		gpio-controller;
+	};
+};
diff --git a/arch/riscv/mach-erizo/Kconfig b/arch/riscv/mach-erizo/Kconfig
new file mode 100644
index 0000000000..2400b4437b
--- /dev/null
+++ b/arch/riscv/mach-erizo/Kconfig
@@ -0,0 +1,11 @@
+if MACH_ERIZO
+
+choice
+	prompt "Board type"
+
+config BOARD_ERIZO_GENERIC
+	bool "erizo generic board"
+
+endchoice
+
+endif
diff --git a/arch/riscv/mach-erizo/Makefile b/arch/riscv/mach-erizo/Makefile
new file mode 100644
index 0000000000..d9c51e74c3
--- /dev/null
+++ b/arch/riscv/mach-erizo/Makefile
@@ -0,0 +1,3 @@
+# just to build a built-in.o. Otherwise compilation fails when no o-files is
+# created.
+obj- += dummy.o
-- 
2.20.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-12-18  7:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18  7:19 [PATCH v3 00/10] Add initial RISC-V architecture support Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 01/10] " Antony Pavlov
2018-12-18  7:19 ` Antony Pavlov [this message]
2018-12-18  7:19 ` [PATCH v3 03/10] RISC-V: add low-level debug macros for ns16550 Antony Pavlov
2018-12-18  8:33   ` Oleksij Rempel
2018-12-18  7:19 ` [PATCH v3 04/10] RISC-V: add nmon nano-monitor Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 05/10] RISC-V: erizo: add DEBUG_LL support Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 06/10] RISC-V: erizo: enable nmon Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 07/10] RISC-V: erizo: add nmon image creation Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 08/10] RISC-V: add erizo_generic_defconfig Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 09/10] scripts: add nmon-loader Antony Pavlov
2019-08-11  9:59   ` Antony Pavlov
2019-08-12  7:41     ` Sascha Hauer
2019-08-12  9:01       ` Antony Pavlov
2018-12-18  7:19 ` [PATCH v3 10/10] Documentation: add RISC-V docs Antony Pavlov
2019-01-03 11:18 ` [PATCH v3 00/10] Add initial RISC-V architecture support Sascha Hauer
2019-01-04  8:47   ` Antony Pavlov
2019-01-07  7:54     ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181218071943.2560-3-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox