mv64x60.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Author: Mark A. Greer <source@mvista.com>
  3. *
  4. * 2007 (c) MontaVista Software, Inc. This file is licensed under
  5. * the terms of the GNU General Public License version 2. This program
  6. * is licensed "as is" without any warranty of any kind, whether express
  7. * or implied.
  8. */
  9. #ifndef _PPC_BOOT_MV64x60_H_
  10. #define _PPC_BOOT_MV64x60_H_
  11. #define MV64x60_CPU_BAR_ENABLE 0x0278
  12. #define MV64x60_PCI_ACC_CNTL_ENABLE (1<<0)
  13. #define MV64x60_PCI_ACC_CNTL_REQ64 (1<<1)
  14. #define MV64x60_PCI_ACC_CNTL_SNOOP_NONE 0x00000000
  15. #define MV64x60_PCI_ACC_CNTL_SNOOP_WT 0x00000004
  16. #define MV64x60_PCI_ACC_CNTL_SNOOP_WB 0x00000008
  17. #define MV64x60_PCI_ACC_CNTL_SNOOP_MASK 0x0000000c
  18. #define MV64x60_PCI_ACC_CNTL_ACCPROT (1<<4)
  19. #define MV64x60_PCI_ACC_CNTL_WRPROT (1<<5)
  20. #define MV64x60_PCI_ACC_CNTL_SWAP_BYTE 0x00000000
  21. #define MV64x60_PCI_ACC_CNTL_SWAP_NONE 0x00000040
  22. #define MV64x60_PCI_ACC_CNTL_SWAP_BYTE_WORD 0x00000080
  23. #define MV64x60_PCI_ACC_CNTL_SWAP_WORD 0x000000c0
  24. #define MV64x60_PCI_ACC_CNTL_SWAP_MASK 0x000000c0
  25. #define MV64x60_PCI_ACC_CNTL_MBURST_32_BYTES 0x00000000
  26. #define MV64x60_PCI_ACC_CNTL_MBURST_64_BYTES 0x00000100
  27. #define MV64x60_PCI_ACC_CNTL_MBURST_128_BYTES 0x00000200
  28. #define MV64x60_PCI_ACC_CNTL_MBURST_MASK 0x00000300
  29. #define MV64x60_PCI_ACC_CNTL_RDSIZE_32_BYTES 0x00000000
  30. #define MV64x60_PCI_ACC_CNTL_RDSIZE_64_BYTES 0x00000400
  31. #define MV64x60_PCI_ACC_CNTL_RDSIZE_128_BYTES 0x00000800
  32. #define MV64x60_PCI_ACC_CNTL_RDSIZE_256_BYTES 0x00000c00
  33. #define MV64x60_PCI_ACC_CNTL_RDSIZE_MASK 0x00000c00
  34. struct mv64x60_cpu2pci_win {
  35. u32 lo;
  36. u32 size;
  37. u32 remap_hi;
  38. u32 remap_lo;
  39. };
  40. extern struct mv64x60_cpu2pci_win mv64x60_cpu2pci_io[2];
  41. extern struct mv64x60_cpu2pci_win mv64x60_cpu2pci_mem[2];
  42. u32 mv64x60_cfg_read(u8 *bridge_base, u8 hose, u8 bus, u8 devfn,
  43. u8 offset);
  44. void mv64x60_cfg_write(u8 *bridge_base, u8 hose, u8 bus, u8 devfn,
  45. u8 offset, u32 val);
  46. void mv64x60_config_ctlr_windows(u8 *bridge_base, u8 *bridge_pbase,
  47. u8 is_coherent);
  48. void mv64x60_config_pci_windows(u8 *bridge_base, u8 *bridge_pbase, u8 hose,
  49. u8 bus, u32 mem_size, u32 acc_bits);
  50. void mv64x60_config_cpu2pci_window(u8 *bridge_base, u8 hose, u32 pci_base_hi,
  51. u32 pci_base_lo, u32 cpu_base, u32 size,
  52. struct mv64x60_cpu2pci_win *offset_tbl);
  53. u32 mv64x60_get_mem_size(u8 *bridge_base);
  54. u8 *mv64x60_get_bridge_pbase(void);
  55. u8 *mv64x60_get_bridge_base(void);
  56. u8 mv64x60_is_coherent(void);
  57. int mv64x60_i2c_open(void);
  58. int mv64x60_i2c_read(u32 devaddr, u8 *buf, u32 offset, u32 offset_size,
  59. u32 count);
  60. void mv64x60_i2c_close(void);
  61. #endif /* _PPC_BOOT_MV64x60_H_ */