Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asahi Linux M1 Pro not properly detected #263

Closed
RossComputerGuy opened this issue Aug 15, 2024 · 14 comments
Closed

Asahi Linux M1 Pro not properly detected #263

RossComputerGuy opened this issue Aug 15, 2024 · 14 comments
Labels
bug Something isn't working

Comments

@RossComputerGuy
Copy link

image

Verbose:

[ERROR]: Unknown microarchitecture detected: IM=0x61 P=0x24 V=0x2 R=0x0
[VERSION]: cpufetch v1.05-38-gf631 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
[ERROR]: Unknown microarchitecture detected: IM=0x61 P=0x25 V=0x2 R=0x0
[VERSION]: cpufetch v1.05-38-gf631 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
[WARNING]: SoC detection failed using /proc/cpuinfo: No string found
[WARNING]: read_file: /sys/bus/nvmem/devices/rockchip-efuse0/nvmem: No such file or directory
[WARNING]: read_file: /sys/bus/nvmem/devices/rockchip-otp0/nvmem: No such file or directory
[WARNING]: guess_soc_from_uarch: No uarch matched the list
[WARNING]: guess_soc_from_pci: No PCI device matched the list

Debug:

[ERROR]: Unknown microarchitecture detected: IM=0x61 P=0x24 V=0x2 R=0x0
[VERSION]: cpufetch v1.05-38-gf631 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
[ERROR]: Unknown microarchitecture detected: IM=0x61 P=0x25 V=0x2 R=0x0
[VERSION]: cpufetch v1.05-38-gf631 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
cpufetch v1.05-38-gf631 (Linux ARM build)
[Core 0] 0x612F0240 2064 MHz
[Core 1] 0x612F0240 2064 MHz
[Core 2] 0x612F0250 3228 MHz
[Core 3] 0x612F0250 3228 MHz
[Core 4] 0x612F0250 3228 MHz
[Core 5] 0x612F0250 3228 MHz
[Core 6] 0x612F0250 3228 MHz
[Core 7] 0x612F0250 3228 MHz
[Core 8] 0x612F0250 3228 MHz
[Core 9] 0x612F0250 3228 MHz
@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 18, 2024

(This is a pretty complicated scenario, but we can try to make this work). Can you provide the output of cat /proc/device-tree/compatible and see if there is any PCI device that could help here to infer the SoC? I'll take care of the microarchitecture issue.

@Dr-Noob Dr-Noob added the bug Something isn't working label Aug 18, 2024
@RossComputerGuy
Copy link
Author

That file has: apple,j314sapple,t6000apple,arm-platform

@CarterLi
Copy link

t6000 is the code name of Apple Silicon SOC. You can find the detail here: https://github.com/AsahiLinux/docs/wiki/Codenames

Fastfetch uses:

switch (code)
{
    case 8103: return "Apple M1";
    case 6000: return "Apple M1 Pro";
    case 6001: return "Apple M1 Max";
    case 6002: return "Apple M1 Ultra";
    case 8112: return "Apple M2";
    case 6020: return "Apple M2 Pro";
    case 6021: return "Apple M2 Max";
    case 6022: return "Apple M2 Ultra";
    case 8122: return "Apple M3";
    case 6030: return "Apple M3 Pro";
    case 6031:
    case 6034: return "Apple M3 Max";
    default: return "Apple Silicon";
}

@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 21, 2024

I've pushed a (bit crappy) fix in branch i263. Could you check if that works for you? Thanks for the feedback 👍

@RossComputerGuy
Copy link
Author

It segfaults 😿

@RossComputerGuy
Copy link
Author

RossComputerGuy commented Aug 22, 2024

get_soc seems to be borked.

0x0000000000418a68 in get_soc (cpu=0x4482d0) at src/arm/soc.c:1144
1144	    if(soc->soc_vendor == SOC_VENDOR_UNKNOWN) {
(gdb) p soc
$1 = (struct system_on_chip *) 0x0

@RossComputerGuy
Copy link
Author

Seems read_file might've borked it:

Run till exit from #0  read_file (path=0x41ac10 "/proc/device-tree/compatible", len=0xffffffffc1bc) at src/common/udev.c:50
0x0000000000404588 in get_devtree_compatible () at src/common/udev.c:360
360	  if ((buf = read_file(_PATH_DEVTREE, &filelen)) == NULL) {
Value returned is $4 = 0x4574b0 "apple,j314s"

@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 22, 2024

My bad! I have pushed a fix, what about now?

@RossComputerGuy
Copy link
Author

Yeah, that works.
image

@RossComputerGuy
Copy link
Author

Breakpoint 1, guess_soc_from_devtree (soc=0x455060) at src/arm/soc.c:917
917	struct system_on_chip* guess_soc_from_devtree(struct system_on_chip* soc) {
(gdb) step
918	  char* dt = get_devtree_compatible();
(gdb)
get_devtree_compatible () at src/common/udev.c:356
356	char* get_devtree_compatible(void) {
(gdb)
360	  if ((buf = read_file(_PATH_DEVTREE, &filelen)) == NULL) {
(gdb)
read_file (path=0x41ac18 "/proc/device-tree/compatible", len=0xffffffffc1bc) at src/common/udev.c:50
50	char* read_file(char* path, int* len) {
(gdb) finish
Run till exit from #0  read_file (path=0x41ac18 "/proc/device-tree/compatible", len=0xffffffffc1bc) at src/common/udev.c:50
0x0000000000404588 in get_devtree_compatible () at src/common/udev.c:360
360	  if ((buf = read_file(_PATH_DEVTREE, &filelen)) == NULL) {
Value returned is $1 = 0x4574b0 "apple,j314s"
(gdb) step
364	  return buf;

Seems read_file still isn't pulling the entire string.

@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 22, 2024

Yeah, I was not careful with the NULL characters in the file. New patch, can you try again?

@RossComputerGuy
Copy link
Author

Sweet, that works now.
image

@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 23, 2024

t6000 is the code name of Apple Silicon SOC. You can find the detail here: https://github.com/AsahiLinux/docs/wiki/Codenames

Fastfetch uses:

switch (code)
{
    case 8103: return "Apple M1";
    case 6000: return "Apple M1 Pro";
    case 6001: return "Apple M1 Max";
    case 6002: return "Apple M1 Ultra";
    case 8112: return "Apple M2";
    case 6020: return "Apple M2 Pro";
    case 6021: return "Apple M2 Max";
    case 6022: return "Apple M2 Ultra";
    case 8122: return "Apple M3";
    case 6030: return "Apple M3 Pro";
    case 6031:
    case 6034: return "Apple M3 Max";
    default: return "Apple Silicon";
}

Thanks, this is very useful. I have incorporated a similar (but less efficient) approach. Fastfetch is indeed a nice project! 👌

@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 23, 2024

Sweet, that works now. image

Awesome! I have merged this into master now. Thank you for your feedback and feel free to report more issues if you find any unsupported device around. It helps a lot 👍

@Dr-Noob Dr-Noob closed this as completed Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants