1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-17 13:10:29 +03:00
Commit Graph

11 Commits

Author SHA1 Message Date
Samuel Dionne-Riel
a96c2b845c boot/init: Add support for FunctionFS on GadgetFS
FunctionFS on GadgetFS requires this to happen in order:

 - (1) preparing the gadget
 - (2) preparing the function
 - (3) mounting the functionfs
 - (4) starting the daemon
 - (5) enabling the device

Doing any of these steps in the wrong order *will* fail. You cannot
mount functionfs if the function name hasn't been allocated yet. You
cannot start the daemon without functionfs being mounted. You cannot
enable the device without the daemon running on the USB endpoints.

This is why the GadgetFS stuff here *has* to know about mounting the
filesystem and starting the daemon.

In fact, the generic library to be written to handle USB gadget mode
**will** have to have that knowledge!

The added TODOs are to be done when extracting as a standalone library.
2021-01-27 22:16:55 -05:00
Samuel Dionne-Riel
179d8b1b70 stage-1/usb-gadget: Add mass storage usb gadget support 2021-01-03 23:08:24 -05:00
Samuel Dionne-Riel
61c6776cb8 stage-1/usb-gadget: Quirk is aware of its path
This will be used for quirks that needs to know where to write more
configuration.
2021-01-03 23:08:24 -05:00
Samuel Dionne-Riel
10c1ccece2 stage-1/usb-gadget: Implement gadgetfs teardown
This way on kexec the device is in a better state, and the kernel that
boots next is able to use the controller.

This was verified to fix an issue with kexec+gadget on the Chuwi Hi10
Pro HQ64 tablet.
2021-01-03 20:23:44 -05:00
Samuel Dionne-Riel
53413080cc initrd-usb: Follow AOSP init order more closely
This is part of what may be required to fix ADB on google-marlin.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
4289996f3c initrd: System.write for USB gadget tasks 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
8d3833691b initrd: Setup ffs aliases before mounting functionfs
It turns out to be required for some devices.

Namely, google-marlin.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
74a1a190ca initrd-usb: Force device to declare mode
The detection cannot be done reliably. Some android_usb devices
(motorola-addison) have gadgetfs available, while some gadgetfs devices
will have the android_usb path available.

Anyway, this is probably better to explicitly declare the mode to use.
2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
57a18403bd initrd-usb: Implement android_usb gadget in task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
c4ec0480fd initrd-network: Port to a boot/init task 2020-02-03 16:19:10 -05:00
Samuel Dionne-Riel
50a04bd651 initrd-usb: Implement gadgetfs usb gadget
This has only been tested with google-walleye, with gsi.rndis.
2020-02-03 16:19:10 -05:00