Skip to content
Open
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
61 changes: 60 additions & 1 deletion Documentation/devicetree/bindings/gpu/apple,s8003-gpu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/gpu/apple,s8003-gpu.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Apple S8000/S8003 (A9), T7000 (A8) and S5L8960X (A7) GPU
title: Apple S8000/S8003 (A9), T7000/T7001 (A8/A8X) and S5L8960X (A7) GPU

maintainers:
- Berkay Kösebay <brkosebay@users.noreply.github.com>
Expand All @@ -31,13 +31,21 @@ description: |
power manager does. The S5L8965X, the iPad Air's variant of the A7, has
the same GPU and takes its own compatible before the A7's.

The A8X's GPU (GXA6850, Apple's G4G) is the A8's family with eight clusters
and a newer firmware (AGXFirmwareKextG4G). Its node has the A8's registers
and, as the A8's, no power domain: the driver switches the GPU's power state
itself, after the power manager stores it must make first. The settings of
its two bus bridges come from the node, so that the driver writes the values
of the device's own firmware.

properties:
compatible:
oneOf:
- enum:
- apple,s5l8960x-gpu
- apple,s8003-gpu
- apple,t7000-gpu
- apple,t7001-gpu
- items:
- const: apple,s8000-gpu
- const: apple,s8003-gpu
Expand Down Expand Up @@ -83,6 +91,20 @@ properties:
Apple's bootloader sets them per chip; the bootloader that starts
Linux (m1n1) fills an empty table from them.

apple,bridge-settings:
$ref: /schemas/types.yaml#/definitions/uint32-matrix
items:
items:
- description: Register offset, from the start of the bridges' region
- description: Value the driver writes there after every power-on
description:
The register stores of the GPU's two bus bridges (A8X), one row per
store, in the order the driver writes them.
The bootloader that starts Linux (m1n1) adds this property from
Apple's device tree: a device tree source does not carry it, so it is
not a required property of the schema, and the driver refuses to probe
without it.

firmware-name:
maxItems: 1
description:
Expand All @@ -107,6 +129,17 @@ allOf:
reg-names:
minItems: 4
power-domains: false
- if:
properties:
compatible:
const: apple,t7001-gpu
then:
properties:
reg:
minItems: 4
reg-names:
minItems: 4
power-domains: false
- if:
properties:
compatible:
Expand Down Expand Up @@ -211,3 +244,29 @@ examples:
firmware-name = "apple/gfx-s5l8960x.bin";
};
};

- |
#include <dt-bindings/interrupt-controller/apple-aic.h>
#include <dt-bindings/interrupt-controller/irq.h>

soc {
#address-cells = <2>;
#size-cells = <2>;

gpu@201000000 {
compatible = "apple,t7001-gpu";
reg = <0x2 0x01000000 0x0 0x100000>,
<0x2 0x01e00000 0x0 0x100000>,
<0x2 0x0e000000 0x0 0x40000>,
<0x2 0x01f00000 0x0 0xc1000>;
reg-names = "rgx", "fender", "pmgr", "bridges";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 134 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 135 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 136 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 137 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 138 IRQ_TYPE_LEVEL_HIGH>;
apple,bridge-settings = <0x0 0x0>;
firmware-name = "apple/gfx-t7001.bin";
};
};
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/apple/t7001-air2.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -570,3 +570,7 @@
apple,always-on;
apple,manual-pm;
};

&gpu {
status = "okay";
};
24 changes: 24 additions & 0 deletions arch/arm64/boot/dts/apple/t7001.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,30 @@
nonposted-mmio;
ranges;

/*
* No power-domains, as the A8's GPU: the driver switches ps_gfx
* itself after its PMGR stores (genpd would power it on at attach,
* before the probe). The firmware's own bus-bridge settings (apple,bridge-settings,
* {offset, value} rows) are the device's: the loader fills them
* from the ADT, and the driver refuses to probe without them.
*/
gpu: gpu@201000000 {
compatible = "apple,t7001-gpu";
reg = <0x2 0x01000000 0x0 0x100000>,
<0x2 0x01e00000 0x0 0x100000>,
<0x2 0x0e000000 0x0 0x40000>,
<0x2 0x01f00000 0x0 0xc1000>;
reg-names = "rgx", "fender", "pmgr", "bridges";
interrupt-parent = <&aic>;
interrupts = <AIC_IRQ 134 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 135 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 136 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 137 IRQ_TYPE_LEVEL_HIGH>,
<AIC_IRQ 138 IRQ_TYPE_LEVEL_HIGH>;
firmware-name = "apple/gfx-t7001.bin";
status = "disabled";
};

cpufreq: performance-controller@202220000 {
compatible = "apple,t7000-cluster-cpufreq", "apple,s5l8960x-cluster-cpufreq";
reg = <0x2 0x02220000 0 0x1000>;
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/imagination/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ config DRM_POWERVR_APPLE
depends on DRM_POWERVR
depends on APPLE_RTKIT && (ARCH_APPLE || COMPILE_TEST)
depends on DRM_POWERVR=m || APPLE_RTKIT=y
select CRYPTO_LIB_SHA256
help
Support the Rogue-based GPU of the Apple A10 (T8010), which runs
Apple's GFX firmware on an RTKit coprocessor instead of
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/imagination/pvr_apple.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern const struct pvr_power_sequence_ops pvr_power_sequence_ops_apple;
extern const struct pvr_apple_chip pvr_apple_chip_s5l8960x;
extern const struct pvr_apple_chip pvr_apple_chip_s8003;
extern const struct pvr_apple_chip pvr_apple_chip_t7000;
extern const struct pvr_apple_chip pvr_apple_chip_t7001;
extern const struct pvr_apple_chip pvr_apple_chip_t8010;
extern const struct pvr_apple_chip pvr_apple_chip_t8015;

Expand Down
Loading
Loading