Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit f06ce44

Browse files
committed
Merge tag 'loongarch-fixes-6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
Pull LoongArch fixes from Huacai Chen: "Some bootloader interface fixes, a dts fix, and a trivial cleanup" * tag 'loongarch-fixes-6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson: LoongArch: Fix GMAC's phy-mode definitions in dts LoongArch: Override higher address bits in JUMP_VIRT_ADDR LoongArch: Fix entry point in kernel image header LoongArch: Add all CPUs enabled by fdt to NUMA node 0 LoongArch: Fix built-in DTB detection LoongArch: Remove CONFIG_ACPI_TABLE_UPGRADE in platform_init()
2 parents c3f38fa + eb36e52 commit f06ce44

File tree

10 files changed

+21
-17
lines changed

10 files changed

+21
-17
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@
4444
&gmac0 {
4545
status = "okay";
4646

47-
phy-mode = "rgmii";
47+
phy-mode = "rgmii-id";
4848
bus_id = <0x0>;
4949
};
5050

5151
&gmac1 {
5252
status = "okay";
5353

54-
phy-mode = "rgmii";
54+
phy-mode = "rgmii-id";
5555
bus_id = <0x1>;
5656
};
5757

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
&gmac0 {
4444
status = "okay";
4545

46-
phy-mode = "rgmii";
46+
phy-mode = "rgmii-id";
4747
phy-handle = <&phy0>;
4848
mdio {
4949
compatible = "snps,dwmac-mdio";
@@ -58,7 +58,7 @@
5858
&gmac1 {
5959
status = "okay";
6060

61-
phy-mode = "rgmii";
61+
phy-mode = "rgmii-id";
6262
phy-handle = <&phy1>;
6363
mdio {
6464
compatible = "snps,dwmac-mdio";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
&gmac2 {
9393
status = "okay";
9494

95-
phy-mode = "rgmii";
95+
phy-mode = "rgmii-id";
9696
phy-handle = <&phy2>;
9797
mdio {
9898
compatible = "snps,dwmac-mdio";

arch/loongarch/include/asm/numa.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ extern int early_cpu_to_node(int cpu);
5656
static inline void early_numa_add_cpu(int cpuid, s16 node) { }
5757
static inline void numa_add_cpu(unsigned int cpu) { }
5858
static inline void numa_remove_cpu(unsigned int cpu) { }
59+
static inline void set_cpuid_to_node(int cpuid, s16 node) { }
5960

6061
static inline int early_cpu_to_node(int cpu)
6162
{

arch/loongarch/include/asm/stackframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
.macro JUMP_VIRT_ADDR temp1 temp2
4343
li.d \temp1, CACHE_BASE
4444
pcaddi \temp2, 0
45-
or \temp1, \temp1, \temp2
45+
bstrins.d \temp1, \temp2, (DMW_PABITS - 1), 0
4646
jirl zero, \temp1, 0xc
4747
.endm
4848

arch/loongarch/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
_head:
2323
.word MZ_MAGIC /* "MZ", MS-DOS header */
2424
.org 0x8
25-
.dword kernel_entry /* Kernel entry point */
25+
.dword _kernel_entry /* Kernel entry point (physical address) */
2626
.dword _kernel_asize /* Kernel image effective size */
2727
.quad PHYS_LINK_KADDR /* Kernel image load offset from start of RAM */
2828
.org 0x38 /* 0x20 ~ 0x37 reserved */

arch/loongarch/kernel/setup.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static void __init fdt_setup(void)
282282
return;
283283

284284
/* Prefer to use built-in dtb, checking its legality first. */
285-
if (!fdt_check_header(__dtb_start))
285+
if (IS_ENABLED(CONFIG_BUILTIN_DTB) && !fdt_check_header(__dtb_start))
286286
fdt_pointer = __dtb_start;
287287
else
288288
fdt_pointer = efi_fdt_pointer(); /* Fallback to firmware dtb */
@@ -351,10 +351,8 @@ void __init platform_init(void)
351351
arch_reserve_vmcore();
352352
arch_reserve_crashkernel();
353353

354-
#ifdef CONFIG_ACPI_TABLE_UPGRADE
355-
acpi_table_upgrade();
356-
#endif
357354
#ifdef CONFIG_ACPI
355+
acpi_table_upgrade();
358356
acpi_gbl_use_default_register_widths = false;
359357
acpi_boot_table_init();
360358
#endif

arch/loongarch/kernel/smp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,6 @@ static void __init fdt_smp_setup(void)
273273

274274
if (cpuid == loongson_sysconf.boot_cpu_id) {
275275
cpu = 0;
276-
numa_add_cpu(cpu);
277276
} else {
278277
cpu = cpumask_next_zero(-1, cpu_present_mask);
279278
}
@@ -283,6 +282,9 @@ static void __init fdt_smp_setup(void)
283282
set_cpu_present(cpu, true);
284283
__cpu_number_map[cpuid] = cpu;
285284
__cpu_logical_map[cpu] = cpuid;
285+
286+
early_numa_add_cpu(cpu, 0);
287+
set_cpuid_to_node(cpuid, 0);
286288
}
287289

288290
loongson_sysconf.nr_cpus = num_processors;
@@ -468,6 +470,7 @@ void smp_prepare_boot_cpu(void)
468470
set_cpu_possible(0, true);
469471
set_cpu_online(0, true);
470472
set_my_cpu_offset(per_cpu_offset(0));
473+
numa_add_cpu(0);
471474

472475
rr_node = first_node(node_online_map);
473476
for_each_possible_cpu(cpu) {

arch/loongarch/kernel/vmlinux.lds.S

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#define PAGE_SIZE _PAGE_SIZE
88
#define RO_EXCEPTION_TABLE_ALIGN 4
9+
#define PHYSADDR_MASK 0xffffffffffff /* 48-bit */
910

1011
/*
1112
* Put .bss..swapper_pg_dir as the first thing in .bss. This will
@@ -142,10 +143,11 @@ SECTIONS
142143

143144
#ifdef CONFIG_EFI_STUB
144145
/* header symbols */
145-
_kernel_asize = _end - _text;
146-
_kernel_fsize = _edata - _text;
147-
_kernel_vsize = _end - __initdata_begin;
148-
_kernel_rsize = _edata - __initdata_begin;
146+
_kernel_entry = ABSOLUTE(kernel_entry & PHYSADDR_MASK);
147+
_kernel_asize = ABSOLUTE(_end - _text);
148+
_kernel_fsize = ABSOLUTE(_edata - _text);
149+
_kernel_vsize = ABSOLUTE(_end - __initdata_begin);
150+
_kernel_rsize = ABSOLUTE(_edata - __initdata_begin);
149151
#endif
150152

151153
.gptab.sdata : {

drivers/firmware/efi/libstub/loongarch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv)
4141
unsigned long __weak kernel_entry_address(unsigned long kernel_addr,
4242
efi_loaded_image_t *image)
4343
{
44-
return *(unsigned long *)(kernel_addr + 8) - VMLINUX_LOAD_ADDRESS + kernel_addr;
44+
return *(unsigned long *)(kernel_addr + 8) - PHYSADDR(VMLINUX_LOAD_ADDRESS) + kernel_addr;
4545
}
4646

4747
efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,

0 commit comments

Comments
 (0)