TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
|
#include "reg.h"
#include "status_reg.h"
#include "util.h"
#include <stdbool.h>
#include <string.h>
#include <tenstorrent/smc_msg.h>
#include <tenstorrent/msgqueue.h>
#include <tenstorrent/sys_init_defines.h>
#include <tenstorrent/tt_boot_fs.h>
#include <zephyr/drivers/mspi.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/logging/log.h>
#include <zephyr/init.h>
#include <zephyr/kernel.h>
Macros | |
#define | SPI_PAGE_SIZE 256 |
#define | SECTOR_SIZE 4096 |
#define | SPI_BUFFER_SIZE 4096 |
#define | BYTE_GET(v, b) |
#define | SSI_RX_DLY_SR_DEPTH 64 |
#define | SPI_RX_SAMPLE_DELAY_TRAIN_ADDR 0x13FFC |
#define | SPI_RX_SAMPLE_DELAY_TRAIN_DATA 0xA5A55A5A |
Functions | |
LOG_MODULE_REGISTER (spi_eeprom, CONFIG_TT_APP_LOG_LEVEL) | |
static void | EepromSetup (void) |
static int | SpiBlockRead (uint32_t spi_address, uint32_t num_bytes, uint8_t *dest) |
static int | SpiSmartWrite (uint32_t address, const uint8_t *data, uint32_t num_bytes) |
static bool | check_csm_region (uint32_t addr, uint32_t num_bytes) |
static uint8_t | read_eeprom_handler (const union request *request, struct response *response) |
static uint8_t | write_eeprom_handler (const union request *request, struct response *response) |
REGISTER_MESSAGE (TT_SMC_MSG_READ_EEPROM, read_eeprom_handler) | |
REGISTER_MESSAGE (TT_SMC_MSG_WRITE_EEPROM, write_eeprom_handler) | |
static int | InitSpiFS (void) |
SYS_INIT_APP (InitSpiFS) |
Variables | |
static uint8_t | spi_page_buf [4096] |
static uint8_t | spi_global_buffer [4096] |
static struct flash_pages_info | page_info |
static const struct device * | flash = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(spi_flash)) |
#define BYTE_GET | ( | v, | |
b ) |
#define SECTOR_SIZE 4096 |
#define SPI_BUFFER_SIZE 4096 |
#define SPI_PAGE_SIZE 256 |
#define SPI_RX_SAMPLE_DELAY_TRAIN_ADDR 0x13FFC |
#define SPI_RX_SAMPLE_DELAY_TRAIN_DATA 0xA5A55A5A |
#define SSI_RX_DLY_SR_DEPTH 64 |
|
static |
|
static |
LOG_MODULE_REGISTER | ( | spi_eeprom | , |
CONFIG_TT_APP_LOG_LEVEL | ) |
REGISTER_MESSAGE | ( | TT_SMC_MSG_READ_EEPROM | , |
read_eeprom_handler | ) |
REGISTER_MESSAGE | ( | TT_SMC_MSG_WRITE_EEPROM | , |
write_eeprom_handler | ) |
SYS_INIT_APP | ( | InitSpiFS | ) |
|
static |
|
static |
|
static |
|
static |