Skip to content

Commit 87fcfa7

Browse files
FlyGoattsbogend
authored andcommitted
MIPS: Loongson64: Add generic dts
Add generic device dts for Loongson-3 devices. They are currently almost identical but will be different later. Some PCH devices like PCI Host Bridge is still enabled by platform code for now. Signed-off-by: Jiaxun Yang <[email protected]> Co-developed-by: Huacai Chen <[email protected]> Signed-off-by: Huacai Chen <[email protected]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent bfe9a29 commit 87fcfa7

File tree

7 files changed

+149
-2
lines changed

7 files changed

+149
-2
lines changed

arch/mips/Kconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,11 @@ config MACH_LOONGSON64
486486
select SYS_SUPPORTS_HIGHMEM
487487
select SYS_SUPPORTS_LITTLE_ENDIAN
488488
select SYS_SUPPORTS_ZBOOT
489-
select LOONGSON_MC146818
490489
select ZONE_DMA32
491490
select NUMA
491+
select COMMON_CLK
492+
select USE_OF
493+
select BUILTIN_DTB
492494
help
493495
This enables the support of Loongson-2/3 family of machines.
494496

@@ -3081,7 +3083,7 @@ endchoice
30813083
choice
30823084
prompt "Kernel command line type" if !CMDLINE_OVERRIDE
30833085
default MIPS_CMDLINE_FROM_DTB if USE_OF && !ATH79 && !MACH_INGENIC && \
3084-
!MIPS_MALTA && \
3086+
!MACH_LOONGSON64 && !MIPS_MALTA && \
30853087
!CAVIUM_OCTEON_SOC
30863088
default MIPS_CMDLINE_FROM_BOOTLOADER
30873089

arch/mips/boot/dts/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ subdir-y += cavium-octeon
44
subdir-y += img
55
subdir-y += ingenic
66
subdir-y += lantiq
7+
subdir-y += loongson
78
subdir-y += mscc
89
subdir-y += mti
910
subdir-y += netlogic

arch/mips/boot/dts/loongson/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX_License_Identifier: GPL_2.0
2+
dtb-$(CONFIG_MACH_LOONGSON64) += loongson3_4core_rs780e.dtb loongson3_8core_rs780e.dtb
3+
4+
obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .o, $(dtb-y))
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
#include <dt-bindings/interrupt-controller/irq.h>
4+
5+
/ {
6+
#address-cells = <2>;
7+
#size-cells = <2>;
8+
9+
cpuintc: interrupt-controller {
10+
#address-cells = <0>;
11+
#interrupt-cells = <1>;
12+
interrupt-controller;
13+
compatible = "mti,cpu-interrupt-controller";
14+
};
15+
16+
package0: bus@1fe00000 {
17+
compatible = "simple-bus";
18+
#address-cells = <2>;
19+
#size-cells = <1>;
20+
ranges = <0 0x1fe00000 0 0x1fe00000 0x100000
21+
0 0x3ff00000 0 0x3ff00000 0x100000
22+
/* 3A HT Config Space */
23+
0xefd 0xfb000000 0xefd 0xfb000000 0x10000000
24+
/* 3B HT Config Space */
25+
0x1efd 0xfb000000 0x1efd 0xfb000000 0x10000000>;
26+
27+
liointc: interrupt-controller@3ff01400 {
28+
compatible = "loongson,liointc-1.0";
29+
reg = <0 0x3ff01400 0x64>;
30+
31+
interrupt-controller;
32+
#interrupt-cells = <2>;
33+
34+
interrupt-parent = <&cpuintc>;
35+
interrupts = <2>, <3>;
36+
interrupt-names = "int0", "int1";
37+
38+
loongson,parent_int_map = <0xf0ffffff>, /* int0 */
39+
<0x0f000000>, /* int1 */
40+
<0x00000000>, /* int2 */
41+
<0x00000000>; /* int3 */
42+
43+
};
44+
45+
cpu_uart0: serial@1fe001e0 {
46+
compatible = "ns16550a";
47+
reg = <0 0x1fe001e0 0x8>;
48+
clock-frequency = <33000000>;
49+
interrupt-parent = <&liointc>;
50+
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
51+
no-loopback-test;
52+
};
53+
54+
cpu_uart1: serial@1fe001e8 {
55+
status = "disabled";
56+
compatible = "ns16550a";
57+
reg = <0 0x1fe001e8 0x8>;
58+
clock-frequency = <33000000>;
59+
interrupts = <10 IRQ_TYPE_LEVEL_HIGH>;
60+
interrupt-parent = <&liointc>;
61+
no-loopback-test;
62+
};
63+
};
64+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
/dts-v1/;
4+
5+
#include "loongson3-package.dtsi"
6+
#include "rs780e-pch.dtsi"
7+
8+
/ {
9+
compatible = "loongson,loongson3-4core-rs780e";
10+
};
11+
12+
&package0 {
13+
htpic: interrupt-controller@efdfb000080 {
14+
compatible = "loongson,htpic-1.0";
15+
reg = <0xefd 0xfb000080 0x40>;
16+
interrupt-controller;
17+
#interrupt-cells = <1>;
18+
19+
interrupt-parent = <&liointc>;
20+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
21+
<25 IRQ_TYPE_LEVEL_HIGH>,
22+
<26 IRQ_TYPE_LEVEL_HIGH>,
23+
<27 IRQ_TYPE_LEVEL_HIGH>;
24+
};
25+
};
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
/dts-v1/;
4+
5+
#include "loongson3-package.dtsi"
6+
#include "rs780e-pch.dtsi"
7+
8+
/ {
9+
compatible = "loongson,loongson3-8core-rs780e";
10+
};
11+
12+
&package0 {
13+
htpic: interrupt-controller@1efdfb000080 {
14+
compatible = "loongson,htpic-1.0";
15+
reg = <0x1efd 0xfb000080 0x40>;
16+
interrupt-controller;
17+
#interrupt-cells = <1>;
18+
19+
interrupt-parent = <&liointc>;
20+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>,
21+
<25 IRQ_TYPE_LEVEL_HIGH>,
22+
<26 IRQ_TYPE_LEVEL_HIGH>,
23+
<27 IRQ_TYPE_LEVEL_HIGH>;
24+
};
25+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
/ {
4+
bus@10000000 {
5+
compatible = "simple-bus";
6+
#address-cells = <2>;
7+
#size-cells = <2>;
8+
ranges = <0 0x10000000 0 0x10000000 0 0x10000000
9+
0 0x40000000 0 0x40000000 0 0x40000000
10+
0xfd 0xfe000000 0xfd 0xfe000000 0 0x2000000 /* PCI Config Space */>;
11+
12+
isa {
13+
compatible = "isa";
14+
#address-cells = <2>;
15+
#size-cells = <1>;
16+
ranges = <1 0 0 0 0x1000>;
17+
18+
rtc0: rtc@70 {
19+
compatible = "motorola,mc146818";
20+
reg = <1 0x70 0x8>;
21+
interrupts = <8>;
22+
interrupt-parent = <&htpic>;
23+
};
24+
};
25+
};
26+
};

0 commit comments

Comments
 (0)