2 * NAND Flash Controller Device Driver
3 * Copyright (c) 2009, Intel Corporation and its suppliers.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20 /* header for LLD_CDMA.c module */
29 /*/////////// CDMA specific MACRO definition */
30 #define MAX_DESCS (255)
32 #define MAX_SYNC_POINTS (16)
33 #define MAX_DESC_PER_CHAN (MAX_DESCS * 3 + MAX_SYNC_POINTS + 2)
35 #define CHANNEL_SYNC_MASK (0x000F)
36 #define CHANNEL_DMA_MASK (0x00F0)
37 #define CHANNEL_ID_MASK (0x0300)
38 #define CHANNEL_CONT_MASK (0x4000)
39 #define CHANNEL_INTR_MASK (0x8000)
41 #define CHANNEL_SYNC_OFFSET (0)
42 #define CHANNEL_DMA_OFFSET (4)
43 #define CHANNEL_ID_OFFSET (8)
44 #define CHANNEL_CONT_OFFSET (14)
45 #define CHANNEL_INTR_OFFSET (15)
47 u16
CDMA_Data_CMD(u8 cmd
, u8
*data
, u32 block
, u16 page
, u16 num
, u16 flags
);
48 u16
CDMA_MemCopy_CMD(u8
*dest
, u8
*src
, u32 byte_cnt
, u16 flags
);
49 u16
CDMA_Execute_CMDs(void);
50 void print_pending_cmds(void);
51 void print_cdma_descriptors(void);
53 extern u8 g_SBDCmdIndex
;
54 extern struct mrst_nand_info info
;
57 /*/////////// prototypes: APIs for LLD_CDMA */
58 int is_cdma_interrupt(void);
59 u16
CDMA_Event_Status(void);
61 /* CMD-DMA Descriptor Struct. These are defined by the CMD_DMA HW */
62 struct cdma_descriptor
{
78 u32 pcmd
; /* pending cmd num related to this descriptor */
81 /* This struct holds one MemCopy descriptor as defined by the HW */
82 struct memcpy_descriptor
{
101 /* Pending CMD table entries (includes MemCopy parameters */
116 extern u32 debug_sync_cnt
;
119 /* Definitions for CMD DMA descriptor chain fields */
120 #define CMD_DMA_DESC_COMP 0x8000
121 #define CMD_DMA_DESC_FAIL 0x4000
123 #endif /*_LLD_CDMA_*/