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
6 changes: 6 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j604.dts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@
};
};

/* The full 3024x1964 panel including the notch rows, 254 ppi. */
&dcp {
apple,panel-width-mm = <302>;
apple,panel-height-mm = <196>;
};

&sound_jack {
compatible = "apple,j604-macaudio-jack", "apple,macaudio";
model = "MacBook Pro J604 Jack";
Expand Down
23 changes: 1 addition & 22 deletions arch/arm64/boot/dts/apple/t8132-j713-j715.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@
#include "t8132-j713-pmgr.dtsi"
#include <dt-bindings/phy/phy.h>

/ {
aliases {
disp0_piodma = &disp0_piodma;
};
};

/* The J713 loader tree has these placeholders. */
&gpu_ttbs {
reg = <0 0 0 0>;
Expand Down Expand Up @@ -137,25 +131,10 @@
status = "okay";
};

/*
* Internal display: the loader enables disp0_dart, piodma and the display
* subsystem once it has validated the inherited frontend mappings.
*/
&dcp_mbox {
status = "okay";
};

&dcp_dart {
status = "okay";
};

/* The J713's full 2560x1664 panel including the notch rows, 224 ppi. */
&dcp {
apple,j713-native-piodma;
apple,j713-native-scanout;
/* Full 2560x1664 panel including the notch rows, 224 ppi. */
apple,panel-width-mm = <290>;
apple,panel-height-mm = <188>;
status = "okay";
};

/* External displays: both pipes, routed to either USB-C port. */
Expand Down
20 changes: 20 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-laptop.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

aliases {
keyboard = &keyboard;
disp0_piodma = &disp0_piodma;
};

chosen {
Expand Down Expand Up @@ -74,6 +75,25 @@
panel = <&fb_panel>;
};

/*
* Internal display: the loader enables disp0_dart, piodma and the display
* subsystem once it has validated the inherited frontend mappings. Each
* board gives its panel's physical size.
*/
&dcp_mbox {
status = "okay";
};

&dcp_dart {
status = "okay";
};

&dcp {
apple,j713-native-piodma;
apple,j713-native-scanout;
status = "okay";
};

&aop_audio {
/* Microphones on LEAP; speakers and sense on TX0/RX0; the jack on TX2/RX2. */
dmas = <&admac0 1>, <&admac1 0>, <&admac1 1>, <&admac1 4>, <&admac1 5>;
Expand Down
10 changes: 7 additions & 3 deletions drivers/gpu/drm/apple/dcp-m4-profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ struct dcp_m4_profile {
const char *name;
const char *machine; /* machine compatible */
u32 panel_width, panel_height;
u32 notch_rows; /* rows the boot loader may hide */
u32 boot_stride; /* D101: inherited framebuffer stride */
u32 swap_size; /* A407 input */
u32 swap_surface; /* plane-0 surface */
Expand Down Expand Up @@ -40,7 +41,8 @@ static const u32 dcp_m4_timing_j713[2][8] = {

static const struct dcp_m4_profile dcp_m4_profile_j713 = {
.name = "J713", .machine = "apple,j713",
.panel_width = 2560, .panel_height = 1664, .boot_stride = 10240,
.panel_width = 2560, .panel_height = 1664, .notch_rows = 64,
.boot_stride = 10240,
.swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38,
.swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e,
.swap_intent = 0x17c,
Expand All @@ -60,7 +62,8 @@ static const u32 dcp_m4_timing_j715[2][8] = {
/* The J715: the same firmware ABI with a 2880x1864 panel. */
static const struct dcp_m4_profile dcp_m4_profile_j715 = {
.name = "J715", .machine = "apple,j715",
.panel_width = 2880, .panel_height = 1864, .boot_stride = 11520,
.panel_width = 2880, .panel_height = 1864, .notch_rows = 64,
.boot_stride = 11520,
.swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38,
.swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e,
.swap_intent = 0x17c,
Expand All @@ -83,7 +86,8 @@ static const u32 dcp_m4_timing_j604[2][8] = {
*/
static const struct dcp_m4_profile dcp_m4_profile_j604 = {
.name = "J604", .machine = "apple,j604",
.panel_width = 3024, .panel_height = 1964, .boot_stride = 12096,
.panel_width = 3024, .panel_height = 1964, .notch_rows = 74,
.boot_stride = 12096,
.swap_size = 0x1bd8, .swap_surface = 0x588, .swap_dva = 0xe38,
.swap_nullable = 0x1bcb, .swap_tail = 0x1bd6, .swap_nits = 0x35e,
.swap_intent = 0x17c,
Expand Down
5 changes: 2 additions & 3 deletions drivers/gpu/drm/apple/iomfb_m4.c
Original file line number Diff line number Diff line change
Expand Up @@ -2270,17 +2270,16 @@ static int dcp_m4_boot_framebuffer_check(void)
if (!of_device_is_available(np))
continue;
found++;
/* The inherited console may exclude the notch (64 lines on J713). */
/* The inherited console may exclude the panel's notch rows. */
if (of_property_read_u32(np, "width", &width) ||
of_property_read_u32(np, "height", &height) ||
of_property_read_u32(np, "stride", &stride) ||
width != dcp_m4_pf->panel_width || stride != dcp_m4_pf->boot_stride ||
(height != dcp_m4_pf->panel_height &&
height != dcp_m4_pf->panel_height - 64)) {
height != dcp_m4_pf->panel_height - dcp_m4_pf->notch_rows)) {
of_node_put(np);
return -EINVAL;
}
/* The inherited console can exclude the 64-line notch region. */
ret = 0;
}
return found > 1 ? -EINVAL : ret;
Expand Down
11 changes: 11 additions & 0 deletions drivers/iommu/apple-dart.c
Original file line number Diff line number Diff line change
Expand Up @@ -4133,6 +4133,17 @@ static int apple_dart_probe(struct platform_device *pdev)
of_machine_is_compatible("apple,t8132") &&
of_device_is_compatible(dev->of_node, "apple,t8132-dart") &&
res->start == 0x490000000ULL;
/*
* Off the qualified firmware nothing hands the internal display DARTs
* over, but the running DCP still uses them: never reset them.
*/
if (res && !tunneled && !apple_t8132_firmware_path() &&
of_machine_is_compatible("apple,t8132") &&
of_device_is_compatible(dev->of_node, "apple,t8132-dart") &&
(res->start == 0x30a300000ULL || res->start == 0x30a340000ULL)) {
dev_info(dev, "Leaving inherited display DART untouched off the qualified firmware\n");
return -ENODEV;
}
if (j713_display && !IS_ENABLED(CONFIG_APPLE_DART_J713_DCP))
return dev_err_probe(dev, -EOPNOTSUPP,
"retained J713 display requires CONFIG_APPLE_DART_J713_DCP=y\n");
Expand Down
Loading