Re: [PATCH v2 1/6] SoC Camera: add driver for OMAP1 camera interface
On Wed, 22 Sep 2010, hermann pitton wrote: Am Mittwoch, den 22.09.2010, 01:23 +0200 schrieb Guennadi Liakhovetski: On Sat, 11 Sep 2010, Janusz Krzysztofik wrote: This is a V4L2 driver for TI OMAP1 SoC camera interface. [snip] + + } else { + dev_warn(dev, %s: unhandled camera interrupt, status == + 0x%0x\n, __func__, it_status); Please, don't split strings sorry for any OT interference. But, are there any new rules out? Maybe I missed them. Either way, the above was forced during the last three years. Not at all ? No. Splitting print strings has always been discouraged, because it makes tracking back kernel logs difficult. The reason for this has been the 80 character line length limit, which has now been effectively lifted. I'm sure you can find enough links on the internet for any of these topics. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/5] OMAP4: PM: Update PRCM register bitshits and masks for ES2
Hi Rajendra On Thu, 16 Sep 2010, Rajendra Nayak wrote: This patch updates the PRM and CM register bitshifts and masks for OMAP4430 ES2.0. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com Thanks, queued for 2.6.37 (with the UTF-8 fix in the patch description). One other note: #define OMAP4430_IDLEST_MASK BITFIELD(16, 17) We should really get rid of all these 'BITFIELD' defines, and just replace them with simple bitshifts. Care to spin a patch to do that during the 2.6.38 timeframe? - Paul
Re: [PATCH 2/5] OMAP4: PM: Define additional registers for ES2
On Thu, 16 Sep 2010, Rajendra Nayak wrote: 4430 ES2 has a few new registers added and a few modified from ES1. This patch adds all the register changes in PRM and CM for OMAP4430 ES2. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com Thanks, queued for 2.6.37 (with the UTF-8 fixed here; please fix this on your end) - Paul Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com --- arch/arm/mach-omap2/cm44xx.h | 90 - arch/arm/mach-omap2/prm44xx.h | 14 --- 2 files changed, 96 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h index 336d948..3c35a87 100644 --- a/arch/arm/mach-omap2/cm44xx.h +++ b/arch/arm/mach-omap2/cm44xx.h @@ -195,6 +195,42 @@ #define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET0x0088 #define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088) +/* CM1.RESTORE_CM1 register offsets */ +#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET 0x +#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x) +#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004 +#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004) +#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008 +#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008) +#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c +#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c) +#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010 +#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010) +#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014 +#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014) +#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018 +#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018) +#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c +#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c) +#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020 +#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020) +#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024 +#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024) +#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET0x0028 +#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028) +#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET 0x002c +#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c) +#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET 0x0030 +#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030) +#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034 +#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034) +#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET0x0038 +#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038) +#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET0x003c +#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c) +#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET 0x0040 +#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040) + /* CM2 */ /* CM2.OCP_SOCKET_CM2 register offsets */ @@ -252,8 +288,6 @@ #define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0068) #define OMAP4_CM_SSC_MODFREQDIV_DPLL_PER_OFFSET 0x006c #define OMAP4430_CM_SSC_MODFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x006c) -#define OMAP4_CM_EMU_OVERRIDE_DPLL_PER_OFFSET0x0070 -#define OMAP4430_CM_EMU_OVERRIDE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0070) #define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080 #define OMAP4430_CM_CLKMODE_DPLL_USB OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0080) #define OMAP4_CM_IDLEST_DPLL_USB_OFFSET 0x0084 @@ -296,6 +330,8 @@ #define OMAP4430_CM_ALWON_SR_IVA_CLKCTRL
Re: [PATCH 4/5] OMAP4: powerdomain: Update DSS logic state for ES2
Hi Rajendra, On Thu, 16 Sep 2010, Rajendra Nayak wrote: DSS on ES2 supports only OSWR, hence remove the support for CSWR from the powerdomain framework. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com Thanks, queued for 2.6.37 (with Benoît's name fixed) - Paul
RE: [PATCH 5/5] OMAP4: powerdomain: add context_offset field
-Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:43 AM To: Nayak, Rajendra; Shilimkar, Santosh Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: Re: [PATCH 5/5] OMAP4: powerdomain: add context_offset field Hello Santosh, Rajendra, a few comments on this patch: On Thu, 16 Sep 2010, Rajendra Nayak wrote: From: Santosh Shilimkar santosh.shilim...@ti.com Context register in various power domain is not at same offset on OMAP4. Mainly the CPUx context resgiters againts rest of them. This patch adds a field in power-domain strucures to handle this. This will be needed to make pwrdm_clear_all_prev_pwrst API work on OMAP4. Is the powerdomain.c code that uses context_offset ready yet? If not, it seems best to submit this together with the code that uses it? It's the next series what Rajendra is doing. We can add this one as part of that series if you like. Signed-off-by: Santosh Shilimkar santosh.shilim...@ti.com Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoit Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com --- arch/arm/mach-omap2/powerdomains44xx.h| 14 ++ arch/arm/plat-omap/include/plat/powerdomain.h |1 + 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/powerdomains44xx.h b/arch/arm/mach- omap2/powerdomains44xx.h index 9c01b55..65e919b 100644 --- a/arch/arm/mach-omap2/powerdomains44xx.h +++ b/arch/arm/mach-omap2/powerdomains44xx.h @@ -40,6 +40,7 @@ static struct powerdomain core_44xx_pwrdm = { .pwrsts = PWRSTS_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF_RET, .banks= 5, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_OFF, /* core_nret_bank */ [1] = PWRSTS_OFF_RET, /* core_ocmram */ @@ -64,6 +65,7 @@ static struct powerdomain gfx_44xx_pwrdm = { .omap_chip= OMAP_CHIP_INIT(CHIP_IS_OMAP4430), .pwrsts = PWRSTS_OFF_ON, .banks= 1, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_OFF, /* gfx_mem */ }, @@ -81,6 +83,7 @@ static struct powerdomain abe_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRDM_POWER_OFF, .banks= 2, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_RET, /* aessmem */ [1] = PWRDM_POWER_OFF, /* periphmem */ @@ -100,6 +103,7 @@ static struct powerdomain dss_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF, .banks= 1, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_OFF, /* dss_mem */ }, @@ -117,6 +121,7 @@ static struct powerdomain tesla_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF_RET, .banks= 3, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_RET, /* tesla_edma */ [1] = PWRSTS_OFF_RET, /* tesla_l1 */ @@ -137,6 +142,7 @@ static struct powerdomain wkup_44xx_pwrdm = { .omap_chip= OMAP_CHIP_INIT(CHIP_IS_OMAP4430), .pwrsts = PWRSTS_ON, .banks= 1, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_OFF, /* wkup_bank */ }, @@ -153,6 +159,7 @@ static struct powerdomain cpu0_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF_RET, .banks= 1, + .context_offset = 0x18, .pwrsts_mem_ret = { [0] = PWRSTS_OFF_RET, /* cpu0_l1 */ }, @@ -169,6 +176,7 @@ static struct powerdomain cpu1_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF_RET, .banks= 1, + .context_offset = 0x18, .pwrsts_mem_ret = { [0] = PWRSTS_OFF_RET, /* cpu1_l1 */ }, @@ -184,6 +192,7 @@ static struct powerdomain emu_44xx_pwrdm = { .omap_chip= OMAP_CHIP_INIT(CHIP_IS_OMAP4430), .pwrsts = PWRSTS_OFF_ON, .banks= 1, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRDM_POWER_OFF, /* emu_bank */ }, @@ -200,6 +209,7 @@ static struct powerdomain mpu_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON, .pwrsts_logic_ret = PWRSTS_OFF_RET, .banks= 3, + .context_offset = 0x24, .pwrsts_mem_ret = { [0] = PWRSTS_OFF_RET, /* mpu_l1 */ [1] = PWRSTS_OFF_RET, /* mpu_l2 */ @@ -220,6 +230,7 @@ static struct powerdomain ivahd_44xx_pwrdm = { .pwrsts = PWRSTS_OFF_RET_ON,
RE: [PATCH 2/5] OMAP4: PM: Define additional registers for ES2
-Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:48 AM To: Nayak, Rajendra Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: Re: [PATCH 2/5] OMAP4: PM: Define additional registers for ES2 On Thu, 16 Sep 2010, Rajendra Nayak wrote: 4430 ES2 has a few new registers added and a few modified from ES1. This patch adds all the register changes in PRM and CM for OMAP4430 ES2. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com Thanks, queued for 2.6.37 (with the UTF-8 fixed here; please fix this on your end) Thanks Paul, I'll get the encoding issue fixed. - Paul Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com --- arch/arm/mach-omap2/cm44xx.h | 90 - arch/arm/mach-omap2/prm44xx.h | 14 --- 2 files changed, 96 insertions(+), 8 deletions(-) diff --git a/arch/arm/mach-omap2/cm44xx.h b/arch/arm/mach-omap2/cm44xx.h index 336d948..3c35a87 100644 --- a/arch/arm/mach-omap2/cm44xx.h +++ b/arch/arm/mach-omap2/cm44xx.h @@ -195,6 +195,42 @@ #define OMAP4_CM1_ABE_WDT3_CLKCTRL_OFFSET 0x0088 #define OMAP4430_CM1_ABE_WDT3_CLKCTRL OMAP44XX_CM1_REGADDR(OMAP4430_CM1_ABE_MOD, 0x0088) +/* CM1.RESTORE_CM1 register offsets */ +#define OMAP4_CM_CLKSEL_CORE_RESTORE_OFFSET0x +#define OMAP4430_CM_CLKSEL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x) +#define OMAP4_CM_DIV_M2_DPLL_CORE_RESTORE_OFFSET 0x0004 +#define OMAP4430_CM_DIV_M2_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0004) +#define OMAP4_CM_DIV_M3_DPLL_CORE_RESTORE_OFFSET 0x0008 +#define OMAP4430_CM_DIV_M3_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0008) +#define OMAP4_CM_DIV_M4_DPLL_CORE_RESTORE_OFFSET 0x000c +#define OMAP4430_CM_DIV_M4_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x000c) +#define OMAP4_CM_DIV_M5_DPLL_CORE_RESTORE_OFFSET 0x0010 +#define OMAP4430_CM_DIV_M5_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0010) +#define OMAP4_CM_DIV_M6_DPLL_CORE_RESTORE_OFFSET 0x0014 +#define OMAP4430_CM_DIV_M6_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0014) +#define OMAP4_CM_DIV_M7_DPLL_CORE_RESTORE_OFFSET 0x0018 +#define OMAP4430_CM_DIV_M7_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0018) +#define OMAP4_CM_CLKSEL_DPLL_CORE_RESTORE_OFFSET 0x001c +#define OMAP4430_CM_CLKSEL_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x001c) +#define OMAP4_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE_OFFSET 0x0020 +#define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0020) +#define OMAP4_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE_OFFSET 0x0024 +#define OMAP4430_CM_SSC_MODFREQDIV_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0024) +#define OMAP4_CM_CLKMODE_DPLL_CORE_RESTORE_OFFSET 0x0028 +#define OMAP4430_CM_CLKMODE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0028) +#define OMAP4_CM_SHADOW_FREQ_CONFIG2_RESTORE_OFFSET0x002c +#define OMAP4430_CM_SHADOW_FREQ_CONFIG2_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x002c) +#define OMAP4_CM_SHADOW_FREQ_CONFIG1_RESTORE_OFFSET0x0030 +#define OMAP4430_CM_SHADOW_FREQ_CONFIG1_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0030) +#define OMAP4_CM_AUTOIDLE_DPLL_CORE_RESTORE_OFFSET 0x0034 +#define OMAP4430_CM_AUTOIDLE_DPLL_CORE_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0034) +#define OMAP4_CM_MPU_CLKSTCTRL_RESTORE_OFFSET 0x0038 +#define OMAP4430_CM_MPU_CLKSTCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0038) +#define OMAP4_CM_CM1_PROFILING_CLKCTRL_RESTORE_OFFSET 0x003c +#define OMAP4430_CM_CM1_PROFILING_CLKCTRL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x003c) +#define OMAP4_CM_DYN_DEP_PRESCAL_RESTORE_OFFSET0x0040 +#define OMAP4430_CM_DYN_DEP_PRESCAL_RESTORE OMAP44XX_CM1_REGADDR(OMAP4430_CM1_RESTORE_MOD, 0x0040) + /* CM2 */ /* CM2.OCP_SOCKET_CM2 register offsets */ @@ -252,8 +288,6 @@ #define OMAP4430_CM_SSC_DELTAMSTEP_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0068) #define OMAP4_CM_SSC_MODFREQDIV_DPLL_PER_OFFSET0x006c #define OMAP4430_CM_SSC_MODFREQDIV_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x006c) -#define OMAP4_CM_EMU_OVERRIDE_DPLL_PER_OFFSET 0x0070 -#define OMAP4430_CM_EMU_OVERRIDE_DPLL_PER OMAP44XX_CM2_REGADDR(OMAP4430_CM2_CKGEN_MOD, 0x0070) #define OMAP4_CM_CLKMODE_DPLL_USB_OFFSET 0x0080
RE: [PATCH 1/5] OMAP4: PM: Update PRCM register bitshits and masks for ES2
-Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:47 AM To: Nayak, Rajendra Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: Re: [PATCH 1/5] OMAP4: PM: Update PRCM register bitshits and masks for ES2 Hi Rajendra On Thu, 16 Sep 2010, Rajendra Nayak wrote: This patch updates the PRM and CM register bitshifts and masks for OMAP4430 ES2.0. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com Thanks, queued for 2.6.37 (with the UTF-8 fix in the patch description). One other note: #define OMAP4430_IDLEST_MASK BITFIELD(16, 17) We should really get rid of all these 'BITFIELD' defines, and just replace them with simple bitshifts. Care to spin a patch to do that during the 2.6.38 timeframe? Sure, there's already a patch for this which I guess Benoit should be posting pretty soon. - Paul -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 2/6] OMAP1: Add support for SoC camera interface
That's up to the platform maintainer to review / apply this one, but if you like, a couple of nit-picks from me: On Sat, 11 Sep 2010, Janusz Krzysztofik wrote: This patch adds support for SoC camera interface to OMAP1 devices. Created and tested against linux-2.6.36-rc3 on Amstrad Delta. For successfull compilation, requires a header file provided by PATCH 1/6 from this series, SoC Camera: add driver for OMAP1 camera interface. Signed-off-by: Janusz Krzysztofik jkrzy...@tis.icnet.pl --- v1-v2 changes: - no functional changes, - refreshed against linux-2.6.36-rc3 arch/arm/mach-omap1/devices.c | 43 ++ arch/arm/mach-omap1/include/mach/camera.h |8 + 2 files changed, 51 insertions(+) diff -upr linux-2.6.36-rc3.orig/arch/arm/mach-omap1/devices.c linux-2.6.36-rc3/arch/arm/mach-omap1/devices.c --- linux-2.6.36-rc3.orig/arch/arm/mach-omap1/devices.c 2010-09-03 22:29:00.0 +0200 +++ linux-2.6.36-rc3/arch/arm/mach-omap1/devices.c2010-09-09 18:42:30.0 +0200 @@ -15,6 +15,7 @@ #include linux/platform_device.h #include linux/io.h #include linux/spi/spi.h +#include linux/dma-mapping.h #include mach/hardware.h #include asm/mach/map.h @@ -25,6 +26,7 @@ #include mach/gpio.h #include plat/mmc.h #include plat/omap7xx.h +#include mach/camera.h You might want to try to group headers according to their location, i.e., put mach/... higher - together with mach/gpio.h, also it helps to have headers alphabetically ordered. /*-*/ @@ -191,6 +193,47 @@ static inline void omap_init_spi100k(voi } #endif + +#define OMAP1_CAMERA_BASE0xfffb6800 + +static struct resource omap1_camera_resources[] = { + [0] = { + .start = OMAP1_CAMERA_BASE, + .end= OMAP1_CAMERA_BASE + OMAP1_CAMERA_IOSIZE - 1, + .flags = IORESOURCE_MEM, + }, + [1] = { + .start = INT_CAMERA, + .flags = IORESOURCE_IRQ, + }, +}; + +static u64 omap1_camera_dma_mask = DMA_BIT_MASK(32); + +static struct platform_device omap1_camera_device = { + .name = omap1-camera, + .id = 0, /* This is used to put cameras on this interface */ + .dev= { + .dma_mask = omap1_camera_dma_mask, + .coherent_dma_mask = DMA_BIT_MASK(32), + }, + .num_resources = ARRAY_SIZE(omap1_camera_resources), + .resource = omap1_camera_resources, +}; + +void __init omap1_set_camera_info(struct omap1_cam_platform_data *info) +{ + struct platform_device *dev = omap1_camera_device; + int ret; + + dev-dev.platform_data = info; + + ret = platform_device_register(dev); + if (ret) + dev_err(dev-dev, unable to register device: %d\n, ret); +} + + /*-*/ static inline void omap_init_sti(void) {} diff -upr linux-2.6.36-rc3.orig/arch/arm/mach-omap1/include/mach/camera.h linux-2.6.36-rc3/arch/arm/mach-omap1/include/mach/camera.h --- linux-2.6.36-rc3.orig/arch/arm/mach-omap1/include/mach/camera.h 2010-09-03 22:34:03.0 +0200 +++ linux-2.6.36-rc3/arch/arm/mach-omap1/include/mach/camera.h 2010-09-09 18:42:30.0 +0200 @@ -0,0 +1,8 @@ +#ifndef __ASM_ARCH_CAMERA_H_ +#define __ASM_ARCH_CAMERA_H_ + +#include media/omap1_camera.h + +extern void omap1_set_camera_info(struct omap1_cam_platform_data *); function declarations don't need an extern - something I've also been doing needlessly for a few years... + +#endif /* __ASM_ARCH_CAMERA_H_ */ Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/5] OMAP4: clocks: Update clock tree for ES2
Hi Paul, -Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 10:34 AM To: Nayak, Rajendra Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: Re: [PATCH 3/5] OMAP4: clocks: Update clock tree for ES2 Hello Rajendra, Benoît, On Thu, 16 Sep 2010, Rajendra Nayak wrote: This patch updates the clock tree with all the changes in OMAP4430 ES2. clock nodes added -1- tie_low_clock_ck -2- abe_dpll_bypass_clk_mux_ck clock nodes deleted -1- dpll_sys_ref_clk -2- per_sgx_fclk -3- usbphyocp2scp_ick Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com UTF-8 problem again here... Cc: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com The clock tree resulting from this patch doesn't match the output from the current OMAP4 clock autogen script. Seems like it should. Could you help me understand that? I guess that's mainly because of fixes in the autogen scripts, the patches for which have not yet made it to the list. Regards, Rajendra thanks - Paul -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/5] OMAP4: clocks: Update clock tree for ES2
Hi Rajendra, On Wed, 22 Sep 2010, Nayak, Rajendra wrote: -Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 10:34 AM The clock tree resulting from this patch doesn't match the output from the current OMAP4 clock autogen script. Seems like it should. Could you help me understand that? I guess that's mainly because of fixes in the autogen scripts, the patches for which have not yet made it to the list. OK, thanks, I think I see what's going on. Patch queued for 2.6.37, but hopefully you and Benoît can review the final set of OMAP4 clock patches, since I had to resolve conflicts by hand. Also it is very important to make sure that what we've got in the mainline tree matches exactly what is coming out of the autogenerator... - Paul
RE: [PATCH 3/5] OMAP4: clocks: Update clock tree for ES2
Hi Paul, -Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 12:46 PM To: Nayak, Rajendra Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: RE: [PATCH 3/5] OMAP4: clocks: Update clock tree for ES2 Hi Rajendra, On Wed, 22 Sep 2010, Nayak, Rajendra wrote: -Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 10:34 AM The clock tree resulting from this patch doesn't match the output from the current OMAP4 clock autogen script. Seems like it should. Could you help me understand that? I guess that's mainly because of fixes in the autogen scripts, the patches for which have not yet made it to the list. OK, thanks, I think I see what's going on. Patch queued for 2.6.37, but hopefully you and Benoît can review the final set of OMAP4 clock patches, since I had to resolve conflicts by hand. Also it is very important to make sure that what we've got in the mainline tree matches exactly what is coming out of the autogenerator... I agree, we'll get the scripts and the header in sync very soon by posting most of the pending fixes. Regards, Rajendra - Paul -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 2/7] OMAP4: clock: Fix clock names and align with hwmod names
Hello Benoît, On Thu, 5 Aug 2010, Benoit Cousson wrote: The OMAP4 hwmod data introduced the new naming convention for TI IPs (See patch OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0) The leaf clock names are using the same IP name and thus must be modified to match the clock populated in the hwmod data. - Fix some leaf clocks nodes that were using a _iclk instead of the _fclk prefix. - Fix some wrong interface clock name for master IPs connected to interconnect. Please not that due to the fact that nodes are sorted by name, the name change will introduce a quite ugly diff a little bit hard to follow. Timers clock con_id is still using the old gptX_fck name until the gptimer driver is updated to omap_device framework. Timers entries in hwmods DB are still disabled until the migration if timer to platform_driver + omap_hwmod. Signed-off-by: Benoit Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Rajendra Nayak rna...@ti.com I had to manually resolve conflicts with Rajendra's patch in order to apply this one. Could you please doublecheck it (or at least, the final clock44xx_data.c, after the next patch from you is applied) to help me make sure I didn't mess anything up too badly? (The updated patch is below) - Paul From a9ddb89a380b862e72a65fba0034fb077f873ba6 Mon Sep 17 00:00:00 2001 From: Benoit Cousson b-cous...@ti.com Date: Thu, 5 Aug 2010 17:47:51 +0200 Subject: [PATCH] OMAP4: clock: Fix clock names and align with hwmod names The OMAP4 hwmod data introduced the new naming convention for TI IPs (See patch OMAP4: hwmod: Add partial hwmod support for OMAP4430 ES1.0) The leaf clock names are using the same IP name and thus must be modified to match the clock populated in the hwmod data. - Fix some leaf clocks nodes that were using a _iclk instead of the _fclk prefix. - Fix some wrong interface clock name for master IPs connected to interconnect. Please not that due to the fact that nodes are sorted by name, the name change will introduce a quite ugly diff a little bit hard to follow. Timers clock con_id is still using the old gptX_fck name until the gptimer driver is updated to omap_device framework. Timers entries in hwmods DB are still disabled until the migration if timer to platform_driver + omap_hwmod. Signed-off-by: Benoit Cousson b-cous...@ti.com [p...@pwsan.com: manually resolved conflicts with Rajendra's clock patch] Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Rajendra Nayak rna...@ti.com --- arch/arm/mach-omap2/clock44xx_data.c | 665 -- 1 files changed, 310 insertions(+), 355 deletions(-) diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 6e5a893..401a6c4 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -22,7 +22,6 @@ #include linux/kernel.h #include linux/list.h #include linux/clk.h - #include plat/control.h #include plat/clkdev_omap.h @@ -910,6 +909,7 @@ static struct clk usb_hs_clk_div_ck = { static struct dpll_data dpll_usb_dd = { .mult_div1_reg = OMAP4430_CM_CLKSEL_DPLL_USB, .clk_bypass = usb_hs_clk_div_ck, + .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL, .clk_ref= sys_clkin_ck, .control_reg= OMAP4430_CM_CLKMODE_DPLL_USB, .modes = (1 DPLL_LOW_POWER_BYPASS) | (1 DPLL_LOCKED), @@ -923,7 +923,6 @@ static struct dpll_data dpll_usb_dd = { .max_multiplier = OMAP4430_MAX_DPLL_MULT, .max_divider= OMAP4430_MAX_DPLL_DIV, .min_divider= 1, - .flags = DPLL_J_TYPE | DPLL_NO_DCO_SEL }; @@ -1285,16 +1284,6 @@ static struct clk aess_fck = { .recalc = followparent_recalc, }; -static struct clk cust_efuse_fck = { - .name = cust_efuse_fck, - .ops= clkops_omap2_dflt, - .enable_reg = OMAP4430_CM_CEFUSE_CEFUSE_CLKCTRL, - .enable_bit = OMAP4430_MODULEMODE_SWCTRL, - .clkdm_name = l4_cefuse_clkdm, - .parent = sys_clkin_ck, - .recalc = followparent_recalc, -}; - static struct clk des3des_fck = { .name = des3des_fck, .ops= clkops_omap2_dflt, @@ -1345,6 +1334,16 @@ static struct clk dmic_fck = { .clkdm_name = abe_clkdm, }; +static struct clk dsp_fck = { + .name = dsp_fck, + .ops= clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_TESLA_TESLA_CLKCTRL, + .enable_bit = OMAP4430_MODULEMODE_HWCTRL, + .clkdm_name = tesla_clkdm, + .parent = dpll_iva_m4_ck, + .recalc = followparent_recalc, +}; + static struct clk dss_fck = { .name = dss_fck, .ops= clkops_omap2_dflt, @@ -1355,18 +1354,18 @@ static struct clk dss_fck = { .recalc = followparent_recalc, }; -static struct clk ducati_ick = { -
Re: [PATCH] OMAP4: clock: Fix missing optional clocks
Hi Benoît, On Tue, 21 Sep 2010, Benoit Cousson wrote: Please note that the diff is pretty bad for the clock table. It looks like everything has changed. I don't know if there is a way to have a better diff with git. It's due to an extra tab that somehow got added between the second and third fields of the clkdev table in your patch. I've removed that to reduce the diff noise in the updated patch (forthcoming in a few minutes). - Paul
Re: [PATCH 3/4] omap4: pandaboard: Adding card detect support for MMC1
On Wed, Sep 22, 2010 at 5:24 AM, David Anders x0132...@ti.com wrote: Adding card detect callback function and card detect configuration function for MMC1 Controller. Signed-off-by: David Anders x0132...@ti.com Signed-off-by: Anand Gadiyar gadi...@ti.com --- patch depends on https://patchwork.kernel.org/patch/189952/ arch/arm/mach-omap2/board-omap4panda.c | 7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 697c0bd..94e819c 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -77,9 +77,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) struct omap_mmc_platform_data *pdata = dev-platform_data; /* Setting MMC1 Card detect Irq */ - if (pdev-id == 0) + if (pdev-id == 0) { + ret = twl6030_mmc_card_detect_config(); It looks like we need this function from twl6030 driver, otherwise we will get this compiling error: In file included from arch/arm/mach-omap2/board-omap4panda.c:38: arch/arm/plat-omap/include/plat/usb.h:109: warning: return type defaults to 'int' arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_twl6030_hsmmc_late_init': arch/arm/mach-omap2/board-omap4panda.c:81: error: implicit declaration of function 'twl6030_mmc_card_detect_config' arch/arm/mach-omap2/board-omap4panda.c:86: error: 'twl6030_mmc_card_detect' undeclared (first use in this function) arch/arm/mach-omap2/board-omap4panda.c:86: error: (Each undeclared identifier is reported only once arch/arm/mach-omap2/board-omap4panda.c:86: error: for each function it appears in.) arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_panda_init': arch/arm/mach-omap2/board-omap4panda.c:285: warning: unused variable 'status' Thanks, -Bryan + if (ret) + pr_err(Failed configuring MMC1 card detect\n); pdata-slots[0].card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET; + pdata-slots[0].card_detect = twl6030_mmc_card_detect; + } return ret; } -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP4: clock: Add optional clock nodes
Hi Paul, On 9/22/2010 9:29 AM, Paul Walmsley wrote: Hi Benoît, On Tue, 21 Sep 2010, Benoit Cousson wrote: OMAP4 IP optional clocks require explicit enable in module CTRLCLK register. In order to allow that we have to create artificial clock nodes that represent this clock inputs in the IP. Signed-off-by: Benoit Coussonb-cous...@ti.com Cc: Paul Walmsleyp...@pwsan.com Cc: Kevin Hilmankhil...@deeprootsystems.com Cc: Rajendra Nayakrna...@ti.com Due to the merge conflicts mentioned earlier, this patch had to be manually edited. The updated patch is below - could you and Rajendra doublecheck it (or at least the final clock44xx_data.c, which will be posted in a few minutes) to make sure that I didn't trash anything too badly? Sorry about that, I had the same issue when I migrated this patches to ES2. I probably, have somewhere the version of that patch that apply on top of Rajendra's one. Regards, Benoit thanks, - Paul From 64d45f071b43fa6c5e3ecd99d0058494a708f8a7 Mon Sep 17 00:00:00 2001 From: Benoit Coussonb-cous...@ti.com Date: Tue, 21 Sep 2010 23:10:30 +0200 Subject: [PATCH] OMAP4: clock: Add optional clock nodes OMAP4 IP optional clocks require explicit enable in module CTRLCLK register. In order to allow that we have to create artificial clock nodes that represent this clock inputs in the IP. Signed-off-by: Benoit Coussonb-cous...@ti.com Signed-off-by: Paul Walmsleyp...@pwsan.com Cc: Kevin Hilmankhil...@deeprootsystems.com Cc: Rajendra Nayakrna...@ti.com --- arch/arm/mach-omap2/clock44xx_data.c | 477 +- 1 files changed, 417 insertions(+), 60 deletions(-) diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 401a6c4..d612e55 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -1284,6 +1284,16 @@ static struct clk aess_fck = { .recalc =followparent_recalc, }; +static struct clk bandgap_fclk = { + .name = bandgap_fclk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_WKUP_BANDGAP_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_BGAP_32K_SHIFT, + .clkdm_name = l4_wkup_clkdm, + .parent =sys_32k_ck, + .recalc =followparent_recalc, +}; + static struct clk des3des_fck = { .name = des3des_fck, .ops=clkops_omap2_dflt, @@ -1344,6 +1354,46 @@ static struct clk dsp_fck = { .recalc =followparent_recalc, }; +static struct clk dss_sys_clk = { + .name = dss_sys_clk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_SYS_CLK_SHIFT, + .clkdm_name = l3_dss_clkdm, + .parent =syc_clk_div_ck, + .recalc =followparent_recalc, +}; + +static struct clk dss_tv_clk = { + .name = dss_tv_clk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_TV_CLK_SHIFT, + .clkdm_name = l3_dss_clkdm, + .parent =extalt_clkin_ck, + .recalc =followparent_recalc, +}; + +static struct clk dss_dss_clk = { + .name = dss_dss_clk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_DSSCLK_SHIFT, + .clkdm_name = l3_dss_clkdm, + .parent =dpll_per_m5_ck, + .recalc =followparent_recalc, +}; + +static struct clk dss_48mhz_clk = { + .name = dss_48mhz_clk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_DSS_DSS_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_48MHZ_CLK_SHIFT, + .clkdm_name = l3_dss_clkdm, + .parent =func_48mc_fclk, + .recalc =followparent_recalc, +}; + static struct clk dss_fck = { .name = dss_fck, .ops=clkops_omap2_dflt, @@ -1417,6 +1467,16 @@ static struct clk fpka_fck = { .recalc =followparent_recalc, }; +static struct clk gpio1_dbclk = { + .name = gpio1_dbclk, + .ops=clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_WKUP_GPIO1_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_DBCLK_SHIFT, + .clkdm_name = l4_wkup_clkdm, + .parent =sys_32k_ck, + .recalc =followparent_recalc, +}; + static struct clk gpio1_ick = { .name = gpio1_ick, .ops=clkops_omap2_dflt, @@ -1427,6 +1487,16 @@ static struct clk gpio1_ick = { .recalc =followparent_recalc, }; +static struct clk gpio2_dbclk = { + .name = gpio2_dbclk, + .ops=clkops_omap2_dflt, + .enable_reg =
Re: [PATCH] OMAP4: clock: Fix missing optional clocks
On 9/22/2010 9:25 AM, Paul Walmsley wrote: Hi Benoît, On Tue, 21 Sep 2010, Benoit Cousson wrote: Please note that the diff is pretty bad for the clock table. It looks like everything has changed. I don't know if there is a way to have a better diff with git. It's due to an extra tab that somehow got added between the second and third fields of the clkdev table in your patch. I've removed that to reduce the diff noise in the updated patch (forthcoming in a few minutes). OK, it missed that, this is probably because of our super smart auto aligned tab to the longest string script :-) Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Branch with the recent OMAP4 clock and PRCM patches for testing
Hi Rajendra, Benoît, in case it is useful, here is a branch based on v2.6.36-rc5 with the hwmod fixes included, and the OMAP4 clock/PRCM patches that we've discussed today: git://git.pwsan.com/linux-2.6 omap4_2.6.37 Tomorrow, I will probably keep adding to this branch, but I think I am done for tonight :-) - Paul
RE: [PATCH 5/5] OMAP4: powerdomain: add context_offset field
On Wed, 22 Sep 2010, Shilimkar, Santosh wrote: -Original Message- From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:43 AM To: Nayak, Rajendra; Shilimkar, Santosh Cc: linux-omap@vger.kernel.org; Cousson, Benoit; Kevin Hilman Subject: Re: [PATCH 5/5] OMAP4: powerdomain: add context_offset field Hello Santosh, Rajendra, a few comments on this patch: On Thu, 16 Sep 2010, Rajendra Nayak wrote: From: Santosh Shilimkar santosh.shilim...@ti.com Context register in various power domain is not at same offset on OMAP4. Mainly the CPUx context resgiters againts rest of them. This patch adds a field in power-domain strucures to handle this. This will be needed to make pwrdm_clear_all_prev_pwrst API work on OMAP4. Is the powerdomain.c code that uses context_offset ready yet? If not, it seems best to submit this together with the code that uses it? It's the next series what Rajendra is doing. We can add this one as part of that series if you like. Yep, let's do it that way. regards - Paul -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Branch with the recent OMAP4 clock and PRCM patches for testing
Hi Paul, On 9/22/2010 9:37 AM, Paul Walmsley wrote: Hi Rajendra, Benoît, in case it is useful, here is a branch based on v2.6.36-rc5 with the hwmod fixes included, and the OMAP4 clock/PRCM patches that we've discussed today: git://git.pwsan.com/linux-2.6 omap4_2.6.37 Tomorrow, I will probably keep adding to this branch, but I think I am done for tonight :-) I'll rebase my stuff on top of that, and keep you inform. You can go to bed... meanwhile I'll have a coffee before starting my day. Thanks, Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path
Hi, -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Kevin Hilman Sent: Tuesday, September 14, 2010 4:33 AM To: linux-omap@vger.kernel.org Cc: Varadarajan, Charulatha; Basak, Partha; Tero Kristo Subject: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path From: Kevin Hilman khil...@ti.com Currently, we wait until late in the idle path where interrupts are disabled to do runtime-PM-like management for certain special-case devices like GPIO. As a prerequiste to moving GPIO to the new runtime PM framework, move this runtime-PM-like code out of the late idle path into new device idle and resume functions that can be called before interrupts are disabled by CPUidle and/or suspend. In addition, move all the GPIO-specific logic into the GPIO core instead of keeping GPIO-specific knowledge of power-states, context saving etc. in the PM core. Also, call the new device-idle and -resume methods from CPUidle and static suspend path. Signed-off-by: Kevin Hilman khil...@ti.com --- arch/arm/mach-omap2/cpuidle34xx.c |4 ++ arch/arm/mach-omap2/pm.h |2 + arch/arm/mach-omap2/pm24xx.c |2 +- arch/arm/mach-omap2/pm34xx.c | 38 + arch/arm/plat-omap/gpio.c | 57 arch/arm/plat-omap/include/plat/gpio.h |4 +-- 6 files changed, 67 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0923b82..681d823 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -274,9 +274,13 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, pwrdm_set_next_pwrst(per_pd, per_next_state); select_state: + omap3_device_idle(); + dev-last_state = new_state; ret = omap3_enter_idle(dev, new_state); + omap3_device_resume(); + /* Restore original PER state if it was modified */ if (per_next_state != per_saved_state) pwrdm_set_next_pwrst(per_pd, per_saved_state); diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 3de6ece..33cae4b 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -22,6 +22,8 @@ extern void omap_sram_idle(void); extern int omap3_can_sleep(void); extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_idle_init(void); +extern void omap3_device_idle(void); +extern void omap3_device_resume(void); struct cpuidle_params { u8 valid; diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 6aeedea..7bbf0db 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c @@ -106,7 +106,7 @@ static void omap2_enter_full_retention(void) l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); - omap2_gpio_prepare_for_idle(PWRDM_POWER_RET); + omap2_gpio_prepare_for_idle(); if (omap2_pm_debug) { omap2_pm_dump(0, 0, 0); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index bb2ba1e..9e590d9 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -74,16 +74,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; static struct powerdomain *core_pwrdm, *per_pwrdm; static struct powerdomain *cam_pwrdm; -static inline void omap3_per_save_context(void) -{ - omap_gpio_save_context(); -} - -static inline void omap3_per_restore_context(void) -{ - omap_gpio_restore_context(); -} - static void omap3_enable_io_chain(void) { int timeout = 0; @@ -332,6 +322,16 @@ static void restore_table_entry(void) restore_control_register(control_reg_value); } +void omap3_device_idle(void) +{ + omap2_gpio_prepare_for_idle(); +} + Is not it is a good idea to pass the new_state as the parameter for the driver calls? It will reduce each individual drivers reading the PRCM register to findout the next state. This might save some time in the idle loop. +void omap3_device_resume(void) +{ + omap2_gpio_resume_after_idle(); +} + Here we will need to pass the next_state as well as previous_state as parameters. If we agree to pass the parameters. ~Hema void omap_sram_idle(void) { /* Variable to tell what needs to be saved and restored @@ -344,7 +344,7 @@ void omap_sram_idle(void) int mpu_next_state = PWRDM_POWER_ON; int per_next_state = PWRDM_POWER_ON; int core_next_state = PWRDM_POWER_ON; - int core_prev_state, per_prev_state; + int core_prev_state; u32 sdrc_pwr = 0; if (!_omap_sram_idle) @@ -387,12 +387,9 @@ void omap_sram_idle(void) } /* PER */ - if (per_next_state PWRDM_POWER_ON) { + if (per_next_state PWRDM_POWER_ON) omap_uart_prepare_idle(2); -
Re: [PATCH 3/5] omap3: cm-t3517: add support for usb host.
On 09/21/10 18:26, Gadiyar, Anand wrote: On Tue, Sep 21, 2010 at 9:33 PM, Igor Grinberg grinb...@compulab.co.il wrote: add support for hsusb host ports 1, 2 and on-module usb hub. Signed-off-by: Igor Grinberg grinb...@compulab.co.il --- arch/arm/mach-omap2/board-cm-t3517.c | 50 ++ ... @@ -100,6 +102,47 @@ static void __init cm_t3517_init_rtc(void) static inline void cm_t3517_init_rtc(void) {} #endif +#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE) Hi Igor, Hi Do we really need to make these conditional on the driver being built? This is depends on what are we trying to achieve... I can think of two things: [1] Simple, clear and nice code without ifdefs [2] Smaller kernel, a bit less resources wasted and a bit faster boot time The hardware is present on the board at all times, right? Yes, it is inside the SoC, except for the usb hub. It should be okay to execute this code independent of whether the driver is built or not. The device registration can be unconditional and if there is no driver present, we won't probe anyway. It is ok, but again it depends on what we are trying to achieve here. If we want [1], then indeed we need to remove the ifdefs also inside usb-ehci.c, so pros: * we'll get nice and clean code, cons: * a bit bigger kernel, * floating device without a driver, * a bit resources wasted for this device, * a bit slower startup time (device registration, gpio toggling, etc.). If we want [2], then we'll have the opposite of [1] ;) Personally, I don't mind either way... , but I want the code to be consistent (in this case with usb-ehci.c). (I see some similar logic in usb-ehci.c - probably a good idea to remove it as well). ... - Anand +#define HSUSB1_RESET_GPIO (146) +#define HSUSB2_RESET_GPIO (147) +#define USB_HUB_RESET_GPIO (152) + +static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = { + .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, + .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, + .port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, + + .phy_reset = true, + .reset_gpio_port[0] = HSUSB1_RESET_GPIO, + .reset_gpio_port[1] = HSUSB2_RESET_GPIO, + .reset_gpio_port[2] = -EINVAL, +}; + +static int cm_t3517_init_usbh(void) +{ + int err; + + err = gpio_request(USB_HUB_RESET_GPIO, usb hub rst); + if (err) { + pr_err(CM-T3517: usb hub rst gpio request failed: %d\n, err); + } else { + gpio_direction_output(USB_HUB_RESET_GPIO, 0); + udelay(10); + gpio_set_value(USB_HUB_RESET_GPIO, 1); + msleep(1); + } + + usb_ehci_init(cm_t3517_ehci_pdata); + + return 0; +} +#else +static inline int cm_t3517_init_usbh(void) +{ + return 0; +} +#endif + -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html -- Regards, Igor. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] omap4: pandaboard: Adding card detect support for MMC1
On Wed, Sep 22, 2010 at 12:58 PM, Bryan Wu bryan...@canonical.com wrote: On Wed, Sep 22, 2010 at 5:24 AM, David Anders x0132...@ti.com wrote: Adding card detect callback function and card detect configuration function for MMC1 Controller. Signed-off-by: David Anders x0132...@ti.com Signed-off-by: Anand Gadiyar gadi...@ti.com --- patch depends on https://patchwork.kernel.org/patch/189952/ arch/arm/mach-omap2/board-omap4panda.c | 7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 697c0bd..94e819c 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -77,9 +77,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) struct omap_mmc_platform_data *pdata = dev-platform_data; /* Setting MMC1 Card detect Irq */ - if (pdev-id == 0) + if (pdev-id == 0) { + ret = twl6030_mmc_card_detect_config(); It looks like we need this function from twl6030 driver, otherwise we will get this compiling error: In file included from arch/arm/mach-omap2/board-omap4panda.c:38: arch/arm/plat-omap/include/plat/usb.h:109: warning: return type defaults to 'int' arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_twl6030_hsmmc_late_init': arch/arm/mach-omap2/board-omap4panda.c:81: error: implicit declaration of function 'twl6030_mmc_card_detect_config' arch/arm/mach-omap2/board-omap4panda.c:86: error: 'twl6030_mmc_card_detect' undeclared (first use in this function) arch/arm/mach-omap2/board-omap4panda.c:86: error: (Each undeclared identifier is reported only once arch/arm/mach-omap2/board-omap4panda.c:86: error: for each function it appears in.) arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_panda_init': arch/arm/mach-omap2/board-omap4panda.c:285: warning: unused variable 'status' Thanks, -Bryan I thought the dependent patch [1] took care of this in the header file? (Haven't actually tried this out - will take a look in a bit) [1] https://patchwork.kernel.org/patch/189952/ + if (ret) + pr_err(Failed configuring MMC1 card detect\n); pdata-slots[0].card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET; + pdata-slots[0].card_detect = twl6030_mmc_card_detect; + } return ret; } \ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/4] omap4 hsmmc: Adding card detect support for MMC1
Hi, On Sat, Sep 18, 2010 at 11:33:56AM -0500, kishore kadiyala wrote: @@ -223,6 +224,81 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset) } EXPORT_SYMBOL(twl6030_interrupt_mask); +int twl6030_mmc_card_detect_config(void) +{ + int ret; + u8 reg_val = 0; + + /* Unmasking the Card detect Interrupt line for MMC1 from Phoenix */ + if (twl_class_is_6030()) { which other class can this be ? + /* +* Intially Configuring MMC_CTRL for receving interrupts +* Card status on TWL6030 for MMC1 +*/ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to read MMCCTRL, error %d\n, ret); + return ret; + } + reg_val = ~VMMC_AUTO_OFF; + reg_val |= SW_FC; + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to write MMCCTRL, error %d\n, ret); + return ret; + } + + /* Configuring PullUp-PullDown register */ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); is this a gpio ? Could gpiolib take care of this ? + if (ret 0) { + pr_err(twl6030: Failed to read CFG_INPUT_PUPD3, error %d\n, + ret); + return ret; + } + reg_val = ~(MMC_PU | MMC_PD); + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); ditto. +int twl6030_mmc_card_detect(struct device *dev, int slot) +{ + int ret = -EIO; + u8 read_reg = 0; + struct platform_device *pdev = container_of(dev, + struct platform_device, dev); how about: struct platform_device *pdev = to_platform_device(dev); diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 562dbbb..a51894d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -466,8 +466,6 @@ static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) int ret; if (gpio_is_valid(pdata-slots[0].switch_pin)) { - pdata-suspend = omap_hsmmc_suspend_cdirq; - pdata-resume = omap_hsmmc_resume_cdirq; if (pdata-slots[0].cover) pdata-slots[0].get_cover_state = omap_hsmmc_get_cover_state; @@ -2211,6 +2209,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) Unable to grab MMC CD IRQ\n); goto err_irq_cd; } + pdata-suspend = omap_hsmmc_suspend_cdirq; + pdata-resume = omap_hsmmc_resume_cdirq; this doesn't look to be part of $SUBJECT, care to explain ? @@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); int twl6030_interrupt_mask(u8 bit_mask, u8 offset); +/* Card detect Configuration for MMC1 Controller on OMAP4 */ +#ifdef CONFIG_TWL4030_CORE +int twl6030_mmc_card_detect_config(void); +#else +static inline int twl6030_mmc_card_detect_config(void) +{ + pr_err(twl6030_mmc_card_detect_config not supported\n); pr_debug() would be better ?? +/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */ +#ifdef CONFIG_TWL4030_CORE +int twl6030_mmc_card_detect(struct device *dev, int slot); +#else +static inline int twl6030_mmc_card_detect(struct device *dev, int slot) +{ + pr_err(Call back twl6030_mmc_card_detect not supported\n); ditto. -- balbi -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[GIT PULL] omap2 sparse fixes
Hi Tony, Please pull omap2 sparse fixes from: git://dev.omapzoom.org/pub/scm/manju/kernel-omap3-dev.git sparse_fixes Regards, Manjunath The following changes since commit 8b15575cae7a93a784c3005c42b069edd9ba64dd: Sage Weil (1): fs: {lock,unlock}_flocks() stubs to prepare for BKL removal are available in the git repository at: git://dev.omapzoom.org/pub/scm/manju/kernel-omap3-dev.git sparse_fixes G, Manjunath Kondaiah (10): OMAP: mach-omap2: Fix incorrect assignment warnings OMAP: mach-omap2: Fix static declaration warnings OMAP: mach-omap2: Fix static function warnings OMAP: mach-omap2: Fix miscellaneous sparse warnings OMAP: plat-omap: Fix static function warnings OMAP: NAND: Fix static declaration warning TWL CORE: Fix sparse warning TWL IRQ: Fix fucntion declaration warnings OMAP2/3: Convert write/read functions to raw read/write OMAP3: Keypad: Fix incorrect type initializer arch/arm/mach-omap2/board-3430sdp.c|2 +- arch/arm/mach-omap2/board-am3517evm.c |5 +-- arch/arm/mach-omap2/board-cm-t35.c |2 +- arch/arm/mach-omap2/board-devkit8000.c |2 +- arch/arm/mach-omap2/board-igep0020.c |4 +- arch/arm/mach-omap2/board-ldp.c|2 +- arch/arm/mach-omap2/board-n8x0.c | 16 + arch/arm/mach-omap2/board-omap3evm.c |8 +++--- arch/arm/mach-omap2/board-omap3stalker.c |4 +- arch/arm/mach-omap2/board-omap3touchbook.c |2 +- arch/arm/mach-omap2/board-rx51-peripherals.c |4 ++- arch/arm/mach-omap2/board-rx51-sdram.c |2 +- arch/arm/mach-omap2/board-rx51-video.c |2 + arch/arm/mach-omap2/board-zoom-debugboard.c|2 + arch/arm/mach-omap2/board-zoom-peripherals.c |4 ++- arch/arm/mach-omap2/control.c |5 ++- arch/arm/mach-omap2/gpmc-onenand.c |8 +++--- arch/arm/mach-omap2/include/mach/board-flash.h |2 + arch/arm/mach-omap2/include/mach/board-rx51.h | 11 + arch/arm/mach-omap2/irq.c |1 - arch/arm/mach-omap2/mux2420.c |2 +- arch/arm/mach-omap2/mux2430.c |2 +- arch/arm/mach-omap2/mux34xx.c | 12 +- arch/arm/mach-omap2/pm-debug.c |2 +- arch/arm/mach-omap2/pm34xx.c |2 +- arch/arm/mach-omap2/powerdomain.c | 28 arch/arm/mach-omap2/prcm.c |2 +- arch/arm/mach-omap2/timer-gp.c |1 + arch/arm/plat-omap/cpu-omap.c |4 +- arch/arm/plat-omap/dmtimer.c |6 ++-- arch/arm/plat-omap/fb.c|1 + arch/arm/plat-omap/include/plat/dmtimer.h |4 ++- arch/arm/plat-omap/include/plat/sdrc.h |1 + arch/arm/plat-omap/mcbsp.c | 10 arch/arm/plat-omap/sram.c | 13 ++- drivers/mfd/twl-core.c |2 +- drivers/mtd/nand/omap2.c |6 ++-- drivers/mtd/onenand/omap2.c|2 +- include/linux/i2c/twl.h|5 include/linux/omapfb.h |5 40 files changed, 96 insertions(+), 102 deletions(-) create mode 100644 arch/arm/mach-omap2/include/mach/board-rx51.h-- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe
Hi Dmitry, -Original Message- From: Dmitry Torokhov [mailto:dmitry.torok...@gmail.com] Sent: Tuesday, September 21, 2010 9:57 PM To: G, Manjunath Kondaiah Cc: Ameya Palande; linux-omap@vger.kernel.org; linux-in...@vger.kernel.org; linux-arm-ker...@lists.infradead.org; Tony Lindgren Subject: Re: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe Hi, On Tue, Sep 21, 2010 at 07:11:01PM +0530, G, Manjunath Kondaiah wrote: Hi, -Original Message- From: Ameya Palande [mailto:ameya.pala...@nokia.com] Sent: Tuesday, September 21, 2010 7:04 PM To: G, Manjunath Kondaiah Cc: linux-omap@vger.kernel.org; linux-in...@vger.kernel.org; Dmitry Torokhov; linux-arm-ker...@lists.infradead.org; Tony Lindgren Subject: Re: [PATCH v2] OMAP3: Keypad: Fix failure exit path in probe Hi Manjunath, On Tue, 2010-09-21 at 13:49 +0200, ext G, Manjunath Kondaiah wrote: The failure exit paths seems to be wrong in probe function. This patch corrects exit failure paths for error handling cases. And also adds memory leak... https://patchwork.kernel.org/patch/160551/ Any comments on this? Looks fine. Sorry, I didn't look at the change. This version seems to be better. I do not understand why we need to separate memory allocations. It looks like the minimal patch should be like one below. Thanks. I am ok with this minimal patch. -Manjunath Thanks. -- Dmitry Input: twl4030_keypad - fix error handling path From: Dmitry Torokhov dmitry.torok...@gmail.com We should not try to call free_irq() when request_irq() failed. Reported-by: G, Manjunath Kondaiah manj...@ti.com Signed-off-by: Dmitry Torokhov d...@mail.ru --- drivers/input/keyboard/twl4030_keypad.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index fb16b5e..09bef79 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -406,23 +406,22 @@ static int __devinit twl4030_kp_probe(struct platform_device *pdev) if (error) { dev_info(kp-dbg_dev, request_irq failed for irq no=%d\n, kp-irq); - goto err3; + goto err2; } /* Enable KP and TO interrupts now. */ reg = (u8) ~(KEYP_IMR1_KP | KEYP_IMR1_TO); if (twl4030_kpwrite_u8(kp, reg, KEYP_IMR1)) { error = -EIO; - goto err4; + goto err3; } platform_set_drvdata(pdev, kp); return 0; -err4: +err3: /* mask all events - we don't care about the result */ (void) twl4030_kpwrite_u8(kp, 0xff, KEYP_IMR1); -err3: free_irq(kp-irq, NULL); err2: input_unregister_device(input); -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC 0/3] Improve fallback LPJ calculation
Adding Tony and Linux-OMAP cc:, as this patchset was written specifically with the OMAP in mind (thread rooted at http://lkml.org/lkml/2010/9/10/104 ). Any comments would be appreciated. Phil On 10/09/10 11:54 +0200, Carmody Phil.2 (EXT-Ixonos/Helsinki) wrote: The motivation for patch 2/3 is that currently our OMAP calibrates itself using the trial-and-error binary chop fallback that some other architectures no longer need to perform. This is a lengthy process, taking 0.2s in an environment where boot time is of great interest. The patch has two optimisations. Firstly, it replaces the initial repeated-doubling to find the relevant power of 2 with a tight loop that just does as much as it can in a jiffy. Secondly, it doesn't binary chop over an entire power of 2 range, it choses a much smaller range based on how much it squeezed in, and failed to squeeze in, during the first stage. Both are significant optimisations, and bring our calibration down from 23 jiffies to 6, and, in the process, arrive at a more accurate lpj value. The 'bands' and 'sub-logarithmic' growth may look over-engineered, but they cost a small level of in inaccuracy of the initial guess (for all architectures) in order to avoid the very large inaccuracies that appeared during testing (on x86_64 architectures, and presumably others with less metronomic operation). Note that due to the existence of the TSC and other timers, the x86_64 doesn't use this fallback routine, but I wanted to code defensively, able to cope with all kinds of processor behaviours. 1/3 is simply cosmetic to prepare for 2/3. 3/3 is simply to assist testing and not intended for integration. I would appreciate it if people with exotic or unusual architectures could help test this. Cheers, Phil -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2 1/4] omap4 hsmmc: Adding card detect support for MMC1
Hi balbi, On Wed, Sep 22, 2010 at 2:21 PM, Felipe Balbi ba...@ti.com wrote: Hi, On Sat, Sep 18, 2010 at 11:33:56AM -0500, kishore kadiyala wrote: @@ -223,6 +224,81 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset) } EXPORT_SYMBOL(twl6030_interrupt_mask); +int twl6030_mmc_card_detect_config(void) +{ + int ret; + u8 reg_val = 0; + + /* Unmasking the Card detect Interrupt line for MMC1 from Phoenix */ + if (twl_class_is_6030()) { which other class can this be ? It can only be a 6030 class. as twl6030_mmc_card_detect_config is called only in board file I can remove the check. + /* + * Intially Configuring MMC_CTRL for receving interrupts + * Card status on TWL6030 for MMC1 + */ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to read MMCCTRL, error %d\n, ret); + return ret; + } + reg_val = ~VMMC_AUTO_OFF; + reg_val |= SW_FC; + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to write MMCCTRL, error %d\n, ret); + return ret; + } + + /* Configuring PullUp-PullDown register */ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); is this a gpio ? Could gpiolib take care of this ? This is not a gpio but an interrupt line from twl6030 to MMC controller + if (ret 0) { + pr_err(twl6030: Failed to read CFG_INPUT_PUPD3, error %d\n, + ret); + return ret; + } + reg_val = ~(MMC_PU | MMC_PD); + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); ditto. This is not a gpio +int twl6030_mmc_card_detect(struct device *dev, int slot) +{ + int ret = -EIO; + u8 read_reg = 0; + struct platform_device *pdev = container_of(dev, + struct platform_device, dev); how about: struct platform_device *pdev = to_platform_device(dev); ok will use this . diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 562dbbb..a51894d 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -466,8 +466,6 @@ static int omap_hsmmc_gpio_init(struct omap_mmc_platform_data *pdata) int ret; if (gpio_is_valid(pdata-slots[0].switch_pin)) { - pdata-suspend = omap_hsmmc_suspend_cdirq; - pdata-resume = omap_hsmmc_resume_cdirq; if (pdata-slots[0].cover) pdata-slots[0].get_cover_state = omap_hsmmc_get_cover_state; @@ -2211,6 +2209,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) Unable to grab MMC CD IRQ\n); goto err_irq_cd; } + pdata-suspend = omap_hsmmc_suspend_cdirq; + pdata-resume = omap_hsmmc_resume_cdirq; this doesn't look to be part of $SUBJECT, care to explain ? I've just moved the initialization of suspend resume which was previously done in omap_hsmmc_gpio_init. Ok will update in the log @@ -173,6 +183,27 @@ int twl_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); int twl6030_interrupt_unmask(u8 bit_mask, u8 offset); int twl6030_interrupt_mask(u8 bit_mask, u8 offset); +/* Card detect Configuration for MMC1 Controller on OMAP4 */ +#ifdef CONFIG_TWL4030_CORE +int twl6030_mmc_card_detect_config(void); +#else +static inline int twl6030_mmc_card_detect_config(void) +{ + pr_err(twl6030_mmc_card_detect_config not supported\n); pr_debug() would be better ?? ok will update with pr_debug +/* MMC1 Controller on OMAP4 uses Phoenix irq for Card detect */ +#ifdef CONFIG_TWL4030_CORE +int twl6030_mmc_card_detect(struct device *dev, int slot); +#else +static inline int twl6030_mmc_card_detect(struct device *dev, int slot) +{ + pr_err(Call back twl6030_mmc_card_detect not supported\n); ditto. ok will update with pr_debug -- balbi Regards, Kishore -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] OMAP: hwmod: Enable module wakeup if in smartidle
Hello. On 22-09-2010 4:19, Paul Walmsley wrote: From: Rajendra Nayakrna...@ti.com If a module's OCP slave port is programmed to be in smartidle, its also necessary that they have module level wakeup enabled. Update _sysc_enable in hwmod framework to do this. The thread [PATCH 7/8] : Hwmod api changes archived here: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34212.html has additional technical information on the rationale of this patch. Signed-off-by: Rajendra Nayakrna...@ti.com Signed-off-by: Partha Basakp-bas...@ti.com Signed-off-by: Benoît Coussonb-cous...@ti.com [p...@pwsan.com: revised patch description] Signed-off-by: Paul Walmsleyp...@pwsan.com Cc: Kevin Hilmankhil...@deeprootsystems.com --- arch/arm/mach-omap2/omap_hwmod.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index f320cfb..3f3d61a 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c [...] @@ -703,6 +701,10 @@ static void _sysc_enable(struct omap_hwmod *oh) _set_clockactivity(oh, oh-class-sysc-clockact,v); _write_sysconfig(v, oh); + + /* If slave is in SMARTIDLE, also enable wakeup */ + if ((sf SYSC_HAS_SIDLEMODE) !(oh-flags HWMOD_SWSUP_SIDLE)) + _enable_wakeup(oh); This line is overindented... WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2 v3]Update broken web addresses.
On Tue, Sep 21, 2010 at 06:29:16PM -0700, Justin P. Mattock wrote: Date: Tue, 21 Sep 2010 18:29:16 -0700 From: Justin P. Mattock justinmatt...@gmail.com To: triv...@kernel.org Cc: linux-arm-ker...@lists.infradead.org, linux-ker...@vger.kernel.org, linux-omap@vger.kernel.org, linux-m...@ml.linux-m32r.org, linux-m...@lists.linux-m68k.org, linux-m...@linux-mips.org, linuxppc-...@lists.ozlabs.org, linux-lap...@vger.kernel.org, Justin P. Mattock justinmatt...@gmail.com, Maciej W. Rozycki ma...@linux-mips.org, Finn Thain fth...@telegraphics.com.au, Randy Dunlap rdun...@xenotime.net Subject: [PATCH 1/2 v3]Update broken web addresses. Content-Type: text/plain; charset=UTF-8 Patchwork MIME butchers the subject of this patch, see https://patchwork.linux-mips.org/patch/1587/ https://patchwork.kernel.org/patch/198382/ Ralf -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/2 v3]Update broken web addresses.
Hi Ralf, On Tue, Sep 21, 2010 at 06:29:16PM -0700, Justin P. Mattock wrote: Date: Tue, 21 Sep 2010 18:29:16 -0700 From: Justin P. Mattock justinmatt...@gmail.com To: triv...@kernel.org Cc: linux-arm-ker...@lists.infradead.org, linux-ker...@vger.kernel.org, linux-omap@vger.kernel.org, linux-m...@ml.linux-m32r.org, linux-m...@lists.linux-m68k.org, linux-m...@linux-mips.org, linuxppc-...@lists.ozlabs.org, linux-lap...@vger.kernel.org, Justin P. Mattock justinmatt...@gmail.com, Maciej W. Rozycki ma...@linux-mips.org, Finn Thain fth...@telegraphics.com.au, Randy Dunlap rdun...@xenotime.net Subject: [PATCH 1/2 v3]Update broken web addresses. Content-Type: text/plain; charset=UTF-8 Patchwork MIME butchers the subject of this patch, see https://patchwork.linux-mips.org/patch/1587/ https://patchwork.kernel.org/patch/198382/ Thanks for the heads-up - I'll see what's happening with the header decoding here. Cheers, Jeremy -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path
Kalliguddi, Hema hem...@ti.com writes: -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Kevin Hilman Sent: Tuesday, September 14, 2010 4:33 AM To: linux-omap@vger.kernel.org Cc: Varadarajan, Charulatha; Basak, Partha; Tero Kristo Subject: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path From: Kevin Hilman khil...@ti.com Currently, we wait until late in the idle path where interrupts are disabled to do runtime-PM-like management for certain special-case devices like GPIO. As a prerequiste to moving GPIO to the new runtime PM framework, move this runtime-PM-like code out of the late idle path into new device idle and resume functions that can be called before interrupts are disabled by CPUidle and/or suspend. In addition, move all the GPIO-specific logic into the GPIO core instead of keeping GPIO-specific knowledge of power-states, context saving etc. in the PM core. Also, call the new device-idle and -resume methods from CPUidle and static suspend path. Signed-off-by: Kevin Hilman khil...@ti.com --- arch/arm/mach-omap2/cpuidle34xx.c |4 ++ arch/arm/mach-omap2/pm.h |2 + arch/arm/mach-omap2/pm24xx.c |2 +- arch/arm/mach-omap2/pm34xx.c | 38 + arch/arm/plat-omap/gpio.c | 57 arch/arm/plat-omap/include/plat/gpio.h |4 +-- 6 files changed, 67 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0923b82..681d823 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -274,9 +274,13 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, pwrdm_set_next_pwrst(per_pd, per_next_state); select_state: + omap3_device_idle(); + dev-last_state = new_state; ret = omap3_enter_idle(dev, new_state); + omap3_device_resume(); + /* Restore original PER state if it was modified */ if (per_next_state != per_saved_state) pwrdm_set_next_pwrst(per_pd, per_saved_state); diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 3de6ece..33cae4b 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -22,6 +22,8 @@ extern void omap_sram_idle(void); extern int omap3_can_sleep(void); extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_idle_init(void); +extern void omap3_device_idle(void); +extern void omap3_device_resume(void); struct cpuidle_params { u8 valid; diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 6aeedea..7bbf0db 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c @@ -106,7 +106,7 @@ static void omap2_enter_full_retention(void) l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); - omap2_gpio_prepare_for_idle(PWRDM_POWER_RET); + omap2_gpio_prepare_for_idle(); if (omap2_pm_debug) { omap2_pm_dump(0, 0, 0); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index bb2ba1e..9e590d9 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -74,16 +74,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; static struct powerdomain *core_pwrdm, *per_pwrdm; static struct powerdomain *cam_pwrdm; -static inline void omap3_per_save_context(void) -{ - omap_gpio_save_context(); -} - -static inline void omap3_per_restore_context(void) -{ - omap_gpio_restore_context(); -} - static void omap3_enable_io_chain(void) { int timeout = 0; @@ -332,6 +322,16 @@ static void restore_table_entry(void) restore_control_register(control_reg_value); } +void omap3_device_idle(void) +{ + omap2_gpio_prepare_for_idle(); +} + Is not it is a good idea to pass the new_state as the parameter for the driver calls? It will reduce each individual drivers reading the PRCM register to findout the next state. This might save some time in the idle loop. I chose not to pass the parameters on purpose. All of the intelligence for device idle (including which powerdomain state to check) should live in the driver code. If reading the PRCM registers is becoming a problem, it will be a simple patch to patch the powerdomain core to cache the current value of it's next state so at least reads of next_state will be fast. Kevin +void omap3_device_resume(void) +{ + omap2_gpio_resume_after_idle(); +} + Here we will need to pass the next_state as well as previous_state as parameters. If we agree to pass the parameters. ~Hema void omap_sram_idle(void) { /* Variable to tell what needs to be saved and restored @@ -344,7 +344,7 @@ void omap_sram_idle(void) int mpu_next_state = PWRDM_POWER_ON; int per_next_state = PWRDM_POWER_ON;
RE: [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way
-Original Message- From: Kevin Hilman [mailto:khil...@deeprootsystems.com] Sent: Wednesday, September 22, 2010 5:48 AM To: Varadarajan, Charulatha Cc: t...@atomide.com; linux-omap@vger.kernel.org; p...@pwsan.com; Cousson, Benoit; Nayak, Rajendra; Basak, Partha Subject: Re: [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way Kevin Hilman khil...@deeprootsystems.com writes: Kevin Hilman khil...@deeprootsystems.com writes: Varadarajan, Charulatha ch...@ti.com writes: Varadarajan, Charulatha ch...@ti.com writes: This patch series makes OMAP2PLUS specific GPIO implemented in hwmod FW way. This is done by implementing GPIO module in platform device model. This patch series is generated on origin/pm-wip/pm-core which has Kevin's pm-next series, the runtime PM core patch series, and a collection of hwmod fixes that Paul/Benoit have lined up for 2.6.37. Tested on OMAP2430, OMAP44430, OMAP3430 SDP and zoom3 boards. Also verified that this patch series does not break the OMAP1 build. This patch series is created on top of the following patches: 1. OMAP: HWMOD: Handle opt clocks using clk_add_alias [https://patchwork.kernel.org/patch/124531/] 2. OMAP2+: GPIO: move late PM out of interrupts-disabled idle path [https://patchwork.kernel.org/patch/176172/] 3. OMAP: CPUIDLE: Enable IRQs during device activity check and idle management by Kevin This series is tested on OMAP4430 ES2 using the below series http://www.spinics.net/lists/linux-omap/msg36023.html Hi Charu, I haven't been fully through the series, but here's some quick feedback based on what I tried today. Basically, I got stuck because the first board I tried it on was the 35xx-based OMAP3EVM platform, which uses a GPIO-based interrupt for the network. My setup uses DHCP + nfsroot, so the GPIO IRQ must be working during boot. The first thing I noticed, is that GPIO interrupts are not firing during boot, so neither the DHCP or the nfsroot works during boot. I haven't been able to fully debug this, but the 3430SDP should have the same issue for its smc91x if you set it up for DHCP + nfsroot. This is working fine on my pm-wip/idle-reorg branch which has the prerequisites you mentioned, but didn't work when I applied the clk_alias patch plus this series. I tested this GPIO series in pm-wip/idle-reorg branch with clock add alias patch and I did not see any issues. I tested with DHCP + nfsroot on SDP3430. Please provide me some more info on this. Hmm, I don't have many more details yet. All I can see is that the GPIO bank that has the smc91x interrupt (GPIO6) is loosing interrupts, and thus preventing DHCP and nfsroot from working. Can you test using omap3_defconfig plus # CONFIG_CPU_FREQ is not set CONFIG_CPU_IDLE=y Some more details. I tried on two different 35xx platforms and it works on one (es3.1) and not on the other (es2.1): [0.00] Machine: Gumstix Overo [0.00] OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp ) but not on omap3evm: [0.00] Machine: OMAP3 EVM [0.00] OMAP3430/3530 ES2.1 (l2cache iva sgx neon isp ) Is there any chance you could get your hands on an es2.1 EVM and try there? Please contact Sanjeev Premi in TII and I think he should be able to find one for you to use temporarily. I could reproduce this issue on 35xxEVM board (ES3.1). I am debugging the issue. Will get back to you soon in this regard. Machine: OMAP3 EVM Memory policy: ECC disabled, Data cache writeback 6OMAP3430/3530 ES3.1 (l2cache iva sgx neon isp) I also just tested on n900 which has lots of GPIOs configured. On this platform, suspend doesn't hit RET because both GPIO3 and GPIO4 are still enabled. Kevin -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v6 00/13] OMAP: GPIO: Implement GPIO in hwmod way
Varadarajan, Charulatha ch...@ti.com writes: [...] I could reproduce this issue on 35xxEVM board (ES3.1). I am debugging the issue. Will get back to you soon in this regard. Thanks for the update. I'll try and debug the suspend problem on n900 today as well. Kevin -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/4] omap4: pandaboard: Adding card detect support for MMC1
On 09/22/2010 03:43 AM, Gadiyar, Anand wrote: On Wed, Sep 22, 2010 at 12:58 PM, Bryan Wubryan...@canonical.com wrote: On Wed, Sep 22, 2010 at 5:24 AM, David Andersx0132...@ti.com wrote: Adding card detect callback function and card detect configuration function for MMC1 Controller. Signed-off-by: David Andersx0132...@ti.com Signed-off-by: Anand Gadiyargadi...@ti.com --- patch depends on https://patchwork.kernel.org/patch/189952/ arch/arm/mach-omap2/board-omap4panda.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 697c0bd..94e819c 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -77,9 +77,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) struct omap_mmc_platform_data *pdata = dev-platform_data; /* Setting MMC1 Card detect Irq */ - if (pdev-id == 0) + if (pdev-id == 0) { + ret = twl6030_mmc_card_detect_config(); It looks like we need this function from twl6030 driver, otherwise we will get this compiling error: In file included from arch/arm/mach-omap2/board-omap4panda.c:38: arch/arm/plat-omap/include/plat/usb.h:109: warning: return type defaults to 'int' arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_twl6030_hsmmc_late_init': arch/arm/mach-omap2/board-omap4panda.c:81: error: implicit declaration of function 'twl6030_mmc_card_detect_config' arch/arm/mach-omap2/board-omap4panda.c:86: error: 'twl6030_mmc_card_detect' undeclared (first use in this function) arch/arm/mach-omap2/board-omap4panda.c:86: error: (Each undeclared identifier is reported only once arch/arm/mach-omap2/board-omap4panda.c:86: error: for each function it appears in.) arch/arm/mach-omap2/board-omap4panda.c: In function 'omap4_panda_init': arch/arm/mach-omap2/board-omap4panda.c:285: warning: unused variable 'status' Thanks, -Bryan I thought the dependent patch [1] took care of this in the header file? (Haven't actually tried this out - will take a look in a bit) [1] https://patchwork.kernel.org/patch/189952/ correct! this patch depends on the reference patch being applied. + if (ret) + pr_err(Failed configuring MMC1 card detect\n); pdata-slots[0].card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET; + pdata-slots[0].card_detect = twl6030_mmc_card_detect; + } return ret; } \ -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: How to enable sys_clkout1 for use by brf6300
On Mon, 2010-09-20 at 11:04 -0700, Kevin Hilman wrote: Hi Peter, Peter Barada peter.bar...@gmail.com writes: I have a brf6300 that requires sys_clkout1, and I have it working fine right now, but if I enable CONFIG_OMAP_RESET_CLOCKS, then sys_clkou1 is disabled. Yes, any unused clocks will be disabled. Where unused means it has a zero use-count (nobody has called clk_enable) How do I tell the system that I need sys_clkout1 enabled for the brf6300 chip to work? Should I use clk = clk_get(NULL, sys_clkout1); clk_enable(clk)'? Yes. Did that not work for you? No, that worked fine. Next challenge is to add into the brf6300 driver proper suspend/resume support to allow disabling/enabling the clock. Thanks! Kevin -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 00/11] OMAP3: Adding Smartreflex and Voltage driver support
From: thara gopinath th...@ti.com This patch series introduces smartreflex and voltage driver support for OMAP3430 and OMAP3630. SmartReflex modules do adaptive voltage control for real-time voltage adjustments. Originally all the functionalities introduced in this patch were present in arch/arm/mach-omap2/smartreflex.c file in Kevin's pm tree. This patch series does a major rewrite of this file and introduces a separate voltage driver. Major contributors to the original driver are Eduardo Valentin (1): OMAP3: PM: SmartReflex: Fix scheduled while atomic problem Kalle Jokiniemi (1): OMAP3: PM: SmartReflex driver integration Kevin Hilman (2): temp: SR: IO_ADDRESS conversion OMAP: SR: OPP interfaces removed from OMAP PM layer Nishanth Menon (1): omap3: pm: sr: replace get_opp with freq_to_opp Paul Walmsley (2): OMAP SR: use opp_find_opp_by_opp_id() OMAP SR: use OPP API for OPP ID, remove direct access Phil Carmody (2): OMAP3: PM: Don't do unnecessary searches in omap_sr_vdd*_autocomp_store OMAP3: PM: Early exit on invalid parameters Rajendra Nayak (9): OMAP3: SR: Fix init voltage on OPP change OMAP3: SR: Update VDD1/2 voltages at boot OMAP3: SR: Use sysclk for SR CLKLENGTH calc OMAP3: SR: Reset voltage level on SR disable OMAP3: SR: Replace printk's with pr_* calls OMAP3: SR: Remove redundant defines OMAP3: SR: Fix SR driver to check for omap-pm return values OMAP3: PM: Put optimal SMPS stabilization delay OMAP3: SR: Wait for VP idle before a VP disable Roger Quadros (4): OMAP3: PM: Fix Smartreflex when used with PM_NOOP layer OMAP3: PM: Make Smartreflex driver independent of SRF OMAP3: PM: Do not Enable SmartReflex if OPP tables not defined OMAP3: PM: Smartreflex: Fix VDD2 OPP determining logic Romit Dasgupta (1): omap: pm: SR: use enum for OPP types Teerth Reddy (1): OMAP3: SR: Replace SR_PASS/FAIL,SR_TRUE/FALSE Tero Kristo (1): Smartreflex: Avoid unnecessary spam This patch series is based against origin/pm-core branch off Kevin's pm tree which in turn is based off lo-master. This series will apply against lo-master also but will break compilation due to lack of opp framework support on lo-master. This patch series has been tested on OMAP3430 SDP with the extra five patches from origin/cpufreq branch off Kevin's pm tree applied. This series has been tested with with omap3_defconfig with the following menuconfig options enabled. System type - TI OMAP Implementations - Smartreflex Support System type - TI OMAP Implementations - Class 3 mode of Smartreflex Implementation Thara Gopinath (11): OMAP: PM: Export the main pm debugfs directory OMAP3: PM: Adding voltage driver support for OMAP3 OMAP3: PM: Adding smartreflex driver support. OMAP3: PM: Adding smartreflex device file. OMAP3: PM: Adding smartreflex hwmod data OMAP3: PM: Adding smartreflex class3 driver OMAP3: PM: Adding T2 enabling of smartreflex support OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers OMAP3: PM: Smartreflex Class3 initialization from board files. OMAP3: PM: Program correct init voltages for VDD1 and VDD2 OMAP3: PM: Register TWL4030 pmic info with the voltage driver. arch/arm/mach-omap2/Makefile |5 +- arch/arm/mach-omap2/board-3430sdp.c |2 + arch/arm/mach-omap2/board-zoom-peripherals.c |2 + arch/arm/mach-omap2/omap_hwmod_3xxx_data.c| 249 + arch/arm/mach-omap2/pm-debug.c| 18 + arch/arm/mach-omap2/pm.c | 67 ++- arch/arm/mach-omap2/pm.h |1 + arch/arm/mach-omap2/smartreflex-class3.c | 61 ++ arch/arm/mach-omap2/smartreflex-class3.h | 23 + arch/arm/mach-omap2/smartreflex.c | 1039 +++ arch/arm/mach-omap2/sr_device.c | 174 arch/arm/mach-omap2/voltage.c | 1319 + arch/arm/plat-omap/Kconfig| 41 + arch/arm/plat-omap/include/plat/control.h | 27 + arch/arm/plat-omap/include/plat/smartreflex.h | 276 ++ arch/arm/plat-omap/include/plat/voltage.h | 141 +++ arch/arm/plat-omap/opp_twl_tps.c | 17 + drivers/mfd/twl-core.c|7 +- drivers/mfd/twl4030-power.c | 29 + include/linux/i2c/twl.h |1 + 20 files changed, 3495 insertions(+), 4 deletions(-) create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c create mode 100644 arch/arm/mach-omap2/smartreflex-class3.h create mode 100644 arch/arm/mach-omap2/smartreflex.c create mode 100644 arch/arm/mach-omap2/sr_device.c create mode 100644 arch/arm/mach-omap2/voltage.c create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h create mode 100644 arch/arm/plat-omap/include/plat/voltage.h -- 1.7.1.GIT -- To unsubscribe from
[PATCH v3 01/11] OMAP: PM: Export the main pm debugfs directory
This patch makes generic pm_debug directory global so that other drivers can include it and use it to create sub-entries. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/pm-debug.c |3 +++ arch/arm/mach-omap2/pm.h |1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index af00c17..390f1c6 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -42,6 +42,7 @@ u32 enable_off_mode; u32 sleep_while_idle; u32 wakeup_timer_seconds; u32 wakeup_timer_milliseconds; +struct dentry *pm_dbg_main_dir; #define DUMP_PRM_MOD_REG(mod, reg)\ regs[reg_count].name = #mod . #reg; \ @@ -641,6 +642,8 @@ static int __init pm_dbg_init(void) (void) debugfs_create_file(wakeup_timer_milliseconds, S_IRUGO | S_IWUGO, d, wakeup_timer_milliseconds, pm_dbg_option_fops); + + pm_dbg_main_dir = d; pm_dbg_init_done = 1; return 0; diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index f3ba1e6..c06cedd 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -55,6 +55,7 @@ extern int omap2_pm_debug; #define omap2_pm_dump(mode, resume, us)do {} while (0); #define omap2_pm_wakeup_on_timer(seconds, milliseconds)do {} while (0); #define omap2_pm_debug 0 +#define pm_dbg_main_dir0 #endif #if defined(CONFIG_CPU_IDLE) -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 02/11] OMAP3: PM: Adding voltage driver support for OMAP3
This patch adds voltage driver support for OMAP3. The driver allows configuring the voltage controller and voltage processors during init and exports APIs to enable/disable voltage processors, scale voltage and reset voltage. The driver also maintains the global voltage table on a per VDD basis which contains the various voltages supported by the VDD along with per voltage dependent data like smartreflex n-target value, errminlimit and voltage processor errorgain. The driver allows scaling of VDD voltages either through vc bypass method or through vp forceupdate method the choice being configurable through the board file. This patch contains code originally in linux omap pm branch smartreflex driver. Major contributors to this driver are Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/Makefile |3 +- arch/arm/mach-omap2/voltage.c | 1117 + arch/arm/plat-omap/include/plat/voltage.h | 136 3 files changed, 1255 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap2/voltage.c create mode 100644 arch/arm/plat-omap/include/plat/voltage.h diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index a88b75a..4f74f2b 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -52,7 +52,8 @@ obj-$(CONFIG_ARCH_OMAP2) += sdrc2xxx.o ifeq ($(CONFIG_PM),y) obj-$(CONFIG_ARCH_OMAP2) += pm24xx.o obj-$(CONFIG_ARCH_OMAP2) += sleep24xx.o pm_bus.o -obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o cpuidle34xx.o pm_bus.o +obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ + cpuidle34xx.o pm_bus.o obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c new file mode 100644 index 000..49013cb --- /dev/null +++ b/arch/arm/mach-omap2/voltage.c @@ -0,0 +1,1117 @@ +/* + * OMAP3/OMAP4 Voltage Management Routines + * + * Author: Thara Gopinath th...@ti.com + * + * Copyright (C) 2007 Texas Instruments, Inc. + * Rajendra Nayak rna...@ti.com + * Lesly A M x0080...@ti.com + * + * Copyright (C) 2008 Nokia Corporation + * Kalle Jokiniemi + * + * Copyright (C) 2010 Texas Instruments, Inc. + * Thara Gopinath th...@ti.com + * + * 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/delay.h +#include linux/io.h +#include linux/clk.h +#include linux/err.h + +#include plat/common.h +#include plat/voltage.h + +#include prm-regbits-34xx.h + +#define VP_IDLE_TIMEOUT200 +#define VP_TRANXDONE_TIMEOUT 300 + +/* PRM voltage module */ +static u32 volt_mod; + +/* Voltage processor register offsets */ +struct vp_reg_offs { + u8 vpconfig; + u8 vstepmin; + u8 vstepmax; + u8 vlimitto; + u8 vstatus; + u8 voltage; +}; + +/* Voltage Processor bit field values, shifts and masks */ +struct vp_reg_val { + /* VPx_VPCONFIG */ + u32 vpconfig_erroroffset; + u16 vpconfig_errorgain; + u32 vpconfig_errorgain_mask; + u8 vpconfig_errorgain_shift; + u32 vpconfig_initvoltage_mask; + u8 vpconfig_initvoltage_shift; + u32 vpconfig_timeouten; + u32 vpconfig_initvdd; + u32 vpconfig_forceupdate; + u32 vpconfig_vpenable; + /* VPx_VSTEPMIN */ + u8 vstepmin_stepmin; + u16 vstepmin_smpswaittimemin; + u8 vstepmin_stepmin_shift; + u8 vstepmin_smpswaittimemin_shift; + /* VPx_VSTEPMAX */ + u8 vstepmax_stepmax; + u16 vstepmax_smpswaittimemax; + u8 vstepmax_stepmax_shift; + u8 vstepmax_smpswaittimemax_shift; + /* VPx_VLIMITTO */ + u16 vlimitto_vddmin; + u16 vlimitto_vddmax; + u16 vlimitto_timeout; + u16 vlimitto_vddmin_shift; + u16 vlimitto_vddmax_shift; + u16 vlimitto_timeout_shift; + /* PRM_IRQSTATUS*/ + u32 tranxdone_status; +}; + +/** + * omap_vdd_info - Per Voltage Domain info + * + * @volt_data : voltage table having the distinct voltages supported + * by the domain and other associated per voltage data. + * @vp_offs: structure containing the offsets for various + * vp registers + * @vp_reg : the register values, shifts, masks for various + * vp registers + * @volt_data_count: Number of distinct voltages supported by this vdd. + * @nominal_volt : Nominal voltage for this vdd. + * @curr_volt : Current voltage for this vdd; + * cmdval_reg : Voltage controller cmdval register. + * @vdd_sr_reg
[PATCH v3 03/11] OMAP3: PM: Adding smartreflex driver support.
SmartReflex modules do adaptive voltage control for real-time voltage adjustments. With Smartreflex the power supply voltage can be adapted to the silicon performance(manufacturing process, temperature induced performance, age induced performance etc). There are differnet classes of smartreflex implementation. Class-0: Manufacturing Test Calibration Class-1: Boot-Time Software Calibration Class-2: Continuous Software Calibration Class-3: Continuous Hardware Calibration Class-4: Fully Integrated Power Management OMAP3 has two smartreflex modules one associated with VDD1 and the other associated with VDD2. This patch adds support for smartreflex driver. The driver is designed for Class-1 , Class-2 and Class-3 support and is a platform driver. Smartreflex driver can be enabled through a Kconfig option SmartReflex support under System type-TI OMAP implementations menu. Smartreflex autocompensation feature can be enabled runtime through a debug fs option. To enable smartreflex autocompensation feature echo 1 /debugfs/pm_debug/smartreflex/sr_X/autocomp To disable smartreflex autocompensation feature echo 0 /debugfs/pm_debug/smartreflex/sr_X/autocomp where X can be mpu, core , iva etc. This patch contains code originally in linux omap pm branch. Major contributors to this driver are Lesly A M, Rajendra Nayak, Kalle Jokiniemi, Paul Walmsley, Nishant Menon, Kevin Hilman. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/Makefile |1 + arch/arm/mach-omap2/smartreflex.c | 1003 + arch/arm/plat-omap/Kconfig| 32 + arch/arm/plat-omap/include/plat/smartreflex.h | 277 +++ 4 files changed, 1313 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/smartreflex.c create mode 100644 arch/arm/plat-omap/include/plat/smartreflex.h diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 4f74f2b..8dd32a7 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -56,6 +56,7 @@ obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ cpuidle34xx.o pm_bus.o obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o +obj-$(CONFIG_OMAP_SMARTREFLEX) += smartreflex.o AFLAGS_sleep24xx.o :=-Wa,-march=armv6 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c new file mode 100644 index 000..7fc3138 --- /dev/null +++ b/arch/arm/mach-omap2/smartreflex.c @@ -0,0 +1,1003 @@ +/* + * OMAP SmartReflex Voltage Control + * + * Author: Thara Gopinath th...@ti.com + * + * Copyright (C) 2010 Texas Instruments, Inc. + * Thara Gopinath th...@ti.com + * + * Copyright (C) 2008 Nokia Corporation + * Kalle Jokiniemi + * + * Copyright (C) 2007 Texas Instruments, Inc. + * Lesly A M x0080...@ti.com + * + * 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/interrupt.h +#include linux/clk.h +#include linux/io.h +#include linux/debugfs.h +#include linux/delay.h +#include linux/slab.h +#include linux/pm_runtime.h + +#include plat/omap_device.h +#include plat/common.h +#include plat/smartreflex.h + +#include pm.h + +#define SMARTREFLEX_NAME_LEN 16 +#define SR_DISABLE_TIMEOUT 200 + +struct dentry *sr_dbg_dir; + +struct omap_sr { + int srid; + boolsr_enable; + boolautocomp_active; + int ip_type; + u32 clk_length; + u32 err_weight; + u32 err_minlimit; + u32 err_maxlimit; + u32 accum_data; + u32 senn_avgweight; + u32 senp_avgweight; + unsigned intirq; + void __iomem*base; + struct platform_device *pdev; + struct list_headnode; + struct voltagedomain*voltdm; +}; + +/* sr_list contains all the instances of smartreflex module */ +static LIST_HEAD(sr_list); + +static struct omap_smartreflex_class_data *sr_class; +static struct omap_smartreflex_pmic_data *sr_pmic_data; + +static inline void sr_write_reg(struct omap_sr *sr, unsigned offset, u32 value) +{ + __raw_writel(value, (sr-base + offset)); +} + +static inline void sr_modify_reg(struct omap_sr *sr, unsigned offset, u32 mask, + u32 value) +{ + u32 reg_val; + u32 errconfig_offs, errconfig_mask; + + reg_val = __raw_readl(sr-base + offset); + reg_val = ~mask; + + /* +
[PATCH v3 04/11] OMAP3: PM: Adding smartreflex device file.
This patch adds support for device registration of various smartreflex module present in the system. This patch introduces the platform data for smartreflex devices which include the efused and test n-target vaules, module enable/disable pointers and a parameter to indicate whether smartreflex autocompensation needs to be enabled on init or not. Currently auocompensation is enabled on init by default for OMAP3430 ES3.1 chip. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/Makefile|2 +- arch/arm/mach-omap2/sr_device.c | 174 +++ 2 files changed, 175 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-omap2/sr_device.c diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 8dd32a7..abc377a 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -56,7 +56,7 @@ obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ cpuidle34xx.o pm_bus.o obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o -obj-$(CONFIG_OMAP_SMARTREFLEX) += smartreflex.o +obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o AFLAGS_sleep24xx.o :=-Wa,-march=armv6 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a diff --git a/arch/arm/mach-omap2/sr_device.c b/arch/arm/mach-omap2/sr_device.c new file mode 100644 index 000..606da59 --- /dev/null +++ b/arch/arm/mach-omap2/sr_device.c @@ -0,0 +1,174 @@ +/* + * OMAP3/OMAP4 smartreflex device file + * + * Author: Thara Gopinath th...@ti.com + * + * Based originally on code from smartreflex.c + * Copyright (C) 2010 Texas Instruments, Inc. + * Thara Gopinath th...@ti.com + * + * Copyright (C) 2008 Nokia Corporation + * Kalle Jokiniemi + * + * Copyright (C) 2007 Texas Instruments, Inc. + * Lesly A M x0080...@ti.com + * + * 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/err.h +#include linux/slab.h + +#include plat/control.h +#include plat/omap_device.h +#include plat/smartreflex.h +#include plat/voltage.h + +static struct omap_device_pm_latency omap_sr_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST + }, +}; + +#ifdef OMAP_SMARTREFLEX_TESTING +/* + * Hard coded nvalues for testing purposes for OMAP3430, + * may cause device to hang! + */ +static void __init sr_set_nvalues(struct omap_sr_dev_data *dev_data, + struct omap_sr_data *sr_data) +{ + int i; + + if (!dev_data || !dev_data-volts_supported || + !dev_data-volt_data || !dev_data-test_nvalues) { + pr_warning(%s: Bad parameters! dev_data = %x, + dev_data-volts_supported = %x, + dev_data-volt_data = %x, + dev_data-test_nvalues = %x\n, __func__, + (unsigned int)dev_data, dev_data-volts_supported, + (unsigned int)dev_data-volt_data, + (unsigned int)dev_data-test_nvalues); + return; + } + + sr_data-senn_mod = dev_data-test_sennenable; + sr_data-senp_mod = dev_data-test_senpenable; + for (i = 0; i dev_data-volts_supported; i++) + dev_data-volt_data[i].sr_nvalue = dev_data-test_nvalues[i]; +} +#else +/* Read EFUSE values from control registers for OMAP3430 */ +static void __init sr_set_nvalues(struct omap_sr_dev_data *dev_data, + struct omap_sr_data *sr_data) +{ + int i; + + if (!dev_data || !dev_data-volts_supported || !dev_data-volt_data || + !dev_data-efuse_nvalues_offs) { + pr_warning(%s: Bad parameters! dev_data = %x, + dev_data-volts_supported = %x, + dev_data-volt_data = %x, + dev_data-efuse_nvalues_offs = %x\n, __func__, + (unsigned int)dev_data, dev_data-volts_supported, + (unsigned int)dev_data-volt_data, + (unsigned int)dev_data-efuse_nvalues_offs); + return; + } + + /* +* From OMAP3630 onwards there are no efuse registers for senn_mod +* and senp_mod. They have to be 0x1 by default. +*/ + if (!dev_data-efuse_sr_control) { + sr_data-senn_mod = 0x1; + sr_data-senp_mod = 0x1; + } else { + sr_data-senn_mod = + ((omap_ctrl_readl(dev_data-efuse_sr_control) + (0x3 dev_data-sennenable_shift)) +
[PATCH v3 05/11] OMAP3: PM: Adding smartreflex hwmod data
This patch adds the smartreflex hwmod data for OMAP3430 and OMAP3630. A dev_attr is also added to the hwmod structure for each smartreflex module which contains SoC specific info like the efuse offsets, test n-values etc. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 249 arch/arm/plat-omap/include/plat/control.h | 27 +++ 2 files changed, 276 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 5d8eb58..c9f0948 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -17,6 +17,8 @@ #include mach/irqs.h #include plat/cpu.h #include plat/dma.h +#include plat/control.h +#include plat/smartreflex.h #include omap_hwmod_common_data.h @@ -36,6 +38,8 @@ static struct omap_hwmod omap3xxx_iva_hwmod; static struct omap_hwmod omap3xxx_l3_main_hwmod; static struct omap_hwmod omap3xxx_l4_core_hwmod; static struct omap_hwmod omap3xxx_l4_per_hwmod; +static struct omap_hwmod omap34xx_sr1_hwmod; +static struct omap_hwmod omap34xx_sr2_hwmod; /* L3 - L4_CORE interface */ static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = { @@ -90,9 +94,47 @@ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* L4 CORE - SR1 interface */ +static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = { + { + .pa_start = OMAP34XX_SR1_BASE, + .pa_end = OMAP34XX_SR1_BASE + SZ_1K - 1, + .flags = ADDR_TYPE_RT, + }, +}; + +static struct omap_hwmod_ocp_if omap3_l4_core__sr1 = { + .master = omap3xxx_l4_core_hwmod, + .slave = omap34xx_sr1_hwmod, + .clk= sr_l4_ick, + .addr = omap3_sr1_addr_space, + .addr_cnt = ARRAY_SIZE(omap3_sr1_addr_space), + .user = OCP_USER_MPU, +}; + +/* L4 CORE - SR1 interface */ +static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = { + { + .pa_start = OMAP34XX_SR2_BASE, + .pa_end = OMAP34XX_SR2_BASE + SZ_1K - 1, + .flags = ADDR_TYPE_RT, + }, +}; + +static struct omap_hwmod_ocp_if omap3_l4_core__sr2 = { + .master = omap3xxx_l4_core_hwmod, + .slave = omap34xx_sr2_hwmod, + .clk= sr_l4_ick, + .addr = omap3_sr2_addr_space, + .addr_cnt = ARRAY_SIZE(omap3_sr2_addr_space), + .user = OCP_USER_MPU, +}; + /* Slave interfaces on the L4_CORE interconnect */ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { omap3xxx_l3_main__l4_core, + omap3_l4_core__sr1, + omap3_l4_core__sr2, }; /* Master interfaces on the L4_CORE interconnect */ @@ -197,6 +239,209 @@ static struct omap_hwmod omap3xxx_iva_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) }; +/* SR common */ +static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = { + .clkact_shift = 20, +}; + +static struct omap_hwmod_class_sysconfig omap34xx_sr_sysc = { + .sysc_offs = 0x24, + .sysc_flags = (SYSC_HAS_CLOCKACTIVITY | SYSC_NO_CACHE), + .clockact = CLOCKACT_TEST_ICLK, + .sysc_fields= omap34xx_sr_sysc_fields, +}; + +static struct omap_hwmod_class omap34xx_smartreflex_hwmod_class = { + .name = smartreflex, + .sysc = omap34xx_sr_sysc, + .rev = 1, +}; + +static struct omap_hwmod_sysc_fields omap36xx_sr_sysc_fields = { + .sidle_shift= 24, + .enwkup_shift = 26 +}; + +static struct omap_hwmod_class_sysconfig omap36xx_sr_sysc = { + .sysc_offs = 0x38, + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_ENAWAKEUP | + SYSC_NO_CACHE), + .sysc_fields= omap36xx_sr_sysc_fields, +}; + +static struct omap_hwmod_class omap36xx_smartreflex_hwmod_class = { + .name = smartreflex, + .sysc = omap36xx_sr_sysc, + .rev = 2, +}; + +/* SR1 */ +static struct omap_hwmod_ocp_if *omap3_sr1_slaves[] = { + omap3_l4_core__sr1, +}; + +static u32 omap34xx_sr1_efuse_offs[] = { + OMAP343X_CONTROL_FUSE_OPP1_VDD1, OMAP343X_CONTROL_FUSE_OPP2_VDD1, + OMAP343X_CONTROL_FUSE_OPP3_VDD1, OMAP343X_CONTROL_FUSE_OPP4_VDD1, + OMAP343X_CONTROL_FUSE_OPP5_VDD1, +}; + +static u32 omap34xx_sr1_test_nvalues[] = { + 0x9A90E6, 0xAABE9A, 0xBBF5C5, 0xBBB292, 0xBBF5C5, +}; + +static struct omap_sr_dev_data omap34xx_sr1_dev_attr = { + .efuse_sr_control = OMAP343X_CONTROL_FUSE_SR, + .sennenable_shift = OMAP343X_SR1_SENNENABLE_SHIFT, + .senpenable_shift = OMAP343X_SR1_SENPENABLE_SHIFT, + .efuse_nvalues_offs = omap34xx_sr1_efuse_offs, + .test_sennenable
[PATCH v3 06/11] OMAP3: PM: Adding smartreflex class3 driver
Smartreflex Class3 implementation continuously monitors silicon performance and instructs the Voltage Processors to increase or decrease the voltage. This patch adds smartreflex class 3 driver. This driver hooks up with the generic smartreflex driver smartreflex.c to abstract out class specific implementations out of the generic driver. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/Makefile |1 + arch/arm/mach-omap2/smartreflex-class3.c | 61 ++ arch/arm/mach-omap2/smartreflex-class3.h | 23 +++ arch/arm/plat-omap/Kconfig |9 4 files changed, 94 insertions(+), 0 deletions(-) create mode 100644 arch/arm/mach-omap2/smartreflex-class3.c create mode 100644 arch/arm/mach-omap2/smartreflex-class3.h diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index abc377a..4f6139c 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -57,6 +57,7 @@ obj-$(CONFIG_ARCH_OMAP3) += pm34xx.o sleep34xx.o voltage.o \ obj-$(CONFIG_ARCH_OMAP4) += pm44xx.o pm_bus.o obj-$(CONFIG_PM_DEBUG) += pm-debug.o obj-$(CONFIG_OMAP_SMARTREFLEX) += sr_device.o smartreflex.o +obj-$(CONFIG_OMAP_SMARTREFLEX_CLASS3) += smartreflex-class3.o AFLAGS_sleep24xx.o :=-Wa,-march=armv6 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a diff --git a/arch/arm/mach-omap2/smartreflex-class3.c b/arch/arm/mach-omap2/smartreflex-class3.c new file mode 100644 index 000..f1ade08 --- /dev/null +++ b/arch/arm/mach-omap2/smartreflex-class3.c @@ -0,0 +1,61 @@ +/* + * Smart reflex Class 3 specific implementations + * + * Author: Thara Gopinath th...@ti.com + * + * Copyright (C) 2010 Texas Instruments, Inc. + * Thara Gopinath th...@ti.com + * + * 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 plat/smartreflex.h + +#include smartreflex-class3.h + +static int sr_class3_enable(struct voltagedomain *voltdm) +{ + unsigned long volt = 0; + + volt = omap_voltage_get_nom_volt(voltdm); + if (!volt) { + pr_warning(%s: Curr voltage unknown. Cannot enable sr_%s\n, + __func__, voltdm-name); + return -ENODATA; + } + + omap_vp_enable(voltdm); + return sr_enable(voltdm, volt); +} + +static int sr_class3_disable(struct voltagedomain *voltdm, int is_volt_reset) +{ + omap_vp_disable(voltdm); + sr_disable(voltdm); + if (is_volt_reset) + omap_voltage_reset(voltdm); + + return 0; +} + +static int sr_class3_configure(struct voltagedomain *voltdm) +{ + return sr_configure_errgen(voltdm); +} + +/* SR class3 structure */ +static struct omap_smartreflex_class_data class3_data = { + .enable = sr_class3_enable, + .disable = sr_class3_disable, + .configure = sr_class3_configure, + .class_type = SR_CLASS3, +}; + +/* Smartreflex CLASS3 init API to be called from board file */ +int __init sr_class3_init(void) +{ + pr_info(SmartReflex CLASS3 initialized\n); + return sr_register_class(class3_data); +} diff --git a/arch/arm/mach-omap2/smartreflex-class3.h b/arch/arm/mach-omap2/smartreflex-class3.h new file mode 100644 index 000..4d86037 --- /dev/null +++ b/arch/arm/mach-omap2/smartreflex-class3.h @@ -0,0 +1,23 @@ +/* + * Smartreflex Class 3 Routines + * + * Author: Thara Gopinath th...@ti.com + * + * Copyright (C) 2010 Texas Instruments, Inc. + * Thara Gopinath th...@ti.com + * + * 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. + */ + +#ifndef __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H +#define __ARCH_ARM_MACH_OMAP2_SMARTREFLEXCLASS3_H + +#ifdef CONFIG_OMAP_SMARTREFLEX_CLASS3 +int sr_class3_init(void); +#else +static int sr_class3_init(void) { return 0; } +#endif + +#endif diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index 8056349..af7acc9 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -67,6 +67,15 @@ config OMAP_SMARTREFLEX_TESTING WARNING: Enabling this option may cause your device to hang! +config OMAP_SMARTREFLEX_CLASS3 + bool Class 3 mode of Smartreflex Implementation + depends on OMAP_SMARTREFLEX TWL4030_CORE + help + Say Y to enable Class 3 implementation of Smartreflex + + Class 3 implementation of Smartreflex employs continuous hardware + voltage caliberation. + config OMAP_RESET_CLOCKS bool Reset unused clocks during boot depends on ARCH_OMAP -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to
[PATCH v3 07/11] OMAP3: PM: Adding T2 enabling of smartreflex support
This patch adds support in the twl4030 driver to hook up the API enabling smartreflex support on PMIC side with the smartreflex driver. Without this the OMAP smartreflex modules will not function. Signed-off-by: Thara Gopinath th...@ti.com --- drivers/mfd/twl-core.c |7 +-- drivers/mfd/twl4030-power.c | 29 + include/linux/i2c/twl.h |1 + 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c index 720e099..677b903 100644 --- a/drivers/mfd/twl-core.c +++ b/drivers/mfd/twl-core.c @@ -1009,8 +1009,11 @@ twl_probe(struct i2c_client *client, const struct i2c_device_id *id) clocks_init(client-dev, pdata-clock); /* load power event scripts */ - if (twl_has_power() pdata-power) - twl4030_power_init(pdata-power); + if (twl_has_power()) { + twl4030_power_sr_init(); +if (pdata-power) + twl4030_power_init(pdata-power); + } /* Maybe init the T2 Interrupt subsystem */ if (client-irq diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 7efa878..6d0ad2d 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c @@ -31,6 +31,8 @@ #include asm/mach-types.h +#include plat/smartreflex.h + static u8 twl4030_start_script_address = 0x2b; #define PWR_P1_SW_EVENTS 0x10 @@ -63,6 +65,10 @@ static u8 twl4030_start_script_address = 0x2b; #define R_MEMORY_ADDRESS PHY_TO_OFF_PM_MASTER(0x59) #define R_MEMORY_DATA PHY_TO_OFF_PM_MASTER(0x5a) +/* Smartreflex Control */ +#define R_DCDC_GLOBAL_CFG PHY_TO_OFF_PM_RECEIVER(0x61) +#define CFG_ENABLE_SRFLX 0x08 + #define R_PROTECT_KEY 0x0E #define R_KEY_10xC0 #define R_KEY_20x0C @@ -511,6 +517,29 @@ int twl4030_remove_script(u8 flags) return err; } +/* API to enable smrtreflex on Triton side */ +static void twl4030_smartreflex_init(void) +{ + int ret = 0; + u8 read_val; + + ret = twl_i2c_read_u8(TWL4030_MODULE_PM_RECEIVER, read_val, + R_DCDC_GLOBAL_CFG); + read_val |= CFG_ENABLE_SRFLX; + ret |= twl_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, read_val, + R_DCDC_GLOBAL_CFG); +} + +struct omap_smartreflex_pmic_data twl4030_sr_data = { + .sr_pmic_init = twl4030_smartreflex_init, +}; + +void __init twl4030_power_sr_init() +{ + /* Register the SR init API with the Smartreflex driver */ + omap_sr_register_pmic(twl4030_sr_data); +} + void __init twl4030_power_init(struct twl4030_power_data *twl4030_scripts) { int err = 0; diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index 6de90bf..b02011e 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h @@ -550,6 +550,7 @@ struct twl4030_power_data { }; extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); +extern void twl4030_power_sr_init(void); extern int twl4030_remove_script(u8 flags); struct twl4030_codec_audio_data { -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 08/11] OMAP3: PM: Adding debug support to Voltage and Smartreflex drivers
This patch adds debug support to the voltage and smartreflex drivers. This means a whole bunch of voltage processor and smartreflex parameters are now visible through the pm debugfs. By default only a read of these parameters are permitted. If you need to write into them then echo 1 /pm_debug/enable_sr_vp_debug The voltage parameters can be viewed at /pm_debug/voltage/vdd_x/parameter and the smartreflex parameters can be viewed at /pm_debug/smartreflex/sr_x/parameter where x is mpu or core for OMAP3. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/pm-debug.c| 15 ++ arch/arm/mach-omap2/smartreflex.c | 40 +- arch/arm/mach-omap2/voltage.c | 210 - arch/arm/plat-omap/include/plat/smartreflex.h |1 - arch/arm/plat-omap/include/plat/voltage.h |5 + 5 files changed, 264 insertions(+), 7 deletions(-) diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 390f1c6..879efb2 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -32,6 +32,7 @@ #include plat/powerdomain.h #include plat/clockdomain.h #include plat/dmtimer.h +#include plat/voltage.h #include prm.h #include cm.h @@ -586,6 +587,18 @@ static int option_set(void *data, u64 val) omap3_pm_off_mode_enable(val); } + if (option == enable_sr_vp_debug val) + pr_notice(Beware that enabling this option will allow user + to override the system defined vp and sr parameters + All the updated parameters will take effect next + time smartreflex is enabled. Also this option + disables the automatic vp errorgain and sr errormin + limit changes as per the voltage. Users will have + to explicitly write values into the debug fs + entries corresponding to these if they want to see + them changing according to the VDD voltage\n); + + return 0; } @@ -642,6 +655,8 @@ static int __init pm_dbg_init(void) (void) debugfs_create_file(wakeup_timer_milliseconds, S_IRUGO | S_IWUGO, d, wakeup_timer_milliseconds, pm_dbg_option_fops); + (void) debugfs_create_file(enable_sr_vp_debug, S_IRUGO | S_IWUGO, d, + enable_sr_vp_debug, pm_dbg_option_fops); pm_dbg_main_dir = d; pm_dbg_init_done = 1; diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index 7fc3138..b5a7878 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -558,8 +558,13 @@ int sr_enable(struct voltagedomain *voltdm, unsigned long volt) return -ENODATA; } - /* errminlimit is opp dependent and hence linked to voltage */ - sr-err_minlimit = volt_data-sr_errminlimit; + /* +* errminlimit is opp dependent and hence linked to voltage +* if the debug option is enabled, the user might have over ridden +* this parameter so do not get it from voltage table +*/ + if (!enable_sr_vp_debug) + sr-err_minlimit = volt_data-sr_errminlimit; /* Enable the clocks */ if (!sr-sr_enable) { @@ -811,9 +816,34 @@ static int omap_sr_autocomp_store(void *data, u64 val) return 0; } +static int omap_sr_params_show(void *data, u64 *val) +{ + u32 *param = data; + + *val = *param; + return 0; +} + +static int omap_sr_params_store(void *data, u64 val) +{ + if (enable_sr_vp_debug) { + u32 *option = data; + *option = val; + } else { + pr_notice(%s: DEBUG option not enabled!\n \ + echo 1 pm_debug/enable_sr_vp_debug - to enable\n, + __func__); + } + + return 0; +} + DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show, omap_sr_autocomp_store, %llu\n); +DEFINE_SIMPLE_ATTRIBUTE(sr_params_fops, omap_sr_params_show, + omap_sr_params_store, %llu\n); + static int __init omap_smartreflex_probe(struct platform_device *pdev) { struct omap_sr *sr_info = kzalloc(sizeof(struct omap_sr), GFP_KERNEL); @@ -907,6 +937,12 @@ static int __init omap_smartreflex_probe(struct platform_device *pdev) (void) debugfs_create_file(autocomp, S_IRUGO | S_IWUGO, dbg_dir, (void *)sr_info, pm_sr_fops); + (void) debugfs_create_file(errweight, S_IRUGO | S_IWUGO, dbg_dir, + sr_info-err_weight, sr_params_fops); + (void) debugfs_create_file(errmaxlimit, S_IRUGO | S_IWUGO, dbg_dir, + sr_info-err_maxlimit, sr_params_fops); + (void) debugfs_create_file(errminlimit, S_IRUGO | S_IWUGO,
[PATCH v3 09/11] OMAP3: PM: Smartreflex Class3 initialization from board files.
This patch enables smartreflex class3 functionality for OMAP3430SDP, OMAP3630SDP, ZOOM2 and ZOOM3 boards. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/board-3430sdp.c |2 ++ arch/arm/mach-omap2/board-zoom-peripherals.c |2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 67b95b5f..9a04a2e 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -47,6 +47,7 @@ #include sdram-qimonda-hyb18m512160af-6.h #include hsmmc.h #include pm.h +#include smartreflex-class3.h #define CONFIG_DISABLE_HFCLK 1 @@ -813,6 +814,7 @@ static void __init omap_3430sdp_init(void) sdp3430_display_init(); enable_board_wakeup_source(); usb_ehci_init(ehci_pdata); + sr_class3_init(); } MACHINE_START(OMAP_3430SDP, OMAP3430 3430SDP board) diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 6b39849..98dffc6 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -26,6 +26,7 @@ #include mux.h #include hsmmc.h +#include smartreflex-class3.h /* Zoom2 has Qwerty keyboard*/ static int board_keymap[] = { @@ -282,4 +283,5 @@ void __init zoom_peripherals_init(void) omap_i2c_init(); usb_musb_init(musb_board_data); enable_board_wakeup_source(); + sr_class3_init(); } -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 10/11] OMAP3: PM: Program correct init voltages for VDD1 and VDD2
By default the system boots up at nominal voltage for every voltage domain in the system. This patch puts VDD1 and VDD2 to the correct boot up voltage as per the opp tables specified. This patch implements this by matching the rate of the main clock of the voltage domain with the opp table and picking up the correct voltage. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/mach-omap2/pm.c | 67 +- 1 files changed, 66 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 71c5a77..86c7bf1 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -13,6 +13,7 @@ #include linux/init.h #include linux/io.h #include linux/err.h +#include linux/clk.h #include plat/omap-pm.h #include plat/omap_device.h @@ -20,6 +21,7 @@ #include plat/powerdomain.h #include plat/clockdomain.h +#include plat/voltage.h #include pm.h @@ -138,12 +140,75 @@ err: return ret; } +/* + * This is to be called during init to put the various voltage + * domains to the voltage as per the opp table. Typically we boot up + * at the nominal voltage. So this function finds out the rate of + * the clock associated with the voltage domain, finds out the correct + * opp entry and puts the voltage domain to the voltage specifies + * in the opp entry + */ +static int __init omap2_set_init_voltage(char *vdd_name, char *clk_name, + struct device *dev) +{ + struct voltagedomain *voltdm; + struct clk *_clk; + struct omap_opp *opp; + unsigned long freq, bootup_volt; + + if (!vdd_name || !clk_name || !dev) { + printk(KERN_ERR %s: Invalid parameters!\n, __func__); + goto exit; + } + + voltdm = omap_voltage_domain_get(vdd_name); + if (IS_ERR(voltdm)) { + printk(KERN_ERR %s: Unable to get vdd pointer for vdd_%s\n, + __func__, vdd_name); + goto exit; + } + + _clk = clk_get(NULL, clk_name); + if (IS_ERR(_clk)) { + printk(KERN_ERR %s: unable to get clk %s\n, + __func__, clk_name); + goto exit; + } + + freq = _clk-rate; + opp = opp_find_freq_ceil(dev, freq); + if (IS_ERR(opp)) { + printk(KERN_ERR %s: unable to find boot up OPP for vdd_%s\n, + __func__, vdd_name); + goto exit; + } + + bootup_volt = opp_get_voltage(opp); + if (!bootup_volt) { + printk(KERN_ERR %s: unable to find voltage corresponding + to the bootup OPP for vdd_%s\n, __func__, vdd_name); + goto exit; + } + + omap_voltage_scale_vdd(voltdm, bootup_volt); + + return 0; + +exit: + printk(KERN_ERR %s: Unable to put vdd_%s to its init voltage\n\n, + __func__, vdd_name); + return -EINVAL; +} + static int __init omap2_common_pm_init(void) { omap2_init_processor_devices(); - if (cpu_is_omap34xx()) + if (cpu_is_omap34xx()) { omap3_pm_init_opp_table(); + omap2_set_init_voltage(mpu, dpll1_ck, mpu_dev); + omap2_set_init_voltage(core, l3_ick, l3_dev); + } omap_pm_if_init(); -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 11/11] OMAP3: PM: Register TWL4030 pmic info with the voltage driver.
This patch registers the TWL4030 PMIC specific informtion with the voltage driver. Failing this patch the voltage driver is unware of the formula to use for vsel to voltage and vice versa conversion. Signed-off-by: Thara Gopinath th...@ti.com --- arch/arm/plat-omap/opp_twl_tps.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c index 112f106..4448fc5 100644 --- a/arch/arm/plat-omap/opp_twl_tps.c +++ b/arch/arm/plat-omap/opp_twl_tps.c @@ -13,7 +13,10 @@ * XXX This code should be part of some other TWL/TPS code. */ +#include linux/module.h + #include plat/opp_twl_tps.h +#include plat/voltage.h /** * omap_twl_vsel_to_vdc - convert TWL/TPS VSEL value to microvolts DC @@ -39,3 +42,17 @@ u8 omap_twl_uv_to_vsel(unsigned long uv) /* Round up to higher voltage */ return DIV_ROUND_UP(uv - 60, 12500); } + +static struct omap_volt_pmic_info twl_volt_info = { + .slew_rate = 4000, + .step_size = 12500, + .vsel_to_uv = omap_twl_vsel_to_uv, + .uv_to_vsel = omap_twl_uv_to_vsel, +}; + +static int __init omap_twl_init(void) +{ + omap_voltage_register_pmic(twl_volt_info); + return 0; +} +arch_initcall(omap_twl_init); -- 1.7.1.GIT -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/9 v3]usb: musb: hwmod and runtime pm support for musb
Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com This patch series makes OMAP2PLUS musb Module implemented in HWMOD FW way. It also implements musb driver to use the runtime pm apis. PATCH[1/8 v3] and [PATCH 2/8 v3] are the pre-requisites for the hwmod support for the usb module. [PATCH 9/9 v3] Is offmode fix for usb in idle path using runtime pm apis. As per the OMAP usbotg specification[1] musb sysconfig register has to be set to force idle and force standby when not used and set smart idle/standby during operation.otherwise core-off will be prevented by musb. [1]: http://focus.ti.com/pdfs/wtbu/SWPU223D_Final_EPDF_06_07_2010.pdf This patch series is created top of origin/pm-core and below patch OMAP2+: GPIO: move late PM out of interrupts-disabled idle path [https://patchwork.kernel.org/patch/176172/] by Kevin This patch series is tested on OMAP3630 zoom3, OMAP4430 SDP OMAP2430SDP. On OMAP3630 zoom3, off mode is tested on origin/pm branch using omap3_pm_defconfig. Version History: --- Version v3 Added the patch for adding the hwmod database for OMAP2430. Re-arranged the patches in such a way that first migrate the musb driver to use the runtime pm apis and then added a patch to support offmode in idle path. Calling the runtime pm apis before disabling the interupts in the idle path. Added the #ifdef CONFIG_PM_RUNTIME check in the musb core driver for calling the runtime PM APIs as non-omap platforms may not have the runtime pm enabled and clk_enable/disable should be called for them. Optimized the context save restore of musb registers only if the next state is going to offmode and previous state was offmode. Addressed few review comments on coding styles. Some of the links for v2 review comments http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34068.html http://www.mail-archive.com/linux-omap@vger.kernel.org/msg32024.html http://www.spinics.net/lists/linux-usb/msg35562.html http://www.spinics.net/lists/linux-usb/msg35720.html Vesrion v2: Fixed review comments. Removed the omap_hwmod.h inclusion from musb.h file which was breaking the non-omap platform build. Using the runtime pm apis in the idle path(interrupts disabled). Added the omap4 hwmod data base. Version v1: initial version of the patch series. Some of the links for v1 http://www.spinics.net/lists/linux-usb/msg34570.html http://www.spinics.net/lists/linux-omap/msg34568.html http://www.spinics.net/lists/linux-usb/msg34544.html http://www.spinics.net/lists/linux-usb/msg34540.html http://www.spinics.net/lists/linux-usb/msg34589.html http://www.spinics.net/lists/linux-usb/msg34554.html http://www.mail-archive.com/linux-omap@vger.kernel.org/msg32973.html Cousson, Benoit (1): usb: musb: HWMOD database structures addition for OMAP4 Hema HK (8): usb: musb: Adding names for IRQs in resource structure usb: musb: Remove board_data parameter from musb_platform_init() usb: musb: HWMOD database structures addition for OMAP3 usb: musb: HWMOD database structures addition for OMAP2430 usb: musb: Using omap_device_build for musb device registration OMAP: Hwmod api changes usb : musb: Using runtime pm apis for musb. usb : musb: Offmode fix for idle path arch/arm/mach-davinci/usb.c|2 + arch/arm/mach-omap2/cpuidle34xx.c |1 + arch/arm/mach-omap2/omap_hwmod.c | 19 ++- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 102 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 105 + arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 99 arch/arm/mach-omap2/pm34xx.c |3 + arch/arm/mach-omap2/usb-musb.c | 175 ++-- arch/arm/plat-omap/include/plat/usb.h |2 + arch/blackfin/mach-bf527/boards/cm_bf527.c |2 + arch/blackfin/mach-bf527/boards/ezbrd.c|2 + arch/blackfin/mach-bf527/boards/ezkit.c|2 + arch/blackfin/mach-bf548/boards/cm_bf548.c |2 + arch/blackfin/mach-bf548/boards/ezkit.c|2 + drivers/usb/musb/blackfin.c|2 +- drivers/usb/musb/cppi_dma.c|2 +- drivers/usb/musb/davinci.c |2 +- drivers/usb/musb/musb_core.c | 40 ++- drivers/usb/musb/musb_core.h |2 +- drivers/usb/musb/musbhsdma.c |2 +- drivers/usb/musb/omap2430.c| 63 -- drivers/usb/musb/tusb6010.c|2 +- include/linux/usb/musb.h | 13 ++ 23 files changed, 560 insertions(+), 86 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at
[PATCH 1/9 v3] usb: musb: Adding names for IRQs in resource structure
Modified the Omap,Blackfin and Davinci board files to add the name of the IRQs in the resource structures and musb driver to use the get_irq_byname() api to get the mc and dma irq numbers instead of using the index as the order of resource definition need not be always in order of device interrupt and then dma interrupt Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-davinci/usb.c|2 ++ arch/arm/mach-omap2/usb-musb.c |2 ++ arch/blackfin/mach-bf527/boards/cm_bf527.c |2 ++ arch/blackfin/mach-bf527/boards/ezbrd.c|2 ++ arch/blackfin/mach-bf527/boards/ezkit.c|2 ++ arch/blackfin/mach-bf548/boards/cm_bf548.c |2 ++ arch/blackfin/mach-bf548/boards/ezkit.c|2 ++ drivers/usb/musb/cppi_dma.c|2 +- drivers/usb/musb/musb_core.c |2 +- drivers/usb/musb/musbhsdma.c |2 +- 10 files changed, 17 insertions(+), 3 deletions(-) Index: linux-omap-pm/arch/arm/mach-davinci/usb.c === --- linux-omap-pm.orig/arch/arm/mach-davinci/usb.c +++ linux-omap-pm/arch/arm/mach-davinci/usb.c @@ -64,10 +64,12 @@ static struct resource usb_resources[] = { .start = IRQ_USBINT, .flags = IORESOURCE_IRQ, + .name = mc }, { /* placeholder for the dedicated CPPI IRQ */ .flags = IORESOURCE_IRQ, + .name = dma }, }; Index: linux-omap-pm/arch/arm/mach-omap2/usb-musb.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/usb-musb.c +++ linux-omap-pm/arch/arm/mach-omap2/usb-musb.c @@ -39,10 +39,12 @@ static struct resource musb_resources[] [1] = { /* general IRQ */ .start = INT_243X_HS_USB_MC, .flags = IORESOURCE_IRQ, + .name = mc, }, [2] = { /* DMA IRQ */ .start = INT_243X_HS_USB_DMA, .flags = IORESOURCE_IRQ, + .name = dma, }, }; Index: linux-omap-pm/arch/blackfin/mach-bf527/boards/cm_bf527.c === --- linux-omap-pm.orig/arch/blackfin/mach-bf527/boards/cm_bf527.c +++ linux-omap-pm/arch/blackfin/mach-bf527/boards/cm_bf527.c @@ -82,11 +82,13 @@ static struct resource musb_resources[] .start = IRQ_USB_INT0, .end= IRQ_USB_INT0, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = mc }, [2] = { /* DMA IRQ */ .start = IRQ_USB_DMA, .end= IRQ_USB_DMA, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = dma }, }; Index: linux-omap-pm/arch/blackfin/mach-bf527/boards/ezbrd.c === --- linux-omap-pm.orig/arch/blackfin/mach-bf527/boards/ezbrd.c +++ linux-omap-pm/arch/blackfin/mach-bf527/boards/ezbrd.c @@ -46,11 +46,13 @@ static struct resource musb_resources[] .start = IRQ_USB_INT0, .end= IRQ_USB_INT0, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = mc }, [2] = { /* DMA IRQ */ .start = IRQ_USB_DMA, .end= IRQ_USB_DMA, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = dma }, }; Index: linux-omap-pm/arch/blackfin/mach-bf527/boards/ezkit.c === --- linux-omap-pm.orig/arch/blackfin/mach-bf527/boards/ezkit.c +++ linux-omap-pm/arch/blackfin/mach-bf527/boards/ezkit.c @@ -86,11 +86,13 @@ static struct resource musb_resources[] .start = IRQ_USB_INT0, .end= IRQ_USB_INT0, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = mc }, [2] = { /* DMA IRQ */ .start = IRQ_USB_DMA, .end= IRQ_USB_DMA, .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, + .name = dma }, }; Index: linux-omap-pm/arch/blackfin/mach-bf548/boards/cm_bf548.c === --- linux-omap-pm.orig/arch/blackfin/mach-bf548/boards/cm_bf548.c +++ linux-omap-pm/arch/blackfin/mach-bf548/boards/cm_bf548.c @@ -482,11 +482,13 @@ static struct resource musb_resources[] .start = IRQ_USB_INT0, .end= IRQ_USB_INT0, .flags = IORESOURCE_IRQ |
[PATCH 2/9 v3] usb: musb: Remove board_data parameter from musb_platform_init()
Removed the board_data parameter being passed to musb_platform_init function as board data can be extracted from device structure which is already member of musb structure. Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- drivers/usb/musb/blackfin.c |2 +- drivers/usb/musb/davinci.c |2 +- drivers/usb/musb/musb_core.c |2 +- drivers/usb/musb/musb_core.h |2 +- drivers/usb/musb/omap2430.c |6 -- drivers/usb/musb/tusb6010.c |2 +- 6 files changed, 9 insertions(+), 7 deletions(-) Index: linux-omap-pm/drivers/usb/musb/blackfin.c === --- linux-omap-pm.orig/drivers/usb/musb/blackfin.c +++ linux-omap-pm/drivers/usb/musb/blackfin.c @@ -323,7 +323,7 @@ int musb_platform_set_mode(struct musb * return -EIO; } -int __init musb_platform_init(struct musb *musb, void *board_data) +int __init musb_platform_init(struct musb *musb) { /* Index: linux-omap-pm/drivers/usb/musb/davinci.c === --- linux-omap-pm.orig/drivers/usb/musb/davinci.c +++ linux-omap-pm/drivers/usb/musb/davinci.c @@ -376,7 +376,7 @@ int musb_platform_set_mode(struct musb * return -EIO; } -int __init musb_platform_init(struct musb *musb, void *board_data) +int __init musb_platform_init(struct musb *musb) { void __iomem*tibase = musb-ctrl_base; u32 revision; Index: linux-omap-pm/drivers/usb/musb/musb_core.c === --- linux-omap-pm.orig/drivers/usb/musb/musb_core.c +++ linux-omap-pm/drivers/usb/musb/musb_core.c @@ -2022,7 +2022,7 @@ bad_config: * isp1504, non-OTG, etc) mostly hooking up through ULPI. */ musb-isr = generic_interrupt; - status = musb_platform_init(musb, plat-board_data); + status = musb_platform_init(musb); if (status 0) goto fail2; Index: linux-omap-pm/drivers/usb/musb/musb_core.h === --- linux-omap-pm.orig/drivers/usb/musb/musb_core.h +++ linux-omap-pm/drivers/usb/musb/musb_core.h @@ -612,7 +612,7 @@ extern int musb_platform_get_vbus_status #define musb_platform_get_vbus_status(x) 0 #endif -extern int __init musb_platform_init(struct musb *musb, void *board_data); +extern int __init musb_platform_init(struct musb *musb); extern int musb_platform_exit(struct musb *musb); #endif /* __MUSB_CORE_H__ */ Index: linux-omap-pm/drivers/usb/musb/omap2430.c === --- linux-omap-pm.orig/drivers/usb/musb/omap2430.c +++ linux-omap-pm/drivers/usb/musb/omap2430.c @@ -187,10 +187,12 @@ int musb_platform_set_mode(struct musb * return 0; } -int __init musb_platform_init(struct musb *musb, void *board_data) +int __init musb_platform_init(struct musb *musb) { u32 l; - struct omap_musb_board_data *data = board_data; + struct device *dev = musb-controller; + struct musb_hdrc_platform_data *plat = dev-platform_data; + struct omap_musb_board_data *data = plat-board_data; /* We require some kind of external transceiver, hooked * up through ULPI. TWL4030-family PMICs include one, Index: linux-omap-pm/drivers/usb/musb/tusb6010.c === --- linux-omap-pm.orig/drivers/usb/musb/tusb6010.c +++ linux-omap-pm/drivers/usb/musb/tusb6010.c @@ -1091,7 +1091,7 @@ err: return -ENODEV; } -int __init musb_platform_init(struct musb *musb, void *board_data) +int __init musb_platform_init(struct musb *musb) { struct platform_device *pdev; struct resource *mem; -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 3/9 v3] usb: musb: HWMOD database structures addition for OMAP3
OMAP3 hwmod data stuctures are populated with base address, L3 and L4 interface clocks, IRQs,and sysconfig register details. Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 101 + 1 file changed, 101 insertions(+) Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -82,6 +82,16 @@ static struct omap_hwmod omap3xxx_l3_mai }; static struct omap_hwmod omap3xxx_l4_wkup_hwmod; +static struct omap_hwmod omap3xxx_usbhsotg_hwmod; + +/* L3 - USBHSOTG interface */ +static struct omap_hwmod_ocp_if omap3xxx_usbhsotg__l3 = { + .master = omap3xxx_usbhsotg_hwmod, + .slave = omap3xxx_l3_main_hwmod, + .clk= core_l3_ick, + .user = OCP_USER_MPU, +}; + /* L4_CORE - L4_WKUP interface */ static struct omap_hwmod_ocp_if omap3xxx_l4_core__l4_wkup = { @@ -90,6 +100,37 @@ static struct omap_hwmod_ocp_if omap3xxx .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* +* USBHSOTG interface data +*/ + +static struct omap_hwmod_addr_space omap3xxx_usbhsotg_addrs[] = { + { + .pa_start = OMAP34XX_HSUSB_OTG_BASE, + .pa_end = OMAP34XX_HSUSB_OTG_BASE + SZ_4K - 1, + .flags = ADDR_TYPE_RT + }, +}; + +/* USBHSOTG - L4_CORE interface */ +static struct omap_hwmod_ocp_if omap3xxx_l4_core__usbhsotg = { + .master = omap3xxx_l4_core_hwmod, + .slave = omap3xxx_usbhsotg_hwmod, + .clk= l4_ick, + .addr = omap3xxx_usbhsotg_addrs, + .addr_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_addrs), + .user = OCP_USER_MPU, + +}; + +static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_masters[] = { + omap3xxx_usbhsotg__l3, +}; + +static struct omap_hwmod_ocp_if *omap3xxx_usbhsotg_slaves[] = { + omap3xxx_l4_core__usbhsotg, +}; + /* Slave interfaces on the L4_CORE interconnect */ static struct omap_hwmod_ocp_if *omap3xxx_l4_core_slaves[] = { omap3xxx_l3_main__l4_core, @@ -197,6 +238,69 @@ static struct omap_hwmod omap3xxx_iva_hw .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP3430) }; +/* + * USBHSOTG (USBHS) + */ +static struct omap_hwmod_class_sysconfig omap3xxx_usbhsotg_sysc = { + .rev_offs = 0x0400, + .sysc_offs = 0x0404, + .syss_offs = 0x0408, + .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| + SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | + SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), + .sysc_fields= omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class usbotg_class = { + .name = usbotg, + .sysc = omap3xxx_usbhsotg_sysc, +}; + +/* usb_otg_hs */ +static struct omap_hwmod_irq_info omap3xxx_usbhsotg_mpu_irqs[] = { + + { .name = mc, .irq = 92 }, + { .name = dma, .irq = 93 }, + +}; + +static struct omap_hwmod omap3xxx_usbhsotg_hwmod = { + .name = usb_otg_hs, + .mpu_irqs = omap3xxx_usbhsotg_mpu_irqs, + .mpu_irqs_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_mpu_irqs), + .main_clk = hsotgusb_ick, + .prcm = { + .omap2 = { + .prcm_reg_id = 1, + .module_bit = OMAP3430_GRPSEL_HSOTGUSB_MASK, + .module_offs = CORE_MOD, + .idlest_reg_id = 1, + .idlest_idle_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT, + .idlest_stdby_bit = OMAP3430ES2_ST_HSOTGUSB_STDBY_SHIFT + }, + }, + .masters= omap3xxx_usbhsotg_masters, + .masters_cnt= ARRAY_SIZE(omap3xxx_usbhsotg_masters), + .slaves = omap3xxx_usbhsotg_slaves, + .slaves_cnt = ARRAY_SIZE(omap3xxx_usbhsotg_slaves), + .class = usbotg_class, + + /* +* Errata ID: i479 idle_req / idle_ack mechanism potentially +* broken when autoidle is enabled +* workaround is to disable the autodile bit at module level. +* +* As per OMAP USBOTG specification, need to configure the USBOTG +* to smart idle/standby or no idle/standby during data transfer and +* force idle/standby when not in use to support retention and offmode. +*/ + .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE + | HWMOD_SWSUP_MSTANDBY, +
[PATCH 4/9 v3] usb: musb: HWMOD database structures addition for OMAP4
From: Cousson, Benoit b-cous...@ti.com OMAP4 hwmod data stuctures are populated with base address, L3 and L4 interface clocks, IRQs,and sysconfig register details. Signed-off-by: Cousson, Benoit b-cous...@ti.com Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 99 + 1 file changed, 99 insertions(+) Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_44xx_data.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -47,6 +47,7 @@ static struct omap_hwmod omap44xx_l4_per static struct omap_hwmod omap44xx_l4_wkup_hwmod; static struct omap_hwmod omap44xx_mpu_hwmod; static struct omap_hwmod omap44xx_mpu_private_hwmod; +static struct omap_hwmod omap44xx_usb_otg_hs_hwmod; /* * Interconnects omap_hwmod structures @@ -223,10 +224,20 @@ static struct omap_hwmod_ocp_if omap44xx .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* usb_otg_hs - l3_main_2 */ +static struct omap_hwmod_ocp_if omap44xx_usb_otg_hs__l3_main_2 = { + .master = omap44xx_usb_otg_hs_hwmod, + .slave = omap44xx_l3_main_2_hwmod, + .clk= l3_div_ck, + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + /* l3_main_2 slave ports */ static struct omap_hwmod_ocp_if *omap44xx_l3_main_2_slaves[] = { omap44xx_l3_main_1__l3_main_2, omap44xx_l4_cfg__l3_main_2, + omap44xx_usb_otg_hs__l3_main_2, + }; static struct omap_hwmod omap44xx_l3_main_2_hwmod = { @@ -452,6 +463,93 @@ static struct omap_hwmod omap44xx_mpu_hw .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), }; +/* + * 'usb_otg_hs' class + * high-speed on-the-go universal serial bus (usb_otg_hs) controller + */ + +static struct omap_hwmod_class_sysconfig omap44xx_usb_otg_hs_sysc = { + .rev_offs = 0x0400, + .sysc_offs = 0x0404, + .syss_offs = 0x0408, + .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| + SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | + SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), + .sysc_fields= omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap44xx_usb_otg_hs_hwmod_class = { + .name = usb_otg_hs, + .sysc = omap44xx_usb_otg_hs_sysc, +}; + +/* usb_otg_hs */ +static struct omap_hwmod_irq_info omap44xx_usb_otg_hs_irqs[] = { + { .name = mc, .irq = 92 + OMAP44XX_IRQ_GIC_START }, + { .name = dma, .irq = 93 + OMAP44XX_IRQ_GIC_START }, +}; + +/* usb_otg_hs master ports */ +static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_masters[] = { + omap44xx_usb_otg_hs__l3_main_2, +}; + +static struct omap_hwmod_addr_space omap44xx_usb_otg_hs_addrs[] = { + { + .pa_start = 0x4a0ab000, + .pa_end = 0x4a0ab003, + .flags = ADDR_TYPE_RT + }, +}; + +/* l4_cfg - usb_otg_hs */ +static struct omap_hwmod_ocp_if omap44xx_l4_cfg__usb_otg_hs = { + .master = omap44xx_l4_cfg_hwmod, + .slave = omap44xx_usb_otg_hs_hwmod, + .clk= l4_div_ck, + .addr = omap44xx_usb_otg_hs_addrs, + .addr_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_addrs), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* usb_otg_hs slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_usb_otg_hs_slaves[] = { + omap44xx_l4_cfg__usb_otg_hs, +}; + +static struct omap_hwmod_opt_clk usb_otg_hs_opt_clks[] = { + { .role = xclk, .clk = otg_60m_gfclk_ck }, +}; + +static struct omap_hwmod omap44xx_usb_otg_hs_hwmod = { + .name = usb_otg_hs, + .class = omap44xx_usb_otg_hs_hwmod_class, + .mpu_irqs = omap44xx_usb_otg_hs_irqs, + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_irqs), + .main_clk = usb_otg_hs_ick, + .prcm = { + .omap4 = { + .clkctrl_reg = OMAP4430_CM_L3INIT_USB_OTG_CLKCTRL, + }, + }, + .opt_clks = usb_otg_hs_opt_clks, + .opt_clks_cnt = ARRAY_SIZE(usb_otg_hs_opt_clks), + .slaves = omap44xx_usb_otg_hs_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_usb_otg_hs_slaves), + .masters= omap44xx_usb_otg_hs_masters, + .masters_cnt= ARRAY_SIZE(omap44xx_usb_otg_hs_masters), + + /* +* As per OMAP USBOTG specification, need to configure the USBOTG +* to smart idle/standby or no idle/standby during data transfer and +* force
[PATCH 5/9 v3] usb: musb: Using omap_device_build for musb device registration
Using omap_device_build api instead of platform_device_register for musb device registration.The device specific resources defined in centralized database will be used. So removed the resource definitions from the musb platform file. Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/usb-musb.c | 75 - 1 file changed, 38 insertions(+), 37 deletions(-) Index: linux-omap-pm/arch/arm/mach-omap2/usb-musb.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/usb-musb.c +++ linux-omap-pm/arch/arm/mach-omap2/usb-musb.c @@ -29,24 +29,11 @@ #include mach/hardware.h #include mach/irqs.h #include plat/usb.h +#include plat/omap_device.h #ifdef CONFIG_USB_MUSB_SOC - -static struct resource musb_resources[] = { - [0] = { /* start and end set dynamically */ - .flags = IORESOURCE_MEM, - }, - [1] = { /* general IRQ */ - .start = INT_243X_HS_USB_MC, - .flags = IORESOURCE_IRQ, - .name = mc, - }, - [2] = { /* DMA IRQ */ - .start = INT_243X_HS_USB_DMA, - .flags = IORESOURCE_IRQ, - .name = dma, - }, -}; +static const char name[] = musb_hdrc; +#define MAX_OMAP_MUSB_HWMOD_NAME_LEN 16 static struct musb_hdrc_config musb_config = { .multipoint = 1, @@ -75,31 +62,30 @@ static struct musb_hdrc_platform_data mu static u64 musb_dmamask = DMA_BIT_MASK(32); -static struct platform_device musb_device = { - .name = musb_hdrc, - .id = -1, - .dev = { - .dma_mask = musb_dmamask, - .coherent_dma_mask = DMA_BIT_MASK(32), - .platform_data = musb_plat, +static struct omap_device_pm_latency omap_musb_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, }, - .num_resources = ARRAY_SIZE(musb_resources), - .resource = musb_resources, }; void __init usb_musb_init(struct omap_musb_board_data *board_data) { - if (cpu_is_omap243x()) { - musb_resources[0].start = OMAP243X_HS_BASE; - } else if (cpu_is_omap34xx()) { - musb_resources[0].start = OMAP34XX_HSUSB_OTG_BASE; - } else if (cpu_is_omap44xx()) { - musb_resources[0].start = OMAP44XX_HSUSB_OTG_BASE; - musb_resources[1].start = OMAP44XX_IRQ_HS_USB_MC_N; - musb_resources[2].start = OMAP44XX_IRQ_HS_USB_DMA_N; + struct omap_hwmod *oh; + struct omap_device *od; + struct platform_device *pdev; + struct device *dev; + int bus_id = -1; + const char *oh_name = usb_otg_hs; + struct musb_hdrc_platform_data *pdata; + + oh = omap_hwmod_lookup(oh_name); + + if (!oh) { + pr_err(Could not look up %s\n, oh_name); + return; } - musb_resources[0].end = musb_resources[0].start + SZ_4K - 1; - /* * REVISIT: This line can be removed once all the platforms using * musb_core.c have been converted to use use clkdev. @@ -110,8 +96,23 @@ void __init usb_musb_init(struct omap_mu musb_plat.mode = board_data-mode; musb_plat.extvbus = board_data-extvbus; - if (platform_device_register(musb_device) 0) - printk(KERN_ERR Unable to register HS-USB (MUSB) device\n); + pdata = musb_plat; + + od = omap_device_build(name, bus_id, oh, pdata, + sizeof(struct musb_hdrc_platform_data), + omap_musb_latency, + ARRAY_SIZE(omap_musb_latency), false); + if (IS_ERR(od)) { + pr_err(Could not build omap_device for %s %s\n, + name, oh_name); + return; + } + pdev = od-pdev; + dev = pdev-dev; + get_device(dev); + dev-dma_mask = musb_dmamask; + dev-coherent_dma_mask = musb_dmamask; + put_device(dev); } #else -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 6/9 v3] usb: musb: HWMOD database structures addition for OMAP2430
OMAP2430 hwmod data stuctures are populated with base address, L3 and L4 interface clocks, IRQs,and sysconfig register details. Signed-off-by: Hema HK hem...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/omap_hwmod_2430_data.c | 98 + 1 file changed, 98 insertions(+) Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_2430_data.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod_2430_data.c @@ -71,6 +71,15 @@ static struct omap_hwmod omap2430_l3_mai }; static struct omap_hwmod omap2430_l4_wkup_hwmod; +static struct omap_hwmod omap2430_usbhsotg_hwmod; + +/* L3 - USBHSOTG interface */ +static struct omap_hwmod_ocp_if omap2430_usbhsotg__l3 = { + .master = omap2430_usbhsotg_hwmod, + .slave = omap2430_l3_main_hwmod, + .clk= core_l3_ck, + .user = OCP_USER_MPU, +}; /* L4_CORE - L4_WKUP interface */ static struct omap_hwmod_ocp_if omap2430_l4_core__l4_wkup = { @@ -79,6 +88,36 @@ static struct omap_hwmod_ocp_if omap2430 .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* +* USBHSOTG interface data +*/ +static struct omap_hwmod_addr_space omap2430_usbhsotg_addrs[] = { + { + .pa_start = OMAP243X_HS_BASE, + .pa_end = OMAP243X_HS_BASE + SZ_4K - 1, + .flags = ADDR_TYPE_RT + }, +}; + +/* USBHSOTG - L4_CORE interface */ +static struct omap_hwmod_ocp_if omap2430_l4_core__usbhsotg = { + .master = omap2430_l4_core_hwmod, + .slave = omap2430_usbhsotg_hwmod, + .clk= usb_l4_ick, + .addr = omap2430_usbhsotg_addrs, + .addr_cnt = ARRAY_SIZE(omap2430_usbhsotg_addrs), + .user = OCP_USER_MPU, + +}; + +static struct omap_hwmod_ocp_if *omap2430_usbhsotg_masters[] = { + omap2430_usbhsotg__l3, +}; + +static struct omap_hwmod_ocp_if *omap2430_usbhsotg_slaves[] = { + omap2430_l4_core__usbhsotg, +}; + /* Slave interfaces on the L4_CORE interconnect */ static struct omap_hwmod_ocp_if *omap2430_l4_core_slaves[] = { omap2430_l3_main__l4_core, @@ -165,12 +204,75 @@ static struct omap_hwmod omap2430_iva_hw .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) }; +/* + * USBHSOTG (USBHS) + */ +static struct omap_hwmod_class_sysconfig omap2430_usbhsotg_sysc = { + .rev_offs = 0x0400, + .sysc_offs = 0x0404, + .syss_offs = 0x0408, + .sysc_flags = (SYSC_HAS_SIDLEMODE | SYSC_HAS_MIDLEMODE| + SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | + SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART | + MSTANDBY_FORCE | MSTANDBY_NO | MSTANDBY_SMART), + .sysc_fields= omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class usbotg_class = { + .name = usbotg, + .sysc = omap2430_usbhsotg_sysc, +}; + +/* usb_otg_hs */ +static struct omap_hwmod_irq_info omap2430_usbhsotg_mpu_irqs[] = { + + { .name = mc, .irq = 92 }, + { .name = dma, .irq = 93 }, + +}; + +static struct omap_hwmod omap2430_usbhsotg_hwmod = { + .name = usb_otg_hs, + .mpu_irqs = omap2430_usbhsotg_mpu_irqs, + .mpu_irqs_cnt = ARRAY_SIZE(omap2430_usbhsotg_mpu_irqs), + .main_clk = usbhs_ick, + .prcm = { + .omap2 = { + .prcm_reg_id = 1, + .module_bit = OMAP2430_EN_USBHS_MASK, + .module_offs = CORE_MOD, + .idlest_reg_id = 1, + .idlest_idle_bit = OMAP2430_ST_USBHS_SHIFT, + }, + }, + .masters= omap2430_usbhsotg_masters, + .masters_cnt= ARRAY_SIZE(omap2430_usbhsotg_masters), + .slaves = omap2430_usbhsotg_slaves, + .slaves_cnt = ARRAY_SIZE(omap2430_usbhsotg_slaves), + .class = usbotg_class, + + /* +* Errata ID: i479 idle_req / idle_ack mechanism potentially +* broken when autoidle is enabled +* workaround is to disable the autodile bit at module level. +* +* As per OMAP USBOTG specification, need to configure the USBOTG +* to smart idle/standby or no idle/standby during data transfer and +* force idle/standby when not in use to support retention and offmode. +*/ + .flags = HWMOD_NO_OCP_AUTOIDLE | HWMOD_SWSUP_SIDLE + | HWMOD_SWSUP_MSTANDBY, + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2430) +}; + static __initdata struct omap_hwmod *omap2430_hwmods[] =
Re: [RFC] ARM: DMA coherent allocator: align remapped addresses
On 2010-07-25 15:50, Russell King - ARM Linux wrote: + * Align the virtual region allocation - maximum alignment is + * a section size, minimum is a page size. This helps reduce + * fragmentation of the DMA space, and also prevents allocations + * smaller than a section from crossing a section boundary. + */ + bit = fls(size - 1) + 1; + if (bit SECTION_SHIFT) + bit = SECTION_SHIFT; + align = 1 bit; A size of 4096 results in an alignment of 8192. Is that really intended? ixp4xx seems to run out of vmregion due to this. The patch below makes it work again. diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index 4bc43e5..7012105 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c @@ -198,7 +198,7 @@ __dma_alloc_remap(struct page *page, size_t size, gfp_t gfp, pgprot_t prot) * fragmentation of the DMA space, and also prevents allocations * smaller than a section from crossing a section boundary. */ - bit = fls(size - 1) + 1; + bit = fls(size - 1); if (bit SECTION_SHIFT) bit = SECTION_SHIFT; align = 1 bit; -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 7/9 v3] OMAP: Hwmod api changes
OMAP USBOTG modules has a requirement to set the auto idle bit only after setting smart idle bit. Modified the _sys_enable api to set the smart idle first and then the autoidle bit. Setting this will not have any impact on the other modules. Signed-off-by: Hema HK hem...@ti.com Signed-off-by: Basak, Partha p-bas...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/omap_hwmod.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod.c +++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c @@ -654,12 +654,6 @@ static void _sysc_enable(struct omap_hwm _set_master_standbymode(oh, idlemode, v); } - if (sf SYSC_HAS_AUTOIDLE) { - idlemode = (oh-flags HWMOD_NO_OCP_AUTOIDLE) ? - 0 : 1; - _set_module_autoidle(oh, idlemode, v); - } - /* XXX OCP ENAWAKEUP bit? */ /* @@ -672,6 +666,19 @@ static void _sysc_enable(struct omap_hwm _set_clockactivity(oh, oh-class-sysc-clockact, v); _write_sysconfig(v, oh); + + /* +* Set the auto idle bit only after setting the smartidle bit +* as this is requirement for some modules like USBOTG +* setting this will not have any impact on the other modues. +*/ + + if (sf SYSC_HAS_AUTOIDLE) { + idlemode = (oh-flags HWMOD_NO_OCP_AUTOIDLE) ? + 0 : 1; + _set_module_autoidle(oh, idlemode, v); + } + _write_sysconfig(v, oh); } /** -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 8/9 v3] usb : musb: Using runtime pm apis for musb.
Calling runtime pm APIs pm_runtime_put_sync() and pm_runtime_get_sync() for enabling/disabling the clocks,sysconfig settings. Also need to put the USB in force standby and force idle mode when usb not used and set it back to no idle and no stndby after wakeup. For OMAP3 auto idle bit has to be disabled because of the errata.So using HWMOD_NO_OCP_AUTOIDLE flag for OMAP3430. Signed-off-by: Hema HK hem...@ti.com Signed-off-by: Basak, Partha p-bas...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- drivers/usb/musb/musb_core.c | 26 drivers/usb/musb/omap2430.c | 45 ++- 2 files changed, 33 insertions(+), 38 deletions(-) Index: linux-omap-pm/drivers/usb/musb/musb_core.c === --- linux-omap-pm.orig/drivers/usb/musb/musb_core.c +++ linux-omap-pm/drivers/usb/musb/musb_core.c @@ -98,6 +98,7 @@ #include linux/kobject.h #include linux/platform_device.h #include linux/io.h +#include linux/pm_runtime.h #ifdef CONFIG_ARM #include mach/hardware.h @@ -2424,13 +2425,16 @@ static int musb_suspend(struct device *d * they will even be wakeup-enabled. */ } + pm_runtime_put_sync(dev); +#ifndef CONFIG_PM_RUNTIME musb_save_context(musb); if (musb-set_clock) musb-set_clock(musb-clock, 0); else clk_disable(musb-clock); +#endif spin_unlock_irqrestore(musb-lock, flags); return 0; } @@ -2443,12 +2447,16 @@ static int musb_resume_noirq(struct devi if (!musb-clock) return 0; + pm_runtime_get_sync(dev); + +#ifndef CONFIG_PM_RUNTIME if (musb-set_clock) musb-set_clock(musb-clock, 1); else clk_enable(musb-clock); musb_restore_context(musb); +#endif /* for static cmos like DaVinci, register values were preserved * unless for some reason the whole soc powered down or the USB @@ -2457,9 +2465,26 @@ static int musb_resume_noirq(struct devi return 0; } +static int musb_runtime_suspend(struct device *dev) +{ + struct musb *musb = dev_to_musb(dev); + + musb_save_context(musb); + return 0; +} + +static int musb_runtime_resume(struct device *dev) +{ + struct musb *musb = dev_to_musb(dev); + + musb_restore_context(musb); + return 0; +} static const struct dev_pm_ops musb_dev_pm_ops = { .suspend= musb_suspend, .resume_noirq = musb_resume_noirq, + .runtime_suspend = musb_runtime_suspend, + .runtime_resume = musb_runtime_resume, }; #define MUSB_DEV_PM_OPS (musb_dev_pm_ops) Index: linux-omap-pm/drivers/usb/musb/omap2430.c === --- linux-omap-pm.orig/drivers/usb/musb/omap2430.c +++ linux-omap-pm/drivers/usb/musb/omap2430.c @@ -31,6 +31,8 @@ #include linux/list.h #include linux/clk.h #include linux/io.h +#include linux/pm_runtime.h +#include linux/platform_device.h #include musb_core.h #include omap2430.h @@ -206,21 +208,6 @@ int __init musb_platform_init(struct mus musb_platform_resume(musb); - l = musb_readl(musb-mregs, OTG_SYSCONFIG); - l = ~ENABLEWAKEUP; /* disable wakeup */ - l = ~NOSTDBY; /* remove possible nostdby */ - l |= SMARTSTDBY;/* enable smart standby */ - l = ~AUTOIDLE; /* disable auto idle */ - l = ~NOIDLE; /* remove possible noidle */ - l |= SMARTIDLE; /* enable smart idle */ - /* -* MUSB AUTOIDLE don't work in 3430. -* Workaround by Richard Woodruff/TI -*/ - if (!cpu_is_omap3430()) - l |= AUTOIDLE; /* enable auto idle */ - musb_writel(musb-mregs, OTG_SYSCONFIG, l); - l = musb_readl(musb-mregs, OTG_INTERFSEL); if (data-interface_type == MUSB_INTERFACE_UTMI) { @@ -253,15 +240,13 @@ int __init musb_platform_init(struct mus void musb_platform_save_context(struct musb *musb, struct musb_context_registers *musb_context) { - musb_context-otg_sysconfig = musb_readl(musb-mregs, OTG_SYSCONFIG); - musb_context-otg_forcestandby = musb_readl(musb-mregs, OTG_FORCESTDBY); + musb_writel(musb-mregs, OTG_FORCESTDBY, ENABLEFORCE); } void musb_platform_restore_context(struct musb *musb, struct musb_context_registers *musb_context) { - musb_writel(musb-mregs, OTG_SYSCONFIG, musb_context-otg_sysconfig); - musb_writel(musb-mregs, OTG_FORCESTDBY, musb_context-otg_forcestandby); + musb_writel(musb-mregs, OTG_FORCESTDBY, 0); } #endif @@ -277,37 +262,23 @@ static int musb_platform_suspend(struct l |= ENABLEFORCE;
[PATCH 9/9 v3] usb : musb: Offmode fix for idle path
With OMAP core-off support musb was not functional as context was getting lost after wakeup from core-off. And also musb was blocking the core-off after loading the gadget driver even with no cable connected sometimes. Added the idle and wakeup APIs in the platform layer which will be called in the idle and wakeup path. Used the pm_runtime_put_sysc API to configure the musb to force idle/standby modes, saving the context and disable the clk in while idling if there is no activity on the usb bus. Used the pm_runtime_get_sync API to configure the musb to no idle/standby modes, enable the clock and restore the context after wakeup when there is no activity on the usb bus. Signed-off-by: Hema HK hem...@ti.com Signed-off-by: Maulik Mankad x0082...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/cpuidle34xx.c |1 arch/arm/mach-omap2/pm34xx.c |3 arch/arm/mach-omap2/usb-musb.c| 107 ++ arch/arm/plat-omap/include/plat/usb.h |2 drivers/usb/musb/musb_core.c | 15 drivers/usb/musb/omap2430.c | 14 include/linux/usb/musb.h |9 ++ 7 files changed, 149 insertions(+), 2 deletions(-) Index: linux-omap-pm/arch/arm/mach-omap2/cpuidle34xx.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/cpuidle34xx.c +++ linux-omap-pm/arch/arm/mach-omap2/cpuidle34xx.c @@ -31,6 +31,7 @@ #include plat/clockdomain.h #include plat/control.h #include plat/serial.h +#include plat/usb.h #include pm.h Index: linux-omap-pm/arch/arm/mach-omap2/pm34xx.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/pm34xx.c +++ linux-omap-pm/arch/arm/mach-omap2/pm34xx.c @@ -38,6 +38,7 @@ #include plat/prcm.h #include plat/gpmc.h #include plat/dma.h +#include plat/usb.h #include asm/tlbflush.h @@ -324,11 +325,13 @@ static void restore_table_entry(void) void omap3_device_idle(void) { omap2_gpio_prepare_for_idle(); + musb_prepare_for_idle(); } void omap3_device_resume(void) { omap2_gpio_resume_after_idle(); + musb_wakeup_from_idle(); } void omap_sram_idle(void) Index: linux-omap-pm/arch/arm/mach-omap2/usb-musb.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/usb-musb.c +++ linux-omap-pm/arch/arm/mach-omap2/usb-musb.c @@ -25,16 +25,21 @@ #include linux/io.h #include linux/usb/musb.h +#include linux/pm_runtime.h #include mach/hardware.h #include mach/irqs.h #include plat/usb.h #include plat/omap_device.h +#include plat/powerdomain.h #ifdef CONFIG_USB_MUSB_SOC static const char name[] = musb_hdrc; #define MAX_OMAP_MUSB_HWMOD_NAME_LEN 16 +struct omap_hwmod *oh_p; +static struct powerdomain *core_pwrdm; + static struct musb_hdrc_config musb_config = { .multipoint = 1, .dyn_fifo = 1, @@ -58,6 +63,10 @@ static struct musb_hdrc_platform_data mu * mode, and should be passed to usb_musb_init(). */ .power = 50, /* up to 100 mA */ + + /* OMAP supports offmode */ + .save_context = 1, + .restore_context= 1, }; static u64 musb_dmamask = DMA_BIT_MASK(32); @@ -80,6 +89,7 @@ void __init usb_musb_init(struct omap_mu const char *oh_name = usb_otg_hs; struct musb_hdrc_platform_data *pdata; + core_pwrdm = pwrdm_lookup(per_pwrdm); oh = omap_hwmod_lookup(oh_name); if (!oh) { @@ -97,6 +107,7 @@ void __init usb_musb_init(struct omap_mu musb_plat.extvbus = board_data-extvbus; pdata = musb_plat; + oh_p = oh; od = omap_device_build(name, bus_id, oh, pdata, sizeof(struct musb_hdrc_platform_data), @@ -115,8 +126,101 @@ void __init usb_musb_init(struct omap_mu put_device(dev); } +void musb_prepare_for_idle() +{ + int core_next_state; + struct omap_hwmod *oh = oh_p; + struct omap_device *od; + struct platform_device *pdev; + struct musb_hdrc_platform_data *pdata; + struct device *dev; + + if (!core_pwrdm) + return; + + core_next_state = pwrdm_read_next_pwrst(core_pwrdm); + if (core_next_state = PWRDM_POWER_INACTIVE) + return; + if (!oh) + return; + + od = oh-od; + pdev = od-pdev; + + if (!pdev) + return; + dev = pdev-dev; + + if (dev-driver) { + pdata = dev-platform_data; + + if (pdata-is_usb_active) + if (!pdata-is_usb_active(dev)) { + if (core_next_state == PWRDM_POWER_OFF) { + pdata-save_context =
RE: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path
-Original Message- From: Kevin Hilman [mailto:khil...@deeprootsystems.com] Sent: Wednesday, September 22, 2010 7:55 PM To: Kalliguddi, Hema Cc: linux-omap@vger.kernel.org; Varadarajan, Charulatha; Basak, Partha; Tero Kristo Subject: Re: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path Kalliguddi, Hema hem...@ti.com writes: -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap-ow...@vger.kernel.org] On Behalf Of Kevin Hilman Sent: Tuesday, September 14, 2010 4:33 AM To: linux-omap@vger.kernel.org Cc: Varadarajan, Charulatha; Basak, Partha; Tero Kristo Subject: [PATCH 2/2] OMAP2+: GPIO: move late PM out of interrupts-disabled idle path From: Kevin Hilman khil...@ti.com Currently, we wait until late in the idle path where interrupts are disabled to do runtime-PM-like management for certain special-case devices like GPIO. As a prerequiste to moving GPIO to the new runtime PM framework, move this runtime-PM-like code out of the late idle path into new device idle and resume functions that can be called before interrupts are disabled by CPUidle and/or suspend. In addition, move all the GPIO-specific logic into the GPIO core instead of keeping GPIO-specific knowledge of power-states, context saving etc. in the PM core. Also, call the new device-idle and -resume methods from CPUidle and static suspend path. Signed-off-by: Kevin Hilman khil...@ti.com --- arch/arm/mach-omap2/cpuidle34xx.c |4 ++ arch/arm/mach-omap2/pm.h |2 + arch/arm/mach-omap2/pm24xx.c |2 +- arch/arm/mach-omap2/pm34xx.c | 38 + arch/arm/plat-omap/gpio.c | 57 arch/arm/plat-omap/include/plat/gpio.h |4 +-- 6 files changed, 67 insertions(+), 40 deletions(-) diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 0923b82..681d823 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -274,9 +274,13 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, pwrdm_set_next_pwrst(per_pd, per_next_state); select_state: +omap3_device_idle(); + dev-last_state = new_state; ret = omap3_enter_idle(dev, new_state); +omap3_device_resume(); + /* Restore original PER state if it was modified */ if (per_next_state != per_saved_state) pwrdm_set_next_pwrst(per_pd, per_saved_state); diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 3de6ece..33cae4b 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -22,6 +22,8 @@ extern void omap_sram_idle(void); extern int omap3_can_sleep(void); extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_idle_init(void); +extern void omap3_device_idle(void); +extern void omap3_device_resume(void); struct cpuidle_params { u8 valid; diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index 6aeedea..7bbf0db 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c @@ -106,7 +106,7 @@ static void omap2_enter_full_retention(void) l = omap_ctrl_readl(OMAP2_CONTROL_DEVCONF0) | OMAP24XX_USBSTANDBYCTRL; omap_ctrl_writel(l, OMAP2_CONTROL_DEVCONF0); -omap2_gpio_prepare_for_idle(PWRDM_POWER_RET); +omap2_gpio_prepare_for_idle(); if (omap2_pm_debug) { omap2_pm_dump(0, 0, 0); diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index bb2ba1e..9e590d9 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -74,16 +74,6 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; static struct powerdomain *core_pwrdm, *per_pwrdm; static struct powerdomain *cam_pwrdm; -static inline void omap3_per_save_context(void) -{ -omap_gpio_save_context(); -} - -static inline void omap3_per_restore_context(void) -{ -omap_gpio_restore_context(); -} - static void omap3_enable_io_chain(void) { int timeout = 0; @@ -332,6 +322,16 @@ static void restore_table_entry(void) restore_control_register(control_reg_value); } +void omap3_device_idle(void) +{ +omap2_gpio_prepare_for_idle(); +} + Is not it is a good idea to pass the new_state as the parameter for the driver calls? It will reduce each individual drivers reading the PRCM register to findout the next state. This might save some time in the idle loop. I chose not to pass the parameters on purpose. All of the intelligence for device idle (including which powerdomain state to check) should live in the driver code. OK agree. If reading the PRCM registers is becoming a problem, it will be a simple patch to patch the powerdomain core to cache the current value of it's next state so at least reads of next_state will be fast. This is good idea, with this we can avoid n number of PRCM register reads. Today it may not be a problem as there are few
RE: [RFC v.4] omap: hwspinlock: Added hwspinlock driver
Ohad, Sorry for the late response, was away from linux-omap mailing list last few days. Please see my response. It would probably make more sense to call pm_runtime_get_sync during hwspinlock_request{_specific}, and then call pm_runtime_put during hwspinlock_free. I agree, this looks like a good approach. Thank you, Best regards, Hari -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 00/13 v2] OMAP: Serial: Add omap-serial driver with platform support
This patch series adds a serial driver to handle uarts on omap platforms. Currenlty omap-uarts are handled with 8250 driver, since updating this driver with omap specific features will over load the 8250 driver with all omap-specific data thus a new driver is added to configure and support features like dma, h/w, s/w flowcontrol for omap-uarts. Also the patch series updates various low level platform specific serial data to support omap-uarts with hwmod framework and adds support for uart4 on OMAP3630. v1 to v2 changes: 1) Incorporate timeout check http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35106.html 2) Add wk_st, padconf etc for uart4 http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35105.html Benoit Cousson (1): OMAP4: UART: Add uart1-4 hwmods data for omap4 Govindraj.R (8): OMAP2: UART: remove set_uart_globals. OMAP clock: Add uart4_ick/fck definitions for 3630 OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs OMAP3: PM: Add prepare idle and resume idle call for uart4 OMAP3: serial: Fix uart4 handling for 3630 serial: Add OMAP high-speed UART driver OMAP: SERIAL: Enable omap-serial driver in Kconfig. OMAP3: SERIAL: Initialize all omap-uarts for zoom boards Kevin Hilman (4): OMAP2/3: UART: add omap_hwmod data for UARTs 1-4 OMAP: UART: omap_device converions, remove implicit 8520 assumptions OMAP: UART: don't do automatic bus-level suspend/resume OMAP: UART: use non-locking versions of hwmod enable/idle functions arch/arm/mach-omap2/Kconfig | 11 +- arch/arm/mach-omap2/board-3630sdp.c |1 - arch/arm/mach-omap2/board-zoom-peripherals.c |1 + arch/arm/mach-omap2/clock3xxx_data.c | 22 + arch/arm/mach-omap2/cm-regbits-34xx.h |2 + arch/arm/mach-omap2/omap_hwmod_2420_data.c| 193 arch/arm/mach-omap2/omap_hwmod_2430_data.c| 193 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c| 253 +- arch/arm/mach-omap2/omap_hwmod_44xx_data.c| 235 + arch/arm/mach-omap2/pm34xx.c | 17 +- arch/arm/mach-omap2/prcm-common.h |5 + arch/arm/mach-omap2/prm-regbits-34xx.h|1 + arch/arm/mach-omap2/serial.c | 557 ++- arch/arm/plat-omap/common.c | 16 - arch/arm/plat-omap/include/plat/common.h |1 - arch/arm/plat-omap/include/plat/dma.h |2 + arch/arm/plat-omap/include/plat/irqs.h|2 + arch/arm/plat-omap/include/plat/omap-serial.h | 129 +++ drivers/serial/Kconfig| 27 + drivers/serial/Makefile |1 + drivers/serial/omap-serial.c | 1332 + include/linux/serial_core.h |3 + 22 files changed, 2707 insertions(+), 297 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/omap-serial.h create mode 100644 drivers/serial/omap-serial.c -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 01/13 v2] OMAP4: UART: Add uart1-4 hwmods data for omap4
From: Benoit Cousson b-cous...@ti.com Add uart1-4 hwmod data into omap4_hwmod data file. Signed-off-by: Benoit Cousson b-cous...@ti.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 235 1 files changed, 235 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index e20b0ee..afcbd48 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -452,6 +452,235 @@ static struct omap_hwmod omap44xx_mpu_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), }; +/* + * 'uart' class + * universal asynchronous receiver/transmitter (uart) + */ + +static struct omap_hwmod_class_sysconfig omap44xx_uart_sysc = { + .rev_offs = 0x0050, + .sysc_offs = 0x0054, + .syss_offs = 0x0058, + .sysc_flags = (SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE | + SYSC_HAS_SOFTRESET | SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_fields= omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap44xx_uart_hwmod_class = { + .name = uart, + .sysc = omap44xx_uart_sysc, +}; + +/* uart1 */ +static struct omap_hwmod omap44xx_uart1_hwmod; +static struct omap_hwmod_irq_info omap44xx_uart1_irqs[] = { + { .irq = 72 + OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_dma_info omap44xx_uart1_sdma_reqs[] = { + { .name = tx, .dma_req = 48 + OMAP44XX_DMA_REQ_START }, + { .name = rx, .dma_req = 49 + OMAP44XX_DMA_REQ_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_uart1_addrs[] = { + { + .pa_start = 0x4806a000, + .pa_end = 0x4806a0ff, + .flags = ADDR_TYPE_RT + }, +}; + +/* l4_per - uart1 */ +static struct omap_hwmod_ocp_if omap44xx_l4_per__uart1 = { + .master = omap44xx_l4_per_hwmod, + .slave = omap44xx_uart1_hwmod, + .clk= l4_div_ck, + .addr = omap44xx_uart1_addrs, + .addr_cnt = ARRAY_SIZE(omap44xx_uart1_addrs), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* uart1 slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_uart1_slaves[] = { + omap44xx_l4_per__uart1, +}; + +static struct omap_hwmod omap44xx_uart1_hwmod = { + .name = uart1, + .class = omap44xx_uart_hwmod_class, + .mpu_irqs = omap44xx_uart1_irqs, + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_uart1_irqs), + .sdma_reqs = omap44xx_uart1_sdma_reqs, + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_uart1_sdma_reqs), + .main_clk = uart1_fck, + .prcm = { + .omap4 = { + .clkctrl_reg = OMAP4430_CM_L4PER_UART1_CLKCTRL, + }, + }, + .slaves = omap44xx_uart1_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_uart1_slaves), + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), +}; + +/* uart2 */ +static struct omap_hwmod omap44xx_uart2_hwmod; +static struct omap_hwmod_irq_info omap44xx_uart2_irqs[] = { + { .irq = 73 + OMAP44XX_IRQ_GIC_START }, +}; + +static struct omap_hwmod_dma_info omap44xx_uart2_sdma_reqs[] = { + { .name = tx, .dma_req = 50 + OMAP44XX_DMA_REQ_START }, + { .name = rx, .dma_req = 51 + OMAP44XX_DMA_REQ_START }, +}; + +static struct omap_hwmod_addr_space omap44xx_uart2_addrs[] = { + { + .pa_start = 0x4806c000, + .pa_end = 0x4806c0ff, + .flags = ADDR_TYPE_RT + }, +}; + +/* l4_per - uart2 */ +static struct omap_hwmod_ocp_if omap44xx_l4_per__uart2 = { + .master = omap44xx_l4_per_hwmod, + .slave = omap44xx_uart2_hwmod, + .clk= l4_div_ck, + .addr = omap44xx_uart2_addrs, + .addr_cnt = ARRAY_SIZE(omap44xx_uart2_addrs), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* uart2 slave ports */ +static struct omap_hwmod_ocp_if *omap44xx_uart2_slaves[] = { + omap44xx_l4_per__uart2, +}; + +static struct omap_hwmod omap44xx_uart2_hwmod = { + .name = uart2, + .class = omap44xx_uart_hwmod_class, + .mpu_irqs = omap44xx_uart2_irqs, + .mpu_irqs_cnt = ARRAY_SIZE(omap44xx_uart2_irqs), + .sdma_reqs = omap44xx_uart2_sdma_reqs, + .sdma_reqs_cnt = ARRAY_SIZE(omap44xx_uart2_sdma_reqs), + .main_clk = uart2_fck, + .prcm = { + .omap4 = { + .clkctrl_reg = OMAP4430_CM_L4PER_UART2_CLKCTRL, + }, + }, + .slaves = omap44xx_uart2_slaves, + .slaves_cnt = ARRAY_SIZE(omap44xx_uart2_slaves), + .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP4430), +}; + +/*
[PATCH 02/13 v2] OMAP2/3: UART: add omap_hwmod data for UARTs 1-4
From: Kevin Hilman khil...@deeprootsystems.com This patch adds omap_hwmod data for UARTs on OMAP2 and OMAP3 platforms. UART4 support for 3630 and OMAP2 hwmod data added by Govindraj R. Signed-off-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/omap_hwmod_2420_data.c | 193 + arch/arm/mach-omap2/omap_hwmod_2430_data.c | 193 + arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 253 +++- arch/arm/mach-omap2/prcm-common.h |3 + arch/arm/plat-omap/include/plat/dma.h |2 + arch/arm/plat-omap/include/plat/irqs.h |2 + 6 files changed, 644 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index 3cc768e..ba145f7 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c @@ -15,6 +15,7 @@ #include mach/irqs.h #include plat/cpu.h #include plat/dma.h +#include plat/serial.h #include omap_hwmod_common_data.h @@ -71,6 +72,9 @@ static struct omap_hwmod omap2420_l3_main_hwmod = { }; static struct omap_hwmod omap2420_l4_wkup_hwmod; +static struct omap_hwmod omap2420_uart1_hwmod; +static struct omap_hwmod omap2420_uart2_hwmod; +static struct omap_hwmod omap2420_uart3_hwmod; /* L4_CORE - L4_WKUP interface */ static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { @@ -79,6 +83,60 @@ static struct omap_hwmod_ocp_if omap2420_l4_core__l4_wkup = { .user = OCP_USER_MPU | OCP_USER_SDMA, }; +/* L4 CORE - UART1 interface */ +static struct omap_hwmod_addr_space omap2420_uart1_addr_space[] = { + { + .pa_start = OMAP2_UART1_BASE, + .pa_end = OMAP2_UART1_BASE + SZ_8K - 1, + .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, + }, +}; + +static struct omap_hwmod_ocp_if omap2_l4_core__uart1 = { + .master = omap2420_l4_core_hwmod, + .slave = omap2420_uart1_hwmod, + .clk= uart1_ick, + .addr = omap2420_uart1_addr_space, + .addr_cnt = ARRAY_SIZE(omap2420_uart1_addr_space), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* L4 CORE - UART2 interface */ +static struct omap_hwmod_addr_space omap2420_uart2_addr_space[] = { + { + .pa_start = OMAP2_UART2_BASE, + .pa_end = OMAP2_UART2_BASE + SZ_1K - 1, + .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, + }, +}; + +static struct omap_hwmod_ocp_if omap2_l4_core__uart2 = { + .master = omap2420_l4_core_hwmod, + .slave = omap2420_uart2_hwmod, + .clk= uart2_ick, + .addr = omap2420_uart2_addr_space, + .addr_cnt = ARRAY_SIZE(omap2420_uart2_addr_space), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* L4 PER - UART3 interface */ +static struct omap_hwmod_addr_space omap2420_uart3_addr_space[] = { + { + .pa_start = OMAP2_UART3_BASE, + .pa_end = OMAP2_UART3_BASE + SZ_1K - 1, + .flags = ADDR_MAP_ON_INIT | ADDR_TYPE_RT, + }, +}; + +static struct omap_hwmod_ocp_if omap2_l4_core__uart3 = { + .master = omap2420_l4_core_hwmod, + .slave = omap2420_uart3_hwmod, + .clk= uart3_ick, + .addr = omap2420_uart3_addr_space, + .addr_cnt = ARRAY_SIZE(omap2420_uart3_addr_space), + .user = OCP_USER_MPU | OCP_USER_SDMA, +}; + /* Slave interfaces on the L4_CORE interconnect */ static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { omap2420_l3_main__l4_core, @@ -87,6 +145,9 @@ static struct omap_hwmod_ocp_if *omap2420_l4_core_slaves[] = { /* Master interfaces on the L4_CORE interconnect */ static struct omap_hwmod_ocp_if *omap2420_l4_core_masters[] = { omap2420_l4_core__l4_wkup, + omap2_l4_core__uart1, + omap2_l4_core__uart2, + omap2_l4_core__uart3, }; /* L4 CORE */ @@ -165,12 +226,144 @@ static struct omap_hwmod omap2420_iva_hwmod = { .omap_chip = OMAP_CHIP_INIT(CHIP_IS_OMAP2420) }; +/* UART */ + +static struct omap_hwmod_class_sysconfig uart_sysc = { + .rev_offs = 0x50, + .sysc_offs = 0x54, + .syss_offs = 0x58, + .sysc_flags = (SYSC_HAS_SIDLEMODE | + SYSC_HAS_ENAWAKEUP | SYSC_HAS_SOFTRESET | + SYSC_HAS_AUTOIDLE), + .idlemodes = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), + .sysc_fields= omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class uart_class = { + .name = uart, + .sysc = uart_sysc, +}; + +/* UART1 */ + +static struct omap_hwmod_irq_info uart1_mpu_irqs[] = { + { .irq = INT_24XX_UART1_IRQ, }, +}; + +static struct
[PATCH 03/13 v2] OMAP: UART: omap_device converions, remove implicit 8520 assumptions
From: Kevin Hilman khil...@ti.com Major rework of OMAP UART init for omap_device conversion as well as use with either 8250 driver or new omap-serial driver. In preparation for a new omap-serial driver, remove 8250 assumptions and dependencies from the serial core. Convert UART core and PM support to use omap_device layer. Also add support for both console on 8250 or omap-serial driver. omap_device conversion: - Convert clock API calls to omap_device calls - Remove all static platform_data setup and configuration. This is all done by the omap_device build phase. Signed-off-by: Govindraj.R govindraj.r...@ti.com Signed-off-by: Kevin Hilman khil...@ti.com --- arch/arm/mach-omap2/serial.c | 529 +- 1 files changed, 260 insertions(+), 269 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 566e991..e6c4027 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -19,19 +19,29 @@ */ #include linux/kernel.h #include linux/init.h -#include linux/serial_8250.h #include linux/serial_reg.h #include linux/clk.h #include linux/io.h #include linux/delay.h +#include linux/platform_device.h +#include linux/slab.h +#include linux/serial_8250.h + +#ifdef CONFIG_SERIAL_OMAP +#include plat/omap-serial.h +#endif #include plat/common.h #include plat/board.h #include plat/clock.h #include plat/control.h +#include plat/dma.h +#include plat/omap_hwmod.h +#include plat/omap_device.h #include prm.h #include pm.h +#include cm.h #include prm-regbits-34xx.h #define UART_OMAP_NO_EMPTY_FIFO_READ_IP_REV0x52 @@ -48,6 +58,8 @@ */ #define DEFAULT_TIMEOUT 0 +#define MAX_UART_HWMOD_NAME_LEN16 + struct omap_uart_state { int num; int can_sleep; @@ -58,14 +70,21 @@ struct omap_uart_state { void __iomem *wk_en; u32 wk_mask; u32 padconf; + u32 dma_enabled; struct clk *ick; struct clk *fck; int clocked; - struct plat_serial8250_port *p; + int irq; + int regshift; + int irqflags; + void __iomem *membase; + resource_size_t mapbase; + struct list_head node; - struct platform_device pdev; + struct omap_hwmod *oh; + struct platform_device *pdev; u32 errata; #if defined(CONFIG_ARCH_OMAP3) defined(CONFIG_PM) @@ -83,75 +102,33 @@ struct omap_uart_state { }; static LIST_HEAD(uart_list); +static u8 num_uarts; -static struct plat_serial8250_port serial_platform_data0[] = { - { - .irq= 72, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk= OMAP24XX_BASE_BAUD * 16, - }, { - .flags = 0 - } -}; - -static struct plat_serial8250_port serial_platform_data1[] = { - { - .irq= 73, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk= OMAP24XX_BASE_BAUD * 16, - }, { - .flags = 0 - } -}; - -static struct plat_serial8250_port serial_platform_data2[] = { - { - .irq= 74, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk= OMAP24XX_BASE_BAUD * 16, - }, { - .flags = 0 - } -}; - -static struct plat_serial8250_port serial_platform_data3[] = { - { - .irq= 70, - .flags = UPF_BOOT_AUTOCONF, - .iotype = UPIO_MEM, - .regshift = 2, - .uartclk= OMAP24XX_BASE_BAUD * 16, - }, { - .flags = 0 - } -}; void __init omap2_set_globals_uart(struct omap_globals *omap2_globals) { - serial_platform_data0[0].mapbase = omap2_globals-uart1_phys; - serial_platform_data1[0].mapbase = omap2_globals-uart2_phys; - serial_platform_data2[0].mapbase = omap2_globals-uart3_phys; - serial_platform_data3[0].mapbase = omap2_globals-uart4_phys; } +static struct omap_device_pm_latency omap_uart_latency[] = { + { + .deactivate_func = omap_device_idle_hwmods, + .activate_func = omap_device_enable_hwmods, + .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, + }, +}; + static inline unsigned int __serial_read_reg(struct uart_port *up, - int offset) +int offset) { offset = up-regshift; return (unsigned int)__raw_readb(up-membase + offset); } -static inline unsigned int serial_read_reg(struct plat_serial8250_port *up, +static inline unsigned int
[PATCH 04/13 v2] OMAP2: UART: remove set_uart_globals
Remove set_uart_globals function as this will not be needed as physical address for uarts will be taken from hwmod data file. Cc: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/serial.c |5 - arch/arm/plat-omap/common.c | 16 arch/arm/plat-omap/include/plat/common.h |1 - 3 files changed, 0 insertions(+), 22 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index e6c4027..6ffbc92 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -104,11 +104,6 @@ struct omap_uart_state { static LIST_HEAD(uart_list); static u8 num_uarts; - -void __init omap2_set_globals_uart(struct omap_globals *omap2_globals) -{ -} - static struct omap_device_pm_latency omap_uart_latency[] = { { .deactivate_func = omap_device_idle_hwmods, diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c index 3008e71..ab04dad 100644 --- a/arch/arm/plat-omap/common.c +++ b/arch/arm/plat-omap/common.c @@ -257,7 +257,6 @@ static void __init __omap2_set_globals(struct omap_globals *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 @@ -272,9 +271,6 @@ static struct omap_globals omap242x_globals = { .ctrl = OMAP2420_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) @@ -293,9 +289,6 @@ static struct omap_globals omap243x_globals = { .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) @@ -314,10 +307,6 @@ static struct omap_globals omap3_globals = { .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) @@ -340,10 +329,6 @@ static struct omap_globals omap4_globals = { .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) @@ -351,7 +336,6 @@ 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 diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h index c45dbb9..159e45c 100644 --- a/arch/arm/plat-omap/include/plat/common.h +++ b/arch/arm/plat-omap/include/plat/common.h @@ -66,7 +66,6 @@ void omap2_set_globals_tap(struct omap_globals *); void omap2_set_globals_sdrc(struct omap_globals *); void omap2_set_globals_control(struct omap_globals *); void omap2_set_globals_prcm(struct omap_globals *); -void omap2_set_globals_uart(struct omap_globals *); void omap3_map_io(void); -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 05/13 v2] OMAP: UART: don't do automatic bus-level suspend/resume
From: Kevin Hilman khil...@deeprootsystems.com Since the omap_device for UART is currently managed inside the idle path itself, don't let the bus-level code suspend/resume the UART. To prevent this, pm_runtime_get() is used when preparing for suspend and pm_runtime_put() is used when finished with suspend. Signed-off-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/serial.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 6ffbc92..ff83e91 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -26,6 +26,7 @@ #include linux/platform_device.h #include linux/slab.h #include linux/serial_8250.h +#include linux/pm_runtime.h #ifdef CONFIG_SERIAL_OMAP #include plat/omap-serial.h @@ -530,14 +531,17 @@ void omap_uart_enable_irqs(int enable) struct omap_uart_state *uart; list_for_each_entry(uart, uart_list, node) { - if (enable) + if (enable) { + pm_runtime_put_sync(uart-pdev-dev); ret = request_threaded_irq(uart-irq, NULL, omap_uart_interrupt, IRQF_SHARED, serial idle, (void *)uart); - else + } else { + pm_runtime_get_noresume(uart-pdev-dev); free_irq(uart-irq, (void *)uart); + } } } -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 06/13 v2] OMAP: UART: use non-locking versions of hwmod enable/idle functions
From: Kevin Hilman khil...@deeprootsystems.com Since the UART enable/idle is done during the idle path (with interrupts disabled), use the non-locking versions of the hwmod enable/idle functions. Signed-off-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/serial.c | 23 +-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index ff83e91..72b5c98 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -105,10 +105,29 @@ struct omap_uart_state { static LIST_HEAD(uart_list); static u8 num_uarts; +/* + * Since these idle/enable hooks are used in the idle path itself + * which has interrupts disabled, use the non-locking versions of + * the hwmod enable/disable functions. + */ +static int uart_idle_hwmod(struct omap_device *od) +{ + _omap_hwmod_idle(od-hwmods[0]); + + return 0; +} + +static int uart_enable_hwmod(struct omap_device *od) +{ + _omap_hwmod_enable(od-hwmods[0]); + + return 0; +} + static struct omap_device_pm_latency omap_uart_latency[] = { { - .deactivate_func = omap_device_idle_hwmods, - .activate_func = omap_device_enable_hwmods, + .deactivate_func = uart_idle_hwmod, + .activate_func = uart_enable_hwmod, .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST, }, }; -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 08/13 v2] OMAP3: PRCM: Consider UART4 for 3630 chip in prcm_setup_regs
To standarize among other uarts (1 to 3), we shall now: - Enable uart4 autodile bit. - Enable uart4 wakeup in PER. - Allow uart4 to wakeup the MPU. Signed-off-by: Sergio Aguirre saagui...@ti.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/cm-regbits-34xx.h |2 ++ arch/arm/mach-omap2/pm34xx.c | 15 +-- arch/arm/mach-omap2/prcm-common.h |2 ++ arch/arm/mach-omap2/prm-regbits-34xx.h |1 + 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/cm-regbits-34xx.h b/arch/arm/mach-omap2/cm-regbits-34xx.h index fe82b79..4f959a7 100644 --- a/arch/arm/mach-omap2/cm-regbits-34xx.h +++ b/arch/arm/mach-omap2/cm-regbits-34xx.h @@ -649,6 +649,8 @@ #define OMAP3430_ST_MCBSP2_MASK(1 0) /* CM_AUTOIDLE_PER */ +#define OMAP3630_AUTO_UART4_MASK (1 18) +#define OMAP3630_AUTO_UART4_SHIFT 18 #define OMAP3430_AUTO_GPIO6_MASK (1 17) #define OMAP3430_AUTO_GPIO6_SHIFT 17 #define OMAP3430_AUTO_GPIO5_MASK (1 16) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index d2b940c..043faaa 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -676,6 +676,14 @@ static void __init omap3_d2d_idle(void) static void __init prcm_setup_regs(void) { + u32 omap3630_auto_uart4_mask = cpu_is_omap3630() ? + OMAP3630_AUTO_UART4_MASK : 0; + u32 omap3630_en_uart4_mask = cpu_is_omap3630() ? + OMAP3630_EN_UART4_MASK : 0; + u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ? + OMAP3630_GRPSEL_UART4_MASK : 0; + + /* XXX Reset all wkdeps. This should be done when initializing * powerdomains */ prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP); @@ -762,6 +770,7 @@ static void __init prcm_setup_regs(void) CM_AUTOIDLE); cm_write_mod_reg( + omap3630_auto_uart4_mask | OMAP3430_AUTO_GPIO6_MASK | OMAP3430_AUTO_GPIO5_MASK | OMAP3430_AUTO_GPIO4_MASK | @@ -838,14 +847,16 @@ static void __init prcm_setup_regs(void) OMAP3430_DSS_MOD, PM_WKEN); /* Enable wakeups in PER */ - prm_write_mod_reg(OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK | + prm_write_mod_reg(omap3630_en_uart4_mask | + OMAP3430_EN_GPIO2_MASK | OMAP3430_EN_GPIO3_MASK | OMAP3430_EN_GPIO4_MASK | OMAP3430_EN_GPIO5_MASK | OMAP3430_EN_GPIO6_MASK | OMAP3430_EN_UART3_MASK | OMAP3430_EN_MCBSP2_MASK | OMAP3430_EN_MCBSP3_MASK | OMAP3430_EN_MCBSP4_MASK, OMAP3430_PER_MOD, PM_WKEN); /* and allow them to wake up MPU */ - prm_write_mod_reg(OMAP3430_GRPSEL_GPIO2_MASK | + prm_write_mod_reg(omap3630_grpsel_uart4_mask | + OMAP3430_GRPSEL_GPIO2_MASK | OMAP3430_GRPSEL_GPIO3_MASK | OMAP3430_GRPSEL_GPIO4_MASK | OMAP3430_GRPSEL_GPIO5_MASK | diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 86edcf9..298a22a 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h @@ -425,6 +425,8 @@ #define OMAP3430_EN_MCBSP2_SHIFT 0 /* CM_IDLEST_PER, PM_WKST_PER shared bits */ +#define OMAP3630_ST_UART4_SHIFT18 +#define OMAP3630_ST_UART4_MASK (1 18) #define OMAP3430_ST_GPIO6_SHIFT17 #define OMAP3430_ST_GPIO6_MASK (1 17) #define OMAP3430_ST_GPIO5_SHIFT16 diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h index 7fd6023..9e63cb7 100644 --- a/arch/arm/mach-omap2/prm-regbits-34xx.h +++ b/arch/arm/mach-omap2/prm-regbits-34xx.h @@ -122,6 +122,7 @@ #define OMAP3430_MEMRETSTATE_MASK (1 8) /* PM_MPUGRPSEL_PER, PM_IVA2GRPSEL_PER shared bits */ +#define OMAP3630_GRPSEL_UART4_MASK (1 18) #define OMAP3430_GRPSEL_GPIO6_MASK (1 17) #define OMAP3430_GRPSEL_GPIO5_MASK (1 16) #define OMAP3430_GRPSEL_GPIO4_MASK (1 15) -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 09/13 v2] OMAP3: PM: Add prepare idle and resume idle call for uart4
Add prepare idle and resume idle call for uart4 used by 3630. Cc: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/pm34xx.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 043faaa..60baffa 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -388,6 +388,7 @@ void omap_sram_idle(void) /* PER */ if (per_next_state PWRDM_POWER_ON) { omap_uart_prepare_idle(2); + omap_uart_prepare_idle(3); omap2_gpio_prepare_for_idle(per_next_state); if (per_next_state == PWRDM_POWER_OFF) omap3_per_save_context(); @@ -459,6 +460,7 @@ void omap_sram_idle(void) if (per_prev_state == PWRDM_POWER_OFF) omap3_per_restore_context(); omap_uart_resume_idle(2); + omap_uart_resume_idle(3); } /* Disable IO-PAD and IO-CHAIN wakeup */ -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 10/13 v2] OMAP3: serial: Fix uart4 handling for 3630
This patch makes the following: - Adds missing wakeup padding register handling. - Fixes a hardcode to use PER module ONLY on UART3. Signed-off-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Sergio Aguirre saagui...@ti.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/serial.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index 72b5c98..c1404af 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -57,7 +57,7 @@ * disabled via sysfs. This also causes that any deeper omap sleep states are * blocked. */ -#define DEFAULT_TIMEOUT 0 +#define DEFAULT_TIMEOUT 5 #define MAX_UART_HWMOD_NAME_LEN16 @@ -487,7 +487,7 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) omap_uart_smart_idle_enable(uart, 0); if (cpu_is_omap34xx()) { - u32 mod = (uart-num == 2) ? OMAP3430_PER_MOD : CORE_MOD; + u32 mod = (uart-num 1) ? OMAP3430_PER_MOD : CORE_MOD; u32 wk_mask = 0; u32 padconf = 0; @@ -506,6 +506,10 @@ static void omap_uart_idle_init(struct omap_uart_state *uart) wk_mask = OMAP3430_ST_UART3_MASK; padconf = 0x19e; break; + case 3: + wk_mask = OMAP3630_ST_UART4_MASK; + padconf = 0x0d2; + break; } uart-wk_mask = wk_mask; uart-padconf = padconf; -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 11/13 v2] serial: Add OMAP high-speed UART driver
This patch adds driver support for OMAP2/3/4 high speed UART. The driver is made separate from 8250 driver as we cannot over load 8250 driver with omap platform specific configuration for features like DMA, it makes easier to implement features like DMA and hardware flow control and software flow control configuration with this driver as required for the omap-platform. This patch involves only the core driver and its dependent. Cc: Tony Lindgren t...@atomide.com Tested-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/plat-omap/include/plat/omap-serial.h | 129 +++ drivers/serial/Kconfig| 27 + drivers/serial/Makefile |1 + drivers/serial/omap-serial.c | 1332 + include/linux/serial_core.h |3 + 5 files changed, 1492 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/omap-serial.h create mode 100644 drivers/serial/omap-serial.c diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h new file mode 100644 index 000..0d6f076 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -0,0 +1,129 @@ +/* + * Driver for OMAP-UART controller. + * Based on drivers/serial/8250.c + * + * Copyright (C) 2010 Texas Instruments. + * + * Authors: + * Govindraj R govindraj.r...@ti.com + * Thara Gopinath th...@ti.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef __OMAP_SERIAL_H__ +#define __OMAP_SERIAL_H__ + +#include linux/serial_core.h +#include linux/platform_device.h + +#include plat/control.h +#include plat/mux.h + +#define DRIVER_NAMEomap-hsuart + +/* + * Use tty device name as ttyO, [O - OMAP] + * in bootargs we specify as console=ttyO0 if uart1 + * is used as console uart. + */ +#define OMAP_SERIAL_NAME ttyO + +#define OMAP_MDR1_DISABLE 0x07 +#define OMAP_MDR1_MODE13X 0x03 +#define OMAP_MDR1_MODE16X 0x00 +#define OMAP_MODE13X_SPEED 230400 + +/* + * LCR = 0XBF: Switch to Configuration Mode B. + * In configuration mode b allow access + * to EFR,DLL,DLH. + * Reference OMAP TRM Chapter 17 + * Section: 1.4.3 Mode Selection + */ +#define OMAP_UART_LCR_CONF_MDB 0XBF + +/* WER = 0x7F + * Enable module level wakeup in WER reg + */ +#define OMAP_UART_WER_MOD_WKUP 0X7F + +/* Enable XON/XOFF flow control on output */ +#define OMAP_UART_SW_TX0x04 + +/* Enable XON/XOFF flow control on input */ +#define OMAP_UART_SW_RX0x04 + +#define OMAP_UART_SYSC_RESET 0X07 +#define OMAP_UART_TCR_TRIG 0X0F +#define OMAP_UART_SW_CLR 0XF0 +#define OMAP_UART_FIFO_CLR 0X06 + +#define OMAP_UART_DMA_CH_FREE -1 + +#define RX_TIMEOUT (3 * HZ) +#define OMAP_MAX_HSUART_PORTS 4 + +#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA + +struct omap_uart_port_info { + booldma_enabled;/* To specify DMA Mode */ + unsigned intuartclk;/* UART clock rate */ + void __iomem*membase; /* ioremap cookie or NULL */ + resource_size_t mapbase;/* resource base */ + unsigned long irqflags; /* request_irq flags */ + upf_t flags; /* UPF_* flags */ +}; + +struct uart_omap_dma { + u8 uart_dma_tx; + u8 uart_dma_rx; + int rx_dma_channel; + int tx_dma_channel; + dma_addr_t rx_buf_dma_phys; + dma_addr_t tx_buf_dma_phys; + unsigned intuart_base; + /* +* Buffer for rx dma.It is not required for tx because the buffer +* comes from port structure. +*/ + unsigned char *rx_buf; + unsigned intprev_rx_dma_pos; + int tx_buf_size; + int tx_dma_used; + int rx_dma_used; + spinlock_t tx_lock; + spinlock_t rx_lock; + /* timer to poll activity on rx dma */ + struct timer_list rx_timer; + int rx_buf_size; + int rx_timeout; +}; + +struct uart_omap_port { + struct uart_portport; + struct uart_omap_dmauart_dma; + struct platform_device *pdev; + + unsigned char ier; + unsigned char lcr; + unsigned char mcr; + unsigned char fcr; + unsigned char efr; + + int use_dma; + /* +* Some bits in registers are
[PATCH 12/13 v2] OMAP: SERIAL: Enable omap-serial driver in Kconfig
Enable omap-serial driver in /mach-omap2/Kconfig and move 8250 driver selection for zoom boards. With omap-serial driver addition all omap-uarts can be handled with omap-serial driver. With addition of omap-serial driver console parameter needs be changed in bootargs from ttyS* should be replaced with ttyO* [O -- OMAP not ZERO] For example: ttyS0[UART1 on 3430SDP] changes to ttyO0. But with some boards that do not use omap-uart as console uart. we need to handle them with 8250 driver. Ex: ZOOM2/3. For zoom2/3 board we need to use 8250 serial driver and console parameter will remain ttyS0 which basically uses a Quad uart placed on the debug board connected through a gpio line. Cc: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/Kconfig | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index b48bacf..19b6c5f 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -11,9 +11,8 @@ config ARCH_OMAP2PLUS_TYPICAL select PM_RUNTIME select VFP select NEON if ARCH_OMAP3 || ARCH_OMAP4 - select SERIAL_8250 - select SERIAL_CORE_CONSOLE - select SERIAL_8250_CONSOLE + select SERIAL_OMAP + select SERIAL_OMAP_CONSOLE select I2C select I2C_OMAP select MFD @@ -200,12 +199,18 @@ config MACH_OMAP_ZOOM2 depends on ARCH_OMAP3 default y select OMAP_PACKAGE_CBB + select SERIAL_8250 + select SERIAL_CORE_CONSOLE + select SERIAL_8250_CONSOLE config MACH_OMAP_ZOOM3 bool OMAP3630 Zoom3 board depends on ARCH_OMAP3 default y select OMAP_PACKAGE_CBP + select SERIAL_8250 + select SERIAL_CORE_CONSOLE + select SERIAL_8250_CONSOLE config MACH_CM_T35 bool CompuLab CM-T35 module -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 13/13 v2] OMAP3: SERIAL: Initialize all omap-uarts for zoom boards
Iniatize all omap-uarts for zoom boards. Remove serial_init from 3630sdp board init as zoom_peripheral_init does the same. Signed-off-by: Kevin Hilman khil...@ti.com Signed-off-by: Anand Gadiyar gadi...@ti.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/board-3630sdp.c |1 - arch/arm/mach-omap2/board-zoom-peripherals.c |1 + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index b359c3f..d510451 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c @@ -208,7 +208,6 @@ static struct flash_partitions sdp_flash_partitions[] = { static void __init omap_sdp_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); - omap_serial_init(); zoom_peripherals_init(); board_smc91x_init(); board_flash_init(sdp_flash_partitions, chip_sel_sdp); diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 6b39849..641765a 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -282,4 +282,5 @@ void __init zoom_peripherals_init(void) omap_i2c_init(); usb_musb_init(musb_board_data); enable_board_wakeup_source(); + omap_serial_init(); } -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 3/4 v2] omap: hwspinlock: Created driver for OMAP hardware spinlock.
Tony, Thanks for your comments. * Que, Simon s...@ti.com [100811 17:22]: Created driver for OMAP hardware spinlock. - Reserved spinlocks for internal use - Dynamic allocation of unreserved locks - Lock, unlock, and trylock functions, with or without disabling irqs/preempt - Registered as a platform device driver --- /dev/null +++ b/arch/arm/mach-omap2/hwspinlocks.c @@ -0,0 +1,65 @@ +int __init hwspinlocks_init(void) +{ + int retval = 0; + + struct omap_hwmod *oh; + const char *oh_name, *pdev_name; + + oh_name = spinlock; + oh = omap_hwmod_lookup(oh_name); + if (WARN_ON(oh == NULL)) + return -EINVAL; + + pdev_name = hwspinlock; + + /* Pass data to device initialization */ + omap_device_build(pdev_name, 0, oh, NULL, 0, omap_spinlock_latency, + ARRAY_SIZE(omap_spinlock_latency), false); + + return retval; +} +postcore_initcall(hwspinlocks_init); Is this initcall safe to run on all omaps or do you need some extra checks for it? It is not since hwspinlock is not even present in pre-omap4. Do you suggest adding a check for if (cpu_is_omap44xx()) in the init function ? --- /dev/null +++ b/arch/arm/plat-omap/hwspinlock.c @@ -0,0 +1,353 @@ +EXPORT_SYMBOL(hwspinlock_lock); +EXPORT_SYMBOL(hwspinlock_trylock); +EXPORT_SYMBOL(hwspinlock_unlock); +EXPORT_SYMBOL(hwspinlock_request); +EXPORT_SYMBOL(hwspinlock_request_specific); +EXPORT_SYMBOL(hwspinlock_free); Do we really want to export these functions? I think we're better off implementing low-level functions in the platform init code that are passed to the drivers in the platform_data. This way the drivers stay generic, and we don't add yet another non-standard layer that will get misused all over the drivers. If you really want to export these functions to the drivers, then all this code should live somewherew under drivers as well. I agree. Will make this change in next revision. Thank you, Best regards, Hari -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 3/5] OMAP: hwmod: Enable module wakeup if in smartidle
Hello Sergei, On Wed, 22 Sep 2010, Sergei Shtylyov wrote: This line is overindented... Thanks, updated the patch (below). - Paul From 9980ce53c97392a3dbdc9d1ac3e455d79b4167ed Mon Sep 17 00:00:00 2001 From: Rajendra Nayak rna...@ti.com Date: Tue, 21 Sep 2010 19:58:30 +0530 Subject: [PATCH] OMAP: hwmod: Enable module wakeup if in smartidle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If a module's OCP slave port is programmed to be in smartidle, its also necessary that they have module level wakeup enabled. Update _sysc_enable in hwmod framework to do this. The thread [PATCH 7/8] : Hwmod api changes archived here: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34212.html has additional technical information on the rationale of this patch. Sergei Shtylyov sshtyl...@mvista.com identified an indentation problem with this patch - thanks, Sergei. Signed-off-by: Rajendra Nayak rna...@ti.com Signed-off-by: Partha Basak p-bas...@ti.com Signed-off-by: Benoît Cousson b-cous...@ti.com [p...@pwsan.com: revised patch description] Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Sergei Shtylyov sshtyl...@mvista.com --- arch/arm/mach-omap2/omap_hwmod.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index f320cfb..d694067 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -691,8 +691,6 @@ static void _sysc_enable(struct omap_hwmod *oh) _set_module_autoidle(oh, idlemode, v); } - /* XXX OCP ENAWAKEUP bit? */ - /* * XXX The clock framework should handle this, by * calling into this code. But this must wait until the @@ -703,6 +701,10 @@ static void _sysc_enable(struct omap_hwmod *oh) _set_clockactivity(oh, oh-class-sysc-clockact, v); _write_sysconfig(v, oh); + + /* If slave is in SMARTIDLE, also enable wakeup */ + if ((sf SYSC_HAS_SIDLEMODE) !(oh-flags HWMOD_SWSUP_SIDLE)) + _enable_wakeup(oh); } /** -- 1.7.1
Re: [PATCH] tracing, perf: add more power related events
Hi, Here is a patch that redefines the power events API. The advantages are: easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation! Thomas, this patch has your patch above merged in ('power-trace: Use power_switch_state instead of power_start and power_end'). The revised ACPI patch is coming asap. The trace points for x86 and OMAP are also udated accordingly. The pytimechart tool needs an update for the new API. This can be done as soon as the kernel code gets merged in. Please note the point below about the existing code in builtin-timechart.c. On Sat, Sep 18, 2010 at 12:26 AM, Thomas Renninger tr...@suse.de wrote: On Friday 17 September 2010 18:24:12 Ingo Molnar wrote: * Thomas Renninger tr...@suse.de wrote: On Friday 17 September 2010 16:24:59 Ingo Molnar wrote: [ You dont even have to document it, as good code is self-explanatory ;-) ] I recently posted a patch exporting some things through /sys/kernel/debug/... Greg complained that a file for Documentation/ABI/{testing,stable}/* is missing and I fully agree. The proposed patch has the documentation in Documentation/trace/events-power.txt. If different userspace apps should make use of this (in above case nobody than my debug userspace tool will...) and this should be called something like an API, it should be documented and if something changes, it should first be marked deprecated, etc. Note: the exsiting code in tools/perf/builtin-timechart.c needs an update for the new events API. Is this code still maintained? I not, could pytimechart be merged in instead? Feedback is welcome! Thomas Thanks, Jean --- From f37d1875050d33273b10e99497b4059b37e6680d Mon Sep 17 00:00:00 2001 From: Jean Pihet jean.pi...@newoldbits.com Date: Wed, 22 Sep 2010 17:10:47 +0200 Subject: [PATCH] tools, perf: redefine the power events API Redefine the API with: - power_switch_state for C-, P- and S-states, - clock and power_domain events The new API allows easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation. The new events are used by the x86 and OMAP platforms. Signed-off-by: Jean Pihet j-pi...@ti.com --- Documentation/trace/events-power.txt | 70 + arch/arm/mach-omap2/cpuidle34xx.c|3 + arch/arm/mach-omap2/pm34xx.c | 11 arch/arm/mach-omap2/powerdomain.c|3 + arch/arm/plat-omap/clock.c | 13 - arch/arm/plat-omap/cpu-omap.c|3 + arch/x86/kernel/process.c| 13 +++-- arch/x86/kernel/process_32.c |3 +- arch/x86/kernel/process_64.c |3 +- drivers/cpufreq/cpufreq.c|3 +- drivers/cpuidle/cpuidle.c|2 +- drivers/idle/intel_idle.c|2 +- include/trace/events/power.h | 95 -- kernel/trace/power-traces.c |2 - 14 files changed, 161 insertions(+), 65 deletions(-) create mode 100644 Documentation/trace/events-power.txt diff --git a/Documentation/trace/events-power.txt b/Documentation/trace/events-power.txt new file mode 100644 index 000..967f842 --- /dev/null +++ b/Documentation/trace/events-power.txt @@ -0,0 +1,70 @@ + + Subsystem Trace Points: power + +The power tracing system captures events related to power transitions +within the kernel. Broadly speaking there are three major subheadings: + + o Power state switch which reports events related to suspend (S-states), + cpuidle (C-states) and cpufreq (P-states) + o System clock related changes + o Power domains related changes and transitions + +This document describes what each of the tracepoints is and why they +might be useful. + +Cf. include/trace/events/power.h for the events definitions. + +1. Power state switch events + + +power_switch_state type=%lu state=%lu sub_state=%lu cpu_id=%lu + +The 'type' parameter takes one of those macros: + . POWER_NONE = 0, + . POWER_CSTATE= 1,/* C-State */ + . POWER_PSTATE= 2,/* Fequency change or DVFS */ + . POWER_SSTATE= 3,/* Suspend */ + +The 'state' parameter is set depending on the type: + . Target C-state for type=POWER_CSTATE, + . Target frequency for type=POWER_PSTATE, + . Target suspend state for type=POWER_SSTATE + +Note: the value of '0' for state means an exit from the current state, +i.e. power_switch_state(POWER_SSTATE, 1, 0, cpu) means 'the system enters +the suspend state' while power_switch_state(POWER_SSTATE, 0, 0, cpu) means +'the system exits the suspend state). + +The event which has 'state=0' is very important to the user space tools +which are using it to detect the end of the current state, and so to correctly +draw the states diagrams and to calculate accurate statistics etc. + +The 'sub_state' parameter is
Re: [PATCH] tracing, perf: add more power related events
On 9/22/2010 8:31 AM, Jean Pihet wrote: Hi, Here is a patch that redefines the power events API. The advantages are: easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation! Thomas, this patch has your patch above merged in ('power-trace: Use power_switch_state instead of power_start and power_end'). The revised ACPI patch is coming asap. The trace points for x86 and OMAP are also udated accordingly. The pytimechart tool needs an update for the new API. This can be done as soon as the kernel code gets merged in. unfortunately this code is changing a userspace ABI... we really shouldn't do that if we can avoid it, and here we can avoid it. applications ARE using this stuff! -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: The current clock44xx_data.c, after applying recent patches
On Wed, 22 Sep 2010, Cousson, Benoit wrote: On 9/22/2010 9:33 AM, Paul Walmsley wrote: Hi Benoît, Rajendra, Here's the clock44xx_data.c that I ended up with, after applying the recent patches. It seems to compare well with the autogenerator output, but maybe you might find some important diffs. I checked the diff with the autogen, and found 2 new issues due to some changes introduce in ES2. I had to fix the script to handle these tricky cases. There is one conflict with the USIM optional clock module that is named usim_fclk which is also the name of its parent clock :-( The other one is due to the module that generate the USB PHY clock. They changed the position of the clock node register from the ocp2scp to the cm_always_on module. I fixed that as well. None of these clock nodes are used today, because the USB is still not hwmod adapted. I'll send you the fix right now. Excellent, thanks Benoît. - Paul
Re: [PATCH] tracing, perf: add more power related events
On Wed, Sep 22, 2010 at 5:33 PM, Arjan van de Ven ar...@linux.intel.com wrote: On 9/22/2010 8:31 AM, Jean Pihet wrote: Hi, Here is a patch that redefines the power events API. The advantages are: easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation! Thomas, this patch has your patch above merged in ('power-trace: Use power_switch_state instead of power_start and power_end'). The revised ACPI patch is coming asap. The trace points for x86 and OMAP are also udated accordingly. The pytimechart tool needs an update for the new API. This can be done as soon as the kernel code gets merged in. unfortunately this code is changing a userspace ABI... we really shouldn't do that if we can avoid it, and here we can avoid it. applications ARE using this stuff! What are the apps that are using it? I know about builtin-timechart, pytimechart. Is powertop using this as well? Is it better to go for a 3 steps approach (add new API, change tools, deprecate old API) like proposed above? Thanks, Jean -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] OMAP4: clocks: Fix ES2 clock issues
- usim optional clock are its parent had the same name, rename the parent usim_fclk - usim_ck - OPTFCLKEN_CLK32K is not handled anymore by the USBPHYOCP2SCP module in ES2 Create a new clock that belongs to CM_ALWON_USBPHY_CLKCTRL register Signed-off-by: Benoit Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Rajendra Nayak rna...@ti.com --- arch/arm/mach-omap2/clock44xx_data.c | 88 +- 1 files changed, 55 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index d612e55..edf2c28 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -2033,23 +2033,23 @@ static struct clk mmc5_fck = { .recalc = followparent_recalc, }; -static struct clk ocp2scp_usb_phy_clk32k = { - .name = ocp2scp_usb_phy_clk32k, +static struct clk ocp2scp_usb_phy_phy_48m = { + .name = ocp2scp_usb_phy_phy_48m, .ops= clkops_omap2_dflt, .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, - .enable_bit = OMAP4430_OPTFCLKEN_CLK32K_SHIFT, + .enable_bit = OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, .clkdm_name = l3_init_clkdm, - .parent = sys_32k_ck, + .parent = func_48m_fclk, .recalc = followparent_recalc, }; -static struct clk ocp2scp_usb_phy_phy_48m = { - .name = ocp2scp_usb_phy_phy_48m, +static struct clk ocp2scp_usb_phy_ick = { + .name = ocp2scp_usb_phy_ick, .ops= clkops_omap2_dflt, .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, - .enable_bit = OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, + .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = l3_init_clkdm, - .parent = func_48m_fclk, + .parent = l4_div_ck, .recalc = followparent_recalc, }; @@ -2595,6 +2595,16 @@ static struct clk usb_otg_hs_ick = { .recalc = followparent_recalc, }; +static struct clk usb_phy_cm_clk32k = { + .name = usb_phy_cm_clk32k, + .ops= clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_ALWON_USBPHY_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_CLK32K_SHIFT, + .clkdm_name = l4_ao_clkdm, + .parent = sys_32k_ck, + .recalc = followparent_recalc, +}; + static struct clk usb_tll_hs_usb_ch2_clk = { .name = usb_tll_hs_usb_ch2_clk, .ops= clkops_omap2_dflt, @@ -2635,6 +2645,39 @@ static struct clk usb_tll_hs_ick = { .recalc = followparent_recalc, }; +static const struct clksel_rate div2_14to18_rates[] = { + { .div = 14, .val = 0, .flags = RATE_IN_4430 }, + { .div = 18, .val = 1, .flags = RATE_IN_4430 }, + { .div = 0 }, +}; + +static const struct clksel usim_fclk_div[] = { + { .parent = dpll_per_m4_ck, .rates = div2_14to18_rates }, + { .parent = NULL }, +}; + +static struct clk usim_ck = { + .name = usim_ck, + .parent = dpll_per_m4_ck, + .clksel = usim_fclk_div, + .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, + .clksel_mask= OMAP4430_CLKSEL_DIV_MASK, + .ops= clkops_null, + .recalc = omap2_clksel_recalc, + .round_rate = omap2_clksel_round_rate, + .set_rate = omap2_clksel_set_rate, +}; + +static struct clk usim_fclk = { + .name = usim_fclk, + .ops= clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_FCLK_SHIFT, + .clkdm_name = l4_wkup_clkdm, + .parent = usim_ck, + .recalc = followparent_recalc, +}; + static struct clk usim_fck = { .name = usim_fck, .ops= clkops_omap2_dflt, @@ -2700,29 +2743,6 @@ static struct clk trace_clk_div_ck = { .set_rate = omap2_clksel_set_rate, }; -static const struct clksel_rate div2_14to18_rates[] = { - { .div = 14, .val = 0, .flags = RATE_IN_4430 }, - { .div = 18, .val = 1, .flags = RATE_IN_4430 }, - { .div = 0 }, -}; - -static const struct clksel usim_fclk_div[] = { - { .parent = dpll_per_m4_ck, .rates = div2_14to18_rates }, - { .parent = NULL }, -}; - -static struct clk usim_fclk = { - .name = usim_fclk, - .parent = dpll_per_m4_ck, - .clksel = usim_fclk_div, - .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, - .clksel_mask= OMAP4430_CLKSEL_DIV_MASK, - .ops= clkops_null, - .recalc = omap2_clksel_recalc, - .round_rate = omap2_clksel_round_rate, - .set_rate = omap2_clksel_set_rate, -}; - /* * clkdev */ @@ -2879,8 +2899,8 @@ static struct omap_clk
Re: [PATCH] OMAP4: clocks: Fix ES2 clock issues
On Wed, 22 Sep 2010, Benoit Cousson wrote: - usim optional clock are its parent had the same name, rename the parent usim_fclk - usim_ck - OPTFCLKEN_CLK32K is not handled anymore by the USBPHYOCP2SCP module in ES2 Create a new clock that belongs to CM_ALWON_USBPHY_CLKCTRL register Signed-off-by: Benoit Cousson b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com Cc: Rajendra Nayak rna...@ti.com Thanks for the fast update, Benoît; queued for 2.6.37 with some updates to the patch description (below) - Paul From db1cad403e005c7eda09f7eac45b7c20c8c4500f Mon Sep 17 00:00:00 2001 From: Benoit Cousson b-cous...@ti.com Date: Wed, 22 Sep 2010 17:40:05 +0200 Subject: [PATCH] OMAP4: clocks: Fix ES2 clock issues Fix a few OMAP4430 clock tree problems after the recent manual merge of the various ES2 clock patches: - usim optional clock and its parent had the same name, rename the parent usim_fclk - usim_ck - OPTFCLKEN_CLK32K is not handled anymore by the USBPHYOCP2SCP module in ES2 Create a new clock that belongs to CM_ALWON_USBPHY_CLKCTRL register This patch depends on some of the PRCM macro updates from Rajendra. Signed-off-by: Benoit Cousson b-cous...@ti.com [p...@pwsan.com: tweaked patch description] Signed-off-by: Paul Walmsley p...@pwsan.com Cc: Rajendra Nayak rna...@ti.com --- arch/arm/mach-omap2/clock44xx_data.c | 88 +- 1 files changed, 55 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index d612e55..edf2c28 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -2033,23 +2033,23 @@ static struct clk mmc5_fck = { .recalc = followparent_recalc, }; -static struct clk ocp2scp_usb_phy_clk32k = { - .name = ocp2scp_usb_phy_clk32k, +static struct clk ocp2scp_usb_phy_phy_48m = { + .name = ocp2scp_usb_phy_phy_48m, .ops= clkops_omap2_dflt, .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, - .enable_bit = OMAP4430_OPTFCLKEN_CLK32K_SHIFT, + .enable_bit = OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, .clkdm_name = l3_init_clkdm, - .parent = sys_32k_ck, + .parent = func_48m_fclk, .recalc = followparent_recalc, }; -static struct clk ocp2scp_usb_phy_phy_48m = { - .name = ocp2scp_usb_phy_phy_48m, +static struct clk ocp2scp_usb_phy_ick = { + .name = ocp2scp_usb_phy_ick, .ops= clkops_omap2_dflt, .enable_reg = OMAP4430_CM_L3INIT_USBPHYOCP2SCP_CLKCTRL, - .enable_bit = OMAP4430_OPTFCLKEN_PHY_48M_SHIFT, + .enable_bit = OMAP4430_MODULEMODE_HWCTRL, .clkdm_name = l3_init_clkdm, - .parent = func_48m_fclk, + .parent = l4_div_ck, .recalc = followparent_recalc, }; @@ -2595,6 +2595,16 @@ static struct clk usb_otg_hs_ick = { .recalc = followparent_recalc, }; +static struct clk usb_phy_cm_clk32k = { + .name = usb_phy_cm_clk32k, + .ops= clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_ALWON_USBPHY_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_CLK32K_SHIFT, + .clkdm_name = l4_ao_clkdm, + .parent = sys_32k_ck, + .recalc = followparent_recalc, +}; + static struct clk usb_tll_hs_usb_ch2_clk = { .name = usb_tll_hs_usb_ch2_clk, .ops= clkops_omap2_dflt, @@ -2635,6 +2645,39 @@ static struct clk usb_tll_hs_ick = { .recalc = followparent_recalc, }; +static const struct clksel_rate div2_14to18_rates[] = { + { .div = 14, .val = 0, .flags = RATE_IN_4430 }, + { .div = 18, .val = 1, .flags = RATE_IN_4430 }, + { .div = 0 }, +}; + +static const struct clksel usim_fclk_div[] = { + { .parent = dpll_per_m4_ck, .rates = div2_14to18_rates }, + { .parent = NULL }, +}; + +static struct clk usim_ck = { + .name = usim_ck, + .parent = dpll_per_m4_ck, + .clksel = usim_fclk_div, + .clksel_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, + .clksel_mask= OMAP4430_CLKSEL_DIV_MASK, + .ops= clkops_null, + .recalc = omap2_clksel_recalc, + .round_rate = omap2_clksel_round_rate, + .set_rate = omap2_clksel_set_rate, +}; + +static struct clk usim_fclk = { + .name = usim_fclk, + .ops= clkops_omap2_dflt, + .enable_reg = OMAP4430_CM_WKUP_USIM_CLKCTRL, + .enable_bit = OMAP4430_OPTFCLKEN_FCLK_SHIFT, + .clkdm_name = l4_wkup_clkdm, + .parent = usim_ck, + .recalc = followparent_recalc, +}; + static struct clk usim_fck = { .name = usim_fck, .ops= clkops_omap2_dflt, @@ -2700,29 +2743,6 @@ static struct clk
RE: [PATCH 13/13 v2] OMAP3: SERIAL: Initialize all omap-uarts for zoom boards
Hi Govindraj, Just one non-functional comment below. -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Raja, Govindraj Sent: Wednesday, September 22, 2010 10:15 AM To: linux-omap@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org; linux-ser...@vger.kernel.org; Kevin Hilman; Tony Lindgren; Gadiyar, Anand Subject: [PATCH 13/13 v2] OMAP3: SERIAL: Initialize all omap-uarts for zoom boards Iniatize all omap-uarts for zoom boards. Remove serial_init from 3630sdp board init as zoom_peripheral_init does the same. I think this description mismatches slightly to what is really being done in the patch. I mean, the way you say it, it's like the omap_serial_init was already in zoom_peripheral_init... which is not. Regards, Sergio Signed-off-by: Kevin Hilman khil...@ti.com Signed-off-by: Anand Gadiyar gadi...@ti.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/mach-omap2/board-3630sdp.c |1 - arch/arm/mach-omap2/board-zoom-peripherals.c |1 + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach- omap2/board-3630sdp.c index b359c3f..d510451 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c @@ -208,7 +208,6 @@ static struct flash_partitions sdp_flash_partitions[] = { static void __init omap_sdp_init(void) { omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); - omap_serial_init(); zoom_peripherals_init(); board_smc91x_init(); board_flash_init(sdp_flash_partitions, chip_sel_sdp); diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 6b39849..641765a 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -282,4 +282,5 @@ void __init zoom_peripherals_init(void) omap_i2c_init(); usb_musb_init(musb_board_data); enable_board_wakeup_source(); + omap_serial_init(); } -- 1.6.3.3 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@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 majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/5] OMAP4: PM: Update PRCM register bitshits and masks for ES2
On 9/22/2010 8:43 AM, Nayak, Rajendra wrote: From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:47 AM Hi Rajendra On Thu, 16 Sep 2010, Rajendra Nayak wrote: This patch updates the PRM and CM register bitshifts and masks for OMAP4430 ES2.0. Signed-off-by: Rajendra Nayakrna...@ti.com Signed-off-by: Benoît Coussonb-cous...@ti.com Cc: Paul Walmsleyp...@pwsan.com Cc: Kevin Hilmankhil...@deeprootsystems.com Thanks, queued for 2.6.37 (with the UTF-8 fix in the patch description). One other note: #define OMAP4430_IDLEST_MASK BITFIELD(16, 17) We should really get rid of all these 'BITFIELD' defines, and just replace them with simple bitshifts. Care to spin a patch to do that during the 2.6.38 timeframe? Sure, there's already a patch for this which I guess Benoit should be posting pretty soon. Yes, I already updated the scripts a couple of weeks ago to fix that on top of Rajendra's series. Since it was not critical, I kind of forgot it :-) I can sent the fix to you right now if you want? Benoit -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/5] OMAP4: PM: Update PRCM register bitshits and masks for ES2
On Wed, 22 Sep 2010, Cousson, Benoit wrote: On 9/22/2010 8:43 AM, Nayak, Rajendra wrote: From: Paul Walmsley [mailto:p...@pwsan.com] Sent: Wednesday, September 22, 2010 11:47 AM We should really get rid of all these 'BITFIELD' defines, and just replace them with simple bitshifts. Care to spin a patch to do that during the 2.6.38 timeframe? Sure, there's already a patch for this which I guess Benoit should be posting pretty soon. Yes, I already updated the scripts a couple of weeks ago to fix that on top of Rajendra's series. Since it was not critical, I kind of forgot it :-) I can sent the fix to you right now if you want? Sure, if you have it ready to go, I'll take it. - Paul -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 7/9 v3] OMAP: Hwmod api changes
Hello. Hema HK wrote: OMAP USBOTG modules has a requirement to set the auto idle bit only after setting smart idle bit. Modified the _sys_enable api to set the smart idle first and then the autoidle bit. Setting this will not have any impact on the other modules. Signed-off-by: Hema HK hem...@ti.com Signed-off-by: Basak, Partha p-bas...@ti.com Cc: Felipe Balbi ba...@ti.com Cc: Tony Lindgren t...@atomide.com Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Cousson, Benoit b-cous...@ti.com Cc: Paul Walmsley p...@pwsan.com --- arch/arm/mach-omap2/omap_hwmod.c | 18 -- 1 file changed, 12 insertions(+), 6 deletions(-) Index: linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c === --- linux-omap-pm.orig/arch/arm/mach-omap2/omap_hwmod.c +++ linux-omap-pm/arch/arm/mach-omap2/omap_hwmod.c [...] @@ -672,6 +666,19 @@ static void _sysc_enable(struct omap_hwm _set_clockactivity(oh, oh-class-sysc-clockact, v); _write_sysconfig(v, oh); + + /* +* Set the auto idle bit only after setting the smartidle bit +* as this is requirement for some modules like USBOTG Need period at the end of sentense, and the next sentense should satrt with capital letter. Sorry for the grammar nitpicking. :-) +* setting this will not have any impact on the other modues. +*/ WBR, Sergei -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On 9/22/2010 8:36 AM, Jean Pihet wrote: On Wed, Sep 22, 2010 at 5:33 PM, Arjan van de Venar...@linux.intel.com wrote: On 9/22/2010 8:31 AM, Jean Pihet wrote: Hi, Here is a patch that redefines the power events API. The advantages are: easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation! Thomas, this patch has your patch above merged in ('power-trace: Use power_switch_state instead of power_start and power_end'). The revised ACPI patch is coming asap. The trace points for x86 and OMAP are also udated accordingly. The pytimechart tool needs an update for the new API. This can be done as soon as the kernel code gets merged in. unfortunately this code is changing a userspace ABI... we really shouldn't do that if we can avoid it, and here we can avoid it. applications ARE using this stuff! What are the apps that are using it? I know about builtin-timechart, pytimechart. Is powertop using this as well? powertop 2.x codebase is as well. and a bunch of tools we have internal here at Intel. the thing with ABIs is that you don't know how many users you have.. at least here you know the lower bound is 3 different tools that are open source. and likely many local tools that aren't. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 0/4] omap4 hsmmc: Card detect and Register offset handling
The patch series is based on mainline 2.6.36-rc5. The series is tested on OMAP3430SDP and OMAP4430SDP and has dependency on http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34718.html V2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg35135.html V1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg34040.html Kishore Kadiyala (3): omap4 hsmmc : Adding card detect support for MMC1 omap4 hsmmc: Register offset handling omap4 hsmmc: Update ocr mask for MMC2 for regulator to use Benoit Cousson (1); omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set arch/arm/mach-omap2/board-4430sdp.c | 16 ++- arch/arm/mach-omap2/devices.c |8 +-- arch/arm/mach-omap2/hsmmc.c |4 ++ arch/arm/plat-omap/include/plat/mmc.h |3 + drivers/mfd/twl6030-irq.c | 72 + drivers/mmc/host/omap_hsmmc.c | 18 +++- include/linux/i2c/twl.h | 31 ++ 7 files changed, 143 insertions(+), 9 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 1/4] omap4 hsmmc: Adding card detect support for MMC1
Adding card detect callback function and card detect configuration function for MMC1 Controller on OMAP4. Card detect configuration function does initial configuration of the MMC Control PullUp-PullDown registers of Phoenix. For MMC1 Controller, card detect interrupt source is twl6030 which is non-gpio. The card detect call back function provides card present/absent status by reading MMC Control register present on twl6030. Since OMAP4 doesn't use any GPIO line as used in OMAP3 for card detect, the suspend/resume initialization which was done in omap_hsmmc_gpio_init previously is moved to the probe thus making it generic for both OMAP3 OMAP4. Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com --- arch/arm/mach-omap2/board-4430sdp.c |7 +++- drivers/mfd/twl6030-irq.c | 72 +++ drivers/mmc/host/omap_hsmmc.c |4 +- include/linux/i2c/twl.h | 31 +++ 4 files changed, 111 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 9447644..a49f285 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -227,9 +227,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) struct omap_mmc_platform_data *pdata = dev-platform_data; /* Setting MMC1 Card detect Irq */ - if (pdev-id == 0) + if (pdev-id == 0) { + ret = twl6030_mmc_card_detect_config(); + if (ret) + pr_err(Failed configuring MMC1 card detect\n); pdata-slots[0].card_detect_irq = TWL6030_IRQ_BASE + MMCDETECT_INTR_OFFSET; + pdata-slots[0].card_detect = twl6030_mmc_card_detect; + } return ret; } diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c index 10bf228..d065899 100644 --- a/drivers/mfd/twl6030-irq.c +++ b/drivers/mfd/twl6030-irq.c @@ -36,6 +36,7 @@ #include linux/irq.h #include linux/kthread.h #include linux/i2c/twl.h +#include linux/platform_device.h /* * TWL6030 (unlike its predecessors, which had two level interrupt handling) @@ -223,6 +224,77 @@ int twl6030_interrupt_mask(u8 bit_mask, u8 offset) } EXPORT_SYMBOL(twl6030_interrupt_mask); +int twl6030_mmc_card_detect_config(void) +{ + int ret; + u8 reg_val = 0; + + /* Unmasking the Card detect Interrupt line for MMC1 from Phoenix */ + twl6030_interrupt_unmask(TWL6030_MMCDETECT_INT_MASK, + REG_INT_MSK_LINE_B); + twl6030_interrupt_unmask(TWL6030_MMCDETECT_INT_MASK, + REG_INT_MSK_STS_B); + /* +* Intially Configuring MMC_CTRL for receving interrupts +* Card status on TWL6030 for MMC1 +*/ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to read MMCCTRL, error %d\n, ret); + return ret; + } + reg_val = ~VMMC_AUTO_OFF; + reg_val |= SW_FC; + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, TWL6030_MMCCTRL); + if (ret 0) { + pr_err(twl6030: Failed to write MMCCTRL, error %d\n, ret); + return ret; + } + + /* Configuring PullUp-PullDown register */ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); + if (ret 0) { + pr_err(twl6030: Failed to read CFG_INPUT_PUPD3, error %d\n, + ret); + return ret; + } + reg_val = ~(MMC_PU | MMC_PD); + ret = twl_i2c_write_u8(TWL6030_MODULE_ID0, reg_val, + TWL6030_CFG_INPUT_PUPD3); + if (ret 0) { + pr_err(twl6030: Failed to write CFG_INPUT_PUPD3, error %d\n, + ret); + return ret; + } + return 0; +} +EXPORT_SYMBOL(twl6030_mmc_card_detect_config); + +int twl6030_mmc_card_detect(struct device *dev, int slot) +{ + int ret = -EIO; + u8 read_reg = 0; + struct platform_device *pdev = to_platform_device(dev); + + switch (pdev-id) { + case 0: + /* +* BIT0 of REG_MMC_CTRL +* 0 - Card not present ,1 - Card present +*/ + ret = twl_i2c_read_u8(TWL6030_MODULE_ID0, read_reg, + TWL6030_MMCCTRL); + if (ret = 0) + ret = read_reg STS_MMC; + break; + default: + pr_err(Unkown MMC controller %d in %s\n, pdev-id, __func__); + } + return ret; +}
[PATCH v3 2/4] omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set
From: Benoit Cousson b-cous...@ti.com Avoid possible crash if CONFIG_MMC_OMAP_HS is not set Signed-off-by: Benoit Cousson b-cous...@ti.com Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com --- arch/arm/mach-omap2/board-4430sdp.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index a49f285..ac8541c 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -240,8 +240,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev) static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev) { - struct omap_mmc_platform_data *pdata = dev-platform_data; + struct omap_mmc_platform_data *pdata; + /* dev can be null if CONFIG_MMC_OMAP_HS is not set */ + if (!dev) { + pr_err(Failed omap4_twl6030_hsmmc_set_late_init\n); + return; + } + pdata = dev-platform_data; pdata-init = omap4_twl6030_hsmmc_late_init; } -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 3/4] omap4 hsmmc: Register offset handling
In OMAP4, as per new PM programming model, the legacy registers which were there in OMAP3 are all shifted by 0x100 while new one's are added from offset 0 to 0x10. For OMAP4, the register offset appending of 0x100 done in devices.c currently, is moved to driver file.This change fits in for current implementation as well as once the driver undergoes hwmod adaptation. Cc: Kevin Hilman khil...@deeprootsystems.com Cc: Benoit Cousson b-cous...@ti.com Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com --- arch/arm/mach-omap2/devices.c |8 +++- arch/arm/mach-omap2/hsmmc.c |4 arch/arm/plat-omap/include/plat/mmc.h |3 +++ drivers/mmc/host/omap_hsmmc.c |2 ++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 2dbb265..bb7ec13 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -745,13 +745,13 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, case 3: if (!cpu_is_omap44xx()) return; - base = OMAP4_MMC4_BASE + OMAP4_MMC_REG_OFFSET; + base = OMAP4_MMC4_BASE; irq = OMAP44XX_IRQ_MMC4; break; case 4: if (!cpu_is_omap44xx()) return; - base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; + base = OMAP4_MMC5_BASE; irq = OMAP44XX_IRQ_MMC5; break; default: @@ -762,10 +762,8 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data, size = OMAP2420_MMC_SIZE; name = mmci-omap; } else if (cpu_is_omap44xx()) { - if (i 3) { - base += OMAP4_MMC_REG_OFFSET; + if (i 3) irq += OMAP44XX_IRQ_GIC_START; - } size = OMAP4_HSMMC_SIZE; name = mmci-omap-hs; } else { diff --git a/arch/arm/mach-omap2/hsmmc.c b/arch/arm/mach-omap2/hsmmc.c index c8f647b..49d76a7 100644 --- a/arch/arm/mach-omap2/hsmmc.c +++ b/arch/arm/mach-omap2/hsmmc.c @@ -261,6 +261,10 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) mmc-slots[0].wires = c-wires; mmc-slots[0].internal_clock = !c-ext_clock; mmc-dma_mask = 0x; + if (cpu_is_omap44xx()) + mmc-reg_offset = OMAP4_MMC_REG_OFFSET; + else + mmc-reg_offset = 0; mmc-get_context_loss_count = hsmmc_get_context_loss; diff --git a/arch/arm/plat-omap/include/plat/mmc.h b/arch/arm/plat-omap/include/plat/mmc.h index 9b89ec6..4e6ef07 100644 --- a/arch/arm/plat-omap/include/plat/mmc.h +++ b/arch/arm/plat-omap/include/plat/mmc.h @@ -71,6 +71,9 @@ struct omap_mmc_platform_data { u64 dma_mask; + /* Register offset deviation */ + u16 reg_offset; + struct omap_mmc_slot_data { /* 4 wire signaling is optional, and is used for SD/SDIO/HSMMC; diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index a51894d..8cb007c 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2009,6 +2009,8 @@ static int __init omap_hsmmc_probe(struct platform_device *pdev) if (res == NULL || irq 0) return -ENXIO; + res-start += pdata-reg_offset; + res-end += pdata-reg_offset; res = request_mem_region(res-start, res-end - res-start + 1, pdev-name); if (res == NULL) -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v3 4/4] omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
On OMAP4, MMC2 controller has eMMC which draws power from VAUX regulator on TWL. Though the eMMC supports dual voltage[1.8v/3v] as per ocr register, its VCC is fixed at 3V for operation. With this once the mmc core selects the minimum voltage[1.8] supported based on the ocr value read from OCR register, eMMC will not get detected. Thus the platform data for MMC2 is updated with ocr mask and same will be communicated to core which will set the regulator to always operate at 3V when ever turned ON. Signed-off-by: Kishore Kadiyala kishore.kadiy...@ti.com --- arch/arm/mach-omap2/board-4430sdp.c |1 + drivers/mmc/host/omap_hsmmc.c | 12 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index ac8541c..9fd1044 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -202,6 +202,7 @@ static struct omap2_hsmmc_info mmc[] = { .gpio_cd= -EINVAL, .gpio_wp= -EINVAL, .nonremovable = true, + .ocr_mask = MMC_VDD_29_30, }, {} /* Terminator */ }; diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 8cb007c..f629acf 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -364,6 +364,7 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) { struct regulator *reg; int ret = 0; + int ocr_value = 0; switch (host-id) { case OMAP_MMC1_DEVID: @@ -396,6 +397,17 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host) } } else { host-vcc = reg; + ocr_value = mmc_regulator_get_ocrmask(reg); + if (!mmc_slot(host).ocr_mask) { + mmc_slot(host).ocr_mask = ocr_value; + } else { + if (!(mmc_slot(host).ocr_mask ocr_value)) { + pr_err(MMC%d ocrmask %x is not supported\n, + host-id, mmc_slot(host).ocr_mask); + mmc_slot(host).ocr_mask = 0; + return -EINVAL; + } + } mmc_slot(host).ocr_mask = mmc_regulator_get_ocrmask(reg); /* Allow an aux regulator */ -- 1.7.0.4 -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On Wed, 2010-09-22 at 09:32 -0700, Arjan van de Ven wrote: What are the apps that are using it? I know about builtin-timechart, pytimechart. Is powertop using this as well? powertop 2.x codebase is as well. and a bunch of tools we have internal here at Intel. the thing with ABIs is that you don't know how many users you have.. at least here you know the lower bound is 3 different tools that are open source. and likely many local tools that aren't. These tools should be smart enough to look up the tracepoint name, fail it its not available, read the tracepoint format, again fail if not compatible. I really object to treating tracepoints as ABI and being tied to any implementation details due to that. Tools really should be flexible and allow for change. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On Wed, 2010-09-22 at 09:32 -0700, Arjan van de Ven wrote: Also, please don't cross-post to subscriber only lists, that's annoying as hell. (removed the disc...@lesswatts list) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 11/13 v2] serial: Add OMAP high-speed UART driver
Hi Govindraj, -Original Message- From: linux-omap-ow...@vger.kernel.org [mailto:linux-omap- ow...@vger.kernel.org] On Behalf Of Govindraj.R Sent: Wednesday, September 22, 2010 10:15 AM To: linux-omap@vger.kernel.org Cc: linux-arm-ker...@lists.infradead.org; linux-ser...@vger.kernel.org; Kevin Hilman; Tony Lindgren Subject: [PATCH 11/13 v2] serial: Add OMAP high-speed UART driver This patch adds driver support for OMAP2/3/4 high speed UART. The driver is made separate from 8250 driver as we cannot over load 8250 driver with omap platform specific configuration for features like DMA, it makes easier to implement features like DMA and hardware flow control and software flow control configuration with this driver as required for the omap-platform. This patch involves only the core driver and its dependent. Cc: Tony Lindgren t...@atomide.com Tested-by: Kevin Hilman khil...@deeprootsystems.com Signed-off-by: Govindraj.R govindraj.r...@ti.com --- arch/arm/plat-omap/include/plat/omap-serial.h | 129 +++ drivers/serial/Kconfig| 27 + drivers/serial/Makefile |1 + drivers/serial/omap-serial.c | 1332 + include/linux/serial_core.h |3 + 5 files changed, 1492 insertions(+), 0 deletions(-) create mode 100644 arch/arm/plat-omap/include/plat/omap-serial.h create mode 100644 drivers/serial/omap-serial.c diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h new file mode 100644 index 000..0d6f076 --- /dev/null +++ b/arch/arm/plat-omap/include/plat/omap-serial.h @@ -0,0 +1,129 @@ +/* + * Driver for OMAP-UART controller. + * Based on drivers/serial/8250.c + * + * Copyright (C) 2010 Texas Instruments. + * + * Authors: + * Govindraj R govindraj.r...@ti.com + * Thara Gopinath th...@ti.com + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#ifndef __OMAP_SERIAL_H__ +#define __OMAP_SERIAL_H__ + +#include linux/serial_core.h +#include linux/platform_device.h + +#include plat/control.h +#include plat/mux.h + +#define DRIVER_NAME omap-hsuart Is there a reason why you keep 2 names in the driver? You use this for the platform_driver struct serial_omap_driver, Meanwhile you send a driver name of OMAP-SERIAL to uart_driver struct... Also IMHO, if you're just going to use this once, then it makes no sense to have this macro. + +/* + * Use tty device name as ttyO, [O - OMAP] + * in bootargs we specify as console=ttyO0 if uart1 + * is used as console uart. + */ +#define OMAP_SERIAL_NAME ttyO + +#define OMAP_MDR1_DISABLE0x07 +#define OMAP_MDR1_MODE13X0x03 +#define OMAP_MDR1_MODE16X0x00 +#define OMAP_MODE13X_SPEED 230400 + +/* + * LCR = 0XBF: Switch to Configuration Mode B. + * In configuration mode b allow access + * to EFR,DLL,DLH. + * Reference OMAP TRM Chapter 17 + * Section: 1.4.3 Mode Selection + */ +#define OMAP_UART_LCR_CONF_MDB 0XBF + +/* WER = 0x7F + * Enable module level wakeup in WER reg + */ +#define OMAP_UART_WER_MOD_WKUP 0X7F + +/* Enable XON/XOFF flow control on output */ +#define OMAP_UART_SW_TX 0x04 + +/* Enable XON/XOFF flow control on input */ +#define OMAP_UART_SW_RX 0x04 + +#define OMAP_UART_SYSC_RESET 0X07 +#define OMAP_UART_TCR_TRIG 0X0F +#define OMAP_UART_SW_CLR 0XF0 +#define OMAP_UART_FIFO_CLR 0X06 + +#define OMAP_UART_DMA_CH_FREE-1 + +#define RX_TIMEOUT (3 * HZ) +#define OMAP_MAX_HSUART_PORTS4 + +#define MSR_SAVE_FLAGS UART_MSR_ANY_DELTA + +struct omap_uart_port_info { + booldma_enabled;/* To specify DMA Mode */ + unsigned intuartclk;/* UART clock rate */ + void __iomem*membase; /* ioremap cookie or NULL */ + resource_size_t mapbase;/* resource base */ + unsigned long irqflags; /* request_irq flags */ + upf_t flags; /* UPF_* flags */ +}; + +struct uart_omap_dma { + u8 uart_dma_tx; + u8 uart_dma_rx; + int rx_dma_channel; + int tx_dma_channel; + dma_addr_t rx_buf_dma_phys; + dma_addr_t tx_buf_dma_phys; + unsigned intuart_base; + /* + * Buffer for rx dma.It is not required for tx because the buffer + * comes from port structure. + */ + unsigned char *rx_buf; + unsigned intprev_rx_dma_pos; + int tx_buf_size; +
Re: [PATCH] tracing, perf: add more power related events
On 9/22/2010 9:43 AM, Peter Zijlstra wrote: On Wed, 2010-09-22 at 09:32 -0700, Arjan van de Ven wrote: What are the apps that are using it? I know about builtin-timechart, pytimechart. Is powertop using this as well? powertop 2.x codebase is as well. and a bunch of tools we have internal here at Intel. the thing with ABIs is that you don't know how many users you have.. at least here you know the lower bound is 3 different tools that are open source. and likely many local tools that aren't. These tools should be smart enough to look up the tracepoint name, fail it its not available, read the tracepoint format, again fail if not compatible. it's not very useful if none of the critical information is available. you can't at the one hand push people to use perf for critical pieces (like machine checks etc etc) and on the other hand say that it's not ABI stable and should not be used really. In this case we're talking about basically a suprious rename of something that isn't really an improvement (because it makes it harder to subscribe to only one type of event)... that's not a good thing. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] OMAP4: HSMMC cmd line reset change
-Original Message- From: Tony Lindgren [mailto:t...@atomide.com] Sent: Tuesday, September 21, 2010 9:47 AM To: Madhusudhan Cc: c...@laptop.org; linux-...@vger.kernel.org; linux-omap@vger.kernel.org; santosh.shilim...@ti.com Subject: Re: [PATCH] OMAP4: HSMMC cmd line reset change * Madhusudhan madhu...@ti.com [100920 09:06]: Please don't use cpu_is_omap tests in the drivers, drivers should be generic. Instead, just pass a feature flag in the platform_data for this feature like HSMMC_REVERSE_RESET_LOGIC or similar. This is not a feature. It is like an ERRATA fix. I am yet to receive an errata number though. How about dealing with this like an errata fix similar to the way in arch/mach-omap2/serial.c done for the uart case? Yes setting some HSMMC_ERRATA_XYZ flag works too. The mmc ip revision will not help because it really does not change to distinguish such issues. OK. Then I guess your only option is to pass the errata flag in the platform_data. Chris, Can you please drop this patch? Sorry, I spoke bit too early on this patch. I need to sort out some stuff internally (seems like it will not be released as an errata). I will post a revised version a bit later. Regards, Madhu Regards, Tony -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] OMAP4: HSMMC cmd line reset change
Hi Madhu, On Wed, Sep 22, 2010 at 12:13:51PM -0500, Madhusudhan wrote: Can you please drop this patch? Sorry, I spoke bit too early on this patch. I need to sort out some stuff internally (seems like it will not be released as an errata). I will post a revised version a bit later. No problem, I dropped this after seeing Tony's comments. I'll keep an eye out for a new patch with his ACK. Thanks, -- Chris Ball c...@laptop.org http://printf.net/ One Laptop Per Child -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On Wed, 2010-09-22 at 10:06 -0700, Arjan van de Ven wrote: In this case we're talking about basically a suprious rename of something that isn't really an improvement (because it makes it harder to subscribe to only one type of event)... that's not a good thing. People have been talking about more/more comprehensive power tracepoints for a while, and I think that's a valid goal, if its really a rename I'm sure you can work it out. That said, I really didn't read this discussion much, but your stance seems to be that any tracepoint you use must stay valid, and I object to that. What will do you do when we include a new scheduling policy and all the scheduler tracepoints need to change? (yes that's really going to happen) I'm not going to carry double tracepoints, and I'm not going to not merge that policy. -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On Wednesday 22 September 2010 19:06:54 Arjan van de Ven wrote: On 9/22/2010 9:43 AM, Peter Zijlstra wrote: On Wed, 2010-09-22 at 09:32 -0700, Arjan van de Ven wrote: What are the apps that are using it? I know about builtin-timechart, pytimechart. Is powertop using this as well? powertop 2.x codebase is as well. and a bunch of tools we have internal here at Intel. the thing with ABIs is that you don't know how many users you have.. at least here you know the lower bound is 3 different tools that are open source. and likely many local tools that aren't. These tools should be smart enough to look up the tracepoint name, fail it its not available, read the tracepoint format, again fail if not compatible. it's not very useful if none of the critical information is available. you can't at the one hand push people to use perf for critical pieces (like machine checks etc etc) and on the other hand say that it's not ABI stable and should not be used really. I provided an ABI stable solution, by marking the broken parts deprecated, etc. I'll rework the CONFIG_DEPRECATED_POWER_EVENTS (or similar config). In this case we're talking about basically a suprious rename of something that isn't really an improvement ... (because it makes it harder to subscribe to only one type of event)... that's not a good thing. Finally there is some talking about the details. You say they should be differed by the name and not the type? Why does the type= attribute exist at all then? /sys/kernel/debug/tracing/:[0]# cat available_events |grep power power:power_start power:power_frequency power:power_end So which one do I set to get C-, processor sleep, state traces? What you mean is that instead of passing the type= as attribute, an additional macro layer could be put in or each type is statically defined. The type itself needs not to get passed anymore then, because this info is already in the name and you get: power:power_cstates power:power_pstates power:power_sstates or power:power_processor_sleep power:power_processor_frequency power:power_machine_suspend ... right? This more looks like an interface that can get exposed to userspace... Thomas -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] tracing, perf: add more power related events
On Wednesday, September 22, 2010, Arjan van de Ven wrote: On 9/22/2010 8:31 AM, Jean Pihet wrote: Hi, Here is a patch that redefines the power events API. The advantages are: easier maintainance of the kernel and the user space tools, a cleaner and more generic interface, more parameters for fine tracing and even documentation! Thomas, this patch has your patch above merged in ('power-trace: Use power_switch_state instead of power_start and power_end'). The revised ACPI patch is coming asap. The trace points for x86 and OMAP are also udated accordingly. The pytimechart tool needs an update for the new API. This can be done as soon as the kernel code gets merged in. unfortunately this code is changing a userspace ABI... we really shouldn't do that if we can avoid it, and here we can avoid it. applications ARE using this stuff! Apart from this, could we rename things like POWER_CSTATE to CPU_POWER_CSTATE and state clearly in the docs that this whole thing is about CPU power? Thanks, Rafael -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html