mirror of
https://github.com/smaeul/u-boot.git
synced 2025-10-17 22:28:17 +01:00
rockchip: ns16550: dm: convert fdt_get to dev_read
With the new dev_read functions available, we can convert the rockchip architecture-specific drivers and common drivers used by these devices over to the dev_read family of calls. This covers the serial driver (ns16550 and compatible) used for the Rockchip devices. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
7ad326a905
commit
3d40479f00
@ -434,10 +434,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
|
|||||||
plat->base = (unsigned long)map_physmem(addr, 0, MAP_NOCACHE);
|
plat->base = (unsigned long)map_physmem(addr, 0, MAP_NOCACHE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
plat->reg_offset = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
|
plat->reg_offset = dev_read_u32_default(dev, "reg-offset", 0);
|
||||||
"reg-offset", 0);
|
plat->reg_shift = dev_read_u32_default(dev, "reg-shift", 0);
|
||||||
plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
|
|
||||||
"reg-shift", 0);
|
|
||||||
|
|
||||||
err = clk_get_by_index(dev, 0, &clk);
|
err = clk_get_by_index(dev, 0, &clk);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
@ -450,8 +448,7 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!plat->clock)
|
if (!plat->clock)
|
||||||
plat->clock = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev),
|
plat->clock = dev_read_u32_default(dev, "clock-frequency",
|
||||||
"clock-frequency",
|
|
||||||
CONFIG_SYS_NS16550_CLK);
|
CONFIG_SYS_NS16550_CLK);
|
||||||
if (!plat->clock) {
|
if (!plat->clock) {
|
||||||
debug("ns16550 clock not defined\n");
|
debug("ns16550 clock not defined\n");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user