Skip to content

Commit

Permalink
ARM: DT/kernel: define ARM specific arch_match_cpu_phys_id
Browse files Browse the repository at this point in the history
OF/DT core library now provides architecture specific hook to match the
logical cpu index with the corresponding physical identifier. Most of the
cpu DT node parsing and initialisation is contained in devtree.c. So it's
better to define ARM specific arch_match_cpu_phys_id there.

This mainly helps to avoid replication of the code doing CPU node parsing
and physical(MPIDR) to logical mapping.

Cc: Russell King <linux@arm.linux.org.uk>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Sudeep KarkadaNagesha <sudeep.karkadanagesha@arm.com>
  • Loading branch information
Sudeep KarkadaNagesha committed Aug 21, 2013
1 parent 183912d commit 973e02c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/kernel/devtree.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ void __init arm_dt_init_cpu_maps(void)
}
}

bool arch_match_cpu_phys_id(int cpu, u64 phys_id)
{
return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu);
}

/**
* setup_machine_fdt - Machine setup when an dtb was passed to the kernel
* @dt_phys: physical address of dt blob
Expand Down

0 comments on commit 973e02c

Please sign in to comment.