Kongyang Liu | fe4a7b4 | 2024-12-15 13:02:42 +0800 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | |
| 3 | Banana Pi BPI-F3 |
| 4 | ================ |
| 5 | |
| 6 | Building |
| 7 | ~~~~~~~~ |
| 8 | 1. Install the SpacemiT riscv cross compile toolchain_, or skip it if riscv toolchain is installed. |
| 9 | |
| 10 | .. _toolchain: https://archive.spacemit.com/toolchain/ |
| 11 | |
| 12 | 2. Setup cross compilation environment variable: |
| 13 | |
| 14 | .. code-block:: console |
| 15 | |
| 16 | export CROSS_COMPILE=<riscv64 toolchain prefix, e.g /opt/spacemit/bin/riscv64-unknown-linux-gnu-> |
| 17 | |
| 18 | 3. Before building U-Boot, OpenSBI should be built first. OpenSBI can be |
| 19 | built for SpacemiT K1 SoC as below: |
| 20 | |
| 21 | .. code-block:: console |
| 22 | |
| 23 | git clone https://github.com/cyyself/opensbi -b k1-opensbi |
| 24 | cd opensbi |
| 25 | make PLATFORM=generic |
| 26 | |
| 27 | 4. Then build U-Boot as following: |
| 28 | |
| 29 | .. code-block:: console |
| 30 | |
| 31 | cd <U-Boot-dir> |
| 32 | make bananapi-f3_defconfig |
| 33 | make OPENSBI=<OpenSBI-dir>/build/platform/generic/firmware/fw_dynamic.bin |
| 34 | |
| 35 | This will generate u-boot.itb |
| 36 | |
| 37 | Burning |
| 38 | ~~~~~~~ |
| 39 | Actually, we can replace the uboot partition of Bianbu Linux which is the bsp_ to validate this patch, |
| 40 | use `balena etcher` to burn the bianbu-minimal.img to the sd card, |
| 41 | and replace the /dev/sdx4 where places the uboot_ with the `u-boot.itb` generated from this patch. |
| 42 | Or use fastboot: |
| 43 | Collect FSBL.bin, u-boot.itb, partition_2M.json, bootinfo_spinor.bin |
| 44 | u-boot-env-default.bin, fw_dynamic.itb from vendor SDK |
| 45 | |
| 46 | .. code-block:: console |
| 47 | |
| 48 | fastboot stage FSBL.bin |
| 49 | fastboot continue |
| 50 | fastboot stage u-boot.itb-vendor # the itb from vendor uboot |
| 51 | fastboot continue |
| 52 | |
| 53 | fastboot flash mtd partition_2M.json |
| 54 | fastboot flash bootinfo bootinfo_spinor.bin |
| 55 | fastboot flash fsbl FSBL.bin |
| 56 | fastboot flash env u-boot-env-default.bin |
| 57 | fastboot flash opensbi fw_dynamic.itb |
| 58 | |
| 59 | fastboot flash uboot u-boot.itb-mainline # the itb from mainline uboot |
| 60 | |
| 61 | .. _bsp: https://archive.spacemit.com/image/k1/version/bianbu/v2.0/ |
| 62 | .. _uboot: https://bianbu-linux.spacemit.com/en/device/boot#21-firmware-layout |
| 63 | |
| 64 | Booting |
| 65 | ~~~~~~~ |
| 66 | Sample boot log from Banana Pi BPI-F3 board |
| 67 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 68 | .. code-block:: none |
| 69 | |
| 70 | try sd... |
| 71 | bm:3 |
| 72 | j... |
| 73 | |
| 74 | U-Boot SPL 2022.10spacemit-dirty (Oct 21 2024 - 09:01:13 +0000) |
| 75 | [ 0.279] DDR type LPDDR4X |
| 76 | [ 0.292] lpddr4_silicon_init consume 13ms |
| 77 | [ 0.293] Change DDR data rate to 2400MT/s |
| 78 | [ 0.430] ## Checking hash(es) for config conf-1 ... OK |
| 79 | [ 0.432] ## Checking hash(es) for Image opensbi ... OK |
| 80 | [ 0.437] ## Checking hash(es) for Image uboot ... OK |
| 81 | [ 0.443] ## Checking hash(es) for Image fdt-1 ... OK |
| 82 | [ 0.488] ## Checking hash(es) for config config_1 ... OK |
| 83 | [ 0.490] ## Checking hash(es) for Image opensbi ... crc32+ OK |
| 84 | |
| 85 | |
| 86 | U-Boot 2024.10-rc4-00462-g5b138cfcc587-dirty (Nov 28 2024 - 14:56:49 +0800) |
| 87 | |
| 88 | DRAM: 4 GiB |
| 89 | Core: 19 devices, 8 uclasses, devicetree: separate |
| 90 | Loading Environment from nowhere... OK |
| 91 | In: serial@d4017000 |
| 92 | Out: serial@d4017000 |
| 93 | Err: serial@d4017000 |
| 94 | Net: No ethernet found. |
| 95 | => cpu list |
| 96 | 0: cpu@0 spacemit,x60 |
| 97 | 1: cpu@1 spacemit,x60 |
| 98 | 2: cpu@2 spacemit,x60 |
| 99 | 3: cpu@3 spacemit,x60 |
| 100 | 4: cpu@4 spacemit,x60 |
| 101 | 5: cpu@5 spacemit,x60 |
| 102 | 6: cpu@6 spacemit,x60 |
| 103 | 7: cpu@7 spacemit,x60 |
| 104 | => test |
| 105 | => |
| 106 | |