exynos: Add proid_is_exynos542x() for common 542x
authorSimon Glass <sjg@chromium.org>
Mon, 10 Dec 2018 17:37:40 +0000 (10:37 -0700)
committerSimon Glass <sjg@chromium.org>
Thu, 13 Dec 2018 23:36:30 +0000 (16:36 -0700)
Add a convenience function for any Exynos 542x chip.

Signed-off-by: Simon Glass <sjg@chromium.org>
arch/arm/mach-exynos/clock.c
arch/arm/mach-exynos/clock_init_exynos5.c
arch/arm/mach-exynos/common_setup.h
arch/arm/mach-exynos/include/mach/cpu.h
arch/arm/mach-exynos/include/mach/gpio.h
arch/arm/mach-exynos/pinmux.c
arch/arm/mach-exynos/power.c

index 6a3cd44b5d3ea89e53bd9d72be85b3cf1080999d..2425a7286696fd340c378db9fc7888b92aa8dcda 100644 (file)
@@ -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);
        }
index e63ef645239bc5ffd2631b65044eee4d171d2340..1cb8d391e7c92f9adb160784cc90a03c178b6b83 100644 (file)
@@ -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();
index 2829fb269edae48d1fa1891d629059c88fb16db4..4e3702b928599773ca1f67420f7280c98ac103bb 100644 (file)
@@ -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;
index aeb3755fe6b4e2b6a29e9e4a00129b4f9692e401..766edeeb298b3a5bf01fa2225739899da0a94bef 100644 (file)
@@ -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;                          \
        }                                                       \
index 272e00bae8f368dff07852e3b480273e6518a601..f9975d7919f2ddc564ea7d5c9d12dc77eaf85096 100644 (file)
@@ -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;
index f6743ca0f6ed4ab0c249656aa870fa6162fbce08..5072f4f56917fa925bb9880bced882d3d32bcc06 100644 (file)
@@ -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);
index 63c410aceff2d9164036581e6a3b2778aa8b384e..f2a6c00dd629cfdd48146abdee06eb1cea6f572d 100644 (file)
@@ -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);