libteak
Macros | Functions
ahbm.h File Reference

AHBM (ARM AMBA AHB bus) utilities. More...

#include <teak/types.h>

Macros

#define AHBM_CH_CFG2_READ   (0 << 8)
 Read external memory.
 
#define AHBM_CH_CFG2_WRITE   (1 << 8)
 HWRITE. Write external memory.
 
#define REG_AHBM_CH_CFG1(n)   (*(vu16 *)(0x80E2 + 6 * (n)))
 AHBM Channel 0..2 Configure Burst/Data (R/W)
 
#define REG_AHBM_CH_CFG2(n)   (*(vu16 *)(0x80E4 + 6 * (n)))
 AHBM Channel 0..2 Configure Whatever (R/W)
 
#define REG_AHBM_CH_CFG_DMA(n)   (*(vu16 *)(0x80E6 + 6 * (n)))
 AHBM Channel 0..2 Configure DMA (R/W)
 
#define REG_AHBM_STATUS   (*(vu16 *)0x80E0)
 AHBM Status (R)
 

Functions

static void ahbmConfigChannel (int channel, u16 a, u16 b, u16 dma_channel_mask)
 Sets up an AHBM channel. More...
 
static u16 ahbmIsBusy (void)
 Checks whether any AHBM channel is busy. More...
 
static void ahbmResetChannel (int channel)
 Resets an AHBM channel. More...
 

Detailed Description

AHBM (ARM AMBA AHB bus) utilities.

For more information about the meaning of all of the concepts in this file, check the document "AMBA AHB Protocol Specification" from ARM: "ARM IHI 0033C (ID090921)".

Function Documentation

◆ ahbmConfigChannel()

static void ahbmConfigChannel ( int  channel,
u16  a,
u16  b,
u16  dma_channel_mask 
)
inlinestatic

Sets up an AHBM channel.

Parameters
channelThe AHBM channel to setup.
aFirst configuration setting.
bSecond configuration setting.
dma_channel_maskThe DMA channels to assign to this AHBM channel.

◆ ahbmIsBusy()

static u16 ahbmIsBusy ( void  )
inlinestatic

Checks whether any AHBM channel is busy.

Returns
Returns 1 if any AHBM channel is busy, 0 otherwise.

◆ ahbmResetChannel()

static void ahbmResetChannel ( int  channel)
inlinestatic

Resets an AHBM channel.

Parameters
channelThe AHBM channel to setup.