2 * Reset a Jazz machine.
4 * We don't trust the firmware so we do it the classic way by poking and
5 * stabbing at the keyboard controller ...
7 #include <linux/jiffies.h>
10 #include <asm/system.h>
11 #include <asm/reboot.h>
12 #include <asm/delay.h>
14 #define jazz_kh ((keyboard_hardware *) JAZZ_KEYBOARD_ADDRESS)
16 #define KBD_STAT_IBF 0x02 /* Keyboard input buffer full */
18 static void jazz_write_output(unsigned char val
)
23 status
= jazz_kh
->command
;
24 } while (status
& KBD_STAT_IBF
);
28 static void jazz_write_command(unsigned char val
)
33 status
= jazz_kh
->command
;
34 } while (status
& KBD_STAT_IBF
);
35 jazz_kh
->command
= val
;
38 static unsigned char jazz_read_status(void)
40 return jazz_kh
->command
;
43 static inline void kb_wait(void)
45 unsigned long start
= jiffies
;
46 unsigned long timeout
= start
+ HZ
/2;
49 if (! (jazz_read_status() & 0x02))
51 } while (time_before_eq(jiffies
, timeout
));
54 void jazz_machine_restart(char *command
)
58 jazz_write_command (0xd1);
60 jazz_write_output (0x00);
64 void jazz_machine_halt(void)
68 void jazz_machine_power_off(void)
70 /* Jazz machines don't have a software power switch */