mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-10-01 17:10:42 +09:00
serial: uniphier: use devm_get_addr() to get base address
Currently, fdtdec_get_addr_size() does not support the address translation, so it cannot handle device trees with non-straight "ranges" properties. (This would be a problem with DTS for UniPhier ARMv8 SoCs.) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
61a4f5bd61
commit
b37a1ccea2
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/serial_reg.h>
|
#include <linux/serial_reg.h>
|
||||||
|
#include <linux/sizes.h>
|
||||||
#include <asm/errno.h>
|
#include <asm/errno.h>
|
||||||
#include <dm/device.h>
|
#include <dm/device.h>
|
||||||
#include <mapmem.h>
|
#include <mapmem.h>
|
||||||
@ -91,12 +92,13 @@ static int uniphier_serial_probe(struct udevice *dev)
|
|||||||
struct uniphier_serial_private_data *priv = dev_get_priv(dev);
|
struct uniphier_serial_private_data *priv = dev_get_priv(dev);
|
||||||
struct uniphier_serial __iomem *port;
|
struct uniphier_serial __iomem *port;
|
||||||
fdt_addr_t base;
|
fdt_addr_t base;
|
||||||
fdt_size_t size;
|
|
||||||
u32 tmp;
|
u32 tmp;
|
||||||
|
|
||||||
base = fdtdec_get_addr_size(gd->fdt_blob, dev->of_offset, "reg", &size);
|
base = dev_get_addr(dev);
|
||||||
|
if (base == FDT_ADDR_T_NONE)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
port = map_sysmem(base, size);
|
port = map_sysmem(base, SZ_64);
|
||||||
if (!port)
|
if (!port)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user