This is the readme for the Das U-Boot standalone program rkspi
1.Define the standalone load address in includes/configs/rkxxxxx_common.h
#define CONFIG_STANDALONE_LOAD_ADDR 0x40000000
2.Enable rkspi in defconfig
CONFIG_ROCKCHIP_SPI=y
1.Setting the iomux and spiclk through:
Note:
setenv ipaddr 172.16.12.157
setenv serverip 172.16.12.167
tftp 0x40000000 rkspi.bin # 0x40000000 is define by CONFIG_STANDALONE_LOAD_ADDR
go 0x40000000 # 0x40000000 is define by CONFIG_STANDALONE_LOAD_ADDR
int rockchip_spi_probe(u8 bus, uintptr_t base_addr, u32 rsd, u32 clock_div, u32 mode);
#define SPI_CPHA BIT(0) /* clock phase */
#define SPI_CPOL BIT(1) /* clock polarity */
#define SPI_MODE_0 (0 | 0) /* (original MicroWire) */
#define SPI_MODE_1 (0 | SPI_CPHA)
#define SPI_MODE_2 (SPI_CPOL | 0)
#define SPI_MODE_3 (SPI_CPOL | SPI_CPHA)
int rockchip_spi_claim_bus(u8 bus);
void rockchip_spi_release_bus(u8 bus);
int rockchip_spi_xfer(u8 bus, u8 cs, unsigned int bitlen, const void *dout, void *din, unsigned long flags);
#define SPI_XFER_BEGIN BIT(0) /* Assert CS before transfer */
#define SPI_XFER_END BIT(1) /* Deassert CS after transfer */
#define SPI_XFER_ONCE (SPI_XFER_BEGIN | SPI_XFER_END)
int rockchip_spi_write_then_read(u8 bus, u8 cs,
const u8 *opcode, size_t n_opcode,
const u8 *txbuf, u8 *rxbuf, size_t n_buf);
Is right in the main function of rkspi.