Commit 283c7f6a authored by Prarit Bhargava's avatar Prarit Bhargava Committed by Tony Luck

[IA64] hotplug/ia64: SN Hotplug Driver - new SN PROM version code

This patch is a rewrite of the code to check the PROM version.  The current
code has some deficiences in the way PROM comparisons were made.  The minimum
value of PROM that will boot has also been changed to 4.04.
Signed-off-by: default avatarPrarit Bhargava <prarit@sgi.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent e07d01e0
...@@ -270,7 +270,7 @@ void __init sn_setup(char **cmdline_p) ...@@ -270,7 +270,7 @@ void __init sn_setup(char **cmdline_p)
{ {
long status, ticks_per_sec, drift; long status, ticks_per_sec, drift;
int pxm; int pxm;
int major = sn_sal_rev_major(), minor = sn_sal_rev_minor(); u32 version = sn_sal_rev();
extern void sn_cpu_init(void); extern void sn_cpu_init(void);
ia64_sn_plat_set_error_handling_features(); ia64_sn_plat_set_error_handling_features();
...@@ -308,22 +308,21 @@ void __init sn_setup(char **cmdline_p) ...@@ -308,22 +308,21 @@ void __init sn_setup(char **cmdline_p)
* support here so we don't have to listen to failed keyboard probe * support here so we don't have to listen to failed keyboard probe
* messages. * messages.
*/ */
if ((major < 2 || (major == 2 && minor <= 9)) && if (version <= 0x0209 && acpi_kbd_controller_present) {
acpi_kbd_controller_present) {
printk(KERN_INFO "Disabling legacy keyboard support as prom " printk(KERN_INFO "Disabling legacy keyboard support as prom "
"is too old and doesn't provide FADT\n"); "is too old and doesn't provide FADT\n");
acpi_kbd_controller_present = 0; acpi_kbd_controller_present = 0;
} }
printk("SGI SAL version %x.%02x\n", major, minor); printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
/* /*
* Confirm the SAL we're running on is recent enough... * Confirm the SAL we're running on is recent enough...
*/ */
if ((major < SN_SAL_MIN_MAJOR) || (major == SN_SAL_MIN_MAJOR && if (version < SN_SAL_MIN_VERSION) {
minor < SN_SAL_MIN_MINOR)) {
printk(KERN_ERR "This kernel needs SGI SAL version >= " printk(KERN_ERR "This kernel needs SGI SAL version >= "
"%x.%02x\n", SN_SAL_MIN_MAJOR, SN_SAL_MIN_MINOR); "%x.%02x\n", SN_SAL_MIN_VERSION >> 8,
SN_SAL_MIN_VERSION & 0x00FF);
panic("PROM version too old\n"); panic("PROM version too old\n");
} }
......
...@@ -589,8 +589,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft) ...@@ -589,8 +589,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft)
/* sanity check prom rev */ /* sanity check prom rev */
if (sn_sal_rev_major() < 4 || if (sn_sal_rev() < 0x0406) {
(sn_sal_rev_major() == 4 && sn_sal_rev_minor() < 6)) {
printk printk
(KERN_ERR "%s: SGI prom rev 4.06 or greater required " (KERN_ERR "%s: SGI prom rev 4.06 or greater required "
"for tioca support\n", __FUNCTION__); "for tioca support\n", __FUNCTION__);
......
...@@ -134,43 +134,28 @@ ...@@ -134,43 +134,28 @@
#define SN_SAL_FAKE_PROM 0x02009999 #define SN_SAL_FAKE_PROM 0x02009999
/** /**
* sn_sal_rev_major - get the major SGI SAL revision number * sn_sal_revision - get the SGI SAL revision number
* *
* The SGI PROM stores its version in sal_[ab]_rev_(major|minor). * The SGI PROM stores its version in the sal_[ab]_rev_(major|minor).
* This routine simply extracts the major value from the * This routine simply extracts the major and minor values and
* @ia64_sal_systab structure constructed by ia64_sal_init(). * presents them in a u32 format.
*/
static inline int
sn_sal_rev_major(void)
{
struct ia64_sal_systab *systab = efi.sal_systab;
return (int)systab->sal_b_rev_major;
}
/**
* sn_sal_rev_minor - get the minor SGI SAL revision number
* *
* The SGI PROM stores its version in sal_[ab]_rev_(major|minor). * For example, version 4.05 would be represented at 0x0405.
* This routine simply extracts the minor value from the
* @ia64_sal_systab structure constructed by ia64_sal_init().
*/ */
static inline int static inline u32
sn_sal_rev_minor(void) sn_sal_rev(void)
{ {
struct ia64_sal_systab *systab = efi.sal_systab; struct ia64_sal_systab *systab = efi.sal_systab;
return (int)systab->sal_b_rev_minor; return (u32)(systab->sal_b_rev_major << 8 | systab->sal_b_rev_minor);
} }
/* /*
* Specify the minimum PROM revsion required for this kernel. * Specify the minimum PROM revsion required for this kernel.
* Note that they're stored in hex format... * Note that they're stored in hex format...
*/ */
#define SN_SAL_MIN_MAJOR 0x4 /* SN2 kernels need at least PROM 4.0 */ #define SN_SAL_MIN_VERSION 0x0404
#define SN_SAL_MIN_MINOR 0x0
/* /*
* Returns the master console nasid, if the call fails, return an illegal * Returns the master console nasid, if the call fails, return an illegal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment