Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sh_mobile_meram.c File Reference
#include <linux/device.h>
#include <linux/err.h>
#include <linux/export.h>
#include <linux/genalloc.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <video/sh_mobile_meram.h>

Go to the source code of this file.

Data Structures

struct  sh_mobile_meram_icb
 
struct  sh_mobile_meram_fb_plane
 
struct  sh_mobile_meram_fb_cache
 
struct  sh_mobile_meram_priv
 

Macros

#define MEVCR1   0x4
 
#define MEVCR1_RST   (1 << 31)
 
#define MEVCR1_WD   (1 << 30)
 
#define MEVCR1_AMD1   (1 << 29)
 
#define MEVCR1_AMD0   (1 << 28)
 
#define MEQSEL1   0x40
 
#define MEQSEL2   0x44
 
#define MExxCTL   0x400
 
#define MExxCTL_BV   (1 << 31)
 
#define MExxCTL_BSZ_SHIFT   28
 
#define MExxCTL_MSAR_MASK   (0x7ff << MExxCTL_MSAR_SHIFT)
 
#define MExxCTL_MSAR_SHIFT   16
 
#define MExxCTL_NXT_MASK   (0x1f << MExxCTL_NXT_SHIFT)
 
#define MExxCTL_NXT_SHIFT   11
 
#define MExxCTL_WD1   (1 << 10)
 
#define MExxCTL_WD0   (1 << 9)
 
#define MExxCTL_WS   (1 << 8)
 
#define MExxCTL_CB   (1 << 7)
 
#define MExxCTL_WBF   (1 << 6)
 
#define MExxCTL_WF   (1 << 5)
 
#define MExxCTL_RF   (1 << 4)
 
#define MExxCTL_CM   (1 << 3)
 
#define MExxCTL_MD_READ   (1 << 0)
 
#define MExxCTL_MD_WRITE   (2 << 0)
 
#define MExxCTL_MD_ICB_WB   (3 << 0)
 
#define MExxCTL_MD_ICB   (4 << 0)
 
#define MExxCTL_MD_FB   (7 << 0)
 
#define MExxCTL_MD_MASK   (7 << 0)
 
#define MExxBSIZE   0x404
 
#define MExxBSIZE_RCNT_SHIFT   28
 
#define MExxBSIZE_YSZM1_SHIFT   16
 
#define MExxBSIZE_XSZM1_SHIFT   0
 
#define MExxMNCF   0x408
 
#define MExxMNCF_KWBNM_SHIFT   28
 
#define MExxMNCF_KRBNM_SHIFT   24
 
#define MExxMNCF_BNM_SHIFT   16
 
#define MExxMNCF_XBV   (1 << 15)
 
#define MExxMNCF_CPL_YCBCR444   (1 << 12)
 
#define MExxMNCF_CPL_YCBCR420   (2 << 12)
 
#define MExxMNCF_CPL_YCBCR422   (3 << 12)
 
#define MExxMNCF_CPL_MSK   (3 << 12)
 
#define MExxMNCF_BL   (1 << 2)
 
#define MExxMNCF_LNM_SHIFT   0
 
#define MExxSARA   0x410
 
#define MExxSARB   0x414
 
#define MExxSBSIZE   0x418
 
#define MExxSBSIZE_HDV   (1 << 31)
 
#define MExxSBSIZE_HSZ16   (0 << 28)
 
#define MExxSBSIZE_HSZ32   (1 << 28)
 
#define MExxSBSIZE_HSZ64   (2 << 28)
 
#define MExxSBSIZE_HSZ128   (3 << 28)
 
#define MExxSBSIZE_SBSIZZ_SHIFT   0
 
#define MERAM_MExxCTL_VAL(next, addr)
 
#define MERAM_MExxBSIZE_VAL(rcnt, yszm1, xszm1)
 
#define MERAM_REGS_SIZE   ARRAY_SIZE(common_regs)
 
#define ICB_REGS_SIZE   ARRAY_SIZE(icb_regs)
 
#define MERAM_ICB_NUM   32
 
#define MERAM_GRANULARITY   1024
 
#define MERAM_SEC_LINE   15
 
#define MERAM_LINE_WIDTH   2048
 
#define MERAM_ICB_OFFSET(base, idx, off)   ((base) + (off) + (idx) * 0x20)
 
#define MERAM_CALC_BYTECOUNT(x, y)   (((x) * (y) + (MERAM_LINE_WIDTH - 1)) & ~(MERAM_LINE_WIDTH - 1))
 

Functions

unsigned long sh_mobile_meram_alloc (struct sh_mobile_meram_info *pdata, size_t size)
 
 EXPORT_SYMBOL_GPL (sh_mobile_meram_alloc)
 
void sh_mobile_meram_free (struct sh_mobile_meram_info *pdata, unsigned long mem, size_t size)
 
 EXPORT_SYMBOL_GPL (sh_mobile_meram_free)
 
voidsh_mobile_meram_cache_alloc (struct sh_mobile_meram_info *pdata, const struct sh_mobile_meram_cfg *cfg, unsigned int xres, unsigned int yres, unsigned int pixelformat, unsigned int *pitch)
 
 EXPORT_SYMBOL_GPL (sh_mobile_meram_cache_alloc)
 
void sh_mobile_meram_cache_free (struct sh_mobile_meram_info *pdata, void *data)
 
 EXPORT_SYMBOL_GPL (sh_mobile_meram_cache_free)
 
void sh_mobile_meram_cache_update (struct sh_mobile_meram_info *pdata, void *data, unsigned long base_addr_y, unsigned long base_addr_c, unsigned long *icb_addr_y, unsigned long *icb_addr_c)
 
 EXPORT_SYMBOL_GPL (sh_mobile_meram_cache_update)
 
 module_platform_driver (sh_mobile_meram_driver)
 
 MODULE_DESCRIPTION ("SuperH Mobile MERAM driver")
 
 MODULE_AUTHOR ("Damian Hobson-Garcia / Takanari Hayama")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define ICB_REGS_SIZE   ARRAY_SIZE(icb_regs)

Definition at line 106 of file sh_mobile_meram.c.

#define MEQSEL1   0x40

Definition at line 34 of file sh_mobile_meram.c.

#define MEQSEL2   0x44

Definition at line 35 of file sh_mobile_meram.c.

#define MERAM_CALC_BYTECOUNT (   x,
  y 
)    (((x) * (y) + (MERAM_LINE_WIDTH - 1)) & ~(MERAM_LINE_WIDTH - 1))

Definition at line 314 of file sh_mobile_meram.c.

#define MERAM_GRANULARITY   1024

Definition at line 164 of file sh_mobile_meram.c.

#define MERAM_ICB_NUM   32

Definition at line 129 of file sh_mobile_meram.c.

#define MERAM_ICB_OFFSET (   base,
  idx,
  off 
)    ((base) + (off) + (idx) * 0x20)

Definition at line 172 of file sh_mobile_meram.c.

#define MERAM_LINE_WIDTH   2048

Definition at line 166 of file sh_mobile_meram.c.

#define MERAM_MExxBSIZE_VAL (   rcnt,
  yszm1,
  xszm1 
)
Value:
(((rcnt) << MExxBSIZE_RCNT_SHIFT) | \
((yszm1) << MExxBSIZE_YSZM1_SHIFT) | \
((xszm1) << MExxBSIZE_XSZM1_SHIFT))

Definition at line 86 of file sh_mobile_meram.c.

#define MERAM_MExxCTL_VAL (   next,
  addr 
)
Value:

Definition at line 83 of file sh_mobile_meram.c.

#define MERAM_REGS_SIZE   ARRAY_SIZE(common_regs)

Definition at line 96 of file sh_mobile_meram.c.

#define MERAM_SEC_LINE   15

Definition at line 165 of file sh_mobile_meram.c.

#define MEVCR1   0x4

Definition at line 29 of file sh_mobile_meram.c.

#define MEVCR1_AMD0   (1 << 28)

Definition at line 33 of file sh_mobile_meram.c.

#define MEVCR1_AMD1   (1 << 29)

Definition at line 32 of file sh_mobile_meram.c.

#define MEVCR1_RST   (1 << 31)

Definition at line 30 of file sh_mobile_meram.c.

#define MEVCR1_WD   (1 << 30)

Definition at line 31 of file sh_mobile_meram.c.

#define MExxBSIZE   0x404

Definition at line 58 of file sh_mobile_meram.c.

#define MExxBSIZE_RCNT_SHIFT   28

Definition at line 59 of file sh_mobile_meram.c.

#define MExxBSIZE_XSZM1_SHIFT   0

Definition at line 61 of file sh_mobile_meram.c.

#define MExxBSIZE_YSZM1_SHIFT   16

Definition at line 60 of file sh_mobile_meram.c.

#define MExxCTL   0x400

Definition at line 37 of file sh_mobile_meram.c.

#define MExxCTL_BSZ_SHIFT   28

Definition at line 39 of file sh_mobile_meram.c.

#define MExxCTL_BV   (1 << 31)

Definition at line 38 of file sh_mobile_meram.c.

#define MExxCTL_CB   (1 << 7)

Definition at line 47 of file sh_mobile_meram.c.

#define MExxCTL_CM   (1 << 3)

Definition at line 51 of file sh_mobile_meram.c.

#define MExxCTL_MD_FB   (7 << 0)

Definition at line 56 of file sh_mobile_meram.c.

#define MExxCTL_MD_ICB   (4 << 0)

Definition at line 55 of file sh_mobile_meram.c.

#define MExxCTL_MD_ICB_WB   (3 << 0)

Definition at line 54 of file sh_mobile_meram.c.

#define MExxCTL_MD_MASK   (7 << 0)

Definition at line 57 of file sh_mobile_meram.c.

#define MExxCTL_MD_READ   (1 << 0)

Definition at line 52 of file sh_mobile_meram.c.

#define MExxCTL_MD_WRITE   (2 << 0)

Definition at line 53 of file sh_mobile_meram.c.

#define MExxCTL_MSAR_MASK   (0x7ff << MExxCTL_MSAR_SHIFT)

Definition at line 40 of file sh_mobile_meram.c.

#define MExxCTL_MSAR_SHIFT   16

Definition at line 41 of file sh_mobile_meram.c.

#define MExxCTL_NXT_MASK   (0x1f << MExxCTL_NXT_SHIFT)

Definition at line 42 of file sh_mobile_meram.c.

#define MExxCTL_NXT_SHIFT   11

Definition at line 43 of file sh_mobile_meram.c.

#define MExxCTL_RF   (1 << 4)

Definition at line 50 of file sh_mobile_meram.c.

#define MExxCTL_WBF   (1 << 6)

Definition at line 48 of file sh_mobile_meram.c.

#define MExxCTL_WD0   (1 << 9)

Definition at line 45 of file sh_mobile_meram.c.

#define MExxCTL_WD1   (1 << 10)

Definition at line 44 of file sh_mobile_meram.c.

#define MExxCTL_WF   (1 << 5)

Definition at line 49 of file sh_mobile_meram.c.

#define MExxCTL_WS   (1 << 8)

Definition at line 46 of file sh_mobile_meram.c.

#define MExxMNCF   0x408

Definition at line 62 of file sh_mobile_meram.c.

#define MExxMNCF_BL   (1 << 2)

Definition at line 71 of file sh_mobile_meram.c.

#define MExxMNCF_BNM_SHIFT   16

Definition at line 65 of file sh_mobile_meram.c.

#define MExxMNCF_CPL_MSK   (3 << 12)

Definition at line 70 of file sh_mobile_meram.c.

#define MExxMNCF_CPL_YCBCR420   (2 << 12)

Definition at line 68 of file sh_mobile_meram.c.

#define MExxMNCF_CPL_YCBCR422   (3 << 12)

Definition at line 69 of file sh_mobile_meram.c.

#define MExxMNCF_CPL_YCBCR444   (1 << 12)

Definition at line 67 of file sh_mobile_meram.c.

#define MExxMNCF_KRBNM_SHIFT   24

Definition at line 64 of file sh_mobile_meram.c.

#define MExxMNCF_KWBNM_SHIFT   28

Definition at line 63 of file sh_mobile_meram.c.

#define MExxMNCF_LNM_SHIFT   0

Definition at line 72 of file sh_mobile_meram.c.

#define MExxMNCF_XBV   (1 << 15)

Definition at line 66 of file sh_mobile_meram.c.

#define MExxSARA   0x410

Definition at line 73 of file sh_mobile_meram.c.

#define MExxSARB   0x414

Definition at line 74 of file sh_mobile_meram.c.

#define MExxSBSIZE   0x418

Definition at line 75 of file sh_mobile_meram.c.

#define MExxSBSIZE_HDV   (1 << 31)

Definition at line 76 of file sh_mobile_meram.c.

#define MExxSBSIZE_HSZ128   (3 << 28)

Definition at line 80 of file sh_mobile_meram.c.

#define MExxSBSIZE_HSZ16   (0 << 28)

Definition at line 77 of file sh_mobile_meram.c.

#define MExxSBSIZE_HSZ32   (1 << 28)

Definition at line 78 of file sh_mobile_meram.c.

#define MExxSBSIZE_HSZ64   (2 << 28)

Definition at line 79 of file sh_mobile_meram.c.

#define MExxSBSIZE_SBSIZZ_SHIFT   0

Definition at line 81 of file sh_mobile_meram.c.

Function Documentation

EXPORT_SYMBOL_GPL ( sh_mobile_meram_alloc  )
EXPORT_SYMBOL_GPL ( sh_mobile_meram_free  )
EXPORT_SYMBOL_GPL ( sh_mobile_meram_cache_alloc  )
EXPORT_SYMBOL_GPL ( sh_mobile_meram_cache_free  )
EXPORT_SYMBOL_GPL ( sh_mobile_meram_cache_update  )
MODULE_AUTHOR ( "Damian Hobson-Garcia / Takanari Hayama"  )
MODULE_DESCRIPTION ( "SuperH Mobile MERAM driver )
MODULE_LICENSE ( "GPL v2 )
module_platform_driver ( sh_mobile_meram_driver  )
unsigned long sh_mobile_meram_alloc ( struct sh_mobile_meram_info pdata,
size_t  size 
)

Definition at line 407 of file sh_mobile_meram.c.

void* sh_mobile_meram_cache_alloc ( struct sh_mobile_meram_info pdata,
const struct sh_mobile_meram_cfg cfg,
unsigned int  xres,
unsigned int  yres,
unsigned int  pixelformat,
unsigned int pitch 
)

Definition at line 466 of file sh_mobile_meram.c.

void sh_mobile_meram_cache_free ( struct sh_mobile_meram_info pdata,
void data 
)

Definition at line 527 of file sh_mobile_meram.c.

void sh_mobile_meram_cache_update ( struct sh_mobile_meram_info pdata,
void data,
unsigned long  base_addr_y,
unsigned long  base_addr_c,
unsigned long icb_addr_y,
unsigned long icb_addr_c 
)

Definition at line 550 of file sh_mobile_meram.c.

void sh_mobile_meram_free ( struct sh_mobile_meram_info pdata,
unsigned long  mem,
size_t  size 
)

Definition at line 416 of file sh_mobile_meram.c.