[v1.03][ARM] Experimental feature: Show vendor logo even when the exact SoC model cannot be determined

This commit is contained in:
Dr-Noob
2023-03-25 11:00:43 +01:00
parent eaee997945
commit c3b5dd0eb0
2 changed files with 19 additions and 4 deletions

View File

@@ -142,6 +142,8 @@ bool match_broadcom(char* soc_name, struct system_on_chip* soc) {
if((tmp = strstr(soc_name, "BCM")) == NULL)
return false;
soc->soc_vendor = SOC_VENDOR_BROADCOM;
SOC_START
SOC_EQ(tmp, "BCM2835", "2835", SOC_BCM_2835, soc, 65)
SOC_EQ(tmp, "BCM2836", "2836", SOC_BCM_2836, soc, 40)
@@ -168,6 +170,8 @@ bool match_hisilicon(char* soc_name, struct system_on_chip* soc) {
if((tmp = strstr(soc_name, "hi")) == NULL)
return false;
soc->soc_vendor = SOC_VENDOR_KIRIN;
SOC_START
SOC_EQ(tmp, "hi3620GFC", "K3V2", SOC_HISILICON_3620, soc, 40)
//SOC_EQ(tmp, "?", "K3V2E", SOC_KIRIN, soc, ?)
@@ -207,6 +211,8 @@ bool match_exynos(char* soc_name, struct system_on_chip* soc) {
else if((tmp = strstr(soc_name, "exynos")) != NULL);
else return false;
soc->soc_vendor = SOC_VENDOR_EXYNOS;
// Because exynos are recently using "exynosXXXX" instead
// of "universalXXXX" as codenames, SOC_EXY_EQ will check for
// both cases, since it seems that there are some SoCs that
@@ -261,6 +267,8 @@ bool match_mediatek(char* soc_name, struct system_on_chip* soc) {
if((tmp = strstr(soc_name_upper, "MT")) == NULL)
return false;
soc->soc_vendor = SOC_VENDOR_MEDIATEK;
SOC_START
// Dimensity //
SOC_EQ(tmp, "MT6893", "Dimensity 1200", SOC_MTK_MT6893, soc, 6)
@@ -389,6 +397,8 @@ bool match_qualcomm(char* soc_name, struct system_on_chip* soc) {
else if((tmp = strstr(soc_name_upper, "QSD")) != NULL);
else return false;
soc->soc_vendor = SOC_VENDOR_SNAPDRAGON;
SOC_START
// Snapdragon S1 //
SOC_EQ(tmp, "QSD8650", "S1", SOC_SNAPD_QSD8650, soc, 65)
@@ -521,6 +531,8 @@ bool match_allwinner(char* soc_name, struct system_on_chip* soc) {
if((tmp = strstr(soc_name, "sun")) == NULL)
return false;
soc->soc_vendor = SOC_VENDOR_ALLWINNER;
SOC_START
// SoCs we can detect just with with the name
SOC_EQ(tmp, "sun4i", "A10", SOC_ALLWINNER_A10, soc, 55)
@@ -532,7 +544,7 @@ bool match_allwinner(char* soc_name, struct system_on_chip* soc) {
int filelen;
char* sid_nvmem = read_file(_PATH_SUNXI_NVMEM, &filelen);
if(sid_nvmem == NULL) {
printWarn("read_file: %s: %s\n", _PATH_SUNXI_NVMEM, strerror(errno));
printWarn("read_file: %s: %s", _PATH_SUNXI_NVMEM, strerror(errno));
return false;
}
uint32_t sid = get_sid_from_nvmem(sid_nvmem);
@@ -744,6 +756,7 @@ struct system_on_chip* get_soc(void) {
struct system_on_chip* soc = emalloc(sizeof(struct system_on_chip));
soc->raw_name = NULL;
soc->soc_vendor = SOC_VENDOR_UNKNOWN;
soc->soc_model = SOC_MODEL_UNKNOWN;
soc->process = UNKNOWN;
#ifdef __linux__
@@ -782,7 +795,7 @@ struct system_on_chip* get_soc(void) {
}
#endif // ifdef __linux__
if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) {
if(soc->soc_model == SOC_MODEL_UNKNOWN) {
// raw_name might not be NULL, but if we were unable to find
// the exact SoC, just print "Unkwnown"
soc->raw_name = emalloc(sizeof(char) * (strlen(STRING_UNKNOWN)+1));
@@ -793,7 +806,7 @@ struct system_on_chip* get_soc(void) {
}
char* get_soc_name(struct system_on_chip* soc) {
if(soc->soc_vendor == SOC_VENDOR_UNKNOWN)
if(soc->soc_model == SOC_MODEL_UNKNOWN)
return soc->raw_name;
return soc->soc_name;
}

View File

@@ -286,7 +286,9 @@ enum {
SOC_ALLWINNER_R16,
SOC_ALLWINNER_R40,
SOC_ALLWINNER_R58,
SOC_ALLWINNER_R328
SOC_ALLWINNER_R328,
// UNKNOWN
SOC_MODEL_UNKNOWN
};
inline static VENDOR get_soc_vendor_from_soc(SOC soc) {