Source code for the Trusted Boot Module.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tbm-mcu/include/spi_flash.h

22 lines
657 B

#pragma once
#define SPI_FLASH_UNIQ_ID 0x4b
#define SPI_FLASH_MFR_DEV_ID 0x90
#define SPI_FLASH_JEDEC_ID 0x9f
#define SPI_FLASH_READ_SR1 0x05
#define SPI_FLASH_SR1_BUSY BIT(0)
#define SPI_FLASH_READ 0x03
#define SPI_FLASH_PAGE_PROGRAM 0x02
#define SPI_FLASH_WRITE_ENABLE 0x06
#define SPI_FLASH_WRITE_DISABLE 0x04
#define SPI_FLASH_ERASE_4K 0x20
#define SPI_FLASH_ERASE_32K 0x52
#define SPI_FLASH_ERASE_64K 0xd8
#define SPI_FLASH_ERASE_CHIP 0xc7
#define SPI_FLASH_SIZE(x) (1 << (x))