Skip to content

Instantly share code, notes, and snippets.

@mjg59 mjg59/rfkill.s

Created Nov 18, 2019
Embed
What would you like to do?
.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
You can’t perform that action at this time.