Skip to content

Commit

Permalink
Automatic merge of 'master' into merge-test (2024-06-04 17:07)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpe committed Jun 4, 2024
2 parents 2c644f2 + 2ab7951 commit c9a3e9d
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 26 deletions.
4 changes: 2 additions & 2 deletions arch/loongarch/boot/dts/loongson-2k0500-ref.dts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@
&gmac0 {
status = "okay";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
bus_id = <0x0>;
};

&gmac1 {
status = "okay";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
bus_id = <0x1>;
};

Expand Down
4 changes: 2 additions & 2 deletions arch/loongarch/boot/dts/loongson-2k1000-ref.dts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
&gmac0 {
status = "okay";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
phy-handle = <&phy0>;
mdio {
compatible = "snps,dwmac-mdio";
Expand All @@ -58,7 +58,7 @@
&gmac1 {
status = "okay";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
phy-handle = <&phy1>;
mdio {
compatible = "snps,dwmac-mdio";
Expand Down
2 changes: 1 addition & 1 deletion arch/loongarch/boot/dts/loongson-2k2000-ref.dts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
&gmac2 {
status = "okay";

phy-mode = "rgmii";
phy-mode = "rgmii-id";
phy-handle = <&phy2>;
mdio {
compatible = "snps,dwmac-mdio";
Expand Down
1 change: 1 addition & 0 deletions arch/loongarch/include/asm/numa.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern int early_cpu_to_node(int cpu);
static inline void early_numa_add_cpu(int cpuid, s16 node) { }
static inline void numa_add_cpu(unsigned int cpu) { }
static inline void numa_remove_cpu(unsigned int cpu) { }
static inline void set_cpuid_to_node(int cpuid, s16 node) { }

static inline int early_cpu_to_node(int cpu)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/loongarch/include/asm/stackframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
.macro JUMP_VIRT_ADDR temp1 temp2
li.d \temp1, CACHE_BASE
pcaddi \temp2, 0
or \temp1, \temp1, \temp2
bstrins.d \temp1, \temp2, (DMW_PABITS - 1), 0
jirl zero, \temp1, 0xc
.endm

Expand Down
2 changes: 1 addition & 1 deletion arch/loongarch/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
_head:
.word MZ_MAGIC /* "MZ", MS-DOS header */
.org 0x8
.dword kernel_entry /* Kernel entry point */
.dword _kernel_entry /* Kernel entry point (physical address) */
.dword _kernel_asize /* Kernel image effective size */
.quad PHYS_LINK_KADDR /* Kernel image load offset from start of RAM */
.org 0x38 /* 0x20 ~ 0x37 reserved */
Expand Down
6 changes: 2 additions & 4 deletions arch/loongarch/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static void __init fdt_setup(void)
return;

/* Prefer to use built-in dtb, checking its legality first. */
if (!fdt_check_header(__dtb_start))
if (IS_ENABLED(CONFIG_BUILTIN_DTB) && !fdt_check_header(__dtb_start))
fdt_pointer = __dtb_start;
else
fdt_pointer = efi_fdt_pointer(); /* Fallback to firmware dtb */
Expand Down Expand Up @@ -351,10 +351,8 @@ void __init platform_init(void)
arch_reserve_vmcore();
arch_reserve_crashkernel();

#ifdef CONFIG_ACPI_TABLE_UPGRADE
acpi_table_upgrade();
#endif
#ifdef CONFIG_ACPI
acpi_table_upgrade();
acpi_gbl_use_default_register_widths = false;
acpi_boot_table_init();
#endif
Expand Down
5 changes: 4 additions & 1 deletion arch/loongarch/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ static void __init fdt_smp_setup(void)

if (cpuid == loongson_sysconf.boot_cpu_id) {
cpu = 0;
numa_add_cpu(cpu);
} else {
cpu = cpumask_next_zero(-1, cpu_present_mask);
}
Expand All @@ -283,6 +282,9 @@ static void __init fdt_smp_setup(void)
set_cpu_present(cpu, true);
__cpu_number_map[cpuid] = cpu;
__cpu_logical_map[cpu] = cpuid;

early_numa_add_cpu(cpu, 0);
set_cpuid_to_node(cpuid, 0);
}

loongson_sysconf.nr_cpus = num_processors;
Expand Down Expand Up @@ -468,6 +470,7 @@ void smp_prepare_boot_cpu(void)
set_cpu_possible(0, true);
set_cpu_online(0, true);
set_my_cpu_offset(per_cpu_offset(0));
numa_add_cpu(0);

rr_node = first_node(node_online_map);
for_each_possible_cpu(cpu) {
Expand Down
10 changes: 6 additions & 4 deletions arch/loongarch/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#define PAGE_SIZE _PAGE_SIZE
#define RO_EXCEPTION_TABLE_ALIGN 4
#define PHYSADDR_MASK 0xffffffffffff /* 48-bit */

/*
* Put .bss..swapper_pg_dir as the first thing in .bss. This will
Expand Down Expand Up @@ -142,10 +143,11 @@ SECTIONS

#ifdef CONFIG_EFI_STUB
/* header symbols */
_kernel_asize = _end - _text;
_kernel_fsize = _edata - _text;
_kernel_vsize = _end - __initdata_begin;
_kernel_rsize = _edata - __initdata_begin;
_kernel_entry = ABSOLUTE(kernel_entry & PHYSADDR_MASK);
_kernel_asize = ABSOLUTE(_end - _text);
_kernel_fsize = ABSOLUTE(_edata - _text);
_kernel_vsize = ABSOLUTE(_end - __initdata_begin);
_kernel_rsize = ABSOLUTE(_edata - __initdata_begin);
#endif

.gptab.sdata : {
Expand Down
18 changes: 9 additions & 9 deletions drivers/cxl/core/region.c
Original file line number Diff line number Diff line change
Expand Up @@ -2352,15 +2352,6 @@ static struct cxl_region *devm_cxl_add_region(struct cxl_root_decoder *cxlrd,
struct device *dev;
int rc;

switch (mode) {
case CXL_DECODER_RAM:
case CXL_DECODER_PMEM:
break;
default:
dev_err(&cxlrd->cxlsd.cxld.dev, "unsupported mode %d\n", mode);
return ERR_PTR(-EINVAL);
}

cxlr = cxl_region_alloc(cxlrd, id);
if (IS_ERR(cxlr))
return cxlr;
Expand Down Expand Up @@ -2415,6 +2406,15 @@ static struct cxl_region *__create_region(struct cxl_root_decoder *cxlrd,
{
int rc;

switch (mode) {
case CXL_DECODER_RAM:
case CXL_DECODER_PMEM:
break;
default:
dev_err(&cxlrd->cxlsd.cxld.dev, "unsupported mode %d\n", mode);
return ERR_PTR(-EINVAL);
}

rc = memregion_alloc(GFP_KERNEL);
if (rc < 0)
return ERR_PTR(rc);
Expand Down
2 changes: 1 addition & 1 deletion drivers/firmware/efi/libstub/loongarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static efi_status_t exit_boot_func(struct efi_boot_memmap *map, void *priv)
unsigned long __weak kernel_entry_address(unsigned long kernel_addr,
efi_loaded_image_t *image)
{
return *(unsigned long *)(kernel_addr + 8) - VMLINUX_LOAD_ADDRESS + kernel_addr;
return *(unsigned long *)(kernel_addr + 8) - PHYSADDR(VMLINUX_LOAD_ADDRESS) + kernel_addr;
}

efi_status_t efi_boot_kernel(void *handle, efi_loaded_image_t *image,
Expand Down
1 change: 1 addition & 0 deletions tools/testing/cxl/test/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include <linux/platform_device.h>
#include <linux/mod_devicetable.h>
#include <linux/vmalloc.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/sizes.h>
Expand Down

0 comments on commit c9a3e9d

Please sign in to comment.