Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 1 | Marvell U-Boot Build Instructions |
| 2 | ================================= |
| 3 | |
| 4 | This document describes how to compile the U-Boot and how to change U-Boot configuration |
| 5 | |
| 6 | Build Procedure |
| 7 | ---------------- |
| 8 | 1. Install required packages: |
| 9 | |
| 10 | # sudo apt-get install libssl-dev |
| 11 | # sudo apt-get install device-tree-compiler |
| 12 | # sudo apt-get install swig libpython-dev |
| 13 | |
| 14 | 2. Set the cross compiler: |
| 15 | |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 16 | # sudo apt-get install gcc-aarch64-linux-gnu |
| 17 | # export CROSS_COMPILE=aarch64-linux-gnu- |
Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 18 | |
| 19 | 3. Clean-up old residuals: |
| 20 | |
| 21 | # make mrproper |
| 22 | |
| 23 | 4. Configure the U-Boot: |
| 24 | |
| 25 | # make <defconfig_file> |
| 26 | |
| 27 | - For the Armada-70x0/80x0 DB board use "mvebu_db_armada8k_defconfig" |
| 28 | - For the Armada-80x0 MacchiatoBin use "make mvebu_mcbin-88f8040_defconfig" |
| 29 | - For the Armada-3700 DB board use "make mvebu_db-88f3720_defconfig" |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 30 | - For the Armada-3700 EspressoBin use "make mvebu_espressobin-88f3720_defconfig" |
Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 31 | |
| 32 | 5. Configure the device-tree and build the U-Boot image: |
| 33 | |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 34 | For the Armada-70x0/80x0 DB board compile u-boot and set the required device-tree using: |
Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 35 | |
| 36 | # make DEVICE_TREE=<name> |
| 37 | |
| 38 | NOTE: |
| 39 | Compilation with "mvebu_db_armada8k_defconfig" requires explicitly exporting DEVICE_TREE |
| 40 | for the requested board. |
| 41 | By default, u-boot is compiled with armada-8040-db device-tree. |
| 42 | Using A80x0 device-tree on A70x0 might break the device. |
| 43 | In order to prevent this, the required device-tree MUST be set during compilation. |
| 44 | All device-tree files are located in ./arch/arm/dts/ folder. |
| 45 | |
Andre Heider | dedf2ec | 2020-09-04 17:33:54 +0200 | [diff] [blame] | 46 | For the EspressoBin board with populated eMMC device use |
| 47 | # make DEVICE_TREE=armada-3720-espressobin-emmc |
| 48 | |
| 49 | For other DB boards (MacchiatoBin, EspressoBin without soldered eMMC and 3700 DB board) |
| 50 | compile u-boot with just default device-tree from defconfig using: |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 51 | |
| 52 | # make |
| 53 | |
Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 54 | NOTE: |
| 55 | The u-boot.bin should not be used as a stand-alone image. |
| 56 | The ARM Trusted Firmware (ATF) build process uses this image to generate the |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 57 | flash image. See TF-A Build Instructions for Marvell Platforms for more details at: |
| 58 | https://trustedfirmware-a.readthedocs.io/en/latest/plat/marvell/armada/build.html |
Igal Liberman | e02e632 | 2017-06-13 10:35:44 +0300 | [diff] [blame] | 59 | |
| 60 | Configuration update |
| 61 | --------------------- |
| 62 | To update the U-Boot configuration, please refer to doc/README.kconfig |
| 63 | |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 64 | |
| 65 | Permanent ethernet MAC address |
| 66 | ------------------------------- |
| 67 | Prior flashing new U-Boot version (as part of ATF image) it is suggested to backup |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 68 | permanent ethernet MAC addresses as they are stored only in U-Boot env storage (SPI or eMMC). |
| 69 | Some boards like EspressoBin have MAC addresses printed on sticker. Some boards got assigned |
| 70 | only one address other may also more than one. To print current MAC addresses run: |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 71 | |
| 72 | # echo $ethaddr |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 73 | # echo $eth1addr |
| 74 | # echo $eth2addr |
| 75 | # echo $eth3addr |
| 76 | # ... |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 77 | |
| 78 | MAC addresses 00:51:82:11:22:00, 00:51:82:11:22:01, 00:51:82:11:22:02, 00:51:82:11:22:03 |
| 79 | and F0:AD:4E:03:64:7F are default hardcoded values found in Marvell's and Armbian U-Boot |
| 80 | forks and therefore *not* unique. Usage of static hardcoded MAC addresses should be avoided. |
| 81 | When original address is lost (e.g. erased by Armbian boot scripts for EspressoBin) it is |
| 82 | suggested to generate new random one. |
| 83 | |
| 84 | After flashing new U-Boot version it is suggested to reset U-Boot env variables to default |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 85 | and then set correct permanent ethernet MAC addresses. |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 86 | |
| 87 | # env default -a |
| 88 | # setenv ethaddr XX:XX:XX:XX:XX:XX |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 89 | # setenv eth1addr XX:XX:XX:XX:XX:XX |
| 90 | # setenv eth2addr YY:YY:YY:YY:YY:YY |
| 91 | # setenv eth3addr ZZ:ZZ:ZZ:ZZ:ZZ:ZZ |
| 92 | # ... |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 93 | # saveenv |
| 94 | |
Pali Rohár | c618fe7 | 2020-09-25 09:54:16 +0200 | [diff] [blame] | 95 | Where value for ethaddr is required permanent ethernet MAC address and values for ethNaddr |
| 96 | are optional per-port MAC addresses. When optional ethNaddr variables are not defined then |
| 97 | they are inherited from required ethaddr variable. eth1addr contains MAC address for the |
| 98 | wan port, other for particular lan ports. |
Pali Rohár | a26c150 | 2020-08-27 15:01:28 +0200 | [diff] [blame] | 99 | |
| 100 | Recent Linux kernel versions use correct permanent ethernet MAC address from U-Boot env as |
| 101 | U-Boot will inject it into kernel's device-tree. |