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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

device: Add pine64-pinetab #331

Merged
merged 2 commits into from Apr 29, 2021
Merged

Conversation

zhaofengli
Copy link
Member

@zhaofengli zhaofengli commented Mar 8, 2021

A straightforward port for the PineTab Early Adopter Edition, a hybrid tablet device with hardware very similar to that of PinePhone. The main differences are:

  • There is no cellular modem 馃槩
  • The display panel is Feixin IM2BYL02 (CONFIG_DRM_PANEL_ILITEK_ILI9881C)
  • The touchpad requires CONFIG_HID_MULTITOUCH

We probably need to make a family for the common configurations - Any idea of what the name should be?

pinetab-nixos

Status

Working:

  • Booting
  • Display
  • Touchscreen
  • Wi-Fi
  • Detachable Keyboard
  • Audio (speakers, headphone jack, headphone jack detection)
  • Bluetooth
  • HDMI output
  • Accelerometer

Untested:

  • Anything else

Notes

  • This configuration is for the Early Adopter Edition, with the IM2BYL02 display panel. A separate device tree is required for display to work on early developer units with IM2BA02.

devices/pine64-pinetab/README.adoc Outdated Show resolved Hide resolved
Comment on lines +65 to +67
# pinephone: Add volume_key environment variable
# https://gitlab.com/pine64-org/u-boot/-/commit/2ce71f93c215bf87a9a64a93c3b2c28a86158e5b
(pine64Patch "2ce71f93c215bf87a9a64a93c3b2c28a86158e5b" "1x5p0p6zyd4y7yigyikhlwhrywqmd0kpkdnb38583svqzadbr9gw")
Copy link
Member

Choose a reason for hiding this comment

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

Does this work for the PineTab too?

You will need to use the serial adapter, cancel the boot, and check the u-boot environment variable volume_key.

It would be useful to know, as I plan to make use of this in the future with the Pinephone boot setup. The Pinetab would, too, benefit from it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, I confirm that it does work:

U-Boot SPL 2021.01 (Jan 11 2021 - 18:11:43 +0000)
DRAM: 2048 MiB
Trying to boot from MMC2
NOTICE:  BL31: v2.4(release):
NOTICE:  BL31: Built : 00:00:00, Jan  1 1980
NOTICE:  BL31: Detected Allwinner A64/H64/R18 SoC (1689)
NOTICE:  BL31: Found U-Boot DTB at 0x208abb8, model: PineTab
NOTICE:  PSCI: System suspend is available via SCPI


U-Boot 2021.01 (Jan 11 2021 - 18:11:43 +0000) Allwinner Technology

CPU:   Allwinner A64 (SUN50I)
Model: PineTab
DRAM:  2 GiB
MMC:   mmc@1c0f000: 0, mmc@1c10000: 2, mmc@1c11000: 1
Loading Environment from FAT... Unable to use mmc 1:3... In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
starting USB...
No working controllers found
Hit any key to stop autoboot:  0 
=> printenv volume_key
volume_key=up

devices/pine64-pinetab/README.adoc Outdated Show resolved Hide resolved
@samueldr
Copy link
Member

samueldr commented Mar 9, 2021

Hi! 馃憢

Thanks for the contribution. It's nice to see a port from other people!

I left some things to change, and things to look at.

I'll have to take another look, but I'm tempted to merge this, at the moment. Though it would be nice to work together (through a github issue or PR I guess) to prepare shared components. It would be much better to have a single kernel image, maybe a single u-boot image, but that may be harder.

All of this is made harder by the fact that we don't have a family implemented yet, I don't exactly know what it should look like.

Anyway, with my first look it looks okay.

zhaofengli added a commit to zhaofengli/mobile-nixos that referenced this pull request Mar 9, 2021
@zhaofengli
Copy link
Member Author

Yeah, there are substantial shared parts in the configurations of the two devices, and I'm down to working together to create a family. I was a bit confused by the documentation that refers to the google-wahoo family as no family seems to exist at the moment 馃槢

@samueldr
Copy link
Member

samueldr commented Mar 9, 2021

Yeah, this is an example of a "family" that is known to exist in the wild, but it's not part of the project yet.

@zhaofengli
Copy link
Member Author

zhaofengli commented Mar 10, 2021

Updated the PR to include support for audio, bluetooth, HDMI output as well as accelerometer. Some notes:

  • Device tree patches are required for all of above, as the corresponding nodes are missing.
  • The UCM files are added by changing environment.variables and pulseaudio's environment, to avoid mass rebuilds of packages depending on alsaLib.
  • Hardware RNG and hash capabilities are also enabled (CONFIG_CRYPTO_DEV_SUN8I_CE_{HASH,PRNG,TRNG}). They should be enabled in PinePhone's kernel configurations as well.

@Artturin
Copy link
Member

im testing other pinephone distros kernel configs. i'll enable those options when i make a pr

@zhaofengli
Copy link
Member Author

PR updated to include origin of the UCM files (#337 (comment)).

@samueldr
Copy link
Member

samueldr commented Mar 22, 2021

@zhaofengli is it too much to ask to try and apply the changes from #340 with the target-disk-mode image, or any other configuration that makes use of USB gadget mode with the pinetab?

I would really prefer that, going forward, all devices added has working and tested gadget mode. The vague plans I have for an installer would rely on gadget mode being available.

@zhaofengli
Copy link
Member Author

zhaofengli commented Mar 24, 2021

Hi sorry, didn't get to try that out until now. I have enabled CONFIG_USB_MUSB_DUAL_ROLE in the kernel and also adbd in the device config. adbd itself seems to be running, but the device does not get discovered at all when connected to another machine.

Digging deeper revealed that at the final step of the initialization process, attaching to the USB driver failed:

[root@serotina:/sys/kernel/config/usb_gadget/g1]# ls /sys/class/udc
musb-hdrc.4.auto

[root@serotina:/sys/kernel/config/usb_gadget/g1]# echo musb-hdrc.4.auto > /sys/kernel/config/usb_gadget/g1/UDC
-bash: echo: write error: No such device

I have also tried setting up the other modes (rndis, mass storage) manually with the same results.

@samueldr
Copy link
Member

samueldr commented Mar 24, 2021

Thanks for looking! No worries about the time it took.

Oh, interesting. I sincerely would not have expected it to differ for gadget mode.

Let's not block this PR on that, and investigate more at a later point.

(I'll try merging the misc. Pine hardware PRs by the end of this week-end)

@zhaofengli
Copy link
Member Author

I would expect it to work the same as well, as the configurations used for Jumpdrive seem to be identical.

@Artturin
Copy link
Member

Add CHASSIS=tablet to /etc/machine-info

@samueldr
Copy link
Member

@Artturin we should provide a standard interface rather than doing it for each device... Out of scope of this PR, but yes it would be nice.

@Artturin
Copy link
Member

Artturin commented Mar 24, 2021

Perhaps


chassis = "handheld";
Or type.handheld or phone = true

@samueldr
Copy link
Member

Yeah, something along the line, or formFactor and an enum... (I don't really find chassis fits here, chassis was the wording chosen for "desktop" vs. "laptop" vs. "server".) Still out of scope of this one :)

@samueldr
Copy link
Member

Thank you very much for the contribution!

Sorry it took over a month to merge once basically known to be good!

@samueldr samueldr merged commit 8155461 into NixOS:master Apr 29, 2021
@zhaofengli zhaofengli deleted the pine64-pinetab branch April 29, 2021 20:37
wentam pushed a commit to wentam/mobile-nixos that referenced this pull request Oct 1, 2022
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.

None yet

3 participants