diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-07-22 13:38:32 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2016-07-24 00:24:55 +0900 |
commit | a74c28a0f2a6bfdc75d0547b804dc578844e49b1 (patch) | |
tree | 90ee1da58be08034df10960beabbee3d91156206 /arch/arm/mach-uniphier | |
parent | 4bab70a77d062582db89946b3e3a75f6e27a92ee (diff) |
ARM: uniphier: introduce flags to uniphier_board_data structure
I need to add more board attributes, so the "flags" member will be
handier than separate boolean ones.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'arch/arm/mach-uniphier')
-rw-r--r-- | arch/arm/mach-uniphier/boards.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-ld4.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-pro4.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/dram/umc-sld8.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-uniphier/init.h | 6 |
5 files changed, 20 insertions, 11 deletions
diff --git a/arch/arm/mach-uniphier/boards.c b/arch/arm/mach-uniphier/boards.c index ed308f3ecba..47e303ec3ae 100644 --- a/arch/arm/mach-uniphier/boards.c +++ b/arch/arm/mach-uniphier/boards.c @@ -1,5 +1,6 @@ /* - * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -38,7 +39,6 @@ static const struct uniphier_board_data uniphier_sld3_data = { static const struct uniphier_board_data uniphier_ld4_data = { .dram_freq = 1600, .dram_nr_ch = 2, - .dram_ddr3plus = true, .dram_ch[0] = { .base = 0x80000000, .size = 0x10000000, @@ -49,6 +49,7 @@ static const struct uniphier_board_data uniphier_ld4_data = { .size = 0x10000000, .width = 16, }, + .flags = UNIPHIER_BD_DDR3PLUS, }; #endif @@ -90,7 +91,6 @@ static const struct uniphier_board_data uniphier_pro4_2g_data = { static const struct uniphier_board_data uniphier_sld8_data = { .dram_freq = 1333, .dram_nr_ch = 2, - .dram_ddr3plus = true, .dram_ch[0] = { .base = 0x80000000, .size = 0x10000000, @@ -101,6 +101,7 @@ static const struct uniphier_board_data uniphier_sld8_data = { .size = 0x10000000, .width = 16, }, + .flags = UNIPHIER_BD_DDR3PLUS, }; #endif diff --git a/arch/arm/mach-uniphier/dram/umc-ld4.c b/arch/arm/mach-uniphier/dram/umc-ld4.c index fc75864a105..1ea6193f88f 100644 --- a/arch/arm/mach-uniphier/dram/umc-ld4.c +++ b/arch/arm/mach-uniphier/dram/umc-ld4.c @@ -1,5 +1,7 @@ /* - * Copyright (C) 2011-2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2011-2014 Panasonic Corporation + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -175,7 +177,7 @@ int uniphier_ld4_umc_init(const struct uniphier_board_data *bd) for (ch = 0; ch < DRAM_CH_NR; ch++) { ret = umc_ch_init(dc_base, ca_base, bd->dram_freq, bd->dram_ch[ch].size, - bd->dram_ddr3plus, ch); + !!(bd->flags & UNIPHIER_BD_DDR3PLUS), ch); if (ret) { pr_err("failed to initialize UMC ch%d\n", ch); return ret; diff --git a/arch/arm/mach-uniphier/dram/umc-pro4.c b/arch/arm/mach-uniphier/dram/umc-pro4.c index 853f561cb23..f6c2d7f145f 100644 --- a/arch/arm/mach-uniphier/dram/umc-pro4.c +++ b/arch/arm/mach-uniphier/dram/umc-pro4.c @@ -1,5 +1,7 @@ /* - * Copyright (C) 2011-2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2011-2014 Panasonic Corporation + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -170,7 +172,7 @@ int uniphier_pro4_umc_init(const struct uniphier_board_data *bd) ret = umc_ch_init(dc_base, ca_base, bd->dram_freq, bd->dram_ch[ch].size, bd->dram_ch[ch].width, - bd->dram_ddr3plus); + !!(bd->flags & UNIPHIER_BD_DDR3PLUS)); if (ret) { pr_err("failed to initialize UMC ch%d\n", ch); return ret; diff --git a/arch/arm/mach-uniphier/dram/umc-sld8.c b/arch/arm/mach-uniphier/dram/umc-sld8.c index e8317665836..61b1dc1a3a2 100644 --- a/arch/arm/mach-uniphier/dram/umc-sld8.c +++ b/arch/arm/mach-uniphier/dram/umc-sld8.c @@ -1,5 +1,7 @@ /* - * Copyright (C) 2011-2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2011-2014 Panasonic Corporation + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -178,7 +180,7 @@ int uniphier_sld8_umc_init(const struct uniphier_board_data *bd) for (ch = 0; ch < DRAM_CH_NR; ch++) { ret = umc_ch_init(dc_base, ca_base, bd->dram_freq, bd->dram_ch[ch].size, - bd->dram_ddr3plus, ch); + !!(bd->flags & UNIPHIER_BD_DDR3PLUS), ch); if (ret) { pr_err("failed to initialize UMC ch%d\n", ch); return ret; diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h index cba0bc9d374..31da605bb45 100644 --- a/arch/arm/mach-uniphier/init.h +++ b/arch/arm/mach-uniphier/init.h @@ -1,5 +1,6 @@ /* - * Copyright (C) 2015 Masahiro Yamada <yamada.masahiro@socionext.com> + * Copyright (C) 2015-2016 Socionext Inc. + * Author: Masahiro Yamada <yamada.masahiro@socionext.com> * * SPDX-License-Identifier: GPL-2.0+ */ @@ -20,8 +21,9 @@ struct uniphier_dram_ch { struct uniphier_board_data { unsigned int dram_freq; unsigned int dram_nr_ch; - bool dram_ddr3plus; struct uniphier_dram_ch dram_ch[UNIPHIER_MAX_NR_DRAM_CH]; + unsigned int flags; +#define UNIPHIER_BD_DDR3PLUS BIT(2) }; const struct uniphier_board_data *uniphier_get_board_param(void); |