Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
aemif.c File Reference
#include <linux/kernel.h>
#include <linux/io.h>
#include <linux/err.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/time.h>
#include <linux/platform_data/mtd-davinci-aemif.h>

Go to the source code of this file.

Macros

#define TA(x)   ((x) << 2)
 
#define RHOLD(x)   ((x) << 4)
 
#define RSTROBE(x)   ((x) << 7)
 
#define RSETUP(x)   ((x) << 13)
 
#define WHOLD(x)   ((x) << 17)
 
#define WSTROBE(x)   ((x) << 20)
 
#define WSETUP(x)   ((x) << 26)
 
#define TA_MAX   0x3
 
#define RHOLD_MAX   0x7
 
#define RSTROBE_MAX   0x3f
 
#define RSETUP_MAX   0xf
 
#define WHOLD_MAX   0x7
 
#define WSTROBE_MAX   0x3f
 
#define WSETUP_MAX   0xf
 
#define TIMING_MASK
 

Functions

int davinci_aemif_setup_timing (struct davinci_aemif_timing *t, void __iomem *base, unsigned cs)
 
 EXPORT_SYMBOL (davinci_aemif_setup_timing)
 

Macro Definition Documentation

#define RHOLD (   x)    ((x) << 4)

Definition at line 23 of file aemif.c.

#define RHOLD_MAX   0x7

Definition at line 31 of file aemif.c.

#define RSETUP (   x)    ((x) << 13)

Definition at line 25 of file aemif.c.

#define RSETUP_MAX   0xf

Definition at line 33 of file aemif.c.

#define RSTROBE (   x)    ((x) << 7)

Definition at line 24 of file aemif.c.

#define RSTROBE_MAX   0x3f

Definition at line 32 of file aemif.c.

#define TA (   x)    ((x) << 2)

Definition at line 22 of file aemif.c.

#define TA_MAX   0x3

Definition at line 30 of file aemif.c.

#define TIMING_MASK
Value:
(TA(TA_MAX) | \
RHOLD(RHOLD_MAX) | \
RSTROBE(RSTROBE_MAX) | \
RSETUP(RSETUP_MAX) | \
WHOLD(WHOLD_MAX) | \
WSTROBE(WSTROBE_MAX) | \
WSETUP(WSETUP_MAX))

Definition at line 38 of file aemif.c.

#define WHOLD (   x)    ((x) << 17)

Definition at line 26 of file aemif.c.

#define WHOLD_MAX   0x7

Definition at line 34 of file aemif.c.

#define WSETUP (   x)    ((x) << 26)

Definition at line 28 of file aemif.c.

#define WSETUP_MAX   0xf

Definition at line 36 of file aemif.c.

#define WSTROBE (   x)    ((x) << 20)

Definition at line 27 of file aemif.c.

#define WSTROBE_MAX   0x3f

Definition at line 35 of file aemif.c.

Function Documentation

int davinci_aemif_setup_timing ( struct davinci_aemif_timing t,
void __iomem base,
unsigned  cs 
)

davinci_aemif_setup_timing - setup timing values for a given AEMIF interface : timing values to be progammed : The virtual base address of the AEMIF interface : chip-select to program the timing values for

This function programs the given timing values (in real clock) into the AEMIF registers taking the AEMIF clock into account.

This function does not use any locking while programming the AEMIF because it is expected that there is only one user of a given chip-select.

Returns 0 on success, else negative errno.

Definition at line 89 of file aemif.c.

EXPORT_SYMBOL ( davinci_aemif_setup_timing  )