Skip to contentSkip to conversation

Add BACO support for CI/VI asics

PATCH In review Alex Deucher 3 participants 18 messages Oct 11, 2019 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add BACO support for CI/VI asics

This patch set enables BACO CI and VI asics. BACO is Bus Active Chip Off. It allows us to turn off the GPU while still keeping the bus interface up, so the device does not disappear from the system. PowerXpress and Hybrid Graphics laptops support BOCO (Bus Off Chip Off) which is controlled by ACPI. BACO was conceived as a power saving feature, but we also use it for reset since the chip gets powered down. These patches are a pre-requisite for using BACO as a power saving feature which will follow in another patch set.

BACO is working well on VI parts. I haven't gotten it working yet on CI parts, but I'm including the code for reference if anyone wants to play with it.

Alex Deucher (15):
drm/amdgpu: add new BIF 4.1 register for BACO drm/amdgpu: add new BIF 5.0 register for BACO drm/amdgpu: add new SMU 7.0.1 registers for BACO drm/amdgpu: add new SMU 7.1.2 registers for BACO drm/amdgpu: add new SMU 7.1.3 registers for BACO drm/amdgpu/powerplay: add core support for pre-SOC15 baco drm/amdgpu/powerplay: add support for BACO on tonga drm/amdgpu/powerplay: add support for BACO on Iceland drm/amdgpu/powerplay: add support for BACO on polaris drm/amdgpu/powerplay: add support for BACO on VegaM drm/amdgpu/powerplay: add support for BACO on Fiji drm/amdgpu/powerplay: add support for BACO on CI drm/amdgpu/powerplay: split out common smu7 BACO code drm/amdgpu/powerplay: wire up BACO to powerplay API for smu7 drm/amdgpu: enable BACO reset for SMU7 based dGPUs (v2)

 drivers/gpu/drm/amd/amdgpu/cik.c              |  48 +++-
 drivers/gpu/drm/amd/amdgpu/cik.h              |   3 +
 drivers/gpu/drm/amd/amdgpu/vi.c               |  84 ++++++-
 drivers/gpu/drm/amd/amdgpu/vi.h               |   3 +
 .../drm/amd/include/asic_reg/bif/bif_4_1_d.h  |   1 +
 .../include/asic_reg/bif/bif_4_1_sh_mask.h    |   2 +
 .../drm/amd/include/asic_reg/bif/bif_5_0_d.h  |   1 +
 .../include/asic_reg/bif/bif_5_0_sh_mask.h    |   2 +
 .../amd/include/asic_reg/smu/smu_7_0_1_d.h    |   1 +
 .../include/asic_reg/smu/smu_7_0_1_sh_mask.h  |   2 +
 .../amd/include/asic_reg/smu/smu_7_1_2_d.h    |   1 +
 .../include/asic_reg/smu/smu_7_1_2_sh_mask.h  |   2 +
 .../amd/include/asic_reg/smu/smu_7_1_3_d.h    |   1 +
 .../include/asic_reg/smu/smu_7_1_3_sh_mask.h  |   2 +
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   3 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c | 195 +++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h |  29 +++
 .../gpu/drm/amd/powerplay/hwmgr/common_baco.c |  19 ++
 .../gpu/drm/amd/powerplay/hwmgr/common_baco.h |  13 +
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.c   | 196 +++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.h   |  29 +++
 .../drm/amd/powerplay/hwmgr/polaris_baco.c    | 222 +++++++++++++++++
 .../drm/amd/powerplay/hwmgr/polaris_baco.h    |  29 +++
 .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.c   |  91 +++++++
 .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.h   |  32 +++
 .../gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c  |   4 +
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.c  | 231 ++++++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.h  |  29 +++
 28 files changed, 1264 insertions(+), 11 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.h
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.h
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20191011012135.18566-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 1/15 drm/amdgpu: add new BIF 4.1 register for BACO

---
 drivers/gpu/drm/amd/include/asic_reg/bif/bif_4_1_d.h       | 1 +
 drivers/gpu/drm/amd/include/asic_reg/bif/bif_4_1_sh_mask.h | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/bif/bif_4_1_d.h +1 -0
index a761ba07f937..fce965984e76 100644
@@ -27,6 +27,7 @@
 #define mmMM_INDEX                                                              0x0
 #define mmMM_INDEX_HI                                                           0x6
 #define mmMM_DATA                                                               0x1
+#define mmCC_BIF_BX_FUSESTRAP0							0x14D7
 #define mmBUS_CNTL                                                              0x1508
 #define mmCONFIG_CNTL                                                           0x1509
 #define mmCONFIG_MEMSIZE                                                        0x150a
drivers/gpu/drm/amd/include/asic_reg/bif/bif_4_1_sh_mask.h +2 -0
index 8fbfd0261d27..39cc4880beb4 100644
@@ -32,6 +32,8 @@
 #define MM_INDEX_HI__MM_OFFSET_HI__SHIFT 0x0
 #define MM_DATA__MM_DATA_MASK 0xffffffff
 #define MM_DATA__MM_DATA__SHIFT 0x0
+#define CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK    0x2
+#define CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE__SHIFT  0x1
 #define BUS_CNTL__BIOS_ROM_WRT_EN_MASK 0x1
 #define BUS_CNTL__BIOS_ROM_WRT_EN__SHIFT 0x0
 #define BUS_CNTL__BIOS_ROM_DIS_MASK 0x2
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 2/15 drm/amdgpu: add new BIF 5.0 register for BACO

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/include/asic_reg/bif/bif_5_0_d.h       | 1 +
 drivers/gpu/drm/amd/include/asic_reg/bif/bif_5_0_sh_mask.h | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/bif/bif_5_0_d.h +1 -0
index 809759f7bb81..8d05d6ca1c8d 100644
@@ -27,6 +27,7 @@
 #define mmMM_INDEX                                                              0x0
 #define mmMM_INDEX_HI                                                           0x6
 #define mmMM_DATA                                                               0x1
+#define mmCC_BIF_BX_FUSESTRAP0							0x14D7
 #define mmCC_BIF_BX_STRAP2							0x152A
 #define mmBIF_MM_INDACCESS_CNTL                                                 0x1500
 #define mmBIF_DOORBELL_APER_EN                                                  0x1501
drivers/gpu/drm/amd/include/asic_reg/bif/bif_5_0_sh_mask.h +2 -0
index adc71b01f793..73435687d049 100644
@@ -32,6 +32,8 @@
 #define MM_INDEX_HI__MM_OFFSET_HI__SHIFT 0x0
 #define MM_DATA__MM_DATA_MASK 0xffffffff
 #define MM_DATA__MM_DATA__SHIFT 0x0
+#define CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK    0x2
+#define CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE__SHIFT  0x1
 #define BIF_MM_INDACCESS_CNTL__MM_INDACCESS_DIS_MASK 0x2
 #define BIF_MM_INDACCESS_CNTL__MM_INDACCESS_DIS__SHIFT 0x1
 #define BIF_DOORBELL_APER_EN__BIF_DOORBELL_APER_EN_MASK 0x1
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 3/15 drm/amdgpu: add new SMU 7.0.1 registers for BACO

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_0_1_d.h       | 1 +
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_0_1_sh_mask.h | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_0_1_d.h +1 -0
index dbc2e723f659..71169daa701a 100644
@@ -49,6 +49,7 @@
 #define ixCG_SPLL_FUNC_CNTL_5                                                   0xc0500150
 #define ixCG_SPLL_FUNC_CNTL_6                                                   0xc0500154
 #define ixCG_SPLL_FUNC_CNTL_7                                                   0xc0500158
+#define ixCG_SPLL_STATUS                                                        0xC050015C
 #define ixSPLL_CNTL_MODE                                                        0xc0500160
 #define ixCG_SPLL_SPREAD_SPECTRUM                                               0xc0500164
 #define ixCG_SPLL_SPREAD_SPECTRUM_2                                             0xc0500168
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_0_1_sh_mask.h +2 -0
index 6af9f0217b34..61a9a84e0c3a 100644
@@ -194,6 +194,8 @@
 #define CG_SPLL_FUNC_CNTL_6__SPLL_LF_CNTR__SHIFT 0x19
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL_MASK 0xfff
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL__SHIFT 0x0
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS_MASK 0x2
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS__SHIFT 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL_MASK 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL__SHIFT 0x0
 #define SPLL_CNTL_MODE__SPLL_LEGACY_PDIV_MASK 0x2
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 4/15 drm/amdgpu: add new SMU 7.1.2 registers for BACO

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_2_d.h       | 1 +
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_2_sh_mask.h | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_2_d.h +1 -0
index bd3685166779..351446754c72 100644
@@ -49,6 +49,7 @@
 #define ixCG_SPLL_FUNC_CNTL_5                                                   0xc0500150
 #define ixCG_SPLL_FUNC_CNTL_6                                                   0xc0500154
 #define ixCG_SPLL_FUNC_CNTL_7                                                   0xc0500158
+#define ixCG_SPLL_STATUS                                                        0xC050015C
 #define ixSPLL_CNTL_MODE                                                        0xc0500160
 #define ixCG_SPLL_SPREAD_SPECTRUM                                               0xc0500164
 #define ixCG_SPLL_SPREAD_SPECTRUM_2                                             0xc0500168
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_2_sh_mask.h +2 -0
index 627906674fe8..4bfd5f8ba66c 100644
@@ -194,6 +194,8 @@
 #define CG_SPLL_FUNC_CNTL_6__SPLL_LF_CNTR__SHIFT 0x19
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL_MASK 0xfff
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL__SHIFT 0x0
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS_MASK 0x2
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS__SHIFT 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL_MASK 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL__SHIFT 0x0
 #define SPLL_CNTL_MODE__SPLL_LEGACY_PDIV_MASK 0x2
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 5/15 drm/amdgpu: add new SMU 7.1.3 registers for BACO

In reply to a message not in the archive
---
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_3_d.h       | 1 +
 drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_3_sh_mask.h | 2 ++
 2 files changed, 3 insertions(+)
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_3_d.h +1 -0
index f35aba72e640..21da61c398f5 100644
@@ -52,6 +52,7 @@
 #define ixCG_SPLL_FUNC_CNTL_5                                                   0xc0500150
 #define ixCG_SPLL_FUNC_CNTL_6                                                   0xc0500154
 #define ixCG_SPLL_FUNC_CNTL_7                                                   0xc0500158
+#define ixCG_SPLL_STATUS                                                        0xC050015C
 #define ixSPLL_CNTL_MODE                                                        0xc0500160
 #define ixCG_SPLL_SPREAD_SPECTRUM                                               0xc0500164
 #define ixCG_SPLL_SPREAD_SPECTRUM_2                                             0xc0500168
drivers/gpu/drm/amd/include/asic_reg/smu/smu_7_1_3_sh_mask.h +2 -0
index 481ee6560aa9..f64fe0fbcb32 100644
@@ -220,6 +220,8 @@
 #define CG_SPLL_FUNC_CNTL_6__SPLL_LF_CNTR__SHIFT 0x19
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL_MASK 0xfff
 #define CG_SPLL_FUNC_CNTL_7__SPLL_BW_CNTRL__SHIFT 0x0
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS_MASK 0x2
+#define CG_SPLL_STATUS__SPLL_CHG_STATUS__SHIFT 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL_MASK 0x1
 #define SPLL_CNTL_MODE__SPLL_SW_DIR_CONTROL__SHIFT 0x0
 #define SPLL_CNTL_MODE__SPLL_LEGACY_PDIV_MASK 0x2
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#7 lore raw

PATCH 6/15 drm/amdgpu/powerplay: add core support for pre-SOC15 baco

In reply to a message not in the archive

This adds core support for BACO on pre-vega asics.

---
 .../gpu/drm/amd/powerplay/hwmgr/common_baco.c | 19 +++++++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/common_baco.h | 13 +++++++++++++
 2 files changed, 32 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.c +19 -0
index 9c57c1f67749..1c73776bd606 100644
@@ -79,6 +79,25 @@ static bool baco_cmd_handler(struct pp_hwmgr *hwmgr, u32 command, u32 reg, u32 m
 	return ret;
 }
 
+bool baco_program_registers(struct pp_hwmgr *hwmgr,
+			    const struct baco_cmd_entry *entry,
+			    const u32 array_size)
+{
+	u32 i, reg = 0;
+
+	for (i = 0; i < array_size; i++) {
+		if ((entry[i].cmd == CMD_WRITE) ||
+		    (entry[i].cmd == CMD_READMODIFYWRITE) ||
+		    (entry[i].cmd == CMD_WAITFOR))
+			reg = entry[i].reg_offset;
+		if (!baco_cmd_handler(hwmgr, entry[i].cmd, reg, entry[i].mask,
+				     entry[i].shift, entry[i].val, entry[i].timeout))
+			return false;
+	}
+
+	return true;
+}
+
 bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr,
 				 const struct soc15_baco_cmd_entry *entry,
 				 const u32 array_size)
drivers/gpu/drm/amd/powerplay/hwmgr/common_baco.h +13 -0
index 95296c916f4e..8393eb62706d 100644
@@ -33,6 +33,15 @@ enum baco_cmd_type {
 	CMD_DELAY_US,
 };
 
+struct baco_cmd_entry {
+	enum baco_cmd_type cmd;
+	uint32_t 	reg_offset;
+	uint32_t     	mask;
+	uint32_t     	shift;
+	uint32_t     	timeout;
+	uint32_t     	val;
+};
+
 struct soc15_baco_cmd_entry {
 	enum baco_cmd_type cmd;
 	uint32_t 	hwip;
@@ -44,6 +53,10 @@ struct soc15_baco_cmd_entry {
 	uint32_t     	timeout;
 	uint32_t     	val;
 };
+
+extern bool baco_program_registers(struct pp_hwmgr *hwmgr,
+				   const struct baco_cmd_entry *entry,
+				   const u32 array_size);
 extern bool soc15_baco_program_registers(struct pp_hwmgr *hwmgr,
 					const struct soc15_baco_cmd_entry *entry,
 					const u32 array_size);
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#8 lore raw

PATCH 7/15 drm/amdgpu/powerplay: add support for BACO on tonga

In reply to a message not in the archive

This adds BACO support for Tonga.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   2 +-
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.c  | 221 ++++++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.h  |  32 +++
 3 files changed, 254 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index cc63705920dc..d66cfe5f80f9 100644
@@ -36,7 +36,7 @@ HARDWARE_MGR = hwmgr.o processpptables.o \
 		pp_overdriver.o smu_helper.o \
 		vega20_processpptables.o vega20_hwmgr.o vega20_powertune.o \
 		vega20_thermal.o common_baco.o vega10_baco.o  vega20_baco.o \
-		vega12_baco.o smu9_baco.o
+		vega12_baco.o smu9_baco.o tonga_baco.o
 
 AMD_PP_HWMGR = $(addprefix $(AMD_PP_PATH)/hwmgr/,$(HARDWARE_MGR))
 
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c new file +221 -0

221 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.h new file +32 -0
new file mode 100644
index 000000000000..21301b043255
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#ifndef __TONGA_BACO_H__
+#define __TONGA_BACO_H__
+#include "hwmgr.h"
+#include "common_baco.h"
+
+extern int tonga_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
+extern int tonga_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
+extern int tonga_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
+
+#endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#9 lore raw

PATCH 8/15 drm/amdgpu/powerplay: add support for BACO on Iceland

In reply to a message not in the archive

This adds BACO support for Iceland asics.

---
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.c  | 54 ++++++++++++++++---
 1 file changed, 48 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c +48 -6
index 37a41b83c913..84b7217b7bda 100644
@@ -152,6 +152,36 @@ static const struct baco_cmd_entry clean_baco_tbl[] =
 	{ CMD_WRITE, mmBIOS_SCRATCH_7, 0, 0, 0, 0 }
 };
 
+static const struct baco_cmd_entry gpio_tbl_iceland[] =
+{
+	{ CMD_WRITE, mmGPIOPAD_EN, 0, 0, 0, 0x0 },
+	{ CMD_WRITE, mmGPIOPAD_PD_EN, 0, 0, 0, 0x0 },
+	{ CMD_WRITE, mmGPIOPAD_PU_EN, 0, 0, 0, 0x0 },
+	{ CMD_WRITE, mmGPIOPAD_MASK, 0, 0, 0, 0xff77ffff }
+};
+
+static const struct baco_cmd_entry exit_baco_tbl_iceland[] =
+{
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_RESET_EN_MASK, BACO_CNTL__BACO_RESET_EN__SHIFT, 0, 0x01 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_BCLK_OFF_MASK, BACO_CNTL__BACO_BCLK_OFF__SHIFT, 0, 0x00 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_POWER_OFF_MASK, BACO_CNTL__BACO_POWER_OFF__SHIFT, 0, 0x00 },
+	{ CMD_DELAY_MS, 0, 0, 0, 20, 0 },
+	{ CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_BF_MASK, 0, 0xffffffff, 0x200 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_ISO_DIS_MASK, BACO_CNTL__BACO_ISO_DIS__SHIFT, 0, 0x01 },
+	{ CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__PWRGOOD_MASK, 0, 5, 0x1c00 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_ANA_ISO_DIS_MASK, BACO_CNTL__BACO_ANA_ISO_DIS__SHIFT, 0, 0x01 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_BIF_SCLK_SWITCH_MASK, BACO_CNTL__BACO_BIF_SCLK_SWITCH__SHIFT, 0, 0x00 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_RESET_EN_MASK, BACO_CNTL__BACO_RESET_EN__SHIFT, 0, 0x00 },
+	{ CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__RCU_BIF_CONFIG_DONE_MASK, 0, 5, 0x100 },
+	{ CMD_READMODIFYWRITE, mmBACO_CNTL, BACO_CNTL__BACO_EN_MASK, BACO_CNTL__BACO_EN__SHIFT, 0, 0x00 },
+	{ CMD_WAITFOR, mmBACO_CNTL, BACO_CNTL__BACO_MODE_MASK, 0, 0xffffffff, 0x00 }
+};
+
+static const struct baco_cmd_entry clean_baco_tbl_iceland[] =
+{
+	{ CMD_WRITE, mmBIOS_SCRATCH_7, 0, 0, 0, 0 }
+};
+
 int tonga_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
@@ -195,7 +225,10 @@ int tonga_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 		return 0;
 
 	if (state == BACO_STATE_IN) {
-		baco_program_registers(hwmgr, gpio_tbl, ARRAY_SIZE(gpio_tbl));
+		if (hwmgr->chip_id == CHIP_TOPAZ)
+			baco_program_registers(hwmgr, gpio_tbl_iceland, ARRAY_SIZE(gpio_tbl_iceland));
+		else
+			baco_program_registers(hwmgr, gpio_tbl, ARRAY_SIZE(gpio_tbl));
 		baco_program_registers(hwmgr, enable_fb_req_rej_tbl,
 				       ARRAY_SIZE(enable_fb_req_rej_tbl));
 		baco_program_registers(hwmgr, use_bclk_tbl, ARRAY_SIZE(use_bclk_tbl));
@@ -209,11 +242,20 @@ int tonga_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 		/* HW requires at least 20ms between regulator off and on */
 		msleep(20);
 		/* Execute Hardware BACO exit sequence */
-		if (baco_program_registers(hwmgr, exit_baco_tbl,
-					   ARRAY_SIZE(exit_baco_tbl))) {
-			if (baco_program_registers(hwmgr, clean_baco_tbl,
-						   ARRAY_SIZE(clean_baco_tbl)))
-				return 0;
+		if (hwmgr->chip_id == CHIP_TOPAZ) {
+			if (baco_program_registers(hwmgr, exit_baco_tbl_iceland,
+						   ARRAY_SIZE(exit_baco_tbl_iceland))) {
+				if (baco_program_registers(hwmgr, clean_baco_tbl_iceland,
+							   ARRAY_SIZE(clean_baco_tbl_iceland)))
+					return 0;
+			}
+		} else {
+			if (baco_program_registers(hwmgr, exit_baco_tbl,
+						   ARRAY_SIZE(exit_baco_tbl))) {
+				if (baco_program_registers(hwmgr, clean_baco_tbl,
+							   ARRAY_SIZE(clean_baco_tbl)))
+					return 0;
+			}
 		}
 	}
 
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#10 lore raw

PATCH 9/15 drm/amdgpu/powerplay: add support for BACO on polaris

In reply to a message not in the archive

This adds BACO support for Polaris asics.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   2 +-
 .../drm/amd/powerplay/hwmgr/polaris_baco.c    | 218 ++++++++++++++++++
 .../drm/amd/powerplay/hwmgr/polaris_baco.h    |  32 +++
 3 files changed, 251 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index d66cfe5f80f9..a1535e1430d5 100644
@@ -36,7 +36,7 @@ HARDWARE_MGR = hwmgr.o processpptables.o \
 		pp_overdriver.o smu_helper.o \
 		vega20_processpptables.o vega20_hwmgr.o vega20_powertune.o \
 		vega20_thermal.o common_baco.o vega10_baco.o  vega20_baco.o \
-		vega12_baco.o smu9_baco.o tonga_baco.o
+		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o
 
 AMD_PP_HWMGR = $(addprefix $(AMD_PP_PATH)/hwmgr/,$(HARDWARE_MGR))
 
drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c new file +218 -0

218 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.h new file +32 -0
new file mode 100644
index 000000000000..e48bfb1c5c6a
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#ifndef __POLARIS_BACO_H__
+#define __POLARIS_BACO_H__
+#include "hwmgr.h"
+#include "common_baco.h"
+
+extern int polaris_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
+extern int polaris_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
+extern int polaris_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
+
+#endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#11 lore raw

PATCH 10/15 drm/amdgpu/powerplay: add support for BACO on VegaM

In reply to a message not in the archive

This adds BACO support for VegaM asics.

---
 .../drm/amd/powerplay/hwmgr/polaris_baco.c    | 42 +++++++++++++++++--
 1 file changed, 39 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c +39 -3
index d0c9de88f474..a9abe53df475 100644
@@ -148,6 +148,36 @@ static const struct baco_cmd_entry clean_baco_tbl[] =
 	{ CMD_WRITE, mmBIOS_SCRATCH_7, 0, 0, 0, 0 }
 };
 
+static const struct baco_cmd_entry use_bclk_tbl_vg[] =
+{
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, ixCG_SPLL_FUNC_CNTL },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, CG_SPLL_FUNC_CNTL__SPLL_BYPASS_EN_MASK, CG_SPLL_FUNC_CNTL__SPLL_BYPASS_EN__SHIFT, 0, 0x1 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, 0xC0500170 },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, 0x4000000, 0x1a, 0, 0x1 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, ixGCK_DFS_BYPASS_CNTL },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, GCK_DFS_BYPASS_CNTL__BYPASSACLK_MASK, GCK_DFS_BYPASS_CNTL__BYPASSACLK__SHIFT, 0, 0x1 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, ixMPLL_BYPASSCLK_SEL },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, MPLL_BYPASSCLK_SEL__MPLL_CLKOUT_SEL_MASK, MPLL_BYPASSCLK_SEL__MPLL_CLKOUT_SEL__SHIFT, 0, 0x2 }
+};
+
+static const struct baco_cmd_entry turn_off_plls_tbl_vg[] =
+{
+	{ CMD_READMODIFYWRITE, mmDC_GPIO_PAD_STRENGTH_1, DC_GPIO_PAD_STRENGTH_1__GENLK_STRENGTH_SP_MASK, DC_GPIO_PAD_STRENGTH_1__GENLK_STRENGTH_SP__SHIFT, 0, 0x1 },
+	{ CMD_DELAY_US, 0, 0, 0, 1, 0x0 },
+	{ CMD_READMODIFYWRITE, mmMC_SEQ_DRAM, MC_SEQ_DRAM__RST_CTL_MASK, MC_SEQ_DRAM__RST_CTL__SHIFT, 0, 0x1 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, 0xC05002B0 },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, 0x10, 0x4, 0, 0x1 },
+	{ CMD_WAITFOR, mmGCK_SMC_IND_DATA, 0x10, 0, 1, 0 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, 0xC050032C },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, 0x10, 0x4, 0, 0x1 },
+	{ CMD_WAITFOR, mmGCK_SMC_IND_DATA, 0x10, 0, 1, 0 },
+	{ CMD_WRITE, mmGCK_SMC_IND_INDEX, 0, 0, 0, 0xC0500080 },
+	{ CMD_READMODIFYWRITE, mmGCK_SMC_IND_DATA, 0x1, 0x0, 0, 0x1 },
+	{ CMD_DELAY_US, 0, 0, 0, 3, 0x0 },
+	{ CMD_DELAY_US, 0, 0, 0, 3, 0x0 },
+	{ CMD_DELAY_US, 0, 0, 0, 5, 0x0 }
+};
+
 int polaris_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
@@ -194,9 +224,15 @@ int polaris_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 		baco_program_registers(hwmgr, gpio_tbl, ARRAY_SIZE(gpio_tbl));
 		baco_program_registers(hwmgr, enable_fb_req_rej_tbl,
 				       ARRAY_SIZE(enable_fb_req_rej_tbl));
-		baco_program_registers(hwmgr, use_bclk_tbl, ARRAY_SIZE(use_bclk_tbl));
-		baco_program_registers(hwmgr, turn_off_plls_tbl,
-				       ARRAY_SIZE(turn_off_plls_tbl));
+		if (hwmgr->chip_id == CHIP_VEGAM) {
+			baco_program_registers(hwmgr, use_bclk_tbl_vg, ARRAY_SIZE(use_bclk_tbl_vg));
+			baco_program_registers(hwmgr, turn_off_plls_tbl_vg,
+					       ARRAY_SIZE(turn_off_plls_tbl_vg));
+		} else {
+			baco_program_registers(hwmgr, use_bclk_tbl, ARRAY_SIZE(use_bclk_tbl));
+			baco_program_registers(hwmgr, turn_off_plls_tbl,
+					       ARRAY_SIZE(turn_off_plls_tbl));
+		}
 		baco_program_registers(hwmgr, clk_req_b_tbl, ARRAY_SIZE(clk_req_b_tbl));
 		if (baco_program_registers(hwmgr, enter_baco_tbl,
 					   ARRAY_SIZE(enter_baco_tbl)))
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#12 lore raw

PATCH 11/15 drm/amdgpu/powerplay: add support for BACO on Fiji

In reply to a message not in the archive

This adds BACO support for Fiji asics.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   2 +-
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.c   | 228 ++++++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.h   |  32 +++
 3 files changed, 261 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index a1535e1430d5..bfd22d8b0aea 100644
@@ -36,7 +36,7 @@ HARDWARE_MGR = hwmgr.o processpptables.o \
 		pp_overdriver.o smu_helper.o \
 		vega20_processpptables.o vega20_hwmgr.o vega20_powertune.o \
 		vega20_thermal.o common_baco.o vega10_baco.o  vega20_baco.o \
-		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o
+		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o fiji_baco.o
 
 AMD_PP_HWMGR = $(addprefix $(AMD_PP_PATH)/hwmgr/,$(HARDWARE_MGR))
 
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.c new file +228 -0

228 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.h new file +32 -0
new file mode 100644
index 000000000000..2f7c8388667e
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#ifndef __FIJI_BACO_H__
+#define __FIJI_BACO_H__
+#include "hwmgr.h"
+#include "common_baco.h"
+
+extern int fiji_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
+extern int fiji_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
+extern int fiji_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
+
+#endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#13 lore raw

PATCH 12/15 drm/amdgpu/powerplay: add support for BACO on CI

In reply to a message not in the archive

This adds BACO support for CI asics.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   3 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c | 227 ++++++++++++++++++
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h |  32 +++
 3 files changed, 261 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +2 -1
index bfd22d8b0aea..5ad5893bdae1 100644
@@ -36,7 +36,8 @@ HARDWARE_MGR = hwmgr.o processpptables.o \
 		pp_overdriver.o smu_helper.o \
 		vega20_processpptables.o vega20_hwmgr.o vega20_powertune.o \
 		vega20_thermal.o common_baco.o vega10_baco.o  vega20_baco.o \
-		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o fiji_baco.o
+		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o fiji_baco.o \
+		ci_baco.o
 
 AMD_PP_HWMGR = $(addprefix $(AMD_PP_PATH)/hwmgr/,$(HARDWARE_MGR))
 
drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c new file +227 -0

227 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h new file +32 -0
new file mode 100644
index 000000000000..c9bedb51cb25
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#ifndef __CI_BACO_H__
+#define __CI_BACO_H__
+#include "hwmgr.h"
+#include "common_baco.h"
+
+extern int ci_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
+extern int ci_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
+extern int ci_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
+
+#endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#14 lore raw

PATCH 13/15 drm/amdgpu/powerplay: split out common smu7 BACO code

In reply to a message not in the archive

Several of the BACO functions are common across smu7-based asics. Split the common code out.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |  2 +-
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c | 34 +------
 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h |  5 +-
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.c   | 34 +------
 .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.h   |  5 +-
 .../drm/amd/powerplay/hwmgr/polaris_baco.c    | 34 +------
 .../drm/amd/powerplay/hwmgr/polaris_baco.h    |  5 +-
 .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.c   | 91 +++++++++++++++++++
 .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.h   | 32 +++++++
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.c  | 34 +------
 .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.h  |  5 +-
 11 files changed, 132 insertions(+), 149 deletions(-)
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.c
 create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.h
drivers/gpu/drm/amd/powerplay/hwmgr/Makefile +1 -1
index 5ad5893bdae1..2773966ae434 100644
@@ -37,7 +37,7 @@ HARDWARE_MGR = hwmgr.o processpptables.o \
 		vega20_processpptables.o vega20_hwmgr.o vega20_powertune.o \
 		vega20_thermal.o common_baco.o vega10_baco.o  vega20_baco.o \
 		vega12_baco.o smu9_baco.o tonga_baco.o polaris_baco.o fiji_baco.o \
-		ci_baco.o
+		ci_baco.o smu7_baco.o
 
 AMD_PP_HWMGR = $(addprefix $(AMD_PP_PATH)/hwmgr/,$(HARDWARE_MGR))
 
drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c +1 -33
index f1a8c9cc0d1f..3be40114e63d 100644
@@ -158,43 +158,11 @@ static const struct baco_cmd_entry clean_baco_tbl[] =
 	{ CMD_WRITE, mmCP_PFP_UCODE_ADDR, 0, 0, 0, 0 }
 };
 
-int ci_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	*cap = false;
-	if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_BACO))
-		return 0;
-
-	reg = RREG32(mmCC_BIF_BX_FUSESTRAP0);
-
-	if (reg & CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK)
-		*cap = true;
-
-	return 0;
-}
-
-int ci_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	reg = RREG32(mmBACO_CNTL);
-
-	if (reg & BACO_CNTL__BACO_MODE_MASK)
-		/* gfx has already entered BACO state */
-		*state = BACO_STATE_IN;
-	else
-		*state = BACO_STATE_OUT;
-	return 0;
-}
-
 int ci_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 {
 	enum BACO_STATE cur_state;
 
-	ci_baco_get_state(hwmgr, &cur_state);
+	smu7_baco_get_state(hwmgr, &cur_state);
 
 	if (cur_state == state)
 		/* aisc already in the target state */
drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h +1 -4
index c9bedb51cb25..17041f187020 100644
@@ -22,11 +22,8 @@
  */
 #ifndef __CI_BACO_H__
 #define __CI_BACO_H__
-#include "hwmgr.h"
-#include "common_baco.h"
+#include "smu7_baco.h"
 
-extern int ci_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
-extern int ci_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
 extern int ci_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
 
 #endif
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.c +1 -33
index ad01919ccb27..c0368f2dfb21 100644
@@ -158,43 +158,11 @@ static const struct baco_cmd_entry clean_baco_tbl[] =
 	{ CMD_WRITE, mmBIOS_SCRATCH_15, 0, 0, 0, 0 }
 };
 
-int fiji_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	*cap = false;
-	if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_BACO))
-		return 0;
-
-	reg = RREG32(mmCC_BIF_BX_FUSESTRAP0);
-
-	if (reg & CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK)
-		*cap = true;
-
-	return 0;
-}
-
-int fiji_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	reg = RREG32(mmBACO_CNTL);
-
-	if (reg & BACO_CNTL__BACO_MODE_MASK)
-		/* gfx has already entered BACO state */
-		*state = BACO_STATE_IN;
-	else
-		*state = BACO_STATE_OUT;
-	return 0;
-}
-
 int fiji_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 {
 	enum BACO_STATE cur_state;
 
-	fiji_baco_get_state(hwmgr, &cur_state);
+	smu7_baco_get_state(hwmgr, &cur_state);
 
 	if (cur_state == state)
 		/* aisc already in the target state */
drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.h +1 -4
index 2f7c8388667e..47f402900bdb 100644
@@ -22,11 +22,8 @@
  */
 #ifndef __FIJI_BACO_H__
 #define __FIJI_BACO_H__
-#include "hwmgr.h"
-#include "common_baco.h"
+#include "smu7_baco.h"
 
-extern int fiji_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
-extern int fiji_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
 extern int fiji_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
 
 #endif
drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c +1 -33
index a9abe53df475..8f8e296f2fe9 100644
@@ -178,43 +178,11 @@ static const struct baco_cmd_entry turn_off_plls_tbl_vg[] =
 	{ CMD_DELAY_US, 0, 0, 0, 5, 0x0 }
 };
 
-int polaris_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	*cap = false;
-	if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_BACO))
-		return 0;
-
-	reg = RREG32(mmCC_BIF_BX_FUSESTRAP0);
-
-	if (reg & CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK)
-		*cap = true;
-
-	return 0;
-}
-
-int polaris_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	reg = RREG32(mmBACO_CNTL);
-
-	if (reg & BACO_CNTL__BACO_MODE_MASK)
-		/* gfx has already entered BACO state */
-		*state = BACO_STATE_IN;
-	else
-		*state = BACO_STATE_OUT;
-	return 0;
-}
-
 int polaris_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 {
 	enum BACO_STATE cur_state;
 
-	polaris_baco_get_state(hwmgr, &cur_state);
+	smu7_baco_get_state(hwmgr, &cur_state);
 
 	if (cur_state == state)
 		/* aisc already in the target state */
drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.h +1 -4
index e48bfb1c5c6a..87a5fa0a157a 100644
@@ -22,11 +22,8 @@
  */
 #ifndef __POLARIS_BACO_H__
 #define __POLARIS_BACO_H__
-#include "hwmgr.h"
-#include "common_baco.h"
+#include "smu7_baco.h"
 
-extern int polaris_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
-extern int polaris_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
 extern int polaris_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
 
 #endif
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.c new file +91 -0

91 lines not on this page · raw message

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.h new file +32 -0
new file mode 100644
index 000000000000..be0d98abb536
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2019 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"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+#ifndef __SMU7_BACO_H__
+#define __SMU7_BACO_H__
+#include "hwmgr.h"
+#include "common_baco.h"
+
+extern int smu7_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
+extern int smu7_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
+extern int smu7_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
+
+#endif
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c +1 -33
index 84b7217b7bda..ea743bea8e29 100644
@@ -182,43 +182,11 @@ static const struct baco_cmd_entry clean_baco_tbl_iceland[] =
 	{ CMD_WRITE, mmBIOS_SCRATCH_7, 0, 0, 0, 0 }
 };
 
-int tonga_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	*cap = false;
-	if (!phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_BACO))
-		return 0;
-
-	reg = RREG32(mmCC_BIF_BX_FUSESTRAP0);
-
-	if (reg & CC_BIF_BX_FUSESTRAP0__STRAP_BIF_PX_CAPABLE_MASK)
-		*cap = true;
-
-	return 0;
-}
-
-int tonga_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state)
-{
-	struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev);
-	uint32_t reg;
-
-	reg = RREG32(mmBACO_CNTL);
-
-	if (reg & BACO_CNTL__BACO_MODE_MASK)
-		/* gfx has already entered BACO state */
-		*state = BACO_STATE_IN;
-	else
-		*state = BACO_STATE_OUT;
-	return 0;
-}
-
 int tonga_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state)
 {
 	enum BACO_STATE cur_state;
 
-	tonga_baco_get_state(hwmgr, &cur_state);
+	smu7_baco_get_state(hwmgr, &cur_state);
 
 	if (cur_state == state)
 		/* aisc already in the target state */
drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.h +1 -4
index 21301b043255..5dc16cc8a295 100644
@@ -22,11 +22,8 @@
  */
 #ifndef __TONGA_BACO_H__
 #define __TONGA_BACO_H__
-#include "hwmgr.h"
-#include "common_baco.h"
+#include "smu7_baco.h"
 
-extern int tonga_baco_get_capability(struct pp_hwmgr *hwmgr, bool *cap);
-extern int tonga_baco_get_state(struct pp_hwmgr *hwmgr, enum BACO_STATE *state);
 extern int tonga_baco_set_state(struct pp_hwmgr *hwmgr, enum BACO_STATE state);
 
 #endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#15 lore raw

PATCH 14/15 drm/amdgpu/powerplay: wire up BACO to powerplay API for smu7

In reply to a message not in the archive

Wire up the powerplay callbacks for for BACO for smu7 devices.

---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +4 -0
index 34f95e0e3ea4..0353a0a7cd8e 100644
@@ -48,6 +48,7 @@
 #include "smu7_clockpowergating.h"
 #include "processpptables.h"
 #include "pp_thermal.h"
+#include "smu7_baco.h"
 
 #include "ivsrcid/ivsrcid_vislands30.h"
 
@@ -5145,6 +5146,9 @@ static const struct pp_hwmgr_func smu7_hwmgr_funcs = {
 	.get_power_profile_mode = smu7_get_power_profile_mode,
 	.set_power_profile_mode = smu7_set_power_profile_mode,
 	.get_performance_level = smu7_get_performance_level,
+	.get_asic_baco_capability = smu7_baco_get_capability,
+	.get_asic_baco_state = smu7_baco_get_state,
+	.set_asic_baco_state = smu7_baco_set_state,
 	.power_off_asic = smu7_power_off_asic,
 };
 
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#16 lore raw

PATCH 15/15 drm/amdgpu: enable BACO reset for SMU7 based dGPUs (v2)

In reply to a message not in the archive

Use BACO to reset the GPU if supported on SMU7 based dGPUs.

v2: don't use baco on CI parts

---
 drivers/gpu/drm/amd/amdgpu/cik.c | 48 ++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/cik.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/vi.c  | 84 ++++++++++++++++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/vi.h  |  3 ++
 4 files changed, 128 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/cik.c +43 -5
index b81bb414fcb3..fc8b34480f66 100644
@@ -1270,15 +1270,15 @@ static int cik_gpu_pci_config_reset(struct amdgpu_device *adev)
 }
 
 /**
- * cik_asic_reset - soft reset GPU
+ * cik_asic_pci_config_reset - soft reset GPU
  *
  * @adev: amdgpu_device pointer
  *
- * Look up which blocks are hung and attempt
- * to reset them.
+ * Use PCI Config method to reset the GPU.
+ *
  * Returns 0 for success.
  */
-static int cik_asic_reset(struct amdgpu_device *adev)
+static int cik_asic_pci_config_reset(struct amdgpu_device *adev)
 {
 	int r;
 
@@ -1294,7 +1294,45 @@ static int cik_asic_reset(struct amdgpu_device *adev)
 static enum amd_reset_method
 cik_asic_reset_method(struct amdgpu_device *adev)
 {
-	return AMD_RESET_METHOD_LEGACY;
+	bool baco_reset;
+
+	switch (adev->asic_type) {
+	case CHIP_BONAIRE:
+	case CHIP_HAWAII:
+		/* disable baco reset until it works */
+		/* smu7_asic_get_baco_capability(adev, &baco_reset); */
+		baco_reset = false;
+		break;
+	default:
+		baco_reset = false;
+		break;
+	}
+
+	if (baco_reset)
+		return AMD_RESET_METHOD_BACO;
+	else
+		return AMD_RESET_METHOD_LEGACY;
+}
+
+/**
+ * cik_asic_reset - soft reset GPU
+ *
+ * @adev: amdgpu_device pointer
+ *
+ * Look up which blocks are hung and attempt
+ * to reset them.
+ * Returns 0 for success.
+ */
+static int cik_asic_reset(struct amdgpu_device *adev)
+{
+	int r;
+
+	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)
+		r = smu7_asic_baco_reset(adev);
+	else
+		r = cik_asic_pci_config_reset(adev);
+
+	return r;
 }
 
 static u32 cik_get_config_memsize(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/cik.h +3 -0
index 54c625a2e570..9870bf27870e 100644
@@ -31,4 +31,7 @@ void cik_srbm_select(struct amdgpu_device *adev,
 int cik_set_ip_blocks(struct amdgpu_device *adev);
 
 void legacy_doorbell_index_init(struct amdgpu_device *adev);
+int smu7_asic_get_baco_capability(struct amdgpu_device *adev, bool *cap);
+int smu7_asic_baco_reset(struct amdgpu_device *adev);
+
 #endif
drivers/gpu/drm/amd/amdgpu/vi.c +79 -5

102 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/vi.h +3 -0
index 8de0772f986c..40d4174913a4 100644
@@ -31,4 +31,7 @@ void vi_srbm_select(struct amdgpu_device *adev,
 int vi_set_ip_blocks(struct amdgpu_device *adev);
 
 void legacy_doorbell_index_init(struct amdgpu_device *adev);
+int smu7_asic_get_baco_capability(struct amdgpu_device *adev, bool *cap);
+int smu7_asic_baco_reset(struct amdgpu_device *adev);
+
 #endif
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20191011012135.18566-16-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#18 lore raw

RE: [PATCH 15/15] drm/amdgpu: enable BACO reset for SMU7 based dGPUs (v2)

Series is reviewed-by: Evan Quan <[email protected]>

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Friday, October 11, 2019 9:22 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH 15/15] drm/amdgpu: enable BACO reset for SMU7 based dGPUs (v2)

Use BACO to reset the GPU if supported on SMU7 based dGPUs.

v2: don't use baco on CI parts

---
 drivers/gpu/drm/amd/amdgpu/cik.c | 48 ++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/cik.h |  3 ++
 drivers/gpu/drm/amd/amdgpu/vi.c  | 84 ++++++++++++++++++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/vi.h  |  3 ++
 4 files changed, 128 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/amdgpu/cik.c +43 -5
index b81bb414fcb3..fc8b34480f66 100644
@@ -1270,15 +1270,15 @@ static int cik_gpu_pci_config_reset(struct amdgpu_device *adev)
 }
 
 /**
- * cik_asic_reset - soft reset GPU
+ * cik_asic_pci_config_reset - soft reset GPU
  *
  * @adev: amdgpu_device pointer
  *
- * Look up which blocks are hung and attempt
- * to reset them.
+ * Use PCI Config method to reset the GPU.
+ *
  * Returns 0 for success.
  */
-static int cik_asic_reset(struct amdgpu_device *adev)
+static int cik_asic_pci_config_reset(struct amdgpu_device *adev)
 {
 	int r;
 
@@ -1294,7 +1294,45 @@ static int cik_asic_reset(struct amdgpu_device *adev)
 static enum amd_reset_method
 cik_asic_reset_method(struct amdgpu_device *adev)
 {
-	return AMD_RESET_METHOD_LEGACY;
+	bool baco_reset;
+
+	switch (adev->asic_type) {
+	case CHIP_BONAIRE:
+	case CHIP_HAWAII:
+		/* disable baco reset until it works */
+		/* smu7_asic_get_baco_capability(adev, &baco_reset); */
+		baco_reset = false;
+		break;
+	default:
+		baco_reset = false;
+		break;
+	}
+
+	if (baco_reset)
+		return AMD_RESET_METHOD_BACO;
+	else
+		return AMD_RESET_METHOD_LEGACY;
+}
+
+/**
+ * cik_asic_reset - soft reset GPU
+ *
+ * @adev: amdgpu_device pointer
+ *
+ * Look up which blocks are hung and attempt
+ * to reset them.
+ * Returns 0 for success.
+ */
+static int cik_asic_reset(struct amdgpu_device *adev)
+{
+	int r;
+
+	if (cik_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)
+		r = smu7_asic_baco_reset(adev);
+	else
+		r = cik_asic_pci_config_reset(adev);
+
+	return r;
 }
 
 static u32 cik_get_config_memsize(struct amdgpu_device *adev)
drivers/gpu/drm/amd/amdgpu/cik.h +3 -0
index 54c625a2e570..9870bf27870e 100644
@@ -31,4 +31,7 @@ void cik_srbm_select(struct amdgpu_device *adev,
 int cik_set_ip_blocks(struct amdgpu_device *adev);
 
 void legacy_doorbell_index_init(struct amdgpu_device *adev);
+int smu7_asic_get_baco_capability(struct amdgpu_device *adev, bool *cap);
+int smu7_asic_baco_reset(struct amdgpu_device *adev);
+
 #endif
drivers/gpu/drm/amd/amdgpu/vi.c +79 -5

102 lines not on this page · raw message

drivers/gpu/drm/amd/amdgpu/vi.h +3 -0
index 8de0772f986c..40d4174913a4 100644
@@ -31,4 +31,7 @@ void vi_srbm_select(struct amdgpu_device *adev,
 int vi_set_ip_blocks(struct amdgpu_device *adev);
 
 void legacy_doorbell_index_init(struct amdgpu_device *adev);
+int smu7_asic_get_baco_capability(struct amdgpu_device *adev, bool *cap);
+int smu7_asic_baco_reset(struct amdgpu_device *adev);
+
 #endif
Signature · 10 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#19 lore raw
In reply to a message not in the archive

Am 11.10.19 um 03:21 schrieb Alex Deucher:

Quoted 11 lines

This patch set enables BACO CI and VI asics. BACO is Bus Active Chip Off. It allows us to turn off the GPU while still keeping the bus interface up, so the device does not disappear from the system. PowerXpress and Hybrid Graphics laptops support BOCO (Bus Off Chip Off) which is controlled by ACPI. BACO was conceived as a power saving feature, but we also use it for reset since the chip gets powered down. These patches are a pre-requisite for using BACO as a power saving feature which will follow in another patch set.

Quoted 3 lines

BACO is working well on VI parts. I haven't gotten it working yet on CI parts, but I'm including the code for reference if anyone wants to play with it.

Regards,
Christian.

Quoted 47 lines

Alex Deucher (15):
drm/amdgpu: add new BIF 4.1 register for BACO drm/amdgpu: add new BIF 5.0 register for BACO drm/amdgpu: add new SMU 7.0.1 registers for BACO drm/amdgpu: add new SMU 7.1.2 registers for BACO drm/amdgpu: add new SMU 7.1.3 registers for BACO drm/amdgpu/powerplay: add core support for pre-SOC15 baco drm/amdgpu/powerplay: add support for BACO on tonga drm/amdgpu/powerplay: add support for BACO on Iceland drm/amdgpu/powerplay: add support for BACO on polaris drm/amdgpu/powerplay: add support for BACO on VegaM drm/amdgpu/powerplay: add support for BACO on Fiji drm/amdgpu/powerplay: add support for BACO on CI drm/amdgpu/powerplay: split out common smu7 BACO code drm/amdgpu/powerplay: wire up BACO to powerplay API for smu7 drm/amdgpu: enable BACO reset for SMU7 based dGPUs (v2)

  drivers/gpu/drm/amd/amdgpu/cik.c              |  48 +++-
  drivers/gpu/drm/amd/amdgpu/cik.h              |   3 +
  drivers/gpu/drm/amd/amdgpu/vi.c               |  84 ++++++-
  drivers/gpu/drm/amd/amdgpu/vi.h               |   3 +
  .../drm/amd/include/asic_reg/bif/bif_4_1_d.h  |   1 +
  .../include/asic_reg/bif/bif_4_1_sh_mask.h    |   2 +
  .../drm/amd/include/asic_reg/bif/bif_5_0_d.h  |   1 +
  .../include/asic_reg/bif/bif_5_0_sh_mask.h    |   2 +
  .../amd/include/asic_reg/smu/smu_7_0_1_d.h    |   1 +
  .../include/asic_reg/smu/smu_7_0_1_sh_mask.h  |   2 +
  .../amd/include/asic_reg/smu/smu_7_1_2_d.h    |   1 +
  .../include/asic_reg/smu/smu_7_1_2_sh_mask.h  |   2 +
  .../amd/include/asic_reg/smu/smu_7_1_3_d.h    |   1 +
  .../include/asic_reg/smu/smu_7_1_3_sh_mask.h  |   2 +
  drivers/gpu/drm/amd/powerplay/hwmgr/Makefile  |   3 +-
  drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c | 195 +++++++++++++++
  drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h |  29 +++
  .../gpu/drm/amd/powerplay/hwmgr/common_baco.c |  19 ++
  .../gpu/drm/amd/powerplay/hwmgr/common_baco.h |  13 +
  .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.c   | 196 +++++++++++++++
  .../gpu/drm/amd/powerplay/hwmgr/fiji_baco.h   |  29 +++
  .../drm/amd/powerplay/hwmgr/polaris_baco.c    | 222 +++++++++++++++++
  .../drm/amd/powerplay/hwmgr/polaris_baco.h    |  29 +++
  .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.c   |  91 +++++++
  .../gpu/drm/amd/powerplay/hwmgr/smu7_baco.h   |  32 +++
  .../gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c  |   4 +
  .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.c  | 231 ++++++++++++++++++
  .../gpu/drm/amd/powerplay/hwmgr/tonga_baco.h  |  29 +++
  28 files changed, 1264 insertions(+), 11 deletions(-)
Quoted 11 lines

create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.c create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/ci_baco.h create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.c create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/fiji_baco.h create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.c create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/polaris_baco.h create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.c create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_baco.h create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.c create mode 100644 drivers/gpu/drm/amd/powerplay/hwmgr/tonga_baco.h

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx