Lines Matching +full:lpddr2 +full:- +full:s4
1 // SPDX-License-Identifier: GPL-2.0+
19 #include <asm/ti-common/ti-edma3.h>
21 static int emif1_enabled = -1, emif2_enabled = -1;
28 reg = readl(&emif->emif_pwr_mgmt_ctrl); in set_lpmode_selfrefresh()
32 writel(reg, &emif->emif_pwr_mgmt_ctrl); in set_lpmode_selfrefresh()
35 readl(&emif->emif_pwr_mgmt_ctrl); in set_lpmode_selfrefresh()
61 writel(mr_addr, &emif->emif_lpddr2_mode_reg_cfg); in get_mr()
63 mr = readl(&emif->emif_lpddr2_mode_reg_data_es2); in get_mr()
65 mr = readl(&emif->emif_lpddr2_mode_reg_data); in get_mr()
81 writel(mr_addr, &emif->emif_lpddr2_mode_reg_cfg); in set_mr()
82 writel(mr_val, &emif->emif_lpddr2_mode_reg_data); in set_mr()
90 iodft = readl(&emif->emif_iodft_tlgc); in emif_reset_phy()
92 writel(iodft, &emif->emif_iodft_tlgc); in emif_reset_phy()
104 set_mr(base, cs, LPDDR2_MR10, mr_regs->mr10); in do_lpddr2_init()
112 set_mr(base, cs, LPDDR2_MR1, mr_regs->mr1); in do_lpddr2_init()
113 set_mr(base, cs, LPDDR2_MR16, mr_regs->mr16); in do_lpddr2_init()
117 * Encoding of RL in MR2 is (RL - 2) in do_lpddr2_init()
120 set_mr(base, cs, mr_addr, mr_regs->mr2); in do_lpddr2_init()
122 if (mr_regs->mr3 > 0) in do_lpddr2_init()
123 set_mr(base, cs, LPDDR2_MR3, mr_regs->mr3); in do_lpddr2_init()
131 clrbits_le32(&emif->emif_lpddr2_nvm_config, EMIF_REG_CS1NVMEN_MASK); in lpddr2_init()
134 * Keep REG_INITREF_DIS = 1 to prevent re-initialization of SDRAM in lpddr2_init()
137 setbits_le32(&emif->emif_sdram_ref_ctrl, EMIF_REG_INITREF_DIS_MASK); in lpddr2_init()
141 * un-locked frequency & default RL in lpddr2_init()
143 writel(regs->sdram_config_init, &emif->emif_sdram_config); in lpddr2_init()
144 writel(regs->emif_ddr_phy_ctlr_1_init, &emif->emif_ddr_phy_ctrl_1); in lpddr2_init()
149 if (regs->sdram_config & EMIF_REG_EBANK_MASK) in lpddr2_init()
152 writel(regs->sdram_config, &emif->emif_sdram_config); in lpddr2_init()
153 writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1); in lpddr2_init()
156 clrbits_le32(&emif->emif_sdram_ref_ctrl, EMIF_REG_INITREF_DIS_MASK); in lpddr2_init()
169 writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl_shdw); in emif_update_timings()
171 writel(regs->ref_ctrl_final, &emif->emif_sdram_ref_ctrl_shdw); in emif_update_timings()
173 writel(regs->sdram_tim1, &emif->emif_sdram_tim_1_shdw); in emif_update_timings()
174 writel(regs->sdram_tim2, &emif->emif_sdram_tim_2_shdw); in emif_update_timings()
175 writel(regs->sdram_tim3, &emif->emif_sdram_tim_3_shdw); in emif_update_timings()
178 writel(0, &emif->emif_pwr_mgmt_ctrl); in emif_update_timings()
180 writel(EMIF_PWR_MGMT_CTRL, &emif->emif_pwr_mgmt_ctrl); in emif_update_timings()
181 writel(EMIF_PWR_MGMT_CTRL_SHDW, &emif->emif_pwr_mgmt_ctrl_shdw); in emif_update_timings()
183 writel(regs->read_idle_ctrl, &emif->emif_read_idlectrl_shdw); in emif_update_timings()
184 writel(regs->zq_config, &emif->emif_zq_config); in emif_update_timings()
185 writel(regs->temp_alert_config, &emif->emif_temp_alert_config); in emif_update_timings()
186 writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw); in emif_update_timings()
190 &emif->emif_l3_config); in emif_update_timings()
193 &emif->emif_l3_config); in emif_update_timings()
196 &emif->emif_l3_config); in emif_update_timings()
205 /* keep sdram in self-refresh */ in omap5_ddr3_leveling()
207 & EMIF_REG_LP_MODE_MASK), &emif->emif_pwr_mgmt_ctrl); in omap5_ddr3_leveling()
211 * Set invert_clkout (if activated)--DDR_PHYCTRL_1 in omap5_ddr3_leveling()
218 writel(regs->emif_ddr_phy_ctlr_1, in omap5_ddr3_leveling()
219 &emif->emif_ddr_phy_ctrl_1); in omap5_ddr3_leveling()
221 writel(regs->emif_ddr_phy_ctlr_1, in omap5_ddr3_leveling()
222 &emif->emif_ddr_phy_ctrl_1_shdw); in omap5_ddr3_leveling()
226 & EMIF_REG_LP_MODE_MASK), &emif->emif_pwr_mgmt_ctrl); in omap5_ddr3_leveling()
229 writel(DDR3_FULL_LVL, &emif->emif_rd_wr_lvl_ctl); in omap5_ddr3_leveling()
232 readl(&emif->emif_rd_wr_lvl_ctl); in omap5_ddr3_leveling()
239 * Launch 8 incremental WR_LVL- to compensate for in omap5_ddr3_leveling()
243 &emif->emif_rd_wr_lvl_ctl); in omap5_ddr3_leveling()
248 writel(DDR3_INC_LVL, &emif->emif_rd_wr_lvl_ctl); in omap5_ddr3_leveling()
258 emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[6]; in update_hwleveling_output()
259 phy = readl(&emif->emif_ddr_phy_ctrl_1); in update_hwleveling_output()
262 emif_ext_phy_ctrl_reg = (u32 *)&emif->emif_ddr_ext_phy_ctrl_7; in update_hwleveling_output()
271 emif_ext_phy_ctrl_reg = (u32 *)&emif->emif_ddr_ext_phy_ctrl_2; in update_hwleveling_output()
272 emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[11]; in update_hwleveling_output()
281 emif_ext_phy_ctrl_reg = (u32 *)&emif->emif_ddr_ext_phy_ctrl_12; in update_hwleveling_output()
282 emif_phy_status = (u32 *)&emif->emif_ddr_phy_status[16]; in update_hwleveling_output()
291 writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1); in update_hwleveling_output()
292 writel(regs->emif_ddr_phy_ctlr_1, &emif->emif_ddr_phy_ctrl_1_shdw); in update_hwleveling_output()
293 writel(0x0, &emif->emif_rd_wr_lvl_rmp_ctl); in update_hwleveling_output()
301 clrsetbits_le32(&emif->emif_ddr_ext_phy_ctrl_36, in dra7_ddr3_leveling()
305 clrsetbits_le32(&emif->emif_ddr_ext_phy_ctrl_36_shdw, in dra7_ddr3_leveling()
310 clrsetbits_le32(&emif->emif_sdram_ref_ctrl, EMIF_REG_INITREF_DIS_MASK, in dra7_ddr3_leveling()
314 writel(DDR3_FULL_LVL, &emif->emif_rd_wr_lvl_ctl); in dra7_ddr3_leveling()
319 if (readl(&emif->emif_status) & EMIF_REG_LEVELING_TO_MASK) { in dra7_ddr3_leveling()
325 clrbits_le32(&emif->emif_sdram_ref_ctrl, EMIF_REG_INITREF_DIS_MASK); in dra7_ddr3_leveling()
357 if (regs->emif_ecc_ctrl_reg & EMIF_ECC_CTRL_REG_ECC_EN_MASK) { in dra7_enable_ecc()
358 writel(regs->emif_ecc_address_range_1, in dra7_enable_ecc()
359 &emif->emif_ecc_address_range_1); in dra7_enable_ecc()
360 writel(regs->emif_ecc_address_range_2, in dra7_enable_ecc()
361 &emif->emif_ecc_address_range_2); in dra7_enable_ecc()
362 writel(regs->emif_ecc_ctrl_reg, &emif->emif_ecc_ctrl_reg); in dra7_enable_ecc()
365 rgn = ((regs->emif_ecc_address_range_1 & in dra7_enable_ecc()
368 size = (regs->emif_ecc_address_range_1 & in dra7_enable_ecc()
371 if (regs->emif_ecc_ctrl_reg & in dra7_enable_ecc()
376 rgn = ((regs->emif_ecc_address_range_2 & in dra7_enable_ecc()
379 size = (regs->emif_ecc_address_range_2 & in dra7_enable_ecc()
382 if (regs->emif_ecc_ctrl_reg & in dra7_enable_ecc()
388 writel(readl(&emif->emif_1b_ecc_err_cnt), in dra7_enable_ecc()
389 &emif->emif_1b_ecc_err_cnt); in dra7_enable_ecc()
390 writel(0xffffffff, &emif->emif_1b_ecc_err_dist_1); in dra7_enable_ecc()
391 writel(0x1, &emif->emif_2b_ecc_err_addr_log); in dra7_enable_ecc()
395 &emif->emif_irqstatus_sys); in dra7_enable_ecc()
406 writel(0x0, &emif->emif_pwr_mgmt_ctrl); in dra7_ddr3_init()
410 writel(regs->ref_ctrl | EMIF_REG_INITREF_DIS_MASK, in dra7_ddr3_init()
411 &emif->emif_sdram_ref_ctrl); in dra7_ddr3_init()
413 writel(regs->sdram_tim1, &emif->emif_sdram_tim_1); in dra7_ddr3_init()
414 writel(regs->sdram_tim2, &emif->emif_sdram_tim_2); in dra7_ddr3_init()
415 writel(regs->sdram_tim3, &emif->emif_sdram_tim_3); in dra7_ddr3_init()
417 writel(EMIF_L3_CONFIG_VAL_SYS_10_MPU_5_LL_0, &emif->emif_l3_config); in dra7_ddr3_init()
418 writel(regs->read_idle_ctrl, &emif->emif_read_idlectrl); in dra7_ddr3_init()
419 writel(regs->zq_config, &emif->emif_zq_config); in dra7_ddr3_init()
420 writel(regs->temp_alert_config, &emif->emif_temp_alert_config); in dra7_ddr3_init()
421 writel(regs->emif_rd_wr_lvl_rmp_ctl, &emif->emif_rd_wr_lvl_rmp_ctl); in dra7_ddr3_init()
422 writel(regs->emif_rd_wr_lvl_ctl, &emif->emif_rd_wr_lvl_ctl); in dra7_ddr3_init()
424 writel(regs->emif_ddr_phy_ctlr_1_init, &emif->emif_ddr_phy_ctrl_1); in dra7_ddr3_init()
425 writel(regs->emif_rd_wr_exec_thresh, &emif->emif_rd_wr_exec_thresh); in dra7_ddr3_init()
427 writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl); in dra7_ddr3_init()
429 writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config); in dra7_ddr3_init()
430 writel(regs->sdram_config_init, &emif->emif_sdram_config); in dra7_ddr3_init()
434 writel(regs->ref_ctrl_final, &emif->emif_sdram_ref_ctrl); in dra7_ddr3_init()
436 if (regs->emif_rd_wr_lvl_rmp_ctl & EMIF_REG_RDWRLVL_EN_MASK) { in dra7_ddr3_init()
442 (regs->emif_ecc_ctrl_reg & EMIF_ECC_CTRL_REG_ECC_EN_MASK)) { in dra7_ddr3_init()
443 writel(0, &emif->emif_ecc_address_range_1); in dra7_ddr3_init()
444 writel(0, &emif->emif_ecc_address_range_2); in dra7_ddr3_init()
447 &emif->emif_ecc_ctrl_reg); in dra7_ddr3_init()
454 writel(0, &emif->emif_ecc_ctrl_reg); in dra7_ddr3_init()
465 writel(regs->ref_ctrl, &emif->emif_sdram_ref_ctrl); in omap5_ddr3_init()
466 writel(regs->sdram_config_init, &emif->emif_sdram_config); in omap5_ddr3_init()
473 writel(regs->emif_ddr_phy_ctlr_1_init, &emif->emif_ddr_phy_ctrl_1); in omap5_ddr3_init()
476 writel(regs->sdram_tim1, &emif->emif_sdram_tim_1); in omap5_ddr3_init()
477 writel(regs->sdram_tim2, &emif->emif_sdram_tim_2); in omap5_ddr3_init()
478 writel(regs->sdram_tim3, &emif->emif_sdram_tim_3); in omap5_ddr3_init()
480 writel(regs->read_idle_ctrl, &emif->emif_read_idlectrl); in omap5_ddr3_init()
482 writel(regs->sdram_config2, &emif->emif_lpddr2_nvm_config); in omap5_ddr3_init()
483 writel(regs->sdram_config_init, &emif->emif_sdram_config); in omap5_ddr3_init()
486 writel(regs->emif_rd_wr_lvl_rmp_ctl, &emif->emif_rd_wr_lvl_rmp_ctl); in omap5_ddr3_init()
500 #define print_timing_reg(reg) debug(#reg" - 0x%08x\n", (reg))
503 * Organization and refresh requirements for LPDDR2 devices of different
504 * types and densities. Derived from JESD209-2 section 2.4
554 return ((ns * (*T_den)) + (*T_num) - 1) / (*T_num); in ns_2_cycles()
564 return ((ns * (*T_den)) + (*T_num) * 2 - 1) / ((*T_num) * 2); in ns_x2_2_cycles()
568 * Find addressing table index based on the device's type(S2 or S4) and
575 return -1; in addressing_table_index()
611 * Start with the maximum allowed frequency - that is always safe in get_timings_table()
616 * i. Above or equal to the DDR frequency - safe in get_timings_table()
617 * ii. The lowest that satisfies condition (i) - optimal in get_timings_table()
620 temp = device_timings[i]->max_freq; in get_timings_table()
645 config_reg |= (cs0_device->type + 4) << EMIF_REG_SDRAM_TYPE_SHIFT; in get_sdram_config_reg()
649 config_reg |= cs0_device->io_width << EMIF_REG_NARROW_MODE_SHIFT; in get_sdram_config_reg()
653 config_reg |= addressing->row_sz[cs0_device->io_width] << in get_sdram_config_reg()
656 config_reg |= addressing->num_banks << EMIF_REG_IBANK_SHIFT; in get_sdram_config_reg()
661 config_reg |= addressing->col_sz[cs0_device->io_width] << in get_sdram_config_reg()
676 val = addressing->t_REFI_us_x10 * freq_khz / 10000; in get_sdram_ref_ctrl()
687 val = max(min_tck->tWTR, ns_x2_2_cycles(timings->tWTRx2)) - 1; in get_sdram_tim_1_reg()
690 if (addressing->num_banks == BANKS8) in get_sdram_tim_1_reg()
691 val = (timings->tFAW * (*T_den) + 4 * (*T_num) - 1) / in get_sdram_tim_1_reg()
692 (4 * (*T_num)) - 1; in get_sdram_tim_1_reg()
694 val = max(min_tck->tRRD, ns_2_cycles(timings->tRRD)) - 1; in get_sdram_tim_1_reg()
698 val = ns_2_cycles(timings->tRASmin + timings->tRPab) - 1; in get_sdram_tim_1_reg()
701 val = max(min_tck->tRAS_MIN, ns_2_cycles(timings->tRASmin)) - 1; in get_sdram_tim_1_reg()
704 val = max(min_tck->tWR, ns_2_cycles(timings->tWR)) - 1; in get_sdram_tim_1_reg()
707 val = max(min_tck->tRCD, ns_2_cycles(timings->tRCD)) - 1; in get_sdram_tim_1_reg()
710 val = max(min_tck->tRP_AB, ns_2_cycles(timings->tRPab)) - 1; in get_sdram_tim_1_reg()
720 val = max(min_tck->tCKE, timings->tCKE) - 1; in get_sdram_tim_2_reg()
723 val = max(min_tck->tRTP, ns_x2_2_cycles(timings->tRTPx2)) - 1; in get_sdram_tim_2_reg()
730 val = ns_2_cycles(timings->tXSR) - 1; in get_sdram_tim_2_reg()
734 val = max(min_tck->tXP, ns_x2_2_cycles(timings->tXPx2)) - 1; in get_sdram_tim_2_reg()
745 val = min(timings->tRASmax * 10 / addressing->t_REFI_us_x10 - 1, 0xF); in get_sdram_tim_3_reg()
748 val = ns_2_cycles(timings->tRFCab) - 1; in get_sdram_tim_3_reg()
751 val = ns_x2_2_cycles(timings->tDQSCKMAXx2) - 1; in get_sdram_tim_3_reg()
754 val = ns_2_cycles(timings->tZQCS) - 1; in get_sdram_tim_3_reg()
757 val = max(min_tck->tCKESR, ns_2_cycles(timings->tCKESR)) - 1; in get_sdram_tim_3_reg()
771 addressing->t_REFI_us_x10; in get_zq_config_reg()
775 addressing->t_REFI_us_x10; in get_zq_config_reg()
778 zq |= (REG_ZQ_ZQCL_MULT - 1) << EMIF_REG_ZQ_ZQCL_MULT_SHIFT; in get_zq_config_reg()
780 zq |= (REG_ZQ_ZQINIT_MULT - 1) << EMIF_REG_ZQ_ZQINIT_MULT_SHIFT; in get_zq_config_reg()
807 TEMP_ALERT_POLL_INTERVAL_MS * 10000 / addressing->t_REFI_us_x10; in get_temp_alert_config()
829 val = ns_2_cycles(READ_IDLE_INTERVAL_DVFS) / 64 - 1; in get_read_idle_ctrl_reg()
831 /*Maximum value in normal conditions - suggested by hw team */ in get_read_idle_ctrl_reg()
876 temp = dev_details.cs0_device_details->density; in get_emif_mem_size()
881 temp = dev_details.cs1_device_details->density; in get_emif_mem_size()
893 * 0x0: 16-MiB section in get_dmm_section_size_map()
894 * 0x1: 32-MiB section in get_dmm_section_size_map()
895 * 0x2: 64-MiB section in get_dmm_section_size_map()
896 * 0x3: 128-MiB section in get_dmm_section_size_map()
897 * 0x4: 256-MiB section in get_dmm_section_size_map()
898 * 0x5: 512-MiB section in get_dmm_section_size_map()
899 * 0x6: 1-GiB section in get_dmm_section_size_map()
900 * 0x7: 2-GiB section in get_dmm_section_size_map()
915 emif_dev_details->cs0_device_details; in emif_calculate_regs()
917 emif_dev_details->cs1_device_details; in emif_calculate_regs()
919 emif_dev_details->cs0_device_timings; in emif_calculate_regs()
929 emif_assert(cs0_dev_details->type != LPDDR2_TYPE_NVM); in emif_calculate_regs()
935 (cs1_dev_details->type == LPDDR2_TYPE_NVM) || in emif_calculate_regs()
936 (cs0_dev_details->type == cs1_dev_details->type)); in emif_calculate_regs()
947 timings = get_timings_table(cs0_dev_timings->ac_timings, freq); in emif_calculate_regs()
949 min_tck = cs0_dev_timings->min_tck; in emif_calculate_regs()
951 temp = addressing_table_index(cs0_dev_details->type, in emif_calculate_regs()
952 cs0_dev_details->density, in emif_calculate_regs()
953 cs0_dev_details->io_width); in emif_calculate_regs()
961 regs->sdram_config_init = get_sdram_config_reg(cs0_dev_details, in emif_calculate_regs()
965 regs->sdram_config = get_sdram_config_reg(cs0_dev_details, in emif_calculate_regs()
969 regs->ref_ctrl = get_sdram_ref_ctrl(freq, addressing); in emif_calculate_regs()
971 regs->sdram_tim1 = get_sdram_tim_1_reg(timings, min_tck, addressing); in emif_calculate_regs()
973 regs->sdram_tim2 = get_sdram_tim_2_reg(timings, min_tck); in emif_calculate_regs()
975 regs->sdram_tim3 = get_sdram_tim_3_reg(timings, min_tck, addressing); in emif_calculate_regs()
977 regs->read_idle_ctrl = get_read_idle_ctrl_reg(LPDDR2_VOLTAGE_STABLE); in emif_calculate_regs()
979 regs->temp_alert_config = in emif_calculate_regs()
982 regs->zq_config = get_zq_config_reg(cs1_dev_details, addressing, in emif_calculate_regs()
985 regs->emif_ddr_phy_ctlr_1_init = in emif_calculate_regs()
988 regs->emif_ddr_phy_ctlr_1 = in emif_calculate_regs()
991 regs->freq = freq; in emif_calculate_regs()
993 print_timing_reg(regs->sdram_config_init); in emif_calculate_regs()
994 print_timing_reg(regs->sdram_config); in emif_calculate_regs()
995 print_timing_reg(regs->ref_ctrl); in emif_calculate_regs()
996 print_timing_reg(regs->sdram_tim1); in emif_calculate_regs()
997 print_timing_reg(regs->sdram_tim2); in emif_calculate_regs()
998 print_timing_reg(regs->sdram_tim3); in emif_calculate_regs()
999 print_timing_reg(regs->read_idle_ctrl); in emif_calculate_regs()
1000 print_timing_reg(regs->temp_alert_config); in emif_calculate_regs()
1001 print_timing_reg(regs->zq_config); in emif_calculate_regs()
1002 print_timing_reg(regs->emif_ddr_phy_ctlr_1); in emif_calculate_regs()
1003 print_timing_reg(regs->emif_ddr_phy_ctlr_1_init); in emif_calculate_regs()
1012 return "LPDDR2-S4"; in get_lpddr2_type()
1014 return "LPDDR2-S2"; in get_lpddr2_type()
1087 mfg_str = get_lpddr2_manufacturer(device->manufacturer); in display_sdram_details()
1088 type_str = get_lpddr2_type(device->type); in display_sdram_details()
1090 density = lpddr2_density_2_size_in_mbytes[device->density]; in display_sdram_details()
1119 /* DNV supported - But DNV is only supported for NVM */ in is_lpddr2_sdram_present()
1139 lpddr2_device->manufacturer = mr; in is_lpddr2_sdram_present()
1164 lpddr2_device->type = temp; in is_lpddr2_sdram_present()
1171 lpddr2_device->density = temp; in is_lpddr2_sdram_present()
1178 lpddr2_device->io_width = temp; in is_lpddr2_sdram_present()
1182 * have a device on this chip-select in is_lpddr2_sdram_present()
1201 writel(phy, &emif->emif_ddr_phy_ctrl_1); in emif_get_device_details()
1239 * - Discovered if CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION is set in do_sdram_init()
1240 * - Obtained from user otherwise in do_sdram_init()
1258 * - Default timings specified by JESD209-2 if in do_sdram_init()
1260 * - Obtained from user otherwise in do_sdram_init()
1276 if (emif_sdram_type(regs->sdram_config) == in do_sdram_init()
1285 if (warm_reset() && (emif_sdram_type(regs->sdram_config) == in do_sdram_init()
1310 writel(0x80000000, &emif->emif_pwr_mgmt_ctrl); in emif_post_init_config()
1346 emif1_size -= mapped_size; in dmm_init()
1347 emif2_size -= mapped_size; in dmm_init()
1349 section_cnt--; in dmm_init()
1354 * section- either EMIF1 or EMIF2 or none, but not both) in dmm_init()
1365 section_cnt--; in dmm_init()
1375 section_cnt--; in dmm_init()
1379 /* Only 1 section - either symmetric or single EMIF */ in dmm_init()
1384 /* 2 sections - 1 symmetric, 1 single EMIF */ in dmm_init()
1400 writel(0, &hw_lisa_map_regs->dmm_lisa_map_3); in dmm_init()
1401 writel(0, &hw_lisa_map_regs->dmm_lisa_map_2); in dmm_init()
1402 writel(0, &hw_lisa_map_regs->dmm_lisa_map_1); in dmm_init()
1403 writel(0, &hw_lisa_map_regs->dmm_lisa_map_0); in dmm_init()
1405 writel(lisa_map_regs->dmm_lisa_map_3, in dmm_init()
1406 &hw_lisa_map_regs->dmm_lisa_map_3); in dmm_init()
1407 writel(lisa_map_regs->dmm_lisa_map_2, in dmm_init()
1408 &hw_lisa_map_regs->dmm_lisa_map_2); in dmm_init()
1409 writel(lisa_map_regs->dmm_lisa_map_1, in dmm_init()
1410 &hw_lisa_map_regs->dmm_lisa_map_1); in dmm_init()
1411 writel(lisa_map_regs->dmm_lisa_map_0, in dmm_init()
1412 &hw_lisa_map_regs->dmm_lisa_map_0); in dmm_init()
1414 if (lisa_map_regs->is_ma_present) { in dmm_init()
1418 writel(lisa_map_regs->dmm_lisa_map_3, in dmm_init()
1419 &hw_lisa_map_regs->dmm_lisa_map_3); in dmm_init()
1420 writel(lisa_map_regs->dmm_lisa_map_2, in dmm_init()
1421 &hw_lisa_map_regs->dmm_lisa_map_2); in dmm_init()
1422 writel(lisa_map_regs->dmm_lisa_map_1, in dmm_init()
1423 &hw_lisa_map_regs->dmm_lisa_map_1); in dmm_init()
1424 writel(lisa_map_regs->dmm_lisa_map_0, in dmm_init()
1425 &hw_lisa_map_regs->dmm_lisa_map_0); in dmm_init()
1461 u32 *phy_status_base = &emif_base->emif_ddr_phy_status[0]; in do_bug0039_workaround()
1462 u32 *phy_ctrl_base = &emif_base->emif_ddr_ext_phy_ctrl_1; in do_bug0039_workaround()
1470 clkctrl = __raw_readl((*prcm)->cm_memif_clkstctrl); in do_bug0039_workaround()
1471 __raw_writel(0x0, (*prcm)->cm_memif_clkstctrl); in do_bug0039_workaround()
1476 bug_00339_regs[i].read_reg - 1); in do_bug0039_workaround()
1479 ((bug_00339_regs[i].write_reg - 1) << 1)); in do_bug0039_workaround()
1482 (bug_00339_regs[i].write_reg << 1) - 1); in do_bug0039_workaround()
1486 writel(0x0, &emif_base->emif_rd_wr_lvl_rmp_ctl); in do_bug0039_workaround()
1488 __raw_writel(clkctrl, (*prcm)->cm_memif_clkstctrl); in do_bug0039_workaround()
1501 * at boot (low power boot). So u-boot has to switch to OPP100 and update
1503 * Doing (1) and (2) makes sense - first time initialization
1504 * Doing (2) and not (1) makes sense - OPP change (when using CH)
1512 u32 sdram_type = emif_sdram_type(emif->emif_sdram_config); in sdram_init()
1524 bypass_dpll((*prcm)->cm_clkmode_dpll_core); in sdram_init()
1526 writel(CM_DLL_CTRL_NO_OVERRIDE, (*prcm)->cm_dll_ctrl); in sdram_init()