diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-09-09 19:59:21 -0400 |
---|---|---|
committer | Deepak Nibade <dnibade@nvidia.com> | 2016-12-27 04:56:49 -0500 |
commit | 82bbd0cd5d3d82bacc5023830d0eeb21065dd5f2 (patch) | |
tree | 50cac71c5516404760b163a7de3675a6b526c797 /drivers/gpu/nvgpu/gp106/hw_xve_gp106.h | |
parent | 4afc6a1659ec058fd44953ccff7a1030275bcc92 (diff) |
gpu: nvgpu: implement PCIe Gen2 frequency swap
Implement the basic code to swap between PCIe bus speeds for the GPU.
Other GPUs are not supported yet. Currently the following speeds can
be used:
Gen1 (2.5 MTPS)
Gen2 (5.0 MTPS)
gp106 on DPX2 does not support Gen3.
JIRA DNVGPU-89
Change-Id: I8bebfc9d99b682bdcff406fa56e806097dd51499
Reviewed-on: http://git-master/r/1218177
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1227925
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/hw_xve_gp106.h')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hw_xve_gp106.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hw_xve_gp106.h b/drivers/gpu/nvgpu/gp106/hw_xve_gp106.h index 74b6cf7c..24434ae0 100644 --- a/drivers/gpu/nvgpu/gp106/hw_xve_gp106.h +++ b/drivers/gpu/nvgpu/gp106/hw_xve_gp106.h | |||
@@ -66,4 +66,84 @@ static inline u32 xve_rom_ctrl_rom_shadow_enabled_f(void) | |||
66 | { | 66 | { |
67 | return 0x1; | 67 | return 0x1; |
68 | } | 68 | } |
69 | static inline u32 xve_link_control_status_r(void) | ||
70 | { | ||
71 | return 0x00000088; | ||
72 | } | ||
73 | static inline u32 xve_link_control_status_link_speed_m(void) | ||
74 | { | ||
75 | return 0xf << 16; | ||
76 | } | ||
77 | static inline u32 xve_link_control_status_link_speed_v(u32 r) | ||
78 | { | ||
79 | return (r >> 16) & 0xf; | ||
80 | } | ||
81 | static inline u32 xve_link_control_status_link_speed_link_speed_2p5_v(void) | ||
82 | { | ||
83 | return 0x00000001; | ||
84 | } | ||
85 | static inline u32 xve_link_control_status_link_speed_link_speed_5p0_v(void) | ||
86 | { | ||
87 | return 0x00000002; | ||
88 | } | ||
89 | static inline u32 xve_link_control_status_link_speed_link_speed_8p0_v(void) | ||
90 | { | ||
91 | return 0x00000003; | ||
92 | } | ||
93 | static inline u32 xve_link_control_status_link_width_m(void) | ||
94 | { | ||
95 | return 0x3f << 20; | ||
96 | } | ||
97 | static inline u32 xve_link_control_status_link_width_v(u32 r) | ||
98 | { | ||
99 | return (r >> 20) & 0x3f; | ||
100 | } | ||
101 | static inline u32 xve_link_control_status_link_width_x1_v(void) | ||
102 | { | ||
103 | return 0x00000001; | ||
104 | } | ||
105 | static inline u32 xve_link_control_status_link_width_x2_v(void) | ||
106 | { | ||
107 | return 0x00000002; | ||
108 | } | ||
109 | static inline u32 xve_link_control_status_link_width_x4_v(void) | ||
110 | { | ||
111 | return 0x00000004; | ||
112 | } | ||
113 | static inline u32 xve_link_control_status_link_width_x8_v(void) | ||
114 | { | ||
115 | return 0x00000008; | ||
116 | } | ||
117 | static inline u32 xve_link_control_status_link_width_x16_v(void) | ||
118 | { | ||
119 | return 0x00000010; | ||
120 | } | ||
121 | static inline u32 xve_priv_xv_r(void) | ||
122 | { | ||
123 | return 0x00000150; | ||
124 | } | ||
125 | static inline u32 xve_priv_xv_cya_l0s_enable_f(u32 v) | ||
126 | { | ||
127 | return (v & 0x1) << 7; | ||
128 | } | ||
129 | static inline u32 xve_priv_xv_cya_l0s_enable_m(void) | ||
130 | { | ||
131 | return 0x1 << 7; | ||
132 | } | ||
133 | static inline u32 xve_priv_xv_cya_l0s_enable_v(u32 r) | ||
134 | { | ||
135 | return (r >> 7) & 0x1; | ||
136 | } | ||
137 | static inline u32 xve_priv_xv_cya_l1_enable_f(u32 v) | ||
138 | { | ||
139 | return (v & 0x1) << 8; | ||
140 | } | ||
141 | static inline u32 xve_priv_xv_cya_l1_enable_m(void) | ||
142 | { | ||
143 | return 0x1 << 8; | ||
144 | } | ||
145 | static inline u32 xve_priv_xv_cya_l1_enable_v(u32 r) | ||
146 | { | ||
147 | return (r >> 8) & 0x1; | ||
148 | } | ||
69 | #endif | 149 | #endif |