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