Skip to content

Instantly share code, notes, and snippets.

@mjg59
Created November 18, 2019 07:52
Show Gist options
  • Save mjg59/591a5cb1b7c96f54fd798c2d1b559c8e to your computer and use it in GitHub Desktop.
Save mjg59/591a5cb1b7c96f54fd798c2d1b559c8e to your computer and use it in GitHub Desktop.
.global _start
_start:
.org 0x20000
.org 0x20fa4
BR rfkill@l
.org 0x20faa
orig:
.org 0x234ea
gpio_out:
.org 0x24ee4
backlight_off:
.org 0x24f0a
backlight_on:
.org 0x2a310
rfkill:
STORB r3, 0x10064
check_wifi:
TBIT $1, r3 # WIRE
BFC disable_wifi
enable_wifi:
MOVW $0,r3
MOVB $0x9e,r2
BAL (ra),*gpio_out
BR check_wwan
disable_wifi:
MOVW $0,r3
MOVB $0x96,r2
BAL (ra),*gpio_out
check_wwan:
LOADB 0x10064, r3
TBIT $2, r3 # BLTH
BFC disable_wwan
enable_wwan:
MOVW $0,r3
MOVB $0x0b,r2
BAL (ra),*gpio_out
MOVW $0,r3
MOVB $0x18,r2
BAL (ra),*gpio_out
MOVW $0,r3
MOVB $0x39,r2
BAL (ra),*gpio_out
BR check_backlight
disable_wwan:
MOVW $0,r3
MOVB $0x03,r2
BAL (ra),*gpio_out
MOVW $0,r3
MOVB $0x10,r2
BAL (ra),*gpio_out
MOVW $0,r3
MOVB $0x31,r2
BAL (ra),*gpio_out
check_backlight:
LOADB 0x10064, r3
TBIT $4, r3 # APFG
BFC disable_backlight
enable_backlight:
BAL (ra),*backlight_on
BR out
disable_backlight:
BAL (ra),*backlight_off
out:
BR *orig:l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment