Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ |
| 2 | |
| 3 | U-Boot for Anbernic RGxx3 Devices |
| 4 | ================================= |
| 5 | |
| 6 | This allows U-Boot to boot the following Anbernic devices: |
| 7 | |
Chris Morgan | 547db7c | 2024-01-02 09:46:54 -0600 | [diff] [blame] | 8 | - Anbernic RG-ARC-D |
| 9 | - Anbernic RG-ARC-S |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 10 | - Anbernic RG353M |
| 11 | - Anbernic RG353P |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 12 | - Anbernic RG353PS |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 13 | - Anbernic RG353V |
| 14 | - Anbernic RG353VS |
| 15 | - Anbernic RG503 |
| 16 | |
Chris Morgan | 547db7c | 2024-01-02 09:46:54 -0600 | [diff] [blame] | 17 | Additionally, the following very similar non-Anbernic devices are also |
| 18 | supported: |
| 19 | |
| 20 | - Powkiddy RGB30 |
| 21 | - Powkiddy RK2023 |
| 22 | |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 23 | The correct device is detected automatically by comparing ADC values |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 24 | from ADC channel 1. In the event of an RG353V or RG353P, an attempt |
| 25 | is then made to probe for an eMMC and if it fails the device is assumed |
| 26 | to be an RG353VS or RG353PS. Based on the detected device, the |
| 27 | environment variables "board", "board_name", and "fdtfile" are set to |
| 28 | the correct values corresponding to the board which can be read by a |
Chris Morgan | 547db7c | 2024-01-02 09:46:54 -0600 | [diff] [blame] | 29 | boot script to boot with the correct device tree. If a board is defined |
| 30 | as requiring panel detection, a panel detect is then performed by |
| 31 | probing a "dummy" display on the DSI bus and then querying the display |
| 32 | ID. The display ID is then compared to a table to get the known |
| 33 | compatible string for use in Linux, and this string is saved as an |
| 34 | environment variable of "panel". |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 35 | |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 36 | FDT fixups are performed in the event of an RG353M to change the device |
| 37 | name, or in the event the panel detected does not match the devicetree. |
| 38 | This allows Linux to load the correct panel driver without having to |
| 39 | know exactly which panel is used (as there is no user distingushable |
| 40 | way to tell). |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 41 | |
| 42 | Building U-Boot |
| 43 | --------------- |
| 44 | |
| 45 | .. code-block:: bash |
| 46 | |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 47 | $ export CROSS_COMPILE=aarch64-linux-gnu- |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 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 anbernic-rgxx3_defconfig |
| 51 | $ make |
| 52 | |
| 53 | This will build ``u-boot-rockchip.bin`` which can be written to an SD |
| 54 | card. |
| 55 | |
| 56 | Image installation |
| 57 | ------------------ |
| 58 | |
| 59 | Write the ``u-boot-rockchip.bin`` to an SD card offset 32kb from the |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 60 | start. Please note that eMMC booting has not been tested at this time. |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 61 | |
| 62 | .. code-block:: bash |
| 63 | |
| 64 | $ dd if=u-boot-rockchip.bin of=/dev/mmcblk0 bs=512 seek=64 |