diff mbox series

[U-Boot] cpu: bmips: fix probe to get the address

Message ID 1529686325-26938-1-git-send-email-philippe.reynes@softathome.com
State Accepted
Commit cef1f0c7a41226cdefec41b01868f2b4702d487c
Delegated to: Daniel Schwierzeck
Headers show
Series [U-Boot] cpu: bmips: fix probe to get the address | expand

Commit Message

Philippe REYNES June 22, 2018, 4:52 p.m. UTC
In the device tree, the address for cpu is located in
the node "cpus", not in the cpu node (for exemple cpu@0).
So when probing cpu, the cpu address must be read in the
cpu parent.

The commit "cpu: bmips: convert to use live dt"
(sha1: c444afbbefa103d567f197393d39ec0fcca21a0c)
change this behaviour and read the address in the
cpu node when probing cpu.

We fix this by reading the address in the cpu parent.

Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
---
 drivers/cpu/bmips_cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Schwierzeck June 29, 2018, 3:32 p.m. UTC | #1
On 22.06.2018 18:52, Philippe Reynes wrote:
> In the device tree, the address for cpu is located in
> the node "cpus", not in the cpu node (for exemple cpu@0).
> So when probing cpu, the cpu address must be read in the
> cpu parent.
> 
> The commit "cpu: bmips: convert to use live dt"
> (sha1: c444afbbefa103d567f197393d39ec0fcca21a0c)
> change this behaviour and read the address in the
> cpu node when probing cpu.
> 
> We fix this by reading the address in the cpu parent.
> 
> Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
> ---
>  drivers/cpu/bmips_cpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

applied to u-boot-mips, thanks.
diff mbox series

Patch

diff --git a/drivers/cpu/bmips_cpu.c b/drivers/cpu/bmips_cpu.c
index f5bacd2..78560b0 100644
--- a/drivers/cpu/bmips_cpu.c
+++ b/drivers/cpu/bmips_cpu.c
@@ -407,7 +407,7 @@  int bmips_cpu_probe(struct udevice *dev)
 	const struct bmips_cpu_hw *hw =
 		(const struct bmips_cpu_hw *)dev_get_driver_data(dev);
 
-	priv->regs = dev_remap_addr(dev);
+	priv->regs = dev_remap_addr(dev_get_parent(dev));
 	if (!priv->regs)
 		return -EINVAL;