OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
Subsystems (10)
Paul Walmsley
maintainercover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
This series fixes several problems that appeared during branch integration testing. These patches are intended to be merged through Tony's tree for 2.6.37.
Change summary:
Recently, the OMAP System Control Module function exports were removed. These are OMAP core-specific functions that should not be used by drivers. Unfortunately, several drivers used these functions, and as a result, these can no longer be built as modules. This series resolves this problem by reimplementing or removing the OMAP SCM accesses. In the case of McBSP, three additional functions were added to arch/arm/mach-omap2/mcbsp.c to handle the signal muxing and clock framework interaction. In the case of OMAP UDC, the code that attempted to use the result of the SCM read was simply broken, so the SCM read has been removed. These changes fix a build breakage. To reduce the likelihood of future usage of the SCM code by drivers, the SCM header files have been moved from plat-omap/include/plat to mach-omap2 (as the SCM only exists on OMAP2+ systems). The McBSP parent fclk and signal muxing changes have received only light testing, so any help from OMAP ASoc experts here is appreciated.
Several boards that are specific to certain OMAP SoC variants have now been marked as such in Kconfig; this prevents them from being built if support for the SoC that they use is not being built.
plat-omap/common.c has been split. OMAP2+ specific code (which had a SCM dependency) has been moved into mach-omap2/common.c. The 32KiHz sync timer code has been moved into its own file. The remainder of the plat-omap/common.c code is deprecated.
Finally, a patch to reduce the amount of debugging generated by the clock framework while it disables unused clocks is included. According to Tim Bird, those debug messages are a significant contributor to kernel boot time when debug-level messages are kept enabled.
regards
- Paul
---
text data bss dec hex filename
5606503 438048 5610800 11655351 b1d8b7 vmlinux.omap2plus.orig 5607439 438848 5610800 11657087 b1df7f vmlinux.omap2plus.patched
Paul Walmsley (10):
OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC
OMAP2420: CTRL: fix OMAP242X_CTRL_REGADDR macro
OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases
OMAP2430: clock: add MCBSP_CLKS node and clkdev aliases
OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching
OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c
OMAP: McBSP: implement functional clock switching via clock framework
OMAP: split plat-omap/common.c
OMAP: control: move plat-omap/control.h to mach-omap2/control.h OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks
arch/arm/mach-omap2/Kconfig | 6 -
arch/arm/mach-omap2/Makefile | 3
arch/arm/mach-omap2/board-3430sdp.c | 2
arch/arm/mach-omap2/board-4430sdp.c | 3
arch/arm/mach-omap2/board-am3517evm.c | 2
arch/arm/mach-omap2/board-apollon.c | 2
arch/arm/mach-omap2/board-cm-t3517.c | 2
arch/arm/mach-omap2/board-generic.c | 16 +-
arch/arm/mach-omap2/board-h4.c | 2
arch/arm/mach-omap2/board-ldp.c | 2
arch/arm/mach-omap2/board-omap3logic.c | 2
arch/arm/mach-omap2/board-omap4panda.c | 4
arch/arm/mach-omap2/clock.c | 2
arch/arm/mach-omap2/clock2420_data.c | 40 ++++
arch/arm/mach-omap2/clock2430_data.c | 64 ++++++
arch/arm/mach-omap2/clock3xxx_data.c | 12 +
arch/arm/mach-omap2/clock44xx_data.c | 2
arch/arm/mach-omap2/common.c | 138 +++++++++++++
arch/arm/mach-omap2/control.c | 3
arch/arm/mach-omap2/control.h | 18 +-
arch/arm/mach-omap2/cpuidle34xx.c | 2
arch/arm/mach-omap2/devices.c | 3
arch/arm/mach-omap2/hsmmc.c | 2
arch/arm/mach-omap2/id.c | 3
arch/arm/mach-omap2/mcbsp.c | 83 ++++++++
arch/arm/mach-omap2/mux.c | 8 -
arch/arm/mach-omap2/pm24xx.c | 2
arch/arm/mach-omap2/pm34xx.c | 2
arch/arm/mach-omap2/prcm.c | 2
arch/arm/mach-omap2/serial.c | 2
arch/arm/mach-omap2/sleep34xx.S | 2
arch/arm/mach-omap2/usb-fs.c | 6 -
arch/arm/plat-omap/32ksynctimer.c | 184 ++++++++++++++++++
arch/arm/plat-omap/Makefile | 2
arch/arm/plat-omap/clock.c | 5
arch/arm/plat-omap/common.c | 291 ----------------------------
arch/arm/plat-omap/devices.c | 1
arch/arm/plat-omap/include/plat/mcbsp.h | 22 ++
arch/arm/plat-omap/include/plat/omap24xx.h | 2
arch/arm/plat-omap/mcbsp.c | 3
arch/arm/plat-omap/sram.c | 3
drivers/usb/gadget/omap_udc.c | 18 --
sound/soc/omap/omap-mcbsp.c | 119 +++--------
43 files changed, 633 insertions(+), 459 deletions(-)
create mode 100644 arch/arm/mach-omap2/common.c
rename arch/arm/{plat-omap/include/plat/control.h => mach-omap2/control.h} (97%)
create mode 100644 arch/arm/plat-omap/32ksynctimer.cPaul Walmsley
maintainerPATCH 1/10 OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC
Currently, if, for example, CONFIG_ARCH_OMAP2420 is not selected, OMAP2420 board files can still be included in the build. This results in link errors:
arch/arm/mach-omap2/built-in.o: In function `omap_generic_map_io':.../arch/arm/mach-omap2/board-generic.c:51: undefined reference to omap2_set_globals_242x' arch/arm/mach-omap2/built-in.o: In function omap_h4_init':.../arch/arm/mach-omap2/board-h4.c:330: undefined reference to omap2420_mux_init' arch/arm/mach-omap2/built-in.o: In function omap_h4_map_io':.../arch/arm/mach-omap2/board-h4.c:373: undefined reference to omap2_set_globals_242x' arch/arm/mach-omap2/built-in.o: In function omap_apollon_init':.../arch/arm/mach-omap2/board-apollon.c:325: undefined reference to omap2420_mux_init' arch/arm/mach-omap2/built-in.o: In function omap_apollon_map_io':.../arch/arm/mach-omap2/board-apollon.c:353: undefined reference to `omap2_set_globals_242x'
make: *** [.tmp_vmlinux1] Error 1
Fix this by making the boards depend on the Kconfig option for the specific SoC that they use.
Also, while here, fix the mach-omap2/board-generic.c file to remove the dependency on OMAP2420.
--- arch/arm/mach-omap2/Kconfig | 6 +++--- arch/arm/mach-omap2/board-generic.c | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/Kconfig +3 -3
@@ -101,20 +101,20 @@ config MACH_OMAP2_TUSB6010 config MACH_OMAP_H4 bool "OMAP 2420 H4 board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2420 default y select OMAP_PACKAGE_ZAF select OMAP_DEBUG_DEVICES config MACH_OMAP_APOLLON bool "OMAP 2420 Apollon board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2420 default y select OMAP_PACKAGE_ZAC config MACH_OMAP_2430SDP bool "OMAP 2430 SDP board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2430 default y select OMAP_PACKAGE_ZAC
arch/arm/mach-omap2/board-generic.c +14 -2
@@ -48,10 +48,22 @@ static void __init omap_generic_init(void)static void __init omap_generic_map_io (void ) { -omap2_set_globals_242x ();/* should be 242x, 243x, or 343x */ -omap242x_map_common_io (); +if (cpu_is_omap242x ()) { +omap2_set_globals_242x (); +omap242x_map_common_io (); + }else if (cpu_is_omap242x ()) { +omap2_set_globals_243x (); +omap243x_map_common_io (); + }else if (cpu_is_omap34xx ()) { +omap2_set_globals_3xxx (); +omap34xx_map_common_io (); + }else if (cpu_is_omap44xx ()) { +omap2_set_globals_443x (); +omap44xx_map_common_io (); + } } +/* XXX This machine entry name should be updated */ MACHINE_START (OMAP_GENERIC ,"Generic OMAP24xx" )/* Maintainer: Paul Mundt <[email protected]> */ .phys_io = 0x48000000,
PATCH 1/10 OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC
Quoted 81 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:05 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Cc: Tony Lindgren
Subject: [PATCH 01/10] OMAP2+:Kconfig: disallow builds for boards that don't use the currently-selected SoCCurrently, if, for example,
CONFIG_ARCH_OMAP2420is not selected, OMAP2420
board files can still be included in the build. This results in link errors:
arch/arm/mach-omap2/built-in.o: In function `omap_generic_map_io':.../arch/arm/mach-omap2/board-generic.c:51: undefined reference toomap2_set_globals_242x' arch/arm/mach-omap2/built-in.o: In functionomap_h4_init':.../arch/arm/mach-omap2/board-h4.c:330: undefined reference to `omap2420_mux_init'arch/arm/mach-omap2/built-in.o: In function `omap_h4_map_io':.../arch/arm/mach-omap2/board-h4.c:373: undefined reference toomap2_set_globals_242x' arch/arm/mach-omap2/built-in.o: In functionomap_apollon_init':.../arch/arm/mach-omap2/board-apollon.c:325: undefined reference toomap2420_mux_init' arch/arm/mach-omap2/built-in.o: In functionomap_apollon_map_io':.../arch/arm/mach-omap2/board-apollon.c:353: undefined reference to `omap2_set_globals_242x'
make: *** [.tmp_vmlinux1] Error 1Fix this by making the boards depend on the
Kconfigoption for the specific SoC that they use.Also, while here, fix the
mach-omap2/board-generic.cfile to remove the
dependency on OMAP2420.Signed-off-by Paul Walmsley <[email protected]>Cc Tony Lindgren <[email protected]>--- arch/arm/mach-omap2/Kconfig | 6 +++--- arch/arm/mach-omap2/board-generic.c | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-)arch/arm/mach-omap2/Kconfig +3
-3@@ -101,20 +101,20 @@ config MACH_OMAP2_TUSB6010 config MACH_OMAP_H4 bool "OMAP 2420 H4 board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2420 default y select OMAP_PACKAGE_ZAF select OMAP_DEBUG_DEVICES config MACH_OMAP_APOLLON bool "OMAP 2420 Apollon board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2420 default y select OMAP_PACKAGE_ZAC config MACH_OMAP_2430SDP bool "OMAP 2430 SDP board" - depends on ARCH_OMAP2 + depends on ARCH_OMAP2430 default y select OMAP_PACKAGE_ZACarch/arm/mach-omap2/board-generic.c +0
-0
arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 54
Quoted 9 lines
arch/arm/mach-omap2/board-generic.c +4
-2@@ -48,10 +48,22 @@ static void __init omap_generic_init(void)static void __init omap_generic_map_io (void ) { -omap2_set_globals_242x ();/* should be 242x, 243x, or 343x */ -omap242x_map_common_io (); +if (cpu_is_omap242x ()) { +omap2_set_globals_242x (); +omap242x_map_common_io (); + }else if (cpu_is_omap242x ()) {
Is this intended for 242x() or 243x()?
Quoted 23 lines
arch/arm/mach-omap2/board-generic.c +10
-1+omap2_set_globals_243x (); +omap243x_map_common_io (); + }else if (cpu_is_omap34xx ()) { +omap2_set_globals_3xxx (); +omap34xx_map_common_io (); + }else if (cpu_is_omap44xx ()) { +omap2_set_globals_443x (); +omap44xx_map_common_io (); + } } +/* XXX This machine entry name should be updated */ MACHINE_START (OMAP_GENERIC ,"Generic OMAP24xx" )/* Maintainer: Paul Mundt <[email protected]> */ .phys_io = 0x48000000, --To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Paul Walmsley
maintainerPATCH 1/10 OMAP2+: Kconfig: disallow builds for boards that don't use the currently-selected SoC
Quoted 10 lines · Charulatha
Quoted 10 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:05 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Cc: Tony Lindgren
Subject: [PATCH 01/10] OMAP2+:Kconfig: disallow builds for boards that don't use the currently-selected SoC
...
Quoted 14 lines
arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 54
Quoted 11 lines
+++
b/arch/arm/mach-omap2/board-generic.carch/arm/mach-omap2/board-generic.c +4
-2@@ -48,10 +48,22 @@ static void __init omap_generic_init(void)static void __init omap_generic_map_io (void ) { -omap2_set_globals_242x ();/* should be 242x, 243x, or 343x */ -omap242x_map_common_io (); +if (cpu_is_omap242x ()) { +omap2_set_globals_242x (); +omap242x_map_common_io (); + }else if (cpu_is_omap242x ()) {Is this intended for 242x() or 243x()?
Quoted 2 lines
arch/arm/mach-omap2/board-generic.c static void __init omap_generic_init(void) · line 56
Quoted 2 lines
arch/arm/mach-omap2/board-generic.c +2
-0+omap2_set_globals_243x (); +omap243x_map_common_io ();
That's for 243x(). Thanks, updated that in the branch that's posted on git.pwsan.com.
- Paul
Paul Walmsley
maintainerPATCH 2/10 OMAP2420: CTRL: fix OMAP242X_CTRL_REGADDR macro
In reply to Paul WalmsleyConform the OMAP2420_CTRL_BASE macro name to the standard of the rest of the OMAP*_CTRL_BASE macro names. This fixes a bug in the OMAP2420 SCM code that prevented OMAP242X_CTRL_REGADDR from working.
--- arch/arm/plat-omap/common.c | 2 +- arch/arm/plat-omap/include/plat/omap24xx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-omap/common.c +1 -1
@@ -269,7 +269,7 @@ static struct omap_globals omap242x_globals = { .tap = OMAP2_L4_IO_ADDRESS(0x48014000), .sdrc = OMAP2420_SDRC_BASE, .sms = OMAP2420_SMS_BASE, - .ctrl = OMAP2420_CTRL_BASE, + .ctrl = OMAP242X_CTRL_BASE, .prm = OMAP2420_PRM_BASE, .cm = OMAP2420_CM_BASE, .uart1_phys = OMAP2_UART1_BASE,
arch/arm/plat-omap/include/plat/omap24xx.h +1 -1
@@ -40,7 +40,7 @@#define OMAP24XX_IC_BASE (L4_24XX_BASE + 0xfe000)#define OMAP24XX_IVA_INTC_BASE 0x40000000 -#define OMAP2420_CTRL_BASE L4_24XX_BASE +#define OMAP242X_CTRL_BASE L4_24XX_BASE#define OMAP2420_32KSYNCT_BASE (L4_24XX_BASE + 0x4000)#define OMAP2420_PRCM_BASE (L4_24XX_BASE + 0x8000)#define OMAP2420_CM_BASE (L4_24XX_BASE + 0x8000)
Paul Walmsley
maintainerPATCH 3/10 OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases
In reply to Paul WalmsleyAdd the MCBSP_CLKS clock and the clksel structures needed to support clock framework-based source switching for McBSP 1 and 2. Also, add clkdev aliases on the parent clocks for the McBSP source switching code, added in a subsequent patch.
--- arch/arm/mach-omap2/clock2420_data.c | 40 ++++++++++++++++++++++++++++++++-- 1 files changed, 38 insertions(+), 2 deletions(-)
arch/arm/mach-omap2/clock2420_data.c +38 -2
@@ -18,6 +18,7 @@#include <linux/list.h> #include <plat/clkdev_omap.h> +#include <plat/control.h> #include "clock.h" #include "clock2xxx.h"
@@ -89,6 +90,12 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ .clkdm_name = "wkup_clkdm", }; +/* Optional external clock input for McBSP CLKS */ +static struct clk mcbsp_clks = { + .name ="mcbsp_clks" , + .ops = &clkops_null, +}; +/* * Analog domain root source clocks */
@@ -1135,14 +1142,34 @@ static struct clk mcbsp1_ick = { .recalc = &followparent_recalc, }; +static const struct clksel_rate common_mcbsp_96m_rates[] = { + { .div =1 , .val =0 , .flags =RATE_IN_24XX }, + { .div =0 } +}; + +static const struct clksel_rate common_mcbsp_mcbsp_rates[] = { + { .div =1 , .val =1 , .flags =RATE_IN_24XX }, + { .div =0 } +}; + +static const struct clksel mcbsp_fck_clksel[] = { + { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates }, + { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, + { .parent =NULL } +}; +static struct clk mcbsp1_fck = { .name ="mcbsp1_fck" , .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name ="core_l4_clkdm" , .enable_reg =OMAP_CM_REGADDR (CORE_MOD ,CM_FCLKEN1 ), .enable_bit =OMAP24XX_EN_MCBSP1_SHIFT , - .recalc = &followparent_recalc, + .clksel_reg =OMAP242X_CTRL_REGADDR (OMAP2_CONTROL_DEVCONF0 ), + .clksel_mask =OMAP2_MCBSP1_CLKS_MASK , + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcbsp2_ick = {
@@ -1159,10 +1186,14 @@ static struct clk mcbsp2_fck = { .name = "mcbsp2_fck", .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name = "core_l4_clkdm", .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, - .recalc = &followparent_recalc, + .clksel_reg = OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), + .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcspi1_ick = {
@@ -1721,6 +1752,9 @@ static struct omap_clk omap2420_clks[] = {CLK (NULL ,"osc_ck" , &osc_ck,CK_242X ),CLK (NULL ,"sys_ck" , &sys_ck,CK_242X ),CLK (NULL ,"alt_ck" , &alt_ck,CK_242X ), +CLK ("omap-mcbsp.1" ,"pad_fck" , &mcbsp_clks,CK_242X ), +CLK ("omap-mcbsp.2" ,"pad_fck" , &mcbsp_clks,CK_242X ), +CLK (NULL ,"mcbsp_clks" , &mcbsp_clks,CK_242X ),/* internal analog sources */ CLK (NULL ,"dpll_ck" , &dpll_ck,CK_242X ), CLK(NULL, "apll96_ck", &apll96_ck, CK_242X),
@@ -1728,6 +1762,8 @@ static struct omap_clk omap2420_clks[] = {/* internal prcm root sources */ CLK (NULL ,"func_54m_ck" , &func_54m_ck,CK_242X ),CLK (NULL ,"core_ck" , &core_ck,CK_242X ), +CLK ("omap-mcbsp.1" ,"prcm_fck" , &func_96m_ck,CK_242X ), +CLK ("omap-mcbsp.2" ,"prcm_fck" , &func_96m_ck,CK_242X ),CLK (NULL ,"func_96m_ck" , &func_96m_ck,CK_242X ),CLK (NULL ,"func_48m_ck" , &func_48m_ck,CK_242X ), CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X),
Paul Walmsley
maintainerPATCH 4/10 OMAP2430: clock: add MCBSP_CLKS node and clkdev aliases
In reply to Paul WalmsleyAdd the MCBSP_CLKS clock and the clksel structures needed to support clock framework-based source switching for McBSPs 1-5. Also, add clkdev aliases on the parent clocks for the McBSP source switching code, added in a subsequent patch.
--- arch/arm/mach-omap2/clock2430_data.c | 64 +++++++++++++++++++++++++++++++--- 1 files changed, 59 insertions(+), 5 deletions(-)
arch/arm/mach-omap2/clock2430_data.c +59 -5
@@ -18,6 +18,7 @@#include <linux/list.h> #include <plat/clkdev_omap.h> +#include <plat/control.h> #include "clock.h" #include "clock2xxx.h"
@@ -89,6 +90,12 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ .clkdm_name = "wkup_clkdm", }; +/* Optional external clock input for McBSP CLKS */ +static struct clk mcbsp_clks = { + .name ="mcbsp_clks" , + .ops = &clkops_null, +}; +/* * Analog domain root source clocks */
@@ -1123,14 +1130,34 @@ static struct clk mcbsp1_ick = { .recalc = &followparent_recalc, }; +static const struct clksel_rate common_mcbsp_96m_rates[] = { + { .div =1 , .val =0 , .flags =RATE_IN_24XX }, + { .div =0 } +}; + +static const struct clksel_rate common_mcbsp_mcbsp_rates[] = { + { .div =1 , .val =1 , .flags =RATE_IN_24XX }, + { .div =0 } +}; + +static const struct clksel mcbsp_fck_clksel[] = { + { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates }, + { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, + { .parent =NULL } +}; +static struct clk mcbsp1_fck = { .name ="mcbsp1_fck" , .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name ="core_l4_clkdm" , .enable_reg =OMAP_CM_REGADDR (CORE_MOD ,CM_FCLKEN1 ), .enable_bit =OMAP24XX_EN_MCBSP1_SHIFT , - .recalc = &followparent_recalc, + .clksel_reg =OMAP243X_CTRL_REGADDR (OMAP2_CONTROL_DEVCONF0 ), + .clksel_mask =OMAP2_MCBSP1_CLKS_MASK , + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcbsp2_ick = {
@@ -1147,10 +1174,14 @@ static struct clk mcbsp2_fck = { .name = "mcbsp2_fck", .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name = "core_l4_clkdm", .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, - .recalc = &followparent_recalc, + .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), + .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcbsp3_ick = {
@@ -1167,10 +1198,14 @@ static struct clk mcbsp3_fck = { .name = "mcbsp3_fck", .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name = "core_l4_clkdm", .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), .enable_bit = OMAP2430_EN_MCBSP3_SHIFT, - .recalc = &followparent_recalc, + .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), + .clksel_mask = OMAP2_MCBSP3_CLKS_MASK, + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcbsp4_ick = {
@@ -1187,10 +1222,14 @@ static struct clk mcbsp4_fck = { .name = "mcbsp4_fck", .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name = "core_l4_clkdm", .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), .enable_bit = OMAP2430_EN_MCBSP4_SHIFT, - .recalc = &followparent_recalc, + .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), + .clksel_mask = OMAP2_MCBSP4_CLKS_MASK, + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcbsp5_ick = {
@@ -1207,10 +1246,14 @@ static struct clk mcbsp5_fck = { .name = "mcbsp5_fck", .ops = &clkops_omap2_dflt_wait, .parent = &func_96m_ck, + .init = &omap2_init_clksel_parent, .clkdm_name = "core_l4_clkdm", .enable_reg = OMAP_CM_REGADDR(CORE_MOD, OMAP24XX_CM_FCLKEN2), .enable_bit = OMAP2430_EN_MCBSP5_SHIFT, - .recalc = &followparent_recalc, + .clksel_reg = OMAP243X_CTRL_REGADDR(OMAP243X_CONTROL_DEVCONF1), + .clksel_mask = OMAP2_MCBSP5_CLKS_MASK, + .clksel = mcbsp_fck_clksel, + .recalc = &omap2_clksel_recalc, };static struct clk mcspi1_ick = {
@@ -1808,6 +1851,12 @@ static struct omap_clk omap2430_clks[] = {CLK (NULL ,"osc_ck" , &osc_ck,CK_243X ),CLK (NULL ,"sys_ck" , &sys_ck,CK_243X ),CLK (NULL ,"alt_ck" , &alt_ck,CK_243X ), +CLK ("omap-mcbsp.1" ,"pad_fck" , &mcbsp_clks,CK_243X ), +CLK ("omap-mcbsp.2" ,"pad_fck" , &mcbsp_clks,CK_243X ), +CLK ("omap-mcbsp.3" ,"pad_fck" , &mcbsp_clks,CK_243X ), +CLK ("omap-mcbsp.4" ,"pad_fck" , &mcbsp_clks,CK_243X ), +CLK ("omap-mcbsp.5" ,"pad_fck" , &mcbsp_clks,CK_243X ), +CLK (NULL ,"mcbsp_clks" , &mcbsp_clks,CK_243X ),/* internal analog sources */ CLK (NULL ,"dpll_ck" , &dpll_ck,CK_243X ), CLK(NULL, "apll96_ck", &apll96_ck, CK_243X),
@@ -1815,6 +1864,11 @@ static struct omap_clk omap2430_clks[] = {/* internal prcm root sources */ CLK (NULL ,"func_54m_ck" , &func_54m_ck,CK_243X ),CLK (NULL ,"core_ck" , &core_ck,CK_243X ), +CLK ("omap-mcbsp.1" ,"prcm_fck" , &func_96m_ck,CK_243X ), +CLK ("omap-mcbsp.2" ,"prcm_fck" , &func_96m_ck,CK_243X ), +CLK ("omap-mcbsp.3" ,"prcm_fck" , &func_96m_ck,CK_243X ), +CLK ("omap-mcbsp.4" ,"prcm_fck" , &func_96m_ck,CK_243X ), +CLK ("omap-mcbsp.5" ,"prcm_fck" , &func_96m_ck,CK_243X ),CLK (NULL ,"func_96m_ck" , &func_96m_ck,CK_243X ),CLK (NULL ,"func_48m_ck" , &func_48m_ck,CK_243X ), CLK(NULL, "func_12m_ck", &func_12m_ck, CK_243X),
Paul Walmsley
maintainerPATCH 5/10 OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching
In reply to Paul WalmsleyThe OMAP3 clock tree already contains the infrastructure to support clock framework-based McBSP functional clock source switching. But it did not contain the clkdev aliases for the McBSP code to refer to the parent clocks in an SoC integration-neutral way. So, add the clkdev aliases for the parent clocks.
--- arch/arm/mach-omap2/clock3xxx_data.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/clock3xxx_data.c +10 -0
@@ -3188,6 +3188,11 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"osc_sys_ck" , &osc_sys_ck,CK_3XXX ),CLK (NULL ,"sys_ck" , &sys_ck,CK_3XXX ),CLK (NULL ,"sys_altclk" , &sys_altclk,CK_3XXX ), +CLK ("omap-mcbsp.1" ,"pad_fck" , &mcbsp_clks,CK_3XXX ), +CLK ("omap-mcbsp.2" ,"pad_fck" , &mcbsp_clks,CK_3XXX ), +CLK ("omap-mcbsp.3" ,"pad_fck" , &mcbsp_clks,CK_3XXX ), +CLK ("omap-mcbsp.4" ,"pad_fck" , &mcbsp_clks,CK_3XXX ), +CLK ("omap-mcbsp.5" ,"pad_fck" , &mcbsp_clks,CK_3XXX ),CLK (NULL ,"mcbsp_clks" , &mcbsp_clks,CK_3XXX ),CLK (NULL ,"sys_clkout1" , &sys_clkout1,CK_3XXX ), CLK(NULL, "dpll1_ck", &dpll1_ck, CK_3XXX),
@@ -3253,6 +3258,8 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"cpefuse_fck" , &cpefuse_fck,CK_3430ES2 |CK_AM35XX ),CLK (NULL ,"ts_fck" , &ts_fck,CK_3430ES2 |CK_AM35XX ),CLK (NULL ,"usbtll_fck" , &usbtll_fck,CK_3430ES2 |CK_AM35XX ), +CLK ("omap-mcbsp.1" ,"prcm_fck" , &core_96m_fck,CK_3XXX ), +CLK ("omap-mcbsp.5" ,"prcm_fck" , &core_96m_fck,CK_3XXX ),CLK (NULL ,"core_96m_fck" , &core_96m_fck,CK_3XXX ),CLK ("mmci-omap-hs.2" ,"fck" , &mmchs3_fck,CK_3430ES2 |CK_AM35XX ), CLK("mmci-omap-hs.1", "fck", &mmchs2_fck, CK_3XXX),
@@ -3346,6 +3353,9 @@ static struct omap_clk omap3xxx_clks[] = {CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_3XXX ),CLK (NULL ,"gpt12_ick" , &gpt12_ick,CK_3XXX ),CLK (NULL ,"gpt1_ick" , &gpt1_ick,CK_3XXX ), +CLK ("omap-mcbsp.2" ,"prcm_fck" , &per_96m_fck,CK_3XXX ), +CLK ("omap-mcbsp.3" ,"prcm_fck" , &per_96m_fck,CK_3XXX ), +CLK ("omap-mcbsp.4" ,"prcm_fck" , &per_96m_fck,CK_3XXX ),CLK (NULL ,"per_96m_fck" , &per_96m_fck,CK_3XXX ),CLK (NULL ,"per_48m_fck" , &per_48m_fck,CK_3XXX ), CLK(NULL, "uart3_fck", &uart3_fck, CK_3XXX),
Paul Walmsley
maintainerPATCH 6/10 OMAP: McBSP: implement McBSP CLKR and FSR signal muxing via mach-omap2/mcbsp.c
In reply to Paul WalmsleyThe OMAP ASoC McBSP code implemented CLKR and FSR signal muxing via direct System Control Module writes on OMAP2+. This required the omap_ctrl_{read,write}l() functions to be exported, which is against
policy: the only code that should call those functions directly is OMAP core code, not device drivers. omap_ctrl_{read,write}*() are no longer exported, so the driver no longer builds as a module.
Fix the pinmuxing part of the problem by removing calls to omap_ctrl_{read,write}l() from the OMAP ASoC McBSP code and implementing signal muxing functions in arch/arm/mach-omap2/mcbsp.c. Due to the unfortunate way that McBSP support is implemented in ASoC and the OMAP tree, these symbols must be exported for use by sound/soc/omap/omap-mcbsp.c.
Going forward, the McBSP device driver should be moved from arch/arm/*omap* into drivers/ or sound/soc/*, and the CPU DAI driver should be implemented as a platform_driver as many other ASoC CPU DAI drivers are. These two steps should resolve many of the layering problems, which will rapidly reappear during a McBSP hwmod/PM runtime conversion.
--- arch/arm/mach-omap2/mcbsp.c | 30 +++++++++++++++++ arch/arm/plat-omap/include/plat/control.h | 2 + arch/arm/plat-omap/include/plat/mcbsp.h | 13 +++++++ arch/arm/plat-omap/mcbsp.c | 1 + sound/soc/omap/omap-mcbsp.c | 52 +++++++++-------------------- 5 files changed, 62 insertions(+), 36 deletions(-)
arch/arm/mach-omap2/mcbsp.c +30 -0
@@ -22,7 +22,37 @@#include <plat/dma.h> #include <plat/cpu.h> #include <plat/mcbsp.h> +#include <plat/control.h> +/* McBSP internal signal muxing functions */ + +void omap2_mcbsp1_mux_clkr_src (u8 mux) +{ +u32 v; + + v =omap_ctrl_readl (OMAP2_CONTROL_DEVCONF0 ); +if (mux ==CLKR_SRC_CLKR ) + v &=OMAP2_MCBSP1_CLKR_MASK ; +else if (mux ==CLKR_SRC_CLKX ) + v |=OMAP2_MCBSP1_CLKR_MASK ; +omap_ctrl_writel (v,OMAP2_CONTROL_DEVCONF0 ); +} +EXPORT_SYMBOL (omap2_mcbsp1_mux_clkr_src); + +void omap2_mcbsp1_mux_fsr_src (u8 mux) +{ +u32 v; + + v =omap_ctrl_readl (OMAP2_CONTROL_DEVCONF0 ); +if (mux ==FSR_SRC_FSR ) + v &=OMAP2_MCBSP1_FSR_MASK ; +else if (mux ==FSR_SRC_FSX ) + v |=OMAP2_MCBSP1_FSR_MASK ; +omap_ctrl_writel (v,OMAP2_CONTROL_DEVCONF0 ); +} +EXPORT_SYMBOL (omap2_mcbsp1_mux_fsr_src); + +/* Platform data */ #ifdef CONFIG_ARCH_OMAP2420 static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = {
arch/arm/plat-omap/include/plat/control.h +2 -0
@@ -223,6 +223,8 @@#define OMAP2_MMCSDIO1ADPCLKISEL (1 << 24)/* MMC1 loop back clock */ #define OMAP24XX_USBSTANDBYCTRL (1 << 15)#define OMAP2_MCBSP2_CLKS_MASK (1 << 6) +#define OMAP2_MCBSP1_FSR_MASK (1 << 4) +#define OMAP2_MCBSP1_CLKR_MASK (1 << 3)#define OMAP2_MCBSP1_CLKS_MASK (1 << 2)/* CONTROL_DEVCONF1 bits */
arch/arm/plat-omap/include/plat/mcbsp.h +12 -1
@@ -312,6 +312,14 @@#define RFSREN 0x0002#define RSYNCERREN 0x0001 +/* CLKR signal muxing options */ +#define CLKR_SRC_CLKR 0 +#define CLKR_SRC_CLKX 1 + +/* FSR signal muxing options */ +#define FSR_SRC_FSR 0 +#define FSR_SRC_FSX 1 +/* we don't do multichannel for now */ struct omap_mcbsp_reg_cfg {u16 spcr2;
@@ -501,7 +509,6 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int lengint omap_mcbsp_spi_master_xmit_word_poll (unsigned int id,u32 word);int omap_mcbsp_spi_master_recv_word_poll (unsigned int id,u32 * word); -/* SPI specific API */ void omap_mcbsp_set_spi_mode (unsigned int id,const struct omap_mcbsp_spi_cfg * spi_cfg);
@@ -510,6 +517,10 @@ int omap_mcbsp_pollread(unsigned int id, u16 * buf);int omap_mcbsp_pollwrite (unsigned int id,u16 buf);int omap_mcbsp_set_io_type (unsigned int id,omap_mcbsp_io_type_t io_type); +/* McBSP signal muxing API */ +void omap2_mcbsp1_mux_clkr_src (u8 mux); +void omap2_mcbsp1_mux_fsr_src (u8 mux); +#ifdef CONFIG_ARCH_OMAP3 /* Sidetone specific API */ int omap_st_set_chgain (unsigned int id,int channel,s16 chgain);
arch/arm/plat-omap/mcbsp.c +1 -0
@@ -27,6 +27,7 @@#include <plat/dma.h> #include <plat/mcbsp.h> +#include <plat/control.h> #include "../mach-omap2/cm-regbits-34xx.h"
sound/soc/omap/omap-mcbsp.c +17 -35
76 lines not on this page · raw message
Paul Walmsley
maintainerPATCH 7/10 OMAP: McBSP: implement functional clock switching via clock framework
In reply to Paul WalmsleyPreviously the OMAP McBSP ASoC driver implemented CLKS switching by using omap_ctrl_{read,write}l() directly. This is against policy; the OMAP System Control Module functions are not intended to be exported to drivers. These symbols are no longer exported, so as a result, the OMAP McBSP ASoC driver does not build as a module.
Resolve the CLKS clock changing portion of this problem by creating a clock parent changing function that lives in arch/arm/mach-omap2/mcbsp.c, and modify the ASoC driver to use it. Due to the unfortunate way that McBSP support is implemented in ASoC and the OMAP tree, this symbol must be exported for use by sound/soc/omap/omap-mcbsp.c.
Going forward, the McBSP device driver should be moved from arch/arm/*omap* into drivers/ or sound/soc/* and the CPU DAI driver should be implemented as a platform_driver as many other ASoC CPU DAI drivers are. These two steps should resolve many of the layering problems, which will rapidly reappear during a McBSP hwmod/PM runtime conversions.
--- arch/arm/mach-omap2/mcbsp.c | 51 +++++++++++++++++++++++ arch/arm/plat-omap/include/plat/mcbsp.h | 11 +++++ arch/arm/plat-omap/mcbsp.c | 3 - sound/soc/omap/omap-mcbsp.c | 69 ++++++------------------------- 4 files changed, 75 insertions(+), 59 deletions(-)
arch/arm/mach-omap2/mcbsp.c +51 -0
@@ -52,6 +52,54 @@ void omap2_mcbsp1_mux_fsr_src(u8 mux) }EXPORT_SYMBOL (omap2_mcbsp1_mux_fsr_src); +/* McBSP CLKS source switching function */ + +int omap2_mcbsp_set_clks_src (u8 id,u8 fck_src_id) +{ +struct omap_mcbsp *mcbsp; +struct clk *fck_src; +char *fck_src_name; +int r; + +if (!omap_mcbsp_check_valid_id (id)) { +pr_err ("%s: Invalid id (%d)\n" , __func__, id +1 ); +return -EINVAL ; + } + mcbsp =id_to_mcbsp_ptr (id); + +if (fck_src_id ==MCBSP_CLKS_PAD_SRC ) + fck_src_name ="pad_fck" ; +else if (fck_src_id ==MCBSP_CLKS_PRCM_SRC ) + fck_src_name ="prcm_fck" ; +else +return -EINVAL ; + + fck_src =clk_get (mcbsp->dev, fck_src_name); +if (IS_ERR_OR_NULL (fck_src)) { +pr_err ("omap-mcbsp: %s: could not clk_get() %s\n" ,"clks" , + fck_src_name); +return -EINVAL ; + } + +clk_disable (mcbsp->fclk); + + r =clk_set_parent (mcbsp->fclk, fck_src); +if (IS_ERR_VALUE (r)) { +pr_err ("omap-mcbsp: %s: could not clk_set_parent() to %s\n" , +"clks" , fck_src_name); +clk_put (fck_src); +return -EINVAL ; + } + +clk_enable (mcbsp->fclk); + +clk_put (fck_src); + +return 0 ; +} +EXPORT_SYMBOL (omap2_mcbsp_set_clks_src); + +/* Platform data */ #ifdef CONFIG_ARCH_OMAP2420
@@ -190,18 +238,21 @@ static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, .tx_irq = OMAP44XX_IRQ_MCBSP2, + /* XXX .ops ? */ }, { .phys_base = OMAP44XX_MCBSP3_BASE, .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, .tx_irq = OMAP44XX_IRQ_MCBSP3, + /* XXX .ops ? */ }, { .phys_base = OMAP44XX_MCBSP4_BASE, .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, .tx_irq = OMAP44XX_IRQ_MCBSP4, + /* XXX .ops ? */ }, };#define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata)
arch/arm/plat-omap/include/plat/mcbsp.h +11 -0
@@ -320,6 +320,10 @@#define FSR_SRC_FSR 0#define FSR_SRC_FSX 1 +/* McBSP functional clock sources */ +#define MCBSP_CLKS_PAD_SRC 0 +#define MCBSP_CLKS_PRCM_SRC 1 +/* we don't do multichannel for now */ struct omap_mcbsp_reg_cfg {u16 spcr2;
@@ -406,6 +410,7 @@ struct omap_mcbsp_spi_cfg {struct omap_mcbsp_ops {void (*request)(unsigned int );void (*free)(unsigned int ); +int (*set_clks_src)(u8 ,u8 ); };struct omap_mcbsp_platform_data {
@@ -472,6 +477,9 @@ struct omap_mcbsp {extern struct omap_mcbsp **mcbsp_ptr;extern int omap_mcbsp_count, omap_mcbsp_cache_size; +#define omap_mcbsp_check_valid_id (id) (id < omap_mcbsp_count) +#define id_to_mcbsp_ptr (id) mcbsp_ptr[id]; +int omap_mcbsp_init (void );void omap_mcbsp_register_board_cfg (struct omap_mcbsp_platform_data *config,int size);
@@ -509,6 +517,9 @@ int omap_mcbsp_recv_buffer(unsigned int id, dma_addr_t buffer, unsigned int lengint omap_mcbsp_spi_master_xmit_word_poll (unsigned int id,u32 word);int omap_mcbsp_spi_master_recv_word_poll (unsigned int id,u32 * word); + +/* McBSP functional clock source changing function */ +extern int omap2_mcbsp_set_clks_src (u8 id,u8 fck_src_id);/* SPI specific API */ void omap_mcbsp_set_spi_mode (unsigned int id,const struct omap_mcbsp_spi_cfg * spi_cfg);
arch/arm/plat-omap/mcbsp.c +0 -3
@@ -81,9 +81,6 @@ int omap_mcbsp_st_read(struct omap_mcbsp *mcbsp, u16 reg)#define MCBSP_READ_CACHE (mcbsp, reg) \ omap_mcbsp_read(mcbsp, OMAP_MCBSP_REG_##reg, 1) -#define omap_mcbsp_check_valid_id (id) (id < omap_mcbsp_count) -#define id_to_mcbsp_ptr (id) mcbsp_ptr[id]; -#define MCBSP_ST_READ (mcbsp, reg) \ omap_mcbsp_st_read(mcbsp, OMAP_ST_REG_##reg)#define MCBSP_ST_WRITE (mcbsp, reg, val) \
sound/soc/omap/omap-mcbsp.c +13 -56
94 lines not on this page · raw message
PATCH 7/10 OMAP: McBSP: implement functional clock switching via clock framework
Hello,
I have only one question...
On Saturday 02 October 2010 00:35:32 ext Paul Walmsley wrote:
...
Quoted 46 lines
arch/arm/mach-omap2/mcbsp.c +46
-0+/* McBSP CLKS source switching function */ + +int omap2_mcbsp_set_clks_src (u8 id,u8 fck_src_id) +{ +struct omap_mcbsp *mcbsp; +struct clk *fck_src; +char *fck_src_name; +int r; + +if (!omap_mcbsp_check_valid_id (id)) { +pr_err ("%s: Invalid id (%d)\n" , __func__, id +1 ); +return -EINVAL ; + } + mcbsp =id_to_mcbsp_ptr (id); + +if (fck_src_id ==MCBSP_CLKS_PAD_SRC ) + fck_src_name ="pad_fck" ; +else if (fck_src_id ==MCBSP_CLKS_PRCM_SRC ) + fck_src_name ="prcm_fck" ; +else +return -EINVAL ; + + fck_src =clk_get (mcbsp->dev, fck_src_name); +if (IS_ERR_OR_NULL (fck_src)) { +pr_err ("omap-mcbsp: %s: could not clk_get() %s\n" ,"clks" , + fck_src_name); +return -EINVAL ; + } + +clk_disable (mcbsp->fclk); + + r =clk_set_parent (mcbsp->fclk, fck_src); +if (IS_ERR_VALUE (r)) { +pr_err ("omap-mcbsp: %s: could not clk_set_parent() to %s\n" , +"clks" , fck_src_name); +clk_put (fck_src); +return -EINVAL ; + } + +clk_enable (mcbsp->fclk); + +clk_put (fck_src); + +return 0 ; +} +EXPORT_SYMBOL (omap2_mcbsp_set_clks_src);
...
Quoted 22 lines
static int omap_mcbsp_dai_set_dai_sysclk(struct
snd_soc_dai*cpu_dai,sound/soc/omap/omap-mcbsp.c +7
-1int clk_id, unsigned int freq, int dir) { struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs; -struct omap_mcbsp_platform_data *pdata = cpu_dai->dev->platform_data;int err =0 ;/* The McBSP signal muxing functions are only available on McBSP1 */ @@ -685,8 +630,20 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, regs->srgr2 |=CLKSM ;break ;case OMAP_MCBSP_SYSCLK_CLKS_FCLK : +if (cpu_class_is_omap1 ()) { + err = -EINVAL ; +break ; + } + err =omap2_mcbsp_set_clks_src (mcbsp_data->bus_id, +MCBSP_CLKS_PRCM_SRC ); +break ;case OMAP_MCBSP_SYSCLK_CLKS_EXT :
sound/soc/omap/omap-mcbsp.c static int omap_mcbsp_dai_set_dai_sysclk(struct · line 649
Quoted 10 lines
sound/soc/omap/omap-mcbsp.c +6
-1- err =omap_mcbsp_dai_set_clks_src (mcbsp_data, clk_id); +if (cpu_class_is_omap1 ()) { + err =0 ; +break ; + } + err =omap2_mcbsp_set_clks_src (mcbsp_data->bus_id, +MCBSP_CLKS_PAD_SRC );break ;case OMAP_MCBSP_SYSCLK_CLKX_EXT :
What is the fclk source by default.
What I mean is that most of the machine drivers are not calling the snd_soc_dai_set_sysclk for the cpu_dai.
It has been by default to prcm_fclk (core_96 or per_96).
Is this still the case after this series?
Do we need to go through the ASoC machine drivers, and need to select explicitly the prcm_fclk from now on?
Signature · 1 line
P?ter
Paul Walmsley
maintainerPATCH 7/10 OMAP: McBSP: implement functional clock switching via clock framework
Hello Peter,
Quoted 5 lines · Peter Ujfalusi
What is the fclk source by default.
What I mean is that most of the machine drivers are not calling thesnd_soc_dai_set_sysclkfor thecpu_dai.
It has been by default toprcm_fclk(core_96orper_96). Is this still the case after this series?
These patches shouldn't cause any change in behavior in this regard. So if the ASoC machine driver does not explicitly tell it which clock to use, it will use whatever the bootloader or board file configured. If the bootloader or board file didn't configure anything, probably it will use the chip's default reset setting, which for CONTROL_DEVCONF0.MCBSP1_CLKS on 34xx, should be the 96MHz "prcm_fclk"[1].
In other words, the clock framework won't change the parent clock unless the code explicitly tells it to do so, as in the case of the OMAP3 Pandora ASoC machine driver.
Quoted 2 lines
Do we need to go through the ASoC machine drivers, and need to select explicitly the
prcm_fclkfrom now on?
It is a wise thing to do, since one never knows what the bootloader will do. Probably also wise to explicitly set the CLKR/FSR muxes also.
best regards,
- Paul
1. OMAP34xx TRM rev. ZH, Table 7-79, "CONTROL_DEVCONF0"
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
In reply to Paul WalmsleySplit plat-omap/common.c into three pieces:
1. the 32KiHz sync timer and clocksource code, which now lives in plat-omap/32ksynctimer.c;
2. the OMAP2+ common code, which has been moved to mach-omap2/common.c;
3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation function.
The primary motivation for doing this is to move the OMAP2+-specific parts into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
--- arch/arm/mach-omap2/Makefile | 3 arch/arm/mach-omap2/common.c | 138 ++++++++++++++++++ arch/arm/plat-omap/32ksynctimer.c | 184 +++++++++++++++++++++++ arch/arm/plat-omap/Makefile | 2 arch/arm/plat-omap/common.c | 291 ------------------------------------- arch/arm/plat-omap/devices.c | 1 arch/arm/plat-omap/sram.c | 3 7 files changed, 325 insertions(+), 297 deletions(-) create mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/plat-omap/32ksynctimer.c
arch/arm/mach-omap2/Makefile +2 -1
@@ -3,7 +3,8 @@ # # Common support -obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o +obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ + common.o omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o hwmod-common = omap_hwmod.o \
arch/arm/mach-omap2/common.c new file +138 -0
138 lines not on this page · raw message
arch/arm/plat-omap/32ksynctimer.c new file +184 -0
184 lines not on this page · raw message
arch/arm/plat-omap/Makefile +1 -1
@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o 32ksynctimer.o obj-m := obj-n := obj- :=
arch/arm/plat-omap/common.c +0 -291
309 lines not on this page · raw message
arch/arm/plat-omap/devices.c +0 -1
@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h>
arch/arm/plat-omap/sram.c +0 -3
@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h"
@@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) -#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300
PATCH 8/10 OMAP: split plat-omap/common.c
Felipe,
Quoted 7 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.c
Quoted 5 lines
Split
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;
I remember you have converted the 32k sync time code to a platform driver. That was also addressing the multi-omap build and was removing all the compile time switches.
Do you plan to rebase it and post it again ?
Quoted 745 lines
2. the OMAP2+ common code, which has been moved to
mach-omap2/common.c;3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation function.
The primary motivation for doing this is to move the OMAP2+-specific parts into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
Signed-off-by Paul Walmsley <[email protected]>--- arch/arm/mach-omap2/Makefile | 3 arch/arm/mach-omap2/common.c | 138 ++++++++++++++++++ arch/arm/plat-omap/32ksynctimer.c | 184 +++++++++++++++++++++++ arch/arm/plat-omap/Makefile | 2 arch/arm/plat-omap/common.c | 291 -------------------------------- ----- arch/arm/plat-omap/devices.c | 1 arch/arm/plat-omap/sram.c | 3 7 files changed, 325 insertions(+), 297 deletions(-) create mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/plat-omap/32ksynctimer.carch/arm/mach-omap2/Makefile +0
-1@@ -3,7 +3,8 @@ # # Common support -obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.opm.o
+obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \arch/arm/mach-omap2/Makefile +1
-0+ common.o omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o hwmod-common = omap_hwmod.o \arch/arm/mach-omap2/common.c new file +34
-0@@ -0,0 +1,138 @@ +/* +* linux/arch/arm/mach-omap2/common.c +* +* Code common to all OMAP2+ machines. +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Added OMAP4 support - Santosh Shilimkar <[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> +#include <plat/control.h> +#include <plat/mux.h> + +#include <plat/clock.h> + +#include "sdrc.h" + +/* Global address base setup code */ + +#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) + +static void __init __omap2_set_globals(struct omap_globals
*omap2_globals)arch/arm/mach-omap2/common.c new file +104
-0+{ +omap2_set_globals_tap (omap2_globals); +omap2_set_globals_sdrc (omap2_globals); +omap2_set_globals_control (omap2_globals); +omap2_set_globals_prcm (omap2_globals); +omap2_set_globals_uart (omap2_globals); +} + +#endif + +#if defined(CONFIG_ARCH_OMAP2420 ) + +static struct omap_globals omap242x_globals = { + .class =OMAP242X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), + .sdrc =OMAP2420_SDRC_BASE , + .sms =OMAP2420_SMS_BASE , + .ctrl =OMAP242X_CTRL_BASE , + .prm =OMAP2420_PRM_BASE , + .cm =OMAP2420_CM_BASE , + .uart1_phys =OMAP2_UART1_BASE , + .uart2_phys =OMAP2_UART2_BASE , + .uart3_phys =OMAP2_UART3_BASE , +}; + +void __init omap2_set_globals_242x (void ) +{ +__omap2_set_globals (&omap242x_globals); +} +#endif + +#if defined(CONFIG_ARCH_OMAP2430 ) + +static struct omap_globals omap243x_globals = { + .class =OMAP243X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), + .sdrc =OMAP243X_SDRC_BASE , + .sms =OMAP243X_SMS_BASE , + .ctrl =OMAP243X_CTRL_BASE , + .prm =OMAP2430_PRM_BASE , + .cm =OMAP2430_CM_BASE , + .uart1_phys =OMAP2_UART1_BASE , + .uart2_phys =OMAP2_UART2_BASE , + .uart3_phys =OMAP2_UART3_BASE , +}; + +void __init omap2_set_globals_243x (void ) +{ +__omap2_set_globals (&omap243x_globals); +} +#endif + +#if defined(CONFIG_ARCH_OMAP3 ) + +static struct omap_globals omap3_globals = { + .class =OMAP343X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), + .sdrc =OMAP343X_SDRC_BASE , + .sms =OMAP343X_SMS_BASE , + .ctrl =OMAP343X_CTRL_BASE , + .prm =OMAP3430_PRM_BASE , + .cm =OMAP3430_CM_BASE , + .uart1_phys =OMAP3_UART1_BASE , + .uart2_phys =OMAP3_UART2_BASE , + .uart3_phys =OMAP3_UART3_BASE , + .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ +}; + +void __init omap2_set_globals_3xxx (void ) +{ +__omap2_set_globals (&omap3_globals); +} + +void __init omap3_map_io (void ) +{ +omap2_set_globals_3xxx (); +omap34xx_map_common_io (); +} +#endif + +#if defined(CONFIG_ARCH_OMAP4 ) +static struct omap_globals omap4_globals = { + .class =OMAP443X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), + .ctrl =OMAP443X_SCM_BASE , + .ctrl_pad =OMAP443X_CTRL_BASE , + .prm =OMAP4430_PRM_BASE , + .cm =OMAP4430_CM_BASE , + .cm2 =OMAP4430_CM2_BASE , + .uart1_phys =OMAP4_UART1_BASE , + .uart2_phys =OMAP4_UART2_BASE , + .uart3_phys =OMAP4_UART3_BASE , + .uart4_phys =OMAP4_UART4_BASE , +}; + +void __init omap2_set_globals_443x (void ) +{ +omap2_set_globals_tap (&omap4_globals); +omap2_set_globals_control (&omap4_globals); +omap2_set_globals_prcm (&omap4_globals); +omap2_set_globals_uart (&omap4_globals); +} +#endif +arch/arm/plat- renamed from arch/arm/plat-omap/32ksynctimer.c +0
-0
omap/32ksynctimer.c
new file mode 100644
index 0000000..b7f458carch/arm/plat-omap/32ksynctimer.c new file +183
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c +* +* OMAP clocksource-related code +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Added OMAP4 support - Santosh Shilimkar <[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> + +#include <plat/clock.h> + + +/* +* 32KHz clocksource ... always available, on pretty most chips except +* OMAP 730 and 1510. Other timers could be used as clocksources, with +* higher resolution in free-running counter modes (e.g. 12 MHz xtal), +* but systems won't necessarily want to spend resources that way. +*/ + +#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 + +#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) + +#include <linux/clocksource.h> + +/* +* offset_32k holds the init time counter value. It is then subtracted +* from every counter read to achieve a counter that counts time from the +* kernel boot (needed for sched_clock()). +*/ +static u32 offset_32k__read_mostly ; + +#ifdef CONFIG_ARCH_OMAP16XX +static cycle_t omap16xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; +} +#else +#define omap16xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2420 +static cycle_t omap2420_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2420_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2430 +static cycle_t omap2430_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2430_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP3 +static cycle_t omap34xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap34xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP4 +static cycle_t omap44xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap44xx_32k_read NULL +#endif + +/* +* Kernel assumes that sched_clock can be called early but may not have +* things ready yet. +*/ +static cycle_t omap_32k_read_dummy (struct clocksource *cs) +{ +return 0 ; +} + +static struct clocksource clocksource_32k = { + .name ="32k_counter" , + .rating =250 , + .read = omap_32k_read_dummy, + .mask =CLOCKSOURCE_MASK (32 ), + .shift =10 , + .flags =CLOCK_SOURCE_IS_CONTINUOUS , +}; + +/* +* Returns current time from boot in nsecs. It's OK for this to wrap +* around for now, as it's just a relative time stamp. +*/ +unsigned long long sched_clock (void ) +{ +return clocksource_cyc2ns (clocksource_32k.read (&clocksource_32k), + clocksource_32k.mult, clocksource_32k.shift); +} + +/** +* read_persistent_clock - Return time from a persistent clock. +* +* Reads the time from a source which isn't disabled during PM, the +* 32k sync timer. Convert the cycles elapsed since last read into +* nsecs and adds to a monotonically increasing timespec. +*/ +static struct timespec persistent_ts; +static cycles_t cycles, last_cycles; +void read_persistent_clock (struct timespec *ts) +{ +unsigned long long nsecs; +cycles_t delta; +struct timespec *tsp = &persistent_ts; + + last_cycles = cycles; + cycles = clocksource_32k.read (&clocksource_32k); + delta = cycles - last_cycles; + + nsecs =clocksource_cyc2ns (delta, + clocksource_32k.mult, clocksource_32k.shift); + +timespec_add_ns (tsp, nsecs); + *ts = *tsp; +} + +static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ()) + clocksource_32k.read = omap16xx_32k_read; +else if (cpu_is_omap2420 ()) + clocksource_32k.read = omap2420_32k_read; +else if (cpu_is_omap2430 ()) + clocksource_32k.read = omap2430_32k_read; +else if (cpu_is_omap34xx ()) + clocksource_32k.read = omap34xx_32k_read; +else if (cpu_is_omap44xx ()) + clocksource_32k.read = omap44xx_32k_read; +else +return -ENODEV ; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift); + + offset_32k = clocksource_32k.read (&clocksource_32k); + +if (clocksource_register (&clocksource_32k)) +printk (err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); + +#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */arch/arm/plat-omap/32ksynctimer.c new file +1
-0+arch/arm/plat-omap/Makefile +1
-1@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o 32ksynctimer.o obj-m := obj-n := obj- :=arch/arm/plat-omap/common.c +0
-181@@ -11,38 +11,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> -#include <linux/delay.h> -#include <linux/console.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/serial_reg.h> -#include <linux/clk.h> #include <linux/io.h> #include <linux/omapfb.h> -#include <mach/hardware.h> -#include <asm/system.h> -#include <asm/pgtable.h> -#include <asm/mach/map.h> -#include <asm/setup.h> -#include <plat/common.h> #include <plat/board.h> -#include <plat/control.h> -#include <plat/mux.h> -#include <plat/fpga.h> -#include <plat/serial.h> #include <plat/vram.h> -#include <plat/clock.h> - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) -# include "../mach-omap2/sdrc.h" -#endif #define NO_LENGTH_CHECK 0xffffffff@@ -88,271 +65,3 @@ void __init omap_reserve(void)omapfb_reserve_sdram_memblock ();omap_vram_reserve_sdram_memblock (); } - -/* -* 32KHz clocksource ... always available, on pretty most chips except -* OMAP 730 and 1510. Other timers could be used as clocksources, with -* higher resolution in free-running counter modes (e.g. 12 MHz xtal), -* but systems won't necessarily want to spend resources that way. -*/ - -#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 - -#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) - -#include <linux/clocksource.h> - -/* -* offset_32k holds the init time counter value. It is then subtracted -* from every counter read to achieve a counter that counts time from the -* kernel boot (needed for sched_clock()). -*/ -static u32 offset_32k__read_mostly ; - -#ifdef CONFIG_ARCH_OMAP16XX -static cycle_t omap16xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; -} -#else -#define omap16xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2420 -static cycle_t omap2420_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2420_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2430 -static cycle_t omap2430_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2430_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP3 -static cycle_t omap34xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap34xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP4 -static cycle_t omap44xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap44xx_32k_read NULL -#endif - -/* -* Kernel assumes that sched_clock can be called early but may not have -* things ready yet. -*/ -static cycle_t omap_32k_read_dummy (struct clocksource *cs) -{ -return 0 ; -} - -static struct clocksource clocksource_32k = { - .name ="32k_counter" , - .rating =250 , - .read = omap_32k_read_dummy, - .mask =CLOCKSOURCE_MASK (32 ), - .shift =10 , - .flags =CLOCK_SOURCE_IS_CONTINUOUS , -}; - -/* -* Returns current time from boot in nsecs. It's OK for this to wrap -* around for now, as it's just a relative time stamp. -*/ -unsigned long long sched_clock (void ) -{ -return clocksource_cyc2ns (clocksource_32k.read (&clocksource_32k), - clocksource_32k.mult, clocksource_32k.shift); -} - -/** -* read_persistent_clock - Return time from a persistent clock. -* -* Reads the time from a source which isn't disabled during PM, the -* 32k sync timer. Convert the cycles elapsed since last read into -* nsecs and adds to a monotonically increasing timespec. -*/ -static struct timespec persistent_ts; -static cycles_t cycles, last_cycles; -void read_persistent_clock (struct timespec *ts) -{ -unsigned long long nsecs; -cycles_t delta; -struct timespec *tsp = &persistent_ts; - - last_cycles = cycles; - cycles = clocksource_32k.read (&clocksource_32k); - delta = cycles - last_cycles; - - nsecs =clocksource_cyc2ns (delta, - clocksource_32k.mult, clocksource_32k.shift); - -timespec_add_ns (tsp, nsecs); - *ts = *tsp; -} - -static int __init omap_init_clocksource_32k (void ) -{ -static char err[]__initdata =KERN_ERR -"%s: can't register clocksource!\n" ; - -if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { -struct clk *sync_32k_ick; - -if (cpu_is_omap16xx ()) - clocksource_32k.read = omap16xx_32k_read; -else if (cpu_is_omap2420 ()) - clocksource_32k.read = omap2420_32k_read; -else if (cpu_is_omap2430 ()) - clocksource_32k.read = omap2430_32k_read; -else if (cpu_is_omap34xx ()) - clocksource_32k.read = omap34xx_32k_read; -else if (cpu_is_omap44xx ()) - clocksource_32k.read = omap44xx_32k_read; -else -return -ENODEV ; - - sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); -if (sync_32k_ick) -clk_enable (sync_32k_ick); - - clocksource_32k.mult =clocksource_hz2mult (32768 , - clocksource_32k.shift); - - offset_32k = clocksource_32k.read (&clocksource_32k); - -if (clocksource_register (&clocksource_32k)) -printk (err, clocksource_32k.name); - } -return 0 ; -} -arch_initcall (omap_init_clocksource_32k); - -#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */arch/arm/plat-omap/common.c +0
-6- -/* Global address base setup code */ - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) - -static void __init __omap2_set_globals(struct omap_globals
*omap2_globals)arch/arm/plat-omap/common.c +0
-104-{ -omap2_set_globals_tap (omap2_globals); -omap2_set_globals_sdrc (omap2_globals); -omap2_set_globals_control (omap2_globals); -omap2_set_globals_prcm (omap2_globals); -omap2_set_globals_uart (omap2_globals); -} - -#endif - -#if defined(CONFIG_ARCH_OMAP2420 ) - -static struct omap_globals omap242x_globals = { - .class =OMAP242X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), - .sdrc =OMAP2420_SDRC_BASE , - .sms =OMAP2420_SMS_BASE , - .ctrl =OMAP242X_CTRL_BASE , - .prm =OMAP2420_PRM_BASE , - .cm =OMAP2420_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_242x (void ) -{ -__omap2_set_globals (&omap242x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP2430 ) - -static struct omap_globals omap243x_globals = { - .class =OMAP243X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), - .sdrc =OMAP243X_SDRC_BASE , - .sms =OMAP243X_SMS_BASE , - .ctrl =OMAP243X_CTRL_BASE , - .prm =OMAP2430_PRM_BASE , - .cm =OMAP2430_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_243x (void ) -{ -__omap2_set_globals (&omap243x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP3 ) - -static struct omap_globals omap3_globals = { - .class =OMAP343X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), - .sdrc =OMAP343X_SDRC_BASE , - .sms =OMAP343X_SMS_BASE , - .ctrl =OMAP343X_CTRL_BASE , - .prm =OMAP3430_PRM_BASE , - .cm =OMAP3430_CM_BASE , - .uart1_phys =OMAP3_UART1_BASE , - .uart2_phys =OMAP3_UART2_BASE , - .uart3_phys =OMAP3_UART3_BASE , - .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ -}; - -void __init omap2_set_globals_3xxx (void ) -{ -__omap2_set_globals (&omap3_globals); -} - -void __init omap3_map_io (void ) -{ -omap2_set_globals_3xxx (); -omap34xx_map_common_io (); -} -#endif - -#if defined(CONFIG_ARCH_OMAP4 ) -static struct omap_globals omap4_globals = { - .class =OMAP443X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), - .ctrl =OMAP443X_SCM_BASE , - .ctrl_pad =OMAP443X_CTRL_BASE , - .prm =OMAP4430_PRM_BASE , - .cm =OMAP4430_CM_BASE , - .cm2 =OMAP4430_CM2_BASE , - .uart1_phys =OMAP4_UART1_BASE , - .uart2_phys =OMAP4_UART2_BASE , - .uart3_phys =OMAP4_UART3_BASE , - .uart4_phys =OMAP4_UART4_BASE , -}; - -void __init omap2_set_globals_443x (void ) -{ -omap2_set_globals_tap (&omap4_globals); -omap2_set_globals_control (&omap4_globals); -omap2_set_globals_prcm (&omap4_globals); -omap2_set_globals_uart (&omap4_globals); -} -#endif -arch/arm/plat-omap/devices.c +0
-1@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h> arch/arm/plat-omap/sram.c +0
-4@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h" @@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) -#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300 --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 11 lines · Santosh
Felipe,
Quoted 9 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.cSplit
plat-omap/common.cinto three pieces:
Quoted 7 lines
Quoted 3 lines
1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;I remember you have converted the 32k sync time code to a platform driver. That was also addressing the multi-omap build and was removing all the compile time switches.
Do you plan to rebase it and post it again ?
I still have that sitting on my gitorious tree. The patch is attached to this mail. I compile tested (only) for omap3_defconfig, it probably needs to start using pm_runtime functions at some point and probably move to drivers/clocksource instead of arch/arm/plat-omap.
patch is also available at [1]
[1] git://gitorious.org/usb/usb.git clksource
8<------------------------------- cut here ---------------------------------
From 9aad17796072a2ee88aa11c0431fa99e8e9609f0 Mon Sep 17 00:00:00 2001
From: Felipe Balbi <[email protected]>
Date: Tue, 23 Mar 2010 12:54:14 +0200
Subject: [PATCH] arm: omap1/2/3/4: convert 32k-sync driver to a platform_driver
Organization: Texas Instruments\n
Convert the omap32k clocksource driver into a platform_driver and while at that, also remove the ifdeferry around the code.
--- arch/arm/mach-omap1/devices.c | 24 ++++ arch/arm/mach-omap2/clock2420_data.c | 2 +- arch/arm/mach-omap2/clock2430_data.c | 2 +- arch/arm/mach-omap2/clock3xxx_data.c | 2 +- arch/arm/mach-omap2/devices.c | 35 +++++ arch/arm/plat-omap/Makefile | 4 +- arch/arm/plat-omap/common.c | 158 --------------------- arch/arm/plat-omap/counter-32k.c | 251 ++++++++++++++++++++++++++++++++++ 8 files changed, 315 insertions(+), 163 deletions(-)
create mode 100644 arch/arm/plat-omap/counter-32k.c
arch/arm/mach-omap1/devices.c +24 -0
@@ -28,6 +28,29 @@/*-------------------------------------------------------------------------*/ +#define OMAP16XX_TIMER_32K_BASE 0xfffbc400 + +static struct resource omap_32k_resources[] = { + { + .start =OMAP16XX_TIMER_32K_BASE , + .end =SZ_4K , + .flags =IORESOURCE_MEM , + }, +}; + +static struct platform_device omap_32k_device = { + .name ="omap-counter-32k" , + .id =-1 , + .num_resources =ARRAY_SIZE (omap_32k_resources), + .resource = omap_32k_resources, +}; + +static void omap_init_32k (void ) +{ +if (cpu_is_omap16xx ()) + (void )platform_device_register (&omap_32k_device); +}; +#if defined(CONFIG_RTC_DRV_OMAP ) || defined(CONFIG_RTC_DRV_OMAP_MODULE )#define OMAP_RTC_BASE 0xfffb4800
@@ -223,6 +246,7 @@ static int __init omap1_init_devices(void)* in alphabetical order so they're easier to sort through. */ +omap_init_32k ();omap_init_mbox ();omap_init_rtc ();omap_init_spi100k ();
arch/arm/mach-omap2/clock2420_data.c +1 -1
@@ -1806,7 +1806,7 @@ static struct omap_clk omap2420_clks[] = {CLK (NULL ,"gpios_fck" , &gpios_fck,CK_242X ),CLK ("omap_wdt" ,"ick" , &mpu_wdt_ick,CK_242X ),CLK ("omap_wdt" ,"fck" , &mpu_wdt_fck,CK_242X ), -CLK (NULL ,"sync_32k_ick" , &sync_32k_ick,CK_242X ), +CLK ("omap-counter-32k" ,"ick" , &sync_32k_ick,CK_242X ),CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_242X ),CLK (NULL ,"omapctrl_ick" , &omapctrl_ick,CK_242X ), CLK("omap24xxcam", "fck", &cam_fck, CK_242X),
arch/arm/mach-omap2/clock2430_data.c +1 -1
@@ -1900,7 +1900,7 @@ static struct omap_clk omap2430_clks[] = {CLK (NULL ,"gpios_fck" , &gpios_fck,CK_243X ),CLK ("omap_wdt" ,"ick" , &mpu_wdt_ick,CK_243X ),CLK ("omap_wdt" ,"fck" , &mpu_wdt_fck,CK_243X ), -CLK (NULL ,"sync_32k_ick" , &sync_32k_ick,CK_243X ), +CLK ("omap-counter-32k" ,"ick" , &sync_32k_ick,CK_243X ),CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_243X ),CLK (NULL ,"omapctrl_ick" , &omapctrl_ick,CK_243X ), CLK(NULL, "icr_ick", &icr_ick, CK_243X),
arch/arm/mach-omap2/clock3xxx_data.c +1 -1
@@ -3343,7 +3343,7 @@ static struct omap_clk omap3xxx_clks[] = {CLK ("omap_wdt" ,"ick" , &wdt2_ick,CK_3XXX ),CLK (NULL ,"wdt1_ick" , &wdt1_ick,CK_3XXX ),CLK (NULL ,"gpio1_ick" , &gpio1_ick,CK_3XXX ), -CLK (NULL ,"omap_32ksync_ick" , &omap_32ksync_ick,CK_3XXX ), +CLK ("omap-counter-32k" ,"ick" , &omap_32ksync_ick,CK_3XXX ),CLK (NULL ,"gpt12_ick" , &gpt12_ick,CK_3XXX ),CLK (NULL ,"gpt1_ick" , &gpt1_ick,CK_3XXX ), CLK(NULL, "per_96m_fck", &per_96m_fck, CK_3XXX),
arch/arm/mach-omap2/devices.c +35 -0
@@ -31,6 +31,40 @@#include "mux.h" +static struct resource omap_32k_resources[] = { + { + .flags =IORESOURCE_MEM , + }, +}; + +static struct platform_device omap_32k_device = { + .name ="omap-counter-32k" , + .id =-1 , + .num_resources =ARRAY_SIZE (omap_32k_resources), + .resource = omap_32k_resources, +}; + +static void omap_init_32k (void ) +{ +if (cpu_is_omap2420 ()) { + omap_32k_resources[0 ].start =OMAP2420_32KSYNCT_BASE ; + omap_32k_resources[0 ].end =OMAP2420_32KSYNCT_BASE +SZ_4K ; + }else if (cpu_is_omap2430 ()) { + omap_32k_resources[0 ].start =OMAP2430_32KSYNCT_BASE ; + omap_32k_resources[0 ].end =OMAP2430_32KSYNCT_BASE +SZ_4K ; + }else if (cpu_is_omap34xx ()) { + omap_32k_resources[0 ].start =OMAP3430_32KSYNCT_BASE ; + omap_32k_resources[0 ].end =OMAP3430_32KSYNCT_BASE +SZ_4K ; + }else if (cpu_is_omap44xx ()) { + omap_32k_resources[0 ].start =OMAP4430_32KSYNCT_BASE ; + omap_32k_resources[0 ].end =OMAP4430_32KSYNCT_BASE +SZ_4K ; + }else {/* not supported */ +return ; + } + + (void )platform_device_register (&omap_32k_device); +}; +#if defined(CONFIG_VIDEO_OMAP2 ) || defined(CONFIG_VIDEO_OMAP2_MODULE ) static struct resource cam_resources[] = {
@@ -847,6 +881,7 @@ static int __init omap2_init_devices(void)* in alphabetical order so they're easier to sort through. */ omap_hsmmc_reset (); +omap_init_32k ();omap_init_camera ();omap_init_mbox ();omap_init_mcspi ();
arch/arm/plat-omap/Makefile +2 -2
@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o counter-32k.o obj-m := obj-n := obj- :=
@@ -31,4 +31,4 @@ obj-y += $(i2c-omap-m) $(i2c-omap-y) # OMAP mailbox framework obj-$(CONFIG_OMAP_MBOX_FWK) += mailbox.o -obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o +obj-$(CONFIG_OMAP_PM_NOOP) += omap-pm-noop.o
arch/arm/plat-omap/common.c +0 -158
164 lines not on this page · raw message
arch/arm/plat-omap/counter-32k.c new file +251 -0
251 lines not on this page · raw message
Signature · 4 lines
1.7.3.rc0.35.g8ac8c -- balbi
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 20 lines · Felipe
Quoted 11 lines · Santosh
Felipe,
Quoted 9 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.cSplit
plat-omap/common.cinto three pieces:Quoted 7 lines
Quoted 3 lines
1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;I remember you have converted the 32k sync time code to a platform driver. That was also addressing the multi-omap build and was removing all the compile time switches.
Do you plan to rebase it and post it again ?
Quoted 8 lines
I still have that sitting on my gitorious tree. The patch is attached to this mail. I compile tested (only) for
omap3_defconfig, it probably needs to start usingpm_runtimefunctions at some point and probably move todrivers/clocksourceinstead ofarch/arm/plat-omap.patch is also available at [1]
[1]
git://gitorious.org/usb/usb.gitclksource
I made a few changes to make checkpatch.pl --strict happy. Attached
Signature · 1 line
balbi
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 35 lines
-----Original Message-----
From: Balbi, Felipe
Sent: Monday, October 04, 2010 12:31 PM
To: Balbi, Felipe
Cc: Shilimkar, Santosh; Paul Walmsley; linux-omap at vger.kernel.org; linux- arm-kernel at lists.infradead.org
Subject: Re: [PATCH 08/10] OMAP: splitplat-omap/common.cQuoted 10 lines · Felipe
Quoted 9 lines · Santosh
Felipe,
Quoted 7 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.cQuoted 6 lines
Quoted 6 lines
Quoted 5 lines
Split
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;I remember you have converted the 32k sync time code to a platform
driver.
Quoted 9 lines
Quoted 3 lines
That was also addressing the multi-omap build and was removing all the compile time switches.
Do you plan to rebase it and post it again ?I still have that sitting on my gitorious tree. The patch is attached to this mail. I compile tested (only) for
omap3_defconfig, it probably needs to start usingpm_runtimefunctions at some point and probably move todrivers/clocksourceinstead ofarch/arm/plat-omap.
Quoted 6 lines
Quoted 3 lines
patch is also available at [1]
[1]
git://gitorious.org/usb/usb.gitclksourceI made a few changes to make checkpatch.pl --strict happy. Attached
Good !!
This patch addresses splitting as well as multi-omap builds and probably also a better candidate in case we need to convert sync timer to hwmod driver.
Paul, what's your take?
Regards,
Santosh
Tony Lindgren
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 11 lines · Shilimkar, Santosh
Quoted 5 lines
Quoted 2 lines
[1]
git://gitorious.org/usb/usb.gitclksourceI made a few changes to make checkpatch.pl --strict happy. Attached
Good !!
This patch addresses splitting as well as multi-omap builds and probably also a better candidate in case we need to convert sync timer to hwmod driver.Paul, what's your take?
I think we need to first merge Paul's series to fix the omap1 compile issue and the ASoC module compile issue.
The other changes should be trivial to rebase on top of that.
Regards,
Tony
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
In reply to Shilimkar, SantoshQuoted 15 lines · Santosh
Quoted 15 lines
-----Original Message-----
From: Balbi, Felipe
Sent: Monday, October 04, 2010 12:31 PMQuoted 9 lines · Felipe
I still have that sitting on my gitorious tree. The patch is attached to this mail. I compile tested (only) for
omap3_defconfig, it probably needs to start usingpm_runtimefunctions at some point and probably move todrivers/clocksourceinstead ofarch/arm/plat-omap.patch is also available at [1]
[1]
git://gitorious.org/usb/usb.gitclksource
Quoted 8 lines
Quoted 2 lines
I made a few changes to make checkpatch.pl --strict happy. Attached
Good !!
This patch addresses splitting as well as multi-omap builds and probably also a better candidate in case we need to convert sync timer to hwmod driver.Paul, what's your take?
It's great that this is getting cleaned up but it's too late for 2.6.37. We stop taking new code after -rc6 comes out so we can try to get all of the changes integrated with each other and fix any bugs.
The best thing for you and Felipe to do is to convert the driver to use hwmod data and pm_runtime and test on more platforms, then post it to the list after 2.6.37 comes out.
- Paul
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 33 lines
-----Original Message-----
From: Paul Walmsley [mailto:paul at pwsan.com]
Sent: Tuesday, October 05, 2010 1:02 AM
To: Shilimkar, Santosh
Cc: Balbi, Felipe; linux-omap at vger.kernel.org; linux-arm- kernel at lists.infradead.org
Subject: RE: [PATCH 08/10] OMAP: splitplat-omap/common.cQuoted 8 lines · Santosh
Quoted 8 lines
-----Original Message-----
From: Balbi, Felipe
Sent: Monday, October 04, 2010 12:31 PMQuoted 3 lines · Felipe
I still have that sitting on my gitorious tree. The patch is attached to this mail. I compile tested (only) for
omap3_defconfig, itprobably
Quoted 14 lines
Quoted 9 lines
Quoted 6 lines
needs to start using
pm_runtimefunctions at some point and probably move todrivers/clocksourceinstead ofarch/arm/plat-omap.patch is also available at [1]
[1]
git://gitorious.org/usb/usb.gitclksourceI made a few changes to make checkpatch.pl --strict happy. Attached
Good !!
This patch addresses splitting as well as multi-omap builds and probably also a better candidate in case we need to convert sync timer to hwmod driver.
Quoted 6 lines
Quoted 1 line
Paul, what's your take?
It's great that this is getting cleaned up but it's too late for 2.6.37. We stop taking new code after -rc6 comes out so we can try to get all of the changes integrated with each other and fix any bugs.
The patch was lying on the list for quite some time but didn't get much attention before.
Quoted 3 lines
The best thing for you and Felipe to do is to convert the driver to use hwmod data and
pm_runtimeand test on more platforms, then post it to the list after 2.6.37 comes out.
Probably this make sense.
Regards,
Santosh
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 10 lines · Santosh
Quoted 8 lines
-----Original Message-----
From: Paul Walmsley [mailto:paul at pwsan.com]
Sent: Tuesday, October 05, 2010 1:02 AMIt's great that this is getting cleaned up but it's too late for 2.6.37. We stop taking new code after -rc6 comes out so we can try to get all of the changes integrated with each other and fix any bugs.
The patch was lying on the list for quite some time but didn't get much attention before.
According to my archives, it looks like Kevin did quite a bit of review on it and requested that it be converted to use omap_hwmod, after which there was no response. If it was converted to use hwmod and pm_runtime, it probably could have gone in with the other hwmod conversions in the .37 merge window.
Quoted 4 lines
Quoted 3 lines
The best thing for you and Felipe to do is to convert the driver to use hwmod data and
pm_runtimeand test on more platforms, then post it to the list after 2.6.37 comes out.Probably this make sense.
- Paul
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 20 lines
-----Original Message-----
From: Paul Walmsley [mailto:paul at pwsan.com]
Sent: Tuesday, October 05, 2010 10:26 AM
To: Shilimkar, Santosh
Cc: Balbi, Felipe; khilman at deeprootsystems.com; linux- omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: RE: [PATCH 08/10] OMAP: splitplat-omap/common.cQuoted 5 lines · Santosh
Quoted 5 lines
-----Original Message-----
From: Paul Walmsley [mailto:paul at pwsan.com]
Sent: Tuesday, October 05, 2010 1:02 AMIt's great that this is getting cleaned up but it's too late for
2.6.37.
Quoted 1 line
Quoted 1 line
We stop taking new code after -rc6 comes out so we can try to get all
of
Quoted 2 lines
Quoted 2 lines
the changes integrated with each other and fix any bugs.
Quoted 9 lines
Quoted 2 lines
The patch was lying on the list for quite some time but didn't get much attention before.
According to my archives, it looks like Kevin did quite a bit of review on it and requested that it be converted to use
omap_hwmod, after which there was no response. If it was converted to use hwmod andpm_runtime, it probably could have gone in with the other hwmod conversions in the .37 merge window.
Thanks Paul. As aligned, the hwmod + runtime is way to go for this one then.
-Santosh
PATCH 8/10 OMAP: split plat-omap/common.c
In reply to Paul WalmsleyQuoted 144 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.cSplit
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;2. the OMAP2+ common code, which has been moved to
mach-omap2/common.c;3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM
reservation function.The primary motivation for doing this is to move the OMAP2+-specific parts
into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.Signed-off-by Paul Walmsley <[email protected]>--- arch/arm/mach-omap2/Makefile | 3 arch/arm/mach-omap2/common.c | 138 ++++++++++++++++++ arch/arm/plat-omap/32ksynctimer.c | 184 +++++++++++++++++++++++ arch/arm/plat-omap/Makefile | 2 arch/arm/plat-omap/common.c | 291 ------------------------------------- arch/arm/plat-omap/devices.c | 1 arch/arm/plat-omap/sram.c | 3 7 files changed, 325 insertions(+), 297 deletions(-) create mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/plat-omap/32ksynctimer.carch/arm/mach-omap2/Makefile +0
-1@@ -3,7 +3,8 @@ # # Common support -obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.otimer-gp.o pm.o
+obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \arch/arm/mach-omap2/Makefile +1
-0+ common.o omap-2-3-common = irq.o sdrc.oprm2xxx_3xxx.o
hwmod-common = omap_hwmod.o \arch/arm/mach-omap2/common.c new file +12
-0@@ -0,0 +1,138 @@ +/* +* linux/arch/arm/mach-omap2/common.c +* +* Code common to all OMAP2+ machines. +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Added OMAP4 support - Santosh Shilimkar <[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */arch/arm/mach-omap2/common.c new file +19
-0+#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> +#include <plat/control.h> +#include <plat/mux.h> + +#include <plat/clock.h> + +#include "sdrc.h" + +/* Global address base setup code */ + +#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) + +static void __init __omap2_set_globals(struct omap_globals
*omap2_globals)arch/arm/mach-omap2/common.c new file +43
-0+{ +omap2_set_globals_tap (omap2_globals); +omap2_set_globals_sdrc (omap2_globals); +omap2_set_globals_control (omap2_globals); +omap2_set_globals_prcm (omap2_globals); +omap2_set_globals_uart (omap2_globals); +} + +#endif + +#if defined(CONFIG_ARCH_OMAP2420 ) + +static struct omap_globals omap242x_globals = { + .class =OMAP242X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), + .sdrc =OMAP2420_SDRC_BASE , + .sms =OMAP2420_SMS_BASE , + .ctrl =OMAP242X_CTRL_BASE , + .prm =OMAP2420_PRM_BASE , + .cm =OMAP2420_CM_BASE , + .uart1_phys =OMAP2_UART1_BASE , + .uart2_phys =OMAP2_UART2_BASE , + .uart3_phys =OMAP2_UART3_BASE , +}; + +void __init omap2_set_globals_242x (void ) +{ +__omap2_set_globals (&omap242x_globals); +} +#endif + +#if defined(CONFIG_ARCH_OMAP2430 ) + +static struct omap_globals omap243x_globals = { + .class =OMAP243X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), + .sdrc =OMAP243X_SDRC_BASE , + .sms =OMAP243X_SMS_BASE , + .ctrl =OMAP243X_CTRL_BASE , + .prm =OMAP2430_PRM_BASE , + .cm =OMAP2430_CM_BASE , + .uart1_phys =OMAP2_UART1_BASE , + .uart2_phys = OMAP2_UART2_BASE,
arch/arm/mach-omap2/common.c line 87
Quoted 10 lines
arch/arm/mach-omap2/common.c new file +10
-0+ .uart3_phys = OMAP2_UART3_BASE, +}; + +void __init omap2_set_globals_243x (void ) +{ +__omap2_set_globals (&omap243x_globals); +} +#endif + +#if defined(CONFIG_ARCH_OMAP3 )
Do you really need these #ifdefs?
It would be better to avoid these #ifdefs and use cpu_is* checks. Same comment holds good across this patch.
Quoted 58 lines
arch/arm/mach-omap2/common.c new file +51
-0+ +static struct omap_globals omap3_globals = { + .class =OMAP343X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), + .sdrc =OMAP343X_SDRC_BASE , + .sms =OMAP343X_SMS_BASE , + .ctrl =OMAP343X_CTRL_BASE , + .prm =OMAP3430_PRM_BASE , + .cm =OMAP3430_CM_BASE , + .uart1_phys =OMAP3_UART1_BASE , + .uart2_phys =OMAP3_UART2_BASE , + .uart3_phys =OMAP3_UART3_BASE , + .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ +}; + +void __init omap2_set_globals_3xxx (void ) +{ +__omap2_set_globals (&omap3_globals); +} + +void __init omap3_map_io (void ) +{ +omap2_set_globals_3xxx (); +omap34xx_map_common_io (); +} +#endif + +#if defined(CONFIG_ARCH_OMAP4 ) +static struct omap_globals omap4_globals = { + .class =OMAP443X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), + .ctrl =OMAP443X_SCM_BASE , + .ctrl_pad =OMAP443X_CTRL_BASE , + .prm =OMAP4430_PRM_BASE , + .cm =OMAP4430_CM_BASE , + .cm2 =OMAP4430_CM2_BASE , + .uart1_phys =OMAP4_UART1_BASE , + .uart2_phys =OMAP4_UART2_BASE , + .uart3_phys =OMAP4_UART3_BASE , + .uart4_phys =OMAP4_UART4_BASE , +}; + +void __init omap2_set_globals_443x (void ) +{ +omap2_set_globals_tap (&omap4_globals); +omap2_set_globals_control (&omap4_globals); +omap2_set_globals_prcm (&omap4_globals); +omap2_set_globals_uart (&omap4_globals); +} +#endif +arch/arm/plat-omap/32ksynctimer.c new file +0
-0
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 2 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c
No need to have file name and path here.
Quoted 14 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+* +* OMAP clocksource-related code +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren <[email protected]> +* Added OMAP4 support - Santosh Shilimkar <[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> + +#include <plat/clock.h> +
<<snip>>
arch/arm/plat-omap/32ksynctimer.c line 154
Quoted 9 lines
arch/arm/plat-omap/32ksynctimer.c new file +9
-0+static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ())
Avoid cpu_is* checks in plat-omap.
Quoted 18 lines
arch/arm/plat-omap/32ksynctimer.c new file +18
-0+ clocksource_32k.read = omap16xx_32k_read; + else if (cpu_is_omap2420()) + clocksource_32k.read = omap2420_32k_read; + else if (cpu_is_omap2430()) + clocksource_32k.read = omap2430_32k_read; + else if (cpu_is_omap34xx()) + clocksource_32k.read = omap34xx_32k_read; + else if (cpu_is_omap44xx()) + clocksource_32k.read = omap44xx_32k_read; + else + return -ENODEV; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift);
arch/arm/plat-omap/32ksynctimer.c line 182
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ + offset_32k = clocksource_32k.read (&clocksource_32k); + +if (clocksource_register (&clocksource_32k)) +printk (err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); +
<<snip>>
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 8 lines · Charulatha
Quoted 8 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of Paul Walmsley
Sent: Saturday, October 02, 2010 3:06 AM
To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: [PATCH 08/10] OMAP: splitplat-omap/common.cSplit
plat-omap/common.cinto three pieces:
...
Quoted 18 lines
Quoted 18 lines
arch/arm/mach-omap2/common.c new file +18
-0+#if defined(CONFIG_ARCH_OMAP2430 ) + +static struct omap_globals omap243x_globals = { + .class =OMAP243X_CLASS , + .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), + .sdrc =OMAP243X_SDRC_BASE , + .sms =OMAP243X_SMS_BASE , + .ctrl =OMAP243X_CTRL_BASE , + .prm =OMAP2430_PRM_BASE , + .cm =OMAP2430_CM_BASE , + .uart1_phys =OMAP2_UART1_BASE , + .uart2_phys =OMAP2_UART2_BASE , + .uart3_phys =OMAP2_UART3_BASE , +}; + +void __init omap2_set_globals_243x (void ) +{ +__omap2_set_globals (&omap243x_globals);
Quoted 8 lines
arch/arm/mach-omap2/common.c line 87
Quoted 4 lines
arch/arm/mach-omap2/common.c new file +4
-0+} +#endif + +#if defined(CONFIG_ARCH_OMAP3 )Do you really need these #ifdefs?
It would be better to avoid these #ifdefs and use cpu_is* checks. Same comment holds good across this patch.
If you think you can do it better, please create a patch for the 2.6.38 time frame. I personally am not interested in changing any of this code (which was not added by this patch; the patch just splits the existing code) for the .37 merge window.
Quoted 11 lines
arch/arm/plat-omap/32ksynctimer.c line 154
Quoted 9 lines
arch/arm/plat-omap/32ksynctimer.c new file +9
-0+static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ())Avoid cpu_is* checks in plat-omap.
OK, I'll bite. Why?
- Paul
PATCH 8/10 OMAP: split plat-omap/common.c
Paul,
<<snip>>
Quoted 13 lines
Quoted 12 lines
arch/arm/plat-omap/32ksynctimer.c line 154
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +9
-0+static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ())Avoid cpu_is* checks in plat-omap.
Quoted 1 line
OK, I'll bite. Why?
I think this is being looked for all the new code introduced in plat-omap layer for the following reasons:
Adding cpu-is-* checks makes code unmaintainable going fwd. plat-omap layer needs to handle common code for all omap platforms.
This was raised for GPIO driver because of which, there was a requirement to clean-up the gpio driver.
Is this stand changed? Are cpu_is* checks allowed in plat-omap?
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
arch/arm/plat-omap/32ksynctimer.c new file +20
-0+ clocksource_32k.read = omap16xx_32k_read; + else if (cpu_is_omap2420()) + clocksource_32k.read = omap2420_32k_read; + else if (cpu_is_omap2430()) + clocksource_32k.read = omap2430_32k_read; + else if (cpu_is_omap34xx()) + clocksource_32k.read = omap34xx_32k_read; + else if (cpu_is_omap44xx()) + clocksource_32k.read = omap44xx_32k_read; + else + return -ENODEV; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift); + + offset_32k = clocksource_32k.read (&clocksource_32k);
Quoted 8 lines
Quoted 8 lines
arch/arm/plat-omap/32ksynctimer.c line 182
Quoted 8 lines
arch/arm/plat-omap/32ksynctimer.c new file +8
-0+ +if (clocksource_register (&clocksource_32k)) +printk (err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); +
-V Charulatha
Tony Lindgren
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 24 lines · Varadarajan, Charulatha
Paul,
<<snip>>
Quoted 13 lines
Quoted 12 lines
arch/arm/plat-omap/32ksynctimer.c line 154
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +9
-0+static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ())Avoid cpu_is* checks in plat-omap.
Quoted 1 line
OK, I'll bite. Why?
I think this is being looked for all the new code introduced in plat-omap layer for the following reasons:
Adding cpu-is-* checks makes code unmaintainable going fwd. plat-omap layer needs to handle common code for all omap platforms.
Quoted 4 lines
This was raised for GPIO driver because of which, there was a requirement to clean-up the gpio driver.
Is this stand changed? Are cpu_is* checks allowed in plat-omap?
We should only need to do cpu_is* checks in arch/arm/mach-omap2, and only in few places during the init.
However, this patch series moves around the existing code to avoid having oma2plus specific code be in plat-omap.
Again, further patches can be done easily on this.
Tony
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
In reply to Varadarajan, CharulathaHere's the updated patch:
- Paul
PATCH 8/10 OMAP: split plat-omap/common.c
In reply to Paul WalmsleyHi Paul,
Quoted 16 lines · Paul Walmsley
Split
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;2. the OMAP2+ common code, which has been moved to
mach-omap2/common.c;3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation function.
The primary motivation for doing this is to move the OMAP2+-specific parts into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
Signed-off-by Paul Walmsley<[email protected]>---
<...>
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 8 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c
What name do you want to use? 32ksynctimer.c or clocksource.c?
If this file is dedicated for the 32k sync timer, maybe we should now use the new OMAP4 name: "counter_32k".
Noboby knows what the sync stand for, and at the end this is just a 32k counter. Hence the new name :-)
Benoit
Quoted 549 lines
arch/arm/plat-omap/32ksynctimer.c new file +182
-0+* +* OMAP clocksource-related code +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren<[email protected]> +* Added OMAP4 support - Santosh Shilimkar<[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> + +#include <plat/clock.h> + + +/* +* 32KHz clocksource ... always available, on pretty most chips except +* OMAP 730 and 1510. Other timers could be used as clocksources, with +* higher resolution in free-running counter modes (e.g. 12 MHz xtal), +* but systems won't necessarily want to spend resources that way. +*/ + +#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 + +#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) + +#include <linux/clocksource.h> + +/* +* offset_32k holds the init time counter value. It is then subtracted +* from every counter read to achieve a counter that counts time from the +* kernel boot (needed for sched_clock()). +*/ +static u32 offset_32k__read_mostly ; + +#ifdef CONFIG_ARCH_OMAP16XX +static cycle_t omap16xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; +} +#else +#define omap16xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2420 +static cycle_t omap2420_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2420_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2430 +static cycle_t omap2430_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2430_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP3 +static cycle_t omap34xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap34xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP4 +static cycle_t omap44xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap44xx_32k_read NULL +#endif + +/* +* Kernel assumes that sched_clock can be called early but may not have +* things ready yet. +*/ +static cycle_t omap_32k_read_dummy (struct clocksource *cs) +{ +return 0 ; +} + +static struct clocksource clocksource_32k = { + .name ="32k_counter" , + .rating =250 , + .read = omap_32k_read_dummy, + .mask =CLOCKSOURCE_MASK (32 ), + .shift =10 , + .flags =CLOCK_SOURCE_IS_CONTINUOUS , +}; + +/* +* Returns current time from boot in nsecs. It's OK for this to wrap +* around for now, as it's just a relative time stamp. +*/ +unsigned long long sched_clock (void ) +{ +return clocksource_cyc2ns (clocksource_32k.read (&clocksource_32k), + clocksource_32k.mult, clocksource_32k.shift); +} + +/** +* read_persistent_clock - Return time from a persistent clock. +* +* Reads the time from a source which isn't disabled during PM, the +* 32k sync timer. Convert the cycles elapsed since last read into +* nsecs and adds to a monotonically increasing timespec. +*/ +static struct timespec persistent_ts; +static cycles_t cycles, last_cycles; +void read_persistent_clock (struct timespec *ts) +{ +unsigned long long nsecs; +cycles_t delta; +struct timespec *tsp =&persistent_ts; + + last_cycles = cycles; + cycles = clocksource_32k.read (&clocksource_32k); + delta = cycles - last_cycles; + + nsecs =clocksource_cyc2ns (delta, + clocksource_32k.mult, clocksource_32k.shift); + +timespec_add_ns (tsp, nsecs); + *ts = *tsp; +} + +static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ()) + clocksource_32k.read = omap16xx_32k_read; +else if (cpu_is_omap2420 ()) + clocksource_32k.read = omap2420_32k_read; +else if (cpu_is_omap2430 ()) + clocksource_32k.read = omap2430_32k_read; +else if (cpu_is_omap34xx ()) + clocksource_32k.read = omap34xx_32k_read; +else if (cpu_is_omap44xx ()) + clocksource_32k.read = omap44xx_32k_read; +else +return -ENODEV ; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift); + + offset_32k = clocksource_32k.read (&clocksource_32k); + +if (clocksource_register (&clocksource_32k)) +printk (err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); + +#endif /* !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) */ +arch/arm/plat-omap/Makefile +1
-1@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o 32ksynctimer.o obj-m := obj-n := obj- :=arch/arm/plat-omap/common.c +0
-291@@ -11,38 +11,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> -#include <linux/delay.h> -#include <linux/console.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/serial_reg.h> -#include <linux/clk.h> #include <linux/io.h> #include <linux/omapfb.h> -#include <mach/hardware.h> -#include <asm/system.h> -#include <asm/pgtable.h> -#include <asm/mach/map.h> -#include <asm/setup.h> -#include <plat/common.h> #include <plat/board.h> -#include <plat/control.h> -#include <plat/mux.h> -#include <plat/fpga.h> -#include <plat/serial.h> #include <plat/vram.h> -#include <plat/clock.h> - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) -# include "../mach-omap2/sdrc.h" -#endif #define NO_LENGTH_CHECK 0xffffffff@@ -88,271 +65,3 @@ void __init omap_reserve(void)omapfb_reserve_sdram_memblock ();omap_vram_reserve_sdram_memblock (); } - -/* -* 32KHz clocksource ... always available, on pretty most chips except -* OMAP 730 and 1510. Other timers could be used as clocksources, with -* higher resolution in free-running counter modes (e.g. 12 MHz xtal), -* but systems won't necessarily want to spend resources that way. -*/ - -#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 - -#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) - -#include <linux/clocksource.h> - -/* -* offset_32k holds the init time counter value. It is then subtracted -* from every counter read to achieve a counter that counts time from the -* kernel boot (needed for sched_clock()). -*/ -static u32 offset_32k__read_mostly ; - -#ifdef CONFIG_ARCH_OMAP16XX -static cycle_t omap16xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; -} -#else -#define omap16xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2420 -static cycle_t omap2420_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2420_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2430 -static cycle_t omap2430_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2430_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP3 -static cycle_t omap34xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap34xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP4 -static cycle_t omap44xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap44xx_32k_read NULL -#endif - -/* -* Kernel assumes that sched_clock can be called early but may not have -* things ready yet. -*/ -static cycle_t omap_32k_read_dummy (struct clocksource *cs) -{ -return 0 ; -} - -static struct clocksource clocksource_32k = { - .name ="32k_counter" , - .rating =250 , - .read = omap_32k_read_dummy, - .mask =CLOCKSOURCE_MASK (32 ), - .shift =10 , - .flags =CLOCK_SOURCE_IS_CONTINUOUS , -}; - -/* -* Returns current time from boot in nsecs. It's OK for this to wrap -* around for now, as it's just a relative time stamp. -*/ -unsigned long long sched_clock (void ) -{ -return clocksource_cyc2ns (clocksource_32k.read (&clocksource_32k), - clocksource_32k.mult, clocksource_32k.shift); -} - -/** -* read_persistent_clock - Return time from a persistent clock. -* -* Reads the time from a source which isn't disabled during PM, the -* 32k sync timer. Convert the cycles elapsed since last read into -* nsecs and adds to a monotonically increasing timespec. -*/ -static struct timespec persistent_ts; -static cycles_t cycles, last_cycles; -void read_persistent_clock (struct timespec *ts) -{ -unsigned long long nsecs; -cycles_t delta; -struct timespec *tsp =&persistent_ts; - - last_cycles = cycles; - cycles = clocksource_32k.read (&clocksource_32k); - delta = cycles - last_cycles; - - nsecs =clocksource_cyc2ns (delta, - clocksource_32k.mult, clocksource_32k.shift); - -timespec_add_ns (tsp, nsecs); - *ts = *tsp; -} - -static int __init omap_init_clocksource_32k (void ) -{ -static char err[]__initdata =KERN_ERR -"%s: can't register clocksource!\n" ; - -if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { -struct clk *sync_32k_ick; - -if (cpu_is_omap16xx ()) - clocksource_32k.read = omap16xx_32k_read; -else if (cpu_is_omap2420 ()) - clocksource_32k.read = omap2420_32k_read; -else if (cpu_is_omap2430 ()) - clocksource_32k.read = omap2430_32k_read; -else if (cpu_is_omap34xx ()) - clocksource_32k.read = omap34xx_32k_read; -else if (cpu_is_omap44xx ()) - clocksource_32k.read = omap44xx_32k_read; -else -return -ENODEV ; - - sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); -if (sync_32k_ick) -clk_enable (sync_32k_ick); - - clocksource_32k.mult =clocksource_hz2mult (32768 , - clocksource_32k.shift); - - offset_32k = clocksource_32k.read (&clocksource_32k); - -if (clocksource_register (&clocksource_32k)) -printk (err, clocksource_32k.name); - } -return 0 ; -} -arch_initcall (omap_init_clocksource_32k); - -#endif /* !(defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP15XX)) */ - -/* Global address base setup code */ - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) - -static void __init __omap2_set_globals (struct omap_globals *omap2_globals) -{ -omap2_set_globals_tap (omap2_globals); -omap2_set_globals_sdrc (omap2_globals); -omap2_set_globals_control (omap2_globals); -omap2_set_globals_prcm (omap2_globals); -omap2_set_globals_uart (omap2_globals); -} - -#endif - -#if defined(CONFIG_ARCH_OMAP2420 ) - -static struct omap_globals omap242x_globals = { - .class =OMAP242X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), - .sdrc =OMAP2420_SDRC_BASE , - .sms =OMAP2420_SMS_BASE , - .ctrl =OMAP242X_CTRL_BASE , - .prm =OMAP2420_PRM_BASE , - .cm =OMAP2420_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_242x (void ) -{ -__omap2_set_globals (&omap242x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP2430 ) - -static struct omap_globals omap243x_globals = { - .class =OMAP243X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), - .sdrc =OMAP243X_SDRC_BASE , - .sms =OMAP243X_SMS_BASE , - .ctrl =OMAP243X_CTRL_BASE , - .prm =OMAP2430_PRM_BASE , - .cm =OMAP2430_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_243x (void ) -{ -__omap2_set_globals (&omap243x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP3 ) - -static struct omap_globals omap3_globals = { - .class =OMAP343X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), - .sdrc =OMAP343X_SDRC_BASE , - .sms =OMAP343X_SMS_BASE , - .ctrl =OMAP343X_CTRL_BASE , - .prm =OMAP3430_PRM_BASE , - .cm =OMAP3430_CM_BASE , - .uart1_phys =OMAP3_UART1_BASE , - .uart2_phys =OMAP3_UART2_BASE , - .uart3_phys =OMAP3_UART3_BASE , - .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ -}; - -void __init omap2_set_globals_3xxx (void ) -{ -__omap2_set_globals (&omap3_globals); -} - -void __init omap3_map_io (void ) -{ -omap2_set_globals_3xxx (); -omap34xx_map_common_io (); -} -#endif - -#if defined(CONFIG_ARCH_OMAP4 ) -static struct omap_globals omap4_globals = { - .class =OMAP443X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), - .ctrl =OMAP443X_SCM_BASE , - .ctrl_pad =OMAP443X_CTRL_BASE , - .prm =OMAP4430_PRM_BASE , - .cm =OMAP4430_CM_BASE , - .cm2 =OMAP4430_CM2_BASE , - .uart1_phys =OMAP4_UART1_BASE , - .uart2_phys =OMAP4_UART2_BASE , - .uart3_phys =OMAP4_UART3_BASE , - .uart4_phys =OMAP4_UART4_BASE , -}; - -void __init omap2_set_globals_443x (void ) -{ -omap2_set_globals_tap (&omap4_globals); -omap2_set_globals_control (&omap4_globals); -omap2_set_globals_prcm (&omap4_globals); -omap2_set_globals_uart (&omap4_globals); -} -#endif -arch/arm/plat-omap/devices.c +0
-1@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h> arch/arm/plat-omap/sram.c +0
-4@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h" @@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) -#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300 --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/10 OMAP: split plat-omap/common.c
Quoted 45 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Cousson, Benoit
Sent: Monday, October 04, 2010 2:39 PM
To: Paul Walmsley
Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 08/10] OMAP: splitplat-omap/common.cHi Paul,
Quoted 9 lines · Paul Walmsley
Split
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;2. the OMAP2+ common code, which has been moved to
mach-omap2/common.c;3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation
function.
Quoted 2 lines
The primary motivation for doing this is to move the OMAP2+-specific
parts
Quoted 5 lines
into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
Signed-off-by Paul Walmsley<[email protected]>---
<...>
arch/arm/plat-
Quoted 1 line
arch/arm/plat- renamed from arch/arm/plat-omap/32ksynctimer.c +0
-0
omap/32ksynctimer.carch/arm/plat-omap/32ksynctimer.c line 2
Quoted 7 lines
new file mode 100644
index 0000000..b7f458carch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?
Quoted 5 lines
If this file is dedicated for the 32k sync timer, maybe we should now use the new OMAP4 name: "
counter_32k".Noboby knows what the sync stand for, and at the end this is just a 32k counter. Hence the new name :-)
One of the points to be kept in mind while naming is that we are able to relate our driver easily to the hardware device. In this regard the TRM terms this module as 32-kHz Synchronized Timer. Therefore we should be careful in our naming. With regard to the meaning of the word here is the extract from the TRM.
OMAP4430 ES2.0 TRM
...
The sync logic ensures the read transaction correctness by synchronizing the counter register read access on 32KSYNCNT_ICLK because the 32KSYNCNT_ICLK clock signal is completely asynchronous with S32KSYNCNT_FCLK.
...
Quoted 570 lines
Benoit
Quoted 30 lines
arch/arm/plat-omap/32ksynctimer.c new file +30
-0+* +* OMAP clocksource-related code +* +* Copyright (C) 2009 Texas Instruments +* Copyright (C) 2010 Nokia Corporation +* Tony Lindgren<[email protected]> +* Added OMAP4 support - Santosh Shilimkar<[email protected]> +* Paul Walmsley +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ +#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> + +#include <plat/clock.h> + + +/* +* 32KHz clocksource ... always available, on pretty most chips except +* OMAP 730 and 1510. Other timers could be used as clocksources, with +* higher resolution in free-running counter modes (e.g. 12 MHz xtal), +* but systems won't necessarily want to spend resources that way. +*/ arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ +#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 + +#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) + +#include <linux/clocksource.h> + +/* +* offset_32k holds the init time counter value. It is then subtracted +* from every counter read to achieve a counter that counts time from the
Quoted 64 lines
arch/arm/plat-omap/32ksynctimer.c new file +64
-0+* kernel boot (needed for sched_clock()). +*/ +static u32 offset_32k__read_mostly ; + +#ifdef CONFIG_ARCH_OMAP16XX +static cycle_t omap16xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; +} +#else +#define omap16xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2420 +static cycle_t omap2420_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2420_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2430 +static cycle_t omap2430_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2430_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP3 +static cycle_t omap34xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap34xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP4 +static cycle_t omap44xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap44xx_32k_read NULL +#endif + +/* +* Kernel assumes that sched_clock can be called early but may not have +* things ready yet. +*/ +static cycle_t omap_32k_read_dummy (struct clocksource *cs) +{ +return 0 ; +} + +static struct clocksource clocksource_32k = { + .name ="32k_counter" , + .rating =250 , + .read = omap_32k_read_dummy, + .mask =CLOCKSOURCE_MASK (32 ), + .shift =10 ,arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ .flags = CLOCK_SOURCE_IS_CONTINUOUS, +}; + +/* +* Returns current time from boot in nsecs. It's OK for this to wrap +* around for now, as it's just a relative time stamp. +*/ +unsigned long long sched_clock (void ) +{ +return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
arch/arm/plat-omap/32ksynctimer.c line 117
Quoted 1 line
arch/arm/plat-omap/32ksynctimer.c new file +1
-0+ clocksource_32k.mult,clocksource_32k.shift);
Quoted 13 lines
arch/arm/plat-omap/32ksynctimer.c new file +13
-0+} + +/** +* read_persistent_clock - Return time from a persistent clock. +* +* Reads the time from a source which isn't disabled during PM, the +* 32k sync timer. Convert the cycles elapsed since last read into +* nsecs and adds to a monotonically increasing timespec. +*/ +static struct timespec persistent_ts; +static cycles_t cycles, last_cycles; +void read_persistent_clock (struct timespec *ts) +{arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+unsigned long long nsecs; +cycles_t delta; +struct timespec *tsp =&persistent_ts; + + last_cycles = cycles; + cycles = clocksource_32k.read (&clocksource_32k); + delta = cycles - last_cycles; + + nsecs = clocksource_cyc2ns(delta, + clocksource_32k.mult,clocksource_32k.shift);
Quoted 33 lines
arch/arm/plat-omap/32ksynctimer.c new file +33
-0+ +timespec_add_ns (tsp, nsecs); + *ts = *tsp; +} + +static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ()) + clocksource_32k.read = omap16xx_32k_read; +else if (cpu_is_omap2420 ()) + clocksource_32k.read = omap2420_32k_read; +else if (cpu_is_omap2430 ()) + clocksource_32k.read = omap2430_32k_read; +else if (cpu_is_omap34xx ()) + clocksource_32k.read = omap34xx_32k_read; +else if (cpu_is_omap44xx ()) + clocksource_32k.read = omap44xx_32k_read; +else +return -ENODEV ; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift); +arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ offset_32k = clocksource_32k.read (&clocksource_32k); + +if (clocksource_register (&clocksource_32k)) + printk(err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); + +#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */Quoted 68 lines
arch/arm/plat-omap/32ksynctimer.c new file +1
-0+arch/arm/plat-omap/Makefile +1
-1@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o 32ksynctimer.o obj-m := obj-n := obj- :=arch/arm/plat-omap/common.c +0
-30@@ -11,38 +11,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> -#include <linux/delay.h> -#include <linux/console.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/serial_reg.h> -#include <linux/clk.h> #include <linux/io.h> #include <linux/omapfb.h> -#include <mach/hardware.h> -#include <asm/system.h> -#include <asm/pgtable.h> -#include <asm/mach/map.h> -#include <asm/setup.h> -#include <plat/common.h> #include <plat/board.h> -#include <plat/control.h> -#include <plat/mux.h> -#include <plat/fpga.h> -#include <plat/serial.h> #include <plat/vram.h> -#include <plat/clock.h> - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) -# include "../mach-omap2/sdrc.h" -#endif #define NO_LENGTH_CHECK 0xffffffff@@ -88,271 +65,3 @@ void __init omap_reserve(void)omapfb_reserve_sdram_memblock ();omap_vram_reserve_sdram_memblock (); } - -/* -* 32KHz clocksource ... always available, on pretty most chips except -* OMAP 730 and 1510. Other timers could be used as clocksources, with -* higher resolution in free-running counter modes (e.g. 12 MHz xtal), -* but systems won't necessarily want to spend resources that way. -*/ arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 107
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- -#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 - -#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) - -#include <linux/clocksource.h> - -/* -* offset_32k holds the init time counter value. It is then subtracted -* from every counter read to achieve a counter that counts time from the
Quoted 64 lines
arch/arm/plat-omap/common.c +0
-64-* kernel boot (needed for sched_clock()). -*/ -static u32 offset_32k__read_mostly ; - -#ifdef CONFIG_ARCH_OMAP16XX -static cycle_t omap16xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; -} -#else -#define omap16xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2420 -static cycle_t omap2420_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2420_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2430 -static cycle_t omap2430_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2430_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP3 -static cycle_t omap34xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap34xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP4 -static cycle_t omap44xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap44xx_32k_read NULL -#endif - -/* -* Kernel assumes that sched_clock can be called early but may not have -* things ready yet. -*/ -static cycle_t omap_32k_read_dummy (struct clocksource *cs) -{ -return 0 ; -} - -static struct clocksource clocksource_32k = { - .name ="32k_counter" , - .rating =250 , - .read = omap_32k_read_dummy, - .mask =CLOCKSOURCE_MASK (32 ), - .shift =10 ,arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- .flags = CLOCK_SOURCE_IS_CONTINUOUS, -}; - -/* -* Returns current time from boot in nsecs. It's OK for this to wrap -* around for now, as it's just a relative time stamp. -*/ -unsigned long long sched_clock (void ) -{ -return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 182
Quoted 1 line
arch/arm/plat-omap/common.c +0
-1- clocksource_32k.mult,clocksource_32k.shift);
Quoted 13 lines
arch/arm/plat-omap/common.c +0
-13-} - -/** -* read_persistent_clock - Return time from a persistent clock. -* -* Reads the time from a source which isn't disabled during PM, the -* 32k sync timer. Convert the cycles elapsed since last read into -* nsecs and adds to a monotonically increasing timespec. -*/ -static struct timespec persistent_ts; -static cycles_t cycles, last_cycles; -void read_persistent_clock (struct timespec *ts) -{arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10-unsigned long long nsecs; -cycles_t delta; -struct timespec *tsp =&persistent_ts; - - last_cycles = cycles; - cycles = clocksource_32k.read (&clocksource_32k); - delta = cycles - last_cycles; - - nsecs = clocksource_cyc2ns(delta, - clocksource_32k.mult,clocksource_32k.shift);
Quoted 33 lines
arch/arm/plat-omap/common.c +0
-33- -timespec_add_ns (tsp, nsecs); - *ts = *tsp; -} - -static int __init omap_init_clocksource_32k (void ) -{ -static char err[]__initdata =KERN_ERR -"%s: can't register clocksource!\n" ; - -if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { -struct clk *sync_32k_ick; - -if (cpu_is_omap16xx ()) - clocksource_32k.read = omap16xx_32k_read; -else if (cpu_is_omap2420 ()) - clocksource_32k.read = omap2420_32k_read; -else if (cpu_is_omap2430 ()) - clocksource_32k.read = omap2430_32k_read; -else if (cpu_is_omap34xx ()) - clocksource_32k.read = omap34xx_32k_read; -else if (cpu_is_omap44xx ()) - clocksource_32k.read = omap44xx_32k_read; -else -return -ENODEV ; - - sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); -if (sync_32k_ick) -clk_enable (sync_32k_ick); - - clocksource_32k.mult =clocksource_hz2mult (32768 , - clocksource_32k.shift); -arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- offset_32k = clocksource_32k.read (&clocksource_32k); - -if (clocksource_register (&clocksource_32k)) - printk(err, clocksource_32k.name); - } -return 0 ; -} -arch_initcall (omap_init_clocksource_32k); - -#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 6 lines
arch/arm/plat-omap/common.c +0
-6- -/* Global address base setup code */ - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) - -static void __init __omap2_set_globals(struct omap_globals
*omap2_globals)Quoted 130 lines
arch/arm/plat-omap/common.c +0
-104-{ -omap2_set_globals_tap (omap2_globals); -omap2_set_globals_sdrc (omap2_globals); -omap2_set_globals_control (omap2_globals); -omap2_set_globals_prcm (omap2_globals); -omap2_set_globals_uart (omap2_globals); -} - -#endif - -#if defined(CONFIG_ARCH_OMAP2420 ) - -static struct omap_globals omap242x_globals = { - .class =OMAP242X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), - .sdrc =OMAP2420_SDRC_BASE , - .sms =OMAP2420_SMS_BASE , - .ctrl =OMAP242X_CTRL_BASE , - .prm =OMAP2420_PRM_BASE , - .cm =OMAP2420_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_242x (void ) -{ -__omap2_set_globals (&omap242x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP2430 ) - -static struct omap_globals omap243x_globals = { - .class =OMAP243X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), - .sdrc =OMAP243X_SDRC_BASE , - .sms =OMAP243X_SMS_BASE , - .ctrl =OMAP243X_CTRL_BASE , - .prm =OMAP2430_PRM_BASE , - .cm =OMAP2430_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_243x (void ) -{ -__omap2_set_globals (&omap243x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP3 ) - -static struct omap_globals omap3_globals = { - .class =OMAP343X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), - .sdrc =OMAP343X_SDRC_BASE , - .sms =OMAP343X_SMS_BASE , - .ctrl =OMAP343X_CTRL_BASE , - .prm =OMAP3430_PRM_BASE , - .cm =OMAP3430_CM_BASE , - .uart1_phys =OMAP3_UART1_BASE , - .uart2_phys =OMAP3_UART2_BASE , - .uart3_phys =OMAP3_UART3_BASE , - .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ -}; - -void __init omap2_set_globals_3xxx (void ) -{ -__omap2_set_globals (&omap3_globals); -} - -void __init omap3_map_io (void ) -{ -omap2_set_globals_3xxx (); -omap34xx_map_common_io (); -} -#endif - -#if defined(CONFIG_ARCH_OMAP4 ) -static struct omap_globals omap4_globals = { - .class =OMAP443X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), - .ctrl =OMAP443X_SCM_BASE , - .ctrl_pad =OMAP443X_CTRL_BASE , - .prm =OMAP4430_PRM_BASE , - .cm =OMAP4430_CM_BASE , - .cm2 =OMAP4430_CM2_BASE , - .uart1_phys =OMAP4_UART1_BASE , - .uart2_phys =OMAP4_UART2_BASE , - .uart3_phys =OMAP4_UART3_BASE , - .uart4_phys =OMAP4_UART4_BASE , -}; - -void __init omap2_set_globals_443x (void ) -{ -omap2_set_globals_tap (&omap4_globals); -omap2_set_globals_control (&omap4_globals); -omap2_set_globals_prcm (&omap4_globals); -omap2_set_globals_uart (&omap4_globals); -} -#endif -arch/arm/plat-omap/devices.c +0
-1@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h> arch/arm/plat-omap/sram.c +0
-2@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h" arch/arm/plat-omap/sram.c line 67
Quoted 2 lines
arch/arm/plat-omap/sram.c +0
-0@@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2
OMAP2_L3_IO_ADDRESS(0x68012880)arch/arm/plat-omap/sram.c line 68
Quoted 1 line
arch/arm/plat-omap/sram.c +0
-0#define OMAP34XX_VA_SMS_RG_ATT0
OMAP2_L3_IO_ADDRESS(0x6C000048)Quoted 10 lines
arch/arm/plat-omap/sram.c +0
-2-#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300 --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 8/10 OMAP: split plat-omap/common.c
Hi Tarun,
Quoted 45 lines · Tarun Kanti
Quoted 45 lines
-----Original Message-----
From: linux-omap-owner at vger.kernel.org [mailto:linux-omap- owner at vger.kernel.org] On Behalf Of Cousson, Benoit
Sent: Monday, October 04, 2010 2:39 PM
To: Paul Walmsley
Cc: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org
Subject: Re: [PATCH 08/10] OMAP: splitplat-omap/common.cHi Paul,
Quoted 9 lines · Paul Walmsley
Split
plat-omap/common.cinto three pieces:1. the 32KiHz sync timer and clocksource code, which now lives in
plat-omap/32ksynctimer.c;2. the OMAP2+ common code, which has been moved to
mach-omap2/common.c;3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation
function.
Quoted 2 lines
The primary motivation for doing this is to move the OMAP2+-specific
parts
Quoted 5 lines
into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
Signed-off-by Paul Walmsley<[email protected]>---
<...>
arch/arm/plat-
Quoted 1 line
arch/arm/plat- renamed from arch/arm/plat-omap/32ksynctimer.c +0
-0
omap/32ksynctimer.carch/arm/plat-omap/32ksynctimer.c line 2
Quoted 7 lines
new file mode 100644
index 0000000..b7f458carch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?
Quoted 6 lines
Quoted 5 lines
If this file is dedicated for the 32k sync timer, maybe we should now use the new OMAP4 name: "
counter_32k".Noboby knows what the sync stand for, and at the end this is just a 32k counter. Hence the new name :-)
One of the points to be kept in mind while naming is that we are able to relate our driver easily to the hardware device. In this regard the TRM terms this module as 32-kHz Synchronized Timer. Therefore we should be careful in our naming. With regard to the meaning of the word here is the extract from the TRM.
The TRM will have to be fixed anyway to stick to the new convention. We are just anticipating in order to avoid changing that again for the next revision.
Quoted 4 lines
OMAP4430 ES2.0 TRM
...
The sync logic ensures the read transaction correctness by synchronizing the counter register read access on 32KSYNCNT_ICLK because the 32KSYNCNT_ICLK clock signal is completely asynchronous withS32KSYNCNT_FCLK.
Thanks, but if this is where the sync came from, then this is the case for all modules with a very slow functional clock or even as soon as the fclk is not derived from its iclk.
This is not a functionality, it is just how it should be implemented.
Regards,
Benoit
Quoted 572 lines
...
Quoted 570 lines
Benoit
Quoted 30 lines
+ *
+ * OMAP clocksource-related code
+ *
+ * Copyright (C) 2009 Texas Instruments
+ * Copyright (C) 2010 Nokia Corporation
+ * Tony Lindgren<[email protected]>
+ * Added OMAP4 support - Santosh Shilimkar<[email protected]>
+ * Paul Walmsley
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */arch/arm/plat-omap/32ksynctimer.c new file +17
-0+#include <linux/kernel.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/io.h> + +#include <plat/common.h> +#include <plat/board.h> + +#include <plat/clock.h> + + +/* +* 32KHz clocksource ... always available, on pretty most chips except +* OMAP 730 and 1510. Other timers could be used as clocksources, with +* higher resolution in free-running counter modes (e.g. 12 MHz xtal), +* but systems won't necessarily want to spend resources that way. +*/ arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ +#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 + +#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) + +#include <linux/clocksource.h> + +/* +* offset_32k holds the init time counter value. It is then subtracted +* from every counter read to achieve a counter that counts time from the
Quoted 64 lines
+ * kernel boot (needed for
sched_clock()).
+ */arch/arm/plat-omap/32ksynctimer.c new file +62
-0+static u32 offset_32k__read_mostly ; + +#ifdef CONFIG_ARCH_OMAP16XX +static cycle_t omap16xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; +} +#else +#define omap16xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2420 +static cycle_t omap2420_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2420_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP2430 +static cycle_t omap2430_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap2430_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP3 +static cycle_t omap34xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap34xx_32k_read NULL +#endif + +#ifdef CONFIG_ARCH_OMAP4 +static cycle_t omap44xx_32k_read (struct clocksource *cs) +{ +return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; +} +#else +#define omap44xx_32k_read NULL +#endif + +/* +* Kernel assumes that sched_clock can be called early but may not have +* things ready yet. +*/ +static cycle_t omap_32k_read_dummy (struct clocksource *cs) +{ +return 0 ; +} + +static struct clocksource clocksource_32k = { + .name ="32k_counter" , + .rating =250 , + .read = omap_32k_read_dummy, + .mask =CLOCKSOURCE_MASK (32 ), + .shift =10 ,arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ .flags = CLOCK_SOURCE_IS_CONTINUOUS, +}; + +/* +* Returns current time from boot in nsecs. It's OK for this to wrap +* around for now, as it's just a relative time stamp. +*/ +unsigned long long sched_clock (void ) +{ +return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
Quoted 1 line
+ clocksource_32k.mult,
clocksource_32k.shift);
Quoted 13 lines
arch/arm/plat-omap/32ksynctimer.c new file +13
-0+} + +/** +* read_persistent_clock - Return time from a persistent clock. +* +* Reads the time from a source which isn't disabled during PM, the +* 32k sync timer. Convert the cycles elapsed since last read into +* nsecs and adds to a monotonically increasing timespec. +*/ +static struct timespec persistent_ts; +static cycles_t cycles, last_cycles; +void read_persistent_clock (struct timespec *ts) +{arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+unsigned long long nsecs; +cycles_t delta; +struct timespec *tsp =&persistent_ts; + + last_cycles = cycles; + cycles = clocksource_32k.read (&clocksource_32k); + delta = cycles - last_cycles; + + nsecs = clocksource_cyc2ns(delta, + clocksource_32k.mult,clocksource_32k.shift);
Quoted 33 lines
arch/arm/plat-omap/32ksynctimer.c new file +33
-0+ +timespec_add_ns (tsp, nsecs); + *ts = *tsp; +} + +static int __init omap_init_clocksource_32k (void ) +{ +static char err[]__initdata =KERN_ERR +"%s: can't register clocksource!\n" ; + +if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { +struct clk *sync_32k_ick; + +if (cpu_is_omap16xx ()) + clocksource_32k.read = omap16xx_32k_read; +else if (cpu_is_omap2420 ()) + clocksource_32k.read = omap2420_32k_read; +else if (cpu_is_omap2430 ()) + clocksource_32k.read = omap2430_32k_read; +else if (cpu_is_omap34xx ()) + clocksource_32k.read = omap34xx_32k_read; +else if (cpu_is_omap44xx ()) + clocksource_32k.read = omap44xx_32k_read; +else +return -ENODEV ; + + sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); +if (sync_32k_ick) +clk_enable (sync_32k_ick); + + clocksource_32k.mult =clocksource_hz2mult (32768 , + clocksource_32k.shift); +arch/arm/plat-omap/32ksynctimer.c
Quoted 10 lines
arch/arm/plat-omap/32ksynctimer.c new file +10
-0+ offset_32k = clocksource_32k.read (&clocksource_32k); + +if (clocksource_register (&clocksource_32k)) + printk(err, clocksource_32k.name); + } +return 0 ; +} +arch_initcall (omap_init_clocksource_32k); + +#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */Quoted 68 lines
arch/arm/plat-omap/32ksynctimer.c new file +1
-0+arch/arm/plat-omap/Makefile +1
-1@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o 32ksynctimer.o obj-m := obj-n := obj- :=arch/arm/plat-omap/common.c +0
-30@@ -11,38 +11,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> -#include <linux/delay.h> -#include <linux/console.h> -#include <linux/serial.h> -#include <linux/tty.h> -#include <linux/serial_8250.h> -#include <linux/serial_reg.h> -#include <linux/clk.h> #include <linux/io.h> #include <linux/omapfb.h> -#include <mach/hardware.h> -#include <asm/system.h> -#include <asm/pgtable.h> -#include <asm/mach/map.h> -#include <asm/setup.h> -#include <plat/common.h> #include <plat/board.h> -#include <plat/control.h> -#include <plat/mux.h> -#include <plat/fpga.h> -#include <plat/serial.h> #include <plat/vram.h> -#include <plat/clock.h> - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) -# include "../mach-omap2/sdrc.h" -#endif #define NO_LENGTH_CHECK 0xffffffff@@ -88,271 +65,3 @@ void __init omap_reserve(void)omapfb_reserve_sdram_memblock ();omap_vram_reserve_sdram_memblock (); } - -/* -* 32KHz clocksource ... always available, on pretty most chips except -* OMAP 730 and 1510. Other timers could be used as clocksources, with -* higher resolution in free-running counter modes (e.g. 12 MHz xtal), -* but systems won't necessarily want to spend resources that way. -*/ arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 107
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- -#define OMAP16XX_TIMER_32K_SYNCHRONIZED 0xfffbc410 - -#if !(defined(CONFIG_ARCH_OMAP730 ) || defined(CONFIG_ARCH_OMAP15XX )) - -#include <linux/clocksource.h> - -/* -* offset_32k holds the init time counter value. It is then subtracted -* from every counter read to achieve a counter that counts time from the
Quoted 64 lines
arch/arm/plat-omap/common.c +0
-64-* kernel boot (needed for sched_clock()). -*/ -static u32 offset_32k__read_mostly ; - -#ifdef CONFIG_ARCH_OMAP16XX -static cycle_t omap16xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP16XX_TIMER_32K_SYNCHRONIZED ) - offset_32k; -} -#else -#define omap16xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2420 -static cycle_t omap2420_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2420_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2420_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP2430 -static cycle_t omap2430_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP2430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap2430_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP3 -static cycle_t omap34xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP3430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap34xx_32k_read NULL -#endif - -#ifdef CONFIG_ARCH_OMAP4 -static cycle_t omap44xx_32k_read (struct clocksource *cs) -{ -return omap_readl (OMAP4430_32KSYNCT_BASE +0x10 ) - offset_32k; -} -#else -#define omap44xx_32k_read NULL -#endif - -/* -* Kernel assumes that sched_clock can be called early but may not have -* things ready yet. -*/ -static cycle_t omap_32k_read_dummy (struct clocksource *cs) -{ -return 0 ; -} - -static struct clocksource clocksource_32k = { - .name ="32k_counter" , - .rating =250 , - .read = omap_32k_read_dummy, - .mask =CLOCKSOURCE_MASK (32 ), - .shift =10 ,arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- .flags = CLOCK_SOURCE_IS_CONTINUOUS, -}; - -/* -* Returns current time from boot in nsecs. It's OK for this to wrap -* around for now, as it's just a relative time stamp. -*/ -unsigned long long sched_clock (void ) -{ -return clocksource_cyc2ns(clocksource_32k.read(&clocksource_32k),
arch/arm/plat-omap/common.c void __init omap_reserve(void) · line 182
Quoted 1 line
arch/arm/plat-omap/common.c +0
-1- clocksource_32k.mult,clocksource_32k.shift);
Quoted 13 lines
arch/arm/plat-omap/common.c +0
-13-} - -/** -* read_persistent_clock - Return time from a persistent clock. -* -* Reads the time from a source which isn't disabled during PM, the -* 32k sync timer. Convert the cycles elapsed since last read into -* nsecs and adds to a monotonically increasing timespec. -*/ -static struct timespec persistent_ts; -static cycles_t cycles, last_cycles; -void read_persistent_clock (struct timespec *ts) -{arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10-unsigned long long nsecs; -cycles_t delta; -struct timespec *tsp =&persistent_ts; - - last_cycles = cycles; - cycles = clocksource_32k.read (&clocksource_32k); - delta = cycles - last_cycles; - - nsecs = clocksource_cyc2ns(delta, - clocksource_32k.mult,clocksource_32k.shift);
Quoted 33 lines
arch/arm/plat-omap/common.c +0
-33- -timespec_add_ns (tsp, nsecs); - *ts = *tsp; -} - -static int __init omap_init_clocksource_32k (void ) -{ -static char err[]__initdata =KERN_ERR -"%s: can't register clocksource!\n" ; - -if (cpu_is_omap16xx () ||cpu_class_is_omap2 ()) { -struct clk *sync_32k_ick; - -if (cpu_is_omap16xx ()) - clocksource_32k.read = omap16xx_32k_read; -else if (cpu_is_omap2420 ()) - clocksource_32k.read = omap2420_32k_read; -else if (cpu_is_omap2430 ()) - clocksource_32k.read = omap2430_32k_read; -else if (cpu_is_omap34xx ()) - clocksource_32k.read = omap34xx_32k_read; -else if (cpu_is_omap44xx ()) - clocksource_32k.read = omap44xx_32k_read; -else -return -ENODEV ; - - sync_32k_ick =clk_get (NULL ,"omap_32ksync_ick" ); -if (sync_32k_ick) -clk_enable (sync_32k_ick); - - clocksource_32k.mult =clocksource_hz2mult (32768 , - clocksource_32k.shift); -arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 10 lines
arch/arm/plat-omap/common.c +0
-10- offset_32k = clocksource_32k.read (&clocksource_32k); - -if (clocksource_register (&clocksource_32k)) - printk(err, clocksource_32k.name); - } -return 0 ; -} -arch_initcall (omap_init_clocksource_32k); - -#endif /* !(defined(CONFIG_ARCH_OMAP730) ||
defined(CONFIG_ARCH_OMAP15XX)) */arch/arm/plat-omap/common.c void __init omap_reserve(void)
Quoted 6 lines
arch/arm/plat-omap/common.c +0
-6- -/* Global address base setup code */ - -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 ) - -static void __init __omap2_set_globals(struct omap_globals
*omap2_globals)Quoted 130 lines
arch/arm/plat-omap/common.c +0
-104-{ -omap2_set_globals_tap (omap2_globals); -omap2_set_globals_sdrc (omap2_globals); -omap2_set_globals_control (omap2_globals); -omap2_set_globals_prcm (omap2_globals); -omap2_set_globals_uart (omap2_globals); -} - -#endif - -#if defined(CONFIG_ARCH_OMAP2420 ) - -static struct omap_globals omap242x_globals = { - .class =OMAP242X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x48014000 ), - .sdrc =OMAP2420_SDRC_BASE , - .sms =OMAP2420_SMS_BASE , - .ctrl =OMAP242X_CTRL_BASE , - .prm =OMAP2420_PRM_BASE , - .cm =OMAP2420_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_242x (void ) -{ -__omap2_set_globals (&omap242x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP2430 ) - -static struct omap_globals omap243x_globals = { - .class =OMAP243X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4900a000 ), - .sdrc =OMAP243X_SDRC_BASE , - .sms =OMAP243X_SMS_BASE , - .ctrl =OMAP243X_CTRL_BASE , - .prm =OMAP2430_PRM_BASE , - .cm =OMAP2430_CM_BASE , - .uart1_phys =OMAP2_UART1_BASE , - .uart2_phys =OMAP2_UART2_BASE , - .uart3_phys =OMAP2_UART3_BASE , -}; - -void __init omap2_set_globals_243x (void ) -{ -__omap2_set_globals (&omap243x_globals); -} -#endif - -#if defined(CONFIG_ARCH_OMAP3 ) - -static struct omap_globals omap3_globals = { - .class =OMAP343X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (0x4830A000 ), - .sdrc =OMAP343X_SDRC_BASE , - .sms =OMAP343X_SMS_BASE , - .ctrl =OMAP343X_CTRL_BASE , - .prm =OMAP3430_PRM_BASE , - .cm =OMAP3430_CM_BASE , - .uart1_phys =OMAP3_UART1_BASE , - .uart2_phys =OMAP3_UART2_BASE , - .uart3_phys =OMAP3_UART3_BASE , - .uart4_phys =OMAP3_UART4_BASE ,/* Only on 3630 */ -}; - -void __init omap2_set_globals_3xxx (void ) -{ -__omap2_set_globals (&omap3_globals); -} - -void __init omap3_map_io (void ) -{ -omap2_set_globals_3xxx (); -omap34xx_map_common_io (); -} -#endif - -#if defined(CONFIG_ARCH_OMAP4 ) -static struct omap_globals omap4_globals = { - .class =OMAP443X_CLASS , - .tap =OMAP2_L4_IO_ADDRESS (OMAP443X_SCM_BASE ), - .ctrl =OMAP443X_SCM_BASE , - .ctrl_pad =OMAP443X_CTRL_BASE , - .prm =OMAP4430_PRM_BASE , - .cm =OMAP4430_CM_BASE , - .cm2 =OMAP4430_CM2_BASE , - .uart1_phys =OMAP4_UART1_BASE , - .uart2_phys =OMAP4_UART2_BASE , - .uart3_phys =OMAP4_UART3_BASE , - .uart4_phys =OMAP4_UART4_BASE , -}; - -void __init omap2_set_globals_443x (void ) -{ -omap2_set_globals_tap (&omap4_globals); -omap2_set_globals_control (&omap4_globals); -omap2_set_globals_prcm (&omap4_globals); -omap2_set_globals_uart (&omap4_globals); -} -#endif -arch/arm/plat-omap/devices.c +0
-1@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h> arch/arm/plat-omap/sram.c +0
-2@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h" arch/arm/plat-omap/sram.c line 67
Quoted 2 lines
arch/arm/plat-omap/sram.c +0
-0@@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2
OMAP2_L3_IO_ADDRESS(0x68012880)arch/arm/plat-omap/sram.c line 68
Quoted 1 line
arch/arm/plat-omap/sram.c +0
-0#define OMAP34XX_VA_SMS_RG_ATT0
OMAP2_L3_IO_ADDRESS(0x6C000048)Quoted 10 lines
arch/arm/plat-omap/sram.c +0
-2-#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300 --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
In reply to Cousson, BenoitQuoted 7 lines · Benoit
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 5 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?
Thanks, that's a bug.
Quoted 5 lines
If this file is dedicated for the 32k sync timer, maybe we should now use the new OMAP4 name: "
counter_32k".Noboby knows what the sync stand for, and at the end this is just a 32k counter. Hence the new name :-)
Yep, let's use counter_32k.c.
- Paul
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 12 lines · Paul Walmsley
Quoted 7 lines · Benoit
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 5 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?Thanks, that's a bug.
Quoted 7 lines
Quoted 5 lines
If this file is dedicated for the 32k sync timer, maybe we should now use the new OMAP4 name: "
counter_32k".Noboby knows what the sync stand for, and at the end this is just a 32k counter. Hence the new name :-)
Yep, let's use
counter_32k.c.
Here's the updated patch:
- Paul
Quoted 1 line
From
38a26f5b30116df2f0f82acdae3b0a5f8aa25ac7Mon Sep 17 00:00:00 2001
From: Paul Walmsley <[email protected]>
Date: Fri, 1 Oct 2010 15:46:44 -0600
Subject: [PATCH] OMAP: split plat-omap/common.c
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Split plat-omap/common.c into three pieces:
1. the 32KiHz sync timer and clocksource code, which now lives in plat-omap/counter_32k.c;
2. the OMAP2+ common code, which has been moved to mach-omap2/common.c;
3. and the remainder of the OMAP-wide common code, which includes the deprecated ATAGs code and a deprecated video RAM reservation function.
The primary motivation for doing this is to move the OMAP2+-specific parts into an OMAP2+-specific file, so that build breakage related to the System Control Module code can be resolved.
Beno?t Cousson <[email protected]> suggested a new filename and found some bugs in the counter_32k.c comments - thanks Beno?t.
--- arch/arm/mach-omap2/Makefile | 3 +- arch/arm/mach-omap2/common.c | 137 ++++++++++++++++++ arch/arm/plat-omap/Makefile | 2 +- arch/arm/plat-omap/common.c | 291 -------------------------------------- arch/arm/plat-omap/counter_32k.c | 183 ++++++++++++++++++++++++ arch/arm/plat-omap/devices.c | 1 - arch/arm/plat-omap/sram.c | 3 - 7 files changed, 323 insertions(+), 297 deletions(-) create mode 100644 arch/arm/mach-omap2/common.c create mode 100644 arch/arm/plat-omap/counter_32k.c
arch/arm/mach-omap2/Makefile +2 -1
@@ -3,7 +3,8 @@ # # Common support -obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o +obj-y := id.o io.o control.o mux.o devices.o serial.o gpmc.o timer-gp.o pm.o \ + common.o omap-2-3-common = irq.o sdrc.o prm2xxx_3xxx.o hwmod-common = omap_hwmod.o \
arch/arm/mach-omap2/common.c new file +137 -0
137 lines not on this page · raw message
arch/arm/plat-omap/Makefile +1 -1
@@ -4,7 +4,7 @@ # Common support obj-y := common.o sram.o clock.o devices.o dma.o mux.o gpio.o \ - usb.o fb.o io.o + usb.o fb.o io.o counter_32k.o obj-m := obj-n := obj- :=
arch/arm/plat-omap/common.c +0 -291
309 lines not on this page · raw message
arch/arm/plat-omap/counter_32k.c new file +183 -0
183 lines not on this page · raw message
arch/arm/plat-omap/devices.c +0 -1
@@ -21,7 +21,6 @@#include <asm/mach/map.h> #include <plat/tc.h> -#include <plat/control.h> #include <plat/board.h> #include <plat/mmc.h> #include <mach/gpio.h>
arch/arm/plat-omap/sram.c +0 -3
@@ -30,8 +30,6 @@#include <plat/cpu.h> #include <plat/vram.h> -#include <plat/control.h> -#if defined(CONFIG_ARCH_OMAP2 ) || defined(CONFIG_ARCH_OMAP3 )# include "../mach-omap2/prm.h" # include "../mach-omap2/cm.h"
@@ -68,7 +66,6 @@#define OMAP34XX_VA_WRITEPERM0 OMAP2_L3_IO_ADDRESS(0x68012858)#define OMAP34XX_VA_ADDR_MATCH2 OMAP2_L3_IO_ADDRESS(0x68012880)#define OMAP34XX_VA_SMS_RG_ATT0 OMAP2_L3_IO_ADDRESS(0x6C000048) -#define OMAP34XX_VA_CONTROL_STAT OMAP2_L4_IO_ADDRESS(0x480022F0)#define GP_DEVICE 0x300
Signature · 1 line
1.7.1
PATCH 8/10 OMAP: split plat-omap/common.c
In reply to Paul WalmsleyHello.
Quoted 9 lines · Paul Walmsley
Quoted 7 lines
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 5 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?Thanks, that's a bug.
And also note that filenames in heading comments have been long discouraged.
WBR, Sergei
Paul Walmsley
maintainerPATCH 8/10 OMAP: split plat-omap/common.c
Quoted 12 lines · Sergei Shtylyov
Hello.
Quoted 7 lines · Paul Walmsley
Quoted 7 lines
arch/arm/plat-omap/32ksynctimer.c line 2
Quoted 5 lines
arch/arm/plat-omap/32ksynctimer.c new file +2
-0@@ -0,0 +1,184 @@ +/* +* linux/arch/arm/plat-omap/clocksource.c What name do you want to use?
32ksynctimer.corclocksource.c?
Quoted 4 lines
Quoted 1 line
Thanks, that's a bug.
And also note that filenames in heading comments have been long
discouraged.
Yeah, I dropped that from the updated patch, that was a pointless attempt at consistency with the old code.
- Paul
Paul Walmsley
maintainerPATCH 9/10 OMAP: control: move plat-omap/control.h to mach-omap2/control.h
In reply to Paul WalmsleyOnly OMAP2+ platforms have the System Control Module (SCM) IP block. In the past, we've kept the SCM header file in plat-omap. This has led to abuse - device drivers including it; includes being added that create implicit dependencies on OMAP2+ builds; etc.
In response, move the SCM headers into mach-omap2/.
As part of this, remove the direct SCM access from the OMAP UDC driver. It was clearly broken. The UDC code needs an indepth review for use on OMAP2+ chips.
---
arch/arm/mach-omap2/board-3430sdp.c | 2 +-
arch/arm/mach-omap2/board-4430sdp.c | 3 ++-
arch/arm/mach-omap2/board-am3517evm.c | 2 +-
arch/arm/mach-omap2/board-apollon.c | 2 +-
arch/arm/mach-omap2/board-cm-t3517.c | 2 +-
arch/arm/mach-omap2/board-h4.c | 2 +-
arch/arm/mach-omap2/board-ldp.c | 2 +-
arch/arm/mach-omap2/board-omap3logic.c | 2 +-
arch/arm/mach-omap2/board-omap4panda.c | 4 ++--
arch/arm/mach-omap2/clock2420_data.c | 2 +-
arch/arm/mach-omap2/clock2430_data.c | 2 +-
arch/arm/mach-omap2/clock3xxx_data.c | 2 +-
arch/arm/mach-omap2/clock44xx_data.c | 2 +-
arch/arm/mach-omap2/common.c | 2 +-
arch/arm/mach-omap2/control.c | 3 ++-
arch/arm/mach-omap2/control.h | 16 ++++++++--------
arch/arm/mach-omap2/cpuidle34xx.c | 2 +-
arch/arm/mach-omap2/devices.c | 3 +--
arch/arm/mach-omap2/hsmmc.c | 2 +-
arch/arm/mach-omap2/id.c | 3 ++-
arch/arm/mach-omap2/mcbsp.c | 4 +++-
arch/arm/mach-omap2/mux.c | 8 +++-----
arch/arm/mach-omap2/pm24xx.c | 2 +-
arch/arm/mach-omap2/pm34xx.c | 2 +-
arch/arm/mach-omap2/prcm.c | 2 +-
arch/arm/mach-omap2/serial.c | 2 +-
arch/arm/mach-omap2/sleep34xx.S | 2 +-
arch/arm/mach-omap2/usb-fs.c | 6 +++---
arch/arm/plat-omap/mcbsp.c | 1 -
drivers/usb/gadget/omap_udc.c | 18 ++++--------------
30 files changed, 49 insertions(+), 58 deletions(-)
rename arch/arm/{plat-omap/include/plat/control.h => mach-omap2/control.h} (97%)arch/arm/mach-omap2/board-3430sdp.c +1 -1
@@ -39,7 +39,6 @@#include <plat/gpmc.h> #include <plat/display.h> -#include <plat/control.h> #include <plat/gpmc-smc91x.h> #include <mach/board-flash.h>
@@ -48,6 +47,7 @@#include "sdram-qimonda-hyb18m512160af-6.h" #include "hsmmc.h" #include "pm.h" +#include "control.h" #define CONFIG_DISABLE_HFCLK 1
arch/arm/mach-omap2/board-4430sdp.c +2 -1
@@ -32,11 +32,12 @@#include <plat/board.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/timer-gp.h> #include <plat/usb.h> #include <plat/mmc.h> +#include "hsmmc.h" +#include "control.h" #define ETH_KS8851_IRQ 34#define ETH_KS8851_POWER_ON 48
arch/arm/mach-omap2/board-am3517evm.c +1 -1
@@ -32,11 +32,11 @@#include <plat/board.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/usb.h> #include <plat/display.h> #include "mux.h" +#include "control.h" #define AM35XX_EVM_PHY_MASK (0xF)#define AM35XX_EVM_MDIO_FREQUENCY (1000000)
arch/arm/mach-omap2/board-apollon.c +1 -1
@@ -39,9 +39,9 @@#include <plat/board.h> #include <plat/common.h> #include <plat/gpmc.h> -#include <plat/control.h> #include "mux.h" +#include "control.h" /* LED & Switch macros */ #define LED0_GPIO13 13
arch/arm/mach-omap2/board-cm-t3517.c +1 -1
@@ -40,7 +40,6 @@#include <plat/board.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/usb.h> #include <plat/nand.h> #include <plat/gpmc.h>
@@ -48,6 +47,7 @@#include <mach/am35xx.h> #include "mux.h" +#include "control.h" #if defined(CONFIG_LEDS_GPIO ) || defined(CONFIG_LEDS_GPIO_MODULE ) static struct gpio_led cm_t3517_leds[] = {
arch/arm/mach-omap2/board-h4.c +1 -1
@@ -31,7 +31,6 @@#include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <plat/control.h> #include <mach/gpio.h> #include <plat/usb.h> #include <plat/board.h>
@@ -42,6 +41,7 @@#include <plat/gpmc.h> #include "mux.h" +#include "control.h" #define H4_FLASH_CS 0#define H4_SMC91X_CS 1
arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -42,11 +42,11 @@#include <mach/board-zoom.h> #include <asm/delay.h> -#include <plat/control.h> #include <plat/usb.h> #include "mux.h" #include "hsmmc.h" +#include "control.h" #define LDP_SMSC911X_CS 1#define LDP_SMSC911X_GPIO 152
arch/arm/mach-omap2/board-omap3logic.c +1 -1
@@ -35,6 +35,7 @@#include "mux.h" #include "hsmmc.h" +#include "control.h" #include <plat/mux.h> #include <plat/board.h>
@@ -43,7 +44,6 @@#include <plat/gpmc.h> #include <plat/timer-gp.h> #include <plat/sdrc.h> -#include <plat/control.h> #define OMAP3LOGIC_SMSC911X_CS 1
arch/arm/mach-omap2/board-omap4panda.c +2 -2
@@ -34,12 +34,12 @@#include <plat/board.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/timer-gp.h> #include <plat/usb.h> #include <plat/mmc.h> -#include "hsmmc.h" +#include "hsmmc.h" +#include "control.h" static struct gpio_led gpio_leds[] = { {
arch/arm/mach-omap2/clock2420_data.c +1 -1
@@ -18,7 +18,6 @@#include <linux/list.h> #include <plat/clkdev_omap.h> -#include <plat/control.h> #include "clock.h" #include "clock2xxx.h"
@@ -28,6 +27,7 @@#include "prm-regbits-24xx.h" #include "cm-regbits-24xx.h" #include "sdrc.h" +#include "control.h" #define OMAP_CM_REGADDR OMAP2420_CM_REGADDR
arch/arm/mach-omap2/clock2430_data.c +1 -1
@@ -18,7 +18,6 @@#include <linux/list.h> #include <plat/clkdev_omap.h> -#include <plat/control.h> #include "clock.h" #include "clock2xxx.h"
@@ -28,6 +27,7 @@#include "prm-regbits-24xx.h" #include "cm-regbits-24xx.h" #include "sdrc.h" +#include "control.h" #define OMAP_CM_REGADDR OMAP2430_CM_REGADDR
arch/arm/mach-omap2/clock3xxx_data.c +1 -1
@@ -20,7 +20,6 @@#include <linux/clk.h> #include <linux/list.h> -#include <plat/control.h> #include <plat/clkdev_omap.h> #include "clock.h"
@@ -33,6 +32,7 @@#include "cm-regbits-34xx.h" #include "prm.h" #include "prm-regbits-34xx.h" +#include "control.h" /* * clocks
arch/arm/mach-omap2/clock44xx_data.c +1 -1
@@ -26,7 +26,6 @@#include <linux/kernel.h> #include <linux/list.h> #include <linux/clk.h> -#include <plat/control.h> #include <plat/clkdev_omap.h> #include "clock.h"
@@ -35,6 +34,7 @@#include "cm-regbits-44xx.h" #include "prm.h" #include "prm-regbits-44xx.h" +#include "control.h" /* Root clocks */
arch/arm/mach-omap2/common.c +1 -1
@@ -20,12 +20,12 @@#include <plat/common.h> #include <plat/board.h> -#include <plat/control.h> #include <plat/mux.h> #include <plat/clock.h> #include "sdrc.h" +#include "control.h" /* Global address base setup code */
arch/arm/mach-omap2/control.c +2 -1
@@ -16,13 +16,14 @@#include <linux/io.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/sdrc.h> +#include "cm-regbits-34xx.h" #include "prm-regbits-34xx.h" #include "cm.h" #include "prm.h" #include "sdrc.h" +#include "control.h" static void __iomem *omap2_ctrl_base;static void __iomem *omap4_ctrl_pad_base;
arch/arm/mach-omap2/control.h renamed from arch/arm/plat-omap/include/plat/control.h +8 -8
@@ -1,10 +1,10 @@/* -* arch/arm/plat-omap/include/mach/control.h +* arch/arm/mach-omap2/control.h * * OMAP2/3/4 System Control Module definitions * -* Copyright (C) 2007-2009 Texas Instruments, Inc. -* Copyright (C) 2007-2008 Nokia Corporation +* Copyright (C) 2007-2010 Texas Instruments, Inc. +* Copyright (C) 2007-2008, 2010 Nokia Corporation * * Written by Paul Walmsley *
@@ -13,8 +13,8 @@* the Free Software Foundation. */ -#ifndef __ASM_ARCH_CONTROL_H -#define __ASM_ARCH_CONTROL_H +#ifndef __ARCH_ARM_MACH_OMAP2_CONTROL_H +#define __ARCH_ARM_MACH_OMAP2_CONTROL_H#include <mach/io.h> #include <mach/ctrl_module_core_44xx.h>
@@ -321,12 +321,12 @@#define FEAT_L2CACHE_256KB 3#define OMAP3_ISP_SHIFT 5 -#define OMAP3_ISP_MASK (1<< OMAP3_ISP_SHIFT) +#define OMAP3_ISP_MASK (1 << OMAP3_ISP_SHIFT)#define FEAT_ISP 0#define FEAT_ISP_NONE 1#define OMAP3_NEON_SHIFT 4 -#define OMAP3_NEON_MASK (1<< OMAP3_NEON_SHIFT) +#define OMAP3_NEON_MASK (1 << OMAP3_NEON_SHIFT)#define FEAT_NEON 0#define FEAT_NEON_NONE 1
@@ -364,5 +364,5 @@ extern void omap3_control_restore_context(void);#endif #endif /* __ASSEMBLY__ */ -#endif /* __ASM_ARCH_CONTROL_H */ +#endif /* __ARCH_ARM_MACH_OMAP2_CONTROL_H */
arch/arm/mach-omap2/cpuidle34xx.c +1 -1
@@ -29,10 +29,10 @@#include <plat/irqs.h> #include <plat/powerdomain.h> #include <plat/clockdomain.h> -#include <plat/control.h> #include <plat/serial.h> #include "pm.h" +#include "control.h" #ifdef CONFIG_CPU_IDLE
arch/arm/mach-omap2/devices.c +1 -2
@@ -9,7 +9,6 @@* (at your option) any later version. */ -#include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h>
@@ -22,7 +21,6 @@#include <asm/mach/map.h> #include <asm/pmu.h> -#include <plat/control.h> #include <plat/tc.h> #include <plat/board.h> #include <mach/gpio.h>
@@ -30,6 +28,7 @@#include <plat/dma.h> #include "mux.h" +#include "control.h" #if defined(CONFIG_VIDEO_OMAP2 ) || defined(CONFIG_VIDEO_OMAP2_MODULE )
arch/arm/mach-omap2/hsmmc.c +1 -1
@@ -14,11 +14,11 @@#include <linux/string.h> #include <linux/delay.h> #include <mach/hardware.h> -#include <plat/control.h> #include <plat/mmc.h> #include <plat/omap-pm.h> #include "hsmmc.h" +#include "control.h" #if defined(CONFIG_MMC_OMAP_HS ) || defined(CONFIG_MMC_OMAP_HS_MODULE )
arch/arm/mach-omap2/id.c +2 -1
@@ -22,11 +22,12 @@#include <asm/cputype.h> #include <plat/common.h> -#include <plat/control.h> #include <plat/cpu.h> #include <mach/id.h> +#include "control.h" +static struct omap_chip_id omap_chip;static unsigned int omap_revision;
arch/arm/mach-omap2/mcbsp.c +3 -1
@@ -22,7 +22,9 @@#include <plat/dma.h> #include <plat/cpu.h> #include <plat/mcbsp.h> -#include <plat/control.h> + +#include "control.h" +/* McBSP internal signal muxing functions */
arch/arm/mach-omap2/mux.c +3 -5
@@ -23,12 +23,11 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#include <linux/module.h> +#include <linux/kernel.h> #include <linux/init.h> #include <linux/io.h> -#include <linux/slab.h> -#include <linux/spinlock.h> #include <linux/list.h> +#include <linux/slab.h> #include <linux/ctype.h> #include <linux/debugfs.h> #include <linux/seq_file.h>
@@ -36,8 +35,7 @@#include <asm/system.h> -#include <plat/control.h> - +#include "control.h" #include "mux.h" #define OMAP_MUX_BASE_OFFSET 0x30/* Offset from CTRL_BASE */
arch/arm/mach-omap2/pm24xx.c +1 -1
@@ -38,7 +38,6 @@#include <mach/irqs.h> #include <plat/clock.h> #include <plat/sram.h> -#include <plat/control.h> #include <plat/dma.h> #include <plat/board.h>
@@ -48,6 +47,7 @@#include "cm-regbits-24xx.h" #include "sdrc.h" #include "pm.h" +#include "control.h" #include <plat/powerdomain.h> #include <plat/clockdomain.h>
arch/arm/mach-omap2/pm34xx.c +1 -1
@@ -32,7 +32,6 @@#include <plat/sram.h> #include <plat/clockdomain.h> #include <plat/powerdomain.h> -#include <plat/control.h> #include <plat/serial.h> #include <plat/sdrc.h> #include <plat/prcm.h>
@@ -48,6 +47,7 @@#include "prm.h" #include "pm.h" #include "sdrc.h" +#include "control.h" /* Scratchpad offsets */ #define OMAP343X_TABLE_ADDRESS_OFFSET 0x31
arch/arm/mach-omap2/prcm.c +1 -1
@@ -26,7 +26,6 @@#include <plat/common.h> #include <plat/prcm.h> #include <plat/irqs.h> -#include <plat/control.h> #include "clock.h" #include "clock2xxx.h"
@@ -34,6 +33,7 @@#include "prm.h" #include "prm-regbits-24xx.h" #include "prm-regbits-44xx.h" +#include "control.h" static void __iomem *prm_base;static void __iomem *cm_base;
arch/arm/mach-omap2/serial.c +1 -1
@@ -28,11 +28,11 @@#include <plat/common.h> #include <plat/board.h> #include <plat/clock.h> -#include <plat/control.h> #include "prm.h" #include "pm.h" #include "prm-regbits-34xx.h" +#include "control.h" #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV 0x52#define UART_OMAP_WER 0x17/* Wake-up enable register */
arch/arm/mach-omap2/sleep34xx.S +1 -1
@@ -27,11 +27,11 @@ #include <linux/linkage.h> #include <asm/assembler.h> #include <mach/io.h> -#include <plat/control.h> #include "cm.h" #include "prm.h" #include "sdrc.h" +#include "control.h" #define SDRC_SCRATCHPAD_SEM_V 0xfa00291c
arch/arm/mach-omap2/usb-fs.c +3 -3
@@ -29,18 +29,18 @@#include <asm/irq.h> -#include <plat/control.h> #include <plat/usb.h> #include <plat/board.h> +#include "control.h" +#include "mux.h" +#define INT_USB_IRQ_GEN INT_24XX_USB_IRQ_GEN#define INT_USB_IRQ_NISO INT_24XX_USB_IRQ_NISO#define INT_USB_IRQ_ISO INT_24XX_USB_IRQ_ISO#define INT_USB_IRQ_HGEN INT_24XX_USB_IRQ_HGEN#define INT_USB_IRQ_OTG INT_24XX_USB_IRQ_OTG -#include "mux.h" -#if defined(CONFIG_ARCH_OMAP2 )#ifdef CONFIG_USB_GADGET_OMAP
arch/arm/plat-omap/mcbsp.c +0 -1
@@ -27,7 +27,6 @@#include <plat/dma.h> #include <plat/mcbsp.h> -#include <plat/control.h> #include "../mach-omap2/cm-regbits-34xx.h"
drivers/usb/gadget/omap_udc.c +4 -14
@@ -54,7 +54,6 @@#include <plat/dma.h> #include <plat/usb.h> -#include <plat/control.h> #include "omap_udc.h"
@@ -2309,21 +2308,12 @@ static char *trx_mode(unsigned m, int enabled)static int proc_otg_show (struct seq_file *s) {u32 tmp; -u32 trans; -char *ctrl_name; +u32 trans =0 ; +char *ctrl_name ="(UNKNOWN)" ; +/* XXX This needs major revision for OMAP2+ */ tmp =omap_readl (OTG_REV ); -if (cpu_is_omap24xx ()) { -/* -* REVISIT: Not clear how this works on OMAP2. trans -* is ANDed to produce bits 7 and 8, which might make -* sense for USB_TRANSCEIVER_CTRL on OMAP1, -* but with CONTROL_DEVCONF, these bits have something to -* do with the frame adjustment counter and McBSP2. -*/ - ctrl_name ="control_devconf" ; - trans =omap_ctrl_readl (OMAP2_CONTROL_DEVCONF0 ); - }else { +if (cpu_class_is_omap1 ()) { ctrl_name ="tranceiver_ctrl" ; trans =omap_readw (USB_TRANSCEIVER_CTRL ); }
Paul Walmsley
maintainerPATCH 10/10 OMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks
In reply to Paul WalmsleyReduce the amount of debugging generated by default when unused clocks are being disabled by the clock code. The previous code would only generate debug-level messages, but some people who wished to run production kernels with debug-level messages enabled reported that the large number of clock disable messages were slowing boot. Now to enable clock-by-clock disable messages, DEBUG needs to be defined in mach-omap2/clock.c.
--- arch/arm/mach-omap2/clock.c | 2 +- arch/arm/plat-omap/clock.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/clock.c +1 -1
@@ -395,7 +395,7 @@ void omap2_clk_disable_unused(struct clk *clk)if ((regval32 & (1 << clk->enable_bit)) == v)return ; -printk (KERN_DEBUG "Disabling unused clock \"%s\"\n" , clk->name); +pr_debug ("Disabling unused clock \"%s\"\n" , clk->name);if (cpu_is_omap34xx ()) {omap2_clk_enable (clk);omap2_clk_disable (clk);
arch/arm/plat-omap/clock.c +3 -2
@@ -60,7 +60,7 @@ void clk_disable(struct clk *clk)spin_lock_irqsave (&clockfw_lock, flags);if (clk->usecount ==0 ) { -printk (KERN_ERR "Trying disable clock %s with 0 usecount\n" , +pr_err ("Trying disable clock %s with 0 usecount\n" , clk->name);WARN_ON (1 ); goto out;
@@ -397,6 +397,7 @@ static int __init clk_disable_unused(void)struct clk *ck;unsigned long flags; +pr_info ("clock: disabling unused clocks to save power\n" );list_for_each_entry (ck, &clocks, node) {if (ck->ops == &clkops_null)continue ;
@@ -418,7 +419,7 @@ late_initcall(clk_disable_unused);int __init clk_init (struct clk_functions * custom_clocks) {if (!custom_clocks) { -printk (KERN_ERR "No custom clock functions registered\n" ); +pr_err ("No custom clock functions registered\n" );BUG (); }
cover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
In reply to Paul WalmsleyQuoted 4 lines · On Fri, 01 Oct 2010 15:34:45 -0600 Paul Walmsley <[email protected]> wrote:
mach-omap2 (as the SCM only exists on OMAP2+ systems). The McBSP parent fclk and signal muxing changes have received only light testing, so any help from OMAP ASoc experts here is appreciated.
Looks good to me. I pointed out one bug but as these are already in linux-omap I sent a fix for it and two minor cleanups [1].
Quoted 12 lines
Paul Walmsley (10):
OMAP2+:Kconfig: disallow builds for boards that don't use the currently-selected SoC
OMAP2420: CTRL: fixOMAP242X_CTRL_REGADDRmacro
OMAP2420: clock: addMCBSP_CLKSnode and clkdev aliases
OMAP2430: clock: addMCBSP_CLKSnode and clkdev aliases
OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching
OMAP: McBSP: implement McBSP CLKR and FSR signal muxing viamach-omap2/mcbsp.c
OMAP: McBSP: implement functional clock switching via clock framework
OMAP: splitplat-omap/common.c
OMAP: control: moveplat-omap/control.htomach-omap2/control.hOMAP2+: clock: reduce the amount of standard debugging while disabling unused clocks
Patches 3-5 are doing the right thing AFAIK the OMAP clock framework.
For patches 6-7 you could have my ack.
As they are touching also sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].
http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2
Signature · 2 lines
Jarkko 1. http://marc.info/?l=linux-omap&m=128628175107214&w=2
Tony Lindgren
maintainercover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
Quoted 25 lines · Jarkko Nikula
Quoted 4 lines · On Fri, 01 Oct 2010 15:34:45 -0600 Paul Walmsley <[email protected]> wrote:
mach-omap2 (as the SCM only exists on OMAP2+ systems). The McBSP parent fclk and signal muxing changes have received only light testing, so any help from OMAP ASoc experts here is appreciated.
Looks good to me. I pointed out one bug but as these are already in linux-omap I sent a fix for it and two minor cleanups [1].
Quoted 12 lines
Paul Walmsley (10):
OMAP2+:Kconfig: disallow builds for boards that don't use the currently-selected SoC
OMAP2420: CTRL: fixOMAP242X_CTRL_REGADDRmacro
OMAP2420: clock: addMCBSP_CLKSnode and clkdev aliases
OMAP2430: clock: addMCBSP_CLKSnode and clkdev aliases
OMAP3xxx: clock: add clkdev aliases for McBSP fclk source switching
OMAP: McBSP: implement McBSP CLKR and FSR signal muxing viamach-omap2/mcbsp.c
OMAP: McBSP: implement functional clock switching via clock framework
OMAP: splitplat-omap/common.c
OMAP: control: moveplat-omap/control.htomach-omap2/control.hOMAP2+: clock: reduce the amount of standard debugging while disabling unused clocksPatches 3-5 are doing the right thing AFAIK the OMAP clock framework.
For patches 6-7 you could have my ack.
Quoted 8 lines
Acked-by Jarkko Nikula <[email protected]>As they are touching also
sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2
Sorry, I've already merged them as they fixed code that did not compile.
Let me know if you guys want me to rebuild those parts of omap-for-linus to add the acks.
Tony
cover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
On Tuesday 05 October 2010 21:40:17 ext Tony Lindgren wrote:
...
Quoted 7 lines
Quoted 7 lines
For patches 6-7 you could have my ack.
Acked-by Jarkko Nikula <[email protected]>As they are touching also
sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].
Quoted 7 lines
Quoted 2 lines
http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2Sorry, I've already merged them as they fixed code that did not compile.
Let me know if you guys want me to rebuild those parts of omap-for-linus to add the acks.
If you decide to rebuild, than you can add my (for patch 6-7):
Signature · 1 line
P?ter
Tony Lindgren
maintainercover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
Quoted 14 lines · Peter Ujfalusi
On Tuesday 05 October 2010 21:40:17 ext Tony Lindgren wrote:
...
Quoted 10 lines
Quoted 9 lines
For patches 6-7 you could have my ack.
Acked-by Jarkko Nikula <[email protected]>As they are touching also
sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2
Quoted 7 lines
Quoted 4 lines
Sorry, I've already merged them as they fixed code that did not compile.
Let me know if you guys want me to rebuild those parts of omap-for-linus to add the acks.
If you decide to rebuild, than you can add my (for patch 6-7):
Acked-by Peter Ujfalusi <[email protected]>
OK, let's do that then we should still have some time left before the merge window.
Mark & Liam, care to ack as well?
Regards,
Tony
cover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
Quoted 20 lines · Tony Lindgren
Quoted 19 lines · Peter Ujfalusi
On Tuesday 05 October 2010 21:40:17 ext Tony Lindgren wrote:
...
Quoted 14 lines
Quoted 9 lines
For patches 6-7 you could have my ack.
Acked-by Jarkko Nikula <[email protected]>As they are touching also
sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2Sorry, I've already merged them as they fixed code that did not compile.
Let me know if you guys want me to rebuild those parts of omap-for-linus to add the acks.
Quoted 8 lines
Quoted 2 lines
If you decide to rebuild, than you can add my (for patch 6-7):
Acked-by Peter Ujfalusi <[email protected]>OK, let's do that then we should still have some time left before the merge window.
Mark & Liam, care to ack as well?
Thanks
Liam
Paul Walmsley
maintainercover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
Hi,
Quoted 24 lines · Liam Girdwood
Quoted 23 lines · Tony Lindgren
Quoted 21 lines · Peter Ujfalusi
On Tuesday 05 October 2010 21:40:17 ext Tony Lindgren wrote:
...
Quoted 7 lines
Quoted 7 lines
For patches 6-7 you could have my ack.
Acked-by Jarkko Nikula <[email protected]>As they are touching also
sound/soc/omap/omap-mcbsp.c, an ack from Mark and Liam are needed. Links to patches 6 and 7 below and my fixes on top of them [1].Quoted 7 lines
Quoted 2 lines
http://marc.info/?l=linux-omap&m=128596931117788&w=2
http://marc.info/?l=linux-omap&m=128596931417805&w=2Sorry, I've already merged them as they fixed code that did not compile.
Let me know if you guys want me to rebuild those parts of omap-for-linus to add the acks.
If you decide to rebuild, than you can add my (for patch 6-7):
Acked-by Peter Ujfalusi <[email protected]>
Quoted 7 lines
Quoted 5 lines
OK, let's do that then we should still have some time left before the merge window.
Mark & Liam, care to ack as well?
Acked-by Liam Girdwood <[email protected]>
Okay, acks from Liam, Mark, Peter, and Jarkko have been added to patches 6 and 7. Also, acks from Peter have been added to Jarkko's three patches. Jarkko's three patches have been added on to the original ten. Will send out an updated pull request shortly.
- Paul
cover OMAP: SCM/McBSP/clock: branch integration patches for 2.6.37
In reply to Tony LindgrenQuoted 4 lines · Tony Lindgren
OK, let's do that then we should still have some time left before the merge window.
Mark & Liam, care to ack as well?