mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2025-10-22 15:03:53 +02:00
LoongArch changes for v6.16
1, Adjust the 'make install' operation; 2, Support SCHED_MC (Multi-core scheduler); 3, Enable ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS; 4, Enable HAVE_ARCH_STACKLEAK; 5, Increase max supported CPUs up to 2048; 6, Introduce the numa_memblks conversion; 7, Add PWM controller nodes in dts; 8, Some bug fixes and other small changes. -----BEGIN PGP SIGNATURE----- iQJKBAABCAA0FiEEzOlt8mkP+tbeiYy5AoYrw/LiJnoFAmhEEh8WHGNoZW5odWFj YWlAa2VybmVsLm9yZwAKCRAChivD8uImenIIEACT43zpQD6lApWZ8tk8dVYXK6Lb pKqXLIhAe9g9cSDC6QfwUTwOjv5RZxJBXgKkQfYSSd3ZEZ6hQIqb2JVYMMpNy6WA I5fJ75pr/E6RMtueg5laYxJ/zLJMM5F2qK/Moff7JGeUuDU5BJEG0R7j7KEhtgo0 5Cm+ktS7waJhNuJposa/Eay6IDWH9Of2UoNboPWmMfLvuZbIp9f1HpjwpZF6xnZ/ xeIhVOcJw8Xft/0xrcx1xZt/nYnJflNwLgaa7/CGa2q1X7yxVarfMUcY63x6cZXX 7jLppejqptPqixf+JFRGKBr8Y82Vu/1TW7XlKaywKrjHPZ/FXJsU682x6SQy2uac nOiu38qCc5DA9pKB57zxL/5DqTn+yAPGpnC//HvF9/koWCOI6lA5bYzSbBwmkpm7 DS7mVKtfPTicUs5fZ7DsHRjXuyqs6i1+s7wNaTkgG4Y/gBNAffHa36ON5jM5Wzzz WJGcMEIG0Or6tt/yUVrzY390aYzIOkyAoWJgUQ+tPCXecyjnor9i5P3ZC66dIm2r UTbC7mX4+bBa/MA1xKKMmCHdJtMzO2A+tduZRf/lO8iYs4c6IJBBaXhW9xHxf8tT Av/sXnShJWsrRW40g6Kp85ghDcLBS6SLBm5Ux5OLd2byWIeeF/R2BHdF6qb4V3j6 Y2ZHk1ewvLgB0BQ/ww== =FH8x -----END PGP SIGNATURE----- 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
This commit is contained in:
commit
b7191581a9
|
@ -12,7 +12,7 @@
|
|||
| arm64: | ok |
|
||||
| csky: | N/A |
|
||||
| hexagon: | N/A |
|
||||
| loongarch: | TODO |
|
||||
| loongarch: | ok |
|
||||
| m68k: | N/A |
|
||||
| microblaze: | N/A |
|
||||
| mips: | TODO |
|
||||
|
|
|
@ -144,7 +144,7 @@ Use cases
|
|||
architecture.
|
||||
|
||||
The following architectures currently support this feature: x86-64, arm64,
|
||||
and s390.
|
||||
loongarch and s390.
|
||||
|
||||
WARNING: This feature breaks programs which rely on relocating
|
||||
or unmapping system mappings. Known broken software at the time
|
||||
|
|
|
@ -69,6 +69,7 @@ config LOONGARCH
|
|||
select ARCH_SUPPORTS_INT128 if CC_HAS_INT128
|
||||
select ARCH_SUPPORTS_LTO_CLANG
|
||||
select ARCH_SUPPORTS_LTO_CLANG_THIN
|
||||
select ARCH_SUPPORTS_MSEAL_SYSTEM_MAPPINGS
|
||||
select ARCH_SUPPORTS_NUMA_BALANCING
|
||||
select ARCH_SUPPORTS_RT
|
||||
select ARCH_USE_BUILTIN_BSWAP
|
||||
|
@ -123,6 +124,7 @@ config LOONGARCH
|
|||
select HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
|
||||
select HAVE_ARCH_SECCOMP
|
||||
select HAVE_ARCH_SECCOMP_FILTER
|
||||
select HAVE_ARCH_STACKLEAK
|
||||
select HAVE_ARCH_TRACEHOOK
|
||||
select HAVE_ARCH_TRANSPARENT_HUGEPAGE
|
||||
select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
|
||||
|
@ -187,6 +189,7 @@ config LOONGARCH
|
|||
select MODULES_USE_ELF_RELA if MODULES
|
||||
select NEED_PER_CPU_EMBED_FIRST_CHUNK
|
||||
select NEED_PER_CPU_PAGE_FIRST_CHUNK
|
||||
select NUMA_MEMBLKS if NUMA
|
||||
select OF
|
||||
select OF_EARLY_FLATTREE
|
||||
select PCI
|
||||
|
@ -456,6 +459,15 @@ config SCHED_SMT
|
|||
Improves scheduler's performance when there are multiple
|
||||
threads in one physical core.
|
||||
|
||||
config SCHED_MC
|
||||
bool "Multi-core scheduler support"
|
||||
depends on SMP
|
||||
default y
|
||||
help
|
||||
Multi-core scheduler support improves the CPU scheduler's decision
|
||||
making when dealing with multi-core CPU chips at a cost of slightly
|
||||
increased overhead in some places.
|
||||
|
||||
config SMP
|
||||
bool "Multi-Processing support"
|
||||
help
|
||||
|
@ -485,10 +497,10 @@ config HOTPLUG_CPU
|
|||
Say N if you want to disable CPU hotplug.
|
||||
|
||||
config NR_CPUS
|
||||
int "Maximum number of CPUs (2-256)"
|
||||
range 2 256
|
||||
int "Maximum number of CPUs (2-2048)"
|
||||
range 2 2048
|
||||
default "2048"
|
||||
depends on SMP
|
||||
default "64"
|
||||
help
|
||||
This allows you to specify the maximum number of CPUs which this
|
||||
kernel will support.
|
||||
|
|
|
@ -181,11 +181,14 @@ vmlinux.elf vmlinux.efi vmlinuz.efi: vmlinux
|
|||
$(Q)$(MAKE) $(build)=$(boot) $(bootvars-y) $(boot)/$@
|
||||
|
||||
install:
|
||||
$(Q)install -D -m 755 $(KBUILD_IMAGE) $(INSTALL_PATH)/$(image-name-y)-$(KERNELRELEASE)
|
||||
$(Q)install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
|
||||
$(Q)install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
|
||||
$(call cmd,install)
|
||||
|
||||
define archhelp
|
||||
echo ' install - install kernel into $(INSTALL_PATH)'
|
||||
echo ' vmlinux.elf - Uncompressed ELF kernel image (arch/loongarch/boot/vmlinux.elf)'
|
||||
echo ' vmlinux.efi - Uncompressed EFI kernel image (arch/loongarch/boot/vmlinux.efi)'
|
||||
echo ' vmlinuz.efi - GZIP/ZSTD-compressed EFI kernel image (arch/loongarch/boot/vmlinuz.efi)'
|
||||
echo ' Default when CONFIG_EFI_ZBOOT=y'
|
||||
echo ' install - Install kernel using (your) ~/bin/$(INSTALLKERNEL) or'
|
||||
echo ' (distribution) /sbin/$(INSTALLKERNEL) or install.sh to $$(INSTALL_PATH)'
|
||||
echo
|
||||
endef
|
||||
|
|
|
@ -169,6 +169,166 @@
|
|||
interrupts = <3>;
|
||||
};
|
||||
|
||||
pwm@1ff5c000 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c000 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c010 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c010 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c020 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c020 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c030 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c030 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c040 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c040 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c050 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c050 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c060 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c060 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c070 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c070 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c080 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c080 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c090 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c090 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0a0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0a0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0b0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0b0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0c0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0c0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0d0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0d0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0e0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0e0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1ff5c0f0 {
|
||||
compatible = "loongson,ls2k0500-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1ff5c0f0 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
gmac0: ethernet@1f020000 {
|
||||
compatible = "snps,dwmac-3.70a";
|
||||
reg = <0x0 0x1f020000 0x0 0x10000>;
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
/dts-v1/;
|
||||
|
||||
#include "dt-bindings/thermal/thermal.h"
|
||||
#include "loongson-2k1000.dtsi"
|
||||
|
||||
/ {
|
||||
|
@ -38,6 +39,13 @@
|
|||
linux,cma-default;
|
||||
};
|
||||
};
|
||||
|
||||
fan0: pwm-fan {
|
||||
compatible = "pwm-fan";
|
||||
cooling-levels = <255 153 85 25>;
|
||||
pwms = <&pwm1 0 100000 0>;
|
||||
#cooling-cells = <2>;
|
||||
};
|
||||
};
|
||||
|
||||
&gmac0 {
|
||||
|
@ -92,6 +100,22 @@
|
|||
#size-cells = <0>;
|
||||
};
|
||||
|
||||
&pwm1 {
|
||||
status = "okay";
|
||||
|
||||
pinctrl-0 = <&pwm1_pins_default>;
|
||||
pinctrl-names = "default";
|
||||
};
|
||||
|
||||
&cpu_thermal {
|
||||
cooling-maps {
|
||||
map0 {
|
||||
trip = <&cpu_alert>;
|
||||
cooling-device = <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&ehci0 {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
};
|
||||
|
||||
thermal-zones {
|
||||
cpu-thermal {
|
||||
cpu_thermal: cpu-thermal {
|
||||
polling-delay-passive = <1000>;
|
||||
polling-delay = <5000>;
|
||||
thermal-sensors = <&tsensor 0>;
|
||||
|
@ -322,6 +322,46 @@
|
|||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1fe22000 {
|
||||
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1fe22000 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm1: pwm@1fe22010 {
|
||||
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1fe22010 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1fe22020 {
|
||||
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1fe22020 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@1fe22030 {
|
||||
compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x1fe22030 0x0 0x10>;
|
||||
interrupt-parent = <&liointc0>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_APB_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pmc: power-management@1fe27000 {
|
||||
compatible = "loongson,ls2k1000-pmc", "loongson,ls2k0500-pmc", "syscon";
|
||||
reg = <0x0 0x1fe27000 0x0 0x58>;
|
||||
|
|
|
@ -165,6 +165,66 @@
|
|||
interrupt-parent = <&eiointc>;
|
||||
};
|
||||
|
||||
pwm@100a0000 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0000 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@100a0100 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0100 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <25 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@100a0200 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0200 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <26 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@100a0300 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0300 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <27 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@100a0400 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0400 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
pwm@100a0500 {
|
||||
compatible = "loongson,ls2k2000-pwm", "loongson,ls7a-pwm";
|
||||
reg = <0x0 0x100a0500 0x0 0x10>;
|
||||
interrupt-parent = <&pic>;
|
||||
interrupts = <39 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&clk LOONGSON2_MISC_CLK>;
|
||||
#pwm-cells = <3>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
rtc0: rtc@100d0100 {
|
||||
compatible = "loongson,ls2k2000-rtc", "loongson,ls7a-rtc";
|
||||
reg = <0x0 0x100d0100 0x0 0x100>;
|
||||
|
|
56
arch/loongarch/boot/install.sh
Executable file
56
arch/loongarch/boot/install.sh
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# This file is subject to the terms and conditions of the GNU General Public
|
||||
# License. See the file "COPYING" in the main directory of this archive
|
||||
# for more details.
|
||||
#
|
||||
# Copyright (C) 1995 by Linus Torvalds
|
||||
#
|
||||
# Adapted from code in arch/i386/boot/Makefile by H. Peter Anvin
|
||||
# Adapted from code in arch/i386/boot/install.sh by Russell King
|
||||
#
|
||||
# "make install" script for the LoongArch Linux port
|
||||
#
|
||||
# Arguments:
|
||||
# $1 - kernel version
|
||||
# $2 - kernel image file
|
||||
# $3 - kernel map file
|
||||
# $4 - default install path (blank if root directory)
|
||||
|
||||
set -e
|
||||
|
||||
case "${2##*/}" in
|
||||
vmlinux.elf)
|
||||
echo "Installing uncompressed vmlinux.elf kernel"
|
||||
base=vmlinux
|
||||
;;
|
||||
vmlinux.efi)
|
||||
echo "Installing uncompressed vmlinux.efi kernel"
|
||||
base=vmlinux
|
||||
;;
|
||||
vmlinuz.efi)
|
||||
echo "Installing gzip/zstd compressed vmlinuz.efi kernel"
|
||||
base=vmlinuz
|
||||
;;
|
||||
*)
|
||||
echo "Warning: Unexpected kernel type"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -f $4/$base-$1 ]; then
|
||||
mv $4/$base-$1 $4/$base-$1.old
|
||||
fi
|
||||
cat $2 > $4/$base-$1
|
||||
|
||||
# Install system map file
|
||||
if [ -f $4/System.map-$1 ]; then
|
||||
mv $4/System.map-$1 $4/System.map-$1.old
|
||||
fi
|
||||
cp $3 $4/System.map-$1
|
||||
|
||||
# Install kernel config file
|
||||
if [ -f $4/config-$1 ]; then
|
||||
mv $4/config-$1 $4/config-$1.old
|
||||
fi
|
||||
cp .config $4/config-$1
|
|
@ -33,7 +33,7 @@ static inline bool acpi_has_cpu_in_madt(void)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define MAX_CORE_PIC 256
|
||||
#define MAX_CORE_PIC 2048
|
||||
|
||||
extern struct list_head acpi_wakeup_device_list;
|
||||
extern struct acpi_madt_core_pic acpi_core_pic[MAX_CORE_PIC];
|
||||
|
|
|
@ -2,12 +2,6 @@
|
|||
#ifndef ARCH_LOONGARCH_ENTRY_COMMON_H
|
||||
#define ARCH_LOONGARCH_ENTRY_COMMON_H
|
||||
|
||||
#include <linux/sched.h>
|
||||
#include <linux/processor.h>
|
||||
|
||||
static inline bool on_thread_stack(void)
|
||||
{
|
||||
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
|
||||
}
|
||||
#include <asm/stacktrace.h> /* For on_thread_stack() */
|
||||
|
||||
#endif
|
||||
|
|
|
@ -14,40 +14,48 @@
|
|||
static inline void arch_local_irq_enable(void)
|
||||
{
|
||||
u32 flags = CSR_CRMD_IE;
|
||||
register u32 mask asm("t0") = CSR_CRMD_IE;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"csrxchg %[val], %[mask], %[reg]\n\t"
|
||||
: [val] "+r" (flags)
|
||||
: [mask] "r" (CSR_CRMD_IE), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: [mask] "r" (mask), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_disable(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
register u32 mask asm("t0") = CSR_CRMD_IE;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"csrxchg %[val], %[mask], %[reg]\n\t"
|
||||
: [val] "+r" (flags)
|
||||
: [mask] "r" (CSR_CRMD_IE), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: [mask] "r" (mask), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline unsigned long arch_local_irq_save(void)
|
||||
{
|
||||
u32 flags = 0;
|
||||
register u32 mask asm("t0") = CSR_CRMD_IE;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"csrxchg %[val], %[mask], %[reg]\n\t"
|
||||
: [val] "+r" (flags)
|
||||
: [mask] "r" (CSR_CRMD_IE), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: [mask] "r" (mask), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: "memory");
|
||||
return flags;
|
||||
}
|
||||
|
||||
static inline void arch_local_irq_restore(unsigned long flags)
|
||||
{
|
||||
register u32 mask asm("t0") = CSR_CRMD_IE;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"csrxchg %[val], %[mask], %[reg]\n\t"
|
||||
: [val] "+r" (flags)
|
||||
: [mask] "r" (CSR_CRMD_IE), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: [mask] "r" (mask), [reg] "i" (LOONGARCH_CSR_CRMD)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
|
|
|
@ -411,8 +411,8 @@
|
|||
|
||||
/* Config CSR registers */
|
||||
#define LOONGARCH_CSR_CPUID 0x20 /* CPU core id */
|
||||
#define CSR_CPUID_COREID_WIDTH 9
|
||||
#define CSR_CPUID_COREID _ULCAST_(0x1ff)
|
||||
#define CSR_CPUID_COREID_WIDTH 11
|
||||
#define CSR_CPUID_COREID _ULCAST_(0x7ff)
|
||||
|
||||
#define LOONGARCH_CSR_PRCFG1 0x21 /* Config1 */
|
||||
#define CSR_CONF1_VSMAX_SHIFT 12
|
||||
|
|
|
@ -22,20 +22,6 @@ extern int numa_off;
|
|||
extern s16 __cpuid_to_node[CONFIG_NR_CPUS];
|
||||
extern nodemask_t numa_nodes_parsed __initdata;
|
||||
|
||||
struct numa_memblk {
|
||||
u64 start;
|
||||
u64 end;
|
||||
int nid;
|
||||
};
|
||||
|
||||
#define NR_NODE_MEMBLKS (MAX_NUMNODES*2)
|
||||
struct numa_meminfo {
|
||||
int nr_blks;
|
||||
struct numa_memblk blk[NR_NODE_MEMBLKS];
|
||||
};
|
||||
|
||||
extern int __init numa_add_memblk(int nodeid, u64 start, u64 end);
|
||||
|
||||
extern void __init early_numa_add_cpu(int cpuid, s16 node);
|
||||
extern void numa_add_cpu(unsigned int cpu);
|
||||
extern void numa_remove_cpu(unsigned int cpu);
|
||||
|
|
|
@ -25,6 +25,7 @@ extern int smp_num_siblings;
|
|||
extern int num_processors;
|
||||
extern int disabled_cpus;
|
||||
extern cpumask_t cpu_sibling_map[];
|
||||
extern cpumask_t cpu_llc_shared_map[];
|
||||
extern cpumask_t cpu_core_map[];
|
||||
extern cpumask_t cpu_foreign_map[];
|
||||
|
||||
|
|
|
@ -21,11 +21,6 @@
|
|||
#define VMEMMAP_SIZE 0 /* 1, For FLATMEM; 2, For SPARSEMEM without VMEMMAP. */
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTPLUG
|
||||
int memory_add_physaddr_to_nid(u64 addr);
|
||||
#define memory_add_physaddr_to_nid memory_add_physaddr_to_nid
|
||||
#endif
|
||||
|
||||
#define INIT_MEMBLOCK_RESERVED_REGIONS (INIT_MEMBLOCK_REGIONS + NR_CPUS)
|
||||
|
||||
#endif /* _LOONGARCH_SPARSEMEM_H */
|
||||
|
|
|
@ -57,6 +57,12 @@
|
|||
jirl zero, \temp1, 0xc
|
||||
.endm
|
||||
|
||||
.macro STACKLEAK_ERASE
|
||||
#ifdef CONFIG_GCC_PLUGIN_STACKLEAK
|
||||
bl stackleak_erase_on_task_stack
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro BACKUP_T0T1
|
||||
csrwr t0, EXCEPTION_KS0
|
||||
csrwr t1, EXCEPTION_KS1
|
||||
|
|
|
@ -31,6 +31,11 @@ bool in_irq_stack(unsigned long stack, struct stack_info *info);
|
|||
bool in_task_stack(unsigned long stack, struct task_struct *task, struct stack_info *info);
|
||||
int get_stack_info(unsigned long stack, struct task_struct *task, struct stack_info *info);
|
||||
|
||||
static __always_inline bool on_thread_stack(void)
|
||||
{
|
||||
return !(((unsigned long)(current->stack) ^ current_stack_pointer) & ~(THREAD_SIZE - 1));
|
||||
}
|
||||
|
||||
#define STR_LONG_L __stringify(LONG_L)
|
||||
#define STR_LONG_S __stringify(LONG_S)
|
||||
#define STR_LONGSIZE __stringify(LONGSIZE)
|
||||
|
|
|
@ -19,17 +19,22 @@ extern int pcibus_to_node(struct pci_bus *);
|
|||
|
||||
#define cpumask_of_pcibus(bus) (cpu_online_mask)
|
||||
|
||||
extern unsigned char node_distances[MAX_NUMNODES][MAX_NUMNODES];
|
||||
|
||||
void numa_set_distance(int from, int to, int distance);
|
||||
|
||||
#define node_distance(from, to) (node_distances[(from)][(to)])
|
||||
int __node_distance(int from, int to);
|
||||
#define node_distance(from, to) __node_distance(from, to)
|
||||
|
||||
#else
|
||||
#define pcibus_to_node(bus) 0
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SMP
|
||||
/*
|
||||
* Return cpus that shares the last level cache.
|
||||
*/
|
||||
static inline const struct cpumask *cpu_coregroup_mask(int cpu)
|
||||
{
|
||||
return &cpu_llc_shared_map[cpu];
|
||||
}
|
||||
|
||||
#define topology_physical_package_id(cpu) (cpu_data[cpu].package)
|
||||
#define topology_core_id(cpu) (cpu_data[cpu].core)
|
||||
#define topology_core_cpumask(cpu) (&cpu_core_map[cpu])
|
||||
|
|
|
@ -20,7 +20,7 @@ static __always_inline ssize_t getrandom_syscall(void *_buffer, size_t _len, uns
|
|||
|
||||
asm volatile(
|
||||
" syscall 0\n"
|
||||
: "+r" (ret)
|
||||
: "=r" (ret)
|
||||
: "r" (nr), "r" (buffer), "r" (len), "r" (flags)
|
||||
: "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", "$t8",
|
||||
"memory");
|
||||
|
|
|
@ -25,7 +25,7 @@ static __always_inline long gettimeofday_fallback(
|
|||
|
||||
asm volatile(
|
||||
" syscall 0\n"
|
||||
: "+r" (ret)
|
||||
: "=r" (ret)
|
||||
: "r" (nr), "r" (tv), "r" (tz)
|
||||
: "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
|
||||
"$t8", "memory");
|
||||
|
@ -44,7 +44,7 @@ static __always_inline long clock_gettime_fallback(
|
|||
|
||||
asm volatile(
|
||||
" syscall 0\n"
|
||||
: "+r" (ret)
|
||||
: "=r" (ret)
|
||||
: "r" (nr), "r" (clkid), "r" (ts)
|
||||
: "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
|
||||
"$t8", "memory");
|
||||
|
@ -63,7 +63,7 @@ static __always_inline int clock_getres_fallback(
|
|||
|
||||
asm volatile(
|
||||
" syscall 0\n"
|
||||
: "+r" (ret)
|
||||
: "=r" (ret)
|
||||
: "r" (nr), "r" (clkid), "r" (ts)
|
||||
: "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7",
|
||||
"$t8", "memory");
|
||||
|
|
|
@ -244,22 +244,6 @@ fdt_earlycon:
|
|||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
|
||||
static __init int setup_node(int pxm)
|
||||
{
|
||||
return acpi_map_pxm_to_node(pxm);
|
||||
}
|
||||
|
||||
void __init numa_set_distance(int from, int to, int distance)
|
||||
{
|
||||
if ((u8)distance != distance || (from == to && distance != LOCAL_DISTANCE)) {
|
||||
pr_warn_once("Warning: invalid distance parameter, from=%d to=%d distance=%d\n",
|
||||
from, to, distance);
|
||||
return;
|
||||
}
|
||||
|
||||
node_distances[from][to] = distance;
|
||||
}
|
||||
|
||||
/* Callback for Proximity Domain -> CPUID mapping */
|
||||
void __init
|
||||
acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
|
||||
|
@ -280,7 +264,41 @@ acpi_numa_processor_affinity_init(struct acpi_srat_cpu_affinity *pa)
|
|||
pxm |= (pa->proximity_domain_hi[1] << 16);
|
||||
pxm |= (pa->proximity_domain_hi[2] << 24);
|
||||
}
|
||||
node = setup_node(pxm);
|
||||
node = acpi_map_pxm_to_node(pxm);
|
||||
if (node < 0) {
|
||||
pr_err("SRAT: Too many proximity domains %x\n", pxm);
|
||||
bad_srat();
|
||||
return;
|
||||
}
|
||||
|
||||
if (pa->apic_id >= CONFIG_NR_CPUS) {
|
||||
pr_info("SRAT: PXM %u -> CPU 0x%02x -> Node %u skipped apicid that is too big\n",
|
||||
pxm, pa->apic_id, node);
|
||||
return;
|
||||
}
|
||||
|
||||
early_numa_add_cpu(pa->apic_id, node);
|
||||
|
||||
set_cpuid_to_node(pa->apic_id, node);
|
||||
node_set(node, numa_nodes_parsed);
|
||||
pr_info("SRAT: PXM %u -> CPU 0x%02x -> Node %u\n", pxm, pa->apic_id, node);
|
||||
}
|
||||
|
||||
void __init
|
||||
acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
|
||||
{
|
||||
int pxm, node;
|
||||
|
||||
if (srat_disabled())
|
||||
return;
|
||||
if (pa->header.length < sizeof(struct acpi_srat_x2apic_cpu_affinity)) {
|
||||
bad_srat();
|
||||
return;
|
||||
}
|
||||
if ((pa->flags & ACPI_SRAT_CPU_ENABLED) == 0)
|
||||
return;
|
||||
pxm = pa->proximity_domain;
|
||||
node = acpi_map_pxm_to_node(pxm);
|
||||
if (node < 0) {
|
||||
pr_err("SRAT: Too many proximity domains %x\n", pxm);
|
||||
bad_srat();
|
||||
|
|
|
@ -73,6 +73,7 @@ SYM_CODE_START(handle_syscall)
|
|||
move a0, sp
|
||||
bl do_syscall
|
||||
|
||||
STACKLEAK_ERASE
|
||||
RESTORE_ALL_AND_RET
|
||||
SYM_CODE_END(handle_syscall)
|
||||
_ASM_NOKPROBE(handle_syscall)
|
||||
|
@ -81,6 +82,7 @@ SYM_CODE_START(ret_from_fork_asm)
|
|||
UNWIND_HINT_REGS
|
||||
move a1, sp
|
||||
bl ret_from_fork
|
||||
STACKLEAK_ERASE
|
||||
RESTORE_STATIC
|
||||
RESTORE_SOME
|
||||
RESTORE_SP_AND_RET
|
||||
|
@ -92,6 +94,7 @@ SYM_CODE_START(ret_from_kernel_thread_asm)
|
|||
move a2, s0
|
||||
move a3, s1
|
||||
bl ret_from_kernel_thread
|
||||
STACKLEAK_ERASE
|
||||
RESTORE_STATIC
|
||||
RESTORE_SOME
|
||||
RESTORE_SP_AND_RET
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <linux/mmzone.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/nodemask.h>
|
||||
#include <linux/numa_memblks.h>
|
||||
#include <linux/swap.h>
|
||||
#include <linux/memblock.h>
|
||||
#include <linux/pfn.h>
|
||||
|
@ -27,10 +28,6 @@
|
|||
#include <asm/time.h>
|
||||
|
||||
int numa_off;
|
||||
unsigned char node_distances[MAX_NUMNODES][MAX_NUMNODES];
|
||||
EXPORT_SYMBOL(node_distances);
|
||||
|
||||
static struct numa_meminfo numa_meminfo;
|
||||
cpumask_t cpus_on_node[MAX_NUMNODES];
|
||||
cpumask_t phys_cpus_on_node[MAX_NUMNODES];
|
||||
EXPORT_SYMBOL(cpus_on_node);
|
||||
|
@ -43,8 +40,6 @@ s16 __cpuid_to_node[CONFIG_NR_CPUS] = {
|
|||
};
|
||||
EXPORT_SYMBOL(__cpuid_to_node);
|
||||
|
||||
nodemask_t numa_nodes_parsed __initdata;
|
||||
|
||||
#ifdef CONFIG_HAVE_SETUP_PER_CPU_AREA
|
||||
unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
|
||||
EXPORT_SYMBOL(__per_cpu_offset);
|
||||
|
@ -145,48 +140,6 @@ void numa_remove_cpu(unsigned int cpu)
|
|||
cpumask_clear_cpu(cpu, &cpus_on_node[nid]);
|
||||
}
|
||||
|
||||
static int __init numa_add_memblk_to(int nid, u64 start, u64 end,
|
||||
struct numa_meminfo *mi)
|
||||
{
|
||||
/* ignore zero length blks */
|
||||
if (start == end)
|
||||
return 0;
|
||||
|
||||
/* whine about and ignore invalid blks */
|
||||
if (start > end || nid < 0 || nid >= MAX_NUMNODES) {
|
||||
pr_warn("NUMA: Warning: invalid memblk node %d [mem %#010Lx-%#010Lx]\n",
|
||||
nid, start, end - 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mi->nr_blks >= NR_NODE_MEMBLKS) {
|
||||
pr_err("NUMA: too many memblk ranges\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mi->blk[mi->nr_blks].start = PFN_ALIGN(start);
|
||||
mi->blk[mi->nr_blks].end = PFN_ALIGN(end - PAGE_SIZE + 1);
|
||||
mi->blk[mi->nr_blks].nid = nid;
|
||||
mi->nr_blks++;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* numa_add_memblk - Add one numa_memblk to numa_meminfo
|
||||
* @nid: NUMA node ID of the new memblk
|
||||
* @start: Start address of the new memblk
|
||||
* @end: End address of the new memblk
|
||||
*
|
||||
* Add a new memblk to the default numa_meminfo.
|
||||
*
|
||||
* RETURNS:
|
||||
* 0 on success, -errno on failure.
|
||||
*/
|
||||
int __init numa_add_memblk(int nid, u64 start, u64 end)
|
||||
{
|
||||
return numa_add_memblk_to(nid, start, end, &numa_meminfo);
|
||||
}
|
||||
|
||||
static void __init node_mem_init(unsigned int node)
|
||||
{
|
||||
unsigned long start_pfn, end_pfn;
|
||||
|
@ -205,18 +158,6 @@ static void __init node_mem_init(unsigned int node)
|
|||
|
||||
#ifdef CONFIG_ACPI_NUMA
|
||||
|
||||
static void __init add_node_intersection(u32 node, u64 start, u64 size, u32 type)
|
||||
{
|
||||
static unsigned long num_physpages;
|
||||
|
||||
num_physpages += (size >> PAGE_SHIFT);
|
||||
pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n",
|
||||
node, type, start, size);
|
||||
pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n",
|
||||
start >> PAGE_SHIFT, (start + size) >> PAGE_SHIFT, num_physpages);
|
||||
memblock_set_node(start, size, &memblock.memory, node);
|
||||
}
|
||||
|
||||
/*
|
||||
* add_numamem_region
|
||||
*
|
||||
|
@ -228,28 +169,21 @@ static void __init add_node_intersection(u32 node, u64 start, u64 size, u32 type
|
|||
*/
|
||||
static void __init add_numamem_region(u64 start, u64 end, u32 type)
|
||||
{
|
||||
u32 i;
|
||||
u64 ofs = start;
|
||||
u32 node = pa_to_nid(start);
|
||||
u64 size = end - start;
|
||||
static unsigned long num_physpages;
|
||||
|
||||
if (start >= end) {
|
||||
pr_debug("Invalid region: %016llx-%016llx\n", start, end);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < numa_meminfo.nr_blks; i++) {
|
||||
struct numa_memblk *mb = &numa_meminfo.blk[i];
|
||||
|
||||
if (ofs > mb->end)
|
||||
continue;
|
||||
|
||||
if (end > mb->end) {
|
||||
add_node_intersection(mb->nid, ofs, mb->end - ofs, type);
|
||||
ofs = mb->end;
|
||||
} else {
|
||||
add_node_intersection(mb->nid, ofs, end - ofs, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
num_physpages += (size >> PAGE_SHIFT);
|
||||
pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n",
|
||||
node, type, start, size);
|
||||
pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n",
|
||||
start >> PAGE_SHIFT, end >> PAGE_SHIFT, num_physpages);
|
||||
memblock_set_node(start, size, &memblock.memory, node);
|
||||
}
|
||||
|
||||
static void __init init_node_memblock(void)
|
||||
|
@ -291,24 +225,6 @@ static void __init init_node_memblock(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void __init numa_default_distance(void)
|
||||
{
|
||||
int row, col;
|
||||
|
||||
for (row = 0; row < MAX_NUMNODES; row++)
|
||||
for (col = 0; col < MAX_NUMNODES; col++) {
|
||||
if (col == row)
|
||||
node_distances[row][col] = LOCAL_DISTANCE;
|
||||
else
|
||||
/* We assume that one node per package here!
|
||||
*
|
||||
* A SLIT should be used for multiple nodes
|
||||
* per package to override default setting.
|
||||
*/
|
||||
node_distances[row][col] = REMOTE_DISTANCE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* fake_numa_init() - For Non-ACPI systems
|
||||
* Return: 0 on success, -errno on failure.
|
||||
|
@ -333,11 +249,11 @@ int __init init_numa_memory(void)
|
|||
for (i = 0; i < NR_CPUS; i++)
|
||||
set_cpuid_to_node(i, NUMA_NO_NODE);
|
||||
|
||||
numa_default_distance();
|
||||
numa_reset_distance();
|
||||
nodes_clear(numa_nodes_parsed);
|
||||
nodes_clear(node_possible_map);
|
||||
nodes_clear(node_online_map);
|
||||
memset(&numa_meminfo, 0, sizeof(numa_meminfo));
|
||||
WARN_ON(memblock_clear_hotplug(0, PHYS_ADDR_MAX));
|
||||
|
||||
/* Parse SRAT and SLIT if provided by firmware. */
|
||||
ret = acpi_disabled ? fake_numa_init() : acpi_numa_init();
|
||||
|
|
|
@ -46,6 +46,10 @@ EXPORT_SYMBOL(__cpu_logical_map);
|
|||
cpumask_t cpu_sibling_map[NR_CPUS] __read_mostly;
|
||||
EXPORT_SYMBOL(cpu_sibling_map);
|
||||
|
||||
/* Representing the last level cache shared map of each logical CPU */
|
||||
cpumask_t cpu_llc_shared_map[NR_CPUS] __read_mostly;
|
||||
EXPORT_SYMBOL(cpu_llc_shared_map);
|
||||
|
||||
/* Representing the core map of multi-core chips of each logical CPU */
|
||||
cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
|
||||
EXPORT_SYMBOL(cpu_core_map);
|
||||
|
@ -63,6 +67,9 @@ EXPORT_SYMBOL(cpu_foreign_map);
|
|||
/* representing cpus for which sibling maps can be computed */
|
||||
static cpumask_t cpu_sibling_setup_map;
|
||||
|
||||
/* representing cpus for which llc shared maps can be computed */
|
||||
static cpumask_t cpu_llc_shared_setup_map;
|
||||
|
||||
/* representing cpus for which core maps can be computed */
|
||||
static cpumask_t cpu_core_setup_map;
|
||||
|
||||
|
@ -102,6 +109,34 @@ static inline void set_cpu_core_map(int cpu)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void set_cpu_llc_shared_map(int cpu)
|
||||
{
|
||||
int i;
|
||||
|
||||
cpumask_set_cpu(cpu, &cpu_llc_shared_setup_map);
|
||||
|
||||
for_each_cpu(i, &cpu_llc_shared_setup_map) {
|
||||
if (cpu_to_node(cpu) == cpu_to_node(i)) {
|
||||
cpumask_set_cpu(i, &cpu_llc_shared_map[cpu]);
|
||||
cpumask_set_cpu(cpu, &cpu_llc_shared_map[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void clear_cpu_llc_shared_map(int cpu)
|
||||
{
|
||||
int i;
|
||||
|
||||
for_each_cpu(i, &cpu_llc_shared_setup_map) {
|
||||
if (cpu_to_node(cpu) == cpu_to_node(i)) {
|
||||
cpumask_clear_cpu(i, &cpu_llc_shared_map[cpu]);
|
||||
cpumask_clear_cpu(cpu, &cpu_llc_shared_map[i]);
|
||||
}
|
||||
}
|
||||
|
||||
cpumask_clear_cpu(cpu, &cpu_llc_shared_setup_map);
|
||||
}
|
||||
|
||||
static inline void set_cpu_sibling_map(int cpu)
|
||||
{
|
||||
int i;
|
||||
|
@ -406,6 +441,7 @@ int loongson_cpu_disable(void)
|
|||
#endif
|
||||
set_cpu_online(cpu, false);
|
||||
clear_cpu_sibling_map(cpu);
|
||||
clear_cpu_llc_shared_map(cpu);
|
||||
calculate_cpu_foreign_map();
|
||||
local_irq_save(flags);
|
||||
irq_migrate_all_off_this_cpu();
|
||||
|
@ -572,6 +608,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
|
|||
current_thread_info()->cpu = 0;
|
||||
loongson_prepare_cpus(max_cpus);
|
||||
set_cpu_sibling_map(0);
|
||||
set_cpu_llc_shared_map(0);
|
||||
set_cpu_core_map(0);
|
||||
calculate_cpu_foreign_map();
|
||||
#ifndef CONFIG_HOTPLUG_CPU
|
||||
|
@ -613,6 +650,7 @@ asmlinkage void start_secondary(void)
|
|||
loongson_init_secondary();
|
||||
|
||||
set_cpu_sibling_map(cpu);
|
||||
set_cpu_llc_shared_map(cpu);
|
||||
set_cpu_core_map(cpu);
|
||||
|
||||
notify_cpu_starting(cpu);
|
||||
|
|
|
@ -105,7 +105,9 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
|
|||
|
||||
vdso_addr = data_addr + VVAR_SIZE;
|
||||
vma = _install_special_mapping(mm, vdso_addr, info->size,
|
||||
VM_READ | VM_EXEC | VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC,
|
||||
VM_READ | VM_EXEC |
|
||||
VM_MAYREAD | VM_MAYWRITE | VM_MAYEXEC |
|
||||
VM_SEALED_SYSMAP,
|
||||
&info->code_mapping);
|
||||
if (IS_ERR(vma)) {
|
||||
ret = PTR_ERR(vma);
|
||||
|
|
|
@ -47,7 +47,8 @@ pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr,
|
|||
pmd = pmd_offset(pud, addr);
|
||||
}
|
||||
}
|
||||
return pmd_none(pmdp_get(pmd)) ? NULL : (pte_t *) pmd;
|
||||
|
||||
return (!pmd || pmd_none(pmdp_get(pmd))) ? NULL : (pte_t *) pmd;
|
||||
}
|
||||
|
||||
uint64_t pmd_to_entrylo(unsigned long pmd_val)
|
||||
|
|
|
@ -106,14 +106,6 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap)
|
|||
page += vmem_altmap_offset(altmap);
|
||||
__remove_pages(start_pfn, nr_pages, altmap);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
int memory_add_physaddr_to_nid(u64 start)
|
||||
{
|
||||
return pa_to_nid(start);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SPARSEMEM_VMEMMAP
|
||||
|
|
|
@ -194,6 +194,7 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
|
|||
{
|
||||
struct pci_bus *bus;
|
||||
struct pci_root_info *info;
|
||||
struct pci_host_bridge *host;
|
||||
struct acpi_pci_root_ops *root_ops;
|
||||
int domain = root->segment;
|
||||
int busnum = root->secondary.start;
|
||||
|
@ -237,8 +238,17 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
pci_bus_size_bridges(bus);
|
||||
pci_bus_assign_resources(bus);
|
||||
/* If we must preserve the resource configuration, claim now */
|
||||
host = pci_find_host_bridge(bus);
|
||||
if (host->preserve_config)
|
||||
pci_bus_claim_resources(bus);
|
||||
|
||||
/*
|
||||
* Assign whatever was left unassigned. If we didn't claim above,
|
||||
* this will reassign everything.
|
||||
*/
|
||||
pci_assign_unassigned_root_bus_resources(bus);
|
||||
|
||||
list_for_each_entry(child, &bus->children, node)
|
||||
pcie_bus_configure_settings(child);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \
|
|||
$(DISABLE_STACKLEAK_PLUGIN)
|
||||
cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax \
|
||||
$(DISABLE_STACKLEAK_PLUGIN)
|
||||
cflags-$(CONFIG_LOONGARCH) += -fpie
|
||||
cflags-$(CONFIG_LOONGARCH) += -fpie $(DISABLE_STACKLEAK_PLUGIN)
|
||||
|
||||
cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt
|
||||
|
||||
|
|
|
@ -56,8 +56,7 @@ static struct input_dev *generic_inputdev;
|
|||
static acpi_handle hotkey_handle;
|
||||
static struct key_entry hotkey_keycode_map[GENERIC_HOTKEY_MAP_MAX];
|
||||
|
||||
int loongson_laptop_turn_on_backlight(void);
|
||||
int loongson_laptop_turn_off_backlight(void);
|
||||
static bool bl_powered;
|
||||
static int loongson_laptop_backlight_update(struct backlight_device *bd);
|
||||
|
||||
/* 2. ACPI Helpers and device model */
|
||||
|
@ -354,16 +353,42 @@ static int ec_backlight_level(u8 level)
|
|||
return level;
|
||||
}
|
||||
|
||||
static int ec_backlight_set_power(bool state)
|
||||
{
|
||||
int status;
|
||||
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
|
||||
struct acpi_object_list args = { 1, &arg0 };
|
||||
|
||||
arg0.integer.value = state;
|
||||
status = acpi_evaluate_object(NULL, "\\BLSW", &args, NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
pr_info("Loongson lvds error: 0x%x\n", status);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int loongson_laptop_backlight_update(struct backlight_device *bd)
|
||||
{
|
||||
int lvl = ec_backlight_level(bd->props.brightness);
|
||||
bool target_powered = !backlight_is_blank(bd);
|
||||
int ret = 0, lvl = ec_backlight_level(bd->props.brightness);
|
||||
|
||||
if (lvl < 0)
|
||||
return -EIO;
|
||||
|
||||
if (ec_set_brightness(lvl))
|
||||
return -EIO;
|
||||
|
||||
return 0;
|
||||
if (target_powered != bl_powered) {
|
||||
ret = ec_backlight_set_power(target_powered);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
bl_powered = target_powered;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int loongson_laptop_get_brightness(struct backlight_device *bd)
|
||||
|
@ -384,7 +409,7 @@ static const struct backlight_ops backlight_laptop_ops = {
|
|||
|
||||
static int laptop_backlight_register(void)
|
||||
{
|
||||
int status = 0;
|
||||
int status = 0, ret;
|
||||
struct backlight_properties props;
|
||||
|
||||
memset(&props, 0, sizeof(props));
|
||||
|
@ -392,44 +417,20 @@ static int laptop_backlight_register(void)
|
|||
if (!acpi_evalf(hotkey_handle, &status, "ECLL", "d"))
|
||||
return -EIO;
|
||||
|
||||
props.brightness = 1;
|
||||
ret = ec_backlight_set_power(true);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
bl_powered = true;
|
||||
|
||||
props.max_brightness = status;
|
||||
props.brightness = ec_get_brightness();
|
||||
props.power = BACKLIGHT_POWER_ON;
|
||||
props.type = BACKLIGHT_PLATFORM;
|
||||
|
||||
backlight_device_register("loongson_laptop",
|
||||
NULL, NULL, &backlight_laptop_ops, &props);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int loongson_laptop_turn_on_backlight(void)
|
||||
{
|
||||
int status;
|
||||
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
|
||||
struct acpi_object_list args = { 1, &arg0 };
|
||||
|
||||
arg0.integer.value = 1;
|
||||
status = acpi_evaluate_object(NULL, "\\BLSW", &args, NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
pr_info("Loongson lvds error: 0x%x\n", status);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int loongson_laptop_turn_off_backlight(void)
|
||||
{
|
||||
int status;
|
||||
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
|
||||
struct acpi_object_list args = { 1, &arg0 };
|
||||
|
||||
arg0.integer.value = 0;
|
||||
status = acpi_evaluate_object(NULL, "\\BLSW", &args, NULL);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
pr_info("Loongson lvds error: 0x%x\n", status);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -611,11 +612,17 @@ static int __init generic_acpi_laptop_init(void)
|
|||
|
||||
static void __exit generic_acpi_laptop_exit(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (generic_inputdev) {
|
||||
if (input_device_registered)
|
||||
input_unregister_device(generic_inputdev);
|
||||
else
|
||||
if (!input_device_registered) {
|
||||
input_free_device(generic_inputdev);
|
||||
} else {
|
||||
input_unregister_device(generic_inputdev);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(generic_sub_drivers); i++)
|
||||
generic_subdriver_exit(&generic_sub_drivers[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1355,6 +1355,7 @@ config NUMA_MEMBLKS
|
|||
config NUMA_EMU
|
||||
bool "NUMA emulation"
|
||||
depends on NUMA_MEMBLKS
|
||||
depends on X86 || GENERIC_ARCH_NUMA
|
||||
help
|
||||
Enable NUMA emulation. A flat machine will be split
|
||||
into virtual nodes when booted with "numa=fake=N", where N is the
|
||||
|
|
Loading…
Reference in New Issue
Block a user