clk: tegra: Correct clock number for UARTE
Subsystems (3)
PATCH 1/1 clk: tegra: Correct clock number for UARTE
UARTE has clock number 66. Number 65 is the right one for UARTD.
--- drivers/clk/tegra/clk-tegra-periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/tegra/clk-tegra-periph.c +1 -1
@@ -492,7 +492,7 @@ static struct tegra_periph_init_data periph_clks[] = {UART ("uartb" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTB ,7 , tegra_clk_uartb),UART ("uartc" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTC ,55 , tegra_clk_uartc),UART ("uartd" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTD ,65 , tegra_clk_uartd), -UART ("uarte" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTE ,65 , tegra_clk_uarte), +UART ("uarte" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTE ,66 , tegra_clk_uarte),XUSB ("xusb_host_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_HOST_SRC ,143 ,TEGRA_PERIPH_ON_APB |TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_host_src),XUSB ("xusb_falcon_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_FALCON_SRC ,143 ,TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_falcon_src), XUSB("xusb_fs_src", mux_clkm_48M_pllp_480M, CLK_SOURCE_XUSB_FS_SRC, 143, TEGRA_PERIPH_NO_RESET, tegra_clk_xusb_fs_src),
Signature · 1 line
1.8.4.2
PATCH 1/1 clk: tegra: Correct clock number for UARTE
Am Montag, den 02.12.2013, 12:30 +0100 schrieb Thierry Reding:
Quoted 12 lines
UARTE has clock number 66. Number 65 is the right one for UARTD.
Signed-off-by Thierry Reding <[email protected]>--- drivers/clk/tegra/clk-tegra-periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/tegra/clk-tegra-periph.c +0
-0
drivers/clk/tegra/clk-tegra-periph.c static struct tegra_periph_init_data periph_clks[] = { · line 498
Quoted 8 lines
drivers/clk/tegra/clk-tegra-periph.c +1
-1@@ -492,7 +492,7 @@ static struct tegra_periph_init_data periph_clks[] = {UART ("uartb" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTB ,7 , tegra_clk_uartb),UART ("uartc" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTC ,55 , tegra_clk_uartc),UART ("uartd" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTD ,65 , tegra_clk_uartd), -UART ("uarte" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTE ,65 , tegra_clk_uarte), +UART ("uarte" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTE ,66 , tegra_clk_uarte),XUSB ("xusb_host_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_HOST_SRC ,143 ,TEGRA_PERIPH_ON_APB |TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_host_src),XUSB ("xusb_falcon_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_FALCON_SRC ,143 ,TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_falcon_src), XUSB("xusb_fs_src", mux_clkm_48M_pllp_480M, CLK_SOURCE_XUSB_FS_SRC, 143, TEGRA_PERIPH_NO_RESET, tegra_clk_xusb_fs_src),
Is this a stable patch or why are those magic numbers even necessary? I have to admit I didn't follow the Tegra clk stuff closely, but with all the churn going on there I would have suspected that those numbers would have been replaced by the DT include defines by now.
Regards,
Lucas
Signature · 4 lines
Pengutronix e.K. | Lucas Stach | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5076 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
PATCH 1/1 clk: tegra: Correct clock number for UARTE
Quoted 18 lines · Lucas Stach
Am Montag, den 02.12.2013, 12:30 +0100 schrieb Thierry Reding:
Quoted 17 lines
UARTE has clock number 66. Number 65 is the right one for UARTD.
Signed-off-by Thierry Reding <[email protected]>--- drivers/clk/tegra/clk-tegra-periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/tegra/clk-tegra-periph.c +1
-1@@ -492,7 +492,7 @@ static struct tegra_periph_init_data periph_clks[] = {UART ("uartb" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTB ,7 , tegra_clk_uartb),UART ("uartc" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTC ,55 , tegra_clk_uartc),UART ("uartd" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTD ,65 , tegra_clk_uartd), - UART("uarte", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTE, 65, tegra_clk_uarte), + UART("uarte", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTE, 66, tegra_clk_uarte),
Quoted 8 lines
drivers/clk/tegra/clk-tegra-periph.c static struct tegra_periph_init_data periph_clks[] = { · line 498
Quoted 3 lines
drivers/clk/tegra/clk-tegra-periph.c +0
-0XUSB ("xusb_host_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_HOST_SRC ,143 ,TEGRA_PERIPH_ON_APB |TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_host_src),XUSB ("xusb_falcon_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_FALCON_SRC ,143 ,TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_falcon_src), XUSB("xusb_fs_src", mux_clkm_48M_pllp_480M, CLK_SOURCE_XUSB_FS_SRC, 143, TEGRA_PERIPH_NO_RESET, tegra_clk_xusb_fs_src),Is this a stable patch or why are those magic numbers even necessary? I have to admit I didn't follow the Tegra clk stuff closely, but with all the churn going on there I would have suspected that those numbers would have been replaced by the DT include defines by now.
There is no 1:1 mapping between the DT include defines and the hardware clock numbers. For instance, UARTB has DT define 192, but the enable bit is at offset 7.
I think the main reason for doing was because of the Tegra-specific reset API. Now that that's being converted to the generic API, there may be some room to refactor this. Until then I think we're stuck with having these numbers in this table.
But perhaps there were other reasons to do this as well. Peter or Stephen may know the details better than I do.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20131202/cfee0d39/attachment-0001.sig>
PATCH 1/1 clk: tegra: Correct clock number for UARTE
Quoted 30 lines · Thierry Reding
* PGP Signed by an unknown key
Quoted 18 lines · Lucas Stach
Am Montag, den 02.12.2013, 12:30 +0100 schrieb Thierry Reding:
Quoted 17 lines
UARTE has clock number 66. Number 65 is the right one for UARTD.
Signed-off-by Thierry Reding <[email protected]>--- drivers/clk/tegra/clk-tegra-periph.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clk/tegra/clk-tegra-periph.c +1
-1@@ -492,7 +492,7 @@ static struct tegra_periph_init_data periph_clks[] = {UART ("uartb" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTB ,7 , tegra_clk_uartb),UART ("uartc" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTC ,55 , tegra_clk_uartc),UART ("uartd" , mux_pllp_pllc_pllm_clkm,CLK_SOURCE_UARTD ,65 , tegra_clk_uartd), - UART("uarte", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTE, 65, tegra_clk_uarte), + UART("uarte", mux_pllp_pllc_pllm_clkm, CLK_SOURCE_UARTE, 66, tegra_clk_uarte),Quoted 8 lines
drivers/clk/tegra/clk-tegra-periph.c static struct tegra_periph_init_data periph_clks[] = { · line 498
Quoted 3 lines
drivers/clk/tegra/clk-tegra-periph.c +0
-0XUSB ("xusb_host_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_HOST_SRC ,143 ,TEGRA_PERIPH_ON_APB |TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_host_src),XUSB ("xusb_falcon_src" , mux_clkm_pllp_pllc_pllre,CLK_SOURCE_XUSB_FALCON_SRC ,143 ,TEGRA_PERIPH_NO_RESET , tegra_clk_xusb_falcon_src), XUSB("xusb_fs_src", mux_clkm_48M_pllp_480M, CLK_SOURCE_XUSB_FS_SRC, 143, TEGRA_PERIPH_NO_RESET, tegra_clk_xusb_fs_src),Is this a stable patch or why are those magic numbers even necessary? I have to admit I didn't follow the Tegra clk stuff closely, but with all the churn going on there I would have suspected that those numbers would have been replaced by the DT include defines by now.
Quoted 4 lines
There is no 1:1 mapping between the DT include defines and the hardware clock numbers. For instance, UARTB has DT define 192, but the enable bit is at offset 7.
Indeed. Some clocks share the enable bit (eg UARTB and VFIR) and hence the hardware 'clock number'. The hardware 'clock number' really only tells you the bank number and the bit in the clk_enable/disable/state register. The bank number is just 'clock number' / 32. bit number is 'clock number' % 32.
Quoted 5 lines
I think the main reason for doing was because of the Tegra-specific reset API. Now that that's being converted to the generic API, there may be some room to refactor this. Until then I think we're stuck with having these numbers in this table.
It's still a rather convenient way I think. An alternative would be to specify the bit number and the bank ID as 2 separate parameters.
Cheers,
Peter.
PATCH 1/1 clk: tegra: Correct clock number for UARTE
In reply to Thierry RedingQuoted 1 line · Thierry Reding
UARTE has clock number 66. Number 65 is the right one for UARTD.