Commit b4e78faab3ce31543ca59a97f8d7d19d66ac608b

Authored by Nikhil Badola
Committed by York Sun
1 parent 0070459048

drivers:usb: Check if USB Erratum A005697 is applicable on BSC913x

Check if USB Erratum A005697 is applicable on BSC913x and
add corresponding  property in the device tree via device
tree fixup which is used by linux driver

Signed-off-by: Nikhil Badola <nikhil.badola@freescale.com>
Reviewed-by: York Sun <yorksun@freescale.com>

Showing 2 changed files with 27 additions and 0 deletions Side-by-side Diff

drivers/usb/host/ehci-fsl.c
... ... @@ -263,6 +263,7 @@
263 263 int usb_erratum_a006261_off = -1;
264 264 int usb_erratum_a007075_off = -1;
265 265 int usb_erratum_a007792_off = -1;
  266 + int usb_erratum_a005697_off = -1;
266 267 int usb_mode_off = -1;
267 268 int usb_phy_off = -1;
268 269 char str[5];
... ... @@ -344,6 +345,14 @@
344 345 "fsl,usb-erratum-a007792",
345 346 usb_erratum_a007792_off);
346 347 if (usb_erratum_a007792_off < 0)
  348 + return;
  349 + }
  350 + if (has_erratum_a005697()) {
  351 + usb_erratum_a005697_off = fdt_fixup_usb_erratum
  352 + (blob,
  353 + "fsl,usb-erratum-a005697",
  354 + usb_erratum_a005697_off);
  355 + if (usb_erratum_a005697_off < 0)
347 356 return;
348 357 }
349 358 }
... ... @@ -196,6 +196,19 @@
196 196 return false;
197 197 }
198 198  
  199 +static inline bool has_erratum_a005697(void)
  200 +{
  201 + u32 svr = get_svr();
  202 + u32 soc = SVR_SOC_VER(svr);
  203 +
  204 + switch (soc) {
  205 + case SVR_9131:
  206 + case SVR_9132:
  207 + return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 1, 1);
  208 + }
  209 + return false;
  210 +}
  211 +
199 212 #else
200 213 static inline bool has_dual_phy(void)
201 214 {
... ... @@ -218,6 +231,11 @@
218 231 }
219 232  
220 233 static inline bool has_erratum_a007792(void)
  234 +{
  235 + return false;
  236 +}
  237 +
  238 +static inline bool has_erratum_a005697(void)
221 239 {
222 240 return false;
223 241 }