summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/filetype.h1
-rw-r--r--include/linux/clk.h5
-rw-r--r--include/linux/mdio.h1
-rw-r--r--include/mach/imx/bbu.h13
-rw-r--r--include/mach/imx/imx-header.h118
-rw-r--r--include/mach/imx/xload.h8
-rw-r--r--include/of.h1
-rw-r--r--include/spi/flash.h31
8 files changed, 143 insertions, 35 deletions
diff --git a/include/filetype.h b/include/filetype.h
index 1a7d145555..783418c652 100644
--- a/include/filetype.h
+++ b/include/filetype.h
@@ -59,6 +59,7 @@ enum filetype {
filetype_rockchip_rkns_image,
filetype_fip,
filetype_qemu_fw_cfg,
+ filetype_nxp_fspi_image,
filetype_max,
};
diff --git a/include/linux/clk.h b/include/linux/clk.h
index bffed2bdcf..29c697a00b 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -686,7 +686,7 @@ struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
unsigned int of_clk_get_parent_count(struct device_node *np);
int of_clk_parent_fill(struct device_node *np, const char **parents,
unsigned int size);
-int of_clk_init(struct device_node *root, const struct of_device_id *matches);
+int of_clk_init(void);
int of_clk_add_provider(struct device_node *np,
struct clk *(*clk_src_get)(struct of_phandle_args *args,
void *data),
@@ -742,8 +742,7 @@ static inline unsigned int of_clk_get_parent_count(struct device_node *np)
{
return 0;
}
-static inline int of_clk_init(struct device_node *root,
- const struct of_device_id *matches)
+static inline int of_clk_init(void)
{
return 0;
}
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index a4aee49d8d..c441a074ec 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -13,6 +13,7 @@
#include <linux/types.h>
#include <linux/mii.h>
+#include <init.h>
/* MDIO Manageable Devices (MMDs). */
#define MDIO_MMD_PMAPMD 1 /* Physical Medium Attachment/
diff --git a/include/mach/imx/bbu.h b/include/mach/imx/bbu.h
index c9b239c698..451ae15740 100644
--- a/include/mach/imx/bbu.h
+++ b/include/mach/imx/bbu.h
@@ -26,6 +26,8 @@ struct imx_dcd_v2_entry;
*/
#define IMX_BBU_FLAG_PARTITION_STARTS_AT_HEADER (1 << 17)
+#define IMX_BBU_FLAG_ERASE BIT(30)
+
/*
* The upper 16 bit of the flags passes to the below functions are reserved
* for i.MX specific flags
@@ -84,6 +86,10 @@ int imx8m_bbu_internal_mmcboot_register_handler(const char *name, const char *de
int imx_bbu_external_nor_register_handler(const char *name, const char *devicefile,
unsigned long flags);
+int imx8m_bbu_internal_flexspi_nor_register_handler(const char *name,
+ const char *devicefile,
+ unsigned long flags);
+
#else
static inline int imx51_bbu_internal_mmc_register_handler(const char *name, const char *devicefile,
@@ -196,6 +202,13 @@ imx7_bbu_internal_spi_i2c_register_handler(const char *name, char *devicefile,
return -ENOSYS;
}
+static inline int
+imx8m_bbu_internal_flexspi_nor_register_handler(const char *name, const char *devicefile,
+ unsigned long flags);
+{
+ return -ENOSYS;
+}
+
#endif
#if defined(CONFIG_BAREBOX_UPDATE_IMX_EXTERNAL_NAND)
diff --git a/include/mach/imx/imx-header.h b/include/mach/imx/imx-header.h
index 8e968e6efb..b11b57c372 100644
--- a/include/mach/imx/imx-header.h
+++ b/include/mach/imx/imx-header.h
@@ -97,6 +97,8 @@ static inline bool is_imx_flash_header_v2(const void *blob)
struct config_data {
uint32_t image_load_addr;
uint32_t image_ivt_offset;
+ uint32_t image_flexspi_ivt_offset;
+ uint32_t image_flexspi_fcfb_offset;
uint32_t image_size;
uint32_t max_load_size;
uint32_t load_size;
@@ -149,4 +151,120 @@ enum imx_dcd_v2_check_cond {
until_any_bit_set = 3, /* until ((*address & mask) != 0) { ...} */
} __attribute__((packed));
+/* FlexSPI conifguration block FCFB */
+#define FCFB_HEAD_TAG 0x46434642 /* "FCFB" */
+#define FCFB_VERSION 0x56010000 /* V<major><minor><bugfix> = V100 */
+#define FCFB_SAMLPE_CLK_SRC_INTERNAL 0
+#define FCFB_DEVTYPE_SERIAL_NOR 1
+#define FCFB_SFLASH_PADS_SINGLE 1
+#define FCFB_SFLASH_PADS_DUAL 2
+#define FCFB_SFLASH_PADS_QUAD 4
+#define FCFB_SFLASH_PADS_OCTAL 8
+#define FCFB_SERIAL_CLK_FREQ_30MHZ 1
+#define FCFB_SERIAL_CLK_FREQ_50MHZ 2
+#define FCFB_SERIAL_CLK_FREQ_60MHZ 3
+#define FCFB_SERIAL_CLK_FREQ_75MHZ 4
+#define FCFB_SERIAL_CLK_FREQ_80MHZ 5
+#define FCFB_SERIAL_CLK_FREQ_100MHZ 6
+#define FCFB_SERIAL_CLK_FREQ_133MHZ 7
+#define FCFB_SERIAL_CLK_FREQ_166MHZ 8
+
+/* Instruction set for the LUT register. */
+#define LUT_STOP 0x00
+#define LUT_CMD 0x01
+#define LUT_ADDR 0x02
+#define LUT_CADDR_SDR 0x03
+#define LUT_MODE 0x04
+#define LUT_MODE2 0x05
+#define LUT_MODE4 0x06
+#define LUT_MODE8 0x07
+#define LUT_NXP_WRITE 0x08
+#define LUT_NXP_READ 0x09
+#define LUT_LEARN_SDR 0x0A
+#define LUT_DATSZ_SDR 0x0B
+#define LUT_DUMMY 0x0C
+#define LUT_DUMMY_RWDS_SDR 0x0D
+#define LUT_JMP_ON_CS 0x1F
+#define LUT_CMD_DDR 0x21
+#define LUT_ADDR_DDR 0x22
+#define LUT_CADDR_DDR 0x23
+#define LUT_MODE_DDR 0x24
+#define LUT_MODE2_DDR 0x25
+#define LUT_MODE4_DDR 0x26
+#define LUT_MODE8_DDR 0x27
+#define LUT_WRITE_DDR 0x28
+#define LUT_READ_DDR 0x29
+#define LUT_LEARN_DDR 0x2A
+#define LUT_DATSZ_DDR 0x2B
+#define LUT_DUMMY_DDR 0x2C
+#define LUT_DUMMY_RWDS_DDR 0x2D
+
+/*
+ * Macro for constructing the LUT entries with the following
+ * register layout:
+ *
+ * -----------------------
+ * | INSTR | PAD | OPRND |
+ * -----------------------
+ */
+#define PAD_SHIFT 8
+#define INSTR_SHIFT 10
+#define OPRND_SHIFT 16
+
+/* Macros for constructing the LUT register. */
+#define LUT_DEF(ins, pad, opr) \
+ (((ins) << INSTR_SHIFT) | ((pad) << PAD_SHIFT) | (opr))
+
+struct imx_fcfb_common {
+ uint32_t tag;
+ uint32_t version;
+ uint32_t reserved1;
+ uint8_t read_sample;
+ uint8_t datahold;
+ uint8_t datasetup;
+ uint8_t coladdrwidth;
+ uint8_t devcfgenable;
+ uint8_t reserved2[3];
+ uint32_t devmodeseq;
+ uint32_t devmodearg;
+ uint8_t cmd_enable;
+ uint8_t reserved3[3];
+ uint32_t cmd_seq[4];
+ uint32_t cmd_arg[4];
+ uint32_t controllermisc;
+ uint8_t dev_type;
+ uint8_t sflash_pad;
+ uint8_t serial_clk;
+ uint8_t lut_custom;
+ uint32_t reserved4[2];
+ uint32_t sflashA1;
+ uint32_t sflashA2;
+ uint32_t sflashB1;
+ uint32_t sflashB2;
+ uint32_t cspadover;
+ uint32_t sclkpadover;
+ uint32_t datapadover;
+ uint32_t dqspadover;
+ uint32_t timeout_ms;
+ uint32_t commandInt_ns;
+ uint32_t datavalid_ns;
+ uint16_t busyoffset;
+ uint16_t busybitpolarity;
+ struct {
+ struct {
+ uint16_t instr[8];
+ } seq[16];
+ } lut;
+ uint16_t lut_custom_seq[24];
+ uint8_t reserved5[16];
+} __attribute__((packed));
+
+struct imx_fcfb_nor {
+ struct imx_fcfb_common memcfg;
+ uint32_t page_sz;
+ uint32_t sector_sz;
+ uint32_t ipcmd_serial_clk;
+ uint8_t reserved[52];
+} __attribute__((packed));
+
#endif
diff --git a/include/mach/imx/xload.h b/include/mach/imx/xload.h
index 88757c7ebf..a52b1e8ea1 100644
--- a/include/mach/imx/xload.h
+++ b/include/mach/imx/xload.h
@@ -17,6 +17,9 @@ int imx7_nand_start_image(void);
int imx8m_esdhc_load_image(int instance, bool start);
int imx8mn_esdhc_load_image(int instance, bool start);
int imx8mp_esdhc_load_image(int instance, bool start);
+int imx8mm_qspi_load_image(int instance, bool start);
+int imx8mn_qspi_load_image(int instance, bool start);
+int imx8mp_qspi_load_image(int instance, bool start);
void imx8mm_load_bl33(void *bl33);
void imx8mn_load_bl33(void *bl33);
@@ -26,6 +29,11 @@ void __noreturn imx8mm_load_and_start_image_via_tfa(void);
void __noreturn imx8mn_load_and_start_image_via_tfa(void);
void __noreturn imx8mp_load_and_start_image_via_tfa(void);
+int imx_load_image(ptrdiff_t address, ptrdiff_t entry, u32 offset,
+ u32 ivt_offset, bool start, unsigned int alignment,
+ int (*read)(void *dest, size_t len, void *priv),
+ void *priv);
+
int imx_image_size(void);
int piggydata_size(void);
diff --git a/include/of.h b/include/of.h
index 106a570418..4b0266fd31 100644
--- a/include/of.h
+++ b/include/of.h
@@ -301,7 +301,6 @@ extern void of_platform_device_dummy_drv(struct device *dev);
extern int of_platform_populate(struct device_node *root,
const struct of_device_id *matches,
struct device *parent);
-extern struct device *of_platform_device_create_root(struct device_node *np);
extern struct device *of_find_device_by_node(struct device_node *np);
extern struct device *of_device_enable_and_register(struct device_node *np);
extern struct device *of_device_enable_and_register_by_name(const char *name);
diff --git a/include/spi/flash.h b/include/spi/flash.h
deleted file mode 100644
index 796d649d9a..0000000000
--- a/include/spi/flash.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef LINUX_SPI_FLASH_H
-#define LINUX_SPI_FLASH_H
-
-struct mtd_partition;
-
-/**
- * struct flash_platform_data: board-specific flash data
- * @name: optional flash device name (eg, as used with mtdparts=)
- * @parts: optional array of mtd_partitions for static partitioning
- * @nr_parts: number of mtd_partitions for static partitoning
- * @type: optional flash device type (e.g. m25p80 vs m25p64), for use
- * with chips that can't be queried for JEDEC or other IDs
- *
- * Board init code (in arch/.../mach-xxx/board-yyy.c files) can
- * provide information about SPI flash parts (such as DataFlash) to
- * help set up the device and its appropriate default partitioning.
- *
- * Note that for DataFlash, sizes for pages, blocks, and sectors are
- * rarely powers of two; and partitions should be sector-aligned.
- */
-struct flash_platform_data {
- char *name;
- struct mtd_partition *parts;
- unsigned int nr_parts;
- char *type;
-
- /* we'll likely add more ... use JEDEC IDs, etc */
-};
-
-#endif