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 | |
Chris Morgan | 4b18114 | 2024-02-05 12:58:53 -0600 | [diff] [blame^] | 20 | - Powkiddy RGB10MAX3 |
Chris Morgan | 547db7c | 2024-01-02 09:46:54 -0600 | [diff] [blame] | 21 | - Powkiddy RGB30 |
| 22 | - Powkiddy RK2023 |
| 23 | |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 24 | The correct device is detected automatically by comparing ADC values |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 25 | from ADC channel 1. In the event of an RG353V or RG353P, an attempt |
| 26 | is then made to probe for an eMMC and if it fails the device is assumed |
| 27 | to be an RG353VS or RG353PS. Based on the detected device, the |
| 28 | environment variables "board", "board_name", and "fdtfile" are set to |
| 29 | 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] | 30 | boot script to boot with the correct device tree. If a board is defined |
| 31 | as requiring panel detection, a panel detect is then performed by |
| 32 | probing a "dummy" display on the DSI bus and then querying the display |
| 33 | ID. The display ID is then compared to a table to get the known |
| 34 | compatible string for use in Linux, and this string is saved as an |
| 35 | environment variable of "panel". |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 36 | |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 37 | FDT fixups are performed in the event of an RG353M to change the device |
| 38 | name, or in the event the panel detected does not match the devicetree. |
| 39 | This allows Linux to load the correct panel driver without having to |
| 40 | know exactly which panel is used (as there is no user distingushable |
| 41 | way to tell). |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 42 | |
| 43 | Building U-Boot |
| 44 | --------------- |
| 45 | |
| 46 | .. code-block:: bash |
| 47 | |
Chris Morgan | b01ff3e | 2023-05-15 11:00:32 -0500 | [diff] [blame] | 48 | $ export CROSS_COMPILE=aarch64-linux-gnu- |
Chris Morgan | 8c4e304 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 49 | $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf |
| 50 | $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.13.bin |
| 51 | $ make anbernic-rgxx3_defconfig |
| 52 | $ make |
| 53 | |
| 54 | This will build ``u-boot-rockchip.bin`` which can be written to an SD |
| 55 | card. |
| 56 | |
| 57 | Image installation |
| 58 | ------------------ |
| 59 | |
| 60 | 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] | 61 | 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] | 62 | |
| 63 | .. code-block:: bash |
| 64 | |
| 65 | $ dd if=u-boot-rockchip.bin of=/dev/mmcblk0 bs=512 seek=64 |