NixOS on ARM/PINE A64-LTS: Difference between revisions
imported>Samueldr m Reviews compatibility notes section |
m Dark mode support |
||
(15 intermediate revisions by 3 users not shown) | |||
Line 19: | Line 19: | ||
|- | |- | ||
!Maintainer | !Maintainer | ||
| | | | ||
|} | |} | ||
</div> | </div> | ||
Line 27: | Line 27: | ||
It can boot from SD or from an eMMC. | It can boot from SD or from an eMMC. | ||
== Status == | == Status == | ||
Line 34: | Line 32: | ||
Upstream NixOS AArch64 image boots on the PINE A64-LTS, using the proper upstream U-Boot. | Upstream NixOS AArch64 image boots on the PINE A64-LTS, using the proper upstream U-Boot. | ||
U-boot support [https://github.com/NixOS/nixpkgs/pull/32553#issuecomment-373915787 has been added 2018-03-18]. The bootloader with SPL can be downloaded from | U-boot support [https://github.com/NixOS/nixpkgs/pull/32553#issuecomment-373915787 has been added 2018-03-18]. The bootloader with SPL can be downloaded from this location: | ||
* [https://hydra.nixos.org/job/nixpkgs/trunk/ubootPine64LTS.aarch64-linux Nixpkgs unstable builds on hydra.] | |||
* [https://hydra.nixos.org/job/nixpkgs/trunk/ | |||
== | == Installation instructions == | ||
{{ARM/installation allwinner|variant=aarch64}} | |||
U-Boot | Flashing U-Boot to the SD card can be skipped if it is installed to the [[#SPI_NOR_flash|SPI NOR flash]] | ||
< | These instructions can also be followed for installation on the eMMC module. A compatible eMMC writer may be required to flash the eMMC. If you do not have one available, it is possible to boot another operating system on the A64-LTS and from there <code>dd</code> to the eMMC. | ||
Then, | Then, continue installation using the [[NixOS_on_ARM#NixOS_installation_.26_configuration|installation and configuration steps]]. | ||
== Serial console== | == Serial console== | ||
{ | Follows a simplified drawing of the edge of the Pine A64-LTS, with two locations to tap for serial.<ref>http://wiki.pine64.org/index.php/PINE_A64-LTS/SOPine_Main_Page#PINE_A64-LTS_Board_Features</ref><ref>http://files.pine64.org/doc/Pine%20A64%20Schematic/Pine%20A64%20Pin%20Assignment%20160119.pdf</ref> | ||
[[File:Pine-A64-LTS_partial-pinout.png|frameless|860px]] | |||
{| class="table" | |||
|- | |||
!colspan="2" style="background: var(--color-inverted)"| EXP Connector | |||
|- | |||
! Pin | |||
! Function | |||
|- | |||
| 7 | |||
| UART0_TX | |||
|- | |||
| 8 | |||
| UART0_RX | |||
|- | |||
| 9 | |||
| GND | |||
|- | |||
!colspan="2" style="background: var(--color-inverted)"| Euler "e" Connector | |||
|- | |||
! Pin | |||
! Function | |||
|- | |||
| 29 | |||
| UART0_TX | |||
|- | |||
| 30 | |||
| UART0_RX | |||
|- | |||
| 33 | |||
| GND | |||
|} | |||
== Compatibility notes == | == Compatibility notes == | ||
{| class="table arm-compatibility" | {| class="table arm-compatibility" | ||
| | !colspan="2" style="background: var(--color-inverted)"| Mainline kernel | ||
|- | |- | ||
! Ethernet | ! Ethernet | ||
| | | | ||
* Up to and including 4.19, ethernet seems to have troubles. The interface is detected but does not work right. | |||
* Verified only starting with 4.20 (rc4 tested), ethernet seems to work sometimes. It may fail with <code>dmesg</code> messages like <code>dwmac-sun8i 1c30000.ethernet eth0: Could not attach to PHY</code> and <code>dwmac-sun8i 1c30000.ethernet eth0: stmmac_open: Cannot attach to PHY (error: -19)</code>. | |||
|- | |- | ||
! HDMI | ! HDMI | ||
| | | | ||
* Starting with 4.20 (rc4 tested), HDMI output works. | |||
* Up to and including 4.19, HDMI output does not work. | |||
|} | |} | ||
Line 118: | Line 150: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Clusterboard Ethernet === | |||
It appears that Ethernet with the [https://www.pine64.org/clusterboard/ pine64 clusterboard] requires [https://forum.pine64.org/showthread.php?tid=10432 a slightly modified device tree to work]. There's some conflicting information about exactly what is needed to get Ethernet working but currently, mainline linux (5.4.58 at the time of testing) plus a modified device tree is sufficient to get a full speed 1gbps connection. | |||
First create the device tree overlay. | |||
<pre> | |||
/* sopine-baseboard-ethernet.dts */ | |||
/dts-v1/; | |||
/ { | |||
model = "SoPine with baseboard"; | |||
compatible = "pine64,sopine-baseboard\0pine64,sopine\0allwinner,sun50i-a64"; | |||
fragment@0 { | |||
target-path = "/soc/ethernet@1c30000"; | |||
__overlay__ { | |||
allwinner,tx-delay-ps = <500>; | |||
}; | |||
}; | |||
}; | |||
</pre> | |||
Create the device tree binary from that. | |||
<pre> | |||
dtc -O dtb -o sopine-baseboard-ethernet.dtbo -b 0 sopine-baseboard-ethernet.dts | |||
</pre> | |||
And add it to your configuration.nix | |||
<pre> | |||
... | |||
hardware.deviceTree.enable = true; | |||
hardware.deviceTree.overlays = [ | |||
"${/path/to/sopine-baseboard-ethernet.dtbo}" | |||
]; | |||
... | |||
</pre> | |||
== SPI NOR flash == | == SPI NOR flash == | ||
Line 155: | Line 222: | ||
{{note|Once a valid bootloader is on the SPI NOR flash, FEL mode will not be entered automatically. [http://linux-sunxi.org/FEL Follow instructions of the FEL page of the linux-sunxi wiki] for alternative ways to enter FEL mode.}} | {{note|Once a valid bootloader is on the SPI NOR flash, FEL mode will not be entered automatically. [http://linux-sunxi.org/FEL Follow instructions of the FEL page of the linux-sunxi wiki] for alternative ways to enter FEL mode.}} | ||
== Flashing from U-Boot == | === Flashing from U-Boot === | ||
{{outdated|Mainline U-Boot can now be used, since the <tt>sf</tt> command and support for the SPI NOR flash has been added}} | |||
It is possible, through using a U-Boot bootloader built from the u-boot-sunxi tree, to write to the SPI NOR flash. The [https://github.com/ayufan-pine64/bootloader-build ayufan-pine64/bootloader-build] has such a build. Using the released <code>.img</code> files, it is possible to write their custom build or erase their custom build. From their custom build, it is possible to write to the SPI NOR flash using the <code>sf</code> command<ref>https://github.com/ayufan-pine64/bootloader-build/blob/d7e891cbee8a559ea50cf25ee18aa9d7b4ea9d58/blobs/flash-spi.cmd#L11-L13</ref>. | It is possible, through using a U-Boot bootloader built from the u-boot-sunxi tree, to write to the SPI NOR flash. The [https://github.com/ayufan-pine64/bootloader-build ayufan-pine64/bootloader-build] has such a build. Using the released <code>.img</code> files, it is possible to write their custom build or erase their custom build. From their custom build, it is possible to write to the SPI NOR flash using the <code>sf</code> command<ref>https://github.com/ayufan-pine64/bootloader-build/blob/d7e891cbee8a559ea50cf25ee18aa9d7b4ea9d58/blobs/flash-spi.cmd#L11-L13</ref>. | ||
Line 183: | Line 252: | ||
* [https://www.pine64.org/?page_id=46823 Official product page] | * [https://www.pine64.org/?page_id=46823 Official product page] | ||