Heiko Stuebner | d3cacb7 | 2024-10-28 20:00:34 +0100 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | U-Boot for Qnap TS433 Devices |
| 4 | ================================= |
| 5 | |
| 6 | This allows U-Boot to boot the Qnap TS433 NAS |
| 7 | |
| 8 | Preparing the serial |
| 9 | -------------------- |
| 10 | |
| 11 | Qnap devices run their serial console with a 115200 baudrate. As the |
| 12 | binary DDR-init and maskrom-downloader expect a 1500000 rate, it is |
| 13 | necessary to adapt the binaries if their output is needed. |
| 14 | |
| 15 | This can be done with a binary provided in the rkbin repository. |
| 16 | First the ddrbin_param.txt in the rkbin repo needs to be modified: |
| 17 | |
| 18 | .. code-block:: bash |
| 19 | |
| 20 | diff --git a/tools/ddrbin_param.txt b/tools/ddrbin_param.txt |
| 21 | index 0dfdd318..82ade7e7 100644 |
| 22 | --- a/tools/ddrbin_param.txt |
| 23 | +++ b/tools/ddrbin_param.txt |
| 24 | @@ -11,7 +11,7 @@ lp5_freq= |
| 25 | |
| 26 | uart id= |
| 27 | uart iomux= |
| 28 | -uart baudrate= |
| 29 | +uart baudrate=115200 |
| 30 | |
| 31 | sr_idle= |
| 32 | pd_idle= |
| 33 | |
| 34 | And after that the ddrbin_tool binary can be used to modify apply this |
| 35 | modification and also a new maskrom downloader can be build: |
| 36 | |
| 37 | .. code-block:: bash |
| 38 | |
| 39 | $ tools/ddrbin_tool rk3568 tools/ddrbin_param.txt bin/rk35/rk3568_ddr_1560MHz_v1.21.bin |
| 40 | $ tools/boot_merger RKBOOT/RK3568MINIALL.ini |
| 41 | |
| 42 | Building U-Boot |
| 43 | --------------- |
| 44 | |
| 45 | .. code-block:: bash |
| 46 | |
| 47 | $ export CROSS_COMPILE=aarch64-linux-gnu- |
| 48 | $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf |
| 49 | $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.13.bin |
| 50 | $ make qnap-ts433-rk3568_defconfig |
| 51 | $ make |
| 52 | |
| 53 | This will build ``u-boot-rockchip.bin`` which can be written to the |
| 54 | on-board eMMC. |
| 55 | |
| 56 | Image installation |
| 57 | ------------------ |
| 58 | |
| 59 | The Qnap thankfully provides an easily accessible serial header as well as |
| 60 | a very user-friendly jumper-header to bring the device into maskrom mode. |
| 61 | |
| 62 | To access both, the drive trays need to be removed. Looking at the board, |
| 63 | through the upper cutout of the metal frame the white 4-port serial-header |
| 64 | can be seen next to a barcode sticker. It's pinout is as follows: |
| 65 | |
| 66 | .. code-block:: none |
| 67 | |
| 68 | ,_ _. |
| 69 | |1234| 1=TX 2=VCC |
| 70 | `----' 3=RX 4=GND |
| 71 | |
| 72 | |
| 73 | Directly below it, the mentioned 2-pin jumper header can be seen. |
| 74 | |
| 75 | To write your u-boot to the device, it needs to be powered off first. Then |
| 76 | a jumper or suitable cable needs to be used to connect the two pins of the |
| 77 | maskrom header. Turning on the device now will start it in maskrom mode. |
| 78 | |
| 79 | It is important that the jumper gets removed after that stop and before |
| 80 | actually trying to write to the emmc. |
| 81 | |
| 82 | The front usb-port needs to be connected to the host with an USB-A-to-A |
| 83 | cable to allow flashing. |
| 84 | |
| 85 | The flashing itself is done via rkdeveloptool, which can be found for |
| 86 | example as package of that name in Debian-based distributions: |
| 87 | |
| 88 | .. code-block:: bash |
| 89 | |
| 90 | $ rkdeveloptool db rk356x_spl_loader_v1.21.113.bin |
| 91 | $ rkdeveloptool wl 64 u-boot-rockchip.bin |