10 #include <soc/iomap.h>
11 #include <soc/pci_devs.h>
16 #if CONFIG(STORAGE_LOG)
25 #define STORAGE_DEBUG BIOS_DEBUG
26 #define LOG_DEBUG (CONFIG(STORAGE_LOG) ? STORAGE_DEBUG : BIOS_NEVER)
28 #ifdef __SIMPLE_DEVICE__
61 #ifdef __SIMPLE_DEVICE__
84 start = log_full ? log_index : 0;
85 for (index = start; (log_full || (index != end)); index++) {
87 delta = log[index].time.microseconds - log_start_time;
89 delta / 1000, delta % 1000,
91 log[index].cmd.cmdarg,
92 log[index].cmd_issued ?
"" :
"(not issued)");
98 ", rsp: 0x%08x.%08x.%08x.%08x",
110 if (
CONFIG(STORAGE_LOG)) {
112 log[log_index].cmd = *
cmd;
113 log[log_index].cmd_issued = 0;
114 log[log_index].response_entries = 0;
115 if ((log_index == 0) && (!log_full))
116 log_start_time = log[0].time.microseconds;
122 if (
CONFIG(STORAGE_LOG)) {
123 log[log_index].cmd_issued = 1;
131 if (
CONFIG(STORAGE_LOG)) {
132 log[log_index].response_entries = entries;
133 for (entry = 0; entry < entries; entry++)
140 if (
CONFIG(STORAGE_LOG)) {
141 log[log_index].ret =
ret;
142 if (++log_index == 0)
154 unsigned int partition;
155 unsigned int previous_partition;
171 if (!full_initialization) {
178 if (
CONFIG(STORAGE_LOG)) {
214 name[0] ?
": " :
"");
229 static void copy_storage_structures(
int is_recovery)
void * memcpy(void *dest, const void *src, size_t n)
void timer_monotonic_get(struct mono_time *mt)
void * cbmem_add(u32 id, u64 size)
void * cbmem_find(u32 id)
#define ROMSTAGE_CBMEM_INIT_HOOK(init_fn_)
#define CBMEM_ID_STORAGE_DATA
#define printk(level,...)
int sdhci_controller_init(struct sdhci_ctrlr *sdhci_ctrlr, void *ioaddr)
void sdhci_update_pointers(struct sdhci_ctrlr *sdhci_ctrlr)
void sdhci_display_setup(struct sdhci_ctrlr *sdhci_ctrlr)
const char * storage_partition_name(struct storage_media *media, unsigned int partition_number)
int storage_set_partition(struct storage_media *media, unsigned int partition_number)
int storage_setup_media(struct storage_media *media, struct sd_mmc_ctrlr *ctrlr)
unsigned int storage_get_current_partition(struct storage_media *media)
void storage_display_setup(struct storage_media *media)
uint64_t storage_block_read(struct storage_media *media, uint64_t start, uint64_t count, void *buffer)
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline u16 pci_read_config16(const struct device *dev, u16 reg)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static __always_inline void pci_write_config16(const struct device *dev, u16 reg, u16 val)
void hexdump(const void *memory, size_t length)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define PCI_BASE_ADDRESS_MEM_ATTR_MASK
#define PCI_COMMAND_MEMORY
#define PCI_BASE_ADDRESS_0
u8 buffer[C2P_BUFFER_MAXSIZE]
unsigned long long uint64_t
static uint8_t drivers_storage[256]
void sdhc_log_command(struct mmc_command *cmd)
static void display_log(void)
void storage_test(uint32_t bar, int full_initialization)
void sdhc_log_command_issued(void)
void storage_test_complete(struct device *dev, uint32_t previous_bar, uint16_t previous_command)
uint32_t storage_test_init(struct device *dev, uint32_t *previous_bar, uint16_t *previous_command)
void sdhc_log_response(uint32_t entries, uint32_t *response)
void sdhc_log_ret(int ret)
uint32_t response_entries
struct sd_mmc_ctrlr sd_mmc_ctrlr