ARM: OMAP: Updates for OMAP1 common code
Subsystems (5)
Tony Lindgren
reviewercover ARM: OMAP: Updates for OMAP1 common code
Hi,
The following patch series contains updates OMAP1 common code.
This is take #2 of the earlier 90 patch mountain, which has been split into six smaller series.
Regards,
Tony
Tony Lindgren
reviewerPATCH 1/6 ARM: OMAP: Enable DSP clocks for McBSP on omap310
From: Marek Vasut <[email protected]>
This patch enables some clock on omap310.
--- arch/arm/mach-omap1/clock.h | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/mach-omap1/clock.h +7 -7
@@ -282,7 +282,7 @@ static struct clk arminth_ck16xx = {static struct clk dsp_ck = { .name ="dsp_ck" , .parent = &ck_dpll1, - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |RATE_CKCTL , .enable_reg = (void __iomem *)ARM_CKCTL , .enable_bit =EN_DSPCK ,
@@ -295,7 +295,7 @@ static struct clk dsp_ck = {static struct clk dspmmu_ck = { .name ="dspmmu_ck" , .parent = &ck_dpll1, - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |RATE_CKCTL |ALWAYS_ENABLED , .rate_offset =CKCTL_DSPMMUDIV_OFFSET , .recalc = &omap1_ckctl_recalc,
@@ -306,7 +306,7 @@ static struct clk dspmmu_ck = {static struct clk dspper_ck = { .name ="dspper_ck" , .parent = &ck_dpll1, - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |RATE_CKCTL |VIRTUAL_IO_ADDRESS , .enable_reg = (void __iomem *)DSP_IDLECT2 , .enable_bit =EN_PERCK ,
@@ -320,7 +320,7 @@ static struct clk dspper_ck = {static struct clk dspxor_ck = { .name ="dspxor_ck" , .parent = &ck_ref, - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |VIRTUAL_IO_ADDRESS , .enable_reg = (void __iomem *)DSP_IDLECT2 , .enable_bit =EN_XORPCK ,
@@ -332,7 +332,7 @@ static struct clk dspxor_ck = {static struct clk dsptim_ck = { .name ="dsptim_ck" , .parent = &ck_ref, - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |VIRTUAL_IO_ADDRESS , .enable_reg = (void __iomem *)DSP_IDLECT2 , .enable_bit =EN_DSPTIMCK ,
@@ -374,7 +374,7 @@ static struct clk arminth_ck1510 = {static struct clk tipb_ck = {/* No-idle controlled by "tc_ck" */ - .name ="tibp_ck" , + .name ="tipb_ck" , .parent = &tc_ck.clk, .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP310 |ALWAYS_ENABLED ,
@@ -733,7 +733,7 @@ remains active during MPU idle whenever this is enabled */static struct clk i2c_fck = { .name ="i2c_fck" , .id =1 , - .flags =CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX | + .flags =CLOCK_IN_OMAP310 |CLOCK_IN_OMAP1510 |CLOCK_IN_OMAP16XX |VIRTUAL_CLOCK |CLOCK_NO_IDLE_PARENT |ALWAYS_ENABLED , .parent = &armxor_ck.clk,
Signature · 1 line
1.4.4.2
Tony Lindgren
reviewerPATCH 2/6 ARM: OMAP: omap camera builds again; Mistral init and mux
From: David Brownell <[email protected]>
Support the camera connector on the OSK Mistral add-on board:
- define muxing for both camera controllers
- mux both of them for Mistral
- teach ov9640 glue about mistral powerup/powerdown
--- arch/arm/mach-omap1/board-osk.c | 32 ++++++++++++++++++++++++++++++++ arch/arm/mach-omap1/mux.c | 24 ++++++++++++++++++++++++ include/asm-arm/arch-omap/mux.h | 23 +++++++++++++++++++++++ 3 files changed, 79 insertions(+), 0 deletions(-)
arch/arm/mach-omap1/board-osk.c +32 -0
@@ -342,6 +342,38 @@ static void __init osk_mistral_init(void* can't talk to the ads or even the i2c eeprom. */ +/* parallel camera interface */ +omap_cfg_reg (J15_1610_CAM_LCLK ); +omap_cfg_reg (J18_1610_CAM_D7 ); +omap_cfg_reg (J19_1610_CAM_D6 ); +omap_cfg_reg (J14_1610_CAM_D5 ); +omap_cfg_reg (K18_1610_CAM_D4 ); +omap_cfg_reg (K19_1610_CAM_D3 ); +omap_cfg_reg (K15_1610_CAM_D2 ); +omap_cfg_reg (K14_1610_CAM_D1 ); +omap_cfg_reg (L19_1610_CAM_D0 ); +omap_cfg_reg (L18_1610_CAM_VS ); +omap_cfg_reg (L15_1610_CAM_HS ); +omap_cfg_reg (M19_1610_CAM_RSTZ ); +omap_cfg_reg (Y15_1610_CAM_OUTCLK ); + +/* serial camera interface */ +omap_cfg_reg (H19_1610_CAM_EXCLK ); +omap_cfg_reg (W13_1610_CCP_CLKM ); +omap_cfg_reg (Y12_1610_CCP_CLKP ); +/* CCP_DATAM CONFLICTS WITH UART1.TX (and serial console) */ +// omap_cfg_reg(Y14_1610_CCP_DATAM); +omap_cfg_reg (W14_1610_CCP_DATAP ); + +/* CAM_PWDN */ +if (omap_request_gpio (11 ) ==0 ) { +omap_cfg_reg (N20_1610_GPIO11 ); +omap_set_gpio_direction (11 ,0 /* out */ ); +omap_set_gpio_dataout (11 ,0 /* off */ ); + }else +pr_debug ("OSK+Mistral: CAM_PWDN is awol\n" ); + +// omap_cfg_reg(P19_1610_GPIO6); // BUSY omap_cfg_reg (P20_1610_GPIO4 );// PENIRQ set_irq_type (OMAP_GPIO_IRQ (4 ),IRQT_FALLING );
arch/arm/mach-omap1/mux.c +24 -0
@@ -283,6 +283,30 @@ MUX_CFG("R11_1610_CF_IOIS16", B, 0, MUX_CFG("V10_1610_CF_IREQ", A, 24, 3, 2, 14, 0, 2, 0, 1) MUX_CFG("W10_1610_CF_RESET", A, 18, 3, 2, 12, 1, 2, 1, 1)MUX_CFG ("W11_1610_CF_CD1" ,10 ,15 ,3 ,3 ,8 ,1 ,3 ,1 ,1 ) + +/* parallel camera */ +MUX_CFG("J15_1610_CAM_LCLK", 4, 24, 0, 0, 18, 1, 0, 0, 0) +MUX_CFG("J18_1610_CAM_D7", 4, 27, 0, 0, 19, 1, 0, 0, 0) +MUX_CFG("J19_1610_CAM_D6", 5, 0, 0, 0, 20, 1, 0, 0, 0) +MUX_CFG("J14_1610_CAM_D5", 5, 3, 0, 0, 21, 1, 0, 0, 0) +MUX_CFG("K18_1610_CAM_D4", 5, 6, 0, 0, 22, 1, 0, 0, 0) +MUX_CFG("K19_1610_CAM_D3", 5, 9, 0, 0, 23, 1, 0, 0, 0) +MUX_CFG("K15_1610_CAM_D2", 5, 12, 0, 0, 24, 1, 0, 0, 0) +MUX_CFG("K14_1610_CAM_D1", 5, 15, 0, 0, 25, 1, 0, 0, 0) +MUX_CFG("L19_1610_CAM_D0", 5, 18, 0, 0, 26, 1, 0, 0, 0) +MUX_CFG("L18_1610_CAM_VS", 5, 21, 0, 0, 27, 1, 0, 0, 0) +MUX_CFG("L15_1610_CAM_HS", 5, 24, 0, 0, 28, 1, 0, 0, 0) +MUX_CFG("M19_1610_CAM_RSTZ", 5, 27, 0, 0, 29, 0, 0, 0, 0) +MUX_CFG ("Y15_1610_CAM_OUTCLK" ,A ,0 ,6 ,2 ,6 ,0 ,2 ,0 ,0 ) + +/* serial camera */ +MUX_CFG ("H19_1610_CAM_EXCLK" ,4 ,21 ,0 ,0 ,17 ,0 ,0 ,0 ,0 ) + /* REVISIT 5912 spec sez CCP_* can't pullup or pulldown ... ? */ +MUX_CFG("Y12_1610_CCP_CLKP", 8, 18, 6, 1, 24, 1, 1, 0, 0) +MUX_CFG("W13_1610_CCP_CLKM", 9, 0, 6, 1, 28, 1, 1, 0, 0) +MUX_CFG("W14_1610_CCP_DATAP", 9, 24, 6, 2, 4, 1, 2, 0, 0) +MUX_CFG ("Y14_1610_CCP_DATAM" ,9 ,21 ,6 ,2 ,3 ,1 ,2 ,0 ,0 ) + };#endif /* CONFIG_ARCH_OMAP15XX || CONFIG_ARCH_OMAP16XX */
include/asm-arm/arch-omap/mux.h +23 -0
@@ -406,6 +406,29 @@ enum omap1xxx_index {V10_1610_CF_IREQ ,W10_1610_CF_RESET ,W11_1610_CF_CD1 , + +/* parallel camera */ +J15_1610_CAM_LCLK , +J18_1610_CAM_D7 , +J19_1610_CAM_D6 , +J14_1610_CAM_D5 , +K18_1610_CAM_D4 , +K19_1610_CAM_D3 , +K15_1610_CAM_D2 , +K14_1610_CAM_D1 , +L19_1610_CAM_D0 , +L18_1610_CAM_VS , +L15_1610_CAM_HS , +M19_1610_CAM_RSTZ , +Y15_1610_CAM_OUTCLK , + +/* serial camera */ +H19_1610_CAM_EXCLK , +Y12_1610_CCP_CLKP , +W13_1610_CCP_CLKM , +W14_1610_CCP_DATAP , + Y14_1610_CCP_DATAM, + }; enum omap24xx_index {
Tony Lindgren
reviewerPATCH 3/6 ARM: OMAP: add SoSSI clock
From: Imre Deak <[email protected]>
This is needed, so that disabling the SoSSI clock during idle can be prevented.
--- arch/arm/mach-omap1/clock.c | 34 ++++++++++++++++++++++++++++++++++ arch/arm/mach-omap1/clock.h | 21 +++++++++++++++++++-- 2 files changed, 53 insertions(+), 2 deletions(-)
arch/arm/mach-omap1/clock.c +34 -0
@@ -49,6 +49,15 @@ static void omap1_uart_recalc(struct clk * clk) clk->rate =12000000 ; } +static void omap1_sossi_recalc (struct clk *clk) +{ +u32 div =omap_readl (MOD_CONF_CTRL_1 ); + + div = (div >>17 ) &0x7 ; + div++; + clk->rate = clk->parent->rate / div; +} +static int omap1_clk_enable_dsp_domain (struct clk *clk) {int retval;
@@ -396,6 +405,31 @@ static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate)return 0 ; } +static int omap1_set_sossi_rate (struct clk *clk,unsigned long rate) +{ +u32 l; +int div; +unsigned long p_rate; + + p_rate = clk->parent->rate; +/* Round towards slower frequency */ + div = (p_rate + rate -1 ) / rate; + div--; +if (div <0 || div >7 ) +return -EINVAL ; + + l =omap_readl (MOD_CONF_CTRL_1 ); + l &= ~(7 <<17 ); + l |= div <<17 ; +omap_writel (l,MOD_CONF_CTRL_1 ); + + clk->rate = p_rate / (div +1 ); +if (unlikely (clk->flags &RATE_PROPAGATES )) +propagate_rate (clk); + +return 0 ; +} +static long omap1_round_ext_clk_rate (struct clk * clk,unsigned long rate) {return 96000000 /calc_ext_dsor (rate);
arch/arm/mach-omap1/clock.h +19 -2
@@ -17,6 +17,8 @@ static int omap1_clk_enable_generic(struct clk * clk);static void omap1_clk_disable_generic (struct clk * clk);static void omap1_ckctl_recalc (struct clk * clk);static void omap1_watchdog_recalc (struct clk * clk); +static int omap1_set_sossi_rate (struct clk *clk,unsigned long rate); +static void omap1_sossi_recalc (struct clk *clk);static void omap1_ckctl_recalc_dsp_domain (struct clk * clk);static int omap1_clk_enable_dsp_domain (struct clk * clk);static int omap1_clk_set_rate_dsp_domain (struct clk * clk,unsigned long rate);
@@ -168,9 +170,10 @@ static struct clk ck_dpll1 = {static struct arm_idlect1_clk ck_dpll1out = { .clk = { - .name ="ck_dpll1out" , + .name ="ck_dpll1out" , .parent = &ck_dpll1, - .flags =CLOCK_IN_OMAP16XX |CLOCK_IDLE_CONTROL , + .flags =CLOCK_IN_OMAP16XX |CLOCK_IDLE_CONTROL | +ENABLE_REG_32BIT |RATE_PROPAGATES , .enable_reg = (void __iomem *)ARM_IDLECT2 , .enable_bit =EN_CKOUT_ARM , .recalc = &followparent_recalc,
@@ -180,6 +183,19 @@ static struct arm_idlect1_clk ck_dpll1out = { .idlect_shift = 12, }; +static struct clk sossi_ck = { + .name ="ck_sossi" , + .parent = &ck_dpll1out.clk, + .flags =CLOCK_IN_OMAP16XX |CLOCK_NO_IDLE_PARENT | +ENABLE_REG_32BIT , + .enable_reg = (void __iomem *)MOD_CONF_CTRL_1 , + .enable_bit =16 , + .recalc = &omap1_sossi_recalc, + .set_rate = &omap1_set_sossi_rate, + .enable = &omap1_clk_enable_generic, + .disable = &omap1_clk_disable_generic, +}; +static struct clk arm_ck = { .name ="arm_ck" , .parent = &ck_dpll1,
@@ -760,6 +776,7 @@ static struct clk * onchip_clks[] = { &ck_dpll1,/* CK_GEN1 clocks */ &ck_dpll1out.clk, + &sossi_ck, &arm_ck, &armper_ck.clk, &arm_gpio_ck,
Signature · 1 line
1.4.4.2
Tony Lindgren
reviewerPATCH 4/6 ARM: OMAP: add SoSSI clock (remove manual checking of SoSSI state from idle)
From: Imre Deak <[email protected]>
The SoSSI driver should already take care of this by enabling / disabling its clock when necessary, so this legacy callout from the PM idle code is not needed any more.
--- arch/arm/mach-omap1/pm.c | 5 +---- arch/arm/plat-omap/dma.c | 6 ------ include/asm-arm/arch-omap/dma.h | 1 - 3 files changed, 1 insertions(+), 11 deletions(-)
arch/arm/mach-omap1/pm.c +1 -4
@@ -155,11 +155,8 @@ void omap_pm_idle(void) use_idlect1 =omap_dm_timer_modify_idlect_mask (use_idlect1);#endif -if (omap_dma_running ()) { +if (omap_dma_running ()) use_idlect1 &= ~(1 <<6 ); -if (omap_lcd_dma_ext_running ()) - use_idlect1 &= ~(1 <<12 ); - }/* We should be able to remove the do_sleep variable and multiple * tests above as soon as drivers, timer and DMA code have been fixed.
arch/arm/plat-omap/dma.c +0 -6
@@ -1347,11 +1347,6 @@ void omap_stop_lcd_dma(void)omap_writew (w,OMAP1610_DMA_LCD_CTRL ); } -int omap_lcd_dma_ext_running (void ) -{ -return lcd_dma.ext_ctrl && lcd_dma.active; -} -/*----------------------------------------------------------------------------*/ static int __init omap_init_dma (void )
@@ -1493,7 +1488,6 @@ EXPORT_SYMBOL(omap_free_lcd_dma);EXPORT_SYMBOL (omap_enable_lcd_dma);EXPORT_SYMBOL (omap_setup_lcd_dma);EXPORT_SYMBOL (omap_stop_lcd_dma); -EXPORT_SYMBOL (omap_lcd_dma_ext_running);EXPORT_SYMBOL (omap_set_lcd_dma_b1);EXPORT_SYMBOL (omap_set_lcd_dma_single_transfer);EXPORT_SYMBOL (omap_set_lcd_dma_ext_controller);
include/asm-arm/arch-omap/dma.h +0 -1
@@ -417,7 +417,6 @@ extern void omap_free_lcd_dma(void);extern void omap_setup_lcd_dma (void );extern void omap_enable_lcd_dma (void );extern void omap_stop_lcd_dma (void ); -extern int omap_lcd_dma_ext_running (void );extern void omap_set_lcd_dma_ext_controller (int external);extern void omap_set_lcd_dma_single_transfer (int single); extern void omap_set_lcd_dma_b1(unsigned long addr, u16 fb_xres, u16 fb_yres,
Tony Lindgren
reviewerPATCH 5/6 ARM: OMAP: fix OMAP1 dmtimer build warning
From: David Brownell <[email protected]>
Remove the OMAP1 version of omap_dm_timer_get_fclk(), and its associated compile-time warning. It would only BUG() if called, while it's only called on OMAP2.
--- arch/arm/plat-omap/dmtimer.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
arch/arm/plat-omap/dmtimer.c +0 -5
@@ -271,11 +271,6 @@ int omap_dm_timer_get_irq(struct omap_dm_timer *timer)#if defined(CONFIG_ARCH_OMAP1 ) -struct clk *omap_dm_timer_get_fclk (struct omap_dm_timer *timer) -{ -BUG (); -} -/** * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR * @inputmask: current value of idlect mask
Signature · 1 line
1.4.4.2
Tony Lindgren
reviewerPATCH 6/6 ARM: OMAP: OSK led fixes
From: David Brownell <[email protected]>
Bugfixes for the OSK led support:
- Fix Kconfig merge glitches: Mistral handles idle and timer leds just fine
- Fix pm_suspend() runtime botch: can't sleep, so can't touch tps65010 leds
Improvements:
- Switch sense of Mistral idle led, so idle == off
Probably the TPS65010 leds should be handled only by the "new led" API.
--- arch/arm/Kconfig | 7 +++++-- arch/arm/mach-omap1/leds-osk.c | 6 +++--- arch/arm/mach-omap1/pm.c | 11 ----------- 3 files changed, 8 insertions(+), 16 deletions(-)
arch/arm/Kconfig +5 -2
@@ -668,7 +668,8 @@ config LEDS config LEDS_TIMER bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \ - MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 + OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ + || MACH_OMAP_PERSEUS2 depends on LEDS default y if ARCH_EBSA110 help
@@ -684,7 +685,9 @@ config LEDS_TIMER config LEDS_CPU bool "CPU usage LED" if (!ARCH_CDB89712 && !ARCH_EBSA110 && \ - !ARCH_OMAP) || MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 + !ARCH_OMAP) \ + || OMAP_OSK_MISTRAL || MACH_OMAP_H2 \ + || MACH_OMAP_PERSEUS2 depends on LEDS help If you say Y here, the red LED will be used to give a good real
arch/arm/mach-omap1/leds-osk.c +3 -3
@@ -133,13 +133,13 @@ void osk_leds_event(led_event_t evt)mistral_setled ();break ; -case led_idle_start: - hw_led_state |=IDLE_LED ; +case led_idle_start:/* idle == off */ + hw_led_state &= ~IDLE_LED ;mistral_setled ();break ;case led_idle_end: - hw_led_state &= ~IDLE_LED ; + hw_led_state |=IDLE_LED ;mistral_setled ();break ;
arch/arm/mach-omap1/pm.c +0 -11
@@ -58,7 +58,6 @@#include <asm/arch/tc.h> #include <asm/arch/pm.h> #include <asm/arch/mux.h> -#include <asm/arch/tps65010.h> #include <asm/arch/dma.h> #include <asm/arch/dsp_common.h> #include <asm/arch/dmtimer.h>
@@ -248,11 +247,6 @@ void omap_pm_suspend(void)omap_serial_wake_trigger (1 ); -if (machine_is_omap_osk ()) { -/* Stop LED1 (D9) blink */ -tps65010_set_led (LED1 ,OFF ); - } -if (!cpu_is_omap15xx ())omap_writew (0xffff ,ULPD_SOFT_DISABLE_REQ_REG );
@@ -445,11 +439,6 @@ void omap_pm_suspend(void)omap_serial_wake_trigger (0 );printk ("PM: OMAP%x is re-starting from deep sleep...\n" , system_rev); - -if (machine_is_omap_osk ()) { -/* Let LED1 (D9) blink again */ -tps65010_set_led (LED1 ,BLINK ); - } }#if defined(DEBUG ) && defined(CONFIG_PROC_FS )