Lines Matching +full:0 +full:xff
25 #define _INST_REQUIRES_EXPLICIT_FF(inst) (SPI_MOSI_OVERRUN_DT(DT_INST_BUS(inst)) != 0xFF) ||
34 #define ANY_INST_REQUIRES_EXPLICIT_FF DT_INST_FOREACH_STATUS_OKAY(_INST_REQUIRES_EXPLICIT_FF) 0
39 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
40 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
41 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
42 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
43 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
44 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
45 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
46 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
47 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
48 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
49 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
50 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
51 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
52 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
53 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
54 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
55 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
56 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
57 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
58 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
59 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
60 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
61 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
62 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
63 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
64 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
65 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
66 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
67 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
68 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
69 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
70 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
71 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
72 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
73 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
74 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
75 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
76 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
77 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
78 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
79 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
80 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
81 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
82 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
83 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
84 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
85 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
88 BUILD_ASSERT(sizeof(sdhc_ones) == 512, "0xFF array for SDHC must be 512 bytes");
146 * for SPI protocol, this will be performed by sending 10 0xff values in sdhc_spi_init_card()
154 if (spi_cfg->frequency == 0) { in sdhc_spi_init_card()
160 if (pm_device_runtime_get(config->spi_dev) < 0) { in sdhc_spi_init_card()
192 if (response == 0xFF) { in sdhc_spi_card_busy()
193 return 0; in sdhc_spi_card_busy()
209 while (timeout_ms > 0) { in sdhc_spi_wait_unbusy()
214 if (response == 0xFF) { in sdhc_spi_wait_unbusy()
215 return 0; in sdhc_spi_wait_unbusy()
250 while (timeout > 0) { in sdhc_spi_response_get()
253 if (ret < 0) { in sdhc_spi_response_get()
256 if (*response != 0xff) { in sdhc_spi_response_get()
263 if (*response == 0xff) { in sdhc_spi_response_get()
268 cmd->response[0] = *response++; in sdhc_spi_response_get()
270 if (cmd->response[0] != 0) { in sdhc_spi_response_get()
271 if (cmd->response[0] & (SD_SPI_R1PARAMETER_ERR | SD_SPI_R1ADDRESS_ERR)) { in sdhc_spi_response_get()
273 } else if (cmd->response[0] & (SD_SPI_R1ILLEGAL_CMD_ERR)) { in sdhc_spi_response_get()
275 } else if (cmd->response[0] & (SD_SPI_R1CMD_CRC_ERR)) { in sdhc_spi_response_get()
277 } else if (cmd->response[0] & (SD_SPI_R1ERASE_SEQ_ERR | SD_SPI_R1ERASE_RESET)) { in sdhc_spi_response_get()
292 while (response < end && (*response == 0x0)) { in sdhc_spi_response_get()
317 cmd->response[0] = (*response) << 8; in sdhc_spi_response_get()
323 cmd->response[1] = 0; in sdhc_spi_response_get()
324 for (i = 0; i < 4; i++) { in sdhc_spi_response_get()
345 return 0; in sdhc_spi_response_get()
365 * additional 5 bytes of data, leaving us with 13 bytes of 0xff. in sdhc_spi_send_cmd()
366 * Finally, we send a padding byte of all 0xff, to ensure that in sdhc_spi_send_cmd()
367 * the card recives at least one 0xff byte before next command. in sdhc_spi_send_cmd()
389 * send one 0xff byte, six command bytes, two additional 0xff in sdhc_spi_send_cmd()
393 bufs[0].len = SD_SPI_CMD_SIZE + 3; in sdhc_spi_send_cmd()
395 memset(dev_data->scratch, 0xFF, sizeof(dev_data->scratch)); in sdhc_spi_send_cmd()
399 * [47]: start bit, 0b0 in sdhc_spi_send_cmd()
400 * [46]: transmission bit, 0b1 in sdhc_spi_send_cmd()
404 * [0]: end bit, 0b1 in sdhc_spi_send_cmd()
408 cmd_buf[0] = (cmd->opcode & SD_SPI_CMD); in sdhc_spi_send_cmd()
409 cmd_buf[0] = ((cmd_buf[0] | SD_SPI_TX) & ~SD_SPI_START); in sdhc_spi_send_cmd()
413 cmd_buf[SD_SPI_CMD_BODY_SIZE] = crc7_be(0, cmd_buf, SD_SPI_CMD_BODY_SIZE) | 0x1; in sdhc_spi_send_cmd()
414 LOG_DBG("cmd%d arg 0x%x", cmd->opcode, cmd->arg); in sdhc_spi_send_cmd()
417 if (err != 0) { in sdhc_spi_send_cmd()
421 return sdhc_spi_response_get(dev, cmd, bufs[0].len); in sdhc_spi_send_cmd()
440 if (retries == 0) { in sdhc_skip()
458 /* If the driver requires explicit 0xFF bytes on receive, we in sdhc_spi_read_data()
494 /* Read bytes until data stream starts. SD will send 0xff until in sdhc_spi_read_data()
497 ret = sdhc_skip(dev, 0xff); in sdhc_spi_read_data()
498 if (ret < 0) { in sdhc_spi_read_data()
517 if (crc16_itu_t(0, read_location, data->block_size) != in sdhc_spi_read_data()
525 rx_bufs[0].buf = read_location; in sdhc_spi_read_data()
528 ret = sdhc_skip(dev, 0xff); in sdhc_spi_read_data()
579 sys_put_be16(crc16_itu_t(0, write_location, data->block_size), in sdhc_spi_write_data()
592 if ((resp & 0xF) != SD_SPI_RESPONSE_ACCEPTED) { in sdhc_spi_write_data()
593 if ((resp & 0xF) == SD_SPI_RESPONSE_CRC_ERR) { in sdhc_spi_write_data()
595 } else if ((resp & 0xF) == SD_SPI_RESPONSE_WRITE_ERR) { in sdhc_spi_write_data()
598 LOG_DBG("Unknown write response token 0x%x", resp); in sdhc_spi_write_data()
605 ret = sdhc_spi_wait_unbusy(dev, data->timeout_ms, 0); in sdhc_spi_write_data()
619 ret = sdhc_spi_wait_unbusy(dev, data->timeout_ms, 0); in sdhc_spi_write_data()
624 return 0; in sdhc_spi_write_data()
636 .arg = 0, in sdhc_spi_request()
643 if (pm_device_runtime_get(config->spi_dev) < 0) { in sdhc_spi_request()
650 } while ((ret != 0) && (retries-- > 0)); in sdhc_spi_request()
673 while ((stop_ret != 0) && (stop_retries > 0)) { in sdhc_spi_request()
681 } while ((ret != 0) && (retries > 0)); in sdhc_spi_request()
705 if (ios->clock != 0) { in sdhc_spi_set_io()
740 if (sdhc_spi_init_card(dev) != 0) { in sdhc_spi_set_io()
746 if (gpio_pin_set_dt(&cfg->pwr_gpio, 0)) { in sdhc_spi_set_io()
762 return 0; in sdhc_spi_set_io()
776 memset(props, 0, sizeof(struct sdhc_host_props)); in sdhc_spi_get_host_props()
783 return 0; in sdhc_spi_get_host_props()
792 return 0; in sdhc_spi_reset()
799 int ret = 0; in sdhc_spi_init()
809 if (ret != 0) { in sdhc_spi_init()
816 data->spi_cfg->frequency = 0; in sdhc_spi_init()
833 .pwr_gpio = GPIO_DT_SPEC_INST_GET_OR(n, pwr_gpios, {0}), \
841 | (DT_INST_PROP(n, spi_clock_mode_cpol) ? SPI_MODE_CPOL : 0) \
842 | (DT_INST_PROP(n, spi_clock_mode_cpha) ? SPI_MODE_CPHA : 0) \
844 0), \