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
4 changes: 3 additions & 1 deletion Documentation/devicetree/bindings/display/apple,dcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ description:
properties:
compatible:
oneOf:
- const: apple,t6034-dcp
- items:
- enum:
- apple,t8103-dcp
Expand All @@ -39,7 +40,7 @@ properties:

reg:
minItems: 2
maxItems: 7
maxItems: 8

reg-names:
minItems: 2
Expand All @@ -50,6 +51,7 @@ properties:
- enum: [disp-2, iop-vbar]
- enum: [disp-3, iop-vbar]
- enum: [disp-4, iop-vbar]
- enum: [disp-5, iop-vbar]
- const: iop-vbar

mboxes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ properties:
enum:
- apple,display-subsystem
- apple,t8122-display-subsystem
- apple,t6034-display-subsystem

iommus:
minItems: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ properties:
oneOf:
- const: apple,t6000-pmp-v2
- items:
- const: apple,t8140-pmp-v2
- enum:
- apple,t8140-pmp-v2
- apple,t6034-pmp-v2
- const: apple,t6000-pmp-v2

reg:
Expand Down
28 changes: 28 additions & 0 deletions arch/arm64/boot/dts/apple/t6034-dcp.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* J514M/T6034 internal display. Fresh ADT metadata identifies the same
* DCP/DART/PMP register layout and 14.7 firmware images as T6031, with a
* 400 MHz disp0 clock. Keep a separate handoff and component compatible;
* every consumer remains disabled until the T6034 gate validates it.
*/
#include "t6031-dcp.dtsi"

&clk_disp0 {
clock-frequency = <400000000>;
};

&display {
compatible = "apple,t6034-display-subsystem";
};

&dcp {
compatible = "apple,t6034-dcp";
};

&pmp {
compatible = "apple,t6034-pmp-v2", "apple,t6000-pmp-v2";
};

&pmp_report {

Check warning on line 26 in arch/arm64/boot/dts/apple/t6034-dcp.dtsi

View workflow job for this annotation

GitHub Actions / ci / device trees

dt-check unmatched (1 DTB)

/soc/pmp_report@2903c0000: compatible ['apple,t6034-pmp-v2-report', 'apple,t6020-pmp-v2-report'] matches no binding In: apple/t6034-j514m.dtb failed to match any schema with compatible: ['apple,t6034-pmp-v2-report', 'apple,t6020-pmp-v2-report']
compatible = "apple,t6034-pmp-v2-report", "apple,t6020-pmp-v2-report";
};
12 changes: 12 additions & 0 deletions arch/arm64/boot/dts/apple/t6034-j514m.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/dts-v1/;

#include "t6034.dtsi"
#include "t6034-dcp.dtsi"
#include "t603x-j514-j516.dtsi"

/ {
Expand All @@ -29,10 +30,21 @@
brcm,board-type = "apple,texa";
};

/* J514 panel dimensions, as on the other 14-inch M3 MacBook Pros. */
&dcp {
panel {
compatible = "apple,panel-j514", "apple,panel-mini-led", "apple,panel";
width-mm = <302>;
height-mm = <196>;
adj-height-mm = <189>;
apple,max-brightness = <500>;
};
};

&aop_audio {
apple,chassis-name = "J514";
apple,machine-kind = "MacBook Pro";
};

Check warning on line 47 in arch/arm64/boot/dts/apple/t6034-j514m.dts

View workflow job for this annotation

GitHub Actions / ci / commits

checkpatch NO_AUTHOR_SIGN_OFF (a5ba43109cb2)

Missing Signed-off-by: line by nominal patch author 'Chris Kearney <303316+chriskearney@users.noreply.github.com>'

&sound {
compatible = "apple,j514-macaudio", "apple,j314-macaudio", "apple,macaudio";
Expand Down
14 changes: 14 additions & 0 deletions drivers/gpu/drm/apple/apple_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ struct apple_drm_private {
static DEFINE_MUTEX(apple_g15_display_lock);
static struct device *apple_t6030_display;
static struct device *apple_t6031_display;
static struct device *apple_t6034_display;

/* The publication slot of a G15 SoC's internal display subsystem, or NULL. */
static struct device **apple_g15_display_slot(struct device *dev)
Expand All @@ -68,6 +69,8 @@ static struct device **apple_g15_display_slot(struct device *dev)
return &apple_t6030_display;
if (of_device_is_compatible(dev->of_node, "apple,t6031-display-subsystem"))
return &apple_t6031_display;
if (of_device_is_compatible(dev->of_node, "apple,t6034-display-subsystem"))
return &apple_t6034_display;
return NULL;
}

Expand Down Expand Up @@ -134,6 +137,15 @@ int apple_drm_t6031_link_device(struct device *consumer)
}
EXPORT_SYMBOL_GPL(apple_drm_t6031_link_device);

int apple_drm_t6034_link_device(struct device *consumer)
{
if (!of_machine_is_compatible("apple,j514m"))
return -ENODEV;
return apple_g15_link_device(consumer, "apple,t6034", "apple,agx-t6034",
&apple_t6034_display);
}
EXPORT_SYMBOL_GPL(apple_drm_t6034_link_device);

DEFINE_DRM_GEM_DMA_FOPS(apple_fops);

#define DART_PAGE_SIZE 16384
Expand Down Expand Up @@ -889,6 +901,7 @@ static const struct of_device_id apple_dcp_id_tbl[] = {
{ .compatible = "apple,t6030-dcp" },
{ .compatible = "apple,t8122-dcp" },
{ .compatible = "apple,t6031-dcp" },
{ .compatible = "apple,t6034-dcp" },
{},
};

Expand Down Expand Up @@ -1237,6 +1250,7 @@ static const struct of_device_id of_match[] = {
{ .compatible = "apple,t6030-display-subsystem" },
{ .compatible = "apple,t8122-display-subsystem" },
{ .compatible = "apple,t6031-display-subsystem" },
{ .compatible = "apple,t6034-display-subsystem" },
{}
};
MODULE_DEVICE_TABLE(of, of_match);
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/apple/dcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -5182,6 +5182,7 @@ static const struct of_device_id of_match[] = {
{ .compatible = "apple,t6030-dcpext", .data = &apple_dcp_hw_t6030_dcpext, },
{ .compatible = "apple,t8122-dcp", .data = &apple_dcp_hw_t8122, },
{ .compatible = "apple,t6031-dcp", .data = &apple_dcp_hw_t6031, },
{ .compatible = "apple,t6034-dcp", .data = &apple_dcp_hw_t6031, },
{ .compatible = "apple,t8122-dcpext", .data = &apple_dcp_hw_t8122_dcpext, },
{ .compatible = "apple,dcp", .data = &apple_dcp_hw_dcp, },
{ .compatible = "apple,dcpext", .data = &apple_dcp_hw_dcpext, },
Expand Down
17 changes: 16 additions & 1 deletion drivers/gpu/drm/apple/iomfb_v14_7.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,27 @@ static const struct dcp_v14_board dcp_v14_board_j514c = {
.log_bringup = true,
};

/* J514M's 14.7 DCP image and panel geometry; the root SoC is required too. */
static const struct dcp_v14_board dcp_v14_board_j514m = {
.name = "J514M",
.debugfs = "dcp-j514m",
.dcp_compatible = "apple,t6034-dcp",
.machine = "apple,j514m",
.soc = "apple,t6034",
.firmware_uuid = DCP_V14_J516C_FIRMWARE_UUID,
.handoff = "apple,t6034-handoff",
.promotion = true,
.log_bringup = true,
};

static const struct dcp_v14_board *const dcp_v14_boards[] = {
&dcp_v14_board_t6030,
&dcp_v14_board_j613,
&dcp_v14_board_j615,
&dcp_v14_board_j504,
&dcp_v14_board_j516c,
&dcp_v14_board_j514c,
&dcp_v14_board_j514m,
};

struct dcp_v14_property {
Expand Down Expand Up @@ -1681,7 +1695,8 @@ const struct dcp_v14_board *dcp_v14_board_select(dcp_v14_compat_fn dcp_is,
if (!dcp_is(ctx, board->dcp_compatible))
continue;
*dcp_known = true;
if (board->machine && !machine_is(ctx, board->machine))
if ((board->machine && !machine_is(ctx, board->machine)) ||
(board->soc && !machine_is(ctx, board->soc)))
continue;
return board;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/apple/iomfb_v14_7_board.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ struct dcp_v14_board {
const char *dcp_compatible;
/* The machine compatible; NULL for any machine with this DCP. */
const char *machine;
/* Optional additional root SoC restriction. */
const char *soc;
/* The firmware image whose layouts were tested on this board. */
const char *firmware_uuid;
/* Set to <1> by the boot loader on the DCP, display and PIODMA nodes. */
Expand Down
22 changes: 22 additions & 0 deletions drivers/gpu/drm/apple/v14-board-test.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/*
* The 14.x IOMFB board records: which record a DCP gets on which machine,
Expand Down Expand Up @@ -51,6 +51,8 @@

static const char *const j516c[] = { "apple,j516c", "apple,t6031", "apple,arm-platform", NULL };
static const char *const j514c[] = { "apple,j514c", "apple,t6031", "apple,arm-platform", NULL };
static const char *const j514m[] = { "apple,j514m", "apple,t6034", "apple,arm-platform", NULL };
static const char *const j514m_wrong_soc[] = { "apple,j514m", "apple,t6031", NULL };
static const char *const j516m[] = { "apple,j516m", "apple,t6034", "apple,arm-platform", NULL };
static const char *const j516s[] = { "apple,j516s", "apple,t6030", "apple,arm-platform", NULL };
static const char *const j613[] = { "apple,j613", "apple,t8122", "apple,arm-platform", NULL };
Expand Down Expand Up @@ -110,6 +112,25 @@
KUNIT_EXPECT_PTR_NE(test, b, board_for("apple,t6031-dcp", j516c, &known));
}

static void v14_board_j514m(struct kunit *test)
{
const struct dcp_v14_board *b;
bool known;

b = board_for("apple,t6034-dcp", j514m, &known);
KUNIT_ASSERT_NOT_NULL(test, b);
KUNIT_EXPECT_TRUE(test, known);
KUNIT_EXPECT_STREQ(test, b->machine, "apple,j514m");
KUNIT_EXPECT_STREQ(test, b->soc, "apple,t6034");
KUNIT_EXPECT_STREQ(test, b->handoff, "apple,t6034-handoff");
KUNIT_EXPECT_TRUE(test, dcp_v14_board_admits(b, J516C_DCP_IMAGE));
KUNIT_EXPECT_FALSE(test, dcp_v14_board_admits(b, T6030_DCP_IMAGE));
KUNIT_EXPECT_FALSE(test, b->panel_nits);
KUNIT_EXPECT_NULL(test, board_for("apple,t6034-dcp", j514m_wrong_soc, &known));
KUNIT_EXPECT_NULL(test, board_for("apple,t6034-dcp", j516m, &known));
KUNIT_EXPECT_NULL(test, board_for("apple,t6031-dcp", j514m, &known));
}

/* A T6031 DCP on a T6034 has no record: refused. */
static void v14_board_t6031_other_boards(struct kunit *test)
{
Expand Down Expand Up @@ -296,6 +317,7 @@
KUNIT_CASE(v14_board_j504),
KUNIT_CASE(v14_board_j516c),
KUNIT_CASE(v14_board_j514c),
KUNIT_CASE(v14_board_j514m),
KUNIT_CASE(v14_board_t6031_other_boards),
KUNIT_CASE(v14_board_j516c_image),
KUNIT_CASE(v14_board_unchanged),
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/asahi/g15/board.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! Board-data templates of the supported firmware build.
Expand Down Expand Up @@ -158,6 +158,7 @@
};
}
let inputs = record::Inputs {
chip_id: cfg.chip_id,
props,
zones: &zones,
main: &main,
Expand Down
34 changes: 33 additions & 1 deletion drivers/gpu/drm/asahi/g15/board/record.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! The J516C hardware record (0xb480 bytes) from the device tree and the ADT.
Expand Down Expand Up @@ -183,6 +183,8 @@

/// Everything the record is built from.
pub(crate) struct Inputs<'a> {
/// SoC identity of this G15C record.
pub(crate) chip_id: u32,
pub(crate) props: [u32; PROPS.len()],
/// `apple,power-zones` cells (triples).
pub(crate) zones: &'a [u32],
Expand Down Expand Up @@ -458,7 +460,7 @@
put32(out, IOMAPS + 32 * slot as usize + 0x18, 1)?;
}
// Identity and flags.
put32(out, 0xa28, 0x6031)?;
put32(out, 0xa28, i.chip_id)?;
put32(out, 0xa2c, 1)?;
put32(out, 0xa30, 2)?;
for at in [0xa38, 0xa3c, 0xa40, 0xa50, 0xa58, 0xa60] {
Expand Down Expand Up @@ -848,6 +850,9 @@

/// Builds the record into `out` (zeroed first) from the inputs.
pub(crate) fn build(out: &mut [u8], i: &Inputs<'_>) -> R<()> {
if !matches!(i.chip_id, 0x6031 | 0x6034) {
return Err("unsupported G15C record SoC");
}
if out.len() != SIZE {
return Err("record of another size");
}
Expand Down Expand Up @@ -950,6 +955,7 @@

fn inputs<'a>(main: &'a [Opp], cs: &'a [Opp], slots: &'a [IoSlot]) -> Inputs<'a> {
Inputs {
chip_id: 0x6031,
props: props(),
zones: &[],
main,
Expand All @@ -966,6 +972,31 @@
}
}

#[test]
fn t6034_identity_and_six_memory_channels() {
let main = main_opps();
let cs = [opp(24, [635; CLUSTERS])];
let slots = [IoSlot {
slot: 11,
pa: 0x220000000,
va: 0xfffffc2068000000,
total: 6 * 0xd8000,
element: 0xd8000,
writable: true,
}];
let mut input = inputs(&main, &cs, &slots);
input.chip_id = 0x6034;
let mut out = vec![0u8; SIZE];
build(&mut out, &input).unwrap();
assert_eq!(get(&out, 0xa28), 0x6034);
assert_eq!(get(&out, IOMAPS + 32 * 11 + 0x10), 6 * 0xd8000);
assert_eq!(get(&out, IOMAPS + 32 * 11 + 0x14), 0xd8000);
// The fused 30-core part still has four ten-slot physical clusters.
assert_eq!(get(&out, 0xb54), 40);
input.chip_id = 0x6030;
assert_eq!(build(&mut out, &input), Err("unsupported G15C record SoC"));
}

#[test]
fn factors() {
assert_eq!(F_1, 1.0f32.to_bits());
Expand Down Expand Up @@ -1500,6 +1531,7 @@
})
.collect();
let i = Inputs {
chip_id: 0x6031,
props,
zones: &zones,
main: &main,
Expand Down
19 changes: 14 additions & 5 deletions drivers/gpu/drm/asahi/g15/boot.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT

//! Admission and firmware start to READY.
Expand Down Expand Up @@ -469,13 +469,17 @@
let pmp = cfg.platform == hw::Platform::AdtWithPmp;
// J514C uses the same-die T6031 path on a normal boot. This does not qualify
// the inherited J516C reference words. Keep exact board AND SoC checks;
// T6034 boards must never inherit this four-cluster T6031 configuration.
// T6034 boards use their own profile and never inherit T6031 admission.
// The remaining display, DT/ADT, full firmware identity, hardware identity
// and record-builder admission below is unchanged.
let j514c_board = cfg.chip_id == 0x6031
&& cfg.platform == hw::Platform::DeviceTree
&& glue::machine(kernel::c_str!("apple,j514c"))
&& glue::machine(kernel::c_str!("apple,t6031"));
let j514m_board = cfg.chip_id == 0x6034
&& cfg.platform == hw::Platform::DeviceTree
&& glue::machine(kernel::c_str!("apple,j514m"))
&& glue::machine(kernel::c_str!("apple,t6034"));
if pmp {
if !glue::board() {
return Err(ENODEV);
Expand All @@ -490,7 +494,9 @@
}
return Err(err);
}
} else if !glue::machine(cfg.machine) && !j514c_board {
} else if (cfg.chip_id == 0x6034 && !j514m_board)
|| (!glue::machine(cfg.machine) && !j514c_board)
{
dev_err!(dev, "G15: not a {} machine\n", cfg.name);
return Err(ENODEV);
} else {
Expand All @@ -505,11 +511,12 @@
return Err(err);
}
}
if j514c_board {
if j514c_board || j514m_board {
if let hw::Board::DeviceTree(reference) = cfg.board {
dev_warn!(
dev,
"J514C bring-up: unqualified J516C reference: max_power_mw={} relative_power={:?} fast_die_mask={:#018x} alarm_mask={:#018x}; OPP powers are boot-loader stand-ins\n",
"{} bring-up: unqualified J516C reference: max_power_mw={} relative_power={:?} fast_die_mask={:#018x} alarm_mask={:#018x}; OPP powers are boot-loader stand-ins\n",
cfg.name,
reference.max_power_mw,
reference.relative_power,
reference.fast_die_mask,
Expand All @@ -519,7 +526,9 @@
}
let adt = adt::read(dev, cfg)
.inspect_err(|e| dev_err!(dev, "GPU regions not admitted: {:?}\n", e))?;
identity::firmware(dev, &adt, cfg.firmware)
// T6034 requires complete identities; the older profiles keep their
// existing explicitly requested bring-up prefix policy.
identity::firmware(dev, &adt, cfg.firmware, cfg.chip_id != 0x6034)
.inspect_err(|e| dev_err!(dev, "loaded GFX TEXT identity mismatch: {:?}\n", e))?;
dev_info!(dev, "M3: firmware identity accepted\n");
if cfg.board == hw::Board::None {
Expand Down
Loading
Loading