diff options
author | Tom Rini <trini@konsulko.com> | 2017-02-23 10:12:41 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2017-02-23 10:12:41 -0500 |
commit | d38de7cb03adf88e18c05d840c2528b7a5af2f9b (patch) | |
tree | 35be69932e53e4c58260af58ae841a3d1a2523b6 /arch/arm/mach-uniphier/dram | |
parent | b24cf8540a85a9bf97975aadd6a7542f166c78a3 (diff) | |
parent | bc647958047cd03193e19cd8c08a6771fea828b7 (diff) | |
download | u-boot-imx-d38de7cb03adf88e18c05d840c2528b7a5af2f9b.zip u-boot-imx-d38de7cb03adf88e18c05d840c2528b7a5af2f9b.tar.gz u-boot-imx-d38de7cb03adf88e18c05d840c2528b7a5af2f9b.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-uniphier
- Fix regressions caused by the previous reworks
- Add pin configuration support
- Re-work SPL code
- Update DRAM and PLL setup code
- Enable needed configs, disable unneeded configs
Diffstat (limited to 'arch/arm/mach-uniphier/dram')
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-ld11.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-ld20.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-pxs2.c | 14 |
3 files changed, 26 insertions, 15 deletions
diff --git a/arch/arm/mach-uniphier/dram/umc-ld11.c b/arch/arm/mach-uniphier/dram/umc-ld11.c index 97a9fef..69aa4f2 100644 --- a/arch/arm/mach-uniphier/dram/umc-ld11.c +++ b/arch/arm/mach-uniphier/dram/umc-ld11.c @@ -471,7 +471,7 @@ int uniphier_ld11_umc_init(const struct uniphier_board_data *bd) ddrphy_init(phy_base, freq); - for (ch = 0; ch < bd->dram_nr_ch; ch++) { + for (ch = 0; ch < DRAM_CH_NR; ch++) { unsigned long size = bd->dram_ch[ch].size; unsigned int width = bd->dram_ch[ch].width; diff --git a/arch/arm/mach-uniphier/dram/umc-ld20.c b/arch/arm/mach-uniphier/dram/umc-ld20.c index 157b915..500c1c1 100644 --- a/arch/arm/mach-uniphier/dram/umc-ld20.c +++ b/arch/arm/mach-uniphier/dram/umc-ld20.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2016-2017 Socionext Inc. * - * based on commit e732175d0b0dbc2a3855cb8ac791c538666b6fd4 of Diag + * based on commit 5ffd75ecd4929f22361ef65a35f0331d2fbc0f35 of Diag * * SPDX-License-Identifier: GPL-2.0+ */ @@ -177,12 +177,18 @@ static void ddrphy_select_lane(void __iomem *phy_base, unsigned int lane, phy_base + PHY_LANE_SEL); } +#define DDRPHY_EFUSEMON (void *)0x5f900118 + static void ddrphy_init(void __iomem *phy_base, enum dram_board board, int ch) { writel(0x0C001001, phy_base + PHY_UNIQUIFY_TSMC_IO_1); while (!(readl(phy_base + PHY_UNIQUIFY_TSMC_IO_1) & BIT(1))) cpu_relax(); - writel(0x0C001000, phy_base + PHY_UNIQUIFY_TSMC_IO_1); + + if (readl(DDRPHY_EFUSEMON) & BIT(ch)) + writel(0x00000000, phy_base + PHY_UNIQUIFY_TSMC_IO_1); + else + writel(0x0C001000, phy_base + PHY_UNIQUIFY_TSMC_IO_1); writel(0x00000000, phy_base + PHY_DLL_INCR_TRIM_3); writel(0x00000000, phy_base + PHY_DLL_INCR_TRIM_1); @@ -606,15 +612,18 @@ int uniphier_ld20_umc_init(const struct uniphier_board_data *bd) return -EINVAL; } - for (ch = 0; ch < bd->dram_nr_ch; ch++) { + for (ch = 0; ch < DRAM_CH_NR; ch++) { unsigned long size = bd->dram_ch[ch].size; unsigned int width = bd->dram_ch[ch].width; - ret = umc_ch_init(umc_ch_base, phy_ch_base, board, - bd->dram_freq, size / (width / 16), ch); - if (ret) { - pr_err("failed to initialize UMC ch%d\n", ch); - return ret; + if (size) { + ret = umc_ch_init(umc_ch_base, phy_ch_base, board, + bd->dram_freq, size / (width / 16), + ch); + if (ret) { + pr_err("failed to initialize UMC ch%d\n", ch); + return ret; + } } umc_ch_base += 0x00200000; diff --git a/arch/arm/mach-uniphier/dram/umc-pxs2.c b/arch/arm/mach-uniphier/dram/umc-pxs2.c index 05a62de..7fa29f1 100644 --- a/arch/arm/mach-uniphier/dram/umc-pxs2.c +++ b/arch/arm/mach-uniphier/dram/umc-pxs2.c @@ -619,15 +619,17 @@ int uniphier_pxs2_umc_init(const struct uniphier_board_data *bd) return -EINVAL; } - for (ch = 0; ch < bd->dram_nr_ch; ch++) { + for (ch = 0; ch < DRAM_CH_NR; ch++) { unsigned long size = bd->dram_ch[ch].size; unsigned int width = bd->dram_ch[ch].width; - ret = umc_ch_init(umc_ch_base, freq, size / (width / 16), - width, ch); - if (ret) { - pr_err("failed to initialize UMC ch%d\n", ch); - return ret; + if (size) { + ret = umc_ch_init(umc_ch_base, freq, + size / (width / 16), width, ch); + if (ret) { + pr_err("failed to initialize UMC ch%d\n", ch); + return ret; + } } umc_ch_base += 0x00200000; |