patch-2.4.21 linux-2.4.21/arch/ia64/sn/io/io.c
Next file: linux-2.4.21/arch/ia64/sn/io/klgraph_hack.c
Previous file: linux-2.4.21/arch/ia64/sn/io/invent.c
Back to the patch index
Back to the overall index
- Lines: 198
- Date:
2003-06-13 07:51:30.000000000 -0700
- Orig file:
linux-2.4.20/arch/ia64/sn/io/io.c
- Orig date:
2002-08-02 17:39:42.000000000 -0700
diff -urN linux-2.4.20/arch/ia64/sn/io/io.c linux-2.4.21/arch/ia64/sn/io/io.c
@@ -7,6 +7,7 @@
* Copyright (C) 1992-1997, 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
*/
+#include <linux/config.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <asm/sn/types.h>
@@ -31,21 +32,6 @@
extern void hub_intr_init(devfs_handle_t hubv);
-/*
- * hub_device_desc_update
- * Update the passed in device descriptor with the actual the
- * target cpu number and interrupt priority level.
- * NOTE : These might be the same as the ones passed in thru
- * the descriptor.
- */
-void
-hub_device_desc_update(device_desc_t dev_desc,
- ilvl_t intr_swlevel,
- cpuid_t cpu)
-{
-}
-
-
/*
* Perform any initializations needed to support hub-based I/O.
* Called once during startup.
@@ -53,11 +39,6 @@
void
hubio_init(void)
{
-#ifdef LATER
- /* This isn't needed unless we port the entire sio driver ... */
- extern void early_brl1_port_init( void );
- early_brl1_port_init();
-#endif
}
/*
@@ -149,6 +130,10 @@
nasid_t nasid;
volatile hubreg_t junk;
unsigned long s;
+ caddr_t kvaddr;
+#ifdef PIOMAP_UNC_ACC_SPACE
+ uint64_t addr;
+#endif
/* sanity check */
if (byte_count_max > byte_count)
@@ -159,8 +144,19 @@
/* If xtalk_addr range is mapped by a small window, we don't have
* to do much
*/
- if (xtalk_addr + byte_count <= SWIN_SIZE)
- return(hubinfo_swin_piomap_get(hubinfo, (int)widget));
+ if (xtalk_addr + byte_count <= SWIN_SIZE) {
+ hub_piomap_t piomap;
+
+ piomap = hubinfo_swin_piomap_get(hubinfo, (int)widget);
+#ifdef PIOMAP_UNC_ACC_SPACE
+ if (flags & PIOMAP_UNC_ACC) {
+ addr = (uint64_t)piomap->hpio_xtalk_info.xp_kvaddr;
+ addr |= PIOMAP_UNC_ACC_SPACE;
+ piomap->hpio_xtalk_info.xp_kvaddr = (caddr_t)addr;
+ }
+#endif
+ return piomap;
+ }
/* We need to use a big window mapping. */
@@ -257,7 +253,15 @@
bw_piomap->hpio_xtalk_info.xp_dev = dev;
bw_piomap->hpio_xtalk_info.xp_target = widget;
bw_piomap->hpio_xtalk_info.xp_xtalk_addr = xtalk_addr;
- bw_piomap->hpio_xtalk_info.xp_kvaddr = (caddr_t)NODE_BWIN_BASE(nasid, free_bw_index);
+ kvaddr = (caddr_t)NODE_BWIN_BASE(nasid, free_bw_index);
+#ifdef PIOMAP_UNC_ACC_SPACE
+ if (flags & PIOMAP_UNC_ACC) {
+ addr = (uint64_t)kvaddr;
+ addr |= PIOMAP_UNC_ACC_SPACE;
+ kvaddr = (caddr_t)addr;
+ }
+#endif
+ bw_piomap->hpio_xtalk_info.xp_kvaddr = kvaddr;
bw_piomap->hpio_holdcnt++;
bw_piomap->hpio_bigwin_num = free_bw_index;
@@ -378,12 +382,22 @@
devfs_handle_t hubv = xwidget_info_master_get(widget_info);
hub_piomap_t hub_piomap;
hubinfo_t hubinfo;
+ caddr_t addr;
hubinfo_get(hubv, &hubinfo);
if (xtalk_addr + byte_count <= SWIN_SIZE) {
hub_piomap = hubinfo_swin_piomap_get(hubinfo, (int)widget);
- return(hub_piomap_addr(hub_piomap, xtalk_addr, byte_count));
+ addr = hub_piomap_addr(hub_piomap, xtalk_addr, byte_count);
+#ifdef PIOMAP_UNC_ACC_SPACE
+ if (flags & PIOMAP_UNC_ACC) {
+ uint64_t iaddr;
+ iaddr = (uint64_t)addr;
+ iaddr |= PIOMAP_UNC_ACC_SPACE;
+ addr = (caddr_t)iaddr;
+ }
+#endif
+ return(addr);
} else
return(0);
}
@@ -392,19 +406,6 @@
/* DMA MANAGEMENT */
/* Mapping from crosstalk space to system physical space */
-/*
- * There's not really very much to do here, since crosstalk maps
- * directly to system physical space. It's quite possible that this
- * DMA layer will be bypassed in performance kernels.
- */
-
-
-/* ARGSUSED */
-void
-hub_dma_init(devfs_handle_t hubv)
-{
-}
-
/*
* Allocate resources needed to set up DMA mappings up to a specified size
@@ -478,7 +479,12 @@
}
/* There isn't actually any DMA mapping hardware on the hub. */
- return(paddr);
+#ifdef CONFIG_IA64_SGI_SN2
+ return( (PHYS_TO_DMA(paddr)) );
+#else
+ /* no translation needed */
+ return(paddr);
+#endif
}
/*
@@ -549,8 +555,12 @@
size_t byte_count, /* length */
unsigned flags) /* defined in dma.h */
{
+#ifdef CONFIG_IA64_SGI_SN2
+ return( (PHYS_TO_DMA(paddr)) );
+#else
/* no translation needed */
return(paddr);
+#endif
}
/*
@@ -565,6 +575,7 @@
alenlist_t palenlist, /* system address/length list */
unsigned flags) /* defined in dma.h */
{
+ BUG();
/* no translation needed */
return(palenlist);
}
@@ -603,11 +614,9 @@
void
hub_provider_startup(devfs_handle_t hubv)
{
- extern void hub_dma_init(devfs_handle_t hubv);
extern void hub_pio_init(devfs_handle_t hubv);
hub_pio_init(hubv);
- hub_dma_init(hubv);
hub_intr_init(hubv);
}
@@ -707,14 +716,12 @@
{
iprb_t prb;
int prb_offset;
-#ifdef LATER
extern int force_fire_and_forget;
extern volatile int ignore_conveyor_override;
if (force_fire_and_forget && !ignore_conveyor_override)
if (conveyor == HUB_PIO_CONVEYOR)
conveyor = HUB_PIO_FIRE_N_FORGET;
-#endif
/*
* Get the current register value.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)