pmc551.h 2.1 KB

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