static int ti_qspi_ofdata_to_platdata(struct udevice *bus) { struct ti_qspi_priv *priv = dev_get_priv(bus); const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); fdt_addr_t mmap_addr; fdt_addr_t mmap_size; priv->ctrl_mod_mmap = map_syscon_chipselects(bus); priv->base = map_physmem(devfdt_get_addr(bus), sizeof(struct ti_qspi_regs), MAP_NOCACHE); mmap_addr = devfdt_get_addr_size_index(bus, 1, &mmap_size); priv->memory_map = map_physmem(mmap_addr, mmap_size, MAP_NOCACHE); priv->mmap_size = mmap_size; priv->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", -1); if (priv->max_hz < 0) { debug("Error: Max frequency missing\n"); return -ENODEV; } priv->num_cs = fdtdec_get_int(blob, node, "num-cs", 4); debug("%s: regs=<0x%x>, max-frequency=%d\n", __func__, (int)priv->base, priv->max_hz); return 0; }
static int pipe3_phy_probe(struct udevice *dev) { fdt_addr_t addr; fdt_size_t sz; struct omap_pipe3 *pipe3 = dev_get_priv(dev); addr = devfdt_get_addr_size_index(dev, 2, &sz); if (addr == FDT_ADDR_T_NONE) { pr_err("missing pll ctrl address\n"); return -EINVAL; } pipe3->pll_ctrl_base = map_physmem(addr, sz, MAP_NOCACHE); if (!pipe3->pll_ctrl_base) { pr_err("unable to remap pll ctrl\n"); return -EINVAL; } pipe3->power_reg = get_reg(dev, "syscon-phy-power"); if (!pipe3->power_reg) return -EINVAL; pipe3->pll_reset_reg = get_reg(dev, "syscon-pllreset"); if (!pipe3->pll_reset_reg) return -EINVAL; pipe3->dpll_map = (struct pipe3_dpll_map *)dev_get_driver_data(dev); return 0; }
static int bcm6345_wdt_probe(struct udevice *dev) { struct bcm6345_wdt_priv *priv = dev_get_priv(dev); fdt_addr_t addr; fdt_size_t size; addr = devfdt_get_addr_size_index(dev, 0, &size); if (addr == FDT_ADDR_T_NONE) return -EINVAL; priv->regs = ioremap(addr, size); bcm6345_wdt_stop(dev); return 0; }