|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
− | Work in progress
| + | This page has been moved to the official NixOS Wiki: |
| | | |
− | === U-boot ===
| + | ⇒ '''[https://wiki.nixos.org/wiki/NixOS_on_ARM/LS1046A NixOS on ARM/LS1046A]''' |
| | | |
− | ==== Cross-compiling ====
| + | ''— samueldr, Lead of NixOS on ARM.'' |
− | | |
− | {{Commands|<nowiki>
| |
− | | |
− | nix-shell --cores 0 '<nixpkgs>' --arg crossSystem '(import <nixpkgs> {}).lib.systems.examples.aarch64-multiplatform' -A ubootQemuAarch64
| |
− | git clone git://git.denx.de/u-boot.git
| |
− | cd u-boot
| |
− | git checkout v2018.03
| |
− | # find available defconfigs and pick one
| |
− | ls configs/ | grep ls1046
| |
− | | |
− | make CROSS_COMPILE=aarch64-unknown-linux-gnu- ls1046ardb_sdcard_defconfig
| |
− | make CROSS_COMPILE=aarch64-unknown-linux-gnu-
| |
− | | |
− | </nowiki>}}
| |
− | | |
− | ==== Switching QSPI flash banks in u-boot ====
| |
− | | |
− | {{Commands|<nowiki>
| |
− | cpld reset # switch to bank0 (default boot)
| |
− | cpld reset altbank # switch to bank4 (reset to boot from alternative bank)
| |
− | cpld reset sd # reset to boot from SD card
| |
− | </nowiki>}}
| |
− | | |
− | ==== Flashing u-boot to QSPI flash ====
| |
− | {{Commands|<nowiki>
| |
− | tftp <uboot_image_addr> <uboot_file_name>.bin
| |
− | # use alternative bank
| |
− | sf probe 0:1
| |
− | sf erase 100000 +$filesize
| |
− | sf write <uboot_image_addr> 100000 $filesize
| |
− | # boot from altbank
| |
− | cpld reset altbank
| |
− | </nowiki>}}
| |
− | | |
− | It is also possible to use <code>sf probe 0:0</code> to flash current bank.
| |
− | | |
− | ==== Flashing u-boot to flash ====
| |
− | Replace <code>/dev/sdX</code> with correct device:
| |
− | | |
− | {{Commands|<nowiki>
| |
− | dd if=u-boot-with-spl-pbl-sd.bin of=/dev/sdX bs=512 seek=8
| |
− | </nowiki>}}
| |