NixOS on ARM/Firefly AIO-3399C: Difference between revisions

imported>Samueldr
m Removes unnecessary spaces
imported>Makefu
add documentation even though nothing works yet :)
Line 4: Line 4:
!colspan="2" class="title"|Firefly AIO-3399C
!colspan="2" class="title"|Firefly AIO-3399C
|-
|-
|colspan="2"|[[File:Firefly_AIO-3399C.png|frameless|256px|A Firefly AIO-3399C with eMMC.]]
|colspan="2"|[[File:Firefly_AIO-3399C.png|frameless|256px|A Firefly AIO-3399C attached to LVDS]]
|-
|-
!Manufacturer
!Manufacturer
Line 16: Line 16:
|-
|-
!Boot order
!Boot order
| eMMC,SD
| official: eMMC
|-
|-
!Maintainer
!Maintainer
Line 24: Line 24:
== Status ==
== Status ==


It can boot the image provided by firefly on [http://www.t-firefly.com/doc/download/54.html the chinese download page], click on '''Ubuntu (GPT)'''. You will need a pan.baidu.com account.
It can boot the image provided by firefly on [http://www.t-firefly.com/doc/download/54.html the chinese download page], click on '''Ubuntu (GPT)'''. The image has also been uploaded to [https://archive.org/details/AIO-33399C archive.org].


The official documentation, which is a pretty good state, can be found at [http://wiki.t-firefly.com/en/AIO-3399C/ the wiki of firefly]
The official documentation, which is a pretty good state, can be found at [http://wiki.t-firefly.com/en/AIO-3399C/ the wiki of firefly]. However as of right now i was unable to:
 
* build an nixos image which can be booted as root image from the emmc (root image must be build as "android" boot)
* build an sd-image with a kernel which detects the card at stage one with NixOS (cannot find rootfs)
* build the the bootloader with NixOS (blobs and trustedboot comes from rockchip)


== Board-specific installation notes ==
== Board-specific installation notes ==


== Serial console==
== Serial console==
On the board there are 3 pins which have a 2.54mm pitch, this is the debug console with the text DEBUG on it. Starting from the middle to the side of the board:
* GND (Black Wire)
* RX (White Wire)
* TX (Green Wire)
* VCC, only the silver trace point and not a pin
Baud rate is <code>1500000</code>
Connect to it via:
<syntaxHighlight lang=bash>
nix-shell -p picocom --run "picocom -b 1500000 /dev/ttyUSB0"
</syntaxHighlight>


When you build your own image, you need the following extra kernel command-line parameters to get serial output:
<syntaxHighlight lang=nix>
{
  boot.kernelParams = ["console=ttyS2,1500000n8" "earlycon=uart8250,mmio32,0xff1a0000" "earlyprintk"];
}
</syntaxHighlight>
== Compatibility notes ==
== Compatibility notes ==
See the [http://opensource.rock-chips.com/wiki_Status_Matrix Rockchip compatibility matrix]. Uboot requires the Rockchip Miniloader and an arm trusted boot image.


=== Downstream kernel ===
=== Downstream kernel ===
The downstream kernel sources can be found on github at [https://github.com/FireflyTeam/kernel]. The stable kernel branch they are maintaining is <code>4.4</code>, however mainline 4.19 should already work according to the [http://opensource.rock-chips.com/wiki_Status_Matrix Rockchip compatibility matrix].
=== u-boot ===
Firefly maintains an own u-boot fork at [https://github.com/FireflyTeam/u-boot]


=== Flashing via Rockchip Loader Mode ===
=== Flashing via Rockchip Loader Mode ===
Line 47: Line 75:


==== Firefly upgrade_tool ====
==== Firefly upgrade_tool ====
Firefly provides an <code>upgrade_tool</code> which is a modified [http://opensource.rock-chips.com/wiki_Upgradetool rock-chip upgrade tool]. Using the upstream tool however may result in weird errors like being unable to flash the image or being unable to erase the flash.
Firefly provides an <code>upgrade_tool</code> which is a modified [http://opensource.rock-chips.com/wiki_Upgradetool rock-chip upgrade tool]. Using the upstream tool however may result in weird errors like being unable to flash the image or being unable to erase the flash. To be sure use the [https://archive.org/details/AIO-33399C archive.org mirror].
 
However, because the software is essentially a blob, you will need to either patchelf the thing or use '''steam-run''':
<syntaxHighlight lang=bash>nix-shell -p steam-run --run "steam-run ./upgrade_tool"</syntaxHighlight>


=== Rockchip MaskROM Mode ===
=== Rockchip MaskROM Mode ===
Maskrom mode is a way to get extended privileges when flashing but you need to shorten two trace points on the board. Follow [http://wiki.t-firefly.com/en/AIO-3399C/maskrom_mode.html the official documentation].
Maskrom mode is a way to get extended privileges when flashing but you need to shorten two trace points on the board. Follow [http://wiki.t-firefly.com/en/AIO-3399C/maskrom_mode.html the official documentation]. However the loader mode should be enough for most things.
 
=== Flashing from U-Boot ===


== Resources ==
== Resources ==


* [https://www.pine64.org/?page_id=46823 Official product page]
* [http://en.t-firefly.com/product/industry/aio_3399c Official product page]
* [http://wiki.t-firefly.com/en/AIO-3399C/ Firefly Wiki Page for the AIO-3399c]
* [http://wiki.t-firefly.com/en/AIO-3399C/ Firefly Wiki Page for the AIO-3399c]