Skip to content

Commit 1d8d8b8

Browse files
Dr. David Alan Gilbertalexdeucher
authored andcommitted
drm/amd/pm/smu7: Remove unused smu7_copy_bytes_from_smc
smu7_copy_bytes_from_smc() was added in 2016 by commit 1ff55f4 ("drm/amd/powerplay: implement smu7_smumgr for asics with smu ip version 7.") but never used. Remove it. Signed-off-by: Dr. David Alan Gilbert <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent c2a3bac commit 1d8d8b8

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,6 @@ static int smu7_set_smc_sram_address(struct pp_hwmgr *hwmgr, uint32_t smc_addr,
4646
}
4747

4848

49-
int smu7_copy_bytes_from_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address, uint32_t *dest, uint32_t byte_count, uint32_t limit)
50-
{
51-
uint32_t data;
52-
uint32_t addr;
53-
uint8_t *dest_byte;
54-
uint8_t i, data_byte[4] = {0};
55-
uint32_t *pdata = (uint32_t *)&data_byte;
56-
57-
PP_ASSERT_WITH_CODE((0 == (3 & smc_start_address)), "SMC address must be 4 byte aligned.", return -EINVAL);
58-
PP_ASSERT_WITH_CODE((limit > (smc_start_address + byte_count)), "SMC address is beyond the SMC RAM area.", return -EINVAL);
59-
60-
addr = smc_start_address;
61-
62-
while (byte_count >= 4) {
63-
smu7_read_smc_sram_dword(hwmgr, addr, &data, limit);
64-
65-
*dest = PP_SMC_TO_HOST_UL(data);
66-
67-
dest += 1;
68-
byte_count -= 4;
69-
addr += 4;
70-
}
71-
72-
if (byte_count) {
73-
smu7_read_smc_sram_dword(hwmgr, addr, &data, limit);
74-
*pdata = PP_SMC_TO_HOST_UL(data);
75-
/* Cast dest into byte type in dest_byte. This way, we don't overflow if the allocated memory is not 4-byte aligned. */
76-
dest_byte = (uint8_t *)dest;
77-
for (i = 0; i < byte_count; i++)
78-
dest_byte[i] = data_byte[i];
79-
}
80-
81-
return 0;
82-
}
83-
84-
8549
int smu7_copy_bytes_to_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
8650
const uint8_t *src, uint32_t byte_count, uint32_t limit)
8751
{

drivers/gpu/drm/amd/pm/powerplay/smumgr/smu7_smumgr.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ struct smu7_smumgr {
5353
};
5454

5555

56-
int smu7_copy_bytes_from_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
57-
uint32_t *dest, uint32_t byte_count, uint32_t limit);
5856
int smu7_copy_bytes_to_smc(struct pp_hwmgr *hwmgr, uint32_t smc_start_address,
5957
const uint8_t *src, uint32_t byte_count, uint32_t limit);
6058
int smu7_program_jump_on_start(struct pp_hwmgr *hwmgr);

0 commit comments

Comments
 (0)