1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-12-03 21:12:48 +02:00

ubb-patgen/ubb-patgen.c: use symbolic bit/field definitions for MSC_*

This commit is contained in:
Werner Almesberger 2013-01-20 17:34:39 -03:00
parent 4cb68b7ece
commit 486471e8fc

View File

@ -335,13 +335,13 @@ static void wait_dma_done(void)
static void wait_response(void)
{
while (!((MSC_STAT >> 11 ) & 1)); /* MSC_STAT.END_CMD_RES */
while (!(MSC_STAT & MSC_STAT_END_CMD_RES));
}
static void wait_fifo_empty(void)
{
while (!((MSC_STAT >> 6 ) & 1)); /* MSC_STAT.DATA_FIFO_EMPTY */
while (!(MSC_STAT & MSC_STAT_DATA_FIFO_EMPTY));
}
@ -410,18 +410,18 @@ static void mmc_buffer(const struct mmcclk *clk,
dma_setup(buf, nibbles);
MSC_STRPCL = 2; /* start the bus clock */
MSC_RESTO = 0xffff; /* maximum response time-out */
MSC_BLKLEN = 0xfff; /* never reach the end (with CRC) */
MSC_STRPCL = MSC_STRPCRL_START_CLOCK; /* start the bus clock */
MSC_RESTO = MSC_RESTO_MASK; /* maximum response time-out */
MSC_BLKLEN = MSC_BLKLEN_MASK; /* never reach the end (with CRC) */
MSC_CMDAT =
(2 << 9) | /* 4 bit bus */
(1 << 8) | /* DMA */
(1 << 4) | /* write */
(1 << 3) | /* with data transfer */
1; /* R1 response */
MSC_CMDAT_BUS_WIDTH_4 << MSC_CMDAT_BUS_WIDTH_SHIFT |
MSC_CMDAT_DMA_EN | /* DMA */
MSC_CMDAT_WRITE_READ | /* write */
MSC_CMDAT_DATA_EN | /* with data transfer */
MSC_CMDAT_RESPONSE_FORMAT_R1; /* R1 response */
MSC_STRPCL = 4; /* START_OP */
MSC_STRPCL = MSC_STRPCRL_START_OP;
/*
* Make sure we've reached the end of the command and then send the