Skip to content

Commit 111005c

Browse files
committed
openrisc: dts: Add de0 nano config and devicetree
The de0 nano from Terasic is an FPGA board that we use in the OpenRISC community to test OpenRISC configurations. Add a base configuration for the board that runs an OpenRISC CPU at 50Mhz with 32MB ram, UART for console and some GPIOs for LEDs and switches. There is an older version of this floating around that defines all of the hardware on the board including SPI's, flash devices, sram, ADCs etc. Eventually it would be good to get the full version upstream but for now I think a minimal board is good to start with. Link: https://openrisc.io/tutorials/de0_nano/ Link: https://github.com/olofk/de0_nano Signed-off-by: Stafford Horne <shorne@gmail.com>
1 parent 0f61b18 commit 111005c

3 files changed

Lines changed: 175 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <dt-bindings/gpio/gpio.h>
4+
#include <dt-bindings/leds/common.h>
5+
6+
/ {
7+
leds0: leds {
8+
compatible = "gpio-leds";
9+
10+
led-heartbeat {
11+
gpios = <&gpio0 0 GPIO_ACTIVE_HIGH>;
12+
color = <LED_COLOR_ID_GREEN>;
13+
function = LED_FUNCTION_HEARTBEAT;
14+
linux,default-trigger = "heartbeat";
15+
label = "heartbeat";
16+
};
17+
};
18+
19+
memory@0 {
20+
device_type = "memory";
21+
reg = <0x00000000 0x02000000>;
22+
};
23+
24+
/* 8 Green LEDs */
25+
gpio0: gpio@91000000 {
26+
compatible = "opencores,gpio";
27+
reg = <0x91000000 0x1>, <0x91000001 0x1>;
28+
reg-names = "dat", "dirout";
29+
gpio-controller;
30+
#gpio-cells = <2>;
31+
};
32+
33+
/* 4 DIP Switches */
34+
gpio1: gpio@92000000 {
35+
compatible = "opencores,gpio";
36+
reg = <0x92000000 0x1>, <0x92000001 0x1>;
37+
reg-names = "dat", "dirout";
38+
gpio-controller;
39+
#gpio-cells = <2>;
40+
status = "disabled";
41+
};
42+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
/dts-v1/;
4+
5+
#include "de0-nano-common.dtsi"
6+
7+
/ {
8+
model = "Terasic DE0 Nano";
9+
compatible = "opencores,or1ksim";
10+
#address-cells = <1>;
11+
#size-cells = <1>;
12+
interrupt-parent = <&pic>;
13+
14+
aliases {
15+
uart0 = &serial0;
16+
};
17+
18+
chosen {
19+
stdout-path = "uart0:115200";
20+
};
21+
22+
cpus {
23+
#address-cells = <1>;
24+
#size-cells = <0>;
25+
26+
cpu@0 {
27+
compatible = "opencores,or1200-rtlsvn481";
28+
reg = <0>;
29+
clock-frequency = <50000000>;
30+
};
31+
};
32+
33+
/*
34+
* OR1K PIC is built into CPU and accessed via special purpose
35+
* registers. It is not addressable and, hence, has no 'reg'
36+
* property.
37+
*/
38+
pic: pic {
39+
compatible = "opencores,or1k-pic";
40+
#interrupt-cells = <1>;
41+
interrupt-controller;
42+
};
43+
44+
serial0: serial@90000000 {
45+
compatible = "opencores,uart16550-rtlsvn105", "ns16550a";
46+
reg = <0x90000000 0x100>;
47+
interrupts = <2>;
48+
clock-frequency = <50000000>;
49+
};
50+
};
51+
52+
&gpio1 {
53+
status = "okay";
54+
};
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
CONFIG_SYSVIPC=y
2+
CONFIG_NO_HZ=y
3+
CONFIG_LOG_BUF_SHIFT=14
4+
CONFIG_BLK_DEV_INITRD=y
5+
# CONFIG_RD_GZIP is not set
6+
# CONFIG_RD_LZMA is not set
7+
# CONFIG_RD_LZO is not set
8+
# CONFIG_RD_LZ4 is not set
9+
# CONFIG_RD_ZSTD is not set
10+
CONFIG_EXPERT=y
11+
# CONFIG_EPOLL is not set
12+
# CONFIG_TIMERFD is not set
13+
# CONFIG_EVENTFD is not set
14+
# CONFIG_AIO is not set
15+
CONFIG_BUILTIN_DTB_NAME="de0-nano"
16+
# CONFIG_FPU is not set
17+
CONFIG_HZ_100=y
18+
# CONFIG_BLOCK is not set
19+
CONFIG_SLUB_TINY=y
20+
# CONFIG_COMPAT_BRK is not set
21+
# CONFIG_VM_EVENT_COUNTERS is not set
22+
CONFIG_NET=y
23+
CONFIG_UNIX=y
24+
CONFIG_UNIX_DIAG=y
25+
CONFIG_INET=y
26+
CONFIG_IP_MULTICAST=y
27+
CONFIG_INET_UDP_DIAG=y
28+
CONFIG_INET_RAW_DIAG=y
29+
CONFIG_INET_DIAG_DESTROY=y
30+
# CONFIG_IPV6 is not set
31+
CONFIG_DEVTMPFS=y
32+
CONFIG_DEVTMPFS_MOUNT=y
33+
# CONFIG_PREVENT_FIRMWARE_BUILD is not set
34+
# CONFIG_FW_LOADER is not set
35+
# CONFIG_INPUT is not set
36+
# CONFIG_SERIO is not set
37+
# CONFIG_VT is not set
38+
# CONFIG_LEGACY_PTYS is not set
39+
CONFIG_SERIAL_8250=y
40+
CONFIG_SERIAL_8250_CONSOLE=y
41+
CONFIG_SERIAL_OF_PLATFORM=y
42+
# CONFIG_HW_RANDOM is not set
43+
CONFIG_PPS=y
44+
CONFIG_GPIO_SYSFS=y
45+
# CONFIG_GPIO_SYSFS_LEGACY is not set
46+
CONFIG_GPIO_GENERIC_PLATFORM=y
47+
# CONFIG_HWMON is not set
48+
# CONFIG_USB_SUPPORT is not set
49+
CONFIG_NEW_LEDS=y
50+
CONFIG_LEDS_CLASS=y
51+
CONFIG_LEDS_GPIO=y
52+
CONFIG_LEDS_TRIGGERS=y
53+
CONFIG_LEDS_TRIGGER_TIMER=y
54+
CONFIG_LEDS_TRIGGER_ONESHOT=y
55+
CONFIG_LEDS_TRIGGER_HEARTBEAT=y
56+
CONFIG_LEDS_TRIGGER_CPU=y
57+
CONFIG_LEDS_TRIGGER_ACTIVITY=y
58+
CONFIG_LEDS_TRIGGER_GPIO=y
59+
CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
60+
CONFIG_LEDS_TRIGGER_TRANSIENT=y
61+
CONFIG_LEDS_TRIGGER_PANIC=y
62+
CONFIG_LEDS_TRIGGER_NETDEV=y
63+
CONFIG_LEDS_TRIGGER_PATTERN=y
64+
CONFIG_LEDS_TRIGGER_TTY=y
65+
# CONFIG_VIRTIO_MENU is not set
66+
# CONFIG_VHOST_MENU is not set
67+
# CONFIG_DNOTIFY is not set
68+
CONFIG_TMPFS=y
69+
# CONFIG_XZ_DEC_X86 is not set
70+
# CONFIG_XZ_DEC_POWERPC is not set
71+
# CONFIG_XZ_DEC_ARM is not set
72+
# CONFIG_XZ_DEC_ARMTHUMB is not set
73+
# CONFIG_XZ_DEC_ARM64 is not set
74+
# CONFIG_XZ_DEC_SPARC is not set
75+
# CONFIG_XZ_DEC_RISCV is not set
76+
CONFIG_PRINTK_TIME=y
77+
# CONFIG_DEBUG_MISC is not set
78+
# CONFIG_FTRACE is not set
79+
# CONFIG_RUNTIME_TESTING_MENU is not set

0 commit comments

Comments
 (0)