AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: <Roman.Li@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: Alex Deucher <alexander.deucher@amd.com>,
	Harry Wentland <harry.wentland@amd.com>,
	Pratik Vishwakarma <Pratik.Vishwakarma@amd.com>,
	Aurabindo Pillai <aurabindo.pillai@amd.com>,
	Ivan Lipski <ivan.lipski@amd.com>, Alex Hung <alex.hung@amd.com>,
	Roman Li <Roman.Li@amd.com>
Subject: [PATCH 5/7] drm/amd/display: Enable dcn42 DMUB
Date: Wed, 11 Feb 2026 20:09:47 -0500	[thread overview]
Message-ID: <20260212010949.654686-6-Roman.Li@amd.com> (raw)
In-Reply-To: <20260212010949.654686-1-Roman.Li@amd.com>

From: Roman Li <Roman.Li@amd.com>

Enable DMUB support for DCN 4.2

Signed-off-by: Roman Li <Roman.Li@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/dmub/dmub_srv.h   |  5 +-
 drivers/gpu/drm/amd/display/dmub/src/Makefile |  3 +-
 .../gpu/drm/amd/display/dmub/src/dmub_srv.c   | 64 ++++++++++++++++++-
 3 files changed, 68 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
index 3b6bba017040..c18ff8f00bb8 100644
--- a/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
+++ b/drivers/gpu/drm/amd/display/dmub/dmub_srv.h
@@ -1,5 +1,6 @@
+/* SPDX-License-Identifier: MIT */
 /*
- * Copyright 2019 Advanced Micro Devices, Inc.
+ * Copyright 2019-2026 Advanced Micro Devices, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -119,6 +120,7 @@ enum dmub_asic {
 	DMUB_ASIC_DCN351,
 	DMUB_ASIC_DCN36,
 	DMUB_ASIC_DCN401,
+	DMUB_ASIC_DCN42,
 	DMUB_ASIC_MAX,
 };
 
@@ -602,6 +604,7 @@ struct dmub_srv {
 	struct dmub_srv_dcn32_regs *regs_dcn32;
 	struct dmub_srv_dcn35_regs *regs_dcn35;
 	const struct dmub_srv_dcn401_regs *regs_dcn401;
+	struct dmub_srv_dcn42_regs *regs_dcn42;
 	struct dmub_srv_base_funcs funcs;
 	struct dmub_srv_hw_funcs hw_funcs;
 	struct dmub_srv_inbox inbox1;
diff --git a/drivers/gpu/drm/amd/display/dmub/src/Makefile b/drivers/gpu/drm/amd/display/dmub/src/Makefile
index 468b768c11ae..ac7b17d8fb0f 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/Makefile
+++ b/drivers/gpu/drm/amd/display/dmub/src/Makefile
@@ -1,5 +1,5 @@
 #
-# Copyright 2019 Advanced Micro Devices, Inc.
+# Copyright 2019-2026 Advanced Micro Devices, Inc.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -28,6 +28,7 @@ DMUB += dmub_dcn35.o
 DMUB += dmub_dcn351.o
 DMUB += dmub_dcn36.o
 DMUB += dmub_dcn401.o
+DMUB += dmub_dcn42.o
 
 AMD_DAL_DMUB = $(addprefix $(AMDDALPATH)/dmub/src/,$(DMUB))
 
diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
index 83cf4888fb54..3bba256a288d 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c
@@ -1,5 +1,6 @@
+// SPDX-License-Identifier: MIT
 /*
- * Copyright 2019 Advanced Micro Devices, Inc.
+ * Copyright 2019-2026 Advanced Micro Devices, Inc.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -22,7 +23,6 @@
  * Authors: AMD
  *
  */
-
 #include "../dmub_srv.h"
 #include "dmub_dcn20.h"
 #include "dmub_dcn21.h"
@@ -40,6 +40,7 @@
 #include "dmub_dcn351.h"
 #include "dmub_dcn36.h"
 #include "dmub_dcn401.h"
+#include "dmub_dcn42.h"
 #include "os_types.h"
 /*
  * Note: the DMUB service is standalone. No additional headers should be
@@ -87,6 +88,7 @@
 
 static struct dmub_srv_dcn32_regs dmub_srv_dcn32_regs;
 static struct dmub_srv_dcn35_regs dmub_srv_dcn35_regs;
+struct dmub_srv_dcn42_regs dmub_srv_dcn42_regs;
 
 static inline uint32_t dmub_align(uint32_t val, uint32_t factor)
 {
@@ -410,6 +412,64 @@ static bool dmub_srv_hw_setup(struct dmub_srv *dmub, enum dmub_asic asic)
 			funcs->is_hw_powered_up = dmub_dcn35_is_hw_powered_up;
 			funcs->should_detect = dmub_dcn35_should_detect;
 			break;
+	case DMUB_ASIC_DCN42:
+			dmub->regs_dcn42 = &dmub_srv_dcn42_regs;
+			funcs->configure_dmub_in_system_memory = dmub_dcn42_configure_dmub_in_system_memory;
+			funcs->send_inbox0_cmd = dmub_dcn42_send_inbox0_cmd;
+			funcs->clear_inbox0_ack_register = dmub_dcn42_clear_inbox0_ack_register;
+			funcs->read_inbox0_ack_register = dmub_dcn42_read_inbox0_ack_register;
+			funcs->reset = dmub_dcn42_reset;
+			funcs->reset_release = dmub_dcn42_reset_release;
+			funcs->backdoor_load = dmub_dcn42_backdoor_load;
+			funcs->backdoor_load_zfb_mode = dmub_dcn42_backdoor_load_zfb_mode;
+			funcs->setup_windows = dmub_dcn42_setup_windows;
+			funcs->setup_mailbox = dmub_dcn42_setup_mailbox;
+			funcs->get_inbox1_wptr = dmub_dcn42_get_inbox1_wptr;
+			funcs->get_inbox1_rptr = dmub_dcn42_get_inbox1_rptr;
+			funcs->set_inbox1_wptr = dmub_dcn42_set_inbox1_wptr;
+			funcs->setup_out_mailbox = dmub_dcn42_setup_out_mailbox;
+			funcs->get_outbox1_wptr = dmub_dcn42_get_outbox1_wptr;
+			funcs->set_outbox1_rptr = dmub_dcn42_set_outbox1_rptr;
+			funcs->is_supported = dmub_dcn42_is_supported;
+			funcs->is_hw_init = dmub_dcn42_is_hw_init;
+			funcs->set_gpint = dmub_dcn42_set_gpint;
+			funcs->is_gpint_acked = dmub_dcn42_is_gpint_acked;
+			funcs->get_gpint_response = dmub_dcn42_get_gpint_response;
+			funcs->get_gpint_dataout = dmub_dcn42_get_gpint_dataout;
+			funcs->get_fw_status = dmub_dcn42_get_fw_boot_status;
+			funcs->get_fw_boot_option = dmub_dcn42_get_fw_boot_option;
+			funcs->enable_dmub_boot_options = dmub_dcn42_enable_dmub_boot_options;
+			funcs->skip_dmub_panel_power_sequence = dmub_dcn42_skip_dmub_panel_power_sequence;
+			/*outbox0 call stacks*/
+			funcs->setup_outbox0 = dmub_dcn42_setup_outbox0;
+			funcs->get_outbox0_wptr = dmub_dcn42_get_outbox0_wptr;
+			funcs->set_outbox0_rptr = dmub_dcn42_set_outbox0_rptr;
+
+			funcs->get_current_time = dmub_dcn42_get_current_time;
+			funcs->get_diagnostic_data = dmub_dcn42_get_diagnostic_data;
+			funcs->get_preos_fw_info = dmub_dcn42_get_preos_fw_info;
+
+			/*carried from dcn401*/
+			funcs->send_reg_inbox0_cmd_msg = dmub_dcn42_send_reg_inbox0_cmd_msg;
+			funcs->read_reg_inbox0_rsp_int_status = dmub_dcn42_read_reg_inbox0_rsp_int_status;
+			funcs->read_reg_inbox0_cmd_rsp = dmub_dcn42_read_reg_inbox0_cmd_rsp;
+			funcs->write_reg_inbox0_rsp_int_ack = dmub_dcn42_write_reg_inbox0_rsp_int_ack;
+			funcs->clear_reg_inbox0_rsp_int_ack = dmub_dcn42_clear_reg_inbox0_rsp_int_ack;
+			funcs->enable_reg_inbox0_rsp_int = dmub_dcn42_enable_reg_inbox0_rsp_int;
+			default_inbox_type = DMUB_CMD_INTERFACE_FB; /*still default to FB for now*/
+
+			funcs->write_reg_outbox0_rdy_int_ack = dmub_dcn42_write_reg_outbox0_rdy_int_ack;
+			funcs->read_reg_outbox0_msg = dmub_dcn42_read_reg_outbox0_msg;
+			funcs->write_reg_outbox0_rsp = dmub_dcn42_write_reg_outbox0_rsp;
+			funcs->read_reg_outbox0_rdy_int_status = dmub_dcn42_read_reg_outbox0_rdy_int_status;
+			funcs->read_reg_outbox0_rsp_int_status = dmub_dcn42_read_reg_outbox0_rsp_int_status;
+			funcs->enable_reg_inbox0_rsp_int = dmub_dcn42_enable_reg_inbox0_rsp_int;
+			funcs->enable_reg_outbox0_rdy_int = dmub_dcn42_enable_reg_outbox0_rdy_int;
+			funcs->init_reg_offsets = dmub_srv_dcn42_regs_init;
+
+			funcs->is_hw_powered_up = dmub_dcn42_is_hw_powered_up;
+			funcs->should_detect = dmub_dcn42_should_detect;
+			break;
 
 	case DMUB_ASIC_DCN401:
 		dmub->regs_dcn401 = &dmub_srv_dcn401_regs;
-- 
2.34.1


  parent reply	other threads:[~2026-02-12  1:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-12  1:09 [PATCH 0/7] Patch set to support dcn42 Roman.Li
2026-02-12  1:09 ` [PATCH 1/7] drm/amd/display: Add dcn42 version identifiers Roman.Li
2026-02-12  1:09 ` [PATCH 4/7] drm/amd/display: Add DMUB support for dcn42 Roman.Li
2026-02-12  1:09 ` Roman.Li [this message]
2026-02-12  1:09 ` [PATCH 6/7] drm/amd/display: Enable dcn42 DC Roman.Li
2026-02-12  1:09 ` [PATCH 7/7] drm/amd/display: Enable dcn42 in DM Roman.Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260212010949.654686-6-Roman.Li@amd.com \
    --to=roman.li@amd.com \
    --cc=Pratik.Vishwakarma@amd.com \
    --cc=alex.hung@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=aurabindo.pillai@amd.com \
    --cc=harry.wentland@amd.com \
    --cc=ivan.lipski@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox