Skip to content

Commit 61f14c0

Browse files
committed
Merge tag 'mips_4.16_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips
Pull MIPS fix from James Hogan: "A single change (and associated DT binding update) to allow the address of the MIPS Cluster Power Controller (CPC) to be chosen by DT, which allows SMP to work on generic MIPS kernels where the bootloader hasn't configured the CPC address (i.e. the new Ranchu platform)" * tag 'mips_4.16_2' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/mips: MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() dt-bindings: Document mti,mips-cpc binding
2 parents 178e834 + 791412d commit 61f14c0

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Binding for MIPS Cluster Power Controller (CPC).
2+
3+
This binding allows a system to specify where the CPC registers are
4+
located.
5+
6+
Required properties:
7+
compatible : Should be "mti,mips-cpc".
8+
regs: Should describe the address & size of the CPC register region.

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9206,6 +9206,7 @@ MIPS GENERIC PLATFORM
92069206
M: Paul Burton <[email protected]>
92079207
92089208
S: Supported
9209+
F: Documentation/devicetree/bindings/power/mti,mips-cpc.txt
92099210
F: arch/mips/generic/
92109211
F: arch/mips/tools/generic-board-config.sh
92119212

arch/mips/kernel/mips-cpc.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
#include <linux/errno.h>
1212
#include <linux/percpu.h>
13+
#include <linux/of.h>
14+
#include <linux/of_address.h>
1315
#include <linux/spinlock.h>
1416

1517
#include <asm/mips-cps.h>
@@ -22,6 +24,17 @@ static DEFINE_PER_CPU_ALIGNED(unsigned long, cpc_core_lock_flags);
2224

2325
phys_addr_t __weak mips_cpc_default_phys_base(void)
2426
{
27+
struct device_node *cpc_node;
28+
struct resource res;
29+
int err;
30+
31+
cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc");
32+
if (cpc_node) {
33+
err = of_address_to_resource(cpc_node, 0, &res);
34+
if (!err)
35+
return res.start;
36+
}
37+
2538
return 0;
2639
}
2740

0 commit comments

Comments
 (0)