blob: 8fa7637629e76e83d96285fd71abab5d0c2ac7a2 [file] [log] [blame]
Mark Kettenis91ce6bf2021-10-23 16:58:07 +02001.. 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
Mark Kettenis0ae3c792022-02-14 22:09:26 +010010 - Apple M1 SoC (t8103)
11 - Apple M1 Pro SoC (t6000)
12 - Apple M1 Max SoC (t6001)
Mark Kettenis568d3ba2022-04-15 14:19:28 +020013 - Apple M1 Ultra SoC (t6002)
Mark Kettenis91ce6bf2021-10-23 16:58:07 +020014
15On these SoCs the following hardware is supported:
16
17 - S5L serial port
Mark Kettenis0ae3c792022-02-14 22:09:26 +010018 - SPI keyboard (on laptops)
Mark Kettenis91ce6bf2021-10-23 16:58:07 +020019 - Framebuffer
Mark Kettenis0ae3c792022-02-14 22:09:26 +010020 - NVMe storage
Mark Kettenis91ce6bf2021-10-23 16:58:07 +020021 - USB 3.1 Type-C ports
22
Mark Kettenis0ae3c792022-02-14 22:09:26 +010023Device 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).
Mark Kettenis91ce6bf2021-10-23 16:58:07 +020026
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.
Mark Kettenis0ae3c792022-02-14 22:09:26 +010064
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
Mark Kettenis568d3ba2022-04-15 14:19:28 +020082 * - M1 Pro/Max/Ultra (t6000/t6001/t6002)
Mark Kettenis0ae3c792022-02-14 22:09:26 +010083 - 0x39b200000