diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-15 13:46:29 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-15 13:46:29 +0200 |
commit | b2aaf8f74cdc84a9182f6cabf198b7763bcb9d40 (patch) | |
tree | 53ccb1c2c14751fe69cf93102e76e97021f6df07 /arch/arm/mach-omap1 | |
parent | 4f962d4d65923d7b722192e729840cfb79af0a5a (diff) | |
parent | 278429cff8809958d25415ba0ed32b59866ab1a8 (diff) |
Merge branch 'linus' into stackprotector
Conflicts:
arch/x86/kernel/Makefile
include/asm-x86/pda.h
Diffstat (limited to 'arch/arm/mach-omap1')
37 files changed, 602 insertions, 251 deletions
diff --git a/arch/arm/mach-omap1/Makefile b/arch/arm/mach-omap1/Makefile index c06f5254c0f..1bda8f5d754 100644 --- a/arch/arm/mach-omap1/Makefile +++ b/arch/arm/mach-omap1/Makefile @@ -3,7 +3,9 @@ # # Common support -obj-y := io.o id.o clock.o irq.o mux.o serial.o devices.o +obj-y := io.o id.o sram.o clock.o irq.o mux.o serial.o devices.o + +obj-$(CONFIG_OMAP_MCBSP) += mcbsp.o obj-$(CONFIG_OMAP_MPU_TIMER) += time.o obj-$(CONFIG_OMAP_32K_TIMER) += timer32k.o diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c index 8b102ad59c1..2e618391cc5 100644 --- a/arch/arm/mach-omap1/board-ams-delta.c +++ b/arch/arm/mach-omap1/board-ams-delta.c @@ -17,18 +17,18 @@ #include <linux/input.h> #include <linux/platform_device.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <asm/arch/board-ams-delta.h> -#include <asm/arch/gpio.h> -#include <asm/arch/keypad.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/board.h> -#include <asm/arch/common.h> +#include <mach/board-ams-delta.h> +#include <mach/gpio.h> +#include <mach/keypad.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/board.h> +#include <mach/common.h> static u8 ams_delta_latch1_reg; static u16 ams_delta_latch2_reg; diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 1bdb66638e2..db789461fca 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c @@ -20,21 +20,21 @@ #include <linux/mtd/partitions.h> #include <linux/input.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/tc.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/fpga.h> -#include <asm/arch/nand.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/board.h> -#include <asm/arch/board-fsample.h> +#include <mach/tc.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/fpga.h> +#include <mach/nand.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/board.h> +#include <mach/board-fsample.h> static int fsample_keymap[] = { KEY(0,0,KEY_UP), diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c index c711bf23f7b..7d267020537 100644 --- a/arch/arm/mach-omap1/board-generic.c +++ b/arch/arm/mach-omap1/board-generic.c @@ -17,16 +17,16 @@ #include <linux/init.h> #include <linux/platform_device.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/board.h> -#include <asm/arch/common.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/board.h> +#include <mach/common.h> static void __init omap_generic_init_irq(void) { diff --git a/arch/arm/mach-omap1/board-h2-mmc.c b/arch/arm/mach-omap1/board-h2-mmc.c index 6fdc78406b2..ab9ee5820c4 100644 --- a/arch/arm/mach-omap1/board-h2-mmc.c +++ b/arch/arm/mach-omap1/board-h2-mmc.c @@ -12,8 +12,8 @@ * published by the Free Software Foundation. */ -#include <asm/arch/mmc.h> -#include <asm/arch/gpio.h> +#include <mach/mmc.h> +#include <mach/gpio.h> #ifdef CONFIG_MMC_OMAP static int slot_cover_open; diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 4b444fdaafe..3b65914b914 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -29,7 +29,7 @@ #include <linux/input.h> #include <linux/i2c/tps65010.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/gpio.h> #include <asm/mach-types.h> @@ -37,16 +37,16 @@ #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/gpio-switch.h> -#include <asm/arch/mux.h> -#include <asm/arch/tc.h> -#include <asm/arch/nand.h> -#include <asm/arch/irda.h> -#include <asm/arch/usb.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> +#include <mach/gpio-switch.h> +#include <mach/mux.h> +#include <mach/tc.h> +#include <mach/nand.h> +#include <mach/irda.h> +#include <mach/usb.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> static int h2_keymap[] = { KEY(0, 0, KEY_LEFT), diff --git a/arch/arm/mach-omap1/board-h3-mmc.c b/arch/arm/mach-omap1/board-h3-mmc.c index 66ecc437928..36085819098 100644 --- a/arch/arm/mach-omap1/board-h3-mmc.c +++ b/arch/arm/mach-omap1/board-h3-mmc.c @@ -12,8 +12,8 @@ * published by the Free Software Foundation. */ -#include <asm/arch/mmc.h> -#include <asm/arch/gpio.h> +#include <mach/mmc.h> +#include <mach/gpio.h> #ifdef CONFIG_MMC_OMAP static int slot_cover_open; diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c index 7fbaa8d648c..adfcd7b5139 100644 --- a/arch/arm/mach-omap1/board-h3.c +++ b/arch/arm/mach-omap1/board-h3.c @@ -31,7 +31,7 @@ #include <asm/setup.h> #include <asm/page.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/gpio.h> #include <asm/mach-types.h> @@ -39,18 +39,18 @@ #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/gpioexpander.h> -#include <asm/arch/irqs.h> -#include <asm/arch/mux.h> -#include <asm/arch/tc.h> -#include <asm/arch/nand.h> -#include <asm/arch/irda.h> -#include <asm/arch/usb.h> -#include <asm/arch/keypad.h> -#include <asm/arch/dma.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> +#include <mach/gpioexpander.h> +#include <mach/irqs.h> +#include <mach/mux.h> +#include <mach/tc.h> +#include <mach/nand.h> +#include <mach/irda.h> +#include <mach/usb.h> +#include <mach/keypad.h> +#include <mach/dma.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> #define H3_TS_GPIO 48 @@ -476,6 +476,10 @@ static struct i2c_board_info __initdata h3_i2c_board_info[] = { I2C_BOARD_INFO("tps65013", 0x48), /* .irq = OMAP_GPIO_IRQ(??), */ }, + { + I2C_BOARD_INFO("isp1301_omap", 0x2d), + .irq = OMAP_GPIO_IRQ(14), + }, }; static struct omap_gpio_switch h3_gpio_switches[] __initdata = { diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c index 4b8ae3ee0d0..cbc11be5cd2 100644 --- a/arch/arm/mach-omap1/board-innovator.c +++ b/arch/arm/mach-omap1/board-innovator.c @@ -24,21 +24,21 @@ #include <linux/mtd/partitions.h> #include <linux/input.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/mux.h> -#include <asm/arch/fpga.h> -#include <asm/arch/gpio.h> -#include <asm/arch/tc.h> -#include <asm/arch/usb.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> +#include <mach/mux.h> +#include <mach/fpga.h> +#include <mach/gpio.h> +#include <mach/tc.h> +#include <mach/usb.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> static int innovator_keymap[] = { KEY(0, 0, KEY_F1), diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c index bcb984f2300..38d9783ac6d 100644 --- a/arch/arm/mach-omap1/board-nokia770.c +++ b/arch/arm/mach-omap1/board-nokia770.c @@ -10,6 +10,7 @@ #include <linux/kernel.h> #include <linux/init.h> +#include <linux/mutex.h> #include <linux/platform_device.h> #include <linux/input.h> #include <linux/clk.h> @@ -19,21 +20,21 @@ #include <linux/workqueue.h> #include <linux/delay.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/board.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/dsp_common.h> -#include <asm/arch/aic23.h> -#include <asm/arch/omapfb.h> -#include <asm/arch/lcd_mipid.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/board.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/dsp_common.h> +#include <mach/aic23.h> +#include <mach/omapfb.h> +#include <mach/lcd_mipid.h> #define ADS7846_PENDOWN_GPIO 15 @@ -202,7 +203,7 @@ static struct omap_board_config_kernel nokia770_config[] __initdata = { #define AMPLIFIER_CTRL_GPIO 58 static struct clk *dspxor_ck; -static DECLARE_MUTEX(audio_pwr_sem); +static DEFINE_MUTEX(audio_pwr_lock); /* * audio_pwr_state * +--+-------------------------+---------------------------------------+ @@ -218,7 +219,7 @@ static DECLARE_MUTEX(audio_pwr_sem); static int audio_pwr_state = -1; /* - * audio_pwr_up / down should be called under audio_pwr_sem + * audio_pwr_up / down should be called under audio_pwr_lock */ static void nokia770_audio_pwr_up(void) { @@ -237,11 +238,11 @@ static void nokia770_audio_pwr_up(void) static void codec_delayed_power_down(struct work_struct *work) { - down(&audio_pwr_sem); + mutex_lock(&audio_pwr_lock); if (audio_pwr_state == -1) aic23_power_down(); clk_disable(dspxor_ck); - up(&audio_pwr_sem); + mutex_unlock(&audio_pwr_lock); } static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down); @@ -258,19 +259,19 @@ static void nokia770_audio_pwr_down(void) static int nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage) { - down(&audio_pwr_sem); + mutex_lock(&audio_pwr_lock); if (audio_pwr_state == -1) nokia770_audio_pwr_up(); /* force audio_pwr_state = 0, even if it was 1. */ audio_pwr_state = 0; - up(&audio_pwr_sem); + mutex_unlock(&audio_pwr_lock); return 0; } static int nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) { - down(&audio_pwr_sem); + mutex_lock(&audio_pwr_lock); switch (stage) { case 1: if (audio_pwr_state == 0) @@ -283,7 +284,7 @@ nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage) } break; } - up(&audio_pwr_sem); + mutex_unlock(&audio_pwr_lock); return 0; } diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c index a66505f58b1..3e766e49f7c 100644 --- a/arch/arm/mach-omap1/board-osk.c +++ b/arch/arm/mach-omap1/board-osk.c @@ -39,7 +39,7 @@ #include <linux/i2c/tps65010.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/gpio.h> #include <asm/mach-types.h> @@ -47,12 +47,12 @@ #include <asm/mach/map.h> #include <asm/mach/flash.h> -#include <asm/arch/usb.h> -#include <asm/arch/mux.h> -#include <asm/arch/tc.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> +#include <mach/usb.h> +#include <mach/mux.h> +#include <mach/tc.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> static struct mtd_partition osk_partitions[] = { /* bootloader (U-Boot, etc) in first sector */ @@ -267,13 +267,17 @@ static struct i2c_board_info __initdata osk_i2c_board_info[] = { static void __init osk_init_smc91x(void) { + u32 l; + if ((gpio_request(0, "smc_irq")) < 0) { printk("Error requesting gpio 0 for smc91x irq\n"); return; } /* Check EMIFS wait states to fix errors with SMC_GET_PKT_HDR */ - EMIFS_CCS(1) |= 0x3; + l = omap_readl(EMIFS_CCS(1)); + l |= 0x3; + omap_writel(l, EMIFS_CCS(1)); } static void __init osk_init_cf(void) @@ -284,7 +288,7 @@ static void __init osk_init_cf(void) return; } /* the CF I/O IRQ is really active-low */ - set_irq_type(OMAP_GPIO_IRQ(62), IRQT_FALLING); + set_irq_type(OMAP_GPIO_IRQ(62), IRQ_TYPE_EDGE_FALLING); } static void __init osk_init_irq(void) @@ -336,7 +340,7 @@ static struct omap_board_config_kernel osk_config[] __initdata = { #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> -#include <asm/arch/keypad.h> +#include <mach/keypad.h> static const int osk_keymap[] = { /* KEY(col, row, code) */ @@ -479,7 +483,7 @@ static void __init osk_mistral_init(void) omap_cfg_reg(P20_1610_GPIO4); /* PENIRQ */ gpio_request(4, "ts_int"); gpio_direction_input(4); - set_irq_type(OMAP_GPIO_IRQ(4), IRQT_FALLING); + set_irq_type(OMAP_GPIO_IRQ(4), IRQ_TYPE_EDGE_FALLING); spi_register_board_info(mistral_boardinfo, ARRAY_SIZE(mistral_boardinfo)); @@ -490,7 +494,7 @@ static void __init osk_mistral_init(void) int ret = 0; gpio_direction_input(OMAP_MPUIO(2)); - set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(OMAP_MPUIO(2)), IRQ_TYPE_EDGE_RISING); #ifdef CONFIG_PM /* share the IRQ in case someone wants to use the * button for more than wakeup from system sleep. @@ -526,20 +530,26 @@ static void __init osk_mistral_init(void) { } static void __init osk_init(void) { + u32 l; + /* Workaround for wrong CS3 (NOR flash) timing * There are some U-Boot versions out there which configure * wrong CS3 memory timings. This mainly leads to CRC * or similar errors if you use NOR flash (e.g. with JFFS2) */ - if (EMIFS_CCS(3) != EMIFS_CS3_VAL) - EMIFS_CCS(3) = EMIFS_CS3_VAL; + l = omap_readl(EMIFS_CCS(3)); + if (l != EMIFS_CS3_VAL) + omap_writel(EMIFS_CS3_VAL, EMIFS_CCS(3)); osk_flash_resource.end = osk_flash_resource.start = omap_cs3_phys(); osk_flash_resource.end += SZ_32M - 1; platform_add_devices(osk5912_devices, ARRAY_SIZE(osk5912_devices)); omap_board_config = osk_config; omap_board_config_size = ARRAY_SIZE(osk_config); - USB_TRANSCEIVER_CTRL_REG |= (3 << 1); + + l = omap_readl(USB_TRANSCEIVER_CTRL); + l |= (3 << 1); + omap_writel(l, USB_TRANSCEIVER_CTRL); /* irq for tps65010 chip */ /* bootloader effectively does: omap_cfg_reg(U19_1610_MPUIO1); */ diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c index a4d20127a60..b58043644a6 100644 --- a/arch/arm/mach-omap1/board-palmte.c +++ b/arch/arm/mach-omap1/board-palmte.c @@ -27,23 +27,23 @@ #include <linux/interrupt.h> #include <linux/apm-emulation.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/flash.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/tc.h> -#include <asm/arch/dma.h> -#include <asm/arch/board.h> -#include <asm/arch/irda.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/tc.h> +#include <mach/dma.h> +#include <mach/board.h> +#include <mach/irda.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> static void __init omap_palmte_init_irq(void) { diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c index 2a033689f9f..40f9860a09d 100644 --- a/arch/arm/mach-omap1/board-palmtt.c +++ b/arch/arm/mach-omap1/board-palmtt.c @@ -23,24 +23,24 @@ #include <linux/mtd/partitions.h> #include <linux/leds.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/flash.h> -#include <asm/arch/led.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/dma.h> -#include <asm/arch/tc.h> -#include <asm/arch/board.h> -#include <asm/arch/irda.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/omap-alsa.h> +#include <mach/led.h> +#include <mach/mcbsp.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/dma.h> +#include <mach/tc.h> +#include <mach/board.h> +#include <mach/irda.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/omap-alsa.h> #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c index e020c277460..e719294250b 100644 --- a/arch/arm/mach-omap1/board-palmz71.c +++ b/arch/arm/mach-omap1/board-palmz71.c @@ -26,23 +26,23 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/partitions.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/flash.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/usb.h> -#include <asm/arch/dma.h> -#include <asm/arch/tc.h> -#include <asm/arch/board.h> -#include <asm/arch/irda.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/omap-alsa.h> +#include <mach/mcbsp.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/usb.h> +#include <mach/dma.h> +#include <mach/tc.h> +#include <mach/board.h> +#include <mach/irda.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/omap-alsa.h> #include <linux/spi/spi.h> #include <linux/spi/ads7846.h> @@ -298,11 +298,11 @@ palmz71_powercable(int irq, void *dev_id) if (omap_get_gpio_datain(PALMZ71_USBDETECT_GPIO)) { printk(KERN_INFO "PM: Power cable connected\n"); set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), - IRQT_FALLING); + IRQ_TYPE_EDGE_FALLING); } else { printk(KERN_INFO "PM: Power cable disconnected\n"); set_irq_type(OMAP_GPIO_IRQ(PALMZ71_USBDETECT_GPIO), - IRQT_RISING); + IRQ_TYPE_EDGE_RISING); } return IRQ_HANDLED; } diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c index 94bc0745ab2..b715917bfda 100644 --- a/arch/arm/mach-omap1/board-perseus2.c +++ b/arch/arm/mach-omap1/board-perseus2.c @@ -20,20 +20,20 @@ #include <linux/mtd/partitions.h> #include <linux/input.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/tc.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/fpga.h> -#include <asm/arch/nand.h> -#include <asm/arch/keypad.h> -#include <asm/arch/common.h> -#include <asm/arch/board.h> +#include <mach/tc.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/fpga.h> +#include <mach/nand.h> +#include <mach/keypad.h> +#include <mach/common.h> +#include <mach/board.h> static int p2_keymap[] = { KEY(0,0,KEY_UP), diff --git a/arch/arm/mach-omap1/board-sx1-mmc.c b/arch/arm/mach-omap1/board-sx1-mmc.c index 8c93d47719e..0be4ebaa284 100644 --- a/arch/arm/mach-omap1/board-sx1-mmc.c +++ b/arch/arm/mach-omap1/board-sx1-mmc.c @@ -12,9 +12,9 @@ * published by the Free Software Foundation. */ -#include <asm/arch/hardware.h> -#include <asm/arch/mmc.h> -#include <asm/arch/gpio.h> +#include <mach/hardware.h> +#include <mach/mmc.h> +#include <mach/gpio.h> #ifdef CONFIG_MMC_OMAP static int slot_cover_open; diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index e473fa6d4a5..130bcc6fd08 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c @@ -26,22 +26,22 @@ #include <linux/i2c.h> #include <linux/errno.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/irda.h> -#include <asm/arch/usb.h> -#include <asm/arch/tc.h> -#include <asm/arch/board.h> -#include <asm/arch/common.h> -#include <asm/arch/mcbsp.h> -#include <asm/arch/omap-alsa.h> -#include <asm/arch/keypad.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/irda.h> +#include <mach/usb.h> +#include <mach/tc.h> +#include <mach/board.h> +#include <mach/common.h> +#include <mach/mcbsp.h> +#include <mach/omap-alsa.h> +#include <mach/keypad.h> /* Write to I2C device */ int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c index 5c00b3f39cd..45a01311669 100644 --- a/arch/arm/mach-omap1/board-voiceblue.c +++ b/arch/arm/mach-omap1/board-voiceblue.c @@ -21,18 +21,19 @@ #include <linux/reboot.h> #include <linux/serial_8250.h> #include <linux/serial_reg.h> +#include <linux/irq.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/mach-types.h> #include <asm/mach/arch.h> #include <asm/mach/flash.h> #include <asm/mach/map.h> -#include <asm/arch/common.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> -#include <asm/arch/tc.h> -#include <asm/arch/usb.h> +#include <mach/common.h> +#include <mach/gpio.h> +#include <mach/mux.h> +#include <mach/tc.h> +#include <mach/usb.h> static struct plat_serial8250_port voiceblue_ports[] = { { @@ -186,10 +187,10 @@ static void __init voiceblue_init(void) omap_request_gpio(13); omap_request_gpio(14); omap_request_gpio(15); - set_irq_type(OMAP_GPIO_IRQ(12), IRQT_RISING); - set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING); - set_irq_type(OMAP_GPIO_IRQ(14), IRQT_RISING); - set_irq_type(OMAP_GPIO_IRQ(15), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(12), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(14), IRQ_TYPE_EDGE_RISING); + set_irq_type(OMAP_GPIO_IRQ(15), IRQ_TYPE_EDGE_RISING); platform_add_devices(voiceblue_devices, ARRAY_SIZE(voiceblue_devices)); omap_board_config = voiceblue_config; diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index 4ea2933f887..478c2c9a22c 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c @@ -17,14 +17,14 @@ #include <linux/errno.h> #include <linux/err.h> #include <linux/clk.h> +#include <linux/io.h> -#include <asm/io.h> #include <asm/mach-types.h> -#include <asm/arch/cpu.h> -#include <asm/arch/usb.h> -#include <asm/arch/clock.h> -#include <asm/arch/sram.h> +#include <mach/cpu.h> +#include <mach/usb.h> +#include <mach/clock.h> +#include <mach/sram.h> #include "clock.h" diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c index da8a3ac47e1..99982d3380c 100644 --- a/arch/arm/mach-omap1/devices.c +++ b/arch/arm/mach-omap1/devices.c @@ -13,16 +13,15 @@ #include <linux/kernel.h> #include <linux/init.h> #include <linux/platform_device.h> +#include <linux/io.h> -#include <asm/hardware.h> -#include <asm/io.h> -#include <asm/mach-types.h> +#include <mach/hardware.h> #include <asm/mach/map.h> -#include <asm/arch/tc.h> -#include <asm/arch/board.h> -#include <asm/arch/mux.h> -#include <asm/arch/gpio.h> +#include <mach/tc.h> +#include <mach/board.h> +#include <mach/mux.h> +#include <mach/gpio.h> /*-------------------------------------------------------------------------*/ diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c index 30e18810904..04995381aa5 100644 --- a/arch/arm/mach-omap1/fpga.c +++ b/arch/arm/mach-omap1/fpga.c @@ -21,18 +21,18 @@ #include <linux/kernel.h> #include <linux/device.h> #include <linux/errno.h> +#include <linux/io.h> -#include <asm/hardware.h> -#include <asm/io.h> +#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/irq.h> -#include <asm/arch/fpga.h> -#include <asm/arch/gpio.h> +#include <mach/fpga.h> +#include <mach/gpio.h> static void fpga_mask_irq(unsigned int irq) { - irq -= OMAP1510_IH_FPGA_BASE; + irq -= OMAP_FPGA_IRQ_BASE; if (irq < 8) __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) @@ -65,7 +65,7 @@ static void fpga_ack_irq(unsigned int irq) static void fpga_unmask_irq(unsigned int irq) { - irq -= OMAP1510_IH_FPGA_BASE; + irq -= OMAP_FPGA_IRQ_BASE; if (irq < 8) __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), @@ -86,7 +86,6 @@ static void fpga_mask_ack_irq(unsigned int irq) void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) { - struct irq_desc *d; u32 stat; int fpga_irq; @@ -95,12 +94,11 @@ void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) if (!stat) return; - for (fpga_irq = OMAP1510_IH_FPGA_BASE; - (fpga_irq < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS)) && stat; + for (fpga_irq = OMAP_FPGA_IRQ_BASE; + (fpga_irq < OMAP_FPGA_IRQ_END) && stat; fpga_irq++, stat >>= 1) { if (stat & 1) { - d = irq_desc + fpga_irq; - desc_handle_irq(fpga_irq, d); + generic_handle_irq(fpga_irq); } } } @@ -151,7 +149,7 @@ void omap1510_fpga_init_irq(void) __raw_writeb(0, OMAP1510_FPGA_IMR_HI); __raw_writeb(0, INNOVATOR_FPGA_IMR2); - for (i = OMAP1510_IH_FPGA_BASE; i < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS); i++) { + for (i = OMAP_FPGA_IRQ_BASE; i < OMAP_FPGA_IRQ_END; i++) { if (i == OMAP1510_INT_FPGA_TS) { /* @@ -181,7 +179,7 @@ void omap1510_fpga_init_irq(void) */ omap_request_gpio(13); omap_set_gpio_direction(13, 1); - set_irq_type(OMAP_GPIO_IRQ(13), IRQT_RISING); + set_irq_type(OMAP_GPIO_IRQ(13), IRQ_TYPE_EDGE_RISING); set_irq_chained_handler(OMAP1510_INT_FPGA, innovator_fpga_IRQ_demux); } diff --git a/arch/arm/mach-omap1/id.c b/arch/arm/mach-omap1/id.c index da13c3e8285..13083d7e692 100644 --- a/arch/arm/mach-omap1/id.c +++ b/arch/arm/mach-omap1/id.c @@ -14,8 +14,7 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> - -#include <asm/io.h> +#include <linux/io.h> #define OMAP_DIE_ID_0 0xfffe1800 #define OMAP_DIE_ID_1 0xfffe1804 diff --git a/arch/arm/mach-omap1/io.c b/arch/arm/mach-omap1/io.c index 81c4e738506..b3bd8ca8511 100644 --- a/arch/arm/mach-omap1/io.c +++ b/arch/arm/mach-omap1/io.c @@ -11,12 +11,12 @@ #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> +#include <linux/io.h> #include <asm/tlb.h> #include <asm/mach/map.h> -#include <asm/io.h> -#include <asm/arch/mux.h> -#include <asm/arch/tc.h> +#include <mach/mux.h> +#include <mach/tc.h> extern int omap1_clk_init(void); extern void omap_check_revision(void); diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c index 1da9d59a034..9ad5197075f 100644 --- a/arch/arm/mach-omap1/irq.c +++ b/arch/arm/mach-omap1/irq.c @@ -40,14 +40,13 @@ #include <linux/module.h> #include <linux/sched.h> #include <linux/interrupt.h> +#include <linux/io.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/irq.h> #include <asm/mach/irq.h> -#include <asm/arch/gpio.h> -#include <asm/arch/cpu.h> - -#include <asm/io.h> +#include <mach/gpio.h> +#include <mach/cpu.h> #define IRQ_BANK(irq) ((irq) >> 5) #define IRQ_BIT(irq) ((irq) & 0x1f) diff --git a/arch/arm/mach-omap1/leds-h2p2-debug.c b/arch/arm/mach-omap1/leds-h2p2-debug.c index 8976fbb21f7..71fe2cc7f7c 100644 --- a/arch/arm/mach-omap1/leds-h2p2-debug.c +++ b/arch/arm/mach-omap1/leds-h2p2-debug.c @@ -12,15 +12,15 @@ #include <linux/init.h> #include <linux/kernel_stat.h> #include <linux/sched.h> +#include <linux/io.h> -#include <asm/io.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/leds.h> #include <asm/system.h> #include <asm/mach-types.h> -#include <asm/arch/fpga.h> -#include <asm/arch/gpio.h> +#include <mach/fpga.h> +#include <mach/gpio.h> #include "leds.h" diff --git a/arch/arm/mach-omap1/leds-innovator.c b/arch/arm/mach-omap1/leds-innovator.c index e7835d6f53a..9b99c289462 100644 --- a/arch/arm/mach-omap1/leds-innovator.c +++ b/arch/arm/mach-omap1/leds-innovator.c @@ -3,7 +3,7 @@ */ #include <linux/init.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/leds.h> #include <asm/system.h> diff --git a/arch/arm/mach-omap1/leds-osk.c b/arch/arm/mach-omap1/leds-osk.c index 754383dde80..98e789622df 100644 --- a/arch/arm/mach-omap1/leds-osk.c +++ b/arch/arm/mach-omap1/leds-osk.c @@ -5,11 +5,11 @@ */ #include <linux/init.h> -#include <asm/hardware.h> +#include <mach/hardware.h> #include <asm/leds.h> #include <asm/system.h> -#include <asm/arch/gpio.h> +#include <mach/gpio.h> #include "leds.h" diff --git a/arch/arm/mach-omap1/leds.c b/arch/arm/mach-omap1/leds.c index 3f9dcac4fd4..6cdad93c4a0 100644 --- a/arch/arm/mach-omap1/leds.c +++ b/arch/arm/mach-omap1/leds.c @@ -9,8 +9,8 @@ #include <asm/leds.h> #include <asm/mach-types.h> -#include <asm/arch/gpio.h> -#include <asm/arch/mux.h> +#include <mach/gpio.h> +#include <mach/mux.h> #include "leds.h" diff --git a/arch/arm/mach-omap1/mailbox.c b/arch/arm/mach-omap1/mailbox.c index bad1e7152d8..59abbf331a9 100644 --- a/arch/arm/mach-omap1/mailbox.c +++ b/arch/arm/mach-omap1/mailbox.c @@ -13,9 +13,9 @@ #include <linux/resource.h> #include <linux/interrupt.h> #include <linux/platform_device.h> -#include <asm/arch/mailbox.h> -#include <asm/arch/irqs.h> -#include <asm/io.h> +#include <linux/io.h> +#include <mach/mailbox.h> +#include <mach/irqs.h> #define MAILBOX_ARM2DSP1 0x00 #define MAILBOX_ARM2DSP1b 0x04 diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c new file mode 100644 index 00000000000..2baeaeb0c90 --- /dev/null +++ b/arch/arm/mach-omap1/mcbsp.c @@ -0,0 +1,288 @@ +/* + * linux/arch/arm/mach-omap1/mcbsp.c + * + * Copyright (C) 2008 Instituto Nokia de Tecnologia + * Contact: Eduardo Valentin <eduardo.valentin@indt.org.br> + * + * 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. + * + * Multichannel mode not supported. + */ +#include <linux/module.h> +#include <linux/init.h> +#include <linux/clk.h> +#include <linux/err.h> +#include <linux/io.h> +#include <linux/platform_device.h> + +#include <mach/dma.h> +#include <mach/mux.h> +#include <mach/cpu.h> +#include <mach/mcbsp.h> +#include <mach/dsp_common.h> + +#define DPS_RSTCT2_PER_EN (1 << 0) +#define DSP_RSTCT2_WD_PER_EN (1 << 1) + +struct mcbsp_internal_clk { + struct clk clk; + struct clk **childs; + int n_childs; +}; + +#if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) +static void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk) +{ + const char *clk_names[] = { "dsp_ck", "api_ck", "dspxor_ck" }; + int i; + + mclk->n_childs = ARRAY_SIZE(clk_names); + mclk->childs = kzalloc(mclk->n_childs * sizeof(struct clk *), + GFP_KERNEL); + + for (i = 0; i < mclk->n_childs; i++) { + /* We fake a platform device to get correct device id */ + struct platform_device pdev; + + pdev.dev.bus = &platform_bus_type; + pdev.id = mclk->clk.id; + mclk->childs[i] = clk_get(&pdev.dev, clk_names[i]); + if (IS_ERR(mclk->childs[i])) + printk(KERN_ERR "Could not get clock %s (%d).\n", + clk_names[i], mclk->clk.id); + } +} + +static int omap_mcbsp_clk_enable(struct clk *clk) +{ + struct mcbsp_internal_clk *mclk = container_of(clk, + struct mcbsp_internal_clk, clk); + int i; + + for (i = 0; i < mclk->n_childs; i++) + clk_enable(mclk->childs[i]); + return 0; +} + +static void omap_mcbsp_clk_disable(struct clk *clk) +{ + struct mcbsp_internal_clk *mclk = container_of(clk, + struct mcbsp_internal_clk, clk); + int i; + + for (i = 0; i < mclk->n_childs; i++) + clk_disable(mclk->childs[i]); +} + +static struct mcbsp_internal_clk omap_mcbsp_clks[] = { + { + .clk = { + .name = "mcbsp_clk", + .id = 1, + .enable = omap_mcbsp_clk_enable, + .disable = omap_mcbsp_clk_disable, + }, + }, + { + .clk = { + .name = "mcbsp_clk", + .id = 3, + .enable = omap_mcbsp_clk_enable, + .disable = omap_mcbsp_clk_disable, + }, + }, +}; + +#define omap_mcbsp_clks_size ARRAY_SIZE(omap_mcbsp_clks) +#else +#define omap_mcbsp_clks_size 0 +static struct mcbsp_internal_clk __initdata *omap_mcbsp_clks; +static inline void omap_mcbsp_clk_init(struct mcbsp_internal_clk *mclk) +{ } +#endif + +static int omap1_mcbsp_check(unsigned int id) +{ + /* REVISIT: Check correctly for number of registered McBSPs */ + if (cpu_is_omap730()) { + if (id > OMAP_MAX_MCBSP_COUNT - 2) { + printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", + id + 1); + return -ENODEV; + } + return 0; + } + + if (cpu_is_omap15xx() || cpu_is_omap16xx()) { + if (id > OMAP_MAX_MCBSP_COUNT - 1) { + printk(KERN_ERR "OMAP-McBSP: McBSP%d doesn't exist\n", + id + 1); + return -ENODEV; + } + return 0; + } + + return -ENODEV; +} + +static void omap1_mcbsp_request(unsigned int id) +{ + /* + * On 1510, 1610 and 1710, McBSP1 and McBSP3 + * are DSP public peripherals. + */ + if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) { + omap_dsp_request_mem(); + /* + * DSP external peripheral reset + * FIXME: This should be moved to dsp code + */ + __raw_writew(__raw_readw(DSP_RSTCT2) | DPS_RSTCT2_PER_EN | + DSP_RSTCT2_WD_PER_EN, DSP_RSTCT2); + } +} + +static void omap1_mcbsp_free(unsigned int id) +{ + if (id == OMAP_MCBSP1 || id == OMAP_MCBSP3) + omap_dsp_release_mem(); +} + +static struct omap_mcbsp_ops omap1_mcbsp_ops = { + .check = omap1_mcbsp_check, + .request = omap1_mcbsp_request, + .free = omap1_mcbsp_free, +}; + +#ifdef CONFIG_ARCH_OMAP730 +static struct omap_mcbsp_platform_data omap730_mcbsp_pdata[] = { + { + .phys_base = OMAP730_MCBSP1_BASE, + .virt_base = io_p2v(OMAP730_MCBSP1_BASE), + .dma_rx_sync = OMAP_DMA_MCBSP1_RX, + .dma_tx_sync = OMAP_DMA_MCBSP1_TX, + .rx_irq = INT_730_McBSP1RX, + .tx_irq = INT_730_McBSP1TX, + .ops = &omap1_mcbsp_ops, + }, + { + .phys_base = OMAP730_MCBSP2_BASE, + .virt_base = io_p2v(OMAP730_MCBSP2_BASE), + .dma_rx_sync = OMAP_DMA_MCBSP3_RX, + .dma_tx_sync = OMAP_DMA_MCBSP3_TX, + .rx_irq = INT_730_McBSP2RX, + .tx_irq = INT_730_McBSP2TX, + .ops = &omap1_mcbsp_ops, + }, +}; +#define OMAP730_MCBSP_PDATA_SZ ARRAY_SIZE(omap730_mcbsp_pdata) +#else +#define omap730_mcbsp_pdata NULL +#define OMAP730_MCBSP_PDATA_SZ 0 +#endif + +#ifdef CONFIG_ARCH_OMAP15XX +static struct omap_mcbsp_platform_data omap15xx_mcbsp_pdata[] = { + { + .phys_base = OMAP1510_MCBSP1_BASE, + .virt_base = OMAP1510_MCBSP1_BASE, + .dma_rx_sync = OMAP_DMA_MCBSP1_RX, + .dma_tx_sync = OMAP_DMA_MCBSP1_TX, + .rx_irq = INT_McBSP1RX, + .tx_irq = INT_McBSP1TX, + .ops = &omap1_mcbsp_ops, + .clk_name = "mcbsp_clk", + }, + { + .phys_base = OMAP1510_MCBSP2_BASE, + .virt_base = io_p2v(OMAP1510_MCBSP2_BASE), + .dma_rx_sync = OMAP_DMA_MCBSP2_RX, + .dma_tx_sync = OMAP_DMA_MCBSP2_TX, + .rx_irq = INT_1510_SPI_RX, + .tx_irq = INT_1510_SPI_TX, + .ops = &omap1_mcbsp_ops, + }, + { + .phys_base = OMAP1510_MCBSP3_BASE, + .virt_base = OMAP1510_MCBSP3_BASE, + .dma_rx_sync = OMAP_DMA_MCBSP3_RX, + .dma_tx_sync = OMAP_DMA_MCBSP3_TX, + .rx_irq = INT_McBSP3RX, + .tx_irq = INT_McBSP3TX, + .ops = &omap1_mcbsp_ops, + .clk_name = "mcbsp_clk", + }, +}; +#define OMAP15XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap15xx_mcbsp_pdata) +#else +#define omap15xx_mcbsp_pdata NULL +#define OMAP15XX_MCBSP_PDATA_SZ 0 +#endif + +#ifdef CONFIG_ARCH_OMAP16XX +static struct omap_mcbsp_platform_data omap16xx_mcbsp_pdata[] = { + { + .phys_base = OMAP1610_MCBSP1_BASE, + .virt_base = OMAP1610_MCBSP1_BASE, + .dma_rx_sync = OMAP_DMA_MCBSP1_RX, + .dma_tx_sync = OMAP_DMA_MCBSP1_TX, + .rx_irq = INT_McBSP1RX, + .tx_irq = INT_McBSP1TX, + .ops = &omap1_mcbsp_ops, + .clk_name = "mcbsp_clk", + }, + { + .phys_base = OMAP1610_MCBSP2_BASE, + .virt_base = io_p2v(OMAP1610_MCBSP2_BASE), + .dma_rx_sync = OMAP_DMA_MCBSP2_RX, + .dma_tx_sync = OMAP_DMA_MCBSP2_TX, + .rx_irq = INT_1610_McBSP2_RX, + .tx_irq = INT_1610_McBSP2_TX, + .ops = &omap1_mcbsp_ops, + }, + { + .phys_base = OMAP1610_MCBSP3_BASE, + .virt_base = OMAP1610_MCBSP3_BASE, + .dma_rx_sync = OMAP_DMA_MCBSP3_RX, + .dma_tx_sync = OMAP_DMA_MCBSP3_TX, + .rx_irq = INT_McBSP3RX, + .tx_irq = INT_McBSP3TX, + .ops = &omap1_mcbsp_ops, + .clk_name = "mcbsp_clk", + }, +}; +#define OMAP16XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap16xx_mcbsp_pdata) +#else +#define omap16xx_mcbsp_pdata NULL +#define OMAP16XX_MCBSP_PDATA_SZ 0 +#endif + +int __init omap1_mcbsp_init(void) +{ + int i; + + for (i = 0; i < omap_mcbsp_clks_size; i++) { + if (cpu_is_omap15xx() || cpu_is_omap16xx()) { + omap_mcbsp_clk_init(&omap_mcbsp_clks[i]); + clk_register(&omap_mcbsp_clks[i].clk); + } + } + + if (cpu_is_omap730()) + omap_mcbsp_register_board_cfg(omap730_mcbsp_pdata, + OMAP730_MCBSP_PDATA_SZ); + + if (cpu_is_omap15xx()) + omap_mcbsp_register_board_cfg(omap15xx_mcbsp_pdata, + OMAP15XX_MCBSP_PDATA_SZ); + + if (cpu_is_omap16xx()) + omap_mcbsp_register_board_cfg(omap16xx_mcbsp_pdata, + OMAP16XX_MCBSP_PDATA_SZ); + + return omap_mcbsp_init(); +} + +arch_initcall(omap1_mcbsp_init); diff --git a/arch/arm/mach-omap1/mux.c b/arch/arm/mach-omap1/mux.c index e207bf7cb85..062c905c2ba 100644 --- a/arch/arm/mach-omap1/mux.c +++ b/arch/arm/mach-omap1/mux.c @@ -24,11 +24,12 @@ */ #include <linux/module.h> #include <linux/init.h> -#include <asm/system.h> -#include <asm/io.h> +#include <linux/io.h> #include <linux/spinlock.h> -#include <asm/arch/mux.h> +#include <asm/system.h> + +#include <mach/mux.h> #ifdef CONFIG_OMAP_MUX diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c index e6c64e10b7e..770d256c790 100644 --- a/arch/arm/mach-omap1/pm.c +++ b/arch/arm/mach-omap1/pm.c @@ -41,23 +41,22 @@ #include <linux/interrupt.h> #include <linux/sysfs.h> #include <linux/module.h> +#include <linux/io.h> -#include <asm/io.h> #include <asm/irq.h> #include <asm/atomic.h> #include <asm/mach/time.h> #include <asm/mach/irq.h> -#include <asm/mach-types.h> - -#include <asm/arch/cpu.h> -#include <asm/arch/irqs.h> -#include <asm/arch/clock.h> -#include <asm/arch/sram.h> -#include <asm/arch/tc.h> -#include <asm/arch/pm.h> -#include <asm/arch/mux.h> -#include <asm/arch/dma.h> -#include <asm/arch/dmtimer.h> + +#include <mach/cpu.h> +#include <mach/irqs.h> +#include <mach/clock.h> +#include <mach/sram.h> +#include <mach/tc.h> +#include <mach/pm.h> +#include <mach/mux.h> +#include <mach/dma.h> +#include <mach/dmtimer.h> static unsigned int arm_sleep_save[ARM_SLEEP_SAVE_SIZE]; static unsigned short dsp_sleep_save[DSP_SLEEP_SAVE_SIZE]; @@ -116,13 +115,6 @@ void omap_pm_idle(void) return; } - /* - * Since an interrupt may set up a timer, we don't want to - * reprogram the hardware timer with interrupts enabled. - * Re-enable interrupts only after returning from idle. - */ - timer_dyn_reprogram(); - #ifdef CONFIG_OMAP_MPU_TIMER #warning Enable 32kHz OS timer in order to allow sleep states in idle use_idlect1 = use_idlect1 & ~(1 << 9); diff --git a/arch/arm/mach-omap1/serial.c b/arch/arm/mach-omap1/serial.c index 10a4fe88b2f..aefc967fc00 100644 --- a/arch/arm/mach-omap1/serial.c +++ b/arch/arm/mach-omap1/serial.c @@ -18,16 +18,16 @@ #include <linux/serial_8250.h> #include <linux/serial_reg.h> #include <linux/clk.h> +#include <linux/io.h> -#include <asm/io.h> #include <asm/mach-types.h> -#include <asm/arch/board.h> -#include <asm/arch/mux.h> -#include <asm/arch/gpio.h> -#include <asm/arch/fpga.h> +#include <mach/board.h> +#include <mach/mux.h> +#include <mach/gpio.h> +#include <mach/fpga.h> #ifdef CONFIG_PM -#include <asm/arch/pm.h> +#include <mach/pm.h> #endif static struct clk * uart1_ck; diff --git a/arch/arm/mach-omap1/sleep.S b/arch/arm/mach-omap1/sleep.S index 68f5b39030b..f3eac932092 100644 --- a/arch/arm/mach-omap1/sleep.S +++ b/arch/arm/mach-omap1/sleep.S @@ -34,8 +34,8 @@ #include <linux/linkage.h> #include <asm/assembler.h> -#include <asm/arch/io.h> -#include <asm/arch/pm.h> +#include <mach/io.h> +#include <mach/pm.h> .text diff --git a/arch/arm/mach-omap1/sram.S b/arch/arm/mach-omap1/sram.S new file mode 100644 index 00000000000..261cdc48228 --- /dev/null +++ b/arch/arm/mach-omap1/sram.S @@ -0,0 +1,57 @@ +/* + * linux/arch/arm/plat-omap/sram-fn.S + * + * Functions that need to be run in internal SRAM + * + * 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> +#include <asm/assembler.h> +#include <mach/io.h> +#include <mach/hardware.h> + + .text + +/* + * Reprograms ULPD and CKCTL. + */ +ENTRY(omap1_sram_reprogram_clock) + stmfd sp!, {r0 - r12, lr} @ save registers on stack + + mov r2, #IO_ADDRESS(DPLL_CTL) & 0xff000000 + orr r2, r2, #IO_ADDRESS(DPLL_CTL) & 0x00ff0000 + orr r2, r2, #IO_ADDRESS(DPLL_CTL) & 0x0000ff00 + + mov r3, #IO_ADDRESS(ARM_CKCTL) & 0xff000000 + orr r3, r3, #IO_ADDRESS(ARM_CKCTL) & 0x00ff0000 + orr r3, r3, #IO_ADDRESS(ARM_CKCTL) & 0x0000ff00 + + tst r0, #1 << 4 @ want lock mode? + beq newck @ nope + bic r0, r0, #1 << 4 @ else clear lock bit + strh r0, [r2] @ set dpll into bypass mode + orr r0, r0, #1 << 4 @ set lock bit again + +newck: + strh r1, [r3] @ write new ckctl value + strh r0, [r2] @ write new dpll value + + mov r4, #0x0700 @ let the clocks settle + orr r4, r4, #0x00ff +delay: sub r4, r4, #1 + cmp r4, #0 + bne delay + +lock: ldrh r4, [r2], #0 @ read back dpll value + tst r0, #1 << 4 @ want lock mode? + beq out @ nope + tst r4, #1 << 0 @ dpll rate locked? + beq lock @ try again + +out: + ldmfd sp!, {r0 - r12, pc} @ restore regs and return +ENTRY(omap1_sram_reprogram_clock_sz) + .word . - omap1_sram_reprogram_clock diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c index 5d2b270935a..2cf7e32bd29 100644 --- a/arch/arm/mach-omap1/time.c +++ b/arch/arm/mach-omap1/time.c @@ -43,10 +43,10 @@ #include <linux/err.h> #include <linux/clocksource.h> #include <linux/clockchips.h> +#include <linux/io.h> #include <asm/system.h> -#include <asm/hardware.h> -#include <asm/io.h> +#include <mach/hardware.h> #include <asm/leds.h> #include <asm/irq.h> #include <asm/mach/irq.h> diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c index fbbdb806c95..705367ece17 100644 --- a/arch/arm/mach-omap1/timer32k.c +++ b/arch/arm/mach-omap1/timer32k.c @@ -44,15 +44,15 @@ #include <linux/clk.h> #include <linux/clocksource.h> #include <linux/clockchips.h> +#include <linux/io.h> #include <asm/system.h> -#include <asm/hardware.h> -#include <asm/io.h> +#include <mach/hardware.h> #include <asm/leds.h> #include <asm/irq.h> #include <asm/mach/irq.h> #include <asm/mach/time.h> -#include <asm/arch/dmtimer.h> +#include <mach/dmtimer.h> struct sys_timer omap_timer; |