| 1 | /* |
|---|
| 2 | * |
|---|
| 3 | * PMC551 PCI Mezzanine Ram Device |
|---|
| 4 | * |
|---|
| 5 | * Author: |
|---|
| 6 | * Mark Ferrell |
|---|
| 7 | * Copyright 1999,2000 Nortel Networks |
|---|
| 8 | * |
|---|
| 9 | * License: |
|---|
| 10 | * As part of this driver was derrived from the slram.c driver it falls |
|---|
| 11 | * under the same license, which is GNU General Public License v2 |
|---|
| 12 | */ |
|---|
| 13 | |
|---|
| 14 | #ifndef __MTD_PMC551_H__ |
|---|
| 15 | #define __MTD_PMC551_H__ |
|---|
| 16 | |
|---|
| 17 | #include <asm/types.h> |
|---|
| 18 | |
|---|
| 19 | #include <linux/mtd/mtd.h> |
|---|
| 20 | |
|---|
| 21 | #define PMC551_VERSION "Id: pmc551.h,v 1.5 2003/01/24 16:49:53 dwmw2 Exp\n"\ |
|---|
| 22 | "Ramix PMC551 PCI Mezzanine Ram Driver. (C) 1999,2000 Nortel Networks.\n" |
|---|
| 23 | |
|---|
| 24 | /* |
|---|
| 25 | * Our personal and private information |
|---|
| 26 | */ |
|---|
| 27 | struct mypriv { |
|---|
| 28 | struct pci_dev *dev; |
|---|
| 29 | u_char *start; |
|---|
| 30 | __u32 base_map0; |
|---|
| 31 | __u32 curr_map0; |
|---|
| 32 | __u32 asize; |
|---|
| 33 | struct mtd_info *nextpmc551; |
|---|
| 34 | }; |
|---|
| 35 | |
|---|
| 36 | /* |
|---|
| 37 | * Function Prototypes |
|---|
| 38 | */ |
|---|
| 39 | static int pmc551_erase(struct mtd_info *, struct erase_info *); |
|---|
| 40 | static void pmc551_unpoint(struct mtd_info *, u_char *, loff_t, size_t); |
|---|
| 41 | static int pmc551_point (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char **mtdbuf); |
|---|
| 42 | static int pmc551_read(struct mtd_info *, loff_t, size_t, size_t *, u_char *); |
|---|
| 43 | static int pmc551_write(struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
|---|
| 44 | |
|---|
| 45 | |
|---|
| 46 | /* |
|---|
| 47 | * Define the PCI ID's if the kernel doesn't define them for us |
|---|
| 48 | */ |
|---|
| 49 | #ifndef PCI_VENDOR_ID_V3_SEMI |
|---|
| 50 | #define PCI_VENDOR_ID_V3_SEMI 0x11b0 |
|---|
| 51 | #endif |
|---|
| 52 | |
|---|
| 53 | #ifndef PCI_DEVICE_ID_V3_SEMI_V370PDC |
|---|
| 54 | #define PCI_DEVICE_ID_V3_SEMI_V370PDC 0x0200 |
|---|
| 55 | #endif |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | #define PMC551_PCI_MEM_MAP0 0x50 |
|---|
| 59 | #define PMC551_PCI_MEM_MAP1 0x54 |
|---|
| 60 | #define PMC551_PCI_MEM_MAP_MAP_ADDR_MASK 0x3ff00000 |
|---|
| 61 | #define PMC551_PCI_MEM_MAP_APERTURE_MASK 0x000000f0 |
|---|
| 62 | #define PMC551_PCI_MEM_MAP_REG_EN 0x00000002 |
|---|
| 63 | #define PMC551_PCI_MEM_MAP_ENABLE 0x00000001 |
|---|
| 64 | |
|---|
| 65 | #define PMC551_SDRAM_MA 0x60 |
|---|
| 66 | #define PMC551_SDRAM_CMD 0x62 |
|---|
| 67 | #define PMC551_DRAM_CFG 0x64 |
|---|
| 68 | #define PMC551_SYS_CTRL_REG 0x78 |
|---|
| 69 | |
|---|
| 70 | #define PMC551_DRAM_BLK0 0x68 |
|---|
| 71 | #define PMC551_DRAM_BLK1 0x6c |
|---|
| 72 | #define PMC551_DRAM_BLK2 0x70 |
|---|
| 73 | #define PMC551_DRAM_BLK3 0x74 |
|---|
| 74 | #define PMC551_DRAM_BLK_GET_SIZE(x) (524288<<((x>>4)&0x0f)) |
|---|
| 75 | #define PMC551_DRAM_BLK_SET_COL_MUX(x,v) (((x) & ~0x00007000) | (((v) & 0x7) << 12)) |
|---|
| 76 | #define PMC551_DRAM_BLK_SET_ROW_MUX(x,v) (((x) & ~0x00000f00) | (((v) & 0xf) << 8)) |
|---|
| 77 | |
|---|
| 78 | |
|---|
| 79 | #endif /* __MTD_PMC551_H__ */ |
|---|
| 80 | |
|---|