blob: 4d417c301201c4a5364a6776d4d965fd1a397571 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 *
Mark Maule5b53ed12005-08-03 14:06:00 -07006 * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved.
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
8#ifndef _ASM_IA64_SN_XTALK_HUBDEV_H
9#define _ASM_IA64_SN_XTALK_HUBDEV_H
10
Prarit Bhargavac13cf372005-07-06 15:26:51 -070011#include "xtalk/xwidgetdev.h"
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#define HUB_WIDGET_ID_MAX 0xf
14#define DEV_PER_WIDGET (2*2*8)
15#define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */
16#define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1)
17#define IIO_ITTE_WIDGET_SHIFT 8
18
Mark Maule5b53ed12005-08-03 14:06:00 -070019#define IIO_ITTE_WIDGET(itte) \
20 (((itte) >> IIO_ITTE_WIDGET_SHIFT) & IIO_ITTE_WIDGET_MASK)
21
Linus Torvalds1da177e2005-04-16 15:20:36 -070022/*
23 * Use the top big window as a surrogate for the first small window
24 */
25#define SWIN0_BIGWIN HUB_NUM_BIG_WINDOW
26#define IIO_NUM_ITTES 7
27#define HUB_NUM_BIG_WINDOW (IIO_NUM_ITTES - 1)
28
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050029/* This struct is shared between the PROM and the kernel.
30 * Changes to this struct will require corresponding changes to the kernel.
31 */
32struct sn_flush_device_common {
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 int sfdl_bus;
34 int sfdl_slot;
35 int sfdl_pin;
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050036 struct common_bar_list {
Linus Torvalds1da177e2005-04-16 15:20:36 -070037 unsigned long start;
38 unsigned long end;
39 } sfdl_bar_list[6];
40 unsigned long sfdl_force_int_addr;
41 unsigned long sfdl_flush_value;
42 volatile unsigned long *sfdl_flush_addr;
Colin Ngam674c6472005-08-03 13:35:00 -070043 uint32_t sfdl_persistent_busnum;
44 uint32_t sfdl_persistent_segment;
Linus Torvalds1da177e2005-04-16 15:20:36 -070045 struct pcibus_info *sfdl_pcibus_info;
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050046};
47
48/* This struct is kernel only and is not used by the PROM */
49struct sn_flush_device_kernel {
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 spinlock_t sfdl_flush_lock;
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050051 struct sn_flush_device_common *common;
Linus Torvalds1da177e2005-04-16 15:20:36 -070052};
53
54/*
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050055 * **widget_p - Used as an array[wid_num][device] of sn_flush_device_kernel.
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 */
57struct sn_flush_nasid_entry {
Prarit Bhargava6d6e4202005-12-23 13:33:25 -050058 struct sn_flush_device_kernel **widget_p; // Used as an array of wid_num
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 uint64_t iio_itte[8];
60};
61
62struct hubdev_info {
63 geoid_t hdi_geoid;
64 short hdi_nasid;
65 short hdi_peer_nasid; /* Dual Porting Peer */
66
67 struct sn_flush_nasid_entry hdi_flush_nasid_list;
68 struct xwidget_info hdi_xwidget_info[HUB_WIDGET_ID_MAX + 1];
69
70
71 void *hdi_nodepda;
72 void *hdi_node_vertex;
Colin Ngam674c6472005-08-03 13:35:00 -070073 uint32_t max_segment_number;
74 uint32_t max_pcibus_number;
Linus Torvalds1da177e2005-04-16 15:20:36 -070075};
76
77extern void hubdev_init_node(nodepda_t *, cnodeid_t);
78extern void hub_error_init(struct hubdev_info *);
79extern void ice_error_init(struct hubdev_info *);
80
81
82#endif /* _ASM_IA64_SN_XTALK_HUBDEV_H */