mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-07 19:40:09 +00:00
add nitropad-shutdown.sh for EC based poweroff
This commit is contained in:
parent
033333f288
commit
902866cc29
36
initrd/bin/nitropad-shutdown.sh
Executable file
36
initrd/bin/nitropad-shutdown.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/ash
|
||||||
|
|
||||||
|
# Method to access IT5570 IO Depth 2 registers
|
||||||
|
it5570_i2ec() {
|
||||||
|
# TODO: Use /dev/port instead of iotools
|
||||||
|
|
||||||
|
# Address high byte
|
||||||
|
iotools io_write8 0x2e 0x2e
|
||||||
|
iotools io_write8 0x2f 0x11
|
||||||
|
iotools io_write8 0x2e 0x2f
|
||||||
|
iotools io_write8 0x2f $(($2>>8 & 0xff))
|
||||||
|
|
||||||
|
# Address low byte
|
||||||
|
iotools io_write8 0x2e 0x2e
|
||||||
|
iotools io_write8 0x2f 0x10
|
||||||
|
iotools io_write8 0x2e 0x2f
|
||||||
|
iotools io_write8 0x2f $(($2 & 0xff))
|
||||||
|
|
||||||
|
# Data
|
||||||
|
iotools io_write8 0x2e 0x2e
|
||||||
|
iotools io_write8 0x2f 0x12
|
||||||
|
iotools io_write8 0x2e 0x2f
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
"r")
|
||||||
|
iotools io_read8 0x2f
|
||||||
|
;;
|
||||||
|
"w")
|
||||||
|
iotools io_write8 0x2f "$3"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
# shut down using EC external watchdog reset
|
||||||
|
it5570_i2ec w 0x1f01 0x20
|
||||||
|
it5570_i2ec w 0x1f07 0x01
|
Loading…
x
Reference in New Issue
Block a user