Apple M1 Support
Subsystems (8)
v2 cover Apple M1 Support
This series adds basic support for Apple's M1 SoC to U-Boot. This builds a basic U-Boot that can be used as a payload for the m1n1 boot loader being developed by the Asahi Linux project.
The goal here is to privide an UEFI interface on these machines that allows booting various open source OSes. This initial series provides support for the serial port, framebuffer and the USB 3.1 Type-C ports. It can boot a support OS (e.g. OpenBSD/arm64) from a USB disk.
This version attempts to address most comments. It doesn't add a proper WDT/sysreset driver yet since I prefer to do that once the device tree bindings for that have been ironed out.
ChangeLog:
v2: - Add IOMMU uclass and use it for the DART driver
- Cut back DART driver to only support bypass mode
- Rework the S5P serial support to use more DT stuff
- Update preliminary device trees
Mark Kettenis (7):
iommu: Add IOMMU uclass
test: Add tests for IOMMU uclass
arm: apple: Add initial support for Apple's M1 SoC
serial: s5p: Add Apple M1 support
iommu: Add Apple DART driver
arm: dts: apple: Add preliminary device trees
doc: board: apple: Add Apple M1 documentation
arch/arm/Kconfig | 23 + arch/arm/Makefile | 1 + arch/arm/dts/Makefile | 4 + arch/arm/dts/t8103-j274.dts | 135 +++++ arch/arm/dts/t8103-j293.dts | 97 +++ arch/arm/dts/t8103.dtsi | 560 ++++++++++++++++++ arch/arm/include/asm/arch-m1/uart.h | 41 ++ arch/arm/mach-apple/Kconfig | 18 + arch/arm/mach-apple/Makefile | 4 + arch/arm/mach-apple/board.c | 161 +++++ arch/arm/mach-apple/lowlevel_init.S | 17 + arch/sandbox/dts/test.dts | 6 + configs/apple_m1_defconfig | 19 + configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + doc/board/apple/index.rst | 9 + doc/board/apple/m1.rst | 56 ++ doc/board/index.rst | 1 + drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/core/device.c | 8 + drivers/iommu/Kconfig | 23 + drivers/iommu/Makefile | 6 + drivers/iommu/apple_dart.c | 59 ++ drivers/iommu/iommu-uclass.c | 45 ++ drivers/iommu/sandbox_iommu.c | 18 + drivers/serial/Kconfig | 4 +- drivers/serial/serial_s5p.c | 104 +++- include/configs/apple.h | 38 ++ include/dm/uclass-id.h | 1 + .../interrupt-controller/apple-aic.h | 15 + include/dt-bindings/pinctrl/apple.h | 13 + include/dt-bindings/spmi/spmi.h | 10 + include/iommu.h | 16 + test/dm/Makefile | 1 + test/dm/iommu.c | 28 + 39 files changed, 1525 insertions(+), 24 deletions(-) create mode 100644 arch/arm/dts/t8103-j274.dts create mode 100644 arch/arm/dts/t8103-j293.dts create mode 100644 arch/arm/dts/t8103.dtsi create mode 100644 arch/arm/include/asm/arch-m1/uart.h create mode 100644 arch/arm/mach-apple/Kconfig create mode 100644 arch/arm/mach-apple/Makefile create mode 100644 arch/arm/mach-apple/board.c create mode 100644 arch/arm/mach-apple/lowlevel_init.S create mode 100644 configs/apple_m1_defconfig create mode 100644 doc/board/apple/index.rst create mode 100644 doc/board/apple/m1.rst create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/apple_dart.c create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 drivers/iommu/sandbox_iommu.c create mode 100644 include/configs/apple.h create mode 100644 include/dt-bindings/interrupt-controller/apple-aic.h create mode 100644 include/dt-bindings/pinctrl/apple.h create mode 100644 include/dt-bindings/spmi/spmi.h create mode 100644 include/iommu.h create mode 100644 test/dm/iommu.c
Signature · 1 line
2.33.0
PATCH v2 1/7 iommu: Add IOMMU uclass
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.h
drivers/Kconfig +2 -0
@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"
drivers/Makefile +1 -0
@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/
drivers/core/device.c +8 -0
@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h>
@@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;
drivers/iommu/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" + +config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices. + +endmenu
drivers/iommu/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.o
drivers/iommu/iommu-uclass.c new file +45 -0
45 lines not on this page · raw message
include/dm/uclass-id.h +1 -0
@@ -61,6 +61,7 @@ enum uclass_id {UCLASS_I2C_MUX ,/* I2C multiplexer */ UCLASS_I2S ,/* I2S bus */ UCLASS_IDE ,/* IDE device */ +UCLASS_IOMMU ,/* IOMMU */ UCLASS_IRQ ,/* Interrupt controller */ UCLASS_KEYBOARD ,/* Keyboard input device */ UCLASS_LED, /* Light-emitting diode (LED) */
include/iommu.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef _IOMMU_H +#define _IOMMU_H + +struct udevice ; + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) && \ +CONFIG_IS_ENABLED (IOMMU ) +int dev_iommu_probe (struct udevice *dev); +#else +static inline int dev_iommu_probe (struct udevice *dev) +{ +return 0 ; +} +#endif + +#endif
Signature · 1 line
2.33.0
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Hi Mark,
Quoted 86 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +1
-0@@ -0,0 +1,13 @@ +#
drivers/iommu/Kconfig line 11
Quoted 10 lines
drivers/iommu/Kconfig new file +10
-0+# IOMMU devices +# + +menu "IOMMU device drivers" + +config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.
Need at least three lines. What is an IOMMU? How does it relate to other devices?
Quoted 19 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +2
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*
drivers/iommu/iommu-uclass.c line 12
Quoted 10 lines
drivers/iommu/iommu-uclass.c new file +10
-0+* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> +#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)
Can we rename to dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );
Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 61 lines
drivers/iommu/iommu-uclass.c new file +26
-0+for (i =0 ; i < count; i++) { + ret =dev_read_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 , i, &args); +if (ret) { +debug ("%s: dev_read_phandle_with_args failed: %d\n" , + __func__, ret); +return ret; + } + + ret =uclass_get_device_by_ofnode (UCLASS_IOMMU , args.node, + &dev_iommu); +if (ret) { +debug ("%s: uclass_get_device_by_ofnode failed: %d\n" , + __func__, ret); +return ret; + } + } + + return 0; +} +#endif + +UCLASS_DRIVER (iommu) = { + .id =UCLASS_IOMMU , + .name ="iommu" , +};include/dm/uclass-id.h +1
-0@@ -61,6 +61,7 @@ enum uclass_id {UCLASS_I2C_MUX ,/* I2C multiplexer */ UCLASS_I2S ,/* I2S bus */ UCLASS_IDE ,/* IDE device */ +UCLASS_IOMMU ,/* IOMMU */ UCLASS_IRQ ,/* Interrupt controller */ UCLASS_KEYBOARD ,/* Keyboard input device */ UCLASS_LED, /* Light-emitting diode (LED) */include/iommu.h new file +16
-1@@ -0,0 +1,16 @@ +#ifndef _IOMMU_H +#define _IOMMU_H + +struct udevice ; + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) && \ +CONFIG_IS_ENABLED (IOMMU ) +int dev_iommu_probe (struct udevice *dev); +#else +static inline int dev_iommu_probe (struct udevice *dev) +{ +return 0 ; +} +#endif + +#endif --
Quoted 2 lines
2.33.0
Regards,
Simon
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Quoted 97 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +
Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h>
Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.
Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
The binding is available in Documentation/bindings/iommu/iommu.txt in the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.
Quoted 67 lines
Quoted 61 lines
drivers/iommu/iommu-uclass.c new file +26
-0+for (i =0 ; i < count; i++) { + ret =dev_read_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 , i, &args); +if (ret) { +debug ("%s: dev_read_phandle_with_args failed: %d\n" , + __func__, ret); +return ret; + } + + ret =uclass_get_device_by_ofnode (UCLASS_IOMMU , args.node, + &dev_iommu); +if (ret) { +debug ("%s: uclass_get_device_by_ofnode failed: %d\n" , + __func__, ret); +return ret; + } + } + + return 0; +} +#endif + +UCLASS_DRIVER (iommu) = { + .id =UCLASS_IOMMU , + .name ="iommu" , +};include/dm/uclass-id.h +1
-0@@ -61,6 +61,7 @@ enum uclass_id {UCLASS_I2C_MUX ,/* I2C multiplexer */ UCLASS_I2S ,/* I2S bus */ UCLASS_IDE ,/* IDE device */ +UCLASS_IOMMU ,/* IOMMU */ UCLASS_IRQ ,/* Interrupt controller */ UCLASS_KEYBOARD ,/* Keyboard input device */ UCLASS_LED, /* Light-emitting diode (LED) */include/iommu.h new file +16
-1@@ -0,0 +1,16 @@ +#ifndef _IOMMU_H +#define _IOMMU_H + +struct udevice ; + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) && \ +CONFIG_IS_ENABLED (IOMMU ) +int dev_iommu_probe (struct udevice *dev); +#else +static inline int dev_iommu_probe (struct udevice *dev) +{ +return 0 ; +} +#endif + +#endif --Quoted 2 lines
2.33.0
Regards,
Simon
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Hi Mark,
Quoted 157 lines · Mark Kettenis
Quoted 98 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 5 lines
The binding is available in
Documentation/bindings/iommu/iommu.txtin the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.
We do plan to sync these at some point, so don't worry about that. We have bigger problems than the bindings.
But without this it is not discoverable in U-Boot so no one knows what the driver is referring to.
Regards,
Simon
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Quoted 163 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:20:21 -0600Hi Mark,
Quoted 157 lines · Mark Kettenis
Quoted 98 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 8 lines
Quoted 5 lines
The binding is available in
Documentation/bindings/iommu/iommu.txtin the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.We do plan to sync these at some point, so don't worry about that. We have bigger problems than the bindings.
Well, at this point they're so much out of date that I don't look there unless I'm looking for someting that I know to be u-boot specific.
Quoted 2 lines
But without this it is not discoverable in U-Boot so no one knows what the driver is referring to.
Really? The canonical place for device tree bindings that aren't part of the device tree specification itself *is* the Linux kernel tree.
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Hi Mark,
Quoted 177 lines · Mark Kettenis
Quoted 164 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:20:21 -0600Hi Mark,
Quoted 157 lines · Mark Kettenis
Quoted 98 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 8 lines
Quoted 5 lines
The binding is available in
Documentation/bindings/iommu/iommu.txtin the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.We do plan to sync these at some point, so don't worry about that. We have bigger problems than the bindings.
Well, at this point they're so much out of date that I don't look there unless I'm looking for someting that I know to be u-boot specific.
Quoted 5 lines
Quoted 2 lines
But without this it is not discoverable in U-Boot so no one knows what the driver is referring to.
Really? The canonical place for device tree bindings that aren't part of the device tree specification itself *is* the Linux kernel tree.
Yes please, these should be in the U-Boot tree at this point. If they move out of the kernel into some other repo then we can revisit it. I don't really understand your reluctance. I hope that what you say will be true at some point, but as you probably know there are some U-Boot bindings which are not in that repo.
Regards,
Simon
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Quoted 186 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:55:19 -0600Hi Mark,
Quoted 180 lines · Mark Kettenis
Quoted 164 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:20:21 -0600Hi Mark,
Quoted 157 lines · Mark Kettenis
Quoted 98 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 8 lines
Quoted 5 lines
The binding is available in
Documentation/bindings/iommu/iommu.txtin the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.We do plan to sync these at some point, so don't worry about that. We have bigger problems than the bindings.
Well, at this point they're so much out of date that I don't look there unless I'm looking for someting that I know to be u-boot specific.
Quoted 2 lines
But without this it is not discoverable in U-Boot so no one knows what the driver is referring to.
Quoted 8 lines
Quoted 2 lines
Really? The canonical place for device tree bindings that aren't part of the device tree specification itself *is* the Linux kernel tree.
Yes please, these should be in the U-Boot tree at this point. If they move out of the kernel into some other repo then we can revisit it. I don't really understand your reluctance. I hope that what you say will be true at some point, but as you probably know there are some U-Boot bindings which are not in that repo.
Should I still add my Signed-off-by on files copied verbatim from the Linux kernel sources?
Re: [PATCH v2 1/7] iommu: Add IOMMU uclass
Hi Mark,
Quoted 190 lines · Mark Kettenis
Quoted 190 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:55:19 -0600Hi Mark,
Quoted 182 lines · Mark Kettenis
Quoted 164 lines
From: Simon Glass <[email protected]>
Date: Thu, 14 Oct 2021 14:20:21 -0600Hi Mark,
Quoted 157 lines · Mark Kettenis
Quoted 98 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:34 -0600Hi Mark,
Quoted 91 lines · Mark Kettenis
This uclass is intended to manage IOMMUs on systems where the IOMMUs are not in bypass mode by default. In that case U-Boot cannot ignore the IOMMUs if it wants to use devices that need to do DMA and sit behind such an IOMMU.
This initial IOMMU uclass implementation does not implement and device ops and is intended for IOMMUs that have a bypass mode that does not require address translation. Support for IOMMUs that do require address translation is planned and device ops will be defined when support for such IOMMUs will be added.
Signed-off-by Mark Kettenis <[email protected]>--- drivers/Kconfig | 2 ++ drivers/Makefile | 1 + drivers/core/device.c | 8 +++++++ drivers/iommu/Kconfig | 13 +++++++++++ drivers/iommu/Makefile | 3 +++ drivers/iommu/iommu-uclass.c | 45 ++++++++++++++++++++++++++++++++++++ include/dm/uclass-id.h | 1 + include/iommu.h | 16 +++++++++++++ 8 files changed, 89 insertions(+) create mode 100644 drivers/iommu/Kconfig create mode 100644 drivers/iommu/Makefile create mode 100644 drivers/iommu/iommu-uclass.c create mode 100644 include/iommu.hdrivers/Kconfig +2
-0@@ -50,6 +50,8 @@ source "drivers/i2c/Kconfig" source "drivers/input/Kconfig" +source "drivers/iommu/Kconfig" + source "drivers/led/Kconfig" source "drivers/mailbox/Kconfig"drivers/Makefile +1
-0@@ -109,6 +109,7 @@ obj-y += mtd/ obj-y += pwm/ obj-y += reset/ obj-y += input/ +obj-y += iommu/ # SOC specific infrastructure drivers. obj-y += smem/ obj-y += thermal/drivers/core/device.c +8
-0@@ -28,6 +28,7 @@#include <dm/uclass.h> #include <dm/uclass-internal.h> #include <dm/util.h> +#include <iommu.h> #include <linux/err.h> #include <linux/list.h> #include <power-domain.h> @@ -543,6 +544,13 @@ int device_probe(struct udevice *dev) goto fail; } +if (CONFIG_IS_ENABLED (IOMMU ) && dev->parent && + (device_get_uclass_id (dev) !=UCLASS_IOMMU )) { + ret =dev_iommu_probe (dev); +if (ret) + goto fail; + } + ret =device_get_dma_constraints (dev);if (ret) goto fail;drivers/iommu/Kconfig new file +6
-0@@ -0,0 +1,13 @@ +# +# IOMMU devices +# + +menu "IOMMU device drivers" +Quoted 8 lines
drivers/iommu/Kconfig line 11
Quoted 5 lines
drivers/iommu/Kconfig new file +5
-0+config IOMMU + bool "Enable Driver Model for IOMMU drivers" + depends on DM + help + Enable driver model for IOMMU devices.Need at least three lines. What is an IOMMU? How does it relate to other devices?
Not sure if I can describe what an IOMMU is in just a few lines, but I'll try.
Quoted 25 lines
Quoted 25 lines
drivers/iommu/Kconfig new file +2
-0+ +endmenudrivers/iommu/Makefile new file +3
-0@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-$(CONFIG_IOMMU) += iommu-uclass.odrivers/iommu/iommu-uclass.c new file +8
-0@@ -0,0 +1,45 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#define LOG_CATEGORY UCLASS_IOMMU + +#include <common.h> Quoted 8 lines
drivers/iommu/iommu-uclass.c line 12
Quoted 4 lines
drivers/iommu/iommu-uclass.c new file +4
-0+#include <dm.h> + +#if (CONFIG_IS_ENABLED (OF_CONTROL ) && !CONFIG_IS_ENABLED (OF_PLATDATA )) +int dev_iommu_probe (struct udevice *dev)Can we rename to
dev_iommus_enable()? I like to keep probe for use by DM itself so it is confusing to talk about probing in a context other than probing a single device.Sure. That was one of the names I considered myself when writing the code.
Quoted 9 lines
drivers/iommu/iommu-uclass.c line 19
Quoted 7 lines
drivers/iommu/iommu-uclass.c new file +7
-0+{ +struct ofnode_phandle_args args; +struct udevice *dev_iommu; +int i, count, ret =0 ; + + count =dev_count_phandle_with_args (dev,"iommus" , +"#iommu-cells" ,0 );Do you have a binding file you can add to docs/device-tree-bindings ?
Quoted 8 lines
Quoted 5 lines
The binding is available in
Documentation/bindings/iommu/iommu.txtin the Linux tree. But I don't think copying it into the u-boot tree makes sense. It will just get out of date. Especially because this will hopefully be converted into a proper DT schema in the near future.We do plan to sync these at some point, so don't worry about that. We have bigger problems than the bindings.
Well, at this point they're so much out of date that I don't look there unless I'm looking for someting that I know to be u-boot specific.
Quoted 2 lines
But without this it is not discoverable in U-Boot so no one knows what the driver is referring to.
Really? The canonical place for device tree bindings that aren't part of the device tree specification itself *is* the Linux kernel tree.
Quoted 8 lines
Quoted 5 lines
Yes please, these should be in the U-Boot tree at this point. If they move out of the kernel into some other repo then we can revisit it. I don't really understand your reluctance. I hope that what you say will be true at some point, but as you probably know there are some U-Boot bindings which are not in that repo.
Should I still add my Signed-off-by on files copied verbatim from the Linux kernel sources?
Yes that's my understanding..."The Signed-off-by: tag indicates that the signer was involved in the development of the patch, or that he/she was in the patch's delivery path"
That's why I sometimes add a tag when applying a patch, e.g. if I make a minor tweak.
Regards,
Simon
PATCH v2 2/7 test: Add tests for IOMMU uclass
In reply to Mark KettenisAdd a set of tests for the IOMMU uclass.
--- arch/sandbox/dts/test.dts | 6 ++++++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + drivers/iommu/Makefile | 2 ++ drivers/iommu/sandbox_iommu.c | 18 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/iommu.c | 28 ++++++++++++++++++++++++++++ 10 files changed, 60 insertions(+) create mode 100644 drivers/iommu/sandbox_iommu.c create mode 100644 test/dm/iommu.c
arch/sandbox/dts/test.dts +6 -0
@@ -752,6 +752,11 @@ vss-microvolts = <0>; }; + iommu: iommu@0 { + compatible = "sandbox,iommu"; + #iommu-cells = <0>; + }; + irq: irq { compatible = "sandbox,irq"; interrupt-controller;
@@ -1199,6 +1204,7 @@ usb_1: usb@1 { compatible = "sandbox,usb"; + iommus = <&iommu>; hub { compatible = "usb-hub"; usb,device-class = <9>;
configs/sandbox64_defconfig +1 -0
@@ -129,6 +129,7 @@ CONFIG_SPL_I2C_MUX=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_CROS_EC_KEYB=y CONFIG_I8042_KEYB=y +CONFIG_IOMMU=y CONFIG_LED=y CONFIG_LED_BLINK=y CONFIG_LED_GPIO=y
configs/sandbox_defconfig +1 -0
@@ -166,6 +166,7 @@ CONFIG_SPL_I2C_MUX=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_CROS_EC_KEYB=y CONFIG_I8042_KEYB=y +CONFIG_IOMMU=y CONFIG_LED=y CONFIG_LED_BLINK=y CONFIG_LED_GPIO=y
configs/sandbox_flattree_defconfig +1 -0
@@ -106,6 +106,7 @@ CONFIG_SPL_I2C_MUX=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_CROS_EC_KEYB=y CONFIG_I8042_KEYB=y +CONFIG_IOMMU=y CONFIG_LED=y CONFIG_LED_BLINK=y CONFIG_LED_GPIO=y
configs/sandbox_noinst_defconfig +1 -0
@@ -125,6 +125,7 @@ CONFIG_I2C_MUX=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_CROS_EC_KEYB=y CONFIG_I8042_KEYB=y +CONFIG_IOMMU=y CONFIG_LED=y CONFIG_LED_BLINK=y CONFIG_LED_GPIO=y
configs/sandbox_spl_defconfig +1 -0
@@ -127,6 +127,7 @@ CONFIG_I2C_MUX=y CONFIG_I2C_ARB_GPIO_CHALLENGE=y CONFIG_CROS_EC_KEYB=y CONFIG_I8042_KEYB=y +CONFIG_IOMMU=y CONFIG_LED=y CONFIG_LED_BLINK=y CONFIG_LED_GPIO=y
drivers/iommu/Makefile +2 -0
@@ -1,3 +1,5 @@ # SPDX-License-Identifier: GPL-2.0+ obj-$(CONFIG_IOMMU) += iommu-uclass.o + +obj-$(CONFIG_SANDBOX) += sandbox_iommu.o
drivers/iommu/sandbox_iommu.c new file +18 -0
@@ -0,0 +1,18 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#include <common.h> +#include <dm.h> + +static const struct udevice_id sandbox_iommu_ids[] = { + { .compatible ="sandbox,iommu" }, + {/* sentinel */ } +}; + +U_BOOT_DRIVER (sandbox_iommu) = { + .name ="sandbox_iommu" , + .id =UCLASS_IOMMU , + .of_match = sandbox_iommu_ids, +};
test/dm/Makefile +1 -0
@@ -48,6 +48,7 @@ obj-$(CONFIG_DM_I2C) += i2c.o obj-$(CONFIG_SOUND) += i2s.o obj-y += irq.o obj-$(CONFIG_CLK_K210_SET_RATE) += k210_pll.o +obj-$(CONFIG_IOMMU) += iommu.o obj-$(CONFIG_LED) += led.o obj-$(CONFIG_DM_MAILBOX) += mailbox.o obj-$(CONFIG_DM_MDIO) += mdio.o
test/dm/iommu.c new file +28 -0
@@ -0,0 +1,28 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* +* Copyright (C) 2021 Mark Kettenis <[email protected]> +*/ + +#include <common.h> +#include <dm.h> +#include <dm/test.h> +#include <dm/uclass-internal.h> +#include <iommu.h> +#include <test/test.h> +#include <test/ut.h> + +static int dm_test_iommu (struct unit_test_state *uts) +{ +struct udevice *dev; + +ut_assertok (uclass_find_device (UCLASS_IOMMU ,0 , &dev)); +ut_assert (!(dev_get_flags (dev) &DM_FLAG_ACTIVATED )); + +/* Probing USB probes the IOMMU through the "iommus" property */ +ut_assertok (uclass_probe_all (UCLASS_USB )); +ut_assert (dev_get_flags (dev) &DM_FLAG_ACTIVATED ); + +return 0 ; +} + +DM_TEST (dm_test_iommu,UT_TESTF_SCAN_FDT );
Signature · 1 line
2.33.0
Re: [PATCH v2 2/7] test: Add tests for IOMMU uclass
Quoted 4 lines · Mark Kettenis
Add a set of tests for the IOMMU uclass.
Signed-off-by Mark Kettenis <[email protected]>
Quoted 15 lines
--- arch/sandbox/dts/test.dts | 6 ++++++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + drivers/iommu/Makefile | 2 ++ drivers/iommu/sandbox_iommu.c | 18 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/iommu.c | 28 ++++++++++++++++++++++++++++ 10 files changed, 60 insertions(+) create mode 100644 drivers/iommu/sandbox_iommu.c create mode 100644 test/dm/iommu.c
You could add the CONFIG options to sandbox's Kconfig in arch/Kconfig
Re: [PATCH v2 2/7] test: Add tests for IOMMU uclass
Quoted 24 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:36 -0600Quoted 4 lines · Mark Kettenis
Add a set of tests for the IOMMU uclass.
Signed-off-by Mark Kettenis <[email protected]>Quoted 15 lines
--- arch/sandbox/dts/test.dts | 6 ++++++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + drivers/iommu/Makefile | 2 ++ drivers/iommu/sandbox_iommu.c | 18 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/iommu.c | 28 ++++++++++++++++++++++++++++ 10 files changed, 60 insertions(+) create mode 100644 drivers/iommu/sandbox_iommu.c create mode 100644 test/dm/iommu.c
Quoted 3 lines
Reviewed-by Simon Glass <[email protected]>You could add the CONFIG options to sandbox's
Kconfiginarch/Kconfig
The codebase is a bit inconsistent in that respect isn't it?
Re: [PATCH v2 2/7] test: Add tests for IOMMU uclass
Hi Mark,
Quoted 25 lines · Mark Kettenis
Quoted 25 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:36 -0600Quoted 19 lines · Mark Kettenis
Add a set of tests for the IOMMU uclass.
Signed-off-by Mark Kettenis <[email protected]>--- arch/sandbox/dts/test.dts | 6 ++++++ configs/sandbox64_defconfig | 1 + configs/sandbox_defconfig | 1 + configs/sandbox_flattree_defconfig | 1 + configs/sandbox_noinst_defconfig | 1 + configs/sandbox_spl_defconfig | 1 + drivers/iommu/Makefile | 2 ++ drivers/iommu/sandbox_iommu.c | 18 ++++++++++++++++++ test/dm/Makefile | 1 + test/dm/iommu.c | 28 ++++++++++++++++++++++++++++ 10 files changed, 60 insertions(+) create mode 100644 drivers/iommu/sandbox_iommu.c create mode 100644 test/dm/iommu.c
Quoted 5 lines
Quoted 3 lines
Reviewed-by Simon Glass <[email protected]>You could add the CONFIG options to sandbox's
Kconfiginarch/KconfigThe codebase is a bit inconsistent in that respect isn't it?
Do you mean sometimes it is in defconfig and sometimes in Kconfig? Yes.
For the sandbox board, we try to enable everything
For the other boards that use the sandbox arch, we have to enable what is needed to run tests, but not necessarily every feature
Regards,
Simon
PATCH v2 3/7 arm: apple: Add initial support for Apple's M1 SoC
In reply to Mark KettenisAdd support for Apple's M1 SoC that is used in "Apple Silicon" Macs. This builds a basic U-Boot that can be used as a payload for the m1n1 boot loader being developed by the Asahi Linux project.
--- arch/arm/Kconfig | 21 ++++ arch/arm/Makefile | 1 + arch/arm/mach-apple/Kconfig | 18 ++++ arch/arm/mach-apple/Makefile | 4 + arch/arm/mach-apple/board.c | 161 ++++++++++++++++++++++++++++ arch/arm/mach-apple/lowlevel_init.S | 17 +++ configs/apple_m1_defconfig | 14 +++ include/configs/apple.h | 38 +++++++ 8 files changed, 274 insertions(+) create mode 100644 arch/arm/mach-apple/Kconfig create mode 100644 arch/arm/mach-apple/Makefile create mode 100644 arch/arm/mach-apple/board.c create mode 100644 arch/arm/mach-apple/lowlevel_init.S create mode 100644 configs/apple_m1_defconfig create mode 100644 include/configs/apple.h
arch/arm/Kconfig +21 -0
@@ -895,6 +895,25 @@ config ARCH_NEXELL select DM select GPIO_EXTRA_HEADER +config ARCH_APPLE + bool "Apple SoCs" + select ARM64 + select BLK + select CMD_USB + select DM + select DM_KEYBOARD + select DM_SERIAL + select DM_USB + select DM_VIDEO + select LINUX_KERNEL_IMAGE_HEADER + select OF_CONTROL + select OF_BOARD + select POSITION_INDEPENDENT + select USB + imply CMD_DM + imply CMD_GPT + imply DISTRO_DEFAULTS + config ARCH_OWL bool "Actions Semi OWL SoCs" select DM
@@ -1932,6 +1951,8 @@ config ISW_ENTRY_ADDR image headers. endif +source "arch/arm/mach-apple/Kconfig" + source "arch/arm/mach-aspeed/Kconfig" source "arch/arm/mach-at91/Kconfig"
arch/arm/Makefile +1 -0
@@ -51,6 +51,7 @@ PLATFORM_CPPFLAGS += $(arch-y) $(tune-y) # Machine directory name. This list is sorted alphanumerically # by CONFIG_* macro name. +machine-$(CONFIG_ARCH_APPLE) += apple machine-$(CONFIG_ARCH_ASPEED) += aspeed machine-$(CONFIG_ARCH_AT91) += at91 machine-$(CONFIG_ARCH_BCM283X) += bcm283x
arch/arm/mach-apple/Kconfig new file +18 -0
@@ -0,0 +1,18 @@ +if ARCH_APPLE + +config SYS_TEXT_BASE + default 0x00000000 + +config SYS_CONFIG_NAME + default "apple" + +config SYS_SOC + default "m1" + +config SYS_MALLOC_LEN + default 0x4000000 + +config SYS_MALLOC_F_LEN + default 0x4000 + +endif
arch/arm/mach-apple/Makefile new file +4 -0
@@ -0,0 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0+ + +obj-y += board.o +obj-y += lowlevel_init.o
arch/arm/mach-apple/board.c new file +161 -0
161 lines not on this page · raw message
arch/arm/mach-apple/lowlevel_init.S new file +17 -0
@@ -0,0 +1,17 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * (C) Copyright 2021 Mark Kettenis <[email protected]> + */ + +.align 8 +.global fw_dtb_pointer +fw_dtb_pointer: + .quad 0 + +.global save_boot_params +save_boot_params: + /* Stash DTB pointer passed by m1n1 */ + adr x1, fw_dtb_pointer + str x0, [x1] + + b save_boot_params_ret
configs/apple_m1_defconfig new file +14 -0
@@ -0,0 +1,14 @@ +CONFIG_ARM=y +CONFIG_ARCH_APPLE=y +# CONFIG_DISPLAY_CPUINFO is not set +# CONFIG_MMC is not set +# CONFIG_NET is not set +CONFIG_VIDEO_SIMPLE=y +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_XHCI_DWC3=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_STORAGE=y +CONFIG_USE_PREBOOT=y +CONFIG_PREBOOT="usb start" +# CONFIG_GENERATE_SMBIOS_TABLE is not set
include/configs/apple.h new file +38 -0
@@ -0,0 +1,38 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#include <linux/sizes.h> + +#define CONFIG_SYS_LOAD_ADDR 0x880000000 + +#define CONFIG_SYS_SDRAM_BASE 0x880000000 + +#define CONFIG_LNX_KRNL_IMG_TEXT_OFFSET_BASE CONFIG_SYS_TEXT_BASE + +/* Environment */ +#define ENV_DEVICE_SETTINGS \ + "stdin=serial,usbkbd\0" \ + "stdout=serial,vidconsole\0" \ + "stderr=serial,vidconsole\0" + +#define ENV_MEM_LAYOUT_SETTINGS \ + "fdt_addr_r=0x960100000\0" \ + "kernel_addr_r=0x960200000\0" + +#if CONFIG_IS_ENABLED (CMD_USB ) +#define BOOT_TARGET_USB (func) func(USB, usb, 0) +#else +#define BOOT_TARGET_USB (func) +#endif + +#define BOOT_TARGET_DEVICES (func) \ + BOOT_TARGET_USB(func) + +#include <config_distro_bootcmd.h> + +#define CONFIG_EXTRA_ENV_SETTINGS \ + ENV_DEVICE_SETTINGS \ + ENV_MEM_LAYOUT_SETTINGS \ + BOOTENV + +#endif
Signature · 1 line
2.33.0
Re: [PATCH v2 3/7] arm: apple: Add initial support for Apple's M1 SoC
Quoted 7 lines · Mark Kettenis
Add support for Apple's M1 SoC that is used in "Apple Silicon" Macs. This builds a basic U-Boot that can be used as a payload for the m1n1 boot loader being developed by the Asahi Linux project.
Signed-off-by Mark Kettenis <[email protected]>
Quoted 16 lines
--- arch/arm/Kconfig | 21 ++++ arch/arm/Makefile | 1 + arch/arm/mach-apple/Kconfig | 18 ++++ arch/arm/mach-apple/Makefile | 4 + arch/arm/mach-apple/board.c | 161 ++++++++++++++++++++++++++++ arch/arm/mach-apple/lowlevel_init.S | 17 +++ configs/apple_m1_defconfig | 14 +++ include/configs/apple.h | 38 +++++++ 8 files changed, 274 insertions(+) create mode 100644 arch/arm/mach-apple/Kconfig create mode 100644 arch/arm/mach-apple/Makefile create mode 100644 arch/arm/mach-apple/board.c create mode 100644 arch/arm/mach-apple/lowlevel_init.S create mode 100644 configs/apple_m1_defconfig create mode 100644 include/configs/apple.h
As mentioned, please convert to a sysreset driver soon, before the release.
PATCH v2 4/7 serial: s5p: Add Apple M1 support
In reply to Mark KettenisApple M1 SoCs include an S5L UART which is a variant of the S5P UART. Add support for this variant and enable it by default on Apple SoCs.
--- arch/arm/Kconfig | 1 + arch/arm/include/asm/arch-m1/uart.h | 41 +++++++++++ configs/apple_m1_defconfig | 4 ++ drivers/serial/Kconfig | 4 +- drivers/serial/serial_s5p.c | 104 ++++++++++++++++++++++------ 5 files changed, 130 insertions(+), 24 deletions(-) create mode 100644 arch/arm/include/asm/arch-m1/uart.h
arch/arm/Kconfig +1 -0
@@ -899,6 +899,7 @@ config ARCH_APPLE bool "Apple SoCs" select ARM64 select BLK + select CLK select CMD_USB select DM select DM_KEYBOARD
arch/arm/include/asm/arch-m1/uart.h new file +41 -0
41 lines not on this page · raw message
configs/apple_m1_defconfig +4 -0
@@ -12,3 +12,7 @@ CONFIG_USB_STORAGE=y CONFIG_USE_PREBOOT=y CONFIG_PREBOOT="usb start" # CONFIG_GENERATE_SMBIOS_TABLE is not set +CONFIG_DEBUG_UART=y +CONFIG_DEBUG_UART_ANNOUNCE=y +CONFIG_DEBUG_UART_BASE=0x235200000 +CONFIG_DEBUG_UART_CLOCK=240000
drivers/serial/Kconfig +2 -2
@@ -272,7 +272,7 @@ config DEBUG_EFI_CONSOLE config DEBUG_UART_S5P bool "Samsung S5P" - depends on ARCH_EXYNOS || ARCH_S5PC1XX + depends on ARCH_APPLE || ARCH_EXYNOS || ARCH_S5PC1XX help Select this to enable a debug UART using the serial_s5p driver. You will need to provide parameters to make this work. The driver will
@@ -719,7 +719,7 @@ config ROCKCHIP_SERIAL config S5P_SERIAL bool "Support for Samsung S5P UART" - depends on ARCH_EXYNOS || ARCH_S5PC1XX + depends on ARCH_APPLE || ARCH_EXYNOS || ARCH_S5PC1XX default y help Select this to enable Samsung S5P UART support.
drivers/serial/serial_s5p.c +82 -22
201 lines not on this page · raw message
Signature · 1 line
2.33.0
Re: [PATCH v2 4/7] serial: s5p: Add Apple M1 support
Hi Mark,
Quoted 6 lines · Mark Kettenis
Apple M1 SoCs include an S5L UART which is a variant of the S5P UART. Add support for this variant and enable it by default on Apple SoCs.
Signed-off-by Mark Kettenis <[email protected]>
Quoted 9 lines
--- arch/arm/Kconfig | 1 + arch/arm/include/asm/arch-m1/uart.h | 41 +++++++++++ configs/apple_m1_defconfig | 4 ++ drivers/serial/Kconfig | 4 +- drivers/serial/serial_s5p.c | 104 ++++++++++++++++++++++------ 5 files changed, 130 insertions(+), 24 deletions(-) create mode 100644 arch/arm/include/asm/arch-m1/uart.h
Quoted 4 lines
drivers/serial/serial_s5p.c +0
-0
[..]
drivers/serial/serial_s5p.c int s5p_serial_setbrg(struct udevice *dev, int baudrate) · line 119
Quoted 6 lines
drivers/serial/serial_s5p.c +1
-1@@ -93,7 +116,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate)struct s5p_uart *const uart = plat->reg;u32 uclk; -#ifdef CONFIG_CLK_EXYNOS +#if CONFIG_IS_ENABLED (CLK_EXYNOS ) ||CONFIG_IS_ENABLED (ARCH_APPLE )
I really don't like making this any worse.
Does this work?
ret = clk_get_by_index(...)
if (ret && ret != -ENOSYS)
return ret
drivers/serial/serial_s5p.c int s5p_serial_setbrg(struct udevice *dev, int baudrate) · line 134
Quoted 12 lines
drivers/serial/serial_s5p.c +1
-1struct clk clk;u32 ret;@@ -105,7 +128,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate) uclk =get_uart_clk (plat->port_id);#endif -s5p_serial_baud (uart, uclk, baudrate); +s5p_serial_baud (uart, plat->reg_width, uclk, baudrate);return 0 ; }
[..]
Regards,
Simon
Re: [PATCH v2 4/7] serial: s5p: Add Apple M1 support
Quoted 39 lines
From: Simon Glass <[email protected]>
Date: Mon, 11 Oct 2021 11:00:39 -0600Hi Mark,
Quoted 6 lines · Mark Kettenis
Apple M1 SoCs include an S5L UART which is a variant of the S5P UART. Add support for this variant and enable it by default on Apple SoCs.
Signed-off-by Mark Kettenis <[email protected]>Quoted 9 lines
--- arch/arm/Kconfig | 1 + arch/arm/include/asm/arch-m1/uart.h | 41 +++++++++++ configs/apple_m1_defconfig | 4 ++ drivers/serial/Kconfig | 4 +- drivers/serial/serial_s5p.c | 104 ++++++++++++++++++++++------ 5 files changed, 130 insertions(+), 24 deletions(-) create mode 100644 arch/arm/include/asm/arch-m1/uart.hReviewed-by Simon Glass <[email protected]>[..]Quoted 4 lines
drivers/serial/serial_s5p.c +0
-0[..]
drivers/serial/serial_s5p.c int s5p_serial_setbrg(struct udevice *dev, int baudrate) · line 119
Quoted 6 lines
drivers/serial/serial_s5p.c +1
-1@@ -93,7 +116,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate)struct s5p_uart *const uart = plat->reg;u32 uclk; -#ifdef CONFIG_CLK_EXYNOS +#if CONFIG_IS_ENABLED (CLK_EXYNOS ) ||CONFIG_IS_ENABLED (ARCH_APPLE )I really don't like making this any worse.
Quoted 5 lines
Does this work?
ret =
clk_get_by_index(...)
if (ret && ret !=-ENOSYS)
return ret
The problem really is that I'm trying to avoid having to define get_uart_clock() for the new platform. So I need an #if of some sorts to avoid that code. I really think the current diff is the cleanest I can come up.
Quoted 17 lines
drivers/serial/serial_s5p.c int s5p_serial_setbrg(struct udevice *dev, int baudrate) · line 134
Quoted 12 lines
drivers/serial/serial_s5p.c +1
-1struct clk clk;u32 ret;@@ -105,7 +128,7 @@ int s5p_serial_setbrg(struct udevice *dev, int baudrate) uclk =get_uart_clk (plat->port_id);#endif -s5p_serial_baud (uart, uclk, baudrate); +s5p_serial_baud (uart, plat->reg_width, uclk, baudrate);return 0 ; }[..]
Regards,
Simon
PATCH v2 5/7 iommu: Add Apple DART driver
In reply to Mark KettenisThe DART is an IOMMU that is used on Apple's M1 SoC. This driver configures the DART such that it operates in bypass mode which is enough to support DMA for the USB3 ports integrated on the SoC.
--- arch/arm/Kconfig | 1 + drivers/iommu/Kconfig | 10 +++++++ drivers/iommu/Makefile | 1 + drivers/iommu/apple_dart.c | 59 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 drivers/iommu/apple_dart.c
arch/arm/Kconfig +1 -0
@@ -906,6 +906,7 @@ config ARCH_APPLE select DM_SERIAL select DM_USB select DM_VIDEO + select IOMMU select LINUX_KERNEL_IMAGE_HEADER select OF_CONTROL select OF_BOARD
drivers/iommu/Kconfig +10 -0
@@ -10,4 +10,14 @@ config IOMMU help Enable driver model for IOMMU devices. +config APPLE_DART + bool "Apple DART support" + depends on IOMMU && ARCH_APPLE + default y + help + Enable support for the DART on Apple SoCs. The DART is Apple's + IOMMU implementation. The driver performs the necessary + configuration to put the DART into bypass mode such that it can + be used transparently by U-Boot. + endmenu
drivers/iommu/Makefile +1 -0
@@ -2,4 +2,5 @@ obj-$(CONFIG_IOMMU) += iommu-uclass.o +obj-$(CONFIG_APPLE_DART) += apple_dart.o obj-$(CONFIG_SANDBOX) += sandbox_iommu.o
drivers/iommu/apple_dart.c new file +59 -0
59 lines not on this page · raw message
Signature · 1 line
2.33.0
Re: [PATCH v2 5/7] iommu: Add Apple DART driver
Quoted 5 lines · Mark Kettenis
The DART is an IOMMU that is used on Apple's M1 SoC. This driver configures the DART such that it operates in bypass mode which is enough to support DMA for the USB3 ports integrated on the SoC.
Quoted 9 lines
Signed-off-by Mark Kettenis <[email protected]>--- arch/arm/Kconfig | 1 + drivers/iommu/Kconfig | 10 +++++++ drivers/iommu/Makefile | 1 + drivers/iommu/apple_dart.c | 59 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 71 insertions(+) create mode 100644 drivers/iommu/apple_dart.c
PATCH v2 6/7 arm: dts: apple: Add preliminary device trees
In reply to Mark KettenisAdd preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
--- arch/arm/dts/Makefile | 4 + arch/arm/dts/t8103-j274.dts | 135 +++++ arch/arm/dts/t8103-j293.dts | 97 +++ arch/arm/dts/t8103.dtsi | 560 ++++++++++++++++++ configs/apple_m1_defconfig | 1 + .../interrupt-controller/apple-aic.h | 15 + include/dt-bindings/pinctrl/apple.h | 13 + include/dt-bindings/spmi/spmi.h | 10 + 8 files changed, 835 insertions(+) create mode 100644 arch/arm/dts/t8103-j274.dts create mode 100644 arch/arm/dts/t8103-j293.dts create mode 100644 arch/arm/dts/t8103.dtsi create mode 100644 include/dt-bindings/interrupt-controller/apple-aic.h create mode 100644 include/dt-bindings/pinctrl/apple.h create mode 100644 include/dt-bindings/spmi/spmi.h
arch/arm/dts/Makefile +4 -0
@@ -29,6 +29,10 @@ dtb-$(CONFIG_EXYNOS5) += exynos5250-arndale.dtb \ exynos5422-odroidxu3.dtb dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb +dtb-$(CONFIG_ARCH_APPLE) += \ + t8103-j274.dtb \ + t8103-j293.dtb + dtb-$(CONFIG_ARCH_DAVINCI) += \ da850-evm.dtb \ da850-lcdk.dtb \
arch/arm/dts/t8103-j274.dts new file +135 -0
135 lines not on this page · raw message
arch/arm/dts/t8103-j293.dts new file +97 -0
97 lines not on this page · raw message
arch/arm/dts/t8103.dtsi new file +560 -0
560 lines not on this page · raw message
configs/apple_m1_defconfig +1 -0
@@ -1,5 +1,6 @@ CONFIG_ARM=y CONFIG_ARCH_APPLE=y +CONFIG_DEFAULT_DEVICE_TREE="t8103-j274" # CONFIG_DISPLAY_CPUINFO is not set # CONFIG_MMC is not set # CONFIG_NET is not set
include/dt-bindings/interrupt-controller/apple-aic.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause */ +#ifndef _DT_BINDINGS_INTERRUPT_CONTROLLER_APPLE_AIC_H +#define _DT_BINDINGS_INTERRUPT_CONTROLLER_APPLE_AIC_H + +#include <dt-bindings/interrupt-controller/irq.h> + +#define AIC_IRQ 0 +#define AIC_FIQ 1 + +#define AIC_TMR_HV_PHYS 0 +#define AIC_TMR_HV_VIRT 1 +#define AIC_TMR_GUEST_PHYS 2 +#define AIC_TMR_GUEST_VIRT 3 + +#endif
include/dt-bindings/pinctrl/apple.h new file +13 -0
@@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ OR MIT */ +/* +* This header provides constants for Apple pinctrl bindings. +*/ + +#ifndef _DT_BINDINGS_PINCTRL_APPLE_H +#define _DT_BINDINGS_PINCTRL_APPLE_H + +#define APPLE_PINMUX (pin, func) ((pin) | ((func) << 16)) +#define APPLE_PIN (pinmux) ((pinmux) & 0xffff) +#define APPLE_FUNC (pinmux) ((pinmux) >> 16) + +#endif /* _DT_BINDINGS_PINCTRL_APPLE_H */
include/dt-bindings/spmi/spmi.h new file +10 -0
@@ -0,0 +1,10 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +*/ +#ifndef __DT_BINDINGS_SPMI_H +#define __DT_BINDINGS_SPMI_H + +#define SPMI_USID 0 +#define SPMI_GSID 1 + +#endif
Signature · 1 line
2.33.0
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
Quoted 10 lines · Mark Kettenis
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
Signed-off-by Mark Kettenis <[email protected]>
Quoted 17 lines
--- arch/arm/dts/Makefile | 4 + arch/arm/dts/t8103-j274.dts | 135 +++++ arch/arm/dts/t8103-j293.dts | 97 +++ arch/arm/dts/t8103.dtsi | 560 ++++++++++++++++++ configs/apple_m1_defconfig | 1 + .../interrupt-controller/apple-aic.h | 15 + include/dt-bindings/pinctrl/apple.h | 13 + include/dt-bindings/spmi/spmi.h | 10 + 8 files changed, 835 insertions(+) create mode 100644 arch/arm/dts/t8103-j274.dts create mode 100644 arch/arm/dts/t8103-j293.dts create mode 100644 arch/arm/dts/t8103.dtsi create mode 100644 include/dt-bindings/interrupt-controller/apple-aic.h create mode 100644 include/dt-bindings/pinctrl/apple.h create mode 100644 include/dt-bindings/spmi/spmi.h
Rob Herring
maintainerRe: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
In reply to Mark KettenisQuoted 5 lines · Mark Kettenis
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
Rob
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
Hi Rob,
Quoted 14 lines · Rob Herring
Quoted 5 lines · Mark Kettenis
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
Quoted 8 lines
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
This is something I have brought in, as U-Boot DT maintainer, to provide some sort of reference in U-Boot as to what is actually built. It allows people to see the devices and also ensures that the build system does build a devicetree. The existing OF_PRIOR_STAGE is being removed and OF_BOARD is becoming a bool, with OF_SEPARATE the standard approach.
We have a few examples where this is not done (e.g. qemu-arm) but I am working on fixing that. It has led to discussions about whether U-Boot is entitled to having its own things in the DT, etc. etc. The whole area is in flux at present. If you want some background:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
Regards,
Simon
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
In reply to Rob HerringQuoted 2 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 13:36:29 -0500
Hi Rob,
Quoted 9 lines · Mark Kettenis
Quoted 5 lines
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Not synched at the moment. It is based on what was in 5.13 or 5.14, but with lots of stuff added so specifying a version would be misleading. It should be mostly aligned with the bindings that are making their way into 5.15 or 5.16 though.
Hopefully now that the power domains are getting addressed we'll have something that can be synchronized soon. I was explicitly encouraged to start upstreaming the U-Boot code even though not all the DT bindings had been sorted out.
Quoted 6 lines
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
The U-Boot maintainers insist there is a DT for each supported system in the U-Boot tree.
Quoted 4 lines
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
You're preaching to the choir ;).
Must admit that it is somewhat convenient for me to have a somewhat complete DT for these devices at the moment. But in the long run I think it will just confuse people. That said, I plan to be aggressive in keeping the U-Boot tree synchronized with Linux.
Cheers,
Mark
Rob Herring
maintainerRe: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
Quoted 13 lines · Mark Kettenis
Quoted 3 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 13:36:29 -0500Hi Rob,
Quoted 7 lines · Mark Kettenis
Quoted 5 lines
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
Quoted 7 lines
Quoted 2 lines
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Not synched at the moment. It is based on what was in 5.13 or 5.14, but with lots of stuff added so specifying a version would be misleading. It should be mostly aligned with the bindings that are making their way into 5.15 or 5.16 though.
This and what's added or preliminary would be good to have in the commit msg.
Quoted 4 lines
Hopefully now that the power domains are getting addressed we'll have something that can be synchronized soon. I was explicitly encouraged to start upstreaming the U-Boot code even though not all the DT bindings had been sorted out.
In general, sounds like a recipe for getting out of sync and bindings never getting documented properly without any checks in place. The good news is checking that is at least possible now.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
The U-Boot maintainers insist there is a DT for each supported system in the U-Boot tree.
Ok, fair enough.
Quoted 6 lines
Quoted 4 lines
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
You're preaching to the choir ;).
Good.
Quoted 4 lines
Must admit that it is somewhat convenient for me to have a somewhat complete DT for these devices at the moment. But in the long run I think it will just confuse people. That said, I plan to be aggressive in keeping the U-Boot tree synchronized with Linux.
What I'd like to see here is some sort of automatic synchronization. The idea I have here is just a list of boards to sync from the kernel tree to wherever. The requirement to get on the list would be passing schema validation and would be a declaration of stability (there's been numerous discussions over the years of how to declare a DT stable or unstable). It would perhaps also include passing validation on an older schema. I'm not sure how well that would catch compatibility issues, but that's the only idea I've come up with besides just testing of mixed versions. I'm happy to do the tooling to support that if we have a board/device to put in the list and u-boot folks agree to use it. I suppose even if just m1n1 used it to start with, I'd be willing to do the tooling.
Rob
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
Hi Rob,
Quoted 60 lines · Rob Herring
Quoted 13 lines · Mark Kettenis
Quoted 3 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 13:36:29 -0500Hi Rob,
Quoted 7 lines · Mark Kettenis
Quoted 5 lines
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
Quoted 7 lines
Quoted 2 lines
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Not synched at the moment. It is based on what was in 5.13 or 5.14, but with lots of stuff added so specifying a version would be misleading. It should be mostly aligned with the bindings that are making their way into 5.15 or 5.16 though.
This and what's added or preliminary would be good to have in the commit msg.
Quoted 4 lines
Hopefully now that the power domains are getting addressed we'll have something that can be synchronized soon. I was explicitly encouraged to start upstreaming the U-Boot code even though not all the DT bindings had been sorted out.
In general, sounds like a recipe for getting out of sync and bindings never getting documented properly without any checks in place. The good news is checking that is at least possible now.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
The U-Boot maintainers insist there is a DT for each supported system in the U-Boot tree.
Ok, fair enough.
Quoted 6 lines
Quoted 4 lines
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
You're preaching to the choir ;).
Good.
Quoted 4 lines
Must admit that it is somewhat convenient for me to have a somewhat complete DT for these devices at the moment. But in the long run I think it will just confuse people. That said, I plan to be aggressive in keeping the U-Boot tree synchronized with Linux.
Quoted 12 lines
What I'd like to see here is some sort of automatic synchronization. The idea I have here is just a list of boards to sync from the kernel tree to wherever. The requirement to get on the list would be passing schema validation and would be a declaration of stability (there's been numerous discussions over the years of how to declare a DT stable or unstable). It would perhaps also include passing validation on an older schema. I'm not sure how well that would catch compatibility issues, but that's the only idea I've come up with besides just testing of mixed versions. I'm happy to do the tooling to support that if we have a board/device to put in the list and u-boot folks agree to use it. I suppose even if just m1n1 used it to start with, I'd be willing to do the tooling.
That sounds great to me. Yes m1n1 is a good first target since it is new, but I'm pretty sure there are quite a few other SoCs that could move over right away.
Ideally we would add it to U-Boot CI too, so that pull requests warn or fail if something wrong is added. Of course it is probably a no-no to make U-Boot CI due to comparisons with another tree over which we have no control, but perhaps we can head in that direction.
+Tom Rini too as he has been looking at this.
Regards,
Simon
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
Quoted 80 lines · Simon Glass
Hi Rob,
Quoted 60 lines · Rob Herring
Quoted 13 lines · Mark Kettenis
Quoted 3 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 13:36:29 -0500Hi Rob,
Quoted 7 lines · Mark Kettenis
Quoted 5 lines
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
Quoted 7 lines
Quoted 2 lines
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Not synched at the moment. It is based on what was in 5.13 or 5.14, but with lots of stuff added so specifying a version would be misleading. It should be mostly aligned with the bindings that are making their way into 5.15 or 5.16 though.
This and what's added or preliminary would be good to have in the commit msg.
Quoted 4 lines
Hopefully now that the power domains are getting addressed we'll have something that can be synchronized soon. I was explicitly encouraged to start upstreaming the U-Boot code even though not all the DT bindings had been sorted out.
In general, sounds like a recipe for getting out of sync and bindings never getting documented properly without any checks in place. The good news is checking that is at least possible now.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
The U-Boot maintainers insist there is a DT for each supported system in the U-Boot tree.
Ok, fair enough.
Quoted 6 lines
Quoted 4 lines
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
You're preaching to the choir ;).
Good.
Quoted 4 lines
Must admit that it is somewhat convenient for me to have a somewhat complete DT for these devices at the moment. But in the long run I think it will just confuse people. That said, I plan to be aggressive in keeping the U-Boot tree synchronized with Linux.
Quoted 12 lines
What I'd like to see here is some sort of automatic synchronization. The idea I have here is just a list of boards to sync from the kernel tree to wherever. The requirement to get on the list would be passing schema validation and would be a declaration of stability (there's been numerous discussions over the years of how to declare a DT stable or unstable). It would perhaps also include passing validation on an older schema. I'm not sure how well that would catch compatibility issues, but that's the only idea I've come up with besides just testing of mixed versions. I'm happy to do the tooling to support that if we have a board/device to put in the list and u-boot folks agree to use it. I suppose even if just m1n1 used it to start with, I'd be willing to do the tooling.
That sounds great to me. Yes m1n1 is a good first target since it is new, but I'm pretty sure there are quite a few other SoCs that could move over right away.
Quoted 6 lines
Ideally we would add it to U-Boot CI too, so that pull requests warn or fail if something wrong is added. Of course it is probably a no-no to make U-Boot CI due to comparisons with another tree over which we have no control, but perhaps we can head in that direction.
+Tom Rini too as he has been looking at this.
I guess the first priority is that so long as _everything_ is in sync, it doesn't super matter if we have an otherwise redundant copy of files in-tree.
And we need to get our DTS files back in sync with upstream, which is the case for some platforms, and not others. But once we get that sorted out, we need to do more regular resyncs, and hopefully once DTS files have settled down, because they all pass validation and for example incorrect names get fixed, it will be less of an issue to more automatically resync DTS files, that are fully validated at least.
Signature · 1 line
Tom
Re: [PATCH v2 6/7] arm: dts: apple: Add preliminary device trees
In reply to Rob HerringQuoted 2 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 14:48:46 -0500
Hi Rob,
Trimming the CC list a bit and adding marcan.
Quoted 17 lines · Mark Kettenis
Quoted 16 lines
Quoted 3 lines
From: Rob Herring <[email protected]>
Date: Mon, 11 Oct 2021 13:36:29 -0500Hi Rob,
Quoted 9 lines · Mark Kettenis
Quoted 5 lines
Add preliminary device trees for the Apple M1 mini (2020) and Apple M1 Macbook Pro 13" (2020). Device tree bindings for the Apple M1 SoC are still being formalized and these device trees will be synchronized with the Linux kernel as needed.
So not synchronized currently? If it is sync'ed, you should specify which version you got.
Quoted 6 lines
Quoted 4 lines
Not synched at the moment. It is based on what was in 5.13 or 5.14, but with lots of stuff added so specifying a version would be misleading. It should be mostly aligned with the bindings that are making their way into 5.15 or 5.16 though.
This and what's added or preliminary would be good to have in the commit msg.
Sure. I added that information to the commit message for v4.
Quoted 35 lines
Quoted 4 lines
Hopefully now that the power domains are getting addressed we'll have something that can be synchronized soon. I was explicitly encouraged to start upstreaming the U-Boot code even though not all the DT bindings had been sorted out.
In general, sounds like a recipe for getting out of sync and bindings never getting documented properly without any checks in place. The good news is checking that is at least possible now.
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
These device trees are provided as a reference only as U-Boot uses the device tree passed by the m1n1 bootloader.
If reference only, why do they need to be checked in here? We're trying to get to fewer copies both of dtbs at runtime and dts files in source trees.
The U-Boot maintainers insist there is a DT for each supported system in the U-Boot tree.
Ok, fair enough.
Quoted 6 lines
Quoted 4 lines
I mainly bring it up here because this is a platform with multiple OS targets, following the model that DT comes from the firmware, and should be free of schema validation warnings. In other words, it's a good candidate to define best practices.
You're preaching to the choir ;).
Good.
Quoted 4 lines
Must admit that it is somewhat convenient for me to have a somewhat complete DT for these devices at the moment. But in the long run I think it will just confuse people. That said, I plan to be aggressive in keeping the U-Boot tree synchronized with Linux.
Quoted 12 lines
What I'd like to see here is some sort of automatic synchronization. The idea I have here is just a list of boards to sync from the kernel tree to wherever. The requirement to get on the list would be passing schema validation and would be a declaration of stability (there's been numerous discussions over the years of how to declare a DT stable or unstable). It would perhaps also include passing validation on an older schema. I'm not sure how well that would catch compatibility issues, but that's the only idea I've come up with besides just testing of mixed versions. I'm happy to do the tooling to support that if we have a board/device to put in the list and u-boot folks agree to use it. I suppose even if just m1n1 used it to start with, I'd be willing to do the tooling.
Sounds interesting.
One of the things we would want to do a ship device trees for new models with m1n1 as soon as we get our hands on the hardware such that the they can be used with existing distro kernels as soon as possible. Under the assumption that the new hardware is compatible with the old of course. That means those new device trees should pass validation.
But as soon as the device tree for a model is available in the Linux tree, we probably want to be rather strict in synching it to m1n1.
Thanks,
Mark
PATCH v2 7/7 doc: board: apple: Add Apple M1 documentation
In reply to Mark KettenisProvide preliminary instructions on how to get U-Boot to run on Apple Silicon Macs.
--- doc/board/apple/index.rst | 9 +++++++ doc/board/apple/m1.rst | 56 +++++++++++++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 3 files changed, 66 insertions(+) create mode 100644 doc/board/apple/index.rst create mode 100644 doc/board/apple/m1.rst
doc/board/apple/index.rst new file +9 -0
@@ -0,0 +1,9 @@ +.. SPDX-License-Identifier: GPL-2.0+ + +Apple +===== + +.. toctree:: + :maxdepth: 2 + + m1
doc/board/apple/m1.rst new file +56 -0
56 lines not on this page · raw message
doc/board/index.rst +1 -0
@@ -10,6 +10,7 @@ Board-specific doc advantech/index AndesTech/index amlogic/index + apple/index atmel/index congatec/index coreboot/index
Signature · 1 line
2.33.0
Re: [PATCH v2 7/7] doc: board: apple: Add Apple M1 documentation
Quoted 4 lines · Mark Kettenis
Provide preliminary instructions on how to get U-Boot to run on Apple Silicon Macs.
Quoted 8 lines
Signed-off-by Mark Kettenis <[email protected]>--- doc/board/apple/index.rst | 9 +++++++ doc/board/apple/m1.rst | 56 +++++++++++++++++++++++++++++++++++++++ doc/board/index.rst | 1 + 3 files changed, 66 insertions(+) create mode 100644 doc/board/apple/index.rst create mode 100644 doc/board/apple/m1.rst
Hi Mark,
Quoted 6 lines · Mark Kettenis
This series adds basic support for Apple's M1 SoC to U-Boot. This builds a basic U-Boot that can be used as a payload for the m1n1 boot loader being developed by the Asahi Linux project.
Quoted 8 lines
The goal here is to privide an UEFI interface on these machines that allows booting various open source OSes. This initial series provides support for the serial port, framebuffer and the USB 3.1 Type-C ports. It can boot a support OS (e.g. OpenBSD/arm64) from a USB disk.
This version attempts to address most comments. It doesn't add a proper WDT/sysreset driver yet since I prefer to do that once the device tree bindings for that have been ironed out.
Please do this soon. We can easily change a compatible string later if needed, but having strange code in there provides a bad example for others.
Regards,
Simon