1
1
mirror of https://github.com/NixOS/mobile-nixos.git synced 2024-12-16 20:21:32 +03:00
mobile-nixos/devices/pine64-pinephone
Samuel Dionne-Riel 59ac9d428c pine64-pinephone: Re-use known working usb id/vendor IDs
Otherwise `adb shell` will not work as expected.

Many phones end up using these identifiers in recoveries (non-official
recoveries mainly) because they are likely to work with ADB, even older
ADB releases.

This sucks, it would be better to have a *proper* USB identifier pair,
but since there is none, let's use one that is known to make the
end-user's life easier.

It's not like the previous identifiers were objectively better.
2021-03-21 00:09:01 -04:00
..
firmware pinephone-braveheart: Generalize Pinephone devices 2020-10-06 21:27:01 -04:00
kernel pine64-pinephone: Fix kernel config for gadget mode 2021-03-20 23:51:40 -04:00
overlay Fix stdenv.lib being removed 2021-02-02 05:51:18 -05:00
u-boot pine64-pinephone: u-boot: 2020.07 -> 2021.01 2021-01-12 23:59:49 -05:00
default.nix pine64-pinephone: Re-use known working usb id/vendor IDs 2021-03-21 00:09:01 -04:00
modem.nix pine64-pinephone: Add service to control the modem 2020-10-18 16:30:24 -04:00
README.adoc pinephone: Update boot partition name in README 2021-03-02 19:49:34 +01:00

= PinePhone
include::_support/common.inc[]

== Device-specific notes

=== Building a full disk image

This platform uses the `u-boot` system-type. This means that a full disk image
can be produced, and this full disk image flashed _outright_ to the block
device. That block device can be the internal eMMC or the SD card.

The PinePhone will boot from SD card if a bootloader can be found. This means
that the full disk image can be flashed to an SD card, and it will prioritise
booting it.

```
 $ nix-build --argstr device pine64-pinephone -A build.disk-image
 $ dd if=result of=/dev/mmcblkX bs=8M oflag=sync,direct status=progress
```

=== Building the boot partition

Building the full disk image may require a native AArch64 system.

The boot partition can be built, and then flashed on top of an existing Mobile
NixOS boot partition.

```
 $ nix-build --argstr device pine64-pinephone -A build.boot-partition
 $ dd if=result/mobile-nixos-boot.img of=/dev/mmcblkXp3 bs=8M oflag=sync,direct status=progress
```

=== Building U-Boot

Flashing the boot partition will not affect the installed U-Boot bootloader.

U-Boot can be built and then flashed the usual way for Allwinner platforms.

```
 $ nix-build --argstr device pine64-pinephone -A build.u-boot
 $ dd if=result/u-boot-sunxi-with-spl.bin of=/dev/mmcblkX bs=1024 seek=8
```

=== Usage notes

==== LED

In the default setup, the LED has been configured to show status information.
Its colour or pattern can be used to infer the status.

During boot:

 * Red as early as possible in our U-Boot build
 * Yellow when our U-Boot "boot script" ran
 * Green by the kernel whenever it sets it up

At any time:

 * The red LED will flash on panic

As it does not reset the other LED colours, it may flash green/yellow rather
than off/red. If applications customize the LED status, it may flash in other
patterns involving red.