omap2+ patches for v2.6.37 merge window
Subsystems (5)
Tony Lindgren
maintainercover omap2+ patches for v2.6.37 merge window
Hi all,
Here are some omap2/3/4 related patches I've picked up.
Regards,
Tony
---
Benoit Cousson (1):
omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set
Grazvydas Ignotas (2):
omap: pandora: add fixed regulator for wlan
omap: pandora: enable twl4030 charger
Madhusudhan Chikkature (1):
OMAP4 ES2: HSMMC soft reset change
Sanjeev Premi (1):
omap2/3: Update revision identification
Tony Lindgren (1):
omap: Fix omap_mux_init_signal not to trash muxname
kishore kadiyala (2):
omap4 hsmmc: Register offset handling
omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
arch/arm/mach-omap2/board-4430sdp.c | 9 +++- arch/arm/mach-omap2/board-omap3pandora.c | 46 +++++++++++++++---- arch/arm/mach-omap2/devices.c | 8 +-- arch/arm/mach-omap2/hsmmc.c | 7 +++ arch/arm/mach-omap2/id.c | 72 ++++++++++++++++++++---------- arch/arm/mach-omap2/mux.c | 13 +++-- arch/arm/mach-omap2/mux.h | 2 - arch/arm/plat-omap/include/plat/cpu.h | 36 ++++++++------- arch/arm/plat-omap/include/plat/mmc.h | 4 ++ drivers/mmc/host/omap_hsmmc.c | 25 ++++++++++ 10 files changed, 156 insertions(+), 66 deletions(-)
Signature · 1 line
Signature
Tony Lindgren
maintainerPATCH 1/8 omap: Fix omap_mux_init_signal not to trash muxname
Otherwise the muxname passed to the function will get truncated.
Based on an earlier patch by rockefeller.lin at innocomm.com.
--- arch/arm/mach-omap2/mux.c | 13 +++++++------ arch/arm/mach-omap2/mux.h | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-)
arch/arm/mach-omap2/mux.c +7 -6
@@ -127,17 +127,16 @@ int __init omap_mux_init_gpio(int gpio, int val)return 0 ; } -int __init omap_mux_init_signal (char *muxname,int val) +int __init omap_mux_init_signal (const char *muxname,int val) {struct omap_mux_entry *e; -char *m0_name =NULL , *mode_name =NULL ; -int found =0 ; +const char *mode_name; +int found =0 , mode0_len =0 ; mode_name =strchr (muxname,'.' );if (mode_name) { - *mode_name ='\0' ; + mode0_len =strlen (muxname) -strlen (mode_name); mode_name++; - m0_name = muxname; }else { mode_name = muxname; }
@@ -147,9 +146,11 @@ int __init omap_mux_init_signal(char *muxname, int val)char *m0_entry = m->muxnames[0 ];int i; -if (m0_name &&strcmp (m0_name, m0_entry)) +/* First check for full name in mode0.muxmode format */ +if (mode0_len &&strncmp (muxname, m0_entry, mode0_len))continue ; +/* Then check for muxmode only */ for (i =0 ; i <OMAP_MUX_NR_MODES ; i++) {char *mode_cur = m->muxnames[i];
arch/arm/mach-omap2/mux.h +1 -1
@@ -120,7 +120,7 @@ int omap_mux_init_gpio(int gpio, int val);* @muxname: Mux name in mode0_name.signal_name format * @val: Options for the mux register value */ -int omap_mux_init_signal (char *muxname,int val); +int omap_mux_init_signal (const char *muxname,int val);#else
Tony Lindgren
maintainerPATCH 2/8 omap2/3: Update revision identification
In reply to Tony LindgrenFrom: Sanjeev Premi <[email protected]>
The existing definitions for cpu revision used upper nibble in the bits[15:08]. With OMAP3630, definitions use lower nibble.
This patch unifies the definitions to start at lower nibble.
--- arch/arm/mach-omap2/id.c | 72 ++++++++++++++++++++++----------- arch/arm/plat-omap/include/plat/cpu.h | 36 ++++++++--------- 2 files changed, 66 insertions(+), 42 deletions(-)
arch/arm/mach-omap2/id.c +48 -24
@@ -385,30 +385,54 @@ static void __init omap3_cpuinfo(void)strcpy (cpu_name,"OMAP3503" ); } -switch (rev) { -case OMAP_REVBITS_00 : -strcpy (cpu_rev,"1.0" ); -break ; -case OMAP_REVBITS_01 : -strcpy (cpu_rev,"1.1" ); -break ; -case OMAP_REVBITS_02 : -strcpy (cpu_rev,"1.2" ); -break ; -case OMAP_REVBITS_10 : -strcpy (cpu_rev,"2.0" ); -break ; -case OMAP_REVBITS_20 : -strcpy (cpu_rev,"2.1" ); -break ; -case OMAP_REVBITS_30 : -strcpy (cpu_rev,"3.0" ); -break ; -case OMAP_REVBITS_40 : -/* FALLTHROUGH */ -default : -/* Use the latest known revision as default */ -strcpy (cpu_rev,"3.1" ); +if (cpu_is_omap3630 ()) { +switch (rev) { +case OMAP_REVBITS_00 : +strcpy (cpu_rev,"1.0" ); +break ; +case OMAP_REVBITS_01 : +strcpy (cpu_rev,"1.1" ); +break ; +case OMAP_REVBITS_02 : +/* FALLTHROUGH */ +default : +/* Use the latest known revision as default */ +strcpy (cpu_rev,"1.2" ); + } + }else if (cpu_is_omap3505 () ||cpu_is_omap3517 ()) { +switch (rev) { +case OMAP_REVBITS_00 : +strcpy (cpu_rev,"1.0" ); +break ; +case OMAP_REVBITS_01 : +/* FALLTHROUGH */ +default : +/* Use the latest known revision as default */ +strcpy (cpu_rev,"1.1" ); + } + }else { +switch (rev) { +case OMAP_REVBITS_00 : +strcpy (cpu_rev,"1.0" ); +break ; +case OMAP_REVBITS_01 : +strcpy (cpu_rev,"2.0" ); +break ; +case OMAP_REVBITS_02 : +strcpy (cpu_rev,"2.1" ); +break ; +case OMAP_REVBITS_03 : +strcpy (cpu_rev,"3.0" ); +break ; +case OMAP_REVBITS_04 : +strcpy (cpu_rev,"3.1" ); +break ; +case OMAP_REVBITS_05 : +/* FALLTHROUGH */ +default : +/* Use the latest known revision as default */ +strcpy (cpu_rev,"3.1.2" ); + } }/* Print verbose information */
arch/arm/plat-omap/include/plat/cpu.h +18 -18
@@ -68,10 +68,9 @@ unsigned int omap_rev(void);#define OMAP_REVBITS_00 0x00#define OMAP_REVBITS_01 0x01#define OMAP_REVBITS_02 0x02 -#define OMAP_REVBITS_10 0x10 -#define OMAP_REVBITS_20 0x20 -#define OMAP_REVBITS_30 0x30 -#define OMAP_REVBITS_40 0x40 +#define OMAP_REVBITS_03 0x03 +#define OMAP_REVBITS_04 0x04 +#define OMAP_REVBITS_05 0x05/* * Get the CPU revision for OMAP devices
@@ -363,23 +362,24 @@ IS_OMAP_TYPE(3517, 0x3517)/* Various silicon revisions for omap2 */ #define OMAP242X_CLASS 0x24200024 -#define OMAP2420_REV_ES1_0 0x24200024 -#define OMAP2420_REV_ES2_0 0x24201024 +#define OMAP2420_REV_ES1_0 OMAP242X_CLASS +#define OMAP2420_REV_ES2_0 (OMAP242X_CLASS | (OMAP_REVBITS_01 << 8))#define OMAP243X_CLASS 0x24300024 -#define OMAP2430_REV_ES1_0 0x24300024 +#define OMAP2430_REV_ES1_0 OMAP243X_CLASS#define OMAP343X_CLASS 0x34300034 -#define OMAP3430_REV_ES1_0 0x34300034 -#define OMAP3430_REV_ES2_0 0x34301034 -#define OMAP3430_REV_ES2_1 0x34302034 -#define OMAP3430_REV_ES3_0 0x34303034 -#define OMAP3430_REV_ES3_1 0x34304034 -#define OMAP3430_REV_ES3_1_2 0x34305034 - -#define OMAP3630_REV_ES1_0 0x36300034 -#define OMAP3630_REV_ES1_1 0x36300134 -#define OMAP3630_REV_ES1_2 0x36300234 +#define OMAP3430_REV_ES1_0 OMAP343X_CLASS +#define OMAP3430_REV_ES2_0 (OMAP343X_CLASS | (OMAP_REVBITS_01 << 8)) +#define OMAP3430_REV_ES2_1 (OMAP343X_CLASS | (OMAP_REVBITS_02 << 8)) +#define OMAP3430_REV_ES3_0 (OMAP343X_CLASS | (OMAP_REVBITS_03 << 8)) +#define OMAP3430_REV_ES3_1 (OMAP343X_CLASS | (OMAP_REVBITS_04 << 8)) +#define OMAP3430_REV_ES3_1_2 (OMAP343X_CLASS | (OMAP_REVBITS_05 << 8)) + +#define OMAP363X_CLASS 0x36300034 +#define OMAP3630_REV_ES1_0 OMAP363X_CLASS +#define OMAP3630_REV_ES1_1 (OMAP363X_CLASS | (OMAP_REVBITS_01 << 8)) +#define OMAP3630_REV_ES1_2 (OMAP363X_CLASS | (OMAP_REVBITS_02 << 8))#define OMAP35XX_CLASS 0x35000034#define OMAP3503_REV (v) (OMAP35XX_CLASS | (0x3503 << 16) | (v << 8))
@@ -390,7 +390,7 @@ IS_OMAP_TYPE(3517, 0x3517)#define OMAP3517_REV (v) (OMAP35XX_CLASS | (0x3517 << 16) | (v << 8))#define OMAP443X_CLASS 0x44300044 -#define OMAP4430_REV_ES1_0 0x44300044 +#define OMAP4430_REV_ES1_0 OMAP443X_CLASS#define OMAP4430_REV_ES2_0 0x44301044/*
Tony Lindgren
maintainerPATCH 3/8 omap: pandora: add fixed regulator for wlan
In reply to Tony LindgrenFrom: Grazvydas Ignotas <[email protected]>
Instead of enabling the wifi module explicitly using GPIO, add a fixed regulator and hook it to MMC host card power control. This way it will only be enabled when SDIO subsystem wants to talk to it, saving power (as done by Zoom boards).
--- arch/arm/mach-omap2/board-omap3pandora.c | 43 ++++++++++++++++++++++-------- 1 files changed, 32 insertions(+), 11 deletions(-)
arch/arm/mach-omap2/board-omap3pandora.c +32 -11
@@ -34,6 +34,7 @@#include <linux/gpio_keys.h> #include <linux/mmc/host.h> #include <linux/mmc/card.h> +#include <linux/regulator/fixed.h> #include <asm/mach-types.h> #include <asm/mach/arch.h>
@@ -345,6 +346,9 @@ static struct regulator_consumer_supply pandora_vmmc1_supply =static struct regulator_consumer_supply pandora_vmmc2_supply =REGULATOR_SUPPLY ("vmmc" ,"mmci-omap-hs.1" ); +static struct regulator_consumer_supply pandora_vmmc3_supply = +REGULATOR_SUPPLY ("vmmc" ,"mmci-omap-hs.2" ); +static struct regulator_consumer_supply pandora_vdda_dac_supply =REGULATOR_SUPPLY ("vdda_dac" ,"omapdss" );
@@ -489,6 +493,33 @@ static struct regulator_init_data pandora_vsim = { .consumer_supplies = &pandora_adac_supply, }; +/* Fixed regulator internal to Wifi module */ +static struct regulator_init_data pandora_vmmc3 = { + .constraints = { + .valid_ops_mask =REGULATOR_CHANGE_STATUS , + }, + .num_consumer_supplies =1 , + .consumer_supplies = &pandora_vmmc3_supply, +}; + +static struct fixed_voltage_config pandora_vwlan = { + .supply_name ="vwlan" , + .microvolts =1800000 ,/* 1.8V */ + .gpio =PANDORA_WIFI_NRESET_GPIO , + .startup_delay =50000 ,/* 50ms */ + .enable_high =1 , + .enabled_at_boot =0 , + .init_data = &pandora_vmmc3, +}; + +static struct platform_device pandora_vwlan_device = { + .name ="reg-fixed-voltage" , + .id =1 , + .dev = { + .platform_data = &pandora_vwlan, + }, +}; +static struct twl4030_usb_data omap3pandora_usb_data = { .usb_mode =T2_USB_MODE_ULPI , };
@@ -645,19 +676,8 @@ static void pandora_wl1251_init(void)if (pandora_wl1251_pdata.irq <0 ) goto fail_irq; - ret =gpio_request (PANDORA_WIFI_NRESET_GPIO ,"wl1251 nreset" ); -if (ret <0 ) - goto fail_irq; - -/* start powered so that it probes with MMC subsystem */ - ret =gpio_direction_output (PANDORA_WIFI_NRESET_GPIO ,1 ); -if (ret <0 ) - goto fail_nreset; -return ; -fail_nreset: -gpio_free (PANDORA_WIFI_NRESET_GPIO ); fail_irq:gpio_free (PANDORA_WIFI_IRQ_GPIO ); fail:
@@ -669,6 +689,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = { &pandora_keys_gpio, &pandora_dss_device, &pandora_wl1251_data, + &pandora_vwlan_device, }; static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
Tony Lindgren
maintainerPATCH 4/8 omap: pandora: enable twl4030 charger
In reply to Tony LindgrenFrom: Grazvydas Ignotas <[email protected]>
Add platform data to make use of newly added charging driver.
--- arch/arm/mach-omap2/board-omap3pandora.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-omap3pandora.c +3 -0
@@ -533,6 +533,8 @@ static struct twl4030_codec_data omap3pandora_codec_data = { .audio = &omap3pandora_audio_data, }; +static struct twl4030_bci_platform_data pandora_bci_data; +static struct twl4030_platform_data omap3pandora_twldata = { .irq_base =TWL4030_IRQ_BASE , .irq_end =TWL4030_IRQ_END ,
@@ -548,6 +550,7 @@ static struct twl4030_platform_data omap3pandora_twldata = { .vaux4 = &pandora_vaux4, .vsim = &pandora_vsim, .keypad = &pandora_kp_data, + .bci = &pandora_bci_data, };static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {
Tony Lindgren
maintainerPATCH 5/8 OMAP4 ES2: HSMMC soft reset change
In reply to Tony LindgrenFrom: Madhusudhan Chikkature <[email protected]>
The omap4 es2 hsmmc has a updated soft reset logic.After the reset is issued monitor a 0->1 transition first. The reset of CMD or DATA lines is complete only after a 0->1->0 transition of SRC or SRD bits.
--- arch/arm/mach-omap2/hsmmc.c | 3 +++ arch/arm/plat-omap/include/plat/mmc.h | 1 + drivers/mmc/host/omap_hsmmc.c | 11 +++++++++++ 3 files changed, 15 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/hsmmc.c +3 -0
@@ -303,6 +303,9 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers)else mmc->slots[0 ].features |=HSMMC_HAS_PBIAS ; +if (cpu_is_omap44xx () && (omap_rev () >OMAP4430_REV_ES1_0 )) + mmc->slots[0 ].features |=HSMMC_HAS_UPDATED_RESET ; +switch (c->mmc) {case 1 :if (mmc->slots[0 ].features &HSMMC_HAS_PBIAS ) {
arch/arm/plat-omap/include/plat/mmc.h +1 -0
@@ -110,6 +110,7 @@ struct omap_mmc_platform_data {/* we can put the features above into this variable */ #define HSMMC_HAS_PBIAS (1 << 0) +#define HSMMC_HAS_UPDATED_RESET (1 << 1)unsigned features;int switch_pin;/* gpio (card detect) */
drivers/mmc/host/omap_hsmmc.c +11 -0
@@ -982,6 +982,17 @@ static inline void omap_hsmmc_reset_controller_fsm(struct omap_hsmmc_host *host,OMAP_HSMMC_WRITE (host->base,SYSCTL ,OMAP_HSMMC_READ (host->base,SYSCTL ) | bit); +/* +* OMAP4 ES2 and greater has an updated reset logic. +* Monitor a 0->1 transition first +*/ +if (mmc_slot (host).features &HSMMC_HAS_UPDATED_RESET ) { +while ((!(OMAP_HSMMC_READ (host,SYSCTL ) & bit)) + && (i++ < limit)) +cpu_relax (); + } + i =0 ; +while ((OMAP_HSMMC_READ (host->base,SYSCTL ) & bit) && (i++ < limit))cpu_relax ();
Tony Lindgren
maintainerPATCH 6/8 omap4 hsmmc: Fix the init if CONFIG_MMC_OMAP_HS is not set
In reply to Tony LindgrenFrom: Benoit Cousson <[email protected]>
Avoid possible crash if CONFIG_MMC_OMAP_HS is not set
--- arch/arm/mach-omap2/board-4430sdp.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +7 -1
@@ -275,8 +275,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 %s\n" , __func__); +return ; + } + pdata = dev->platform_data; pdata->init = omap4_twl6030_hsmmc_late_init; }
Tony Lindgren
maintainerPATCH 7/8 omap4 hsmmc: Register offset handling
In reply to Tony LindgrenFrom: kishore kadiyala <[email protected]>
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.
--- 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(-)
arch/arm/mach-omap2/devices.c +3 -5
@@ -817,13 +817,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 :
@@ -834,10 +834,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 {
arch/arm/mach-omap2/hsmmc.c +4 -0
@@ -266,6 +266,10 @@ void __init omap2_hsmmc_init(struct omap2_hsmmc_info *controllers) mmc->slots[0 ].caps = c->caps; mmc->slots[0 ].internal_clock = !c->ext_clock; mmc->dma_mask =0xffffffff ; +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;
arch/arm/plat-omap/include/plat/mmc.h +3 -0
@@ -71,6 +71,9 @@ struct omap_mmc_platform_data {u64 dma_mask; +/* Register offset deviation */ +u16 reg_offset; +struct omap_mmc_slot_data {/*
drivers/mmc/host/omap_hsmmc.c +2 -0
@@ -2014,6 +2014,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 )
Tony Lindgren
maintainerPATCH 8/8 omap4 hsmmc: Update ocr mask for MMC2 for regulator to use
In reply to Tony LindgrenFrom: kishore kadiyala <[email protected]>
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.
--- arch/arm/mach-omap2/board-4430sdp.c | 1 + drivers/mmc/host/omap_hsmmc.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/board-4430sdp.c +1 -0
@@ -242,6 +242,7 @@ static struct omap2_hsmmc_info mmc[] = { .gpio_cd = -EINVAL, .gpio_wp = -EINVAL, .nonremovable = true, + .ocr_mask = MMC_VDD_29_30, }, {}/* Terminator */ };
drivers/mmc/host/omap_hsmmc.c +12 -0
@@ -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 */