mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Clement Leger <cleger@kalray.eu>
To: barebox@lists.infradead.org, Sascha Hauer <s.hauer@pengutronix.de>
Cc: Clement Leger <cleger@kalray.eu>
Subject: [PATCH 3/5] k1c: Add support for device tree
Date: Wed, 15 Jan 2020 11:26:48 +0100	[thread overview]
Message-ID: <20200115102650.11739-4-cleger@kalray.eu> (raw)
In-Reply-To: <20200115102650.11739-1-cleger@kalray.eu>

Add dts folder with minimal device tree for kalray K200 board.

Signed-off-by: Clement Leger <cleger@kalray.eu>
---
 arch/k1c/Kconfig      |  20 ++++++++++
 arch/k1c/Makefile     |   1 +
 arch/k1c/dts/Makefile |  13 +++++++
 arch/k1c/dts/k200.dts | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 139 insertions(+)
 create mode 100644 arch/k1c/dts/Makefile
 create mode 100644 arch/k1c/dts/k200.dts

diff --git a/arch/k1c/Kconfig b/arch/k1c/Kconfig
index f0f9d1728..cf5c7beff 100644
--- a/arch/k1c/Kconfig
+++ b/arch/k1c/Kconfig
@@ -43,3 +43,23 @@ config MALLOC_SIZE
 	default 0x800000
 	prompt "malloc area size"
 endmenu
+
+menu "Board configuration"
+
+config BUILTIN_DTB
+	bool "link a DTB into the barebox image"
+	depends on OFTREE
+
+config BUILTIN_DTB_NAME
+	string "DTB to build into the barebox image"
+	depends on BUILTIN_DTB
+
+choice
+	prompt "Select your board"
+
+config BOARD_K200
+	bool "K200 Network card"
+
+endchoice
+
+endmenu
diff --git a/arch/k1c/Makefile b/arch/k1c/Makefile
index 10852406f..6eb28d1b2 100644
--- a/arch/k1c/Makefile
+++ b/arch/k1c/Makefile
@@ -26,6 +26,7 @@ PHONY += maketools
 
 common-y += arch/k1c/lib/
 common-y += arch/k1c/cpu/
+common-$(CONFIG_OFTREE) += arch/k1c/dts/
 
 lds-y += arch/k1c/cpu/barebox.lds
 
diff --git a/arch/k1c/dts/Makefile b/arch/k1c/dts/Makefile
new file mode 100644
index 000000000..9d5e94ae1
--- /dev/null
+++ b/arch/k1c/dts/Makefile
@@ -0,0 +1,13 @@
+# just to build a built-in.o. Otherwise compilation fails when no devicetree is
+# created.
+obj- += dummy.o
+
+BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_NAME))
+ifneq ($(BUILTIN_DTB),)
+obj-dtb-$(CONFIG_BUILTIN_DTB) += $(BUILTIN_DTB).dtb.o
+endif
+
+obj-dtb-$(CONFIG_BOARD_K200) += k200.dtb.o
+
+always := $(dtb-y)
+clean-files := *.dtb *.dtb.S .*.dtc .*.pre .*.dts
diff --git a/arch/k1c/dts/k200.dts b/arch/k1c/dts/k200.dts
new file mode 100644
index 000000000..fc9a21ad4
--- /dev/null
+++ b/arch/k1c/dts/k200.dts
@@ -0,0 +1,105 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (C) 2019 Kalray, Inc.
+ */
+
+/dts-v1/;
+
+/ {
+	model = "KONIC 200 (K200)";
+	compatible = "kalray,board-k200";
+
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	/* Standard nodes (choosen, cpus, memory, etc) */
+	chosen {
+		bootargs = "earlycon norandmaps console=ttyS0";
+		stdout-path = &serial0;
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu@0 {
+			device_type = "cpu";
+			compatible = "kalray,k1c-pe";
+			reg = <0>;
+			clocks = <&core_clk>;
+			clock-names = "cpu";
+		};
+
+	};
+
+	clocks {
+		ref_clk: ref_clk@0 {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			/* 100 MHz clock */
+			clock-frequency = <100000000>;
+		};
+
+		core_clk: core_clk@0 {
+			#clock-cells = <0>;
+			compatible = "fixed-clock";
+			/* 1 GHz clock */
+			clock-frequency = <1000000000>;
+		};
+	};
+
+	ddr: memory@100000000 {
+		device_type = "memory";
+		/* Declare 4G of DDR starting at 4G */
+		reg = <0x1 0x00000000 0x1 0x00000000>;
+	};
+
+	smem: memory@0 {
+		device_type = "memory";
+		/* 4M of SMEM starting at @0 */
+		reg = <0x0 0x0 0x0 0x400000>;
+	};
+
+	core_timer {
+		compatible = "kalray,k1c-core-timer";
+		clocks = <&core_clk>;
+	};
+
+	core_watchdog {
+		compatible = "kalray,k1c-core-watchdog";
+		clocks = <&core_clk>;
+	};
+
+	axi {
+		compatible = "simple-bus";
+		#address-cells = <2>;
+		#size-cells = <2>;
+
+		ranges;
+
+		pmx_gpio0: pinmux@20230008 {
+			compatible = "pinctrl-single";
+			reg = <0x0 0x20230008 0x0 0x4>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			#pinctrl-cells = <2>;
+			pinctrl-single,bit-per-mux;
+			pinctrl-single,register-width = <32>;
+			pinctrl-single,function-mask = <0x1>;
+
+			uart0_pins: pinmux_uart0_pins {
+				pinctrl-single,bits = <0x00 0x00000003 0x00000003>;
+			};
+		};
+
+		serial0: uart0@20210000 {
+			compatible = "snps,dw-apb-uart";
+			reg = <0x0 0x20210000 0x0 0x100>;
+			clocks = <&ref_clk>;
+			reg-io-width = <4>;
+			reg-shift = <2>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&uart0_pins>;
+		};
+	};
+};
-- 
2.15.0.276.g89ea799


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

  parent reply	other threads:[~2020-01-15 10:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 10:26 [PATCH 0/5] Add support for Kalray k1c core Clement Leger
2020-01-15 10:26 ` [PATCH 1/5] k1c: Initial Kalray Coolidge (k1c) architecture support Clement Leger
2020-01-16  9:26   ` Sascha Hauer
2020-01-16 10:49     ` Clément Leger
2020-01-16 10:55       ` Sascha Hauer
2020-01-16 12:24         ` Clément Leger
2020-01-16 13:11           ` Sascha Hauer
2020-01-16 13:26             ` Clément Leger
2020-01-16 13:34               ` Sascha Hauer
2020-01-15 10:26 ` [PATCH 2/5] k1c: Add processor definitions Clement Leger
2020-01-15 10:26 ` Clement Leger [this message]
2020-01-15 10:26 ` [PATCH 4/5] clocksource: k1c: Add k1c clocksource support Clement Leger
2020-01-15 10:26 ` [PATCH 5/5] watchdog: k1c: Add k1c watchdog support Clement Leger
2020-01-20 15:10   ` Ahmad Fatoum
2020-01-20 16:08     ` Clément Leger
2020-01-16  8:25 ` [PATCH 0/5] Add support for Kalray k1c core Sascha Hauer
2020-01-16  8:53   ` Clément Leger
2020-01-16  9:22     ` Sascha Hauer
2020-01-16  9:37       ` Clément Leger
2020-01-16  9:46         ` Sascha Hauer
2020-01-16  9:49 ` Roland Hieber
2020-01-16  9:53   ` Clément Leger

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=20200115102650.11739-4-cleger@kalray.eu \
    --to=cleger@kalray.eu \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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