diff options
Diffstat (limited to 'arch/arm/mach-omap2')
42 files changed, 1390 insertions, 432 deletions
diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c index ab0880ba3c4..1fa6bb896f4 100644 --- a/arch/arm/mach-omap2/board-2430sdp.c +++ b/arch/arm/mach-omap2/board-2430sdp.c @@ -142,8 +142,6 @@ static struct omap_board_config_kernel sdp2430_config[] __initdata = {  static void __init omap_2430sdp_init_early(void)  { -	omap_board_config = sdp2430_config; -	omap_board_config_size = ARRAY_SIZE(sdp2430_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -246,6 +244,9 @@ static void __init omap_2430sdp_init(void)  	omap2430_mux_init(board_mux, OMAP_PACKAGE_ZAC); +	omap_board_config = sdp2430_config; +	omap_board_config_size = ARRAY_SIZE(sdp2430_config); +  	omap2430_i2c_init();  	platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices)); diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 40b0174a4ef..5464bec156a 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -315,9 +315,6 @@ static struct omap_board_config_kernel sdp3430_config[] __initdata = {  static void __init omap_3430sdp_init_early(void)  { -	omap_board_config = sdp3430_config; -	omap_board_config_size = ARRAY_SIZE(sdp3430_config); -	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(hyb18m512160af6_sdrc_params, NULL);  } @@ -555,9 +552,7 @@ static struct regulator_init_data sdp3430_vpll2 = {  	.consumer_supplies	= sdp3430_vpll2_supplies,  }; -static struct twl4030_codec_audio_data sdp3430_audio = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data sdp3430_audio;  static struct twl4030_codec_data sdp3430_codec = {  	.audio_mclk = 26000000, @@ -788,6 +783,9 @@ static struct omap_musb_board_data musb_board_data = {  static void __init omap_3430sdp_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = sdp3430_config; +	omap_board_config_size = ARRAY_SIZE(sdp3430_config); +	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);  	omap3430_i2c_init();  	omap_display_init(&sdp3430_dss_data);  	if (omap_rev() > OMAP3430_REV_ES1_0) diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 8d1c4358ecf..c4e22b32e47 100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c @@ -72,8 +72,6 @@ static struct omap_board_config_kernel sdp_config[] __initdata = {  static void __init omap_sdp_init_early(void)  { -	omap_board_config = sdp_config; -	omap_board_config_size = ARRAY_SIZE(sdp_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(h8mbx00u0mer0em_sdrc_params,  				  h8mbx00u0mer0em_sdrc_params); @@ -206,6 +204,8 @@ static struct flash_partitions sdp_flash_partitions[] = {  static void __init omap_sdp_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); +	omap_board_config = sdp_config; +	omap_board_config_size = ARRAY_SIZE(sdp_config);  	zoom_peripherals_init();  	zoom_display_init();  	board_smc91x_init(); diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index f914099b225..85805d432e3 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -325,8 +325,6 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {  static void __init omap_4430sdp_init_early(void)  { -	omap_board_config = sdp4430_config; -	omap_board_config_size = ARRAY_SIZE(sdp4430_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  #ifdef CONFIG_OMAP_32K_TIMER @@ -640,6 +638,9 @@ static void __init omap_4430sdp_init(void)  		package = OMAP_PACKAGE_CBL;  	omap4_mux_init(board_mux, package); +	omap_board_config = sdp4430_config; +	omap_board_config_size = ARRAY_SIZE(sdp4430_config); +  	omap4_i2c_init();  	omap_sfh7741prox_init();  	platform_add_devices(sdp4430_devices, ARRAY_SIZE(sdp4430_devices)); diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c index ae3a83d47da..f53bbb2c347 100644 --- a/arch/arm/mach-omap2/board-am3517crane.c +++ b/arch/arm/mach-omap2/board-am3517crane.c @@ -51,9 +51,6 @@ static struct omap_board_mux board_mux[] __initdata = {  static void __init am3517_crane_init_early(void)  { -	omap_board_config = am3517_crane_config; -	omap_board_config_size = ARRAY_SIZE(am3517_crane_config); -  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -76,6 +73,9 @@ static void __init am3517_crane_init(void)  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);  	omap_serial_init(); +	omap_board_config = am3517_crane_config; +	omap_board_config_size = ARRAY_SIZE(am3517_crane_config); +  	/* Configure GPIO for EHCI port */  	if (omap_mux_init_gpio(GPIO_USB_NRESET, OMAP_PIN_OUTPUT)) {  		pr_err("Can not configure mux for GPIO_USB_NRESET %d\n", diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 634fe65b33c..30ec4519326 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -381,13 +381,8 @@ static struct omap_dss_board_info am3517_evm_dss_data = {  /*   * Board initialization   */ -static struct omap_board_config_kernel am3517_evm_config[] __initdata = { -}; -  static void __init am3517_evm_init_early(void)  { -	omap_board_config = am3517_evm_config; -	omap_board_config_size = ARRAY_SIZE(am3517_evm_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -481,8 +476,13 @@ static void am3517_evm_hecc_init(struct ti_hecc_platform_data *pdata)  	platform_device_register(&am3517_hecc_device);  } +static struct omap_board_config_kernel am3517_evm_config[] __initdata = { +}; +  static void __init am3517_evm_init(void)  { +	omap_board_config = am3517_evm_config; +	omap_board_config_size = ARRAY_SIZE(am3517_evm_config);  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);  	am3517_evm_i2c_init(); diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 4ef4aad4e71..f4f8374a029 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -276,8 +276,6 @@ static struct omap_board_config_kernel apollon_config[] __initdata = {  static void __init omap_apollon_init_early(void)  { -	omap_board_config = apollon_config; -	omap_board_config_size = ARRAY_SIZE(apollon_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -319,6 +317,8 @@ static void __init omap_apollon_init(void)  	u32 v;  	omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC); +	omap_board_config = apollon_config; +	omap_board_config_size = ARRAY_SIZE(apollon_config);  	apollon_init_smc91x();  	apollon_led_init(); diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index 7311824be99..27bea540ccb 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -668,14 +668,8 @@ static void __init cm_t35_init_i2c(void)  			      ARRAY_SIZE(cm_t35_i2c_boardinfo));  } -static struct omap_board_config_kernel cm_t35_config[] __initdata = { -}; -  static void __init cm_t35_init_early(void)  { -	omap_board_config = cm_t35_config; -	omap_board_config_size = ARRAY_SIZE(cm_t35_config); -  	omap2_init_common_infrastructure();  	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,  			     mt46h32m32lf6_sdrc_params); @@ -785,8 +779,13 @@ static struct omap_musb_board_data musb_board_data = {  	.power			= 100,  }; +static struct omap_board_config_kernel cm_t35_config[] __initdata = { +}; +  static void __init cm_t35_init(void)  { +	omap_board_config = cm_t35_config; +	omap_board_config_size = ARRAY_SIZE(cm_t35_config);  	omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);  	omap_serial_init();  	cm_t35_init_i2c(); diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c index 38bef6d004c..9da6e8240e8 100644 --- a/arch/arm/mach-omap2/board-cm-t3517.c +++ b/arch/arm/mach-omap2/board-cm-t3517.c @@ -256,9 +256,6 @@ static struct omap_board_config_kernel cm_t3517_config[] __initdata = {  static void __init cm_t3517_init_early(void)  { -	omap_board_config = cm_t3517_config; -	omap_board_config_size = ARRAY_SIZE(cm_t3517_config); -  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -293,6 +290,8 @@ static void __init cm_t3517_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);  	omap_serial_init(); +	omap_board_config = cm_t3517_config; +	omap_board_config_size = ARRAY_SIZE(cm_t3517_config);  	cm_t3517_init_leds();  	cm_t3517_init_nand();  	cm_t3517_init_rtc(); diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index c9170f4d5d4..728f27c5bcb 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -342,9 +342,7 @@ static struct twl4030_usb_data devkit8000_usb_data = {  	.usb_mode	= T2_USB_MODE_ULPI,  }; -static struct twl4030_codec_audio_data devkit8000_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data devkit8000_audio_data;  static struct twl4030_codec_data devkit8000_codec_data = {  	.audio_mclk = 26000000, diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c index c32c06828f0..729892fdcf2 100644 --- a/arch/arm/mach-omap2/board-flash.c +++ b/arch/arm/mach-omap2/board-flash.c @@ -154,7 +154,7 @@ __init board_nand_init(struct mtd_partition *nand_parts,  }  #else  void -__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs) +__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs, int nand_type)  {  }  #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */ diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 682da9251db..73e3c31e850 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -35,8 +35,6 @@ static struct omap_board_config_kernel generic_config[] = {  static void __init omap_generic_init_early(void)  { -	omap_board_config = generic_config; -	omap_board_config_size = ARRAY_SIZE(generic_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -44,6 +42,8 @@ static void __init omap_generic_init_early(void)  static void __init omap_generic_init(void)  {  	omap_serial_init(); +	omap_board_config = generic_config; +	omap_board_config_size = ARRAY_SIZE(generic_config);  }  static void __init omap_generic_map_io(void) diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index f6a3872f72f..7e6bf4fa153 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -292,8 +292,6 @@ static struct omap_board_config_kernel h4_config[] __initdata = {  static void __init omap_h4_init_early(void)  { -	omap_board_config = h4_config; -	omap_board_config_size = ARRAY_SIZE(h4_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -334,6 +332,9 @@ static void __init omap_h4_init(void)  {  	omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAF); +	omap_board_config = h4_config; +	omap_board_config_size = ARRAY_SIZE(h4_config); +  	/*  	 * Make sure the serial ports are muxed on at this point.  	 * You have to mux them off in device drivers later on diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 1877c28961e..c4b3c1c47ec 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -521,9 +521,7 @@ static void __init igep2_init_early(void)  				  m65kxxxxam_sdrc_params);  } -static struct twl4030_codec_audio_data igep2_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data igep2_audio_data;  static struct twl4030_codec_data igep2_codec_data = {  	.audio_mclk = 26000000, diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index a3fae5697a7..e2ba77957a8 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -290,8 +290,6 @@ static struct omap_board_config_kernel ldp_config[] __initdata = {  static void __init omap_ldp_init_early(void)  { -	omap_board_config = ldp_config; -	omap_board_config_size = ARRAY_SIZE(ldp_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -329,6 +327,26 @@ static struct regulator_init_data ldp_vmmc1 = {  	.consumer_supplies	= &ldp_vmmc1_supply,  }; +/* ads7846 on SPI */ +static struct regulator_consumer_supply ldp_vaux1_supplies[] = { +	REGULATOR_SUPPLY("vcc", "spi1.0"), +}; + +/* VAUX1 */ +static struct regulator_init_data ldp_vaux1 = { +	.constraints = { +		.min_uV			= 3000000, +		.max_uV			= 3000000, +		.apply_uV		= true, +		.valid_modes_mask	= REGULATOR_MODE_NORMAL +					| REGULATOR_MODE_STANDBY, +		.valid_ops_mask		= REGULATOR_CHANGE_MODE +					| REGULATOR_CHANGE_STATUS, +	}, +	.num_consumer_supplies		= ARRAY_SIZE(ldp_vaux1_supplies), +	.consumer_supplies		= ldp_vaux1_supplies, +}; +  static struct twl4030_platform_data ldp_twldata = {  	.irq_base	= TWL4030_IRQ_BASE,  	.irq_end	= TWL4030_IRQ_END, @@ -337,6 +355,7 @@ static struct twl4030_platform_data ldp_twldata = {  	.madc		= &ldp_madc_data,  	.usb		= &ldp_usb_data,  	.vmmc1		= &ldp_vmmc1, +	.vaux1		= &ldp_vaux1,  	.gpio		= &ldp_gpio_data,  	.keypad		= &ldp_kp_twl4030_data,  }; @@ -422,6 +441,8 @@ static struct mtd_partition ldp_nand_partitions[] = {  static void __init omap_ldp_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = ldp_config; +	omap_board_config_size = ARRAY_SIZE(ldp_config);  	ldp_init_smsc911x();  	omap_i2c_init();  	platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices)); diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index a1faea3b776..b6752ac5b97 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -427,9 +427,7 @@ static struct twl4030_usb_data beagle_usb_data = {  	.usb_mode	= T2_USB_MODE_ULPI,  }; -static struct twl4030_codec_audio_data beagle_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data beagle_audio_data;  static struct twl4030_codec_data beagle_codec_data = {  	.audio_mclk = 26000000, diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index f2a3a883cca..b65848c59e1 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -534,9 +534,7 @@ static struct twl4030_madc_platform_data omap3evm_madc_data = {  	.irq_line	= 1,  }; -static struct twl4030_codec_audio_data omap3evm_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data omap3evm_audio_data;  static struct twl4030_codec_data omap3evm_codec_data = {  	.audio_mclk = 26000000, @@ -729,8 +727,6 @@ static struct omap_board_config_kernel omap3_evm_config[] __initdata = {  static void __init omap3_evm_init_early(void)  { -	omap_board_config = omap3_evm_config; -	omap_board_config_size = ARRAY_SIZE(omap3_evm_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);  } @@ -836,6 +832,9 @@ static void __init omap3_evm_init(void)  	else  		omap3_mux_init(omap35x_board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = omap3_evm_config; +	omap_board_config_size = ARRAY_SIZE(omap3_evm_config); +  	omap3_evm_i2c_init();  	omap_display_init(&omap3_evm_dss_data); diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index ed138694ccb..5386a8190ea 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -516,9 +516,7 @@ static struct twl4030_usb_data omap3pandora_usb_data = {  	.usb_mode	= T2_USB_MODE_ULPI,  }; -static struct twl4030_codec_audio_data omap3pandora_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data omap3pandora_audio_data;  static struct twl4030_codec_data omap3pandora_codec_data = {  	.audio_mclk = 26000000, diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c index 07006c323fc..15ede8b4981 100644 --- a/arch/arm/mach-omap2/board-omap3stalker.c +++ b/arch/arm/mach-omap2/board-omap3stalker.c @@ -431,9 +431,7 @@ static struct twl4030_madc_platform_data omap3stalker_madc_data = {  	.irq_line	= 1,  }; -static struct twl4030_codec_audio_data omap3stalker_audio_data = { -	.audio_mclk	= 26000000, -}; +static struct twl4030_codec_audio_data omap3stalker_audio_data;  static struct twl4030_codec_data omap3stalker_codec_data = {  	.audio_mclk	= 26000000, @@ -581,8 +579,6 @@ static struct omap_board_config_kernel omap3_stalker_config[] __initdata = {  static void __init omap3_stalker_init_early(void)  { -	omap_board_config = omap3_stalker_config; -	omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(mt46h32m32lf6_sdrc_params, NULL);  } @@ -629,6 +625,8 @@ static struct omap_musb_board_data musb_board_data = {  static void __init omap3_stalker_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CUS); +	omap_board_config = omap3_stalker_config; +	omap_board_config_size = ARRAY_SIZE(omap3_stalker_config);  	omap3_stalker_i2c_init(); diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 6a60f79dccc..5554f5814aa 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c @@ -252,9 +252,7 @@ static struct twl4030_usb_data touchbook_usb_data = {  	.usb_mode	= T2_USB_MODE_ULPI,  }; -static struct twl4030_codec_audio_data touchbook_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data touchbook_audio_data;  static struct twl4030_codec_data touchbook_codec_data = {  	.audio_mclk = 26000000, @@ -417,9 +415,6 @@ static struct omap_board_mux board_mux[] __initdata = {  static void __init omap3_touchbook_init_early(void)  { -	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); -	omap_board_config = omap3_touchbook_config; -	omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,  				  mt46h32m32lf6_sdrc_params); @@ -514,6 +509,10 @@ static struct omap_musb_board_data musb_board_data = {  static void __init omap3_touchbook_init(void)  { +	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = omap3_touchbook_config; +	omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config); +  	pm_power_off = omap3_touchbook_poweroff;  	omap3_touchbook_i2c_init(); diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index 12bf09a7c5e..a94ce07be72 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -50,6 +50,16 @@  #define GPIO_WIFI_PMENA		43  #define GPIO_WIFI_IRQ		53 +/* wl127x BT, FM, GPS connectivity chip */ +static int wl1271_gpios[] = {46, -1, -1}; +static struct platform_device wl1271_device = { +	.name	= "kim", +	.id	= -1, +	.dev	= { +		.platform_data	= &wl1271_gpios, +	}, +}; +  static struct gpio_led gpio_leds[] = {  	{  		.name			= "pandaboard::status1", @@ -78,6 +88,7 @@ static struct platform_device leds_gpio = {  static struct platform_device *panda_devices[] __initdata = {  	&leds_gpio, +	&wl1271_device,  };  static void __init omap4_panda_init_early(void) diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index a33ec0edec1..60f8db31763 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -358,9 +358,7 @@ static struct regulator_init_data overo_vmmc1 = {  	.consumer_supplies	= &overo_vmmc1_supply,  }; -static struct twl4030_codec_audio_data overo_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data overo_audio_data;  static struct twl4030_codec_data overo_codec_data = {  	.audio_mclk = 26000000, @@ -411,8 +409,6 @@ static struct omap_board_config_kernel overo_config[] __initdata = {  static void __init overo_init_early(void)  { -	omap_board_config = overo_config; -	omap_board_config_size = ARRAY_SIZE(overo_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(mt46h32m32lf6_sdrc_params,  				  mt46h32m32lf6_sdrc_params); @@ -448,6 +444,8 @@ static struct omap_musb_board_data musb_board_data = {  static void __init overo_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = overo_config; +	omap_board_config_size = ARRAY_SIZE(overo_config);  	overo_i2c_init();  	platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));  	omap_serial_init(); diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c index b74357ffe61..5f1900c532e 100644 --- a/arch/arm/mach-omap2/board-rx51-peripherals.c +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c @@ -36,6 +36,8 @@  #include <sound/tlv320aic3x.h>  #include <sound/tpa6130a2-plat.h> +#include <media/radio-si4713.h> +#include <media/si4713.h>  #include <../drivers/staging/iio/light/tsl2563.h> @@ -47,6 +49,8 @@  #define RX51_WL1251_POWER_GPIO		87  #define RX51_WL1251_IRQ_GPIO		42 +#define RX51_FMTX_RESET_GPIO		163 +#define RX51_FMTX_IRQ			53  /* list all spi devices here */  enum { @@ -357,10 +361,14 @@ static struct regulator_consumer_supply rx51_vio_supplies[] = {  	REGULATOR_SUPPLY("DVDD", "2-0018"),  	REGULATOR_SUPPLY("IOVDD", "2-0019"),  	REGULATOR_SUPPLY("DVDD", "2-0019"), +	/* Si4713 IO supply */ +	REGULATOR_SUPPLY("vio", "2-0063"),  };  static struct regulator_consumer_supply rx51_vaux1_consumers[] = {  	REGULATOR_SUPPLY("vdds_sdi", "omapdss"), +	/* Si4713 supply */ +	REGULATOR_SUPPLY("vdd", "2-0063"),  };  static struct regulator_consumer_supply rx51_vdac_supply[] = { @@ -511,6 +519,41 @@ static struct regulator_init_data rx51_vio = {  	.consumer_supplies	= rx51_vio_supplies,  }; +static struct si4713_platform_data rx51_si4713_i2c_data __initdata_or_module = { +	.gpio_reset	= RX51_FMTX_RESET_GPIO, +}; + +static struct i2c_board_info rx51_si4713_board_info __initdata_or_module = { +	I2C_BOARD_INFO("si4713", SI4713_I2C_ADDR_BUSEN_HIGH), +	.platform_data	= &rx51_si4713_i2c_data, +}; + +static struct radio_si4713_platform_data rx51_si4713_data __initdata_or_module = { +	.i2c_bus	= 2, +	.subdev_board_info = &rx51_si4713_board_info, +}; + +static struct platform_device rx51_si4713_dev __initdata_or_module = { +	.name	= "radio-si4713", +	.id	= -1, +	.dev	= { +		.platform_data	= &rx51_si4713_data, +	}, +}; + +static __init void rx51_init_si4713(void) +{ +	int err; + +	err = gpio_request_one(RX51_FMTX_IRQ, GPIOF_DIR_IN, "si4713 irq"); +	if (err) { +		printk(KERN_ERR "Cannot request si4713 irq gpio. %d\n", err); +		return; +	} +	rx51_si4713_board_info.irq = gpio_to_irq(RX51_FMTX_IRQ); +	platform_device_register(&rx51_si4713_dev); +} +  static int rx51_twlgpio_setup(struct device *dev, unsigned gpio, unsigned n)  {  	/* FIXME this gpio setup is just a placeholder for now */ @@ -699,6 +742,14 @@ static struct twl4030_power_data rx51_t2scripts_data __initdata = {  	.resource_config = twl4030_rconfig,  }; +struct twl4030_codec_vibra_data rx51_vibra_data __initdata = { +	.coexist	= 0, +}; + +struct twl4030_codec_data rx51_codec_data __initdata = { +	.audio_mclk	= 26000000, +	.vibra		= &rx51_vibra_data, +};  static struct twl4030_platform_data rx51_twldata __initdata = {  	.irq_base		= TWL4030_IRQ_BASE, @@ -710,6 +761,7 @@ static struct twl4030_platform_data rx51_twldata __initdata = {  	.madc			= &rx51_madc_data,  	.usb			= &rx51_usb_data,  	.power			= &rx51_t2scripts_data, +	.codec			= &rx51_codec_data,  	.vaux1			= &rx51_vaux1,  	.vaux2			= &rx51_vaux2, @@ -921,6 +973,7 @@ void __init rx51_peripherals_init(void)  	board_smc91x_init();  	rx51_add_gpio_keys();  	rx51_init_wl1251(); +	rx51_init_si4713();  	spi_register_board_info(rx51_peripherals_spi_board_info,  				ARRAY_SIZE(rx51_peripherals_spi_board_info)); diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 3cf72fe6d75..e964895b80e 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -102,9 +102,6 @@ static void __init rx51_init_early(void)  {  	struct omap_sdrc_params *sdrc_params; -	omap_board_config = rx51_config; -	omap_board_config_size = ARRAY_SIZE(rx51_config); -	omap3_pm_init_cpuidle(rx51_cpuidle_params);  	omap2_init_common_infrastructure();  	sdrc_params = nokia_get_sdram_timings();  	omap2_init_common_devices(sdrc_params, sdrc_params); @@ -127,6 +124,9 @@ static struct omap_musb_board_data musb_board_data = {  static void __init rx51_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); +	omap_board_config = rx51_config; +	omap_board_config_size = ARRAY_SIZE(rx51_config); +	omap3_pm_init_cpuidle(rx51_cpuidle_params);  	omap_serial_init();  	usb_musb_init(&musb_board_data);  	rx51_peripherals_init(); diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c index f2b097190e0..09fa7bfff8d 100644 --- a/arch/arm/mach-omap2/board-ti8168evm.c +++ b/arch/arm/mach-omap2/board-ti8168evm.c @@ -29,8 +29,6 @@ static struct omap_board_config_kernel ti8168_evm_config[] __initdata = {  static void __init ti8168_init_early(void)  { -	omap_board_config = ti8168_evm_config; -	omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);  	omap2_init_common_infrastructure();  	omap2_init_common_devices(NULL, NULL);  } @@ -43,6 +41,8 @@ static void __init ti8168_evm_init_irq(void)  static void __init ti8168_evm_init(void)  {  	omap_serial_init(); +	omap_board_config = ti8168_evm_config; +	omap_board_config_size = ARRAY_SIZE(ti8168_evm_config);  }  static void __init ti8168_evm_map_io(void) diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 7a098a4cdfe..448ab60195d 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -322,9 +322,7 @@ static struct twl4030_madc_platform_data zoom_madc_data = {  	.irq_line	= 1,  }; -static struct twl4030_codec_audio_data zoom_audio_data = { -	.audio_mclk = 26000000, -}; +static struct twl4030_codec_audio_data zoom_audio_data;  static struct twl4030_codec_data zoom_codec_data = {  	.audio_mclk = 26000000, diff --git a/arch/arm/mach-omap2/clkt_dpll.c b/arch/arm/mach-omap2/clkt_dpll.c index 337392c3f54..acb7ae5b0a2 100644 --- a/arch/arm/mach-omap2/clkt_dpll.c +++ b/arch/arm/mach-omap2/clkt_dpll.c @@ -77,7 +77,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n)  	dd = clk->dpll_data;  	/* DPLL divider must result in a valid jitter correction val */ -	fint = clk->parent->rate / (n + 1); +	fint = clk->parent->rate / n;  	if (fint < DPLL_FINT_BAND1_MIN) {  		pr_debug("rejecting n=%d due to Fint failure, " diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 31632ac1ca7..2cb720b5b12 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -184,95 +184,29 @@ int __init omap4_keyboard_init(struct omap4_keypad_platform_data  }  #if defined(CONFIG_OMAP_MBOX_FWK) || defined(CONFIG_OMAP_MBOX_FWK_MODULE) - -#define MBOX_REG_SIZE   0x120 - -#ifdef CONFIG_ARCH_OMAP2 -static struct resource omap2_mbox_resources[] = { -	{ -		.start		= OMAP24XX_MAILBOX_BASE, -		.end		= OMAP24XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, -		.flags		= IORESOURCE_MEM, -	}, -	{ -		.start		= INT_24XX_MAIL_U0_MPU, -		.flags		= IORESOURCE_IRQ, -		.name		= "dsp", -	}, -	{ -		.start		= INT_24XX_MAIL_U3_MPU, -		.flags		= IORESOURCE_IRQ, -		.name		= "iva", -	}, -}; -static int omap2_mbox_resources_sz = ARRAY_SIZE(omap2_mbox_resources); -#else -#define omap2_mbox_resources		NULL -#define omap2_mbox_resources_sz		0 -#endif - -#ifdef CONFIG_ARCH_OMAP3 -static struct resource omap3_mbox_resources[] = { -	{ -		.start		= OMAP34XX_MAILBOX_BASE, -		.end		= OMAP34XX_MAILBOX_BASE + MBOX_REG_SIZE - 1, -		.flags		= IORESOURCE_MEM, -	}, -	{ -		.start		= INT_24XX_MAIL_U0_MPU, -		.flags		= IORESOURCE_IRQ, -		.name		= "dsp", -	}, -}; -static int omap3_mbox_resources_sz = ARRAY_SIZE(omap3_mbox_resources); -#else -#define omap3_mbox_resources		NULL -#define omap3_mbox_resources_sz		0 -#endif - -#ifdef CONFIG_ARCH_OMAP4 - -#define OMAP4_MBOX_REG_SIZE	0x130 -static struct resource omap4_mbox_resources[] = { -	{ -		.start          = OMAP44XX_MAILBOX_BASE, -		.end            = OMAP44XX_MAILBOX_BASE + -					OMAP4_MBOX_REG_SIZE - 1, -		.flags          = IORESOURCE_MEM, -	}, -	{ -		.start          = OMAP44XX_IRQ_MAIL_U0, -		.flags          = IORESOURCE_IRQ, -		.name		= "mbox", +static struct omap_device_pm_latency mbox_latencies[] = { +	[0] = { +		.activate_func = omap_device_enable_hwmods, +		.deactivate_func = omap_device_idle_hwmods, +		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,  	},  }; -static int omap4_mbox_resources_sz = ARRAY_SIZE(omap4_mbox_resources); -#else -#define omap4_mbox_resources		NULL -#define omap4_mbox_resources_sz		0 -#endif - -static struct platform_device mbox_device = { -	.name		= "omap-mailbox", -	.id		= -1, -};  static inline void omap_init_mbox(void)  { -	if (cpu_is_omap24xx()) { -		mbox_device.resource = omap2_mbox_resources; -		mbox_device.num_resources = omap2_mbox_resources_sz; -	} else if (cpu_is_omap34xx()) { -		mbox_device.resource = omap3_mbox_resources; -		mbox_device.num_resources = omap3_mbox_resources_sz; -	} else if (cpu_is_omap44xx()) { -		mbox_device.resource = omap4_mbox_resources; -		mbox_device.num_resources = omap4_mbox_resources_sz; -	} else { -		pr_err("%s: platform not supported\n", __func__); +	struct omap_hwmod *oh; +	struct omap_device *od; + +	oh = omap_hwmod_lookup("mailbox"); +	if (!oh) { +		pr_err("%s: unable to find hwmod\n", __func__);  		return;  	} -	platform_device_register(&mbox_device); + +	od = omap_device_build("omap-mailbox", -1, oh, NULL, 0, +				mbox_latencies, ARRAY_SIZE(mbox_latencies), 0); +	WARN(IS_ERR(od), "%s: could not build device, err %ld\n", +						__func__, PTR_ERR(od));  }  #else  static inline void omap_init_mbox(void) { } diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 14ee686b649..adb083e41ac 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c @@ -145,35 +145,32 @@ static void omap2_iommu_set_twl(struct iommu *obj, bool on)  static u32 omap2_iommu_fault_isr(struct iommu *obj, u32 *ra)  { -	int i;  	u32 stat, da; -	const char *err_msg[] =	{ -		"tlb miss", -		"translation fault", -		"emulation miss", -		"table walk fault", -		"multi hit fault", -	}; +	u32 errs = 0;  	stat = iommu_read_reg(obj, MMU_IRQSTATUS);  	stat &= MMU_IRQ_MASK; -	if (!stat) +	if (!stat) { +		*ra = 0;  		return 0; +	}  	da = iommu_read_reg(obj, MMU_FAULT_AD);  	*ra = da; -	dev_err(obj->dev, "%s:\tda:%08x ", __func__, da); - -	for (i = 0; i < ARRAY_SIZE(err_msg); i++) { -		if (stat & (1 << i)) -			printk("%s ", err_msg[i]); -	} -	printk("\n"); - +	if (stat & MMU_IRQ_TLBMISS) +		errs |= OMAP_IOMMU_ERR_TLB_MISS; +	if (stat & MMU_IRQ_TRANSLATIONFAULT) +		errs |= OMAP_IOMMU_ERR_TRANS_FAULT; +	if (stat & MMU_IRQ_EMUMISS) +		errs |= OMAP_IOMMU_ERR_EMU_MISS; +	if (stat & MMU_IRQ_TABLEWALKFAULT) +		errs |= OMAP_IOMMU_ERR_TBLWALK_FAULT; +	if (stat & MMU_IRQ_MULTIHITFAULT) +		errs |= OMAP_IOMMU_ERR_MULTIHIT_FAULT;  	iommu_write_reg(obj, stat, MMU_IRQSTATUS); -	return stat; +	return errs;  }  static void omap2_tlb_read_cr(struct iommu *obj, struct cr_regs *cr) diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 29b9dc3917a..6e15e3d7c65 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -14,12 +14,11 @@  #include <linux/err.h>  #include <linux/platform_device.h>  #include <linux/io.h> +#include <linux/pm_runtime.h>  #include <plat/mailbox.h>  #include <mach/irqs.h>  #define MAILBOX_REVISION		0x000 -#define MAILBOX_SYSCONFIG		0x010 -#define MAILBOX_SYSSTATUS		0x014  #define MAILBOX_MESSAGE(m)		(0x040 + 4 * (m))  #define MAILBOX_FIFOSTATUS(m)		(0x080 + 4 * (m))  #define MAILBOX_MSGSTATUS(m)		(0x0c0 + 4 * (m)) @@ -33,17 +32,6 @@  #define MAILBOX_IRQ_NEWMSG(m)		(1 << (2 * (m)))  #define MAILBOX_IRQ_NOTFULL(m)		(1 << (2 * (m) + 1)) -/* SYSCONFIG: register bit definition */ -#define AUTOIDLE	(1 << 0) -#define SOFTRESET	(1 << 1) -#define SMARTIDLE	(2 << 3) -#define OMAP4_SOFTRESET	(1 << 0) -#define OMAP4_NOIDLE	(1 << 2) -#define OMAP4_SMARTIDLE	(2 << 2) - -/* SYSSTATUS: register bit definition */ -#define RESETDONE	(1 << 0) -  #define MBOX_REG_SIZE			0x120  #define OMAP4_MBOX_REG_SIZE		0x130 @@ -70,8 +58,6 @@ struct omap_mbox2_priv {  	unsigned long irqdisable;  }; -static struct clk *mbox_ick_handle; -  static void omap2_mbox_enable_irq(struct omap_mbox *mbox,  				  omap_mbox_type_t irq); @@ -89,53 +75,13 @@ static inline void mbox_write_reg(u32 val, size_t ofs)  static int omap2_mbox_startup(struct omap_mbox *mbox)  {  	u32 l; -	unsigned long timeout; -	mbox_ick_handle = clk_get(NULL, "mailboxes_ick"); -	if (IS_ERR(mbox_ick_handle)) { -		printk(KERN_ERR "Could not get mailboxes_ick: %ld\n", -			PTR_ERR(mbox_ick_handle)); -		return PTR_ERR(mbox_ick_handle); -	} -	clk_enable(mbox_ick_handle); - -	if (cpu_is_omap44xx()) { -		mbox_write_reg(OMAP4_SOFTRESET, MAILBOX_SYSCONFIG); -		timeout = jiffies + msecs_to_jiffies(20); -		do { -			l = mbox_read_reg(MAILBOX_SYSCONFIG); -			if (!(l & OMAP4_SOFTRESET)) -				break; -		} while (!time_after(jiffies, timeout)); - -		if (l & OMAP4_SOFTRESET) { -			pr_err("Can't take mailbox out of reset\n"); -			return -ENODEV; -		} -	} else { -		mbox_write_reg(SOFTRESET, MAILBOX_SYSCONFIG); -		timeout = jiffies + msecs_to_jiffies(20); -		do { -			l = mbox_read_reg(MAILBOX_SYSSTATUS); -			if (l & RESETDONE) -				break; -		} while (!time_after(jiffies, timeout)); - -		if (!(l & RESETDONE)) { -			pr_err("Can't take mailbox out of reset\n"); -			return -ENODEV; -		} -	} +	pm_runtime_enable(mbox->dev->parent); +	pm_runtime_get_sync(mbox->dev->parent);  	l = mbox_read_reg(MAILBOX_REVISION);  	pr_debug("omap mailbox rev %d.%d\n", (l & 0xf0) >> 4, (l & 0x0f)); -	if (cpu_is_omap44xx()) -		l = OMAP4_SMARTIDLE; -	else -		l = SMARTIDLE | AUTOIDLE; -	mbox_write_reg(l, MAILBOX_SYSCONFIG); -  	omap2_mbox_enable_irq(mbox, IRQ_RX);  	return 0; @@ -143,9 +89,8 @@ static int omap2_mbox_startup(struct omap_mbox *mbox)  static void omap2_mbox_shutdown(struct omap_mbox *mbox)  { -	clk_disable(mbox_ick_handle); -	clk_put(mbox_ick_handle); -	mbox_ick_handle = NULL; +	pm_runtime_put_sync(mbox->dev->parent); +	pm_runtime_disable(mbox->dev->parent);  }  /* Mailbox FIFO handle functions */ @@ -334,7 +279,7 @@ static struct omap_mbox mbox_iva_info = {  	.priv	= &omap2_mbox_iva_priv,  }; -struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL }; +struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL };  #endif  #if defined(CONFIG_ARCH_OMAP4) @@ -398,14 +343,14 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)  	else if (cpu_is_omap34xx()) {  		list = omap3_mboxes; -		list[0]->irq = platform_get_irq_byname(pdev, "dsp"); +		list[0]->irq = platform_get_irq(pdev, 0);  	}  #endif  #if defined(CONFIG_ARCH_OMAP2)  	else if (cpu_is_omap2430()) {  		list = omap2_mboxes; -		list[0]->irq = platform_get_irq_byname(pdev, "dsp"); +		list[0]->irq = platform_get_irq(pdev, 0);  	} else if (cpu_is_omap2420()) {  		list = omap2_mboxes; @@ -417,8 +362,7 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)  	else if (cpu_is_omap44xx()) {  		list = omap4_mboxes; -		list[0]->irq = list[1]->irq = -			platform_get_irq_byname(pdev, "mbox"); +		list[0]->irq = list[1]->irq = platform_get_irq(pdev, 0);  	}  #endif  	else { diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index 0526b758bdc..565b9064a32 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c @@ -22,10 +22,11 @@  #include <plat/dma.h>  #include <plat/cpu.h>  #include <plat/mcbsp.h> +#include <plat/omap_device.h> +#include <linux/pm_runtime.h>  #include "control.h" -  /* McBSP internal signal muxing functions */  void omap2_mcbsp1_mux_clkr_src(u8 mux) @@ -83,7 +84,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)  		return -EINVAL;  	} -	clk_disable(mcbsp->fclk); +	pm_runtime_put_sync(mcbsp->dev);  	r = clk_set_parent(mcbsp->fclk, fck_src);  	if (IS_ERR_VALUE(r)) { @@ -93,7 +94,7 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)  		return -EINVAL;  	} -	clk_enable(mcbsp->fclk); +	pm_runtime_get_sync(mcbsp->dev);  	clk_put(fck_src); @@ -101,196 +102,70 @@ int omap2_mcbsp_set_clks_src(u8 id, u8 fck_src_id)  }  EXPORT_SYMBOL(omap2_mcbsp_set_clks_src); - -/* Platform data */ - -#ifdef CONFIG_SOC_OMAP2420 -static struct omap_mcbsp_platform_data omap2420_mcbsp_pdata[] = { +struct omap_device_pm_latency omap2_mcbsp_latency[] = {  	{ -		.phys_base	= OMAP24XX_MCBSP1_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX, -		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX, -	}, -	{ -		.phys_base	= OMAP24XX_MCBSP2_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX, -		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX, +		.deactivate_func = omap_device_idle_hwmods, +		.activate_func   = omap_device_enable_hwmods, +		.flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,  	},  }; -#define OMAP2420_MCBSP_PDATA_SZ		ARRAY_SIZE(omap2420_mcbsp_pdata) -#define OMAP2420_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) -#else -#define omap2420_mcbsp_pdata		NULL -#define OMAP2420_MCBSP_PDATA_SZ		0 -#define OMAP2420_MCBSP_REG_NUM		0 -#endif -#ifdef CONFIG_SOC_OMAP2430 -static struct omap_mcbsp_platform_data omap2430_mcbsp_pdata[] = { -	{ -		.phys_base	= OMAP24XX_MCBSP1_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX, -		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX, -	}, -	{ -		.phys_base	= OMAP24XX_MCBSP2_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX, -		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX, -	}, -	{ -		.phys_base	= OMAP2430_MCBSP3_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP3_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP3_TX, -		.rx_irq		= INT_24XX_MCBSP3_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP3_IRQ_TX, -	}, -	{ -		.phys_base	= OMAP2430_MCBSP4_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP4_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP4_TX, -		.rx_irq		= INT_24XX_MCBSP4_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP4_IRQ_TX, -	}, -	{ -		.phys_base	= OMAP2430_MCBSP5_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP5_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP5_TX, -		.rx_irq		= INT_24XX_MCBSP5_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP5_IRQ_TX, -	}, -}; -#define OMAP2430_MCBSP_PDATA_SZ		ARRAY_SIZE(omap2430_mcbsp_pdata) -#define OMAP2430_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) -#else -#define omap2430_mcbsp_pdata		NULL -#define OMAP2430_MCBSP_PDATA_SZ		0 -#define OMAP2430_MCBSP_REG_NUM		0 -#endif +static int omap_init_mcbsp(struct omap_hwmod *oh, void *unused) +{ +	int id, count = 1; +	char *name = "omap-mcbsp"; +	struct omap_hwmod *oh_device[2]; +	struct omap_mcbsp_platform_data *pdata = NULL; +	struct omap_device *od; -#ifdef CONFIG_ARCH_OMAP3 -static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { -	{ -		.phys_base	= OMAP34XX_MCBSP1_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP1_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP1_TX, -		.rx_irq		= INT_24XX_MCBSP1_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP1_IRQ_TX, -		.buffer_size	= 0x80, /* The FIFO has 128 locations */ -	}, -	{ -		.phys_base	= OMAP34XX_MCBSP2_BASE, -		.phys_base_st	= OMAP34XX_MCBSP2_ST_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP2_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP2_TX, -		.rx_irq		= INT_24XX_MCBSP2_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP2_IRQ_TX, -		.buffer_size	= 0x500, /* The FIFO has 1024 + 256 locations */ -	}, -	{ -		.phys_base	= OMAP34XX_MCBSP3_BASE, -		.phys_base_st	= OMAP34XX_MCBSP3_ST_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP3_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP3_TX, -		.rx_irq		= INT_24XX_MCBSP3_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP3_IRQ_TX, -		.buffer_size	= 0x80, /* The FIFO has 128 locations */ -	}, -	{ -		.phys_base	= OMAP34XX_MCBSP4_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP4_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP4_TX, -		.rx_irq		= INT_24XX_MCBSP4_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP4_IRQ_TX, -		.buffer_size	= 0x80, /* The FIFO has 128 locations */ -	}, -	{ -		.phys_base	= OMAP34XX_MCBSP5_BASE, -		.dma_rx_sync	= OMAP24XX_DMA_MCBSP5_RX, -		.dma_tx_sync	= OMAP24XX_DMA_MCBSP5_TX, -		.rx_irq		= INT_24XX_MCBSP5_IRQ_RX, -		.tx_irq		= INT_24XX_MCBSP5_IRQ_TX, -		.buffer_size	= 0x80, /* The FIFO has 128 locations */ -	}, -}; -#define OMAP34XX_MCBSP_PDATA_SZ		ARRAY_SIZE(omap34xx_mcbsp_pdata) -#define OMAP34XX_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) -#else -#define omap34xx_mcbsp_pdata		NULL -#define OMAP34XX_MCBSP_PDATA_SZ		0 -#define OMAP34XX_MCBSP_REG_NUM		0 -#endif +	sscanf(oh->name, "mcbsp%d", &id); -static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { -	{ -		.phys_base      = OMAP44XX_MCBSP1_BASE, -		.dma_rx_sync    = OMAP44XX_DMA_MCBSP1_RX, -		.dma_tx_sync    = OMAP44XX_DMA_MCBSP1_TX, -		.tx_irq         = OMAP44XX_IRQ_MCBSP1, -	}, -	{ -		.phys_base      = OMAP44XX_MCBSP2_BASE, -		.dma_rx_sync    = OMAP44XX_DMA_MCBSP2_RX, -		.dma_tx_sync    = OMAP44XX_DMA_MCBSP2_TX, -		.tx_irq         = OMAP44XX_IRQ_MCBSP2, -	}, -	{ -		.phys_base      = OMAP44XX_MCBSP3_BASE, -		.dma_rx_sync    = OMAP44XX_DMA_MCBSP3_RX, -		.dma_tx_sync    = OMAP44XX_DMA_MCBSP3_TX, -		.tx_irq         = OMAP44XX_IRQ_MCBSP3, -	}, -	{ -		.phys_base      = OMAP44XX_MCBSP4_BASE, -		.dma_rx_sync    = OMAP44XX_DMA_MCBSP4_RX, -		.dma_tx_sync    = OMAP44XX_DMA_MCBSP4_TX, -		.tx_irq         = OMAP44XX_IRQ_MCBSP4, -	}, -}; -#define OMAP44XX_MCBSP_PDATA_SZ		ARRAY_SIZE(omap44xx_mcbsp_pdata) -#define OMAP44XX_MCBSP_REG_NUM		(OMAP_MCBSP_REG_RCCR / sizeof(u32) + 1) +	pdata = kzalloc(sizeof(struct omap_mcbsp_platform_data), GFP_KERNEL); +	if (!pdata) { +		pr_err("%s: No memory for mcbsp\n", __func__); +		return -ENOMEM; +	} + +	pdata->mcbsp_config_type = oh->class->rev; + +	if (oh->class->rev == MCBSP_CONFIG_TYPE3) { +		if (id == 2) +			/* The FIFO has 1024 + 256 locations */ +			pdata->buffer_size = 0x500; +		else +			/* The FIFO has 128 locations */ +			pdata->buffer_size = 0x80; +	} + +	oh_device[0] = oh; + +	if (oh->dev_attr) { +		oh_device[1] = omap_hwmod_lookup(( +		(struct omap_mcbsp_dev_attr *)(oh->dev_attr))->sidetone); +		count++; +	} +	od = omap_device_build_ss(name, id, oh_device, count, pdata, +				sizeof(*pdata), omap2_mcbsp_latency, +				ARRAY_SIZE(omap2_mcbsp_latency), false); +	kfree(pdata); +	if (IS_ERR(od))  { +		pr_err("%s: Cant build omap_device for %s:%s.\n", __func__, +					name, oh->name); +		return PTR_ERR(od); +	} +	omap_mcbsp_count++; +	return 0; +}  static int __init omap2_mcbsp_init(void)  { -	if (cpu_is_omap2420()) { -		omap_mcbsp_count = OMAP2420_MCBSP_PDATA_SZ; -		omap_mcbsp_cache_size = OMAP2420_MCBSP_REG_NUM * sizeof(u16); -	} else if (cpu_is_omap2430()) { -		omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; -		omap_mcbsp_cache_size = OMAP2430_MCBSP_REG_NUM * sizeof(u32); -	} else if (cpu_is_omap34xx()) { -		omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; -		omap_mcbsp_cache_size = OMAP34XX_MCBSP_REG_NUM * sizeof(u32); -	} else if (cpu_is_omap44xx()) { -		omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; -		omap_mcbsp_cache_size = OMAP44XX_MCBSP_REG_NUM * sizeof(u32); -	} +	omap_hwmod_for_each_by_class("mcbsp", omap_init_mcbsp, NULL);  	mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *),  								GFP_KERNEL);  	if (!mcbsp_ptr)  		return -ENOMEM; -	if (cpu_is_omap2420()) -		omap_mcbsp_register_board_cfg(omap2420_mcbsp_pdata, -						OMAP2420_MCBSP_PDATA_SZ); -	if (cpu_is_omap2430()) -		omap_mcbsp_register_board_cfg(omap2430_mcbsp_pdata, -						OMAP2430_MCBSP_PDATA_SZ); -	if (cpu_is_omap34xx()) -		omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, -						OMAP34XX_MCBSP_PDATA_SZ); -	if (cpu_is_omap44xx()) -		omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata, -						OMAP44XX_MCBSP_PDATA_SZ); -  	return omap_mcbsp_init();  }  arch_initcall(omap2_mcbsp_init); diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index 98148b6c36e..6c84659cf84 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -605,7 +605,7 @@ static void __init omap_mux_dbg_create_entry(  	list_for_each_entry(e, &partition->muxmodes, node) {  		struct omap_mux *m = &e->mux; -		(void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, +		(void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir,  					  m, &omap_mux_dbg_signal_fops);  	}  } diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index f76f133780c..1125134c9a7 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1929,6 +1929,7 @@ int omap_hwmod_fill_resources(struct omap_hwmod *oh, struct resource *res)  		os = oh->slaves[i];  		for (j = 0; j < os->addr_cnt; j++) { +			(res + r)->name = (os->addr + j)->name;  			(res + r)->start = (os->addr + j)->pa_start;  			(res + r)->end = (os->addr + j)->pa_end;  			(res + r)->flags = IORESOURCE_MEM; diff --git a/arch/arm/mach-omap2/omap_hwmod_2420_data.c b/arch/arm/mach-omap2/omap_hwmod_2420_data.c index e58621aa9b3..e0bc2c7a15d 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2420_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2420_data.c @@ -110,6 +110,8 @@ static struct omap_hwmod omap2420_uart2_hwmod;  static struct omap_hwmod omap2420_uart3_hwmod;  static struct omap_hwmod omap2420_i2c1_hwmod;  static struct omap_hwmod omap2420_i2c2_hwmod; +static struct omap_hwmod omap2420_mcbsp1_hwmod; +static struct omap_hwmod omap2420_mcbsp2_hwmod;  /* l4 core -> mcspi1 interface */  static struct omap_hwmod_addr_space omap2420_mcspi1_addr_space[] = { @@ -1828,6 +1830,76 @@ static struct omap_hwmod omap2420_dma_system_hwmod = {  };  /* + * 'mailbox' class + * mailbox module allowing communication between the on-chip processors + * using a queued mailbox-interrupt mechanism. + */ + +static struct omap_hwmod_class_sysconfig omap2420_mailbox_sysc = { +	.rev_offs	= 0x000, +	.sysc_offs	= 0x010, +	.syss_offs	= 0x014, +	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | 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 omap2420_mailbox_hwmod_class = { +	.name = "mailbox", +	.sysc = &omap2420_mailbox_sysc, +}; + +/* mailbox */ +static struct omap_hwmod omap2420_mailbox_hwmod; +static struct omap_hwmod_irq_info omap2420_mailbox_irqs[] = { +	{ .name = "dsp", .irq = 26 }, +	{ .name = "iva", .irq = 34 }, +}; + +static struct omap_hwmod_addr_space omap2420_mailbox_addrs[] = { +	{ +		.pa_start	= 0x48094000, +		.pa_end		= 0x480941ff, +		.flags		= ADDR_TYPE_RT, +	}, +}; + +/* l4_core -> mailbox */ +static struct omap_hwmod_ocp_if omap2420_l4_core__mailbox = { +	.master		= &omap2420_l4_core_hwmod, +	.slave		= &omap2420_mailbox_hwmod, +	.addr		= omap2420_mailbox_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2420_mailbox_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mailbox slave ports */ +static struct omap_hwmod_ocp_if *omap2420_mailbox_slaves[] = { +	&omap2420_l4_core__mailbox, +}; + +static struct omap_hwmod omap2420_mailbox_hwmod = { +	.name		= "mailbox", +	.class		= &omap2420_mailbox_hwmod_class, +	.mpu_irqs	= omap2420_mailbox_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2420_mailbox_irqs), +	.main_clk	= "mailboxes_ick", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, +		}, +	}, +	.slaves		= omap2420_mailbox_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2420_mailbox_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420), +}; + +/*   * 'mcspi' class   * multichannel serial port interface (mcspi) / master/slave synchronous serial   * bus @@ -1940,6 +2012,129 @@ static struct omap_hwmod omap2420_mcspi2_hwmod = {  	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420),  }; +/* + * 'mcbsp' class + * multi channel buffered serial port controller + */ + +static struct omap_hwmod_class omap2420_mcbsp_hwmod_class = { +	.name = "mcbsp", +}; + +/* mcbsp1 */ +static struct omap_hwmod_irq_info omap2420_mcbsp1_irqs[] = { +	{ .name = "tx", .irq = 59 }, +	{ .name = "rx", .irq = 60 }, +}; + +static struct omap_hwmod_dma_info omap2420_mcbsp1_sdma_chs[] = { +	{ .name = "rx", .dma_req = 32 }, +	{ .name = "tx", .dma_req = 31 }, +}; + +static struct omap_hwmod_addr_space omap2420_mcbsp1_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48074000, +		.pa_end		= 0x480740ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp1 */ +static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp1 = { +	.master		= &omap2420_l4_core_hwmod, +	.slave		= &omap2420_mcbsp1_hwmod, +	.clk		= "mcbsp1_ick", +	.addr		= omap2420_mcbsp1_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2420_mcbsp1_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp1 slave ports */ +static struct omap_hwmod_ocp_if *omap2420_mcbsp1_slaves[] = { +	&omap2420_l4_core__mcbsp1, +}; + +static struct omap_hwmod omap2420_mcbsp1_hwmod = { +	.name		= "mcbsp1", +	.class		= &omap2420_mcbsp_hwmod_class, +	.mpu_irqs	= omap2420_mcbsp1_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2420_mcbsp1_irqs), +	.sdma_reqs	= omap2420_mcbsp1_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2420_mcbsp1_sdma_chs), +	.main_clk	= "mcbsp1_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MCBSP1_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, +		}, +	}, +	.slaves		= omap2420_mcbsp1_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2420_mcbsp1_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420), +}; + +/* mcbsp2 */ +static struct omap_hwmod_irq_info omap2420_mcbsp2_irqs[] = { +	{ .name = "tx", .irq = 62 }, +	{ .name = "rx", .irq = 63 }, +}; + +static struct omap_hwmod_dma_info omap2420_mcbsp2_sdma_chs[] = { +	{ .name = "rx", .dma_req = 34 }, +	{ .name = "tx", .dma_req = 33 }, +}; + +static struct omap_hwmod_addr_space omap2420_mcbsp2_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48076000, +		.pa_end		= 0x480760ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp2 */ +static struct omap_hwmod_ocp_if omap2420_l4_core__mcbsp2 = { +	.master		= &omap2420_l4_core_hwmod, +	.slave		= &omap2420_mcbsp2_hwmod, +	.clk		= "mcbsp2_ick", +	.addr		= omap2420_mcbsp2_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2420_mcbsp2_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp2 slave ports */ +static struct omap_hwmod_ocp_if *omap2420_mcbsp2_slaves[] = { +	&omap2420_l4_core__mcbsp2, +}; + +static struct omap_hwmod omap2420_mcbsp2_hwmod = { +	.name		= "mcbsp2", +	.class		= &omap2420_mcbsp_hwmod_class, +	.mpu_irqs	= omap2420_mcbsp2_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2420_mcbsp2_irqs), +	.sdma_reqs	= omap2420_mcbsp2_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2420_mcbsp2_sdma_chs), +	.main_clk	= "mcbsp2_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MCBSP2_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, +		}, +	}, +	.slaves		= omap2420_mcbsp2_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2420_mcbsp2_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2420), +}; +  static __initdata struct omap_hwmod *omap2420_hwmods[] = {  	&omap2420_l3_main_hwmod,  	&omap2420_l4_core_hwmod, @@ -1982,6 +2177,13 @@ static __initdata struct omap_hwmod *omap2420_hwmods[] = {  	/* dma_system class*/  	&omap2420_dma_system_hwmod, +	/* mailbox class */ +	&omap2420_mailbox_hwmod, + +	/* mcbsp class */ +	&omap2420_mcbsp1_hwmod, +	&omap2420_mcbsp2_hwmod, +  	/* mcspi class */  	&omap2420_mcspi1_hwmod,  	&omap2420_mcspi2_hwmod, diff --git a/arch/arm/mach-omap2/omap_hwmod_2430_data.c b/arch/arm/mach-omap2/omap_hwmod_2430_data.c index ca25fa2af78..4aa74d78289 100644 --- a/arch/arm/mach-omap2/omap_hwmod_2430_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_2430_data.c @@ -18,6 +18,7 @@  #include <plat/serial.h>  #include <plat/i2c.h>  #include <plat/gpio.h> +#include <plat/mcbsp.h>  #include <plat/mcspi.h>  #include <plat/dmtimer.h>  #include <plat/mmc.h> @@ -53,6 +54,11 @@ static struct omap_hwmod omap2430_gpio3_hwmod;  static struct omap_hwmod omap2430_gpio4_hwmod;  static struct omap_hwmod omap2430_gpio5_hwmod;  static struct omap_hwmod omap2430_dma_system_hwmod; +static struct omap_hwmod omap2430_mcbsp1_hwmod; +static struct omap_hwmod omap2430_mcbsp2_hwmod; +static struct omap_hwmod omap2430_mcbsp3_hwmod; +static struct omap_hwmod omap2430_mcbsp4_hwmod; +static struct omap_hwmod omap2430_mcbsp5_hwmod;  static struct omap_hwmod omap2430_mcspi1_hwmod;  static struct omap_hwmod omap2430_mcspi2_hwmod;  static struct omap_hwmod omap2430_mcspi3_hwmod; @@ -1955,6 +1961,75 @@ static struct omap_hwmod omap2430_dma_system_hwmod = {  };  /* + * 'mailbox' class + * mailbox module allowing communication between the on-chip processors + * using a queued mailbox-interrupt mechanism. + */ + +static struct omap_hwmod_class_sysconfig omap2430_mailbox_sysc = { +	.rev_offs	= 0x000, +	.sysc_offs	= 0x010, +	.syss_offs	= 0x014, +	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | 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 omap2430_mailbox_hwmod_class = { +	.name = "mailbox", +	.sysc = &omap2430_mailbox_sysc, +}; + +/* mailbox */ +static struct omap_hwmod omap2430_mailbox_hwmod; +static struct omap_hwmod_irq_info omap2430_mailbox_irqs[] = { +	{ .irq = 26 }, +}; + +static struct omap_hwmod_addr_space omap2430_mailbox_addrs[] = { +	{ +		.pa_start	= 0x48094000, +		.pa_end		= 0x480941ff, +		.flags		= ADDR_TYPE_RT, +	}, +}; + +/* l4_core -> mailbox */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mailbox = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mailbox_hwmod, +	.addr		= omap2430_mailbox_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mailbox_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mailbox slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mailbox_slaves[] = { +	&omap2430_l4_core__mailbox, +}; + +static struct omap_hwmod omap2430_mailbox_hwmod = { +	.name		= "mailbox", +	.class		= &omap2430_mailbox_hwmod_class, +	.mpu_irqs	= omap2430_mailbox_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mailbox_irqs), +	.main_clk	= "mailboxes_ick", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MAILBOXES_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MAILBOXES_SHIFT, +		}, +	}, +	.slaves		= omap2430_mailbox_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mailbox_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +}; + +/*   * 'mcspi' class   * multichannel serial port interface (mcspi) / master/slave synchronous serial   * bus @@ -2166,7 +2241,314 @@ static struct omap_hwmod omap2430_usbhsotg_hwmod = {  	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430)  }; +/* + * 'mcbsp' class + * multi channel buffered serial port controller + */ + +static struct omap_hwmod_class_sysconfig omap2430_mcbsp_sysc = { +	.rev_offs	= 0x007C, +	.sysc_offs	= 0x008C, +	.sysc_flags	= (SYSC_HAS_SOFTRESET), +	.sysc_fields    = &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = { +	.name = "mcbsp", +	.sysc = &omap2430_mcbsp_sysc, +	.rev  = MCBSP_CONFIG_TYPE2, +}; + +/* mcbsp1 */ +static struct omap_hwmod_irq_info omap2430_mcbsp1_irqs[] = { +	{ .name = "tx",		.irq = 59 }, +	{ .name = "rx",		.irq = 60 }, +	{ .name = "ovr",	.irq = 61 }, +	{ .name = "common",	.irq = 64 }, +}; + +static struct omap_hwmod_dma_info omap2430_mcbsp1_sdma_chs[] = { +	{ .name = "rx", .dma_req = 32 }, +	{ .name = "tx", .dma_req = 31 }, +}; + +static struct omap_hwmod_addr_space omap2430_mcbsp1_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48074000, +		.pa_end		= 0x480740ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp1 */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp1 = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mcbsp1_hwmod, +	.clk		= "mcbsp1_ick", +	.addr		= omap2430_mcbsp1_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mcbsp1_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp1 slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mcbsp1_slaves[] = { +	&omap2430_l4_core__mcbsp1, +}; + +static struct omap_hwmod omap2430_mcbsp1_hwmod = { +	.name		= "mcbsp1", +	.class		= &omap2430_mcbsp_hwmod_class, +	.mpu_irqs	= omap2430_mcbsp1_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mcbsp1_irqs), +	.sdma_reqs	= omap2430_mcbsp1_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2430_mcbsp1_sdma_chs), +	.main_clk	= "mcbsp1_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MCBSP1_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MCBSP1_SHIFT, +		}, +	}, +	.slaves		= omap2430_mcbsp1_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mcbsp1_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +}; + +/* mcbsp2 */ +static struct omap_hwmod_irq_info omap2430_mcbsp2_irqs[] = { +	{ .name = "tx",		.irq = 62 }, +	{ .name = "rx",		.irq = 63 }, +	{ .name = "common",	.irq = 16 }, +}; + +static struct omap_hwmod_dma_info omap2430_mcbsp2_sdma_chs[] = { +	{ .name = "rx", .dma_req = 34 }, +	{ .name = "tx", .dma_req = 33 }, +}; + +static struct omap_hwmod_addr_space omap2430_mcbsp2_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48076000, +		.pa_end		= 0x480760ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp2 */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp2 = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mcbsp2_hwmod, +	.clk		= "mcbsp2_ick", +	.addr		= omap2430_mcbsp2_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mcbsp2_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp2 slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mcbsp2_slaves[] = { +	&omap2430_l4_core__mcbsp2, +}; + +static struct omap_hwmod omap2430_mcbsp2_hwmod = { +	.name		= "mcbsp2", +	.class		= &omap2430_mcbsp_hwmod_class, +	.mpu_irqs	= omap2430_mcbsp2_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mcbsp2_irqs), +	.sdma_reqs	= omap2430_mcbsp2_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2430_mcbsp2_sdma_chs), +	.main_clk	= "mcbsp2_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP24XX_EN_MCBSP2_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP24XX_ST_MCBSP2_SHIFT, +		}, +	}, +	.slaves		= omap2430_mcbsp2_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mcbsp2_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +}; + +/* mcbsp3 */ +static struct omap_hwmod_irq_info omap2430_mcbsp3_irqs[] = { +	{ .name = "tx",		.irq = 89 }, +	{ .name = "rx",		.irq = 90 }, +	{ .name = "common",	.irq = 17 }, +}; + +static struct omap_hwmod_dma_info omap2430_mcbsp3_sdma_chs[] = { +	{ .name = "rx", .dma_req = 18 }, +	{ .name = "tx", .dma_req = 17 }, +}; + +static struct omap_hwmod_addr_space omap2430_mcbsp3_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x4808C000, +		.pa_end		= 0x4808C0ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp3 */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp3 = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mcbsp3_hwmod, +	.clk		= "mcbsp3_ick", +	.addr		= omap2430_mcbsp3_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mcbsp3_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp3 slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mcbsp3_slaves[] = { +	&omap2430_l4_core__mcbsp3, +}; +static struct omap_hwmod omap2430_mcbsp3_hwmod = { +	.name		= "mcbsp3", +	.class		= &omap2430_mcbsp_hwmod_class, +	.mpu_irqs	= omap2430_mcbsp3_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mcbsp3_irqs), +	.sdma_reqs	= omap2430_mcbsp3_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2430_mcbsp3_sdma_chs), +	.main_clk	= "mcbsp3_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP2430_EN_MCBSP3_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 2, +			.idlest_idle_bit = OMAP2430_ST_MCBSP3_SHIFT, +		}, +	}, +	.slaves		= omap2430_mcbsp3_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mcbsp3_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +}; + +/* mcbsp4 */ +static struct omap_hwmod_irq_info omap2430_mcbsp4_irqs[] = { +	{ .name = "tx",		.irq = 54 }, +	{ .name = "rx",		.irq = 55 }, +	{ .name = "common",	.irq = 18 }, +}; + +static struct omap_hwmod_dma_info omap2430_mcbsp4_sdma_chs[] = { +	{ .name = "rx", .dma_req = 20 }, +	{ .name = "tx", .dma_req = 19 }, +}; + +static struct omap_hwmod_addr_space omap2430_mcbsp4_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x4808E000, +		.pa_end		= 0x4808E0ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp4 */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp4 = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mcbsp4_hwmod, +	.clk		= "mcbsp4_ick", +	.addr		= omap2430_mcbsp4_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mcbsp4_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp4 slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mcbsp4_slaves[] = { +	&omap2430_l4_core__mcbsp4, +}; + +static struct omap_hwmod omap2430_mcbsp4_hwmod = { +	.name		= "mcbsp4", +	.class		= &omap2430_mcbsp_hwmod_class, +	.mpu_irqs	= omap2430_mcbsp4_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mcbsp4_irqs), +	.sdma_reqs	= omap2430_mcbsp4_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2430_mcbsp4_sdma_chs), +	.main_clk	= "mcbsp4_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP2430_EN_MCBSP4_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 2, +			.idlest_idle_bit = OMAP2430_ST_MCBSP4_SHIFT, +		}, +	}, +	.slaves		= omap2430_mcbsp4_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mcbsp4_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +}; + +/* mcbsp5 */ +static struct omap_hwmod_irq_info omap2430_mcbsp5_irqs[] = { +	{ .name = "tx",		.irq = 81 }, +	{ .name = "rx",		.irq = 82 }, +	{ .name = "common",	.irq = 19 }, +}; + +static struct omap_hwmod_dma_info omap2430_mcbsp5_sdma_chs[] = { +	{ .name = "rx", .dma_req = 22 }, +	{ .name = "tx", .dma_req = 21 }, +}; + +static struct omap_hwmod_addr_space omap2430_mcbsp5_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48096000, +		.pa_end		= 0x480960ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp5 */ +static struct omap_hwmod_ocp_if omap2430_l4_core__mcbsp5 = { +	.master		= &omap2430_l4_core_hwmod, +	.slave		= &omap2430_mcbsp5_hwmod, +	.clk		= "mcbsp5_ick", +	.addr		= omap2430_mcbsp5_addrs, +	.addr_cnt	= ARRAY_SIZE(omap2430_mcbsp5_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp5 slave ports */ +static struct omap_hwmod_ocp_if *omap2430_mcbsp5_slaves[] = { +	&omap2430_l4_core__mcbsp5, +}; + +static struct omap_hwmod omap2430_mcbsp5_hwmod = { +	.name		= "mcbsp5", +	.class		= &omap2430_mcbsp_hwmod_class, +	.mpu_irqs	= omap2430_mcbsp5_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap2430_mcbsp5_irqs), +	.sdma_reqs	= omap2430_mcbsp5_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap2430_mcbsp5_sdma_chs), +	.main_clk	= "mcbsp5_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP2430_EN_MCBSP5_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 2, +			.idlest_idle_bit = OMAP2430_ST_MCBSP5_SHIFT, +		}, +	}, +	.slaves		= omap2430_mcbsp5_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap2430_mcbsp5_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP2430), +};  /* MMC/SD/SDIO common */ @@ -2324,6 +2706,16 @@ static __initdata struct omap_hwmod *omap2430_hwmods[] = {  	/* dma_system class*/  	&omap2430_dma_system_hwmod, +	/* mcbsp class */ +	&omap2430_mcbsp1_hwmod, +	&omap2430_mcbsp2_hwmod, +	&omap2430_mcbsp3_hwmod, +	&omap2430_mcbsp4_hwmod, +	&omap2430_mcbsp5_hwmod, + +	/* mailbox class */ +	&omap2430_mailbox_hwmod, +  	/* mcspi class */  	&omap2430_mcspi1_hwmod,  	&omap2430_mcspi2_hwmod, diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c index 5fdcc1e9d4a..e2792cf9c54 100644 --- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c @@ -24,6 +24,7 @@  #include <plat/gpio.h>  #include <plat/mmc.h>  #include <plat/smartreflex.h> +#include <plat/mcbsp.h>  #include <plat/mcspi.h>  #include <plat/dmtimer.h> @@ -77,6 +78,14 @@ static struct omap_hwmod am35xx_usbhsotg_hwmod;  static struct omap_hwmod omap3xxx_dma_system_hwmod; +static struct omap_hwmod omap3xxx_mcbsp1_hwmod; +static struct omap_hwmod omap3xxx_mcbsp2_hwmod; +static struct omap_hwmod omap3xxx_mcbsp3_hwmod; +static struct omap_hwmod omap3xxx_mcbsp4_hwmod; +static struct omap_hwmod omap3xxx_mcbsp5_hwmod; +static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod; +static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod; +  /* L3 -> L4_CORE interface */  static struct omap_hwmod_ocp_if omap3xxx_l3_main__l4_core = {  	.master	= &omap3xxx_l3_main_hwmod, @@ -2425,6 +2434,437 @@ static struct omap_hwmod omap3xxx_dma_system_hwmod = {  	.flags		= HWMOD_NO_IDLEST,  }; +/* + * 'mcbsp' class + * multi channel buffered serial port controller + */ + +static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sysc = { +	.sysc_offs	= 0x008c, +	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | SYSC_HAS_ENAWAKEUP | +			   SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET), +	.idlemodes	= (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART), +	.sysc_fields	= &omap_hwmod_sysc_type1, +	.clockact	= 0x2, +}; + +static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = { +	.name = "mcbsp", +	.sysc = &omap3xxx_mcbsp_sysc, +	.rev  = MCBSP_CONFIG_TYPE3, +}; + +/* mcbsp1 */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp1_irqs[] = { +	{ .name = "irq", .irq = 16 }, +	{ .name = "tx", .irq = 59 }, +	{ .name = "rx", .irq = 60 }, +}; + +static struct omap_hwmod_dma_info omap3xxx_mcbsp1_sdma_chs[] = { +	{ .name = "rx", .dma_req = 32 }, +	{ .name = "tx", .dma_req = 31 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp1_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48074000, +		.pa_end		= 0x480740ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp1 */ +static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp1 = { +	.master		= &omap3xxx_l4_core_hwmod, +	.slave		= &omap3xxx_mcbsp1_hwmod, +	.clk		= "mcbsp1_ick", +	.addr		= omap3xxx_mcbsp1_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp1_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp1 slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp1_slaves[] = { +	&omap3xxx_l4_core__mcbsp1, +}; + +static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { +	.name		= "mcbsp1", +	.class		= &omap3xxx_mcbsp_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp1_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp1_irqs), +	.sdma_reqs	= omap3xxx_mcbsp1_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp1_sdma_chs), +	.main_clk	= "mcbsp1_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP1_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP1_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp1_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp1_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* mcbsp2 */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp2_irqs[] = { +	{ .name = "irq", .irq = 17 }, +	{ .name = "tx", .irq = 62 }, +	{ .name = "rx", .irq = 63 }, +}; + +static struct omap_hwmod_dma_info omap3xxx_mcbsp2_sdma_chs[] = { +	{ .name = "rx", .dma_req = 34 }, +	{ .name = "tx", .dma_req = 33 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp2_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x49022000, +		.pa_end		= 0x490220ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_per -> mcbsp2 */ +static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2 = { +	.master		= &omap3xxx_l4_per_hwmod, +	.slave		= &omap3xxx_mcbsp2_hwmod, +	.clk		= "mcbsp2_ick", +	.addr		= omap3xxx_mcbsp2_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp2 slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_slaves[] = { +	&omap3xxx_l4_per__mcbsp2, +}; + +static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { +	.sidetone	= "mcbsp2_sidetone", +}; + +static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { +	.name		= "mcbsp2", +	.class		= &omap3xxx_mcbsp_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp2_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_irqs), +	.sdma_reqs	= omap3xxx_mcbsp2_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_sdma_chs), +	.main_clk	= "mcbsp2_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP2_SHIFT, +			.module_offs = OMAP3430_PER_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp2_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_slaves), +	.dev_attr	= &omap34xx_mcbsp2_dev_attr, +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* mcbsp3 */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp3_irqs[] = { +	{ .name = "irq", .irq = 22 }, +	{ .name = "tx", .irq = 89 }, +	{ .name = "rx", .irq = 90 }, +}; + +static struct omap_hwmod_dma_info omap3xxx_mcbsp3_sdma_chs[] = { +	{ .name = "rx", .dma_req = 18 }, +	{ .name = "tx", .dma_req = 17 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp3_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x49024000, +		.pa_end		= 0x490240ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_per -> mcbsp3 */ +static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3 = { +	.master		= &omap3xxx_l4_per_hwmod, +	.slave		= &omap3xxx_mcbsp3_hwmod, +	.clk		= "mcbsp3_ick", +	.addr		= omap3xxx_mcbsp3_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp3 slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_slaves[] = { +	&omap3xxx_l4_per__mcbsp3, +}; + +static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { +	.sidetone       = "mcbsp3_sidetone", +}; + +static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { +	.name		= "mcbsp3", +	.class		= &omap3xxx_mcbsp_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp3_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_irqs), +	.sdma_reqs	= omap3xxx_mcbsp3_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_sdma_chs), +	.main_clk	= "mcbsp3_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP3_SHIFT, +			.module_offs = OMAP3430_PER_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp3_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_slaves), +	.dev_attr	= &omap34xx_mcbsp3_dev_attr, +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* mcbsp4 */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp4_irqs[] = { +	{ .name = "irq", .irq = 23 }, +	{ .name = "tx", .irq = 54 }, +	{ .name = "rx", .irq = 55 }, +}; + +static struct omap_hwmod_dma_info omap3xxx_mcbsp4_sdma_chs[] = { +	{ .name = "rx", .dma_req = 20 }, +	{ .name = "tx", .dma_req = 19 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp4_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x49026000, +		.pa_end		= 0x490260ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_per -> mcbsp4 */ +static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp4 = { +	.master		= &omap3xxx_l4_per_hwmod, +	.slave		= &omap3xxx_mcbsp4_hwmod, +	.clk		= "mcbsp4_ick", +	.addr		= omap3xxx_mcbsp4_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp4_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp4 slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp4_slaves[] = { +	&omap3xxx_l4_per__mcbsp4, +}; + +static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { +	.name		= "mcbsp4", +	.class		= &omap3xxx_mcbsp_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp4_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp4_irqs), +	.sdma_reqs	= omap3xxx_mcbsp4_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp4_sdma_chs), +	.main_clk	= "mcbsp4_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP4_SHIFT, +			.module_offs = OMAP3430_PER_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP4_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp4_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp4_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* mcbsp5 */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp5_irqs[] = { +	{ .name = "irq", .irq = 27 }, +	{ .name = "tx", .irq = 81 }, +	{ .name = "rx", .irq = 82 }, +}; + +static struct omap_hwmod_dma_info omap3xxx_mcbsp5_sdma_chs[] = { +	{ .name = "rx", .dma_req = 22 }, +	{ .name = "tx", .dma_req = 21 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp5_addrs[] = { +	{ +		.name		= "mpu", +		.pa_start	= 0x48096000, +		.pa_end		= 0x480960ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_core -> mcbsp5 */ +static struct omap_hwmod_ocp_if omap3xxx_l4_core__mcbsp5 = { +	.master		= &omap3xxx_l4_core_hwmod, +	.slave		= &omap3xxx_mcbsp5_hwmod, +	.clk		= "mcbsp5_ick", +	.addr		= omap3xxx_mcbsp5_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp5_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mcbsp5 slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp5_slaves[] = { +	&omap3xxx_l4_core__mcbsp5, +}; + +static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { +	.name		= "mcbsp5", +	.class		= &omap3xxx_mcbsp_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp5_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp5_irqs), +	.sdma_reqs	= omap3xxx_mcbsp5_sdma_chs, +	.sdma_reqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp5_sdma_chs), +	.main_clk	= "mcbsp5_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP5_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP5_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp5_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp5_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; +/* 'mcbsp sidetone' class */ + +static struct omap_hwmod_class_sysconfig omap3xxx_mcbsp_sidetone_sysc = { +	.sysc_offs	= 0x0010, +	.sysc_flags	= SYSC_HAS_AUTOIDLE, +	.sysc_fields	= &omap_hwmod_sysc_type1, +}; + +static struct omap_hwmod_class omap3xxx_mcbsp_sidetone_hwmod_class = { +	.name = "mcbsp_sidetone", +	.sysc = &omap3xxx_mcbsp_sidetone_sysc, +}; + +/* mcbsp2_sidetone */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp2_sidetone_irqs[] = { +	{ .name = "irq", .irq = 4 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp2_sidetone_addrs[] = { +	{ +		.name		= "sidetone", +		.pa_start	= 0x49028000, +		.pa_end		= 0x490280ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_per -> mcbsp2_sidetone */ +static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp2_sidetone = { +	.master		= &omap3xxx_l4_per_hwmod, +	.slave		= &omap3xxx_mcbsp2_sidetone_hwmod, +	.clk		= "mcbsp2_ick", +	.addr		= omap3xxx_mcbsp2_sidetone_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_addrs), +	.user		= OCP_USER_MPU, +}; + +/* mcbsp2_sidetone slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp2_sidetone_slaves[] = { +	&omap3xxx_l4_per__mcbsp2_sidetone, +}; + +static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { +	.name		= "mcbsp2_sidetone", +	.class		= &omap3xxx_mcbsp_sidetone_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp2_sidetone_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_irqs), +	.main_clk	= "mcbsp2_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			 .module_bit = OMAP3430_EN_MCBSP2_SHIFT, +			.module_offs = OMAP3430_PER_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP2_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp2_sidetone_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp2_sidetone_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +/* mcbsp3_sidetone */ +static struct omap_hwmod_irq_info omap3xxx_mcbsp3_sidetone_irqs[] = { +	{ .name = "irq", .irq = 5 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mcbsp3_sidetone_addrs[] = { +	{ +		.name		= "sidetone", +		.pa_start	= 0x4902A000, +		.pa_end		= 0x4902A0ff, +		.flags		= ADDR_TYPE_RT +	}, +}; + +/* l4_per -> mcbsp3_sidetone */ +static struct omap_hwmod_ocp_if omap3xxx_l4_per__mcbsp3_sidetone = { +	.master		= &omap3xxx_l4_per_hwmod, +	.slave		= &omap3xxx_mcbsp3_sidetone_hwmod, +	.clk		= "mcbsp3_ick", +	.addr		= omap3xxx_mcbsp3_sidetone_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_addrs), +	.user		= OCP_USER_MPU, +}; + +/* mcbsp3_sidetone slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mcbsp3_sidetone_slaves[] = { +	&omap3xxx_l4_per__mcbsp3_sidetone, +}; + +static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { +	.name		= "mcbsp3_sidetone", +	.class		= &omap3xxx_mcbsp_sidetone_hwmod_class, +	.mpu_irqs	= omap3xxx_mcbsp3_sidetone_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_irqs), +	.main_clk	= "mcbsp3_fck", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MCBSP3_SHIFT, +			.module_offs = OMAP3430_PER_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MCBSP3_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mcbsp3_sidetone_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mcbsp3_sidetone_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; + +  /* SR common */  static struct omap_hwmod_sysc_fields omap34xx_sr_sysc_fields = {  	.clkact_shift	= 20, @@ -2554,6 +2994,74 @@ static struct omap_hwmod omap36xx_sr2_hwmod = {  	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3630ES1),  }; +/* + * 'mailbox' class + * mailbox module allowing communication between the on-chip processors + * using a queued mailbox-interrupt mechanism. + */ + +static struct omap_hwmod_class_sysconfig omap3xxx_mailbox_sysc = { +	.rev_offs	= 0x000, +	.sysc_offs	= 0x010, +	.syss_offs	= 0x014, +	.sysc_flags	= (SYSC_HAS_CLOCKACTIVITY | 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 omap3xxx_mailbox_hwmod_class = { +	.name = "mailbox", +	.sysc = &omap3xxx_mailbox_sysc, +}; + +static struct omap_hwmod omap3xxx_mailbox_hwmod; +static struct omap_hwmod_irq_info omap3xxx_mailbox_irqs[] = { +	{ .irq = 26 }, +}; + +static struct omap_hwmod_addr_space omap3xxx_mailbox_addrs[] = { +	{ +		.pa_start	= 0x48094000, +		.pa_end		= 0x480941ff, +		.flags		= ADDR_TYPE_RT, +	}, +}; + +/* l4_core -> mailbox */ +static struct omap_hwmod_ocp_if omap3xxx_l4_core__mailbox = { +	.master		= &omap3xxx_l4_core_hwmod, +	.slave		= &omap3xxx_mailbox_hwmod, +	.addr		= omap3xxx_mailbox_addrs, +	.addr_cnt	= ARRAY_SIZE(omap3xxx_mailbox_addrs), +	.user		= OCP_USER_MPU | OCP_USER_SDMA, +}; + +/* mailbox slave ports */ +static struct omap_hwmod_ocp_if *omap3xxx_mailbox_slaves[] = { +	&omap3xxx_l4_core__mailbox, +}; + +static struct omap_hwmod omap3xxx_mailbox_hwmod = { +	.name		= "mailbox", +	.class		= &omap3xxx_mailbox_hwmod_class, +	.mpu_irqs	= omap3xxx_mailbox_irqs, +	.mpu_irqs_cnt	= ARRAY_SIZE(omap3xxx_mailbox_irqs), +	.main_clk	= "mailboxes_ick", +	.prcm		= { +		.omap2 = { +			.prcm_reg_id = 1, +			.module_bit = OMAP3430_EN_MAILBOXES_SHIFT, +			.module_offs = CORE_MOD, +			.idlest_reg_id = 1, +			.idlest_idle_bit = OMAP3430_ST_MAILBOXES_SHIFT, +		}, +	}, +	.slaves		= omap3xxx_mailbox_slaves, +	.slaves_cnt	= ARRAY_SIZE(omap3xxx_mailbox_slaves), +	.omap_chip	= OMAP_CHIP_INIT(CHIP_IS_OMAP3430), +}; +  /* l4 core -> mcspi1 interface */  static struct omap_hwmod_addr_space omap34xx_mcspi1_addr_space[] = {  	{ @@ -3117,6 +3625,18 @@ static __initdata struct omap_hwmod *omap3xxx_hwmods[] = {  	/* dma_system class*/  	&omap3xxx_dma_system_hwmod, +	/* mcbsp class */ +	&omap3xxx_mcbsp1_hwmod, +	&omap3xxx_mcbsp2_hwmod, +	&omap3xxx_mcbsp3_hwmod, +	&omap3xxx_mcbsp4_hwmod, +	&omap3xxx_mcbsp5_hwmod, +	&omap3xxx_mcbsp2_sidetone_hwmod, +	&omap3xxx_mcbsp3_sidetone_hwmod, + +	/* mailbox class */ +	&omap3xxx_mailbox_hwmod, +  	/* mcspi class */  	&omap34xx_mcspi1,  	&omap34xx_mcspi2, diff --git a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c index 9398c2db725..7dbcdf751c0 100644 --- a/arch/arm/mach-omap2/omap_hwmod_44xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_44xx_data.c @@ -25,6 +25,7 @@  #include <plat/gpio.h>  #include <plat/dma.h>  #include <plat/mcspi.h> +#include <plat/mcbsp.h>  #include <plat/mmc.h>  #include "omap_hwmod_common_data.h" @@ -2738,6 +2739,7 @@ static struct omap_hwmod_class_sysconfig omap44xx_mcbsp_sysc = {  static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = {  	.name	= "mcbsp",  	.sysc	= &omap44xx_mcbsp_sysc, +	.rev	= MCBSP_CONFIG_TYPE4,  };  /* mcbsp1 */ @@ -2753,6 +2755,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp1_sdma_reqs[] = {  static struct omap_hwmod_addr_space omap44xx_mcbsp1_addrs[] = {  	{ +		.name		= "mpu",  		.pa_start	= 0x40122000,  		.pa_end		= 0x401220ff,  		.flags		= ADDR_TYPE_RT @@ -2771,6 +2774,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp1 = {  static struct omap_hwmod_addr_space omap44xx_mcbsp1_dma_addrs[] = {  	{ +		.name		= "dma",  		.pa_start	= 0x49022000,  		.pa_end		= 0x490220ff,  		.flags		= ADDR_TYPE_RT @@ -2824,6 +2828,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp2_sdma_reqs[] = {  static struct omap_hwmod_addr_space omap44xx_mcbsp2_addrs[] = {  	{ +		.name		= "mpu",  		.pa_start	= 0x40124000,  		.pa_end		= 0x401240ff,  		.flags		= ADDR_TYPE_RT @@ -2842,6 +2847,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp2 = {  static struct omap_hwmod_addr_space omap44xx_mcbsp2_dma_addrs[] = {  	{ +		.name		= "dma",  		.pa_start	= 0x49024000,  		.pa_end		= 0x490240ff,  		.flags		= ADDR_TYPE_RT @@ -2895,6 +2901,7 @@ static struct omap_hwmod_dma_info omap44xx_mcbsp3_sdma_reqs[] = {  static struct omap_hwmod_addr_space omap44xx_mcbsp3_addrs[] = {  	{ +		.name		= "mpu",  		.pa_start	= 0x40126000,  		.pa_end		= 0x401260ff,  		.flags		= ADDR_TYPE_RT @@ -2913,6 +2920,7 @@ static struct omap_hwmod_ocp_if omap44xx_l4_abe__mcbsp3 = {  static struct omap_hwmod_addr_space omap44xx_mcbsp3_dma_addrs[] = {  	{ +		.name		= "dma",  		.pa_start	= 0x49026000,  		.pa_end		= 0x490260ff,  		.flags		= ADDR_TYPE_RT diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 125f56591fb..a5a83b358dd 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -637,14 +637,14 @@ static int __init pm_dbg_init(void)  		} -	(void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d, +	(void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d,  				   &enable_off_mode, &pm_dbg_option_fops); -	(void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d, +	(void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d,  				   &sleep_while_idle, &pm_dbg_option_fops); -	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d, +	(void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d,  				   &wakeup_timer_seconds, &pm_dbg_option_fops);  	(void) debugfs_create_file("wakeup_timer_milliseconds", -			S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds, +			S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds,  			&pm_dbg_option_fops);  	pm_dbg_init_done = 1; diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 098e65943a0..0363dcb0ef9 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h @@ -121,6 +121,10 @@  #define OMAP24XX_ST_MCSPI2_MASK				(1 << 18)  #define OMAP24XX_ST_MCSPI1_SHIFT			17  #define OMAP24XX_ST_MCSPI1_MASK				(1 << 17) +#define OMAP24XX_ST_MCBSP2_SHIFT			16 +#define OMAP24XX_ST_MCBSP2_MASK				(1 << 16) +#define OMAP24XX_ST_MCBSP1_SHIFT			15 +#define OMAP24XX_ST_MCBSP1_MASK				(1 << 15)  #define OMAP24XX_ST_GPT12_SHIFT				14  #define OMAP24XX_ST_GPT12_MASK				(1 << 14)  #define OMAP24XX_ST_GPT11_SHIFT				13 diff --git a/arch/arm/mach-omap2/prcm_mpu44xx.h b/arch/arm/mach-omap2/prcm_mpu44xx.h index 729a644ce85..3300ff6e3cf 100644 --- a/arch/arm/mach-omap2/prcm_mpu44xx.h +++ b/arch/arm/mach-omap2/prcm_mpu44xx.h @@ -38,8 +38,8 @@  #define OMAP4430_PRCM_MPU_CPU1_INST		0x0800  /* PRCM_MPU clockdomain register offsets (from instance start) */ -#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS	0x0000 -#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS	0x0000 +#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS	0x0018 +#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS	0x0018  /* diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index c37e823266d..95ac336fe3f 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -900,7 +900,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)  		return PTR_ERR(dbg_dir);  	} -	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir, +	(void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir,  				(void *)sr_info, &pm_sr_fops);  	(void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir,  			&sr_info->err_weight); @@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev)  		strcpy(name, "volt_");  		sprintf(volt_name, "%d", volt_data[i].volt_nominal);  		strcat(name, volt_name); -		(void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir, +		(void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir,  				&(sr_info->nvalue_table[i].nvalue));  	} diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c index fb8d656e4d0..3b9cf85f4bb 100644 --- a/arch/arm/mach-omap2/timer-gp.c +++ b/arch/arm/mach-omap2/timer-gp.c @@ -39,6 +39,7 @@  #include <asm/mach/time.h>  #include <plat/dmtimer.h>  #include <asm/localtimer.h> +#include <asm/sched_clock.h>  #include <plat/common.h>  #include <plat/omap_hwmod.h> @@ -195,6 +196,7 @@ static void __init omap2_gp_clocksource_init(void)  /*   * clocksource   */ +static DEFINE_CLOCK_DATA(cd);  static struct omap_dm_timer *gpt_clocksource;  static cycle_t clocksource_read_cycles(struct clocksource *cs)  { @@ -209,6 +211,15 @@ static struct clocksource clocksource_gpt = {  	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,  }; +static void notrace dmtimer_update_sched_clock(void) +{ +	u32 cyc; + +	cyc = omap_dm_timer_read_counter(gpt_clocksource); + +	update_sched_clock(&cd, cyc, (u32)~0); +} +  /* Setup free-running counter for clocksource */  static void __init omap2_gp_clocksource_init(void)  { @@ -229,6 +240,8 @@ static void __init omap2_gp_clocksource_init(void)  	omap_dm_timer_set_load_start(gpt, 1, 0); +	init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate); +  	if (clocksource_register_hz(&clocksource_gpt, tick_rate))  		printk(err2, clocksource_gpt.name);  }  |