Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sdrc.h File Reference

Go to the source code of this file.

Data Structures

struct  omap_sdrc_params
 

Macros

#define SDRC_SYSCONFIG   0x010
 
#define SDRC_CS_CFG   0x040
 
#define SDRC_SHARING   0x044
 
#define SDRC_ERR_TYPE   0x04C
 
#define SDRC_DLLA_CTRL   0x060
 
#define SDRC_DLLA_STATUS   0x064
 
#define SDRC_DLLB_CTRL   0x068
 
#define SDRC_DLLB_STATUS   0x06C
 
#define SDRC_POWER   0x070
 
#define SDRC_MCFG_0   0x080
 
#define SDRC_MR_0   0x084
 
#define SDRC_EMR2_0   0x08c
 
#define SDRC_ACTIM_CTRL_A_0   0x09c
 
#define SDRC_ACTIM_CTRL_B_0   0x0a0
 
#define SDRC_RFR_CTRL_0   0x0a4
 
#define SDRC_MANUAL_0   0x0a8
 
#define SDRC_MCFG_1   0x0B0
 
#define SDRC_MR_1   0x0B4
 
#define SDRC_EMR2_1   0x0BC
 
#define SDRC_ACTIM_CTRL_A_1   0x0C4
 
#define SDRC_ACTIM_CTRL_B_1   0x0C8
 
#define SDRC_RFR_CTRL_1   0x0D4
 
#define SDRC_MANUAL_1   0x0D8
 
#define SDRC_POWER_AUTOCOUNT_SHIFT   8
 
#define SDRC_POWER_AUTOCOUNT_MASK   (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)
 
#define SDRC_POWER_CLKCTRL_SHIFT   4
 
#define SDRC_POWER_CLKCTRL_MASK   (0x3 << SDRC_POWER_CLKCTRL_SHIFT)
 
#define SDRC_SELF_REFRESH_ON_AUTOCOUNT   (0x2 << SDRC_POWER_CLKCTRL_SHIFT)
 
#define SDRC_RFR_CTRL_165MHz   (0x00044c00 | 1)
 
#define SDRC_RFR_CTRL_133MHz   (0x0003de00 | 1)
 
#define SDRC_RFR_CTRL_100MHz   (0x0002da01 | 1)
 
#define SDRC_RFR_CTRL_110MHz   (0x0002da01 | 1) /* Need to calc */
 
#define SDRC_RFR_CTRL_BYPASS   (0x00005000 | 1) /* Need to calc */
 
#define OMAP242X_SMS_REGADDR(reg)   (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)
 
#define OMAP243X_SMS_REGADDR(reg)   (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)
 
#define OMAP343X_SMS_REGADDR(reg)   (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)
 
#define SMS_SYSCONFIG   0x010
 
#define SMS_ROT_CONTROL(context)   (0x180 + 0x10 * context)
 
#define SMS_ROT_SIZE(context)   (0x184 + 0x10 * context)
 
#define SMS_ROT_PHYSICAL_BA(context)   (0x188 + 0x10 * context)
 

Functions

int omap2_sdrc_get_params (unsigned long r, struct omap_sdrc_params **sdrc_cs0, struct omap_sdrc_params **sdrc_cs1)
 
void omap2_sms_save_context (void)
 
void omap2_sms_restore_context (void)
 
void omap2_sms_write_rot_control (u32 val, unsigned ctx)
 
void omap2_sms_write_rot_size (u32 val, unsigned ctx)
 
void omap2_sms_write_rot_physical_ba (u32 val, unsigned ctx)
 

Macro Definition Documentation

#define OMAP242X_SMS_REGADDR (   reg)    (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP2420_SMS_BASE + reg)

Definition at line 87 of file sdrc.h.

#define OMAP243X_SMS_REGADDR (   reg)    (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP243X_SMS_BASE + reg)

Definition at line 89 of file sdrc.h.

#define OMAP343X_SMS_REGADDR (   reg)    (void __iomem *)OMAP2_L3_IO_ADDRESS(OMAP343X_SMS_BASE + reg)

Definition at line 91 of file sdrc.h.

#define SDRC_ACTIM_CTRL_A_0   0x09c

Definition at line 34 of file sdrc.h.

#define SDRC_ACTIM_CTRL_A_1   0x0C4

Definition at line 41 of file sdrc.h.

#define SDRC_ACTIM_CTRL_B_0   0x0a0

Definition at line 35 of file sdrc.h.

#define SDRC_ACTIM_CTRL_B_1   0x0C8

Definition at line 42 of file sdrc.h.

#define SDRC_CS_CFG   0x040

Definition at line 23 of file sdrc.h.

#define SDRC_DLLA_CTRL   0x060

Definition at line 26 of file sdrc.h.

#define SDRC_DLLA_STATUS   0x064

Definition at line 27 of file sdrc.h.

#define SDRC_DLLB_CTRL   0x068

Definition at line 28 of file sdrc.h.

#define SDRC_DLLB_STATUS   0x06C

Definition at line 29 of file sdrc.h.

#define SDRC_EMR2_0   0x08c

Definition at line 33 of file sdrc.h.

#define SDRC_EMR2_1   0x0BC

Definition at line 40 of file sdrc.h.

#define SDRC_ERR_TYPE   0x04C

Definition at line 25 of file sdrc.h.

#define SDRC_MANUAL_0   0x0a8

Definition at line 37 of file sdrc.h.

#define SDRC_MANUAL_1   0x0D8

Definition at line 44 of file sdrc.h.

#define SDRC_MCFG_0   0x080

Definition at line 31 of file sdrc.h.

#define SDRC_MCFG_1   0x0B0

Definition at line 38 of file sdrc.h.

#define SDRC_MR_0   0x084

Definition at line 32 of file sdrc.h.

#define SDRC_MR_1   0x0B4

Definition at line 39 of file sdrc.h.

#define SDRC_POWER   0x070

Definition at line 30 of file sdrc.h.

#define SDRC_POWER_AUTOCOUNT_MASK   (0xffff << SDRC_POWER_AUTOCOUNT_SHIFT)

Definition at line 47 of file sdrc.h.

#define SDRC_POWER_AUTOCOUNT_SHIFT   8

Definition at line 46 of file sdrc.h.

#define SDRC_POWER_CLKCTRL_MASK   (0x3 << SDRC_POWER_CLKCTRL_SHIFT)

Definition at line 49 of file sdrc.h.

#define SDRC_POWER_CLKCTRL_SHIFT   4

Definition at line 48 of file sdrc.h.

#define SDRC_RFR_CTRL_0   0x0a4

Definition at line 36 of file sdrc.h.

#define SDRC_RFR_CTRL_1   0x0D4

Definition at line 43 of file sdrc.h.

#define SDRC_RFR_CTRL_100MHz   (0x0002da01 | 1)

Definition at line 78 of file sdrc.h.

#define SDRC_RFR_CTRL_110MHz   (0x0002da01 | 1) /* Need to calc */

Definition at line 79 of file sdrc.h.

#define SDRC_RFR_CTRL_133MHz   (0x0003de00 | 1)

Definition at line 77 of file sdrc.h.

#define SDRC_RFR_CTRL_165MHz   (0x00044c00 | 1)

Definition at line 76 of file sdrc.h.

#define SDRC_RFR_CTRL_BYPASS   (0x00005000 | 1) /* Need to calc */

Definition at line 80 of file sdrc.h.

#define SDRC_SELF_REFRESH_ON_AUTOCOUNT   (0x2 << SDRC_POWER_CLKCTRL_SHIFT)

Definition at line 50 of file sdrc.h.

#define SDRC_SHARING   0x044

Definition at line 24 of file sdrc.h.

#define SDRC_SYSCONFIG   0x010

Definition at line 22 of file sdrc.h.

#define SMS_ROT_CONTROL (   context)    (0x180 + 0x10 * context)

Definition at line 97 of file sdrc.h.

#define SMS_ROT_PHYSICAL_BA (   context)    (0x188 + 0x10 * context)

Definition at line 99 of file sdrc.h.

#define SMS_ROT_SIZE (   context)    (0x184 + 0x10 * context)

Definition at line 98 of file sdrc.h.

#define SMS_SYSCONFIG   0x010

Definition at line 96 of file sdrc.h.

Function Documentation

int omap2_sdrc_get_params ( unsigned long  r,
struct omap_sdrc_params **  sdrc_cs0,
struct omap_sdrc_params **  sdrc_cs1 
)

omap2_sdrc_get_params - return SDRC register values for a given clock rate : SDRC clock rate (in Hz) : chip select 0 ram timings ** : chip select 1 ram timings **

Return pre-calculated values for the SDRC_ACTIM_CTRLA, SDRC_ACTIM_CTRLB, SDRC_RFR_CTRL and SDRC_MR registers in sdrc_cs[01] structs,for a given SDRC clock rate 'r'. These parameters control various timing delays in the SDRAM controller that are expressed in terms of the number of SDRC clock cycles to wait; hence the clock rate dependency.

Supports 2 different timing parameters for both chip selects.

Note 1: the sdrc_init_params_cs[01] must be sorted rate descending. Note 2: If sdrc_init_params_cs_1 is not NULL it must be of same size as sdrc_init_params_cs_0.

Fills in the struct omap_sdrc_params * for each chip select. Returns 0 upon success or -1 upon failure.

Definition at line 91 of file sdrc.c.

void omap2_sms_restore_context ( void  )

omap2_sms_restore_context - Restore SMS registers

Restore SMS registers that need to be Restored after off mode.

Definition at line 64 of file sdrc.c.

void omap2_sms_save_context ( void  )

omap2_sms_save_context - Save SMS registers

Save SMS registers that need to be restored after off mode.

Definition at line 54 of file sdrc.c.

void omap2_sms_write_rot_control ( u32  val,
unsigned  ctx 
)

Definition at line 164 of file sdrc.c.

void omap2_sms_write_rot_physical_ba ( u32  val,
unsigned  ctx 
)

Definition at line 174 of file sdrc.c.

void omap2_sms_write_rot_size ( u32  val,
unsigned  ctx 
)

Definition at line 169 of file sdrc.c.