Skip to content

Commit 613ee7e

Browse files
committed
dcp: T602X bwreq support
Signed-off-by: Hector Martin <[email protected]>
1 parent 210457a commit 613ee7e

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

drivers/gpu/drm/apple/iomfb_template.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
/* Register defines used in bandwidth setup structure */
3636
#define REG_SCRATCH (0x14)
3737
#define REG_SCRATCH_T600X (0x988)
38+
#define REG_SCRATCH_T602X (0x1208)
3839
#define REG_DOORBELL (0x0)
3940
#define REG_DOORBELL_BIT (2)
4041

@@ -636,7 +637,7 @@ static bool dcpep_cb_boot_1(struct apple_dcp *dcp, int tag, void *out, void *in)
636637

637638
static struct dcp_rt_bandwidth dcpep_cb_rt_bandwidth(struct apple_dcp *dcp)
638639
{
639-
if (dcp->disp_registers[5] && dcp->disp_registers[6])
640+
if (dcp->disp_registers[5] && dcp->disp_registers[6]) {
640641
return (struct dcp_rt_bandwidth){
641642
.reg_scratch =
642643
dcp->disp_registers[5]->start + REG_SCRATCH,
@@ -646,19 +647,24 @@ static struct dcp_rt_bandwidth dcpep_cb_rt_bandwidth(struct apple_dcp *dcp)
646647

647648
.padding[3] = 0x4, // XXX: required by 11.x firmware
648649
};
649-
else if (dcp->disp_registers[4])
650+
} else if (dcp->disp_registers[4]) {
651+
u32 offset = REG_SCRATCH_T600X;
652+
if (of_device_is_compatible(dcp->dev->of_node, "apple,t6020-dcp"))
653+
offset = REG_SCRATCH_T602X;
654+
650655
return (struct dcp_rt_bandwidth){
651656
.reg_scratch = dcp->disp_registers[4]->start +
652-
REG_SCRATCH_T600X,
657+
offset,
653658
.reg_doorbell = 0,
654659
.doorbell_bit = 0,
655660
};
656-
else
661+
} else {
657662
return (struct dcp_rt_bandwidth){
658663
.reg_scratch = 0,
659664
.reg_doorbell = 0,
660665
.doorbell_bit = 0,
661666
};
667+
}
662668
}
663669

664670
/* Callback to get the current time as milliseconds since the UNIX epoch */

0 commit comments

Comments
 (0)