7 #include <soc/symbols.h>
17 #define GET_NTH_BYTE(d, n) ((d >> (8 * n)) & 0xff)
133 u32 drop = total - skip - len;
134 u32 done, read_len, copy_len;
138 if (
CONFIG(SOC_MEDIATEK_MT8173)) {
145 if (
CONFIG(FLASH_DUAL_READ)) {
151 for (done = 0; done < total; dest += copy_len) {
152 read_len =
MIN(dma_buf_len, total - done);
161 copy_len = read_len - skip;
190 int sector_start =
offset;
220 flash->
size = CONFIG_ROM_SIZE;
static void write8(void *addr, uint8_t val)
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
static uint8_t read8(const void *addr)
void * memcpy(void *dest, const void *src, size_t n)
#define assert(statement)
#define printk(level,...)
int dma_coherent(void *ptr)
const struct spi_flash_ops spi_flash_ops
static int nor_write(const struct spi_flash *flash, u32 addr, size_t len, const void *buf)
static struct mtk_nor_regs *const mtk_nor
static int sector_erase(int offset)
static int nor_erase(const struct spi_flash *flash, u32 offset, size_t len)
static int sflashhw_read_flash_status(u8 *value)
static int mtk_nor_execute_cmd(u8 cmdval)
static int wait_for_write_done(void)
static int nor_read(const struct spi_flash *flash, u32 addr, size_t len, void *buf)
static void set_sfpaddr(u32 addr)
int mtk_spi_flash_probe(const struct spi_slave *spi, struct spi_flash *flash)
static int dma_read(u32 addr, uintptr_t dma_buf, u32 len)
static int polling_cmd(u32 val)
#define GET_NTH_BYTE(d, n)
@ SFLASH_WRITE_IN_PROGRESS
#define setbits8(addr, set)
#define REGION_SIZE(name)
static int stopwatch_expired(struct stopwatch *sw)
static void stopwatch_init_usecs_expire(struct stopwatch *sw, long us)
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
u8 buffer[C2P_BUFFER_MAXSIZE]
#define ENV_SEPARATE_VERSTAGE
int(* read)(const struct spi_flash *flash, u32 offset, size_t len, void *buf)
const struct spi_flash_ops * ops