diff options
Diffstat (limited to 'arch/arm/mach-omap2')
41 files changed, 306 insertions, 172 deletions
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index a8a3d1e23e2..2455dcc744a 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -59,8 +59,10 @@ config MACH_OMAP3_BEAGLE  	select OMAP_PACKAGE_CBB  config MACH_DEVKIT8000 -        bool "DEVKIT8000 board" -        depends on ARCH_OMAP3 +	bool "DEVKIT8000 board" +	depends on ARCH_OMAP3 +	select OMAP_PACKAGE_CUS +	select OMAP_MUX  config MACH_OMAP_LDP  	bool "OMAP3 LDP board" diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index 2069fb33baa..4b9fc57770d 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -22,6 +22,9 @@ obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o  # SMP support ONLY available for OMAP4  obj-$(CONFIG_SMP)			+= omap-smp.o omap-headsmp.o  obj-$(CONFIG_LOCAL_TIMERS)		+= timer-mpu.o +obj-$(CONFIG_ARCH_OMAP4)		+= omap44xx-smc.o + +AFLAGS_omap44xx-smc.o			:=-Wa,-march=armv7-a  # Functions loaded to SRAM  obj-$(CONFIG_ARCH_OMAP2420)		+= sram242x.o diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index a101029ceb6..5822bcf7b15 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -648,7 +648,7 @@ static void enable_board_wakeup_source(void)  		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);  } -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c index 4386d2b4a78..504d2bd222f 100755..100644 --- a/arch/arm/mach-omap2/board-3630sdp.c +++ b/arch/arm/mach-omap2/board-3630sdp.c @@ -54,7 +54,7 @@ static void enable_board_wakeup_source(void)  		OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);  } -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, @@ -96,6 +96,7 @@ static struct omap_board_mux board_mux[] __initdata = {  static void __init omap_sdp_init(void)  {  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); +	omap_serial_init();  	zoom_peripherals_init();  	board_smc91x_init();  	enable_board_wakeup_source(); diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c index 180ac112e52..b88f28c5814 100644 --- a/arch/arm/mach-omap2/board-4430sdp.c +++ b/arch/arm/mach-omap2/board-4430sdp.c @@ -50,33 +50,9 @@ static struct omap_board_config_kernel sdp4430_config[] __initdata = {  };  #ifdef CONFIG_CACHE_L2X0 -noinline void omap_smc1(u32 fn, u32 arg) -{ -	register u32 r12 asm("r12") = fn; -	register u32 r0 asm("r0") = arg; - -	/* This is common routine cache secure monitor API used to -	 * modify the PL310 secure registers. -	 * r0 contains the value to be modified and "r12" contains -	 * the monitor API number. It uses few CPU registers -	 * internally and hence they need be backed up including -	 * link register "lr". -	 * Explicitly save r11 and r12 the compiler generated code -	 * won't save it. -	 */ -	asm volatile( -		"stmfd r13!, {r11,r12}\n" -		"dsb\n" -		"smc\n" -		"ldmfd r13!, {r11,r12}\n" -		: "+r" (r0), "+r" (r12) -		: -		: "r4", "r5", "r10", "lr", "cc"); -} -EXPORT_SYMBOL(omap_smc1); -  static int __init omap_l2_cache_init(void)  { +	extern void omap_smc1(u32 fn, u32 arg);  	void __iomem *l2cache_base;  	/* To avoid code running on other OMAPs in diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c index 70c18614773..c1c4389fbd8 100644 --- a/arch/arm/mach-omap2/board-am3517evm.c +++ b/arch/arm/mach-omap2/board-am3517evm.c @@ -273,7 +273,7 @@ static void __init am3517_evm_init_irq(void)  	omap_gpio_init();  } -static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, @@ -294,9 +294,9 @@ static struct omap_board_mux board_mux[] __initdata = {  static void __init am3517_evm_init(void)  { -	am3517_evm_i2c_init(); -  	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); + +	am3517_evm_i2c_init();  	platform_add_devices(am3517_evm_devices,  				ARRAY_SIZE(am3517_evm_devices)); diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c index afa77caaff4..2de4f79f03a 100644 --- a/arch/arm/mach-omap2/board-cm-t35.c +++ b/arch/arm/mach-omap2/board-cm-t35.c @@ -612,7 +612,7 @@ static struct omap2_hsmmc_info mmc[] = {  	{}	/* Terminator */  }; -static struct ehci_hcd_omap_platform_data ehci_pdata = { +static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c index 371019054b4..47e3af2166d 100644 --- a/arch/arm/mach-omap2/board-devkit8000.c +++ b/arch/arm/mach-omap2/board-devkit8000.c @@ -50,7 +50,6 @@  #include <linux/input/matrix_keypad.h>  #include <linux/spi/spi.h>  #include <linux/spi/ads7846.h> -#include <linux/usb/otg.h>  #include <linux/dm9000.h>  #include <linux/interrupt.h> @@ -269,20 +268,6 @@ static int devkit8000_twl_gpio_setup(struct device *dev,  	devkit8000_vmmc1_supply.dev = mmc[0].dev;  	devkit8000_vsim_supply.dev = mmc[0].dev; -	/* REVISIT: need ehci-omap hooks for external VBUS -	 * power switch and overcurrent detect -	 */ - -	gpio_request(gpio + 1, "EHCI_nOC"); -	gpio_direction_input(gpio + 1); - -	/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ -	gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); -	gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); - -	/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ -	gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; -  	return 0;  } @@ -303,7 +288,7 @@ static struct regulator_consumer_supply devkit8000_vpll2_supplies[] = {  	.dev		= &devkit8000_lcd_device.dev,  	},  	{ -	.supply		= "vdss_dsi", +	.supply		= "vdds_dsi",  	.dev		= &devkit8000_dss_device.dev,  	}  }; @@ -636,20 +621,24 @@ static struct omap_musb_board_data musb_board_data = {  	.power			= 100,  }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, -	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, +	.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.phy_reset  = true,  	.reset_gpio_port[0]  = -EINVAL, -	.reset_gpio_port[1]  = 147, +	.reset_gpio_port[1]  = -EINVAL,  	.reset_gpio_port[2]  = -EINVAL  };  static void __init devkit8000_init(void)  { +	omap_serial_init(); + +	omap_dm9000_init(); +  	devkit8000_i2c_init();  	platform_add_devices(devkit8000_devices,  			ARRAY_SIZE(devkit8000_devices)); @@ -659,25 +648,15 @@ static void __init devkit8000_init(void)  	spi_register_board_info(devkit8000_spi_board_info,  	ARRAY_SIZE(devkit8000_spi_board_info)); -	omap_serial_init(); - -	omap_dm9000_init(); -  	devkit8000_ads7846_init(); -	omap_mux_init_gpio(170, OMAP_PIN_INPUT); - -	gpio_request(170, "DVI_nPD"); -	/* REVISIT leave DVI powered down until it's needed ... */ -	gpio_direction_output(170, true); -  	usb_musb_init(&musb_board_data);  	usb_ehci_init(&ehci_pdata);  	devkit8000_flash_init();  	/* Ensure SDRC pins are mux'd for self-refresh */ -	omap_mux_init_signal("sdr_cke0", OMAP_PIN_OUTPUT); -	omap_mux_init_signal("sdr_cke1", OMAP_PIN_OUTPUT); +	omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); +	omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);  }  static void __init devkit8000_map_io(void) diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c index 9958987a3d0..d55c57b761a 100644 --- a/arch/arm/mach-omap2/board-igep0020.c +++ b/arch/arm/mach-omap2/board-igep0020.c @@ -16,7 +16,6 @@  #include <linux/clk.h>  #include <linux/io.h>  #include <linux/gpio.h> -#include <linux/leds.h>  #include <linux/interrupt.h>  #include <linux/regulator/machine.h> @@ -39,8 +38,8 @@  #define IGEP2_SMSC911X_CS       5  #define IGEP2_SMSC911X_GPIO     176  #define IGEP2_GPIO_USBH_NRESET  24 -#define IGEP2_GPIO_LED0_RED 	26 -#define IGEP2_GPIO_LED0_GREEN 	27 +#define IGEP2_GPIO_LED0_GREEN 	26 +#define IGEP2_GPIO_LED0_RED 	27  #define IGEP2_GPIO_LED1_RED   	28  #define IGEP2_GPIO_DVI_PUP	170  #define IGEP2_GPIO_WIFI_NPD 	94 @@ -355,34 +354,50 @@ static void __init igep2_display_init(void)  	    gpio_direction_output(IGEP2_GPIO_DVI_PUP, 1))  		pr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n");  } -#ifdef CONFIG_LEDS_TRIGGERS -static struct gpio_led gpio_leds[] = { + +#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +#include <linux/leds.h> + +static struct gpio_led igep2_gpio_leds[] = {  	{ -		.name = "GPIO_LED1_RED", +		.name = "led0:red", +		.gpio = IGEP2_GPIO_LED0_RED, +	}, +	{ +		.name = "led0:green",  		.default_trigger = "heartbeat", +		.gpio = IGEP2_GPIO_LED0_GREEN, +	}, +	{ +		.name = "led1:red",  		.gpio = IGEP2_GPIO_LED1_RED,  	},  }; -static struct gpio_led_platform_data gpio_leds_info = { -	.leds           = gpio_leds, -	.num_leds       = ARRAY_SIZE(gpio_leds), +static struct gpio_led_platform_data igep2_led_pdata = { +	.leds           = igep2_gpio_leds, +	.num_leds       = ARRAY_SIZE(igep2_gpio_leds),  }; -static struct platform_device leds_gpio = { +static struct platform_device igep2_led_device = {  	 .name   = "leds-gpio",  	 .id     = -1,  	 .dev    = { -		 .platform_data  =  &gpio_leds_info, +		 .platform_data  =  &igep2_led_pdata,  	},  }; + +static void __init igep2_init_led(void) +{ +	platform_device_register(&igep2_led_device); +} + +#else +static inline void igep2_init_led(void) {}  #endif  static struct platform_device *igep2_devices[] __initdata = {  	&igep2_dss_device, -#ifdef CONFIG_LEDS_TRIGGERS -	&leds_gpio, -#endif  };  static void __init igep2_init_irq(void) @@ -442,14 +457,14 @@ static struct omap_musb_board_data musb_board_data = {  	.power			= 100,  }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { -	.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN, -	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY, +	.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.phy_reset = true, -	.reset_gpio_port[0] = -EINVAL, -	.reset_gpio_port[1] = IGEP2_GPIO_USBH_NRESET, +	.reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET, +	.reset_gpio_port[1] = -EINVAL,  	.reset_gpio_port[2] = -EINVAL,  }; @@ -471,31 +486,34 @@ static void __init igep2_init(void)  	usb_ehci_init(&ehci_pdata);  	igep2_flash_init(); +	igep2_init_led();  	igep2_display_init();  	igep2_init_smsc911x();  	/* GPIO userspace leds */ -	if ((gpio_request(IGEP2_GPIO_LED0_RED, "GPIO_LED0_RED") == 0) && +#if !defined(CONFIG_LEDS_GPIO) && !defined(CONFIG_LEDS_GPIO_MODULE) +	if ((gpio_request(IGEP2_GPIO_LED0_RED, "led0:red") == 0) &&  	    (gpio_direction_output(IGEP2_GPIO_LED0_RED, 1) == 0)) {  		gpio_export(IGEP2_GPIO_LED0_RED, 0);  		gpio_set_value(IGEP2_GPIO_LED0_RED, 0);  	} else  		pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_RED\n"); -	if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "GPIO_LED0_GREEN") == 0) && +	if ((gpio_request(IGEP2_GPIO_LED0_GREEN, "led0:green") == 0) &&  	    (gpio_direction_output(IGEP2_GPIO_LED0_GREEN, 1) == 0)) {  		gpio_export(IGEP2_GPIO_LED0_GREEN, 0);  		gpio_set_value(IGEP2_GPIO_LED0_GREEN, 0);  	} else  		pr_warning("IGEP v2: Could not obtain gpio GPIO_LED0_GREEN\n"); -#ifndef CONFIG_LEDS_TRIGGERS -	if ((gpio_request(IGEP2_GPIO_LED1_RED, "GPIO_LED1_RED") == 0) && + +	if ((gpio_request(IGEP2_GPIO_LED1_RED, "led1:red") == 0) &&  	    (gpio_direction_output(IGEP2_GPIO_LED1_RED, 1) == 0)) {  		gpio_export(IGEP2_GPIO_LED1_RED, 0);  		gpio_set_value(IGEP2_GPIO_LED1_RED, 0);  	} else  		pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_RED\n");  #endif +  	/* GPIO W-LAN + Bluetooth combo module */  	if ((gpio_request(IGEP2_GPIO_WIFI_NPD, "GPIO_WIFI_NPD") == 0) &&  	    (gpio_direction_output(IGEP2_GPIO_WIFI_NPD, 1) == 0)) { diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c index 4cab0522d7c..3ccc34ebdcc 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -37,6 +37,103 @@ static int slot1_cover_open;  static int slot2_cover_open;  static struct device *mmc_device; +#define TUSB6010_ASYNC_CS	1 +#define TUSB6010_SYNC_CS	4 +#define TUSB6010_GPIO_INT	58 +#define TUSB6010_GPIO_ENABLE	0 +#define TUSB6010_DMACHAN	0x3f + +#if defined(CONFIG_USB_TUSB6010) || \ +	defined(CONFIG_USB_TUSB6010_MODULE) +/* + * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and + * 1.5 V voltage regulators of PM companion chip. Companion chip will then + * provide then PGOOD signal to TUSB6010 which will release it from reset. + */ +static int tusb_set_power(int state) +{ +	int i, retval = 0; + +	if (state) { +		gpio_set_value(TUSB6010_GPIO_ENABLE, 1); +		msleep(1); + +		/* Wait until TUSB6010 pulls INT pin down */ +		i = 100; +		while (i && gpio_get_value(TUSB6010_GPIO_INT)) { +			msleep(1); +			i--; +		} + +		if (!i) { +			printk(KERN_ERR "tusb: powerup failed\n"); +			retval = -ENODEV; +		} +	} else { +		gpio_set_value(TUSB6010_GPIO_ENABLE, 0); +		msleep(10); +	} + +	return retval; +} + +static struct musb_hdrc_config musb_config = { +	.multipoint	= 1, +	.dyn_fifo	= 1, +	.num_eps	= 16, +	.ram_bits	= 12, +}; + +static struct musb_hdrc_platform_data tusb_data = { +#if defined(CONFIG_USB_MUSB_OTG) +	.mode		= MUSB_OTG, +#elif defined(CONFIG_USB_MUSB_PERIPHERAL) +	.mode		= MUSB_PERIPHERAL, +#else /* defined(CONFIG_USB_MUSB_HOST) */ +	.mode		= MUSB_HOST, +#endif +	.set_power	= tusb_set_power, +	.min_power	= 25,	/* x2 = 50 mA drawn from VBUS as peripheral */ +	.power		= 100,	/* Max 100 mA VBUS for host mode */ +	.config		= &musb_config, +}; + +static void __init n8x0_usb_init(void) +{ +	int ret = 0; +	static char	announce[] __initdata = KERN_INFO "TUSB 6010\n"; + +	/* PM companion chip power control pin */ +	ret = gpio_request(TUSB6010_GPIO_ENABLE, "TUSB6010 enable"); +	if (ret != 0) { +		printk(KERN_ERR "Could not get TUSB power GPIO%i\n", +		       TUSB6010_GPIO_ENABLE); +		return; +	} +	gpio_direction_output(TUSB6010_GPIO_ENABLE, 0); + +	tusb_set_power(0); + +	ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2, +					TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS, +					TUSB6010_GPIO_INT, TUSB6010_DMACHAN); +	if (ret != 0) +		goto err; + +	printk(announce); + +	return; + +err: +	gpio_free(TUSB6010_GPIO_ENABLE); +} +#else + +static void __init n8x0_usb_init(void) {} + +#endif /*CONFIG_USB_TUSB6010 */ + +  static struct omap2_mcspi_device_config p54spi_mcspi_config = {  	.turbo_mode	= 0,  	.single_channel = 1, @@ -119,7 +216,7 @@ static void __init n8x0_onenand_init(void) {}   */  #define N8X0_SLOT_SWITCH_GPIO	96  #define N810_EMMC_VSD_GPIO	23 -#define NN810_EMMC_VIO_GPIO	9 +#define N810_EMMC_VIO_GPIO	9  static int n8x0_mmc_switch_slot(struct device *dev, int slot)  { @@ -207,10 +304,10 @@ static void n810_set_power_emmc(struct device *dev,  	if (power_on) {  		gpio_set_value(N810_EMMC_VSD_GPIO, 1);  		msleep(1); -		gpio_set_value(NN810_EMMC_VIO_GPIO, 1); +		gpio_set_value(N810_EMMC_VIO_GPIO, 1);  		msleep(1);  	} else { -		gpio_set_value(NN810_EMMC_VIO_GPIO, 0); +		gpio_set_value(N810_EMMC_VIO_GPIO, 0);  		msleep(50);  		gpio_set_value(N810_EMMC_VSD_GPIO, 0);  		msleep(50); @@ -371,7 +468,7 @@ static void n8x0_mmc_cleanup(struct device *dev)  	if (machine_is_nokia_n810()) {  		gpio_free(N810_EMMC_VSD_GPIO); -		gpio_free(NN810_EMMC_VIO_GPIO); +		gpio_free(N810_EMMC_VIO_GPIO);  	}  } @@ -432,7 +529,7 @@ void __init n8x0_mmc_init(void)  	err = gpio_request(N8X0_SLOT_SWITCH_GPIO, "MMC slot switch");  	if (err) -		return err; +		return;  	gpio_direction_output(N8X0_SLOT_SWITCH_GPIO, 0); @@ -440,17 +537,17 @@ void __init n8x0_mmc_init(void)  		err = gpio_request(N810_EMMC_VSD_GPIO, "MMC slot 2 Vddf");  		if (err) {  			gpio_free(N8X0_SLOT_SWITCH_GPIO); -			return err; +			return;  		}  		gpio_direction_output(N810_EMMC_VSD_GPIO, 0); -		err = gpio_request(NN810_EMMC_VIO_GPIO, "MMC slot 2 Vdd"); +		err = gpio_request(N810_EMMC_VIO_GPIO, "MMC slot 2 Vdd");  		if (err) {  			gpio_free(N8X0_SLOT_SWITCH_GPIO);  			gpio_free(N810_EMMC_VSD_GPIO); -			return err; +			return;  		} -		gpio_direction_output(NN810_EMMC_VIO_GPIO, 0); +		gpio_direction_output(N810_EMMC_VIO_GPIO, 0);  	}  	mmc_data[0] = &mmc1_data; @@ -562,6 +659,7 @@ static void __init n8x0_init_machine(void)  	n8x0_menelaus_init();  	n8x0_onenand_init();  	n8x0_mmc_init(); +	n8x0_usb_init();  }  MACHINE_START(NOKIA_N800, "Nokia N800") diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 6eb77e1f7c8..962d377970e 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -410,7 +410,7 @@ static void __init omap3beagle_flash_init(void)  	}  } -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index d6bc88c426b..017bb2f4f7d 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -635,7 +635,7 @@ static struct platform_device *omap3_evm_devices[] __initdata = {  	&omap3_evm_dss_device,  }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c index 4827f4658df..395d049bf01 100644 --- a/arch/arm/mach-omap2/board-omap3pandora.c +++ b/arch/arm/mach-omap2/board-omap3pandora.c @@ -459,12 +459,20 @@ static struct i2c_board_info __initdata omap3pandora_i2c_boardinfo[] = {  	},  }; +static struct i2c_board_info __initdata omap3pandora_i2c3_boardinfo[] = { +	{ +		I2C_BOARD_INFO("bq27500", 0x55), +		.flags = I2C_CLIENT_WAKE, +	}, +}; +  static int __init omap3pandora_i2c_init(void)  {  	omap_register_i2c_bus(1, 2600, omap3pandora_i2c_boardinfo,  			ARRAY_SIZE(omap3pandora_i2c_boardinfo));  	/* i2c2 pins are not connected */ -	omap_register_i2c_bus(3, 100, NULL, 0); +	omap_register_i2c_bus(3, 100, omap3pandora_i2c3_boardinfo, +			ARRAY_SIZE(omap3pandora_i2c3_boardinfo));  	return 0;  } @@ -537,7 +545,7 @@ static struct platform_device *omap3pandora_devices[] __initdata = {  	&pandora_dss_device,  }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN, diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c index 3943d0f8322..2504d41f923 100644 --- a/arch/arm/mach-omap2/board-omap3touchbook.c +++ b/arch/arm/mach-omap2/board-omap3touchbook.c @@ -493,7 +493,7 @@ static void __init omap3touchbook_flash_init(void)  	}  } -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY, @@ -518,14 +518,14 @@ static void omap3_touchbook_poweroff(void)  	gpio_direction_output(TB_KILL_POWER_GPIO, 0);  } -static void __init early_touchbook_revision(char **p) +static int __init early_touchbook_revision(char *p)  { -	if (!*p) -		return; +	if (!p) +		return 0; -	strict_strtoul(*p, 10, &touchbook_revision); +	return strict_strtoul(p, 10, &touchbook_revision);  } -__early_param("tbr=", early_touchbook_revision); +early_param("tbr", early_touchbook_revision);  static struct omap_musb_board_data musb_board_data = {  	.interface_type		= MUSB_INTERFACE_ULPI, diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 50872a42bec..8848c7c5ce4 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -394,7 +394,7 @@ static struct platform_device *overo_devices[] __initdata = {  	&overo_lcd_device,  }; -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,  	.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN, diff --git a/arch/arm/mach-omap2/board-sdp-flash.c b/arch/arm/mach-omap2/board-sdp-flash.c index b1b88deec7f..2d026328e38 100644 --- a/arch/arm/mach-omap2/board-sdp-flash.c +++ b/arch/arm/mach-omap2/board-sdp-flash.c @@ -253,20 +253,20 @@ void __init sdp_flash_init(struct flash_partitions sdp_partition_info[])  	}  	if (norcs > GPMC_CS_NUM) -		printk(KERN_INFO "OneNAND: Unable to find configuration " -				" in GPMC\n "); +		printk(KERN_INFO "NOR: Unable to find configuration " +				"in GPMC\n");  	else  		board_nor_init(sdp_partition_info[0], norcs);  	if (onenandcs > GPMC_CS_NUM)  		printk(KERN_INFO "OneNAND: Unable to find configuration " -				" in GPMC\n "); +				"in GPMC\n");  	else  		board_onenand_init(sdp_partition_info[1], onenandcs);  	if (nandcs > GPMC_CS_NUM)  		printk(KERN_INFO "NAND: Unable to find configuration " -				" in GPMC\n "); +				"in GPMC\n");  	else  		board_nand_init(sdp_partition_info[2], nandcs);  } diff --git a/arch/arm/mach-omap2/board-zoom-debugboard.c b/arch/arm/mach-omap2/board-zoom-debugboard.c index bb4018b6064..e15d2e87cfc 100644 --- a/arch/arm/mach-omap2/board-zoom-debugboard.c +++ b/arch/arm/mach-omap2/board-zoom-debugboard.c @@ -96,7 +96,7 @@ static struct plat_serial8250_port serial_platform_data[] = {  static struct platform_device zoom_debugboard_serial_device = {  	.name			= "serial8250", -	.id			= 3, +	.id			= PLAT8250_DEV_PLATFORM,  	.dev			= {  		.platform_data	= serial_platform_data,  	}, diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index ca95d8d6413..6b3984964cc 100755..100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c @@ -280,7 +280,6 @@ static void enable_board_wakeup_source(void)  void __init zoom_peripherals_init(void)  {  	omap_i2c_init(); -	omap_serial_init();  	usb_musb_init(&musb_board_data);  	enable_board_wakeup_source();  } diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c index d3e3cd5170d..cd3e40cf3ac 100644 --- a/arch/arm/mach-omap2/board-zoom3.c +++ b/arch/arm/mach-omap2/board-zoom3.c @@ -52,7 +52,7 @@ static struct omap_board_mux board_mux[] __initdata = {  #define board_mux	NULL  #endif -static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = { +static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {  	.port_mode[0]		= EHCI_HCD_OMAP_MODE_UNKNOWN,  	.port_mode[1]		= EHCI_HCD_OMAP_MODE_PHY,  	.port_mode[2]		= EHCI_HCD_OMAP_MODE_UNKNOWN, diff --git a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c index 3b1eac4d539..e60ca4e47bb 100644 --- a/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +++ b/arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c @@ -31,6 +31,7 @@  #include <linux/clk.h>  #include <linux/io.h>  #include <linux/cpufreq.h> +#include <linux/slab.h>  #include <plat/clock.h>  #include <plat/sram.h> diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index f12af95ead4..d932b142d0b 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c @@ -1841,6 +1841,7 @@ static struct omap_clk omap2420_clks[] = {  	CLK(NULL,	"aes_ick",	&aes_ick,	CK_242X),  	CLK(NULL,	"pka_ick",	&pka_ick,	CK_242X),  	CLK(NULL,	"usb_fck",	&usb_fck,	CK_242X), +	CLK("musb_hdrc",	"fck",	&osc_ck,	CK_242X),  };  /* diff --git a/arch/arm/mach-omap2/clock3xxx_data.c b/arch/arm/mach-omap2/clock3xxx_data.c index d5153b6bd6c..9cba5560519 100644 --- a/arch/arm/mach-omap2/clock3xxx_data.c +++ b/arch/arm/mach-omap2/clock3xxx_data.c @@ -895,7 +895,7 @@ static struct clk dpll4_m4x2_ck = {  	.ops		= &clkops_omap2_dflt_wait,  	.parent		= &dpll4_m4_ck,  	.enable_reg	= OMAP_CM_REGADDR(PLL_MOD, CM_CLKEN), -	.enable_bit	= OMAP3430_PWRDN_CAM_SHIFT, +	.enable_bit	= OMAP3430_PWRDN_DSS1_SHIFT,  	.flags		= INVERT_ENABLE,  	.clkdm_name	= "dpll4_clkdm",  	.recalc		= &omap3_clkoutx2_recalc, diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 28b107967c8..a5c0c9c8e49 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -2671,10 +2671,10 @@ static struct omap_clk omap44xx_clks[] = {  	CLK("omap-mcbsp.2",	"ick",				&dummy_ck,	CK_443X),  	CLK("omap-mcbsp.3",	"ick",				&dummy_ck,	CK_443X),  	CLK("omap-mcbsp.4",	"ick",				&dummy_ck,	CK_443X), -	CLK("omap-mcspi.1",	"ick",				&dummy_ck,	CK_443X), -	CLK("omap-mcspi.2",	"ick",				&dummy_ck,	CK_443X), -	CLK("omap-mcspi.3",	"ick",				&dummy_ck,	CK_443X), -	CLK("omap-mcspi.4",	"ick",				&dummy_ck,	CK_443X), +	CLK("omap2_mcspi.1",	"ick",			&dummy_ck,	CK_443X), +	CLK("omap2_mcspi.2",	"ick",			&dummy_ck,	CK_443X), +	CLK("omap2_mcspi.3",	"ick",			&dummy_ck,	CK_443X), +	CLK("omap2_mcspi.4",	"ick",			&dummy_ck,	CK_443X),  	CLK(NULL,	"uart1_ick",			&dummy_ck,	CK_443X),  	CLK(NULL,	"uart2_ick",			&dummy_ck,	CK_443X),  	CLK(NULL,	"uart3_ick",			&dummy_ck,	CK_443X), diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c index b87ad66f083..6e568ec995e 100644 --- a/arch/arm/mach-omap2/clockdomain.c +++ b/arch/arm/mach-omap2/clockdomain.c @@ -240,7 +240,7 @@ static void _omap2_clkdm_set_hwsup(struct clockdomain *clkdm, int enable)  			bits = OMAP24XX_CLKSTCTRL_ENABLE_AUTO;  		else  			bits = OMAP24XX_CLKSTCTRL_DISABLE_AUTO; -	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { +	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {  		if (enable)  			bits = OMAP34XX_CLKSTCTRL_ENABLE_AUTO;  		else @@ -812,7 +812,7 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm)  		cm_set_mod_reg_bits(OMAP24XX_FORCESTATE,  			    clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); -	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { +	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {  		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_SLEEP <<  			 __ffs(clkdm->clktrctrl_mask)); @@ -856,7 +856,7 @@ int omap2_clkdm_wakeup(struct clockdomain *clkdm)  		cm_clear_mod_reg_bits(OMAP24XX_FORCESTATE,  			      clkdm->pwrdm.ptr->prcm_offs, OMAP2_PM_PWSTCTRL); -	} else if (cpu_is_omap34xx() | cpu_is_omap44xx()) { +	} else if (cpu_is_omap34xx() || cpu_is_omap44xx()) {  		u32 bits = (OMAP34XX_CLKSTCTRL_FORCE_WAKEUP <<  			 __ffs(clkdm->clktrctrl_mask)); diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c index 23e4d773361..2271b9bd1f5 100644 --- a/arch/arm/mach-omap2/devices.c +++ b/arch/arm/mach-omap2/devices.c @@ -726,7 +726,7 @@ void __init omap2_init_mmc(struct omap_mmc_platform_data **mmc_data,  			if (!cpu_is_omap44xx())  				return;  			base = OMAP4_MMC5_BASE + OMAP4_MMC_REG_OFFSET; -			irq = OMAP44XX_IRQ_MMC4; +			irq = OMAP44XX_IRQ_MMC5;  			break;  		default:  			continue; diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c index 64d74f05abb..e57fb29ff85 100644 --- a/arch/arm/mach-omap2/gpmc-nand.c +++ b/arch/arm/mach-omap2/gpmc-nand.c @@ -39,6 +39,9 @@ static int omap2_nand_gpmc_retime(void)  	struct gpmc_timings t;  	int err; +	if (!gpmc_nand_data->gpmc_t) +		return 0; +  	memset(&t, 0, sizeof(t));  	t.sync_clk = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->sync_clk);  	t.cs_on = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_on); diff --git a/arch/arm/mach-omap2/include/mach/entry-macro.S b/arch/arm/mach-omap2/include/mach/entry-macro.S index ff25c7e4e60..50fd7491664 100644 --- a/arch/arm/mach-omap2/include/mach/entry-macro.S +++ b/arch/arm/mach-omap2/include/mach/entry-macro.S @@ -52,7 +52,7 @@ omap_irq_base:	.word	0  		mrc	p15, 0, \tmp, c0, c0, 0	@ get processor revision  		and	\tmp, \tmp, #0x000f0000	@ only check architecture -		cmp	\tmp, #0x00060000	@ is v6? +		cmp	\tmp, #0x00070000	@ is v6?  		beq	2400f			@ found v6 so it's omap24xx  		mrc	p15, 0, \tmp, c0, c0, 0	@ get processor revision  		and	\tmp, \tmp, #0x000000f0	@ check cortex 8 or 9 diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 402e8f0d0f2..87f676acf61 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -237,7 +237,7 @@ static void __init _omap2_map_common_io(void)  }  #ifdef CONFIG_ARCH_OMAP2420 -void __init omap242x_map_common_io() +void __init omap242x_map_common_io(void)  {  	iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));  	iotable_init(omap242x_io_desc, ARRAY_SIZE(omap242x_io_desc)); @@ -246,7 +246,7 @@ void __init omap242x_map_common_io()  #endif  #ifdef CONFIG_ARCH_OMAP2430 -void __init omap243x_map_common_io() +void __init omap243x_map_common_io(void)  {  	iotable_init(omap24xx_io_desc, ARRAY_SIZE(omap24xx_io_desc));  	iotable_init(omap243x_io_desc, ARRAY_SIZE(omap243x_io_desc)); @@ -255,7 +255,7 @@ void __init omap243x_map_common_io()  #endif  #ifdef CONFIG_ARCH_OMAP3 -void __init omap34xx_map_common_io() +void __init omap34xx_map_common_io(void)  {  	iotable_init(omap34xx_io_desc, ARRAY_SIZE(omap34xx_io_desc));  	_omap2_map_common_io(); @@ -263,7 +263,7 @@ void __init omap34xx_map_common_io()  #endif  #ifdef CONFIG_ARCH_OMAP4 -void __init omap44xx_map_common_io() +void __init omap44xx_map_common_io(void)  {  	iotable_init(omap44xx_io_desc, ARRAY_SIZE(omap44xx_io_desc));  	_omap2_map_common_io(); @@ -309,7 +309,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,  {  	pwrdm_init(powerdomains_omap);  	clkdm_init(clockdomains_omap, clkdm_autodeps); -#ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */  	if (cpu_is_omap242x())  		omap2420_hwmod_init();  	else if (cpu_is_omap243x()) @@ -319,7 +318,6 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,  	omap2_mux_init();  	/* The OPP tables have to be registered before a clk init */  	omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); -#endif  	if (cpu_is_omap2420())  		omap2420_clk_init(); @@ -333,11 +331,12 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,  		pr_err("Could not init clock framework - unknown CPU\n");  	omap_serial_early_init(); -#ifndef CONFIG_ARCH_OMAP4 -	omap_hwmod_late_init(); +	if (cpu_is_omap24xx() || cpu_is_omap34xx())   /* FIXME: OMAP4 */ +		omap_hwmod_late_init();  	omap_pm_if_init(); -	omap2_sdrc_init(sdrc_cs0, sdrc_cs1); -	_omap2_init_reprogram_sdrc(); -#endif +	if (cpu_is_omap24xx() || cpu_is_omap34xx()) { +		omap2_sdrc_init(sdrc_cs0, sdrc_cs1); +		_omap2_init_reprogram_sdrc(); +	}  	gpmc_init();  } diff --git a/arch/arm/mach-omap2/iommu2.c b/arch/arm/mach-omap2/iommu2.c index 6f4b7cc8f4d..4f63dc6859a 100644 --- a/arch/arm/mach-omap2/iommu2.c +++ b/arch/arm/mach-omap2/iommu2.c @@ -15,6 +15,7 @@  #include <linux/device.h>  #include <linux/jiffies.h>  #include <linux/module.h> +#include <linux/slab.h>  #include <linux/stringify.h>  #include <plat/iommu.h> diff --git a/arch/arm/mach-omap2/mailbox.c b/arch/arm/mach-omap2/mailbox.c index 52a981cb8fd..318f3638653 100644 --- a/arch/arm/mach-omap2/mailbox.c +++ b/arch/arm/mach-omap2/mailbox.c @@ -430,19 +430,19 @@ static int __devinit omap2_mbox_probe(struct platform_device *pdev)  		if (unlikely(!res)) {  			dev_err(&pdev->dev, "invalid irq resource\n");  			ret = -ENODEV; -			goto err_iva1; +			omap_mbox_unregister(&mbox_dsp_info); +			goto err_dsp;  		}  		mbox_iva_info.irq = res->start;  		ret = omap_mbox_register(&pdev->dev, &mbox_iva_info); -		if (ret) -			goto err_iva1; +		if (ret) { +			omap_mbox_unregister(&mbox_dsp_info); +			goto err_dsp; +		}  	}  #endif  	return 0; -err_iva1: -	omap_mbox_unregister(&mbox_dsp_info); -  err_dsp:  	iounmap(mbox_base);  	return ret; diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index be8fce395a5..2f3cad6f940 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c @@ -16,6 +16,7 @@  #include <linux/err.h>  #include <linux/io.h>  #include <linux/platform_device.h> +#include <linux/slab.h>  #include <mach/irqs.h>  #include <plat/dma.h> diff --git a/arch/arm/mach-omap2/mux.c b/arch/arm/mach-omap2/mux.c index b4ca84ee0a9..8b3d26935a3 100644 --- a/arch/arm/mach-omap2/mux.c +++ b/arch/arm/mach-omap2/mux.c @@ -26,6 +26,7 @@  #include <linux/module.h>  #include <linux/init.h>  #include <linux/io.h> +#include <linux/slab.h>  #include <linux/spinlock.h>  #include <linux/list.h>  #include <linux/ctype.h> diff --git a/arch/arm/mach-omap2/omap-headsmp.S b/arch/arm/mach-omap2/omap-headsmp.S index aa3f65c2ac9..ef0e7a00dd6 100644 --- a/arch/arm/mach-omap2/omap-headsmp.S +++ b/arch/arm/mach-omap2/omap-headsmp.S @@ -33,7 +33,7 @@  ENTRY(omap_secondary_startup)  hold:	ldr	r12,=0x103  	dsb -	smc				@ read from AuxCoreBoot0 +	smc	#0			@ read from AuxCoreBoot0  	mov	r0, r0, lsr #9  	mrc	p15, 0, r4, c0, c0, 5  	and	r4, r4, #0x0f @@ -52,7 +52,7 @@ ENTRY(omap_modify_auxcoreboot0)  	stmfd   sp!, {r1-r12, lr}  	ldr	r12, =0x104  	dsb -	smc +	smc	#0  	ldmfd   sp!, {r1-r12, pc}  END(omap_modify_auxcoreboot0) @@ -60,6 +60,6 @@ ENTRY(omap_auxcoreboot_addr)  	stmfd   sp!, {r2-r12, lr}  	ldr	r12, =0x105  	dsb -	smc +	smc	#0  	ldmfd   sp!, {r2-r12, pc}  END(omap_auxcoreboot_addr) diff --git a/arch/arm/mach-omap2/omap44xx-smc.S b/arch/arm/mach-omap2/omap44xx-smc.S new file mode 100644 index 00000000000..f61c7771ca4 --- /dev/null +++ b/arch/arm/mach-omap2/omap44xx-smc.S @@ -0,0 +1,32 @@ +/* + * OMAP44xx secure APIs file. + * + * Copyright (C) 2010 Texas Instruments, Inc. + * Written by Santosh Shilimkar <santosh.shilimkar@ti.com> + * + * + * This program is free software,you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include <linux/linkage.h> + +/* + * This is common routine to manage secure monitor API + * used to modify the PL310 secure registers. + * 'r0' contains the value to be modified and 'r12' contains + * the monitor API number. It uses few CPU registers + * internally and hence they need be backed up including + * link register "lr". + * Function signature : void omap_smc1(u32 fn, u32 arg) + */ + +ENTRY(omap_smc1) +	stmfd   sp!, {r2-r12, lr} +	mov	r12, r0 +	mov 	r0, r1 +	dsb +	smc	#0 +	ldmfd   sp!, {r2-r12, pc} +END(omap_smc1) diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index c6649472ce0..e436dcb1979 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1511,6 +1511,9 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh)  		c = oh->slaves[oh->_mpu_port_index]->_clk;  	} +	if (!c->clkdm) +		return NULL; +  	return c->clkdm->pwrdm.ptr;  } diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index c18f7f2f19b..6cac9817c24 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c @@ -25,6 +25,7 @@  #include <linux/err.h>  #include <linux/io.h>  #include <linux/module.h> +#include <linux/slab.h>  #include <plat/clock.h>  #include <plat/board.h> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index fee2efb172e..ea0000bc535 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -27,6 +27,7 @@  #include <linux/gpio.h>  #include <linux/clk.h>  #include <linux/delay.h> +#include <linux/slab.h>  #include <plat/sram.h>  #include <plat/clockdomain.h> diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 9a0fb385622..ebfce7d1a5d 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c @@ -222,7 +222,7 @@ void pwrdm_init(struct powerdomain **pwrdm_list)  {  	struct powerdomain **p = NULL; -	if (cpu_is_omap24xx() | cpu_is_omap34xx()) { +	if (cpu_is_omap24xx() || cpu_is_omap34xx()) {  		pwrstctrl_reg_offs = OMAP2_PM_PWSTCTRL;  		pwrstst_reg_offs = OMAP2_PM_PWSTST;  	} else if (cpu_is_omap44xx()) { diff --git a/arch/arm/mach-omap2/prcm.c b/arch/arm/mach-omap2/prcm.c index 81872aacb80..07a60f1204c 100644 --- a/arch/arm/mach-omap2/prcm.c +++ b/arch/arm/mach-omap2/prcm.c @@ -123,7 +123,7 @@ struct omap3_prcm_regs prcm_context;  u32 omap_prcm_get_reset_sources(void)  {  	/* XXX This presumably needs modification for 34XX */ -	if (cpu_is_omap24xx() | cpu_is_omap34xx()) +	if (cpu_is_omap24xx() || cpu_is_omap34xx())  		return prm_read_mod_reg(WKUP_MOD, OMAP2_RM_RSTST) & 0x7f;  	if (cpu_is_omap44xx())  		return prm_read_mod_reg(WKUP_MOD, OMAP4_RM_RSTST) & 0x7f; @@ -133,7 +133,7 @@ u32 omap_prcm_get_reset_sources(void)  EXPORT_SYMBOL(omap_prcm_get_reset_sources);  /* Resets clock rates and reboots the system. Only called from system.h */ -void omap_prcm_arch_reset(char mode) +void omap_prcm_arch_reset(char mode, const char *cmd)  {  	s16 prcm_offs = 0; @@ -145,7 +145,7 @@ void omap_prcm_arch_reset(char mode)  		u32 l;  		prcm_offs = OMAP3430_GR_MOD; -		l = ('B' << 24) | ('M' << 16) | mode; +		l = ('B' << 24) | ('M' << 16) | (cmd ? (u8)*cmd : 0);  		/* Reserve the first word in scratchpad for communicating  		 * with the boot ROM. A pointer to a data structure  		 * describing the boot process can be stored there, @@ -157,7 +157,7 @@ void omap_prcm_arch_reset(char mode)  	else  		WARN_ON(1); -	if (cpu_is_omap24xx() | cpu_is_omap34xx()) +	if (cpu_is_omap24xx() || cpu_is_omap34xx())  		prm_set_mod_reg_bits(OMAP_RST_DPLL3, prcm_offs,  						 OMAP2_RM_RSTCTRL);  	if (cpu_is_omap44xx()) diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c index b79bc8926cc..3771254dfa8 100644 --- a/arch/arm/mach-omap2/serial.c +++ b/arch/arm/mach-omap2/serial.c @@ -115,7 +115,6 @@ static struct plat_serial8250_port serial_platform_data2[] = {  	}  }; -#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)  static struct plat_serial8250_port serial_platform_data3[] = {  	{  		.irq		= 70, @@ -128,23 +127,12 @@ static struct plat_serial8250_port serial_platform_data3[] = {  	}  }; -static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals) -{ -	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys; -} -#else -static inline void omap2_set_globals_uart4(struct omap_globals *omap2_globals) -{ -} -#endif -  void __init omap2_set_globals_uart(struct omap_globals *omap2_globals)  {  	serial_platform_data0[0].mapbase = omap2_globals->uart1_phys;  	serial_platform_data1[0].mapbase = omap2_globals->uart2_phys;  	serial_platform_data2[0].mapbase = omap2_globals->uart3_phys; -	if (cpu_is_omap3630() || cpu_is_omap44xx()) -		omap2_set_globals_uart4(omap2_globals); +	serial_platform_data3[0].mapbase = omap2_globals->uart4_phys;  }  static inline unsigned int __serial_read_reg(struct uart_port *up, @@ -550,7 +538,7 @@ static ssize_t sleep_timeout_store(struct device *dev,  	unsigned int value;  	if (sscanf(buf, "%u", &value) != 1) { -		printk(KERN_ERR "sleep_timeout_store: Invalid value\n"); +		dev_err(dev, "sleep_timeout_store: Invalid value\n");  		return -EINVAL;  	} @@ -644,42 +632,53 @@ static void serial_out_override(struct uart_port *up, int offset, int value)  }  void __init omap_serial_early_init(void)  { -	int i; +	int i, nr_ports;  	char name[16]; +	if (!(cpu_is_omap3630() || cpu_is_omap4430())) +		nr_ports = 3; +	else +		nr_ports = ARRAY_SIZE(omap_uart); +  	/*  	 * Make sure the serial ports are muxed on at this point.  	 * You have to mux them off in device drivers later on  	 * if not needed.  	 */ -	for (i = 0; i < ARRAY_SIZE(omap_uart); i++) { +	for (i = 0; i < nr_ports; i++) {  		struct omap_uart_state *uart = &omap_uart[i];  		struct platform_device *pdev = &uart->pdev;  		struct device *dev = &pdev->dev;  		struct plat_serial8250_port *p = dev->platform_data; +		/* Don't map zero-based physical address */ +		if (p->mapbase == 0) { +			dev_warn(dev, "no physical address for uart#%d," +				 " so skipping early_init...\n", i); +			continue; +		}  		/*  		 * Module 4KB + L4 interconnect 4KB  		 * Static mapping, never released  		 */  		p->membase = ioremap(p->mapbase, SZ_8K);  		if (!p->membase) { -			printk(KERN_ERR "ioremap failed for uart%i\n", i + 1); +			dev_err(dev, "ioremap failed for uart%i\n", i + 1);  			continue;  		} -		sprintf(name, "uart%d_ick", i+1); +		sprintf(name, "uart%d_ick", i + 1);  		uart->ick = clk_get(NULL, name);  		if (IS_ERR(uart->ick)) { -			printk(KERN_ERR "Could not get uart%d_ick\n", i+1); +			dev_err(dev, "Could not get uart%d_ick\n", i + 1);  			uart->ick = NULL;  		}  		sprintf(name, "uart%d_fck", i+1);  		uart->fck = clk_get(NULL, name);  		if (IS_ERR(uart->fck)) { -			printk(KERN_ERR "Could not get uart%d_fck\n", i+1); +			dev_err(dev, "Could not get uart%d_fck\n", i + 1);  			uart->fck = NULL;  		} @@ -722,6 +721,13 @@ void __init omap_serial_init_port(int port)  	pdev = &uart->pdev;  	dev = &pdev->dev; +	/* Don't proceed if there's no clocks available */ +	if (unlikely(!uart->ick || !uart->fck)) { +		WARN(1, "%s: can't init uart%d, no clocks available\n", +		     kobject_name(&dev->kobj), port); +		return; +	} +  	omap_uart_enable_clocks(uart);  	omap_uart_reset(uart); diff --git a/arch/arm/mach-omap2/usb-ehci.c b/arch/arm/mach-omap2/usb-ehci.c index f1df873d59d..ee9f548d5d8 100644 --- a/arch/arm/mach-omap2/usb-ehci.c +++ b/arch/arm/mach-omap2/usb-ehci.c @@ -70,7 +70,7 @@ static struct platform_device ehci_device = {  /*   * setup_ehci_io_mux - initialize IO pad mux for USBHOST   */ -static void setup_ehci_io_mux(enum ehci_hcd_omap_mode *port_mode) +static void setup_ehci_io_mux(const enum ehci_hcd_omap_mode *port_mode)  {  	switch (port_mode[0]) {  	case EHCI_HCD_OMAP_MODE_PHY: @@ -213,7 +213,7 @@ static void setup_ehci_io_mux(enum ehci_hcd_omap_mode *port_mode)  	return;  } -void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata) +void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)  {  	platform_device_add_data(&ehci_device, pdata, sizeof(*pdata)); @@ -229,7 +229,7 @@ void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata)  #else -void __init usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata) +void __init usb_ehci_init(const struct ehci_hcd_omap_platform_data *pdata)  {  }  |