2020-03-11 23:52:37 +03:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
2020-10-07 04:27:01 +03:00
|
|
|
mobile.device.name = "pine64-pinephone";
|
2020-05-24 00:27:57 +03:00
|
|
|
mobile.device.identity = {
|
2020-10-07 04:27:01 +03:00
|
|
|
name = "PinePhone";
|
2020-03-11 23:52:37 +03:00
|
|
|
manufacturer = "Pine64";
|
2020-05-24 00:27:57 +03:00
|
|
|
};
|
2020-03-11 23:52:37 +03:00
|
|
|
|
|
|
|
mobile.hardware = {
|
|
|
|
soc = "allwinner-a64";
|
|
|
|
ram = 1024 * 2;
|
|
|
|
screen = {
|
|
|
|
width = 720; height = 1440;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-25 01:39:33 +03:00
|
|
|
mobile.boot.stage-1 = {
|
2020-10-03 02:47:47 +03:00
|
|
|
kernel.package = pkgs.callPackage ./kernel { };
|
2020-05-25 01:39:33 +03:00
|
|
|
};
|
|
|
|
|
2020-05-24 01:14:10 +03:00
|
|
|
boot.kernelParams = [
|
2020-05-24 09:44:39 +03:00
|
|
|
# Serial console on ttyS0, using the serial headphone adapter.
|
2020-05-24 01:14:10 +03:00
|
|
|
"console=ttyS0,115200"
|
|
|
|
"vt.global_cursor_default=0"
|
|
|
|
"earlycon=uart,mmio32,0x01c28000"
|
|
|
|
"panic=10"
|
|
|
|
"consoleblank=0"
|
|
|
|
];
|
|
|
|
|
2020-03-11 23:52:37 +03:00
|
|
|
mobile.system.type = "u-boot";
|
2020-06-12 02:11:17 +03:00
|
|
|
|
|
|
|
mobile.device.firmware = pkgs.callPackage ./firmware {};
|
|
|
|
|
2020-03-11 23:52:37 +03:00
|
|
|
mobile.quirks.u-boot.package = pkgs.callPackage ./u-boot {};
|
2020-03-28 08:36:22 +03:00
|
|
|
mobile.quirks.u-boot.additionalCommands = ''
|
|
|
|
# Yellow LED.
|
2020-03-28 08:36:59 +03:00
|
|
|
gpio set 115 # R
|
|
|
|
gpio set 114 # G
|
2020-03-28 08:36:22 +03:00
|
|
|
gpio clear 116 # B
|
2020-07-20 03:11:37 +03:00
|
|
|
|
|
|
|
# Properly shut off EG25 by pulling up PWRKEY.
|
|
|
|
gpio set 35
|
|
|
|
sleep 1
|
|
|
|
gpio clear 35
|
2020-03-28 08:36:22 +03:00
|
|
|
'';
|
2020-03-11 23:52:37 +03:00
|
|
|
}
|