Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ properties:
- apple,t6020-pmp-v2-report
- apple,t6030-pmp-v2-report
- apple,t6041-pmp-v2-report
- apple,t6050-pmp-v2-report
- apple,t8112-pmp-v2-report
- apple,t8122-pmp-v2-report
- apple,t8140-pmp-v2-report
Expand Down Expand Up @@ -113,6 +114,7 @@ patternProperties:
- apple,t6030-pmp-v2-report-entry
- apple,t6031-pmp-v2-report-entry
- apple,t6041-pmp-v2-report-entry
- apple,t6050-pmp-v2-report-entry
- apple,t8112-pmp-v2-report-entry
- apple,t8122-pmp-v2-report-entry
- const: apple,t6000-pmp-v2-report-entry
Expand Down
20 changes: 8 additions & 12 deletions Documentation/devicetree/bindings/soc/apple/apple,pmp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ properties:

interrupts:
maxItems: 4
description: Coprocessor mailbox and status interrupts, on T6050 in ADT order.
description: Coprocessor mailbox and status interrupts.

iommus:
maxItems: 1
Expand Down Expand Up @@ -148,23 +148,19 @@ allOf:
const: apple,t6050-pmp-v2
then:
description:
The T6050 PMP is described from the ADT and stays disabled until its
firmware handoff is supported; its mailbox is not described yet.
The T6050 PMP's firmware SRAM and ASC views and its ASC mailbox. It
also holds the PMS SRAM's power domain.
properties:
reg:
minItems: 4
maxItems: 4
interrupts:
minItems: 4
maxItems: 4
maxItems: 2
power-domains:
minItems: 2
status:
const: disabled
interrupts: false
required:
- interrupts
- reg-names
- mboxes
- mbox-names
- power-domains
- status
else:
properties:
reg:
Expand Down
94 changes: 86 additions & 8 deletions arch/arm64/boot/dts/apple/t6050-peripherals.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -2176,27 +2176,105 @@
status = "disabled";
};

/* ADT pmp0 reg[2] (firmware SRAM) and reg[0] (ASC); iBoot loads the firmware, the OS starts it */
pmp0: pmp@284e00000 {
compatible = "apple,t6050-pmp-v2", "apple,t6000-pmp-v2";
reg = <0x2 0x84e00000 0x0 0x88000>,
<0x2 0x84850000 0x0 0x4000>,
<0x2 0x84500000 0x0 0x100000>,
<0x2 0x84250000 0x0 0x4000>;
interrupts = <AIC_IRQ 0 397 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 396 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 399 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 398 IRQ_TYPE_LEVEL_HIGH>;
reg = <0x2 0x84500000 0x0 0x100000>,
<0x2 0x84e00000 0x0 0x4000>;
reg-names = "pmp", "asc";
mboxes = <&pmp0_mbox>;
mbox-names = "mbox";
iommus = <&pmp0_dart 0>;
power-domains = <&ps_pmp>, <&ps_pms_sram>;
status = "disabled";
};

pmp0_mbox: mailbox@284e08000 {
compatible = "apple,t6050-asc-mailbox", "apple,asc-mailbox-v4";
reg = <0x2 0x84e08000 0x0 0x4000>;
interrupts = <AIC_IRQ 0 396 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 397 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 398 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 0 399 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "send-empty", "send-not-empty",
"recv-empty", "recv-not-empty";
#mbox-cells = <0>;
power-domains = <&ps_pmp>;
status = "disabled";
};

/*
* PMP report (PTD): reads 16 bytes per entry from the base, writes 8 bytes per entry from
* base + 0x10000, which is pmp0's ptd-update register (ADT pmp0 reg[3]); together they are
* /arm-io/pmgr reg[7]. Entries are PMP soc-devices; an entry's reg is its soc-device ID - 1
* (ADT iop-pmp0-nub soc-device). Without requests the running PMP keeps the vote iBoot left.
*/
pmp0_report: pmp-report@284240000 {
compatible = "apple,t6050-pmp-v2-report";
reg = <0x2 0x84240000 0x0 0x20000>;
power-domains = <&ps_pms_sram>;
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";

/* The CPU clusters: MACC0, MACC1, PACC */
report@c {
compatible = "apple,t6050-pmp-v2-report-entry",
"apple,t6000-pmp-v2-report-entry";
reg = <0xc>;
label = "pmp-macc0";
#power-domain-cells = <0>;
apple,always-on;
};

report@d {
compatible = "apple,t6050-pmp-v2-report-entry",
"apple,t6000-pmp-v2-report-entry";
reg = <0xd>;
label = "pmp-macc1";
#power-domain-cells = <0>;
apple,always-on;
};

report@e {
compatible = "apple,t6050-pmp-v2-report-entry",
"apple,t6000-pmp-v2-report-entry";
reg = <0xe>;
label = "pmp-pacc";
#power-domain-cells = <0>;
apple,always-on;
};

/* The internal display (DISPINT) */
report@12 {
compatible = "apple,t6050-pmp-v2-report-entry",
"apple,t6000-pmp-v2-report-entry";
reg = <0x12>;
label = "pmp-dispint";
#power-domain-cells = <0>;
apple,always-on;
};

/* Storage (ANS) */
report@24 {
compatible = "apple,t6050-pmp-v2-report-entry",
"apple,t6000-pmp-v2-report-entry";
reg = <0x24>;
label = "pmp-ans";
#power-domain-cells = <0>;
apple,always-on;
};
};

pmp0_dart: iommu@2841a0000 {
compatible = "apple,t6050-dart", "apple,t8110-dart";
reg = <0x2 0x841a0000 0x0 0xc000>,
<0x2 0x841b0000 0x0 0x4000>;
interrupts = <AIC_IRQ 0 371 IRQ_TYPE_LEVEL_HIGH>;
#iommu-cells = <1>;
/* ADT dart-pmp0 vm-base, vm-size */
apple,dma-range = /bits/ 64 <0x10000000000 0x1000000000>;
power-domains = <&ps_pmp>;
status = "disabled";
};

Expand Down
2 changes: 2 additions & 0 deletions drivers/pmdomain/apple/pmp-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,8 @@ static const struct of_device_id apple_pmp_report_of_match[] = {
{ .compatible = "apple,t6030-pmp-v2-report", .data = &apple_pmp_offsets_t6030 },
{ .compatible = "apple,t6031-pmp-v2-report", .data = &apple_pmp_offsets_t6031 },
{ .compatible = "apple,t6041-pmp-v2-report", .data = &apple_pmp_offsets_t6041 },
/* T6050: the ADT's ptd-range lists T6041's entries at the same places. */
{ .compatible = "apple,t6050-pmp-v2-report", .data = &apple_pmp_offsets_t6041 },
{ .compatible = "apple,t8112-pmp-v2-report", .data = &apple_pmp_offsets_t8112 },
{ .compatible = "apple,t8122-pmp-v2-report", .data = &apple_pmp_offsets_t8122 },
{ .compatible = "apple,t8132-pmp-v2-report", .data = &apple_pmp_offsets_t8132 },
Expand Down
9 changes: 9 additions & 0 deletions drivers/soc/apple/pmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,14 @@ const HW_CFG_T8142: PmpHwConfig = PmpHwConfig {
coreanalytics: Ep7::Always,
};

/// T6050: the DART window starts at 1 TiB (ADT dart-pmp0 vm-base) and spans
/// 64 GiB, as on T8142. Its firmware never readies endpoint 7 (-ETIME).
const HW_CFG_T6050: PmpHwConfig = PmpHwConfig {
dma_mask: Some(DmaMask::new::<42>()),
check_bootargs_uuid: false,
coreanalytics: Ep7::No,
};

const HW_CFG_T8132: PmpHwConfig = PmpHwConfig {
dma_mask: None,
check_bootargs_uuid: false,
Expand All @@ -722,6 +730,7 @@ kernel::of_device_table!(
(of::DeviceId::new(c"apple,t8140-pmp-v2"), &HW_CFG_T8140),
(of::DeviceId::new(c"apple,t8142-pmp-v2"), &HW_CFG_T8142),
(of::DeviceId::new(c"apple,t6041-pmp-v2"), &HW_CFG_T6041),
(of::DeviceId::new(c"apple,t6050-pmp-v2"), &HW_CFG_T6050),
(of::DeviceId::new(c"apple,t6000-pmp-v2"), &HW_CFG_DEFAULT),
]
);
Expand Down
Loading