aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorShobhit Kumar <shobhit.kumar@intel.com>2015-02-05 06:40:56 -0500
committerJani Nikula <jani.nikula@intel.com>2015-02-09 07:26:19 -0500
commitd180d2bbb66579e3bf449642b8ec2a76f4014fcd (patch)
tree4eb557df13a787ffad4a66981e48a1544bfddac5 /drivers/gpu/drm
parent460822b0b1a77db859b0320469799fa4dbe4d367 (diff)
drm/i915: Correct the IOSF Dev_FN field for IOSF transfers
As per the specififcation, the SB_DevFn is the PCI_DEVFN of the target device and not the source. So PCI_DEVFN(2,0) is not correct. Further the port ID should be enough to identify devices unless they are MFD. The SB_DevFn was intended to remove ambiguity in case of these MFD devices. For non MFD devices the recommendation for the target device IP was to ignore these fields, but not all of them followed the recommendation. Some like CCK ignore these fields and hence PCI_DEVFN(2, 0) works and so does PCI_DEVFN(0, 0) as it works for DPIO. The issue came to light because of GPIONC which was not getting programmed correctly with PCI_DEVFN(2, 0). It turned out that this did not follow the recommendation and expected 0 in this field. In general the recommendation is to use SB_DevFn as PCI_DEVFN(0, 0) for all devices except target PCI devices. Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: stable@vger.kernel.org Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/i915/intel_sideband.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c
index 3c42eeffa3cb..693ce8281970 100644
--- a/drivers/gpu/drm/i915/intel_sideband.c
+++ b/drivers/gpu/drm/i915/intel_sideband.c
@@ -82,7 +82,7 @@ u32 vlv_punit_read(struct drm_i915_private *dev_priv, u32 addr)
82 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock)); 82 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
83 83
84 mutex_lock(&dev_priv->dpio_lock); 84 mutex_lock(&dev_priv->dpio_lock);
85 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_PUNIT, 85 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_PUNIT,
86 SB_CRRDDA_NP, addr, &val); 86 SB_CRRDDA_NP, addr, &val);
87 mutex_unlock(&dev_priv->dpio_lock); 87 mutex_unlock(&dev_priv->dpio_lock);
88 88
@@ -94,7 +94,7 @@ void vlv_punit_write(struct drm_i915_private *dev_priv, u32 addr, u32 val)
94 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock)); 94 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
95 95
96 mutex_lock(&dev_priv->dpio_lock); 96 mutex_lock(&dev_priv->dpio_lock);
97 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_PUNIT, 97 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_PUNIT,
98 SB_CRWRDA_NP, addr, &val); 98 SB_CRWRDA_NP, addr, &val);
99 mutex_unlock(&dev_priv->dpio_lock); 99 mutex_unlock(&dev_priv->dpio_lock);
100} 100}
@@ -103,7 +103,7 @@ u32 vlv_bunit_read(struct drm_i915_private *dev_priv, u32 reg)
103{ 103{
104 u32 val = 0; 104 u32 val = 0;
105 105
106 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_BUNIT, 106 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_BUNIT,
107 SB_CRRDDA_NP, reg, &val); 107 SB_CRRDDA_NP, reg, &val);
108 108
109 return val; 109 return val;
@@ -111,7 +111,7 @@ u32 vlv_bunit_read(struct drm_i915_private *dev_priv, u32 reg)
111 111
112void vlv_bunit_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) 112void vlv_bunit_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
113{ 113{
114 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_BUNIT, 114 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_BUNIT,
115 SB_CRWRDA_NP, reg, &val); 115 SB_CRWRDA_NP, reg, &val);
116} 116}
117 117
@@ -122,7 +122,7 @@ u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr)
122 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock)); 122 WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
123 123
124 mutex_lock(&dev_priv->dpio_lock); 124 mutex_lock(&dev_priv->dpio_lock);
125 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_NC, 125 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_NC,
126 SB_CRRDDA_NP, addr, &val); 126 SB_CRRDDA_NP, addr, &val);
127 mutex_unlock(&dev_priv->dpio_lock); 127 mutex_unlock(&dev_priv->dpio_lock);
128 128
@@ -132,56 +132,56 @@ u32 vlv_nc_read(struct drm_i915_private *dev_priv, u8 addr)
132u32 vlv_gpio_nc_read(struct drm_i915_private *dev_priv, u32 reg) 132u32 vlv_gpio_nc_read(struct drm_i915_private *dev_priv, u32 reg)
133{ 133{
134 u32 val = 0; 134 u32 val = 0;
135 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPIO_NC, 135 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_GPIO_NC,
136 SB_CRRDDA_NP, reg, &val); 136 SB_CRRDDA_NP, reg, &val);
137 return val; 137 return val;
138} 138}
139 139
140void vlv_gpio_nc_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) 140void vlv_gpio_nc_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
141{ 141{
142 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPIO_NC, 142 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_GPIO_NC,
143 SB_CRWRDA_NP, reg, &val); 143 SB_CRWRDA_NP, reg, &val);
144} 144}
145 145
146u32 vlv_cck_read(struct drm_i915_private *dev_priv, u32 reg) 146u32 vlv_cck_read(struct drm_i915_private *dev_priv, u32 reg)
147{ 147{
148 u32 val = 0; 148 u32 val = 0;
149 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCK, 149 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_CCK,
150 SB_CRRDDA_NP, reg, &val); 150 SB_CRRDDA_NP, reg, &val);
151 return val; 151 return val;
152} 152}
153 153
154void vlv_cck_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) 154void vlv_cck_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
155{ 155{
156 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCK, 156 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_CCK,
157 SB_CRWRDA_NP, reg, &val); 157 SB_CRWRDA_NP, reg, &val);
158} 158}
159 159
160u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg) 160u32 vlv_ccu_read(struct drm_i915_private *dev_priv, u32 reg)
161{ 161{
162 u32 val = 0; 162 u32 val = 0;
163 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCU, 163 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_CCU,
164 SB_CRRDDA_NP, reg, &val); 164 SB_CRRDDA_NP, reg, &val);
165 return val; 165 return val;
166} 166}
167 167
168void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) 168void vlv_ccu_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
169{ 169{
170 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_CCU, 170 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_CCU,
171 SB_CRWRDA_NP, reg, &val); 171 SB_CRWRDA_NP, reg, &val);
172} 172}
173 173
174u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg) 174u32 vlv_gps_core_read(struct drm_i915_private *dev_priv, u32 reg)
175{ 175{
176 u32 val = 0; 176 u32 val = 0;
177 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPS_CORE, 177 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_GPS_CORE,
178 SB_CRRDDA_NP, reg, &val); 178 SB_CRRDDA_NP, reg, &val);
179 return val; 179 return val;
180} 180}
181 181
182void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val) 182void vlv_gps_core_write(struct drm_i915_private *dev_priv, u32 reg, u32 val)
183{ 183{
184 vlv_sideband_rw(dev_priv, PCI_DEVFN(2, 0), IOSF_PORT_GPS_CORE, 184 vlv_sideband_rw(dev_priv, PCI_DEVFN(0, 0), IOSF_PORT_GPS_CORE,
185 SB_CRWRDA_NP, reg, &val); 185 SB_CRWRDA_NP, reg, &val);
186} 186}
187 187