Skip to content

Initial addition for Pine64 devices #52

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

Merged
merged 11 commits into from
Jan 9, 2020
Merged

Conversation

yeyeto2788
Copy link
Contributor

I will need the output of the /proc/cpuinfo and the /proc/device-tree/model for a better implementation.

@yeyeto2788
Copy link
Contributor Author

Output of the latest changes working on the Pinebook running Armbian:

linuxuser@pinebook:~/GitHub/Adafruit_Python_PlatformDetect$ python3 Python 3.5.2 (default, Oct  8 2019, 13:06:37) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. 
>>> import adafruit_platformdetect 
>>> detector = adafruit_platformdetect.Detector() 
>>> detector.chip.id 
'PINE64' 
>>> detector.board.id 
'PINEBOOK'

@ladyada
Copy link
Member

ladyada commented Jan 7, 2020

hi the chip should be the A64 right? there is no chip called 'pine64'?
https://linux-sunxi.org/A64

@makermelissa
Copy link
Collaborator

Yes, that's correct. The Original Pine64 was actually called the Pine A64.

@yeyeto2788
Copy link
Contributor Author

Yeap, the chip is the AllWinner A64, if you want I can make the change reflecting it. I'll also test the new implementation on other OS.

Shouldn't we detect the board and chip based on OS? I ask this because there is already a method for getting the BOARD variable from armbian and it is only used by orange pi boards.

Regards.

@ladyada
Copy link
Member

ladyada commented Jan 7, 2020

no, the chip is set by the hardware - whatever is printed on the microcontroller, it is independant completely from the OS :)

@yeyeto2788
Copy link
Contributor Author

Got it! :P thanks for the clarification. I'll make the changes tomorrow so you guys will have it to review first time in your morning (different working hours)

@ladyada
Copy link
Member

ladyada commented Jan 7, 2020

all good, thank you for working with us :)

@yeyeto2788
Copy link
Contributor Author

My pleasure @ladyada, I'll upload the result once I get home and test it on the PineBook itself.

After finishing this PR would be great if you or @makermelissa can point me out to the right direction on adding the support on adafruit/Adafruit_Blinka#118 and adding also the Onion Omega board on it (don't want to start making changes out of the blue without a prior guidance 😛 ).

Also, @makermelissa can you please test this on your Pine64 board and share the /proc/cpuinfo file content so I can adapt the code accordingly?

Regards.

@makermelissa
Copy link
Collaborator

Hi, I'll try to get the /proc/cpuinfo to you today sometime.

@yeyeto2788
Copy link
Contributor Author

@makermelissa, no problem. I have tested the new changes just now on the PineBook and this is the result:

linuxuser@pinebook:~/GitHub/Adafruit_Python_PlatformDetect$ python3
Python 3.5.2 (default, Oct  8 2019, 13:06:37) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import adafruit_platformdetect
>>> detector = adafruit_platformdetect.Detector()
>>> detector.board.id
'PINEBOOK'
>>> detector.chip.id
'A64'
>>> 

In yours it should be working also, but by any chance is not and you want me to change something, let me know.

@makermelissa
Copy link
Collaborator

Sounds good!

@makermelissa
Copy link
Collaborator

Looks like I accidentally overwrote my Pine64 SD Card with another image, so I'm needing to reset it back up.

@yeyeto2788
Copy link
Contributor Author

No problem, if you want you can also test it with that distro.

There might be something we can add to support the detection on that OS

@makermelissa
Copy link
Collaborator

Oh, I meant I overwrote it with Ubuntu for the Raspberry Pi while testing another PR. Armbian is the preferred one since we've had really good luck with it.

Copy link
Collaborator

@makermelissa makermelissa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Here's my test results:
pi@pine64:~$ python3 detect.py
Chip id: A64
Board id: PINE64
Is this a DragonBoard 410c? False
Is this a Pi 3B+? False
Is this a Pi 4B? False
Is this a 40-pin Raspberry Pi? False
Is this a Raspberry Pi Compute Module? False
Is this a BBB? False
Is this a Giant Board? False
Is this a Coral Edge TPU? False
Is this a SiFive Unleashed? False
Is this an embedded Linux system? True
Is this a generic Linux PC? False
Is this an OS environment variable special case? False
Pine64 device detected.

@makermelissa makermelissa merged commit 18c9682 into adafruit:master Jan 9, 2020
@lucapinello
Copy link

Hi thanks for adding the support to the Pine64!

This doesn't work for me in my machine I see this for cat /proc/cpuinfo :
Processor : AArch64 Processor rev 4 (aarch64)
processor : 0
processor : 1
processor : 2
processor : 3
Features : fp asimd aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : Pine64+

and cat /proc/device-tree/model

Pine64+

Maybe is it the + at the end?

Thanks!

@makermelissa
Copy link
Collaborator

What do you get for cat /proc/device-tree/compatible?

@lucapinello
Copy link

Thanks for the quick reply!

cat /proc/device-tree/compatible
pine64,pine64-plus

@makermelissa
Copy link
Collaborator

Is that the full string? The one on my board was pine64,pine64-plusallwinner,sun50i-a64.

If so, it seems they may have removed the processor from the string, which is causing the chip to not be detected and the board value isn't even checked at that point. That could present problem because of other boards having similar strings.

@lucapinello
Copy link

lucapinello commented Jan 18, 2021 via email

@makermelissa
Copy link
Collaborator

Ok, created a new issue at #133. Please make any new comments regarding this issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants