Add beginnings of a SPI flash driver

This commit is contained in:
jaseg 2020-02-25 18:05:14 +01:00
parent 031380141d
commit 2964bda23c
4 changed files with 245 additions and 37 deletions

23
controller/fw/spi_flash.h Normal file
View file

@ -0,0 +1,23 @@
#ifndef __SPI_FLASH_H__
#define __SPI_FLASH_H__
#include <stdbool.h>
#include <stdint.h>
struct spi_mem_id {
size_t size;
uint8_t mfg_id;
uint8_t type;
};
struct spi_flash_if {
struct spi_mem_id id;
uint32_t spi_base;
void (*cs)(bool val);
};
int spif_init(struct spi_mem_id *mem_data);
void spif_deep_power_down(struct spi_flash_if *spif);
void spif_wakeup(struct spi_flash_if *spif);
#endif /* __SPI_FLASH_H__ */