aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/in2000.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-03-24 06:15:38 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-24 10:33:19 -0500
commit22bc685f4b93f4a0ce28e5829eaf754cb4f7c040 (patch)
tree53a463596fee23c1e4b097ac7a1cd16b12da49a9 /drivers/scsi/in2000.c
parentc818cb6406815716ab210ae15655ed94a973b15f (diff)
[PATCH] remove ISA legacy functions: drivers/scsi/in2000.c
switched to ioremap(), cleaned the probing up a bit. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/scsi/in2000.c')
-rw-r--r--drivers/scsi/in2000.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index 34daa3e068de..9c519876f8a0 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1898,6 +1898,21 @@ static int int_tab[] in2000__INITDATA = {
1898 10 1898 10
1899}; 1899};
1900 1900
1901static int probe_bios(u32 addr, u32 *s1, uchar *switches)
1902{
1903 void __iomem *p = ioremap(addr, 0x34);
1904 if (!p)
1905 return 0;
1906 *s1 = readl(p + 0x10);
1907 if (*s1 == 0x41564f4e || readl(p + 0x30) == 0x61776c41) {
1908 /* Read the switch image that's mapped into EPROM space */
1909 *switches = ~readb(p + 0x20);
1910 iounmap(p);
1911 return 1;
1912 }
1913 iounmap(p);
1914 return 0;
1915}
1901 1916
1902static int __init in2000_detect(struct scsi_host_template * tpnt) 1917static int __init in2000_detect(struct scsi_host_template * tpnt)
1903{ 1918{
@@ -1930,6 +1945,7 @@ static int __init in2000_detect(struct scsi_host_template * tpnt)
1930 1945
1931 detect_count = 0; 1946 detect_count = 0;
1932 for (bios = 0; bios_tab[bios]; bios++) { 1947 for (bios = 0; bios_tab[bios]; bios++) {
1948 u32 s1 = 0;
1933 if (check_setup_args("ioport", &val, buf)) { 1949 if (check_setup_args("ioport", &val, buf)) {
1934 base = val; 1950 base = val;
1935 switches = ~inb(base + IO_SWITCHES) & 0xff; 1951 switches = ~inb(base + IO_SWITCHES) & 0xff;
@@ -1941,13 +1957,9 @@ static int __init in2000_detect(struct scsi_host_template * tpnt)
1941 * for the obvious ID strings. We look for the 2 most common ones and 1957 * for the obvious ID strings. We look for the 2 most common ones and
1942 * hope that they cover all the cases... 1958 * hope that they cover all the cases...
1943 */ 1959 */
1944 else if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e || isa_readl(bios_tab[bios] + 0x30) == 0x61776c41) { 1960 else if (probe_bios(bios_tab[bios], &s1, &switches)) {
1945 printk("Found IN2000 BIOS at 0x%x ", (unsigned int) bios_tab[bios]); 1961 printk("Found IN2000 BIOS at 0x%x ", (unsigned int) bios_tab[bios]);
1946 1962
1947/* Read the switch image that's mapped into EPROM space */
1948
1949 switches = ~((isa_readb(bios_tab[bios] + 0x20) & 0xff));
1950
1951/* Find out where the IO space is */ 1963/* Find out where the IO space is */
1952 1964
1953 x = switches & (SW_ADDR0 | SW_ADDR1); 1965 x = switches & (SW_ADDR0 | SW_ADDR1);
@@ -2037,7 +2049,7 @@ static int __init in2000_detect(struct scsi_host_template * tpnt)
2037 2049
2038/* Older BIOS's had a 'sync on/off' switch - use its setting */ 2050/* Older BIOS's had a 'sync on/off' switch - use its setting */
2039 2051
2040 if (isa_readl(bios_tab[bios] + 0x10) == 0x41564f4e && (switches & SW_SYNC_DOS5)) 2052 if (s1 == 0x41564f4e && (switches & SW_SYNC_DOS5))
2041 hostdata->sync_off = 0x00; /* sync defaults to on */ 2053 hostdata->sync_off = 0x00; /* sync defaults to on */
2042 else 2054 else
2043 hostdata->sync_off = 0xff; /* sync defaults to off */ 2055 hostdata->sync_off = 0xff; /* sync defaults to off */