From 160942dfde46786f3fa35ad3814cd6861d61d324 Mon Sep 17 00:00:00 2001 From: Adeeb Shihadeh Date: Sat, 20 Jun 2026 16:09:22 -0700 Subject: [PATCH] move HAL to common/hardware/ (#38202) * move HAL to common/hardware/ * lint * rm shim --- .gitattributes | 2 +- Jenkinsfile | 4 +- common/api.py | 2 +- common/esim/esim.py | 2 +- {system => common}/hardware/__init__.py | 6 +- {system => common}/hardware/base.h | 0 {system => common}/hardware/base.py | 0 {system => common}/hardware/hw.h | 6 +- {system => common}/hardware/hw.py | 2 +- {system => common}/hardware/pc/__init__.py | 0 {system => common}/hardware/pc/hardware.h | 2 +- {system => common}/hardware/pc/hardware.py | 2 +- common/hardware/tici/__init__.py | 1 + common/hardware/tici/agnos.json | 84 ++++++++++++++++++ {system => common}/hardware/tici/agnos.py | 0 .../hardware/tici/all-partitions.json | 0 {system => common}/hardware/tici/amplifier.py | 0 {system => common}/hardware/tici/hardware.h | 2 +- {system => common}/hardware/tici/hardware.py | 6 +- {system => common}/hardware/tici/id_rsa | 0 {system => common}/hardware/tici/modem.py | 0 {system => common}/hardware/tici/pins.py | 0 .../hardware/tici/power_monitor.py | 0 common/hardware/tici/tests/__init__.py | 1 + .../hardware/tici/tests/test_agnos_updater.py | 0 .../hardware/tici/tests/test_amplifier.py | 4 +- .../hardware/tici/tests/test_power_draw.py | 2 +- {system => common}/hardware/tici/updater | 0 common/params.cc | 2 +- common/prefix.h | 2 +- common/prefix.py | 6 +- common/realtime.py | 2 +- common/swaglog.cc | 2 +- common/swaglog.py | 2 +- common/tests/test_swaglog.cc | 2 +- conftest.py | 2 +- launch_chffrplus.sh | 4 +- scripts/disable-powersave.py | 2 +- selfdrive/car/tests/test_models.py | 2 +- selfdrive/locationd/calibrationd.py | 2 +- selfdrive/locationd/test/test_lagd.py | 2 +- selfdrive/modeld/SConscript | 2 +- selfdrive/modeld/compile_modeld.py | 2 +- selfdrive/pandad/main.cc | 2 +- selfdrive/pandad/pandad.cc | 2 +- selfdrive/pandad/pandad.py | 2 +- selfdrive/pandad/tests/test_pandad.py | 4 +- selfdrive/selfdrived/events.py | 2 +- selfdrive/selfdrived/selfdrived.py | 2 +- selfdrive/test/process_replay/model_replay.py | 2 +- .../test/process_replay/process_replay.py | 2 +- selfdrive/test/test_onroad.py | 4 +- selfdrive/ui/installer/installer.cc | 2 +- selfdrive/ui/mici/layouts/offroad_alerts.py | 2 +- selfdrive/ui/mici/onroad/alert_renderer.py | 2 +- selfdrive/ui/mici/onroad/cameraview.py | 2 +- selfdrive/ui/onroad/alert_renderer.py | 2 +- selfdrive/ui/onroad/cameraview.py | 2 +- selfdrive/ui/soundd.py | 2 +- selfdrive/ui/ui.py | 2 +- selfdrive/ui/ui_state.py | 2 +- selfdrive/ui/widgets/offroad_alerts.py | 2 +- system/athena/athenad.py | 4 +- system/athena/manage_athenad.py | 2 +- system/athena/registration.py | 4 +- system/athena/tests/test_athenad.py | 2 +- system/athena/tests/test_athenad_ping.py | 2 +- system/athena/tests/test_registration.py | 2 +- system/camerad/snapshot.py | 2 +- system/hardware/fan_controller.py | 2 +- system/hardware/hardwared.py | 2 +- system/hardware/power_monitoring.py | 2 +- system/hardware/tici/__init__.py | 0 system/hardware/tici/agnos.json | 85 +------------------ system/hardware/tici/tests/__init__.py | 0 system/loggerd/config.py | 2 +- system/loggerd/deleter.py | 2 +- system/loggerd/logger.h | 2 +- system/loggerd/loggerd.h | 2 +- system/loggerd/tests/loggerd_tests_common.py | 2 +- system/loggerd/tests/test_encoder.py | 4 +- system/loggerd/tests/test_loggerd.py | 4 +- system/loggerd/tests/test_uploader.py | 2 +- system/loggerd/uploader.py | 2 +- system/logmessaged.py | 2 +- system/manager/build.py | 2 +- system/manager/manager.py | 4 +- system/manager/process_config.py | 4 +- system/manager/test/test_manager.py | 2 +- system/qcomgpsd/nmeaport.py | 2 +- system/qcomgpsd/qcomgpsd.py | 2 +- system/sentry.py | 2 +- system/statsd.py | 4 +- system/tests/test_logmessaged.py | 2 +- system/tombstoned.py | 2 +- system/ubloxd/pigeond.py | 4 +- system/ubloxd/tests/test_pigeond.py | 2 +- system/ui/lib/application.py | 2 +- system/ui/lib/scroll_panel2.py | 2 +- system/ui/mici_reset.py | 2 +- system/ui/mici_setup.py | 2 +- system/ui/mici_updater.py | 2 +- system/ui/text.py | 2 +- system/ui/tici_reset.py | 2 +- system/ui/tici_setup.py | 2 +- system/ui/tici_updater.py | 2 +- system/updated/tests/test_base.py | 8 +- system/updated/updated.py | 4 +- tools/jotpluggler/app.cc | 2 +- tools/jotpluggler/layout.cc | 2 +- tools/joystick/joystick_control.py | 2 +- tools/lateral_maneuvers/generate_report.py | 2 +- tools/lib/auth_config.py | 2 +- tools/lib/file_downloader.py | 2 +- tools/lib/tests/test_caching.py | 2 +- tools/lib/url_file.py | 2 +- .../longitudinal_maneuvers/generate_report.py | 2 +- tools/replay/framereader.cc | 2 +- tools/replay/route.cc | 2 +- tools/scripts/ssh.py | 2 +- tools/scripts/uiview.py | 2 +- 121 files changed, 215 insertions(+), 212 deletions(-) rename {system => common}/hardware/__init__.py (55%) rename {system => common}/hardware/base.h (100%) rename {system => common}/hardware/base.py (100%) rename {system => common}/hardware/hw.h (91%) rename {system => common}/hardware/hw.py (97%) rename {system => common}/hardware/pc/__init__.py (100%) rename {system => common}/hardware/pc/hardware.h (88%) rename {system => common}/hardware/pc/hardware.py (80%) create mode 100644 common/hardware/tici/__init__.py create mode 100644 common/hardware/tici/agnos.json rename {system => common}/hardware/tici/agnos.py (100%) rename {system => common}/hardware/tici/all-partitions.json (100%) rename {system => common}/hardware/tici/amplifier.py (100%) rename {system => common}/hardware/tici/hardware.h (98%) rename {system => common}/hardware/tici/hardware.py (98%) rename {system => common}/hardware/tici/id_rsa (100%) rename {system => common}/hardware/tici/modem.py (100%) rename {system => common}/hardware/tici/pins.py (100%) rename {system => common}/hardware/tici/power_monitor.py (100%) create mode 100644 common/hardware/tici/tests/__init__.py rename {system => common}/hardware/tici/tests/test_agnos_updater.py (100%) rename {system => common}/hardware/tici/tests/test_amplifier.py (93%) rename {system => common}/hardware/tici/tests/test_power_draw.py (98%) rename {system => common}/hardware/tici/updater (100%) delete mode 100644 system/hardware/tici/__init__.py mode change 100644 => 120000 system/hardware/tici/agnos.json delete mode 100644 system/hardware/tici/tests/__init__.py diff --git a/.gitattributes b/.gitattributes index efbe60f99..507eb73c1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,4 +11,4 @@ *.wav filter=lfs diff=lfs merge=lfs -text selfdrive/car/tests/test_models_segs.txt filter=lfs diff=lfs merge=lfs -text -system/hardware/tici/updater filter=lfs diff=lfs merge=lfs -text +common/hardware/tici/updater filter=lfs diff=lfs merge=lfs -text diff --git a/Jenkinsfile b/Jenkinsfile index 92bc61521..6291f5beb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -210,7 +210,7 @@ node { 'HW + Unit Tests': { deviceStage("tizi-hardware", "tizi-common", ["UNSAFE=1"], [ step("build", "cd system/manager && ./build.py"), - step("test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"), + step("test power draw", "pytest -s common/hardware/tici/tests/test_power_draw.py"), step("test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py", [diffPaths: ["system/loggerd/"]]), step("test manager", "pytest system/manager/test/test_manager.py"), ]) @@ -246,7 +246,7 @@ node { step("build openpilot", "cd system/manager && ./build.py"), step("test pandad loopback", "pytest selfdrive/pandad/tests/test_pandad_loopback.py"), step("test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"), - step("test amp", "pytest system/hardware/tici/tests/test_amplifier.py"), + step("test amp", "pytest common/hardware/tici/tests/test_amplifier.py"), ]) }, diff --git a/common/api.py b/common/api.py index ebf0290d1..521aac3fd 100644 --- a/common/api.py +++ b/common/api.py @@ -2,7 +2,7 @@ import jwt import os import requests from datetime import datetime, timedelta, UTC -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.system.version import get_version API_HOST = os.getenv('API_HOST', 'https://api.commadotai.com') diff --git a/common/esim/esim.py b/common/esim/esim.py index 788e944c4..8456d4dd4 100755 --- a/common/esim/esim.py +++ b/common/esim/esim.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import argparse -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.common.esim.base import LPABase, Profile diff --git a/system/hardware/__init__.py b/common/hardware/__init__.py similarity index 55% rename from system/hardware/__init__.py rename to common/hardware/__init__.py index 99079b5ef..3387d8a0c 100644 --- a/system/hardware/__init__.py +++ b/common/hardware/__init__.py @@ -1,9 +1,9 @@ import os from typing import cast -from openpilot.system.hardware.base import HardwareBase -from openpilot.system.hardware.tici.hardware import Tici -from openpilot.system.hardware.pc.hardware import Pc +from openpilot.common.hardware.base import HardwareBase +from openpilot.common.hardware.tici.hardware import Tici +from openpilot.common.hardware.pc.hardware import Pc TICI = os.path.isfile('/TICI') AGNOS = os.path.isfile('/AGNOS') diff --git a/system/hardware/base.h b/common/hardware/base.h similarity index 100% rename from system/hardware/base.h rename to common/hardware/base.h diff --git a/system/hardware/base.py b/common/hardware/base.py similarity index 100% rename from system/hardware/base.py rename to common/hardware/base.py diff --git a/system/hardware/hw.h b/common/hardware/hw.h similarity index 91% rename from system/hardware/hw.h rename to common/hardware/hw.h index a9058401c..1e097d99b 100644 --- a/system/hardware/hw.h +++ b/common/hardware/hw.h @@ -2,14 +2,14 @@ #include -#include "system/hardware/base.h" +#include "common/hardware/base.h" #include "common/util.h" #if __TICI__ -#include "system/hardware/tici/hardware.h" +#include "common/hardware/tici/hardware.h" #define Hardware HardwareTici #else -#include "system/hardware/pc/hardware.h" +#include "common/hardware/pc/hardware.h" #define Hardware HardwarePC #endif diff --git a/system/hardware/hw.py b/common/hardware/hw.py similarity index 97% rename from system/hardware/hw.py rename to common/hardware/hw.py index dc36dc047..2c649db9e 100644 --- a/system/hardware/hw.py +++ b/common/hardware/hw.py @@ -2,7 +2,7 @@ import os import platform from pathlib import Path -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC DEFAULT_DOWNLOAD_CACHE_ROOT = "/tmp/comma_download_cache" diff --git a/system/hardware/pc/__init__.py b/common/hardware/pc/__init__.py similarity index 100% rename from system/hardware/pc/__init__.py rename to common/hardware/pc/__init__.py diff --git a/system/hardware/pc/hardware.h b/common/hardware/pc/hardware.h similarity index 88% rename from system/hardware/pc/hardware.h rename to common/hardware/pc/hardware.h index c3545f3e5..2c43b4329 100644 --- a/system/hardware/pc/hardware.h +++ b/common/hardware/pc/hardware.h @@ -2,7 +2,7 @@ #include -#include "system/hardware/base.h" +#include "common/hardware/base.h" class HardwarePC : public HardwareNone { public: diff --git a/system/hardware/pc/hardware.py b/common/hardware/pc/hardware.py similarity index 80% rename from system/hardware/pc/hardware.py rename to common/hardware/pc/hardware.py index 37775d9bb..b387f0312 100644 --- a/system/hardware/pc/hardware.py +++ b/common/hardware/pc/hardware.py @@ -1,5 +1,5 @@ from cereal import log -from openpilot.system.hardware.base import HardwareBase +from openpilot.common.hardware.base import HardwareBase class Pc(HardwareBase): def get_device_type(self): diff --git a/common/hardware/tici/__init__.py b/common/hardware/tici/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/common/hardware/tici/__init__.py @@ -0,0 +1 @@ + diff --git a/common/hardware/tici/agnos.json b/common/hardware/tici/agnos.json new file mode 100644 index 000000000..07e2079ec --- /dev/null +++ b/common/hardware/tici/agnos.json @@ -0,0 +1,84 @@ +[ + { + "name": "xbl", + "url": "https://commadist.azureedge.net/agnosupdate/xbl-e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb.img.xz", + "hash": "e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb", + "hash_raw": "e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb", + "size": 3282256, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "bea7f1a24428c3ededf672fa4fc78baf180cfbd8aafb77c974655b38517283e3" + }, + { + "name": "xbl_config", + "url": "https://commadist.azureedge.net/agnosupdate/xbl_config-758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85.img.xz", + "hash": "758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85", + "hash_raw": "758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85", + "size": 98124, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "fb18cde08a98a168961ecd357e92474823046752b94e112f59fe51a6acd7197d" + }, + { + "name": "abl", + "url": "https://commadist.azureedge.net/agnosupdate/abl-b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c.img.xz", + "hash": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c", + "hash_raw": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c", + "size": 274432, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c" + }, + { + "name": "aop", + "url": "https://commadist.azureedge.net/agnosupdate/aop-78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1.img.xz", + "hash": "78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1", + "hash_raw": "78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1", + "size": 184364, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "6c9135446bd3fc075fcee59b887a12e49029ab1f98ed8d6d1e32c73569d47de3" + }, + { + "name": "devcfg", + "url": "https://commadist.azureedge.net/agnosupdate/devcfg-f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc.img.xz", + "hash": "f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc", + "hash_raw": "f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc", + "size": 40336, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "2a67971602012c1b43544964709da13c322786b456a8e78568b117e8b1540ce3" + }, + { + "name": "boot", + "url": "https://commadist.azureedge.net/agnosupdate/boot-8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8.img.xz", + "hash": "8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8", + "hash_raw": "8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8", + "size": 17487872, + "sparse": false, + "full_check": true, + "has_ab": true, + "ondevice_hash": "edca8bee1531e66953d107eeceeed2dc7b3ca46417e49d55508f94e58bf95db8" + }, + { + "name": "system", + "url": "https://commadist.azureedge.net/agnosupdate/system-ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f.img.xz", + "hash": "78acfe16a7b62a3a91fc7a81f40a693e4468cec1c69df7d0b1e550aacc646113", + "hash_raw": "ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f", + "size": 4718592000, + "sparse": true, + "full_check": false, + "has_ab": true, + "ondevice_hash": "743142c5a898f27b2a1029cca42c8a5d5d1fc0096414422b850fe84c8d0b8342", + "alt": { + "hash": "ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f", + "url": "https://commadist.azureedge.net/agnosupdate/system-ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f.img", + "size": 4718592000 + } + } +] \ No newline at end of file diff --git a/system/hardware/tici/agnos.py b/common/hardware/tici/agnos.py similarity index 100% rename from system/hardware/tici/agnos.py rename to common/hardware/tici/agnos.py diff --git a/system/hardware/tici/all-partitions.json b/common/hardware/tici/all-partitions.json similarity index 100% rename from system/hardware/tici/all-partitions.json rename to common/hardware/tici/all-partitions.json diff --git a/system/hardware/tici/amplifier.py b/common/hardware/tici/amplifier.py similarity index 100% rename from system/hardware/tici/amplifier.py rename to common/hardware/tici/amplifier.py diff --git a/system/hardware/tici/hardware.h b/common/hardware/tici/hardware.h similarity index 98% rename from system/hardware/tici/hardware.h rename to common/hardware/tici/hardware.h index 95a6d4e01..a1a8090c3 100644 --- a/system/hardware/tici/hardware.h +++ b/common/hardware/tici/hardware.h @@ -7,7 +7,7 @@ #include // for std::clamp #include "common/util.h" -#include "system/hardware/base.h" +#include "common/hardware/base.h" class HardwareTici : public HardwareNone { public: diff --git a/system/hardware/tici/hardware.py b/common/hardware/tici/hardware.py similarity index 98% rename from system/hardware/tici/hardware.py rename to common/hardware/tici/hardware.py index 35bf4cd08..bec4c9042 100644 --- a/system/hardware/tici/hardware.py +++ b/common/hardware/tici/hardware.py @@ -11,10 +11,10 @@ from cereal import log from openpilot.common.utils import sudo_read, sudo_write from openpilot.common.gpio import gpio_set, gpio_init, get_irqs_for_action from openpilot.common.esim.base import LPABase -from openpilot.system.hardware.base import HardwareBase, ThermalConfig, ThermalZone +from openpilot.common.hardware.base import HardwareBase, ThermalConfig, ThermalZone from openpilot.common.esim.lpa import TiciLPA -from openpilot.system.hardware.tici.pins import GPIO -from openpilot.system.hardware.tici.amplifier import Amplifier +from openpilot.common.hardware.tici.pins import GPIO +from openpilot.common.hardware.tici.amplifier import Amplifier MODEM_STATE_PATH = "/dev/shm/modem" diff --git a/system/hardware/tici/id_rsa b/common/hardware/tici/id_rsa similarity index 100% rename from system/hardware/tici/id_rsa rename to common/hardware/tici/id_rsa diff --git a/system/hardware/tici/modem.py b/common/hardware/tici/modem.py similarity index 100% rename from system/hardware/tici/modem.py rename to common/hardware/tici/modem.py diff --git a/system/hardware/tici/pins.py b/common/hardware/tici/pins.py similarity index 100% rename from system/hardware/tici/pins.py rename to common/hardware/tici/pins.py diff --git a/system/hardware/tici/power_monitor.py b/common/hardware/tici/power_monitor.py similarity index 100% rename from system/hardware/tici/power_monitor.py rename to common/hardware/tici/power_monitor.py diff --git a/common/hardware/tici/tests/__init__.py b/common/hardware/tici/tests/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/common/hardware/tici/tests/__init__.py @@ -0,0 +1 @@ + diff --git a/system/hardware/tici/tests/test_agnos_updater.py b/common/hardware/tici/tests/test_agnos_updater.py similarity index 100% rename from system/hardware/tici/tests/test_agnos_updater.py rename to common/hardware/tici/tests/test_agnos_updater.py diff --git a/system/hardware/tici/tests/test_amplifier.py b/common/hardware/tici/tests/test_amplifier.py similarity index 93% rename from system/hardware/tici/tests/test_amplifier.py rename to common/hardware/tici/tests/test_amplifier.py index 9ce00c3ff..39628b53c 100644 --- a/system/hardware/tici/tests/test_amplifier.py +++ b/common/hardware/tici/tests/test_amplifier.py @@ -4,8 +4,8 @@ import random import subprocess from panda import Panda -from openpilot.system.hardware import TICI, HARDWARE -from openpilot.system.hardware.tici.amplifier import Amplifier +from openpilot.common.hardware import TICI, HARDWARE +from openpilot.common.hardware.tici.amplifier import Amplifier class TestAmplifier: diff --git a/system/hardware/tici/tests/test_power_draw.py b/common/hardware/tici/tests/test_power_draw.py similarity index 98% rename from system/hardware/tici/tests/test_power_draw.py rename to common/hardware/tici/tests/test_power_draw.py index 6656addf7..ad2729294 100644 --- a/system/hardware/tici/tests/test_power_draw.py +++ b/common/hardware/tici/tests/test_power_draw.py @@ -10,7 +10,7 @@ from cereal.services import SERVICE_LIST from opendbc.car.car_helpers import get_demo_car_params from openpilot.common.mock import mock_messages from openpilot.common.params import Params -from openpilot.system.hardware.tici.power_monitor import get_power +from openpilot.common.hardware.tici.power_monitor import get_power from openpilot.system.manager.process_config import managed_processes from openpilot.system.manager.manager import manager_cleanup diff --git a/system/hardware/tici/updater b/common/hardware/tici/updater similarity index 100% rename from system/hardware/tici/updater rename to common/hardware/tici/updater diff --git a/common/params.cc b/common/params.cc index 6af00fe95..495feb0a9 100644 --- a/common/params.cc +++ b/common/params.cc @@ -12,7 +12,7 @@ #include "common/queue.h" #include "common/swaglog.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" namespace { diff --git a/common/prefix.h b/common/prefix.h index de3a94d71..89f346b9e 100644 --- a/common/prefix.h +++ b/common/prefix.h @@ -5,7 +5,7 @@ #include "common/params.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" class OpenpilotPrefix { public: diff --git a/common/prefix.py b/common/prefix.py index d0a5f9262..d0be8997a 100644 --- a/common/prefix.py +++ b/common/prefix.py @@ -5,9 +5,9 @@ import uuid from openpilot.common.params import Params -from openpilot.system.hardware import PC -from openpilot.system.hardware.hw import Paths -from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT +from openpilot.common.hardware import PC +from openpilot.common.hardware.hw import Paths +from openpilot.common.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT class OpenpilotPrefix: def __init__(self, prefix: str | None = None, create_dirs_on_enter: bool = True, clean_dirs_on_exit: bool = True, shared_download_cache: bool = False): diff --git a/common/realtime.py b/common/realtime.py index 91d2e165e..e0b9e8a3a 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -7,7 +7,7 @@ import time from setproctitle import getproctitle from openpilot.common.utils import MovingAverage -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC # time step for each process diff --git a/common/swaglog.cc b/common/swaglog.cc index df7ce94c1..74c617fa6 100644 --- a/common/swaglog.cc +++ b/common/swaglog.cc @@ -13,7 +13,7 @@ #include #include "json11/json11.hpp" #include "common/version.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" class SwaglogState { public: diff --git a/common/swaglog.py b/common/swaglog.py index d009f00e7..ea72766fc 100644 --- a/common/swaglog.py +++ b/common/swaglog.py @@ -8,7 +8,7 @@ from logging.handlers import BaseRotatingHandler import zmq from openpilot.common.logging_extra import SwagLogger, SwagFormatter, SwagLogFileFormatter -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths def get_file_handler(): diff --git a/common/tests/test_swaglog.cc b/common/tests/test_swaglog.cc index 8142f8d63..0c9cfcc1e 100644 --- a/common/tests/test_swaglog.cc +++ b/common/tests/test_swaglog.cc @@ -6,7 +6,7 @@ #include "common/swaglog.h" #include "common/util.h" #include "common/version.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "json11/json11.hpp" std::string daemon_name = "testy"; diff --git a/conftest.py b/conftest.py index dd159129b..3719be93d 100644 --- a/conftest.py +++ b/conftest.py @@ -5,7 +5,7 @@ import pytest from openpilot.common.prefix import OpenpilotPrefix from openpilot.system.manager import manager -from openpilot.system.hardware import TICI, HARDWARE +from openpilot.common.hardware import TICI, HARDWARE # these are heavy CI-only tests, invoked explicitly in .github/workflows/tests.yaml collect_ignore = [ diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 5e7b4fa0d..46b0a5d07 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -19,12 +19,12 @@ function agnos_init { # Check if AGNOS update is required if [ $(< /VERSION) != "$AGNOS_VERSION" ]; then - AGNOS_PY="$DIR/system/hardware/tici/agnos.py" + AGNOS_PY="$DIR/common/hardware/tici/agnos.py" MANIFEST="$DIR/system/hardware/tici/agnos.json" if $AGNOS_PY --verify $MANIFEST; then sudo reboot fi - $DIR/system/hardware/tici/updater $AGNOS_PY $MANIFEST + $DIR/common/hardware/tici/updater $AGNOS_PY $MANIFEST fi } diff --git a/scripts/disable-powersave.py b/scripts/disable-powersave.py index 367b4108b..093275fd7 100755 --- a/scripts/disable-powersave.py +++ b/scripts/disable-powersave.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE if __name__ == "__main__": HARDWARE.set_power_save(False) diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index dd0826e51..035602b95 100644 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -20,7 +20,7 @@ from opendbc.safety.tests.libsafety import libsafety_py from openpilot.common.basedir import BASEDIR from openpilot.selfdrive.pandad import can_capnp_to_list from openpilot.selfdrive.test.helpers import read_segment_list -from openpilot.system.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT +from openpilot.common.hardware.hw import DEFAULT_DOWNLOAD_CACHE_ROOT from openpilot.tools.lib.logreader import LogReader, LogsUnavailable, openpilotci_source, internal_source, comma_api_source from openpilot.tools.lib.route import SegmentName diff --git a/selfdrive/locationd/calibrationd.py b/selfdrive/locationd/calibrationd.py index 4423f3906..c444d4398 100755 --- a/selfdrive/locationd/calibrationd.py +++ b/selfdrive/locationd/calibrationd.py @@ -13,7 +13,7 @@ from typing import NoReturn from cereal import log, car import cereal.messaging as messaging -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.common.constants import CV from openpilot.common.params import Params from openpilot.common.realtime import config_realtime_process diff --git a/selfdrive/locationd/test/test_lagd.py b/selfdrive/locationd/test/test_lagd.py index 0c4e22719..63ea2b5fa 100644 --- a/selfdrive/locationd/test/test_lagd.py +++ b/selfdrive/locationd/test/test_lagd.py @@ -10,7 +10,7 @@ from openpilot.selfdrive.test.process_replay.migration import migrate, migrate_c from openpilot.selfdrive.locationd.test.test_locationd_scenarios import TEST_ROUTE from openpilot.common.params import Params from openpilot.tools.lib.logreader import LogReader -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC MAX_ERR_FRAMES = 1 DT = 0.05 diff --git a/selfdrive/modeld/SConscript b/selfdrive/modeld/SConscript index 74adf0d93..4a4017362 100644 --- a/selfdrive/modeld/SConscript +++ b/selfdrive/modeld/SConscript @@ -79,7 +79,7 @@ compile_modeld_script = [ File(f"{modeld_dir}/compile_modeld.py"), File(f"{modeld_dir}/get_model_metadata.py"), File("#system/camerad/cameras/nv12_info.py"), - File("#system/hardware/hw.py"), + File("#common/hardware/hw.py"), ] model_w, model_h = MEDMODEL_INPUT_SIZE frame_skip = ModelConstants.MODEL_RUN_FREQ // ModelConstants.MODEL_CONTEXT_FREQ diff --git a/selfdrive/modeld/compile_modeld.py b/selfdrive/modeld/compile_modeld.py index 069e39091..35f92d344 100755 --- a/selfdrive/modeld/compile_modeld.py +++ b/selfdrive/modeld/compile_modeld.py @@ -265,7 +265,7 @@ def _parse_size(s): def read_file_chunked_to_shm(path): from openpilot.common.file_chunker import read_file_chunked - from openpilot.system.hardware.hw import Paths + from openpilot.common.hardware.hw import Paths with tempfile.NamedTemporaryFile(prefix='compile_modeld_', dir=Paths.shm_path(), delete=False) as f: f.write(read_file_chunked(path)) tmp_path = f.name diff --git a/selfdrive/pandad/main.cc b/selfdrive/pandad/main.cc index ef30d6037..08e88b616 100644 --- a/selfdrive/pandad/main.cc +++ b/selfdrive/pandad/main.cc @@ -3,7 +3,7 @@ #include "selfdrive/pandad/pandad.h" #include "common/swaglog.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" int main(int argc, char *argv[]) { LOGW("starting pandad"); diff --git a/selfdrive/pandad/pandad.cc b/selfdrive/pandad/pandad.cc index 7fbfcb5b1..657e36e6b 100644 --- a/selfdrive/pandad/pandad.cc +++ b/selfdrive/pandad/pandad.cc @@ -15,7 +15,7 @@ #include "common/swaglog.h" #include "common/timing.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #define MAX_IR_PANDA_VAL 50 #define CUTOFF_IL 400 diff --git a/selfdrive/pandad/pandad.py b/selfdrive/pandad/pandad.py index 2400f8cd6..443c25a7e 100755 --- a/selfdrive/pandad/pandad.py +++ b/selfdrive/pandad/pandad.py @@ -9,7 +9,7 @@ import subprocess from panda import Panda, PandaDFU, PandaProtocolMismatch, McuType, FW_PATH from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.common.swaglog import cloudlog diff --git a/selfdrive/pandad/tests/test_pandad.py b/selfdrive/pandad/tests/test_pandad.py index 9dacd3f5a..88022dda8 100644 --- a/selfdrive/pandad/tests/test_pandad.py +++ b/selfdrive/pandad/tests/test_pandad.py @@ -7,8 +7,8 @@ from cereal import log from openpilot.common.gpio import gpio_set, gpio_init from panda import Panda, PandaDFU from openpilot.system.manager.process_config import managed_processes -from openpilot.system.hardware import HARDWARE -from openpilot.system.hardware.tici.pins import GPIO +from openpilot.common.hardware import HARDWARE +from openpilot.common.hardware.tici.pins import GPIO HERE = os.path.dirname(os.path.realpath(__file__)) diff --git a/selfdrive/selfdrived/events.py b/selfdrive/selfdrived/events.py index 99e25571b..9a31e6f6b 100755 --- a/selfdrive/selfdrived/events.py +++ b/selfdrive/selfdrived/events.py @@ -13,7 +13,7 @@ from openpilot.common.realtime import DT_CTRL from openpilot.selfdrive.locationd.calibrationd import MIN_SPEED_FILTER from openpilot.system.micd import SAMPLE_RATE, SAMPLE_BUFFER from openpilot.selfdrive.ui.feedback.feedbackd import FEEDBACK_MAX_DURATION -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE AlertSize = log.SelfdriveState.AlertSize AlertStatus = log.SelfdriveState.AlertStatus diff --git a/selfdrive/selfdrived/selfdrived.py b/selfdrive/selfdrived/selfdrived.py index e376ea5c9..5fe45d927 100755 --- a/selfdrive/selfdrived/selfdrived.py +++ b/selfdrive/selfdrived/selfdrived.py @@ -22,7 +22,7 @@ from openpilot.selfdrive.selfdrived.state import StateMachine from openpilot.selfdrive.selfdrived.alertmanager import AlertManager, set_offroad_alert from openpilot.system.version import get_build_metadata -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE REPLAY = "REPLAY" in os.environ SIMULATION = "SIMULATION" in os.environ diff --git a/selfdrive/test/process_replay/model_replay.py b/selfdrive/test/process_replay/model_replay.py index 266f66aaf..3e5616e70 100755 --- a/selfdrive/test/process_replay/model_replay.py +++ b/selfdrive/test/process_replay/model_replay.py @@ -12,7 +12,7 @@ import numpy as np from openpilot.common.utils import tabulate from openpilot.common.git import get_commit -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC from openpilot.tools.lib.openpilotci import get_url from openpilot.selfdrive.test.process_replay.compare_logs import compare_logs, format_diff from openpilot.selfdrive.test.process_replay.process_replay import get_process_config, replay_process diff --git a/selfdrive/test/process_replay/process_replay.py b/selfdrive/test/process_replay/process_replay.py index 1edbc3e2d..2f198b047 100755 --- a/selfdrive/test/process_replay/process_replay.py +++ b/selfdrive/test/process_replay/process_replay.py @@ -12,7 +12,7 @@ from typing import Any from collections.abc import Callable, Iterable from tqdm import tqdm import capnp -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths import cereal.messaging as messaging from cereal import car diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index a08912fde..99d0279c4 100644 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -18,7 +18,7 @@ from openpilot.common.timeout import Timeout from openpilot.common.params import Params from openpilot.selfdrive.selfdrived.events import EVENTS, ET from openpilot.selfdrive.test.helpers import set_params_enabled, release_only -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.tools.lib.logreader import LogReader from openpilot.tools.lib.log_time_series import msgs_to_time_series @@ -68,7 +68,7 @@ PROCS = { "system.loggerd.deleter": 1.0, "./pandad": 19.0, "system.qcomgpsd.qcomgpsd": 1.0, - "system.hardware.tici.modem": 10.0, + "common.hardware.tici.modem": 10.0, } TIMINGS = { diff --git a/selfdrive/ui/installer/installer.cc b/selfdrive/ui/installer/installer.cc index 176c2d510..07e824c64 100644 --- a/selfdrive/ui/installer/installer.cc +++ b/selfdrive/ui/installer/installer.cc @@ -5,7 +5,7 @@ #include "common/swaglog.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "raylib.h" int freshClone(); diff --git a/selfdrive/ui/mici/layouts/offroad_alerts.py b/selfdrive/ui/mici/layouts/offroad_alerts.py index de631f686..47a2ddde9 100644 --- a/selfdrive/ui/mici/layouts/offroad_alerts.py +++ b/selfdrive/ui/mici/layouts/offroad_alerts.py @@ -7,7 +7,7 @@ from enum import IntEnum from openpilot.common.params import Params from openpilot.common.realtime import drop_realtime from openpilot.selfdrive.selfdrived.alertmanager import OFFROAD_ALERTS -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.system.ui.widgets.scroller import Scroller diff --git a/selfdrive/ui/mici/onroad/alert_renderer.py b/selfdrive/ui/mici/onroad/alert_renderer.py index 7b006aaae..6505ca47c 100644 --- a/selfdrive/ui/mici/onroad/alert_renderer.py +++ b/selfdrive/ui/mici/onroad/alert_renderer.py @@ -8,7 +8,7 @@ from dataclasses import dataclass from cereal import messaging, log, car from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.common.filter_simple import BounceFilter, FirstOrderFilter -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel diff --git a/selfdrive/ui/mici/onroad/cameraview.py b/selfdrive/ui/mici/onroad/cameraview.py index 86dd95f46..991349dbf 100644 --- a/selfdrive/ui/mici/onroad/cameraview.py +++ b/selfdrive/ui/mici/onroad/cameraview.py @@ -4,7 +4,7 @@ import pyray as rl from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.egl import init_egl, create_egl_image, destroy_egl_image, bind_egl_image_to_texture, EGLImage from openpilot.system.ui.widgets import Widget diff --git a/selfdrive/ui/onroad/alert_renderer.py b/selfdrive/ui/onroad/alert_renderer.py index a81fbfc44..cfb4bf661 100644 --- a/selfdrive/ui/onroad/alert_renderer.py +++ b/selfdrive/ui/onroad/alert_renderer.py @@ -3,7 +3,7 @@ import pyray as rl from dataclasses import dataclass from cereal import messaging, log from openpilot.selfdrive.ui.ui_state import ui_state -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.text_measure import measure_text_cached diff --git a/selfdrive/ui/onroad/cameraview.py b/selfdrive/ui/onroad/cameraview.py index 53c2ff8b0..846bf20bb 100644 --- a/selfdrive/ui/onroad/cameraview.py +++ b/selfdrive/ui/onroad/cameraview.py @@ -4,7 +4,7 @@ import pyray as rl from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.lib.egl import init_egl, create_egl_image, destroy_egl_image, bind_egl_image_to_texture, EGLImage from openpilot.system.ui.widgets import Widget diff --git a/selfdrive/ui/soundd.py b/selfdrive/ui/soundd.py index a6f5d2fc2..ca5c824c2 100644 --- a/selfdrive/ui/soundd.py +++ b/selfdrive/ui/soundd.py @@ -12,7 +12,7 @@ from openpilot.common.utils import retry from openpilot.common.swaglog import cloudlog from openpilot.system import micd -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE SAMPLE_RATE = 48000 SAMPLE_BUFFER = 4096 # (approx 100ms) diff --git a/selfdrive/ui/ui.py b/selfdrive/ui/ui.py index e01ddb251..fc7e40920 100755 --- a/selfdrive/ui/ui.py +++ b/selfdrive/ui/ui.py @@ -3,7 +3,7 @@ import os import time from cereal import messaging -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.common.realtime import Priority, config_realtime_process, set_core_affinity from openpilot.system.ui.lib.application import gui_app from openpilot.selfdrive.ui.layouts.main import MainLayout diff --git a/selfdrive/ui/ui_state.py b/selfdrive/ui/ui_state.py index 643054e50..d5b014274 100644 --- a/selfdrive/ui/ui_state.py +++ b/selfdrive/ui/ui_state.py @@ -10,7 +10,7 @@ from openpilot.common.realtime import drop_realtime from openpilot.common.swaglog import cloudlog from openpilot.selfdrive.ui.lib.prime_state import PrimeState from openpilot.system.ui.lib.application import gui_app -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC BACKLIGHT_OFFROAD = 65 if HARDWARE.get_device_type() == "mici" else 50 PARAM_UPDATE_TIME = 1 / 5.0 diff --git a/selfdrive/ui/widgets/offroad_alerts.py b/selfdrive/ui/widgets/offroad_alerts.py index 110ca714a..88ccc5df7 100644 --- a/selfdrive/ui/widgets/offroad_alerts.py +++ b/selfdrive/ui/widgets/offroad_alerts.py @@ -4,7 +4,7 @@ from abc import ABC, abstractmethod from collections.abc import Callable from dataclasses import dataclass from openpilot.common.params import Params -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel diff --git a/system/athena/athenad.py b/system/athena/athenad.py index 6350b8a89..697819d0a 100755 --- a/system/athena/athenad.py +++ b/system/athena/athenad.py @@ -35,11 +35,11 @@ from openpilot.common.api import Api, get_key_pair from openpilot.common.utils import CallbackReader, get_upload_stream from openpilot.common.params import Params from openpilot.common.realtime import set_core_affinity -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC from openpilot.system.loggerd.xattr_cache import getxattr, setxattr from openpilot.common.swaglog import cloudlog from openpilot.system.version import get_build_metadata -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths ATHENA_HOST = os.getenv('ATHENA_HOST', 'wss://athena.comma.ai') diff --git a/system/athena/manage_athenad.py b/system/athena/manage_athenad.py index ee63606b6..11fd11d43 100755 --- a/system/athena/manage_athenad.py +++ b/system/athena/manage_athenad.py @@ -6,7 +6,7 @@ from multiprocessing import Process from openpilot.common.params import Params from openpilot.system.manager.process import launcher from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.version import get_build_metadata ATHENA_MGR_PID_PARAM = "AthenadPid" diff --git a/system/athena/registration.py b/system/athena/registration.py index 8548a544f..0e8d4bc49 100755 --- a/system/athena/registration.py +++ b/system/athena/registration.py @@ -10,8 +10,8 @@ from openpilot.common.api import api_get, get_key_pair from openpilot.common.params import Params from openpilot.common.spinner import Spinner from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert -from openpilot.system.hardware import HARDWARE, PC -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware import HARDWARE, PC +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog diff --git a/system/athena/tests/test_athenad.py b/system/athena/tests/test_athenad.py index 33b0113b3..0e3ae68d4 100644 --- a/system/athena/tests/test_athenad.py +++ b/system/athena/tests/test_athenad.py @@ -22,7 +22,7 @@ from openpilot.system.athena import athenad from openpilot.system.athena.athenad import MAX_RETRY_COUNT, UPLOAD_SESS, dispatcher from openpilot.system.athena.tests.helpers import HTTPRequestHandler, MockWebsocket, MockApi, EchoSocket from openpilot.selfdrive.test.helpers import http_server_context -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths def seed_athena_server(host, port): diff --git a/system/athena/tests/test_athenad_ping.py b/system/athena/tests/test_athenad_ping.py index 8ff1e37a5..7f4426316 100644 --- a/system/athena/tests/test_athenad_ping.py +++ b/system/athena/tests/test_athenad_ping.py @@ -8,7 +8,7 @@ from openpilot.common.params import Params from openpilot.common.timeout import Timeout from openpilot.system.athena import athenad from openpilot.system.manager.helpers import write_onroad_params -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI TIMEOUT_TOLERANCE = 20 # seconds diff --git a/system/athena/tests/test_registration.py b/system/athena/tests/test_registration.py index f5d900d4d..bb1523de8 100644 --- a/system/athena/tests/test_registration.py +++ b/system/athena/tests/test_registration.py @@ -5,7 +5,7 @@ from pathlib import Path from openpilot.common.params import Params from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID from openpilot.system.athena.tests.helpers import MockResponse -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths class TestRegistration: diff --git a/system/camerad/snapshot.py b/system/camerad/snapshot.py index ec6cbc8ad..241f02704 100755 --- a/system/camerad/snapshot.py +++ b/system/camerad/snapshot.py @@ -9,7 +9,7 @@ import cereal.messaging as messaging from msgq.visionipc import VisionIpcClient, VisionStreamType from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert from openpilot.system.manager.process_config import managed_processes diff --git a/system/hardware/fan_controller.py b/system/hardware/fan_controller.py index eafde599a..869fe19c3 100755 --- a/system/hardware/fan_controller.py +++ b/system/hardware/fan_controller.py @@ -2,7 +2,7 @@ import numpy as np from openpilot.common.pid import PIDController -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE # raise fan setpoint on tici/tizi to reduce noise # after raising LMH threshold in AGNOS 18.1 to prevent CPU throttling diff --git a/system/hardware/hardwared.py b/system/hardware/hardwared.py index d047ee37c..f8a9d3add 100755 --- a/system/hardware/hardwared.py +++ b/system/hardware/hardwared.py @@ -17,7 +17,7 @@ from openpilot.common.filter_simple import FirstOrderFilter from openpilot.common.params import Params from openpilot.common.realtime import DT_HW from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert -from openpilot.system.hardware import HARDWARE, TICI, PC +from openpilot.common.hardware import HARDWARE, TICI, PC from openpilot.system.loggerd.config import get_available_percent from openpilot.system.statsd import statlog from openpilot.common.swaglog import cloudlog diff --git a/system/hardware/power_monitoring.py b/system/hardware/power_monitoring.py index 161b5d23e..ca43d9007 100644 --- a/system/hardware/power_monitoring.py +++ b/system/hardware/power_monitoring.py @@ -2,7 +2,7 @@ import time import threading from openpilot.common.params import Params -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.common.swaglog import cloudlog from openpilot.system.statsd import statlog diff --git a/system/hardware/tici/__init__.py b/system/hardware/tici/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json deleted file mode 100644 index 07e2079ec..000000000 --- a/system/hardware/tici/agnos.json +++ /dev/null @@ -1,84 +0,0 @@ -[ - { - "name": "xbl", - "url": "https://commadist.azureedge.net/agnosupdate/xbl-e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb.img.xz", - "hash": "e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb", - "hash_raw": "e8acf2a9cc7f0ce84cb803bfea9477f765c0d7b4daf26048e59651b9e6a7bfbb", - "size": 3282256, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "bea7f1a24428c3ededf672fa4fc78baf180cfbd8aafb77c974655b38517283e3" - }, - { - "name": "xbl_config", - "url": "https://commadist.azureedge.net/agnosupdate/xbl_config-758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85.img.xz", - "hash": "758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85", - "hash_raw": "758552ecf92b5569677197783bf0ccb73d7f961685308e45d3276ac9dd974f85", - "size": 98124, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "fb18cde08a98a168961ecd357e92474823046752b94e112f59fe51a6acd7197d" - }, - { - "name": "abl", - "url": "https://commadist.azureedge.net/agnosupdate/abl-b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c.img.xz", - "hash": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c", - "hash_raw": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c", - "size": 274432, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "b6fba807b9bcd66a31f2afb0eba5163ec239693ad32e2e4200f6c356adfe098c" - }, - { - "name": "aop", - "url": "https://commadist.azureedge.net/agnosupdate/aop-78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1.img.xz", - "hash": "78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1", - "hash_raw": "78b2287ca219a0811b3004c523fa0f4749e4d1fd92be3aba61699305b7943ad1", - "size": 184364, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "6c9135446bd3fc075fcee59b887a12e49029ab1f98ed8d6d1e32c73569d47de3" - }, - { - "name": "devcfg", - "url": "https://commadist.azureedge.net/agnosupdate/devcfg-f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc.img.xz", - "hash": "f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc", - "hash_raw": "f71df3a86958c093ba3969254c4db025187eef9385427f1ade946742939b43cc", - "size": 40336, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "2a67971602012c1b43544964709da13c322786b456a8e78568b117e8b1540ce3" - }, - { - "name": "boot", - "url": "https://commadist.azureedge.net/agnosupdate/boot-8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8.img.xz", - "hash": "8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8", - "hash_raw": "8806802b195a5b1396a3ae8dd92a8b7711dc522f6aceafd820e871bae5c8a6d8", - "size": 17487872, - "sparse": false, - "full_check": true, - "has_ab": true, - "ondevice_hash": "edca8bee1531e66953d107eeceeed2dc7b3ca46417e49d55508f94e58bf95db8" - }, - { - "name": "system", - "url": "https://commadist.azureedge.net/agnosupdate/system-ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f.img.xz", - "hash": "78acfe16a7b62a3a91fc7a81f40a693e4468cec1c69df7d0b1e550aacc646113", - "hash_raw": "ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f", - "size": 4718592000, - "sparse": true, - "full_check": false, - "has_ab": true, - "ondevice_hash": "743142c5a898f27b2a1029cca42c8a5d5d1fc0096414422b850fe84c8d0b8342", - "alt": { - "hash": "ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f", - "url": "https://commadist.azureedge.net/agnosupdate/system-ef0d879302cb29e72110e9c8d3f947c830fd7d37c8192744fc9dbea1af78501f.img", - "size": 4718592000 - } - } -] \ No newline at end of file diff --git a/system/hardware/tici/agnos.json b/system/hardware/tici/agnos.json new file mode 120000 index 000000000..ffee992f2 --- /dev/null +++ b/system/hardware/tici/agnos.json @@ -0,0 +1 @@ +../../../common/hardware/tici/agnos.json \ No newline at end of file diff --git a/system/hardware/tici/tests/__init__.py b/system/hardware/tici/tests/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/system/loggerd/config.py b/system/loggerd/config.py index e1c47c768..0a8ee9839 100644 --- a/system/loggerd/config.py +++ b/system/loggerd/config.py @@ -1,5 +1,5 @@ import os -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths CAMERA_FPS = 20 diff --git a/system/loggerd/deleter.py b/system/loggerd/deleter.py index eb8fd35f2..6e9ac3657 100755 --- a/system/loggerd/deleter.py +++ b/system/loggerd/deleter.py @@ -2,7 +2,7 @@ import os import shutil import threading -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.loggerd.config import get_available_bytes, get_available_percent from openpilot.system.loggerd.uploader import listdir_by_creation diff --git a/system/loggerd/logger.h b/system/loggerd/logger.h index 18d07b5f3..dba7c2f44 100644 --- a/system/loggerd/logger.h +++ b/system/loggerd/logger.h @@ -6,7 +6,7 @@ #include "cereal/messaging/messaging.h" #include "common/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "system/loggerd/zstd_writer.h" constexpr int LOG_COMPRESSION_LEVEL = 10; diff --git a/system/loggerd/loggerd.h b/system/loggerd/loggerd.h index c5f253d8f..7877e9dbb 100644 --- a/system/loggerd/loggerd.h +++ b/system/loggerd/loggerd.h @@ -6,7 +6,7 @@ #include "cereal/messaging/messaging.h" #include "cereal/services.h" #include "msgq/visionipc/visionipc_client.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "common/params.h" #include "common/swaglog.h" #include "common/util.h" diff --git a/system/loggerd/tests/loggerd_tests_common.py b/system/loggerd/tests/loggerd_tests_common.py index fd071486d..757b61d17 100644 --- a/system/loggerd/tests/loggerd_tests_common.py +++ b/system/loggerd/tests/loggerd_tests_common.py @@ -6,7 +6,7 @@ from pathlib import Path import openpilot.system.loggerd.deleter as deleter import openpilot.system.loggerd.uploader as uploader from openpilot.common.params import Params -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.system.loggerd.xattr_cache import setxattr diff --git a/system/loggerd/tests/test_encoder.py b/system/loggerd/tests/test_encoder.py index 2b74fe227..416c158ed 100644 --- a/system/loggerd/tests/test_encoder.py +++ b/system/loggerd/tests/test_encoder.py @@ -12,10 +12,10 @@ from tqdm import trange from openpilot.common.params import Params from openpilot.common.timeout import Timeout -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.system.manager.process_config import managed_processes from openpilot.tools.lib.logreader import LogReader -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths SEGMENT_LENGTH = 2 FULL_SIZE = 2507572 diff --git a/system/loggerd/tests/test_loggerd.py b/system/loggerd/tests/test_loggerd.py index 9fd1b2d43..882de583b 100644 --- a/system/loggerd/tests/test_loggerd.py +++ b/system/loggerd/tests/test_loggerd.py @@ -15,8 +15,8 @@ from cereal.services import SERVICE_LIST from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params from openpilot.common.timeout import Timeout -from openpilot.system.hardware.hw import Paths -from openpilot.system.hardware import TICI +from openpilot.common.hardware.hw import Paths +from openpilot.common.hardware import TICI from openpilot.system.loggerd.xattr_cache import getxattr from openpilot.system.loggerd.deleter import PRESERVE_ATTR_NAME, PRESERVE_ATTR_VALUE from openpilot.system.manager.process_config import managed_processes diff --git a/system/loggerd/tests/test_uploader.py b/system/loggerd/tests/test_uploader.py index 562bc068e..eec85eda2 100644 --- a/system/loggerd/tests/test_uploader.py +++ b/system/loggerd/tests/test_uploader.py @@ -4,7 +4,7 @@ import threading import logging import json from pathlib import Path -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.loggerd.uploader import main, UPLOAD_ATTR_NAME, UPLOAD_ATTR_VALUE diff --git a/system/loggerd/uploader.py b/system/loggerd/uploader.py index 8ac38b6df..809a302b6 100755 --- a/system/loggerd/uploader.py +++ b/system/loggerd/uploader.py @@ -15,7 +15,7 @@ from openpilot.common.api import Api from openpilot.common.utils import get_upload_stream from openpilot.common.params import Params from openpilot.common.realtime import set_core_affinity -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.system.loggerd.xattr_cache import getxattr, setxattr from openpilot.common.swaglog import cloudlog diff --git a/system/logmessaged.py b/system/logmessaged.py index c095c2619..a64a849b0 100755 --- a/system/logmessaged.py +++ b/system/logmessaged.py @@ -4,7 +4,7 @@ from typing import NoReturn import cereal.messaging as messaging from openpilot.common.logging_extra import SwagLogFileFormatter -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import get_file_handler diff --git a/system/manager/build.py b/system/manager/build.py index 470cfccda..75a7dc63e 100755 --- a/system/manager/build.py +++ b/system/manager/build.py @@ -6,7 +6,7 @@ import subprocess from openpilot.common.basedir import BASEDIR from openpilot.common.spinner import Spinner from openpilot.common.text_window import TextWindow -from openpilot.system.hardware import HARDWARE, AGNOS +from openpilot.common.hardware import HARDWARE, AGNOS def build() -> None: spinner = Spinner() diff --git a/system/manager/manager.py b/system/manager/manager.py index d8f9a3d8f..cb84b9b8c 100755 --- a/system/manager/manager.py +++ b/system/manager/manager.py @@ -12,14 +12,14 @@ import openpilot.system.sentry as sentry from openpilot.common.utils import atomic_write from openpilot.common.params import Params, ParamKeyFlag from openpilot.common.text_window import TextWindow -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.manager.helpers import unblock_stdout, write_onroad_params, save_bootlog from openpilot.system.manager.process import ensure_running from openpilot.system.manager.process_config import managed_processes from openpilot.system.athena.registration import register, UNREGISTERED_DONGLE_ID from openpilot.common.swaglog import cloudlog, add_file_handler from openpilot.system.version import get_build_metadata -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths def manager_init() -> None: diff --git a/system/manager/process_config.py b/system/manager/process_config.py index a442e4f86..a099bc753 100644 --- a/system/manager/process_config.py +++ b/system/manager/process_config.py @@ -4,7 +4,7 @@ import platform from cereal import car from openpilot.common.params import Params -from openpilot.system.hardware import PC, TICI +from openpilot.common.hardware import PC, TICI from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess WEBCAM = os.getenv("USE_WEBCAM") is not None @@ -112,7 +112,7 @@ procs = [ PythonProcess("lateral_maneuversd", "tools.lateral_maneuvers.lateral_maneuversd", lat_maneuver), PythonProcess("radard", "selfdrive.controls.radard", only_onroad), PythonProcess("hardwared", "system.hardware.hardwared", always_run), - PythonProcess("modem", "system.hardware.tici.modem", always_run, enabled=TICI), + PythonProcess("modem", "common.hardware.tici.modem", always_run, enabled=TICI), PythonProcess("tombstoned", "system.tombstoned", always_run, enabled=not PC), PythonProcess("updated", "system.updated.updated", only_offroad, enabled=not PC), PythonProcess("uploader", "system.loggerd.uploader", always_run), diff --git a/system/manager/test/test_manager.py b/system/manager/test/test_manager.py index 34d07c672..73c66ff3f 100644 --- a/system/manager/test/test_manager.py +++ b/system/manager/test/test_manager.py @@ -8,7 +8,7 @@ from openpilot.common.params import Params import openpilot.system.manager.manager as manager from openpilot.system.manager.process import ensure_running from openpilot.system.manager.process_config import managed_processes, procs -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE os.environ['FAKEUPLOAD'] = "1" diff --git a/system/qcomgpsd/nmeaport.py b/system/qcomgpsd/nmeaport.py index 10b8516ed..0e695b65e 100644 --- a/system/qcomgpsd/nmeaport.py +++ b/system/qcomgpsd/nmeaport.py @@ -119,7 +119,7 @@ def process_nmea_port_messages(device:str="/dev/ttyUSB1") -> NoReturn: def main() -> NoReturn: from openpilot.common.gpio import gpio_init, gpio_set - from openpilot.system.hardware.tici.pins import GPIO + from openpilot.common.hardware.tici.pins import GPIO from openpilot.system.qcomgpsd.qcomgpsd import at_cmd try: diff --git a/system/qcomgpsd/qcomgpsd.py b/system/qcomgpsd/qcomgpsd.py index 7e0d30487..78731f434 100755 --- a/system/qcomgpsd/qcomgpsd.py +++ b/system/qcomgpsd/qcomgpsd.py @@ -16,7 +16,7 @@ import cereal.messaging as messaging from openpilot.common.gpio import gpio_init, gpio_set from openpilot.common.utils import retry from openpilot.common.time_helpers import system_time_valid -from openpilot.system.hardware.tici.pins import GPIO +from openpilot.common.hardware.tici.pins import GPIO from openpilot.common.swaglog import cloudlog from openpilot.system.qcomgpsd.modemdiag import ModemDiag, DIAG_LOG_F, setup_logs, send_recv from openpilot.system.qcomgpsd.structs import (dict_unpacker, position_report, relist, diff --git a/system/sentry.py b/system/sentry.py index 47d64ba0f..ee9f813e2 100644 --- a/system/sentry.py +++ b/system/sentry.py @@ -5,7 +5,7 @@ from sentry_sdk.integrations.threading import ThreadingIntegration from openpilot.common.params import Params from openpilot.system.athena.registration import is_registered_device -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC from openpilot.common.swaglog import cloudlog from openpilot.system.version import get_build_metadata, get_version diff --git a/system/statsd.py b/system/statsd.py index 33e9e9912..250780e01 100755 --- a/system/statsd.py +++ b/system/statsd.py @@ -10,9 +10,9 @@ from typing import NoReturn from openpilot.common.params import Params from cereal.messaging import SubMaster -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.common.utils import atomic_write from openpilot.system.version import get_build_metadata from openpilot.system.loggerd.config import STATS_DIR_FILE_LIMIT, STATS_SOCKET, STATS_FLUSH_TIME_S diff --git a/system/tests/test_logmessaged.py b/system/tests/test_logmessaged.py index 9ccc8ef53..92bcd9d1a 100644 --- a/system/tests/test_logmessaged.py +++ b/system/tests/test_logmessaged.py @@ -4,7 +4,7 @@ import time import cereal.messaging as messaging from openpilot.system.manager.process_config import managed_processes -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog, ipchandler diff --git a/system/tombstoned.py b/system/tombstoned.py index 5bcced266..88a2a879e 100755 --- a/system/tombstoned.py +++ b/system/tombstoned.py @@ -10,7 +10,7 @@ import glob from typing import NoReturn import openpilot.system.sentry as sentry -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.system.version import get_build_metadata diff --git a/system/ubloxd/pigeond.py b/system/ubloxd/pigeond.py index e458a9d65..fe2634e33 100755 --- a/system/ubloxd/pigeond.py +++ b/system/ubloxd/pigeond.py @@ -12,9 +12,9 @@ from cereal import messaging from openpilot.common.time_helpers import system_time_valid from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from openpilot.common.gpio import gpio_init, gpio_set -from openpilot.system.hardware.tici.pins import GPIO +from openpilot.common.hardware.tici.pins import GPIO UBLOX_TTY = "/dev/ttyHS0" diff --git a/system/ubloxd/tests/test_pigeond.py b/system/ubloxd/tests/test_pigeond.py index 202820e41..fb979a937 100644 --- a/system/ubloxd/tests/test_pigeond.py +++ b/system/ubloxd/tests/test_pigeond.py @@ -6,7 +6,7 @@ from cereal.services import SERVICE_LIST from openpilot.common.gpio import gpio_read from openpilot.selfdrive.test.helpers import with_processes from openpilot.system.manager.process_config import managed_processes -from openpilot.system.hardware.tici.pins import GPIO +from openpilot.common.hardware.tici.pins import GPIO # TODO: test TTFF when we have good A-GNSS diff --git a/system/ui/lib/application.py b/system/ui/lib/application.py index 2513086ed..bd2c9dfcd 100644 --- a/system/ui/lib/application.py +++ b/system/ui/lib/application.py @@ -18,7 +18,7 @@ from pathlib import Path from typing import NamedTuple from importlib.resources import as_file, files from openpilot.common.swaglog import cloudlog -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC from openpilot.system.ui.lib.multilang import multilang from openpilot.common.realtime import Ratekeeper diff --git a/system/ui/lib/scroll_panel2.py b/system/ui/lib/scroll_panel2.py index 7fae60119..b6193672c 100644 --- a/system/ui/lib/scroll_panel2.py +++ b/system/ui/lib/scroll_panel2.py @@ -5,7 +5,7 @@ from collections.abc import Callable from enum import Enum from typing import cast from openpilot.system.ui.lib.application import gui_app, MouseEvent -from openpilot.system.hardware import TICI +from openpilot.common.hardware import TICI from collections import deque MIN_VELOCITY = 10 # px/s, changes from auto scroll to steady state diff --git a/system/ui/mici_reset.py b/system/ui/mici_reset.py index 9cc6e7f3f..90de7843f 100755 --- a/system/ui/mici_reset.py +++ b/system/ui/mici_reset.py @@ -7,7 +7,7 @@ from enum import IntEnum import pyray as rl -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC from openpilot.system.ui.lib.application import gui_app from openpilot.system.ui.widgets.scroller import Scroller from openpilot.system.ui.mici_setup import GreyBigButton, FailedPage diff --git a/system/ui/mici_setup.py b/system/ui/mici_setup.py index 2a23e4c4f..4df127f1b 100755 --- a/system/ui/mici_setup.py +++ b/system/ui/mici_setup.py @@ -13,7 +13,7 @@ import pyray as rl from cereal import log from openpilot.common.filter_simple import BounceFilter -from openpilot.system.hardware import HARDWARE, TICI +from openpilot.common.hardware import HARDWARE, TICI from openpilot.common.realtime import config_realtime_process, set_core_affinity from openpilot.common.swaglog import cloudlog from openpilot.common.time_helpers import system_time_valid diff --git a/system/ui/mici_updater.py b/system/ui/mici_updater.py index 8437e6fa6..a072354cf 100755 --- a/system/ui/mici_updater.py +++ b/system/ui/mici_updater.py @@ -5,7 +5,7 @@ import threading import pyray as rl from openpilot.common.realtime import config_realtime_process, set_core_affinity -from openpilot.system.hardware import HARDWARE, TICI +from openpilot.common.hardware import HARDWARE, TICI from openpilot.common.swaglog import cloudlog from openpilot.system.ui.lib.application import gui_app, FontWeight from openpilot.system.ui.widgets.nav_widget import NavWidget diff --git a/system/ui/text.py b/system/ui/text.py index 17e8a507c..f6bcf4edd 100755 --- a/system/ui/text.py +++ b/system/ui/text.py @@ -2,7 +2,7 @@ import re import sys import pyray as rl -from openpilot.system.hardware import HARDWARE, PC +from openpilot.common.hardware import HARDWARE, PC from openpilot.system.ui.lib.application import BIG_UI, gui_app from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.lib.text_measure import measure_text_cached diff --git a/system/ui/tici_reset.py b/system/ui/tici_reset.py index a6603d547..cb5441a40 100755 --- a/system/ui/tici_reset.py +++ b/system/ui/tici_reset.py @@ -7,7 +7,7 @@ from enum import IntEnum import pyray as rl -from openpilot.system.hardware import PC +from openpilot.common.hardware import PC from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.button import Button, ButtonStyle diff --git a/system/ui/tici_setup.py b/system/ui/tici_setup.py index 9eefb6af5..0e0c6fdc7 100755 --- a/system/ui/tici_setup.py +++ b/system/ui/tici_setup.py @@ -11,7 +11,7 @@ from enum import IntEnum import pyray as rl from cereal import log -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.ui.lib.scroll_panel import GuiScrollPanel from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.widgets import DialogResult, Widget diff --git a/system/ui/tici_updater.py b/system/ui/tici_updater.py index 3a3b0987d..27cf6579a 100755 --- a/system/ui/tici_updater.py +++ b/system/ui/tici_updater.py @@ -5,7 +5,7 @@ import threading import pyray as rl from enum import IntEnum -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.system.ui.lib.application import gui_app, FontWeight, FONT_SCALE from openpilot.system.ui.lib.wifi_manager import WifiManager from openpilot.system.ui.widgets import Widget diff --git a/system/updated/tests/test_base.py b/system/updated/tests/test_base.py index db38bfa84..315aebbbe 100644 --- a/system/updated/tests/test_base.py +++ b/system/updated/tests/test_base.py @@ -233,10 +233,10 @@ class ParamsBaseUpdateTest(TestBaseUpdate): self.setup_basedir_release("release3") with self.additional_context(), processes_context(["updated"]) as [updated]: - mocker.patch("openpilot.system.hardware.AGNOS", "True") - mocker.patch("openpilot.system.hardware.tici.hardware.Tici.get_os_version", "1.2") - mocker.patch("openpilot.system.hardware.tici.agnos.get_target_slot_number") - mocker.patch("openpilot.system.hardware.tici.agnos.flash_agnos_update") + mocker.patch("openpilot.common.hardware.AGNOS", "True") + mocker.patch("openpilot.common.hardware.tici.hardware.Tici.get_os_version", "1.2") + mocker.patch("openpilot.common.hardware.tici.agnos.get_target_slot_number") + mocker.patch("openpilot.common.hardware.tici.agnos.flash_agnos_update") self._test_params("release3", False, False) self.wait_for_idle() diff --git a/system/updated/updated.py b/system/updated/updated.py index 25821e373..e40bc44e7 100755 --- a/system/updated/updated.py +++ b/system/updated/updated.py @@ -18,7 +18,7 @@ from openpilot.common.time_helpers import system_time_valid from openpilot.common.markdown import parse_markdown from openpilot.common.swaglog import cloudlog from openpilot.selfdrive.selfdrived.alertmanager import set_offroad_alert -from openpilot.system.hardware import AGNOS, HARDWARE +from openpilot.common.hardware import AGNOS, HARDWARE from openpilot.system.version import get_build_metadata LOCK_FILE = os.getenv("UPDATER_LOCK_FILE", "/tmp/safe_staging_overlay.lock") @@ -204,7 +204,7 @@ def finalize_update() -> None: def handle_agnos_update() -> None: - from openpilot.system.hardware.tici.agnos import flash_agnos_update, get_target_slot_number + from openpilot.common.hardware.tici.agnos import flash_agnos_update, get_target_slot_number cur_version = HARDWARE.get_os_version() updated_version = run(["bash", "-c", r"unset AGNOS_VERSION && source launch_env.sh && \ diff --git a/tools/jotpluggler/app.cc b/tools/jotpluggler/app.cc index 22a9f9021..f80443e56 100644 --- a/tools/jotpluggler/app.cc +++ b/tools/jotpluggler/app.cc @@ -3,7 +3,7 @@ #include "tools/jotpluggler/common.h" #include "tools/jotpluggler/internal.h" #include "tools/jotpluggler/map.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "imgui_impl_glfw.h" #include "imgui_internal.h" diff --git a/tools/jotpluggler/layout.cc b/tools/jotpluggler/layout.cc index 0d3b82c25..bf2a3f208 100644 --- a/tools/jotpluggler/layout.cc +++ b/tools/jotpluggler/layout.cc @@ -1,5 +1,5 @@ #include "tools/jotpluggler/internal.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include diff --git a/tools/joystick/joystick_control.py b/tools/joystick/joystick_control.py index b1f14043b..d9d4f0156 100755 --- a/tools/joystick/joystick_control.py +++ b/tools/joystick/joystick_control.py @@ -8,7 +8,7 @@ from inputs import UnpluggedError, get_gamepad from cereal import messaging from openpilot.common.params import Params from openpilot.common.realtime import Ratekeeper -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE from openpilot.tools.lib.kbhit import KBHit EXPO = 0.4 diff --git a/tools/lateral_maneuvers/generate_report.py b/tools/lateral_maneuvers/generate_report.py index c2ef7e99e..5db486a70 100755 --- a/tools/lateral_maneuvers/generate_report.py +++ b/tools/lateral_maneuvers/generate_report.py @@ -15,7 +15,7 @@ from cereal import car from openpilot.common.filter_simple import FirstOrderFilter from openpilot.selfdrive.controls.lib.latcontrol_torque import LP_FILTER_CUTOFF_HZ from openpilot.tools.lib.logreader import LogReader -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.common.constants import CV from openpilot.tools.longitudinal_maneuvers.generate_report import format_car_params diff --git a/tools/lib/auth_config.py b/tools/lib/auth_config.py index c4e7b6261..5966bd34a 100644 --- a/tools/lib/auth_config.py +++ b/tools/lib/auth_config.py @@ -1,6 +1,6 @@ import json import os -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths class MissingAuthConfigError(Exception): diff --git a/tools/lib/file_downloader.py b/tools/lib/file_downloader.py index 5b31a5894..68061b201 100755 --- a/tools/lib/file_downloader.py +++ b/tools/lib/file_downloader.py @@ -17,7 +17,7 @@ import sys import tempfile import shutil -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.tools.lib.api import CommaApi, UnauthorizedError, APIError from openpilot.tools.lib.auth_config import get_token from openpilot.tools.lib.url_file import URLFile diff --git a/tools/lib/tests/test_caching.py b/tools/lib/tests/test_caching.py index cb14098e6..0753ef1d3 100644 --- a/tools/lib/tests/test_caching.py +++ b/tools/lib/tests/test_caching.py @@ -6,7 +6,7 @@ import tempfile import pytest from openpilot.selfdrive.test.helpers import http_server_context -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from openpilot.tools.lib.url_file import URLFile, prune_cache import openpilot.tools.lib.url_file as url_file_module diff --git a/tools/lib/url_file.py b/tools/lib/url_file.py index de1207046..3f72429b9 100644 --- a/tools/lib/url_file.py +++ b/tools/lib/url_file.py @@ -9,7 +9,7 @@ from urllib3.response import BaseHTTPResponse from urllib3.util import Timeout from openpilot.common.utils import atomic_write -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths from urllib3.exceptions import MaxRetryError # Cache chunk size diff --git a/tools/longitudinal_maneuvers/generate_report.py b/tools/longitudinal_maneuvers/generate_report.py index 32bdb5b1c..dbd9f6db9 100755 --- a/tools/longitudinal_maneuvers/generate_report.py +++ b/tools/longitudinal_maneuvers/generate_report.py @@ -12,7 +12,7 @@ import matplotlib.pyplot as plt from openpilot.common.utils import tabulate from openpilot.tools.lib.logreader import LogReader -from openpilot.system.hardware.hw import Paths +from openpilot.common.hardware.hw import Paths def format_car_params(CP): diff --git a/tools/replay/framereader.cc b/tools/replay/framereader.cc index a643f0d3a..52db658ad 100644 --- a/tools/replay/framereader.cc +++ b/tools/replay/framereader.cc @@ -9,7 +9,7 @@ #include "libyuv.h" #include "tools/replay/py_downloader.h" #include "tools/replay/util.h" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #ifdef __APPLE__ #define HW_DEVICE_TYPE AV_HWDEVICE_TYPE_VIDEOTOOLBOX diff --git a/tools/replay/route.cc b/tools/replay/route.cc index df4fa813c..1560f1dce 100644 --- a/tools/replay/route.cc +++ b/tools/replay/route.cc @@ -5,7 +5,7 @@ #include #include "json11/json11.hpp" -#include "system/hardware/hw.h" +#include "common/hardware/hw.h" #include "tools/replay/py_downloader.h" #include "tools/replay/replay.h" #include "tools/replay/util.h" diff --git a/tools/scripts/ssh.py b/tools/scripts/ssh.py index e454afb69..33eac4081 100755 --- a/tools/scripts/ssh.py +++ b/tools/scripts/ssh.py @@ -14,7 +14,7 @@ if __name__ == "__main__": parser.add_argument("device", help="device name or dongle id") parser.add_argument("--host", help="ssh jump server host", default="ssh.comma.ai") parser.add_argument("--port", help="ssh jump server port", default=22, type=int) - parser.add_argument("--key", help="ssh key", default=os.path.join(BASEDIR, "system/hardware/tici/id_rsa")) + parser.add_argument("--key", help="ssh key", default=os.path.join(BASEDIR, "common/hardware/tici/id_rsa")) parser.add_argument("--debug", help="enable debug output", action="store_true") args = parser.parse_args() diff --git a/tools/scripts/uiview.py b/tools/scripts/uiview.py index e558406b0..a8d50e7f9 100755 --- a/tools/scripts/uiview.py +++ b/tools/scripts/uiview.py @@ -4,7 +4,7 @@ import time from cereal import car, log, messaging from openpilot.common.params import Params from openpilot.system.manager.process_config import managed_processes -from openpilot.system.hardware import HARDWARE +from openpilot.common.hardware import HARDWARE if __name__ == "__main__": CP = car.CarParams(notCar=True, wheelbase=1, steerRatio=10)