* [U-Boot] [PATCH 0/3] keystone, clk: revert ugly work-around by #ifdef CONFIG_CLK
@ 2016-09-26 11:45 Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-09-26 11:45 UTC (permalink / raw)
To: u-boot
Commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37 chose
a very bad way to suppress the KeyStone boards failure.
The root cause was that KeyStone is using the same function name clk_get_rate
as the clk-uclass one, but the probotype is completely different.
So, if both <clk.h> and <config.h> are included from a single file
(drivers/serial/ns16550.c does so), it fails to build.
The function is only used for KeyStone specific files,
so we can rename it to avoid name space conflict.
Masahiro Yamada (3):
ARM: keystone: remove declaration of unused functions
ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
Revert "ns16650: Make sure we have CONFIG_CLK set before using
infrastructure"
arch/arm/include/asm/ti-common/keystone_net.h | 4 ++--
arch/arm/mach-keystone/clock.c | 24 ++++++++++++------------
arch/arm/mach-keystone/cmd_clock.c | 2 +-
arch/arm/mach-keystone/include/mach/clock.h | 4 +---
drivers/serial/ns16550.c | 7 ++-----
include/clk.h | 25 +++++++++++++------------
include/configs/ti_armv7_keystone2.h | 8 ++++----
7 files changed, 35 insertions(+), 39 deletions(-)
--
1.9.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions
2016-09-26 11:45 [U-Boot] [PATCH 0/3] keystone, clk: revert ugly work-around by #ifdef CONFIG_CLK Masahiro Yamada
@ 2016-09-26 11:45 ` Masahiro Yamada
2016-09-27 3:04 ` Lokesh Vutla
` (2 more replies)
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
2 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-09-26 11:45 UTC (permalink / raw)
To: u-boot
These two functions are neither defined nor referenced.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/mach-keystone/include/mach/clock.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/mach-keystone/include/mach/clock.h b/arch/arm/mach-keystone/include/mach/clock.h
index 72724aa..e2bdec1 100644
--- a/arch/arm/mach-keystone/include/mach/clock.h
+++ b/arch/arm/mach-keystone/include/mach/clock.h
@@ -126,8 +126,6 @@ void init_plls(void);
void init_pll(const struct pll_init_data *data);
struct pll_init_data *get_pll_init_data(int pll);
unsigned long clk_get_rate(unsigned int clk);
-unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
-int clk_set_rate(unsigned int clk, unsigned long hz);
int get_max_dev_speed(int *spds);
int get_max_arm_speed(int *spds);
void pll_pa_clk_sel(void);
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 [U-Boot] [PATCH 0/3] keystone, clk: revert ugly work-around by #ifdef CONFIG_CLK Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
@ 2016-09-26 11:45 ` Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
` (4 more replies)
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
2 siblings, 5 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-09-26 11:45 UTC (permalink / raw)
To: u-boot
The KeyStone platform has its own clk_get_rate() but its prototype
is different from that of the common-clk (clk-uclass) framework.
Prefix the KeyStone specific implementation with _ks in order to
avoid name-space conflict.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
arch/arm/include/asm/ti-common/keystone_net.h | 4 ++--
arch/arm/mach-keystone/clock.c | 24 ++++++++++++------------
arch/arm/mach-keystone/cmd_clock.c | 2 +-
arch/arm/mach-keystone/include/mach/clock.h | 2 +-
include/configs/ti_armv7_keystone2.h | 8 ++++----
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/arm/include/asm/ti-common/keystone_net.h b/arch/arm/include/asm/ti-common/keystone_net.h
index a0d0d9b..0627728 100644
--- a/arch/arm/include/asm/ti-common/keystone_net.h
+++ b/arch/arm/include/asm/ti-common/keystone_net.h
@@ -51,9 +51,9 @@
/* MDIO module input frequency */
#ifdef CONFIG_SOC_K2G
-#define EMAC_MDIO_BUS_FREQ (clk_get_rate(sys_clk0_3_clk))
+#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(sys_clk0_3_clk))
#else
-#define EMAC_MDIO_BUS_FREQ (clk_get_rate(pass_pll_clk))
+#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(pass_pll_clk))
#endif
/* MDIO clock output frequency */
#define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
diff --git a/arch/arm/mach-keystone/clock.c b/arch/arm/mach-keystone/clock.c
index b25db1e..d8804724 100644
--- a/arch/arm/mach-keystone/clock.c
+++ b/arch/arm/mach-keystone/clock.c
@@ -341,7 +341,7 @@ static unsigned long pll_freq_get(int pll)
return ret;
}
-unsigned long clk_get_rate(unsigned int clk)
+unsigned long ks_clk_get_rate(unsigned int clk)
{
unsigned long freq = 0;
@@ -381,37 +381,37 @@ unsigned long clk_get_rate(unsigned int clk)
freq = pll_freq_get(CORE_PLL) / pll0div_read(4);
break;
case sys_clk0_2_clk:
- freq = clk_get_rate(sys_clk0_clk) / 2;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 2;
break;
case sys_clk0_3_clk:
- freq = clk_get_rate(sys_clk0_clk) / 3;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 3;
break;
case sys_clk0_4_clk:
- freq = clk_get_rate(sys_clk0_clk) / 4;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 4;
break;
case sys_clk0_6_clk:
- freq = clk_get_rate(sys_clk0_clk) / 6;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 6;
break;
case sys_clk0_8_clk:
- freq = clk_get_rate(sys_clk0_clk) / 8;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 8;
break;
case sys_clk0_12_clk:
- freq = clk_get_rate(sys_clk0_clk) / 12;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 12;
break;
case sys_clk0_24_clk:
- freq = clk_get_rate(sys_clk0_clk) / 24;
+ freq = ks_clk_get_rate(sys_clk0_clk) / 24;
break;
case sys_clk1_3_clk:
- freq = clk_get_rate(sys_clk1_clk) / 3;
+ freq = ks_clk_get_rate(sys_clk1_clk) / 3;
break;
case sys_clk1_4_clk:
- freq = clk_get_rate(sys_clk1_clk) / 4;
+ freq = ks_clk_get_rate(sys_clk1_clk) / 4;
break;
case sys_clk1_6_clk:
- freq = clk_get_rate(sys_clk1_clk) / 6;
+ freq = ks_clk_get_rate(sys_clk1_clk) / 6;
break;
case sys_clk1_12_clk:
- freq = clk_get_rate(sys_clk1_clk) / 12;
+ freq = ks_clk_get_rate(sys_clk1_clk) / 12;
break;
default:
break;
diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
index 3d5cf3f..06afa72 100644
--- a/arch/arm/mach-keystone/cmd_clock.c
+++ b/arch/arm/mach-keystone/cmd_clock.c
@@ -74,7 +74,7 @@ int do_getclk_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
clk = simple_strtoul(argv[1], NULL, 10);
- freq = clk_get_rate(clk);
+ freq = ks_clk_get_rate(clk);
if (freq)
printf("clock index [%d] - frequency %lu\n", clk, freq);
else
diff --git a/arch/arm/mach-keystone/include/mach/clock.h b/arch/arm/mach-keystone/include/mach/clock.h
index e2bdec1..0d8a944 100644
--- a/arch/arm/mach-keystone/include/mach/clock.h
+++ b/arch/arm/mach-keystone/include/mach/clock.h
@@ -125,7 +125,7 @@ extern int speeds[];
void init_plls(void);
void init_pll(const struct pll_init_data *data);
struct pll_init_data *get_pll_init_data(int pll);
-unsigned long clk_get_rate(unsigned int clk);
+unsigned long ks_clk_get_rate(unsigned int clk);
int get_max_dev_speed(int *spds);
int get_max_arm_speed(int *spds);
void pll_pa_clk_sel(void);
diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
index d8f0847..d7bfacc 100644
--- a/include/configs/ti_armv7_keystone2.h
+++ b/include/configs/ti_armv7_keystone2.h
@@ -68,14 +68,14 @@
#define CONFIG_CONS_INDEX 1
#ifndef CONFIG_SOC_K2G
-#define CONFIG_SYS_NS16550_CLK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(KS2_CLK1_6)
#else
-#define CONFIG_SYS_NS16550_CLK clk_get_rate(uart_pll_clk) / 2
+#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(uart_pll_clk) / 2
#endif
/* SPI Configuration */
#define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_CLK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_SPI_CLK ks_clk_get_rate(KS2_CLK1_6)
#define CONFIG_SF_DEFAULT_SPEED 30000000
#define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
#define CONFIG_SYS_SPI0
@@ -314,7 +314,7 @@
#include <asm/arch/hardware.h>
#include <asm/arch/clock.h>
#ifndef CONFIG_SOC_K2G
-#define CONFIG_SYS_HZ_CLOCK clk_get_rate(KS2_CLK1_6)
+#define CONFIG_SYS_HZ_CLOCK ks_clk_get_rate(KS2_CLK1_6)
#else
#define CONFIG_SYS_HZ_CLOCK external_clk[sys_clk]
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"
2016-09-26 11:45 [U-Boot] [PATCH 0/3] keystone, clk: revert ugly work-around by #ifdef CONFIG_CLK Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
@ 2016-09-26 11:45 ` Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
` (2 more replies)
2 siblings, 3 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-09-26 11:45 UTC (permalink / raw)
To: u-boot
This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
The build failure of k2*evm boards was fixed in a different way by
the previous commit. It is nasty to patch generic drivers around
with #ifdef CONFIG_CLK just for the KeyStone's matter.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---
drivers/serial/ns16550.c | 7 ++-----
include/clk.h | 25 +++++++++++++------------
2 files changed, 15 insertions(+), 17 deletions(-)
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 765499d..3f6ea4d 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -13,7 +13,6 @@
#include <serial.h>
#include <watchdog.h>
#include <linux/types.h>
-#include <linux/compiler.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -354,8 +353,8 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
{
struct ns16550_platdata *plat = dev->platdata;
fdt_addr_t addr;
- __maybe_unused struct clk clk;
- __maybe_unused int err;
+ struct clk clk;
+ int err;
/* try Processor Local Bus device first */
addr = dev_get_addr(dev);
@@ -402,7 +401,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
plat->reg_shift = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
"reg-shift", 0);
-#ifdef CONFIG_CLK
err = clk_get_by_index(dev, 0, &clk);
if (!err) {
err = clk_get_rate(&clk);
@@ -412,7 +410,6 @@ int ns16550_serial_ofdata_to_platdata(struct udevice *dev)
debug("ns16550 failed to get clock\n");
return err;
}
-#endif
if (!plat->clock)
plat->clock = fdtdec_get_int(gd->fdt_blob, dev->of_offset,
diff --git a/include/clk.h b/include/clk.h
index fe1f892..5a5c2ff 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -98,6 +98,19 @@ int clk_get_by_index(struct udevice *dev, int index, struct clk *clk);
* @return 0 if OK, or a negative error code.
*/
int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk);
+#else
+static inline int clk_get_by_index(struct udevice *dev, int index,
+ struct clk *clk)
+{
+ return -ENOSYS;
+}
+
+static inline int clk_get_by_name(struct udevice *dev, const char *name,
+ struct clk *clk)
+{
+ return -ENOSYS;
+}
+#endif
/**
* clk_request - Request a clock by provider-specific ID.
@@ -162,17 +175,5 @@ int clk_enable(struct clk *clk);
int clk_disable(struct clk *clk);
int soc_clk_dump(void);
-#else
-static inline int clk_get_by_index(struct udevice *dev, int index,
- struct clk *clk)
-{
- return -ENOSYS;
-}
-static inline int clk_get_by_name(struct udevice *dev, const char *name,
- struct clk *clk)
-{
- return -ENOSYS;
-}
-#endif
#endif
--
1.9.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
@ 2016-09-27 0:34 ` Simon Glass
2016-09-27 3:04 ` Lokesh Vutla
` (3 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Simon Glass @ 2016-09-27 0:34 UTC (permalink / raw)
To: u-boot
On 26 September 2016 at 05:45, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
>
> Prefix the KeyStone specific implementation with _ks in order to
> avoid name-space conflict.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> arch/arm/include/asm/ti-common/keystone_net.h | 4 ++--
> arch/arm/mach-keystone/clock.c | 24 ++++++++++++------------
> arch/arm/mach-keystone/cmd_clock.c | 2 +-
> arch/arm/mach-keystone/include/mach/clock.h | 2 +-
> include/configs/ti_armv7_keystone2.h | 8 ++++----
> 5 files changed, 20 insertions(+), 20 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
@ 2016-09-27 0:34 ` Simon Glass
2016-09-27 17:44 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Simon Glass @ 2016-09-27 0:34 UTC (permalink / raw)
To: u-boot
On 26 September 2016 at 05:45, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
> This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
>
> The build failure of k2*evm boards was fixed in a different way by
> the previous commit. It is nasty to patch generic drivers around
> with #ifdef CONFIG_CLK just for the KeyStone's matter.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
> drivers/serial/ns16550.c | 7 ++-----
> include/clk.h | 25 +++++++++++++------------
> 2 files changed, 15 insertions(+), 17 deletions(-)
Reviewed-by: Simon Glass <sjg@chromium.org>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
@ 2016-09-27 3:04 ` Lokesh Vutla
2016-09-27 17:45 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Lokesh Vutla @ 2016-09-27 3:04 UTC (permalink / raw)
To: u-boot
On Monday 26 September 2016 05:15 PM, Masahiro Yamada wrote:
> These two functions are neither defined nor referenced.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
Thanks and regards,
Lokesh
> ---
>
> arch/arm/mach-keystone/include/mach/clock.h | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/arch/arm/mach-keystone/include/mach/clock.h b/arch/arm/mach-keystone/include/mach/clock.h
> index 72724aa..e2bdec1 100644
> --- a/arch/arm/mach-keystone/include/mach/clock.h
> +++ b/arch/arm/mach-keystone/include/mach/clock.h
> @@ -126,8 +126,6 @@ void init_plls(void);
> void init_pll(const struct pll_init_data *data);
> struct pll_init_data *get_pll_init_data(int pll);
> unsigned long clk_get_rate(unsigned int clk);
> -unsigned long clk_round_rate(unsigned int clk, unsigned long hz);
> -int clk_set_rate(unsigned int clk, unsigned long hz);
> int get_max_dev_speed(int *spds);
> int get_max_arm_speed(int *spds);
> void pll_pa_clk_sel(void);
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
@ 2016-09-27 3:04 ` Lokesh Vutla
2016-09-27 17:44 ` Tom Rini
` (2 subsequent siblings)
4 siblings, 0 replies; 15+ messages in thread
From: Lokesh Vutla @ 2016-09-27 3:04 UTC (permalink / raw)
To: u-boot
On Monday 26 September 2016 05:15 PM, Masahiro Yamada wrote:
> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
>
> Prefix the KeyStone specific implementation with _ks in order to
> avoid name-space conflict.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
Thanks and regards,
Lokesh
> ---
>
> arch/arm/include/asm/ti-common/keystone_net.h | 4 ++--
> arch/arm/mach-keystone/clock.c | 24 ++++++++++++------------
> arch/arm/mach-keystone/cmd_clock.c | 2 +-
> arch/arm/mach-keystone/include/mach/clock.h | 2 +-
> include/configs/ti_armv7_keystone2.h | 8 ++++----
> 5 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm/include/asm/ti-common/keystone_net.h b/arch/arm/include/asm/ti-common/keystone_net.h
> index a0d0d9b..0627728 100644
> --- a/arch/arm/include/asm/ti-common/keystone_net.h
> +++ b/arch/arm/include/asm/ti-common/keystone_net.h
> @@ -51,9 +51,9 @@
>
> /* MDIO module input frequency */
> #ifdef CONFIG_SOC_K2G
> -#define EMAC_MDIO_BUS_FREQ (clk_get_rate(sys_clk0_3_clk))
> +#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(sys_clk0_3_clk))
> #else
> -#define EMAC_MDIO_BUS_FREQ (clk_get_rate(pass_pll_clk))
> +#define EMAC_MDIO_BUS_FREQ (ks_clk_get_rate(pass_pll_clk))
> #endif
> /* MDIO clock output frequency */
> #define EMAC_MDIO_CLOCK_FREQ 2500000 /* 2.5 MHz */
> diff --git a/arch/arm/mach-keystone/clock.c b/arch/arm/mach-keystone/clock.c
> index b25db1e..d8804724 100644
> --- a/arch/arm/mach-keystone/clock.c
> +++ b/arch/arm/mach-keystone/clock.c
> @@ -341,7 +341,7 @@ static unsigned long pll_freq_get(int pll)
> return ret;
> }
>
> -unsigned long clk_get_rate(unsigned int clk)
> +unsigned long ks_clk_get_rate(unsigned int clk)
> {
> unsigned long freq = 0;
>
> @@ -381,37 +381,37 @@ unsigned long clk_get_rate(unsigned int clk)
> freq = pll_freq_get(CORE_PLL) / pll0div_read(4);
> break;
> case sys_clk0_2_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 2;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 2;
> break;
> case sys_clk0_3_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 3;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 3;
> break;
> case sys_clk0_4_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 4;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 4;
> break;
> case sys_clk0_6_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 6;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 6;
> break;
> case sys_clk0_8_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 8;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 8;
> break;
> case sys_clk0_12_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 12;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 12;
> break;
> case sys_clk0_24_clk:
> - freq = clk_get_rate(sys_clk0_clk) / 24;
> + freq = ks_clk_get_rate(sys_clk0_clk) / 24;
> break;
> case sys_clk1_3_clk:
> - freq = clk_get_rate(sys_clk1_clk) / 3;
> + freq = ks_clk_get_rate(sys_clk1_clk) / 3;
> break;
> case sys_clk1_4_clk:
> - freq = clk_get_rate(sys_clk1_clk) / 4;
> + freq = ks_clk_get_rate(sys_clk1_clk) / 4;
> break;
> case sys_clk1_6_clk:
> - freq = clk_get_rate(sys_clk1_clk) / 6;
> + freq = ks_clk_get_rate(sys_clk1_clk) / 6;
> break;
> case sys_clk1_12_clk:
> - freq = clk_get_rate(sys_clk1_clk) / 12;
> + freq = ks_clk_get_rate(sys_clk1_clk) / 12;
> break;
> default:
> break;
> diff --git a/arch/arm/mach-keystone/cmd_clock.c b/arch/arm/mach-keystone/cmd_clock.c
> index 3d5cf3f..06afa72 100644
> --- a/arch/arm/mach-keystone/cmd_clock.c
> +++ b/arch/arm/mach-keystone/cmd_clock.c
> @@ -74,7 +74,7 @@ int do_getclk_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
>
> clk = simple_strtoul(argv[1], NULL, 10);
>
> - freq = clk_get_rate(clk);
> + freq = ks_clk_get_rate(clk);
> if (freq)
> printf("clock index [%d] - frequency %lu\n", clk, freq);
> else
> diff --git a/arch/arm/mach-keystone/include/mach/clock.h b/arch/arm/mach-keystone/include/mach/clock.h
> index e2bdec1..0d8a944 100644
> --- a/arch/arm/mach-keystone/include/mach/clock.h
> +++ b/arch/arm/mach-keystone/include/mach/clock.h
> @@ -125,7 +125,7 @@ extern int speeds[];
> void init_plls(void);
> void init_pll(const struct pll_init_data *data);
> struct pll_init_data *get_pll_init_data(int pll);
> -unsigned long clk_get_rate(unsigned int clk);
> +unsigned long ks_clk_get_rate(unsigned int clk);
> int get_max_dev_speed(int *spds);
> int get_max_arm_speed(int *spds);
> void pll_pa_clk_sel(void);
> diff --git a/include/configs/ti_armv7_keystone2.h b/include/configs/ti_armv7_keystone2.h
> index d8f0847..d7bfacc 100644
> --- a/include/configs/ti_armv7_keystone2.h
> +++ b/include/configs/ti_armv7_keystone2.h
> @@ -68,14 +68,14 @@
> #define CONFIG_CONS_INDEX 1
>
> #ifndef CONFIG_SOC_K2G
> -#define CONFIG_SYS_NS16550_CLK clk_get_rate(KS2_CLK1_6)
> +#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(KS2_CLK1_6)
> #else
> -#define CONFIG_SYS_NS16550_CLK clk_get_rate(uart_pll_clk) / 2
> +#define CONFIG_SYS_NS16550_CLK ks_clk_get_rate(uart_pll_clk) / 2
> #endif
>
> /* SPI Configuration */
> #define CONFIG_DAVINCI_SPI
> -#define CONFIG_SYS_SPI_CLK clk_get_rate(KS2_CLK1_6)
> +#define CONFIG_SYS_SPI_CLK ks_clk_get_rate(KS2_CLK1_6)
> #define CONFIG_SF_DEFAULT_SPEED 30000000
> #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
> #define CONFIG_SYS_SPI0
> @@ -314,7 +314,7 @@
> #include <asm/arch/hardware.h>
> #include <asm/arch/clock.h>
> #ifndef CONFIG_SOC_K2G
> -#define CONFIG_SYS_HZ_CLOCK clk_get_rate(KS2_CLK1_6)
> +#define CONFIG_SYS_HZ_CLOCK ks_clk_get_rate(KS2_CLK1_6)
> #else
> #define CONFIG_SYS_HZ_CLOCK external_clk[sys_clk]
> #endif
>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
2016-09-27 3:04 ` Lokesh Vutla
@ 2016-09-27 17:44 ` Tom Rini
2016-09-28 5:14 ` Masahiro Yamada
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
4 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-09-27 17:44 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:26PM +0900, Masahiro Yamada wrote:
> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
>
> Prefix the KeyStone specific implementation with _ks in order to
> avoid name-space conflict.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/f0548d81/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
@ 2016-09-27 17:44 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-09-27 17:44 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:27PM +0900, Masahiro Yamada wrote:
> This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
>
> The build failure of k2*evm boards was fixed in a different way by
> the previous commit. It is nasty to patch generic drivers around
> with #ifdef CONFIG_CLK just for the KeyStone's matter.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/fd3685a7/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
2016-09-27 3:04 ` Lokesh Vutla
@ 2016-09-27 17:45 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-09-27 17:45 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:25PM +0900, Masahiro Yamada wrote:
> These two functions are neither defined nor referenced.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/3f414ba8/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
` (2 preceding siblings ...)
2016-09-27 17:44 ` Tom Rini
@ 2016-09-28 5:14 ` Masahiro Yamada
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
4 siblings, 0 replies; 15+ messages in thread
From: Masahiro Yamada @ 2016-09-28 5:14 UTC (permalink / raw)
To: u-boot
2016-09-26 20:45 GMT+09:00 Masahiro Yamada <yamada.masahiro@socionext.com>:
> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
>
> Prefix the KeyStone specific implementation with _ks in order to
> avoid name-space conflict.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
A nit.
"Prefix ... with _ks"
should be
"Prefix ... with ks_"
I am not inclined to resend just for it,
but hoping Tom can fix it when this patch is applied.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [U-Boot, 1/3] ARM: keystone: remove declaration of unused functions
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
2016-09-27 3:04 ` Lokesh Vutla
2016-09-27 17:45 ` Tom Rini
@ 2016-10-08 17:07 ` Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-10-08 17:07 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:25PM +0900, Masahiro Yamada wrote:
> These two functions are neither defined nor referenced.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/8a9a38a6/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [U-Boot, 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate()
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
` (3 preceding siblings ...)
2016-09-28 5:14 ` Masahiro Yamada
@ 2016-10-08 17:07 ` Tom Rini
4 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-10-08 17:07 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:26PM +0900, Masahiro Yamada wrote:
> The KeyStone platform has its own clk_get_rate() but its prototype
> is different from that of the common-clk (clk-uclass) framework.
>
> Prefix the KeyStone specific implementation with ks_ in order to
> avoid name-space conflict.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Acked-by: Lokesh Vutla <lokeshvutla@ti.com>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/f7e0051c/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [U-Boot] [U-Boot, 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure"
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
2016-09-27 17:44 ` Tom Rini
@ 2016-10-08 17:07 ` Tom Rini
2 siblings, 0 replies; 15+ messages in thread
From: Tom Rini @ 2016-10-08 17:07 UTC (permalink / raw)
To: u-boot
On Mon, Sep 26, 2016 at 08:45:27PM +0900, Masahiro Yamada wrote:
> This reverts commit 82f5279b0cd99a9163d34cfe926d0316d9dc0d37.
>
> The build failure of k2*evm boards was fixed in a different way by
> the previous commit. It is nasty to patch generic drivers around
> with #ifdef CONFIG_CLK just for the KeyStone's matter.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> Reviewed-by: Simon Glass <sjg@chromium.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20161008/6b129f8b/attachment.sig>
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2016-10-08 17:07 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-26 11:45 [U-Boot] [PATCH 0/3] keystone, clk: revert ugly work-around by #ifdef CONFIG_CLK Masahiro Yamada
2016-09-26 11:45 ` [U-Boot] [PATCH 1/3] ARM: keystone: remove declaration of unused functions Masahiro Yamada
2016-09-27 3:04 ` Lokesh Vutla
2016-09-27 17:45 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2016-09-26 11:45 ` [U-Boot] [PATCH 2/3] ARM: keystone: rename clk_get_rate() to ks_clk_get_rate() Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
2016-09-27 3:04 ` Lokesh Vutla
2016-09-27 17:44 ` Tom Rini
2016-09-28 5:14 ` Masahiro Yamada
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
2016-09-26 11:45 ` [U-Boot] [PATCH 3/3] Revert "ns16650: Make sure we have CONFIG_CLK set before using infrastructure" Masahiro Yamada
2016-09-27 0:34 ` Simon Glass
2016-09-27 17:44 ` Tom Rini
2016-10-08 17:07 ` [U-Boot] [U-Boot, " Tom Rini
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.