Pali Rohár | 6763ff8 | 2024-06-06 18:33:26 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
| 2 | // (C) 2022 Pali Rohár <pali@kernel.org> |
| 3 | |
| 4 | #include <config.h> |
| 5 | #include <linux/types.h> |
| 6 | #include <fsl_ddr_sdram.h> |
| 7 | #include <fsl_ddr_dimm_params.h> |
| 8 | |
| 9 | void fsl_ddr_board_options(memctl_options_t *popts, dimm_params_t *pdimm, unsigned int ctrl_num) |
| 10 | { |
| 11 | int i; |
| 12 | |
| 13 | popts->clk_adjust = 6; |
| 14 | popts->cpo_override = 0x1f; |
| 15 | popts->write_data_delay = 2; |
| 16 | popts->half_strength_driver_enable = 1; |
| 17 | popts->wrlvl_en = 1; |
| 18 | popts->wrlvl_override = 1; |
| 19 | popts->wrlvl_sample = 0xf; |
| 20 | popts->wrlvl_start = 0x8; |
| 21 | popts->trwt_override = 1; |
| 22 | popts->trwt = 0; |
| 23 | |
| 24 | for (i = 0; i < CONFIG_CHIP_SELECTS_PER_CTRL; i++) { |
| 25 | popts->cs_local_opts[i].odt_rd_cfg = FSL_DDR_ODT_NEVER; |
| 26 | popts->cs_local_opts[i].odt_wr_cfg = FSL_DDR_ODT_CS; |
| 27 | } |
| 28 | } |