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