Likun Gao
89466f49b2
drm/amdgpu: add rlc TOC header file for soc21 (v2)
...
Add RLC autoload TOC header file for soc21 ASIC.
v2: squash in updates
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:03:04 -04:00
Likun Gao
550bb28e64
drm/amdgpu: support rlc v2_3 ucode struct
...
Add support for rlc v2_3 to support RLCV and RLCP fw load.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:02:38 -04:00
Likun Gao
641f053e3e
drm/amdgpu: add gfx firmware header v2_0
...
We need define new firmware header to support
CP RS64 fw.
Signed-off-by: Wenhui Sheng <Wenhui.Sheng@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:02:36 -04:00
Hawking Zhang
6c982cf878
drm/amdgpu: add gfx11 clearstate header
...
Add gfx11 clearstate register arrays
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:02:20 -04:00
Likun Gao
7d33614285
drm/amdgpu/discovery: Set GC family for GC 11.0 IP
...
Set GC family for GC 11.0 IPs.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:02:14 -04:00
Alice Wong
ab0cd4a9ae
drm/amdgpu/ucode: Remove firmware load type check in amdgpu_ucode_free_bo
...
When psp_hw_init failed, it will set the load_type to AMDGPU_FW_LOAD_DIRECT.
During amdgpu_device_ip_fini, amdgpu_ucode_free_bo checks that load_type is
AMDGPU_FW_LOAD_DIRECT and skips deallocating fw_buf causing memory leak.
Remove load_type check in amdgpu_ucode_free_bo.
Signed-off-by: Alice Wong <shiwei.wong@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 10:01:53 -04:00
Likun Gao
40c487409a
drm/amdgpu/discovery: Enable SMU for SMU 13.0.0
...
Enable SMU on SMU IP version 13.0.0
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:59:01 -04:00
Evan Quan
a6dec86840
drm/amdgpu/soc21: enable ATHUB and MMHUB PG
...
Enable ATHUB and MMHUB powergating.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:58:59 -04:00
Evan Quan
b37c41f2cb
drm/amdgpu: enable pptable ucode loading
...
With SCPM enabled, pptable cannot be uploaded to SMU directly.
The transferring has to be via PSP.
Signed-off-by: Evan Quan <evan.quan@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:58:00 -04:00
Hawking Zhang
f0b0a1b806
drm/amdgpu: query core refclk from bios for smu v13
...
The smu_info structrue for smu v13 is changed that
core_refclk in v31 strucuture is not correct for
smu v13_0_0
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:35 -04:00
Likun Gao
0984d38441
drm/amdgpu/discovery: add GMC 11.0 Support
...
Enable GMC 11.0 on asics where it is present.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:29 -04:00
Tianci.Yin
1c2014da77
drm/amdgpu: add gmc v11_0 ip block (v3)
...
Add support for GPU memory controller v11.
v1: Add support for gmc v11.0
Add gmc 11 block (Tianci)
v2: drop unused amdgpu_bo_late_init (Hawking)
v3: squash in various fix
Signed-off-by: Tianci.Yin <tianci.yin@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:26 -04:00
Jack Xiao
d7dab4fc44
drm/amdgpu: save the setting of VM_CONTEXT_CNTL
...
MES firmware needs the setting of VM_CONTEXT_CNTL to perform
vmid switch. Save the initial setting when hub initializing.
Signed-off-by: Jack Xiao <Jack.Xiao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:22 -04:00
Tianci.Yin
98a0f8687e
drm/amdgpu: add mmhub v3_0 ip block
...
Add support for mmhub v3.0
Signed-off-by: Tianci.Yin <tianci.yin@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:18 -04:00
Tianci.Yin
2279b4e596
drm/amdgpu: add gfxhub v3_0 ip block
...
Add support for gfxhub v3.0
Signed-off-by: Tianci.Yin <tianci.yin@amd.com >
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:13 -04:00
Tianci.Yin
ae460cd566
drm/amdgpu: add athub v3_0 ip block
...
Add support for athub v3.0
Signed-off-by: Tianci.Yin <tianci.yin@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:10 -04:00
Likun Gao
55a800da49
drm/amdgpu/discovery: Enable PSP for PSP 13.0.0
...
Enable PSP on PSP IP version 13.0.0
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:57:00 -04:00
Likun Gao
7f318f4e30
drm/amdgpu: add tracking for the enablement of SCPM
...
Add parmeter to shows whether SCPM feature is enabled or not, and
whether is valid.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:56:51 -04:00
Likun Gao
a6b6d38ed8
drm/amdgpu: rework psp firmware name
...
Use the new helper for deriving the fw name from
the IP version.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:30 -04:00
Likun Gao
911a75043f
drm/amdgpu: support psp v13_0_0 microcode init
...
Support psp v13_0_0 microcode init.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:27 -04:00
Likun Gao
e995e2ecdf
drm/amdgpu: add support for spl fw load on psp v13
...
Support for spl firmware load on psp v13.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:23 -04:00
Likun Gao
47a2038554
drm/amdgpu: extend PSP GFX FW type
...
Extend PSP GFX FW type to support IMU, LSDMA, SDMA v6, RS64 MES related
fw load.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:18 -04:00
Hawking Zhang
5fea10d5a9
drm/amdgpu: support print psp v2_0 hdr debug information
...
print out psp firmware v2_0 hdr information for debugging
purpose
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Le Ma <le.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:13 -04:00
Alice Wong
e2c34219d1
drm/amdgpu/psp: deallocate memory when psp_load_fw failed
...
psp_load_fw failure would cause memory leak for psp tmr and psp ring
because psp_hw_init is not called as psp block is not fully initialized.
Clean up psp tmr and psp ring when psp_load_fw fail by calling
psp_free_shared_bufs and psp_ring_destroy.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alice Wong <shiwei.wong@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:07 -04:00
Alex Deucher
da40bf8f93
drm/amdgpu/psp: move shared buffer frees into single function
...
So we can properly clean up if any of the TAs or TMR fails
to properly initialize or terminate. This avoids any
memory leaks in the error case.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:05 -04:00
Alex Deucher
fb4f4f4256
drm/amdgpu/psp: fix memory leak in terminate functions
...
Make sure we free the memory even if the unload fails.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:55:02 -04:00
Alex Deucher
f03d97b0bd
drm/amdgpu/psp: drop load/unload/init_shared_buf wrappers
...
Just call the load/unload/init_shared_buf functions
directly. Makes the code easier to follow.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:54:58 -04:00
Hawking Zhang
996ea8591b
drm/amdgpu: init smuio v13_0_6 callbacks
...
initialize smuio callback for soc21
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:54:46 -04:00
Alex Deucher
b95b539168
drm/amdgpu/psp: move PSP memory alloc from hw_init to sw_init
...
Memory allocations should be done in sw_init. hw_init should
just be hardware programming needed to initialize the IP block.
This is how most other IP blocks work. Move the GPU memory
allocations from psp hw_init to psp sw_init and move the memory
free to sw_fini. This also fixes a potential GPU memory leak
if psp hw_init fails.
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:54:41 -04:00
Hawking Zhang
e6e405e048
drm/amdgpu: add smuio v13_0_6 support
...
add smuio v13_0_6 callbacks to support read
rom image
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:54:38 -04:00
Likun Gao
1761e5efab
drm/amdgpu/discovery: add HDP v6
...
Enable HDP v6 on asics where it is present.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:54:01 -04:00
Likun Gao
563fcfbf31
drm/amdgpu: add hdp version 6 functions
...
Unify hdp related function into hdp structure for hdp version 6.
V2: Remove hdp invalidate function as hdp v6 doesn't have read cache.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:58 -04:00
Philip Yang
068421b173
drm/amdgpu: Free user pages if kvmalloc_array fails
...
To cleanup the BOs of bo_list which have got user pages.
Signed-off-by: Philip Yang <Philip.Yang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:40 -04:00
Minghao Chi
364d453f4d
drm/amdgpu: simplify the return expression of navi10_ih_hw_init()
...
Simplify the return expression.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:28 -04:00
Minghao Chi
3453677aea
drm/amdgpu: simplify the return expression of iceland_ih_hw_init
...
Simplify the return expression.
Reported-by: Zeal Robot <zealci@zte.com.cn >
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:18 -04:00
Likun Gao
2929a6bfa1
drm/amdgpu/discovery: add IH v6
...
Enable IH v6 on asics where it is present.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:15 -04:00
Stanley.Yang
6e02c0ed4b
drm/amdgpu: add ih v6_0 ip block v2
...
This adds ih v6_0 ip block support. IH is the
interrupt handler.
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:53:12 -04:00
Likun Gao
2c0e7ddd1f
drm/amdgpu/discovery: add NBIO 4.3 Support
...
Enable NBIO 4.3 on asics where it is present.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:52:53 -04:00
Stanley.Yang
0d09a60e3e
drm/amdgpu: add nbio v4_3_0 ip block v2
...
This adds nbio v4_3_0 ip block support
Changed from v1:
use WREG32_SOC15/RREG32_SOC15 instead of
WREG32_PCIE/RREG32_PCIE
remove the programming of PCIE_CONFIG_CNTL
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:52:44 -04:00
Likun Gao
759693aced
drm/amdgpu/discovery: add soc21 common Support
...
Enable soc21 common support on asics where it is present.
Signed-off-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-05-04 09:52:35 -04:00
Christian König
8d62a974ac
drm/amdgpu: fix drm-next merge fallout
...
That hunk somehow got missing while solving the conflict between the TTM
and AMDGPU changes for drm-next.
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220503063613.46925-1-christian.koenig@amd.com
2022-05-04 04:20:53 +10:00
Dave Airlie
e954d2c94d
Backmerge tag 'v5.18-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next
...
Linux 5.18-rc5
There was a build fix for arm I wanted in drm-next, so backmerge rather then cherry-pick.
Signed-off-by: Dave Airlie <airlied@redhat.com >
2022-05-03 16:08:48 +10:00
Dave Airlie
15e2b419a8
Merge tag 'drm-misc-next-2022-04-28' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
drm-misc-next for 5.19:
UAPI Changes:
Cross-subsystem Changes:
Core Changes:
- Introduction of display-helper module, and rework of the DP, DSC,
HDCP, HDMI and SCDC headers
- doc: Improvements for tiny drivers, link to external resources
- formats: helper to convert from RGB888 and RGB565 to XRGB8888
- modes: make width-mm/height-mm check mandatory in of_get_drm_panel_display_mode
- ttm: Convert from kvmalloc_array to kvcalloc
Driver Changes:
- bridge:
- analogix_dp: Fix error handling in probe
- dw_hdmi: Coccinelle fixes
- it6505: Fix Kconfig dependency on DRM_DP_AUX_BUS
- panel:
- new panel: DataImage FG040346DSSWBG04
- amdgpu: ttm_eu cleanups
- mxsfb: Rework CRTC mode setting
- nouveau: Make some variables static
- sun4i: Drop drm_display_info.is_hdmi caching, support for the
Allwinner D1
- vc4: Drop drm_display_info.is_hdmi caching
- vmwgfx: Fence improvements
Signed-off-by: Dave Airlie <airlied@redhat.com >
# gpg: Signature made Thu 28 Apr 2022 17:52:13 AEST
# gpg: using EDDSA key 5C1337A45ECA9AEB89060E9EE3EF0D6F671851C5
# gpg: Can't check signature: No public key
From: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20220428075237.yypztjha7hetphcd@houat
2022-04-29 11:33:00 +10:00
Dave Airlie
9d9f720733
Merge tag 'amd-drm-fixes-5.18-2022-04-27' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
...
amd-drm-fixes-5.18-2022-04-27:
amdgpu:
- Runtime pm fix
- DCN memory leak fix in error path
- SI DPM deadlock fix
- S0ix fix
amdkfd:
- GWS fix
- GWS support for CRIU
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220428023232.5794-1-alexander.deucher@amd.com
2022-04-29 10:27:05 +10:00
Philip Yang
3da2c38231
drm/amdgpu: Free user pages if amdgpu_cs_parser_bos failed
...
Otherwise userspace resubmit the BOs again will trigger kernel WARNING
and fail the command submission.
Signed-off-by: Philip Yang <Philip.Yang@amd.com >
Tested-by: Robert Święcki <robert@swiecki.net >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:49:04 -04:00
Candice Li
86e18ac3ae
drm/amdgpu: Fix build warning for TA debugfs interface
...
Remove the redundant codes to fix build warning
when CONFIG_DEBUG_FS is disabled.
Reported-by: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Candice Li <candice.li@amd.com >
Reviewed-by: Yang Wang <kevinyang.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:48:44 -04:00
Stanley.Yang
71199aa47b
drm/amdgpu: add soc21 common ip block v2
...
This adds soc21 common ip block support
Changed from v1:
Switch WREG32/RREG32_PCIE to use indirect reg access
helper for sco15 and onwards
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:48:40 -04:00
Stanley.Yang
ba9e7a4a31
drm/amdgpu: add new write field for soc21
...
add new write field macro to handle soc21
registers with reg prefix
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Stanley.Yang <Stanley.Yang@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:48:35 -04:00
Hawking Zhang
fb1d683513
drm/amdgpu: add nbio callback to query rom offset
...
Add nbio callback func used to query rom offset.
Used to query the rom offset for fetching the vbios.
Acked-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:48:32 -04:00
Hawking Zhang
a8d59943b8
drm/amdgpu: update query ref clk from bios
...
Handle atom_gfx_info_v3_0 structure.
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Likun Gao <Likun.Gao@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-28 17:48:21 -04:00