PoC: Integrate spi and flash code

This commit is contained in:
Mikael Ågren 2025-02-03 17:46:25 +01:00
parent 12c23cc149
commit cbc7adf706
No known key found for this signature in database
GPG key ID: E02DA3D397792C46
6 changed files with 11 additions and 12 deletions

View file

@ -2,11 +2,9 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "spi.h"
#include "../tk1/types.h"
#include "../tk1_mem.h"
#include <stddef.h>
#include <stdint.h>
// clang-format off
static volatile uint32_t *spi_en = (volatile uint32_t *)(TK1_MMIO_TK1_BASE | 0x200);
static volatile uint32_t *spi_xfer = (volatile uint32_t *)(TK1_MMIO_TK1_BASE | 0x204);
@ -64,7 +62,6 @@ static void _spi_read(uint8_t *buf, size_t size)
}
}
// Function to both read and write data to the connected SPI flash.
int spi_transfer(uint8_t *cmd, size_t cmd_size, uint8_t *tx_buf, size_t tx_size,
uint8_t *rx_buf, size_t rx_size)