source: svn/trunk/newcon3bcm2_21bu/toolchain/mips-linux-uclibc/include/linux/umem.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 3.9 KB
RevLine 
[2]1
2/*
3 * This file contains defines for the
4 *   Micro Memory MM5415
5 * family PCI Memory Module with Battery Backup.
6 *
7 * Copyright Micro Memory INC 2001.  All rights reserved.
8 * Release under the terms of the GNU GENERAL PUBLIC LICENSE version 2.
9 * See the file COPYING.
10 */
11
12#ifndef _DRIVERS_BLOCK_MM_H
13#define _DRIVERS_BLOCK_MM_H
14
15#include <asm/types.h>
16
17
18#define IRQ_TIMEOUT (1 * HZ)
19
20/* CSR register definition */
21#define MEMCTRLSTATUS_MAGIC     0x00
22#define  MM_MAGIC_VALUE         (unsigned char)0x59
23
24#define MEMCTRLSTATUS_BATTERY   0x04
25#define  BATTERY_1_DISABLED     0x01
26#define  BATTERY_1_FAILURE      0x02
27#define  BATTERY_2_DISABLED     0x04
28#define  BATTERY_2_FAILURE      0x08
29
30#define MEMCTRLSTATUS_MEMORY    0x07
31#define  MEM_128_MB             0xfe
32#define  MEM_256_MB             0xfc
33#define  MEM_512_MB             0xf8
34#define  MEM_1_GB               0xf0
35#define  MEM_2_GB               0xe0
36
37#define MEMCTRLCMD_LEDCTRL      0x08
38#define  LED_REMOVE             2
39#define  LED_FAULT              4
40#define  LED_POWER              6
41#define  LED_FLIP               255
42#define  LED_OFF                0x00
43#define  LED_ON                 0x01
44#define  LED_FLASH_3_5          0x02
45#define  LED_FLASH_7_0          0x03
46#define  LED_POWER_ON           0x00
47#define  LED_POWER_OFF          0x01
48#define  USER_BIT1              0x01
49#define  USER_BIT2              0x02
50
51#define MEMORY_INITIALIZED      USER_BIT1
52
53#define MEMCTRLCMD_ERRCTRL      0x0C
54#define  EDC_NONE_DEFAULT       0x00
55#define  EDC_NONE               0x01
56#define  EDC_STORE_READ         0x02
57#define  EDC_STORE_CORRECT      0x03
58
59#define MEMCTRLCMD_ERRCNT       0x0D
60#define MEMCTRLCMD_ERRSTATUS    0x0E
61
62#define ERROR_DATA_LOG          0x20
63#define ERROR_ADDR_LOG          0x28
64#define ERROR_COUNT             0x3D
65#define ERROR_SYNDROME          0x3E
66#define ERROR_CHECK             0x3F
67
68#define DMA_PCI_ADDR            0x40
69#define DMA_LOCAL_ADDR          0x48
70#define DMA_TRANSFER_SIZE       0x50
71#define DMA_DESCRIPTOR_ADDR     0x58
72#define DMA_SEMAPHORE_ADDR      0x60
73#define DMA_STATUS_CTRL         0x68
74#define  DMASCR_GO              0x00001
75#define  DMASCR_TRANSFER_READ   0x00002
76#define  DMASCR_CHAIN_EN        0x00004
77#define  DMASCR_SEM_EN          0x00010
78#define  DMASCR_DMA_COMP_EN     0x00020
79#define  DMASCR_CHAIN_COMP_EN   0x00040
80#define  DMASCR_ERR_INT_EN      0x00080
81#define  DMASCR_PARITY_INT_EN   0x00100
82#define  DMASCR_ANY_ERR         0x00800
83#define  DMASCR_MBE_ERR         0x01000
84#define  DMASCR_PARITY_ERR_REP  0x02000
85#define  DMASCR_PARITY_ERR_DET  0x04000
86#define  DMASCR_SYSTEM_ERR_SIG  0x08000
87#define  DMASCR_TARGET_ABT      0x10000
88#define  DMASCR_MASTER_ABT      0x20000
89#define  DMASCR_DMA_COMPLETE    0x40000
90#define  DMASCR_CHAIN_COMPLETE  0x80000
91
92/*
933.SOME PCs HAVE HOST BRIDGES WHICH APPARENTLY DO NOT CORRECTLY HANDLE
94READ-LINE (0xE) OR READ-MULTIPLE (0xC) PCI COMMAND CODES DURING DMA
95TRANSFERS. IN OTHER SYSTEMS THESE COMMAND CODES WILL CAUSE THE HOST BRIDGE
96TO ALLOW LONGER BURSTS DURING DMA READ OPERATIONS. THE UPPER FOUR BITS
97(31..28) OF THE DMA CSR HAVE BEEN MADE PROGRAMMABLE, SO THAT EITHER A 0x6,
98AN 0xE OR A 0xC CAN BE WRITTEN TO THEM TO SET THE COMMAND CODE USED DURING
99DMA READ OPERATIONS.
100*/
101#define        DMASCR_READ   0x60000000
102#define        DMASCR_READLINE   0xE0000000
103#define        DMASCR_READMULTI   0xC0000000
104
105
106#define DMASCR_ERROR_MASK       (DMASCR_MASTER_ABT | DMASCR_TARGET_ABT | DMASCR_SYSTEM_ERR_SIG | DMASCR_PARITY_ERR_DET | DMASCR_MBE_ERR | DMASCR_ANY_ERR)
107#define DMASCR_HARD_ERROR       (DMASCR_MASTER_ABT | DMASCR_TARGET_ABT | DMASCR_SYSTEM_ERR_SIG | DMASCR_PARITY_ERR_DET | DMASCR_MBE_ERR)
108
109#define WINDOWMAP_WINNUM        0x7B
110
111#define DMA_READ_FROM_HOST 0
112#define DMA_WRITE_TO_HOST 1
113
114struct mm_dma_desc {
115        __le64  pci_addr;
116        __le64  local_addr;
117        __le32  transfer_size;
118        __u32   zero1;
119        __le64  next_desc_addr;
120        __le64  sem_addr;
121        __le32  control_bits;
122        __u32   zero2;
123
124        dma_addr_t data_dma_handle;
125
126        /* Copy of the bits */
127        __le64  sem_control_bits;
128} __attribute__((aligned(8)));
129
130#define PCI_VENDOR_ID_MICRO_MEMORY              0x1332
131#define PCI_DEVICE_ID_MICRO_MEMORY_5415CN       0x5415
132#define PCI_DEVICE_ID_MICRO_MEMORY_5425CN       0x5425
133#define PCI_DEVICE_ID_MICRO_MEMORY_6155         0x6155
134
135/* bits for card->flags */
136#define UM_FLAG_DMA_IN_REGS             1
137#define UM_FLAG_NO_BYTE_STATUS          2
138#define UM_FLAG_NO_BATTREG              4
139#define UM_FLAG_NO_BATT                 8
140#endif
Note: See TracBrowser for help on using the repository browser.