Skip to contentSkip to conversation

- Update SN2 code for running on simulator

PATCH In review Jack Steiner 2 participants 3 messages Jan 4, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 - Update SN2 code for running on simulator

Update the hack in sn_io_addr() that is used when running on the system simulator. The change is needed for running on systems with the new shub2 chipset.

Note that this change affects simulator runs only.

Index: linux/arch/ia64/sn/kernel/iomv.c
=================================--- linux.orig/arch/ia64/sn/kernel/iomv.c 2005-01-03 19:53:47.745120404 -0600
+++ linux/arch/ia64/sn/kernel/iomv.c 2005-01-04 08:20:27.550257092 -0600
@@ -32,7 +32,6 @@ void *sn_io_addr(unsigned long port)
return ((void *)(port | __IA64_UNCACHED_OFFSET));
} else {
/* but the simulator uses them... */
- unsigned long io_base;
unsigned long addr;

/*
@@ -40,13 +39,9 @@ void *sn_io_addr(unsigned long port)
* for accessing registers in bedrock local block
* (so we don't do port&0xfff)
*/
- if ((port >= 0x1f0 && port <= 0x1f7) ||
- port = 0x3f6 || port = 0x3f7) {
- io_base = GLOBAL_MMR_ADDR(get_nasid(), 0xfcc000000UL);
- addr = io_base | ((port >> 2) << 12) | (port & 0xfff);
- } else {
- addr = __ia64_get_io_port_base() | ((port >> 2) << 2);
- }
+ addr = (is_shub2() ? 0xc00000028c000000 : 0xc0000087cc000000) | ((port >> 2) << 12);
+ if ((port >= 0x1f0 && port <= 0x1f7) || port = 0x3f6 || port = 0x3f7)
+ addr |= port;
return (void *)addr;
}
}

Signature · 4 lines
Thanks

Jack Steiner ([email protected])          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.
#1 lore raw
Quoted 6 lines · Jack Steiner

+ addr = (is_shub2() ? 0xc00000028c000000 : 0xc0000087cc000000) | ((port

Quoted 1 line
Quoted 1 line

2) << 12); + if ((port >= 0x1f0 && port <= 0x1f7) || port = 0x3f6 ||

port = 0x3f7) +   addr |= port;
   return (void *)addr;

}
}

Can we keep the UL specifiers in there? It helps silence sparse and is a little more correct.

Thanks,
Jesse

#2 lore raw

PATCH 1/1 - Update SN2 code for running on simulator (2nd try)

In reply to Jack Steiner

Update the hack in sn_io_addr() that is used when running on the system simulator. The change is needed for running on systems with the new shub2 chipset.

Note that this change affects simulator runs only.

Index: linux/arch/ia64/sn/kernel/iomv.c
=================================--- linux.orig/arch/ia64/sn/kernel/iomv.c 2005-01-03 19:53:47.745120404 -0600
+++ linux/arch/ia64/sn/kernel/iomv.c 2005-01-04 11:06:59.394846071 -0600
@@ -32,7 +32,6 @@ void *sn_io_addr(unsigned long port)
return ((void *)(port | __IA64_UNCACHED_OFFSET));
} else {
/* but the simulator uses them... */
- unsigned long io_base;
unsigned long addr;

/*
@@ -40,13 +39,9 @@ void *sn_io_addr(unsigned long port)
* for accessing registers in bedrock local block
* (so we don't do port&0xfff)
*/
- if ((port >= 0x1f0 && port <= 0x1f7) ||
- port = 0x3f6 || port = 0x3f7) {
- io_base = GLOBAL_MMR_ADDR(get_nasid(), 0xfcc000000UL);
- addr = io_base | ((port >> 2) << 12) | (port & 0xfff);
- } else {
- addr = __ia64_get_io_port_base() | ((port >> 2) << 2);
- }
+ addr = (is_shub2() ? 0xc00000028c000000UL : 0xc0000087cc000000UL) | ((port >> 2) << 12);
+ if ((port >= 0x1f0 && port <= 0x1f7) || port = 0x3f6 || port = 0x3f7)
+ addr |= port;
return (void *)addr;
}
}

Signature · 4 lines
Thanks

Jack Steiner ([email protected])          651-683-5302
Principal Engineer                      SGI - Silicon Graphics, Inc.