*/
#include <common.h>
-#include <asm/io.h>
+#include <clk.h>
+#include <dm.h>
+#include <dm/device_compat.h>
#include <malloc.h>
#include <spi.h>
#include <spi-mem.h>
-#include <dm.h>
-#include <clk.h>
+#include <asm/io.h>
+#include <linux/bitops.h>
#include <linux/kernel.h>
#include <linux/sizes.h>
#include <linux/iopoll.h>
#include <linux/bug.h>
+#include <linux/err.h>
/*
* The driver only uses one single LUT entry, that is updated on
return true;
}
-/* Instead of busy looping invoke readl_poll_timeout functionality. */
+/* Instead of busy looping invoke readl_poll_sleep_timeout functionality. */
static int fspi_readl_poll_tout(struct nxp_fspi *f, void __iomem *base,
u32 mask, u32 delay_us,
u32 timeout_us, bool c)
mask = (u32)cpu_to_be32(mask);
if (c)
- return readl_poll_timeout(base, reg, (reg & mask),
- timeout_us);
+ return readl_poll_sleep_timeout(base, reg, (reg & mask),
+ delay_us, timeout_us);
else
- return readl_poll_timeout(base, reg, !(reg & mask),
- timeout_us);
+ return readl_poll_sleep_timeout(base, reg, !(reg & mask),
+ delay_us, timeout_us);
}
/*
fspi_writel(f, FSPI_LCKER_LOCK, f->iobase + FSPI_LCKCR);
}
-#if CONFIG_IS_ENABLED(CONFIG_CLK)
+#if CONFIG_IS_ENABLED(CLK)
static int nxp_fspi_clk_prep_enable(struct nxp_fspi *f)
{
int ret;
int ret, i;
u32 reg;
-#if CONFIG_IS_ENABLED(CONFIG_CLK)
+#if CONFIG_IS_ENABLED(CLK)
/* disable and unprepare clock to avoid glitch pass to controller */
nxp_fspi_clk_disable_unprep(f);
{
struct nxp_fspi *f;
struct udevice *bus;
- struct dm_spi_slave_platdata *slave_plat = dev_get_parent_platdata(dev);
+ struct dm_spi_slave_platdata *slave_plat = dev_get_parent_plat(dev);
bus = dev->parent;
f = dev_get_priv(bus);
static int nxp_fspi_set_speed(struct udevice *bus, uint speed)
{
-#if CONFIG_IS_ENABLED(CONFIG_CLK)
+#if CONFIG_IS_ENABLED(CLK)
struct nxp_fspi *f = dev_get_priv(bus);
int ret;
static int nxp_fspi_ofdata_to_platdata(struct udevice *bus)
{
struct nxp_fspi *f = dev_get_priv(bus);
-#if CONFIG_IS_ENABLED(CONFIG_CLK)
+#if CONFIG_IS_ENABLED(CLK)
int ret;
#endif
f->ahb_addr = map_physmem(ahb_addr, ahb_size, MAP_NOCACHE);
f->memmap_phy_size = ahb_size;
-#if CONFIG_IS_ENABLED(CONFIG_CLK)
+#if CONFIG_IS_ENABLED(CLK)
ret = clk_get_by_name(bus, "fspi_en", &f->clk_en);
if (ret) {
dev_err(bus, "failed to get fspi_en clock\n");
.of_match = nxp_fspi_ids,
.ops = &nxp_fspi_ops,
.ofdata_to_platdata = nxp_fspi_ofdata_to_platdata,
- .priv_auto_alloc_size = sizeof(struct nxp_fspi),
+ .priv_auto = sizeof(struct nxp_fspi),
.probe = nxp_fspi_probe,
};