diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2018-03-22 19:39:39 +0100 |
---|---|---|
committer | Daniel Schwierzeck <daniel.schwierzeck@gmail.com> | 2018-06-01 15:56:02 +0200 |
commit | c444afbbefa103d567f197393d39ec0fcca21a0c (patch) | |
tree | 8e927b47c6b65740e32585549c6c166dfd6c93a2 /drivers/cpu | |
parent | 13a7bfe4904c15f5a33cadcbd3823887d445ad75 (diff) |
cpu: bmips: convert to use live dt
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Diffstat (limited to 'drivers/cpu')
-rw-r--r-- | drivers/cpu/bmips_cpu.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/cpu/bmips_cpu.c b/drivers/cpu/bmips_cpu.c index 7ed4bc7cec..f5bacd2b18 100644 --- a/drivers/cpu/bmips_cpu.c +++ b/drivers/cpu/bmips_cpu.c @@ -13,8 +13,6 @@ #include <errno.h> #include <asm/io.h> -DECLARE_GLOBAL_DATA_PTR; - #define REV_CHIPID_SHIFT 16 #define REV_CHIPID_MASK (0xffff << REV_CHIPID_SHIFT) #define REV_LONG_CHIPID_SHIFT 12 @@ -397,8 +395,7 @@ int bmips_cpu_bind(struct udevice *dev) { struct cpu_platdata *plat = dev_get_parent_platdata(dev); - plat->cpu_id = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), - "reg", -1); + plat->cpu_id = dev_read_u32_default(dev, "reg", -1); plat->device_id = read_c0_prid(); return 0; @@ -409,14 +406,11 @@ int bmips_cpu_probe(struct udevice *dev) struct bmips_cpu_priv *priv = dev_get_priv(dev); const struct bmips_cpu_hw *hw = (const struct bmips_cpu_hw *)dev_get_driver_data(dev); - fdt_addr_t addr; - fdt_size_t size; - addr = devfdt_get_addr_size_index(dev_get_parent(dev), 0, &size); - if (addr == FDT_ADDR_T_NONE) + priv->regs = dev_remap_addr(dev); + if (!priv->regs) return -EINVAL; - priv->regs = ioremap(addr, size); priv->hw = hw; return 0; |