diff options
Diffstat (limited to 'drivers/mtd/devices/pmc551.c')
-rw-r--r-- | drivers/mtd/devices/pmc551.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c index d394e06e4279..6269a434f304 100644 --- a/drivers/mtd/devices/pmc551.c +++ b/drivers/mtd/devices/pmc551.c | |||
@@ -95,12 +95,48 @@ | |||
95 | #include <asm/io.h> | 95 | #include <asm/io.h> |
96 | #include <asm/system.h> | 96 | #include <asm/system.h> |
97 | #include <linux/pci.h> | 97 | #include <linux/pci.h> |
98 | |||
99 | #include <linux/mtd/mtd.h> | 98 | #include <linux/mtd/mtd.h> |
100 | #include <linux/mtd/pmc551.h> | 99 | |
100 | #define PMC551_VERSION \ | ||
101 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" | ||
102 | |||
103 | #define PCI_VENDOR_ID_V3_SEMI 0x11b0 | ||
104 | #define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 | ||
105 | |||
106 | #define PMC551_PCI_MEM_MAP0 0x50 | ||
107 | #define PMC551_PCI_MEM_MAP1 0x54 | ||
108 | #define PMC551_PCI_MEM_MAP_MAP_ADDR_MASK 0x3ff00000 | ||
109 | #define PMC551_PCI_MEM_MAP_APERTURE_MASK 0x000000f0 | ||
110 | #define PMC551_PCI_MEM_MAP_REG_EN 0x00000002 | ||
111 | #define PMC551_PCI_MEM_MAP_ENABLE 0x00000001 | ||
112 | |||
113 | #define PMC551_SDRAM_MA 0x60 | ||
114 | #define PMC551_SDRAM_CMD 0x62 | ||
115 | #define PMC551_DRAM_CFG 0x64 | ||
116 | #define PMC551_SYS_CTRL_REG 0x78 | ||
117 | |||
118 | #define PMC551_DRAM_BLK0 0x68 | ||
119 | #define PMC551_DRAM_BLK1 0x6c | ||
120 | #define PMC551_DRAM_BLK2 0x70 | ||
121 | #define PMC551_DRAM_BLK3 0x74 | ||
122 | #define PMC551_DRAM_BLK_GET_SIZE(x) (524288 << ((x >> 4) & 0x0f)) | ||
123 | #define PMC551_DRAM_BLK_SET_COL_MUX(x, v) (((x) & ~0x00007000) | (((v) & 0x7) << 12)) | ||
124 | #define PMC551_DRAM_BLK_SET_ROW_MUX(x, v) (((x) & ~0x00000f00) | (((v) & 0xf) << 8)) | ||
125 | |||
126 | struct mypriv { | ||
127 | struct pci_dev *dev; | ||
128 | u_char *start; | ||
129 | u32 base_map0; | ||
130 | u32 curr_map0; | ||
131 | u32 asize; | ||
132 | struct mtd_info *nextpmc551; | ||
133 | }; | ||
101 | 134 | ||
102 | static struct mtd_info *pmc551list; | 135 | static struct mtd_info *pmc551list; |
103 | 136 | ||
137 | static int pmc551_point(struct mtd_info *mtd, loff_t from, size_t len, | ||
138 | size_t *retlen, void **virt, resource_size_t *phys); | ||
139 | |||
104 | static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr) | 140 | static int pmc551_erase(struct mtd_info *mtd, struct erase_info *instr) |
105 | { | 141 | { |
106 | struct mypriv *priv = mtd->priv; | 142 | struct mypriv *priv = mtd->priv; |