platform/kernel/linux-starfive.git
4 years agodrm/amd/display: Add DCN3 HWSEQ
Bhawanpreet Lakha [Thu, 21 May 2020 16:45:45 +0000 (12:45 -0400)]
drm/amd/display: Add DCN3 HWSEQ

Add HW sequence programing for DCN3

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DMUB
Bhawanpreet Lakha [Fri, 29 May 2020 19:06:16 +0000 (15:06 -0400)]
drm/amd/display: Add DCN3 DMUB

DMUB (Display Micro-Controller Unit)

Used to read/write regs

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 GPIO
Bhawanpreet Lakha [Thu, 21 May 2020 16:31:21 +0000 (12:31 -0400)]
drm/amd/display: Add DCN3 GPIO

Add support to program GPIO HW block

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 IRQ
Bhawanpreet Lakha [Thu, 21 May 2020 16:30:35 +0000 (12:30 -0400)]
drm/amd/display: Add DCN3 IRQ

Add IWQ services for DCN3,

This allows us to create/init and manage irqs for DCN3

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DML
Bhawanpreet Lakha [Thu, 21 May 2020 16:29:44 +0000 (12:29 -0400)]
drm/amd/display: Add DCN3 DML

Add support for DML(Display mode library) for bandwidth calculations

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DWB
Bhawanpreet Lakha [Thu, 21 May 2020 16:42:30 +0000 (12:42 -0400)]
drm/amd/display: Add DCN3 DWB

Add support to program the DCN3 DWB (Display Writeback)

HW Blocks:

 +--------++------+       +----------+
 | HUBBUB || HUBP |  <--  | MMHUBBUB |
 +--------++------+       +----------+
        |                     ^
        v                     |
    +--------+            +--------+
    |  DPP   |            |  DWB   |
    +--------+            +--------+
        |
        v                      ^
    +--------+                 |
    |  MPC   |                 |
    +--------+                 |
        |                      |
        v                      |
    +-------+                  |
    |  OPP  |                  |
    +-------+                  |
        |                      |
        v                      |
    +--------+                /
    |  OPTC  |  --------------
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 MMHUBHUB
Bhawanpreet Lakha [Thu, 21 May 2020 16:36:30 +0000 (12:36 -0400)]
drm/amd/display: Add DCN3 MMHUBHUB

Add support to program the DCN3 MMHUBBUB (Multimedia HUB interface)

HW Blocks:

 +--------++------+       +----------+
 | HUBBUB || HUBP |  <--  | MMHUBBUB |
 +--------++------+       +----------+
        |
        v
    +--------+
    |  DPP   |
    +--------+
        |
        v
    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 HUBP
Bhawanpreet Lakha [Thu, 21 May 2020 16:44:03 +0000 (12:44 -0400)]
drm/amd/display: Add DCN3 HUBP

Add support to program the DCN3 HUBP (Display to data fabric interface
pipe)

HW Blocks:

 +--------++------+
 | HUBBUB || HUBP |
 +--------++------+
        |
        v
    +--------+
    |  DPP   |
    +--------+
        |
        v
    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 HUBHUB
Bhawanpreet Lakha [Thu, 21 May 2020 16:37:22 +0000 (12:37 -0400)]
drm/amd/display: Add DCN3 HUBHUB

Add support to program the HUBBUB (DCN memory HUB interface)

HW Blocks:

 +--------+
 | HUBBUB |
 +--------+
        |
        v
    +--------+
    |  DPP   |
    +--------+
        |
        v
    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DPP
Bhawanpreet Lakha [Thu, 21 May 2020 16:35:22 +0000 (12:35 -0400)]
drm/amd/display: Add DCN3 DPP

Add support to program the DCN3 DPP (Multiple pipe and plane combine)

HW Blocks:

    +--------+
    |  DPP   |
    +--------+
        |
        v
    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 MPC
Bhawanpreet Lakha [Thu, 21 May 2020 16:38:55 +0000 (12:38 -0400)]
drm/amd/display: Add DCN3 MPC

Add support to program the DCN3 MPC (Multiple pipe and plane combine)

HW Blocks:

    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 OPP header
Bhawanpreet Lakha [Fri, 22 May 2020 21:22:00 +0000 (17:22 -0400)]
drm/amd/display: Add DCN3 OPP header

Add support to program the DCN3 OPP (Output Plane Processing)

HW Blocks:

    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 OPTC
Bhawanpreet Lakha [Thu, 21 May 2020 16:43:28 +0000 (12:43 -0400)]
drm/amd/display: Add DCN3 OPTC

Add support for programming the DCN3 OPTC (Output Timing Controller)

HW Blocks:

    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DCCG
Bhawanpreet Lakha [Thu, 21 May 2020 16:38:30 +0000 (12:38 -0400)]
drm/amd/display: Add DCN3 DCCG

Add programming of the DCCG (Display Controller Clock Generator)
block:

HW Blocks:

    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 CLK_MGR
Bhawanpreet Lakha [Thu, 21 May 2020 16:32:53 +0000 (12:32 -0400)]
drm/amd/display: Add DCN3 CLK_MGR

Adds support for handling of clocking relevant to the DCN3 block

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 DIO
Bhawanpreet Lakha [Fri, 22 May 2020 18:38:38 +0000 (14:38 -0400)]
drm/amd/display: Add DCN3 DIO

Add support for the DIO (Display IO)  block of DCN3, which entails our
stream and link encoders.

HW Blocks:

    +--------+
    |  DIO   |
    +--------+

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/display: Add DCN3 chip ids
Bhawanpreet Lakha [Thu, 21 May 2020 16:28:39 +0000 (12:28 -0400)]
drm/amd/display: Add DCN3 chip ids

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: bypass tmr when reserve c2p memory
Likun Gao [Tue, 26 May 2020 08:54:44 +0000 (16:54 +0800)]
drm/amdgpu: bypass tmr when reserve c2p memory

C2P memory reserved should not in tmr memory range.

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>
4 years agodrm/amdgpu: remove unnecessary check for mem train
Likun Gao [Fri, 22 May 2020 06:42:35 +0000 (14:42 +0800)]
drm/amdgpu: remove unnecessary check for mem train

a.Check whether mem train support when try to reserve related memory.
b.Remove ASIC check and atom firmware table version check as the check
of firmware capability is enough to achieve that purpose.

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>
4 years agodrm/amdgpu: support memory training for sienna_cichlid
Likun Gao [Thu, 21 May 2020 07:35:46 +0000 (15:35 +0800)]
drm/amdgpu: support memory training for sienna_cichlid

Add memory training support for sienna_cichlid.

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>
4 years agodrm/amdgpu: reserve fb according to return value from vbios
Likun Gao [Thu, 21 May 2020 02:33:15 +0000 (10:33 +0800)]
drm/amdgpu: reserve fb according to return value from vbios

Query reserved tmr size through atom firmwareinfo for Sienna_Cichlid and onwards
for all the use cases (IP discovery/G6 memory
training/profiling/diagnostic data.etc), otherwise, fallback to legacy
approach to check and reserve tmr block for ip discovery data and G6
memory training data respectively

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>
4 years agodrm/amd/powerplay: let PMFW to handle the features disablement on BACO in V2
Evan Quan [Fri, 29 May 2020 18:38:53 +0000 (14:38 -0400)]
drm/amd/powerplay: let PMFW to handle the features disablement on BACO in V2

For Sienna_Cichlid, PMFW will handle the features disablement on BACO in. No
need to have driver stepped in.

V2: limit this for baco really

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: drop sienna_cichlid hardcode of using pptable
Likun Gao [Mon, 18 May 2020 10:44:10 +0000 (18:44 +0800)]
drm/amd/powerplay: drop sienna_cichlid hardcode of using pptable

Drop the hardcode of sienna_cichlid which will force to use softpptable,
so that it can use pptable on vbios once the value of pp_table_id get
from vbios is 0.

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>
4 years agodrm/amd/powerplay: update smu function for sienna_cichlid
Likun Gao [Wed, 13 May 2020 12:24:53 +0000 (20:24 +0800)]
drm/amd/powerplay: update smu function for sienna_cichlid

Add function to check whether baco is support for sienna cichlid.
Remove fucntion of get clock by type with latency as it will not be
called.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: update golden setting for sienna_cichlid
Likun Gao [Fri, 8 May 2020 06:39:27 +0000 (14:39 +0800)]
drm/amdgpu: update golden setting for sienna_cichlid

Update golden setting for sienna_cichlid.

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>
4 years agodrm/amdgpu/psp: support for loading PSP SPL fw
Likun Gao [Wed, 6 May 2020 08:19:41 +0000 (16:19 +0800)]
drm/amdgpu/psp: support for loading PSP SPL fw

Add support for loading SPL firmware.

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>
4 years agodrm/amdgpu/psp: initialization PSP SPL fw
Likun Gao [Wed, 6 May 2020 08:16:08 +0000 (16:16 +0800)]
drm/amdgpu/psp: initialization PSP SPL fw

Support for psp firmware header version v1_3 initialization and
information print.

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>
4 years agodrm/amdgpu/psp: add structure to support PSP SPL
Likun Gao [Wed, 6 May 2020 06:57:13 +0000 (14:57 +0800)]
drm/amdgpu/psp: add structure to support PSP SPL

Add support for PSP SPL (Security patch level) table to support
anti-rollback of FW loaded by Trusted OS.

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>
4 years agodrm/amd/powerplay: show gfxclk=0 in gfxoff state
Kenneth Feng [Thu, 7 May 2020 06:33:06 +0000 (14:33 +0800)]
drm/amd/powerplay: show gfxclk=0 in gfxoff state

The instant retrieved gfxclk value should be 0 in gfxoff state.
This can be fetched with gfxoff enabled.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable gfxoff for sienna_cichlid
Likun Gao [Fri, 29 May 2020 18:34:15 +0000 (14:34 -0400)]
drm/amdgpu: enable gfxoff for sienna_cichlid

Enable GFXOFF for sienna_cichlid.

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>
4 years agodrm/amd/amdgpu: disable gfxoff to retrieve gfxclk
Likun Gao [Mon, 20 Apr 2020 15:37:07 +0000 (23:37 +0800)]
drm/amd/amdgpu: disable gfxoff to retrieve gfxclk

For Sienna_Cichlid, GFXOFF state puts gfx dpm into standby mode, then the
gfxclk can't be retireved.

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>
4 years agodrm/amd/powerplay: support mclk socclk limit value set for sienna_cichlid.
Likun Gao [Tue, 28 Apr 2020 08:42:30 +0000 (16:42 +0800)]
drm/amd/powerplay: support mclk socclk limit value set for sienna_cichlid.

Add support to force and unforce MCLK or SOCCLK to dpm limit value.

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>
4 years agodrm/amdgpu/sriov : Add sriov detection for sienna_cichlid
shaoyunl [Mon, 27 Apr 2020 15:53:00 +0000 (11:53 -0400)]
drm/amdgpu/sriov : Add sriov detection for sienna_cichlid

This is a regression due to the rebase , add sienna_cichlid sriov detection back

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: only use one gfx pipe for Sienna_Cichlid
Likun Gao [Fri, 17 Apr 2020 09:33:35 +0000 (17:33 +0800)]
drm/amdgpu: only use one gfx pipe for Sienna_Cichlid

Only enable one gfx pipe for sienna_cichlid currently.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Acked-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: drop jpeg instance1 dpm setup
Likun Gao [Tue, 21 Apr 2020 02:39:12 +0000 (10:39 +0800)]
drm/amd/powerplay: drop jpeg instance1 dpm setup

VCN removed JPEG for instance 1, so drop jpeg instance1 dpm setup.

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>
4 years agodrm/amdgpu: disable runtime pm for sienna_cichlid temporarily
Likun Gao [Thu, 16 Apr 2020 06:53:08 +0000 (14:53 +0800)]
drm/amdgpu: disable runtime pm for sienna_cichlid temporarily

Disable runtime pm for sienna_cichlid temporarily as BACO regression issue.

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>
4 years agodrm/amd/powerplay: enable fw ctf
Kenneth Feng [Thu, 16 Apr 2020 03:56:50 +0000 (11:56 +0800)]
drm/amd/powerplay: enable fw ctf

fw ctf can be triggered if the temperature can't be throttled below the limit.
then the gpu will be powered off and the whole system will hang.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: skip GPU scheduler setup for KIQ and MES ring
Likun Gao [Wed, 15 Apr 2020 03:33:15 +0000 (11:33 +0800)]
drm/amdgpu: skip GPU scheduler setup for KIQ and MES ring

Fix the coding error to skip GPU scheduler setup for KIQ and MES ring.

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>
4 years agodrm/amd/powerplay: enable VDDCI and MVDD for sienna_cichlid
Likun Gao [Mon, 13 Apr 2020 05:00:56 +0000 (13:00 +0800)]
drm/amd/powerplay: enable VDDCI and MVDD for sienna_cichlid

Enable VDDCI and MVDD if PP_MCLK_DPM_MASK was enable for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: append pptable for sienna_cichlid (v2)
Likun Gao [Mon, 13 Apr 2020 06:10:17 +0000 (14:10 +0800)]
drm/amd/powerplay: append pptable for sienna_cichlid (v2)

Add function to append powerplay table from vbios for sienna_cichlid.

v2: squash in warning fix

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>
4 years agodrm/amd/powerplay: and smc dpm info struct for sienna_cichlid
Likun Gao [Fri, 17 Apr 2020 18:03:19 +0000 (14:03 -0400)]
drm/amd/powerplay: and smc dpm info struct for sienna_cichlid

And atom_smc_dpm_info_v4_9 struct for sienna_cichlid use.

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>
4 years agodrm/amdgpu/sriov : Use kiq to do tlb invalidation for gfx10 on sriov
shaoyunl [Thu, 9 Apr 2020 19:53:17 +0000 (15:53 -0400)]
drm/amdgpu/sriov : Use kiq to do tlb invalidation for gfx10 on sriov

On SRIOV run time, driver shouldn't directly access invalidation registers through MMIO.
Use kiq to submit wait_reg_mem package for the invalidation

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable ULCK DS for sienna_cichlid
Likun Gao [Thu, 9 Apr 2020 07:33:53 +0000 (15:33 +0800)]
drm/amd/powerplay: enable ULCK DS for sienna_cichlid

Enable uclk deep sleep for sienna_cichlid.
Df cstate kicks in first, then df triggers uclk ds with the sideband.

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>
4 years agodrm/amdgpu/vcn3.0: schedule instance 0 for decode and 1 for encode
Alex Deucher [Thu, 9 Apr 2020 20:08:55 +0000 (16:08 -0400)]
drm/amdgpu/vcn3.0: schedule instance 0 for decode and 1 for encode

VCN3 has 2 unsymmetrical instances, i.e there're less codecs
on instance 1, we use 0 for decode and 1 for encode for now

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/mes10.1: add no scheduler flag for mes
Alex Deucher [Thu, 9 Apr 2020 20:03:10 +0000 (16:03 -0400)]
drm/amdgpu/mes10.1: add no scheduler flag for mes

We don't want a gpu scheduler for mes.

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable DPG mode for VCN3.0
Boyuan Zhang [Thu, 2 Apr 2020 17:28:07 +0000 (13:28 -0400)]
drm/amdgpu: enable DPG mode for VCN3.0

Enable DPG mode for VCN3.0 by updating related flag.

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add workaround for issue in DPG for VCN3.0
Boyuan Zhang [Fri, 27 Mar 2020 17:49:11 +0000 (13:49 -0400)]
drm/amdgpu: add workaround for issue in DPG for VCN3.0

To workaround an issue in DPG

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: rename macro for VCN2.0 2.5 and 3.0
Boyuan Zhang [Mon, 30 Mar 2020 15:05:02 +0000 (11:05 -0400)]
drm/amdgpu: rename macro for VCN2.0 2.5 and 3.0

Rename SOC15_DPG_MODE_OFFSET_2_0, RREG32_SOC15_DPG_MODE_2_0 and
WREG32_SOC15_DPG_MODE_2_0 for VCN2.0, VCN2.5 and VCN3.0.
These three macros are used VCN2.0, VCN2.5 and VCN3.0, therefore rename
it to be a general name.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: rename macro for VCN1.0
Boyuan Zhang [Fri, 27 Mar 2020 18:11:59 +0000 (14:11 -0400)]
drm/amdgpu: rename macro for VCN1.0

Rename RREG32_SOC15_DPG_MODE and WREG32_SOC15_DPG_MODE for VCN1.0
These two macros are used specifically for VCN1.0, therefore rename
it from general name to VCN1.0 specific name.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add internal reg offset translation for VCN inst 1
Boyuan Zhang [Thu, 26 Mar 2020 23:16:43 +0000 (19:16 -0400)]
drm/amdgpu: add internal reg offset translation for VCN inst 1

Add range for vcn instance 1 for translation for internal register offset, which
is needed for VCN3.0

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: set indirect sram mode for VCN3.0
Boyuan Zhang [Thu, 26 Mar 2020 23:11:56 +0000 (19:11 -0400)]
drm/amdgpu: set indirect sram mode for VCN3.0

Use indirect sram for secure DPG mode

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add pause DPG mode for VCN3.0
Boyuan Zhang [Fri, 27 Mar 2020 17:41:54 +0000 (13:41 -0400)]
drm/amdgpu: add pause DPG mode for VCN3.0

Add vcn_v3_0_pause_dpg_mode to pause/unpause DPG mode for VCN3.0

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add stop DPG mode for VCN3.0
Boyuan Zhang [Fri, 27 Mar 2020 17:38:54 +0000 (13:38 -0400)]
drm/amdgpu: add stop DPG mode for VCN3.0

Add vcn_v3_0_stop_dpg_mode to power off in DPG mode for VCN3.0

V2: update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add start DPG mode for VCN3.0
Boyuan Zhang [Fri, 27 Mar 2020 17:30:53 +0000 (13:30 -0400)]
drm/amdgpu: add start DPG mode for VCN3.0

Add vcn_v3_0_start_dpg_mode to setup and start VCN block in DPG mode for VCN3.0

V2: Separate from previous patch-0002, and update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add mc resume DPG mode for VCN3.0
Boyuan Zhang [Mon, 30 Mar 2020 13:42:45 +0000 (09:42 -0400)]
drm/amdgpu: add mc resume DPG mode for VCN3.0

Add vcn_v3_0_mc_resume_dpg_mode to resume memory controller in DPG mode for VCN3.0

V2: Separate from previous patch-0002, and update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add clock gating DPG mode for VCN3.0
Boyuan Zhang [Fri, 27 Mar 2020 17:11:16 +0000 (13:11 -0400)]
drm/amdgpu: add clock gating DPG mode for VCN3.0

Add vcn_v3_0_clock_gating_dpg_mode to enabling clock gating in DPG mode for VCN3.0

V2: Separate from previous patch-0002, and update description.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: James Zhu <james.zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/am/powerplay: enable OUT OF BAND MONITER for sienna_cichlid
Likun Gao [Mon, 30 Mar 2020 09:07:11 +0000 (17:07 +0800)]
drm/am/powerplay: enable OUT OF BAND MONITER for sienna_cichlid

Enable OUT OF BAND MONITER for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: enable RSMU SMN PG for sienna_cichlid
Likun Gao [Mon, 30 Mar 2020 07:07:10 +0000 (15:07 +0800)]
drm/amd/powerplay: enable RSMU SMN PG for sienna_cichlid

Enable RSMU SMN PG for sienna_cichlid.

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>
4 years agodrm/amdgpu: update golden setting for sienna_cichlid
Likun Gao [Mon, 30 Mar 2020 06:56:53 +0000 (14:56 +0800)]
drm/amdgpu: update golden setting for sienna_cichlid

Update golden setting for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: bundle GPO with gfx DPM
Kenneth Feng [Fri, 27 Mar 2020 06:44:35 +0000 (14:44 +0800)]
drm/amd/powerplay: bundle GPO with gfx DPM

Bundle GPO with gfx DPM and enable it since gfxclk dpm
should work first then GPO works.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable GPO
Kenneth Feng [Fri, 27 Mar 2020 06:17:41 +0000 (14:17 +0800)]
drm/amd/powerplay: enable GPO

GPO is graphics power optimizer.
SMU calculates the 16 gfxclk V/F points according to the CU numbers
and memory activity.RLC picks one of them according to the memory
speed requirements for the data transmission.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable mmhub pg
Kenneth Feng [Fri, 27 Mar 2020 04:23:14 +0000 (12:23 +0800)]
drm/amd/powerplay: enable mmhub pg

mmhub pg can be obvserved from PCTL_CTRL

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable athub pg
Kenneth Feng [Thu, 26 Mar 2020 04:01:15 +0000 (12:01 +0800)]
drm/amd/powerplay: enable athub pg

enable athub pg and the status can be checked in
ATHUB_MISC_CNTL.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: skip VM inv eng assignment for mes ring
Le Ma [Fri, 20 Mar 2020 11:28:52 +0000 (19:28 +0800)]
drm/amdgpu: skip VM inv eng assignment for mes ring

Statically allocated VM inv eng of gfxhub on sienna_cichlid is used up.
Also VM inv eng is no need for mes ring.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/mes: allocate memory slots for hw resource setting
Le Ma [Fri, 20 Mar 2020 11:11:36 +0000 (19:11 +0800)]
drm/amdgpu/mes: allocate memory slots for hw resource setting

Pass a piece of memory to MES ucode to fill contents.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/mes: add status fence memory definitions
Le Ma [Fri, 20 Mar 2020 08:35:50 +0000 (16:35 +0800)]
drm/amdgpu/mes: add status fence memory definitions

Update for new member query_status_fence_gpu_mc_ptr in MESAPI_SET_HW_RESOURCES.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/mes: update mes fw api
Le Ma [Fri, 20 Mar 2020 07:22:37 +0000 (15:22 +0800)]
drm/amdgpu/mes: update mes fw api

Update mes_api_def.h to match the latest mes fw.

v2: clean up coding style based on kernel standards:
  - fix indentation and alignment
  - break long lines
  - put the opening brace last on the line
  - remove unnecessary blank line and space
  - replace uint(32|64) with standard uint(32|64)_t

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: add function to get power limit for sienna_cichlid
Likun Gao [Tue, 24 Mar 2020 07:25:40 +0000 (15:25 +0800)]
drm/amd/powerplay: add function to get power limit for sienna_cichlid

Add function to get pptable power limit for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: enable APCC DFLL for sienna_cichlid
Likun Gao [Tue, 24 Mar 2020 07:15:10 +0000 (15:15 +0800)]
drm/amd/powerplay: enable APCC DFLL for sienna_cichlid

Enable APCC DFLL for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: enable BACO for sienna_cichlid
Likun Gao [Mon, 23 Mar 2020 03:29:20 +0000 (11:29 +0800)]
drm/amd/powerplay: enable BACO for sienna_cichlid

Enable BACO for sienna_cichlid.

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>
4 years agodrm/amdgpu: Sienna_Cichlid don't enable SMU for SRIOV
shaoyunl [Tue, 17 Mar 2020 15:41:34 +0000 (11:41 -0400)]
drm/amdgpu: Sienna_Cichlid don't enable SMU for SRIOV

SMU firmware already been loaded from host, don't enable it for now.
May need to re-work it if we want to enable the SMU for guest in the future.

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable MM DPM PG for sienna_cichlid (v2)
Likun Gao [Thu, 19 Mar 2020 07:21:27 +0000 (15:21 +0800)]
drm/amd/powerplay: enable MM DPM PG for sienna_cichlid (v2)

Enable VCN dpm set for sienna_cichlid.
Enable JPEG dpm set for sienna_cichlid.

v2: squash in BACO fix (Kenneth)

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>
4 years agodrm/amdgpu: fix typo for vcn3/jpeg3 idle check
James Zhu [Wed, 18 Mar 2020 20:59:38 +0000 (16:59 -0400)]
drm/amdgpu: fix typo for vcn3/jpeg3 idle check

fix typo for vcn3/jpeg3 idle check

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/powerplay: enable FCLK DS for sienna_cichlid
Likun Gao [Tue, 17 Mar 2020 05:28:10 +0000 (13:28 +0800)]
drm/amd/powerplay: enable FCLK DS for sienna_cichlid

Enable the feature of FCLK Deep Sleep for sienna_cichlid.

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>
4 years agodrm/amd/powerplay: enable VR0HOT for sienna_cichlid
Likun Gao [Tue, 17 Mar 2020 05:25:12 +0000 (13:25 +0800)]
drm/amd/powerplay: enable VR0HOT for sienna_cichlid

Enable the feature of Voltage Regulator (VR) Hot for sienna_cichlid.

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>
4 years agodrm/amdkfd: sienna_cichlid virtual function support
shaoyunl [Fri, 7 Feb 2020 23:56:42 +0000 (18:56 -0500)]
drm/amdkfd: sienna_cichlid virtual function support

amdkfd add support for sienna_cichlid virtual function

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Support debugger in Navi1x trap handler
Jay Cornwall [Thu, 21 Nov 2019 18:41:11 +0000 (12:41 -0600)]
drm/amdkfd: Support debugger in Navi1x trap handler

- Preserve scalar GPRs ttmp[4:11] and ttmp13
- Add single step exception during context save workaround
- Remove incorrect PC adjustment during context save

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Support newer assemblers in gfx10 trap handler
Jay Cornwall [Wed, 20 Nov 2019 22:13:03 +0000 (16:13 -0600)]
drm/amdkfd: Support newer assemblers in gfx10 trap handler

The contents of macros are parsed by the assembler before conditions
have been tested. This causes assembly errors when using IP-specific
instructions in the IP-unified trap handler.

Add a preprocessing step to filter IP-specific code.

Also guard a Navi1x-specific instruction (no effect on Sienna_Cichlid).

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Add Sienna_Cichlid trap handler support
Jay Cornwall [Sat, 2 Nov 2019 00:05:08 +0000 (19:05 -0500)]
drm/amdkfd: Add Sienna_Cichlid trap handler support

- Replace SQC stores with TCP stores
- Synchronize with MSG_SAVEWAVE via lgkmcnt
- HW_REG_IB_STS is now read-only

Signed-off-by: Jay Cornwall <jay.cornwall@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdkfd: Support Sienna_Cichlid KFD v4
Yong Zhao [Tue, 1 Oct 2019 21:42:20 +0000 (17:42 -0400)]
drm/amdkfd: Support Sienna_Cichlid KFD v4

v4: drop get_tile_config, comment out other callbacks

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu/dc: Add missing Sienna_Cichlid chip id
Jerry (Fangzhi) Zuo [Mon, 20 Jan 2020 16:39:18 +0000 (11:39 -0500)]
drm/amdgpu/dc: Add missing Sienna_Cichlid chip id

Signed-off-by: Jerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: enable 3D pipe 1 on Sienna_Cichlid
Likun Gao [Tue, 3 Mar 2020 02:40:32 +0000 (10:40 +0800)]
drm/amdgpu: enable 3D pipe 1 on Sienna_Cichlid

Only disable 3D pipe 1 on navi1x, enable 3D pipe 1 on Sienna_Cichlid.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: fix SDMA hdp flush engine conflict
Likun Gao [Wed, 4 Mar 2020 08:40:24 +0000 (16:40 +0800)]
drm/amdgpu: fix SDMA hdp flush engine conflict

Each of HDP flush engine should be used by one ring, correct allocate of
hdp flush engine to SDMA ring.
Correct me value of each SDMA ring, as it was cleared when init microcode.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: Enable Multi Media Hub (MMHUB) Clock Gating for sienna_cichlid.
Likun Gao [Wed, 18 Mar 2020 21:33:47 +0000 (17:33 -0400)]
drm/amdgpu: Enable Multi Media Hub (MMHUB) Clock Gating for sienna_cichlid.

Enable mmhub clockgating.

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>
4 years agodrm/amd/amdgpu: add athub ls support
Kenneth Feng [Fri, 28 Feb 2020 06:14:00 +0000 (14:14 +0800)]
drm/amd/amdgpu: add athub ls support

athub ls is bounded with hdp ls,verified.

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/amdgpu: add IH cg support
Kenneth Feng [Fri, 28 Feb 2020 06:09:31 +0000 (14:09 +0800)]
drm/amd/amdgpu: add IH cg support

IH cg verified

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/amdgpu: add HDP mgcg and ls support
Kenneth Feng [Fri, 28 Feb 2020 03:57:04 +0000 (11:57 +0800)]
drm/amd/amdgpu: add HDP mgcg and ls support

add HDP mgcg and ls support and verified

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amd/amdgpu: fix the HDP LS/DS/SD programming
Kenneth Feng [Fri, 28 Feb 2020 03:57:04 +0000 (11:57 +0800)]
drm/amd/amdgpu: fix the HDP LS/DS/SD programming

confirmed that IPH_MEM_POWER_CTRL_EN and RC_MEM_POWER_CTRL_EN
have to be set for SRAM LS/DS/SD

Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Likun Gao <Likun.Gao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: update golden setting for gfx10.3
Likun Gao [Fri, 14 Feb 2020 08:45:56 +0000 (16:45 +0800)]
drm/amdgpu: update golden setting for gfx10.3

Update gfx golden setting for gfx10.3.

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>
4 years agodrm/amdgpu: set the LMI ctrl and reset earlier
Leo Liu [Tue, 28 Jan 2020 17:21:52 +0000 (12:21 -0500)]
drm/amdgpu: set the LMI ctrl and reset earlier

So the LMI register will be programmed properly

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: fix the PSP front door loading VCN firmware
Leo Liu [Tue, 28 Jan 2020 16:50:00 +0000 (11:50 -0500)]
drm/amdgpu: fix the PSP front door loading VCN firmware

for the second instance with correct index

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: change the offset for VCN FW cache window
Leo Liu [Mon, 20 Jan 2020 15:07:40 +0000 (10:07 -0500)]
drm/amdgpu: change the offset for VCN FW cache window

The signed header is added

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: open GFX clock gating for sienna_cichlid
Likun Gao [Thu, 23 Jan 2020 19:57:55 +0000 (03:57 +0800)]
drm/amdgpu: open GFX clock gating for sienna_cichlid

Open GFX MGCG, CGCG and 3DCG for sienna_cichlid.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: switch to query reserved fb size from vbios (v3)
Hawking Zhang [Thu, 23 Jan 2020 16:14:32 +0000 (00:14 +0800)]
drm/amdgpu: switch to query reserved fb size from vbios (v3)

For Sienna_Cichlid, query fw_reserved_fb_size from vbios directly.
For navi1x, fall back to default 64K TMR size.
For pre-navi, no need to reserve tmr region in top LFB.

v2: fix TMR define (Alex)
v3: partially revert size change

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add atomfirmware helper funciton to query reserved fb size
Hawking Zhang [Wed, 22 Jan 2020 20:13:01 +0000 (04:13 +0800)]
drm/amdgpu: add atomfirmware helper funciton to query reserved fb size

fw_reserved_size_in_kb is introduced for driver to query
the TMR region reserved by PSP BL in Sienna_Cichlid and onwards

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: add firmware_info v3_4 structure for Sienna_Cichlid
Hawking Zhang [Wed, 22 Jan 2020 20:08:59 +0000 (04:08 +0800)]
drm/amdgpu: add firmware_info v3_4 structure for Sienna_Cichlid

firmware_info v3_4 strucure will be used by kernel driver
to query various parameters set by VBIOS for Sienna_Cichlid

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: only send one sdma firmware for sienna_cichlid
Likun Gao [Mon, 20 Jan 2020 19:22:32 +0000 (03:22 +0800)]
drm/amdgpu: only send one sdma firmware for sienna_cichlid

As all four sdma firmware are same, PSP only receive one SDMA fw.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
4 years agodrm/amdgpu: drop gfx_v10_0_tiling_mode_table_init
Hawking Zhang [Sun, 19 Jan 2020 21:16:41 +0000 (05:16 +0800)]
drm/amdgpu: drop gfx_v10_0_tiling_mode_table_init

tiling mode table is not used anymore for gfx10

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>
4 years agodrm/amdgpu: support query vram info for sienna_cichlid
Hawking Zhang [Sun, 19 Jan 2020 20:46:33 +0000 (04:46 +0800)]
drm/amdgpu: support query vram info for sienna_cichlid

support query vram_module v11 and vram_info v2_5
for sienna_cichlid

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>
4 years agodrm/amdgpu: add vram_info v2_5 in atomfirmware header
Hawking Zhang [Sun, 19 Jan 2020 20:41:40 +0000 (04:41 +0800)]
drm/amdgpu: add vram_info v2_5 in atomfirmware header

vram_info v2_5 was introduced to support sienna_cichlid

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>