![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <stddef.h>
Go to the source code of this file.
Data Structures | |
struct | spi_sdcard |
Functions | |
int | spi_sdcard_init (struct spi_sdcard *card, const unsigned int bus, const unsigned int cs) |
int | spi_sdcard_single_read (const struct spi_sdcard *card, size_t block_address, void *buff) |
int | spi_sdcard_multiple_read (const struct spi_sdcard *card, size_t start_block_address, size_t end_block_address, void *buff) |
int | spi_sdcard_single_write (const struct spi_sdcard *card, size_t block_address, void *buff) |
int | spi_sdcard_read (const struct spi_sdcard *card, void *dest, size_t offset, size_t count) |
int | spi_sdcard_multiple_write (const struct spi_sdcard *card, size_t start_block_address, size_t end_block_address, void *buff) |
int | spi_sdcard_erase (const struct spi_sdcard *card, size_t start_block_address, size_t end_block_address) |
int | spi_sdcard_erase_all (const struct spi_sdcard *card) |
size_t | spi_sdcard_size (const struct spi_sdcard *card) |
int spi_sdcard_erase | ( | const struct spi_sdcard * | card, |
size_t | start_block_address, | ||
size_t | end_block_address | ||
) |
Definition at line 772 of file spi_sdcard.c.
References card, ERASE, ERASE_WR_BLK_END_ADDR, ERASE_WR_BLK_START_ADDR, NULL, SDCARD_TYPE_SDSC, spi_sdcard_do_command(), and spi_sdcard::type.
Referenced by spi_sdcard_erase_all().
int spi_sdcard_erase_all | ( | const struct spi_sdcard * | card | ) |
Definition at line 798 of file spi_sdcard.c.
References BLOCK_SIZE, card, spi_sdcard_erase(), and spi_sdcard_size().
int spi_sdcard_init | ( | struct spi_sdcard * | card, |
const unsigned int | bus, | ||
const unsigned int | cs | ||
) |
Definition at line 421 of file spi_sdcard.c.
References card, GO_IDLE_STATE, NULL, READ_OCR, RSP_ERR_ILLEGAL_COMMAND, RSP_ERR_IN_IDLE, SD_SEND_OP_COND, SDCARD_TYPE_SDHC, SDCARD_TYPE_SDSC, SDCARD_TYPE_SDXC, SEND_IF_COND, SEND_OP_COND, SET_BLOCKLEN, spi_sdcard::slave, spi_sdcard_disable_cs(), spi_sdcard_do_app_command(), spi_sdcard_do_command(), spi_sdcard_sendbyte(), spi_sdcard_size(), spi_setup_slave(), spi_sdcard::type, and wait().
Referenced by boot_device_init().
int spi_sdcard_multiple_read | ( | const struct spi_sdcard * | card, |
size_t | start_block_address, | ||
size_t | end_block_address, | ||
void * | buff | ||
) |
Definition at line 544 of file spi_sdcard.c.
References c, card, crc16_byte(), CT_BLOCK_START, NULL, READ_MULTIPLEBLOCK, SDCARD_TYPE_SDSC, SEND_STATUS, spi_sdcard_disable_cs(), spi_sdcard_do_command(), spi_sdcard_enable_cs(), spi_sdcard_recvbyte(), STOP_TRANSMISSION, spi_sdcard::type, and wait().
Referenced by spi_sdcard_read().
int spi_sdcard_multiple_write | ( | const struct spi_sdcard * | card, |
size_t | start_block_address, | ||
size_t | end_block_address, | ||
void * | buff | ||
) |
Definition at line 707 of file spi_sdcard.c.
References c, card, crc16_byte(), CT_MULTIPLE_BLOCK_START, CT_MULTIPLE_BLOCK_STOP, CT_RESPONSE_ACCEPTED, CT_RESPONSE_MASK, NULL, SDCARD_TYPE_SDSC, SEND_STATUS, spi_sdcard_disable_cs(), spi_sdcard_do_command(), spi_sdcard_enable_cs(), spi_sdcard_recvbyte(), spi_sdcard_sendbyte(), STOP_TRANSMISSION, spi_sdcard::type, wait(), and WRITE_MULTIPLEBLOCK.
int spi_sdcard_read | ( | const struct spi_sdcard * | card, |
void * | dest, | ||
size_t | offset, | ||
size_t | count | ||
) |
Definition at line 603 of file spi_sdcard.c.
References BLOCK_SIZE, card, count, memcpy(), offset, spi_sdcard_multiple_read(), and spi_sdcard_single_read().
int spi_sdcard_single_read | ( | const struct spi_sdcard * | card, |
size_t | block_address, | ||
void * | buff | ||
) |
Definition at line 496 of file spi_sdcard.c.
References c, card, crc16_byte(), CT_BLOCK_START, NULL, READ_SINGLE_BLOCK, SDCARD_TYPE_SDSC, spi_sdcard_disable_cs(), spi_sdcard_do_command(), spi_sdcard_enable_cs(), spi_sdcard_recvbyte(), spi_sdcard::type, and wait().
Referenced by spi_sdcard_read().
int spi_sdcard_single_write | ( | const struct spi_sdcard * | card, |
size_t | block_address, | ||
void * | buff | ||
) |
Definition at line 658 of file spi_sdcard.c.
References c, card, crc16_byte(), CT_BLOCK_START, CT_RESPONSE_ACCEPTED, CT_RESPONSE_MASK, NULL, SDCARD_TYPE_SDSC, spi_sdcard_disable_cs(), spi_sdcard_do_command(), spi_sdcard_enable_cs(), spi_sdcard_recvbyte(), spi_sdcard_sendbyte(), spi_sdcard::type, wait(), and WRITE_BLOCK.
size_t spi_sdcard_size | ( | const struct spi_sdcard * | card | ) |
Definition at line 363 of file spi_sdcard.c.
References c, card, crc16_byte(), CT_BLOCK_START, extract_bits(), NULL, SEND_CSD, spi_sdcard_disable_cs(), spi_sdcard_do_command(), spi_sdcard_enable_cs(), spi_sdcard_recvbyte(), and wait().
Referenced by spi_sdcard_erase_all(), and spi_sdcard_init().