Lines Matching defs:pup
68 int ddr3_check_window_limits(u32 pup, int high_limit, int low_limit, int is_tx,
297 u32 victim_dq, pup, tmp;
299 u32 max_pup; /* maximal pup index */
316 int pup_adll_limit_state[MAX_PUP_NUM]; /* hold state of each pup */
326 for (pup = 0; pup < max_pup; pup++) {
327 centralization_low_limit[pup] = ADLL_MIN;
328 centralization_high_limit[pup] = ADLL_MAX;
341 /* Prepare pup masks */
342 for (pup = 0; pup < max_pup; pup++)
343 pup_mask |= (1 << pup);
345 for (pup = 0; pup < max_pup; pup++) {
347 analog_pbs_sum[pup][dq][0] = adll_start_val;
348 analog_pbs_sum[pup][dq][1] = adll_end_val;
358 * 3 stages for each pup.
367 for (pup = 0; pup < max_pup; pup++)
368 pup_adll_limit_state[pup] = PUP_ADLL_LIMITS_STATE_FAIL;
377 for (pup = 0; pup < max_pup; pup++) {
379 analog_pbs[victim_dq][pup][dq][0] =
381 analog_pbs[victim_dq][pup][dq][1] =
383 per_bit_data[pup][dq] = 0;
391 for (pup = 0; pup < max_pup; pup++) {
392 if (IS_PUP_ACTIVE(unlock_pup, pup) == 1) {
395 [pup * (1 - ecc) + ecc * ECC_PUP]
397 ddr3_write_pup_reg(adll_addr, cs, pup +
406 /* '1' - means pup failed, '0' - means pup pass */
426 pup = 0;
432 /* Update pup state */
433 for (pup = 0; pup < max_pup; pup++) {
434 if (IS_PUP_ACTIVE(unlock_pup, pup) == 0) {
435 DEBUG_DQS_FULL_C("DDR3 - DQS Find Limits - Skipping pup ",
436 pup, 1);
441 * Still didn't find the window limit of the pup
443 if (IS_PUP_ACTIVE(new_unlock_pup, pup) == 1) {
445 if (pup_adll_limit_state[pup] ==
455 DEBUG_DQS_S(", Pup - ");
456 DEBUG_DQS_D(pup, 1);
463 if ((analog_pbs[victim_dq][pup][dq][0] != adll_start_val)
464 && (analog_pbs[victim_dq][pup]
468 [pup][dq]
479 if (centralization_high_limit[pup] >
484 centralization_low_limit[pup];
489 if (centralization_low_limit[pup] < (curr_adll + 1)) {
492 [pup];
509 (pup, high_limit,
521 [pup] =
524 [pup] =
530 /* Found end of window - lock the pup */
531 pup_adll_limit_state[pup] =
533 unlock_pup &= ~(1 << pup);
536 pup_adll_limit_state[pup] =
546 [pup][dq]
551 [pup][dq]
555 [pup][dq]
563 if (pup_adll_limit_state[pup] ==
570 DEBUG_DQS_S(", Pup - ");
571 DEBUG_DQS_D(pup, 1);
579 if (analog_pbs[victim_dq][pup][dq][0] == adll_start_val)
582 [pup][dq]
588 pup_adll_limit_state[pup] =
594 if (centralization_low_limit[pup] <= curr_adll)
596 [pup] =
600 if (centralization_high_limit[pup] >= curr_adll)
602 [pup] =
611 DEBUG_DQS_FULL_S("DDR3 - DQS Find Limits - found PUP limit\n");
634 for (pup = 0; pup < max_pup; pup++) {
635 if (IS_PUP_ACTIVE(unlock_pup, pup) == 1) {
636 if (pup_adll_limit_state[pup] ==
639 DEBUG_DQS_S("DDR3 - DQS Find Limits - Got FAIL for the complete range on pup - ");
640 DEBUG_DQS_D(pup, 1);
645 centralization_low_limit[pup]
648 * In case the pup is in mode
663 for (pup = 0; pup < max_pup; pup++) {
666 DEBUG_DQS_S(", PUP-");
667 DEBUG_DQS_D(pup, 1);
672 DEBUG_DQS_D(analog_pbs[victim_dq][pup][dq]
675 DEBUG_DQS_D(analog_pbs[victim_dq][pup][dq]
679 if (analog_pbs[victim_dq][pup][dq][0]
680 > analog_pbs_sum[pup][dq][0])
681 analog_pbs_sum[pup][dq][0] =
682 analog_pbs[victim_dq][pup]
684 if (analog_pbs[victim_dq][pup][dq][1]
685 < analog_pbs_sum[pup][dq][1])
686 analog_pbs_sum[pup][dq][1] =
687 analog_pbs[victim_dq][pup]
690 if (analog_pbs[victim_dq][pup][dq][0]
691 < analog_pbs_sum[pup][dq][0])
692 analog_pbs_sum[pup][dq][0] =
693 analog_pbs[victim_dq][pup]
695 if (analog_pbs[victim_dq][pup][dq][1]
696 > analog_pbs_sum[pup][dq][1])
697 analog_pbs_sum[pup][dq][1] =
698 analog_pbs[victim_dq][pup]
724 for (pup = 0; pup < max_pup; pup++) {
727 DEBUG_PER_DQ_D(pup, 1);
738 DQ_NUM * pup), 2);
747 DEBUG_PER_DQ_D(analog_pbs[victim_dq][pup][dq][1], 2); /* low value */
749 DEBUG_PER_DQ_D(analog_pbs[victim_dq][pup][dq][0], 2); /* high value */
751 DEBUG_PER_DQ_D(analog_pbs[victim_dq][pup][dq][0] - analog_pbs[victim_dq][pup][dq][1], 2); /* win-size */
754 DEBUG_PER_DQ_D(analog_pbs[victim_dq][pup][dq][0], 2); /* low value */
756 DEBUG_PER_DQ_D((analog_pbs[victim_dq][pup][dq][1] - 1), 2); /* high value */
758 DEBUG_PER_DQ_D(analog_pbs[victim_dq][pup][dq][1] - analog_pbs[victim_dq][pup][dq][0], 2); /* win-size */
772 for (pup = 0; pup < max_pup; pup++) {
773 DEBUG_DQS_S("PUP-");
774 DEBUG_DQS_D(pup, 1);
779 DEBUG_DQS_D(analog_pbs_sum[pup][dq][0], 2);
781 DEBUG_DQS_D(analog_pbs_sum[pup][dq][1], 2);
792 for (pup = 0; pup < max_pup; pup++) {
794 /* For ECC PUP */
798 DEBUG_DQS_D(pup, 1);
805 DEBUG_DQS_D(analog_pbs_sum[pup][dq][0], 2);
807 DEBUG_DQS_D(analog_pbs_sum[pup][dq][1], 2);
820 * Args: pup pup index
828 int ddr3_check_window_limits(u32 pup, int high_limit, int low_limit, int is_tx,
834 DEBUG_DQS_S("DDR3 - DQS Check Win Limits - Pup ");
835 DEBUG_DQS_D(pup, 1);
852 DEBUG_DQS_S("DDR3 - DQS Check Win Limits - Pup ");
853 DEBUG_DQS_D(pup, 1);
859 DEBUG_DQS_S("DDR3 - DQS Check Win Limits - Pup ");
860 DEBUG_DQS_D(pup, 1);
869 DEBUG_DQS_FULL_S("DDR3 - DQS Check Win Limits - Pup ");
870 DEBUG_DQS_FULL_D(pup, 1);
892 u32 pup;
897 for (pup = 0; pup < max_pup; pup++) {
904 if (((centralization_high_limit[pup] -
905 centralization_low_limit[pup]) < VALID_WIN_THRS)
906 && (centralization_low_limit[pup] == MIN_DELAY))
907 special_pattern_i_pup |= (1 << pup);
914 if (((centralization_high_limit[pup] -
915 centralization_low_limit[pup]) < VALID_WIN_THRS)
916 && (centralization_high_limit[pup] == MAX_DELAY))
917 special_pattern_ii_pup |= (1 << pup);
921 /* Run special pattern Low limit search - for relevant pup */
930 /* Run special pattern High limit search - for relevant pup */
956 u32 pup;
960 u32 pass_pup; /* bit array of compare pass pup */
971 for (pup = 0; pup < max_pup; pup++)
972 special_res[pup] = ADLL_MAX;
982 for (pup = 0; pup < max_pup; pup++) {
983 /* Set adll value per PUP. adll = high limit per pup */
984 if (IS_PUP_ACTIVE(unlock_pup, pup)) {
987 pup + (ecc * ECC_PUP), 0,
989 [pup]);
1020 DEBUG_DQS_S("DDR3 - DQS - Special I - Some Pup passed!\n");
1029 for (pup = 0; pup < max_pup; pup++) {
1030 if (IS_PUP_ACTIVE(pass_pup, pup) ==
1032 /* If pup passed and has first fail = 1 */
1034 /* (centralization_high_limit[pup] + adll_idx) = current adll !!! */
1038 [pup] + adll_idx));
1041 ("DDR3 - DQS - Special I - Pup - ",
1042 pup, 1);
1048 special_res[pup]) {
1049 special_res[pup] =
1052 [pup] =
1057 ("DDR3 - DQS - Special I - Pup - ",
1058 pup, 1);
1062 [pup], 2);
1069 * Did all PUP found missing window?
1070 * Check for each pup if adll (different for each pup)
1071 * reach maximum if reach max value - lock the pup
1076 for (pup = 0; pup < max_pup; pup++) {
1077 if (IS_PUP_ACTIVE(unlock_pup, pup) == 1) {
1079 if ((centralization_high_limit[pup] +
1081 /* reach maximum - lock the pup */
1082 DEBUG_DQS_C("DDR3 - DQS - Special I - reach maximum - lock pup ",
1083 pup, 1);
1084 unlock_pup &= ~(1 << pup);
1089 pup +
1093 [pup] +
1117 u32 pup;
1121 u32 pass_pup; /* bit array of compare pass pup */
1132 for (pup = 0; pup < max_pup; pup++)
1133 special_res[pup] = ADLL_MAX;
1142 for (pup = 0; pup < max_pup; pup++) {
1143 /* Set adll value per PUP. adll = 0 */
1144 if (IS_PUP_ACTIVE(unlock_pup, pup)) {
1147 pup + (ecc * ECC_PUP), 0,
1176 DEBUG_DQS_S("DDR3 - DQS - Special II - Some Pup passed!\n");
1186 for (pup = 0; pup < max_pup; pup++) {
1187 if (IS_PUP_ACTIVE(pass_pup, pup) ==
1189 /* If pup passed and has first fail = 1 */
1194 DEBUG_DQS_C("DDR3 - DQS - Special II - Pup - ",
1195 pup, 1);
1200 special_res[pup]) {
1201 special_res[pup] =
1204 [pup] =
1209 ("DDR3 - DQS - Special II - Pup - ",
1210 pup, 1);
1214 [pup], 2);
1221 * Did all PUP found missing window?
1222 * Check for each pup if adll (different for each pup)
1223 * reach maximum if reach max value - lock the pup
1228 for (pup = 0; pup < max_pup; pup++) {
1229 if (IS_PUP_ACTIVE(unlock_pup, pup) == 1) {
1232 /* Reach maximum - lock the pup */
1233 DEBUG_DQS_C("DDR3 - DQS - Special II - reach maximum - lock pup ",
1234 pup, 1);
1235 unlock_pup &= ~(1 << pup);
1240 pup +
1264 u32 pup, pup_num;
1283 for (pup = 0; pup < max_pup; pup++) {
1284 addl_val = (centralization_high_limit[pup] +
1285 centralization_low_limit[pup]) / 2;
1287 pup_num = pup * (1 - ecc) + ecc * ECC_PUP;
1291 DEBUG_DQS_RESULTS_D(centralization_low_limit[pup], 2);
1293 DEBUG_DQS_RESULTS_D(centralization_high_limit[pup], 2);
1295 DEBUG_DQS_RESULTS_D(centralization_high_limit[pup] -
1296 centralization_low_limit[pup], 2);
1303 DEBUG_DQS_RESULTS_S("DDR3 - DQS - Setting ADLL value for Pup to MIN (since it was lower than 0)\n");
1308 DEBUG_DQS_RESULTS_S("DDR3 - DQS - Setting ADLL value for Pup to MAX (since it was higher than 31)\n");