MIPS: Netlogic: Add macro for node present
Add macro nlm_node_present() that can be used to check if a node is present in a multi-chip configuration. This can be used even when NUMA is not enabled. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6272/
This commit is contained in:
committed by
Ralf Baechle
parent
ed8dfc46e0
commit
cfec4c63f5
@@ -63,6 +63,8 @@ struct nlm_soc_info {
|
|||||||
|
|
||||||
extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES];
|
extern struct nlm_soc_info nlm_nodes[NLM_NR_NODES];
|
||||||
#define nlm_get_node(i) (&nlm_nodes[i])
|
#define nlm_get_node(i) (&nlm_nodes[i])
|
||||||
|
#define nlm_node_present(n) ((n) >= 0 && (n) < NLM_NR_NODES && \
|
||||||
|
nlm_get_node(n)->coremask != 0)
|
||||||
#ifdef CONFIG_CPU_XLR
|
#ifdef CONFIG_CPU_XLR
|
||||||
#define nlm_current_node() (&nlm_nodes[0])
|
#define nlm_current_node() (&nlm_nodes[0])
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -235,7 +235,6 @@ static inline void xlp_config_pci_bswap(int node, int link) {}
|
|||||||
|
|
||||||
static int __init pcibios_init(void)
|
static int __init pcibios_init(void)
|
||||||
{
|
{
|
||||||
struct nlm_soc_info *nodep;
|
|
||||||
uint64_t pciebase;
|
uint64_t pciebase;
|
||||||
int link, n;
|
int link, n;
|
||||||
u32 reg;
|
u32 reg;
|
||||||
@@ -249,9 +248,8 @@ static int __init pcibios_init(void)
|
|||||||
ioport_resource.end = ~0;
|
ioport_resource.end = ~0;
|
||||||
|
|
||||||
for (n = 0; n < NLM_NR_NODES; n++) {
|
for (n = 0; n < NLM_NR_NODES; n++) {
|
||||||
nodep = nlm_get_node(n);
|
if (!nlm_node_present(n))
|
||||||
if (!nodep->coremask)
|
continue;
|
||||||
continue; /* node does not exist */
|
|
||||||
|
|
||||||
for (link = 0; link < PCIE_NLINKS; link++) {
|
for (link = 0; link < PCIE_NLINKS; link++) {
|
||||||
pciebase = nlm_get_pcie_base(n, link);
|
pciebase = nlm_get_pcie_base(n, link);
|
||||||
|
|||||||
Reference in New Issue
Block a user