diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/nvlink.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/hal_gv100.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/nvlink_gv100.c | 23 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gv100/nvlink_gv100.h | 3 |
5 files changed, 25 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/nvlink.c b/drivers/gpu/nvgpu/common/linux/nvlink.c index faa27239..c93514c0 100644 --- a/drivers/gpu/nvgpu/common/linux/nvlink.c +++ b/drivers/gpu/nvgpu/common/linux/nvlink.c | |||
@@ -28,7 +28,6 @@ int nvgpu_nvlink_read_dt_props(struct gk20a *g) | |||
28 | u32 local_link_id; | 28 | u32 local_link_id; |
29 | u32 remote_dev_id; | 29 | u32 remote_dev_id; |
30 | u32 remote_link_id; | 30 | u32 remote_link_id; |
31 | u32 physical_link; | ||
32 | bool is_master; | 31 | bool is_master; |
33 | 32 | ||
34 | /* Parse DT */ | 33 | /* Parse DT */ |
@@ -49,7 +48,6 @@ int nvgpu_nvlink_read_dt_props(struct gk20a *g) | |||
49 | of_property_read_u32(np, "local_link_id", &local_link_id); | 48 | of_property_read_u32(np, "local_link_id", &local_link_id); |
50 | of_property_read_u32(np, "remote_dev_id", &remote_dev_id); | 49 | of_property_read_u32(np, "remote_dev_id", &remote_dev_id); |
51 | of_property_read_u32(np, "remote_link_id", &remote_link_id); | 50 | of_property_read_u32(np, "remote_link_id", &remote_link_id); |
52 | of_property_read_u32(np, "physical_link", &physical_link); | ||
53 | is_master = of_property_read_bool(np, "is_master"); | 51 | is_master = of_property_read_bool(np, "is_master"); |
54 | 52 | ||
55 | /* Check that we are in dGPU mode */ | 53 | /* Check that we are in dGPU mode */ |
@@ -64,7 +62,6 @@ int nvgpu_nvlink_read_dt_props(struct gk20a *g) | |||
64 | ndev->link.remote_dev_info.device_id = remote_dev_id; | 62 | ndev->link.remote_dev_info.device_id = remote_dev_id; |
65 | ndev->link.remote_dev_info.link_id = remote_link_id; | 63 | ndev->link.remote_dev_info.link_id = remote_link_id; |
66 | 64 | ||
67 | g->nvlink.connected_links = BIT(physical_link); | ||
68 | return 0; | 65 | return 0; |
69 | 66 | ||
70 | fail: | 67 | fail: |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 3b6c3660..2dc62716 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -1200,6 +1200,7 @@ struct gpu_ops { | |||
1200 | int (*setup_pll)(struct gk20a *g, unsigned long link_mask); | 1200 | int (*setup_pll)(struct gk20a *g, unsigned long link_mask); |
1201 | int (*minion_data_ready_en)(struct gk20a *g, | 1201 | int (*minion_data_ready_en)(struct gk20a *g, |
1202 | unsigned long link_mask, bool sync); | 1202 | unsigned long link_mask, bool sync); |
1203 | void (*get_connected_link_mask)(u32 *link_mask); | ||
1203 | /* API */ | 1204 | /* API */ |
1204 | int (*link_early_init)(struct gk20a *g, unsigned long mask); | 1205 | int (*link_early_init)(struct gk20a *g, unsigned long mask); |
1205 | u32 (*link_get_mode)(struct gk20a *g, u32 link_id); | 1206 | u32 (*link_get_mode)(struct gk20a *g, u32 link_id); |
diff --git a/drivers/gpu/nvgpu/gv100/hal_gv100.c b/drivers/gpu/nvgpu/gv100/hal_gv100.c index 5e42ba9f..92900421 100644 --- a/drivers/gpu/nvgpu/gv100/hal_gv100.c +++ b/drivers/gpu/nvgpu/gv100/hal_gv100.c | |||
@@ -843,6 +843,7 @@ static const struct gpu_ops gv100_ops = { | |||
843 | .rxdet = NULL, | 843 | .rxdet = NULL, |
844 | .setup_pll = gv100_nvlink_setup_pll, | 844 | .setup_pll = gv100_nvlink_setup_pll, |
845 | .minion_data_ready_en = gv100_nvlink_minion_data_ready_en, | 845 | .minion_data_ready_en = gv100_nvlink_minion_data_ready_en, |
846 | .get_connected_link_mask = gv100_nvlink_get_connected_link_mask, | ||
846 | /* API */ | 847 | /* API */ |
847 | .link_early_init = gv100_nvlink_link_early_init, | 848 | .link_early_init = gv100_nvlink_link_early_init, |
848 | .link_get_state = gv100_nvlink_link_get_state, | 849 | .link_get_state = gv100_nvlink_link_get_state, |
diff --git a/drivers/gpu/nvgpu/gv100/nvlink_gv100.c b/drivers/gpu/nvgpu/gv100/nvlink_gv100.c index cae4f9bd..e85b5a93 100644 --- a/drivers/gpu/nvgpu/gv100/nvlink_gv100.c +++ b/drivers/gpu/nvgpu/gv100/nvlink_gv100.c | |||
@@ -2696,6 +2696,13 @@ u32 gv100_nvlink_link_get_rx_sublink_state(struct gk20a *g, u32 link_id) | |||
2696 | return nvl_sl1_slsm_status_rx_primary_state_v(reg); | 2696 | return nvl_sl1_slsm_status_rx_primary_state_v(reg); |
2697 | } | 2697 | } |
2698 | 2698 | ||
2699 | /* Hardcode the link_mask while we wait for VBIOS link_disable_mask field | ||
2700 | * to be updated. | ||
2701 | */ | ||
2702 | void gv100_nvlink_get_connected_link_mask(u32 *link_mask) | ||
2703 | { | ||
2704 | *link_mask = GV100_CONNECTED_LINK_MASK; | ||
2705 | } | ||
2699 | /* | 2706 | /* |
2700 | * Performs nvlink device level initialization by discovering the topology | 2707 | * Performs nvlink device level initialization by discovering the topology |
2701 | * taking device out of reset, boot minion, set clocks up and common interrupts | 2708 | * taking device out of reset, boot minion, set clocks up and common interrupts |
@@ -2735,10 +2742,20 @@ int gv100_nvlink_early_init(struct gk20a *g) | |||
2735 | /* Links in reset should be removed from initialized link sw state */ | 2742 | /* Links in reset should be removed from initialized link sw state */ |
2736 | g->nvlink.initialized_links &= __gv100_nvlink_get_link_reset_mask(g); | 2743 | g->nvlink.initialized_links &= __gv100_nvlink_get_link_reset_mask(g); |
2737 | 2744 | ||
2738 | nvgpu_log(g, gpu_dbg_nvlink, "connected_links = 0x%08x (from DT)", | 2745 | /* VBIOS link_disable_mask should be sufficient to find the connected |
2739 | g->nvlink.connected_links); | 2746 | * links. As VBIOS is not updated with correct mask, we parse the DT |
2747 | * node where we hardcode the link_id. DT method is not scalable as same | ||
2748 | * DT node is used for different dGPUs connected over PCIE. | ||
2749 | * Remove the DT parsing of link id and use HAL to get link_mask based | ||
2750 | * on the GPU. This is temporary WAR while we get the VBIOS updated with | ||
2751 | * correct mask. | ||
2752 | */ | ||
2753 | g->ops.nvlink.get_connected_link_mask(&(g->nvlink.connected_links)); | ||
2754 | |||
2755 | nvgpu_log(g, gpu_dbg_nvlink, "connected_links = 0x%08x", | ||
2756 | g->nvlink.connected_links); | ||
2740 | 2757 | ||
2741 | /* Track unconnected links */ | 2758 | /* Track only connected links */ |
2742 | g->nvlink.discovered_links &= g->nvlink.connected_links; | 2759 | g->nvlink.discovered_links &= g->nvlink.connected_links; |
2743 | 2760 | ||
2744 | nvgpu_log(g, gpu_dbg_nvlink, "discovered_links = 0x%08x (combination)", | 2761 | nvgpu_log(g, gpu_dbg_nvlink, "discovered_links = 0x%08x (combination)", |
diff --git a/drivers/gpu/nvgpu/gv100/nvlink_gv100.h b/drivers/gpu/nvgpu/gv100/nvlink_gv100.h index bf923d4b..d9a4b073 100644 --- a/drivers/gpu/nvgpu/gv100/nvlink_gv100.h +++ b/drivers/gpu/nvgpu/gv100/nvlink_gv100.h | |||
@@ -23,6 +23,8 @@ | |||
23 | #ifndef NVGPU_NVLINK_GV100_H | 23 | #ifndef NVGPU_NVLINK_GV100_H |
24 | #define NVGPU_NVLINK_GV100_H | 24 | #define NVGPU_NVLINK_GV100_H |
25 | 25 | ||
26 | #define GV100_CONNECTED_LINK_MASK 0x8 | ||
27 | |||
26 | struct gk20a; | 28 | struct gk20a; |
27 | 29 | ||
28 | int gv100_nvlink_discover_ioctrl(struct gk20a *g); | 30 | int gv100_nvlink_discover_ioctrl(struct gk20a *g); |
@@ -34,6 +36,7 @@ int gv100_nvlink_minion_send_command(struct gk20a *g, u32 link_id, u32 command, | |||
34 | int gv100_nvlink_setup_pll(struct gk20a *g, unsigned long link_mask); | 36 | int gv100_nvlink_setup_pll(struct gk20a *g, unsigned long link_mask); |
35 | int gv100_nvlink_minion_data_ready_en(struct gk20a *g, | 37 | int gv100_nvlink_minion_data_ready_en(struct gk20a *g, |
36 | unsigned long link_mask, bool sync); | 38 | unsigned long link_mask, bool sync); |
39 | void gv100_nvlink_get_connected_link_mask(u32 *link_mask); | ||
37 | /* API */ | 40 | /* API */ |
38 | int gv100_nvlink_link_early_init(struct gk20a *g, unsigned long mask); | 41 | int gv100_nvlink_link_early_init(struct gk20a *g, unsigned long mask); |
39 | u32 gv100_nvlink_link_get_mode(struct gk20a *g, u32 link_id); | 42 | u32 gv100_nvlink_link_get_mode(struct gk20a *g, u32 link_id); |