mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-26 16:30:17 +00:00
45a62144ff
Currently, only some scripts in proxyclient/experiments and proxyclient/tools have their execute bit set. Set it for those that miss it. Signed-off-by: Jean-Marc Ranger <jmranger@hotmail.com>
27 lines
650 B
Python
Executable file
27 lines
650 B
Python
Executable file
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: MIT
|
|
import sys, pathlib
|
|
import time
|
|
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
|
|
|
|
import struct
|
|
from m1n1.setup import *
|
|
from m1n1.fw.smc import SMCClient
|
|
|
|
smc_addr = u.adt["arm-io/smc"].get_reg(0)[0]
|
|
smc = SMCClient(u, smc_addr)
|
|
smc.start()
|
|
smc.start_ep(0x20)
|
|
|
|
smcep = smc.epmap[0x20]
|
|
|
|
def gpio_key(pin):
|
|
assert(pin < (1 << 16))
|
|
|
|
fourcc = 'gP' + ('00'+(hex(pin)[2:]))[-2:]
|
|
return fourcc
|
|
|
|
# Enable wifi/bluetooth
|
|
RFKILL_PIN = 13
|
|
smcep.write(gpio_key(RFKILL_PIN), struct.pack('<I', 0x800000 | 0x0))
|
|
smcep.write(gpio_key(RFKILL_PIN), struct.pack('<I', 0x800000 | 0x1))
|