@@ -450,17 +450,20 @@ static int sdhci_am654_calculate_itap(struct sdhci_host *host, struct window
450
450
{
451
451
u8 itap = 0 , start_fail = 0 , end_fail = 0 , pass_length = 0 ;
452
452
u8 first_fail_start = 0 , last_fail_end = 0 ;
453
+ struct device * dev = mmc_dev (host -> mmc );
453
454
struct window pass_window = {0 , 0 , 0 };
454
455
int prev_fail_end = -1 ;
455
456
u8 i ;
456
457
457
458
if (!num_fails ) {
458
459
/* Retry tuning */
460
+ dev_dbg (dev , "No failing region found, retry tuning\n" );
459
461
return -1 ;
460
462
}
461
463
462
464
if (fail_window -> length == ITAPDLY_LENGTH ) {
463
465
/* Retry tuning */
466
+ dev_dbg (dev , "No passing itapdly, retry tuning\n" );
464
467
return -1 ;
465
468
}
466
469
@@ -504,6 +507,7 @@ static int sdhci_am654_do_tuning(struct sdhci_host *host,
504
507
struct sdhci_am654_data * sdhci_am654 = sdhci_pltfm_priv (pltfm_host );
505
508
unsigned char timing = host -> mmc -> ios .timing ;
506
509
struct window fail_window [ITAPDLY_LENGTH ];
510
+ struct device * dev = mmc_dev (host -> mmc );
507
511
u8 curr_pass , itap ;
508
512
u8 fail_index = 0 ;
509
513
u8 prev_pass = 1 ;
@@ -524,6 +528,7 @@ static int sdhci_am654_do_tuning(struct sdhci_host *host,
524
528
if (!curr_pass ) {
525
529
fail_window [fail_index ].end = itap ;
526
530
fail_window [fail_index ].length ++ ;
531
+ dev_dbg (dev , "Failed itapdly=%d\n" , itap );
527
532
}
528
533
529
534
if (curr_pass && !prev_pass )
@@ -545,6 +550,7 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host,
545
550
struct sdhci_pltfm_host * pltfm_host = sdhci_priv (host );
546
551
struct sdhci_am654_data * sdhci_am654 = sdhci_pltfm_priv (pltfm_host );
547
552
unsigned char timing = host -> mmc -> ios .timing ;
553
+ struct device * dev = mmc_dev (host -> mmc );
548
554
int itapdly ;
549
555
550
556
do {
@@ -553,9 +559,12 @@ static int sdhci_am654_platform_execute_tuning(struct sdhci_host *host,
553
559
break ;
554
560
} while (++ sdhci_am654 -> tuning_loop < RETRY_TUNING_MAX );
555
561
556
- if (itapdly < 0 )
562
+ if (itapdly < 0 ) {
563
+ dev_err (dev , "Failed to find itapdly, fail tuning\n" );
557
564
return -1 ;
565
+ }
558
566
567
+ dev_dbg (dev , "Passed tuning, final itapdly=%d\n" , itapdly );
559
568
sdhci_am654_write_itapdly (sdhci_am654 , itapdly , sdhci_am654 -> itap_del_ena [timing ]);
560
569
/* Save ITAPDLY */
561
570
sdhci_am654 -> itap_del_sel [timing ] = itapdly ;
0 commit comments