Lines Matching refs:para
561 static unsigned long dramc_init_helper(struct dram_para *para) in dramc_init_helper() argument
572 if (para->type != DRAM_MEMORY_TYPE_DDR3 || para->rank_num != 1) in dramc_init_helper()
576 mctl_setup_dram_clock(para->clock, para->mbus_clock); in dramc_init_helper()
592 mctl_enable_dll0(para->tpr3); in dramc_init_helper()
596 reg_val |= DRAM_DCR_IO_WIDTH(para->io_width >> 3); in dramc_init_helper()
598 if (para->density == 256) in dramc_init_helper()
600 else if (para->density == 512) in dramc_init_helper()
602 else if (para->density == 1024) in dramc_init_helper()
604 else if (para->density == 2048) in dramc_init_helper()
606 else if (para->density == 4096) in dramc_init_helper()
608 else if (para->density == 8192) in dramc_init_helper()
614 reg_val |= DRAM_DCR_BUS_WIDTH((para->bus_width >> 3) - 1); in dramc_init_helper()
615 reg_val |= DRAM_DCR_RANK_SEL(para->rank_num - 1); in dramc_init_helper()
622 mctl_set_impedance(para->zq, para->odt_en); in dramc_init_helper()
632 mctl_enable_dllx(para->tpr3); in dramc_init_helper()
635 dramc_set_autorefresh_cycle(para->clock, density); in dramc_init_helper()
638 writel(para->tpr0, &dram->tpr0); in dramc_init_helper()
639 writel(para->tpr1, &dram->tpr1); in dramc_init_helper()
640 writel(para->tpr2, &dram->tpr2); in dramc_init_helper()
646 reg_val |= DRAM_MR_CAS_LAT(para->cas - 4); in dramc_init_helper()
647 reg_val |= DRAM_MR_WRITE_RECOVERY(ddr3_write_recovery(para->clock)); in dramc_init_helper()
650 writel(para->emr1, &dram->emr); in dramc_init_helper()
651 writel(para->emr2, &dram->emr2); in dramc_init_helper()
652 writel(para->emr3, &dram->emr3); in dramc_init_helper()
659 if (para->tpr4 & 0x1) in dramc_init_helper()
675 if (para->dqs_gating_delay) in dramc_init_helper()
676 mctl_set_dqs_gating_delay(0, para->dqs_gating_delay); in dramc_init_helper()
679 if (para->active_windowing) in dramc_init_helper()
692 unsigned long dramc_init(struct dram_para *para) in dramc_init() argument
697 if (!para) in dramc_init()
701 if (para->io_width && para->bus_width && para->density) in dramc_init()
702 return dramc_init_helper(para); in dramc_init()
705 para->io_width = 16; in dramc_init()
706 para->bus_width = 32; in dramc_init()
709 para->density = 4096; in dramc_init()
712 para->density = 8192; in dramc_init()
715 dram_size = dramc_init_helper(para); in dramc_init()
718 para->bus_width = 16; in dramc_init()
719 dram_size = dramc_init_helper(para); in dramc_init()
727 actual_density = (dram_size >> 17) * para->io_width / para->bus_width; in dramc_init()
729 if (actual_density != para->density) { in dramc_init()
731 para->density = actual_density; in dramc_init()
732 dram_size = dramc_init_helper(para); in dramc_init()