bridge.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:72k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* $Id$
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1992 - 1997, 2000 Silicon Graphics, Inc.
  8.  * Copyright (C) 2000 by Colin Ngam
  9.  */
  10. #ifndef _ASM_SN_PCI_BRIDGE_H
  11. #define _ASM_SN_PCI_BRIDGE_H
  12. /*
  13.  * bridge.h - header file for bridge chip and bridge portion of xbridge chip
  14.  */
  15. #include <asm/sn/xtalk/xwidget.h>
  16. /* I/O page size */
  17. #if _PAGESZ == 4096
  18. #define IOPFNSHIFT 12 /* 4K per mapped page */
  19. #else
  20. #define IOPFNSHIFT 14 /* 16K per mapped page */
  21. #endif /* _PAGESZ */
  22. #define IOPGSIZE (1 << IOPFNSHIFT)
  23. #define IOPG(x) ((x) >> IOPFNSHIFT)
  24. #define IOPGOFF(x) ((x) & (IOPGSIZE-1))
  25. /* Bridge RAM sizes */
  26. #define BRIDGE_INTERNAL_ATES 128
  27. #define XBRIDGE_INTERNAL_ATES 1024
  28. #define BRIDGE_ATE_RAM_SIZE     (BRIDGE_INTERNAL_ATES<<3) /* 1kB ATE */
  29. #define XBRIDGE_ATE_RAM_SIZE    (XBRIDGE_INTERNAL_ATES<<3) /* 8kB ATE */
  30. #define BRIDGE_CONFIG_BASE 0x20000 /* start of bridge's */
  31. /* map to each device's */
  32. /* config space */
  33. #define BRIDGE_CONFIG1_BASE 0x28000 /* type 1 device config space */
  34. #define BRIDGE_CONFIG_END 0x30000
  35. #define BRIDGE_CONFIG_SLOT_SIZE 0x1000 /* each map == 4k */
  36. #define BRIDGE_SSRAM_512K 0x00080000 /* 512kB */
  37. #define BRIDGE_SSRAM_128K 0x00020000 /* 128kB */
  38. #define BRIDGE_SSRAM_64K 0x00010000 /* 64kB */
  39. #define BRIDGE_SSRAM_0K 0x00000000 /* 0kB */
  40. /* ========================================================================
  41.  *    Bridge address map
  42.  */
  43. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  44. #ifdef __cplusplus
  45. extern "C" {
  46. #endif
  47. /*
  48.  * All accesses to bridge hardware registers must be done
  49.  * using 32-bit loads and stores.
  50.  */
  51. typedef uint32_t bridgereg_t;
  52. typedef uint64_t bridge_ate_t;
  53. /* pointers to bridge ATEs
  54.  * are always "pointer to volatile"
  55.  */
  56. typedef volatile bridge_ate_t  *bridge_ate_p;
  57. /*
  58.  * It is generally preferred that hardware registers on the bridge
  59.  * are located from C code via this structure.
  60.  *
  61.  * Generated from Bridge spec dated 04oct95
  62.  */
  63. #ifdef LITTLE_ENDIAN
  64. typedef volatile struct bridge_s {
  65.     /* Local Registers        0x000000-0x00FFFF */
  66.     /* standard widget configuration        0x000000-0x000057 */
  67.     widget_cfg_t     b_widget;     /* 0x000000 */
  68.     /* helper fieldnames for accessing bridge widget */
  69. #define b_wid_id b_widget.w_id
  70. #define b_wid_stat b_widget.w_status
  71. #define b_wid_err_upper b_widget.w_err_upper_addr
  72. #define b_wid_err_lower b_widget.w_err_lower_addr
  73. #define b_wid_control b_widget.w_control
  74. #define b_wid_req_timeout b_widget.w_req_timeout
  75. #define b_wid_int_upper b_widget.w_intdest_upper_addr
  76. #define b_wid_int_lower b_widget.w_intdest_lower_addr
  77. #define b_wid_err_cmdword b_widget.w_err_cmd_word
  78. #define b_wid_llp b_widget.w_llp_cfg
  79. #define b_wid_tflush b_widget.w_tflush
  80.     /*
  81.      * we access these through synergy unswizzled space, so the address
  82.      * gets twiddled (i.e. references to 0x4 actually go to 0x0 and vv.)
  83.      * That's why we put the register first and filler second.
  84.      */
  85.     /* bridge-specific widget configuration        0x000058-0x00007F */
  86.     bridgereg_t             b_wid_aux_err;          /* 0x00005C */
  87.     bridgereg_t     _pad_000058;
  88.     bridgereg_t             b_wid_resp_upper;       /* 0x000064 */
  89.     bridgereg_t             _pad_000060;
  90.     bridgereg_t             b_wid_resp_lower;       /* 0x00006C */
  91.     bridgereg_t             _pad_000068;
  92.     bridgereg_t             b_wid_tst_pin_ctrl;     /* 0x000074 */
  93.     bridgereg_t             _pad_000070;
  94.     bridgereg_t     _pad_000078[2];
  95.     /* PMU & Map        0x000080-0x00008F */
  96.     bridgereg_t             b_dir_map;              /* 0x000084 */
  97.     bridgereg_t             _pad_000080;
  98.     bridgereg_t     _pad_000088[2];
  99.     /* SSRAM        0x000090-0x00009F */
  100.     bridgereg_t             b_ram_perr_or_map_fault;/* 0x000094 */
  101.     bridgereg_t             _pad_000090;
  102. #define b_ram_perr  b_ram_perr_or_map_fault /* Bridge */
  103. #define b_map_fault b_ram_perr_or_map_fault /* Xbridge */
  104.     bridgereg_t     _pad_000098[2];
  105.     /* Arbitration        0x0000A0-0x0000AF */
  106.     bridgereg_t             b_arb;                  /* 0x0000A4 */
  107.     bridgereg_t             _pad_0000A0;
  108.     bridgereg_t     _pad_0000A8[2];
  109.     /* Number In A Can        0x0000B0-0x0000BF */
  110.     bridgereg_t             b_nic;                  /* 0x0000B4 */
  111.     bridgereg_t             _pad_0000B0;
  112.     bridgereg_t     _pad_0000B8[2];
  113.     /* PCI/GIO        0x0000C0-0x0000FF */
  114.     bridgereg_t             b_bus_timeout;          /* 0x0000C4 */
  115.     bridgereg_t             _pad_0000C0;
  116. #define b_pci_bus_timeout b_bus_timeout
  117.     bridgereg_t             b_pci_cfg;              /* 0x0000CC */
  118.     bridgereg_t             _pad_0000C8;
  119.     bridgereg_t             b_pci_err_upper;        /* 0x0000D4 */
  120.     bridgereg_t             _pad_0000D0;
  121.     bridgereg_t             b_pci_err_lower;        /* 0x0000DC */
  122.     bridgereg_t             _pad_0000D8;
  123.     bridgereg_t     _pad_0000E0[8];
  124. #define b_gio_err_lower b_pci_err_lower
  125. #define b_gio_err_upper b_pci_err_upper
  126.     /* Interrupt        0x000100-0x0001FF */
  127.     bridgereg_t             b_int_status;           /* 0x000104 */
  128.     bridgereg_t             _pad_000100;
  129.     bridgereg_t             b_int_enable;           /* 0x00010C */
  130.     bridgereg_t             _pad_000108;
  131.     bridgereg_t             b_int_rst_stat;         /* 0x000114 */
  132.     bridgereg_t             _pad_000110;
  133.     bridgereg_t             b_int_mode;             /* 0x00011C */
  134.     bridgereg_t             _pad_000118;
  135.     bridgereg_t             b_int_device;           /* 0x000124 */
  136.     bridgereg_t             _pad_000120;
  137.     bridgereg_t             b_int_host_err;         /* 0x00012C */
  138.     bridgereg_t             _pad_000128;
  139.     struct {
  140.         bridgereg_t             addr;               /* 0x0001{34,,,6C} */
  141.         bridgereg_t             __pad;              /* 0x0001{30,,,68} */
  142.     } b_int_addr[8];     /* 0x000130 */
  143.     bridgereg_t             b_err_int_view;         /* 0x000174 */
  144.     bridgereg_t             _pad_000170;
  145.     bridgereg_t             b_mult_int;             /* 0x00017c */
  146.     bridgereg_t             _pad_000178;
  147.     struct {
  148.         bridgereg_t             intr;               /* 0x0001{84,,,BC} */
  149.         bridgereg_t             __pad;              /* 0x0001{80,,,B8} */
  150.     } b_force_always[8];     /* 0x000180 */
  151.     struct {
  152.         bridgereg_t             intr;               /* 0x0001{C4,,,FC} */
  153.         bridgereg_t             __pad;              /* 0x0001{C0,,,F8} */
  154.     } b_force_pin[8];          /* 0x0001C0 */
  155.     /* Device        0x000200-0x0003FF */
  156.     struct {
  157.         bridgereg_t             reg;                /* 0x0002{04,,,3C} */
  158.         bridgereg_t             __pad;              /* 0x0002{00,,,38} */
  159.     } b_device[8];     /* 0x000200 */
  160.     struct {
  161.         bridgereg_t             reg;                /* 0x0002{44,,,7C} */
  162.         bridgereg_t             __pad;              /* 0x0002{40,,,78} */
  163.     } b_wr_req_buf[8];     /* 0x000240 */
  164.     struct {
  165.         bridgereg_t             reg;                /* 0x0002{84,,,8C} */
  166.         bridgereg_t             __pad;              /* 0x0002{80,,,88} */
  167.     } b_rrb_map[2];     /* 0x000280 */
  168. #define b_even_resp b_rrb_map[0].reg     /* 0x000284 */
  169. #define b_odd_resp b_rrb_map[1].reg     /* 0x00028C */
  170.     bridgereg_t             b_resp_status;          /* 0x000294 */
  171.     bridgereg_t             _pad_000290;
  172.     bridgereg_t             b_resp_clear;           /* 0x00029C */
  173.     bridgereg_t             _pad_000298;
  174.     bridgereg_t     _pad_0002A0[24];
  175.     /* Xbridge only */
  176.     struct {
  177. bridgereg_t         upper;              /* 0x0003{04,,,F4} */
  178. bridgereg_t             __pad1;     /* 0x0003{00,,,F0} */
  179. bridgereg_t             lower;              /* 0x0003{0C,,,FC} */
  180. bridgereg_t             __pad2;             /* 0x0003{08,,,F8} */
  181.     } b_buf_addr_match[16];
  182.     /* Performance Monitor Registers (even only) */
  183.     struct {
  184.         bridgereg_t             flush_w_touch;      /* 0x000404,,,5C4 */
  185.         bridgereg_t             __pad1;             /* 0x000400,,,5C0 */
  186.         bridgereg_t             flush_wo_touch;     /* 0x00040C,,,5CC */
  187.         bridgereg_t             __pad2;             /* 0x000408,,,5C8 */
  188.         bridgereg_t             inflight;           /* 0x000414,,,5D4 */
  189.         bridgereg_t             __pad3;             /* 0x000410,,,5D0 */
  190.         bridgereg_t             prefetch;           /* 0x00041C,,,5DC */
  191.         bridgereg_t             __pad4;             /* 0x000418,,,5D8 */
  192.         bridgereg_t             total_pci_retry;    /* 0x000424,,,5E4 */
  193.         bridgereg_t             __pad5;             /* 0x000420,,,5E0 */
  194.         bridgereg_t             max_pci_retry;      /* 0x00042C,,,5EC */
  195.         bridgereg_t             __pad6;             /* 0x000428,,,5E8 */
  196.         bridgereg_t             max_latency;        /* 0x000434,,,5F4 */
  197.         bridgereg_t             __pad7;             /* 0x000430,,,5F0 */
  198.         bridgereg_t             clear_all;          /* 0x00043C,,,5FC */
  199.         bridgereg_t             __pad8;             /* 0x000438,,,5F8 */
  200.     } b_buf_count[8];
  201.     char                    _pad_000600[0x010000 - 0x000600];
  202.     /*
  203.      * The Xbridge has 1024 internal ATE's and the Bridge has 128.
  204.      * Make enough room for the Xbridge ATE's and depend on runtime
  205.      * checks to limit access to bridge ATE's.
  206.      */
  207.     /* Internal Address Translation Entry RAM        0x010000-0x011fff */
  208.     union {
  209. bridge_ate_t wr; /* write-only */
  210. struct {
  211.     bridgereg_t             rd;         /* read-only */
  212.             bridgereg_t             _p_pad;
  213. } hi;
  214.     }     b_int_ate_ram[XBRIDGE_INTERNAL_ATES];
  215. #define b_int_ate_ram_lo(idx) b_int_ate_ram[idx+512].hi.rd
  216.     /* the xbridge read path for internal ates starts at 0x12000.
  217.      * I don't believe we ever try to read the ates.
  218.      */
  219.     /* Internal Address Translation Entry RAM LOW       0x012000-0x013fff */
  220.     struct {
  221. bridgereg_t             rd; 
  222.         bridgereg_t             _p_pad;
  223.     }     xb_int_ate_ram_lo[XBRIDGE_INTERNAL_ATES];
  224.     char     _pad_014000[0x20000 - 0x014000];
  225.     /* PCI Device Configuration Spaces        0x020000-0x027FFF */
  226.     union { /* make all access sizes available. */
  227. uchar_t c[0x1000 / 1];
  228. uint16_t s[0x1000 / 2];
  229. uint32_t l[0x1000 / 4];
  230. uint64_t d[0x1000 / 8];
  231. union {
  232.     uchar_t c[0x100 / 1];
  233.     uint16_t s[0x100 / 2];
  234.     uint32_t l[0x100 / 4];
  235.     uint64_t d[0x100 / 8];
  236. } f[8];
  237.     } b_type0_cfg_dev[8];     /* 0x020000 */
  238.     /* PCI Type 1 Configuration Space        0x028000-0x028FFF */
  239.     union { /* make all access sizes available. */
  240. uchar_t c[0x1000 / 1];
  241. uint16_t s[0x1000 / 2];
  242. uint32_t l[0x1000 / 4];
  243. uint64_t d[0x1000 / 8];
  244.     } b_type1_cfg;     /* 0x028000-0x029000 */
  245.     char     _pad_029000[0x007000];  /* 0x029000-0x030000 */
  246.     /* PCI Interrupt Acknowledge Cycle        0x030000 */
  247.     union {
  248. uchar_t c[8 / 1];
  249. uint16_t s[8 / 2];
  250. uint32_t l[8 / 4];
  251. uint64_t d[8 / 8];
  252.     } b_pci_iack;     /* 0x030000 */
  253.     uchar_t     _pad_030007[0x04fff8];  /* 0x030008-0x07FFFF */
  254.     /* External Address Translation Entry RAM        0x080000-0x0FFFFF */
  255.     bridge_ate_t     b_ext_ate_ram[0x10000];
  256.     /* Reserved        0x100000-0x1FFFFF */
  257.     char     _pad_100000[0x200000-0x100000];
  258.     /* PCI/GIO Device Spaces        0x200000-0xBFFFFF */
  259.     union { /* make all access sizes available. */
  260. uchar_t c[0x100000 / 1];
  261. uint16_t s[0x100000 / 2];
  262. uint32_t l[0x100000 / 4];
  263. uint64_t d[0x100000 / 8];
  264.     } b_devio_raw[10]; /* 0x200000 */
  265.     /* b_devio macro is a bit strange; it reflects the
  266.      * fact that the Bridge ASIC provides 2M for the
  267.      * first two DevIO windows and 1M for the other six.
  268.      */
  269. #define b_devio(n) b_devio_raw[((n)<2)?(n*2):(n+2)]
  270.     /* External Flash Proms 1,0        0xC00000-0xFFFFFF */
  271.     union { /* make all access sizes available. */
  272. uchar_t c[0x400000 / 1]; /* read-only */
  273. uint16_t s[0x400000 / 2]; /* read-write */
  274. uint32_t l[0x400000 / 4]; /* read-only */
  275. uint64_t d[0x400000 / 8]; /* read-only */
  276.     } b_external_flash; /* 0xC00000 */
  277. } bridge_t;
  278. #else
  279. /*
  280.  * Field formats for Error Command Word and Auxillary Error Command Word
  281.  * of bridge.
  282.  */
  283. typedef struct bridge_err_cmdword_s {
  284.     union {
  285. uint32_t cmd_word;
  286. struct {
  287.     uint32_t     didn:4, /* Destination ID */
  288.     sidn:4, /* SOurce ID   */
  289.     pactyp:4, /* Packet type   */
  290.     tnum:5, /* Trans Number   */
  291.     coh:1, /* Coh Transacti  */
  292.     ds:2, /* Data size   */
  293.     gbr:1, /* GBR enable   */
  294.     vbpm:1, /* VBPM message   */
  295.     error:1, /* Error occurred  */
  296.     barr:1, /* Barrier op   */
  297.     rsvd:8;
  298. } berr_st;
  299.     } berr_un;
  300. } bridge_err_cmdword_t;
  301. typedef volatile struct bridge_s {
  302.     /* Local Registers                                 0x000000-0x00FFFF */
  303.     /* standard widget configuration                   0x000000-0x000057 */
  304.     widget_cfg_t            b_widget;               /* 0x000000 */
  305.     /* helper fieldnames for accessing bridge widget */
  306. #define b_wid_id                        b_widget.w_id
  307. #define b_wid_stat                      b_widget.w_status
  308. #define b_wid_err_upper                 b_widget.w_err_upper_addr
  309. #define b_wid_err_lower                 b_widget.w_err_lower_addr
  310. #define b_wid_control                   b_widget.w_control
  311. #define b_wid_req_timeout               b_widget.w_req_timeout
  312. #define b_wid_int_upper                 b_widget.w_intdest_upper_addr
  313. #define b_wid_int_lower                 b_widget.w_intdest_lower_addr
  314. #define b_wid_err_cmdword               b_widget.w_err_cmd_word
  315. #define b_wid_llp                       b_widget.w_llp_cfg
  316. #define b_wid_tflush                    b_widget.w_tflush
  317.     /* bridge-specific widget configuration            0x000058-0x00007F */
  318.     bridgereg_t             _pad_000058;
  319.     bridgereg_t             b_wid_aux_err;          /* 0x00005C */
  320.     bridgereg_t             _pad_000060;
  321.     bridgereg_t             b_wid_resp_upper;       /* 0x000064 */
  322.     bridgereg_t             _pad_000068;
  323.     bridgereg_t             b_wid_resp_lower;       /* 0x00006C */
  324.     bridgereg_t             _pad_000070;
  325.     bridgereg_t             b_wid_tst_pin_ctrl;     /* 0x000074 */
  326.     bridgereg_t             _pad_000078[2];
  327.     /* PMU & Map                                       0x000080-0x00008F */
  328.     bridgereg_t             _pad_000080;
  329.     bridgereg_t             b_dir_map;              /* 0x000084 */
  330.     bridgereg_t             _pad_000088[2];
  331.     /* SSRAM                                           0x000090-0x00009F */
  332.     bridgereg_t             _pad_000090;
  333.     bridgereg_t             b_ram_perr_or_map_fault;/* 0x000094 */
  334. #define b_ram_perr  b_ram_perr_or_map_fault     /* Bridge */
  335. #define b_map_fault b_ram_perr_or_map_fault     /* Xbridge */
  336.     bridgereg_t             _pad_000098[2];
  337.     /* Arbitration                                     0x0000A0-0x0000AF */
  338.     bridgereg_t             _pad_0000A0;
  339.     bridgereg_t             b_arb;                  /* 0x0000A4 */
  340.     bridgereg_t             _pad_0000A8[2];
  341.     /* Number In A Can                                 0x0000B0-0x0000BF */
  342.     bridgereg_t             _pad_0000B0;
  343.     bridgereg_t             b_nic;                  /* 0x0000B4 */
  344.     bridgereg_t             _pad_0000B8[2];
  345.     /* PCI/GIO                                         0x0000C0-0x0000FF */
  346.     bridgereg_t             _pad_0000C0;
  347.     bridgereg_t             b_bus_timeout;          /* 0x0000C4 */
  348. #define b_pci_bus_timeout b_bus_timeout
  349.     bridgereg_t             _pad_0000C8;
  350.     bridgereg_t             b_pci_cfg;              /* 0x0000CC */
  351.     bridgereg_t             _pad_0000D0;
  352.     bridgereg_t             b_pci_err_upper;        /* 0x0000D4 */
  353.     bridgereg_t             _pad_0000D8;
  354.     bridgereg_t             b_pci_err_lower;        /* 0x0000DC */
  355.     bridgereg_t             _pad_0000E0[8];
  356. #define b_gio_err_lower b_pci_err_lower
  357. #define b_gio_err_upper b_pci_err_upper
  358.     /* Interrupt                                       0x000100-0x0001FF */
  359.     bridgereg_t             _pad_000100;
  360.     bridgereg_t             b_int_status;           /* 0x000104 */
  361.     bridgereg_t             _pad_000108;
  362.     bridgereg_t             b_int_enable;           /* 0x00010C */
  363.     bridgereg_t             _pad_000110;
  364.     bridgereg_t             b_int_rst_stat;         /* 0x000114 */
  365.     bridgereg_t             _pad_000118;
  366.     bridgereg_t             b_int_mode;             /* 0x00011C */
  367.     bridgereg_t             _pad_000120;
  368.     bridgereg_t             b_int_device;           /* 0x000124 */
  369.     bridgereg_t             _pad_000128;
  370.     bridgereg_t             b_int_host_err;         /* 0x00012C */
  371.     struct {
  372.         bridgereg_t             __pad;              /* 0x0001{30,,,68} */
  373.         bridgereg_t             addr;               /* 0x0001{34,,,6C} */
  374.     } b_int_addr[8];                                /* 0x000130 */
  375.     bridgereg_t             _pad_000170;
  376.     bridgereg_t             b_err_int_view;         /* 0x000174 */
  377.     bridgereg_t             _pad_000178;
  378.     bridgereg_t             b_mult_int;             /* 0x00017c */
  379.     struct {
  380.         bridgereg_t             __pad;              /* 0x0001{80,,,B8} */
  381.         bridgereg_t             intr;               /* 0x0001{84,,,BC} */
  382.     } b_force_always[8];                            /* 0x000180 */
  383.     struct {
  384.         bridgereg_t             __pad;              /* 0x0001{C0,,,F8} */
  385.         bridgereg_t             intr;               /* 0x0001{C4,,,FC} */
  386.     } b_force_pin[8];                               /* 0x0001C0 */
  387.     /* Device                                          0x000200-0x0003FF */
  388.     struct {
  389.         bridgereg_t             __pad;              /* 0x0002{00,,,38} */
  390.         bridgereg_t             reg;                /* 0x0002{04,,,3C} */
  391.     } b_device[8];                                  /* 0x000200 */
  392.     struct {
  393.         bridgereg_t             __pad;              /* 0x0002{40,,,78} */
  394.         bridgereg_t             reg;                /* 0x0002{44,,,7C} */
  395.     } b_wr_req_buf[8];                              /* 0x000240 */
  396.     struct {
  397.         bridgereg_t             __pad;              /* 0x0002{80,,,88} */
  398.         bridgereg_t             reg;                /* 0x0002{84,,,8C} */
  399.     } b_rrb_map[2];                                 /* 0x000280 */
  400. #define b_even_resp     b_rrb_map[0].reg            /* 0x000284 */
  401. #define b_odd_resp      b_rrb_map[1].reg            /* 0x00028C */
  402.     bridgereg_t             _pad_000290;
  403.     bridgereg_t             b_resp_status;          /* 0x000294 */
  404.     bridgereg_t             _pad_000298;
  405.     bridgereg_t             b_resp_clear;           /* 0x00029C */
  406.     bridgereg_t             _pad_0002A0[24];
  407.     /* Xbridge only */
  408.     struct {
  409.         bridgereg_t             __pad1;             /* 0x0003{00,,,F0} */
  410.         bridgereg_t             upper;              /* 0x0003{04,,,F4} */
  411.         bridgereg_t             __pad2;             /* 0x0003{08,,,F8} */
  412.         bridgereg_t             lower;              /* 0x0003{0C,,,FC} */
  413.     } b_buf_addr_match[16];
  414.     /* Performance Monitor Registers (even only) */
  415.     struct {
  416.         bridgereg_t             __pad1;             /* 0x000400,,,5C0 */
  417.         bridgereg_t             flush_w_touch;      /* 0x000404,,,5C4 */
  418.         bridgereg_t             __pad2;             /* 0x000408,,,5C8 */
  419.         bridgereg_t             flush_wo_touch;     /* 0x00040C,,,5CC */
  420.         bridgereg_t             __pad3;             /* 0x000410,,,5D0 */
  421.         bridgereg_t             inflight;           /* 0x000414,,,5D4 */
  422.         bridgereg_t             __pad4;             /* 0x000418,,,5D8 */
  423.         bridgereg_t             prefetch;           /* 0x00041C,,,5DC */
  424.         bridgereg_t             __pad5;             /* 0x000420,,,5E0 */
  425.         bridgereg_t             total_pci_retry;    /* 0x000424,,,5E4 */
  426.         bridgereg_t             __pad6;             /* 0x000428,,,5E8 */
  427.         bridgereg_t             max_pci_retry;      /* 0x00042C,,,5EC */
  428.         bridgereg_t             __pad7;             /* 0x000430,,,5F0 */
  429.         bridgereg_t             max_latency;        /* 0x000434,,,5F4 */
  430.         bridgereg_t             __pad8;             /* 0x000438,,,5F8 */
  431.         bridgereg_t             clear_all;          /* 0x00043C,,,5FC */
  432.     } b_buf_count[8];
  433.     char                    _pad_000600[0x010000 - 0x000600];
  434.     /*
  435.      * The Xbridge has 1024 internal ATE's and the Bridge has 128.
  436.      * Make enough room for the Xbridge ATE's and depend on runtime
  437.      * checks to limit access to bridge ATE's.
  438.      */
  439.     /* Internal Address Translation Entry RAM          0x010000-0x011fff */
  440.     union {
  441.         bridge_ate_t            wr;             /* write-only */
  442.         struct {
  443.             bridgereg_t             _p_pad;
  444.             bridgereg_t             rd;         /* read-only */
  445.         }                       hi;
  446.     }                       b_int_ate_ram[XBRIDGE_INTERNAL_ATES];
  447. #define b_int_ate_ram_lo(idx) b_int_ate_ram[idx+512].hi.rd
  448.     /* the xbridge read path for internal ates starts at 0x12000.
  449.      * I don't believe we ever try to read the ates.
  450.      */
  451.     /* Internal Address Translation Entry RAM LOW       0x012000-0x013fff */
  452.     struct {
  453.         bridgereg_t             _p_pad;
  454.         bridgereg_t             rd;             /* read-only */
  455.     }                       xb_int_ate_ram_lo[XBRIDGE_INTERNAL_ATES];
  456.     char                    _pad_014000[0x20000 - 0x014000];
  457.     /* PCI Device Configuration Spaces                 0x020000-0x027FFF */
  458.     union {                             /* make all access sizes available. */
  459.         uchar_t                 c[0x1000 / 1];
  460.         uint16_t                s[0x1000 / 2];
  461.         uint32_t              l[0x1000 / 4];
  462.         uint64_t              d[0x1000 / 8];
  463.         union {
  464.             uchar_t             c[0x100 / 1];
  465.             uint16_t            s[0x100 / 2];
  466.             uint32_t          l[0x100 / 4];
  467.             uint64_t          d[0x100 / 8];
  468.         }                       f[8];
  469.     } b_type0_cfg_dev[8];                           /* 0x020000 */
  470.     /* PCI Type 1 Configuration Space                  0x028000-0x028FFF */
  471.     union {                             /* make all access sizes available. */
  472.         uchar_t                 c[0x1000 / 1];
  473.         uint16_t                s[0x1000 / 2];
  474.         uint32_t              l[0x1000 / 4];
  475.         uint64_t              d[0x1000 / 8];
  476.     } b_type1_cfg;                                  /* 0x028000-0x029000 */
  477.     char                    _pad_029000[0x007000];  /* 0x029000-0x030000 */
  478.     /* PCI Interrupt Acknowledge Cycle                 0x030000 */
  479.     union {
  480.         uchar_t                 c[8 / 1];
  481.         uint16_t                s[8 / 2];
  482.         uint32_t              l[8 / 4];
  483.         uint64_t              d[8 / 8];
  484.     } b_pci_iack;                                   /* 0x030000 */
  485.     uchar_t                 _pad_030007[0x04fff8];  /* 0x030008-0x07FFFF */
  486.     /* External Address Translation Entry RAM          0x080000-0x0FFFFF */
  487.     bridge_ate_t            b_ext_ate_ram[0x10000];
  488.     /* Reserved                                        0x100000-0x1FFFFF */
  489.     char                    _pad_100000[0x200000-0x100000];
  490.     /* PCI/GIO Device Spaces                           0x200000-0xBFFFFF */
  491.     union {                             /* make all access sizes available. */
  492.         uchar_t                 c[0x100000 / 1];
  493.         uint16_t                s[0x100000 / 2];
  494.         uint32_t              l[0x100000 / 4];
  495.         uint64_t              d[0x100000 / 8];
  496.     } b_devio_raw[10];                  /* 0x200000 */
  497.     /* b_devio macro is a bit strange; it reflects the
  498.      * fact that the Bridge ASIC provides 2M for the
  499.      * first two DevIO windows and 1M for the other six.
  500.      */
  501. #define b_devio(n)      b_devio_raw[((n)<2)?(n*2):(n+2)]
  502.     /* External Flash Proms 1,0                        0xC00000-0xFFFFFF */
  503.     union {                             /* make all access sizes available. */
  504.         uchar_t                 c[0x400000 / 1];        /* read-only */
  505.         uint16_t                s[0x400000 / 2];        /* read-write */
  506.         uint32_t              l[0x400000 / 4];        /* read-only */
  507.         uint64_t              d[0x400000 / 8];        /* read-only */
  508.     } b_external_flash;                 /* 0xC00000 */
  509. } bridge_t;
  510. #endif
  511. #define berr_field berr_un.berr_st
  512. #endif /* LANGUAGE_C */
  513. /*
  514.  * The values of these macros can and should be crosschecked
  515.  * regularly against the offsets of the like-named fields
  516.  * within the "bridge_t" structure above.
  517.  */
  518. /* Byte offset macros for Bridge internal registers */
  519. #define BRIDGE_WID_ID WIDGET_ID
  520. #define BRIDGE_WID_STAT WIDGET_STATUS
  521. #define BRIDGE_WID_ERR_UPPER WIDGET_ERR_UPPER_ADDR
  522. #define BRIDGE_WID_ERR_LOWER WIDGET_ERR_LOWER_ADDR
  523. #define BRIDGE_WID_CONTROL WIDGET_CONTROL
  524. #define BRIDGE_WID_REQ_TIMEOUT WIDGET_REQ_TIMEOUT
  525. #define BRIDGE_WID_INT_UPPER WIDGET_INTDEST_UPPER_ADDR
  526. #define BRIDGE_WID_INT_LOWER WIDGET_INTDEST_LOWER_ADDR
  527. #define BRIDGE_WID_ERR_CMDWORD WIDGET_ERR_CMD_WORD
  528. #define BRIDGE_WID_LLP WIDGET_LLP_CFG
  529. #define BRIDGE_WID_TFLUSH WIDGET_TFLUSH
  530. #define BRIDGE_WID_AUX_ERR 0x00005C /* Aux Error Command Word */
  531. #define BRIDGE_WID_RESP_UPPER 0x000064 /* Response Buf Upper Addr */
  532. #define BRIDGE_WID_RESP_LOWER 0x00006C /* Response Buf Lower Addr */
  533. #define BRIDGE_WID_TST_PIN_CTRL 0x000074 /* Test pin control */
  534. #define BRIDGE_DIR_MAP 0x000084 /* Direct Map reg */
  535. /* Bridge has SSRAM Parity Error and Xbridge has Map Fault here */
  536. #define BRIDGE_RAM_PERR  0x000094 /* SSRAM Parity Error */
  537. #define BRIDGE_MAP_FAULT 0x000094 /* Map Fault */
  538. #define BRIDGE_ARB 0x0000A4 /* Arbitration Priority reg */
  539. #define BRIDGE_NIC 0x0000B4 /* Number In A Can */
  540. #define BRIDGE_BUS_TIMEOUT 0x0000C4 /* Bus Timeout Register */
  541. #define BRIDGE_PCI_BUS_TIMEOUT BRIDGE_BUS_TIMEOUT
  542. #define BRIDGE_PCI_CFG 0x0000CC /* PCI Type 1 Config reg */
  543. #define BRIDGE_PCI_ERR_UPPER 0x0000D4 /* PCI error Upper Addr */
  544. #define BRIDGE_PCI_ERR_LOWER 0x0000DC /* PCI error Lower Addr */
  545. #define BRIDGE_INT_STATUS 0x000104 /* Interrupt Status */
  546. #define BRIDGE_INT_ENABLE 0x00010C /* Interrupt Enables */
  547. #define BRIDGE_INT_RST_STAT 0x000114 /* Reset Intr Status */
  548. #define BRIDGE_INT_MODE 0x00011C /* Interrupt Mode */
  549. #define BRIDGE_INT_DEVICE 0x000124 /* Interrupt Device */
  550. #define BRIDGE_INT_HOST_ERR 0x00012C /* Host Error Field */
  551. #define BRIDGE_INT_ADDR0 0x000134 /* Host Address Reg */
  552. #define BRIDGE_INT_ADDR_OFF 0x000008 /* Host Addr offset (1..7) */
  553. #define BRIDGE_INT_ADDR(x) (BRIDGE_INT_ADDR0+(x)*BRIDGE_INT_ADDR_OFF)
  554. #define BRIDGE_INT_VIEW 0x000174 /* Interrupt view */
  555. #define BRIDGE_MULTIPLE_INT 0x00017c /* Multiple interrupt occurred */
  556. #define BRIDGE_FORCE_ALWAYS0 0x000184 /* Force an interrupt (always)*/
  557. #define BRIDGE_FORCE_ALWAYS_OFF 0x000008 /* Force Always offset */
  558. #define BRIDGE_FORCE_ALWAYS(x)  (BRIDGE_FORCE_ALWAYS0+(x)*BRIDGE_FORCE_ALWAYS_OFF)
  559. #define BRIDGE_FORCE_PIN0 0x0001c4 /* Force an interrupt */
  560. #define BRIDGE_FORCE_PIN_OFF  0x000008 /* Force Pin offset */
  561. #define BRIDGE_FORCE_PIN(x)  (BRIDGE_FORCE_PIN0+(x)*BRIDGE_FORCE_PIN_OFF)
  562. #define BRIDGE_DEVICE0 0x000204 /* Device 0 */
  563. #define BRIDGE_DEVICE_OFF 0x000008 /* Device offset (1..7) */
  564. #define BRIDGE_DEVICE(x) (BRIDGE_DEVICE0+(x)*BRIDGE_DEVICE_OFF)
  565. #define BRIDGE_WR_REQ_BUF0 0x000244 /* Write Request Buffer 0 */
  566. #define BRIDGE_WR_REQ_BUF_OFF 0x000008 /* Buffer Offset (1..7) */
  567. #define BRIDGE_WR_REQ_BUF(x) (BRIDGE_WR_REQ_BUF0+(x)*BRIDGE_WR_REQ_BUF_OFF)
  568. #define BRIDGE_EVEN_RESP 0x000284 /* Even Device Response Buf */
  569. #define BRIDGE_ODD_RESP 0x00028C /* Odd Device Response Buf */
  570. #define BRIDGE_RESP_STATUS 0x000294 /* Read Response Status reg */
  571. #define BRIDGE_RESP_CLEAR 0x00029C /* Read Response Clear reg */
  572. #define BRIDGE_BUF_ADDR_UPPER0 0x000304
  573. #define BRIDGE_BUF_ADDR_UPPER_OFF 0x000010 /* PCI Buffer Upper Offset */
  574. #define BRIDGE_BUF_ADDR_UPPER(x) (BRIDGE_BUF_ADDR_UPPER0+(x)*BRIDGE_BUF_ADDR_UPPER_OFF)
  575. #define BRIDGE_BUF_ADDR_LOWER0 0x00030c
  576. #define BRIDGE_BUF_ADDR_LOWER_OFF 0x000010 /* PCI Buffer Upper Offset */
  577. #define BRIDGE_BUF_ADDR_LOWER(x) (BRIDGE_BUF_ADDR_LOWER0+(x)*BRIDGE_BUF_ADDR_LOWER_OFF)
  578. /* 
  579.  * Performance Monitor Registers.
  580.  *
  581.  * The Performance registers are those registers which are associated with
  582.  * monitoring the performance of PCI generated reads to the host environ
  583.  * ment. Because of the size of the register file only the even registers
  584.  * were instrumented.
  585.  */
  586. #define BRIDGE_BUF_OFF 0x40
  587. #define BRIDGE_BUF_NEXT(base, off) (base+((off)*BRIDGE_BUF_OFF))
  588. /*
  589.  * Buffer (x) Flush Count with Data Touch Register.
  590.  *
  591.  * This counter is incremented each time the corresponding response buffer
  592.  * is flushed after at least a single data element in the buffer is used.
  593.  * A word write to this address clears the count.
  594.  */
  595. #define BRIDGE_BUF_0_FLUSH_TOUCH  0x000404
  596. #define BRIDGE_BUF_2_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 1)
  597. #define BRIDGE_BUF_4_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 2)
  598. #define BRIDGE_BUF_6_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 3)
  599. #define BRIDGE_BUF_8_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 4)
  600. #define BRIDGE_BUF_10_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 5)
  601. #define BRIDGE_BUF_12_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 6)
  602. #define BRIDGE_BUF_14_FLUSH_TOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_TOUCH, 7)
  603. /*
  604.  * Buffer (x) Flush Count w/o Data Touch Register
  605.  *
  606.  * This counter is incremented each time the corresponding response buffer
  607.  * is flushed without any data element in the buffer being used. A word
  608.  * write to this address clears the count.
  609.  */
  610. #define BRIDGE_BUF_0_FLUSH_NOTOUCH  0x00040c
  611. #define BRIDGE_BUF_2_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 1)
  612. #define BRIDGE_BUF_4_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 2)
  613. #define BRIDGE_BUF_6_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 3)
  614. #define BRIDGE_BUF_8_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 4)
  615. #define BRIDGE_BUF_10_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 5)
  616. #define BRIDGE_BUF_12_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 6)
  617. #define BRIDGE_BUF_14_FLUSH_NOTOUCH  BRIDGE_BUF_NEXT(BRIDGE_BUF_0_FLUSH_NOTOUCH, 7)
  618. /*
  619.  * Buffer (x) Request in Flight Count Register
  620.  *
  621.  * This counter is incremented on each bus clock while the request is in
  622.  * flight. A word write to this address clears the count.
  623.  */
  624. #define BRIDGE_BUF_0_INFLIGHT  0x000414
  625. #define BRIDGE_BUF_2_INFLIGHT    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 1)
  626. #define BRIDGE_BUF_4_INFLIGHT    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 2)
  627. #define BRIDGE_BUF_6_INFLIGHT    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 3)
  628. #define BRIDGE_BUF_8_INFLIGHT    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 4)
  629. #define BRIDGE_BUF_10_INFLIGHT   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 5)
  630. #define BRIDGE_BUF_12_INFLIGHT   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 6)
  631. #define BRIDGE_BUF_14_INFLIGHT   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_INFLIGHT, 7)
  632. /*
  633.  * Buffer (x) Prefetch Request Count Register
  634.  *
  635.  * This counter is incremented each time the request using this buffer was
  636.  * generated from the prefetcher. A word write to this address clears the
  637.  * count.
  638.  */
  639. #define BRIDGE_BUF_0_PREFETCH  0x00041C
  640. #define BRIDGE_BUF_2_PREFETCH    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 1)
  641. #define BRIDGE_BUF_4_PREFETCH    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 2)
  642. #define BRIDGE_BUF_6_PREFETCH    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 3)
  643. #define BRIDGE_BUF_8_PREFETCH    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 4)
  644. #define BRIDGE_BUF_10_PREFETCH   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 5)
  645. #define BRIDGE_BUF_12_PREFETCH   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 6)
  646. #define BRIDGE_BUF_14_PREFETCH   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PREFETCH, 7)
  647. /*
  648.  * Buffer (x) Total PCI Retry Count Register
  649.  *
  650.  * This counter is incremented each time a PCI bus retry occurs and the ad
  651.  * dress matches the tag for the selected buffer. The buffer must also has
  652.  * this request in-flight. A word write to this address clears the count.
  653.  */
  654. #define BRIDGE_BUF_0_PCI_RETRY  0x000424
  655. #define BRIDGE_BUF_2_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 1)
  656. #define BRIDGE_BUF_4_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 2)
  657. #define BRIDGE_BUF_6_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 3)
  658. #define BRIDGE_BUF_8_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 4)
  659. #define BRIDGE_BUF_10_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 5)
  660. #define BRIDGE_BUF_12_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 6)
  661. #define BRIDGE_BUF_14_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_PCI_RETRY, 7)
  662. /*
  663.  * Buffer (x) Max PCI Retry Count Register
  664.  *
  665.  * This counter is contains the maximum retry count for a single request
  666.  * which was in-flight for this buffer. A word write to this address
  667.  * clears the count.
  668.  */
  669. #define BRIDGE_BUF_0_MAX_PCI_RETRY  0x00042C
  670. #define BRIDGE_BUF_2_MAX_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 1)
  671. #define BRIDGE_BUF_4_MAX_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 2)
  672. #define BRIDGE_BUF_6_MAX_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 3)
  673. #define BRIDGE_BUF_8_MAX_PCI_RETRY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 4)
  674. #define BRIDGE_BUF_10_MAX_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 5)
  675. #define BRIDGE_BUF_12_MAX_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 6)
  676. #define BRIDGE_BUF_14_MAX_PCI_RETRY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_PCI_RETRY, 7)
  677. /*
  678.  * Buffer (x) Max Latency Count Register
  679.  *
  680.  * This counter is contains the maximum count (in bus clocks) for a single
  681.  * request which was in-flight for this buffer. A word write to this
  682.  * address clears the count.
  683.  */
  684. #define BRIDGE_BUF_0_MAX_LATENCY  0x000434
  685. #define BRIDGE_BUF_2_MAX_LATENCY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 1)
  686. #define BRIDGE_BUF_4_MAX_LATENCY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 2)
  687. #define BRIDGE_BUF_6_MAX_LATENCY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 3)
  688. #define BRIDGE_BUF_8_MAX_LATENCY    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 4)
  689. #define BRIDGE_BUF_10_MAX_LATENCY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 5)
  690. #define BRIDGE_BUF_12_MAX_LATENCY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 6)
  691. #define BRIDGE_BUF_14_MAX_LATENCY   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_MAX_LATENCY, 7)
  692. /*
  693.  * Buffer (x) Clear All Register
  694.  *
  695.  * Any access to this register clears all the count values for the (x)
  696.  * registers.
  697.  */
  698. #define BRIDGE_BUF_0_CLEAR_ALL  0x00043C
  699. #define BRIDGE_BUF_2_CLEAR_ALL    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 1)
  700. #define BRIDGE_BUF_4_CLEAR_ALL    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 2)
  701. #define BRIDGE_BUF_6_CLEAR_ALL    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 3)
  702. #define BRIDGE_BUF_8_CLEAR_ALL    BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 4)
  703. #define BRIDGE_BUF_10_CLEAR_ALL   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 5)
  704. #define BRIDGE_BUF_12_CLEAR_ALL   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 6)
  705. #define BRIDGE_BUF_14_CLEAR_ALL   BRIDGE_BUF_NEXT(BRIDGE_BUF_0_CLEAR_ALL, 7)
  706. /* end of Performance Monitor Registers */
  707. /* Byte offset macros for Bridge I/O space */
  708. #define BRIDGE_ATE_RAM 0x00010000 /* Internal Addr Xlat Ram */
  709. #define BRIDGE_TYPE0_CFG_DEV0 0x00020000 /* Type 0 Cfg, Device 0 */
  710. #define BRIDGE_TYPE0_CFG_SLOT_OFF 0x00001000 /* Type 0 Cfg Slot Offset (1..7) */
  711. #define BRIDGE_TYPE0_CFG_FUNC_OFF 0x00000100 /* Type 0 Cfg Func Offset (1..7) */
  712. #define BRIDGE_TYPE0_CFG_DEV(s) (BRIDGE_TYPE0_CFG_DEV0+
  713.  (s)*BRIDGE_TYPE0_CFG_SLOT_OFF)
  714. #define BRIDGE_TYPE0_CFG_DEVF(s,f) (BRIDGE_TYPE0_CFG_DEV0+
  715.  (s)*BRIDGE_TYPE0_CFG_SLOT_OFF+
  716.  (f)*BRIDGE_TYPE0_CFG_FUNC_OFF)
  717. #define BRIDGE_TYPE1_CFG 0x00028000 /* Type 1 Cfg space */
  718. #define BRIDGE_PCI_IACK 0x00030000 /* PCI Interrupt Ack */
  719. #define BRIDGE_EXT_SSRAM 0x00080000 /* Extern SSRAM (ATE) */
  720. /* Byte offset macros for Bridge device IO spaces */
  721. #define BRIDGE_DEV_CNT 8 /* Up to 8 devices per bridge */
  722. #define BRIDGE_DEVIO0 0x00200000 /* Device IO 0 Addr */
  723. #define BRIDGE_DEVIO1 0x00400000 /* Device IO 1 Addr */
  724. #define BRIDGE_DEVIO2 0x00600000 /* Device IO 2 Addr */
  725. #define BRIDGE_DEVIO_OFF 0x00100000 /* Device IO Offset (3..7) */
  726. #define BRIDGE_DEVIO_2MB 0x00200000 /* Device IO Offset (0..1) */
  727. #define BRIDGE_DEVIO_1MB 0x00100000 /* Device IO Offset (2..7) */
  728. #if LANGUAGE_C
  729. #define BRIDGE_DEVIO(x) ((x)<=1 ? BRIDGE_DEVIO0+(x)*BRIDGE_DEVIO_2MB : BRIDGE_DEVIO2+((x)-2)*BRIDGE_DEVIO_1MB)
  730. #endif /* LANGUAGE_C */
  731. #define BRIDGE_EXTERNAL_FLASH 0x00C00000 /* External Flash PROMS */
  732. /* ========================================================================
  733.  *    Bridge register bit field definitions
  734.  */
  735. /* Widget part number of bridge */
  736. #define BRIDGE_WIDGET_PART_NUM 0xc002
  737. #define XBRIDGE_WIDGET_PART_NUM 0xd002
  738. /* Manufacturer of bridge */
  739. #define BRIDGE_WIDGET_MFGR_NUM 0x036
  740. #define XBRIDGE_WIDGET_MFGR_NUM 0x024
  741. /* Revision numbers for known [X]Bridge revisions */
  742. #define BRIDGE_REV_A 0x1
  743. #define BRIDGE_REV_B 0x2
  744. #define BRIDGE_REV_C 0x3
  745. #define BRIDGE_REV_D 0x4
  746. #define XBRIDGE_REV_A 0x1
  747. #define XBRIDGE_REV_B 0x2
  748. /* Part + Rev numbers allows distinction and acscending sequence */
  749. #define BRIDGE_PART_REV_A (BRIDGE_WIDGET_PART_NUM << 4 | BRIDGE_REV_A)
  750. #define BRIDGE_PART_REV_B (BRIDGE_WIDGET_PART_NUM << 4 | BRIDGE_REV_B)
  751. #define BRIDGE_PART_REV_C (BRIDGE_WIDGET_PART_NUM << 4 | BRIDGE_REV_C)
  752. #define BRIDGE_PART_REV_D (BRIDGE_WIDGET_PART_NUM << 4 | BRIDGE_REV_D)
  753. #define XBRIDGE_PART_REV_A (XBRIDGE_WIDGET_PART_NUM << 4 | XBRIDGE_REV_A)
  754. #define XBRIDGE_PART_REV_B (XBRIDGE_WIDGET_PART_NUM << 4 | XBRIDGE_REV_B)
  755. /* Bridge widget status register bits definition */
  756. #define BRIDGE_STAT_LLP_REC_CNT (0xFFu << 24)
  757. #define BRIDGE_STAT_LLP_TX_CNT (0xFF << 16)
  758. #define BRIDGE_STAT_FLASH_SELECT (0x1 << 6)
  759. #define BRIDGE_STAT_PCI_GIO_N (0x1 << 5)
  760. #define BRIDGE_STAT_PENDING (0x1F << 0)
  761. /* Bridge widget control register bits definition */
  762. #define BRIDGE_CTRL_FLASH_WR_EN (0x1ul << 31)
  763. #define BRIDGE_CTRL_EN_CLK50 (0x1 << 30)
  764. #define BRIDGE_CTRL_EN_CLK40 (0x1 << 29)
  765. #define BRIDGE_CTRL_EN_CLK33 (0x1 << 28)
  766. #define BRIDGE_CTRL_RST(n) ((n) << 24)
  767. #define BRIDGE_CTRL_RST_MASK (BRIDGE_CTRL_RST(0xF))
  768. #define BRIDGE_CTRL_RST_PIN(x) (BRIDGE_CTRL_RST(0x1 << (x)))
  769. #define BRIDGE_CTRL_IO_SWAP (0x1 << 23)
  770. #define BRIDGE_CTRL_MEM_SWAP (0x1 << 22)
  771. #define BRIDGE_CTRL_PAGE_SIZE (0x1 << 21)
  772. #define BRIDGE_CTRL_SS_PAR_BAD (0x1 << 20)
  773. #define BRIDGE_CTRL_SS_PAR_EN (0x1 << 19)
  774. #define BRIDGE_CTRL_SSRAM_SIZE(n) ((n) << 17)
  775. #define BRIDGE_CTRL_SSRAM_SIZE_MASK (BRIDGE_CTRL_SSRAM_SIZE(0x3))
  776. #define BRIDGE_CTRL_SSRAM_512K (BRIDGE_CTRL_SSRAM_SIZE(0x3))
  777. #define BRIDGE_CTRL_SSRAM_128K (BRIDGE_CTRL_SSRAM_SIZE(0x2))
  778. #define BRIDGE_CTRL_SSRAM_64K (BRIDGE_CTRL_SSRAM_SIZE(0x1))
  779. #define BRIDGE_CTRL_SSRAM_1K (BRIDGE_CTRL_SSRAM_SIZE(0x0))
  780. #define BRIDGE_CTRL_F_BAD_PKT (0x1 << 16)
  781. #define BRIDGE_CTRL_LLP_XBAR_CRD(n) ((n) << 12)
  782. #define BRIDGE_CTRL_LLP_XBAR_CRD_MASK (BRIDGE_CTRL_LLP_XBAR_CRD(0xf))
  783. #define BRIDGE_CTRL_CLR_RLLP_CNT (0x1 << 11)
  784. #define BRIDGE_CTRL_CLR_TLLP_CNT (0x1 << 10)
  785. #define BRIDGE_CTRL_SYS_END (0x1 << 9)
  786. #define BRIDGE_CTRL_MAX_TRANS(n) ((n) << 4)
  787. #define BRIDGE_CTRL_MAX_TRANS_MASK (BRIDGE_CTRL_MAX_TRANS(0x1f))
  788. #define BRIDGE_CTRL_WIDGET_ID(n) ((n) << 0)
  789. #define BRIDGE_CTRL_WIDGET_ID_MASK (BRIDGE_CTRL_WIDGET_ID(0xf))
  790. /* Bridge Response buffer Error Upper Register bit fields definition */
  791. #define BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT (20)
  792. #define BRIDGE_RESP_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT)
  793. #define BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT (16)
  794. #define BRIDGE_RESP_ERRUPPR_BUFNUM_MASK (0xF << BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT)
  795. #define BRIDGE_RESP_ERRRUPPR_BUFMASK (0xFFFF)
  796. #define BRIDGE_RESP_ERRUPPR_BUFNUM(x)
  797. (((x) & BRIDGE_RESP_ERRUPPR_BUFNUM_MASK) >> 
  798. BRIDGE_RESP_ERRUPPR_BUFNUM_SHFT)
  799. #define BRIDGE_RESP_ERRUPPR_DEVICE(x)
  800. (((x) &  BRIDGE_RESP_ERRUPPR_DEVNUM_MASK) >> 
  801.  BRIDGE_RESP_ERRUPPR_DEVNUM_SHFT)
  802. /* Bridge direct mapping register bits definition */
  803. #define BRIDGE_DIRMAP_W_ID_SHFT 20
  804. #define BRIDGE_DIRMAP_W_ID (0xf << BRIDGE_DIRMAP_W_ID_SHFT)
  805. #define BRIDGE_DIRMAP_RMF_64 (0x1 << 18)
  806. #define BRIDGE_DIRMAP_ADD512 (0x1 << 17)
  807. #define BRIDGE_DIRMAP_OFF (0x1ffff << 0)
  808. #define BRIDGE_DIRMAP_OFF_ADDRSHFT (31) /* lsbit of DIRMAP_OFF is xtalk address bit 31 */
  809. /* Bridge Arbitration register bits definition */
  810. #define BRIDGE_ARB_REQ_WAIT_TICK(x) ((x) << 16)
  811. #define BRIDGE_ARB_REQ_WAIT_TICK_MASK BRIDGE_ARB_REQ_WAIT_TICK(0x3)
  812. #define BRIDGE_ARB_REQ_WAIT_EN(x) ((x) << 8)
  813. #define BRIDGE_ARB_REQ_WAIT_EN_MASK BRIDGE_ARB_REQ_WAIT_EN(0xff)
  814. #define BRIDGE_ARB_FREEZE_GNT (1 << 6)
  815. #define BRIDGE_ARB_HPRI_RING_B2 (1 << 5)
  816. #define BRIDGE_ARB_HPRI_RING_B1 (1 << 4)
  817. #define BRIDGE_ARB_HPRI_RING_B0 (1 << 3)
  818. #define BRIDGE_ARB_LPRI_RING_B2 (1 << 2)
  819. #define BRIDGE_ARB_LPRI_RING_B1 (1 << 1)
  820. #define BRIDGE_ARB_LPRI_RING_B0 (1 << 0)
  821. /* Bridge Bus time-out register bits definition */
  822. #define BRIDGE_BUS_PCI_RETRY_HLD(x) ((x) << 16)
  823. #define BRIDGE_BUS_PCI_RETRY_HLD_MASK BRIDGE_BUS_PCI_RETRY_HLD(0x1f)
  824. #define BRIDGE_BUS_GIO_TIMEOUT (1 << 12)
  825. #define BRIDGE_BUS_PCI_RETRY_CNT(x) ((x) << 0)
  826. #define BRIDGE_BUS_PCI_RETRY_MASK BRIDGE_BUS_PCI_RETRY_CNT(0x3ff)
  827. /* Bridge interrupt status register bits definition */
  828. #define BRIDGE_ISR_MULTI_ERR (0x1u << 31) /* bridge only */
  829. #define BRIDGE_ISR_PMU_ESIZE_FAULT (0x1 << 30) /* bridge only */
  830. #define BRIDGE_ISR_PAGE_FAULT (0x1 << 30) /* xbridge only */
  831. #define BRIDGE_ISR_UNEXP_RESP (0x1 << 29)
  832. #define BRIDGE_ISR_BAD_XRESP_PKT (0x1 << 28)
  833. #define BRIDGE_ISR_BAD_XREQ_PKT (0x1 << 27)
  834. #define BRIDGE_ISR_RESP_XTLK_ERR (0x1 << 26)
  835. #define BRIDGE_ISR_REQ_XTLK_ERR (0x1 << 25)
  836. #define BRIDGE_ISR_INVLD_ADDR (0x1 << 24)
  837. #define BRIDGE_ISR_UNSUPPORTED_XOP (0x1 << 23)
  838. #define BRIDGE_ISR_XREQ_FIFO_OFLOW (0x1 << 22)
  839. #define BRIDGE_ISR_LLP_REC_SNERR (0x1 << 21)
  840. #define BRIDGE_ISR_LLP_REC_CBERR (0x1 << 20)
  841. #define BRIDGE_ISR_LLP_RCTY (0x1 << 19)
  842. #define BRIDGE_ISR_LLP_TX_RETRY (0x1 << 18)
  843. #define BRIDGE_ISR_LLP_TCTY (0x1 << 17)
  844. #define BRIDGE_ISR_SSRAM_PERR (0x1 << 16)
  845. #define BRIDGE_ISR_PCI_ABORT (0x1 << 15)
  846. #define BRIDGE_ISR_PCI_PARITY (0x1 << 14)
  847. #define BRIDGE_ISR_PCI_SERR (0x1 << 13)
  848. #define BRIDGE_ISR_PCI_PERR (0x1 << 12)
  849. #define BRIDGE_ISR_PCI_MST_TIMEOUT (0x1 << 11)
  850. #define BRIDGE_ISR_GIO_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT
  851. #define BRIDGE_ISR_PCI_RETRY_CNT (0x1 << 10)
  852. #define BRIDGE_ISR_XREAD_REQ_TIMEOUT (0x1 << 9)
  853. #define BRIDGE_ISR_GIO_B_ENBL_ERR (0x1 << 8)
  854. #define BRIDGE_ISR_INT_MSK (0xff << 0)
  855. #define BRIDGE_ISR_INT(x) (0x1 << (x))
  856. #define BRIDGE_ISR_LINK_ERROR
  857. (BRIDGE_ISR_LLP_REC_SNERR|BRIDGE_ISR_LLP_REC_CBERR|
  858.  BRIDGE_ISR_LLP_RCTY|BRIDGE_ISR_LLP_TX_RETRY|
  859.  BRIDGE_ISR_LLP_TCTY)
  860. #define BRIDGE_ISR_PCIBUS_PIOERR
  861. (BRIDGE_ISR_PCI_MST_TIMEOUT|BRIDGE_ISR_PCI_ABORT)
  862. #define BRIDGE_ISR_PCIBUS_ERROR
  863. (BRIDGE_ISR_PCIBUS_PIOERR|BRIDGE_ISR_PCI_PERR|
  864.  BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_RETRY_CNT|
  865.  BRIDGE_ISR_PCI_PARITY)
  866. #define BRIDGE_ISR_XTALK_ERROR
  867. (BRIDGE_ISR_XREAD_REQ_TIMEOUT|BRIDGE_ISR_XREQ_FIFO_OFLOW|
  868.  BRIDGE_ISR_UNSUPPORTED_XOP|BRIDGE_ISR_INVLD_ADDR|
  869.  BRIDGE_ISR_REQ_XTLK_ERR|BRIDGE_ISR_RESP_XTLK_ERR|
  870.  BRIDGE_ISR_BAD_XREQ_PKT|BRIDGE_ISR_BAD_XRESP_PKT|
  871.  BRIDGE_ISR_UNEXP_RESP)
  872. #define BRIDGE_ISR_ERRORS
  873. (BRIDGE_ISR_LINK_ERROR|BRIDGE_ISR_PCIBUS_ERROR|
  874.  BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR|
  875.  BRIDGE_ISR_PMU_ESIZE_FAULT)
  876. /*
  877.  * List of Errors which are fatal and kill the sytem
  878.  */
  879. #define BRIDGE_ISR_ERROR_FATAL
  880. ((BRIDGE_ISR_XTALK_ERROR & ~BRIDGE_ISR_XREAD_REQ_TIMEOUT)|
  881.  BRIDGE_ISR_PCI_SERR|BRIDGE_ISR_PCI_PARITY )
  882. #define BRIDGE_ISR_ERROR_DUMP
  883. (BRIDGE_ISR_PCIBUS_ERROR|BRIDGE_ISR_PMU_ESIZE_FAULT|
  884.  BRIDGE_ISR_XTALK_ERROR|BRIDGE_ISR_SSRAM_PERR)
  885. /* Bridge interrupt enable register bits definition */
  886. #define BRIDGE_IMR_UNEXP_RESP BRIDGE_ISR_UNEXP_RESP
  887. #define BRIDGE_IMR_PMU_ESIZE_FAULT BRIDGE_ISR_PMU_ESIZE_FAULT
  888. #define BRIDGE_IMR_BAD_XRESP_PKT BRIDGE_ISR_BAD_XRESP_PKT
  889. #define BRIDGE_IMR_BAD_XREQ_PKT BRIDGE_ISR_BAD_XREQ_PKT
  890. #define BRIDGE_IMR_RESP_XTLK_ERR BRIDGE_ISR_RESP_XTLK_ERR
  891. #define BRIDGE_IMR_REQ_XTLK_ERR BRIDGE_ISR_REQ_XTLK_ERR
  892. #define BRIDGE_IMR_INVLD_ADDR BRIDGE_ISR_INVLD_ADDR
  893. #define BRIDGE_IMR_UNSUPPORTED_XOP BRIDGE_ISR_UNSUPPORTED_XOP
  894. #define BRIDGE_IMR_XREQ_FIFO_OFLOW BRIDGE_ISR_XREQ_FIFO_OFLOW
  895. #define BRIDGE_IMR_LLP_REC_SNERR BRIDGE_ISR_LLP_REC_SNERR
  896. #define BRIDGE_IMR_LLP_REC_CBERR BRIDGE_ISR_LLP_REC_CBERR
  897. #define BRIDGE_IMR_LLP_RCTY BRIDGE_ISR_LLP_RCTY
  898. #define BRIDGE_IMR_LLP_TX_RETRY BRIDGE_ISR_LLP_TX_RETRY
  899. #define BRIDGE_IMR_LLP_TCTY BRIDGE_ISR_LLP_TCTY
  900. #define BRIDGE_IMR_SSRAM_PERR BRIDGE_ISR_SSRAM_PERR
  901. #define BRIDGE_IMR_PCI_ABORT BRIDGE_ISR_PCI_ABORT
  902. #define BRIDGE_IMR_PCI_PARITY BRIDGE_ISR_PCI_PARITY
  903. #define BRIDGE_IMR_PCI_SERR BRIDGE_ISR_PCI_SERR
  904. #define BRIDGE_IMR_PCI_PERR BRIDGE_ISR_PCI_PERR
  905. #define BRIDGE_IMR_PCI_MST_TIMEOUT BRIDGE_ISR_PCI_MST_TIMEOUT
  906. #define BRIDGE_IMR_GIO_MST_TIMEOUT BRIDGE_ISR_GIO_MST_TIMEOUT
  907. #define BRIDGE_IMR_PCI_RETRY_CNT BRIDGE_ISR_PCI_RETRY_CNT
  908. #define BRIDGE_IMR_XREAD_REQ_TIMEOUT BRIDGE_ISR_XREAD_REQ_TIMEOUT
  909. #define BRIDGE_IMR_GIO_B_ENBL_ERR BRIDGE_ISR_GIO_B_ENBL_ERR
  910. #define BRIDGE_IMR_INT_MSK BRIDGE_ISR_INT_MSK
  911. #define BRIDGE_IMR_INT(x) BRIDGE_ISR_INT(x)
  912. /* Bridge interrupt reset register bits definition */
  913. #define BRIDGE_IRR_MULTI_CLR (0x1 << 6)
  914. #define BRIDGE_IRR_CRP_GRP_CLR (0x1 << 5)
  915. #define BRIDGE_IRR_RESP_BUF_GRP_CLR (0x1 << 4)
  916. #define BRIDGE_IRR_REQ_DSP_GRP_CLR (0x1 << 3)
  917. #define BRIDGE_IRR_LLP_GRP_CLR (0x1 << 2)
  918. #define BRIDGE_IRR_SSRAM_GRP_CLR (0x1 << 1)
  919. #define BRIDGE_IRR_PCI_GRP_CLR (0x1 << 0)
  920. #define BRIDGE_IRR_GIO_GRP_CLR (0x1 << 0)
  921. #define BRIDGE_IRR_ALL_CLR 0x7f
  922. #define BRIDGE_IRR_CRP_GRP (BRIDGE_ISR_UNEXP_RESP | 
  923.  BRIDGE_ISR_XREQ_FIFO_OFLOW)
  924. #define BRIDGE_IRR_RESP_BUF_GRP (BRIDGE_ISR_BAD_XRESP_PKT | 
  925.  BRIDGE_ISR_RESP_XTLK_ERR | 
  926.  BRIDGE_ISR_XREAD_REQ_TIMEOUT)
  927. #define BRIDGE_IRR_REQ_DSP_GRP (BRIDGE_ISR_UNSUPPORTED_XOP | 
  928.  BRIDGE_ISR_BAD_XREQ_PKT | 
  929.  BRIDGE_ISR_REQ_XTLK_ERR | 
  930.  BRIDGE_ISR_INVLD_ADDR)
  931. #define BRIDGE_IRR_LLP_GRP (BRIDGE_ISR_LLP_REC_SNERR | 
  932.  BRIDGE_ISR_LLP_REC_CBERR | 
  933.  BRIDGE_ISR_LLP_RCTY | 
  934.  BRIDGE_ISR_LLP_TX_RETRY | 
  935.  BRIDGE_ISR_LLP_TCTY)
  936. #define BRIDGE_IRR_SSRAM_GRP (BRIDGE_ISR_SSRAM_PERR | 
  937.  BRIDGE_ISR_PMU_ESIZE_FAULT)
  938. #define BRIDGE_IRR_PCI_GRP (BRIDGE_ISR_PCI_ABORT | 
  939.  BRIDGE_ISR_PCI_PARITY | 
  940.  BRIDGE_ISR_PCI_SERR | 
  941.  BRIDGE_ISR_PCI_PERR | 
  942.  BRIDGE_ISR_PCI_MST_TIMEOUT | 
  943.  BRIDGE_ISR_PCI_RETRY_CNT)
  944. #define BRIDGE_IRR_GIO_GRP (BRIDGE_ISR_GIO_B_ENBL_ERR | 
  945.  BRIDGE_ISR_GIO_MST_TIMEOUT)
  946. /* Bridge INT_DEV register bits definition */
  947. #define BRIDGE_INT_DEV_SHFT(n) ((n)*3)
  948. #define BRIDGE_INT_DEV_MASK(n) (0x7 << BRIDGE_INT_DEV_SHFT(n))
  949. #define BRIDGE_INT_DEV_SET(_dev, _line) (_dev << BRIDGE_INT_DEV_SHFT(_line))
  950. /* Bridge interrupt(x) register bits definition */
  951. #define BRIDGE_INT_ADDR_HOST 0x0003FF00
  952. #define BRIDGE_INT_ADDR_FLD 0x000000FF
  953. #define BRIDGE_TMO_PCI_RETRY_HLD_MASK 0x1f0000
  954. #define BRIDGE_TMO_GIO_TIMEOUT_MASK 0x001000
  955. #define BRIDGE_TMO_PCI_RETRY_CNT_MASK 0x0003ff
  956. #define BRIDGE_TMO_PCI_RETRY_CNT_MAX 0x3ff
  957. #ifdef SN0
  958. /*
  959.  * The NASID should be shifted by this amount and stored into the
  960.  * interrupt(x) register.
  961.  */
  962. #define BRIDGE_INT_ADDR_NASID_SHFT 8
  963. /*
  964.  * The BRIDGE_INT_ADDR_DEST_IO bit should be set to send an interrupt to
  965.  * memory.
  966.  */
  967. #define BRIDGE_INT_ADDR_DEST_IO (1 << 17)
  968. #define BRIDGE_INT_ADDR_DEST_MEM 0
  969. #define BRIDGE_INT_ADDR_MASK (1 << 17)
  970. #endif
  971. /* Bridge device(x) register bits definition */
  972. #define BRIDGE_DEV_ERR_LOCK_EN (1ull << 28)
  973. #define BRIDGE_DEV_PAGE_CHK_DIS (1ull << 27)
  974. #define BRIDGE_DEV_FORCE_PCI_PAR (1ull << 26)
  975. #define BRIDGE_DEV_VIRTUAL_EN (1ull << 25)
  976. #define BRIDGE_DEV_PMU_WRGA_EN (1ull << 24)
  977. #define BRIDGE_DEV_DIR_WRGA_EN (1ull << 23)
  978. #define BRIDGE_DEV_DEV_SIZE (1ull << 22)
  979. #define BRIDGE_DEV_RT (1ull << 21)
  980. #define BRIDGE_DEV_SWAP_PMU (1ull << 20)
  981. #define BRIDGE_DEV_SWAP_DIR (1ull << 19)
  982. #define BRIDGE_DEV_PREF (1ull << 18)
  983. #define BRIDGE_DEV_PRECISE (1ull << 17)
  984. #define BRIDGE_DEV_COH (1ull << 16)
  985. #define BRIDGE_DEV_BARRIER (1ull << 15)
  986. #define BRIDGE_DEV_GBR (1ull << 14)
  987. #define BRIDGE_DEV_DEV_SWAP (1ull << 13)
  988. #define BRIDGE_DEV_DEV_IO_MEM (1ull << 12)
  989. #define BRIDGE_DEV_OFF_MASK 0x00000fff
  990. #define BRIDGE_DEV_OFF_ADDR_SHFT 20
  991. #define XBRIDGE_DEV_PMU_BITS BRIDGE_DEV_PMU_WRGA_EN
  992. #define BRIDGE_DEV_PMU_BITS (BRIDGE_DEV_PMU_WRGA_EN | 
  993.  BRIDGE_DEV_SWAP_PMU)
  994. #define BRIDGE_DEV_D32_BITS (BRIDGE_DEV_DIR_WRGA_EN | 
  995.  BRIDGE_DEV_SWAP_DIR | 
  996.  BRIDGE_DEV_PREF | 
  997.  BRIDGE_DEV_PRECISE | 
  998.  BRIDGE_DEV_COH | 
  999.  BRIDGE_DEV_BARRIER)
  1000. #define XBRIDGE_DEV_D64_BITS (BRIDGE_DEV_DIR_WRGA_EN | 
  1001.  BRIDGE_DEV_COH | 
  1002.  BRIDGE_DEV_BARRIER)
  1003. #define BRIDGE_DEV_D64_BITS (BRIDGE_DEV_DIR_WRGA_EN | 
  1004.  BRIDGE_DEV_SWAP_DIR | 
  1005.  BRIDGE_DEV_COH | 
  1006.  BRIDGE_DEV_BARRIER)
  1007. /* Bridge Error Upper register bit field definition */
  1008. #define BRIDGE_ERRUPPR_DEVMASTER (0x1 << 20) /* Device was master */
  1009. #define BRIDGE_ERRUPPR_PCIVDEV (0x1 << 19) /* Virtual Req value */
  1010. #define BRIDGE_ERRUPPR_DEVNUM_SHFT (16)
  1011. #define BRIDGE_ERRUPPR_DEVNUM_MASK (0x7 << BRIDGE_ERRUPPR_DEVNUM_SHFT)
  1012. #define BRIDGE_ERRUPPR_DEVICE(err) (((err) >> BRIDGE_ERRUPPR_DEVNUM_SHFT) & 0x7)
  1013. #define BRIDGE_ERRUPPR_ADDRMASK (0xFFFF)
  1014. /* Bridge interrupt mode register bits definition */
  1015. #define BRIDGE_INTMODE_CLR_PKT_EN(x) (0x1 << (x))
  1016. /* this should be written to the xbow's link_control(x) register */
  1017. #define BRIDGE_CREDIT 3
  1018. /* RRB assignment register */
  1019. #define BRIDGE_RRB_EN 0x8 /* after shifting down */
  1020. #define BRIDGE_RRB_DEV 0x7 /* after shifting down */
  1021. #define BRIDGE_RRB_VDEV 0x4 /* after shifting down */
  1022. #define BRIDGE_RRB_PDEV 0x3 /* after shifting down */
  1023. /* RRB status register */
  1024. #define BRIDGE_RRB_VALID(r) (0x00010000<<(r))
  1025. #define BRIDGE_RRB_INUSE(r) (0x00000001<<(r))
  1026. /* RRB clear register */
  1027. #define BRIDGE_RRB_CLEAR(r) (0x00000001<<(r))
  1028. /* xbox system controller declarations */
  1029. #define XBOX_BRIDGE_WID         8
  1030. #define FLASH_PROM1_BASE        0xE00000 /* To read the xbox sysctlr status */
  1031. #define XBOX_RPS_EXISTS 1 << 6  /* RPS bit in status register */
  1032. #define XBOX_RPS_FAIL 1 << 4  /* RPS status bit in register */
  1033. /* ========================================================================
  1034.  */
  1035. /*
  1036.  * Macros for Xtalk to Bridge bus (PCI/GIO) PIO
  1037.  * refer to section 4.2.1 of Bridge Spec for xtalk to PCI/GIO PIO mappings
  1038.  */
  1039. /* XTALK addresses that map into Bridge Bus addr space */
  1040. #define BRIDGE_PIO32_XTALK_ALIAS_BASE 0x000040000000L
  1041. #define BRIDGE_PIO32_XTALK_ALIAS_LIMIT 0x00007FFFFFFFL
  1042. #define BRIDGE_PIO64_XTALK_ALIAS_BASE 0x000080000000L
  1043. #define BRIDGE_PIO64_XTALK_ALIAS_LIMIT 0x0000BFFFFFFFL
  1044. #define BRIDGE_PCIIO_XTALK_ALIAS_BASE 0x000100000000L
  1045. #define BRIDGE_PCIIO_XTALK_ALIAS_LIMIT 0x0001FFFFFFFFL
  1046. /* Ranges of PCI bus space that can be accessed via PIO from xtalk */
  1047. #define BRIDGE_MIN_PIO_ADDR_MEM 0x00000000 /* 1G PCI memory space */
  1048. #define BRIDGE_MAX_PIO_ADDR_MEM 0x3fffffff
  1049. #define BRIDGE_MIN_PIO_ADDR_IO 0x00000000 /* 4G PCI IO space */
  1050. #define BRIDGE_MAX_PIO_ADDR_IO 0xffffffff
  1051. /* XTALK addresses that map into PCI addresses */
  1052. #define BRIDGE_PCI_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE
  1053. #define BRIDGE_PCI_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT
  1054. #define BRIDGE_PCI_MEM64_BASE BRIDGE_PIO64_XTALK_ALIAS_BASE
  1055. #define BRIDGE_PCI_MEM64_LIMIT BRIDGE_PIO64_XTALK_ALIAS_LIMIT
  1056. #define BRIDGE_PCI_IO_BASE BRIDGE_PCIIO_XTALK_ALIAS_BASE
  1057. #define BRIDGE_PCI_IO_LIMIT BRIDGE_PCIIO_XTALK_ALIAS_LIMIT
  1058. /*
  1059.  * Macros for Bridge bus (PCI/GIO) to Xtalk DMA
  1060.  */
  1061. /* Bridge Bus DMA addresses */
  1062. #define BRIDGE_LOCAL_BASE 0
  1063. #define BRIDGE_DMA_MAPPED_BASE 0x40000000
  1064. #define BRIDGE_DMA_MAPPED_SIZE 0x40000000 /* 1G Bytes */
  1065. #define BRIDGE_DMA_DIRECT_BASE 0x80000000
  1066. #define BRIDGE_DMA_DIRECT_SIZE 0x80000000 /* 2G Bytes */
  1067. #define PCI32_LOCAL_BASE BRIDGE_LOCAL_BASE
  1068. /* PCI addresses of regions decoded by Bridge for DMA */
  1069. #define PCI32_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE
  1070. #define PCI32_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE
  1071. #if LANGUAGE_C
  1072. #define IS_PCI32_LOCAL(x) ((uint64_t)(x) < PCI32_MAPPED_BASE)
  1073. #define IS_PCI32_MAPPED(x) ((uint64_t)(x) < PCI32_DIRECT_BASE && 
  1074. (uint64_t)(x) >= PCI32_MAPPED_BASE)
  1075. #define IS_PCI32_DIRECT(x) ((uint64_t)(x) >= PCI32_MAPPED_BASE)
  1076. #define IS_PCI64(x) ((uint64_t)(x) >= PCI64_BASE)
  1077. #endif /* LANGUAGE_C */
  1078. /*
  1079.  * The GIO address space.
  1080.  */
  1081. /* Xtalk to GIO PIO */
  1082. #define BRIDGE_GIO_MEM32_BASE BRIDGE_PIO32_XTALK_ALIAS_BASE
  1083. #define BRIDGE_GIO_MEM32_LIMIT BRIDGE_PIO32_XTALK_ALIAS_LIMIT
  1084. #define GIO_LOCAL_BASE BRIDGE_LOCAL_BASE
  1085. /* GIO addresses of regions decoded by Bridge for DMA */
  1086. #define GIO_MAPPED_BASE BRIDGE_DMA_MAPPED_BASE
  1087. #define GIO_DIRECT_BASE BRIDGE_DMA_DIRECT_BASE
  1088. #if LANGUAGE_C
  1089. #define IS_GIO_LOCAL(x) ((uint64_t)(x) < GIO_MAPPED_BASE)
  1090. #define IS_GIO_MAPPED(x) ((uint64_t)(x) < GIO_DIRECT_BASE && 
  1091. (uint64_t)(x) >= GIO_MAPPED_BASE)
  1092. #define IS_GIO_DIRECT(x) ((uint64_t)(x) >= GIO_MAPPED_BASE)
  1093. #endif /* LANGUAGE_C */
  1094. /* PCI to xtalk mapping */
  1095. /* given a DIR_OFF value and a pci/gio 32 bits direct address, determine
  1096.  * which xtalk address is accessed
  1097.  */
  1098. #define BRIDGE_DIRECT_32_SEG_SIZE BRIDGE_DMA_DIRECT_SIZE
  1099. #define BRIDGE_DIRECT_32_TO_XTALK(dir_off,adr)
  1100. ((dir_off) * BRIDGE_DIRECT_32_SEG_SIZE +
  1101. ((adr) & (BRIDGE_DIRECT_32_SEG_SIZE - 1)) + PHYS_RAMBASE)
  1102. /* 64-bit address attribute masks */
  1103. #define PCI64_ATTR_TARG_MASK 0xf000000000000000
  1104. #define PCI64_ATTR_TARG_SHFT 60
  1105. #define PCI64_ATTR_PREF (1ull << 59)
  1106. #define PCI64_ATTR_PREC (1ull << 58)
  1107. #define PCI64_ATTR_VIRTUAL (1ull << 57)
  1108. #define PCI64_ATTR_BAR (1ull << 56)
  1109. #define PCI64_ATTR_SWAP (1ull << 55)
  1110. #define PCI64_ATTR_RMF_MASK 0x00ff000000000000
  1111. #define PCI64_ATTR_RMF_SHFT 48
  1112. #if LANGUAGE_C
  1113. /* Address translation entry for mapped pci32 accesses */
  1114. typedef union ate_u {
  1115.     uint64_t     ent;
  1116.     struct xb_ate_s { /* xbridge */
  1117. uint64_t :16;
  1118. uint64_t addr:36;
  1119. uint64_t targ:4;
  1120. uint64_t reserved:2;
  1121.         uint64_t swap:1;
  1122. uint64_t barrier:1;
  1123. uint64_t prefetch:1;
  1124. uint64_t precise:1;
  1125. uint64_t coherent:1;
  1126. uint64_t valid:1;
  1127.     } xb_field;
  1128.     struct ate_s { /* bridge */
  1129. uint64_t rmf:16;
  1130. uint64_t addr:36;
  1131. uint64_t targ:4;
  1132. uint64_t reserved:3;
  1133. uint64_t barrier:1;
  1134. uint64_t prefetch:1;
  1135. uint64_t precise:1;
  1136. uint64_t coherent:1;
  1137. uint64_t valid:1;
  1138.     } field;
  1139. } ate_t;
  1140. #endif /* LANGUAGE_C */
  1141. #define ATE_V (1 << 0)
  1142. #define ATE_CO (1 << 1)
  1143. #define ATE_PREC (1 << 2)
  1144. #define ATE_PREF (1 << 3)
  1145. #define ATE_BAR (1 << 4)
  1146. #define ATE_SWAP        (1 << 5)
  1147. #define ATE_PFNSHIFT 12
  1148. #define ATE_TIDSHIFT 8
  1149. #define ATE_RMFSHIFT 48
  1150. #define mkate(xaddr, xid, attr) ((xaddr) & 0x0000fffffffff000ULL) | 
  1151. ((xid)<<ATE_TIDSHIFT) | 
  1152. (attr)
  1153. /*
  1154.  * for xbridge, bit 29 of the pci address is the swap bit */
  1155. #define ATE_SWAPSHIFT 29
  1156. #define ATE_SWAP_ON(x) ((x) |= (1 << ATE_SWAPSHIFT))
  1157. #define ATE_SWAP_OFF(x) ((x) &= ~(1 << ATE_SWAPSHIFT))
  1158. #define is_xbridge(bridge) 
  1159.         (XWIDGET_PART_NUM(bridge->b_wid_id) == XBRIDGE_WIDGET_PART_NUM)
  1160. #if LANGUAGE_C
  1161. /* ========================================================================
  1162.  */
  1163. #ifdef MACROFIELD_LINE
  1164. /*
  1165.  * This table forms a relation between the byte offset macros normally
  1166.  * used for ASM coding and the calculated byte offsets of the fields
  1167.  * in the C structure.
  1168.  *
  1169.  * See bridge_check.c and bridge_html.c for further details.
  1170.  */
  1171. #ifndef MACROFIELD_LINE_BITFIELD
  1172. #define MACROFIELD_LINE_BITFIELD(m) /* ignored */
  1173. #endif
  1174. struct macrofield_s bridge_macrofield[] =
  1175. {
  1176.     MACROFIELD_LINE(BRIDGE_WID_ID, b_wid_id)
  1177.     MACROFIELD_LINE_BITFIELD(WIDGET_REV_NUM)
  1178.     MACROFIELD_LINE_BITFIELD(WIDGET_PART_NUM)
  1179.     MACROFIELD_LINE_BITFIELD(WIDGET_MFG_NUM)
  1180.     MACROFIELD_LINE(BRIDGE_WID_STAT, b_wid_stat)
  1181.     MACROFIELD_LINE_BITFIELD(BRIDGE_STAT_LLP_REC_CNT)
  1182.     MACROFIELD_LINE_BITFIELD(BRIDGE_STAT_LLP_TX_CNT)
  1183.     MACROFIELD_LINE_BITFIELD(BRIDGE_STAT_FLASH_SELECT)
  1184.     MACROFIELD_LINE_BITFIELD(BRIDGE_STAT_PCI_GIO_N)
  1185.     MACROFIELD_LINE_BITFIELD(BRIDGE_STAT_PENDING)
  1186.     MACROFIELD_LINE(BRIDGE_WID_ERR_UPPER, b_wid_err_upper)
  1187.     MACROFIELD_LINE(BRIDGE_WID_ERR_LOWER, b_wid_err_lower)
  1188.     MACROFIELD_LINE(BRIDGE_WID_CONTROL, b_wid_control)
  1189.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_FLASH_WR_EN)
  1190.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_EN_CLK50)
  1191.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_EN_CLK40)
  1192.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_EN_CLK33)
  1193.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_RST_MASK)
  1194.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_IO_SWAP)
  1195.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_MEM_SWAP)
  1196.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_PAGE_SIZE)
  1197.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_SS_PAR_BAD)
  1198.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_SS_PAR_EN)
  1199.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_SSRAM_SIZE_MASK)
  1200.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_F_BAD_PKT)
  1201.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_LLP_XBAR_CRD_MASK)
  1202.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_CLR_RLLP_CNT)
  1203.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_CLR_TLLP_CNT)
  1204.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_SYS_END)
  1205.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_MAX_TRANS_MASK)
  1206.     MACROFIELD_LINE_BITFIELD(BRIDGE_CTRL_WIDGET_ID_MASK)
  1207.     MACROFIELD_LINE(BRIDGE_WID_REQ_TIMEOUT, b_wid_req_timeout)
  1208.     MACROFIELD_LINE(BRIDGE_WID_INT_UPPER, b_wid_int_upper)
  1209.     MACROFIELD_LINE_BITFIELD(WIDGET_INT_VECTOR)
  1210.     MACROFIELD_LINE_BITFIELD(WIDGET_TARGET_ID)
  1211.     MACROFIELD_LINE_BITFIELD(WIDGET_UPP_ADDR)
  1212.     MACROFIELD_LINE(BRIDGE_WID_INT_LOWER, b_wid_int_lower)
  1213.     MACROFIELD_LINE(BRIDGE_WID_ERR_CMDWORD, b_wid_err_cmdword)
  1214.     MACROFIELD_LINE_BITFIELD(WIDGET_DIDN)
  1215.     MACROFIELD_LINE_BITFIELD(WIDGET_SIDN)
  1216.     MACROFIELD_LINE_BITFIELD(WIDGET_PACTYP)
  1217.     MACROFIELD_LINE_BITFIELD(WIDGET_TNUM)
  1218.     MACROFIELD_LINE_BITFIELD(WIDGET_COHERENT)
  1219.     MACROFIELD_LINE_BITFIELD(WIDGET_DS)
  1220.     MACROFIELD_LINE_BITFIELD(WIDGET_GBR)
  1221.     MACROFIELD_LINE_BITFIELD(WIDGET_VBPM)
  1222.     MACROFIELD_LINE_BITFIELD(WIDGET_ERROR)
  1223.     MACROFIELD_LINE_BITFIELD(WIDGET_BARRIER)
  1224.     MACROFIELD_LINE(BRIDGE_WID_LLP, b_wid_llp)
  1225.     MACROFIELD_LINE_BITFIELD(WIDGET_LLP_MAXRETRY)
  1226.     MACROFIELD_LINE_BITFIELD(WIDGET_LLP_NULLTIMEOUT)
  1227.     MACROFIELD_LINE_BITFIELD(WIDGET_LLP_MAXBURST)
  1228.     MACROFIELD_LINE(BRIDGE_WID_TFLUSH, b_wid_tflush)
  1229.     MACROFIELD_LINE(BRIDGE_WID_AUX_ERR, b_wid_aux_err)
  1230.     MACROFIELD_LINE(BRIDGE_WID_RESP_UPPER, b_wid_resp_upper)
  1231.     MACROFIELD_LINE(BRIDGE_WID_RESP_LOWER, b_wid_resp_lower)
  1232.     MACROFIELD_LINE(BRIDGE_WID_TST_PIN_CTRL, b_wid_tst_pin_ctrl)
  1233.     MACROFIELD_LINE(BRIDGE_DIR_MAP, b_dir_map)
  1234.     MACROFIELD_LINE_BITFIELD(BRIDGE_DIRMAP_W_ID)
  1235.     MACROFIELD_LINE_BITFIELD(BRIDGE_DIRMAP_RMF_64)
  1236.     MACROFIELD_LINE_BITFIELD(BRIDGE_DIRMAP_ADD512)
  1237.     MACROFIELD_LINE_BITFIELD(BRIDGE_DIRMAP_OFF)
  1238.     MACROFIELD_LINE(BRIDGE_RAM_PERR, b_ram_perr)
  1239.     MACROFIELD_LINE(BRIDGE_ARB, b_arb)
  1240.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_REQ_WAIT_TICK_MASK)
  1241.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_REQ_WAIT_EN_MASK)
  1242.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_FREEZE_GNT)
  1243.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_HPRI_RING_B2)
  1244.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_HPRI_RING_B1)
  1245.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_HPRI_RING_B0)
  1246.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_LPRI_RING_B2)
  1247.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_LPRI_RING_B1)
  1248.     MACROFIELD_LINE_BITFIELD(BRIDGE_ARB_LPRI_RING_B0)
  1249.     MACROFIELD_LINE(BRIDGE_NIC, b_nic)
  1250.     MACROFIELD_LINE(BRIDGE_PCI_BUS_TIMEOUT, b_pci_bus_timeout)
  1251.     MACROFIELD_LINE(BRIDGE_PCI_CFG, b_pci_cfg)
  1252.     MACROFIELD_LINE(BRIDGE_PCI_ERR_UPPER, b_pci_err_upper)
  1253.     MACROFIELD_LINE(BRIDGE_PCI_ERR_LOWER, b_pci_err_lower)
  1254.     MACROFIELD_LINE(BRIDGE_INT_STATUS, b_int_status)
  1255.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_MULTI_ERR)
  1256.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PMU_ESIZE_FAULT)
  1257.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_UNEXP_RESP)
  1258.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_BAD_XRESP_PKT)
  1259.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_BAD_XREQ_PKT)
  1260.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_RESP_XTLK_ERR)
  1261.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_REQ_XTLK_ERR)
  1262.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_INVLD_ADDR)
  1263.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_UNSUPPORTED_XOP)
  1264.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_XREQ_FIFO_OFLOW)
  1265.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_LLP_REC_SNERR)
  1266.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_LLP_REC_CBERR)
  1267.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_LLP_RCTY)
  1268.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_LLP_TX_RETRY)
  1269.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_LLP_TCTY)
  1270.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_SSRAM_PERR)
  1271.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_ABORT)
  1272.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_PARITY)
  1273.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_SERR)
  1274.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_PERR)
  1275.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_MST_TIMEOUT)
  1276.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_PCI_RETRY_CNT)
  1277.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_XREAD_REQ_TIMEOUT)
  1278.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_GIO_B_ENBL_ERR)
  1279.     MACROFIELD_LINE_BITFIELD(BRIDGE_ISR_INT_MSK)
  1280.     MACROFIELD_LINE(BRIDGE_INT_ENABLE, b_int_enable)
  1281.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_UNEXP_RESP)
  1282.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PMU_ESIZE_FAULT)
  1283.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_BAD_XRESP_PKT)
  1284.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_BAD_XREQ_PKT)
  1285.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_RESP_XTLK_ERR)
  1286.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_REQ_XTLK_ERR)
  1287.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_INVLD_ADDR)
  1288.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_UNSUPPORTED_XOP)
  1289.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_XREQ_FIFO_OFLOW)
  1290.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_LLP_REC_SNERR)
  1291.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_LLP_REC_CBERR)
  1292.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_LLP_RCTY)
  1293.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_LLP_TX_RETRY)
  1294.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_LLP_TCTY)
  1295.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_SSRAM_PERR)
  1296.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_ABORT)
  1297.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_PARITY)
  1298.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_SERR)
  1299.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_PERR)
  1300.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_MST_TIMEOUT)
  1301.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_PCI_RETRY_CNT)
  1302.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_XREAD_REQ_TIMEOUT)
  1303.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_GIO_B_ENBL_ERR)
  1304.     MACROFIELD_LINE_BITFIELD(BRIDGE_IMR_INT_MSK)
  1305.     MACROFIELD_LINE(BRIDGE_INT_RST_STAT, b_int_rst_stat)
  1306.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_ALL_CLR)
  1307.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_MULTI_CLR)
  1308.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_CRP_GRP_CLR)
  1309.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_RESP_BUF_GRP_CLR)
  1310.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_REQ_DSP_GRP_CLR)
  1311.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_LLP_GRP_CLR)
  1312.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_SSRAM_GRP_CLR)
  1313.     MACROFIELD_LINE_BITFIELD(BRIDGE_IRR_PCI_GRP_CLR)
  1314.     MACROFIELD_LINE(BRIDGE_INT_MODE, b_int_mode)
  1315.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(7))
  1316.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(6))
  1317.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(5))
  1318.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(4))
  1319.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(3))
  1320.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(2))
  1321.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(1))
  1322.     MACROFIELD_LINE_BITFIELD(BRIDGE_INTMODE_CLR_PKT_EN(0))
  1323.     MACROFIELD_LINE(BRIDGE_INT_DEVICE, b_int_device)
  1324.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(7))
  1325.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(6))
  1326.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(5))
  1327.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(4))
  1328.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(3))
  1329.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(2))
  1330.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(1))
  1331.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_DEV_MASK(0))
  1332.     MACROFIELD_LINE(BRIDGE_INT_HOST_ERR, b_int_host_err)
  1333.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_ADDR_HOST)
  1334.     MACROFIELD_LINE_BITFIELD(BRIDGE_INT_ADDR_FLD)
  1335.     MACROFIELD_LINE(BRIDGE_INT_ADDR0, b_int_addr[0].addr)
  1336.     MACROFIELD_LINE(BRIDGE_INT_ADDR(0), b_int_addr[0].addr)
  1337.     MACROFIELD_LINE(BRIDGE_INT_ADDR(1), b_int_addr[1].addr)
  1338.     MACROFIELD_LINE(BRIDGE_INT_ADDR(2), b_int_addr[2].addr)
  1339.     MACROFIELD_LINE(BRIDGE_INT_ADDR(3), b_int_addr[3].addr)
  1340.     MACROFIELD_LINE(BRIDGE_INT_ADDR(4), b_int_addr[4].addr)
  1341.     MACROFIELD_LINE(BRIDGE_INT_ADDR(5), b_int_addr[5].addr)
  1342.     MACROFIELD_LINE(BRIDGE_INT_ADDR(6), b_int_addr[6].addr)
  1343.     MACROFIELD_LINE(BRIDGE_INT_ADDR(7), b_int_addr[7].addr)
  1344.     MACROFIELD_LINE(BRIDGE_DEVICE0, b_device[0].reg)
  1345.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_ERR_LOCK_EN)
  1346.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_PAGE_CHK_DIS)
  1347.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_FORCE_PCI_PAR)
  1348.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_VIRTUAL_EN)
  1349.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_PMU_WRGA_EN)
  1350.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_DIR_WRGA_EN)
  1351.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_DEV_SIZE)
  1352.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_RT)
  1353.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_SWAP_PMU)
  1354.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_SWAP_DIR)
  1355.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_PREF)
  1356.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_PRECISE)
  1357.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_COH)
  1358.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_BARRIER)
  1359.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_GBR)
  1360.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_DEV_SWAP)
  1361.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_DEV_IO_MEM)
  1362.     MACROFIELD_LINE_BITFIELD(BRIDGE_DEV_OFF_MASK)
  1363.     MACROFIELD_LINE(BRIDGE_DEVICE(0), b_device[0].reg)
  1364.     MACROFIELD_LINE(BRIDGE_DEVICE(1), b_device[1].reg)
  1365.     MACROFIELD_LINE(BRIDGE_DEVICE(2), b_device[2].reg)
  1366.     MACROFIELD_LINE(BRIDGE_DEVICE(3), b_device[3].reg)
  1367.     MACROFIELD_LINE(BRIDGE_DEVICE(4), b_device[4].reg)
  1368.     MACROFIELD_LINE(BRIDGE_DEVICE(5), b_device[5].reg)
  1369.     MACROFIELD_LINE(BRIDGE_DEVICE(6), b_device[6].reg)
  1370.     MACROFIELD_LINE(BRIDGE_DEVICE(7), b_device[7].reg)
  1371.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF0, b_wr_req_buf[0].reg)
  1372.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(0), b_wr_req_buf[0].reg)
  1373.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(1), b_wr_req_buf[1].reg)
  1374.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(2), b_wr_req_buf[2].reg)
  1375.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(3), b_wr_req_buf[3].reg)
  1376.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(4), b_wr_req_buf[4].reg)
  1377.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(5), b_wr_req_buf[5].reg)
  1378.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(6), b_wr_req_buf[6].reg)
  1379.     MACROFIELD_LINE(BRIDGE_WR_REQ_BUF(7), b_wr_req_buf[7].reg)
  1380.     MACROFIELD_LINE(BRIDGE_EVEN_RESP, b_even_resp)
  1381.     MACROFIELD_LINE(BRIDGE_ODD_RESP, b_odd_resp)
  1382.     MACROFIELD_LINE(BRIDGE_RESP_STATUS, b_resp_status)
  1383.     MACROFIELD_LINE(BRIDGE_RESP_CLEAR, b_resp_clear)
  1384.     MACROFIELD_LINE(BRIDGE_ATE_RAM, b_int_ate_ram)
  1385.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV0, b_type0_cfg_dev[0])
  1386.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(0), b_type0_cfg_dev[0])
  1387.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,0), b_type0_cfg_dev[0].f[0])
  1388.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,1), b_type0_cfg_dev[0].f[1])
  1389.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,2), b_type0_cfg_dev[0].f[2])
  1390.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,3), b_type0_cfg_dev[0].f[3])
  1391.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,4), b_type0_cfg_dev[0].f[4])
  1392.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,5), b_type0_cfg_dev[0].f[5])
  1393.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,6), b_type0_cfg_dev[0].f[6])
  1394.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(0,7), b_type0_cfg_dev[0].f[7])
  1395.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(1), b_type0_cfg_dev[1])
  1396.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,0), b_type0_cfg_dev[1].f[0])
  1397.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,1), b_type0_cfg_dev[1].f[1])
  1398.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,2), b_type0_cfg_dev[1].f[2])
  1399.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,3), b_type0_cfg_dev[1].f[3])
  1400.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,4), b_type0_cfg_dev[1].f[4])
  1401.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,5), b_type0_cfg_dev[1].f[5])
  1402.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,6), b_type0_cfg_dev[1].f[6])
  1403.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(1,7), b_type0_cfg_dev[1].f[7])
  1404.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(2), b_type0_cfg_dev[2])
  1405.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,0), b_type0_cfg_dev[2].f[0])
  1406.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,1), b_type0_cfg_dev[2].f[1])
  1407.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,2), b_type0_cfg_dev[2].f[2])
  1408.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,3), b_type0_cfg_dev[2].f[3])
  1409.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,4), b_type0_cfg_dev[2].f[4])
  1410.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,5), b_type0_cfg_dev[2].f[5])
  1411.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,6), b_type0_cfg_dev[2].f[6])
  1412.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(2,7), b_type0_cfg_dev[2].f[7])
  1413.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(3), b_type0_cfg_dev[3])
  1414.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,0), b_type0_cfg_dev[3].f[0])
  1415.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,1), b_type0_cfg_dev[3].f[1])
  1416.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,2), b_type0_cfg_dev[3].f[2])
  1417.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,3), b_type0_cfg_dev[3].f[3])
  1418.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,4), b_type0_cfg_dev[3].f[4])
  1419.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,5), b_type0_cfg_dev[3].f[5])
  1420.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,6), b_type0_cfg_dev[3].f[6])
  1421.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(3,7), b_type0_cfg_dev[3].f[7])
  1422.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(4), b_type0_cfg_dev[4])
  1423.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,0), b_type0_cfg_dev[4].f[0])
  1424.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,1), b_type0_cfg_dev[4].f[1])
  1425.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,2), b_type0_cfg_dev[4].f[2])
  1426.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,3), b_type0_cfg_dev[4].f[3])
  1427.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,4), b_type0_cfg_dev[4].f[4])
  1428.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,5), b_type0_cfg_dev[4].f[5])
  1429.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,6), b_type0_cfg_dev[4].f[6])
  1430.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(4,7), b_type0_cfg_dev[4].f[7])
  1431.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(5), b_type0_cfg_dev[5])
  1432.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,0), b_type0_cfg_dev[5].f[0])
  1433.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,1), b_type0_cfg_dev[5].f[1])
  1434.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,2), b_type0_cfg_dev[5].f[2])
  1435.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,3), b_type0_cfg_dev[5].f[3])
  1436.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,4), b_type0_cfg_dev[5].f[4])
  1437.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,5), b_type0_cfg_dev[5].f[5])
  1438.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,6), b_type0_cfg_dev[5].f[6])
  1439.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(5,7), b_type0_cfg_dev[5].f[7])
  1440.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(6), b_type0_cfg_dev[6])
  1441.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,0), b_type0_cfg_dev[6].f[0])
  1442.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,1), b_type0_cfg_dev[6].f[1])
  1443.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,2), b_type0_cfg_dev[6].f[2])
  1444.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,3), b_type0_cfg_dev[6].f[3])
  1445.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,4), b_type0_cfg_dev[6].f[4])
  1446.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,5), b_type0_cfg_dev[6].f[5])
  1447.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,6), b_type0_cfg_dev[6].f[6])
  1448.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(6,7), b_type0_cfg_dev[6].f[7])
  1449.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEV(7), b_type0_cfg_dev[7])
  1450.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,0), b_type0_cfg_dev[7].f[0])
  1451.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,1), b_type0_cfg_dev[7].f[1])
  1452.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,2), b_type0_cfg_dev[7].f[2])
  1453.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,3), b_type0_cfg_dev[7].f[3])
  1454.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,4), b_type0_cfg_dev[7].f[4])
  1455.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,5), b_type0_cfg_dev[7].f[5])
  1456.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,6), b_type0_cfg_dev[7].f[6])
  1457.     MACROFIELD_LINE(BRIDGE_TYPE0_CFG_DEVF(7,7), b_type0_cfg_dev[7].f[7])
  1458.     MACROFIELD_LINE(BRIDGE_TYPE1_CFG, b_type1_cfg)
  1459.     MACROFIELD_LINE(BRIDGE_PCI_IACK, b_pci_iack)
  1460.     MACROFIELD_LINE(BRIDGE_EXT_SSRAM, b_ext_ate_ram)
  1461.     MACROFIELD_LINE(BRIDGE_DEVIO0, b_devio(0))
  1462.     MACROFIELD_LINE(BRIDGE_DEVIO(0), b_devio(0))
  1463.     MACROFIELD_LINE(BRIDGE_DEVIO(1), b_devio(1))
  1464.     MACROFIELD_LINE(BRIDGE_DEVIO(2), b_devio(2))
  1465.     MACROFIELD_LINE(BRIDGE_DEVIO(3), b_devio(3))
  1466.     MACROFIELD_LINE(BRIDGE_DEVIO(4), b_devio(4))
  1467.     MACROFIELD_LINE(BRIDGE_DEVIO(5), b_devio(5))
  1468.     MACROFIELD_LINE(BRIDGE_DEVIO(6), b_devio(6))
  1469.     MACROFIELD_LINE(BRIDGE_DEVIO(7), b_devio(7))
  1470.     MACROFIELD_LINE(BRIDGE_EXTERNAL_FLASH, b_external_flash)
  1471. };
  1472. #endif
  1473. #ifdef __cplusplus
  1474. };
  1475. #endif
  1476. #endif /* C or C++ */ 
  1477. #endif                          /* _ASM_SN_PCI_BRIDGE_H */