1.. SPDX-License-Identifier: GPL-2.0+ 2 3U-Boot for Apple Silicon Macs 4============================= 5 6Allows Apple Silicon Macs to boot U-Boot via the m1n1 bootloader 7developed by the Asahi Linux project. At this point the machines with 8the following SoCs work: 9 10 - Apple M1 SoC (t8103) 11 - Apple M1 Pro SoC (t6000) 12 - Apple M1 Max SoC (t6001) 13 - Apple M1 Ultra SoC (t6002) 14 15On these SoCs the following hardware is supported: 16 17 - S5L serial port 18 - SPI keyboard (on laptops) 19 - Framebuffer 20 - NVMe storage 21 - USB 3.1 Type-C ports 22 23Device trees are currently provided for the M1 Mac mini (2020, J274), 24M1 MacBook Pro 13" (2020, J293), M1 MacBook Air (2020, J313) and M1 25iMac (2021, J456/J457). 26 27Building U-Boot 28--------------- 29 30.. code-block:: bash 31 32 $ export CROSS_COMPILE=aarch64-none-elf- 33 $ make apple_m1_defconfig 34 $ make 35 36This will build ``u-boot-nodtb.bin`` as well as devices trees for some 37of the supported machines. These device trees can be found in the 38``arch/arm/dts`` subdirectory of your build. 39 40Image creation 41-------------- 42 43In order to run U-Boot on an Apple Silicon Mac, U-Boot has to be used 44as a payload for the m1n1 bootloader. Instructions for building m1n1 45can be found here: 46 47 https://github.com/AsahiLinux/docs/wiki/SW%3Am1n1 48 49.. code-block:: bash 50 51 $ cat m1n1.macho t8103-j274.dtb u-boot-nodtb.bin > u-boot.macho 52 53This uses ``u-boot-nodtb.bin`` as the device tree is passed to U-Boot 54by m1n1 after making some adjustments. 55 56Image installation 57------------------ 58 59Instructions on how to install U-Boot on your Mac can be found at: 60 61 https://github.com/AsahiLinux/docs/wiki/Developer-Quickstart 62 63Just replace ``m1n1.macho`` with ``u-boot.macho`` in the instructions. 64 65Debug UART 66---------- 67 68Since the base address of the UART is SoC-dependent, the debug UART is 69not enabled by default. To enable the debug UART the base address 70needs to be adjusted and the CONFIG_DEBUG_UART option needs to be 71enabled. The table below gives the correct base address for the 72supported SoCs. 73 74.. list-table:: 75 :widths: 32 16 76 :header-rows: 1 77 78 * - SoC 79 - Base Address 80 * - M1 (t8103) 81 - 0x235200000 82 * - M1 Pro/Max/Ultra (t6000/t6001/t6002) 83 - 0x39b200000 84