Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
samsung.c File Reference
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/onenand.h>
#include <linux/mtd/partitions.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <asm/mach/flash.h>
#include <plat/regs-onenand.h>
#include <linux/io.h>

Go to the source code of this file.

Data Structures

struct  s3c_onenand
 

Macros

#define ONENAND_ERASE_STATUS   0x00
 
#define ONENAND_MULTI_ERASE_SET   0x01
 
#define ONENAND_ERASE_START   0x03
 
#define ONENAND_UNLOCK_START   0x08
 
#define ONENAND_UNLOCK_END   0x09
 
#define ONENAND_LOCK_START   0x0A
 
#define ONENAND_LOCK_END   0x0B
 
#define ONENAND_LOCK_TIGHT_START   0x0C
 
#define ONENAND_LOCK_TIGHT_END   0x0D
 
#define ONENAND_UNLOCK_ALL   0x0E
 
#define ONENAND_OTP_ACCESS   0x12
 
#define ONENAND_SPARE_ACCESS_ONLY   0x13
 
#define ONENAND_MAIN_ACCESS_ONLY   0x14
 
#define ONENAND_ERASE_VERIFY   0x15
 
#define ONENAND_MAIN_SPARE_ACCESS   0x16
 
#define ONENAND_PIPELINE_READ   0x4000
 
#define MAP_00   (0x0)
 
#define MAP_01   (0x1)
 
#define MAP_10   (0x2)
 
#define MAP_11   (0x3)
 
#define S3C64XX_CMD_MAP_SHIFT   24
 
#define S5PC100_CMD_MAP_SHIFT   26
 
#define S3C6400_FBA_SHIFT   10
 
#define S3C6400_FPA_SHIFT   4
 
#define S3C6400_FSA_SHIFT   2
 
#define S3C6410_FBA_SHIFT   12
 
#define S3C6410_FPA_SHIFT   6
 
#define S3C6410_FSA_SHIFT   4
 
#define S5PC100_FBA_SHIFT   13
 
#define S5PC100_FPA_SHIFT   7
 
#define S5PC100_FSA_SHIFT   5
 
#define S5PC110_DMA_SRC_ADDR   0x400
 
#define S5PC110_DMA_SRC_CFG   0x404
 
#define S5PC110_DMA_DST_ADDR   0x408
 
#define S5PC110_DMA_DST_CFG   0x40C
 
#define S5PC110_DMA_TRANS_SIZE   0x414
 
#define S5PC110_DMA_TRANS_CMD   0x418
 
#define S5PC110_DMA_TRANS_STATUS   0x41C
 
#define S5PC110_DMA_TRANS_DIR   0x420
 
#define S5PC110_INTC_DMA_CLR   0x1004
 
#define S5PC110_INTC_ONENAND_CLR   0x1008
 
#define S5PC110_INTC_DMA_MASK   0x1024
 
#define S5PC110_INTC_ONENAND_MASK   0x1028
 
#define S5PC110_INTC_DMA_PEND   0x1044
 
#define S5PC110_INTC_ONENAND_PEND   0x1048
 
#define S5PC110_INTC_DMA_STATUS   0x1064
 
#define S5PC110_INTC_ONENAND_STATUS   0x1068
 
#define S5PC110_INTC_DMA_TD   (1 << 24)
 
#define S5PC110_INTC_DMA_TE   (1 << 16)
 
#define S5PC110_DMA_CFG_SINGLE   (0x0 << 16)
 
#define S5PC110_DMA_CFG_4BURST   (0x2 << 16)
 
#define S5PC110_DMA_CFG_8BURST   (0x3 << 16)
 
#define S5PC110_DMA_CFG_16BURST   (0x4 << 16)
 
#define S5PC110_DMA_CFG_INC   (0x0 << 8)
 
#define S5PC110_DMA_CFG_CNT   (0x1 << 8)
 
#define S5PC110_DMA_CFG_8BIT   (0x0 << 0)
 
#define S5PC110_DMA_CFG_16BIT   (0x1 << 0)
 
#define S5PC110_DMA_CFG_32BIT   (0x2 << 0)
 
#define S5PC110_DMA_SRC_CFG_READ
 
#define S5PC110_DMA_DST_CFG_READ
 
#define S5PC110_DMA_SRC_CFG_WRITE
 
#define S5PC110_DMA_DST_CFG_WRITE
 
#define S5PC110_DMA_TRANS_CMD_TDC   (0x1 << 18)
 
#define S5PC110_DMA_TRANS_CMD_TEC   (0x1 << 16)
 
#define S5PC110_DMA_TRANS_CMD_TR   (0x1 << 0)
 
#define S5PC110_DMA_TRANS_STATUS_TD   (0x1 << 18)
 
#define S5PC110_DMA_TRANS_STATUS_TB   (0x1 << 17)
 
#define S5PC110_DMA_TRANS_STATUS_TE   (0x1 << 16)
 
#define S5PC110_DMA_DIR_READ   0x0
 
#define S5PC110_DMA_DIR_WRITE   0x1
 
#define CMD_MAP_00(dev, addr)   (dev->cmd_map(MAP_00, ((addr) << 1)))
 
#define CMD_MAP_01(dev, mem_addr)   (dev->cmd_map(MAP_01, (mem_addr)))
 
#define CMD_MAP_10(dev, mem_addr)   (dev->cmd_map(MAP_10, (mem_addr)))
 
#define CMD_MAP_11(dev, addr)   (dev->cmd_map(MAP_11, ((addr) << 2)))
 

Enumerations

enum  soc_type {
  TYPE_S3C6400, TYPE_S3C6410, TYPE_S5PC100, TYPE_S5PC110,
  SOC_ARCH_EXYNOS4210 = 1, SOC_ARCH_EXYNOS
}
 

Functions

 MODULE_DEVICE_TABLE (platform, s3c_onenand_driver_ids)
 
 module_platform_driver (s3c_onenand_driver)
 
 MODULE_LICENSE ("GPL")
 
 MODULE_AUTHOR ("Kyungmin Park <[email protected]>")
 
 MODULE_DESCRIPTION ("Samsung OneNAND controller support")
 

Macro Definition Documentation

#define CMD_MAP_00 (   dev,
  addr 
)    (dev->cmd_map(MAP_00, ((addr) << 1)))

Definition at line 152 of file samsung.c.

#define CMD_MAP_01 (   dev,
  mem_addr 
)    (dev->cmd_map(MAP_01, (mem_addr)))

Definition at line 153 of file samsung.c.

#define CMD_MAP_10 (   dev,
  mem_addr 
)    (dev->cmd_map(MAP_10, (mem_addr)))

Definition at line 154 of file samsung.c.

#define CMD_MAP_11 (   dev,
  addr 
)    (dev->cmd_map(MAP_11, ((addr) << 2)))

Definition at line 155 of file samsung.c.

#define MAP_00   (0x0)

Definition at line 56 of file samsung.c.

#define MAP_01   (0x1)

Definition at line 57 of file samsung.c.

#define MAP_10   (0x2)

Definition at line 58 of file samsung.c.

#define MAP_11   (0x3)

Definition at line 59 of file samsung.c.

#define ONENAND_ERASE_START   0x03

Definition at line 41 of file samsung.c.

#define ONENAND_ERASE_STATUS   0x00

Definition at line 39 of file samsung.c.

#define ONENAND_ERASE_VERIFY   0x15

Definition at line 52 of file samsung.c.

#define ONENAND_LOCK_END   0x0B

Definition at line 45 of file samsung.c.

#define ONENAND_LOCK_START   0x0A

Definition at line 44 of file samsung.c.

#define ONENAND_LOCK_TIGHT_END   0x0D

Definition at line 47 of file samsung.c.

#define ONENAND_LOCK_TIGHT_START   0x0C

Definition at line 46 of file samsung.c.

#define ONENAND_MAIN_ACCESS_ONLY   0x14

Definition at line 51 of file samsung.c.

#define ONENAND_MAIN_SPARE_ACCESS   0x16

Definition at line 53 of file samsung.c.

#define ONENAND_MULTI_ERASE_SET   0x01

Definition at line 40 of file samsung.c.

#define ONENAND_OTP_ACCESS   0x12

Definition at line 49 of file samsung.c.

#define ONENAND_PIPELINE_READ   0x4000

Definition at line 54 of file samsung.c.

#define ONENAND_SPARE_ACCESS_ONLY   0x13

Definition at line 50 of file samsung.c.

#define ONENAND_UNLOCK_ALL   0x0E

Definition at line 48 of file samsung.c.

#define ONENAND_UNLOCK_END   0x09

Definition at line 43 of file samsung.c.

#define ONENAND_UNLOCK_START   0x08

Definition at line 42 of file samsung.c.

#define S3C6400_FBA_SHIFT   10

Definition at line 64 of file samsung.c.

#define S3C6400_FPA_SHIFT   4

Definition at line 65 of file samsung.c.

#define S3C6400_FSA_SHIFT   2

Definition at line 66 of file samsung.c.

#define S3C6410_FBA_SHIFT   12

Definition at line 68 of file samsung.c.

#define S3C6410_FPA_SHIFT   6

Definition at line 69 of file samsung.c.

#define S3C6410_FSA_SHIFT   4

Definition at line 70 of file samsung.c.

#define S3C64XX_CMD_MAP_SHIFT   24

Definition at line 61 of file samsung.c.

#define S5PC100_CMD_MAP_SHIFT   26

Definition at line 62 of file samsung.c.

#define S5PC100_FBA_SHIFT   13

Definition at line 72 of file samsung.c.

#define S5PC100_FPA_SHIFT   7

Definition at line 73 of file samsung.c.

#define S5PC100_FSA_SHIFT   5

Definition at line 74 of file samsung.c.

#define S5PC110_DMA_CFG_16BIT   (0x1 << 0)

Definition at line 106 of file samsung.c.

#define S5PC110_DMA_CFG_16BURST   (0x4 << 16)

Definition at line 100 of file samsung.c.

#define S5PC110_DMA_CFG_32BIT   (0x2 << 0)

Definition at line 107 of file samsung.c.

#define S5PC110_DMA_CFG_4BURST   (0x2 << 16)

Definition at line 98 of file samsung.c.

#define S5PC110_DMA_CFG_8BIT   (0x0 << 0)

Definition at line 105 of file samsung.c.

#define S5PC110_DMA_CFG_8BURST   (0x3 << 16)

Definition at line 99 of file samsung.c.

#define S5PC110_DMA_CFG_CNT   (0x1 << 8)

Definition at line 103 of file samsung.c.

#define S5PC110_DMA_CFG_INC   (0x0 << 8)

Definition at line 102 of file samsung.c.

#define S5PC110_DMA_CFG_SINGLE   (0x0 << 16)

Definition at line 97 of file samsung.c.

#define S5PC110_DMA_DIR_READ   0x0

Definition at line 130 of file samsung.c.

#define S5PC110_DMA_DIR_WRITE   0x1

Definition at line 131 of file samsung.c.

#define S5PC110_DMA_DST_ADDR   0x408

Definition at line 79 of file samsung.c.

#define S5PC110_DMA_DST_CFG   0x40C

Definition at line 80 of file samsung.c.

#define S5PC110_DMA_DST_CFG_READ
Value:
S5PC110_DMA_CFG_INC | \
S5PC110_DMA_CFG_32BIT)

Definition at line 112 of file samsung.c.

#define S5PC110_DMA_DST_CFG_WRITE
Value:
S5PC110_DMA_CFG_INC | \
S5PC110_DMA_CFG_16BIT)

Definition at line 118 of file samsung.c.

#define S5PC110_DMA_SRC_ADDR   0x400

Definition at line 77 of file samsung.c.

#define S5PC110_DMA_SRC_CFG   0x404

Definition at line 78 of file samsung.c.

#define S5PC110_DMA_SRC_CFG_READ
Value:
S5PC110_DMA_CFG_INC | \
S5PC110_DMA_CFG_16BIT)

Definition at line 109 of file samsung.c.

#define S5PC110_DMA_SRC_CFG_WRITE
Value:
S5PC110_DMA_CFG_INC | \
S5PC110_DMA_CFG_32BIT)

Definition at line 115 of file samsung.c.

#define S5PC110_DMA_TRANS_CMD   0x418

Definition at line 82 of file samsung.c.

#define S5PC110_DMA_TRANS_CMD_TDC   (0x1 << 18)

Definition at line 122 of file samsung.c.

#define S5PC110_DMA_TRANS_CMD_TEC   (0x1 << 16)

Definition at line 123 of file samsung.c.

#define S5PC110_DMA_TRANS_CMD_TR   (0x1 << 0)

Definition at line 124 of file samsung.c.

#define S5PC110_DMA_TRANS_DIR   0x420

Definition at line 84 of file samsung.c.

#define S5PC110_DMA_TRANS_SIZE   0x414

Definition at line 81 of file samsung.c.

#define S5PC110_DMA_TRANS_STATUS   0x41C

Definition at line 83 of file samsung.c.

#define S5PC110_DMA_TRANS_STATUS_TB   (0x1 << 17)

Definition at line 127 of file samsung.c.

#define S5PC110_DMA_TRANS_STATUS_TD   (0x1 << 18)

Definition at line 126 of file samsung.c.

#define S5PC110_DMA_TRANS_STATUS_TE   (0x1 << 16)

Definition at line 128 of file samsung.c.

#define S5PC110_INTC_DMA_CLR   0x1004

Definition at line 85 of file samsung.c.

#define S5PC110_INTC_DMA_MASK   0x1024

Definition at line 87 of file samsung.c.

#define S5PC110_INTC_DMA_PEND   0x1044

Definition at line 89 of file samsung.c.

#define S5PC110_INTC_DMA_STATUS   0x1064

Definition at line 91 of file samsung.c.

#define S5PC110_INTC_DMA_TD   (1 << 24)

Definition at line 94 of file samsung.c.

#define S5PC110_INTC_DMA_TE   (1 << 16)

Definition at line 95 of file samsung.c.

#define S5PC110_INTC_ONENAND_CLR   0x1008

Definition at line 86 of file samsung.c.

#define S5PC110_INTC_ONENAND_MASK   0x1028

Definition at line 88 of file samsung.c.

#define S5PC110_INTC_ONENAND_PEND   0x1048

Definition at line 90 of file samsung.c.

#define S5PC110_INTC_ONENAND_STATUS   0x1068

Definition at line 92 of file samsung.c.

Enumeration Type Documentation

enum soc_type
Enumerator:
TYPE_S3C6400 
TYPE_S3C6410 
TYPE_S5PC100 
TYPE_S5PC110 
SOC_ARCH_EXYNOS4210 
SOC_ARCH_EXYNOS 

Definition at line 32 of file samsung.c.

Function Documentation

MODULE_AUTHOR ( "Kyungmin Park <[email protected]>"  )
MODULE_DESCRIPTION ( "Samsung OneNAND controller support )
MODULE_DEVICE_TABLE ( platform  ,
s3c_onenand_driver_ids   
)
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( s3c_onenand_driver  )