mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
LoongArch: Use pa_to_nid()/nid_to_addrbase() rather than hard-code
NODE_ADDRSPACE_SHIFT is 44 now but may be changed in future, so use pa_to_nid()/nid_to_addrbase() rather than hard-code. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
This commit is contained in:
parent
87c6d144bc
commit
244eb26bbd
|
|
@ -14,7 +14,7 @@
|
|||
#define NODE_ADDRSPACE_SHIFT 44
|
||||
|
||||
#define pa_to_nid(addr) (((addr) & 0xf00000000000) >> NODE_ADDRSPACE_SHIFT)
|
||||
#define nid_to_addrbase(nid) (_ULCAST_(nid) << NODE_ADDRSPACE_SHIFT)
|
||||
#define nid_to_addrbase(nid) (_U64CAST_(nid) << NODE_ADDRSPACE_SHIFT)
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include <asm/irq.h>
|
||||
#include <asm/loongson.h>
|
||||
#include <asm/numa.h>
|
||||
#include <asm/setup.h>
|
||||
|
||||
DEFINE_PER_CPU(unsigned long, irq_stack);
|
||||
|
|
@ -69,7 +70,7 @@ static int __init early_pci_mcfg_parse(struct acpi_table_header *header)
|
|||
|
||||
for (i = 0; i < n; i++, mptr++) {
|
||||
msi_group[i].pci_segment = mptr->pci_segment;
|
||||
pch_group[i].node = msi_group[i].node = (mptr->address >> 44) & 0xf;
|
||||
pch_group[i].node = msi_group[i].node = pa_to_nid(mptr->address);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/io-64-nonatomic-lo-hi.h>
|
||||
#include <asm/cacheflush.h>
|
||||
#include <asm/loongson.h>
|
||||
#include <asm/numa.h>
|
||||
|
||||
#define PCI_DEVICE_ID_LOONGSON_HOST 0x7a00
|
||||
#define PCI_DEVICE_ID_LOONGSON_DC1 0x7a06
|
||||
|
|
@ -43,7 +44,7 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn,
|
|||
|
||||
phys_addr_t mcfg_addr_init(int node)
|
||||
{
|
||||
return (((u64)node << 44) | MCFG_EXT_PCICFG_BASE);
|
||||
return (nid_to_addrbase(node) | MCFG_EXT_PCICFG_BASE);
|
||||
}
|
||||
|
||||
static int __init pcibios_init(void)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user