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

Port to Motorola G5 Plus (potter) [second attempt] #159

Closed
wants to merge 4 commits into from

Conversation

telent
Copy link
Contributor

@telent telent commented Jun 3, 2020

This is #147 but with greater purpose and less meandering around. Or at least, more verbose commit messages.

What works:

  • boots
  • framebuffer
  • adb over usb
  • finds stage 2 image on external SD card
  • the power button performs an orderly shutdown

What doesn't work:

  • illuminating the "charging" led :-(
  • wireless lan (seems to be wcnss)

Untested:

  • anything I haven't mentioned

It's the same SoC and a lot of the same hardware. Surprisingly enough
the kernel even boots, though without USB, so there's not a lot you
can actually do with it
* kernel-msm/arch/arm/configs/ext_config/mot8953-potter.config in
https://github.com/MotorolaMobilityLLC/kernel-msm/ checkout tag
MMI-NPN25.137-67

* and /proc/config.gz extracted from a running device with OmniROM
9-20191013
This is needed to make mobile-nixos notice that an external SD card is
present.  Looking at the device tree sources for various msm8953
devices, it seems to be pretty much a 50/50 chance whether the card
detect pin is active high or low.  Of course that *might*
just mean it's broken on half of all phones

See also https://lore.kernel.org/patchwork/patch/615679/ - clearly I
amn not the only person who finds this confusing
@telent
Copy link
Contributor Author

telent commented Jun 3, 2020

From the previous PR:

Oopsie, it's possible the LED thing can't work.

It uses leds-atc, which for addison will not work as expected. First, the driver needs to be tweaked to allow setting an initial state (trivial enough). Though, once done, it works, but something resets the state of the LED hardware-wise just after it lights-up at boot.

The thing that resets it doesn't notify the kernel; the kernel still thinks it's turned on if you try and read information in the /sys fs.

You may want to try applying that commit and see if it works for your device, but I guess chances are low.

I tried and ... no, your supposition is correct. The light flashes on very briefly , then off, and I have the same behaviour in sysfs too

telent@be270ad

bash-4.4# cd /sys/class/leds/charging
bash-4.4# ls
brightness  device  max_brightness  power  subsystem  trigger  uevent
bash-4.4# cat brightness
3
bash-4.4# cat max_brightness
3

Maybe it's worth trying with a timer or heartbeat trigger that would reinitialize the led state even after the mystery guest has extinguished it?

mobile.usb = {
# Dan is not sure what this is for, given that it seems to be
# set to the Nexus 4 id on a variety of other devices which aren't that
mode = "android_usb";
Copy link
Member

Choose a reason for hiding this comment

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

android_usb is for the "legacy" android-specific USB gadget mode. Newer devices use the mainline-derived gadgetfs subsystem of the kernel.

Comment on lines +51 to +52
idVendor = "18D1";
idProduct = "4EE7";
Copy link
Member

Choose a reason for hiding this comment

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

In reality, it could be anything. though I figure it's good to use the proper identifier for the device. The main issue I can see is that on some platforms (e.g. windows) it may be easier to fake it and re-use a common well-known identifier. In the end, AFAICT, this is only an identifier though.

With that said, using the appropriate identifiers is better. I guess you can remove the previous comments :).

@samueldr
Copy link
Member

samueldr commented Jun 3, 2020

If you end up wanting to implement the quirk that sets default-on during stage-1, this is most likely the best starting point:

Something like qualcomm/leds-atc.nix for the filename, and not sure about the exact option name, but involving leds-atc too.

@samueldr samueldr added the 4. type: port New device port label Jun 12, 2020
@samueldr
Copy link
Member

(Closing in favour of #359)

@samueldr samueldr closed this May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4. type: port New device port
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants