tici: offline big cluster while offroad (#20668)

* tici: offline big cluster while offroad

* shuffling

Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
Adeeb Shihadeh
2021-04-12 23:06:24 -07:00
committed by GitHub
parent 5a3c22d804
commit 9edda6fbc1
4 changed files with 8 additions and 4 deletions

View File

@@ -573,7 +573,7 @@ int main() {
LOG("set priority returns %d", err);
#ifdef QCOM2
err = set_core_affinity(7);
err = set_core_affinity(4);
#else
err = set_core_affinity(3);
#endif

View File

@@ -45,7 +45,7 @@ EventName = car.CarEvent.EventName
class Controls:
def __init__(self, sm=None, pm=None, can_sock=None):
config_realtime_process(7 if TICI else 3, Priority.CTRL_HIGH)
config_realtime_process(4 if TICI else 3, Priority.CTRL_HIGH)
# Setup sockets
self.pm = pm

View File

@@ -205,6 +205,11 @@ class Tici(HardwareBase):
# amplifier, 100mW at idle
write_amplifier_reg(0x51, 0b0 if enabled else 0b1, 7, 0b10000000)
# offline big cluster, leave core 4 online for boardd
for i in range(5, 8):
# TODO: fix permissions with udev
val = "0" if enabled else "1"
os.system(f"sudo su -c 'echo {val} > /sys/devices/system/cpu/cpu{i}/online'")
if __name__ == "__main__":
import sys

View File

@@ -137,8 +137,7 @@ int main(int argc, char **argv) {
#ifdef QCOM
set_core_affinity(2);
#elif QCOM2
// CPU usage is much lower when pinned to a single big core
set_core_affinity(4);
set_core_affinity(7);
#endif
bool wide_camera = false;