pmc551.h 2.2 KB

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