All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 11/22] exynos: Add proid_is_exynos542x() for common 542x
Date: Mon, 10 Dec 2018 10:37:40 -0700	[thread overview]
Message-ID: <20181210173751.177266-12-sjg@chromium.org> (raw)
In-Reply-To: <20181210173751.177266-1-sjg@chromium.org>

Add a convenience function for any Exynos 542x chip.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

Changes in v2: None

 arch/arm/mach-exynos/clock.c              | 10 +++++-----
 arch/arm/mach-exynos/clock_init_exynos5.c |  2 +-
 arch/arm/mach-exynos/common_setup.h       |  4 ++--
 arch/arm/mach-exynos/include/mach/cpu.h   |  4 +++-
 arch/arm/mach-exynos/include/mach/gpio.h  |  4 ++--
 arch/arm/mach-exynos/pinmux.c             |  2 +-
 arch/arm/mach-exynos/power.c              |  2 +-
 7 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/arch/arm/mach-exynos/clock.c b/arch/arm/mach-exynos/clock.c
index 6a3cd44b5d3..2425a728669 100644
--- a/arch/arm/mach-exynos/clock.c
+++ b/arch/arm/mach-exynos/clock.c
@@ -345,7 +345,7 @@ static struct clk_bit_info *get_clk_bit_info(int peripheral)
 	int i;
 	struct clk_bit_info *info;
 
-	if (proid_is_exynos5420() || proid_is_exynos5422())
+	if (proid_is_exynos542x())
 		info = exynos542x_bit_info;
 	else
 		info = exynos5_bit_info;
@@ -557,7 +557,7 @@ static unsigned long exynos542x_get_periph_rate(int peripheral)
 unsigned long clock_get_periph_rate(int peripheral)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return exynos542x_get_periph_rate(peripheral);
 		return exynos5_get_periph_rate(peripheral);
 	} else {
@@ -1575,7 +1575,7 @@ static unsigned long exynos4_get_i2c_clk(void)
 unsigned long get_pll_clk(int pllreg)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return exynos542x_get_pll_clk(pllreg);
 		return exynos5_get_pll_clk(pllreg);
 	} else if (cpu_is_exynos4()) {
@@ -1691,7 +1691,7 @@ void set_mmc_clk(int dev_index, unsigned int div)
 		div -= 1;
 
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			exynos5420_set_mmc_clk(dev_index, div);
 		else
 			exynos5_set_mmc_clk(dev_index, div);
@@ -1739,7 +1739,7 @@ void set_mipi_clk(void)
 int set_spi_clk(int periph_id, unsigned int rate)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return exynos5420_set_spi_clk(periph_id, rate);
 		return exynos5_set_spi_clk(periph_id, rate);
 	}
diff --git a/arch/arm/mach-exynos/clock_init_exynos5.c b/arch/arm/mach-exynos/clock_init_exynos5.c
index e63ef645239..1cb8d391e7c 100644
--- a/arch/arm/mach-exynos/clock_init_exynos5.c
+++ b/arch/arm/mach-exynos/clock_init_exynos5.c
@@ -968,7 +968,7 @@ static void exynos5420_system_clock_init(void)
 
 void system_clock_init(void)
 {
-	if (proid_is_exynos5420() || proid_is_exynos5422())
+	if (proid_is_exynos542x())
 		exynos5420_system_clock_init();
 	else
 		exynos5250_system_clock_init();
diff --git a/arch/arm/mach-exynos/common_setup.h b/arch/arm/mach-exynos/common_setup.h
index 2829fb269ed..4e3702b9285 100644
--- a/arch/arm/mach-exynos/common_setup.h
+++ b/arch/arm/mach-exynos/common_setup.h
@@ -78,7 +78,7 @@ static inline void configure_l2_ctlr(void)
 		CACHE_TAG_RAM_LATENCY_2_CYCLES |
 		CACHE_DATA_RAM_LATENCY_2_CYCLES;
 
-	if (proid_is_exynos5420() || proid_is_exynos5422()) {
+	if (proid_is_exynos542x()) {
 		val |= CACHE_ECC_AND_PARITY |
 			CACHE_TAG_RAM_LATENCY_3_CYCLES |
 			CACHE_DATA_RAM_LATENCY_3_CYCLES;
@@ -97,7 +97,7 @@ static inline void configure_l2_actlr(void)
 {
 	uint32_t val;
 
-	if (proid_is_exynos5420() || proid_is_exynos5422()) {
+	if (proid_is_exynos542x()) {
 		mrc_l2_aux_ctlr(val);
 		val |= CACHE_ENABLE_FORCE_L2_LOGIC |
 			CACHE_DISABLE_CLEAN_EVICT;
diff --git a/arch/arm/mach-exynos/include/mach/cpu.h b/arch/arm/mach-exynos/include/mach/cpu.h
index aeb3755fe6b..766edeeb298 100644
--- a/arch/arm/mach-exynos/include/mach/cpu.h
+++ b/arch/arm/mach-exynos/include/mach/cpu.h
@@ -268,6 +268,8 @@ IS_EXYNOS_TYPE(exynos5250, 0x5250)
 IS_EXYNOS_TYPE(exynos5420, 0x5420)
 IS_EXYNOS_TYPE(exynos5422, 0x5422)
 
+#define proid_is_exynos542x() (proid_is_exynos5420() || proid_is_exynos5422())
+
 #define SAMSUNG_BASE(device, base)				\
 static inline unsigned long __attribute__((no_instrument_function)) \
 	samsung_get_base_##device(void) \
@@ -277,7 +279,7 @@ static inline unsigned long __attribute__((no_instrument_function)) \
 			return EXYNOS4X12_##base;		\
 		return EXYNOS4_##base;				\
 	} else if (cpu_is_exynos5()) {				\
-		if (proid_is_exynos5420() || proid_is_exynos5422())	\
+		if (proid_is_exynos542x())			\
 			return EXYNOS5420_##base;		\
 		return EXYNOS5_##base;				\
 	}							\
diff --git a/arch/arm/mach-exynos/include/mach/gpio.h b/arch/arm/mach-exynos/include/mach/gpio.h
index 272e00bae8f..f9975d7919f 100644
--- a/arch/arm/mach-exynos/include/mach/gpio.h
+++ b/arch/arm/mach-exynos/include/mach/gpio.h
@@ -1397,7 +1397,7 @@ static struct gpio_info exynos5420_gpio_data[EXYNOS5420_GPIO_NUM_PARTS] = {
 static inline struct gpio_info *get_gpio_data(void)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return exynos5420_gpio_data;
 		else
 			return exynos5_gpio_data;
@@ -1414,7 +1414,7 @@ static inline struct gpio_info *get_gpio_data(void)
 static inline unsigned int get_bank_num(void)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return EXYNOS5420_GPIO_NUM_PARTS;
 		else
 			return EXYNOS5_GPIO_NUM_PARTS;
diff --git a/arch/arm/mach-exynos/pinmux.c b/arch/arm/mach-exynos/pinmux.c
index f6743ca0f6e..5072f4f5691 100644
--- a/arch/arm/mach-exynos/pinmux.c
+++ b/arch/arm/mach-exynos/pinmux.c
@@ -863,7 +863,7 @@ static int exynos4x12_pinmux_config(int peripheral, int flags)
 int exynos_pinmux_config(int peripheral, int flags)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			return exynos5420_pinmux_config(peripheral, flags);
 		else if (proid_is_exynos5250())
 			return exynos5_pinmux_config(peripheral, flags);
diff --git a/arch/arm/mach-exynos/power.c b/arch/arm/mach-exynos/power.c
index 63c410aceff..f2a6c00dd62 100644
--- a/arch/arm/mach-exynos/power.c
+++ b/arch/arm/mach-exynos/power.c
@@ -124,7 +124,7 @@ static void exynos5420_set_usbdev_phy_ctrl(unsigned int enable)
 void set_usbdrd_phy_ctrl(unsigned int enable)
 {
 	if (cpu_is_exynos5()) {
-		if (proid_is_exynos5420() || proid_is_exynos5422())
+		if (proid_is_exynos542x())
 			exynos5420_set_usbdev_phy_ctrl(enable);
 		else
 			exynos5_set_usbdrd_phy_ctrl(enable);
-- 
2.20.0.rc2.403.gdbc3b29805-goog

  parent reply	other threads:[~2018-12-10 17:37 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-10 17:37 [U-Boot] [PATCH v2 00/22] dm: sound: Convert to driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 01/22] dm: sound: exynos: Correct codec bus addresses Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 02/22] dm: sound: Create an option to use driver model for sound Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 03/22] dm: sound: Rename samsung_i2s_priv to i2s_uc_priv Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 04/22] dm: sound: Create a uclass for audio codecs Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 05/22] dm: sound: Create a uclass for i2s Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 06/22] dm: sandbox: Update sound to use two buffers Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 07/22] dm: sound: Create a uclass for sound Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 08/22] dm: core: Add a function to read into a unsigned int Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 09/22] dm: sound: Start i2c IDs from 0 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 10/22] dm: sound: Add conversion to driver model Simon Glass
2018-12-10 17:37 ` Simon Glass [this message]
2018-12-10 17:37 ` [U-Boot] [PATCH v2 12/22] exynos: Add support for exynos5420 i2s pinmux Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 13/22] dm: sound: Move common code out of maxim98095 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 14/22] dm: sound: exynos: Add support for max98090 Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 15/22] dm: exynos: sound: Convert to use driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 16/22] dm: sandbox: " Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 17/22] dm: exynos: Drop CONFIG_DM_I2C_COMPAT Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 18/22] dm: sound: Complete migration to driver model Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 19/22] dm: sound: Fix license headers Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 20/22] dm: sound: max98095: Tidy up error codes Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 21/22] dm: sandbox: Allow selection of sample rate and channels Simon Glass
2018-12-10 17:37 ` [U-Boot] [PATCH v2 22/22] dm: sound: Use the correct number of channels for sound Simon Glass
2018-12-14 15:35 ` sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 21/22] dm: sandbox: Allow selection of sample rate and channels sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 20/22] dm: sound: max98095: Tidy up error codes sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 19/22] dm: sound: Fix license headers sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 18/22] dm: sound: Complete migration to driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 17/22] dm: exynos: Drop CONFIG_DM_I2C_COMPAT sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 16/22] dm: sandbox: sound: Convert to use driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 15/22] dm: exynos: " sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 14/22] dm: sound: exynos: Add support for max98090 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 13/22] dm: sound: Move common code out of maxim98095 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 12/22] exynos: Add support for exynos5420 i2s pinmux sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 11/22] exynos: Add proid_is_exynos542x() for common 542x sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 10/22] dm: sound: Add conversion to driver model sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 09/22] dm: sound: Start i2c IDs from 0 sjg at google.com
2018-12-14 15:35 ` [U-Boot] [PATCH v2 08/22] dm: core: Add a function to read into a unsigned int sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 07/22] dm: sound: Create a uclass for sound sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 06/22] dm: sandbox: Update sound to use two buffers sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 05/22] dm: sound: Create a uclass for i2s sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 04/22] dm: sound: Create a uclass for audio codecs sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 03/22] dm: sound: Rename samsung_i2s_priv to i2s_uc_priv sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 02/22] dm: sound: Create an option to use driver model for sound sjg at google.com
2018-12-14 15:38 ` [U-Boot] [PATCH v2 01/22] dm: sound: exynos: Correct codec bus addresses sjg at google.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181210173751.177266-12-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.