coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
dma.c File Reference
#include <device/mmio.h>
#include <console/console.h>
#include <stdint.h>
#include <soc/addressmap.h>
#include <soc/dma.h>
Include dependency graph for dma.c:

Go to the source code of this file.

Macros

#define APB_DMA_OFFSET(n)    (struct apb_dma_channel_regs *)(TEGRA_APB_DMA_BASE + n)
 

Functions

int dma_busy (struct apb_dma_channel *const channel)
 
struct apb_dma_channel *const dma_claim (void)
 
void dma_release (struct apb_dma_channel *const channel)
 
int dma_start (struct apb_dma_channel *const channel)
 
int dma_stop (struct apb_dma_channel *const channel)
 

Variables

struct apb_dma *const apb_dma = (struct apb_dma *)TEGRA_APB_DMA_BASE
 
struct apb_dma_channel apb_dma_channels []
 

Macro Definition Documentation

◆ APB_DMA_OFFSET

#define APB_DMA_OFFSET (   n)     (struct apb_dma_channel_regs *)(TEGRA_APB_DMA_BASE + n)

Definition at line 11 of file dma.c.

Function Documentation

◆ dma_busy()

int dma_busy ( struct apb_dma_channel *const  channel)

Definition at line 48 of file dma.c.

References APB_STA_DMA_ACTIVITY, read32(), apb_dma_channel::regs, and apb_dma_channel_regs::sta.

Referenced by dma_release(), and tegra_spi_dma_finish().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dma_claim()

struct apb_dma_channel* const dma_claim ( void  )

Definition at line 59 of file dma.c.

References APB_COMMAND_GEN, apb_dma_channels, ARRAY_SIZE, BIOS_DEBUG, apb_dma::command, apb_dma_channel::in_use, NULL, printk, read32(), apb_dma_channel::regs, and setbits32.

Referenced by tegra_spi_dma_prepare().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dma_release()

void dma_release ( struct apb_dma_channel *const  channel)

Definition at line 92 of file dma.c.

References APB_COMMAND_GEN, apb_dma_channels, ARRAY_SIZE, clrbits32, apb_dma::command, dma_busy(), and apb_dma_channel::in_use.

Referenced by tegra_spi_dma_finish().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dma_start()

int dma_start ( struct apb_dma_channel *const  channel)

Definition at line 111 of file dma.c.

References APB_CSR_ENB, apb_dma_channel::regs, and setbits32.

Referenced by tegra_spi_dma_start().

Here is the caller graph for this function:

◆ dma_stop()

int dma_stop ( struct apb_dma_channel *const  channel)

Definition at line 121 of file dma.c.

References APB_CSR_ENB, clrbits32, and apb_dma_channel::regs.

Referenced by tegra_spi_dma_finish().

Here is the caller graph for this function:

Variable Documentation

◆ apb_dma

struct apb_dma* const apb_dma = (struct apb_dma *)TEGRA_APB_DMA_BASE

Definition at line 9 of file dma.c.

◆ apb_dma_channels

struct apb_dma_channel apb_dma_channels[]

Definition at line 9 of file dma.c.

Referenced by dma_claim(), and dma_release().