Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64-SGI] add support for TIO huge-window

Altix patch to add TIO "huge-window" address support to sn_dma_flush().

Update copyright in affected files.

Signed-off-by: Mark Maule <maule@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Mark Maule and committed by
Tony Luck
5b53ed1f 735e60f4

+45 -26
+5 -1
arch/ia64/sn/include/tio.h
··· 3 3 * License. See the file "COPYING" in the main directory of this archive 4 4 * for more details. 5 5 * 6 - * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 + * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved. 7 7 */ 8 8 9 9 #ifndef _ASM_IA64_SN_TIO_H ··· 26 26 #define TIO_ITTE_VALID_MASK 0x1 27 27 #define TIO_ITTE_VALID_SHIFT 16 28 28 29 + #define TIO_ITTE_WIDGET(itte) \ 30 + (((itte) >> TIO_ITTE_WIDGET_SHIFT) & TIO_ITTE_WIDGET_MASK) 31 + #define TIO_ITTE_VALID(itte) \ 32 + (((itte) >> TIO_ITTE_VALID_SHIFT) & TIO_ITTE_VALID_MASK) 29 33 30 34 #define TIO_ITTE_PUT(nasid, bigwin, widget, addr, valid) \ 31 35 REMOTE_HUB_S((nasid), TIO_ITTE(bigwin), \
+4 -1
arch/ia64/sn/include/xtalk/hubdev.h
··· 3 3 * License. See the file "COPYING" in the main directory of this archive 4 4 * for more details. 5 5 * 6 - * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights reserved. 6 + * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights reserved. 7 7 */ 8 8 #ifndef _ASM_IA64_SN_XTALK_HUBDEV_H 9 9 #define _ASM_IA64_SN_XTALK_HUBDEV_H ··· 15 15 #define IIO_ITTE_WIDGET_BITS 4 /* size of widget field */ 16 16 #define IIO_ITTE_WIDGET_MASK ((1<<IIO_ITTE_WIDGET_BITS)-1) 17 17 #define IIO_ITTE_WIDGET_SHIFT 8 18 + 19 + #define IIO_ITTE_WIDGET(itte) \ 20 + (((itte) >> IIO_ITTE_WIDGET_SHIFT) & IIO_ITTE_WIDGET_MASK) 18 21 19 22 /* 20 23 * Use the top big window as a surrogate for the first small window
+33 -22
arch/ia64/sn/pci/pcibr/pcibr_dma.c
··· 3 3 * License. See the file "COPYING" in the main directory of this archive 4 4 * for more details. 5 5 * 6 - * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved. 6 + * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved. 7 7 */ 8 8 9 9 #include <linux/types.h> ··· 215 215 int is_tio; 216 216 int wid_num; 217 217 int i, j; 218 - int bwin; 219 218 uint64_t flags; 219 + uint64_t itte; 220 220 struct hubdev_info *hubinfo; 221 221 volatile struct sn_flush_device_list *p; 222 222 struct sn_flush_nasid_entry *flush_nasid_list; ··· 233 233 if (!hubinfo) { 234 234 BUG(); 235 235 } 236 - is_tio = (nasid & 1); 237 - if (is_tio) { 238 - wid_num = TIO_SWIN_WIDGETNUM(addr); 239 - bwin = TIO_BWIN_WINDOWNUM(addr); 240 - } else { 241 - wid_num = SWIN_WIDGETNUM(addr); 242 - bwin = BWIN_WINDOWNUM(addr); 243 - } 244 236 245 237 flush_nasid_list = &hubinfo->hdi_flush_nasid_list; 246 238 if (flush_nasid_list->widget_p == NULL) 247 239 return; 248 - if (bwin > 0) { 249 - uint64_t itte = flush_nasid_list->iio_itte[bwin]; 250 240 251 - if (is_tio) { 252 - wid_num = (itte >> TIO_ITTE_WIDGET_SHIFT) & 253 - TIO_ITTE_WIDGET_MASK; 254 - } else { 255 - wid_num = (itte >> IIO_ITTE_WIDGET_SHIFT) & 256 - IIO_ITTE_WIDGET_MASK; 257 - } 241 + is_tio = (nasid & 1); 242 + if (is_tio) { 243 + int itte_index; 244 + 245 + if (TIO_HWIN(addr)) 246 + itte_index = 0; 247 + else if (TIO_BWIN_WINDOWNUM(addr)) 248 + itte_index = TIO_BWIN_WINDOWNUM(addr); 249 + else 250 + itte_index = -1; 251 + 252 + if (itte_index >= 0) { 253 + itte = flush_nasid_list->iio_itte[itte_index]; 254 + if (! TIO_ITTE_VALID(itte)) 255 + return; 256 + wid_num = TIO_ITTE_WIDGET(itte); 257 + } else 258 + wid_num = TIO_SWIN_WIDGETNUM(addr); 259 + } else { 260 + if (BWIN_WINDOWNUM(addr)) { 261 + itte = flush_nasid_list->iio_itte[BWIN_WINDOWNUM(addr)]; 262 + wid_num = IIO_ITTE_WIDGET(itte); 263 + } else 264 + wid_num = SWIN_WIDGETNUM(addr); 258 265 } 259 - if (flush_nasid_list->widget_p == NULL) 260 - return; 261 266 if (flush_nasid_list->widget_p[wid_num] == NULL) 262 267 return; 263 268 p = &flush_nasid_list->widget_p[wid_num][0]; ··· 288 283 /* 289 284 * For TIOCP use the Device(x) Write Request Buffer Flush Bridge 290 285 * register since it ensures the data has entered the coherence 291 - * domain, unlike PIC 286 + * domain, unlike PIC. 292 287 */ 293 288 if (is_tio) { 289 + /* 290 + * Note: devices behind TIOCE should never be matched in the 291 + * above code, and so the following code is PIC/CP centric. 292 + * If CE ever needs the sn_dma_flush mechanism, we will have 293 + * to account for that here and in tioce_bus_fixup(). 294 + */ 294 295 uint32_t tio_id = REMOTE_HUB_L(nasid, TIO_NODE_ID); 295 296 uint32_t revnum = XWIDGET_PART_REV_NUM(tio_id); 296 297
+3 -2
include/asm-ia64/sn/addrs.h
··· 3 3 * License. See the file "COPYING" in the main directory of this archive 4 4 * for more details. 5 5 * 6 - * Copyright (c) 1992-1999,2001-2004 Silicon Graphics, Inc. All rights reserved. 6 + * Copyright (c) 1992-1999,2001-2005 Silicon Graphics, Inc. All rights reserved. 7 7 */ 8 8 9 9 #ifndef _ASM_IA64_SN_ADDRS_H ··· 191 191 #define TIO_BWIN_WINDOW_SELECT_MASK 0x7 192 192 #define TIO_BWIN_WINDOWNUM(x) (((x) >> TIO_BWIN_SIZE_BITS) & TIO_BWIN_WINDOW_SELECT_MASK) 193 193 194 - 194 + #define TIO_HWIN_SHIFT_BITS 33 195 + #define TIO_HWIN(x) (NODE_OFFSET(x) >> TIO_HWIN_SHIFT_BITS) 195 196 196 197 /* 197 198 * The following definitions pertain to the IO special address