Lines Matching refs:emmc
328 static int wait_for_cmd_complete(struct emmc_data *emmc, uint32_t time_out) in wait_for_cmd_complete() argument
340 events = k_event_wait(&emmc->irq_event, in wait_for_cmd_complete()
410 struct emmc_data *emmc = dev->data; in emmc_dma_init() local
421 memset(emmc->desc_table, 0, sizeof(emmc->desc_table)); in emmc_dma_init()
427 emmc->desc_table[i] = ((uint64_t)buff) << EMMC_HOST_ADMA_BUFF_ADD_LOC; in emmc_dma_init()
428 emmc->desc_table[i] |= data->block_size << EMMC_HOST_ADMA_BUFF_LEN_LOC; in emmc_dma_init()
431 emmc->desc_table[i] |= EMMC_HOST_ADMA_BUFF_LINK_LAST; in emmc_dma_init()
432 emmc->desc_table[i] |= EMMC_HOST_ADMA_INTR_EN; in emmc_dma_init()
433 emmc->desc_table[i] |= EMMC_HOST_ADMA_BUFF_LAST; in emmc_dma_init()
435 emmc->desc_table[i] |= EMMC_HOST_ADMA_BUFF_LINK_NEXT; in emmc_dma_init()
437 emmc->desc_table[i] |= EMMC_HOST_ADMA_BUFF_VALID; in emmc_dma_init()
439 LOG_DBG("desc_table:%llx", emmc->desc_table[i]); in emmc_dma_init()
442 regs->adma_sys_addr1 = (uint32_t)((uintptr_t)emmc->desc_table & ADDRESS_32BIT_MASK); in emmc_dma_init()
444 (uint32_t)(((uintptr_t)emmc->desc_table >> 32) & ADDRESS_32BIT_MASK); in emmc_dma_init()
446 LOG_DBG("adma: %llx %x %p", emmc->desc_table[0], regs->adma_sys_addr1, in emmc_dma_init()
447 emmc->desc_table); in emmc_dma_init()
458 struct emmc_data *emmc = dev->data; in emmc_init_xfr() local
484 emmc->host_io.timing == SDHC_TIMING_SDR104) { in emmc_init_xfr()
542 struct emmc_data *emmc = dev->data; in wait_xfr_intr_complete() local
555 events = k_event_wait(&emmc->irq_event, in wait_xfr_intr_complete()
669 struct emmc_data *emmc = dev->data; in emmc_host_send_cmd() local
693 k_event_clear(&emmc->irq_event, EMMC_HOST_CMD_COMPLETE); in emmc_host_send_cmd()
707 ret = wait_for_cmd_complete(emmc, sdhc_cmd->timeout_ms); in emmc_host_send_cmd()
723 struct emmc_data *emmc = dev->data; in emmc_stop_transfer() local
727 hdc_cmd.arg = emmc->rca << EMMC_HOST_RCA_SHIFT; in emmc_stop_transfer()
768 struct emmc_data *emmc = dev->data; in read_data_port() local
787 events = k_event_wait(&emmc->irq_event, EMMC_HOST_BUF_RD_READY, false, in read_data_port()
789 k_event_clear(&emmc->irq_event, EMMC_HOST_BUF_RD_READY); in read_data_port()
814 struct emmc_data *emmc = dev->data; in write_data_port() local
837 k_event_clear(&emmc->irq_event, EMMC_HOST_BUF_WR_READY); in write_data_port()
853 events = k_event_wait(&emmc->irq_event, EMMC_HOST_BUF_WR_READY, false, in write_data_port()
855 k_event_clear(&emmc->irq_event, EMMC_HOST_BUF_WR_READY); in write_data_port()
926 struct emmc_data *emmc = dev->data; in emmc_xfr() local
941 k_event_clear(&emmc->irq_event, EMMC_HOST_XFER_COMPLETE); in emmc_xfr()
942 k_event_clear(&emmc->irq_event, read ? EMMC_HOST_BUF_RD_READY : EMMC_HOST_BUF_WR_READY); in emmc_xfr()
1009 struct emmc_data *emmc = dev->data; in emmc_set_io() local
1011 struct sdhc_io *host_io = &emmc->host_io; in emmc_set_io()
1018 if (ios->clock && (ios->clock > emmc->props.f_max || ios->clock < emmc->props.f_min)) { in emmc_set_io()
1020 emmc->props.f_max, emmc->props.f_min); in emmc_set_io()
1095 struct emmc_data *emmc = dev->data; in emmc_get_card_present() local
1100 emmc->card_present = (bool)((regs->present_state >> 16u) & 1u); in emmc_get_card_present()
1102 if (!emmc->card_present) { in emmc_get_card_present()
1106 return ((int)emmc->card_present); in emmc_get_card_present()
1146 struct emmc_data *emmc = dev->data; in emmc_get_host_props() local
1175 emmc->props = *props; in emmc_get_host_props()
1182 struct emmc_data *emmc = dev->data; in emmc_isr() local
1187 k_event_post(&emmc->irq_event, EMMC_HOST_CMD_COMPLETE); in emmc_isr()
1192 k_event_post(&emmc->irq_event, EMMC_HOST_XFER_COMPLETE); in emmc_isr()
1197 k_event_post(&emmc->irq_event, EMMC_HOST_DMA_INTR); in emmc_isr()
1202 k_event_post(&emmc->irq_event, EMMC_HOST_BUF_WR_READY); in emmc_isr()
1207 k_event_post(&emmc->irq_event, EMMC_HOST_BUF_RD_READY); in emmc_isr()
1212 k_event_post(&emmc->irq_event, ERR_INTR_STATUS_EVENT(regs->err_int_stat)); in emmc_isr()
1221 k_event_post(&emmc->irq_event, regs->normal_int_stat); in emmc_isr()
1232 struct emmc_data *emmc = dev->data; in emmc_init() local
1235 k_sem_init(&emmc->lock, 1, 1); in emmc_init()
1236 k_event_init(&emmc->irq_event); in emmc_init()