Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'loongarch-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson

Pull LoongArch updates from Huacai Chen:

- Raise minimum clang version to 18.0.0

- Enable initial Rust support for LoongArch

- Add built-in dtb support for LoongArch

- Use generic interface to support crashkernel=X,[high,low]

- Some bug fixes and other small changes

- Update the default config file.

* tag 'loongarch-6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: (22 commits)
MAINTAINERS: Add BPF JIT for LOONGARCH entry
LoongArch: Update Loongson-3 default config file
LoongArch: BPF: Prevent out-of-bounds memory access
LoongArch: BPF: Support 64-bit pointers to kfuncs
LoongArch: Fix definition of ftrace_regs_set_instruction_pointer()
LoongArch: Use generic interface to support crashkernel=X,[high,low]
LoongArch: Fix and simplify fcsr initialization on execve()
LoongArch: Let cores_io_master cover the largest NR_CPUS
LoongArch: Change SHMLBA from SZ_64K to PAGE_SIZE
LoongArch: Add a missing call to efi_esrt_init()
LoongArch: Parsing CPU-related information from DTS
LoongArch: dts: DeviceTree for Loongson-2K2000
LoongArch: dts: DeviceTree for Loongson-2K1000
LoongArch: dts: DeviceTree for Loongson-2K0500
LoongArch: Allow device trees be built into the kernel
dt-bindings: interrupt-controller: loongson,liointc: Fix dtbs_check warning for interrupt-names
dt-bindings: interrupt-controller: loongson,liointc: Fix dtbs_check warning for reg-names
dt-bindings: loongarch: Add Loongson SoC boards compatibles
dt-bindings: loongarch: Add CPU bindings for LoongArch
LoongArch: Enable initial Rust support
...

+1735 -102
+13 -11
Documentation/admin-guide/kernel-parameters.txt
··· 888 888 memory region [offset, offset + size] for that kernel 889 889 image. If '@offset' is omitted, then a suitable offset 890 890 is selected automatically. 891 - [KNL, X86-64, ARM64, RISCV] Select a region under 4G first, and 892 - fall back to reserve region above 4G when '@offset' 893 - hasn't been specified. 891 + [KNL, X86-64, ARM64, RISCV, LoongArch] Select a region 892 + under 4G first, and fall back to reserve region above 893 + 4G when '@offset' hasn't been specified. 894 894 See Documentation/admin-guide/kdump/kdump.rst for further details. 895 895 896 896 crashkernel=range1:size1[,range2:size2,...][@offset] ··· 901 901 Documentation/admin-guide/kdump/kdump.rst for an example. 902 902 903 903 crashkernel=size[KMG],high 904 - [KNL, X86-64, ARM64, RISCV] range could be above 4G. 904 + [KNL, X86-64, ARM64, RISCV, LoongArch] range could be 905 + above 4G. 905 906 Allow kernel to allocate physical memory region from top, 906 907 so could be above 4G if system have more than 4G ram 907 908 installed. Otherwise memory region will be allocated 908 909 below 4G, if available. 909 910 It will be ignored if crashkernel=X is specified. 910 911 crashkernel=size[KMG],low 911 - [KNL, X86-64, ARM64, RISCV] range under 4G. When crashkernel=X,high 912 - is passed, kernel could allocate physical memory region 913 - above 4G, that cause second kernel crash on system 914 - that require some amount of low memory, e.g. swiotlb 915 - requires at least 64M+32K low memory, also enough extra 916 - low memory is needed to make sure DMA buffers for 32-bit 917 - devices won't run out. Kernel would try to allocate 912 + [KNL, X86-64, ARM64, RISCV, LoongArch] range under 4G. 913 + When crashkernel=X,high is passed, kernel could allocate 914 + physical memory region above 4G, that cause second kernel 915 + crash on system that require some amount of low memory, 916 + e.g. swiotlb requires at least 64M+32K low memory, also 917 + enough extra low memory is needed to make sure DMA buffers 918 + for 32-bit devices won't run out. Kernel would try to allocate 918 919 default size of memory below 4G automatically. The default 919 920 size is platform dependent. 920 921 --> x86: max(swiotlb_size_or_default() + 8MiB, 256MiB) 921 922 --> arm64: 128MiB 922 923 --> riscv: 128MiB 924 + --> loongarch: 128MiB 923 925 This one lets the user specify own low range under 4G 924 926 for second kernel instead. 925 927 0: to disable low allocation.
+12 -6
Documentation/devicetree/bindings/interrupt-controller/loongson,liointc.yaml
··· 11 11 12 12 description: | 13 13 This interrupt controller is found in the Loongson-3 family of chips and 14 - Loongson-2K1000 chip, as the primary package interrupt controller which 14 + Loongson-2K series chips, as the primary package interrupt controller which 15 15 can route local I/O interrupt to interrupt lines of cores. 16 + Be aware of the following points. 17 + 1.The Loongson-2K0500 is a single core CPU; 18 + 2.The Loongson-2K0500/2K1000 has 64 device interrupt sources as inputs, so we 19 + need to define two nodes in dts{i} to describe the "0-31" and "32-61" interrupt 20 + sources respectively. 16 21 17 22 allOf: 18 23 - $ref: /schemas/interrupt-controller.yaml# ··· 38 33 - const: main 39 34 - const: isr0 40 35 - const: isr1 36 + minItems: 2 41 37 42 38 interrupt-controller: true 43 39 ··· 51 45 interrupt-names: 52 46 description: List of names for the parent interrupts. 53 47 items: 54 - - const: int0 55 - - const: int1 56 - - const: int2 57 - - const: int3 48 + pattern: int[0-3] 58 49 minItems: 1 50 + maxItems: 4 59 51 60 52 '#interrupt-cells': 61 53 const: 2 ··· 73 69 - compatible 74 70 - reg 75 71 - interrupts 72 + - interrupt-names 76 73 - interrupt-controller 77 74 - '#interrupt-cells' 78 75 - loongson,parent_int_map ··· 91 86 then: 92 87 properties: 93 88 reg: 94 - minItems: 3 89 + minItems: 2 90 + maxItems: 3 95 91 96 92 required: 97 93 - reg-names
+61
Documentation/devicetree/bindings/loongarch/cpus.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/loongarch/cpus.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: LoongArch CPUs 8 + 9 + maintainers: 10 + - Binbin Zhou <zhoubinbin@loongson.cn> 11 + 12 + description: 13 + This document describes the list of LoongArch CPU cores that support FDT, 14 + it describe the layout of CPUs in a system through the "cpus" node. 15 + 16 + allOf: 17 + - $ref: /schemas/cpu.yaml# 18 + 19 + properties: 20 + compatible: 21 + enum: 22 + - loongson,la264 23 + - loongson,la364 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + clocks: 29 + maxItems: 1 30 + 31 + required: 32 + - compatible 33 + - reg 34 + - clocks 35 + 36 + unevaluatedProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/clock/loongson,ls2k-clk.h> 41 + 42 + cpus { 43 + #size-cells = <0>; 44 + #address-cells = <1>; 45 + 46 + cpu@0 { 47 + compatible = "loongson,la264"; 48 + device_type = "cpu"; 49 + reg = <0>; 50 + clocks = <&clk LOONGSON2_NODE_CLK>; 51 + }; 52 + 53 + cpu@1 { 54 + compatible = "loongson,la264"; 55 + device_type = "cpu"; 56 + reg = <1>; 57 + clocks = <&clk LOONGSON2_NODE_CLK>; 58 + }; 59 + }; 60 + 61 + ...
+34
Documentation/devicetree/bindings/loongarch/loongson.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/loongarch/loongson.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Loongson SoC-based boards 8 + 9 + maintainers: 10 + - Binbin Zhou <zhoubinbin@loongson.cn> 11 + 12 + properties: 13 + $nodename: 14 + const: '/' 15 + compatible: 16 + oneOf: 17 + - description: Loongson-2K0500 processor based boards 18 + items: 19 + - const: loongson,ls2k0500-ref 20 + - const: loongson,ls2k0500 21 + 22 + - description: Loongson-2K1000 processor based boards 23 + items: 24 + - const: loongson,ls2k1000-ref 25 + - const: loongson,ls2k1000 26 + 27 + - description: Loongson-2K2000 processor based boards 28 + items: 29 + - const: loongson,ls2k2000-ref 30 + - const: loongson,ls2k2000 31 + 32 + additionalProperties: true 33 + 34 + ...
+7 -6
Documentation/rust/arch-support.rst
··· 12 12 Below is a general summary of architectures that currently work. Level of 13 13 support corresponds to ``S`` values in the ``MAINTAINERS`` file. 14 14 15 - ============ ================ ============================================== 16 - Architecture Level of support Constraints 17 - ============ ================ ============================================== 18 - ``um`` Maintained ``x86_64`` only. 19 - ``x86`` Maintained ``x86_64`` only. 20 - ============ ================ ============================================== 15 + ============= ================ ============================================== 16 + Architecture Level of support Constraints 17 + ============= ================ ============================================== 18 + ``loongarch`` Maintained - 19 + ``um`` Maintained ``x86_64`` only. 20 + ``x86`` Maintained ``x86_64`` only. 21 + ============= ================ ============================================== 21 22
+7
MAINTAINERS
··· 3692 3692 S: Supported 3693 3693 F: arch/arm64/net/ 3694 3694 3695 + BPF JIT for LOONGARCH 3696 + M: Tiezhu Yang <yangtiezhu@loongson.cn> 3697 + R: Hengqi Chen <hengqi.chen@gmail.com> 3698 + L: bpf@vger.kernel.org 3699 + S: Maintained 3700 + F: arch/loongarch/net/ 3701 + 3695 3702 BPF JIT for MIPS (32-BIT AND 64-BIT) 3696 3703 M: Johan Almbladh <johan.almbladh@anyfinetworks.com> 3697 3704 M: Paul Burton <paulburton@kernel.org>
+1
arch/loongarch/Kbuild
··· 4 4 obj-y += vdso/ 5 5 6 6 obj-$(CONFIG_KVM) += kvm/ 7 + obj-$(CONFIG_BUILTIN_DTB) += boot/dts/ 7 8 8 9 # for cleaning 9 10 subdir- += boot
+22
arch/loongarch/Kconfig
··· 142 142 select HAVE_REGS_AND_STACK_ACCESS_API 143 143 select HAVE_RETHOOK 144 144 select HAVE_RSEQ 145 + select HAVE_RUST 145 146 select HAVE_SAMPLE_FTRACE_DIRECT 146 147 select HAVE_SAMPLE_FTRACE_DIRECT_MULTI 147 148 select HAVE_SETUP_PER_CPU_AREA if NUMA ··· 377 376 378 377 endchoice 379 378 379 + config BUILTIN_DTB 380 + bool "Enable built-in dtb in kernel" 381 + depends on OF 382 + help 383 + Some existing systems do not provide a canonical device tree to 384 + the kernel at boot time. Let's provide a device tree table in the 385 + kernel, keyed by the dts filename, containing the relevant DTBs. 386 + 387 + Built-in DTBs are generic enough and can be used as references. 388 + 389 + config BUILTIN_DTB_NAME 390 + string "Source file for built-in dtb" 391 + depends on BUILTIN_DTB 392 + help 393 + Base name (without suffix, relative to arch/loongarch/boot/dts/) 394 + for the DTS file that will be used to produce the DTB linked into 395 + the kernel. 396 + 380 397 config DMI 381 398 bool "Enable DMI scanning" 382 399 select DMI_SCAN_MACHINE_NON_EFI_FALLBACK ··· 595 576 def_bool y 596 577 depends on CRASH_DUMP 597 578 select RELOCATABLE 579 + 580 + config ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION 581 + def_bool CRASH_CORE 598 582 599 583 config RELOCATABLE 600 584 bool "Relocatable kernel"
+5 -1
arch/loongarch/Makefile
··· 6 6 boot := arch/loongarch/boot 7 7 8 8 KBUILD_DEFCONFIG := loongson3_defconfig 9 + KBUILD_DTBS := dtbs 9 10 10 11 image-name-y := vmlinux 11 12 image-name-$(CONFIG_EFI_ZBOOT) := vmlinuz ··· 82 81 KBUILD_CFLAGS_MODULE += -fplt -Wa,-mla-global-with-abs,-mla-local-with-abs 83 82 endif 84 83 84 + KBUILD_RUSTFLAGS_MODULE += -Crelocation-model=pic 85 + 85 86 ifeq ($(CONFIG_RELOCATABLE),y) 86 87 KBUILD_CFLAGS_KERNEL += -fPIE 88 + KBUILD_RUSTFLAGS_KERNEL += -Crelocation-model=pie 87 89 LDFLAGS_vmlinux += -static -pie --no-dynamic-linker -z notext $(call ld-option, --apply-dynamic-relocs) 88 90 endif 89 91 ··· 145 141 146 142 vdso-install-y += arch/loongarch/vdso/vdso.so.dbg 147 143 148 - all: $(notdir $(KBUILD_IMAGE)) 144 + all: $(notdir $(KBUILD_IMAGE)) $(KBUILD_DTBS) 149 145 150 146 vmlinuz.efi: vmlinux.efi 151 147
+3 -2
arch/loongarch/boot/dts/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - dtstree := $(srctree)/$(src) 3 2 4 - dtb-y := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts)) 3 + dtb-y = loongson-2k0500-ref.dtb loongson-2k1000-ref.dtb loongson-2k2000-ref.dtb 4 + 5 + obj-$(CONFIG_BUILTIN_DTB) += $(addsuffix .dtb.o, $(CONFIG_BUILTIN_DTB_NAME))
+88
arch/loongarch/boot/dts/loongson-2k0500-ref.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "loongson-2k0500.dtsi" 9 + 10 + / { 11 + compatible = "loongson,ls2k0500-ref", "loongson,ls2k0500"; 12 + model = "Loongson-2K0500 Reference Board"; 13 + 14 + aliases { 15 + ethernet0 = &gmac0; 16 + ethernet1 = &gmac1; 17 + serial0 = &uart0; 18 + }; 19 + 20 + chosen { 21 + stdout-path = "serial0:115200n8"; 22 + }; 23 + 24 + memory@200000 { 25 + device_type = "memory"; 26 + reg = <0x0 0x00200000 0x0 0x0ee00000>, 27 + <0x0 0x90000000 0x0 0x60000000>; 28 + }; 29 + 30 + reserved-memory { 31 + #address-cells = <2>; 32 + #size-cells = <2>; 33 + ranges; 34 + 35 + linux,cma { 36 + compatible = "shared-dma-pool"; 37 + reusable; 38 + size = <0x0 0x2000000>; 39 + linux,cma-default; 40 + }; 41 + }; 42 + }; 43 + 44 + &gmac0 { 45 + status = "okay"; 46 + 47 + phy-mode = "rgmii"; 48 + bus_id = <0x0>; 49 + }; 50 + 51 + &gmac1 { 52 + status = "okay"; 53 + 54 + phy-mode = "rgmii"; 55 + bus_id = <0x1>; 56 + }; 57 + 58 + &i2c0 { 59 + status = "okay"; 60 + 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + eeprom@57{ 64 + compatible = "atmel,24c16"; 65 + reg = <0x57>; 66 + pagesize = <16>; 67 + }; 68 + }; 69 + 70 + &ehci0 { 71 + status = "okay"; 72 + }; 73 + 74 + &ohci0 { 75 + status = "okay"; 76 + }; 77 + 78 + &sata { 79 + status = "okay"; 80 + }; 81 + 82 + &uart0 { 83 + status = "okay"; 84 + }; 85 + 86 + &rtc0 { 87 + status = "okay"; 88 + };
+266
arch/loongarch/boot/dts/loongson-2k0500.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/interrupt-controller/irq.h> 9 + 10 + / { 11 + #address-cells = <2>; 12 + #size-cells = <2>; 13 + 14 + cpus { 15 + #address-cells = <1>; 16 + #size-cells = <0>; 17 + 18 + cpu0: cpu@0 { 19 + compatible = "loongson,la264"; 20 + device_type = "cpu"; 21 + reg = <0x0>; 22 + clocks = <&cpu_clk>; 23 + }; 24 + }; 25 + 26 + cpu_clk: cpu-clk { 27 + compatible = "fixed-clock"; 28 + #clock-cells = <0>; 29 + clock-frequency = <500000000>; 30 + }; 31 + 32 + cpuintc: interrupt-controller { 33 + compatible = "loongson,cpu-interrupt-controller"; 34 + #interrupt-cells = <1>; 35 + interrupt-controller; 36 + }; 37 + 38 + bus@10000000 { 39 + compatible = "simple-bus"; 40 + ranges = <0x0 0x10000000 0x0 0x10000000 0x0 0x10000000>, 41 + <0x0 0x02000000 0x0 0x02000000 0x0 0x02000000>, 42 + <0x0 0x20000000 0x0 0x20000000 0x0 0x10000000>, 43 + <0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>, 44 + <0xfe 0x0 0xfe 0x0 0x0 0x40000000>; 45 + #address-cells = <2>; 46 + #size-cells = <2>; 47 + 48 + isa@16400000 { 49 + compatible = "isa"; 50 + #size-cells = <1>; 51 + #address-cells = <2>; 52 + ranges = <1 0x0 0x0 0x16400000 0x4000>; 53 + }; 54 + 55 + liointc0: interrupt-controller@1fe11400 { 56 + compatible = "loongson,liointc-2.0"; 57 + reg = <0x0 0x1fe11400 0x0 0x40>, 58 + <0x0 0x1fe11040 0x0 0x8>; 59 + reg-names = "main", "isr0"; 60 + 61 + interrupt-controller; 62 + #interrupt-cells = <2>; 63 + interrupt-parent = <&cpuintc>; 64 + interrupts = <2>; 65 + interrupt-names = "int0"; 66 + 67 + loongson,parent_int_map = <0xffffffff>, /* int0 */ 68 + <0x00000000>, /* int1 */ 69 + <0x00000000>, /* int2 */ 70 + <0x00000000>; /* int3 */ 71 + }; 72 + 73 + liointc1: interrupt-controller@1fe11440 { 74 + compatible = "loongson,liointc-2.0"; 75 + reg = <0x0 0x1fe11440 0x0 0x40>, 76 + <0x0 0x1fe11048 0x0 0x8>; 77 + reg-names = "main", "isr0"; 78 + 79 + interrupt-controller; 80 + #interrupt-cells = <2>; 81 + interrupt-parent = <&cpuintc>; 82 + interrupts = <4>; 83 + interrupt-names = "int2"; 84 + 85 + loongson,parent_int_map = <0x00000000>, /* int0 */ 86 + <0x00000000>, /* int1 */ 87 + <0xffffffff>, /* int2 */ 88 + <0x00000000>; /* int3 */ 89 + }; 90 + 91 + eiointc: interrupt-controller@1fe11600 { 92 + compatible = "loongson,ls2k0500-eiointc"; 93 + reg = <0x0 0x1fe11600 0x0 0xea00>; 94 + interrupt-controller; 95 + #interrupt-cells = <1>; 96 + interrupt-parent = <&cpuintc>; 97 + interrupts = <3>; 98 + }; 99 + 100 + gmac0: ethernet@1f020000 { 101 + compatible = "snps,dwmac-3.70a"; 102 + reg = <0x0 0x1f020000 0x0 0x10000>; 103 + interrupt-parent = <&liointc0>; 104 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 105 + interrupt-names = "macirq"; 106 + status = "disabled"; 107 + }; 108 + 109 + gmac1: ethernet@1f030000 { 110 + compatible = "snps,dwmac-3.70a"; 111 + reg = <0x0 0x1f030000 0x0 0x10000>; 112 + interrupt-parent = <&liointc0>; 113 + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; 114 + interrupt-names = "macirq"; 115 + status = "disabled"; 116 + }; 117 + 118 + sata: sata@1f040000 { 119 + compatible = "snps,spear-ahci"; 120 + reg = <0x0 0x1f040000 0x0 0x10000>; 121 + interrupt-parent = <&eiointc>; 122 + interrupts = <75>; 123 + status = "disabled"; 124 + }; 125 + 126 + ehci0: usb@1f050000 { 127 + compatible = "generic-ehci"; 128 + reg = <0x0 0x1f050000 0x0 0x8000>; 129 + interrupt-parent = <&eiointc>; 130 + interrupts = <71>; 131 + status = "disabled"; 132 + }; 133 + 134 + ohci0: usb@1f058000 { 135 + compatible = "generic-ohci"; 136 + reg = <0x0 0x1f058000 0x0 0x8000>; 137 + interrupt-parent = <&eiointc>; 138 + interrupts = <72>; 139 + status = "disabled"; 140 + }; 141 + 142 + uart0: serial@1ff40800 { 143 + compatible = "ns16550a"; 144 + reg = <0x0 0x1ff40800 0x0 0x10>; 145 + clock-frequency = <100000000>; 146 + interrupt-parent = <&eiointc>; 147 + interrupts = <2>; 148 + no-loopback-test; 149 + status = "disabled"; 150 + }; 151 + 152 + i2c0: i2c@1ff48000 { 153 + compatible = "loongson,ls2k-i2c"; 154 + reg = <0x0 0x1ff48000 0x0 0x0800>; 155 + interrupt-parent = <&eiointc>; 156 + interrupts = <14>; 157 + status = "disabled"; 158 + }; 159 + 160 + i2c@1ff48800 { 161 + compatible = "loongson,ls2k-i2c"; 162 + reg = <0x0 0x1ff48800 0x0 0x0800>; 163 + interrupt-parent = <&eiointc>; 164 + interrupts = <15>; 165 + status = "disabled"; 166 + }; 167 + 168 + i2c@1ff49000 { 169 + compatible = "loongson,ls2k-i2c"; 170 + reg = <0x0 0x1ff49000 0x0 0x0800>; 171 + interrupt-parent = <&eiointc>; 172 + interrupts = <16>; 173 + status = "disabled"; 174 + }; 175 + 176 + i2c@1ff49800 { 177 + compatible = "loongson,ls2k-i2c"; 178 + reg = <0x0 0x1ff49800 0x0 0x0800>; 179 + interrupt-parent = <&eiointc>; 180 + interrupts = <17>; 181 + status = "disabled"; 182 + }; 183 + 184 + i2c@1ff4a000 { 185 + compatible = "loongson,ls2k-i2c"; 186 + reg = <0x0 0x1ff4a000 0x0 0x0800>; 187 + interrupt-parent = <&eiointc>; 188 + interrupts = <18>; 189 + status = "disabled"; 190 + }; 191 + 192 + i2c@1ff4a800 { 193 + compatible = "loongson,ls2k-i2c"; 194 + reg = <0x0 0x1ff4a800 0x0 0x0800>; 195 + interrupt-parent = <&eiointc>; 196 + interrupts = <19>; 197 + status = "disabled"; 198 + }; 199 + 200 + pmc: power-management@1ff6c000 { 201 + compatible = "loongson,ls2k0500-pmc", "syscon"; 202 + reg = <0x0 0x1ff6c000 0x0 0x58>; 203 + interrupt-parent = <&eiointc>; 204 + interrupts = <56>; 205 + loongson,suspend-address = <0x0 0x1c000500>; 206 + 207 + syscon-reboot { 208 + compatible = "syscon-reboot"; 209 + offset = <0x30>; 210 + mask = <0x1>; 211 + }; 212 + 213 + syscon-poweroff { 214 + compatible = "syscon-poweroff"; 215 + regmap = <&pmc>; 216 + offset = <0x14>; 217 + mask = <0x3c00>; 218 + value = <0x3c00>; 219 + }; 220 + }; 221 + 222 + rtc0: rtc@1ff6c100 { 223 + compatible = "loongson,ls2k0500-rtc", "loongson,ls7a-rtc"; 224 + reg = <0x0 0x1ff6c100 0x0 0x100>; 225 + interrupt-parent = <&eiointc>; 226 + interrupts = <35>; 227 + status = "disabled"; 228 + }; 229 + 230 + pcie@1a000000 { 231 + compatible = "loongson,ls2k-pci"; 232 + reg = <0x0 0x1a000000 0x0 0x02000000>, 233 + <0xfe 0x0 0x0 0x20000000>; 234 + #address-cells = <3>; 235 + #size-cells = <2>; 236 + device_type = "pci"; 237 + bus-range = <0x0 0x5>; 238 + ranges = <0x01000000 0x0 0x00004000 0x0 0x16404000 0x0 0x00004000>, 239 + <0x02000000 0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>; 240 + 241 + pcie@0,0 { 242 + reg = <0x0000 0x0 0x0 0x0 0x0>; 243 + #address-cells = <3>; 244 + #size-cells = <2>; 245 + device_type = "pci"; 246 + interrupt-parent = <&eiointc>; 247 + #interrupt-cells = <1>; 248 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 249 + interrupt-map = <0x0 0x0 0x0 0x0 &eiointc 81>; 250 + ranges; 251 + }; 252 + 253 + pcie@1,0 { 254 + reg = <0x0800 0x0 0x0 0x0 0x0>; 255 + #address-cells = <3>; 256 + #size-cells = <2>; 257 + device_type = "pci"; 258 + interrupt-parent = <&eiointc>; 259 + #interrupt-cells = <1>; 260 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 261 + interrupt-map = <0x0 0x0 0x0 0x0 &eiointc 82>; 262 + ranges; 263 + }; 264 + }; 265 + }; 266 + };
+183
arch/loongarch/boot/dts/loongson-2k1000-ref.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "loongson-2k1000.dtsi" 9 + 10 + / { 11 + compatible = "loongson,ls2k1000-ref", "loongson,ls2k1000"; 12 + model = "Loongson-2K1000 Reference Board"; 13 + 14 + aliases { 15 + serial0 = &uart0; 16 + }; 17 + 18 + chosen { 19 + stdout-path = "serial0:115200n8"; 20 + }; 21 + 22 + memory@200000 { 23 + device_type = "memory"; 24 + reg = <0x0 0x00200000 0x0 0x06e00000>, 25 + <0x0 0x08000000 0x0 0x07000000>, 26 + <0x0 0x90000000 0x1 0xe0000000>; 27 + }; 28 + 29 + reserved-memory { 30 + #address-cells = <2>; 31 + #size-cells = <2>; 32 + ranges; 33 + 34 + linux,cma { 35 + compatible = "shared-dma-pool"; 36 + reusable; 37 + size = <0x0 0x2000000>; 38 + linux,cma-default; 39 + }; 40 + }; 41 + }; 42 + 43 + &gmac0 { 44 + status = "okay"; 45 + 46 + phy-mode = "rgmii"; 47 + phy-handle = <&phy0>; 48 + mdio { 49 + compatible = "snps,dwmac-mdio"; 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + phy0: ethernet-phy@0 { 53 + reg = <0>; 54 + }; 55 + }; 56 + }; 57 + 58 + &gmac1 { 59 + status = "okay"; 60 + 61 + phy-mode = "rgmii"; 62 + phy-handle = <&phy1>; 63 + mdio { 64 + compatible = "snps,dwmac-mdio"; 65 + #address-cells = <1>; 66 + #size-cells = <0>; 67 + phy1: ethernet-phy@1 { 68 + reg = <16>; 69 + }; 70 + }; 71 + }; 72 + 73 + &i2c2 { 74 + status = "okay"; 75 + 76 + pinctrl-0 = <&i2c0_pins_default>; 77 + pinctrl-names = "default"; 78 + 79 + #address-cells = <1>; 80 + #size-cells = <0>; 81 + eeprom@57{ 82 + compatible = "atmel,24c16"; 83 + reg = <0x57>; 84 + pagesize = <16>; 85 + }; 86 + }; 87 + 88 + &spi0 { 89 + status = "okay"; 90 + 91 + #address-cells = <1>; 92 + #size-cells = <0>; 93 + spidev@0 { 94 + compatible = "rohm,dh2228fv"; 95 + spi-max-frequency = <100000000>; 96 + reg = <0>; 97 + }; 98 + }; 99 + 100 + &ehci0 { 101 + status = "okay"; 102 + }; 103 + 104 + &ohci0 { 105 + status = "okay"; 106 + }; 107 + 108 + &sata { 109 + status = "okay"; 110 + }; 111 + 112 + &uart0 { 113 + status = "okay"; 114 + }; 115 + 116 + &clk { 117 + status = "okay"; 118 + }; 119 + 120 + &rtc0 { 121 + status = "okay"; 122 + }; 123 + 124 + &pctrl { 125 + status = "okay"; 126 + 127 + sdio_pins_default: sdio-pins { 128 + sdio-pinmux { 129 + groups = "sdio"; 130 + function = "sdio"; 131 + }; 132 + sdio-det-pinmux { 133 + groups = "pwm2"; 134 + function = "gpio"; 135 + }; 136 + }; 137 + 138 + pwm1_pins_default: pwm1-pins { 139 + pinmux { 140 + groups = "pwm1"; 141 + function = "pwm1"; 142 + }; 143 + }; 144 + 145 + pwm0_pins_default: pwm0-pins { 146 + pinmux { 147 + groups = "pwm0"; 148 + function = "pwm0"; 149 + }; 150 + }; 151 + 152 + i2c1_pins_default: i2c1-pins { 153 + pinmux { 154 + groups = "i2c1"; 155 + function = "i2c1"; 156 + }; 157 + }; 158 + 159 + i2c0_pins_default: i2c0-pins { 160 + pinmux { 161 + groups = "i2c0"; 162 + function = "i2c0"; 163 + }; 164 + }; 165 + 166 + nand_pins_default: nand-pins { 167 + pinmux { 168 + groups = "nand"; 169 + function = "nand"; 170 + }; 171 + }; 172 + 173 + hda_pins_default: hda-pins { 174 + grp0-pinmux { 175 + groups = "hda"; 176 + function = "hda"; 177 + }; 178 + grp1-pinmux { 179 + groups = "i2s"; 180 + function = "gpio"; 181 + }; 182 + }; 183 + };
+492
arch/loongarch/boot/dts/loongson-2k1000.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/interrupt-controller/irq.h> 9 + #include <dt-bindings/clock/loongson,ls2k-clk.h> 10 + #include <dt-bindings/gpio/gpio.h> 11 + 12 + / { 13 + #address-cells = <2>; 14 + #size-cells = <2>; 15 + 16 + cpus { 17 + #address-cells = <1>; 18 + #size-cells = <0>; 19 + 20 + cpu0: cpu@0 { 21 + compatible = "loongson,la264"; 22 + device_type = "cpu"; 23 + reg= <0x0>; 24 + clocks = <&clk LOONGSON2_NODE_CLK>; 25 + }; 26 + 27 + cpu1: cpu@1 { 28 + compatible = "loongson,la264"; 29 + device_type = "cpu"; 30 + reg = <0x1>; 31 + clocks = <&clk LOONGSON2_NODE_CLK>; 32 + }; 33 + }; 34 + 35 + ref_100m: clock-ref-100m { 36 + compatible = "fixed-clock"; 37 + #clock-cells = <0>; 38 + clock-frequency = <100000000>; 39 + clock-output-names = "ref_100m"; 40 + }; 41 + 42 + cpuintc: interrupt-controller { 43 + compatible = "loongson,cpu-interrupt-controller"; 44 + #interrupt-cells = <1>; 45 + interrupt-controller; 46 + }; 47 + 48 + /* i2c of the dvi eeprom edid */ 49 + i2c-gpio-0 { 50 + compatible = "i2c-gpio"; 51 + scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 52 + sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 53 + i2c-gpio,delay-us = <5>; /* ~100 kHz */ 54 + #address-cells = <1>; 55 + #size-cells = <0>; 56 + status = "disabled"; 57 + }; 58 + 59 + /* i2c of the eeprom edid */ 60 + i2c-gpio-1 { 61 + compatible = "i2c-gpio"; 62 + scl-gpios = <&gpio0 33 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 63 + sda-gpios = <&gpio0 32 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; 64 + i2c-gpio,delay-us = <5>; /* ~100 kHz */ 65 + #address-cells = <1>; 66 + #size-cells = <0>; 67 + status = "disabled"; 68 + }; 69 + 70 + thermal-zones { 71 + cpu-thermal { 72 + polling-delay-passive = <1000>; 73 + polling-delay = <5000>; 74 + thermal-sensors = <&tsensor 0>; 75 + 76 + trips { 77 + cpu_alert: cpu-alert { 78 + temperature = <33000>; 79 + hysteresis = <2000>; 80 + type = "active"; 81 + }; 82 + 83 + cpu_crit: cpu-crit { 84 + temperature = <85000>; 85 + hysteresis = <5000>; 86 + type = "critical"; 87 + }; 88 + }; 89 + }; 90 + }; 91 + 92 + bus@10000000 { 93 + compatible = "simple-bus"; 94 + ranges = <0x0 0x10000000 0x0 0x10000000 0x0 0x10000000>, 95 + <0x0 0x02000000 0x0 0x02000000 0x0 0x02000000>, 96 + <0x0 0x20000000 0x0 0x20000000 0x0 0x10000000>, 97 + <0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>, 98 + <0xfe 0x0 0xfe 0x0 0x0 0x40000000>; 99 + #address-cells = <2>; 100 + #size-cells = <2>; 101 + dma-coherent; 102 + 103 + liointc0: interrupt-controller@1fe01400 { 104 + compatible = "loongson,liointc-2.0"; 105 + reg = <0x0 0x1fe01400 0x0 0x40>, 106 + <0x0 0x1fe01040 0x0 0x8>, 107 + <0x0 0x1fe01140 0x0 0x8>; 108 + reg-names = "main", "isr0", "isr1"; 109 + interrupt-controller; 110 + #interrupt-cells = <2>; 111 + interrupt-parent = <&cpuintc>; 112 + interrupts = <2>; 113 + interrupt-names = "int0"; 114 + loongson,parent_int_map = <0xffffffff>, /* int0 */ 115 + <0x00000000>, /* int1 */ 116 + <0x00000000>, /* int2 */ 117 + <0x00000000>; /* int3 */ 118 + }; 119 + 120 + liointc1: interrupt-controller@1fe01440 { 121 + compatible = "loongson,liointc-2.0"; 122 + reg = <0x0 0x1fe01440 0x0 0x40>, 123 + <0x0 0x1fe01048 0x0 0x8>, 124 + <0x0 0x1fe01148 0x0 0x8>; 125 + reg-names = "main", "isr0", "isr1"; 126 + interrupt-controller; 127 + #interrupt-cells = <2>; 128 + interrupt-parent = <&cpuintc>; 129 + interrupts = <3>; 130 + interrupt-names = "int1"; 131 + loongson,parent_int_map = <0x00000000>, /* int0 */ 132 + <0xffffffff>, /* int1 */ 133 + <0x00000000>, /* int2 */ 134 + <0x00000000>; /* int3 */ 135 + }; 136 + 137 + chipid@1fe00000 { 138 + compatible = "loongson,ls2k-chipid"; 139 + reg = <0x0 0x1fe00000 0x0 0x30>; 140 + little-endian; 141 + }; 142 + 143 + pctrl: pinctrl@1fe00420 { 144 + compatible = "loongson,ls2k-pinctrl"; 145 + reg = <0x0 0x1fe00420 0x0 0x18>; 146 + status = "disabled"; 147 + }; 148 + 149 + clk: clock-controller@1fe00480 { 150 + compatible = "loongson,ls2k-clk"; 151 + reg = <0x0 0x1fe00480 0x0 0x58>; 152 + #clock-cells = <1>; 153 + clocks = <&ref_100m>; 154 + clock-names = "ref_100m"; 155 + status = "disabled"; 156 + }; 157 + 158 + gpio0: gpio@1fe00500 { 159 + compatible = "loongson,ls2k-gpio"; 160 + reg = <0x0 0x1fe00500 0x0 0x38>; 161 + ngpios = <64>; 162 + #gpio-cells = <2>; 163 + gpio-controller; 164 + gpio-ranges = <&pctrl 0x0 0x0 15>, 165 + <&pctrl 16 16 15>, 166 + <&pctrl 32 32 10>, 167 + <&pctrl 44 44 20>; 168 + interrupt-parent = <&liointc1>; 169 + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>, 170 + <29 IRQ_TYPE_LEVEL_HIGH>, 171 + <30 IRQ_TYPE_LEVEL_HIGH>, 172 + <30 IRQ_TYPE_LEVEL_HIGH>, 173 + <26 IRQ_TYPE_LEVEL_HIGH>, 174 + <26 IRQ_TYPE_LEVEL_HIGH>, 175 + <26 IRQ_TYPE_LEVEL_HIGH>, 176 + <26 IRQ_TYPE_LEVEL_HIGH>, 177 + <26 IRQ_TYPE_LEVEL_HIGH>, 178 + <26 IRQ_TYPE_LEVEL_HIGH>, 179 + <26 IRQ_TYPE_LEVEL_HIGH>, 180 + <26 IRQ_TYPE_LEVEL_HIGH>, 181 + <26 IRQ_TYPE_LEVEL_HIGH>, 182 + <26 IRQ_TYPE_LEVEL_HIGH>, 183 + <26 IRQ_TYPE_LEVEL_HIGH>, 184 + <>, 185 + <26 IRQ_TYPE_LEVEL_HIGH>, 186 + <26 IRQ_TYPE_LEVEL_HIGH>, 187 + <26 IRQ_TYPE_LEVEL_HIGH>, 188 + <26 IRQ_TYPE_LEVEL_HIGH>, 189 + <26 IRQ_TYPE_LEVEL_HIGH>, 190 + <26 IRQ_TYPE_LEVEL_HIGH>, 191 + <26 IRQ_TYPE_LEVEL_HIGH>, 192 + <26 IRQ_TYPE_LEVEL_HIGH>, 193 + <26 IRQ_TYPE_LEVEL_HIGH>, 194 + <26 IRQ_TYPE_LEVEL_HIGH>, 195 + <26 IRQ_TYPE_LEVEL_HIGH>, 196 + <26 IRQ_TYPE_LEVEL_HIGH>, 197 + <26 IRQ_TYPE_LEVEL_HIGH>, 198 + <26 IRQ_TYPE_LEVEL_HIGH>, 199 + <26 IRQ_TYPE_LEVEL_HIGH>, 200 + <26 IRQ_TYPE_LEVEL_HIGH>, 201 + <27 IRQ_TYPE_LEVEL_HIGH>, 202 + <27 IRQ_TYPE_LEVEL_HIGH>, 203 + <27 IRQ_TYPE_LEVEL_HIGH>, 204 + <27 IRQ_TYPE_LEVEL_HIGH>, 205 + <27 IRQ_TYPE_LEVEL_HIGH>, 206 + <>, 207 + <27 IRQ_TYPE_LEVEL_HIGH>, 208 + <27 IRQ_TYPE_LEVEL_HIGH>, 209 + <27 IRQ_TYPE_LEVEL_HIGH>, 210 + <27 IRQ_TYPE_LEVEL_HIGH>, 211 + <>, 212 + <>, 213 + <27 IRQ_TYPE_LEVEL_HIGH>, 214 + <27 IRQ_TYPE_LEVEL_HIGH>, 215 + <27 IRQ_TYPE_LEVEL_HIGH>, 216 + <27 IRQ_TYPE_LEVEL_HIGH>, 217 + <27 IRQ_TYPE_LEVEL_HIGH>, 218 + <27 IRQ_TYPE_LEVEL_HIGH>, 219 + <27 IRQ_TYPE_LEVEL_HIGH>, 220 + <27 IRQ_TYPE_LEVEL_HIGH>, 221 + <27 IRQ_TYPE_LEVEL_HIGH>, 222 + <27 IRQ_TYPE_LEVEL_HIGH>, 223 + <27 IRQ_TYPE_LEVEL_HIGH>, 224 + <27 IRQ_TYPE_LEVEL_HIGH>, 225 + <27 IRQ_TYPE_LEVEL_HIGH>, 226 + <27 IRQ_TYPE_LEVEL_HIGH>, 227 + <27 IRQ_TYPE_LEVEL_HIGH>, 228 + <27 IRQ_TYPE_LEVEL_HIGH>, 229 + <27 IRQ_TYPE_LEVEL_HIGH>, 230 + <27 IRQ_TYPE_LEVEL_HIGH>, 231 + <27 IRQ_TYPE_LEVEL_HIGH>, 232 + <27 IRQ_TYPE_LEVEL_HIGH>; 233 + }; 234 + 235 + tsensor: thermal-sensor@1fe01500 { 236 + compatible = "loongson,ls2k1000-thermal"; 237 + reg = <0x0 0x1fe01500 0x0 0x30>; 238 + interrupt-parent = <&liointc0>; 239 + interrupts = <7 IRQ_TYPE_LEVEL_HIGH>; 240 + #thermal-sensor-cells = <1>; 241 + }; 242 + 243 + dma-controller@1fe00c00 { 244 + compatible = "loongson,ls2k1000-apbdma"; 245 + reg = <0x0 0x1fe00c00 0x0 0x8>; 246 + interrupt-parent = <&liointc1>; 247 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 248 + clocks = <&clk LOONGSON2_APB_CLK>; 249 + #dma-cells = <1>; 250 + status = "disabled"; 251 + }; 252 + 253 + dma-controller@1fe00c10 { 254 + compatible = "loongson,ls2k1000-apbdma"; 255 + reg = <0x0 0x1fe00c10 0x0 0x8>; 256 + interrupt-parent = <&liointc1>; 257 + interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; 258 + clocks = <&clk LOONGSON2_APB_CLK>; 259 + #dma-cells = <1>; 260 + status = "disabled"; 261 + }; 262 + 263 + dma-controller@1fe00c20 { 264 + compatible = "loongson,ls2k1000-apbdma"; 265 + reg = <0x0 0x1fe00c20 0x0 0x8>; 266 + interrupt-parent = <&liointc1>; 267 + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; 268 + clocks = <&clk LOONGSON2_APB_CLK>; 269 + #dma-cells = <1>; 270 + status = "disabled"; 271 + }; 272 + 273 + dma-controller@1fe00c30 { 274 + compatible = "loongson,ls2k1000-apbdma"; 275 + reg = <0x0 0x1fe00c30 0x0 0x8>; 276 + interrupt-parent = <&liointc1>; 277 + interrupts = <15 IRQ_TYPE_LEVEL_HIGH>; 278 + clocks = <&clk LOONGSON2_APB_CLK>; 279 + #dma-cells = <1>; 280 + status = "disabled"; 281 + }; 282 + 283 + dma-controller@1fe00c40 { 284 + compatible = "loongson,ls2k1000-apbdma"; 285 + reg = <0x0 0x1fe00c40 0x0 0x8>; 286 + interrupt-parent = <&liointc1>; 287 + interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; 288 + clocks = <&clk LOONGSON2_APB_CLK>; 289 + #dma-cells = <1>; 290 + status = "disabled"; 291 + }; 292 + 293 + uart0: serial@1fe20000 { 294 + compatible = "ns16550a"; 295 + reg = <0x0 0x1fe20000 0x0 0x10>; 296 + clock-frequency = <125000000>; 297 + interrupt-parent = <&liointc0>; 298 + interrupts = <0x0 IRQ_TYPE_LEVEL_HIGH>; 299 + no-loopback-test; 300 + status = "disabled"; 301 + }; 302 + 303 + i2c2: i2c@1fe21000 { 304 + compatible = "loongson,ls2k-i2c"; 305 + reg = <0x0 0x1fe21000 0x0 0x8>; 306 + interrupt-parent = <&liointc0>; 307 + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; 308 + status = "disabled"; 309 + }; 310 + 311 + i2c3: i2c@1fe21800 { 312 + compatible = "loongson,ls2k-i2c"; 313 + reg = <0x0 0x1fe21800 0x0 0x8>; 314 + interrupt-parent = <&liointc0>; 315 + interrupts = <23 IRQ_TYPE_LEVEL_HIGH>; 316 + status = "disabled"; 317 + }; 318 + 319 + pmc: power-management@1fe27000 { 320 + compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon"; 321 + reg = <0x0 0x1fe27000 0x0 0x58>; 322 + interrupt-parent = <&liointc1>; 323 + interrupts = <11 IRQ_TYPE_LEVEL_HIGH>; 324 + loongson,suspend-address = <0x0 0x1c000500>; 325 + 326 + syscon-reboot { 327 + compatible = "syscon-reboot"; 328 + offset = <0x30>; 329 + mask = <0x1>; 330 + }; 331 + 332 + syscon-poweroff { 333 + compatible = "syscon-poweroff"; 334 + regmap = <&pmc>; 335 + offset = <0x14>; 336 + mask = <0x3c00>; 337 + value = <0x3c00>; 338 + }; 339 + }; 340 + 341 + rtc0: rtc@1fe27800 { 342 + compatible = "loongson,ls2k1000-rtc"; 343 + reg = <0x0 0x1fe27800 0x0 0x100>; 344 + interrupt-parent = <&liointc1>; 345 + interrupts = <8 IRQ_TYPE_LEVEL_HIGH>; 346 + status = "disabled"; 347 + }; 348 + 349 + spi0: spi@1fff0220 { 350 + compatible = "loongson,ls2k1000-spi"; 351 + reg = <0x0 0x1fff0220 0x0 0x10>; 352 + clocks = <&clk LOONGSON2_BOOT_CLK>; 353 + status = "disabled"; 354 + }; 355 + 356 + pcie@1a000000 { 357 + compatible = "loongson,ls2k-pci"; 358 + reg = <0x0 0x1a000000 0x0 0x02000000>, 359 + <0xfe 0x0 0x0 0x20000000>; 360 + #address-cells = <3>; 361 + #size-cells = <2>; 362 + device_type = "pci"; 363 + bus-range = <0x0 0xff>; 364 + ranges = <0x01000000 0x0 0x00008000 0x0 0x18008000 0x0 0x00008000>, 365 + <0x02000000 0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>; 366 + 367 + gmac0: ethernet@3,0 { 368 + reg = <0x1800 0x0 0x0 0x0 0x0>; 369 + interrupt-parent = <&liointc0>; 370 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>, 371 + <13 IRQ_TYPE_LEVEL_HIGH>; 372 + interrupt-names = "macirq", "eth_lpi"; 373 + status = "disabled"; 374 + }; 375 + 376 + gmac1: ethernet@3,1 { 377 + reg = <0x1900 0x0 0x0 0x0 0x0>; 378 + interrupt-parent = <&liointc0>; 379 + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>, 380 + <15 IRQ_TYPE_LEVEL_HIGH>; 381 + interrupt-names = "macirq", "eth_lpi"; 382 + status = "disabled"; 383 + }; 384 + 385 + ehci0: usb@4,1 { 386 + reg = <0x2100 0x0 0x0 0x0 0x0>; 387 + interrupt-parent = <&liointc1>; 388 + interrupts = <18 IRQ_TYPE_LEVEL_HIGH>; 389 + status = "disabled"; 390 + }; 391 + 392 + ohci0: usb@4,2 { 393 + reg = <0x2200 0x0 0x0 0x0 0x0>; 394 + interrupt-parent = <&liointc1>; 395 + interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 396 + status = "disabled"; 397 + }; 398 + 399 + display@6,0 { 400 + reg = <0x3000 0x0 0x0 0x0 0x0>; 401 + interrupt-parent = <&liointc0>; 402 + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; 403 + status = "disabled"; 404 + }; 405 + 406 + hda@7,0 { 407 + reg = <0x3800 0x0 0x0 0x0 0x0>; 408 + interrupt-parent = <&liointc0>; 409 + interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 410 + status = "disabled"; 411 + }; 412 + 413 + sata: sata@8,0 { 414 + reg = <0x4000 0x0 0x0 0x0 0x0>; 415 + interrupt-parent = <&liointc0>; 416 + interrupts = <19 IRQ_TYPE_LEVEL_HIGH>; 417 + status = "disabled"; 418 + }; 419 + 420 + pcie@9,0 { 421 + reg = <0x4800 0x0 0x0 0x0 0x0>; 422 + #address-cells = <3>; 423 + #size-cells = <2>; 424 + device_type = "pci"; 425 + #interrupt-cells = <1>; 426 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 427 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 0x0 IRQ_TYPE_LEVEL_HIGH>; 428 + ranges; 429 + }; 430 + 431 + pcie@a,0 { 432 + reg = <0x5000 0x0 0x0 0x0 0x0>; 433 + #address-cells = <3>; 434 + #size-cells = <2>; 435 + device_type = "pci"; 436 + interrupt-parent = <&liointc1>; 437 + #interrupt-cells = <1>; 438 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 439 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 1 IRQ_TYPE_LEVEL_HIGH>; 440 + ranges; 441 + }; 442 + 443 + pcie@b,0 { 444 + reg = <0x5800 0x0 0x0 0x0 0x0>; 445 + #address-cells = <3>; 446 + #size-cells = <2>; 447 + device_type = "pci"; 448 + interrupt-parent = <&liointc1>; 449 + #interrupt-cells = <1>; 450 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 451 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 2 IRQ_TYPE_LEVEL_HIGH>; 452 + ranges; 453 + }; 454 + 455 + pcie@c,0 { 456 + reg = <0x6000 0x0 0x0 0x0 0x0>; 457 + #address-cells = <3>; 458 + #size-cells = <2>; 459 + device_type = "pci"; 460 + interrupt-parent = <&liointc1>; 461 + #interrupt-cells = <1>; 462 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 463 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 3 IRQ_TYPE_LEVEL_HIGH>; 464 + ranges; 465 + }; 466 + 467 + pcie@d,0 { 468 + reg = <0x6800 0x0 0x0 0x0 0x0>; 469 + #address-cells = <3>; 470 + #size-cells = <2>; 471 + device_type = "pci"; 472 + interrupt-parent = <&liointc1>; 473 + #interrupt-cells = <1>; 474 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 475 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 4 IRQ_TYPE_LEVEL_HIGH>; 476 + ranges; 477 + }; 478 + 479 + pcie@e,0 { 480 + reg = <0x7000 0x0 0x0 0x0 0x0>; 481 + #address-cells = <3>; 482 + #size-cells = <2>; 483 + device_type = "pci"; 484 + interrupt-parent = <&liointc1>; 485 + #interrupt-cells = <1>; 486 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 487 + interrupt-map = <0x0 0x0 0x0 0x0 &liointc1 5 IRQ_TYPE_LEVEL_HIGH>; 488 + ranges; 489 + }; 490 + }; 491 + }; 492 + };
+72
arch/loongarch/boot/dts/loongson-2k2000-ref.dts
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include "loongson-2k2000.dtsi" 9 + 10 + / { 11 + compatible = "loongson,ls2k2000-ref", "loongson,ls2k2000"; 12 + model = "Loongson-2K2000 Reference Board"; 13 + 14 + aliases { 15 + serial0 = &uart0; 16 + }; 17 + 18 + chosen { 19 + stdout-path = "serial0:115200n8"; 20 + }; 21 + 22 + memory@200000 { 23 + device_type = "memory"; 24 + reg = <0x0 0x00200000 0x0 0x0ee00000>, 25 + <0x0 0x90000000 0x0 0x70000000>; 26 + }; 27 + 28 + reserved-memory { 29 + #address-cells = <2>; 30 + #size-cells = <2>; 31 + ranges; 32 + 33 + linux,cma { 34 + compatible = "shared-dma-pool"; 35 + reusable; 36 + size = <0x0 0x2000000>; 37 + linux,cma-default; 38 + }; 39 + }; 40 + }; 41 + 42 + &sata { 43 + status = "okay"; 44 + }; 45 + 46 + &uart0 { 47 + status = "okay"; 48 + }; 49 + 50 + &rtc0 { 51 + status = "okay"; 52 + }; 53 + 54 + &xhci0 { 55 + status = "okay"; 56 + }; 57 + 58 + &xhci1 { 59 + status = "okay"; 60 + }; 61 + 62 + &gmac0 { 63 + status = "okay"; 64 + }; 65 + 66 + &gmac1 { 67 + status = "okay"; 68 + }; 69 + 70 + &gmac2 { 71 + status = "okay"; 72 + };
+300
arch/loongarch/boot/dts/loongson-2k2000.dtsi
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (C) 2023 Loongson Technology Corporation Limited 4 + */ 5 + 6 + /dts-v1/; 7 + 8 + #include <dt-bindings/interrupt-controller/irq.h> 9 + 10 + / { 11 + #address-cells = <2>; 12 + #size-cells = <2>; 13 + 14 + cpus { 15 + #address-cells = <1>; 16 + #size-cells = <0>; 17 + 18 + cpu0: cpu@1 { 19 + compatible = "loongson,la364"; 20 + device_type = "cpu"; 21 + reg = <0x0>; 22 + clocks = <&cpu_clk>; 23 + }; 24 + 25 + cpu1: cpu@2 { 26 + compatible = "loongson,la364"; 27 + device_type = "cpu"; 28 + reg = <0x1>; 29 + clocks = <&cpu_clk>; 30 + }; 31 + }; 32 + 33 + cpu_clk: cpu-clk { 34 + compatible = "fixed-clock"; 35 + #clock-cells = <0>; 36 + clock-frequency = <1400000000>; 37 + }; 38 + 39 + cpuintc: interrupt-controller { 40 + compatible = "loongson,cpu-interrupt-controller"; 41 + #interrupt-cells = <1>; 42 + interrupt-controller; 43 + }; 44 + 45 + bus@10000000 { 46 + compatible = "simple-bus"; 47 + ranges = <0x0 0x10000000 0x0 0x10000000 0x0 0x10000000>, 48 + <0x0 0x02000000 0x0 0x02000000 0x0 0x02000000>, 49 + <0x0 0x40000000 0x0 0x40000000 0x0 0x40000000>, 50 + <0xfe 0x0 0xfe 0x0 0x0 0x40000000>; 51 + #address-cells = <2>; 52 + #size-cells = <2>; 53 + 54 + pmc: power-management@100d0000 { 55 + compatible = "loongson,ls2k2000-pmc", "loongson,ls2k0500-pmc", "syscon"; 56 + reg = <0x0 0x100d0000 0x0 0x58>; 57 + interrupt-parent = <&eiointc>; 58 + interrupts = <47>; 59 + loongson,suspend-address = <0x0 0x1c000500>; 60 + 61 + syscon-reboot { 62 + compatible = "syscon-reboot"; 63 + offset = <0x30>; 64 + mask = <0x1>; 65 + }; 66 + 67 + syscon-poweroff { 68 + compatible = "syscon-poweroff"; 69 + regmap = <&pmc>; 70 + offset = <0x14>; 71 + mask = <0x3c00>; 72 + value = <0x3c00>; 73 + }; 74 + }; 75 + 76 + liointc: interrupt-controller@1fe01400 { 77 + compatible = "loongson,liointc-1.0"; 78 + reg = <0x0 0x1fe01400 0x0 0x64>; 79 + 80 + interrupt-controller; 81 + #interrupt-cells = <2>; 82 + interrupt-parent = <&cpuintc>; 83 + interrupts = <2>; 84 + interrupt-names = "int0"; 85 + loongson,parent_int_map = <0xffffffff>, /* int0 */ 86 + <0x00000000>, /* int1 */ 87 + <0x00000000>, /* int2 */ 88 + <0x00000000>; /* int3 */ 89 + }; 90 + 91 + eiointc: interrupt-controller@1fe01600 { 92 + compatible = "loongson,ls2k2000-eiointc"; 93 + reg = <0x0 0x1fe01600 0x0 0xea00>; 94 + interrupt-controller; 95 + #interrupt-cells = <1>; 96 + interrupt-parent = <&cpuintc>; 97 + interrupts = <3>; 98 + }; 99 + 100 + pic: interrupt-controller@10000000 { 101 + compatible = "loongson,pch-pic-1.0"; 102 + reg = <0x0 0x10000000 0x0 0x400>; 103 + interrupt-controller; 104 + #interrupt-cells = <2>; 105 + loongson,pic-base-vec = <0>; 106 + interrupt-parent = <&eiointc>; 107 + }; 108 + 109 + msi: msi-controller@1fe01140 { 110 + compatible = "loongson,pch-msi-1.0"; 111 + reg = <0x0 0x1fe01140 0x0 0x8>; 112 + msi-controller; 113 + loongson,msi-base-vec = <64>; 114 + loongson,msi-num-vecs = <192>; 115 + interrupt-parent = <&eiointc>; 116 + }; 117 + 118 + rtc0: rtc@100d0100 { 119 + compatible = "loongson,ls2k2000-rtc", "loongson,ls7a-rtc"; 120 + reg = <0x0 0x100d0100 0x0 0x100>; 121 + interrupt-parent = <&pic>; 122 + interrupts = <52 IRQ_TYPE_LEVEL_HIGH>; 123 + status = "disabled"; 124 + }; 125 + 126 + uart0: serial@1fe001e0 { 127 + compatible = "ns16550a"; 128 + reg = <0x0 0x1fe001e0 0x0 0x10>; 129 + clock-frequency = <100000000>; 130 + interrupt-parent = <&liointc>; 131 + interrupts = <10 IRQ_TYPE_LEVEL_HIGH>; 132 + no-loopback-test; 133 + status = "disabled"; 134 + }; 135 + 136 + pcie@1a000000 { 137 + compatible = "loongson,ls2k-pci"; 138 + reg = <0x0 0x1a000000 0x0 0x02000000>, 139 + <0xfe 0x0 0x0 0x20000000>; 140 + #address-cells = <3>; 141 + #size-cells = <2>; 142 + device_type = "pci"; 143 + bus-range = <0x0 0xff>; 144 + ranges = <0x01000000 0x0 0x00008000 0x0 0x18400000 0x0 0x00008000>, 145 + <0x02000000 0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>; 146 + 147 + gmac0: ethernet@3,0 { 148 + reg = <0x1800 0x0 0x0 0x0 0x0>; 149 + interrupts = <12 IRQ_TYPE_LEVEL_HIGH>; 150 + interrupt-parent = <&pic>; 151 + status = "disabled"; 152 + }; 153 + 154 + gmac1: ethernet@3,1 { 155 + reg = <0x1900 0x0 0x0 0x0 0x0>; 156 + interrupts = <14 IRQ_TYPE_LEVEL_HIGH>; 157 + interrupt-parent = <&pic>; 158 + status = "disabled"; 159 + }; 160 + 161 + gmac2: ethernet@3,2 { 162 + reg = <0x1a00 0x0 0x0 0x0 0x0>; 163 + interrupts = <17 IRQ_TYPE_LEVEL_HIGH>; 164 + interrupt-parent = <&pic>; 165 + status = "disabled"; 166 + }; 167 + 168 + xhci0: usb@4,0 { 169 + reg = <0x2000 0x0 0x0 0x0 0x0>; 170 + interrupts = <48 IRQ_TYPE_LEVEL_HIGH>; 171 + interrupt-parent = <&pic>; 172 + status = "disabled"; 173 + }; 174 + 175 + xhci1: usb@19,0 { 176 + reg = <0xc800 0x0 0x0 0x0 0x0>; 177 + interrupts = <22 IRQ_TYPE_LEVEL_HIGH>; 178 + interrupt-parent = <&pic>; 179 + status = "disabled"; 180 + }; 181 + 182 + display@6,1 { 183 + reg = <0x3100 0x0 0x0 0x0 0x0>; 184 + interrupts = <28 IRQ_TYPE_LEVEL_HIGH>; 185 + interrupt-parent = <&pic>; 186 + status = "disabled"; 187 + }; 188 + 189 + hda@7,0 { 190 + reg = <0x3800 0x0 0x0 0x0 0x0>; 191 + interrupts = <58 IRQ_TYPE_LEVEL_HIGH>; 192 + interrupt-parent = <&pic>; 193 + status = "disabled"; 194 + }; 195 + 196 + sata: sata@8,0 { 197 + reg = <0x4000 0x0 0x0 0x0 0x0>; 198 + interrupts = <16 IRQ_TYPE_LEVEL_HIGH>; 199 + interrupt-parent = <&pic>; 200 + status = "disabled"; 201 + }; 202 + 203 + pcie@9,0 { 204 + reg = <0x4800 0x0 0x0 0x0 0x0>; 205 + #address-cells = <3>; 206 + #size-cells = <2>; 207 + device_type = "pci"; 208 + interrupt-parent = <&pic>; 209 + #interrupt-cells = <1>; 210 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 211 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 32 IRQ_TYPE_LEVEL_HIGH>; 212 + ranges; 213 + }; 214 + 215 + pcie@a,0 { 216 + reg = <0x5000 0x0 0x0 0x0 0x0>; 217 + #address-cells = <3>; 218 + #size-cells = <2>; 219 + device_type = "pci"; 220 + interrupt-parent = <&pic>; 221 + #interrupt-cells = <1>; 222 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 223 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 33 IRQ_TYPE_LEVEL_HIGH>; 224 + ranges; 225 + }; 226 + 227 + pcie@b,0 { 228 + reg = <0x5800 0x0 0x0 0x0 0x0>; 229 + #address-cells = <3>; 230 + #size-cells = <2>; 231 + device_type = "pci"; 232 + interrupt-parent = <&pic>; 233 + #interrupt-cells = <1>; 234 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 235 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 34 IRQ_TYPE_LEVEL_HIGH>; 236 + ranges; 237 + }; 238 + 239 + pcie@c,0 { 240 + reg = <0x6000 0x0 0x0 0x0 0x0>; 241 + #address-cells = <3>; 242 + #size-cells = <2>; 243 + device_type = "pci"; 244 + interrupt-parent = <&pic>; 245 + #interrupt-cells = <1>; 246 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 247 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 35 IRQ_TYPE_LEVEL_HIGH>; 248 + ranges; 249 + }; 250 + 251 + pcie@d,0 { 252 + reg = <0x6800 0x0 0x0 0x0 0x0>; 253 + #address-cells = <3>; 254 + #size-cells = <2>; 255 + device_type = "pci"; 256 + interrupt-parent = <&pic>; 257 + #interrupt-cells = <1>; 258 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 259 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 36 IRQ_TYPE_LEVEL_HIGH>; 260 + ranges; 261 + }; 262 + 263 + pcie@e,0 { 264 + reg = <0x7000 0x0 0x0 0x0 0x0>; 265 + #address-cells = <3>; 266 + #size-cells = <2>; 267 + device_type = "pci"; 268 + interrupt-parent = <&pic>; 269 + #interrupt-cells = <1>; 270 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 271 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 37 IRQ_TYPE_LEVEL_HIGH>; 272 + ranges; 273 + }; 274 + 275 + pcie@f,0 { 276 + reg = <0x7800 0x0 0x0 0x0 0x0>; 277 + #address-cells = <3>; 278 + #size-cells = <2>; 279 + device_type = "pci"; 280 + interrupt-parent = <&pic>; 281 + #interrupt-cells = <1>; 282 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 283 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 40 IRQ_TYPE_LEVEL_HIGH>; 284 + ranges; 285 + }; 286 + 287 + pcie@10,0 { 288 + reg = <0x8000 0x0 0x0 0x0 0x0>; 289 + #address-cells = <3>; 290 + #size-cells = <2>; 291 + device_type = "pci"; 292 + interrupt-parent = <&pic>; 293 + #interrupt-cells = <1>; 294 + interrupt-map-mask = <0x0 0x0 0x0 0x0>; 295 + interrupt-map = <0x0 0x0 0x0 0x0 &pic 30 IRQ_TYPE_LEVEL_HIGH>; 296 + ranges; 297 + }; 298 + }; 299 + }; 300 + };
+47 -8
arch/loongarch/configs/loongson3_defconfig
··· 6 6 CONFIG_BPF_SYSCALL=y 7 7 CONFIG_BPF_JIT=y 8 8 CONFIG_PREEMPT=y 9 + CONFIG_PREEMPT_DYNAMIC=y 10 + CONFIG_SCHED_CORE=y 9 11 CONFIG_BSD_PROCESS_ACCT=y 10 12 CONFIG_BSD_PROCESS_ACCT_V3=y 11 13 CONFIG_TASKSTATS=y ··· 21 19 CONFIG_CFS_BANDWIDTH=y 22 20 CONFIG_RT_GROUP_SCHED=y 23 21 CONFIG_CGROUP_PIDS=y 22 + CONFIG_CGROUP_RDMA=y 24 23 CONFIG_CGROUP_FREEZER=y 25 24 CONFIG_CGROUP_HUGETLB=y 26 25 CONFIG_CPUSETS=y ··· 29 26 CONFIG_CGROUP_CPUACCT=y 30 27 CONFIG_CGROUP_PERF=y 31 28 CONFIG_CGROUP_BPF=y 29 + CONFIG_CGROUP_MISC=y 32 30 CONFIG_NAMESPACES=y 33 31 CONFIG_USER_NS=y 34 32 CONFIG_CHECKPOINT_RESTORE=y ··· 39 35 CONFIG_EXPERT=y 40 36 CONFIG_KALLSYMS_ALL=y 41 37 CONFIG_PERF_EVENTS=y 38 + CONFIG_KEXEC=y 39 + CONFIG_CRASH_DUMP=y 42 40 CONFIG_LOONGARCH=y 43 41 CONFIG_64BIT=y 44 42 CONFIG_MACH_LOONGSON64=y ··· 50 44 CONFIG_EFI=y 51 45 CONFIG_SMP=y 52 46 CONFIG_HOTPLUG_CPU=y 53 - CONFIG_NR_CPUS=64 47 + CONFIG_NR_CPUS=256 54 48 CONFIG_NUMA=y 55 49 CONFIG_CPU_HAS_FPU=y 56 50 CONFIG_CPU_HAS_LSX=y 57 51 CONFIG_CPU_HAS_LASX=y 58 - CONFIG_KEXEC=y 59 - CONFIG_CRASH_DUMP=y 60 52 CONFIG_RANDOMIZE_BASE=y 61 53 CONFIG_SUSPEND=y 62 54 CONFIG_HIBERNATION=y ··· 66 62 CONFIG_ACPI_HOTPLUG_CPU=y 67 63 CONFIG_ACPI_PCI_SLOT=y 68 64 CONFIG_ACPI_HOTPLUG_MEMORY=y 69 - CONFIG_EFI_ZBOOT=y 70 - CONFIG_EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER=y 71 - CONFIG_EFI_CAPSULE_LOADER=m 72 - CONFIG_EFI_TEST=m 73 65 CONFIG_VIRTUALIZATION=y 74 66 CONFIG_KVM=m 75 67 CONFIG_JUMP_LABEL=y ··· 74 74 CONFIG_MODULE_UNLOAD=y 75 75 CONFIG_MODULE_FORCE_UNLOAD=y 76 76 CONFIG_MODVERSIONS=y 77 + CONFIG_BLK_DEV_ZONED=y 77 78 CONFIG_BLK_DEV_THROTTLING=y 79 + CONFIG_BLK_DEV_THROTTLING_LOW=y 80 + CONFIG_BLK_WBT=y 81 + CONFIG_BLK_CGROUP_IOLATENCY=y 82 + CONFIG_BLK_CGROUP_FC_APPID=y 83 + CONFIG_BLK_CGROUP_IOCOST=y 84 + CONFIG_BLK_CGROUP_IOPRIO=y 78 85 CONFIG_PARTITION_ADVANCED=y 79 86 CONFIG_BSD_DISKLABEL=y 80 87 CONFIG_UNIXWARE_DISKLABEL=y 88 + CONFIG_CMDLINE_PARTITION=y 81 89 CONFIG_IOSCHED_BFQ=y 82 90 CONFIG_BFQ_GROUP_IOSCHED=y 83 91 CONFIG_BINFMT_MISC=m ··· 101 93 CONFIG_MEMORY_HOTREMOVE=y 102 94 CONFIG_KSM=y 103 95 CONFIG_TRANSPARENT_HUGEPAGE=y 96 + CONFIG_CMA=y 97 + CONFIG_CMA_SYSFS=y 104 98 CONFIG_USERFAULTFD=y 105 99 CONFIG_NET=y 106 100 CONFIG_PACKET=y ··· 138 128 CONFIG_IPV6_ROUTE_INFO=y 139 129 CONFIG_INET6_ESP=m 140 130 CONFIG_IPV6_MROUTE=y 131 + CONFIG_MPTCP=y 141 132 CONFIG_NETWORK_PHY_TIMESTAMPING=y 142 133 CONFIG_NETFILTER=y 143 134 CONFIG_BRIDGE_NETFILTER=m ··· 363 352 CONFIG_PCI_IOV=y 364 353 CONFIG_HOTPLUG_PCI=y 365 354 CONFIG_HOTPLUG_PCI_SHPC=y 355 + CONFIG_PCI_HOST_GENERIC=y 366 356 CONFIG_PCCARD=m 367 357 CONFIG_YENTA=m 368 358 CONFIG_RAPIDIO=y ··· 377 365 CONFIG_DEVTMPFS_MOUNT=y 378 366 CONFIG_FW_LOADER_COMPRESS=y 379 367 CONFIG_FW_LOADER_COMPRESS_ZSTD=y 368 + CONFIG_EFI_ZBOOT=y 369 + CONFIG_EFI_BOOTLOADER_CONTROL=m 370 + CONFIG_EFI_CAPSULE_LOADER=m 371 + CONFIG_EFI_TEST=m 380 372 CONFIG_MTD=m 381 373 CONFIG_MTD_BLOCK=m 382 374 CONFIG_MTD_CFI=m ··· 602 586 CONFIG_RTW89_8852CE=m 603 587 CONFIG_ZD1211RW=m 604 588 CONFIG_USB_NET_RNDIS_WLAN=m 589 + CONFIG_USB4_NET=m 605 590 CONFIG_INPUT_MOUSEDEV=y 606 591 CONFIG_INPUT_MOUSEDEV_PSAUX=y 607 592 CONFIG_INPUT_EVDEV=y ··· 708 691 CONFIG_SND_HDA_CODEC_HDMI=y 709 692 CONFIG_SND_HDA_CODEC_CONEXANT=y 710 693 CONFIG_SND_USB_AUDIO=m 694 + CONFIG_SND_SOC=m 695 + CONFIG_SND_SOC_LOONGSON_CARD=m 696 + CONFIG_SND_VIRTIO=m 711 697 CONFIG_HIDRAW=y 712 698 CONFIG_UHID=m 713 699 CONFIG_HID_A4TECH=m ··· 758 738 CONFIG_RTC_DRV_EFI=y 759 739 CONFIG_RTC_DRV_LOONGSON=y 760 740 CONFIG_DMADEVICES=y 741 + CONFIG_LS2X_APB_DMA=y 742 + CONFIG_UDMABUF=y 743 + CONFIG_DMABUF_HEAPS=y 744 + CONFIG_DMABUF_HEAPS_SYSTEM=y 745 + CONFIG_DMABUF_HEAPS_CMA=y 761 746 CONFIG_UIO=m 762 747 CONFIG_UIO_PDRV_GENIRQ=m 763 748 CONFIG_UIO_DMEM_GENIRQ=m ··· 803 778 CONFIG_DEVFREQ_GOV_PERFORMANCE=y 804 779 CONFIG_DEVFREQ_GOV_POWERSAVE=y 805 780 CONFIG_DEVFREQ_GOV_USERSPACE=y 781 + CONFIG_NTB=m 782 + CONFIG_NTB_MSI=y 783 + CONFIG_NTB_IDT=m 784 + CONFIG_NTB_EPF=m 785 + CONFIG_NTB_SWITCHTEC=m 786 + CONFIG_NTB_PERF=m 787 + CONFIG_NTB_TRANSPORT=m 806 788 CONFIG_PWM=y 789 + CONFIG_USB4=y 807 790 CONFIG_EXT2_FS=y 808 791 CONFIG_EXT2_FS_XATTR=y 809 792 CONFIG_EXT2_FS_POSIX_ACL=y ··· 830 797 CONFIG_OCFS2_FS=m 831 798 CONFIG_BTRFS_FS=y 832 799 CONFIG_BTRFS_FS_POSIX_ACL=y 800 + CONFIG_F2FS_FS=m 801 + CONFIG_F2FS_FS_SECURITY=y 802 + CONFIG_F2FS_CHECK_FS=y 803 + CONFIG_F2FS_FS_COMPRESSION=y 833 804 CONFIG_FANOTIFY=y 834 805 CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y 835 806 CONFIG_QUOTA=y ··· 920 883 CONFIG_SECURITY=y 921 884 CONFIG_SECURITY_SELINUX=y 922 885 CONFIG_SECURITY_SELINUX_BOOTPARAM=y 923 - CONFIG_SECURITY_SELINUX_DISABLE=y 924 886 CONFIG_SECURITY_APPARMOR=y 925 887 CONFIG_SECURITY_YAMA=y 926 888 CONFIG_DEFAULT_SECURITY_DAC=y ··· 950 914 CONFIG_CRYPTO_USER_API_AEAD=m 951 915 CONFIG_CRYPTO_CRC32_LOONGARCH=m 952 916 CONFIG_CRYPTO_DEV_VIRTIO=m 917 + CONFIG_DMA_CMA=y 918 + CONFIG_DMA_NUMA_CMA=y 919 + CONFIG_CMA_SIZE_MBYTES=0 953 920 CONFIG_PRINTK_TIME=y 954 921 CONFIG_STRIP_ASM_SYMS=y 955 922 CONFIG_MAGIC_SYSRQ=y
+4 -2
arch/loongarch/include/asm/bootinfo.h
··· 24 24 const char *board_vendor; 25 25 }; 26 26 27 + #define NR_WORDS DIV_ROUND_UP(NR_CPUS, BITS_PER_LONG) 28 + 27 29 struct loongson_system_configuration { 28 30 int nr_cpus; 29 31 int nr_nodes; 30 32 int boot_cpu_id; 31 33 int cores_per_node; 32 34 int cores_per_package; 33 - unsigned long cores_io_master; 35 + unsigned long cores_io_master[NR_WORDS]; 34 36 unsigned long suspend_addr; 35 37 const char *cpuname; 36 38 }; ··· 44 42 45 43 static inline bool io_master(int cpu) 46 44 { 47 - return test_bit(cpu, &loongson_sysconf.cores_io_master); 45 + return test_bit(cpu, loongson_sysconf.cores_io_master); 48 46 } 49 47 50 48 #endif /* _ASM_BOOTINFO_H */
+12
arch/loongarch/include/asm/crash_core.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-only */ 2 + #ifndef _LOONGARCH_CRASH_CORE_H 3 + #define _LOONGARCH_CRASH_CORE_H 4 + 5 + #define CRASH_ALIGN SZ_2M 6 + 7 + #define CRASH_ADDR_LOW_MAX SZ_4G 8 + #define CRASH_ADDR_HIGH_MAX memblock_end_of_DRAM() 9 + 10 + extern phys_addr_t memblock_end_of_DRAM(void); 11 + 12 + #endif
-5
arch/loongarch/include/asm/elf.h
··· 241 241 do { \ 242 242 current->thread.vdso = &vdso_info; \ 243 243 \ 244 - loongarch_set_personality_fcsr(state); \ 245 - \ 246 244 if (personality(current->personality) != PER_LINUX) \ 247 245 set_personality(PER_LINUX); \ 248 246 } while (0) ··· 257 259 clear_thread_flag(TIF_32BIT_ADDR); \ 258 260 \ 259 261 current->thread.vdso = &vdso_info; \ 260 - loongarch_set_personality_fcsr(state); \ 261 262 \ 262 263 p = personality(current->personality); \ 263 264 if (p != PER_LINUX32 && p != PER_LINUX) \ ··· 336 339 337 340 extern int arch_check_elf(void *ehdr, bool has_interpreter, void *interp_ehdr, 338 341 struct arch_elf_state *state); 339 - 340 - extern void loongarch_set_personality_fcsr(struct arch_elf_state *state); 341 342 342 343 #endif /* _ASM_ELF_H */
+1 -1
arch/loongarch/include/asm/ftrace.h
··· 63 63 static __always_inline void 64 64 ftrace_regs_set_instruction_pointer(struct ftrace_regs *fregs, unsigned long ip) 65 65 { 66 - regs_set_return_value(&fregs->regs, ip); 66 + instruction_pointer_set(&fregs->regs, ip); 67 67 } 68 68 69 69 #define ftrace_regs_get_argument(fregs, n) \
-12
arch/loongarch/include/asm/shmparam.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - /* 3 - * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 4 - */ 5 - #ifndef _ASM_SHMPARAM_H 6 - #define _ASM_SHMPARAM_H 7 - 8 - #define __ARCH_FORCE_SHMLBA 1 9 - 10 - #define SHMLBA SZ_64K /* attach addr a multiple of this */ 11 - 12 - #endif /* _ASM_SHMPARAM_H */
+1 -1
arch/loongarch/kernel/acpi.c
··· 119 119 return -EINVAL; 120 120 121 121 core = eiointc->node * CORES_PER_EIO_NODE; 122 - set_bit(core, &(loongson_sysconf.cores_io_master)); 122 + set_bit(core, loongson_sysconf.cores_io_master); 123 123 124 124 return 0; 125 125 }
+2
arch/loongarch/kernel/efi.c
··· 140 140 141 141 early_memunmap(tbl, sizeof(*tbl)); 142 142 } 143 + 144 + efi_esrt_init(); 143 145 }
-5
arch/loongarch/kernel/elf.c
··· 23 23 { 24 24 return 0; 25 25 } 26 - 27 - void loongarch_set_personality_fcsr(struct arch_elf_state *state) 28 - { 29 - current->thread.fpu.fcsr = boot_cpu_data.fpu_csr0; 30 - }
+33 -1
arch/loongarch/kernel/env.c
··· 5 5 * Copyright (C) 2020-2022 Loongson Technology Corporation Limited 6 6 */ 7 7 #include <linux/acpi.h> 8 + #include <linux/clk.h> 8 9 #include <linux/efi.h> 9 10 #include <linux/export.h> 10 11 #include <linux/memblock.h> 12 + #include <linux/of_clk.h> 11 13 #include <asm/early_ioremap.h> 12 14 #include <asm/bootinfo.h> 13 15 #include <asm/loongson.h> 14 16 #include <asm/setup.h> 17 + #include <asm/time.h> 15 18 16 19 u64 efi_system_table; 17 20 struct loongson_system_configuration loongson_sysconf; ··· 39 36 40 37 static int __init init_cpu_fullname(void) 41 38 { 42 - int cpu; 39 + struct device_node *root; 40 + int cpu, ret; 41 + char *model; 42 + 43 + /* Parsing cpuname from DTS model property */ 44 + root = of_find_node_by_path("/"); 45 + ret = of_property_read_string(root, "model", (const char **)&model); 46 + of_node_put(root); 47 + if (ret == 0) 48 + loongson_sysconf.cpuname = strsep(&model, " "); 43 49 44 50 if (loongson_sysconf.cpuname && !strncmp(loongson_sysconf.cpuname, "Loongson", 8)) { 45 51 for (cpu = 0; cpu < NR_CPUS; cpu++) ··· 57 45 return 0; 58 46 } 59 47 arch_initcall(init_cpu_fullname); 48 + 49 + static int __init fdt_cpu_clk_init(void) 50 + { 51 + struct clk *clk; 52 + struct device_node *np; 53 + 54 + np = of_get_cpu_node(0, NULL); 55 + if (!np) 56 + return -ENODEV; 57 + 58 + clk = of_clk_get(np, 0); 59 + if (IS_ERR(clk)) 60 + return -ENODEV; 61 + 62 + cpu_clock_freq = clk_get_rate(clk); 63 + clk_put(clk); 64 + 65 + return 0; 66 + } 67 + late_initcall(fdt_cpu_clk_init); 60 68 61 69 static ssize_t boardinfo_show(struct kobject *kobj, 62 70 struct kobj_attribute *attr, char *buf)
+10
arch/loongarch/kernel/head.S
··· 74 74 la.pcrel t0, fw_arg2 75 75 st.d a2, t0, 0 76 76 77 + #ifdef CONFIG_PAGE_SIZE_4KB 78 + li.d t0, 0 79 + li.d t1, CSR_STFILL 80 + csrxchg t0, t1, LOONGARCH_CSR_IMPCTL1 81 + #endif 77 82 /* KSave3 used for percpu base, initialized as 0 */ 78 83 csrwr zero, PERCPU_BASE_KS 79 84 /* GPR21 used for percpu base (runtime), initialized as 0 */ ··· 131 126 132 127 JUMP_VIRT_ADDR t0, t1 133 128 129 + #ifdef CONFIG_PAGE_SIZE_4KB 130 + li.d t0, 0 131 + li.d t1, CSR_STFILL 132 + csrxchg t0, t1, LOONGARCH_CSR_IMPCTL1 133 + #endif 134 134 /* Enable PG */ 135 135 li.w t0, 0xb0 # PLV=0, IE=0, PG=1 136 136 csrwr t0, LOONGARCH_CSR_CRMD
+1
arch/loongarch/kernel/process.c
··· 85 85 regs->csr_euen = euen; 86 86 lose_fpu(0); 87 87 lose_lbt(0); 88 + current->thread.fpu.fcsr = boot_cpu_data.fpu_csr0; 88 89 89 90 clear_thread_flag(TIF_LSX_CTX_LIVE); 90 91 clear_thread_flag(TIF_LASX_CTX_LIVE);
+19 -37
arch/loongarch/kernel/setup.c
··· 252 252 #endif 253 253 } 254 254 255 - /* 2MB alignment for crash kernel regions */ 256 - #define CRASH_ALIGN SZ_2M 257 - #define CRASH_ADDR_MAX SZ_4G 258 - 259 - static void __init arch_parse_crashkernel(void) 255 + static void __init arch_reserve_crashkernel(void) 260 256 { 261 - #ifdef CONFIG_KEXEC 262 257 int ret; 263 - unsigned long long total_mem; 258 + unsigned long long low_size = 0; 264 259 unsigned long long crash_base, crash_size; 260 + char *cmdline = boot_command_line; 261 + bool high = false; 265 262 266 - total_mem = memblock_phys_mem_size(); 267 - ret = parse_crashkernel(boot_command_line, total_mem, 268 - &crash_size, &crash_base, 269 - NULL, NULL); 270 - if (ret < 0 || crash_size <= 0) 263 + if (!IS_ENABLED(CONFIG_KEXEC_CORE)) 271 264 return; 272 265 273 - if (crash_base <= 0) { 274 - crash_base = memblock_phys_alloc_range(crash_size, CRASH_ALIGN, CRASH_ALIGN, CRASH_ADDR_MAX); 275 - if (!crash_base) { 276 - pr_warn("crashkernel reservation failed - No suitable area found.\n"); 277 - return; 278 - } 279 - } else if (!memblock_phys_alloc_range(crash_size, CRASH_ALIGN, crash_base, crash_base + crash_size)) { 280 - pr_warn("Invalid memory region reserved for crash kernel\n"); 266 + ret = parse_crashkernel(cmdline, memblock_phys_mem_size(), 267 + &crash_size, &crash_base, &low_size, &high); 268 + if (ret) 281 269 return; 282 - } 283 270 284 - crashk_res.start = crash_base; 285 - crashk_res.end = crash_base + crash_size - 1; 286 - #endif 271 + reserve_crashkernel_generic(cmdline, crash_size, crash_base, low_size, high); 287 272 } 288 273 289 274 static void __init fdt_setup(void) ··· 280 295 if (acpi_os_get_root_pointer()) 281 296 return; 282 297 283 - /* Look for a device tree configuration table entry */ 284 - fdt_pointer = efi_fdt_pointer(); 298 + /* Prefer to use built-in dtb, checking its legality first. */ 299 + if (!fdt_check_header(__dtb_start)) 300 + fdt_pointer = __dtb_start; 301 + else 302 + fdt_pointer = efi_fdt_pointer(); /* Fallback to firmware dtb */ 303 + 285 304 if (!fdt_pointer || fdt_check_header(fdt_pointer)) 286 305 return; 287 306 ··· 319 330 if (boot_command_line[0]) 320 331 strlcat(boot_command_line, " ", COMMAND_LINE_SIZE); 321 332 322 - strlcat(boot_command_line, init_command_line, COMMAND_LINE_SIZE); 333 + if (!strstr(boot_command_line, init_command_line)) 334 + strlcat(boot_command_line, init_command_line, COMMAND_LINE_SIZE); 335 + 323 336 goto out; 324 337 } 325 338 #endif ··· 348 357 void __init platform_init(void) 349 358 { 350 359 arch_reserve_vmcore(); 351 - arch_parse_crashkernel(); 360 + arch_reserve_crashkernel(); 352 361 353 362 #ifdef CONFIG_ACPI_TABLE_UPGRADE 354 363 acpi_table_upgrade(); ··· 458 467 request_resource(res, &data_resource); 459 468 request_resource(res, &bss_resource); 460 469 } 461 - 462 - #ifdef CONFIG_KEXEC 463 - if (crashk_res.start < crashk_res.end) { 464 - insert_resource(&iomem_resource, &crashk_res); 465 - pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n", 466 - (unsigned long)((crashk_res.end - crashk_res.start + 1) >> 20), 467 - (unsigned long)(crashk_res.start >> 20)); 468 - } 469 - #endif 470 470 } 471 471 472 472 static int __init add_legacy_isa_io(struct fwnode_handle *fwnode,
+4 -1
arch/loongarch/kernel/smp.c
··· 208 208 } 209 209 210 210 loongson_sysconf.nr_cpus = num_processors; 211 - set_bit(0, &(loongson_sysconf.cores_io_master)); 211 + set_bit(0, loongson_sysconf.cores_io_master); 212 212 #endif 213 213 } 214 214 215 215 void __init loongson_smp_setup(void) 216 216 { 217 217 fdt_smp_setup(); 218 + 219 + if (loongson_sysconf.cores_per_package == 0) 220 + loongson_sysconf.cores_per_package = num_processors; 218 221 219 222 cpu_data[0].core = cpu_logical_map(0) % loongson_sysconf.cores_per_package; 220 223 cpu_data[0].package = cpu_logical_map(0) / loongson_sysconf.cores_per_package;
+9 -1
arch/loongarch/net/bpf_jit.c
··· 201 201 return true; 202 202 } 203 203 204 + bool bpf_jit_supports_far_kfunc_call(void) 205 + { 206 + return true; 207 + } 208 + 204 209 /* initialized on the first pass of build_body() */ 205 210 static int out_offset = -1; 206 211 static int emit_bpf_tail_call(struct jit_ctx *ctx) ··· 470 465 const u8 dst = regmap[insn->dst_reg]; 471 466 const s16 off = insn->off; 472 467 const s32 imm = insn->imm; 473 - const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm; 474 468 const bool is32 = BPF_CLASS(insn->code) == BPF_ALU || BPF_CLASS(insn->code) == BPF_JMP32; 475 469 476 470 switch (code) { ··· 927 923 928 924 /* dst = imm64 */ 929 925 case BPF_LD | BPF_IMM | BPF_DW: 926 + { 927 + const u64 imm64 = (u64)(insn + 1)->imm << 32 | (u32)insn->imm; 928 + 930 929 move_imm(ctx, dst, imm64, is32); 931 930 return 1; 931 + } 932 932 933 933 /* dst = *(size *)(src + off) */ 934 934 case BPF_LDX | BPF_MEM | BPF_B:
+7
scripts/generate_rust_target.rs
··· 161 161 ts.push("features", features); 162 162 ts.push("llvm-target", "x86_64-linux-gnu"); 163 163 ts.push("target-pointer-width", "64"); 164 + } else if cfg.has("LOONGARCH") { 165 + ts.push("arch", "loongarch64"); 166 + ts.push("data-layout", "e-m:e-p:64:64-i64:64-i128:128-n64-S128"); 167 + ts.push("features", "-f,-d"); 168 + ts.push("llvm-target", "loongarch64-linux-gnusf"); 169 + ts.push("llvm-abiname", "lp64s"); 170 + ts.push("target-pointer-width", "64"); 164 171 } else { 165 172 panic!("Unsupported architecture"); 166 173 }
+2
scripts/min-tool-version.sh
··· 26 26 llvm) 27 27 if [ "$SRCARCH" = s390 ]; then 28 28 echo 15.0.0 29 + elif [ "$SRCARCH" = loongarch ]; then 30 + echo 18.0.0 29 31 else 30 32 echo 11.0.0 31 33 fi
+17 -2
scripts/mod/modpost.c
··· 1345 1345 #define R_LARCH_SUB32 55 1346 1346 #endif 1347 1347 1348 + #ifndef R_LARCH_RELAX 1349 + #define R_LARCH_RELAX 100 1350 + #endif 1351 + 1352 + #ifndef R_LARCH_ALIGN 1353 + #define R_LARCH_ALIGN 102 1354 + #endif 1355 + 1348 1356 static void get_rel_type_and_sym(struct elf_info *elf, uint64_t r_info, 1349 1357 unsigned int *r_type, unsigned int *r_sym) 1350 1358 { ··· 1407 1399 continue; 1408 1400 break; 1409 1401 case EM_LOONGARCH: 1410 - if (!strcmp("__ex_table", fromsec) && 1411 - r_type == R_LARCH_SUB32) 1402 + switch (r_type) { 1403 + case R_LARCH_SUB32: 1404 + if (!strcmp("__ex_table", fromsec)) 1405 + continue; 1406 + break; 1407 + case R_LARCH_RELAX: 1408 + case R_LARCH_ALIGN: 1409 + /* These relocs do not refer to symbols */ 1412 1410 continue; 1411 + } 1413 1412 break; 1414 1413 } 1415 1414