Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
lart.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>

Go to the source code of this file.

Macros

#define FLASH_BLOCKSIZE_PARAM   (4096 * BUSWIDTH)
 
#define FLASH_NUMBLOCKS_16m_PARAM   8
 
#define FLASH_NUMBLOCKS_8m_PARAM   8
 
#define FLASH_BLOCKSIZE_MAIN   (32768 * BUSWIDTH)
 
#define FLASH_NUMBLOCKS_16m_MAIN   31
 
#define FLASH_NUMBLOCKS_8m_MAIN   15
 
#define BUSWIDTH   4 /* don't change this - a lot of the code _will_ break if you change this */
 
#define FLASH_OFFSET   0xe8000000 /* see linux/arch/arm/mach-sa1100/lart.c */
 
#define NUM_BLOB_BLOCKS   FLASH_NUMBLOCKS_16m_PARAM
 
#define BLOB_START   0x00000000
 
#define BLOB_LEN   (NUM_BLOB_BLOCKS * FLASH_BLOCKSIZE_PARAM)
 
#define NUM_KERNEL_BLOCKS   7
 
#define KERNEL_START   (BLOB_START + BLOB_LEN)
 
#define KERNEL_LEN   (NUM_KERNEL_BLOCKS * FLASH_BLOCKSIZE_MAIN)
 
#define NUM_INITRD_BLOCKS   24
 
#define INITRD_START   (KERNEL_START + KERNEL_LEN)
 
#define INITRD_LEN   (NUM_INITRD_BLOCKS * FLASH_BLOCKSIZE_MAIN)
 
#define READ_ARRAY   0x00FF00FF /* Read Array/Reset */
 
#define READ_ID_CODES   0x00900090 /* Read Identifier Codes */
 
#define ERASE_SETUP   0x00200020 /* Block Erase */
 
#define ERASE_CONFIRM   0x00D000D0 /* Block Erase and Program Resume */
 
#define PGM_SETUP   0x00400040 /* Program */
 
#define STATUS_READ   0x00700070 /* Read Status Register */
 
#define STATUS_CLEAR   0x00500050 /* Clear Status Register */
 
#define STATUS_BUSY   0x00800080 /* Write State Machine Status (WSMS) */
 
#define STATUS_ERASE_ERR   0x00200020 /* Erase Status (ES) */
 
#define STATUS_PGM_ERR   0x00100010 /* Program Status (PS) */
 
#define FLASH_MANUFACTURER   0x00890089
 
#define FLASH_DEVICE_8mbit_TOP   0x88f188f1
 
#define FLASH_DEVICE_8mbit_BOTTOM   0x88f288f2
 
#define FLASH_DEVICE_16mbit_TOP   0x88f388f3
 
#define FLASH_DEVICE_16mbit_BOTTOM   0x88f488f4
 
#define DATA_TO_FLASH(x)
 
#define FLASH_TO_DATA(x)
 
#define ADDR_TO_FLASH_U2(x)
 
#define FLASH_U2_TO_ADDR(x)
 
#define ADDR_TO_FLASH_U3(x)
 
#define FLASH_U3_TO_ADDR(x)
 
#define NUM_PARTITIONS   ARRAY_SIZE(lart_partitions)
 

Functions

 module_init (lart_flash_init)
 
 module_exit (lart_flash_exit)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Abraham vd Merwe <[email protected]>")
 
 MODULE_DESCRIPTION ("MTD driver for Intel 28F160F3 on LART board")
 

Macro Definition Documentation

#define ADDR_TO_FLASH_U2 (   x)
Value:
( \
(((x) & 0x00000f00) >> 4) + \
(((x) & 0x00042000) << 1) + \
(((x) & 0x0009c003) << 2) + \
(((x) & 0x00021080) << 3) + \
(((x) & 0x00000010) << 4) + \
(((x) & 0x00000040) << 5) + \
(((x) & 0x00000024) << 7) + \
(((x) & 0x00000008) << 10) \
)

Definition at line 216 of file lart.c.

#define ADDR_TO_FLASH_U3 (   x)
Value:
( \
(((x) & 0x00000080) >> 3) + \
(((x) & 0x00000040) >> 1) + \
(((x) & 0x00052020) << 1) + \
(((x) & 0x00084f03) << 2) + \
(((x) & 0x00029010) << 3) + \
(((x) & 0x00000008) << 5) + \
(((x) & 0x00000004) << 7) \
)

Definition at line 242 of file lart.c.

#define BLOB_LEN   (NUM_BLOB_BLOCKS * FLASH_BLOCKSIZE_PARAM)

Definition at line 79 of file lart.c.

#define BLOB_START   0x00000000

Definition at line 78 of file lart.c.

#define BUSWIDTH   4 /* don't change this - a lot of the code _will_ break if you change this */

Definition at line 73 of file lart.c.

#define DATA_TO_FLASH (   x)
Value:
( \
(((x) & 0x08009000) >> 11) + \
(((x) & 0x00002000) >> 10) + \
(((x) & 0x04004000) >> 8) + \
(((x) & 0x00000010) >> 4) + \
(((x) & 0x91000820) >> 3) + \
(((x) & 0x22080080) >> 2) + \
((x) & 0x40000400) + \
(((x) & 0x00040040) << 1) + \
(((x) & 0x00110000) << 4) + \
(((x) & 0x00220100) << 5) + \
(((x) & 0x00800208) << 6) + \
(((x) & 0x00400004) << 9) + \
(((x) & 0x00000001) << 12) + \
(((x) & 0x00000002) << 13) \
)

Definition at line 140 of file lart.c.

#define ERASE_CONFIRM   0x00D000D0 /* Block Erase and Program Resume */

Definition at line 97 of file lart.c.

#define ERASE_SETUP   0x00200020 /* Block Erase */

Definition at line 96 of file lart.c.

#define FLASH_BLOCKSIZE_MAIN   (32768 * BUSWIDTH)

Definition at line 64 of file lart.c.

#define FLASH_BLOCKSIZE_PARAM   (4096 * BUSWIDTH)

Definition at line 56 of file lart.c.

#define FLASH_DEVICE_16mbit_BOTTOM   0x88f488f4

Definition at line 112 of file lart.c.

#define FLASH_DEVICE_16mbit_TOP   0x88f388f3

Definition at line 111 of file lart.c.

#define FLASH_DEVICE_8mbit_BOTTOM   0x88f288f2

Definition at line 110 of file lart.c.

#define FLASH_DEVICE_8mbit_TOP   0x88f188f1

Definition at line 109 of file lart.c.

#define FLASH_MANUFACTURER   0x00890089

Definition at line 108 of file lart.c.

#define FLASH_NUMBLOCKS_16m_MAIN   31

Definition at line 65 of file lart.c.

#define FLASH_NUMBLOCKS_16m_PARAM   8

Definition at line 57 of file lart.c.

#define FLASH_NUMBLOCKS_8m_MAIN   15

Definition at line 66 of file lart.c.

#define FLASH_NUMBLOCKS_8m_PARAM   8

Definition at line 58 of file lart.c.

#define FLASH_OFFSET   0xe8000000 /* see linux/arch/arm/mach-sa1100/lart.c */

Definition at line 74 of file lart.c.

#define FLASH_TO_DATA (   x)
Value:
( \
(((x) & 0x00010012) << 11) + \
(((x) & 0x00000008) << 10) + \
(((x) & 0x00040040) << 8) + \
(((x) & 0x00000001) << 4) + \
(((x) & 0x12200104) << 3) + \
(((x) & 0x08820020) << 2) + \
((x) & 0x40000400) + \
(((x) & 0x00080080) >> 1) + \
(((x) & 0x01100000) >> 4) + \
(((x) & 0x04402000) >> 5) + \
(((x) & 0x20008200) >> 6) + \
(((x) & 0x80000800) >> 9) + \
(((x) & 0x00001000) >> 12) + \
(((x) & 0x00004000) >> 13) \
)

Definition at line 159 of file lart.c.

#define FLASH_U2_TO_ADDR (   x)
Value:
( \
(((x) << 4) & 0x00000f00) + \
(((x) >> 1) & 0x00042000) + \
(((x) >> 2) & 0x0009c003) + \
(((x) >> 3) & 0x00021080) + \
(((x) >> 4) & 0x00000010) + \
(((x) >> 5) & 0x00000040) + \
(((x) >> 7) & 0x00000024) + \
(((x) >> 10) & 0x00000008) \
)

Definition at line 229 of file lart.c.

#define FLASH_U3_TO_ADDR (   x)
Value:
( \
(((x) << 3) & 0x00000080) + \
(((x) << 1) & 0x00000040) + \
(((x) >> 1) & 0x00052020) + \
(((x) >> 2) & 0x00084f03) + \
(((x) >> 3) & 0x00029010) + \
(((x) >> 5) & 0x00000008) + \
(((x) >> 7) & 0x00000004) \
)

Definition at line 254 of file lart.c.

#define INITRD_LEN   (NUM_INITRD_BLOCKS * FLASH_BLOCKSIZE_MAIN)

Definition at line 89 of file lart.c.

#define INITRD_START   (KERNEL_START + KERNEL_LEN)

Definition at line 88 of file lart.c.

#define KERNEL_LEN   (NUM_KERNEL_BLOCKS * FLASH_BLOCKSIZE_MAIN)

Definition at line 84 of file lart.c.

#define KERNEL_START   (BLOB_START + BLOB_LEN)

Definition at line 83 of file lart.c.

#define NUM_BLOB_BLOCKS   FLASH_NUMBLOCKS_16m_PARAM

Definition at line 77 of file lart.c.

#define NUM_INITRD_BLOCKS   24

Definition at line 87 of file lart.c.

#define NUM_KERNEL_BLOCKS   7

Definition at line 82 of file lart.c.

#define NUM_PARTITIONS   ARRAY_SIZE(lart_partitions)

Definition at line 606 of file lart.c.

#define PGM_SETUP   0x00400040 /* Program */

Definition at line 98 of file lart.c.

#define READ_ARRAY   0x00FF00FF /* Read Array/Reset */

Definition at line 94 of file lart.c.

#define READ_ID_CODES   0x00900090 /* Read Identifier Codes */

Definition at line 95 of file lart.c.

#define STATUS_BUSY   0x00800080 /* Write State Machine Status (WSMS) */

Definition at line 101 of file lart.c.

#define STATUS_CLEAR   0x00500050 /* Clear Status Register */

Definition at line 100 of file lart.c.

#define STATUS_ERASE_ERR   0x00200020 /* Erase Status (ES) */

Definition at line 102 of file lart.c.

#define STATUS_PGM_ERR   0x00100010 /* Program Status (PS) */

Definition at line 103 of file lart.c.

#define STATUS_READ   0x00700070 /* Read Status Register */

Definition at line 99 of file lart.c.

Function Documentation

MODULE_AUTHOR ( "Abraham vd Merwe <[email protected]>"  )
MODULE_DESCRIPTION ( "MTD driver for Intel 28F160F3 on LART board"  )
module_exit ( lart_flash_exit  )
module_init ( lart_flash_init  )
MODULE_LICENSE ( "GPL"  )