blob: 083bfb0a1a6ec5ec99271b894fc0bcc3905b62fd [file] [log] [blame]
Mark Kettenisfdfe2a22021-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 Kettenise15bbac2022-02-14 22:09:26 +010010 - Apple M1 SoC (t8103)
11 - Apple M1 Pro SoC (t6000)
12 - Apple M1 Max SoC (t6001)
Mark Kettenisfdfe2a22021-10-23 16:58:07 +020013
14On these SoCs the following hardware is supported:
15
16 - S5L serial port
Mark Kettenise15bbac2022-02-14 22:09:26 +010017 - SPI keyboard (on laptops)
Mark Kettenisfdfe2a22021-10-23 16:58:07 +020018 - Framebuffer
Mark Kettenise15bbac2022-02-14 22:09:26 +010019 - NVMe storage
Mark Kettenisfdfe2a22021-10-23 16:58:07 +020020 - USB 3.1 Type-C ports
21
Mark Kettenise15bbac2022-02-14 22:09:26 +010022Device trees are currently provided for the M1 Mac mini (2020, J274),
23M1 MacBook Pro 13" (2020, J293), M1 MacBook Air (2020, J313) and M1
24iMac (2021, J456/J457).
Mark Kettenisfdfe2a22021-10-23 16:58:07 +020025
26Building U-Boot
27---------------
28
29.. code-block:: bash
30
31 $ export CROSS_COMPILE=aarch64-none-elf-
32 $ make apple_m1_defconfig
33 $ make
34
35This will build ``u-boot-nodtb.bin`` as well as devices trees for some
36of the supported machines. These device trees can be found in the
37``arch/arm/dts`` subdirectory of your build.
38
39Image creation
40--------------
41
42In order to run U-Boot on an Apple Silicon Mac, U-Boot has to be used
43as a payload for the m1n1 bootloader. Instructions for building m1n1
44can 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
52This uses ``u-boot-nodtb.bin`` as the device tree is passed to U-Boot
53by m1n1 after making some adjustments.
54
55Image installation
56------------------
57
58Instructions on how to install U-Boot on your Mac can be found at:
59
60 https://github.com/AsahiLinux/docs/wiki/Developer-Quickstart
61
62Just replace ``m1n1.macho`` with ``u-boot.macho`` in the instructions.
Mark Kettenise15bbac2022-02-14 22:09:26 +010063
64Debug UART
65----------
66
67Since the base address of the UART is SoC-dependent, the debug UART is
68not enabled by default. To enable the debug UART the base address
69needs to be adjusted and the CONFIG_DEBUG_UART option needs to be
70enabled. The table below gives the correct base address for the
71supported 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