Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
cpm_common.c File Reference
#include <linux/init.h>
#include <linux/of_device.h>
#include <linux/spinlock.h>
#include <linux/export.h>
#include <linux/of.h>
#include <linux/slab.h>
#include <asm/udbg.h>
#include <asm/io.h>
#include <asm/rheap.h>
#include <asm/cpm.h>
#include <mm/mmu_decl.h>

Go to the source code of this file.

Macros

#define OF_MAX_ADDR_CELLS   4
 

Functions

int cpm_muram_init (void)
 
unsigned long cpm_muram_alloc (unsigned long size, unsigned long align)
 
 EXPORT_SYMBOL (cpm_muram_alloc)
 
int cpm_muram_free (unsigned long offset)
 
 EXPORT_SYMBOL (cpm_muram_free)
 
unsigned long cpm_muram_alloc_fixed (unsigned long offset, unsigned long size)
 
 EXPORT_SYMBOL (cpm_muram_alloc_fixed)
 
void __iomemcpm_muram_addr (unsigned long offset)
 
 EXPORT_SYMBOL (cpm_muram_addr)
 
unsigned long cpm_muram_offset (void __iomem *addr)
 
 EXPORT_SYMBOL (cpm_muram_offset)
 
dma_addr_t cpm_muram_dma (void __iomem *addr)
 
 EXPORT_SYMBOL (cpm_muram_dma)
 

Macro Definition Documentation

#define OF_MAX_ADDR_CELLS   4

Definition at line 74 of file cpm_common.c.

Function Documentation

void __iomem* cpm_muram_addr ( unsigned long  offset)

cpm_muram_addr - turn a muram offset into a virtual address : muram offset to convert

Definition at line 200 of file cpm_common.c.

unsigned long cpm_muram_alloc ( unsigned long  size,
unsigned long  align 
)

cpm_muram_alloc - allocate the requested size worth of multi-user ram : number of bytes to allocate : requested alignment, in bytes

This function returns an offset into the muram area. Use cpm_dpram_addr() to get the virtual address of the area. Use cpm_muram_free() to free the allocation.

Definition at line 141 of file cpm_common.c.

unsigned long cpm_muram_alloc_fixed ( unsigned long  offset,
unsigned long  size 
)

cpm_muram_alloc_fixed - reserve a specific region of multi-user ram : the offset into the muram area to reserve : the number of bytes to reserve

This function returns "start" on success, -ENOMEM on failure. Use cpm_dpram_addr() to get the virtual address of the area. Use cpm_muram_free() to free the allocation.

Definition at line 182 of file cpm_common.c.

dma_addr_t cpm_muram_dma ( void __iomem addr)

cpm_muram_dma - turn a muram virtual address into a DMA address : virtual address from cpm_muram_addr() to convert

Definition at line 216 of file cpm_common.c.

int cpm_muram_free ( unsigned long  offset)

cpm_muram_free - free a chunk of multi-user ram : The beginning of the chunk as returned by cpm_muram_alloc().

Definition at line 160 of file cpm_common.c.

int cpm_muram_init ( void  )

Definition at line 76 of file cpm_common.c.

unsigned long cpm_muram_offset ( void __iomem addr)

Definition at line 206 of file cpm_common.c.

EXPORT_SYMBOL ( cpm_muram_alloc  )
EXPORT_SYMBOL ( cpm_muram_free  )
EXPORT_SYMBOL ( cpm_muram_alloc_fixed  )
EXPORT_SYMBOL ( cpm_muram_addr  )
EXPORT_SYMBOL ( cpm_muram_offset  )
EXPORT_SYMBOL ( cpm_muram_dma  )