SPRUI30H November 2015 – May 2024 DRA745 , DRA746 , DRA750 , DRA756
A channel initialization must be performed in order to ensure proper operation. Table 24-1476 shows the sequence.
Step | Crossreference |
---|---|
Configuring the hardware | Table 24-1477 |
Programming the routing fabric block | Table 24-1478 |
Programming the DMA block | Table 24-1482 |
Synchronizing and unmuting the synchronous channel | Table 24-1485 |
Configuring The Hardware
To configure the MediaLB interface, the steps shown in Table 24-1477 should be followed.
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
Clear channel table RAM, to ensure that no stray interrupts are generated | - | 0x0 |
Clear the interrupt status bits for logical channels 0 to 63 | MLB_DCSR0 and MLB_DCSR1 | 0xFFFF FFFF |
Mask all DMA channels (from 0 to 63) | MLB_DCMR0 and MLB_DCMR1 | 0x0000 0000 |
Select 3-pin or 6-pin MediaLB operation | MLB_MLBC0[5] MLBPEN | 0x0 for 3-pin 0x1 for 6-pin |
Select MediaLB clock speed | MLB_MLBC0[4:2] MLBCLK | 0x- |
Enable the MediaLB | MLB_MLBC0[0] MLBEN | 0x1 |
Activate all channels | MLB_DICER0 and MLB_DICER1 | 0xFFFF FFFF |
Enable the DMA | MLB_DIENR[15] EN | 0x1 |
Set the DMA channel mask bits according to all active DMA channels | MLB_DCMR0 and MLB_DCMR1 | 0x- |
Select DMA Mode 1 to be used | MLB_DCTL[2] DMA_MODE | 0x1 |
Select software to clear the interrupts | MLB_DCTL[0] SCE | 0x1 |
Enable MLB interrupts, if required | MLB_MIEN | 0x- |
Programming The Routing Fabric Block
The channel allocation table and channel descriptor table reside in the channel table RAM and are programmed indirectly through the memory interface block. The steps to be followed are shown in Table 24-1478.
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
1. Initialize all bits of the channel allocation table | - | 0x0 |
2. Select a connection label | CL | N = 0x0 to 0x3F |
3. Program the channel descriptor table for channel N | Use the memory interface registers to do a write to the channel descriptor table. See Table 24-1479. | Mask to be used : 0xFFFF FFFF |
4. Program the channel allocation table for inbound data buffer RAM access | Write to the data buffer RAM. See Table 24-1480. | - |
5. Program the channel allocation table for outbound data buffer RAM access | Read from the data buffer RAM. See Table 24-1481. | - |
6. Repeat steps 2-5 to initialize all logical channels | - | - |
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
1. Set the 14-bit base address | BA | 0x- |
2. Set the 12-bit or 13-bit buffer depth | BD (set this according to the BA so that it doesn’t overflow the buffer) | BD = buffer depth in bytes - 1 |
IF: Synchronous channels | ||
Set the 12-bit or 13-bit buffer depth | BD | (BD + 1) = 4 × frames per sub-buffer (m) × bytes-per-frame (bpf) |
ENDIF | ||
IF: Isochronous channels | ||
Set the 12-bit or 13-bit buffer depth | BD | (BD + 1) mod (BS + 1) = 0 |
ENDIF | ||
IF: Asynchronous channels | ||
Set the 12-bit or 13-bit buffer depth | BD | (BD + 1) >= max packet length (1024 for a MOST Data Packet (MDP)) |
ENDIF | ||
IF: Control channels | ||
Set the 12-bit or 13-bit buffer depth | BD | (BD + 1) >= max packet length (64) |
ENDIF | ||
3. For isochronous channels, configure the block size | BS | BS = block size in bytes - 1 |
4. Write to all other bits of the channel descriptor table | 0x0 |
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
For Tx channels the DMA block does the inbound data buffer RAM access | A Tx channel is from MLBSS to external host | - |
For Rx channels MediaLB does the inbound data buffer RAM access | An Rx channel is from external host to MLBSS | - |
Set the channel direction | RNW | 0x0 |
Set the channel type | CT[2:0] | 0x0: synchronous 0x1: control 0x2: asynchronous 0x3: isochronous |
Set the connection label | CL[5:0] | CL[5:0] = N |
IF: CT[2:0] = 0x0 (synchronous) | ||
Set the mute bit. | MT (the mute bit is set to avoid any flow of the garbage data that will be there in the data buffer prior to any transfer) | 0x1 |
ENDIF | ||
Set the channel enable bit | CE | 0x1 |
Clear all other bits of the channel allocation table | - | 0x0 |
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
For Tx channels MediaLB does the outbound data buffer RAM access | A Tx channel is from MLBSS to external host | - |
For Rx channels the DMA block does the outbound data buffer RAM access | An Rx channel is from external host to MLBSS | - |
Set the channel direction | RNW | 0x1 |
Set the channel type | CT[2:0] | 0x0: synchronous 0x1: control 0x2: asynchronous 0x3: isochronous |
Set the connection label | CL[5:0] | CL[5:0] = N |
IF: CT[2:0] = 000 (synchronous), | ||
Set the mute bit. | MT | 0x1 |
ENDIF | ||
Set the channel enable bit | CE | 0x1 |
Clear all other bits of the channel allocation table | - | 0x0 |
Programming The DMA Block
The DMA descriptor table resides in the channel table RAM and is programmed through L4_PER2 slave interface using the registers of the memory interface block. The steps to be followed are shown in Table 24-1482.
Step (1) | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
1. Initialize all bits of the DMA descriptor table | - | 0x0 |
2. Select a connection label | CL (Note that the CL number chosen in this step should be equal to the CL number chosen in step 2 of Table 24-1478) | N = 0x0 to 0x3F |
3. Program the DMA block ping page for channel N (2) | See Table 24-1483 | - |
4. Program the DMA block pong page for channel N | See Table 24-1484 | - |
5. Select big or little endian | LE | 0x- |
6. Select the active page | PG (Program this bit only once in the beginning of the configuration. It shouldn’t be touched by the software after that. The hardware updates this bit as the transactions happen) | 0x- |
7. Set the channel enable bit for all active logical channels | CE | 0x1 |
8. Repeat steps 2-7 for all active logical channels | - | - |
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
Set the 32-bit base address | BA1 | 0x- |
Set the 11-bit buffer depth | BD1 | BD1 = buffer depth in bytes - 1 |
IF: Synchronous channels | ||
Set the 11-bit buffer depth | BD1 | (BD1+ 1) = n × frames per sub-buffer (m) × bytes-per-frame (bpf) |
ENDIF | ||
IF: Isochronous channels | ||
Set the 11-bit buffer depth | BD1 | (BD1 + 1) mod (BS + 1) = 0 |
ENDIF | ||
IF: Asynchronous and control Rx channels | ||
Set the 11-bit buffer depth | BD1 | 5 <= (BD1 + 1) <= 4096 (1) |
ENDIF | ||
IF: Asynchronous and control Tx channels | ||
Set the 11-bit buffer depth | BD1 | 5 <= (BD1 + 1) <= 4096 (1) |
Set the packet start bit if the page contains the start of the packet | PS1 | 0x1 |
ENDIF | ||
Clear the page done bit | DNE1 | 0x0 |
Clear the error bit | ERR1 | 0x0 |
Set the page ready bit | RDY1 | 0x1 |
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
Set the 32-bit base address | BA2 | 0x- |
Set the 11-bit buffer depth | BD2 | BD2 = buffer depth in bytes - 1 |
IF: Synchronous channels | ||
Set the 11-bit buffer depth | BD2 | (BD2+ 1) = n × frames per sub-buffer (m) × bytes-per-frame (bpf) |
ENDIF | ||
IF: Isochronous channels | ||
Set the 11-bit buffer depth | BD2 | (BD2 + 1) mod (BS + 1) = 0 |
ENDIF | ||
IF: Asynchronous and control Rx channels | ||
Set the 11-bit buffer depth | BD2 | 5 <= (BD2 + 1) <= 4096 (1) |
ENDIF | ||
IF: Asynchronous and control Tx channels | ||
Set the 11-bit buffer depth | BD2 | 5 <= (BD2 + 1) <= 4096 (1) |
Set the packet start bit if the page contains the start of the packet | PS2 | 0x1 |
ENDIF | ||
Clear the page done bit | DNE2 | 0x0 |
Clear the error bit | ERR2 | 0x0 |
Set the page ready | RDY2 | 0x1 |
Synchronizing And Unmuting The Synchronous Channel
The steps to be followed are shown in Table 24-1485
Step | Register/ Bit Field/ Programming Model/ Comments | Value |
---|---|---|
Check that MediaLB clock is running | MLB_MLBC1[7] CLKMERR | 0x0 |
IF: The MediaLB clock is not toggling at the pads | MLB_MLBC1[7] CLKMERR | 0x1 |
Clear the register bit | MLB_MLBC1[7] CLKMERR | |
Wait one MLB_L4_ICLK or MLB I/O clock cycle | ||
Check that MediaLB clock is running | MLB_MLBC1[7] CLKMERR | 0x0 |
ENDIF | ||
Poll for MediaLB lock | MLB_MLBC0[7] MLBLK | 0x1 |
Wait four frames | - | - |
Unmute the synchronous channel/channels | MT | 0x0 |