Skip to content

Commit b719158

Browse files
committed
Merge tag 'loongarch-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch updates from Huacai Chen: - Adjust the 'make install' operation - Support SCHED_MC (Multi-core scheduler) - Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS - Enable HAVE_ARCH_STACKLEAK - Increase max supported CPUs up to 2048 - Introduce the numa_memblks conversion - Add PWM controller nodes in dts - Some bug fixes and other small changes * tag 'loongarch-6.16' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: platform/loongarch: laptop: Unregister generic_sub_drivers on exit platform/loongarch: laptop: Add backlight power control support platform/loongarch: laptop: Get brightness setting from EC on probe LoongArch: dts: Add PWM support to Loongson-2K2000 LoongArch: dts: Add PWM support to Loongson-2K1000 LoongArch: dts: Add PWM support to Loongson-2K0500 LoongArch: vDSO: Correctly use asm parameters in syscall wrappers LoongArch: Fix panic caused by NULL-PMD in huge_pte_offset() LoongArch: Preserve firmware configuration when desired LoongArch: Avoid using $r0/$r1 as "mask" for csrxchg LoongArch: Introduce the numa_memblks conversion LoongArch: Increase max supported CPUs up to 2048 LoongArch: Enable HAVE_ARCH_STACKLEAK LoongArch: Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS LoongArch: Add SCHED_MC (Multi-core scheduler) support LoongArch: Add some annotations in archhelp LoongArch: Using generic scripts/install.sh in `make install` LoongArch: Add a default install.sh
2 parents af477f4 + f78fb25 commit b719158

File tree

32 files changed

+561
-218
lines changed

32 files changed

+561
-218
lines changed

Documentation/features/core/mseal_sys_mappings/arch-support.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
| arm64: | ok |
1313
| csky: | N/A |
1414
| hexagon: | N/A |
15-
| loongarch: | TODO |
15+
| loongarch: | ok |
1616
| m68k: | N/A |
1717
| microblaze: | N/A |
1818
| mips: | TODO |

Documentation/userspace-api/mseal.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ Use cases
144144
architecture.
145145

146146
The following architectures currently support this feature: x86-64, arm64,
147-
and s390.
147+
loongarch and s390.
148148

149149
WARNING: This feature breaks programs which rely on relocating
150150
or unmapping system mappings. Known broken software at the time

arch/loongarch/Kconfig

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ config LOONGARCH
6969
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
7070
select ARCH_SUPPORTS_LTO_CLANG
7171
select ARCH_SUPPORTS_LTO_CLANG_THIN
72+
select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
7273
select ARCH_SUPPORTS_NUMA_BALANCING
7374
select ARCH_SUPPORTS_RT
7475
select ARCH_USE_BUILTIN_BSWAP
@@ -123,6 +124,7 @@ config LOONGARCH
123124
select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
124125
select HAVE_ARCH_SECCOMP
125126
select HAVE_ARCH_SECCOMP_FILTER
127+
select HAVE_ARCH_STACKLEAK
126128
select HAVE_ARCH_TRACEHOOK
127129
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
128130
select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
@@ -187,6 +189,7 @@ config LOONGARCH
187189
select MODULES_USE_ELF_RELA if MODULES
188190
select NEED_PER_CPU_EMBED_FIRST_CHUNK
189191
select NEED_PER_CPU_PAGE_FIRST_CHUNK
192+
select NUMA_MEMBLKS if NUMA
190193
select OF
191194
select OF_EARLY_FLATTREE
192195
select PCI
@@ -456,6 +459,15 @@ config SCHED_SMT
456459
Improves scheduler's performance when there are multiple
457460
threads in one physical core.
458461

462+
config SCHED_MC
463+
bool "Multi-core scheduler support"
464+
depends on SMP
465+
default y
466+
help
467+
Multi-core scheduler support improves the CPU scheduler's decision
468+
making when dealing with multi-core CPU chips at a cost of slightly
469+
increased overhead in some places.
470+
459471
config SMP
460472
bool "Multi-Processing support"
461473
help
@@ -485,10 +497,10 @@ config HOTPLUG_CPU
485497
Say N if you want to disable CPU hotplug.
486498

487499
config NR_CPUS
488-
int "Maximum number of CPUs (2-256)"
489-
range 2 256
500+
int "Maximum number of CPUs (2-2048)"
501+
range 2 2048
502+
default "2048"
490503
depends on SMP
491-
default "64"
492504
help
493505
This allows you to specify the maximum number of CPUs which this
494506
kernel will support.

arch/loongarch/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,14 @@ vmlinux.elf vmlinux.efi vmlinuz.efi: vmlinux
181181
$(Q)$(MAKE) $(build)=$(boot) $(bootvars-y) $(boot)/$@
182182

183183
install:
184-
$(Q)install -D -m 755 $(KBUILD_IMAGE) $(INSTALL_PATH)/$(image-name-y)-$(KERNELRELEASE)
185-
$(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
186-
$(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
184+
$(call cmd,install)
187185

188186
define archhelp
189-
echo ' install - install kernel into $(INSTALL_PATH)'
187+
echo ' vmlinux.elf - Uncompressed ELF kernel image (arch/loongarch/boot/vmlinux.elf)'
188+
echo ' vmlinux.efi - Uncompressed EFI kernel image (arch/loongarch/boot/vmlinux.efi)'
189+
echo ' vmlinuz.efi - GZIP/ZSTD-compressed EFI kernel image (arch/loongarch/boot/vmlinuz.efi)'
190+
echo ' Default when CONFIG_EFI_ZBOOT=y'
191+
echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
192+
echo ' (distribution) /sbin/$(INSTALLKERNEL) or install.sh to $$(INSTALL_PATH)'
190193
echo
191194
endef

arch/loongarch/boot/dts/loongson-2k0500.dtsi

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,166 @@
169169
interrupts = <3>;
170170
};
171171

172+
pwm@1ff5c000 {
173+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
174+
reg = <0x0 0x1ff5c000 0x0 0x10>;
175+
interrupt-parent = <&liointc0>;
176+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
177+
clocks = <&clk LOONGSON2_APB_CLK>;
178+
#pwm-cells = <3>;
179+
status = "disabled";
180+
};
181+
182+
pwm@1ff5c010 {
183+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
184+
reg = <0x0 0x1ff5c010 0x0 0x10>;
185+
interrupt-parent = <&liointc0>;
186+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
187+
clocks = <&clk LOONGSON2_APB_CLK>;
188+
#pwm-cells = <3>;
189+
status = "disabled";
190+
};
191+
192+
pwm@1ff5c020 {
193+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
194+
reg = <0x0 0x1ff5c020 0x0 0x10>;
195+
interrupt-parent = <&liointc0>;
196+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
197+
clocks = <&clk LOONGSON2_APB_CLK>;
198+
#pwm-cells = <3>;
199+
status = "disabled";
200+
};
201+
202+
pwm@1ff5c030 {
203+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
204+
reg = <0x0 0x1ff5c030 0x0 0x10>;
205+
interrupt-parent = <&liointc0>;
206+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
207+
clocks = <&clk LOONGSON2_APB_CLK>;
208+
#pwm-cells = <3>;
209+
status = "disabled";
210+
};
211+
212+
pwm@1ff5c040 {
213+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
214+
reg = <0x0 0x1ff5c040 0x0 0x10>;
215+
interrupt-parent = <&liointc0>;
216+
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
217+
clocks = <&clk LOONGSON2_APB_CLK>;
218+
#pwm-cells = <3>;
219+
status = "disabled";
220+
};
221+
222+
pwm@1ff5c050 {
223+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
224+
reg = <0x0 0x1ff5c050 0x0 0x10>;
225+
interrupt-parent = <&liointc0>;
226+
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
227+
clocks = <&clk LOONGSON2_APB_CLK>;
228+
#pwm-cells = <3>;
229+
status = "disabled";
230+
};
231+
232+
pwm@1ff5c060 {
233+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
234+
reg = <0x0 0x1ff5c060 0x0 0x10>;
235+
interrupt-parent = <&liointc0>;
236+
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
237+
clocks = <&clk LOONGSON2_APB_CLK>;
238+
#pwm-cells = <3>;
239+
status = "disabled";
240+
};
241+
242+
pwm@1ff5c070 {
243+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
244+
reg = <0x0 0x1ff5c070 0x0 0x10>;
245+
interrupt-parent = <&liointc0>;
246+
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
247+
clocks = <&clk LOONGSON2_APB_CLK>;
248+
#pwm-cells = <3>;
249+
status = "disabled";
250+
};
251+
252+
pwm@1ff5c080 {
253+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
254+
reg = <0x0 0x1ff5c080 0x0 0x10>;
255+
interrupt-parent = <&liointc0>;
256+
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
257+
clocks = <&clk LOONGSON2_APB_CLK>;
258+
#pwm-cells = <3>;
259+
status = "disabled";
260+
};
261+
262+
pwm@1ff5c090 {
263+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
264+
reg = <0x0 0x1ff5c090 0x0 0x10>;
265+
interrupt-parent = <&liointc0>;
266+
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
267+
clocks = <&clk LOONGSON2_APB_CLK>;
268+
#pwm-cells = <3>;
269+
status = "disabled";
270+
};
271+
272+
pwm@1ff5c0a0 {
273+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
274+
reg = <0x0 0x1ff5c0a0 0x0 0x10>;
275+
interrupt-parent = <&liointc0>;
276+
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
277+
clocks = <&clk LOONGSON2_APB_CLK>;
278+
#pwm-cells = <3>;
279+
status = "disabled";
280+
};
281+
282+
pwm@1ff5c0b0 {
283+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
284+
reg = <0x0 0x1ff5c0b0 0x0 0x10>;
285+
interrupt-parent = <&liointc0>;
286+
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
287+
clocks = <&clk LOONGSON2_APB_CLK>;
288+
#pwm-cells = <3>;
289+
status = "disabled";
290+
};
291+
292+
pwm@1ff5c0c0 {
293+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
294+
reg = <0x0 0x1ff5c0c0 0x0 0x10>;
295+
interrupt-parent = <&liointc0>;
296+
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
297+
clocks = <&clk LOONGSON2_APB_CLK>;
298+
#pwm-cells = <3>;
299+
status = "disabled";
300+
};
301+
302+
pwm@1ff5c0d0 {
303+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
304+
reg = <0x0 0x1ff5c0d0 0x0 0x10>;
305+
interrupt-parent = <&liointc0>;
306+
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
307+
clocks = <&clk LOONGSON2_APB_CLK>;
308+
#pwm-cells = <3>;
309+
status = "disabled";
310+
};
311+
312+
pwm@1ff5c0e0 {
313+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
314+
reg = <0x0 0x1ff5c0e0 0x0 0x10>;
315+
interrupt-parent = <&liointc0>;
316+
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
317+
clocks = <&clk LOONGSON2_APB_CLK>;
318+
#pwm-cells = <3>;
319+
status = "disabled";
320+
};
321+
322+
pwm@1ff5c0f0 {
323+
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
324+
reg = <0x0 0x1ff5c0f0 0x0 0x10>;
325+
interrupt-parent = <&liointc0>;
326+
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
327+
clocks = <&clk LOONGSON2_APB_CLK>;
328+
#pwm-cells = <3>;
329+
status = "disabled";
330+
};
331+
172332
gmac0: ethernet@1f020000 {
173333
compatible = "snps,dwmac-3.70a";
174334
reg = <0x0 0x1f020000 0x0 0x10000>;

arch/loongarch/boot/dts/loongson-2k1000-ref.dts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
/dts-v1/;
77

8+
#include "dt-bindings/thermal/thermal.h"
89
#include "loongson-2k1000.dtsi"
910

1011
/ {
@@ -38,6 +39,13 @@
3839
linux,cma-default;
3940
};
4041
};
42+
43+
fan0: pwm-fan {
44+
compatible = "pwm-fan";
45+
cooling-levels = <255 153 85 25>;
46+
pwms = <&pwm1 0 100000 0>;
47+
#cooling-cells = <2>;
48+
};
4149
};
4250

4351
&gmac0 {
@@ -92,6 +100,22 @@
92100
#size-cells = <0>;
93101
};
94102

103+
&pwm1 {
104+
status = "okay";
105+
106+
pinctrl-0 = <&pwm1_pins_default>;
107+
pinctrl-names = "default";
108+
};
109+
110+
&cpu_thermal {
111+
cooling-maps {
112+
map0 {
113+
trip = <&cpu_alert>;
114+
cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
115+
};
116+
};
117+
};
118+
95119
&ehci0 {
96120
status = "okay";
97121
};

arch/loongarch/boot/dts/loongson-2k1000.dtsi

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
};
6969

7070
thermal-zones {
71-
cpu-thermal {
71+
cpu_thermal: cpu-thermal {
7272
polling-delay-passive = <1000>;
7373
polling-delay = <5000>;
7474
thermal-sensors = <&tsensor 0>;
@@ -322,6 +322,46 @@
322322
status = "disabled";
323323
};
324324

325+
pwm@1fe22000 {
326+
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
327+
reg = <0x0 0x1fe22000 0x0 0x10>;
328+
interrupt-parent = <&liointc0>;
329+
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
330+
clocks = <&clk LOONGSON2_APB_CLK>;
331+
#pwm-cells = <3>;
332+
status = "disabled";
333+
};
334+
335+
pwm1: pwm@1fe22010 {
336+
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
337+
reg = <0x0 0x1fe22010 0x0 0x10>;
338+
interrupt-parent = <&liointc0>;
339+
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
340+
clocks = <&clk LOONGSON2_APB_CLK>;
341+
#pwm-cells = <3>;
342+
status = "disabled";
343+
};
344+
345+
pwm@1fe22020 {
346+
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
347+
reg = <0x0 0x1fe22020 0x0 0x10>;
348+
interrupt-parent = <&liointc0>;
349+
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
350+
clocks = <&clk LOONGSON2_APB_CLK>;
351+
#pwm-cells = <3>;
352+
status = "disabled";
353+
};
354+
355+
pwm@1fe22030 {
356+
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
357+
reg = <0x0 0x1fe22030 0x0 0x10>;
358+
interrupt-parent = <&liointc0>;
359+
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
360+
clocks = <&clk LOONGSON2_APB_CLK>;
361+
#pwm-cells = <3>;
362+
status = "disabled";
363+
};
364+
325365
pmc: power-management@1fe27000 {
326366
compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon";
327367
reg = <0x0 0x1fe27000 0x0 0x58>;

0 commit comments

Comments
 (0)