diff options
-rw-r--r-- | drivers/scsi/in2000.c | 24 |
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 | ||
1901 | static 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 | ||
1902 | static int __init in2000_detect(struct scsi_host_template * tpnt) | 1917 | static 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 */ |