[v0.98][PPC] Add part number detection using linux device tree

This commit is contained in:
Dr-Noob
2021-08-05 10:06:16 +02:00
parent bcdd5267b2
commit 921e815470
5 changed files with 18 additions and 10 deletions

View File

@@ -166,6 +166,11 @@ struct cpuInfo* get_cpu_info() {
*ptr = false;
}
int len;
char* path = emalloc(sizeof(char) * (strlen(_PATH_DT) + strlen(_PATH_DT_PART) + 1));
sprintf(path, "%s%s", _PATH_DT, _PATH_DT_PART);
cpu->cpu_name = read_file(path, &len);
cpu->pvr = mfpvr();
cpu->arch = get_cpu_uarch(cpu);
cpu->freq = get_frequency_info();

View File

@@ -2,6 +2,8 @@
#define __UDEV_PPC__
#include "../common/udev.h"
#define _PATH_DT "/proc/device-tree/vpd/root-node-vpd@a000/enclosure@1e00/backplane@800/processor@1000"
#define _PATH_DT_PART "/part-number"
bool fill_core_ids_from_sys(int *core_ids, int total_cores);
bool fill_package_ids_from_sys(int* package_ids, int total_cores);