openwrt/staging/blogic.git
5 years agodrm/amd/display: refactor dump_clk_registers
Su Sung Chung [Wed, 22 May 2019 18:28:52 +0000 (14:28 -0400)]
drm/amd/display: refactor dump_clk_registers

[why]
for 2 purposes:

1. get raw register value dumped on the log, which will make it easier
to talk to other team who only knows about the register

2. enable other HW to be able to use the same interface as raven to log
clock register data

Signed-off-by: Su Sung Chung <Su.Chung@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: wait for the whole frame after global unlock
Wenjing Liu [Tue, 11 Jun 2019 22:18:36 +0000 (18:18 -0400)]
drm/amd/display: wait for the whole frame after global unlock

[why]
The current code will not wait for the entire frame
 after global unlock.
This causes dsc dynamic target bpp update corruption when
there is a surface update immediately happens after this.

[how]
Wait for the entire whole frame after unlock before continuing
the rest of stream and surface update.

Signed-off-by: Wenjing Liu <Wenjing.Liu@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display:Use Pixel clock in 100Hz units for HDMI Audio wall clock DTO
Nevenko Stupar [Tue, 11 Jun 2019 21:35:16 +0000 (17:35 -0400)]
drm/amd/display:Use Pixel clock in 100Hz units for HDMI Audio wall clock DTO

[Why]
-Pass and use pixel clock in 100 Hz to Audio for HDMI
audio DTO for Audio wall clock programming so audio DTO gets
increased precision for timings with /1001 factor.
-For HDMI TMDS for N and CTS ACR tables are based on 10 KHz
units, these does not need to be modified as N and CTS values
are still valid using current tables.

Signed-off-by: Nevenko Stupar <Nevenko.Stupar@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Copy max_clks_by_state after dce_clk_mgr_construct
Nicholas Kazlauskas [Wed, 5 Jun 2019 19:02:04 +0000 (15:02 -0400)]
drm/amd/display: Copy max_clks_by_state after dce_clk_mgr_construct

[Why]
For DCE110, DCE112 and DCE120 the max_clks_by_state for the clk_mgr are
copied from their respective table before the call to
dce_clk_mgr_construct, but then dce_clk_mgr_construct overwrites
these with the dce80_max_clks_by_state.

[How]
Copy these after we call dce_clk_mgr_construct so we're using the
right tables.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Clock does not lower in Updateplanes
Murton Liu [Mon, 10 Jun 2019 21:55:28 +0000 (17:55 -0400)]
drm/amd/display: Clock does not lower in Updateplanes

[why]
We reset the optimized_required in atomic_plane_disable
flag immediately after it is set in atomic_plane_disconnect, causing us to
never have flag set during next flip in UpdatePlanes.

[how]
Optimize directly after each time plane is removed.

Signed-off-by: Murton Liu <murton.liu@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Incorrect Read Interval Time For CR Sequence
David Galiffi [Sat, 8 Jun 2019 01:32:34 +0000 (21:32 -0400)]
drm/amd/display: Incorrect Read Interval Time For CR Sequence

[WHY]
TRAINING_AUX_RD_INTERVAL (DPCD 000Eh) modifies the read interval
for the EQ training sequence. CR read interval should remain 100 us.
Currently, the CR interval is also being modified.

[HOW]
lt_settings->cr_pattern_time should always be 100 us.

Signed-off-by: David Galiffi <david.galiffi@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: 3.2.38
Aric Cyr [Mon, 10 Jun 2019 12:49:36 +0000 (08:49 -0400)]
drm/amd/display: 3.2.38

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Split out common HUBP registers and code
Charlene Liu [Wed, 5 Jun 2019 19:21:03 +0000 (15:21 -0400)]
drm/amd/display: Split out common HUBP registers and code

There are shared regs and code across DCN generations. Pull them out
into a shared common location.

Also, expose some dcn20 init functions.

Signed-off-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: skip retrain in dc_link_set_preferred_link_settings() if using passi...
Samson Tam [Tue, 4 Jun 2019 19:52:59 +0000 (15:52 -0400)]
drm/amd/display: skip retrain in dc_link_set_preferred_link_settings() if using passive dongle

[Why]
Fixes issue when we have a display connected using a passive
dongle and then emulate over it using a DP connection at 1 x 1.62 Ghz.
System hangs because register bus returns back 0xFFFFFFFF for all
register reads after setting register DIG_BE_CNTL in
dcn10_link_encoder_connect_dig_be_to_fe().  Hang occurs later
when trying to do a register read.

[How]
At the start of the emulation, dc_link_set_preferred_link_settings()
and dp_retrain_link_dp_test() is called, even though it is connected
using a passive dongle.

Add an extra condition in dp_retrain_link_dp_test() to check for
link->dongle_max_pix_clk > 0.  This is the only way we know if the
connection is using passive dongle so we don't retrain DP.

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: swap system aperture high/low
Jun Lei [Wed, 5 Jun 2019 14:53:40 +0000 (10:53 -0400)]
drm/amd/display: swap system aperture high/low

[why]
Currently logical values are swapped in HW, causing
system aperture to be undefined, so VA and PA cannot co-exist

[how]
program values correctly

Signed-off-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Set one 4:2:0-related PPS field as recommended by DSC spec
Nikola Cornij [Wed, 5 Jun 2019 18:29:47 +0000 (14:29 -0400)]
drm/amd/display: Set one 4:2:0-related PPS field as recommended by DSC spec

[why]
'second_line_offset_adj' was mistakenly left at zero, even though DSC spec
v1.2a recommends setting this field to 512 for 4:2:0.

[how]
Set 'second_line_offset_adj' to 512 for 4:2:0 and leave at zero otherwise

Signed-off-by: Nikola Cornij <nikola.cornij@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Set default block_size, even in unexpected cases
Dmytro Laktyushkin [Tue, 4 Jun 2019 18:48:33 +0000 (14:48 -0400)]
drm/amd/display: Set default block_size, even in unexpected cases

We're not expected to enter the default case, but not returning a
default value here is incorrect.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: early return when pipe_cnt is 0 in bw validation
Eric Yang [Tue, 4 Jun 2019 22:14:43 +0000 (18:14 -0400)]
drm/amd/display: early return when pipe_cnt is 0 in bw validation

[Why]
Unintentionally introduced behaviour change from previous refactor,
which causes clks to be 0 in no stream cases, which will cause
divide by 0.

[How]
Skip calculation of clocks when no stream. Which is the same as old
behaviour.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <tong.cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Update drm_dsc to reflect native 4.2.0 DSC spec
David Francis [Tue, 4 Jun 2019 20:05:14 +0000 (16:05 -0400)]
drm/amd/display: Update drm_dsc to reflect native 4.2.0 DSC spec

[Why]
Some parts of the DSC spec relating to 4.2.0 were not reflected in
drm_dsc_compute_rc_parameters, causing unexpected config failures

[How]
Add nsl_bpg_offset and rbs_min computation

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Add aux tracing log in dce
Chiawen Huang [Tue, 14 May 2019 08:16:11 +0000 (16:16 +0800)]
drm/amd/display: Add aux tracing log in dce

[Why]
dce was re-arch'd, therefore adding aux tracing log into new dce

[How]
The porting from submit_channel_request/process_channel_reply of aux_engine_dce110.c

Signed-off-by: Chiawen Huang <chiawen.huang@amd.com>
Reviewed-by: Tony Cheng <tong.cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: No audio endpoint for Dell MST display
Harmanprit Tatla [Tue, 4 Jun 2019 18:12:21 +0000 (14:12 -0400)]
drm/amd/display: No audio endpoint for Dell MST display

[Why]
There are certain MST displays (i.e. Dell P2715Q)
that although have the MST feature set to off may still
report it is a branch device and a non-zero
value for downstream port present.
This can lead to us incorrectly classifying a
dp dongle connection as being active and
disabling the audio endpoint for the display.

[How]
Modified the placement and
condition used to assign
the is_branch_dev bit.

Signed-off-by: Harmanprit Tatla <harmanprit.tatla@amd.com>
Reviewed-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: cap DCFCLK hardmin to 507 for NV10
Jun Lei [Mon, 3 Jun 2019 15:37:44 +0000 (11:37 -0400)]
drm/amd/display: cap DCFCLK hardmin to 507 for NV10

[why]
Due to limitation in SMU/PPLIB, it is not possible to know Fmax @ Vmin for DCFCLK.
This causes issues at high display configurations where extra headroom of DCFCLK
can enable P-state switching

[how]
Use existing override logic.  If override not defined, then force
min = 507

Signed-off-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: move bw calc code into helpers
Eric Yang [Wed, 22 May 2019 18:24:40 +0000 (14:24 -0400)]
drm/amd/display: move bw calc code into helpers

[Why]
For better readability and reusability

[How]
Move snippets of BW calculation code into helpers.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Fatemeh Darbehani <Fatemeh.Darbehani@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: 3.2.37
Aric Cyr [Mon, 3 Jun 2019 15:30:43 +0000 (11:30 -0400)]
drm/amd/display: 3.2.37

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: fix dsc disable
Dmytro Laktyushkin [Thu, 30 May 2019 19:47:51 +0000 (15:47 -0400)]
drm/amd/display: fix dsc disable

A regression caused dsc to never get disabled in certain situations.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Nikola Cornij <Nikola.Cornij@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: fix up HUBBUB hw programming for VM
Jun Lei [Mon, 3 Jun 2019 12:13:12 +0000 (08:13 -0400)]
drm/amd/display: fix up HUBBUB hw programming for VM

[why]
Some values were not being converted or bit-shifted properly for
HW registers, causing black screen

[how]
Fix up the values before programming HW

Signed-off-by: Jun Lei <jun.lei@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: 3.2.36
Aric Cyr [Mon, 3 Jun 2019 13:12:55 +0000 (09:12 -0400)]
drm/amd/display: 3.2.36

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: Add ability to set preferred link training parameters.
David Galiffi [Thu, 30 May 2019 15:56:39 +0000 (11:56 -0400)]
drm/amd/display: Add ability to set preferred link training parameters.

[WHY]
To add support for OS requirement to set preferred link training
parameters.

[HOW]
Create new structure of dp link training overrides. During link training
processes, these values should be used instead of the default training
parameters.

Signed-off-by: David Galiffi <David.Galiffi@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/display: initialize p_state to proper value
Jun Lei [Fri, 31 May 2019 19:14:13 +0000 (15:14 -0400)]
drm/amd/display: initialize p_state to proper value

[why]
On some modes SMU will be in infinite loop state at boot, this is
because driver assumes p_state_support is false, but this is the
opposite of the assumed boot state by SMU.  we optimize away
notifying SMU about no pstate, and so they will get stuck

[how]
when we init clk manager, init pstate to true, so it matches driver load
assumption

Signed-off-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: use VCN firmware offset for cache window
Leo Liu [Thu, 18 Jul 2019 15:38:46 +0000 (11:38 -0400)]
drm/amdgpu: use VCN firmware offset for cache window

Since we are using the signed FW now, and also using PSP firmware loading,
but it's still potential to break driver when loading FW directly
instead of PSP, so we should add offset.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/ttm: use the same attributes when freeing d_page->vaddr
Fuqian Huang [Thu, 11 Jul 2019 03:10:21 +0000 (11:10 +0800)]
drm/ttm: use the same attributes when freeing d_page->vaddr

In function __ttm_dma_alloc_page(), d_page->addr is allocated
by dma_alloc_attrs() but freed with use dma_free_coherent() in
__ttm_dma_free_page().
Use the correct dma_free_attrs() to free d_page->vaddr.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: change sysfs pp_dpm_xxx format for navi10
Kevin Wang [Thu, 18 Jul 2019 07:46:55 +0000 (15:46 +0800)]
drm/amd/powerplay: change sysfs pp_dpm_xxx format for navi10

v2:
set average clock value on level 1 when current clock equal
min or max clock (fine grained dpm support).

the navi10 gfxclk (sclk) support fine grained DPM,
so use level 1 to show current dpm freq in sysfs pp_dpm_xxx

Signed-off-by: Kevin Wang <kevin1.wang@amd.com>
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: drop ras self test
Hawking Zhang [Thu, 18 Jul 2019 08:03:46 +0000 (16:03 +0800)]
drm/amdgpu: drop ras self test

this function is not needed any more. error injection is
the only way to validate ras but it can't be executed in
amdgpu_ras_init, where gpu is even not initialized

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: only allow error injection to UMC IP block
Hawking Zhang [Thu, 18 Jul 2019 05:59:38 +0000 (13:59 +0800)]
drm/amdgpu: only allow error injection to UMC IP block

error injection to other IP blocks (except UMC) will be enabled
until RAS feature stablize on those IP blocks

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: disable GFX RAS by default
Hawking Zhang [Thu, 18 Jul 2019 04:52:56 +0000 (12:52 +0800)]
drm/amdgpu: disable GFX RAS by default

GFX RAS has not been stablized yet. disable GFX ras until
it is fully funcitonal.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: do not create ras debugfs/sysfs node for ASICs that don't have ras ability
Hawking Zhang [Thu, 18 Jul 2019 04:49:15 +0000 (12:49 +0800)]
drm/amdgpu: do not create ras debugfs/sysfs node for ASICs that don't have ras ability

driver shouldn't init any ras debugfs/sysfs node for ASICs that don't have ras
hardware ability

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: report bootup clock as max supported on dpm disabled
Evan Quan [Wed, 17 Jul 2019 08:32:27 +0000 (16:32 +0800)]
drm/amd/powerplay: report bootup clock as max supported on dpm disabled

With gfxclk or uclk dpm disabled, it's reasonable to report bootup clock
as the max supported.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Default disable GDS for compute VMIDs
Joseph Greathouse [Wed, 17 Jul 2019 16:55:22 +0000 (11:55 -0500)]
drm/amdgpu: Default disable GDS for compute VMIDs

The GDS and GWS blocks default to allowing all VMIDs to
access all entries. Graphics VMIDs can handle setting
these limits when the driver launches work. However,
compute workloads under HWS control don't go through the
kernel driver. Instead, HWS firmware should set these
limits when a process is put into a VMID slot.

Disable access to these devices by default by turning off
all mask bits (for OA) and setting BASE=SIZE=0 (for GDS
and GWS) for all compute VMIDs. If a process wants to use
these resources, they can request this from the HWS
firmware (when such capabilities are enabled). HWS will
then handle setting the base and limit for the process when
it is assigned to a VMID.

This will also prevent user kernels from getting 'stuck' in
GWS by accident if they write GWS-using code but HWS
firmware is not set up to handle GWS reset. Until HWS is
enabled to handle GWS properly, all GWS accesses will
MEM_VIOL fault the kernel.

v2: Move initialization outside of SRBM mutex

Signed-off-by: Joseph Greathouse <Joseph.Greathouse@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: exposing fica registers to df offsets
Jonathan Kim [Thu, 11 Jul 2019 16:19:44 +0000 (12:19 -0400)]
drm/amdgpu:  exposing fica registers to df offsets

exposing fica registers to poll df pie data for xgmi error counters for
vega20.

Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
Reviewed-by: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: input check for unsupported message/clock index
Evan Quan [Thu, 11 Jul 2019 06:36:44 +0000 (14:36 +0800)]
drm/amd/powerplay: input check for unsupported message/clock index

This can avoid them to be handled in a wrong way without notice.
Since not all SMU messages/clocks are supported on every SMU11 ASIC.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: correct SW SMU valid mapping check
Evan Quan [Thu, 11 Jul 2019 02:23:17 +0000 (10:23 +0800)]
drm/amd/powerplay: correct SW SMU valid mapping check

Current implementation is not actually able to detect
invalid message/table/workload mapping.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: flag arcturus as experimental for now
Alex Deucher [Mon, 15 Jul 2019 21:16:00 +0000 (16:16 -0500)]
drm/amdgpu: flag arcturus as experimental for now

Current support will only work in internal engineering
boards.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: drop unused function definitions
Alex Deucher [Fri, 12 Jul 2019 03:10:31 +0000 (22:10 -0500)]
drm/amdgpu: drop unused function definitions

These were dropped and the headers never got cleaned up.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu:add all VCN rings into schedule request queue
James Zhu [Mon, 1 Jul 2019 23:12:14 +0000 (19:12 -0400)]
drm/amdgpu:add all VCN rings into schedule request queue

Add all VCN instances' decode/encode/jpeg decode rings into
drm_sched_rq list.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Increase vcrat size for GPU
Oak Zeng [Wed, 3 Jul 2019 03:01:59 +0000 (22:01 -0500)]
drm/amdkfd: Increase vcrat size for GPU

GPU cache info (part of virtual CRAT) size depends on CU number.
For arcturus, CU number has been increased. So the required memory
for vcrat also increases.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: enable all 8 sdma instances for Arcturus silicon
Le Ma [Tue, 2 Jul 2019 03:15:37 +0000 (11:15 +0800)]
drm/amdgpu: enable all 8 sdma instances for Arcturus silicon

The more 6 sdma instances work fine now with DF fix in vbios:
  * mmDF_PIE_AON_MiscClientsEnable(0x1c728)=0x3fe(DF_ALL_INSTANCE)
       [9:4]MmhubsEnable=3f (change from 0)

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Merge gfx9/arcturus trap handlers, add ACC VGPR save
Jay Cornwall [Mon, 1 Jul 2019 20:46:56 +0000 (15:46 -0500)]
drm/amdkfd: Merge gfx9/arcturus trap handlers, add ACC VGPR save

ACC VGPRs are a secondary VGPR set of same size as the primary VGPRs.
Save them as a block immediately following VGPRs.

Signed-off-by: Jay Cornwall <Jay.Cornwall@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Add more detail to the VM fault printing
Yong Zhao [Mon, 1 Jul 2019 04:48:40 +0000 (00:48 -0400)]
drm/amdgpu: Add more detail to the VM fault printing

With the printing, we don't need to parse the value on our own any more.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Add device id for real asics
Oak Zeng [Tue, 9 Jul 2019 18:16:37 +0000 (13:16 -0500)]
drm/amdkfd: Add device id for real asics

Add pci device ids.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: limit sdma instances to 2 for Arcturus in BU phase
Le Ma [Sun, 30 Jun 2019 03:35:32 +0000 (11:35 +0800)]
drm/amdgpu: limit sdma instances to 2 for Arcturus in BU phase

Another 6 sdma instances do not work at present. Disable them to unblock KFD
for silicon bringup as a workaround

Signed-off-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: skip gfx 9 common golden settings for arct
Hawking Zhang [Sat, 29 Jun 2019 14:22:13 +0000 (22:22 +0800)]
drm/amdgpu: skip gfx 9 common golden settings for arct

They are not needed by arct

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Add arcturus CWSR trap handler
Oak Zeng [Tue, 9 Jul 2019 18:13:33 +0000 (13:13 -0500)]
drm/amdkfd: Add arcturus CWSR trap handler

CWSR (compute wave save/restore) is used for
preempting compute queues.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamd/powerplay: No SW XGMI dpm for Arcturus rev 2
Yong Zhao [Fri, 28 Jun 2019 09:45:39 +0000 (05:45 -0400)]
amd/powerplay: No SW XGMI dpm for Arcturus rev 2

xgmi dpm is handled by the SMU.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: clean up nonexistent firmware declaration for Arcturus
Le Ma [Fri, 28 Jun 2019 07:08:04 +0000 (15:08 +0800)]
drm/amdgpu: clean up nonexistent firmware declaration for Arcturus

CPG firmwares are not used.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: init gds config for arct
Hawking Zhang [Fri, 28 Jun 2019 05:22:32 +0000 (13:22 +0800)]
drm/amdgpu: init gds config for arct

arct has 4KB gds (4 banks inside) so the max_wave_id
should be 0xfff

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>
5 years agodrm/amdgpu: keep stolen memory for arct
Hawking Zhang [Fri, 28 Jun 2019 03:07:53 +0000 (11:07 +0800)]
drm/amdgpu: keep stolen memory for arct

Any dce register read back from arct is invalid. use hard code
stolen memory for arct until we validate the s3.

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>
5 years agodrm/amdgpu: init arct external rev id
Hawking Zhang [Thu, 27 Jun 2019 10:05:30 +0000 (18:05 +0800)]
drm/amdgpu: init arct external rev id

Properly set the external silicon revision id.

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>
5 years agodrm/amdgpu: add arct gc golden settings
Hawking Zhang [Thu, 27 Jun 2019 07:08:48 +0000 (15:08 +0800)]
drm/amdgpu: add arct gc golden settings

Golden GC register settings from the hw team.

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>
5 years agodrm/amdgpu: add arct sdma golden settings
Hawking Zhang [Thu, 27 Jun 2019 06:47:42 +0000 (14:47 +0800)]
drm/amdgpu: add arct sdma golden settings

Golden SDMA register settings from the hw team.

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>
5 years agodrm/amdgpu: add pci DID for Arcturus GL-XL.
Feifei Xu [Tue, 9 Jul 2019 18:10:53 +0000 (13:10 -0500)]
drm/amdgpu: add pci DID for Arcturus GL-XL.

Add device ids for Arcturus.

Signed-off-by: Feifei Xu <Feifei.Xu@amd.com>
Reviewed-by: Le Ma <Le.Ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: assign fb_start/end in mmhub v9.4 interface
Le Ma [Mon, 22 Apr 2019 09:14:59 +0000 (17:14 +0800)]
drm/amdgpu: assign fb_start/end in mmhub v9.4 interface

Align with mmhub v1.0.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add harvest support for Arcturus
James Zhu [Wed, 10 Jul 2019 17:07:29 +0000 (12:07 -0500)]
drm/amdgpu: add harvest support for Arcturus

Add VCN harvest support for Arcturus

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>
5 years agodrm/amdgpu: add multiple instances support for Arcturus
James Zhu [Wed, 10 Jul 2019 16:06:37 +0000 (11:06 -0500)]
drm/amdgpu: add multiple instances support for Arcturus

Arcturus has dual-VCN. Need add multiple instances support for Arcturus.

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>
5 years agodrm/amdgpu: modify amdgpu_vcn to support multiple instances
James Zhu [Wed, 10 Jul 2019 15:53:34 +0000 (10:53 -0500)]
drm/amdgpu: modify amdgpu_vcn to support multiple instances

Arcturus has dual-VCN. Need Restruct amdgpu_device::vcn to support
multiple vcns. There are no any logical changes here

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>
5 years agodrm/amdgpu: add vcn nbio doorbell range setting for 2nd vcn instance
James Zhu [Wed, 10 Jul 2019 15:50:24 +0000 (10:50 -0500)]
drm/amdgpu: add vcn nbio doorbell range setting for 2nd vcn instance

add vcn nbio doorbell range setting for 2nd vcn instance

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>
5 years agodrm/amdgpu/: increase AMDGPU_MAX_RINGS to add 2nd vcn instance
James Zhu [Tue, 9 Jul 2019 16:07:51 +0000 (11:07 -0500)]
drm/amdgpu/: increase AMDGPU_MAX_RINGS to add 2nd vcn instance

increase AMDGPU_MAX_RINGS to add 2nd vcn instance

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>
5 years agodrm/amdgpu/: add doorbell assignment for 2nd vcn instance
James Zhu [Tue, 4 Jun 2019 18:47:10 +0000 (14:47 -0400)]
drm/amdgpu/: add doorbell assignment for 2nd vcn instance

add doorbell assignment for 2nd vcn instance

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>
5 years agodrm/amdgpu/: add ucodeID for 2nd vcn instance
James Zhu [Tue, 4 Jun 2019 18:44:33 +0000 (14:44 -0400)]
drm/amdgpu/: add ucodeID for 2nd vcn instance

add ucodeID for 2nd vcn instance

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>
5 years agodrm/amdgpu/: add clientID for 2nd vcn instance
James Zhu [Tue, 4 Jun 2019 18:41:48 +0000 (14:41 -0400)]
drm/amdgpu/: add clientID for 2nd vcn instance

add clientID for 2nd vcn instance, remove unused SOC15_IH_CLIENTID_SYSHUB.

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>
5 years agodrm/amdkfd: Set number of xgmi optimized SDMA engines for arcturus
Oak Zeng [Wed, 5 Jun 2019 20:45:26 +0000 (15:45 -0500)]
drm/amdkfd: Set number of xgmi optimized SDMA engines for arcturus

some sdma engines are optimized for xgmi on arcturus.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: correct ip for mmHDP_READ_CACHE_INVALIDATE register access
Le Ma [Mon, 20 May 2019 09:04:05 +0000 (17:04 +0800)]
drm/amdgpu: correct ip for mmHDP_READ_CACHE_INVALIDATE register access

Use the proper IP index for HDP registers.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: set system aperture to cover whole FB region in mmhub v9.4
Le Ma [Fri, 26 Apr 2019 08:36:44 +0000 (16:36 +0800)]
drm/amdgpu: set system aperture to cover whole FB region in mmhub v9.4

In XGMI configuration, the FB region covers vram region from peer
device, adjust system aperture to cover all of them

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: skip get/update xgmi topology info when no psp exists
Le Ma [Tue, 4 Jun 2019 06:58:49 +0000 (14:58 +0800)]
drm/amdgpu: skip get/update xgmi topology info when no psp exists

We don't currently have psp support for arcturus so provide a alternative
mechanism in the meantime.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amd/powerplay: get smc firmware and pptable
Chengming Gui [Tue, 9 Jul 2019 16:04:17 +0000 (11:04 -0500)]
drm/amd/powerplay: get smc firmware and pptable

get smc firmware and pptable for arcturus

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/powerplay: add smu11 driver interface for arcturus. (v2)
Chengming Gui [Mon, 27 May 2019 11:01:39 +0000 (19:01 +0800)]
drm/amdgpu/powerplay: add smu11 driver interface for arcturus. (v2)

add smu11_driver_if_arcturus.h file.

v2: add license, fix header guard (Alex)

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu/powerplay: add arcturus ppt functions
Chengming Gui [Tue, 9 Jul 2019 15:52:20 +0000 (10:52 -0500)]
drm/amdgpu/powerplay: add arcturus ppt functions

add arcturus_ppsmc.h arcturus_ppt.c and arcturus_ppt.h files.

This is the initial power management support for Arcturus.

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
Reviewed-by: Kevin Wang <kevin1.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: enable the Doorbell support for VCN2.5
Leo Liu [Fri, 26 Apr 2019 17:46:21 +0000 (13:46 -0400)]
drm/amdgpu: enable the Doorbell support for VCN2.5

Including decode, encode, and JPEG decode rings

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>
5 years agodrm/amdgpu: add vcn doorbell range function to nbio7.4 (v2)
Leo Liu [Tue, 9 Jul 2019 15:18:36 +0000 (10:18 -0500)]
drm/amdgpu: add vcn doorbell range function to nbio7.4 (v2)

To setup the aperture for VCN2.5

v2: setup vcn doorbells in vcn2.5 hw_init (Alex)

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>
5 years agodrm/amdgpu: enable VCN2.5 on Arcturus
Leo Liu [Tue, 16 Apr 2019 15:42:56 +0000 (11:42 -0400)]
drm/amdgpu: enable VCN2.5 on Arcturus

VCN is the video decode and encode engine on Arcturus

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>
5 years agodrm/amdgpu/VCN2.5: set JPEG decode ring functions
Leo Liu [Mon, 22 Apr 2019 16:21:16 +0000 (12:21 -0400)]
drm/amdgpu/VCN2.5: set JPEG decode ring functions

Also reuse most of the JPEG2.0 decode ring functions

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>
5 years agodrm/amdgpu: add JPEG2.5 HW start and stop
Leo Liu [Tue, 16 Apr 2019 15:32:22 +0000 (11:32 -0400)]
drm/amdgpu: add JPEG2.5 HW start and stop

JPEG engine initialization and suspend sequences

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>
5 years agodrm/amdgpu/VCN2.5: set encode ring functions
Leo Liu [Mon, 22 Apr 2019 16:17:38 +0000 (12:17 -0400)]
drm/amdgpu/VCN2.5: set encode ring functions

Also reuse most of the VCN2.0 encode ring functions

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>
5 years agodrm/amdgpu/VCN2.5: set decode ring functions
Leo Liu [Tue, 16 Apr 2019 15:17:46 +0000 (11:17 -0400)]
drm/amdgpu/VCN2.5: set decode ring functions

Also reuse most of the VCN2.0 decode ring functions

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>
5 years agodrm/amdgpu: add Arcturus to the VCN family
Leo Liu [Tue, 9 Jul 2019 15:09:06 +0000 (10:09 -0500)]
drm/amdgpu: add Arcturus to the VCN family

including firmware support etc.

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>
5 years agodrm/amdgpu: add VCN2.5 VCPU start and stop
Leo Liu [Mon, 15 Apr 2019 16:41:09 +0000 (12:41 -0400)]
drm/amdgpu: add VCN2.5 VCPU start and stop

HW engine initialization and suspend sequences.

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>
5 years agodrm/amdgpu: add VCN2.5 basic supports
Leo Liu [Mon, 15 Apr 2019 16:21:42 +0000 (12:21 -0400)]
drm/amdgpu: add VCN2.5 basic supports

i.e. basic VCN IP SW structures

VCN is the video codec block on the GPU.

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>
5 years agodrm/amdgpu/VCN2: expose rings functions
Leo Liu [Tue, 9 Jul 2019 15:04:39 +0000 (10:04 -0500)]
drm/amdgpu/VCN2: expose rings functions

They can be reused by VCN2.x family

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>
5 years agodrm/amdgpu/VCN2: put IB internal registers offset to structure
Leo Liu [Mon, 15 Apr 2019 13:39:06 +0000 (09:39 -0400)]
drm/amdgpu/VCN2: put IB internal registers offset to structure

So the ring functions can be shared with different VCN versions
with different internal registers offsets

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>
5 years agodrm/amdgpu: declare sdma firmware binary files for Arcturus
Le Ma [Tue, 21 May 2019 11:34:41 +0000 (19:34 +0800)]
drm/amdgpu: declare sdma firmware binary files for Arcturus

So that they are properly picked up as a driver dependency.

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>
5 years agodrm/amdgpu: Clear build undefined warning
James Zhu [Tue, 9 Jul 2019 15:01:35 +0000 (10:01 -0500)]
drm/amdgpu: Clear build undefined warning

Add amdgpu_amdkfd_arcturus_get_functions stub when
CONFIG_HSA_AMD is undefinded.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Enable xgmi support for Arcturus
Oak Zeng [Wed, 20 Mar 2019 21:04:10 +0000 (16:04 -0500)]
drm/amdgpu: Enable xgmi support for Arcturus

xgmi is a high performance cross-GPU communication channel.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Hack xgmi topology info when there is no psp fw
Oak Zeng [Thu, 14 Mar 2019 16:44:24 +0000 (11:44 -0500)]
drm/amdgpu: Hack xgmi topology info when there is no psp fw

This is only needed on emulation platform where psp fw might
not be available, to hack xgmi topology info such as hive id and
node id.

v2: Add offset to hacked hive/node id
v3: Don't use introduce new module parameter.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Support MMHUB1 in kfd interrupt path
Yong Zhao [Sat, 9 Feb 2019 04:06:55 +0000 (23:06 -0500)]
drm/amdkfd: Support MMHUB1 in kfd interrupt path

Handle interrupts for second mmhub.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Set VM_L2_CNTL.PDE_FAULT_CLASSIFICATION to 0 for MMHUB 9.4
Yong Zhao [Fri, 15 Mar 2019 00:28:50 +0000 (20:28 -0400)]
drm/amdgpu: Set VM_L2_CNTL.PDE_FAULT_CLASSIFICATION to 0 for MMHUB 9.4

Should be set to 0 for mmhub 9.4.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Implement kfd2kgd_calls for Arcturus
Oak Zeng [Tue, 9 Jul 2019 14:59:30 +0000 (09:59 -0500)]
drm/amdkfd: Implement kfd2kgd_calls for Arcturus

Arcturus shares most of the kfd2kgd_calls with gfx9. But due to
SDMA register address change, it can't share SDMA related functions.
Export gfx9 kfd2kgd_calls and implement SDMA related functions
for Arcturus.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Fix sdma_bitmap overflow issue
Oak Zeng [Tue, 9 Jul 2019 14:40:15 +0000 (09:40 -0500)]
drm/amdkfd: Fix sdma_bitmap overflow issue

In the original formula, when sdma queue number is 64,
the left shift overflows. Use an equivalence that won't
overflow.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Change arcturus sdma engines number
Oak Zeng [Wed, 12 Dec 2018 22:33:56 +0000 (16:33 -0600)]
drm/amdkfd: Change arcturus sdma engines number

Arcturus has 8 sdma engines

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Yong Zhao <yong.zhao@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Support two MMHUBs when setting up page table base in KFD
Yong Zhao [Fri, 12 Oct 2018 20:16:15 +0000 (16:16 -0400)]
drm/amdkfd: Support two MMHUBs when setting up page table base in KFD

2 mmhubs on arcturus.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Expose function mmhub_v9_4_setup_vm_pt_regs() for kfd to use
Yong Zhao [Thu, 15 Nov 2018 17:59:34 +0000 (12:59 -0500)]
drm/amdkfd: Expose function mmhub_v9_4_setup_vm_pt_regs() for kfd to use

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agoamd/amdkfd: Add ASIC ARCTURUS to kfd
Yong Zhao [Tue, 9 Jul 2019 14:37:04 +0000 (09:37 -0500)]
amd/amdkfd: Add ASIC ARCTURUS to kfd

Add initial support for ARCTURUS to kfd.

Signed-off-by: Yong Zhao <Yong.Zhao@amd.com>
Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Support bigger gds size
Oak Zeng [Tue, 19 Feb 2019 20:59:51 +0000 (14:59 -0600)]
drm/amdkfd: Support bigger gds size

Extend map_process and set_resources pm4 packet to support
bigger gds size for arcturus.

v2: Only make the change for v9

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdkfd: Extend PM4 packets to support 8 SDMA
Oak Zeng [Thu, 14 Feb 2019 20:53:15 +0000 (14:53 -0600)]
drm/amdkfd: Extend PM4 packets to support 8 SDMA

Extend map_queue and unmap_queue PM4 packets to support 8
SDMA engines. The new format is backward compatible.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: Initialize asic functions for Arcturus
Oak Zeng [Wed, 19 Dec 2018 14:44:38 +0000 (08:44 -0600)]
drm/amdgpu: Initialize asic functions for Arcturus

After cherry-picking doorbell rework changes from drm-next
branch, Arcturus asic functions pointer need to be initialized
to init doorbell index for Arcturus.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: add paging queue support for 8 SDMA instances on Arcturus
Le Ma [Tue, 16 Jul 2019 18:39:42 +0000 (13:39 -0500)]
drm/amdgpu: add paging queue support for 8 SDMA instances on Arcturus

Properly enable all 8 instances for paging queue.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
5 years agodrm/amdgpu: correct programming of ih_chicken for Arcturus
Le Ma [Tue, 26 Feb 2019 12:37:17 +0000 (20:37 +0800)]
drm/amdgpu: correct programming of ih_chicken for Arcturus

ih_chicken is a register that is not allowed to access by driver
in the L0 security policy.
psp bl need to enable field to allow driver to use physical
bus address for ih ring on secure part.

Signed-off-by: Le Ma <le.ma@amd.com>
Reviewed-by: Snow Zhang <snow.zhang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>