Commit 5de6b467 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'loongarch-fixes-6.9-1' of...

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

Pull LoongArch fixes from Huacai Chen:

 - make {virt, phys, page, pfn} translation work with KFENCE for
   LoongArch (otherwise NVMe and virtio-blk cannot work with KFENCE
   enabled)

 - update dts files for Loongson-2K series to make devices work
   correctly

 - fix a build error

* tag 'loongarch-fixes-6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson:
  LoongArch: Include linux/sizes.h in addrspace.h to prevent build errors
  LoongArch: Update dts for Loongson-2K2000 to support GMAC/GNET
  LoongArch: Update dts for Loongson-2K2000 to support PCI-MSI
  LoongArch: Update dts for Loongson-2K2000 to support ISA/LPC
  LoongArch: Update dts for Loongson-2K1000 to support ISA/LPC
  LoongArch: Make virt_addr_valid()/__virt_addr_valid() work with KFENCE
  LoongArch: Make {virt, phys, page, pfn} translation work with KFENCE
  mm: Move lowmem_page_address() a little later
parents e1dc191d a07c772f
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -100,6 +100,13 @@ bus@10000000 {
		#size-cells = <2>;
		dma-coherent;

		isa@18000000 {
			compatible = "isa";
			#size-cells = <1>;
			#address-cells = <2>;
			ranges = <1 0x0 0x0 0x18000000 0x4000>;
		};

		liointc0: interrupt-controller@1fe01400 {
			compatible = "loongson,liointc-2.0";
			reg = <0x0 0x1fe01400 0x0 0x40>,
+33 −0
Original line number Diff line number Diff line
@@ -61,12 +61,45 @@ &xhci1 {

&gmac0 {
	status = "okay";

	phy-mode = "gmii";
	phy-handle = <&phy0>;
	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;
		phy0: ethernet-phy@0 {
			reg = <2>;
		};
	};
};

&gmac1 {
	status = "okay";

	phy-mode = "gmii";
	phy-handle = <&phy1>;
	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;
		phy1: ethernet-phy@1 {
			reg = <2>;
		};
	};
};

&gmac2 {
	status = "okay";

	phy-mode = "rgmii";
	phy-handle = <&phy2>;
	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;
		phy2: ethernet-phy@2 {
			reg = <0>;
		};
	};
};
+20 −4
Original line number Diff line number Diff line
@@ -51,6 +51,13 @@ bus@10000000 {
		#address-cells = <2>;
		#size-cells = <2>;

		isa@18400000 {
			compatible = "isa";
			#size-cells = <1>;
			#address-cells = <2>;
			ranges = <1 0x0 0x0 0x18400000 0x4000>;
		};

		pmc: power-management@100d0000 {
			compatible = "loongson,ls2k2000-pmc", "loongson,ls2k0500-pmc", "syscon";
			reg = <0x0 0x100d0000 0x0 0x58>;
@@ -109,6 +116,8 @@ pic: interrupt-controller@10000000 {
		msi: msi-controller@1fe01140 {
			compatible = "loongson,pch-msi-1.0";
			reg = <0x0 0x1fe01140 0x0 0x8>;
			interrupt-controller;
			#interrupt-cells = <1>;
			msi-controller;
			loongson,msi-base-vec = <64>;
			loongson,msi-num-vecs = <192>;
@@ -140,27 +149,34 @@ pcie@1a000000 {
			#address-cells = <3>;
			#size-cells = <2>;
			device_type = "pci";
			msi-parent = <&msi>;
			bus-range = <0x0 0xff>;
			ranges = <0x01000000 0x0 0x00008000 0x0 0x18400000 0x0 0x00008000>,
			ranges = <0x01000000 0x0 0x00008000 0x0 0x18408000 0x0 0x00008000>,
				 <0x02000000 0x0 0x60000000 0x0 0x60000000 0x0 0x20000000>;

			gmac0: ethernet@3,0 {
				reg = <0x1800 0x0 0x0 0x0 0x0>;
				interrupts = <12 IRQ_TYPE_LEVEL_HIGH>;
				interrupts = <12 IRQ_TYPE_LEVEL_HIGH>,
					     <13 IRQ_TYPE_LEVEL_HIGH>;
				interrupt-names = "macirq", "eth_lpi";
				interrupt-parent = <&pic>;
				status = "disabled";
			};

			gmac1: ethernet@3,1 {
				reg = <0x1900 0x0 0x0 0x0 0x0>;
				interrupts = <14 IRQ_TYPE_LEVEL_HIGH>;
				interrupts = <14 IRQ_TYPE_LEVEL_HIGH>,
					     <15 IRQ_TYPE_LEVEL_HIGH>;
				interrupt-names = "macirq", "eth_lpi";
				interrupt-parent = <&pic>;
				status = "disabled";
			};

			gmac2: ethernet@3,2 {
				reg = <0x1a00 0x0 0x0 0x0 0x0>;
				interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
				interrupts = <17 IRQ_TYPE_LEVEL_HIGH>,
					     <18 IRQ_TYPE_LEVEL_HIGH>;
				interrupt-names = "macirq", "eth_lpi";
				interrupt-parent = <&pic>;
				status = "disabled";
			};
+1 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#define _ASM_ADDRSPACE_H

#include <linux/const.h>
#include <linux/sizes.h>

#include <asm/loongarch.h>

+15 −5
Original line number Diff line number Diff line
@@ -14,11 +14,6 @@
#include <asm/pgtable-bits.h>
#include <asm/string.h>

/*
 * Change "struct page" to physical address.
 */
#define page_to_phys(page)	((phys_addr_t)page_to_pfn(page) << PAGE_SHIFT)

extern void __init __iomem *early_ioremap(u64 phys_addr, unsigned long size);
extern void __init early_iounmap(void __iomem *addr, unsigned long size);

@@ -73,6 +68,21 @@ extern void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t

#define __io_aw() mmiowb()

#ifdef CONFIG_KFENCE
#define virt_to_phys(kaddr)								\
({											\
	(likely((unsigned long)kaddr < vm_map_base)) ? __pa((unsigned long)kaddr) :	\
	page_to_phys(tlb_virt_to_page((unsigned long)kaddr)) + offset_in_page((unsigned long)kaddr);\
})

#define phys_to_virt(paddr)								\
({											\
	extern char *__kfence_pool;							\
	(unlikely(__kfence_pool == NULL)) ? __va((unsigned long)paddr) :		\
	page_address(phys_to_page((unsigned long)paddr)) + offset_in_page((unsigned long)paddr);\
})
#endif

#include <asm-generic/io.h>

#define ARCH_HAS_VALID_PHYS_ADDR_RANGE
Loading