Skip to content

Commit

Permalink
[v1.06][ARM] Add support for NXP i.MX 8M Plus (Dr-Noob#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-Noob committed Aug 25, 2024
1 parent 324d0fb commit 9f66a13
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/arm/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,10 @@ struct system_on_chip* guess_soc_from_devtree(struct system_on_chip* soc) {
return soc;
}

DT_START
// The following are internal codenames of Asahi Linux
// https://github.com/AsahiLinux/docs/wiki/Codenames
DT_START
// https://github.com/Dr-Noob/cpufetch/issues/263
DT_EQ(dt, len, soc, "apple,t8103", "M1", SOC_APPLE_M1, 5)
DT_EQ(dt, len, soc, "apple,t6000", "M1 Pro", SOC_APPLE_M1_PRO, 5)
DT_EQ(dt, len, soc, "apple,t6001", "M1 Max", SOC_APPLE_M1_MAX, 5)
Expand All @@ -969,6 +970,9 @@ struct system_on_chip* guess_soc_from_devtree(struct system_on_chip* soc) {
DT_EQ(dt, len, soc, "apple,t6030", "M3 Pro", SOC_APPLE_M3_PRO, 3)
DT_EQ(dt, len, soc, "apple,t6031", "M3 Max", SOC_APPLE_M3_MAX, 3)
DT_EQ(dt, len, soc, "apple,t6034", "M3 Max", SOC_APPLE_M3_MAX, 3)
// https://github.com/Dr-Noob/cpufetch/issues/261
// https://www.nxp.com/docs/en/fact-sheet/IMX8MPLUSFS.pdf
DT_EQ(dt, len, soc, "imx8mp-nitrogen8mp", "i.MX 8M Plus", SOC_NXP_IMX8MP, 14)
DT_END(dt, len)
}

Expand Down
3 changes: 3 additions & 0 deletions src/arm/socs.h
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ enum {
SOC_TEGRA_X1,
// ALTRA
SOC_AMPERE_ALTRA,
// NXP
SOC_NXP_IMX8MP,
// UNKNOWN
SOC_MODEL_UNKNOWN
};
Expand All @@ -399,6 +401,7 @@ inline static VENDOR get_soc_vendor_from_soc(SOC soc) {
else if(soc >= SOC_GOOGLE_TENSOR && soc <= SOC_GOOGLE_TENSOR_G3) return SOC_VENDOR_GOOGLE;
else if(soc >= SOC_TEGRA_X1 && soc <= SOC_TEGRA_X1) return SOC_VENDOR_NVIDIA;
else if(soc >= SOC_AMPERE_ALTRA && soc <= SOC_AMPERE_ALTRA) return SOC_VENDOR_AMPERE;
else if(soc >= SOC_NXP_IMX8MP && soc <= SOC_NXP_IMX8MP) return SOC_VENDOR_NXP;
return SOC_VENDOR_UNKNOWN;
}

Expand Down
11 changes: 11 additions & 0 deletions src/common/ascii.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,16 @@ struct ascii_logo {
$C1 \
$C1 "

#define ASCII_NXP \
"$C1##### # $C2####### ####### $C3########## \
$C1####### ## $C2####### ####### $C3############### \
$C1########## #### $C2###### ###### $C3### ###### \
$C1############ ##### $C2############ $C3##### ##### \
$C1##### ####### ##### $C2########## $C3################### \
$C1##### ######### $C2############## $C3############### \
$C1##### ###### $C2###### ###### $C3#### \
$C1##### ## $C2###### ###### $C3## "

// --------------------- LONG LOGOS ------------------------- //
#define ASCII_AMD_L \
"$C1 \
Expand Down Expand Up @@ -589,6 +599,7 @@ asciiL logo_starfive = { ASCII_STARFIVE, 33, 17, false, {C_FG_WHITE},
asciiL logo_sipeed = { ASCII_SIPEED, 41, 16, true, {C_BG_RED, C_BG_WHITE}, {C_FG_RED, C_FG_WHITE} };
asciiL logo_nvidia = { ASCII_NVIDIA, 45, 19, false, {C_FG_GREEN, C_FG_WHITE}, {C_FG_WHITE, C_FG_GREEN} };
asciiL logo_ampere = { ASCII_AMPERE, 50, 17, false, {C_FG_RED}, {C_FG_WHITE, C_FG_RED} };
asciiL logo_nxp = { ASCII_NXP, 55, 8, false, {C_FG_YELLOW, C_FG_CYAN, C_FG_GREEN}, {C_FG_CYAN, C_FG_WHITE} };

// Long variants | ----------------------------------------------------------------------------------------------------------------|
asciiL logo_amd_l = { ASCII_AMD_L, 62, 19, true, {C_BG_WHITE, C_BG_GREEN}, {C_FG_WHITE, C_FG_GREEN} };
Expand Down
2 changes: 2 additions & 0 deletions src/common/printer.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,8 @@ void choose_ascii_art(struct ascii* art, struct color** cs, struct terminal* ter
art->art = &logo_rockchip;
else if(art->vendor == SOC_VENDOR_AMPERE)
art->art = &logo_ampere;
else if(art->vendor == SOC_VENDOR_NXP)
art->art = &logo_nxp;
else if(art->vendor == SOC_VENDOR_NVIDIA)
art->art = choose_ascii_art_aux(&logo_nvidia_l, &logo_nvidia, term, lf);
else {
Expand Down
1 change: 1 addition & 0 deletions src/common/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ static char* soc_trademark_string[] = {
[SOC_VENDOR_GOOGLE] = "Google ",
[SOC_VENDOR_NVIDIA] = "NVIDIA ",
[SOC_VENDOR_AMPERE] = "Ampere ",
[SOC_VENDOR_NXP] = "NXP ",
// RISC-V
[SOC_VENDOR_SIFIVE] = "SiFive ",
[SOC_VENDOR_STARFIVE] = "StarFive ",
Expand Down
1 change: 1 addition & 0 deletions src/common/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ enum {
SOC_VENDOR_GOOGLE,
SOC_VENDOR_NVIDIA,
SOC_VENDOR_AMPERE,
SOC_VENDOR_NXP,
// RISC-V
SOC_VENDOR_SIFIVE,
SOC_VENDOR_STARFIVE,
Expand Down

0 comments on commit 9f66a13

Please sign in to comment.