From: Arnd Bergmann <arnd@arndb.de>
To: cw00.choi@samsung.com
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>,
"linux-samsung-soc@vger.kernel.org"
<linux-samsung-soc@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kgene.kim@samsung.com" <kgene.kim@samsung.com>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"olof@lixom.net" <olof@lixom.net>,
"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
"will.deacon@arm.com" <will.deacon@arm.com>,
"tomasz.figa@gmail.com" <tomasz.figa@gmail.com>,
"thomas.abraham@linaro.org" <thomas.abraham@linaro.org>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
"inki.dae@samsung.com" <inki.dae@samsung.com>,
"chanho61.park@samsung.com" <chanho61.park@samsung.com>,
"geunsik.lim@samsung.com" <geunsik.lim@samsung.com>,
"sw0312.kim@samsung.com" <sw0312.kim@samsung.com>,
"jh80.chung@samsung.com" <jh80.chung@samsu>
Subject: Re: [PATCH 11/19] clk: samsung: exynos5433: Add clocks for CMU_BUS{0|1|2} domains
Date: Thu, 27 Nov 2014 16:51:35 +0100 [thread overview]
Message-ID: <3844465.a5d3AtOSOo@wuerfel> (raw)
In-Reply-To: <CAGTfZH1C28s7trTh9+PhrnLnmJ9vpsKtAA61ASK-LA_1d_cihg@mail.gmail.com>
On Friday 28 November 2014 00:44:07 Chanwoo Choi wrote:
> >
> >> +#define bus_div_clks(num) \
> >> +static struct samsung_div_clock bus##num_div_clks[] __initdata = { \
> >> + /* DIV_BUS */ \
> >> + DIV(CLK_DIV_PCLK_BUS##num_133, "div_pclk_bus"#num"_133", \
> >> + "aclk_bus"#num"_400", DIV_BUS##num, 0, 3), \
> >> +}; \
> >
> > To illustrate my point further: CLK_DIV_PCLK_BUS0/1/2 are all the
> > same, and so are DIV_BUS0/1/2, so you should not need to duplicate
> > the definitions at all but just call them 'CLK_DIV_PCLK_BUS'
> > and 'DIV_BUS'.
>
> CLK_DIV_PCLK_BUS0/1/2 is not all the same.
> Each CLK_DIV_PCLK_BUS0/1/2 must need the unique clock number.
> Because some device may need some clocks by using unique clock number.
This is from your original patch:
+/* CMU_BUS0 */
+#define CLK_DIV_PCLK_BUS0_133 1
+
+#define CLK_ACLK_AHB2APB_BUS0P 2
+#define CLK_ACLK_BUS0NP_133 3
+#define CLK_ACLK_BUS0ND_400 4
+#define CLK_PCLK_BUS0SRVND_133 5
+#define CLK_PCLK_PMU_BUS0 6
+#define CLK_PCLK_SYSREG_BUS0 7
+
+#define BUS0_NR_CLK 8
+
+/* CMU_BUS1 */
+#define CLK_DIV_PCLK_BUS1_133 1
+
+#define CLK_ACLK_AHB2APB_BUS1P 2
+#define CLK_ACLK_BUS1NP_133 3
+#define CLK_ACLK_BUS1ND_400 4
+#define CLK_PCLK_BUS1SRVND_133 5
+#define CLK_PCLK_PMU_BUS1 6
+#define CLK_PCLK_SYSREG_BUS1 7
+
+#define BUS1_NR_CLK 8
+
+/* CMU_BUS2 */
+#define CLK_MOUT_ACLK_BUS2_400_USER 1
+
+#define CLK_DIV_PCLK_BUS2_133 2
+
+#define CLK_ACLK_AHB2APB_BUS2P 3
+#define CLK_ACLK_BUS2NP_133 4
+#define CLK_ACLK_BUS2BEND_400 5
+#define CLK_ACLK_BUS2RTND_400 6
+#define CLK_PCLK_BUS2SRVND_133 7
+#define CLK_PCLK_PMU_BUS2 8
+#define CLK_PCLK_SYSREG_BUS2 9
+
+#define BUS2_NR_CLK 10
The numbers are arbitrarily assigned, but for bus0 and bus1,
they are all identical, while bus2 uses a lightly different
numbering, which you could easily change, e.g. by using the
numbers you have for bus2 on bus0 and bus1 as well.
+ * Register offset definitions for CMU_BUS0
+ */
+#define DIV_BUS0 0x0600
+#define DIV_STAT_BUS0 0x0700
+#define ENABLE_ACLK_BUS0 0x0800
+#define ENABLE_PCLK_BUS0 0x0900
+#define ENABLE_IP_BUS0 0x0b00
+#define ENABLE_IP_BUS1 0x0b04
+
+/*
+ * Register offset definitions for CMU_BUS1
+ */
+#define DIV_BUS1 0x0600
+#define DIV_STAT_BUS1 0x0700
+#define ENABLE_ACLK_BUS1 0x0800
+#define ENABLE_PCLK_BUS1 0x0900
+#define ENABLE_IP_BUS10 0x0b00
+#define ENABLE_IP_BUS11 0x0b04
+/*
+ * Register offset definitions for CMU_BUS2
+ */
+#define MUX_SEL_BUS2 0x0200
+#define MUX_ENABLE_BUS2 0x0300
+#define MUX_STAT_BUS2 0x0400
+#define DIV_BUS2 0x0600
+#define DIV_STAT_BUS2 0x0700
+#define ENABLE_ACLK_BUS2 0x0800
+#define ENABLE_PCLK_BUS2 0x0900
+#define ENABLE_IP_BUS20 0x0b00
+#define ENABLE_IP_BUS21 0x0b04
More importantly, the register offsets are all identical, except that
bus2 has the additional MUX_SEL and MUX_ENABLE definitions. It's very
obvious that this is the same hardware block in multiple instances.
Arnd
next prev parent reply other threads:[~2014-11-27 15:51 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 7:34 [PATCH 00/19] arm64: Add the support for new 64-bit Exynos5433 SoC Chanwoo Choi
2014-11-27 7:34 ` [PATCH 01/19] pinctrl: exynos: Add support for Exynos5433 Chanwoo Choi
2014-11-27 10:26 ` [01/19] " Pankaj Dubey
2014-11-27 10:49 ` Chanwoo Choi
2014-11-27 11:45 ` [PATCH 01/19] " Arnd Bergmann
2014-11-27 12:14 ` Tomasz Figa
2014-11-27 12:36 ` Arnd Bergmann
2014-12-28 11:21 ` Tomasz Figa
2014-12-28 23:33 ` Chanwoo Choi
2014-11-27 7:34 ` [PATCH 02/19] clk: samsung: Add binding documentation for Exynos5433 clock controller Chanwoo Choi
2014-11-27 11:21 ` Mark Rutland
2014-11-27 11:29 ` Chanwoo Choi
2014-11-27 7:35 ` [PATCH 03/19] clk: samsung: exynos5433: Add clocks using common clock framework Chanwoo Choi
2014-11-27 11:48 ` [03/19] " Pankaj Dubey
2014-11-27 12:53 ` Chanwoo Choi
2014-11-28 1:57 ` Chanwoo Choi
2014-11-27 7:35 ` [PATCH 04/19] clk: samsung: exynos5433: Add MUX clocks of CMU_TOP domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 05/19] clk: samsung: exynos5433: Add clocks for CMU_PERIC domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 06/19] clk: samsung: exynos5433: Add clocks for CMU_PERIS domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 07/19] clk: samsung: exynos5433: Add clocks for CMU_G2D domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 08/19] clk: samsung: exynos5433: Add clocks for CMU_MIF domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 09/19] clk: samsung: exynos5433: Add clocks for CMU_DISP domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 10/19] clk: samsung: exynos5433: Add clocks for CMU_AUD domain Chanwoo Choi
[not found] ` <1417073716-22997-1-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-27 7:35 ` [PATCH 11/19] clk: samsung: exynos5433: Add clocks for CMU_BUS{0|1|2} domains Chanwoo Choi
2014-11-27 11:41 ` Arnd Bergmann
2014-11-27 11:56 ` Chanwoo Choi
[not found] ` <54771173.6090408-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-27 12:12 ` Sylwester Nawrocki
2014-11-27 12:14 ` Chanwoo Choi
2014-11-27 12:35 ` Arnd Bergmann
2014-11-27 12:58 ` Chanwoo Choi
2014-11-27 13:15 ` Arnd Bergmann
[not found] ` <CAGTfZH3KmwhJNFdmeWnujbbUbtLf5vSi6i2dbV62DeCtV7n4TQ@mail.gmail.com>
[not found] ` <CAGTfZH3KmwhJNFdmeWnujbbUbtLf5vSi6i2dbV62DeCtV7n4TQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-27 14:02 ` Arnd Bergmann
2014-11-27 15:17 ` Chanwoo Choi
2014-11-27 15:33 ` Arnd Bergmann
2014-11-27 15:44 ` Chanwoo Choi
2014-11-27 15:51 ` Arnd Bergmann [this message]
2014-11-27 15:58 ` Chanwoo Choi
2014-11-27 7:35 ` [PATCH 12/19] clk: samsung: exynos5433: Add missing clocks for CMU_FSYS domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 13/19] clk: samsung: exynos5433: Add clocks for CMU_G3D domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 14/19] clk: samsung: exynos5433: Add clocks for CMU_GSCL domain Chanwoo Choi
2014-11-27 7:35 ` [PATCH 15/19] arm64: exynos5433: Enable ARMv8-based Exynos5433 SoC support Chanwoo Choi
2014-11-27 11:18 ` Catalin Marinas
[not found] ` <20141127111839.GD11511-M2fw3Uu6cmfZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-11-27 11:22 ` Chanwoo Choi
2014-11-27 7:35 ` [PATCH 16/19] arm64: dts: exynos: Add dts files for 64-bit Exynos5433 SoC Chanwoo Choi
2014-11-27 10:26 ` Marc Zyngier
2014-11-28 13:51 ` Chanwoo Choi
[not found] ` <1417073716-22997-17-git-send-email-cw00.choi-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-27 11:18 ` Mark Rutland
2014-11-28 13:18 ` Chanwoo Choi
2014-11-28 14:00 ` Mark Rutland
2014-12-01 2:21 ` Chanwoo Choi
2014-12-02 10:42 ` Mark Rutland
2014-11-27 7:35 ` [PATCH 17/19] arm64: dts: exynos: Add MSHC dt node for Exynos5433 Chanwoo Choi
2014-11-27 7:35 ` [PATCH 18/19] arm64: dts: exynos: Add SPI/PDMA " Chanwoo Choi
2014-11-27 7:35 ` [PATCH 19/19] serial: samsung: Add the support for Exynos5433 SoC Chanwoo Choi
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=3844465.a5d3AtOSOo@wuerfel \
--to=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=chanho61.park@samsung.com \
--cc=cw00.choi@samsung.com \
--cc=geunsik.lim@samsung.com \
--cc=inki.dae@samsung.com \
--cc=jh80.chung@samsu \
--cc=kgene.kim@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=olof@lixom.net \
--cc=s.nawrocki@samsung.com \
--cc=sw0312.kim@samsung.com \
--cc=thomas.abraham@linaro.org \
--cc=tomasz.figa@gmail.com \
--cc=will.deacon@arm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).