diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-02-16 15:59:32 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-02-23 08:37:56 +0900 |
commit | dd38374d2f1d89fb34d4c544f558537db1966a33 (patch) | |
tree | d0d90c7b4fcf280741fbda498e31d31b66835d22 /arch/arm/mach-uniphier/dram | |
parent | 784548efb2b76fdbfdb73f6a505a156f90bb1e55 (diff) | |
download | u-boot-imx-dd38374d2f1d89fb34d4c544f558537db1966a33.zip u-boot-imx-dd38374d2f1d89fb34d4c544f558537db1966a33.tar.gz u-boot-imx-dd38374d2f1d89fb34d4c544f558537db1966a33.tar.bz2 |
ARM: uniphier: remove dram_nr_ch from board parameters
This parameter is redundant because we can know the number of
channels by checking if dram_ch[2].size is zero.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
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 | 15 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-pxs2.c | 14 |
3 files changed, 18 insertions, 13 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..14c44e4 100644 --- a/arch/arm/mach-uniphier/dram/umc-ld20.c +++ b/arch/arm/mach-uniphier/dram/umc-ld20.c @@ -606,15 +606,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; |