From 456305ec597908536e8e0de32dade43f9db00e8c Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Jan 2022 20:38:12 +0100 Subject: mailbox: apple: Add driver for Apple IOP mailbox This mailbox driver provides a communication channel with the Apple IOP controllers found on Apple SoCs. These IOP controllers are used to implement various functions such as the System Manegement Controller (SMC) and NVMe storage. It allows sending and receiving a 96-bit message over a single channel. The header file with the struct used for mailbox messages is taken straight from Linux. Signed-off-by: Mark Kettenis Signed-off-by: Sven Peter Reviewed-by: Simon Glass Tested on: Macbook Air M1 Tested-by: Simon Glass --- include/linux/apple-mailbox.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/linux/apple-mailbox.h (limited to 'include') diff --git a/include/linux/apple-mailbox.h b/include/linux/apple-mailbox.h new file mode 100644 index 00000000000..720fbb70294 --- /dev/null +++ b/include/linux/apple-mailbox.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */ +/* + * Apple mailbox message format + * + * Copyright (C) 2021 The Asahi Linux Contributors + */ + +#ifndef _LINUX_APPLE_MAILBOX_H_ +#define _LINUX_APPLE_MAILBOX_H_ + +#include + +/* encodes a single 96bit message sent over the single channel */ +struct apple_mbox_msg { + u64 msg0; + u32 msg1; +}; + +#endif -- cgit v1.2.3 From dbb273a5b6c02fd5a191ce4c059c596439a839fe Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sat, 22 Jan 2022 20:38:19 +0100 Subject: configs: apple: Add NVMe boot target Add a boot target for NVMe such that we can boot from NVMe. Signed-off-by: Mark Kettenis --- include/configs/apple.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/configs/apple.h b/include/configs/apple.h index 3e5fb495f1a..47faad81509 100644 --- a/include/configs/apple.h +++ b/include/configs/apple.h @@ -13,6 +13,12 @@ "fdt_addr_r=0x960100000\0" \ "kernel_addr_r=0x960200000\0" +#if CONFIG_IS_ENABLED(CMD_NVME) + #define BOOT_TARGET_NVME(func) func(NVME, nvme, 0) +#else + #define BOOT_TARGET_NVME(func) +#endif + #if CONFIG_IS_ENABLED(CMD_USB) #define BOOT_TARGET_USB(func) func(USB, usb, 0) #else @@ -20,6 +26,7 @@ #endif #define BOOT_TARGET_DEVICES(func) \ + BOOT_TARGET_NVME(func) \ BOOT_TARGET_USB(func) #include -- cgit v1.2.3 From d42f1074253505f4e129267faa0d34676ca54d1f Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 23 Jan 2022 16:48:13 +0100 Subject: input: apple: Add support for Apple SPI keyboard This driver adds support for the keyboard on Apple Silicon laptops. The controller for this keyboard sits on an SPI bus and uses an Apple-specific HID over SPI protocol. The packets sent by this controller for key presses and key releases are fairly simple and are decoded directly by the code in this driver and converted into standard Linux keycodes. The same controller handles the touchpad found on these laptops. Packets for touchpad events are simply ignored. Signed-off-by: Mark Kettenis Reviewed-by: Simon Glass Tested on: Macbook Air M1 Tested-by: Simon Glass --- include/configs/apple.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/apple.h b/include/configs/apple.h index 47faad81509..f12e9bdef5a 100644 --- a/include/configs/apple.h +++ b/include/configs/apple.h @@ -5,7 +5,7 @@ /* Environment */ #define ENV_DEVICE_SETTINGS \ - "stdin=serial,usbkbd\0" \ + "stdin=serial,usbkbd,spikbd\0" \ "stdout=serial,vidconsole\0" \ "stderr=serial,vidconsole\0" -- cgit v1.2.3 From 1ca890d789b45ddcda73454fe2b54f5fdb10ee3b Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Mon, 31 Jan 2022 09:20:22 +0200 Subject: common: drop CONFIG_SYS_RESET_ADDR There are no boards that define CONFIG_SYS_RESET_ADDR, so drop the remaining comments referencing it and also the config_whitelist.txt entry. Signed-off-by: Ovidiu Panait Reviewed-by: Stefan Roese Acked-by: thomas@wytron.com.tw --- include/configs/10m50_devboard.h | 9 --------- include/configs/3c120_devboard.h | 9 --------- 2 files changed, 18 deletions(-) (limited to 'include') diff --git a/include/configs/10m50_devboard.h b/include/configs/10m50_devboard.h index 04ce88c9dd9..3b4d1fd6265 100644 --- a/include/configs/10m50_devboard.h +++ b/include/configs/10m50_devboard.h @@ -47,13 +47,4 @@ CONFIG_SYS_SDRAM_SIZE - \ CONFIG_SYS_MONITOR_LEN) -/* - * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above - * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the - * reset address, no? This will keep the environment in user region - * of flash. NOTE: the monitor length must be multiple of sector size - * (which is common practice). - */ - - #endif /* __CONFIG_H */ diff --git a/include/configs/3c120_devboard.h b/include/configs/3c120_devboard.h index e12e54fe4fb..763cb8db7cf 100644 --- a/include/configs/3c120_devboard.h +++ b/include/configs/3c120_devboard.h @@ -47,13 +47,4 @@ CONFIG_SYS_SDRAM_SIZE - \ CONFIG_SYS_MONITOR_LEN) -/* - * ENVIRONMENT -- Put environment in sector CONFIG_SYS_MONITOR_LEN above - * CONFIG_SYS_RESET_ADDR, since we assume the monitor is stored at the - * reset address, no? This will keep the environment in user region - * of flash. NOTE: the monitor length must be multiple of sector size - * (which is common practice). - */ - - #endif /* __CONFIG_H */ -- cgit v1.2.3