tiocx.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (c) 2005 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_TIO_TIOCX_H
  9. #define _ASM_IA64_SN_TIO_TIOCX_H
  10. #ifdef __KERNEL__
  11. struct cx_id_s {
  12. unsigned int part_num;
  13. unsigned int mfg_num;
  14. int nasid;
  15. };
  16. struct cx_dev {
  17. struct cx_id_s cx_id;
  18. void *soft; /* driver specific */
  19. struct hubdev_info *hubdev;
  20. struct device dev;
  21. struct cx_drv *driver;
  22. };
  23. struct cx_device_id {
  24. unsigned int part_num;
  25. unsigned int mfg_num;
  26. };
  27. struct cx_drv {
  28. char *name;
  29. const struct cx_device_id *id_table;
  30. struct device_driver driver;
  31. int (*probe) (struct cx_dev * dev, const struct cx_device_id * id);
  32. int (*remove) (struct cx_dev * dev);
  33. };
  34. /* create DMA address by stripping AS bits */
  35. #define TIOCX_DMA_ADDR(a) (uint64_t)((uint64_t)(a) & 0xffffcfffffffffUL)
  36. #define TIOCX_TO_TIOCX_DMA_ADDR(a) (uint64_t)(((uint64_t)(a) & 0xfffffffff) | \
  37. ((((uint64_t)(a)) & 0xffffc000000000UL) <<2))
  38. #define TIO_CE_ASIC_PARTNUM 0xce00
  39. #define TIOCX_CORELET 3
  40. /* These are taken from tio_mmr_as.h */
  41. #define TIO_ICE_FRZ_CFG TIO_MMR_ADDR_MOD(0x00000000b0008100UL)
  42. #define TIO_ICE_PMI_TX_CFG TIO_MMR_ADDR_MOD(0x00000000b000b100UL)
  43. #define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3 TIO_MMR_ADDR_MOD(0x00000000b000be18UL)
  44. #define TIO_ICE_PMI_TX_DYN_CREDIT_STAT_CB3_CREDIT_CNT_MASK 0x000000000000000fUL
  45. #define to_cx_dev(n) container_of(n, struct cx_dev, dev)
  46. #define to_cx_driver(drv) container_of(drv, struct cx_drv, driver)
  47. extern struct sn_irq_info *tiocx_irq_alloc(nasid_t, int, int, nasid_t, int);
  48. extern void tiocx_irq_free(struct sn_irq_info *);
  49. extern int cx_device_unregister(struct cx_dev *);
  50. extern int cx_device_register(nasid_t, int, int, struct hubdev_info *);
  51. extern int cx_driver_unregister(struct cx_drv *);
  52. extern int cx_driver_register(struct cx_drv *);
  53. extern uint64_t tiocx_dma_addr(uint64_t addr);
  54. extern uint64_t tiocx_swin_base(int nasid);
  55. extern void tiocx_mmr_store(int nasid, uint64_t offset, uint64_t value);
  56. extern uint64_t tiocx_mmr_load(int nasid, uint64_t offset);
  57. #endif // __KERNEL__
  58. #endif // _ASM_IA64_SN_TIO_TIOCX__