hubdev.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
  7. */
  8. #ifndef _ASM_IA64_SN_XTALK_HUBDEV_H
  9. #define _ASM_IA64_SN_XTALK_HUBDEV_H
  10. #include "xtalk/xwidgetdev.h"
  11. #define HUB_WIDGET_ID_MAX 0xf
  12. #define DEV_PER_WIDGET (2*2*8)
  13. #define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */
  14. #define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1)
  15. #define IIO_ITTE_WIDGET_SHIFT 8
  16. #define IIO_ITTE_WIDGET(itte) \
  17. (((itte) >> IIO_ITTE_WIDGET_SHIFT) & IIO_ITTE_WIDGET_MASK)
  18. /*
  19. * Use the top big window as a surrogate for the first small window
  20. */
  21. #define SWIN0_BIGWIN HUB_NUM_BIG_WINDOW
  22. #define IIO_NUM_ITTES 7
  23. #define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1)
  24. /* This struct is shared between the PROM and the kernel.
  25. * Changes to this struct will require corresponding changes to the kernel.
  26. */
  27. struct sn_flush_device_common {
  28. int sfdl_bus;
  29. int sfdl_slot;
  30. int sfdl_pin;
  31. struct common_bar_list {
  32. unsigned long start;
  33. unsigned long end;
  34. } sfdl_bar_list[6];
  35. unsigned long sfdl_force_int_addr;
  36. unsigned long sfdl_flush_value;
  37. volatile unsigned long *sfdl_flush_addr;
  38. u32 sfdl_persistent_busnum;
  39. u32 sfdl_persistent_segment;
  40. struct pcibus_info *sfdl_pcibus_info;
  41. };
  42. /* This struct is kernel only and is not used by the PROM */
  43. struct sn_flush_device_kernel {
  44. spinlock_t sfdl_flush_lock;
  45. struct sn_flush_device_common *common;
  46. };
  47. /* 01/16/06 This struct is the old PROM/kernel struct and needs to be included
  48. * for older official PROMs to function on the new kernel base. This struct
  49. * will be removed when the next official PROM release occurs. */
  50. struct sn_flush_device_war {
  51. struct sn_flush_device_common common;
  52. u32 filler; /* older PROMs expect the default size of a spinlock_t */
  53. };
  54. /*
  55. * **widget_p - Used as an array[wid_num][device] of sn_flush_device_kernel.
  56. */
  57. struct sn_flush_nasid_entry {
  58. struct sn_flush_device_kernel **widget_p; // Used as an array of wid_num
  59. u64 iio_itte[8];
  60. };
  61. struct hubdev_info {
  62. geoid_t hdi_geoid;
  63. short hdi_nasid;
  64. short hdi_peer_nasid; /* Dual Porting Peer */
  65. struct sn_flush_nasid_entry hdi_flush_nasid_list;
  66. struct xwidget_info hdi_xwidget_info[HUB_WIDGET_ID_MAX + 1];
  67. void *hdi_nodepda;
  68. void *hdi_node_vertex;
  69. u32 max_segment_number;
  70. u32 max_pcibus_number;
  71. };
  72. extern void hubdev_init_node(nodepda_t *, cnodeid_t);
  73. extern void hub_error_init(struct hubdev_info *);
  74. extern void ice_error_init(struct hubdev_info *);
  75. #endif /* _ASM_IA64_SN_XTALK_HUBDEV_H */