X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=drivers%2Fspi%2Ffsl_dspi.c;h=42086197d9891b15e21b10eacc3efb988ffccc4f;hb=9b643e312d528f291966c1f30b0d90bf3b1d43dc;hp=792853192ed78fc661b467d2f5c21405f97bdd47;hpb=b1d9e46a0b89054e1a702e757612f87a907bf7a9;p=oweals%2Fu-boot.git diff --git a/drivers/spi/fsl_dspi.c b/drivers/spi/fsl_dspi.c index 792853192e..42086197d9 100644 --- a/drivers/spi/fsl_dspi.c +++ b/drivers/spi/fsl_dspi.c @@ -9,6 +9,8 @@ * * SPDX-License-Identifier: GPL-2.0+ */ + +#include #include #include #include @@ -24,7 +26,7 @@ DECLARE_GLOBAL_DATA_PTR; /* fsl_dspi_platdata flags */ -#define DSPI_FLAG_REGMAP_ENDIAN_BIG (1 << 0) +#define DSPI_FLAG_REGMAP_ENDIAN_BIG BIT(0) /* idle data value */ #define DSPI_IDLE_VAL 0x0 @@ -594,7 +596,7 @@ static int fsl_dspi_claim_bus(struct udevice *dev) priv = dev_get_priv(bus); - /* processor special prepartion work */ + /* processor special preparation work */ cpu_dspi_claim_bus(bus->seq, slave_plat->cs); /* configure transfer mode */ @@ -646,7 +648,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus) fdt_addr_t addr; struct fsl_dspi_platdata *plat = bus->platdata; const void *blob = gd->fdt_blob; - int node = bus->of_offset; + int node = dev_of_offset(bus); if (fdtdec_get_bool(blob, node, "big-endian")) plat->flags |= DSPI_FLAG_REGMAP_ENDIAN_BIG; @@ -654,7 +656,7 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus) plat->num_chipselect = fdtdec_get_int(blob, node, "num-cs", FSL_DSPI_MAX_CHIPSELECT); - addr = fdtdec_get_addr(blob, node, "reg"); + addr = devfdt_get_addr(bus); if (addr == FDT_ADDR_T_NONE) { debug("DSPI: Can't get base address or size\n"); return -ENOMEM; @@ -664,8 +666,8 @@ static int fsl_dspi_ofdata_to_platdata(struct udevice *bus) plat->speed_hz = fdtdec_get_int(blob, node, "spi-max-frequency", FSL_DSPI_DEFAULT_SCK_FREQ); - debug("DSPI: regs=0x%llx, max-frequency=%d, endianess=%s, num-cs=%d\n", - (u64)plat->regs_addr, plat->speed_hz, + debug("DSPI: regs=%pa, max-frequency=%d, endianess=%s, num-cs=%d\n", + &plat->regs_addr, plat->speed_hz, plat->flags & DSPI_FLAG_REGMAP_ENDIAN_BIG ? "be" : "le", plat->num_chipselect);