Chris Morgan | 6cf6fe2 | 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 | |
| 8 | - Anbernic RG353M |
| 9 | - Anbernic RG353P |
Chris Morgan | 182d0ba | 2023-05-15 11:00:32 -0500 | [diff] [blame^] | 10 | - Anbernic RG353PS |
Chris Morgan | 6cf6fe2 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 11 | - Anbernic RG353V |
| 12 | - Anbernic RG353VS |
| 13 | - Anbernic RG503 |
| 14 | |
| 15 | The correct device is detected automatically by comparing ADC values |
Chris Morgan | 182d0ba | 2023-05-15 11:00:32 -0500 | [diff] [blame^] | 16 | from ADC channel 1. In the event of an RG353V or RG353P, an attempt |
| 17 | is then made to probe for an eMMC and if it fails the device is assumed |
| 18 | to be an RG353VS or RG353PS. Based on the detected device, the |
| 19 | environment variables "board", "board_name", and "fdtfile" are set to |
| 20 | the correct values corresponding to the board which can be read by a |
| 21 | boot script to boot with the correct device tree. If the board detected |
| 22 | is not of type RG503 (which currently has only 1 panel revision) a |
| 23 | panel detect is then performed by probing a "dummy" display on the DSI |
| 24 | bus and then querying the display ID. The display ID is then compared |
| 25 | to a table to get the known compatible string for use in Linux, and |
| 26 | this string is saved as an environment variable of "panel". |
Chris Morgan | 6cf6fe2 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 27 | |
Chris Morgan | 182d0ba | 2023-05-15 11:00:32 -0500 | [diff] [blame^] | 28 | FDT fixups are performed in the event of an RG353M to change the device |
| 29 | name, or in the event the panel detected does not match the devicetree. |
| 30 | This allows Linux to load the correct panel driver without having to |
| 31 | know exactly which panel is used (as there is no user distingushable |
| 32 | way to tell). |
Chris Morgan | 6cf6fe2 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 33 | |
| 34 | Building U-Boot |
| 35 | --------------- |
| 36 | |
| 37 | .. code-block:: bash |
| 38 | |
Chris Morgan | 182d0ba | 2023-05-15 11:00:32 -0500 | [diff] [blame^] | 39 | $ export CROSS_COMPILE=aarch64-linux-gnu- |
Chris Morgan | 6cf6fe2 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 40 | $ export BL31=../rkbin/bin/rk35/rk3568_bl31_v1.34.elf |
| 41 | $ export ROCKCHIP_TPL=../rkbin/bin/rk35/rk3568_ddr_1056MHz_v1.13.bin |
| 42 | $ make anbernic-rgxx3_defconfig |
| 43 | $ make |
| 44 | |
| 45 | This will build ``u-boot-rockchip.bin`` which can be written to an SD |
| 46 | card. |
| 47 | |
| 48 | Image installation |
| 49 | ------------------ |
| 50 | |
| 51 | Write the ``u-boot-rockchip.bin`` to an SD card offset 32kb from the |
Chris Morgan | 182d0ba | 2023-05-15 11:00:32 -0500 | [diff] [blame^] | 52 | start. Please note that eMMC booting has not been tested at this time. |
Chris Morgan | 6cf6fe2 | 2023-04-21 10:59:19 -0500 | [diff] [blame] | 53 | |
| 54 | .. code-block:: bash |
| 55 | |
| 56 | $ dd if=u-boot-rockchip.bin of=/dev/mmcblk0 bs=512 seek=64 |