Initial hardware support for Rubik pi (#1989)

This commit is contained in:
Sam Freund
2025-07-06 14:39:29 -05:00
committed by GitHub
parent d88ea4a75d
commit d341ebbadf
3 changed files with 62 additions and 0 deletions

View File

@@ -51,6 +51,13 @@ public enum Platform {
false,
OSType.LINUX,
true),
LINUX_QCS6490(
"Linux AARCH 64-bit with QCS6490",
Platform::getLinuxDeviceTreeModel,
"linuxarm64",
true,
OSType.LINUX,
true), // QCS6490 SBCs
LINUX_AARCH64(
"Linux AARCH64",
Platform::getLinuxDeviceTreeModel,
@@ -124,6 +131,10 @@ public enum Platform {
return Platform.isOrangePi() || Platform.isCoolPi4b() || Platform.isRock5C();
}
public static boolean isQCS6490() {
return isRubik();
}
public static boolean isRaspberryPi() {
return currentPlatform.isPi;
}
@@ -162,6 +173,7 @@ public enum Platform {
String.format("Unknown Platform. OS: %s, Architecture: %s", OS_NAME, OS_ARCH);
private static final String UnknownDeviceModelString = "Unknown";
// TODO: add rubik, but waiting for more info on architecture
public static Platform getCurrentPlatform() {
String OS_NAME;
if (Platform.OS_NAME != null) {
@@ -219,6 +231,9 @@ public enum Platform {
// TODO - os detection needed?
if (isRK3588()) {
return LINUX_RK3588_64;
} else if (isQCS6490()) {
return LINUX_QCS6490;
} else {
return LINUX_AARCH64;
}
@@ -256,6 +271,10 @@ public enum Platform {
return fileHasText("/proc/device-tree/model", "NVIDIA Jetson");
}
private static boolean isRubik() {
return fileHasText("/proc/device-tree/model", "Rubik");
}
static String getLinuxDeviceTreeModel() {
var deviceTreeModelPath = Paths.get("/proc/device-tree/model");
try {