Commit de1a3f5
phy: cadence: cdns-dphy: Fix PLL lock and O_CMN_READY polling
[ Upstream commit 284fb19a3ffb1083c3ad9c00d29749d09dddb99c ]
PLL lockup and O_CMN_READY assertion can only happen after common state
machine gets enabled by programming DPHY_CMN_SSM register, but driver was
polling them before the common state machine was enabled which is
incorrect. This is as per the DPHY initialization sequence as mentioned in
J721E TRM [1] at section "12.7.2.4.1.2.1 Start-up Sequence Timing Diagram".
It shows O_CMN_READY polling at the end after common configuration pin
setup where the common configuration pin setup step enables state machine
as referenced in "Table 12-1533. Common Configuration-Related Setup
mentions state machine"
To fix this :
- Add new function callbacks for polling on PLL lock and O_CMN_READY
assertion.
- As state machine and clocks get enabled in power_on callback only, move
the clock related programming part from configure callback to power_on
callback and poll for the PLL lockup and O_CMN_READY assertion after state
machine gets enabled.
- The configure callback only saves the PLL configuration received from the
client driver which will be applied later on in power_on callback.
- Add checks to ensure configure is called before power_on and state
machine is in disabled state before power_on callback is called.
- Disable state machine in power_off so that client driver can re-configure
the PLL by following up a power_off, configure, power_on sequence.
[1]: https://www.ti.com/lit/zip/spruil1
Cc: [email protected]
Fixes: 7a343c8 ("phy: Add Cadence D-PHY support")
Signed-off-by: Devarsh Thakkar <[email protected]>
Tested-by: Harikrishna Shenoy <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent b0d5e35 commit de1a3f5
1 file changed
Lines changed: 92 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
| 115 | + | |
112 | 116 | | |
113 | 117 | | |
114 | 118 | | |
| |||
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
198 | 212 | | |
199 | 213 | | |
200 | 214 | | |
| |||
236 | 250 | | |
237 | 251 | | |
238 | 252 | | |
239 | | - | |
240 | 253 | | |
241 | 254 | | |
242 | 255 | | |
| |||
253 | 266 | | |
254 | 267 | | |
255 | 268 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | 269 | | |
264 | 270 | | |
265 | 271 | | |
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
269 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
270 | 293 | | |
271 | 294 | | |
272 | 295 | | |
| |||
282 | 305 | | |
283 | 306 | | |
284 | 307 | | |
| 308 | + | |
| 309 | + | |
285 | 310 | | |
286 | 311 | | |
287 | 312 | | |
| |||
339 | 364 | | |
340 | 365 | | |
341 | 366 | | |
342 | | - | |
343 | | - | |
344 | | - | |
| 367 | + | |
345 | 368 | | |
346 | | - | |
347 | | - | |
348 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
349 | 387 | | |
350 | 388 | | |
351 | 389 | | |
352 | 390 | | |
353 | 391 | | |
354 | 392 | | |
355 | | - | |
356 | | - | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
357 | 397 | | |
358 | 398 | | |
359 | 399 | | |
| |||
368 | 408 | | |
369 | 409 | | |
370 | 410 | | |
371 | | - | |
| 411 | + | |
372 | 412 | | |
373 | | - | |
374 | | - | |
375 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
376 | 418 | | |
377 | | - | |
378 | | - | |
| 419 | + | |
| 420 | + | |
379 | 421 | | |
380 | 422 | | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | 423 | | |
392 | 424 | | |
393 | 425 | | |
394 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
395 | 442 | | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
396 | 449 | | |
397 | 450 | | |
398 | 451 | | |
399 | 452 | | |
400 | 453 | | |
| 454 | + | |
401 | 455 | | |
402 | 456 | | |
403 | 457 | | |
404 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
405 | 465 | | |
406 | 466 | | |
407 | 467 | | |
| |||
0 commit comments