NixOS on ARM/Libre Computer ROC-RK3328-CC: Difference between revisions

imported>Cyber-murmel
Copy most stuff from ROCK64; add USB enable service
 
m fixed it! hurray
 
(6 intermediate revisions by 4 users not shown)
Line 20: Line 20:
</div>
</div>


The ROC-RK3328-CC (Renegade) is a single board computer built around the Rockchip RK3328 SoC. It is very similar to the [[NixOS_on_ARM/PINE64_ROCKPro64|ROCKPro64]].
The ROC-RK3328-CC (Renegade) is a single board computer built around the Rockchip RK3328 SoC. It is very similar to the [[NixOS_on_ARM/PINE64_ROCK64|ROCK64]].


There are three models of the board, with 1, 2 or 4 GB of RAM. It can boot from an microSD card or an eMMC. It also has a 128 Mbit SPI flash that can be used to store the bootloader.
There are three models of the board, with 1, 2 or 4 GB of RAM. It can boot from an microSD card or an eMMC. It also has a 128 Mbit SPI flash that can be used to store the bootloader.
Line 33: Line 33:


This bootloader is not entirely open, incorporating a binary blob for the tertiary program loader (TPL).
This bootloader is not entirely open, incorporating a binary blob for the tertiary program loader (TPL).
If your have nix installed you can download the latest version with (This command also works on different
If you have nix installed, you can download the latest version with (This command also works on different
architectures since it can be downloaded from the binary cache):
architectures since it can be downloaded from the binary cache):


Line 79: Line 79:


   nixpkgs.config.allowUnfree = true; # needed for ubootRock64
   nixpkgs.config.allowUnfree = true; # needed for ubootRock64
   sdImage.postBuildCommands = ''
  # at the time of writing the u-boot version from FireFly hasn't been successfully ported yet
     dd if=${pkgs.ubootRock64}/idbloader.img of=$img conv=fsync,notrunc bs=512 seek=64
  # so we use the one from Rock64
     dd if=${pkgs.ubootRock64}/u-boot.itb of=$img conv=fsync,notrunc bs=512 seek=16384
   sdImage.postBuildCommands = with pkgs; ''
     dd if=${ubootRock64}/idbloader.img of=$img conv=fsync,notrunc bs=512 seek=64
     dd if=${ubootRock64}/u-boot.itb of=$img conv=fsync,notrunc bs=512 seek=16384
   '';
   '';


Line 96: Line 98:
$ nix-build '<nixpkgs/nixos>' \
$ nix-build '<nixpkgs/nixos>' \
     -A config.system.build.sdImage \
     -A config.system.build.sdImage \
     -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/9bc841f.tar.gz \ # pinned to nixos-unstable on 2022-03-23
     -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/9bc841fec1c0e8b9772afa29f934d2c7ce57da8e.tar.gz \ # pinned to nixos-unstable on 2022-03-23
     -I nixos-config=./sd-image.nix</syntaxHighlight>
     -I nixos-config=./sd-image.nix</syntaxHighlight>


== USB ==
== USB ==
To enable USB power ''GPIO1_D2'' must be pulled high. D2 translates to 26 (D=4, 4*8+2=26). This is most easily done with the following systemd service.
To enable USB power ''GPIO1_D2'' must be pulled high. D2 translates to 26 (D=4, 4*8+2=26). Normally this is configured in the device tree, which gets loaded at boot time. At the time of writing, the ROC-RK3328-CC version of u-boot hasn't been ported to nixpkgs yet, so this is most easily done with the following systemd service.


<syntaxHighlight lang=nix>
<syntaxHighlight lang=nix>
Line 116: Line 118:
{| class="table"
{| class="table"
|-
|-
!colspan="2" style="background: #fafafa"| Pi-2 Bus
!colspan="2" style="background: var(--color-inverted)"| Pi-2 Bus
|-
|-
! Pin
! Pin
Line 143: Line 145:
{| class="table arm-compatibility"
{| class="table arm-compatibility"
|
|
! style="background: #fafafa" | Mainline kernel
! style="background: var(--color-inverted)" | Mainline kernel
|-
|-
! Ethernet  
! Ethernet  
Line 160: Line 162:
* [https://www.libre.computer/products/rk3328/ Official product page]
* [https://www.libre.computer/products/rk3328/ Official product page]
* [https://roc-rk3328-cc.readthedocs.io/en/latest/intro.html Official Getting Started Guide]
* [https://roc-rk3328-cc.readthedocs.io/en/latest/intro.html Official Getting Started Guide]
[[Category:NixOS on ARM]]