Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
at91sam9_smc.h File Reference
#include <mach/cpu.h>

Go to the source code of this file.

Data Structures

struct  sam9_smc_config
 

Macros

#define AT91_SMC_SETUP   0x00 /* Setup Register for CS n */
 
#define AT91_SMC_NWESETUP   (0x3f << 0) /* NWE Setup Length */
 
#define AT91_SMC_NWESETUP_(x)   ((x) << 0)
 
#define AT91_SMC_NCS_WRSETUP   (0x3f << 8) /* NCS Setup Length in Write Access */
 
#define AT91_SMC_NCS_WRSETUP_(x)   ((x) << 8)
 
#define AT91_SMC_NRDSETUP   (0x3f << 16) /* NRD Setup Length */
 
#define AT91_SMC_NRDSETUP_(x)   ((x) << 16)
 
#define AT91_SMC_NCS_RDSETUP   (0x3f << 24) /* NCS Setup Length in Read Access */
 
#define AT91_SMC_NCS_RDSETUP_(x)   ((x) << 24)
 
#define AT91_SMC_PULSE   0x04 /* Pulse Register for CS n */
 
#define AT91_SMC_NWEPULSE   (0x7f << 0) /* NWE Pulse Length */
 
#define AT91_SMC_NWEPULSE_(x)   ((x) << 0)
 
#define AT91_SMC_NCS_WRPULSE   (0x7f << 8) /* NCS Pulse Length in Write Access */
 
#define AT91_SMC_NCS_WRPULSE_(x)   ((x) << 8)
 
#define AT91_SMC_NRDPULSE   (0x7f << 16) /* NRD Pulse Length */
 
#define AT91_SMC_NRDPULSE_(x)   ((x) << 16)
 
#define AT91_SMC_NCS_RDPULSE   (0x7f << 24) /* NCS Pulse Length in Read Access */
 
#define AT91_SMC_NCS_RDPULSE_(x)   ((x) << 24)
 
#define AT91_SMC_CYCLE   0x08 /* Cycle Register for CS n */
 
#define AT91_SMC_NWECYCLE   (0x1ff << 0 ) /* Total Write Cycle Length */
 
#define AT91_SMC_NWECYCLE_(x)   ((x) << 0)
 
#define AT91_SMC_NRDCYCLE   (0x1ff << 16) /* Total Read Cycle Length */
 
#define AT91_SMC_NRDCYCLE_(x)   ((x) << 16)
 
#define AT91_SMC_MODE   0x0c /* Mode Register for CS n */
 
#define AT91_SMC_READMODE   (1 << 0) /* Read Mode */
 
#define AT91_SMC_WRITEMODE   (1 << 1) /* Write Mode */
 
#define AT91_SMC_EXNWMODE   (3 << 4) /* NWAIT Mode */
 
#define AT91_SMC_EXNWMODE_DISABLE   (0 << 4)
 
#define AT91_SMC_EXNWMODE_FROZEN   (2 << 4)
 
#define AT91_SMC_EXNWMODE_READY   (3 << 4)
 
#define AT91_SMC_BAT   (1 << 8) /* Byte Access Type */
 
#define AT91_SMC_BAT_SELECT   (0 << 8)
 
#define AT91_SMC_BAT_WRITE   (1 << 8)
 
#define AT91_SMC_DBW   (3 << 12) /* Data Bus Width */
 
#define AT91_SMC_DBW_8   (0 << 12)
 
#define AT91_SMC_DBW_16   (1 << 12)
 
#define AT91_SMC_DBW_32   (2 << 12)
 
#define AT91_SMC_TDF   (0xf << 16) /* Data Float Time. */
 
#define AT91_SMC_TDF_(x)   ((x) << 16)
 
#define AT91_SMC_TDFMODE   (1 << 20) /* TDF Optimization - Enabled */
 
#define AT91_SMC_PMEN   (1 << 24) /* Page Mode Enabled */
 
#define AT91_SMC_PS   (3 << 28) /* Page Size */
 
#define AT91_SMC_PS_4   (0 << 28)
 
#define AT91_SMC_PS_8   (1 << 28)
 
#define AT91_SMC_PS_16   (2 << 28)
 
#define AT91_SMC_PS_32   (3 << 28)
 

Functions

void sam9_smc_configure (int id, int cs, struct sam9_smc_config *config)
 
void sam9_smc_read (int id, int cs, struct sam9_smc_config *config)
 
void sam9_smc_read_mode (int id, int cs, struct sam9_smc_config *config)
 
void sam9_smc_write_mode (int id, int cs, struct sam9_smc_config *config)
 

Macro Definition Documentation

#define AT91_SMC_BAT   (1 << 8) /* Byte Access Type */

Definition at line 83 of file at91sam9_smc.h.

#define AT91_SMC_BAT_SELECT   (0 << 8)

Definition at line 84 of file at91sam9_smc.h.

#define AT91_SMC_BAT_WRITE   (1 << 8)

Definition at line 85 of file at91sam9_smc.h.

#define AT91_SMC_CYCLE   0x08 /* Cycle Register for CS n */

Definition at line 70 of file at91sam9_smc.h.

#define AT91_SMC_DBW   (3 << 12) /* Data Bus Width */

Definition at line 86 of file at91sam9_smc.h.

#define AT91_SMC_DBW_16   (1 << 12)

Definition at line 88 of file at91sam9_smc.h.

#define AT91_SMC_DBW_32   (2 << 12)

Definition at line 89 of file at91sam9_smc.h.

#define AT91_SMC_DBW_8   (0 << 12)

Definition at line 87 of file at91sam9_smc.h.

#define AT91_SMC_EXNWMODE   (3 << 4) /* NWAIT Mode */

Definition at line 79 of file at91sam9_smc.h.

#define AT91_SMC_EXNWMODE_DISABLE   (0 << 4)

Definition at line 80 of file at91sam9_smc.h.

#define AT91_SMC_EXNWMODE_FROZEN   (2 << 4)

Definition at line 81 of file at91sam9_smc.h.

#define AT91_SMC_EXNWMODE_READY   (3 << 4)

Definition at line 82 of file at91sam9_smc.h.

#define AT91_SMC_MODE   0x0c /* Mode Register for CS n */

Definition at line 76 of file at91sam9_smc.h.

#define AT91_SMC_NCS_RDPULSE   (0x7f << 24) /* NCS Pulse Length in Read Access */

Definition at line 67 of file at91sam9_smc.h.

#define AT91_SMC_NCS_RDPULSE_ (   x)    ((x) << 24)

Definition at line 68 of file at91sam9_smc.h.

#define AT91_SMC_NCS_RDSETUP   (0x3f << 24) /* NCS Setup Length in Read Access */

Definition at line 57 of file at91sam9_smc.h.

#define AT91_SMC_NCS_RDSETUP_ (   x)    ((x) << 24)

Definition at line 58 of file at91sam9_smc.h.

#define AT91_SMC_NCS_WRPULSE   (0x7f << 8) /* NCS Pulse Length in Write Access */

Definition at line 63 of file at91sam9_smc.h.

#define AT91_SMC_NCS_WRPULSE_ (   x)    ((x) << 8)

Definition at line 64 of file at91sam9_smc.h.

#define AT91_SMC_NCS_WRSETUP   (0x3f << 8) /* NCS Setup Length in Write Access */

Definition at line 53 of file at91sam9_smc.h.

#define AT91_SMC_NCS_WRSETUP_ (   x)    ((x) << 8)

Definition at line 54 of file at91sam9_smc.h.

#define AT91_SMC_NRDCYCLE   (0x1ff << 16) /* Total Read Cycle Length */

Definition at line 73 of file at91sam9_smc.h.

#define AT91_SMC_NRDCYCLE_ (   x)    ((x) << 16)

Definition at line 74 of file at91sam9_smc.h.

#define AT91_SMC_NRDPULSE   (0x7f << 16) /* NRD Pulse Length */

Definition at line 65 of file at91sam9_smc.h.

#define AT91_SMC_NRDPULSE_ (   x)    ((x) << 16)

Definition at line 66 of file at91sam9_smc.h.

#define AT91_SMC_NRDSETUP   (0x3f << 16) /* NRD Setup Length */

Definition at line 55 of file at91sam9_smc.h.

#define AT91_SMC_NRDSETUP_ (   x)    ((x) << 16)

Definition at line 56 of file at91sam9_smc.h.

#define AT91_SMC_NWECYCLE   (0x1ff << 0 ) /* Total Write Cycle Length */

Definition at line 71 of file at91sam9_smc.h.

#define AT91_SMC_NWECYCLE_ (   x)    ((x) << 0)

Definition at line 72 of file at91sam9_smc.h.

#define AT91_SMC_NWEPULSE   (0x7f << 0) /* NWE Pulse Length */

Definition at line 61 of file at91sam9_smc.h.

#define AT91_SMC_NWEPULSE_ (   x)    ((x) << 0)

Definition at line 62 of file at91sam9_smc.h.

#define AT91_SMC_NWESETUP   (0x3f << 0) /* NWE Setup Length */

Definition at line 51 of file at91sam9_smc.h.

#define AT91_SMC_NWESETUP_ (   x)    ((x) << 0)

Definition at line 52 of file at91sam9_smc.h.

#define AT91_SMC_PMEN   (1 << 24) /* Page Mode Enabled */

Definition at line 93 of file at91sam9_smc.h.

#define AT91_SMC_PS   (3 << 28) /* Page Size */

Definition at line 94 of file at91sam9_smc.h.

#define AT91_SMC_PS_16   (2 << 28)

Definition at line 97 of file at91sam9_smc.h.

#define AT91_SMC_PS_32   (3 << 28)

Definition at line 98 of file at91sam9_smc.h.

#define AT91_SMC_PS_4   (0 << 28)

Definition at line 95 of file at91sam9_smc.h.

#define AT91_SMC_PS_8   (1 << 28)

Definition at line 96 of file at91sam9_smc.h.

#define AT91_SMC_PULSE   0x04 /* Pulse Register for CS n */

Definition at line 60 of file at91sam9_smc.h.

#define AT91_SMC_READMODE   (1 << 0) /* Read Mode */

Definition at line 77 of file at91sam9_smc.h.

#define AT91_SMC_SETUP   0x00 /* Setup Register for CS n */

Definition at line 50 of file at91sam9_smc.h.

#define AT91_SMC_TDF   (0xf << 16) /* Data Float Time. */

Definition at line 90 of file at91sam9_smc.h.

#define AT91_SMC_TDF_ (   x)    ((x) << 16)

Definition at line 91 of file at91sam9_smc.h.

#define AT91_SMC_TDFMODE   (1 << 20) /* TDF Optimization - Enabled */

Definition at line 92 of file at91sam9_smc.h.

#define AT91_SMC_WRITEMODE   (1 << 1) /* Write Mode */

Definition at line 78 of file at91sam9_smc.h.

Function Documentation

void sam9_smc_configure ( int  id,
int  cs,
struct sam9_smc_config config 
)

Definition at line 67 of file sam9_smc.c.

void sam9_smc_read ( int  id,
int  cs,
struct sam9_smc_config config 
)

Definition at line 119 of file sam9_smc.c.

void sam9_smc_read_mode ( int  id,
int  cs,
struct sam9_smc_config config 
)

Definition at line 82 of file sam9_smc.c.

void sam9_smc_write_mode ( int  id,
int  cs,
struct sam9_smc_config config 
)

Definition at line 34 of file sam9_smc.c.