Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions Documentation/arch/arm64/aurora-apif-centauri.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. SPDX-License-Identifier: GPL-2.0-only

N1 firmware and PCI transport
=============================

The Control function owns the firmware bootstrap and its DMA allocations.
Alpha and Beta use their own PCI-function DMA mappings. The driver requires
an APIF host with the supported isolated Gen3 x1 reset layout. All endpoint
DMA/MSI must be quiesced and the endpoint left in the stopped ROM personality;
live sessions cannot be adopted by this interface.

The Control PCI DT node supplies ``firmware-name``,
``apple,centauri-platform-id`` and ``apple,centauri-protocol = <27>``. The
platform identifier and personalized FTAB must agree with the actual device.
These are firmware inputs supplied by the boot producer, rather than a
machine-name lookup in the driver. No firmware or calibration data is shipped
in this series. The driver loads the firmware directly and starts asynchronously;
a missing file or failed phase requires correcting the input and reprobe.

The host's native DART reset requires exclusive Linux ownership and no retained
firmware streams on that unit. The boot producer must resolve ownership before
handoff. This driver cannot discard retained streams to make a reset succeed.
A failed link transition prevents further endpoint accesses. Published DMA and
vectors remain pinned when shutdown cannot be proved; a platform reset is then
required. This is an error path, not a supported live-session handoff.

Bootstrap command rings are bounded and used once. Radio data-plane ring sizes
and batching are separate from bootstrap. The transport builds without the
Wi-Fi consumer; it still starts the shared firmware for the later Alpha/Beta
consumers. Wi-Fi and Bluetooth are separate follow-up changes. Hardware
qualification of this cleaned series, including suspend/resume, remains pending.
5 changes: 5 additions & 0 deletions Documentation/arch/arm64/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ ARM64 Architecture

acpi_object_usage
amu
aurora-apif
aurora-apif-nvme
aurora-apif-pcie
aurora-apif-pmp
aurora-apif-centauri
apple-j813
arm-acpi
arm-cca
Expand Down
50 changes: 50 additions & 0 deletions Documentation/devicetree/bindings/net/wireless/apple,centauri.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/wireless/apple,centauri.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple N1 Centauri Control PCI function

maintainers:
- Dj <hey@djdev.me>

description: |
PCI function zero owns the shared N1 firmware bootstrap. The boot producer
supplies the personalized FTAB filename and packed firmware platform ID.
The endpoint must be left in its stopped ROM personality with DMA and MSI
quiesced. A supported APIF PCI host performs the isolated port reset after
ROM bootstrap. This binding does not authorize adopting an existing live
firmware session or releasing another owner's retained DART streams.

properties:
compatible:
enum:
- pci106b,1900
- pci106b,1901

reg:
maxItems: 1
description: Standard five-cell PCI function address

firmware-name:
$ref: /schemas/types.yaml#/definitions/string
description: Personalized FTAB including the required per-device calibration

apple,centauri-platform-id:
$ref: /schemas/types.yaml#/definitions/uint32
description: Firmware chip ID in bits 15..0 and board ID in bits 30..16

apple,centauri-protocol:
$ref: /schemas/types.yaml#/definitions/uint32
const: 27
description: Shared firmware wire protocol profile

required:
- compatible
- reg
- firmware-name
- apple,centauri-platform-id
- apple,centauri-protocol

additionalProperties: false
8 changes: 8 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -4366,6 +4366,14 @@ S: Maintained
F: Documentation/devicetree/bindings/rtc/apple,abbey-pmu-rtc.yaml
F: drivers/rtc/rtc-apple-spmi-pmu.c

AURORA N1 CENTAURI TRANSPORT
M: Dj <hey@djdev.me>
L: linux-wireless@vger.kernel.org
S: Maintained
F: Documentation/arch/arm64/aurora-apif-centauri.rst
F: Documentation/devicetree/bindings/net/wireless/apple,centauri.yaml
F: drivers/net/wireless/apple/

AURORA PLATFORM MMIO INTERFACE
M: Dj <hey@djdev.me>
S: Maintained
Expand Down
10 changes: 10 additions & 0 deletions arch/arm64/configs/aurora-apif.config
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ CONFIG_SENSORS_MACSMC_HWMON=y
CONFIG_PHY_APPLE_T6050_DP=y
CONFIG_MULTIPLEXER=y
CONFIG_MUX_APPLE_DPXBAR=y
CONFIG_CPU_FREQ=y
CONFIG_ARM_APPLE_SOC_CPUFREQ=y
CONFIG_NET=y
CONFIG_NETDEVICES=y
CONFIG_INET=y
CONFIG_WIRELESS=y
CONFIG_WLAN=y
CONFIG_CFG80211=y
CONFIG_WLAN_VENDOR_APPLE=y
CONFIG_APPLE_CENTAURI=y
1 change: 1 addition & 0 deletions drivers/net/wireless/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ menuconfig WLAN
if WLAN

source "drivers/net/wireless/admtek/Kconfig"
source "drivers/net/wireless/apple/Kconfig"
source "drivers/net/wireless/ath/Kconfig"
source "drivers/net/wireless/atmel/Kconfig"
source "drivers/net/wireless/broadcom/Kconfig"
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ obj-$(CONFIG_WLAN_VENDOR_TI) += ti/
obj-$(CONFIG_WLAN_VENDOR_ZYDAS) += zydas/

obj-$(CONFIG_WLAN) += virtual/

obj-$(CONFIG_WLAN_VENDOR_APPLE) += apple/
18 changes: 18 additions & 0 deletions drivers/net/wireless/apple/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# SPDX-License-Identifier: GPL-2.0-only
config WLAN_VENDOR_APPLE
bool "Apple wireless devices"
default y

if WLAN_VENDOR_APPLE
config APPLE_CENTAURI
tristate "Apple N1 Centauri firmware and IPC transport"
depends on ARCH_APPLE || COMPILE_TEST
depends on PCI && CFG80211 && PCIE_APPLE_APIF
select FW_LOADER
help
Boot the shared N1 firmware and establish its PCI DMA contexts.
Requires a preinitialized APIF host with the supported reset layout
and DT-supplied personalized firmware name and platform identifier.
The endpoint must start in the stopped ROM personality. Firmware
and per-device calibration are external inputs and are not included.
endif
2 changes: 2 additions & 0 deletions drivers/net/wireless/apple/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_APPLE_CENTAURI) += centauri/
3 changes: 3 additions & 0 deletions drivers/net/wireless/apple/centauri/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
obj-$(CONFIG_APPLE_CENTAURI) += apple_centauri.o
apple_centauri-y := centauri_pci.o centauri_ipc.o
87 changes: 87 additions & 0 deletions drivers/net/wireless/apple/centauri/centauri.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@

#ifndef AURORA_CENTAURI_H
#define AURORA_CENTAURI_H
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/sizes.h>
#include <linux/workqueue.h>

#define CEN_ALPHA_WINDOW_SIZE SZ_32M
#define CEN_ALPHA_SCRATCH_OFFSET SZ_8M
#define CEN_ALPHA_SCRATCH_SIZE (5 * SZ_1M)

struct centauri_ipc;
struct centauri_wifi;
struct centauri_irqs {
struct pci_dev *pdev;
void *data;
unsigned int count;
};

struct cen_alpha_resources {
struct pci_dev *pdev;
void *context, *messages, *window;
dma_addr_t context_dma, messages_dma, window_dma;
void __iomem *bar;
u32 index[4], mtr, mcr;
};
enum centauri_boot_phase {
CEN_BOOT_ROM,
CEN_BOOT_CYCLE,
CEN_BOOT_IPC,
CEN_BOOT_READY,
CEN_BOOT_FAILED,
CEN_BOOT_STOPPED,
};

struct centauri {
struct pci_dev *pdev;
void __iomem *bar;
resource_size_t size;
u32 platform_id, protocol;
const char *firmware_name;
struct dentry *debug;
struct mutex boot_lock;
struct delayed_work boot_work;
enum centauri_boot_phase boot_phase;
bool removing;
void *firmware, *descriptor;
struct centauri_irqs irqs, alpha_irqs;
dma_addr_t firmware_dma, descriptor_dma;
size_t firmware_size;
u32 image_response;
bool boot_attempted;
bool link_ready;
struct centauri_ipc *ipc;
struct centauri_wifi *wifi;
};

int centauri_request_irqs(struct centauri_irqs *irqs, struct pci_dev *pdev,
unsigned int count, irq_handler_t handler, void *data);
void centauri_free_irqs(struct centauri_irqs *irqs);

int centauri_start_ipc(struct centauri *c);
void centauri_free_ipc(struct centauri *c);
int centauri_alpha_resources(struct centauri *c, struct cen_alpha_resources *resources);
bool centauri_stop_dma(struct pci_dev *pdev);

#if IS_ENABLED(CONFIG_APPLE_CENTAURI_WIFI)
irqreturn_t centauri_alpha_irq(int irq, void *data);
int centauri_wifi_register(struct centauri *c);
void centauri_wifi_unregister(struct centauri *c);
#else
static inline irqreturn_t centauri_alpha_irq(int irq, void *data)
{
return IRQ_HANDLED;
}
static inline int centauri_wifi_register(struct centauri *c)
{
return 0;
}
static inline void centauri_wifi_unregister(struct centauri *c)
{
}
#endif
#endif
Loading