dts: nios2: Add interrupt controller support in dts

Added properties to support the core interrupt controller on the NIOS2
cpu cores and enable that support for the NS16550 UART.

We rename some compatibles so that the cpu core compatibles is unique.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-03-27 12:22:55 -05:00 committed by Kumar Gala
commit 4192254ef2
7 changed files with 42 additions and 15 deletions

View file

@ -6,7 +6,7 @@
/ { / {
model = "altera_max10"; model = "altera_max10";
compatible = "altera,nios2f"; compatible = "altera,nios2-max10";
aliases { aliases {
uart-0 = &uart0; uart-0 = &uart0;

View file

@ -0,0 +1,15 @@
# Copyright (c) 2018 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
description: Altera NIOS-2F CPU
compatible: "altera,nios2f"
include: [interrupt-controller.yaml, base.yaml]
properties:
"#interrupt-cells":
const: 1
interrupt-cells:
- irq

View file

@ -0,0 +1,15 @@
# Copyright (c) 2020 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
description: QEMU NIOS2 Zephyr CPU
compatible: "qemu,nios2-zephyr"
include: [interrupt-controller.yaml, base.yaml]
properties:
"#interrupt-cells":
const: 1
interrupt-cells:
- irq

View file

@ -7,12 +7,13 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
cpu@0 { cpu: cpu@0 {
device_type = "cpu"; device_type = "cpu";
compatible = "qemu,nios2"; compatible = "qemu,nios2-zephyr";
reg = <0>; reg = <0>;
interrupt-controller;
#interrupt-cells = <1>;
}; };
}; };
flash0: flash@420000 { flash0: flash@420000 {
@ -29,6 +30,7 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "simple-bus"; compatible = "simple-bus";
interrupt-parent = <&cpu>;
ranges; ranges;
jtag_uart: uart@201000 { jtag_uart: uart@201000 {
@ -42,12 +44,11 @@
ns16550_uart: uart@440000 { ns16550_uart: uart@440000 {
compatible = "ns16550"; compatible = "ns16550";
reg = <0x440000 0x400>; reg = <0x440000 0x400>;
/* interrupts = <1 0>; */ interrupts = <1>;
clock-frequency = <50000000>; clock-frequency = <50000000>;
label = "UART_0"; label = "UART_0";
status = "disabled"; status = "disabled";
}; };
}; };
}; };

View file

@ -8,12 +8,13 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;
cpu@0 { cpu: cpu@0 {
device_type = "cpu"; device_type = "cpu";
compatible = "altera,nios2f"; compatible = "altera,nios2f";
reg = <0>; reg = <0>;
interrupt-controller;
#interrupt-cells = <1>;
}; };
}; };
flash0: flash@0 { flash0: flash@0 {
@ -30,13 +31,14 @@
#address-cells = <1>; #address-cells = <1>;
#size-cells = <1>; #size-cells = <1>;
compatible = "simple-bus"; compatible = "simple-bus";
interrupt-parent = <&cpu>;
ranges; ranges;
uart0: uart@f0008000 { uart0: uart@f0008000 {
compatible = "ns16550"; compatible = "ns16550";
reg = <0xf0008000 0x400>; reg = <0xf0008000 0x400>;
clock-frequency = <50000000>; clock-frequency = <50000000>;
/* interrupts = <1 0>; */ interrupts = <1 0>;
label = "UART_0"; label = "UART_0";
status = "disabled"; status = "disabled";

View file

@ -10,7 +10,4 @@
#include <system.h> #include <system.h>
/* Move to DTS once interrupt controller is defined there */
#define DT_INST_0_NS16550_IRQ_0 A_16550_UART_0_IRQ
#endif #endif

View file

@ -10,7 +10,4 @@
#include <system.h> #include <system.h>
/* Move to DTS once interrupt controller is defined there */
#define DT_INST_0_NS16550_IRQ_0 A_16550_UART_0_IRQ
#endif #endif