diff --git a/recipes-kernel/linux/linux-3.0/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch b/recipes-kernel/linux/linux-3.0/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch index 9f9b43ed..ff914dc8 100644 --- a/recipes-kernel/linux/linux-3.0/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch +++ b/recipes-kernel/linux/linux-3.0/beagle/0001-OMAP3-beagle-add-support-for-beagleboard-xM-revision.patch @@ -1,7 +1,7 @@ -From 033514238d4b2b59b1507f39372dbabe7365c102 Mon Sep 17 00:00:00 2001 +From fa563f291feaed45803ae17db71514928a17a6a6 Mon Sep 17 00:00:00 2001 From: Fernandes, Joel A Date: Tue, 7 Jun 2011 15:54:45 -0500 -Subject: [PATCH] OMAP3: beagle: add support for beagleboard xM revision C +Subject: [PATCH 1/3] OMAP3: beagle: add support for beagleboard xM revision C OMAP3: beagle: add support for beagleboard xM revision C @@ -17,10 +17,10 @@ Signed-off-by: Koen Kooi 1 files changed, 51 insertions(+), 27 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c -index 7f21d24..4b113b2 100644 +index 34f8411..32f5f89 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c -@@ -61,7 +61,8 @@ +@@ -60,7 +60,8 @@ * AXBX = GPIO173, GPIO172, GPIO171: 1 1 1 * C1_3 = GPIO173, GPIO172, GPIO171: 1 1 0 * C4 = GPIO173, GPIO172, GPIO171: 1 0 1 @@ -30,7 +30,7 @@ index 7f21d24..4b113b2 100644 */ enum { OMAP3BEAGLE_BOARD_UNKN = 0, -@@ -69,14 +70,26 @@ enum { +@@ -68,14 +69,26 @@ enum { OMAP3BEAGLE_BOARD_C1_3, OMAP3BEAGLE_BOARD_C4, OMAP3BEAGLE_BOARD_XM, @@ -61,7 +61,7 @@ index 7f21d24..4b113b2 100644 static struct gpio omap3_beagle_rev_gpios[] __initdata = { { 171, GPIOF_IN, "rev_id_0" }, -@@ -111,18 +124,32 @@ static void __init omap3_beagle_init_rev(void) +@@ -110,18 +123,32 @@ static void __init omap3_beagle_init_rev(void) case 7: printk(KERN_INFO "OMAP3 Beagle Rev: Ax/Bx\n"); omap3_beagle_version = OMAP3BEAGLE_BOARD_AXBX; @@ -95,7 +95,7 @@ index 7f21d24..4b113b2 100644 break; default: printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev); -@@ -234,7 +261,7 @@ static struct omap2_hsmmc_info mmc[] = { +@@ -225,7 +252,7 @@ static struct omap2_hsmmc_info mmc[] = { { .mmc = 1, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, @@ -104,7 +104,7 @@ index 7f21d24..4b113b2 100644 }, {} /* Terminator */ }; -@@ -252,17 +279,11 @@ static struct gpio_led gpio_leds[]; +@@ -243,17 +270,11 @@ static struct gpio_led gpio_leds[]; static int beagle_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { @@ -127,7 +127,7 @@ index 7f21d24..4b113b2 100644 /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap2_hsmmc_init(mmc); -@@ -276,9 +297,8 @@ static int beagle_twl_gpio_setup(struct device *dev, +@@ -263,9 +284,8 @@ static int beagle_twl_gpio_setup(struct device *dev, * high / others active low) * DVI reset GPIO is different between beagle revisions */ @@ -139,7 +139,7 @@ index 7f21d24..4b113b2 100644 /* * gpio + 1 on Xm controls the TFP410's enable line (active low) * gpio + 2 control varies depending on the board rev as below: -@@ -296,8 +316,6 @@ static int beagle_twl_gpio_setup(struct device *dev, +@@ -283,8 +303,6 @@ static int beagle_twl_gpio_setup(struct device *dev, pr_err("%s: unable to configure DVI_LDO_EN\n", __func__); } else { @@ -148,7 +148,7 @@ index 7f21d24..4b113b2 100644 /* * REVISIT: need ehci-omap hooks for external VBUS * power switch and overcurrent detect -@@ -305,8 +323,10 @@ static int beagle_twl_gpio_setup(struct device *dev, +@@ -292,8 +310,10 @@ static int beagle_twl_gpio_setup(struct device *dev, if (gpio_request_one(gpio + 1, GPIOF_IN, "EHCI_nOC")) pr_err("%s: unable to configure EHCI_nOC\n", __func__); } @@ -160,7 +160,7 @@ index 7f21d24..4b113b2 100644 /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; -@@ -458,7 +478,8 @@ static struct platform_device leds_gpio = { +@@ -404,7 +424,8 @@ static struct platform_device leds_gpio = { static struct gpio_keys_button gpio_buttons[] = { { .code = BTN_EXTRA, @@ -170,7 +170,7 @@ index 7f21d24..4b113b2 100644 .desc = "user", .wakeup = 1, }, -@@ -525,8 +546,8 @@ static void __init beagle_opp_init(void) +@@ -468,8 +489,8 @@ static void __init beagle_opp_init(void) return; } @@ -181,7 +181,7 @@ index 7f21d24..4b113b2 100644 struct omap_hwmod *mh = omap_hwmod_lookup("mpu"); struct omap_hwmod *dh = omap_hwmod_lookup("iva"); struct device *dev; -@@ -566,6 +587,9 @@ static void __init omap3_beagle_init(void) +@@ -509,6 +530,9 @@ static void __init omap3_beagle_init(void) omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); omap3_beagle_init_rev(); omap3_beagle_i2c_init(); diff --git a/recipes-kernel/linux/linux-3.0/beagle/0002-UNFINISHED-OMAP3-beagle-add-support-for-expansionboa.patch b/recipes-kernel/linux/linux-3.0/beagle/0002-UNFINISHED-OMAP3-beagle-add-support-for-expansionboa.patch new file mode 100644 index 00000000..6e8a33e9 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/beagle/0002-UNFINISHED-OMAP3-beagle-add-support-for-expansionboa.patch @@ -0,0 +1,313 @@ +From 04557e8b744e8e6f8ab8b7c4fc715cecd585f2ab Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Thu, 21 Jul 2011 14:29:42 +0200 +Subject: [PATCH 2/3] UNFINISHED: OMAP3: beagle: add support for expansionboards + +Signed-off-by: Koen Kooi +--- + arch/arm/mach-omap2/board-omap3beagle.c | 246 +++++++++++++++++++++++++++++++ + 1 files changed, 246 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 32f5f89..e542df0 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -21,6 +21,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -156,6 +157,167 @@ static void __init omap3_beagle_init_rev(void) + } + } + ++char expansionboard_name[16]; ++ ++#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE) ++#include ++#include ++ ++#define OMAP_BEAGLE_WLAN_EN_GPIO (139) ++#define OMAP_BEAGLE_BT_EN_GPIO (138) ++#define OMAP_BEAGLE_WLAN_IRQ_GPIO (137) ++#define OMAP_BEAGLE_FM_EN_BT_WU (136) ++ ++struct wl12xx_platform_data omap_beagle_wlan_data __initdata = { ++ .irq = OMAP_GPIO_IRQ(OMAP_BEAGLE_WLAN_IRQ_GPIO), ++ .board_ref_clock = 2, /* 38.4 MHz */ ++}; ++ ++static int gpios[] = {OMAP_BEAGLE_BT_EN_GPIO, OMAP_BEAGLE_FM_EN_BT_WU, -1}; ++static struct platform_device wl12xx_device = { ++ .name = "kim", ++ .id = -1, ++ .dev.platform_data = &gpios, ++}; ++ ++static struct omap2_hsmmc_info mmcbbt[] = { ++ { ++ .mmc = 1, ++ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, ++ .gpio_wp = 29, ++ }, ++ { ++ .name = "wl1271", ++ .mmc = 2, ++ .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, ++ .gpio_wp = -EINVAL, ++ .gpio_cd = -EINVAL, ++ .ocr_mask = MMC_VDD_165_195, ++ .nonremovable = true, ++ }, ++ {} /* Terminator */ ++ }; ++ ++static struct regulator_consumer_supply beagle_vmmc2_supply = ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++ ++static struct regulator_init_data beagle_vmmc2 = { ++ .constraints = { ++ .min_uV = 1850000, ++ .max_uV = 1850000, ++ .apply_uV = true, ++ .valid_modes_mask = REGULATOR_MODE_NORMAL ++ | REGULATOR_MODE_STANDBY, ++ .valid_ops_mask = REGULATOR_CHANGE_MODE ++ | REGULATOR_CHANGE_STATUS, ++ }, ++ .num_consumer_supplies = 1, ++ .consumer_supplies = &beagle_vmmc2_supply, ++}; ++ ++static struct fixed_voltage_config beagle_vwlan = { ++ .supply_name = "vwl1271", ++ .microvolts = 1800000, /* 1.8V */ ++ .gpio = OMAP_BEAGLE_WLAN_EN_GPIO, ++ .startup_delay = 70000, /* 70ms */ ++ .enable_high = 1, ++ .enabled_at_boot = 0, ++ .init_data = &beagle_vmmc2, ++}; ++ ++static struct platform_device omap_vwlan_device = { ++ .name = "reg-fixed-voltage", ++ .id = 1, ++ .dev = { ++ .platform_data = &beagle_vwlan, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_ENC28J60) || defined(CONFIG_ENC28J60_MODULE) ++ ++#include ++#include ++ ++#define OMAP3BEAGLE_GPIO_ENC28J60_IRQ 157 ++ ++static struct omap2_mcspi_device_config enc28j60_spi_chip_info = { ++ .turbo_mode = 0, ++ .single_channel = 1, /* 0: slave, 1: master */ ++}; ++ ++static struct spi_board_info omap3beagle_zippy_spi_board_info[] __initdata = { ++ { ++ .modalias = "enc28j60", ++ .bus_num = 4, ++ .chip_select = 0, ++ .max_speed_hz = 20000000, ++ .controller_data = &enc28j60_spi_chip_info, ++ }, ++}; ++ ++static void __init omap3beagle_enc28j60_init(void) ++{ ++ if ((gpio_request(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, "ENC28J60_IRQ") == 0) && ++ (gpio_direction_input(OMAP3BEAGLE_GPIO_ENC28J60_IRQ) == 0)) { ++ gpio_export(OMAP3BEAGLE_GPIO_ENC28J60_IRQ, 0); ++ omap3beagle_zippy_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_ENC28J60_IRQ); ++ irq_set_irq_type(omap3beagle_zippy_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); ++ } else { ++ printk(KERN_ERR "could not obtain gpio for ENC28J60_IRQ\n"); ++ return; ++ } ++ ++ spi_register_board_info(omap3beagle_zippy_spi_board_info, ++ ARRAY_SIZE(omap3beagle_zippy_spi_board_info)); ++} ++ ++#else ++static inline void __init omap3beagle_enc28j60_init(void) { return; } ++#endif ++ ++#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE) ++ ++#include ++#include ++ ++#define OMAP3BEAGLE_GPIO_KS8851_IRQ 157 ++ ++static struct omap2_mcspi_device_config ks8851_spi_chip_info = { ++ .turbo_mode = 0, ++ .single_channel = 1, /* 0: slave, 1: master */ ++}; ++ ++static struct spi_board_info omap3beagle_zippy2_spi_board_info[] __initdata = { ++ { ++ .modalias = "ks8851", ++ .bus_num = 4, ++ .chip_select = 0, ++ .max_speed_hz = 36000000, ++ .controller_data = &ks8851_spi_chip_info, ++ }, ++}; ++ ++static void __init omap3beagle_ks8851_init(void) ++{ ++ if ((gpio_request(OMAP3BEAGLE_GPIO_KS8851_IRQ, "KS8851_IRQ") == 0) && ++ (gpio_direction_input(OMAP3BEAGLE_GPIO_KS8851_IRQ) == 0)) { ++ gpio_export(OMAP3BEAGLE_GPIO_KS8851_IRQ, 0); ++ omap3beagle_zippy2_spi_board_info[0].irq = OMAP_GPIO_IRQ(OMAP3BEAGLE_GPIO_KS8851_IRQ); ++ irq_set_irq_type(omap3beagle_zippy2_spi_board_info[0].irq, IRQ_TYPE_EDGE_FALLING); ++ } else { ++ printk(KERN_ERR "could not obtain gpio for KS8851_IRQ\n"); ++ return; ++ } ++ ++ spi_register_board_info(omap3beagle_zippy2_spi_board_info, ++ ARRAY_SIZE(omap3beagle_zippy2_spi_board_info)); ++} ++ ++#else ++static inline void __init omap3beagle_ks8851_init(void) { return; } ++#endif ++ + static struct mtd_partition omap3beagle_nand_partitions[] = { + /* All the partition sizes are listed in terms of NAND block size */ + { +@@ -254,6 +416,12 @@ static struct omap2_hsmmc_info mmc[] = { + .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, + .gpio_wp = -EINVAL, + }, ++ { ++ .mmc = 2, ++ .caps = MMC_CAP_4_BIT_DATA, ++ .transceiver = true, ++ .ocr_mask = 0x00100000, /* 3.3V */ ++ }, + {} /* Terminator */ + }; + +@@ -277,7 +445,15 @@ static int beagle_twl_gpio_setup(struct device *dev, + mmc[0].gpio_wp = beagle_config.mmc1_gpio_wp; + /* gpio + 0 is "mmc0_cd" (input/IRQ) */ + mmc[0].gpio_cd = gpio + 0; ++#if defined(CONFIG_WL12XX) || defined(CONFIG_WL12XX_MODULE) ++ if(!strcmp(expansionboard_name, "bbtoys-wifi")) { ++ omap2_hsmmc_init(mmcbbt); ++ } else { ++ omap2_hsmmc_init(mmc); ++ } ++#else + omap2_hsmmc_init(mmc); ++#endif + + /* + * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active +@@ -479,6 +655,15 @@ static struct omap_board_mux board_mux[] __initdata = { + }; + #endif + ++static int __init expansionboard_setup(char *str) ++{ ++ if (!str) ++ return -EINVAL; ++ strncpy(expansionboard_name, str, 16); ++ printk(KERN_INFO "Beagle expansionboard: %s\n", expansionboard_name); ++ return 0; ++} ++ + static void __init beagle_opp_init(void) + { + int r = 0; +@@ -542,6 +727,65 @@ static void __init omap3_beagle_init(void) + /* REVISIT leave DVI powered down until it's needed ... */ + gpio_request_one(170, GPIOF_OUT_INIT_HIGH, "DVI_nPD"); + ++ if(!strcmp(expansionboard_name, "zippy")) ++ { ++ printk(KERN_INFO "Beagle expansionboard: initializing enc28j60\n"); ++ omap3beagle_enc28j60_init(); ++ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); ++ mmc[1].gpio_wp = 141; ++ mmc[1].gpio_cd = 162; ++ } ++ ++ if(!strcmp(expansionboard_name, "zippy2")) ++ { ++ printk(KERN_INFO "Beagle expansionboard: initializing ks_8851\n"); ++ omap3beagle_ks8851_init(); ++ printk(KERN_INFO "Beagle expansionboard: assigning GPIO 141 and 162 to MMC1\n"); ++ mmc[1].gpio_wp = 141; ++ mmc[1].gpio_cd = 162; ++ } ++ ++ if(!strcmp(expansionboard_name, "trainer")) ++ { ++ printk(KERN_INFO "Beagle expansionboard: exporting GPIOs 130-141,162 to userspace\n"); ++ gpio_request(130, "sysfs"); ++ gpio_export(130, 1); ++ gpio_request(131, "sysfs"); ++ gpio_export(131, 1); ++ gpio_request(132, "sysfs"); ++ gpio_export(132, 1); ++ gpio_request(133, "sysfs"); ++ gpio_export(133, 1); ++ gpio_request(134, "sysfs"); ++ gpio_export(134, 1); ++ gpio_request(135, "sysfs"); ++ gpio_export(135, 1); ++ gpio_request(136, "sysfs"); ++ gpio_export(136, 1); ++ gpio_request(137, "sysfs"); ++ gpio_export(137, 1); ++ gpio_request(138, "sysfs"); ++ gpio_export(138, 1); ++ gpio_request(139, "sysfs"); ++ gpio_export(139, 1); ++ gpio_request(140, "sysfs"); ++ gpio_export(140, 1); ++ gpio_request(141, "sysfs"); ++ gpio_export(141, 1); ++ gpio_request(162, "sysfs"); ++ gpio_export(162, 1); ++ } ++ ++ if(!strcmp(expansionboard_name, "bbtoys-wifi")) ++ { ++ if (wl12xx_set_platform_data(&omap_beagle_wlan_data)) ++ pr_err("error setting wl12xx data\n"); ++ printk(KERN_INFO "Beagle expansionboard: registering wl12xx bt platform device\n"); ++ platform_device_register(&wl12xx_device); ++ printk(KERN_INFO "Beagle expansionboard: registering wl12xx wifi platform device\n"); ++ platform_device_register(&omap_vwlan_device); ++ } ++ + usb_musb_init(NULL); + usbhs_init(&usbhs_bdata); + omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions, +@@ -558,6 +802,8 @@ static void __init omap3_beagle_init(void) + beagle_opp_init(); + } + ++early_param("buddy", expansionboard_setup); ++ + MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + /* Maintainer: Syed Mohammed Khasim - http://beagleboard.org */ + .boot_params = 0x80000100, +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/beagle/0003-HACK-OMAP3-beagle-switch-to-GPTIMER1.patch b/recipes-kernel/linux/linux-3.0/beagle/0003-HACK-OMAP3-beagle-switch-to-GPTIMER1.patch new file mode 100644 index 00000000..7ef020b3 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/beagle/0003-HACK-OMAP3-beagle-switch-to-GPTIMER1.patch @@ -0,0 +1,26 @@ +From dcdb487041d64eab8369b477311553f3c9fc9157 Mon Sep 17 00:00:00 2001 +From: Koen Kooi +Date: Thu, 21 Jul 2011 12:59:20 +0200 +Subject: [PATCH 3/3] HACK: OMAP3: beagle: switch to GPTIMER1 + +Breaks with B3 and older due to clock noise + +Signed-off-by: Koen Kooi +--- + arch/arm/mach-omap2/board-omap3beagle.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index e542df0..f4b01a9 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -812,5 +812,5 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + .init_early = omap3_beagle_init_early, + .init_irq = omap3_beagle_init_irq, + .init_machine = omap3_beagle_init, +- .timer = &omap3_secure_timer, ++ .timer = &omap3_timer, + MACHINE_END +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/beagleboard/defconfig b/recipes-kernel/linux/linux-3.0/beagleboard/defconfig index 6f97d93b..1942725f 100644 --- a/recipes-kernel/linux/linux-3.0/beagleboard/defconfig +++ b/recipes-kernel/linux/linux-3.0/beagleboard/defconfig @@ -319,7 +319,7 @@ CONFIG_OMAP_PM_NOOP=y CONFIG_ARCH_OMAP2PLUS_TYPICAL=y # CONFIG_ARCH_OMAP2 is not set CONFIG_ARCH_OMAP3=y -# CONFIG_ARCH_OMAP4 is not set +CONFIG_ARCH_OMAP4=y CONFIG_SOC_OMAP3430=y # CONFIG_SOC_OMAPTI816X is not set CONFIG_OMAP_PACKAGE_CBB=y @@ -463,9 +463,9 @@ CONFIG_CPU_FREQ_TABLE=y # CONFIG_CPU_FREQ_DEBUG is not set CONFIG_CPU_FREQ_STAT=y CONFIG_CPU_FREQ_STAT_DETAILS=y -# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set +CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set -CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE=y +# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set # CONFIG_CPU_FREQ_DEFAULT_GOV_HOTPLUG is not set diff --git a/recipes-kernel/linux/linux-3.0/bias/0001-OMAP3630-PRM-add-ABB-PRM-register-definitions.patch b/recipes-kernel/linux/linux-3.0/bias/0001-OMAP3630-PRM-add-ABB-PRM-register-definitions.patch new file mode 100644 index 00000000..fa647be4 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0001-OMAP3630-PRM-add-ABB-PRM-register-definitions.patch @@ -0,0 +1,93 @@ +From d6bdaaceafadfc31441e8dd14696da5ea683424b Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Wed, 29 Jun 2011 17:25:53 -0700 +Subject: [PATCH 1/8] OMAP3630: PRM: add ABB PRM register definitions + +OMAP3630 supports an Adaptive Body-Bias ldo as well as some MPU interrupts +related to voltage control that are not present on OMAP34XX. This patch +adds the offsets, register addresses, bitfield shifts and masks to support +this feature. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/prm-regbits-34xx.h | 34 ++++++++++++++++++++++++++++++++ + arch/arm/mach-omap2/prm2xxx_3xxx.h | 4 +++ + 2 files changed, 38 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/prm-regbits-34xx.h b/arch/arm/mach-omap2/prm-regbits-34xx.h +index 64c087a..0309ff6 100644 +--- a/arch/arm/mach-omap2/prm-regbits-34xx.h ++++ b/arch/arm/mach-omap2/prm-regbits-34xx.h +@@ -216,6 +216,12 @@ + /* PRM_SYSCONFIG specific bits */ + + /* PRM_IRQSTATUS_MPU specific bits */ ++#define OMAP3630_VC_BYPASS_ACK_ST_SHIFT 28 ++#define OMAP3630_VC_BYPASS_ACK_ST_MASK (1 << 28) ++#define OMAP3630_VC_VP1_ACK_ST_SHIFT 27 ++#define OMAP3630_VC_VP1_ACK_ST_MASK (1 << 27) ++#define OMAP3630_ABB_LDO_TRANXDONE_ST_SHIFT 26 ++#define OMAP3630_ABB_LDO_TRANXDONE_ST_MASK (1 << 26) + #define OMAP3430ES2_SND_PERIPH_DPLL_ST_SHIFT 25 + #define OMAP3430ES2_SND_PERIPH_DPLL_ST_MASK (1 << 25) + #define OMAP3430_VC_TIMEOUTERR_ST_MASK (1 << 24) +@@ -248,6 +254,12 @@ + #define OMAP3430_FS_USB_WKUP_ST_MASK (1 << 1) + + /* PRM_IRQENABLE_MPU specific bits */ ++#define OMAP3630_VC_BYPASS_ACK_EN_SHIFT 28 ++#define OMAP3630_VC_BYPASS_ACK_EN_MASK (1 << 28) ++#define OMAP3630_VC_VP1_ACK_EN_SHIFT 27 ++#define OMAP3630_VC_VP1_ACK_EN_MASK (1 << 27) ++#define OMAP3630_ABB_LDO_TRANXDONE_EN_SHIFT 26 ++#define OMAP3630_ABB_LDO_TRANXDONE_EN_MASK (1 << 26) + #define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_SHIFT 25 + #define OMAP3430ES2_SND_PERIPH_DPLL_RECAL_EN_MASK (1 << 25) + #define OMAP3430_VC_TIMEOUTERR_EN_MASK (1 << 24) +@@ -587,6 +599,28 @@ + + /* PRM_VP2_STATUS specific bits */ + ++/* PRM_LDO_ABB_SETUP specific bits */ ++#define OMAP3630_SR2_IN_TRANSITION_SHIFT 6 ++#define OMAP3630_SR2_IN_TRANSITION_MASK (1 << 6) ++#define OMAP3630_SR2_STATUS_SHIFT 3 ++#define OMAP3630_SR2_STATUS_MASK (3 << 3) ++#define OMAP3630_OPP_CHANGE_SHIFT 2 ++#define OMAP3630_OPP_CHANGE_MASK (1 << 2) ++#define OMAP3630_OPP_SEL_SHIFT 0 ++#define OMAP3630_OPP_SEL_MASK (3 << 0) ++ ++/* PRM_LDO_ABB_CTRL specific bits */ ++#define OMAP3630_SR2_WTCNT_VALUE_SHIFT 8 ++#define OMAP3630_SR2_WTCNT_VALUE_MASK (0xff << 8) ++#define OMAP3630_SLEEP_RBB_SEL_SHIFT 3 ++#define OMAP3630_SLEEP_RBB_SEL_MASK (1 << 3) ++#define OMAP3630_ACTIVE_FBB_SEL_SHIFT 2 ++#define OMAP3630_ACTIVE_FBB_SEL_MASK (1 << 2) ++#define OMAP3630_ACTIVE_RBB_SEL_SHIFT 1 ++#define OMAP3630_ACTIVE_RBB_SEL_MASK (1 << 1) ++#define OMAP3630_SR2EN_SHIFT 0 ++#define OMAP3630_SR2EN_MASK (1 << 0) ++ + /* RM_RSTST_NEON specific bits */ + + /* PM_WKDEP_NEON specific bits */ +diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h +index cef533d..408d1c7 100644 +--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h ++++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h +@@ -167,6 +167,10 @@ + #define OMAP3430_PRM_VP2_VOLTAGE OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e0) + #define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4 + #define OMAP3430_PRM_VP2_STATUS OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00e4) ++#define OMAP3_PRM_LDO_ABB_SETUP_OFFSET 0x00f0 ++#define OMAP3630_PRM_LDO_ABB_SETUP OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00f0) ++#define OMAP3_PRM_LDO_ABB_CTRL_OFFSET 0x00f4 ++#define OMAP3630_PRM_LDO_ABB_CTRL OMAP34XX_PRM_REGADDR(OMAP3430_GR_MOD, 0x00f4) + + #define OMAP3_PRM_CLKSEL_OFFSET 0x0040 + #define OMAP3430_PRM_CLKSEL OMAP34XX_PRM_REGADDR(OMAP3430_CCR_MOD, 0x0040) +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0002-OMAP3-PM-VP-generalize-PRM-interrupt-helpers.patch b/recipes-kernel/linux/linux-3.0/bias/0002-OMAP3-PM-VP-generalize-PRM-interrupt-helpers.patch new file mode 100644 index 00000000..21149dd1 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0002-OMAP3-PM-VP-generalize-PRM-interrupt-helpers.patch @@ -0,0 +1,263 @@ +From 8e6411258660b08ee55b4148cca37f841d9c9568 Mon Sep 17 00:00:00 2001 +From: Nishanth Menon +Date: Wed, 29 Jun 2011 17:25:54 -0700 +Subject: [PATCH 2/8] OMAP3+: PM: VP: generalize PRM interrupt helpers + +We have multiple interrupt status hidden in the PRM interrupt status +reg. Make this handling generic to allow us to pull out LDO status such +as those for ABB from it using the same data structure and indexing. We +hence rename accordingly. + +We also fix a trivial warning as the variable does not need exporting: +arch/arm/mach-omap2/prm2xxx_3xxx.c:172:22: warning: symbol +'omap3_prm_irqs' was not declared. Should it be static? + +Signed-off-by: Nishanth Menon +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/prm2xxx_3xxx.c | 22 +++++++++++----------- + arch/arm/mach-omap2/prm2xxx_3xxx.h | 7 +++++-- + arch/arm/mach-omap2/prm44xx.c | 28 ++++++++++++++-------------- + arch/arm/mach-omap2/prm44xx.h | 7 +++++-- + arch/arm/mach-omap2/vp.h | 9 --------- + arch/arm/mach-omap2/vp3xxx_data.c | 4 ++-- + arch/arm/mach-omap2/vp44xx_data.c | 6 +++--- + 7 files changed, 40 insertions(+), 43 deletions(-) + +diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c +index 3b83763..8a20242 100644 +--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c ++++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c +@@ -162,39 +162,39 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift) + /* PRM VP */ + + /* +- * struct omap3_vp - OMAP3 VP register access description. ++ * struct omap3_prm_irq - OMAP3 PRM IRQ register access description. + * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg + */ +-struct omap3_vp { ++struct omap3_prm_irq { + u32 tranxdone_status; + }; + +-struct omap3_vp omap3_vp[] = { +- [OMAP3_VP_VDD_MPU_ID] = { ++static struct omap3_prm_irq omap3_prm_irqs[] = { ++ [OMAP3_PRM_IRQ_VDD_MPU_ID] = { + .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, + }, +- [OMAP3_VP_VDD_CORE_ID] = { ++ [OMAP3_PRM_IRQ_VDD_CORE_ID] = { + .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK, + }, + }; + + #define MAX_VP_ID ARRAY_SIZE(omap3_vp); + +-u32 omap3_prm_vp_check_txdone(u8 vp_id) ++u32 omap3_prm_vp_check_txdone(u8 irq_id) + { +- struct omap3_vp *vp = &omap3_vp[vp_id]; ++ struct omap3_prm_irq *irq = &omap3_prm_irqs[irq_id]; + u32 irqstatus; + + irqstatus = omap2_prm_read_mod_reg(OCP_MOD, + OMAP3_PRM_IRQSTATUS_MPU_OFFSET); +- return irqstatus & vp->tranxdone_status; ++ return irqstatus & irq->tranxdone_status; + } + +-void omap3_prm_vp_clear_txdone(u8 vp_id) ++void omap3_prm_vp_clear_txdone(u8 irq_id) + { +- struct omap3_vp *vp = &omap3_vp[vp_id]; ++ struct omap3_prm_irq *irq = &omap3_prm_irqs[irq_id]; + +- omap2_prm_write_mod_reg(vp->tranxdone_status, ++ omap2_prm_write_mod_reg(irq->tranxdone_status, + OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); + } + +diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h +index 408d1c7..d90b23f 100644 +--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h ++++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h +@@ -307,9 +307,12 @@ extern int omap2_prm_is_hardreset_asserted(s16 prm_mod, u8 shift); + extern int omap2_prm_assert_hardreset(s16 prm_mod, u8 shift); + extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); + ++#define OMAP3_PRM_IRQ_VDD_MPU_ID 0 ++#define OMAP3_PRM_IRQ_VDD_CORE_ID 1 + /* OMAP3-specific VP functions */ +-u32 omap3_prm_vp_check_txdone(u8 vp_id); +-void omap3_prm_vp_clear_txdone(u8 vp_id); ++u32 omap3_prm_vp_check_txdone(u8 irq_id); ++void omap3_prm_vp_clear_txdone(u8 irq_id); ++ + + /* + * OMAP3 access functions for voltage controller (VC) and +diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c +index 495a31a..b77d331 100644 +--- a/arch/arm/mach-omap2/prm44xx.c ++++ b/arch/arm/mach-omap2/prm44xx.c +@@ -57,49 +57,49 @@ u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg) + /* PRM VP */ + + /* +- * struct omap4_vp - OMAP4 VP register access description. ++ * struct omap4_prm_irq - OMAP4 VP register access description. + * @irqstatus_mpu: offset to IRQSTATUS_MPU register for VP + * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg + */ +-struct omap4_vp { ++struct omap4_prm_irq { + u32 irqstatus_mpu; + u32 tranxdone_status; + }; + +-static struct omap4_vp omap4_vp[] = { +- [OMAP4_VP_VDD_MPU_ID] = { ++static struct omap4_prm_irq omap4_prm_irqs[] = { ++ [OMAP4_PRM_IRQ_VDD_MPU_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET, + .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, + }, +- [OMAP4_VP_VDD_IVA_ID] = { ++ [OMAP4_PRM_IRQ_VDD_IVA_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, + .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, + }, +- [OMAP4_VP_VDD_CORE_ID] = { ++ [OMAP4_PRM_IRQ_VDD_CORE_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, + .tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK, + }, + }; + +-u32 omap4_prm_vp_check_txdone(u8 vp_id) ++u32 omap4_prm_vp_check_txdone(u8 irq_id) + { +- struct omap4_vp *vp = &omap4_vp[vp_id]; ++ struct omap4_prm_irq *irq = &omap4_prm_irqs[irq_id]; + u32 irqstatus; + + irqstatus = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, + OMAP4430_PRM_OCP_SOCKET_INST, +- vp->irqstatus_mpu); +- return irqstatus & vp->tranxdone_status; ++ irq->irqstatus_mpu); ++ return irqstatus & irq->tranxdone_status; + } + +-void omap4_prm_vp_clear_txdone(u8 vp_id) ++void omap4_prm_vp_clear_txdone(u8 irq_id) + { +- struct omap4_vp *vp = &omap4_vp[vp_id]; ++ struct omap4_prm_irq *irq = &omap4_prm_irqs[irq_id]; + +- omap4_prminst_write_inst_reg(vp->tranxdone_status, ++ omap4_prminst_write_inst_reg(irq->tranxdone_status, + OMAP4430_PRM_PARTITION, + OMAP4430_PRM_OCP_SOCKET_INST, +- vp->irqstatus_mpu); ++ irq->irqstatus_mpu); + }; + + u32 omap4_prm_vcvp_read(u8 offset) +diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h +index 3d66ccd..858ee53 100644 +--- a/arch/arm/mach-omap2/prm44xx.h ++++ b/arch/arm/mach-omap2/prm44xx.h +@@ -751,9 +751,12 @@ extern u32 omap4_prm_read_inst_reg(s16 inst, u16 idx); + extern void omap4_prm_write_inst_reg(u32 val, s16 inst, u16 idx); + extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); + ++#define OMAP4_PRM_IRQ_VDD_CORE_ID 0 ++#define OMAP4_PRM_IRQ_VDD_IVA_ID 1 ++#define OMAP4_PRM_IRQ_VDD_MPU_ID 2 + /* OMAP4-specific VP functions */ +-u32 omap4_prm_vp_check_txdone(u8 vp_id); +-void omap4_prm_vp_clear_txdone(u8 vp_id); ++u32 omap4_prm_vp_check_txdone(u8 irq_id); ++void omap4_prm_vp_clear_txdone(u8 irq_id); + + /* + * OMAP4 access functions for voltage controller (VC) and +diff --git a/arch/arm/mach-omap2/vp.h b/arch/arm/mach-omap2/vp.h +index d9bc4f1..ee31e2f 100644 +--- a/arch/arm/mach-omap2/vp.h ++++ b/arch/arm/mach-omap2/vp.h +@@ -21,15 +21,6 @@ + + struct voltagedomain; + +-/* +- * Voltage Processor (VP) identifiers +- */ +-#define OMAP3_VP_VDD_MPU_ID 0 +-#define OMAP3_VP_VDD_CORE_ID 1 +-#define OMAP4_VP_VDD_CORE_ID 0 +-#define OMAP4_VP_VDD_IVA_ID 1 +-#define OMAP4_VP_VDD_MPU_ID 2 +- + /* XXX document */ + #define VP_IDLE_TIMEOUT 200 + #define VP_TRANXDONE_TIMEOUT 300 +diff --git a/arch/arm/mach-omap2/vp3xxx_data.c b/arch/arm/mach-omap2/vp3xxx_data.c +index 260c554..7bd8181 100644 +--- a/arch/arm/mach-omap2/vp3xxx_data.c ++++ b/arch/arm/mach-omap2/vp3xxx_data.c +@@ -57,7 +57,7 @@ static const struct omap_vp_common omap3_vp_common = { + }; + + struct omap_vp_instance omap3_vp_mpu = { +- .id = OMAP3_VP_VDD_MPU_ID, ++ .id = OMAP3_PRM_IRQ_VDD_MPU_ID, + .common = &omap3_vp_common, + .vpconfig = OMAP3_PRM_VP1_CONFIG_OFFSET, + .vstepmin = OMAP3_PRM_VP1_VSTEPMIN_OFFSET, +@@ -68,7 +68,7 @@ struct omap_vp_instance omap3_vp_mpu = { + }; + + struct omap_vp_instance omap3_vp_core = { +- .id = OMAP3_VP_VDD_CORE_ID, ++ .id = OMAP3_PRM_IRQ_VDD_CORE_ID, + .common = &omap3_vp_common, + .vpconfig = OMAP3_PRM_VP2_CONFIG_OFFSET, + .vstepmin = OMAP3_PRM_VP2_VSTEPMIN_OFFSET, +diff --git a/arch/arm/mach-omap2/vp44xx_data.c b/arch/arm/mach-omap2/vp44xx_data.c +index b4e7704..6de8ed6 100644 +--- a/arch/arm/mach-omap2/vp44xx_data.c ++++ b/arch/arm/mach-omap2/vp44xx_data.c +@@ -56,7 +56,7 @@ static const struct omap_vp_common omap4_vp_common = { + }; + + struct omap_vp_instance omap4_vp_mpu = { +- .id = OMAP4_VP_VDD_MPU_ID, ++ .id = OMAP4_PRM_IRQ_VDD_MPU_ID, + .common = &omap4_vp_common, + .vpconfig = OMAP4_PRM_VP_MPU_CONFIG_OFFSET, + .vstepmin = OMAP4_PRM_VP_MPU_VSTEPMIN_OFFSET, +@@ -67,7 +67,7 @@ struct omap_vp_instance omap4_vp_mpu = { + }; + + struct omap_vp_instance omap4_vp_iva = { +- .id = OMAP4_VP_VDD_IVA_ID, ++ .id = OMAP4_PRM_IRQ_VDD_IVA_ID, + .common = &omap4_vp_common, + .vpconfig = OMAP4_PRM_VP_IVA_CONFIG_OFFSET, + .vstepmin = OMAP4_PRM_VP_IVA_VSTEPMIN_OFFSET, +@@ -78,7 +78,7 @@ struct omap_vp_instance omap4_vp_iva = { + }; + + struct omap_vp_instance omap4_vp_core = { +- .id = OMAP4_VP_VDD_CORE_ID, ++ .id = OMAP4_PRM_IRQ_VDD_CORE_ID, + .common = &omap4_vp_common, + .vpconfig = OMAP4_PRM_VP_CORE_CONFIG_OFFSET, + .vstepmin = OMAP4_PRM_VP_CORE_VSTEPMIN_OFFSET, +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0003-OMAP3-PRM-add-tranxdone-IRQ-handlers-for-ABB.patch b/recipes-kernel/linux/linux-3.0/bias/0003-OMAP3-PRM-add-tranxdone-IRQ-handlers-for-ABB.patch new file mode 100644 index 00000000..45edb2b4 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0003-OMAP3-PRM-add-tranxdone-IRQ-handlers-for-ABB.patch @@ -0,0 +1,202 @@ +From 6dd3408940048af572773518f8646226828e7275 Mon Sep 17 00:00:00 2001 +From: Nishanth Menon +Date: Wed, 29 Jun 2011 17:25:55 -0700 +Subject: [PATCH 3/8] OMAP3+: PRM: add tranxdone IRQ handlers for ABB + +OMAP3 and more recent platforms support a PRM interrupt to the MPU for +Adapative Body-Bias ldo transitions. + +Add helpers to the OMAP3 & OMAP4 PRM code to check the status of the +interrupt and also to clear it. These will be called from the ABB code +as part of the greater voltage scaling sequence. + +Signed-off-by: Nishanth Menon +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/prm2xxx_3xxx.c | 35 ++++++++++++++++++++++++++----- + arch/arm/mach-omap2/prm2xxx_3xxx.h | 3 ++ + arch/arm/mach-omap2/prm44xx.c | 40 +++++++++++++++++++++++++++++------ + arch/arm/mach-omap2/prm44xx.h | 3 ++ + 4 files changed, 68 insertions(+), 13 deletions(-) + +diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.c b/arch/arm/mach-omap2/prm2xxx_3xxx.c +index 8a20242..49e9719 100644 +--- a/arch/arm/mach-omap2/prm2xxx_3xxx.c ++++ b/arch/arm/mach-omap2/prm2xxx_3xxx.c +@@ -163,18 +163,23 @@ int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift) + + /* + * struct omap3_prm_irq - OMAP3 PRM IRQ register access description. +- * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg ++ * @vp_tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg ++ * @abb_tranxdone_status: ABB_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg ++ * (ONLY for OMAP3630) + */ + struct omap3_prm_irq { +- u32 tranxdone_status; ++ u32 vp_tranxdone_status; ++ u32 abb_tranxdone_status; + }; + + static struct omap3_prm_irq omap3_prm_irqs[] = { + [OMAP3_PRM_IRQ_VDD_MPU_ID] = { +- .tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, ++ .vp_tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK, ++ .abb_tranxdone_status = OMAP3630_ABB_LDO_TRANXDONE_ST_MASK, + }, + [OMAP3_PRM_IRQ_VDD_CORE_ID] = { +- .tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK, ++ .vp_tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK, ++ /* no abb for core */ + }, + }; + +@@ -187,14 +192,32 @@ u32 omap3_prm_vp_check_txdone(u8 irq_id) + + irqstatus = omap2_prm_read_mod_reg(OCP_MOD, + OMAP3_PRM_IRQSTATUS_MPU_OFFSET); +- return irqstatus & irq->tranxdone_status; ++ return irqstatus & irq->vp_tranxdone_status; + } + + void omap3_prm_vp_clear_txdone(u8 irq_id) + { + struct omap3_prm_irq *irq = &omap3_prm_irqs[irq_id]; + +- omap2_prm_write_mod_reg(irq->tranxdone_status, ++ omap2_prm_write_mod_reg(irq->vp_tranxdone_status, ++ OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); ++} ++ ++u32 omap36xx_prm_abb_check_txdone(u8 irq_id) ++{ ++ struct omap3_prm_irq *irq = &omap3_prm_irqs[irq_id]; ++ u32 irqstatus; ++ ++ irqstatus = omap2_prm_read_mod_reg(OCP_MOD, ++ OMAP3_PRM_IRQSTATUS_MPU_OFFSET); ++ return irqstatus & irq->abb_tranxdone_status; ++} ++ ++void omap36xx_prm_abb_clear_txdone(u8 irq_id) ++{ ++ struct omap3_prm_irq *irq = &omap3_prm_irqs[irq_id]; ++ ++ omap2_prm_write_mod_reg(irq->abb_tranxdone_status, + OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET); + } + +diff --git a/arch/arm/mach-omap2/prm2xxx_3xxx.h b/arch/arm/mach-omap2/prm2xxx_3xxx.h +index d90b23f..08d5f1e 100644 +--- a/arch/arm/mach-omap2/prm2xxx_3xxx.h ++++ b/arch/arm/mach-omap2/prm2xxx_3xxx.h +@@ -313,6 +313,9 @@ extern int omap2_prm_deassert_hardreset(s16 prm_mod, u8 rst_shift, u8 st_shift); + u32 omap3_prm_vp_check_txdone(u8 irq_id); + void omap3_prm_vp_clear_txdone(u8 irq_id); + ++/* OMAP36xx-specific ABB functions */ ++u32 omap36xx_prm_abb_check_txdone(u8 irq_id); ++void omap36xx_prm_abb_clear_txdone(u8 irq_id); + + /* + * OMAP3 access functions for voltage controller (VC) and +diff --git a/arch/arm/mach-omap2/prm44xx.c b/arch/arm/mach-omap2/prm44xx.c +index b77d331..dd3776c 100644 +--- a/arch/arm/mach-omap2/prm44xx.c ++++ b/arch/arm/mach-omap2/prm44xx.c +@@ -59,25 +59,30 @@ u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 reg) + /* + * struct omap4_prm_irq - OMAP4 VP register access description. + * @irqstatus_mpu: offset to IRQSTATUS_MPU register for VP +- * @tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg ++ * @vp_tranxdone_status: VP_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg ++ * @abb_tranxdone_status: ABB_TRANXDONE_ST bitmask in PRM_IRQSTATUS_MPU reg + */ + struct omap4_prm_irq { + u32 irqstatus_mpu; +- u32 tranxdone_status; ++ u32 vp_tranxdone_status; ++ u32 abb_tranxdone_status; + }; + + static struct omap4_prm_irq omap4_prm_irqs[] = { + [OMAP4_PRM_IRQ_VDD_MPU_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_2_OFFSET, +- .tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, ++ .vp_tranxdone_status = OMAP4430_VP_MPU_TRANXDONE_ST_MASK, ++ .abb_tranxdone_status = OMAP4430_ABB_MPU_DONE_ST_MASK + }, + [OMAP4_PRM_IRQ_VDD_IVA_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, +- .tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, ++ .vp_tranxdone_status = OMAP4430_VP_IVA_TRANXDONE_ST_MASK, ++ .abb_tranxdone_status = OMAP4430_ABB_IVA_DONE_ST_MASK, + }, + [OMAP4_PRM_IRQ_VDD_CORE_ID] = { + .irqstatus_mpu = OMAP4_PRM_IRQSTATUS_MPU_OFFSET, +- .tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK, ++ .vp_tranxdone_status = OMAP4430_VP_CORE_TRANXDONE_ST_MASK, ++ /* Core has no ABB */ + }, + }; + +@@ -89,19 +94,40 @@ u32 omap4_prm_vp_check_txdone(u8 irq_id) + irqstatus = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, + OMAP4430_PRM_OCP_SOCKET_INST, + irq->irqstatus_mpu); +- return irqstatus & irq->tranxdone_status; ++ return irqstatus & irq->vp_tranxdone_status; + } + + void omap4_prm_vp_clear_txdone(u8 irq_id) + { + struct omap4_prm_irq *irq = &omap4_prm_irqs[irq_id]; + +- omap4_prminst_write_inst_reg(irq->tranxdone_status, ++ omap4_prminst_write_inst_reg(irq->vp_tranxdone_status, + OMAP4430_PRM_PARTITION, + OMAP4430_PRM_OCP_SOCKET_INST, + irq->irqstatus_mpu); + }; + ++u32 omap4_prm_abb_check_txdone(u8 irq_id) ++{ ++ struct omap4_prm_irq *irq = &omap4_prm_irqs[irq_id]; ++ u32 irqstatus; ++ ++ irqstatus = omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, ++ OMAP4430_PRM_OCP_SOCKET_INST, ++ irq->irqstatus_mpu); ++ return irqstatus & irq->abb_tranxdone_status; ++} ++ ++void omap4_prm_abb_clear_txdone(u8 irq_id) ++{ ++ struct omap4_prm_irq *irq = &omap4_prm_irqs[irq_id]; ++ ++ omap4_prminst_write_inst_reg(irq->abb_tranxdone_status, ++ OMAP4430_PRM_PARTITION, ++ OMAP4430_PRM_OCP_SOCKET_INST, ++ irq->irqstatus_mpu); ++} ++ + u32 omap4_prm_vcvp_read(u8 offset) + { + return omap4_prminst_read_inst_reg(OMAP4430_PRM_PARTITION, +diff --git a/arch/arm/mach-omap2/prm44xx.h b/arch/arm/mach-omap2/prm44xx.h +index 858ee53..8ce3207 100644 +--- a/arch/arm/mach-omap2/prm44xx.h ++++ b/arch/arm/mach-omap2/prm44xx.h +@@ -757,6 +757,9 @@ extern u32 omap4_prm_rmw_inst_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); + /* OMAP4-specific VP functions */ + u32 omap4_prm_vp_check_txdone(u8 irq_id); + void omap4_prm_vp_clear_txdone(u8 irq_id); ++/* OMAP4-specific ABB functions */ ++u32 omap4_prm_abb_check_txdone(u8 irq_id); ++void omap4_prm_abb_clear_txdone(u8 irq_id); + + /* + * OMAP4 access functions for voltage controller (VC) and +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0004-OMAP3-ABB-Adaptive-Body-Bias-structures-data.patch b/recipes-kernel/linux/linux-3.0/bias/0004-OMAP3-ABB-Adaptive-Body-Bias-structures-data.patch new file mode 100644 index 00000000..662e4477 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0004-OMAP3-ABB-Adaptive-Body-Bias-structures-data.patch @@ -0,0 +1,240 @@ +From cd3d2049b3c59b5b28efe81b91f4051fea51687b Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Wed, 29 Jun 2011 17:25:56 -0700 +Subject: [PATCH 4/8] OMAP3+: ABB: Adaptive Body-Bias structures & data + +Due to voltage domain trimming and silicon characterstics some silicon +may experience instability when operating at a high voltage. To +compensate for this an Adaptive Body-Bias ldo exists. First featured in +OMAP3630, the purpose of this ldo is to provide a voltage boost to PMOS +backgates when a voltage domain is operating at a high OPP. In this +mode the ldo is said to be in Forward Body-Bias. At OPPs within a +nominal voltage range the ABB ldo is bypassed. + +This patch introduces the data structures needed to represent the ABB +ldo's in the voltage layer, and populates the appropriate data for 3630 +and OMAP4. Not all voltage domains have an ABB ldo, and OMAP34xx does +not have it at all; in such cases the voltage data will be marked with +OMAP_ABB_NO_LDO. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/Makefile | 5 +- + arch/arm/mach-omap2/abb.h | 85 ++++++++++++++++++++++++++++++++++++ + arch/arm/mach-omap2/abb36xx_data.c | 38 ++++++++++++++++ + arch/arm/mach-omap2/abb44xx_data.c | 44 ++++++++++++++++++ + 4 files changed, 170 insertions(+), 2 deletions(-) + create mode 100644 arch/arm/mach-omap2/abb.h + create mode 100644 arch/arm/mach-omap2/abb36xx_data.c + create mode 100644 arch/arm/mach-omap2/abb44xx_data.c + +diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile +index 7927dd6..5bc306c 100644 +--- a/arch/arm/mach-omap2/Makefile ++++ b/arch/arm/mach-omap2/Makefile +@@ -82,14 +82,15 @@ endif + # PRCM + obj-$(CONFIG_ARCH_OMAP2) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o + obj-$(CONFIG_ARCH_OMAP3) += prcm.o cm2xxx_3xxx.o prm2xxx_3xxx.o \ +- vc3xxx_data.o vp3xxx_data.o ++ vc3xxx_data.o vp3xxx_data.o \ ++ abb36xx_data.o + # XXX The presence of cm2xxx_3xxx.o on the line below is temporary and + # will be removed once the OMAP4 part of the codebase is converted to + # use OMAP4-specific PRCM functions. + obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ + cm44xx.o prcm_mpu44xx.o \ + prminst44xx.o vc44xx_data.o \ +- vp44xx_data.o ++ vp44xx_data.o abb44xx_data.o + + # OMAP voltage domains + ifeq ($(CONFIG_PM),y) +diff --git a/arch/arm/mach-omap2/abb.h b/arch/arm/mach-omap2/abb.h +new file mode 100644 +index 0000000..74f2044 +--- /dev/null ++++ b/arch/arm/mach-omap2/abb.h +@@ -0,0 +1,85 @@ ++/* ++ * OMAP Adaptive Body-Bias structure and macro definitions ++ * ++ * Copyright (C) 2011 Texas Instruments, Inc. ++ * Mike Turquette ++ * ++ * 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. ++ */ ++ ++#ifndef __ARCH_ARM_MACH_OMAP2_ABB_H ++#define __ARCH_ARM_MACH_OMAP2_ABB_H ++ ++#include ++ ++#include "voltage.h" ++ ++/* NOMINAL_OPP bypasses the ABB ldo, FAST_OPP sets it to Forward Body-Bias */ ++#define OMAP_ABB_NOMINAL_OPP 0 ++#define OMAP_ABB_FAST_OPP 1 ++#define OMAP_ABB_NO_LDO ~0 ++ ++/* Time for the ABB ldo to settle after transition (in micro-seconds) */ ++#define ABB_TRANXDONE_TIMEOUT 50 ++ ++/* ++ * struct omap_abb_ops - per-OMAP operations needed for ABB transition ++ * ++ * @check_tranxdone: return status of ldo transition from PRM_IRQSTATUS ++ * @clear_tranxdone: clear ABB transition status bit from PRM_IRQSTATUS ++ */ ++struct omap_abb_ops { ++ u32 (*check_tranxdone)(u8 irq_id); ++ void (*clear_tranxdone)(u8 irq_id); ++}; ++ ++/* ++ * struct omap_abb_common - ABB data common to an OMAP family ++ * ++ * @opp_sel_mask: CTRL reg uses this to program next state of ldo ++ * @opp_change_mask: CTRL reg uses this to initiate ldo state change ++ * @sr2_wtcnt_value_mask: SETUP reg uses this to program ldo settling time ++ * @sr2en_mask: SETUP reg uses this to enable/disable ldo ++ * @active_fbb_sel_mask: SETUP reg uses this to enable/disable FBB operation ++ * @settling_time: number of micro-seconds it takes for ldo to transition ++ * @clock_cycles: settling_time is counted in multiples of clock cycles ++ * @ops: pointer to common ops for manipulating PRM_IRQSTATUS bits ++ */ ++struct omap_abb_common { ++ u32 opp_sel_mask; ++ u32 opp_change_mask; ++ u32 sr2_wtcnt_value_mask; ++ u32 sr2en_mask; ++ u32 active_fbb_sel_mask; ++ unsigned long settling_time; ++ unsigned long clock_cycles; ++ const struct omap_abb_ops *ops; ++}; ++ ++/* ++ * struct omap_abb_instance - data for each instance of ABB ldo ++ * ++ * @setup_offs: PRM register offset for initial configuration of ABB ldo ++ * @ctrl_offs: PRM register offset for active programming of ABB ldo ++ * @prm_irq_id: IRQ handle used to resolve IRQSTATUS offset & masks ++ * @enabled: track whether ABB ldo is enabled or disabled ++ * @common: pointer to common data for all ABB ldo's ++ * @_opp_sel: internally track last programmed state of ABB ldo. DO NOT USE ++ */ ++struct omap_abb_instance { ++ u8 setup_offs; ++ u8 ctrl_offs; ++ u8 prm_irq_id; ++ bool enabled; ++ const struct omap_abb_common *common; ++ u8 _opp_sel; ++}; ++ ++extern struct omap_abb_instance omap36xx_abb_mpu; ++ ++extern struct omap_abb_instance omap4_abb_mpu; ++extern struct omap_abb_instance omap4_abb_iva; ++ ++#endif +diff --git a/arch/arm/mach-omap2/abb36xx_data.c b/arch/arm/mach-omap2/abb36xx_data.c +new file mode 100644 +index 0000000..0bcfd66 +--- /dev/null ++++ b/arch/arm/mach-omap2/abb36xx_data.c +@@ -0,0 +1,38 @@ ++/* ++ * OMAP36xx Adaptive Body-Bias (ABB) data ++ * ++ * Copyright (C) 2011 Texas Instruments, Inc. ++ * Mike Turquette ++ * ++ * 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 "abb.h" ++#include "prm2xxx_3xxx.h" ++#include "prm-regbits-34xx.h" ++ ++static const struct omap_abb_ops omap36xx_abb_ops = { ++ .check_tranxdone = &omap36xx_prm_abb_check_txdone, ++ .clear_tranxdone = &omap36xx_prm_abb_clear_txdone, ++}; ++ ++static const struct omap_abb_common omap36xx_abb_common = { ++ .opp_sel_mask = OMAP3630_OPP_SEL_MASK, ++ .opp_change_mask = OMAP3630_OPP_CHANGE_MASK, ++ .sr2en_mask = OMAP3630_SR2EN_MASK, ++ .active_fbb_sel_mask = OMAP3630_ACTIVE_FBB_SEL_MASK, ++ .sr2_wtcnt_value_mask = OMAP3630_SR2_WTCNT_VALUE_MASK, ++ .settling_time = 30, ++ .clock_cycles = 8, ++ .ops = &omap36xx_abb_ops, ++}; ++ ++/* SETUP & CTRL registers swapped names in OMAP4; thus 36xx looks strange */ ++struct omap_abb_instance omap36xx_abb_mpu = { ++ .setup_offs = OMAP3_PRM_LDO_ABB_CTRL_OFFSET, ++ .ctrl_offs = OMAP3_PRM_LDO_ABB_SETUP_OFFSET, ++ .prm_irq_id = OMAP3_PRM_IRQ_VDD_MPU_ID, ++ .common = &omap36xx_abb_common, ++}; +diff --git a/arch/arm/mach-omap2/abb44xx_data.c b/arch/arm/mach-omap2/abb44xx_data.c +new file mode 100644 +index 0000000..a7cf855 +--- /dev/null ++++ b/arch/arm/mach-omap2/abb44xx_data.c +@@ -0,0 +1,44 @@ ++/* ++ * OMAP44xx Adaptive Body-Bias (ABB) data ++ * ++ * Copyright (C) 2011 Texas Instruments, Inc. ++ * Mike Turquette ++ * ++ * 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 "abb.h" ++#include "prm44xx.h" ++#include "prm-regbits-44xx.h" ++ ++static const struct omap_abb_ops omap4_abb_ops = { ++ .check_tranxdone = &omap4_prm_abb_check_txdone, ++ .clear_tranxdone = &omap4_prm_abb_clear_txdone, ++}; ++ ++static const struct omap_abb_common omap4_abb_common = { ++ .opp_sel_mask = OMAP4430_OPP_SEL_MASK, ++ .opp_change_mask = OMAP4430_OPP_CHANGE_MASK, ++ .sr2en_mask = OMAP4430_SR2EN_MASK, ++ .active_fbb_sel_mask = OMAP4430_ACTIVE_FBB_SEL_MASK, ++ .sr2_wtcnt_value_mask = OMAP4430_SR2_WTCNT_VALUE_MASK, ++ .settling_time = 50, ++ .clock_cycles = 16, ++ .ops = &omap4_abb_ops, ++}; ++ ++struct omap_abb_instance omap4_abb_mpu = { ++ .setup_offs = OMAP4_PRM_LDO_ABB_MPU_SETUP_OFFSET, ++ .ctrl_offs = OMAP4_PRM_LDO_ABB_MPU_CTRL_OFFSET, ++ .prm_irq_id = OMAP4_PRM_IRQ_VDD_MPU_ID, ++ .common = &omap4_abb_common, ++}; ++ ++struct omap_abb_instance omap4_abb_iva = { ++ .setup_offs = OMAP4_PRM_LDO_ABB_IVA_SETUP_OFFSET, ++ .ctrl_offs = OMAP4_PRM_LDO_ABB_IVA_CTRL_OFFSET, ++ .prm_irq_id = OMAP4_PRM_IRQ_VDD_IVA_ID, ++ .common = &omap4_abb_common, ++}; +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0005-OMAP3-OPP-add-ABB-data-to-voltage-tables.patch b/recipes-kernel/linux/linux-3.0/bias/0005-OMAP3-OPP-add-ABB-data-to-voltage-tables.patch new file mode 100644 index 00000000..517a4d86 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0005-OMAP3-OPP-add-ABB-data-to-voltage-tables.patch @@ -0,0 +1,194 @@ +From dbbe5cde8c8c9b055ba8bd22d329149b2a0a09e2 Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Wed, 29 Jun 2011 17:25:57 -0700 +Subject: [PATCH 5/8] OMAP3+: OPP: add ABB data to voltage tables + +The operating mode of the Adaptive Body-Bias ldo maps directly to the +voltage of its voltage domain. The two modes supported are bypass and +Forward Body-Bias (FBB). + +This patch models this relationship by adding an opp_sel paramter to +struct omap_volt_data and populates this type in the 3630 and 4430 +voltage tables. + +NOMINAL_OPP causes the ABB ldo to be in bypass at that specific voltage. +FAST_OPP causes the ldo to operate in Forward Body-Bias mode. + +Not all voltage domains have an ABB ldo and 3430 doesn't have one at +all. In such cases voltages are marked with OMAP_ABB_NO_LDO. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/omap_opp_data.h | 5 ++- + arch/arm/mach-omap2/opp3xxx_data.c | 37 ++++++++++++++++++----------------- + arch/arm/mach-omap2/opp4xxx_data.c | 25 ++++++++++++----------- + arch/arm/mach-omap2/voltage.h | 1 + + 4 files changed, 36 insertions(+), 32 deletions(-) + +diff --git a/arch/arm/mach-omap2/omap_opp_data.h b/arch/arm/mach-omap2/omap_opp_data.h +index c784c12..5dd4dea 100644 +--- a/arch/arm/mach-omap2/omap_opp_data.h ++++ b/arch/arm/mach-omap2/omap_opp_data.h +@@ -71,12 +71,13 @@ struct omap_opp_def { + * Initialization wrapper used to define SmartReflex process data + * XXX Is this needed? Just use C99 initializers in data files? + */ +-#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain) \ ++#define VOLT_DATA_DEFINE(_v_nom, _efuse_offs, _errminlimit, _errgain, _opp_sel) \ + { \ + .volt_nominal = _v_nom, \ + .sr_efuse_offs = _efuse_offs, \ + .sr_errminlimit = _errminlimit, \ +- .vp_errgain = _errgain \ ++ .vp_errgain = _errgain, \ ++ .opp_sel = _opp_sel \ + } + + /* Use this to initialize the default table */ +diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c +index d95f3f9..12fc2da 100644 +--- a/arch/arm/mach-omap2/opp3xxx_data.c ++++ b/arch/arm/mach-omap2/opp3xxx_data.c +@@ -24,6 +24,7 @@ + #include "control.h" + #include "omap_opp_data.h" + #include "pm.h" ++#include "abb.h" + + /* 34xx */ + +@@ -36,12 +37,12 @@ + #define OMAP3430_VDD_MPU_OPP5_UV 1350000 + + struct omap_volt_data omap34xx_vddmpu_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18), +- VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18), +- VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD1, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD1, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD1, 0xf9, 0x18, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP4_UV, OMAP343X_CONTROL_FUSE_OPP4_VDD1, 0xf9, 0x18, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_MPU_OPP5_UV, OMAP343X_CONTROL_FUSE_OPP5_VDD1, 0xf9, 0x18, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + /* VDD2 */ +@@ -51,10 +52,10 @@ struct omap_volt_data omap34xx_vddmpu_volt_data[] = { + #define OMAP3430_VDD_CORE_OPP3_UV 1150000 + + struct omap_volt_data omap34xx_vddcore_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP1_UV, OMAP343X_CONTROL_FUSE_OPP1_VDD2, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP2_UV, OMAP343X_CONTROL_FUSE_OPP2_VDD2, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3430_VDD_CORE_OPP3_UV, OMAP343X_CONTROL_FUSE_OPP3_VDD2, 0xf9, 0x18, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + /* 36xx */ +@@ -67,11 +68,11 @@ struct omap_volt_data omap34xx_vddcore_volt_data[] = { + #define OMAP3630_VDD_MPU_OPP1G_UV 1375000 + + struct omap_volt_data omap36xx_vddmpu_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16), +- VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23), +- VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD1, 0xf4, 0x0c, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD1, 0xf9, 0x16, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP120_UV, OMAP3630_CONTROL_FUSE_OPP120_VDD1, 0xfa, 0x23, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_MPU_OPP1G_UV, OMAP3630_CONTROL_FUSE_OPP1G_VDD1, 0xfa, 0x27, OMAP_ABB_FAST_OPP), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + /* VDD2 */ +@@ -80,9 +81,9 @@ struct omap_volt_data omap36xx_vddmpu_volt_data[] = { + #define OMAP3630_VDD_CORE_OPP100_UV 1200000 + + struct omap_volt_data omap36xx_vddcore_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP50_UV, OMAP3630_CONTROL_FUSE_OPP50_VDD2, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP3630_VDD_CORE_OPP100_UV, OMAP3630_CONTROL_FUSE_OPP100_VDD2, 0xf9, 0x16, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + /* OPP data */ +diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c +index 2293ba2..efdbf91 100644 +--- a/arch/arm/mach-omap2/opp4xxx_data.c ++++ b/arch/arm/mach-omap2/opp4xxx_data.c +@@ -25,6 +25,7 @@ + #include "control.h" + #include "omap_opp_data.h" + #include "pm.h" ++#include "abb.h" + + /* + * Structures containing OMAP4430 voltage supported and various +@@ -37,11 +38,11 @@ + #define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000 + + struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16), +- VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23), +- VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP100_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP100, 0xf9, 0x16, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPTURBO, 0xfa, 0x23, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPPNITRO_UV, OMAP44XX_CONTROL_FUSE_MPU_OPPNITRO, 0xfa, 0x27, OMAP_ABB_FAST_OPP), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + #define OMAP4430_VDD_IVA_OPP50_UV 1013000 +@@ -49,19 +50,19 @@ struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = { + #define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000 + + struct omap_volt_data omap44xx_vdd_iva_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16), +- VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP100_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP100, 0xf9, 0x16, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPPTURBO_UV, OMAP44XX_CONTROL_FUSE_IVA_OPPTURBO, 0xfa, 0x23, OMAP_ABB_NOMINAL_OPP), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + #define OMAP4430_VDD_CORE_OPP50_UV 1025000 + #define OMAP4430_VDD_CORE_OPP100_UV 1200000 + + struct omap_volt_data omap44xx_vdd_core_volt_data[] = { +- VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c), +- VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16), +- VOLT_DATA_DEFINE(0, 0, 0, 0), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP100_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP100, 0xf9, 0x16, OMAP_ABB_NO_LDO), ++ VOLT_DATA_DEFINE(0, 0, 0, 0, 0), + }; + + +diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h +index b4c6259..2aa6c43 100644 +--- a/arch/arm/mach-omap2/voltage.h ++++ b/arch/arm/mach-omap2/voltage.h +@@ -105,6 +105,7 @@ struct omap_volt_data { + u32 sr_efuse_offs; + u8 sr_errminlimit; + u8 vp_errgain; ++ u32 opp_sel; + }; + + /** +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0006-OMAP3-Voltage-add-ABB-data-to-voltage-domains.patch b/recipes-kernel/linux/linux-3.0/bias/0006-OMAP3-Voltage-add-ABB-data-to-voltage-domains.patch new file mode 100644 index 00000000..4a60d442 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0006-OMAP3-Voltage-add-ABB-data-to-voltage-domains.patch @@ -0,0 +1,83 @@ +From 25458f46e77c4e816d313126a789d69f98f73af4 Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Thu, 21 Jul 2011 12:31:50 +0200 +Subject: [PATCH 6/8] OMAP3+: Voltage: add ABB data to voltage domains + +Starting with OMAP36xx, some voltage domains have an ABB ldo meant to +insure stability when that voltage domain is operating at a high OPP. + +This patch adds struct omap_abb_instance to struct voltagedomain and +populates the data for those voltage domains that have an ABB ldo on +both 36xx and 44xx silicon. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/voltage.h | 1 + + arch/arm/mach-omap2/voltagedomains3xxx_data.c | 3 +++ + arch/arm/mach-omap2/voltagedomains44xx_data.c | 3 +++ + 3 files changed, 7 insertions(+), 0 deletions(-) + +diff --git a/arch/arm/mach-omap2/voltage.h b/arch/arm/mach-omap2/voltage.h +index 2aa6c43..4fe35d7 100644 +--- a/arch/arm/mach-omap2/voltage.h ++++ b/arch/arm/mach-omap2/voltage.h +@@ -69,6 +69,7 @@ struct voltagedomain { + struct omap_vc_channel *vc; + const struct omap_vfsm_instance *vfsm; + struct omap_vp_instance *vp; ++ struct omap_abb_instance *abb; + struct omap_voltdm_pmic *pmic; + + /* VC/VP register access functions: SoC specific */ +diff --git a/arch/arm/mach-omap2/voltagedomains3xxx_data.c b/arch/arm/mach-omap2/voltagedomains3xxx_data.c +index b0d0ae1..cdcfbdf 100644 +--- a/arch/arm/mach-omap2/voltagedomains3xxx_data.c ++++ b/arch/arm/mach-omap2/voltagedomains3xxx_data.c +@@ -26,6 +26,7 @@ + #include "voltage.h" + #include "vc.h" + #include "vp.h" ++#include "abb.h" + + /* + * VDD data +@@ -90,6 +91,8 @@ void __init omap3xxx_voltagedomains_init(void) + if (cpu_is_omap3630()) { + omap3_voltdm_mpu.volt_data = omap36xx_vddmpu_volt_data; + omap3_voltdm_core.volt_data = omap36xx_vddcore_volt_data; ++ ++ omap3_voltdm_mpu.abb = &omap36xx_abb_mpu; + } else { + omap3_voltdm_mpu.volt_data = omap34xx_vddmpu_volt_data; + omap3_voltdm_core.volt_data = omap34xx_vddcore_volt_data; +diff --git a/arch/arm/mach-omap2/voltagedomains44xx_data.c b/arch/arm/mach-omap2/voltagedomains44xx_data.c +index c4584e9..11e2458 100644 +--- a/arch/arm/mach-omap2/voltagedomains44xx_data.c ++++ b/arch/arm/mach-omap2/voltagedomains44xx_data.c +@@ -31,6 +31,7 @@ + #include "omap_opp_data.h" + #include "vc.h" + #include "vp.h" ++#include "abb.h" + + static const struct omap_vfsm_instance omap4_vdd_mpu_vfsm = { + .voltsetup_reg = OMAP4_PRM_VOLTSETUP_MPU_RET_SLEEP_OFFSET, +@@ -53,6 +54,7 @@ static struct voltagedomain omap4_voltdm_mpu = { + .vc = &omap4_vc_mpu, + .vfsm = &omap4_vdd_mpu_vfsm, + .vp = &omap4_vp_mpu, ++ .abb = &omap4_abb_mpu, + }; + + static struct voltagedomain omap4_voltdm_iva = { +@@ -64,6 +66,7 @@ static struct voltagedomain omap4_voltdm_iva = { + .vc = &omap4_vc_iva, + .vfsm = &omap4_vdd_iva_vfsm, + .vp = &omap4_vp_iva, ++ .abb = &omap4_abb_iva, + }; + + static struct voltagedomain omap4_voltdm_core = { +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0007-OMAP3-ABB-initialization-transition-functions.patch b/recipes-kernel/linux/linux-3.0/bias/0007-OMAP3-ABB-initialization-transition-functions.patch new file mode 100644 index 00000000..8e860c9e --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0007-OMAP3-ABB-initialization-transition-functions.patch @@ -0,0 +1,274 @@ +From d9dd20e6220aa04f17ec44f64a0b1545407ae8f9 Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Wed, 29 Jun 2011 17:25:59 -0700 +Subject: [PATCH 7/8] OMAP3+: ABB: initialization & transition functions + +The Adaptive Body-Bias ldo can be set to bypass or Forward Body-Bias +after voltage scaling is performed. + +This patch implements the Adaptive Body-Bias ldo initialization routine +and the transition sequence which is needed after a vc_bypass or +vp_forceupdate sequence completes. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/Makefile | 2 +- + arch/arm/mach-omap2/abb.c | 218 ++++++++++++++++++++++++++++++++++++++++++ + arch/arm/mach-omap2/abb.h | 5 + + 3 files changed, 224 insertions(+), 1 deletions(-) + create mode 100644 arch/arm/mach-omap2/abb.c + +diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile +index 5bc306c..d0dd488 100644 +--- a/arch/arm/mach-omap2/Makefile ++++ b/arch/arm/mach-omap2/Makefile +@@ -94,7 +94,7 @@ obj-$(CONFIG_ARCH_OMAP4) += prcm.o cm2xxx_3xxx.o cminst44xx.o \ + + # OMAP voltage domains + ifeq ($(CONFIG_PM),y) +-voltagedomain-common := voltage.o vc.o vp.o ++voltagedomain-common := voltage.o vc.o vp.o abb.o + obj-$(CONFIG_ARCH_OMAP2) += $(voltagedomain-common) \ + voltagedomains2xxx_data.o + obj-$(CONFIG_ARCH_OMAP3) += $(voltagedomain-common) \ +diff --git a/arch/arm/mach-omap2/abb.c b/arch/arm/mach-omap2/abb.c +new file mode 100644 +index 0000000..4d42b67 +--- /dev/null ++++ b/arch/arm/mach-omap2/abb.c +@@ -0,0 +1,218 @@ ++/* ++ * OMAP Adaptive Body-Bias core ++ * ++ * Copyright (C) 2011 Texas Instruments, Inc. ++ * Mike Turquette ++ * ++ * 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 ++#include ++ ++#include "abb.h" ++#include "voltage.h" ++ ++/* ++ * omap_abb_set_opp - program ABB ldo based on new voltage ++ * ++ * @voltdm - pointer to voltage domain that just finished scaling voltage ++ * ++ * Look up the ABB ldo state for the new voltage that voltdm just finished ++ * transitioning to and compare it to current ldo state. If a change is needed ++ * then clear appropriate PRM_IRQSTATUS bit, transition ldo and then clear ++ * PRM_IRQSTATUS bit again. Returns 0 on success, -EERROR otherwise. ++ */ ++int omap_abb_set_opp(struct voltagedomain *voltdm) ++{ ++ struct omap_abb_instance *abb = voltdm->abb; ++ struct omap_volt_data *volt_data; ++ int ret, timeout; ++ u8 opp_sel; ++ ++ /* fetch the ABB ldo OPP_SEL value for the new voltage */ ++ volt_data = omap_voltage_get_voltdata(voltdm, voltdm->nominal_volt); ++ ++ if (IS_ERR_OR_NULL(volt_data)) ++ return -EINVAL; ++ ++ opp_sel = volt_data->opp_sel; ++ ++ /* bail early if no transition is necessary */ ++ if (opp_sel == abb->_opp_sel) ++ return 0; ++ ++ /* clear interrupt status */ ++ timeout = 0; ++ while (timeout++ < ABB_TRANXDONE_TIMEOUT) { ++ abb->common->ops->clear_tranxdone(abb->prm_irq_id); ++ ++ ret = abb->common->ops->check_tranxdone(abb->prm_irq_id); ++ if (!ret) ++ break; ++ ++ udelay(1); ++ } ++ ++ if (timeout>= ABB_TRANXDONE_TIMEOUT) { ++ pr_warning("%s: vdd_%s ABB TRANXDONE timeout\n", ++ __func__, voltdm->name); ++ return -ETIMEDOUT; ++ } ++ ++ /* program next state of ABB ldo */ ++ voltdm->rmw(abb->common->opp_sel_mask, ++ opp_sel << __ffs(abb->common->opp_sel_mask), ++ abb->ctrl_offs); ++ ++ /* initiate ABB ldo change */ ++ voltdm->rmw(abb->common->opp_change_mask, ++ abb->common->opp_change_mask, ++ abb->ctrl_offs); ++ ++ /* clear interrupt status */ ++ timeout = 0; ++ while (timeout++ < ABB_TRANXDONE_TIMEOUT) { ++ abb->common->ops->clear_tranxdone(abb->prm_irq_id); ++ ++ ret = abb->common->ops->check_tranxdone(abb->prm_irq_id); ++ if (!ret) ++ break; ++ ++ udelay(1); ++ } ++ ++ if (timeout>= ABB_TRANXDONE_TIMEOUT) { ++ pr_warning("%s: vdd_%s ABB TRANXDONE timeout\n", ++ __func__, voltdm->name); ++ return -ETIMEDOUT; ++ } ++ ++ /* track internal state */ ++ abb->_opp_sel = opp_sel; ++ ++ return 0; ++} ++ ++/* ++ * omap_abb_enable - enable ABB ldo on a particular voltage domain ++ * ++ * @voltdm - pointer to particular voltage domain ++ */ ++void omap_abb_enable(struct voltagedomain *voltdm) ++{ ++ struct omap_abb_instance *abb = voltdm->abb; ++ ++ if (abb->enabled) ++ return; ++ ++ abb->enabled = true; ++ ++ voltdm->rmw(abb->common->sr2en_mask, abb->common->sr2en_mask, ++ abb->setup_offs); ++} ++ ++/* ++ * omap_abb_disable - disable ABB ldo on a particular voltage domain ++ * ++ * @voltdm - pointer to particular voltage domain ++ * ++ * Included for completeness. Not currently used but will be needed in the ++ * future if ABB is converted to a loadable module. ++ */ ++void omap_abb_disable(struct voltagedomain *voltdm) ++{ ++ struct omap_abb_instance *abb = voltdm->abb; ++ ++ if (!abb->enabled) ++ return; ++ ++ abb->enabled = false; ++ ++ voltdm->rmw(abb->common->sr2en_mask, ++ (0 << __ffs(abb->common->sr2en_mask)), ++ abb->setup_offs); ++} ++ ++/* ++ * omap_abb_init - Initialize an ABB ldo instance ++ * ++ * @voltdm: voltage domain upon which ABB ldo resides ++ * ++ * Initializes an individual ABB ldo for Forward Body-Bias. FBB is used to ++ * insure stability at higher voltages. Note that some older OMAP chips have a ++ * Reverse Body-Bias mode meant to save power at low voltage, but that mode is ++ * unsupported and phased out on newer chips. ++ */ ++void __init omap_abb_init(struct voltagedomain *voltdm) ++{ ++ struct omap_abb_instance *abb = voltdm->abb; ++ u32 sys_clk_rate; ++ u32 sr2_wt_cnt_val; ++ u32 clock_cycles; ++ u32 settling_time; ++ u32 val; ++ ++ if(IS_ERR_OR_NULL(abb)) ++ return; ++ ++ /* ++ * SR2_WTCNT_VALUE is the settling time for the ABB ldo after a ++ * transition and must be programmed with the correct time at boot. ++ * The value programmed into the register is the number of SYS_CLK ++ * clock cycles that match a given wall time profiled for the ldo. ++ * This value depends on: ++ * settling time of ldo in micro-seconds (varies per OMAP family) ++ * # of clock cycles per SYS_CLK period (varies per OMAP family) ++ * the SYS_CLK frequency in MHz (varies per board) ++ * The formula is: ++ * ++ * ldo settling time (in micro-seconds) ++ * SR2_WTCNT_VALUE = ------------------------------------------ ++ * (# system clock cycles) * (sys_clk period) ++ * ++ * Put another way: ++ * ++ * SR2_WTCNT_VALUE = settling time / (# SYS_CLK cycles / SYS_CLK rate)) ++ * ++ * To avoid dividing by zero multiply both "# clock cycles" and ++ * "settling time" by 10 such that the final result is the one we want. ++ */ ++ ++ /* convert SYS_CLK rate to MHz & prevent divide by zero */ ++ sys_clk_rate = DIV_ROUND_CLOSEST(voltdm->sys_clk.rate, 1000000); ++ clock_cycles = abb->common->clock_cycles * 10; ++ settling_time = abb->common->settling_time * 10; ++ ++ /* calculate cycle rate */ ++ clock_cycles = DIV_ROUND_CLOSEST(clock_cycles, sys_clk_rate); ++ ++ /* calulate SR2_WTCNT_VALUE */ ++ sr2_wt_cnt_val = DIV_ROUND_CLOSEST(settling_time, clock_cycles); ++ ++ voltdm->rmw(abb->common->sr2_wtcnt_value_mask, ++ (sr2_wt_cnt_val << __ffs(abb->common->sr2_wtcnt_value_mask)), ++ abb->setup_offs); ++ ++ /* allow Forward Body-Bias */ ++ voltdm->rmw(abb->common->active_fbb_sel_mask, ++ abb->common->active_fbb_sel_mask, ++ abb->setup_offs); ++ ++ /* did bootloader set OPP_SEL? */ ++ val = voltdm->read(abb->ctrl_offs); ++ val &= abb->common->opp_sel_mask; ++ abb->_opp_sel = val >> __ffs(abb->common->opp_sel_mask); ++ ++ /* enable the ldo if not done by bootloader */ ++ val = voltdm->read(abb->setup_offs); ++ val &= abb->common->sr2en_mask; ++ if (val) ++ abb->enabled = true; ++ else ++ omap_abb_enable(voltdm); ++ ++ return; ++} +diff --git a/arch/arm/mach-omap2/abb.h b/arch/arm/mach-omap2/abb.h +index 74f2044..c06c7d6 100644 +--- a/arch/arm/mach-omap2/abb.h ++++ b/arch/arm/mach-omap2/abb.h +@@ -82,4 +82,9 @@ extern struct omap_abb_instance omap36xx_abb_mpu; + extern struct omap_abb_instance omap4_abb_mpu; + extern struct omap_abb_instance omap4_abb_iva; + ++void omap_abb_init(struct voltagedomain *voltdm); ++void omap_abb_enable(struct voltagedomain *voltdm); ++void omap_abb_disble(struct voltagedomain *voltdm); ++int omap_abb_set_opp(struct voltagedomain *voltdm); ++ + #endif +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/bias/0008-OMAP3-Voltage-add-ABB-to-voltage-scaling.patch b/recipes-kernel/linux/linux-3.0/bias/0008-OMAP3-Voltage-add-ABB-to-voltage-scaling.patch new file mode 100644 index 00000000..e4b8bf26 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/bias/0008-OMAP3-Voltage-add-ABB-to-voltage-scaling.patch @@ -0,0 +1,114 @@ +From 5d8a37a58e5ad0bd385f023453277d9aebd4768a Mon Sep 17 00:00:00 2001 +From: Mike Turquette +Date: Thu, 21 Jul 2011 12:36:37 +0200 +Subject: [PATCH 8/8] OMAP3+: Voltage: add ABB to voltage scaling + +Adaptive Body-Bias ldo state should be transitioned (if necessary) after +a voltage scaling sequence completes via vc_bypass or vp_forceupdate +methods. + +This patch initializes the ABB ldo's as a part of the greater voltage +initialization function and adds the ABB transition routine to both the +vc_bypass and vp_forceupdate sequences. + +Signed-off-by: Mike Turquette +--- + arch/arm/mach-omap2/vc.c | 10 ++++++++-- + arch/arm/mach-omap2/voltage.c | 4 ++++ + arch/arm/mach-omap2/vp.c | 9 +++++++-- + 3 files changed, 19 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/vc.c b/arch/arm/mach-omap2/vc.c +index 16fa912..c5d8550 100644 +--- a/arch/arm/mach-omap2/vc.c ++++ b/arch/arm/mach-omap2/vc.c +@@ -6,6 +6,7 @@ + + #include "voltage.h" + #include "vc.h" ++#include "abb.h" + #include "prm-regbits-34xx.h" + #include "prm-regbits-44xx.h" + #include "prm44xx.h" +@@ -153,7 +154,7 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm, + u32 loop_cnt = 0, retries_cnt = 0; + u32 vc_valid, vc_bypass_val_reg, vc_bypass_value; + u8 target_vsel, current_vsel; +- int ret; ++ int ret = 0; + + ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, ¤t_vsel); + if (ret) +@@ -191,7 +192,12 @@ int omap_vc_bypass_scale(struct voltagedomain *voltdm, + } + + omap_vc_post_scale(voltdm, target_volt, target_vsel, current_vsel); +- return 0; ++ ++ /* transition Adaptive Body-Bias ldo */ ++ if (voltdm->abb) ++ ret = omap_abb_set_opp(voltdm); ++ ++ return ret; + } + + static void __init omap3_vfsm_init(struct voltagedomain *voltdm) +diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c +index cebc8b1..25f8604 100644 +--- a/arch/arm/mach-omap2/voltage.c ++++ b/arch/arm/mach-omap2/voltage.c +@@ -40,6 +40,7 @@ + + #include "vc.h" + #include "vp.h" ++#include "abb.h" + + static LIST_HEAD(voltdm_list); + +@@ -279,6 +280,9 @@ int __init omap_voltage_late_init(void) + voltdm->scale = omap_vp_forceupdate_scale; + omap_vp_init(voltdm); + } ++ ++ if (voltdm->abb) ++ omap_abb_init(voltdm); + } + + return 0; +diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c +index 66bd700..886be89 100644 +--- a/arch/arm/mach-omap2/vp.c ++++ b/arch/arm/mach-omap2/vp.c +@@ -5,6 +5,7 @@ + + #include "voltage.h" + #include "vp.h" ++#include "abb.h" + #include "prm-regbits-34xx.h" + #include "prm-regbits-44xx.h" + #include "prm44xx.h" +@@ -116,7 +117,7 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, + struct omap_vp_instance *vp = voltdm->vp; + u32 vpconfig; + u8 target_vsel, current_vsel; +- int ret, timeout = 0; ++ int ret = 0, timeout = 0; + + ret = omap_vc_pre_scale(voltdm, target_volt, &target_vsel, ¤t_vsel); + if (ret) +@@ -178,7 +179,11 @@ int omap_vp_forceupdate_scale(struct voltagedomain *voltdm, + /* Clear force bit */ + voltdm->write(vpconfig, vp->vpconfig); + +- return 0; ++ /* transition Adaptive Body-Bias LDO */ ++ if (voltdm->abb) ++ ret = omap_abb_set_opp(voltdm); ++ ++ return ret; + } + + /** +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0004-OMAP3-PM-debug-remove-sleep_while_idle-feature.patch b/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0004-OMAP3-PM-debug-remove-sleep_while_idle-feature.patch deleted file mode 100644 index 38d3d477..00000000 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0004-OMAP3-PM-debug-remove-sleep_while_idle-feature.patch +++ /dev/null @@ -1,79 +0,0 @@ -From e38ec7b32ebb15b1e703743ea14ca7a29675a3ba Mon Sep 17 00:00:00 2001 -From: Kevin Hilman -Date: Thu, 26 May 2011 14:48:19 -0700 -Subject: [PATCH 4/7] OMAP3: PM debug: remove sleep_while_idle feature - -Remove the OMAP-specific PM debug 'sleep_while_idle' feature which is -currently available as an OMAP-specific debugfs entry. - -This duplicates existing ARM-generic functionality available as a -boot-time option using the boot cmdline option 'hohlt'. - -If runtime configuration of this is needed, then adding a debugfs -entry for the ARM-generic hlt/nohlt interface should be added. - -Tested-by: Santosh Shilimkar -Acked-by: Santosh Shilimkar -Acked-by: Jean Pihet -Signed-off-by: Kevin Hilman ---- - arch/arm/mach-omap2/pm-debug.c | 3 --- - arch/arm/mach-omap2/pm.h | 2 -- - arch/arm/mach-omap2/pm34xx.c | 2 -- - 3 files changed, 0 insertions(+), 7 deletions(-) - -diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c -index e01da45..d9f0821 100644 ---- a/arch/arm/mach-omap2/pm-debug.c -+++ b/arch/arm/mach-omap2/pm-debug.c -@@ -40,7 +40,6 @@ - - int omap2_pm_debug; - u32 enable_off_mode; --u32 sleep_while_idle; - u32 wakeup_timer_seconds; - u32 wakeup_timer_milliseconds; - -@@ -639,8 +638,6 @@ static int pm_dbg_init(void) - - (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_IWUSR, d, -- &sleep_while_idle, &pm_dbg_option_fops); - (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", -diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h -index 45bcfce..674eedc 100644 ---- a/arch/arm/mach-omap2/pm.h -+++ b/arch/arm/mach-omap2/pm.h -@@ -69,13 +69,11 @@ extern void omap2_pm_dump(int mode, int resume, unsigned int us); - extern void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds); - extern int omap2_pm_debug; - extern u32 enable_off_mode; --extern u32 sleep_while_idle; - #else - #define omap2_pm_dump(mode, resume, us) do {} while (0); - #define omap2_pm_wakeup_on_timer(seconds, milliseconds) do {} while (0); - #define omap2_pm_debug 0 - #define enable_off_mode 0 --#define sleep_while_idle 0 - #endif - - #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) -diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c -index c155c9d..cb34244 100644 ---- a/arch/arm/mach-omap2/pm34xx.c -+++ b/arch/arm/mach-omap2/pm34xx.c -@@ -497,8 +497,6 @@ console_still_active: - - int omap3_can_sleep(void) - { -- if (!sleep_while_idle) -- return 0; - if (!omap_uart_can_sleep()) - return 0; - return 1; --- -1.6.6.1 - diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0005-OMAP2-PM-debug-remove-register-dumping.patch b/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0005-OMAP2-PM-debug-remove-register-dumping.patch deleted file mode 100644 index ea83cd57..00000000 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0005-OMAP2-PM-debug-remove-register-dumping.patch +++ /dev/null @@ -1,215 +0,0 @@ -From 51ea2570669b64adfaee2c4a757122f0376255dd Mon Sep 17 00:00:00 2001 -From: Kevin Hilman -Date: Thu, 26 May 2011 14:07:41 -0700 -Subject: [PATCH 5/7] OMAP2: PM debug: remove register dumping - -Tested-by: Santosh Shilimkar -Acked-by: Santosh Shilimkar -Signed-off-by: Kevin Hilman ---- - arch/arm/mach-omap2/pm-debug.c | 119 ---------------------------------------- - arch/arm/mach-omap2/pm.h | 4 - - arch/arm/mach-omap2/pm24xx.c | 6 +- - 3 files changed, 2 insertions(+), 127 deletions(-) - -diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c -index d9f0821..a8425d6 100644 ---- a/arch/arm/mach-omap2/pm-debug.c -+++ b/arch/arm/mach-omap2/pm-debug.c -@@ -38,129 +38,10 @@ - #include "prm2xxx_3xxx.h" - #include "pm.h" - --int omap2_pm_debug; - u32 enable_off_mode; - u32 wakeup_timer_seconds; - u32 wakeup_timer_milliseconds; - --#define DUMP_PRM_MOD_REG(mod, reg) \ -- regs[reg_count].name = #mod "." #reg; \ -- regs[reg_count++].val = omap2_prm_read_mod_reg(mod, reg) --#define DUMP_CM_MOD_REG(mod, reg) \ -- regs[reg_count].name = #mod "." #reg; \ -- regs[reg_count++].val = omap2_cm_read_mod_reg(mod, reg) --#define DUMP_PRM_REG(reg) \ -- regs[reg_count].name = #reg; \ -- regs[reg_count++].val = __raw_readl(reg) --#define DUMP_CM_REG(reg) \ -- regs[reg_count].name = #reg; \ -- regs[reg_count++].val = __raw_readl(reg) --#define DUMP_INTC_REG(reg, off) \ -- regs[reg_count].name = #reg; \ -- regs[reg_count++].val = \ -- __raw_readl(OMAP2_L4_IO_ADDRESS(0x480fe000 + (off))) -- --void omap2_pm_dump(int mode, int resume, unsigned int us) --{ -- struct reg { -- const char *name; -- u32 val; -- } regs[32]; -- int reg_count = 0, i; -- const char *s1 = NULL, *s2 = NULL; -- -- if (!resume) { --#if 0 -- /* MPU */ -- DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRM_IRQENABLE_MPU_OFFSET); -- DUMP_CM_MOD_REG(MPU_MOD, OMAP2_CM_CLKSTCTRL); -- DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTCTRL); -- DUMP_PRM_MOD_REG(MPU_MOD, OMAP2_PM_PWSTST); -- DUMP_PRM_MOD_REG(MPU_MOD, PM_WKDEP); --#endif --#if 0 -- /* INTC */ -- DUMP_INTC_REG(INTC_MIR0, 0x0084); -- DUMP_INTC_REG(INTC_MIR1, 0x00a4); -- DUMP_INTC_REG(INTC_MIR2, 0x00c4); --#endif --#if 0 -- DUMP_CM_MOD_REG(CORE_MOD, CM_FCLKEN1); -- if (cpu_is_omap24xx()) { -- DUMP_CM_MOD_REG(CORE_MOD, OMAP24XX_CM_FCLKEN2); -- DUMP_PRM_MOD_REG(OMAP24XX_GR_MOD, -- OMAP2_PRCM_CLKEMUL_CTRL_OFFSET); -- DUMP_PRM_MOD_REG(OMAP24XX_GR_MOD, -- OMAP2_PRCM_CLKSRC_CTRL_OFFSET); -- } -- DUMP_CM_MOD_REG(WKUP_MOD, CM_FCLKEN); -- DUMP_CM_MOD_REG(CORE_MOD, CM_ICLKEN1); -- DUMP_CM_MOD_REG(CORE_MOD, CM_ICLKEN2); -- DUMP_CM_MOD_REG(WKUP_MOD, CM_ICLKEN); -- DUMP_CM_MOD_REG(PLL_MOD, CM_CLKEN); -- DUMP_CM_MOD_REG(PLL_MOD, CM_AUTOIDLE); -- DUMP_PRM_MOD_REG(CORE_MOD, OMAP2_PM_PWSTST); --#endif --#if 0 -- /* DSP */ -- if (cpu_is_omap24xx()) { -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_FCLKEN); -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_ICLKEN); -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_IDLEST); -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_AUTOIDLE); -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, CM_CLKSEL); -- DUMP_CM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_CM_CLKSTCTRL); -- DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTCTRL); -- DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_RM_RSTST); -- DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTCTRL); -- DUMP_PRM_MOD_REG(OMAP24XX_DSP_MOD, OMAP2_PM_PWSTST); -- } --#endif -- } else { -- DUMP_PRM_MOD_REG(CORE_MOD, PM_WKST1); -- if (cpu_is_omap24xx()) -- DUMP_PRM_MOD_REG(CORE_MOD, OMAP24XX_PM_WKST2); -- DUMP_PRM_MOD_REG(WKUP_MOD, PM_WKST); -- DUMP_PRM_MOD_REG(OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET); --#if 1 -- DUMP_INTC_REG(INTC_PENDING_IRQ0, 0x0098); -- DUMP_INTC_REG(INTC_PENDING_IRQ1, 0x00b8); -- DUMP_INTC_REG(INTC_PENDING_IRQ2, 0x00d8); --#endif -- } -- -- switch (mode) { -- case 0: -- s1 = "full"; -- s2 = "retention"; -- break; -- case 1: -- s1 = "MPU"; -- s2 = "retention"; -- break; -- case 2: -- s1 = "MPU"; -- s2 = "idle"; -- break; -- } -- -- if (!resume) --#ifdef CONFIG_NO_HZ -- printk(KERN_INFO -- "--- Going to %s %s (next timer after %u ms)\n", s1, s2, -- jiffies_to_msecs(get_next_timer_interrupt(jiffies) - -- jiffies)); --#else -- printk(KERN_INFO "--- Going to %s %s\n", s1, s2); --#endif -- else -- printk(KERN_INFO "--- Woke up (slept for %u.%03u ms)\n", -- us / 1000, us % 1000); -- -- for (i = 0; i < reg_count; i++) -- printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val); --} -- - void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds) - { - u32 tick_rate, cycles; -diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h -index 674eedc..acac275 100644 ---- a/arch/arm/mach-omap2/pm.h -+++ b/arch/arm/mach-omap2/pm.h -@@ -65,14 +65,10 @@ extern u32 wakeup_timer_milliseconds; - extern struct omap_dm_timer *gptimer_wakeup; - - #ifdef CONFIG_PM_DEBUG --extern void omap2_pm_dump(int mode, int resume, unsigned int us); - extern void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds); --extern int omap2_pm_debug; - extern u32 enable_off_mode; - #else --#define omap2_pm_dump(mode, resume, us) do {} while (0); - #define omap2_pm_wakeup_on_timer(seconds, milliseconds) do {} while (0); --#define omap2_pm_debug 0 - #define enable_off_mode 0 - #endif - -diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c -index df3ded6..bf089e7 100644 ---- a/arch/arm/mach-omap2/pm24xx.c -+++ b/arch/arm/mach-omap2/pm24xx.c -@@ -53,6 +53,8 @@ - #include "powerdomain.h" - #include "clockdomain.h" - -+static int omap2_pm_debug; -+ - #ifdef CONFIG_SUSPEND - static suspend_state_t suspend_state = PM_SUSPEND_ON; - static inline bool is_suspending(void) -@@ -123,7 +125,6 @@ static void omap2_enter_full_retention(void) - omap2_gpio_prepare_for_idle(0); - - if (omap2_pm_debug) { -- omap2_pm_dump(0, 0, 0); - getnstimeofday(&ts_preidle); - } - -@@ -160,7 +161,6 @@ no_sleep: - getnstimeofday(&ts_postidle); - ts_idle = timespec_sub(ts_postidle, ts_preidle); - tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC; -- omap2_pm_dump(0, 1, tmp); - } - omap2_gpio_resume_after_idle(); - -@@ -247,7 +247,6 @@ static void omap2_enter_mpu_retention(void) - } - - if (omap2_pm_debug) { -- omap2_pm_dump(only_idle ? 2 : 1, 0, 0); - getnstimeofday(&ts_preidle); - } - -@@ -259,7 +258,6 @@ static void omap2_enter_mpu_retention(void) - getnstimeofday(&ts_postidle); - ts_idle = timespec_sub(ts_postidle, ts_preidle); - tmp = timespec_to_ns(&ts_idle) * NSEC_PER_USEC; -- omap2_pm_dump(only_idle ? 2 : 1, 1, tmp); - } - } - --- -1.6.6.1 - diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0006-OMAP3-PM-debug-remove-register-dumping.patch b/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0006-OMAP3-PM-debug-remove-register-dumping.patch deleted file mode 100644 index bbb41490..00000000 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0006-OMAP3-PM-debug-remove-register-dumping.patch +++ /dev/null @@ -1,313 +0,0 @@ -From 2cb229bc89ac3f0b369ffcfb375bb1469f77d98b Mon Sep 17 00:00:00 2001 -From: Kevin Hilman -Date: Thu, 26 May 2011 15:34:39 -0700 -Subject: [PATCH 6/7] OMAP3: PM debug: remove register dumping - -Remove OMAP3-specific register dumping feature from PM debug layer. -This is removed because: - -- it's ugly -- it's OMAP3-specific, and will obviously not scale to OMAP4+ -- userspace /dev/mem-based tools (like omapconf) can do this much better - -Tested-by: Santosh Shilimkar -Acked-by: Santosh Shilimkar -Acked-by: Jean Pihet -Signed-off-by: Kevin Hilman ---- - arch/arm/mach-omap2/pm-debug.c | 221 ---------------------------------------- - arch/arm/mach-omap2/pm.h | 4 - - 2 files changed, 0 insertions(+), 225 deletions(-) - -diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c -index a8425d6..3d1cce2 100644 ---- a/arch/arm/mach-omap2/pm-debug.c -+++ b/arch/arm/mach-omap2/pm-debug.c -@@ -63,10 +63,6 @@ void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds) - #include - #include - --static void pm_dbg_regset_store(u32 *ptr); -- --static struct dentry *pm_dbg_dir; -- - static int pm_dbg_init_done; - - static int pm_dbg_init(void); -@@ -76,160 +72,6 @@ enum { - DEBUG_FILE_TIMERS, - }; - --struct pm_module_def { -- char name[8]; /* Name of the module */ -- short type; /* CM or PRM */ -- unsigned short offset; -- int low; /* First register address on this module */ -- int high; /* Last register address on this module */ --}; -- --#define MOD_CM 0 --#define MOD_PRM 1 -- --static const struct pm_module_def *pm_dbg_reg_modules; --static const struct pm_module_def omap3_pm_reg_modules[] = { -- { "IVA2", MOD_CM, OMAP3430_IVA2_MOD, 0, 0x4c }, -- { "OCP", MOD_CM, OCP_MOD, 0, 0x10 }, -- { "MPU", MOD_CM, MPU_MOD, 4, 0x4c }, -- { "CORE", MOD_CM, CORE_MOD, 0, 0x4c }, -- { "SGX", MOD_CM, OMAP3430ES2_SGX_MOD, 0, 0x4c }, -- { "WKUP", MOD_CM, WKUP_MOD, 0, 0x40 }, -- { "CCR", MOD_CM, PLL_MOD, 0, 0x70 }, -- { "DSS", MOD_CM, OMAP3430_DSS_MOD, 0, 0x4c }, -- { "CAM", MOD_CM, OMAP3430_CAM_MOD, 0, 0x4c }, -- { "PER", MOD_CM, OMAP3430_PER_MOD, 0, 0x4c }, -- { "EMU", MOD_CM, OMAP3430_EMU_MOD, 0x40, 0x54 }, -- { "NEON", MOD_CM, OMAP3430_NEON_MOD, 0x20, 0x48 }, -- { "USB", MOD_CM, OMAP3430ES2_USBHOST_MOD, 0, 0x4c }, -- -- { "IVA2", MOD_PRM, OMAP3430_IVA2_MOD, 0x50, 0xfc }, -- { "OCP", MOD_PRM, OCP_MOD, 4, 0x1c }, -- { "MPU", MOD_PRM, MPU_MOD, 0x58, 0xe8 }, -- { "CORE", MOD_PRM, CORE_MOD, 0x58, 0xf8 }, -- { "SGX", MOD_PRM, OMAP3430ES2_SGX_MOD, 0x58, 0xe8 }, -- { "WKUP", MOD_PRM, WKUP_MOD, 0xa0, 0xb0 }, -- { "CCR", MOD_PRM, PLL_MOD, 0x40, 0x70 }, -- { "DSS", MOD_PRM, OMAP3430_DSS_MOD, 0x58, 0xe8 }, -- { "CAM", MOD_PRM, OMAP3430_CAM_MOD, 0x58, 0xe8 }, -- { "PER", MOD_PRM, OMAP3430_PER_MOD, 0x58, 0xe8 }, -- { "EMU", MOD_PRM, OMAP3430_EMU_MOD, 0x58, 0xe4 }, -- { "GLBL", MOD_PRM, OMAP3430_GR_MOD, 0x20, 0xe4 }, -- { "NEON", MOD_PRM, OMAP3430_NEON_MOD, 0x58, 0xe8 }, -- { "USB", MOD_PRM, OMAP3430ES2_USBHOST_MOD, 0x58, 0xe8 }, -- { "", 0, 0, 0, 0 }, --}; -- --#define PM_DBG_MAX_REG_SETS 4 -- --static void *pm_dbg_reg_set[PM_DBG_MAX_REG_SETS]; -- --static int pm_dbg_get_regset_size(void) --{ -- static int regset_size; -- -- if (regset_size == 0) { -- int i = 0; -- -- while (pm_dbg_reg_modules[i].name[0] != 0) { -- regset_size += pm_dbg_reg_modules[i].high + -- 4 - pm_dbg_reg_modules[i].low; -- i++; -- } -- } -- return regset_size; --} -- --static int pm_dbg_show_regs(struct seq_file *s, void *unused) --{ -- int i, j; -- unsigned long val; -- int reg_set = (int)s->private; -- u32 *ptr; -- void *store = NULL; -- int regs; -- int linefeed; -- -- if (reg_set == 0) { -- store = kmalloc(pm_dbg_get_regset_size(), GFP_KERNEL); -- ptr = store; -- pm_dbg_regset_store(ptr); -- } else { -- ptr = pm_dbg_reg_set[reg_set - 1]; -- } -- -- i = 0; -- -- while (pm_dbg_reg_modules[i].name[0] != 0) { -- regs = 0; -- linefeed = 0; -- if (pm_dbg_reg_modules[i].type == MOD_CM) -- seq_printf(s, "MOD: CM_%s (%08x)\n", -- pm_dbg_reg_modules[i].name, -- (u32)(OMAP3430_CM_BASE + -- pm_dbg_reg_modules[i].offset)); -- else -- seq_printf(s, "MOD: PRM_%s (%08x)\n", -- pm_dbg_reg_modules[i].name, -- (u32)(OMAP3430_PRM_BASE + -- pm_dbg_reg_modules[i].offset)); -- -- for (j = pm_dbg_reg_modules[i].low; -- j <= pm_dbg_reg_modules[i].high; j += 4) { -- val = *(ptr++); -- if (val != 0) { -- regs++; -- if (linefeed) { -- seq_printf(s, "\n"); -- linefeed = 0; -- } -- seq_printf(s, " %02x => %08lx", j, val); -- if (regs % 4 == 0) -- linefeed = 1; -- } -- } -- seq_printf(s, "\n"); -- i++; -- } -- -- if (store != NULL) -- kfree(store); -- -- return 0; --} -- --static void pm_dbg_regset_store(u32 *ptr) --{ -- int i, j; -- u32 val; -- -- i = 0; -- -- while (pm_dbg_reg_modules[i].name[0] != 0) { -- for (j = pm_dbg_reg_modules[i].low; -- j <= pm_dbg_reg_modules[i].high; j += 4) { -- if (pm_dbg_reg_modules[i].type == MOD_CM) -- val = omap2_cm_read_mod_reg( -- pm_dbg_reg_modules[i].offset, j); -- else -- val = omap2_prm_read_mod_reg( -- pm_dbg_reg_modules[i].offset, j); -- *(ptr++) = val; -- } -- i++; -- } --} -- --int pm_dbg_regset_save(int reg_set) --{ -- if (pm_dbg_reg_set[reg_set-1] == NULL) -- return -EINVAL; -- -- pm_dbg_regset_store(pm_dbg_reg_set[reg_set-1]); -- -- return 0; --} -- - static const char pwrdm_state_names[][PWRDM_MAX_PWRSTS] = { - "OFF", - "RET", -@@ -349,11 +191,6 @@ static int pm_dbg_open(struct inode *inode, struct file *file) - }; - } - --static int pm_dbg_reg_open(struct inode *inode, struct file *file) --{ -- return single_open(file, pm_dbg_show_regs, inode->i_private); --} -- - static const struct file_operations debug_fops = { - .open = pm_dbg_open, - .read = seq_read, -@@ -361,40 +198,6 @@ static const struct file_operations debug_fops = { - .release = single_release, - }; - --static const struct file_operations debug_reg_fops = { -- .open = pm_dbg_reg_open, -- .read = seq_read, -- .llseek = seq_lseek, -- .release = single_release, --}; -- --int pm_dbg_regset_init(int reg_set) --{ -- char name[2]; -- -- if (!pm_dbg_init_done) -- pm_dbg_init(); -- -- if (reg_set < 1 || reg_set > PM_DBG_MAX_REG_SETS || -- pm_dbg_reg_set[reg_set-1] != NULL) -- return -EINVAL; -- -- pm_dbg_reg_set[reg_set-1] = -- kmalloc(pm_dbg_get_regset_size(), GFP_KERNEL); -- -- if (pm_dbg_reg_set[reg_set-1] == NULL) -- return -ENOMEM; -- -- if (pm_dbg_dir != NULL) { -- sprintf(name, "%d", reg_set); -- -- (void) debugfs_create_file(name, S_IRUGO, -- pm_dbg_dir, (void *)reg_set, &debug_reg_fops); -- } -- -- return 0; --} -- - static int pwrdm_suspend_get(void *data, u64 *val) - { - int ret = -EINVAL; -@@ -477,20 +280,11 @@ DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n"); - - static int pm_dbg_init(void) - { -- int i; - struct dentry *d; -- char name[2]; - - if (pm_dbg_init_done) - return 0; - -- if (cpu_is_omap34xx()) -- pm_dbg_reg_modules = omap3_pm_reg_modules; -- else { -- printk(KERN_ERR "%s: only OMAP3 supported\n", __func__); -- return -ENODEV; -- } -- - d = debugfs_create_dir("pm_debug", NULL); - if (IS_ERR(d)) - return PTR_ERR(d); -@@ -502,21 +296,6 @@ static int pm_dbg_init(void) - - pwrdm_for_each(pwrdms_setup, (void *)d); - -- pm_dbg_dir = debugfs_create_dir("registers", d); -- if (IS_ERR(pm_dbg_dir)) -- return PTR_ERR(pm_dbg_dir); -- -- (void) debugfs_create_file("current", S_IRUGO, -- pm_dbg_dir, (void *)0, &debug_reg_fops); -- -- for (i = 0; i < PM_DBG_MAX_REG_SETS; i++) -- if (pm_dbg_reg_set[i] != NULL) { -- sprintf(name, "%d", i+1); -- (void) debugfs_create_file(name, S_IRUGO, -- pm_dbg_dir, (void *)(i+1), &debug_reg_fops); -- -- } -- - (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, - &enable_off_mode, &pm_dbg_option_fops); - (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d, -diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h -index acac275..ea58f5d 100644 ---- a/arch/arm/mach-omap2/pm.h -+++ b/arch/arm/mach-omap2/pm.h -@@ -74,12 +74,8 @@ extern u32 enable_off_mode; - - #if defined(CONFIG_PM_DEBUG) && defined(CONFIG_DEBUG_FS) - extern void pm_dbg_update_time(struct powerdomain *pwrdm, int prev); --extern int pm_dbg_regset_save(int reg_set); --extern int pm_dbg_regset_init(int reg_set); - #else - #define pm_dbg_update_time(pwrdm, prev) do {} while (0); --#define pm_dbg_regset_save(reg_set) do {} while (0); --#define pm_dbg_regset_init(reg_set) do {} while (0); - #endif /* CONFIG_PM_DEBUG */ - - extern void omap24xx_idle_loop_suspend(void); --- -1.6.6.1 - diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0007-OMAP2-PM-fix-section-mismatch-in-pm_dbg_init.patch b/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0007-OMAP2-PM-fix-section-mismatch-in-pm_dbg_init.patch deleted file mode 100644 index 372b349d..00000000 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0007-OMAP2-PM-fix-section-mismatch-in-pm_dbg_init.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 7472bb7b89bfdc6beef83bb6008219158e072975 Mon Sep 17 00:00:00 2001 -From: Sanjeev Premi -Date: Fri, 17 Jun 2011 02:01:00 +0530 -Subject: [PATCH 7/7] OMAP2+: PM: fix section mismatch in pm_dbg_init() - -Fix the section mismatch warning: - - WARNING: vmlinux.o(.text+0x21118): Section mismatch - in reference from the function pm_dbg_init() to the - function .init.text:pwrdms_setup() - The function pm_dbg_init() references - the function __init pwrdms_setup(). - This is often because pm_dbg_init lacks a __init - annotation or the annotation of pwrdms_setup is wrong. - -Signed-off-by: Sanjeev Premi -Signed-off-by: Kevin Hilman ---- - arch/arm/mach-omap2/pm-debug.c | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c -index 3d1cce2..3feb475 100644 ---- a/arch/arm/mach-omap2/pm-debug.c -+++ b/arch/arm/mach-omap2/pm-debug.c -@@ -278,7 +278,7 @@ static int option_set(void *data, u64 val) - - DEFINE_SIMPLE_ATTRIBUTE(pm_dbg_option_fops, option_get, option_set, "%llu\n"); - --static int pm_dbg_init(void) -+static int __init pm_dbg_init(void) - { - struct dentry *d; - --- -1.6.6.1 - diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0001-PM-OPP-introduce-function-to-free-cpufreq-table.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0001-PM-OPP-introduce-function-to-free-cpufreq-table.patch index f92c4abc..2195c588 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0001-PM-OPP-introduce-function-to-free-cpufreq-table.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0001-PM-OPP-introduce-function-to-free-cpufreq-table.patch @@ -1,4 +1,4 @@ -From e029940bc6c0ff4ad3c8e2b4f31d0a3de78eff32 Mon Sep 17 00:00:00 2001 +From e234cd2e8844589e2836aa67b3adefa0fd332081 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Wed, 25 May 2011 00:43:26 -0700 Subject: [PATCH 01/19] PM: OPP: introduce function to free cpufreq table diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0002-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0002-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch index 5201c81b..486cd5c3 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0002-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0002-OMAP-CPUfreq-ensure-driver-initializes-after-cpufreq.patch @@ -1,4 +1,4 @@ -From 895fc8961297666b46b4cd3f8c01010051d2164e Mon Sep 17 00:00:00 2001 +From c305bd58ba4bd21eae34991684b4f27311c8c12f Mon Sep 17 00:00:00 2001 From: Peter 'p2' De Schrijver Date: Wed, 11 Aug 2010 17:02:43 -0700 Subject: [PATCH 02/19] OMAP: CPUfreq: ensure driver initializes after cpufreq framework and governors diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0003-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0003-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch index 5447646a..e011037d 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0003-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0003-OMAP-CPUfreq-ensure-policy-is-fully-initialized.patch @@ -1,4 +1,4 @@ -From 62bd1b0f18ee6c6bad1573c2f06e74b0abc418a3 Mon Sep 17 00:00:00 2001 +From 25d01f098bd134113876b8110b2433cd9a37dcf7 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Wed, 11 Aug 2010 17:05:38 -0700 Subject: [PATCH 03/19] OMAP: CPUfreq: ensure policy is fully initialized diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch index c490a1de..455656e0 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0004-OMAP3-PM-CPUFreq-driver-for-OMAP3.patch @@ -1,4 +1,4 @@ -From afa9b062a33a9d9d2d9077cc519e1375b8338e39 Mon Sep 17 00:00:00 2001 +From f37fcaec1c8e778ea7c697b8e7d3e771460b2c71 Mon Sep 17 00:00:00 2001 From: Rajendra Nayak Date: Mon, 10 Nov 2008 17:00:25 +0530 Subject: [PATCH 04/19] OMAP3 PM: CPUFreq driver for OMAP3 @@ -122,10 +122,10 @@ Signed-off-by: Koen Kooi 3 files changed, 46 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h -index e10ff2b..0a07e50 100644 +index 48ac568..8bad1c6 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h -@@ -141,7 +141,9 @@ extern const struct clksel_rate gpt_sys_rates[]; +@@ -144,7 +144,9 @@ extern const struct clksel_rate gpt_sys_rates[]; extern const struct clksel_rate gfx_l3_rates[]; extern const struct clksel_rate dsp_ick_rates[]; @@ -136,7 +136,7 @@ index e10ff2b..0a07e50 100644 extern void omap2_clk_init_cpufreq_table(struct cpufreq_frequency_table **table); extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table); #else -@@ -149,6 +151,16 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) +@@ -152,6 +154,16 @@ extern void omap2_clk_exit_cpufreq_table(struct cpufreq_frequency_table **table) #define omap2_clk_exit_cpufreq_table 0 #endif diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0005-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0005-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch index 1801c46c..42ccd697 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0005-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0005-OMAP-PM-CPUFREQ-Fix-conditional-compilation.patch @@ -1,4 +1,4 @@ -From c93327d36f0dc4ea6693fcae54c561eb8bafdd1e Mon Sep 17 00:00:00 2001 +From b432446c907e4352babda2d380136ba42a5089d0 Mon Sep 17 00:00:00 2001 From: Silesh C V Date: Wed, 29 Sep 2010 14:52:54 +0530 Subject: [PATCH 05/19] OMAP: PM: CPUFREQ: Fix conditional compilation diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0006-cpufreq-fixup-after-new-OPP-layer-merged.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0006-cpufreq-fixup-after-new-OPP-layer-merged.patch index 9c035fab..634b6734 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0006-cpufreq-fixup-after-new-OPP-layer-merged.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0006-cpufreq-fixup-after-new-OPP-layer-merged.patch @@ -1,4 +1,4 @@ -From b8246b5d5edc98155628ba88510bc7e67baf7acf Mon Sep 17 00:00:00 2001 +From f04b9a76326121cb8e42e486a77a6bf098d87ecc Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Tue, 16 Nov 2010 11:48:41 -0800 Subject: [PATCH 06/19] cpufreq: fixup after new OPP layer merged diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0007-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0007-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch index 3eafe76c..69ac50a0 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0007-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0007-OMAP-cpufreq-Split-OMAP1-and-OMAP2PLUS-CPUfreq-drive.patch @@ -1,4 +1,4 @@ -From 9f9061d3e98aa6db7d5c3feabd5a2d93eb3cb737 Mon Sep 17 00:00:00 2001 +From 0dce78bb4a6d7d65a7c5c34a7d0dd085dccae72f Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 14 Mar 2011 17:08:48 +0530 Subject: [PATCH 07/19] OMAP: cpufreq: Split OMAP1 and OMAP2PLUS CPUfreq drivers. @@ -226,7 +226,7 @@ index 0000000..7c5216e +module_init(omap_cpufreq_init); +module_exit(omap_cpufreq_exit); diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile -index b148077..5024064 100644 +index 8e79ca5..7927dd6 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -56,6 +56,9 @@ obj-$(CONFIG_ARCH_OMAP3) += opp3xxx_data.o diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0008-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0008-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch index b47934f2..a4aad2ef 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0008-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0008-OMAP2PLUS-cpufreq-Add-SMP-support-to-cater-OMAP4430.patch @@ -1,4 +1,4 @@ -From f5dc16c8178d0c0bcad795f8ebc71934c4028472 Mon Sep 17 00:00:00 2001 +From 6f0a749e22140520fa67c46d7cb2c020b8678df4 Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Mon, 14 Mar 2011 17:08:49 +0530 Subject: [PATCH 08/19] OMAP2PLUS: cpufreq: Add SMP support to cater OMAP4430 diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0009-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0009-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch index b7ea956d..bc106b2c 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0009-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0009-OMAP2PLUS-cpufreq-Fix-typo-when-attempting-to-set-mp.patch @@ -1,4 +1,4 @@ -From 07367b4c3afd8e881c4cf50ef35d081c4ac252b8 Mon Sep 17 00:00:00 2001 +From eb0279c52c74abcb0475b70115667a351bcae4e0 Mon Sep 17 00:00:00 2001 From: Jarkko Nikula Date: Thu, 14 Apr 2011 16:21:58 +0300 Subject: [PATCH 09/19] OMAP2PLUS: cpufreq: Fix typo when attempting to set mpu_clk for OMAP4 diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0010-OMAP2-cpufreq-move-clk-name-decision-to-init.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0010-OMAP2-cpufreq-move-clk-name-decision-to-init.patch index fe892e37..cc3f7c01 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0010-OMAP2-cpufreq-move-clk-name-decision-to-init.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0010-OMAP2-cpufreq-move-clk-name-decision-to-init.patch @@ -1,4 +1,4 @@ -From 4d3e024c2f7f0334874bbb2a168b62e91cb2517a Mon Sep 17 00:00:00 2001 +From a81a661b40c6ca792f1cc8de46d529603b93215d Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Wed, 25 May 2011 16:38:46 -0700 Subject: [PATCH 10/19] OMAP2+: cpufreq: move clk name decision to init diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch index 4138e3fe..5b29e510 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0011-OMAP2-cpufreq-deny-initialization-if-no-mpudev.patch @@ -1,4 +1,4 @@ -From 85afa12ad2a6e7a23ddf4b25e78e0ce5b9f18a64 Mon Sep 17 00:00:00 2001 +From 7f50ad4eb8465fd74115f67bbf3c5a1bc884d902 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Wed, 25 May 2011 16:38:47 -0700 Subject: [PATCH 11/19] OMAP2+: cpufreq: deny initialization if no mpudev diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch index b57031a0..679d78b5 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0012-OMAP2-cpufreq-dont-support-freq_table.patch @@ -1,4 +1,4 @@ -From 345f93655f425c87ba01e949dc038e04542d8cd4 Mon Sep 17 00:00:00 2001 +From 229d046050abc04e56ecdc6fd500e37359a70e8c Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 26 May 2011 19:39:17 -0700 Subject: [PATCH 12/19] OMAP2+: cpufreq: dont support !freq_table diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0013-OMAP2-cpufreq-only-supports-OPP-library.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0013-OMAP2-cpufreq-only-supports-OPP-library.patch index 71c4fe64..9702b47a 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0013-OMAP2-cpufreq-only-supports-OPP-library.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0013-OMAP2-cpufreq-only-supports-OPP-library.patch @@ -1,4 +1,4 @@ -From 1e5757cbc79685c6294a178d1bea76a52cffcae9 Mon Sep 17 00:00:00 2001 +From 515c4e841924e69dba0a0af5d5ed0ead23d768e6 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 26 May 2011 19:39:18 -0700 Subject: [PATCH 13/19] OMAP2+: cpufreq: only supports OPP library diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0014-OMAP2-cpufreq-put-clk-if-cpu_init-failed.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0014-OMAP2-cpufreq-put-clk-if-cpu_init-failed.patch index fffbcc90..120a7dd7 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0014-OMAP2-cpufreq-put-clk-if-cpu_init-failed.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0014-OMAP2-cpufreq-put-clk-if-cpu_init-failed.patch @@ -1,4 +1,4 @@ -From bec0338ead64cdd8515ae4c94462ffbfd6ae6418 Mon Sep 17 00:00:00 2001 +From a97cfd4b3ba13e6c165ac67e97476b9b3c3f0df7 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 26 May 2011 19:39:19 -0700 Subject: [PATCH 14/19] OMAP2+: cpufreq: put clk if cpu_init failed diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0015-OMAP2-cpufreq-fix-freq_table-leak.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0015-OMAP2-cpufreq-fix-freq_table-leak.patch index 8257a17d..e331389c 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0015-OMAP2-cpufreq-fix-freq_table-leak.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0015-OMAP2-cpufreq-fix-freq_table-leak.patch @@ -1,4 +1,4 @@ -From 0054f5049a4e65a359eca6fa8c6668fb047c9270 Mon Sep 17 00:00:00 2001 +From 27481c729129c20a2550d8f99831146ca6260622 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Thu, 26 May 2011 19:39:20 -0700 Subject: [PATCH 15/19] OMAP2+: cpufreq: fix freq_table leak diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0016-OMAP2-CPUfreq-Remove-superfluous-check-in-target-for.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0016-OMAP2-CPUfreq-Remove-superfluous-check-in-target-for.patch index 478b7691..5059cf34 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0016-OMAP2-CPUfreq-Remove-superfluous-check-in-target-for.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0016-OMAP2-CPUfreq-Remove-superfluous-check-in-target-for.patch @@ -1,4 +1,4 @@ -From 255f1830ab71e130bbdffd84e61fc7a8c3791120 Mon Sep 17 00:00:00 2001 +From b25da32f52df4e31a535e28397f73b37711b6cfa Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Fri, 3 Jun 2011 17:46:57 +0530 Subject: [PATCH 16/19] OMAP2+: CPUfreq: Remove superfluous check in target() for online CPU's. diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch index 42ca787a..ba0457c3 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0017-OMAP2-cpufreq-notify-even-with-bad-boot-frequency.patch @@ -1,4 +1,4 @@ -From 3bf92d672cb3ee7c1ec39f1f0fcf6e8dbde2ceb9 Mon Sep 17 00:00:00 2001 +From 600d2adf94d6df2fa5e4517b4dfa03c736c45055 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 6 Jun 2011 21:05:29 -0500 Subject: [PATCH 17/19] OMAP2+: cpufreq: notify even with bad boot frequency diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0018-OMAP2-cpufreq-Enable-all-CPUs-in-shared-policy-mask.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0018-OMAP2-cpufreq-Enable-all-CPUs-in-shared-policy-mask.patch index 57cec0f1..29465844 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0018-OMAP2-cpufreq-Enable-all-CPUs-in-shared-policy-mask.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0018-OMAP2-cpufreq-Enable-all-CPUs-in-shared-policy-mask.patch @@ -1,4 +1,4 @@ -From 6e092f78e67d722be6036131df6aa0b8b2fec879 Mon Sep 17 00:00:00 2001 +From 3b3f823cf6049824ad754dc92260212134f01e94 Mon Sep 17 00:00:00 2001 From: Todd Poynor Date: Tue, 7 Jun 2011 13:57:52 -0700 Subject: [PATCH 18/19] OMAP2+: cpufreq: Enable all CPUs in shared policy mask diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0019-OMAP2-CPUfreq-update-lpj-with-reference-value-to-avo.patch b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0019-OMAP2-CPUfreq-update-lpj-with-reference-value-to-avo.patch index b5f69d16..92117025 100644 --- a/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0019-OMAP2-CPUfreq-update-lpj-with-reference-value-to-avo.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/cpufreq/0019-OMAP2-CPUfreq-update-lpj-with-reference-value-to-avo.patch @@ -1,4 +1,4 @@ -From e8fa6ffc7822b7c7e81fafb112f3064f31c5c0e3 Mon Sep 17 00:00:00 2001 +From 27225a42d66fe1650949857d98d8f58c6cf7c26f Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 11 Jul 2011 23:10:04 +0530 Subject: [PATCH 19/19] OMAP2+: CPUfreq: update lpj with reference value to avoid progressive error. diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0001-cleanup-regulator-supply-definitions-in-mach-omap2.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0001-cleanup-regulator-supply-definitions-in-mach-omap2.patch new file mode 100644 index 00000000..d90af235 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0001-cleanup-regulator-supply-definitions-in-mach-omap2.patch @@ -0,0 +1,1083 @@ +From cb5d2a594f46d4020101d562978cf12fcdbabf28 Mon Sep 17 00:00:00 2001 +From: Oleg Drokin +Date: Mon, 6 Jun 2011 18:57:07 +0000 +Subject: [PATCH 001/149] cleanup regulator supply definitions in mach-omap2 + +to use REGULATOR_SUPPLY arrays. + +CC: Mark Brown +CC: Mike Rapoport +CC: Nishant Kamat +CC: Steve Sakoman +CC: Felipe Balbi +CC: Santosh Shilimkar +CC: peter.barada@logicpd.com +Signed-off-by: Oleg Drokin +Acked-by: Felipe Balbi +Signed-off-by: Tony Lindgren +--- + arch/arm/mach-omap2/board-4430sdp.c | 13 ++---- + arch/arm/mach-omap2/board-cm-t35.c | 34 +++++++------- + arch/arm/mach-omap2/board-devkit8000.c | 28 ++++++----- + arch/arm/mach-omap2/board-igep0020.c | 27 ++++++----- + arch/arm/mach-omap2/board-ldp.c | 8 ++-- + arch/arm/mach-omap2/board-omap3beagle.c | 25 +++++----- + arch/arm/mach-omap2/board-omap3evm.c | 41 +++++++++-------- + arch/arm/mach-omap2/board-omap3logic.c | 8 ++-- + arch/arm/mach-omap2/board-omap3pandora.c | 63 ++++++++++++++----------- + arch/arm/mach-omap2/board-omap3stalker.c | 25 +++++----- + arch/arm/mach-omap2/board-omap3touchbook.c | 32 +++++++------ + arch/arm/mach-omap2/board-omap4panda.c | 16 +++---- + arch/arm/mach-omap2/board-overo.c | 26 ++++++----- + arch/arm/mach-omap2/board-rx51-peripherals.c | 29 +++++++----- + arch/arm/mach-omap2/board-zoom-peripherals.c | 42 +++++++++--------- + 15 files changed, 218 insertions(+), 199 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c +index 63de2d3..39a8062 100644 +--- a/arch/arm/mach-omap2/board-4430sdp.c ++++ b/arch/arm/mach-omap2/board-4430sdp.c +@@ -333,16 +333,11 @@ static struct omap2_hsmmc_info mmc[] = { + }; + + static struct regulator_consumer_supply sdp4430_vaux_supply[] = { +- { +- .supply = "vmmc", +- .dev_name = "omap_hsmmc.1", +- }, ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), + }; ++ + static struct regulator_consumer_supply sdp4430_vmmc_supply[] = { +- { +- .supply = "vmmc", +- .dev_name = "omap_hsmmc.0", +- }, ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + + static int omap4_twl6030_hsmmc_late_init(struct device *dev) +@@ -399,7 +394,7 @@ static struct regulator_init_data sdp4430_vaux1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, ++ .num_consumer_supplies = ARRAY_SIZE(sdp4430_vaux_supply), + .consumer_supplies = sdp4430_vaux_supply, + }; + +diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c +index 77456de..e7bf32d 100644 +--- a/arch/arm/mach-omap2/board-cm-t35.c ++++ b/arch/arm/mach-omap2/board-cm-t35.c +@@ -337,19 +337,21 @@ static void __init cm_t35_init_display(void) + } + } + +-static struct regulator_consumer_supply cm_t35_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply cm_t35_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply cm_t35_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply cm_t35_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply cm_t35_vdac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply cm_t35_vdac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + +-static struct regulator_consumer_supply cm_t35_vdvi_supply = +- REGULATOR_SUPPLY("vdvi", "omapdss"); ++static struct regulator_consumer_supply cm_t35_vdvi_supply[] = { ++ REGULATOR_SUPPLY("vdvi", "omapdss"), ++}; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ + static struct regulator_init_data cm_t35_vmmc1 = { +@@ -362,8 +364,8 @@ static struct regulator_init_data cm_t35_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &cm_t35_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(cm_t35_vmmc1_supply), ++ .consumer_supplies = cm_t35_vmmc1_supply, + }; + + /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +@@ -377,8 +379,8 @@ static struct regulator_init_data cm_t35_vsim = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &cm_t35_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(cm_t35_vsim_supply), ++ .consumer_supplies = cm_t35_vsim_supply, + }; + + /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +@@ -391,8 +393,8 @@ static struct regulator_init_data cm_t35_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &cm_t35_vdac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdac_supply), ++ .consumer_supplies = cm_t35_vdac_supply, + }; + + /* VPLL2 for digital video outputs */ +@@ -406,8 +408,8 @@ static struct regulator_init_data cm_t35_vpll2 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &cm_t35_vdvi_supply, ++ .num_consumer_supplies = ARRAY_SIZE(cm_t35_vdvi_supply), ++ .consumer_supplies = cm_t35_vdvi_supply, + }; + + static struct twl4030_usb_data cm_t35_usb_data = { +diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c +index 34956ec..ead9c1d 100644 +--- a/arch/arm/mach-omap2/board-devkit8000.c ++++ b/arch/arm/mach-omap2/board-devkit8000.c +@@ -130,13 +130,14 @@ static void devkit8000_panel_disable_dvi(struct omap_dss_device *dssdev) + gpio_set_value_cansleep(dssdev->reset_gpio, 0); + } + +-static struct regulator_consumer_supply devkit8000_vmmc1_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); +- ++static struct regulator_consumer_supply devkit8000_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), ++}; + + /* ads7846 on SPI */ +-static struct regulator_consumer_supply devkit8000_vio_supply = +- REGULATOR_SUPPLY("vcc", "spi2.0"); ++static struct regulator_consumer_supply devkit8000_vio_supply[] = { ++ REGULATOR_SUPPLY("vcc", "spi2.0"), ++}; + + static struct panel_generic_dpi_data lcd_panel = { + .name = "generic", +@@ -186,8 +187,9 @@ static struct omap_dss_board_info devkit8000_dss_data = { + .default_device = &devkit8000_lcd_device, + }; + +-static struct regulator_consumer_supply devkit8000_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply devkit8000_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + static uint32_t board_keymap[] = { + KEY(0, 0, KEY_1), +@@ -284,8 +286,8 @@ static struct regulator_init_data devkit8000_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &devkit8000_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(devkit8000_vmmc1_supply), ++ .consumer_supplies = devkit8000_vmmc1_supply, + }; + + /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +@@ -298,8 +300,8 @@ static struct regulator_init_data devkit8000_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &devkit8000_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(devkit8000_vdda_dac_supply), ++ .consumer_supplies = devkit8000_vdda_dac_supply, + }; + + /* VPLL1 for digital video outputs */ +@@ -327,8 +329,8 @@ static struct regulator_init_data devkit8000_vio = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &devkit8000_vio_supply, ++ .num_consumer_supplies = ARRAY_SIZE(devkit8000_vio_supply), ++ .consumer_supplies = devkit8000_vio_supply, + }; + + static struct twl4030_usb_data devkit8000_usb_data = { +diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c +index 0c1bfca..84d2846 100644 +--- a/arch/arm/mach-omap2/board-igep0020.c ++++ b/arch/arm/mach-omap2/board-igep0020.c +@@ -222,8 +222,9 @@ static inline void __init igep2_init_smsc911x(void) + static inline void __init igep2_init_smsc911x(void) { } + #endif + +-static struct regulator_consumer_supply igep_vmmc1_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); ++static struct regulator_consumer_supply igep_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), ++}; + + /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ + static struct regulator_init_data igep_vmmc1 = { +@@ -236,12 +237,13 @@ static struct regulator_init_data igep_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &igep_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(igep_vmmc1_supply), ++ .consumer_supplies = igep_vmmc1_supply, + }; + +-static struct regulator_consumer_supply igep_vio_supply = +- REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); ++static struct regulator_consumer_supply igep_vio_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"), ++}; + + static struct regulator_init_data igep_vio = { + .constraints = { +@@ -254,20 +256,21 @@ static struct regulator_init_data igep_vio = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &igep_vio_supply, ++ .num_consumer_supplies = ARRAY_SIZE(igep_vio_supply), ++ .consumer_supplies = igep_vio_supply, + }; + +-static struct regulator_consumer_supply igep_vmmc2_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++static struct regulator_consumer_supply igep_vmmc2_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), ++}; + + static struct regulator_init_data igep_vmmc2 = { + .constraints = { + .valid_modes_mask = REGULATOR_MODE_NORMAL, + .always_on = 1, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &igep_vmmc2_supply, ++ .num_consumer_supplies = ARRAY_SIZE(igep_vmmc2_supply), ++ .consumer_supplies = igep_vmmc2_supply, + }; + + static struct fixed_voltage_config igep_vwlan = { +diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c +index f7d6038..069bc9f 100644 +--- a/arch/arm/mach-omap2/board-ldp.c ++++ b/arch/arm/mach-omap2/board-ldp.c +@@ -213,8 +213,8 @@ static struct twl4030_madc_platform_data ldp_madc_data = { + .irq_line = 1, + }; + +-static struct regulator_consumer_supply ldp_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply ldp_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +@@ -228,8 +228,8 @@ static struct regulator_init_data ldp_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &ldp_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(ldp_vmmc1_supply), ++ .consumer_supplies = ldp_vmmc1_supply, + }; + + /* ads7846 on SPI */ +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 7f21d24..4cf7c19 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -210,8 +210,9 @@ static struct omap_dss_board_info beagle_dss_data = { + .default_device = &beagle_dvi_device, + }; + +-static struct regulator_consumer_supply beagle_vdac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply beagle_vdac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + static struct regulator_consumer_supply beagle_vdvi_supplies[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss"), +@@ -239,12 +240,12 @@ static struct omap2_hsmmc_info mmc[] = { + {} /* Terminator */ + }; + +-static struct regulator_consumer_supply beagle_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply beagle_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply beagle_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply beagle_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + + static struct gpio_led gpio_leds[]; +@@ -336,8 +337,8 @@ static struct regulator_init_data beagle_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &beagle_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_vmmc1_supply), ++ .consumer_supplies = beagle_vmmc1_supply, + }; + + /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +@@ -351,8 +352,8 @@ static struct regulator_init_data beagle_vsim = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &beagle_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_vsim_supply), ++ .consumer_supplies = beagle_vsim_supply, + }; + + /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +@@ -365,8 +366,8 @@ static struct regulator_init_data beagle_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &beagle_vdac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(beagle_vdac_supply), ++ .consumer_supplies = beagle_vdac_supply, + }; + + /* VPLL2 for digital video outputs */ +diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c +index b4d4346..fc7a23a 100644 +--- a/arch/arm/mach-omap2/board-omap3evm.c ++++ b/arch/arm/mach-omap2/board-omap3evm.c +@@ -273,12 +273,12 @@ static struct omap_dss_board_info omap3_evm_dss_data = { + .default_device = &omap3_evm_lcd_device, + }; + +-static struct regulator_consumer_supply omap3evm_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply omap3evm_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply omap3evm_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply omap3evm_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +@@ -292,8 +292,8 @@ static struct regulator_init_data omap3evm_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3evm_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3evm_vmmc1_supply), ++ .consumer_supplies = omap3evm_vmmc1_supply, + }; + + /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +@@ -307,8 +307,8 @@ static struct regulator_init_data omap3evm_vsim = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3evm_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3evm_vsim_supply), ++ .consumer_supplies = omap3evm_vsim_supply, + }; + + static struct omap2_hsmmc_info mmc[] = { +@@ -449,8 +449,9 @@ static struct twl4030_codec_data omap3evm_codec_data = { + .audio = &omap3evm_audio_data, + }; + +-static struct regulator_consumer_supply omap3_evm_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply omap3_evm_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + /* VDAC for DSS driving S-Video */ + static struct regulator_init_data omap3_evm_vdac = { +@@ -463,8 +464,8 @@ static struct regulator_init_data omap3_evm_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3_evm_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3_evm_vdda_dac_supply), ++ .consumer_supplies = omap3_evm_vdda_dac_supply, + }; + + /* VPLL2 for digital video outputs */ +@@ -488,8 +489,9 @@ static struct regulator_init_data omap3_evm_vpll2 = { + }; + + /* ads7846 on SPI */ +-static struct regulator_consumer_supply omap3evm_vio_supply = +- REGULATOR_SUPPLY("vcc", "spi1.0"); ++static struct regulator_consumer_supply omap3evm_vio_supply[] = { ++ REGULATOR_SUPPLY("vcc", "spi1.0"), ++}; + + /* VIO for ads7846 */ + static struct regulator_init_data omap3evm_vio = { +@@ -502,8 +504,8 @@ static struct regulator_init_data omap3evm_vio = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3evm_vio_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3evm_vio_supply), ++ .consumer_supplies = omap3evm_vio_supply, + }; + + #ifdef CONFIG_WL12XX_PLATFORM_DATA +@@ -511,16 +513,17 @@ static struct regulator_init_data omap3evm_vio = { + #define OMAP3EVM_WLAN_PMENA_GPIO (150) + #define OMAP3EVM_WLAN_IRQ_GPIO (149) + +-static struct regulator_consumer_supply omap3evm_vmmc2_supply = ++static struct regulator_consumer_supply omap3evm_vmmc2_supply[] = { + REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++}; + + /* VMMC2 for driving the WL12xx module */ + static struct regulator_init_data omap3evm_vmmc2 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3evm_vmmc2_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3evm_vmmc2_supply);, ++ .consumer_supplies = omap3evm_vmmc2_supply, + }; + + static struct fixed_voltage_config omap3evm_vwlan = { +diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c +index 60d9be4..ec18435 100644 +--- a/arch/arm/mach-omap2/board-omap3logic.c ++++ b/arch/arm/mach-omap2/board-omap3logic.c +@@ -55,8 +55,8 @@ + #define OMAP3_TORPEDO_MMC_GPIO_CD 127 + #define OMAP3_TORPEDO_SMSC911X_GPIO_IRQ 129 + +-static struct regulator_consumer_supply omap3logic_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply omap3logic_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +@@ -71,8 +71,8 @@ static struct regulator_init_data omap3logic_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3logic_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3logic_vmmc1_supply), ++ .consumer_supplies = omap3logic_vmmc1_supply, + }; + + static struct twl4030_gpio_platform_data omap3logic_gpio_data = { +diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c +index 23f71d4..130a278 100644 +--- a/arch/arm/mach-omap2/board-omap3pandora.c ++++ b/arch/arm/mach-omap2/board-omap3pandora.c +@@ -320,17 +320,21 @@ static struct twl4030_gpio_platform_data omap3pandora_gpio_data = { + .setup = omap3pandora_twl_gpio_setup, + }; + +-static struct regulator_consumer_supply pandora_vmmc1_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); ++static struct regulator_consumer_supply pandora_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), ++}; + +-static struct regulator_consumer_supply pandora_vmmc2_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++static struct regulator_consumer_supply pandora_vmmc2_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1") ++}; + +-static struct regulator_consumer_supply pandora_vmmc3_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"); ++static struct regulator_consumer_supply pandora_vmmc3_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), ++}; + +-static struct regulator_consumer_supply pandora_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply pandora_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + static struct regulator_consumer_supply pandora_vdds_supplies[] = { + REGULATOR_SUPPLY("vdds_sdi", "omapdss"), +@@ -338,11 +342,13 @@ static struct regulator_consumer_supply pandora_vdds_supplies[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), + }; + +-static struct regulator_consumer_supply pandora_vcc_lcd_supply = +- REGULATOR_SUPPLY("vcc", "display0"); ++static struct regulator_consumer_supply pandora_vcc_lcd_supply[] = { ++ REGULATOR_SUPPLY("vcc", "display0"), ++}; + +-static struct regulator_consumer_supply pandora_usb_phy_supply = +- REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"); ++static struct regulator_consumer_supply pandora_usb_phy_supply[] = { ++ REGULATOR_SUPPLY("hsusb0", "ehci-omap.0"), ++}; + + /* ads7846 on SPI and 2 nub controllers on I2C */ + static struct regulator_consumer_supply pandora_vaux4_supplies[] = { +@@ -351,8 +357,9 @@ static struct regulator_consumer_supply pandora_vaux4_supplies[] = { + REGULATOR_SUPPLY("vcc", "3-0067"), + }; + +-static struct regulator_consumer_supply pandora_adac_supply = +- REGULATOR_SUPPLY("vcc", "soc-audio"); ++static struct regulator_consumer_supply pandora_adac_supply[] = { ++ REGULATOR_SUPPLY("vcc", "soc-audio"), ++}; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ + static struct regulator_init_data pandora_vmmc1 = { +@@ -365,8 +372,8 @@ static struct regulator_init_data pandora_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc1_supply), ++ .consumer_supplies = pandora_vmmc1_supply, + }; + + /* VMMC2 for MMC2 pins CMD, CLK, DAT0..DAT3 (max 100 mA) */ +@@ -380,8 +387,8 @@ static struct regulator_init_data pandora_vmmc2 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_vmmc2_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc2_supply), ++ .consumer_supplies = pandora_vmmc2_supply, + }; + + /* VDAC for DSS driving S-Video */ +@@ -395,8 +402,8 @@ static struct regulator_init_data pandora_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_vdda_dac_supply), ++ .consumer_supplies = pandora_vdda_dac_supply, + }; + + /* VPLL2 for digital video outputs */ +@@ -425,8 +432,8 @@ static struct regulator_init_data pandora_vaux1 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_vcc_lcd_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_vcc_lcd_supply), ++ .consumer_supplies = pandora_vcc_lcd_supply, + }; + + /* VAUX2 for USB host PHY */ +@@ -440,8 +447,8 @@ static struct regulator_init_data pandora_vaux2 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_usb_phy_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_usb_phy_supply), ++ .consumer_supplies = pandora_usb_phy_supply, + }; + + /* VAUX4 for ads7846 and nubs */ +@@ -470,8 +477,8 @@ static struct regulator_init_data pandora_vsim = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_adac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_adac_supply), ++ .consumer_supplies = pandora_adac_supply, + }; + + /* Fixed regulator internal to Wifi module */ +@@ -479,8 +486,8 @@ static struct regulator_init_data pandora_vmmc3 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &pandora_vmmc3_supply, ++ .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc3_supply), ++ .consumer_supplies = pandora_vmmc3_supply, + }; + + static struct fixed_voltage_config pandora_vwlan = { +diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c +index 0c108a2..99be540 100644 +--- a/arch/arm/mach-omap2/board-omap3stalker.c ++++ b/arch/arm/mach-omap2/board-omap3stalker.c +@@ -206,12 +206,12 @@ static struct omap_dss_board_info omap3_stalker_dss_data = { + .default_device = &omap3_stalker_dvi_device, + }; + +-static struct regulator_consumer_supply omap3stalker_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply omap3stalker_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply omap3stalker_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply omap3stalker_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +@@ -224,8 +224,8 @@ static struct regulator_init_data omap3stalker_vmmc1 = { + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3stalker_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3stalker_vmmc1_supply), ++ .consumer_supplies = omap3stalker_vmmc1_supply, + }; + + /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +@@ -238,8 +238,8 @@ static struct regulator_init_data omap3stalker_vsim = { + .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE + | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3stalker_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3stalker_vsim_supply), ++ .consumer_supplies = omap3stalker_vsim_supply, + }; + + static struct omap2_hsmmc_info mmc[] = { +@@ -403,8 +403,9 @@ static struct twl4030_codec_data omap3stalker_codec_data = { + .audio = &omap3stalker_audio_data, + }; + +-static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply omap3_stalker_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + /* VDAC for DSS driving S-Video */ + static struct regulator_init_data omap3_stalker_vdac = { +@@ -417,8 +418,8 @@ static struct regulator_init_data omap3_stalker_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap3_stalker_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap3_stalker_vdda_dac_supply), ++ .consumer_supplies = omap3_stalker_vdda_dac_supply, + }; + + /* VPLL2 for digital video outputs */ +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index 5f649fa..ab5c37d 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -114,12 +114,12 @@ static struct omap_lcd_config omap3_touchbook_lcd_config __initdata = { + .ctrl_name = "internal", + }; + +-static struct regulator_consumer_supply touchbook_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply touchbook_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply touchbook_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply touchbook_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + + static struct gpio_led gpio_leds[]; +@@ -167,14 +167,18 @@ static struct twl4030_gpio_platform_data touchbook_gpio_data = { + .setup = touchbook_twl_gpio_setup, + }; + +-static struct regulator_consumer_supply touchbook_vdac_supply = { ++static struct regulator_consumer_supply touchbook_vdac_supply[] = { ++{ + .supply = "vdac", + .dev = &omap3_touchbook_lcd_device.dev, ++}, + }; + +-static struct regulator_consumer_supply touchbook_vdvi_supply = { ++static struct regulator_consumer_supply touchbook_vdvi_supply[] = { ++{ + .supply = "vdvi", + .dev = &omap3_touchbook_lcd_device.dev, ++}, + }; + + /* VMMC1 for MMC1 pins CMD, CLK, DAT0..DAT3 (20 mA, plus card == max 220 mA) */ +@@ -188,8 +192,8 @@ static struct regulator_init_data touchbook_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &touchbook_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(touchbook_vmmc1_supply), ++ .consumer_supplies = touchbook_vmmc1_supply, + }; + + /* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */ +@@ -203,8 +207,8 @@ static struct regulator_init_data touchbook_vsim = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &touchbook_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(touchbook_vsim_supply), ++ .consumer_supplies = touchbook_vsim_supply, + }; + + /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +@@ -217,8 +221,8 @@ static struct regulator_init_data touchbook_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &touchbook_vdac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(touchbook_vdac_supply), ++ .consumer_supplies = touchbook_vdac_supply, + }; + + /* VPLL2 for digital video outputs */ +@@ -232,8 +236,8 @@ static struct regulator_init_data touchbook_vpll2 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &touchbook_vdvi_supply, ++ .num_consumer_supplies = ARRAY_SIZE(touchbook_vdvi_supply), ++ .consumer_supplies = touchbook_vdvi_supply, + }; + + static struct twl4030_usb_data touchbook_usb_data = { +diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c +index 0cfe200..6d2372b 100644 +--- a/arch/arm/mach-omap2/board-omap4panda.c ++++ b/arch/arm/mach-omap2/board-omap4panda.c +@@ -183,23 +183,19 @@ static struct omap2_hsmmc_info mmc[] = { + }; + + static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = { +- { +- .supply = "vmmc", +- .dev_name = "omap_hsmmc.0", +- }, ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply omap4_panda_vmmc5_supply = { +- .supply = "vmmc", +- .dev_name = "omap_hsmmc.4", ++static struct regulator_consumer_supply omap4_panda_vmmc5_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.4"), + }; + + static struct regulator_init_data panda_vmmc5 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &omap4_panda_vmmc5_supply, ++ .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc5_supply), ++ .consumer_supplies = omap4_panda_vmmc5_supply, + }; + + static struct fixed_voltage_config panda_vwlan = { +@@ -312,7 +308,7 @@ static struct regulator_init_data omap4_panda_vmmc = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, ++ .num_consumer_supplies = ARRAY_SIZE(omap4_panda_vmmc_supply), + .consumer_supplies = omap4_panda_vmmc_supply, + }; + +diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c +index 175e1ab..30c7556 100644 +--- a/arch/arm/mach-omap2/board-overo.c ++++ b/arch/arm/mach-omap2/board-overo.c +@@ -74,15 +74,16 @@ + defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE) + + /* fixed regulator for ads7846 */ +-static struct regulator_consumer_supply ads7846_supply = +- REGULATOR_SUPPLY("vcc", "spi1.0"); ++static struct regulator_consumer_supply ads7846_supply[] = { ++ REGULATOR_SUPPLY("vcc", "spi1.0"), ++}; + + static struct regulator_init_data vads7846_regulator = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &ads7846_supply, ++ .num_consumer_supplies = ARRAY_SIZE(ads7846_supply), ++ .consumer_supplies = ads7846_supply, + }; + + static struct fixed_voltage_config vads7846 = { +@@ -264,8 +265,9 @@ static struct omap_dss_board_info overo_dss_data = { + .default_device = &overo_dvi_device, + }; + +-static struct regulator_consumer_supply overo_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply overo_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + static struct regulator_consumer_supply overo_vdds_dsi_supply[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss"), +@@ -319,8 +321,8 @@ static struct omap2_hsmmc_info mmc[] = { + {} /* Terminator */ + }; + +-static struct regulator_consumer_supply overo_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply overo_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + + #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) +@@ -447,8 +449,8 @@ static struct regulator_init_data overo_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &overo_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(overo_vmmc1_supply), ++ .consumer_supplies = overo_vmmc1_supply, + }; + + /* VDAC for DSS driving S-Video (8 mA unloaded, max 65 mA) */ +@@ -461,8 +463,8 @@ static struct regulator_init_data overo_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &overo_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(overo_vdda_dac_supply), ++ .consumer_supplies = overo_vdda_dac_supply, + }; + + /* VPLL2 for digital video outputs */ +diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c +index 88bd6f7..7810b1e 100644 +--- a/arch/arm/mach-omap2/board-rx51-peripherals.c ++++ b/arch/arm/mach-omap2/board-rx51-peripherals.c +@@ -358,14 +358,17 @@ static struct omap2_hsmmc_info mmc[] __initdata = { + {} /* Terminator */ + }; + +-static struct regulator_consumer_supply rx51_vmmc1_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); ++static struct regulator_consumer_supply rx51_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), ++}; + +-static struct regulator_consumer_supply rx51_vaux3_supply = +- REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); ++static struct regulator_consumer_supply rx51_vaux3_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), ++}; + +-static struct regulator_consumer_supply rx51_vsim_supply = +- REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); ++static struct regulator_consumer_supply rx51_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"), ++}; + + static struct regulator_consumer_supply rx51_vmmc2_supplies[] = { + /* tlv320aic3x analog supplies */ +@@ -452,8 +455,8 @@ static struct regulator_init_data rx51_vaux3_mmc = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &rx51_vaux3_supply, ++ .num_consumer_supplies = ARRAY_SIZE(rx51_vaux3_supply), ++ .consumer_supplies = rx51_vaux3_supply, + }; + + static struct regulator_init_data rx51_vaux4 = { +@@ -479,8 +482,8 @@ static struct regulator_init_data rx51_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &rx51_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(rx51_vmmc1_supply), ++ .consumer_supplies = rx51_vmmc1_supply, + }; + + static struct regulator_init_data rx51_vmmc2 = { +@@ -511,8 +514,8 @@ static struct regulator_init_data rx51_vsim = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &rx51_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(rx51_vsim_supply), ++ .consumer_supplies = rx51_vsim_supply, + }; + + static struct regulator_init_data rx51_vdac = { +@@ -526,7 +529,7 @@ static struct regulator_init_data rx51_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, ++ .num_consumer_supplies = ARRAY_SIZE(rx51_vdac_supply), + .consumer_supplies = rx51_vdac_supply, + }; + +diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c +index 118c6f5..cb012e1 100644 +--- a/arch/arm/mach-omap2/board-zoom-peripherals.c ++++ b/arch/arm/mach-omap2/board-zoom-peripherals.c +@@ -105,21 +105,20 @@ static struct twl4030_keypad_data zoom_kp_twl4030_data = { + .rep = 1, + }; + +-static struct regulator_consumer_supply zoom_vmmc1_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply zoom_vmmc1_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply zoom_vsim_supply = { +- .supply = "vmmc_aux", ++static struct regulator_consumer_supply zoom_vsim_supply[] = { ++ REGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.0"), + }; + +-static struct regulator_consumer_supply zoom_vmmc2_supply = { +- .supply = "vmmc", ++static struct regulator_consumer_supply zoom_vmmc2_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"), + }; + +-static struct regulator_consumer_supply zoom_vmmc3_supply = { +- .supply = "vmmc", +- .dev_name = "omap_hsmmc.2", ++static struct regulator_consumer_supply zoom_vmmc3_supply[] = { ++ REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"), + }; + + /* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ +@@ -133,8 +132,8 @@ static struct regulator_init_data zoom_vmmc1 = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &zoom_vmmc1_supply, ++ .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc1_supply), ++ .consumer_supplies = zoom_vmmc1_supply, + }; + + /* VMMC2 for MMC2 card */ +@@ -148,8 +147,8 @@ static struct regulator_init_data zoom_vmmc2 = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &zoom_vmmc2_supply, ++ .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc2_supply), ++ .consumer_supplies = zoom_vmmc2_supply, + }; + + /* VSIM for OMAP VDD_MMC1A (i/o for DAT4..DAT7) */ +@@ -163,16 +162,16 @@ static struct regulator_init_data zoom_vsim = { + | REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &zoom_vsim_supply, ++ .num_consumer_supplies = ARRAY_SIZE(zoom_vsim_supply), ++ .consumer_supplies = zoom_vsim_supply, + }; + + static struct regulator_init_data zoom_vmmc3 = { + .constraints = { + .valid_ops_mask = REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &zoom_vmmc3_supply, ++ .num_consumer_supplies = ARRAY_SIZE(zoom_vmmc3_supply), ++ .consumer_supplies = zoom_vmmc3_supply, + }; + + static struct fixed_voltage_config zoom_vwlan = { +@@ -232,8 +231,9 @@ static struct regulator_consumer_supply zoom_vpll2_supplies[] = { + REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi1"), + }; + +-static struct regulator_consumer_supply zoom_vdda_dac_supply = +- REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"); ++static struct regulator_consumer_supply zoom_vdda_dac_supply[] = { ++ REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"), ++}; + + static struct regulator_init_data zoom_vpll2 = { + .constraints = { +@@ -257,8 +257,8 @@ static struct regulator_init_data zoom_vdac = { + .valid_ops_mask = REGULATOR_CHANGE_MODE + | REGULATOR_CHANGE_STATUS, + }, +- .num_consumer_supplies = 1, +- .consumer_supplies = &zoom_vdda_dac_supply, ++ .num_consumer_supplies = ARRAY_SIZE(zoom_vdda_dac_supply), ++ .consumer_supplies = zoom_vdda_dac_supply, + }; + + static int zoom_twl_gpio_setup(struct device *dev, +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0002-Remove-old-style-supply.dev-assignments-common-in-hs.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0002-Remove-old-style-supply.dev-assignments-common-in-hs.patch new file mode 100644 index 00000000..2dc12bd5 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0002-Remove-old-style-supply.dev-assignments-common-in-hs.patch @@ -0,0 +1,160 @@ +From e2f6d2c10498469246ca0f4dbdc1909f6b919262 Mon Sep 17 00:00:00 2001 +From: Oleg Drokin +Date: Mon, 6 Jun 2011 18:57:08 +0000 +Subject: [PATCH 002/149] Remove old-style supply.dev assignments common in hsmmc init + +CC: Mark Brown +CC: Mike Rapoport +CC: Nishant Kamat +CC: Steve Sakoman +CC: Felipe Balbi +Signed-off-by: Oleg Drokin +Acked-by: Felipe Balbi +Signed-off-by: Tony Lindgren +--- + arch/arm/mach-omap2/board-cm-t35.c | 4 ---- + arch/arm/mach-omap2/board-ldp.c | 2 -- + arch/arm/mach-omap2/board-omap3beagle.c | 4 ---- + arch/arm/mach-omap2/board-omap3evm.c | 4 ---- + arch/arm/mach-omap2/board-omap3logic.c | 2 -- + arch/arm/mach-omap2/board-omap3stalker.c | 4 ---- + arch/arm/mach-omap2/board-omap3touchbook.c | 4 ---- + arch/arm/mach-omap2/board-overo.c | 2 -- + arch/arm/mach-omap2/board-zoom-peripherals.c | 7 ------- + 9 files changed, 0 insertions(+), 33 deletions(-) + +diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c +index e7bf32d..ceb581e 100644 +--- a/arch/arm/mach-omap2/board-cm-t35.c ++++ b/arch/arm/mach-omap2/board-cm-t35.c +@@ -483,10 +483,6 @@ static int cm_t35_twl_gpio_setup(struct device *dev, unsigned gpio, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters */ +- cm_t35_vmmc1_supply.dev = mmc[0].dev; +- cm_t35_vsim_supply.dev = mmc[0].dev; +- + return 0; + } + +diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c +index 069bc9f..2d7e0ae 100644 +--- a/arch/arm/mach-omap2/board-ldp.c ++++ b/arch/arm/mach-omap2/board-ldp.c +@@ -341,8 +341,6 @@ static void __init omap_ldp_init(void) + ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0); + + omap2_hsmmc_init(mmc); +- /* link regulators to MMC adapters */ +- ldp_vmmc1_supply.dev = mmc[0].dev; + } + + MACHINE_START(OMAP_LDP, "OMAP LDP board") +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 4cf7c19..8ef0e19 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -268,10 +268,6 @@ static int beagle_twl_gpio_setup(struct device *dev, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters */ +- beagle_vmmc1_supply.dev = mmc[0].dev; +- beagle_vsim_supply.dev = mmc[0].dev; +- + /* + * TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active + * high / others active low) +diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c +index fc7a23a..e2202dd 100644 +--- a/arch/arm/mach-omap2/board-omap3evm.c ++++ b/arch/arm/mach-omap2/board-omap3evm.c +@@ -365,10 +365,6 @@ static int omap3evm_twl_gpio_setup(struct device *dev, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters */ +- omap3evm_vmmc1_supply.dev = mmc[0].dev; +- omap3evm_vsim_supply.dev = mmc[0].dev; +- + /* + * Most GPIOs are for USB OTG. Some are mostly sent to + * the P2 connector; notably LEDA for the LCD backlight. +diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c +index ec18435..eaefb59 100644 +--- a/arch/arm/mach-omap2/board-omap3logic.c ++++ b/arch/arm/mach-omap2/board-omap3logic.c +@@ -130,8 +130,6 @@ static void __init board_mmc_init(void) + } + + omap2_hsmmc_init(board_mmc_info); +- /* link regulators to MMC adapters */ +- omap3logic_vmmc1_supply.dev = board_mmc_info[0].dev; + } + + static struct omap_smsc911x_platform_data __initdata board_smsc911x_data = { +diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c +index 99be540..63d12a3 100644 +--- a/arch/arm/mach-omap2/board-omap3stalker.c ++++ b/arch/arm/mach-omap2/board-omap3stalker.c +@@ -321,10 +321,6 @@ omap3stalker_twl_gpio_setup(struct device *dev, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters */ +- omap3stalker_vmmc1_supply.dev = mmc[0].dev; +- omap3stalker_vsim_supply.dev = mmc[0].dev; +- + /* + * Most GPIOs are for USB OTG. Some are mostly sent to + * the P2 connector; notably LEDA for the LCD backlight. +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index ab5c37d..c80e2c3 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -137,10 +137,6 @@ static int touchbook_twl_gpio_setup(struct device *dev, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters */ +- touchbook_vmmc1_supply.dev = mmc[0].dev; +- touchbook_vsim_supply.dev = mmc[0].dev; +- + /* REVISIT: need ehci-omap hooks for external VBUS + * power switch and overcurrent detect + */ +diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c +index 30c7556..031a9a6 100644 +--- a/arch/arm/mach-omap2/board-overo.c ++++ b/arch/arm/mach-omap2/board-overo.c +@@ -417,8 +417,6 @@ static int overo_twl_gpio_setup(struct device *dev, + { + omap2_hsmmc_init(mmc); + +- overo_vmmc1_supply.dev = mmc[0].dev; +- + #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) + /* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ + gpio_leds[2].gpio = gpio + TWL4030_GPIO_MAX + 1; +diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c +index cb012e1..8495f82 100644 +--- a/arch/arm/mach-omap2/board-zoom-peripherals.c ++++ b/arch/arm/mach-omap2/board-zoom-peripherals.c +@@ -270,13 +270,6 @@ static int zoom_twl_gpio_setup(struct device *dev, + mmc[0].gpio_cd = gpio + 0; + omap2_hsmmc_init(mmc); + +- /* link regulators to MMC adapters ... we "know" the +- * regulators will be set up only *after* we return. +- */ +- zoom_vmmc1_supply.dev = mmc[0].dev; +- zoom_vsim_supply.dev = mmc[0].dev; +- zoom_vmmc2_supply.dev = mmc[1].dev; +- + ret = gpio_request_one(LCD_PANEL_ENABLE_GPIO, GPIOF_OUT_INIT_LOW, + "lcd enable"); + if (ret) +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0003-omap-Use-separate-init_irq-functions-to-avoid-cpu_is.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0003-omap-Use-separate-init_irq-functions-to-avoid-cpu_is.patch new file mode 100644 index 00000000..020dc988 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0003-omap-Use-separate-init_irq-functions-to-avoid-cpu_is.patch @@ -0,0 +1,802 @@ +From 15c991d632814077f7dbc6ec0d6ca19433a95986 Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 17 May 2011 03:51:26 -0700 +Subject: [PATCH 003/149] omap: Use separate init_irq functions to avoid cpu_is_omap tests early + +This allows us to remove cpu_is_omap calls from init_irq functions. +There should not be any need for cpu_is_omap calls as at this point. +During the timer init we only care about SoC generation, and not about +subrevisions. + +The main reason for the patch is that we want to initialize only +minimal omap specific code from the init_early call. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap1/board-ams-delta.c | 2 +- + arch/arm/mach-omap1/board-fsample.c | 2 +- + arch/arm/mach-omap1/board-generic.c | 2 +- + arch/arm/mach-omap1/board-h2.c | 2 +- + arch/arm/mach-omap1/board-h3.c | 2 +- + arch/arm/mach-omap1/board-htcherald.c | 2 +- + arch/arm/mach-omap1/board-innovator.c | 2 +- + arch/arm/mach-omap1/board-nokia770.c | 2 +- + arch/arm/mach-omap1/board-osk.c | 2 +- + arch/arm/mach-omap1/board-palmte.c | 2 +- + arch/arm/mach-omap1/board-palmtt.c | 2 +- + arch/arm/mach-omap1/board-palmz71.c | 2 +- + arch/arm/mach-omap1/board-perseus2.c | 2 +- + arch/arm/mach-omap1/board-sx1.c | 2 +- + arch/arm/mach-omap1/board-voiceblue.c | 2 +- + arch/arm/mach-omap1/irq.c | 2 +- + arch/arm/mach-omap2/board-2430sdp.c | 2 +- + arch/arm/mach-omap2/board-3430sdp.c | 2 +- + arch/arm/mach-omap2/board-3630sdp.c | 2 +- + arch/arm/mach-omap2/board-am3517crane.c | 2 +- + arch/arm/mach-omap2/board-am3517evm.c | 2 +- + arch/arm/mach-omap2/board-apollon.c | 2 +- + arch/arm/mach-omap2/board-cm-t35.c | 2 +- + arch/arm/mach-omap2/board-cm-t3517.c | 2 +- + arch/arm/mach-omap2/board-devkit8000.c | 2 +- + arch/arm/mach-omap2/board-generic.c | 2 +- + arch/arm/mach-omap2/board-h4.c | 2 +- + arch/arm/mach-omap2/board-igep0020.c | 4 +- + arch/arm/mach-omap2/board-ldp.c | 2 +- + arch/arm/mach-omap2/board-n8x0.c | 6 ++-- + arch/arm/mach-omap2/board-omap3beagle.c | 2 +- + arch/arm/mach-omap2/board-omap3evm.c | 2 +- + arch/arm/mach-omap2/board-omap3logic.c | 4 +- + arch/arm/mach-omap2/board-omap3pandora.c | 2 +- + arch/arm/mach-omap2/board-omap3stalker.c | 2 +- + arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- + arch/arm/mach-omap2/board-overo.c | 2 +- + arch/arm/mach-omap2/board-rm680.c | 2 +- + arch/arm/mach-omap2/board-rx51.c | 2 +- + arch/arm/mach-omap2/board-ti8168evm.c | 7 +----- + arch/arm/mach-omap2/board-zoom.c | 4 +- + arch/arm/mach-omap2/io.c | 17 +-------------- + arch/arm/mach-omap2/irq.c | 32 ++++++++++++++++++--------- + arch/arm/mach-omap2/omap4-common.c | 10 ++++---- + arch/arm/plat-omap/include/plat/irqs.h | 6 ++++- + 45 files changed, 78 insertions(+), 84 deletions(-) + +diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c +index f49ce85..e3caef8 100644 +--- a/arch/arm/mach-omap1/board-ams-delta.c ++++ b/arch/arm/mach-omap1/board-ams-delta.c +@@ -138,7 +138,7 @@ void ams_delta_latch2_write(u16 mask, u16 value) + static void __init ams_delta_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static struct map_desc ams_delta_io_desc[] __initdata = { +diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c +index 87f173d..eaff305 100644 +--- a/arch/arm/mach-omap1/board-fsample.c ++++ b/arch/arm/mach-omap1/board-fsample.c +@@ -329,7 +329,7 @@ static void __init omap_fsample_init(void) + static void __init omap_fsample_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + /* Only FPGA needs to be mapped here. All others are done with ioremap */ +diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c +index 23f4ab9..3fd6b40 100644 +--- a/arch/arm/mach-omap1/board-generic.c ++++ b/arch/arm/mach-omap1/board-generic.c +@@ -31,7 +31,7 @@ + static void __init omap_generic_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + /* assume no Mini-AB port */ +diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c +index ba3bd09..8147b04 100644 +--- a/arch/arm/mach-omap1/board-h2.c ++++ b/arch/arm/mach-omap1/board-h2.c +@@ -376,7 +376,7 @@ static struct i2c_board_info __initdata h2_i2c_board_info[] = { + static void __init h2_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static struct omap_usb_config h2_usb_config __initdata = { +diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c +index ac48677..1b448f6 100644 +--- a/arch/arm/mach-omap1/board-h3.c ++++ b/arch/arm/mach-omap1/board-h3.c +@@ -439,7 +439,7 @@ static void __init h3_init(void) + static void __init h3_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static void __init h3_map_io(void) +diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c +index ba05a51..1bd4d8e 100644 +--- a/arch/arm/mach-omap1/board-htcherald.c ++++ b/arch/arm/mach-omap1/board-htcherald.c +@@ -605,7 +605,7 @@ static void __init htcherald_init_irq(void) + { + printk(KERN_INFO "htcherald_init_irq.\n"); + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + MACHINE_START(HERALD, "HTC Herald") +diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c +index 2d9b8cb..5926b0c 100644 +--- a/arch/arm/mach-omap1/board-innovator.c ++++ b/arch/arm/mach-omap1/board-innovator.c +@@ -292,7 +292,7 @@ static void __init innovator_init_smc91x(void) + static void __init innovator_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + #ifdef CONFIG_ARCH_OMAP15XX +diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c +index cfd0849..e3cf21d 100644 +--- a/arch/arm/mach-omap1/board-nokia770.c ++++ b/arch/arm/mach-omap1/board-nokia770.c +@@ -51,7 +51,7 @@ static void __init omap_nokia770_init_irq(void) + omap_writew((omap_readw(0xfffb5004) & ~2), 0xfffb5004); + + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static const unsigned int nokia770_keymap[] = { +diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c +index e68dfde..1e7823d 100644 +--- a/arch/arm/mach-omap1/board-osk.c ++++ b/arch/arm/mach-omap1/board-osk.c +@@ -282,7 +282,7 @@ static void __init osk_init_cf(void) + static void __init osk_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static struct omap_usb_config osk_usb_config __initdata = { +diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c +index c9d38f4..8b6a881 100644 +--- a/arch/arm/mach-omap1/board-palmte.c ++++ b/arch/arm/mach-omap1/board-palmte.c +@@ -62,7 +62,7 @@ + static void __init omap_palmte_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static const unsigned int palmte_keymap[] = { +diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c +index f04f2d3..f2de43d 100644 +--- a/arch/arm/mach-omap1/board-palmtt.c ++++ b/arch/arm/mach-omap1/board-palmtt.c +@@ -266,7 +266,7 @@ static struct spi_board_info __initdata palmtt_boardinfo[] = { + static void __init omap_palmtt_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static struct omap_usb_config palmtt_usb_config __initdata = { +diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c +index 45f01d2..6665d2d 100644 +--- a/arch/arm/mach-omap1/board-palmz71.c ++++ b/arch/arm/mach-omap1/board-palmz71.c +@@ -61,7 +61,7 @@ static void __init + omap_palmz71_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static const unsigned int palmz71_keymap[] = { +diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c +index 3c8ee84..7f019e5 100644 +--- a/arch/arm/mach-omap1/board-perseus2.c ++++ b/arch/arm/mach-omap1/board-perseus2.c +@@ -297,7 +297,7 @@ static void __init omap_perseus2_init(void) + static void __init omap_perseus2_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + /* Only FPGA needs to be mapped here. All others are done with ioremap */ + static struct map_desc omap_perseus2_io_desc[] __initdata = { +diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c +index 0ad781d..24f0f7b 100644 +--- a/arch/arm/mach-omap1/board-sx1.c ++++ b/arch/arm/mach-omap1/board-sx1.c +@@ -411,7 +411,7 @@ static void __init omap_sx1_init(void) + static void __init omap_sx1_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + /*----------------------------------------*/ + +diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c +index 65d2420..98826e2 100644 +--- a/arch/arm/mach-omap1/board-voiceblue.c ++++ b/arch/arm/mach-omap1/board-voiceblue.c +@@ -162,7 +162,7 @@ static struct omap_board_config_kernel voiceblue_config[] = { + static void __init voiceblue_init_irq(void) + { + omap1_init_common_hw(); +- omap_init_irq(); ++ omap1_init_irq(); + } + + static void __init voiceblue_map_io(void) +diff --git a/arch/arm/mach-omap1/irq.c b/arch/arm/mach-omap1/irq.c +index 5d3da7a..e2b9c90 100644 +--- a/arch/arm/mach-omap1/irq.c ++++ b/arch/arm/mach-omap1/irq.c +@@ -175,7 +175,7 @@ static struct irq_chip omap_irq_chip = { + .irq_set_wake = omap_wake_irq, + }; + +-void __init omap_init_irq(void) ++void __init omap1_init_irq(void) + { + int i, j; + +diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c +index 5de6eac..45cabc5 100644 +--- a/arch/arm/mach-omap2/board-2430sdp.c ++++ b/arch/arm/mach-omap2/board-2430sdp.c +@@ -260,7 +260,7 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") + .reserve = omap_reserve, + .map_io = omap_2430sdp_map_io, + .init_early = omap_2430sdp_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = omap_2430sdp_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c +index 5dac974..85b207f 100644 +--- a/arch/arm/mach-omap2/board-3430sdp.c ++++ b/arch/arm/mach-omap2/board-3430sdp.c +@@ -804,7 +804,7 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_3430sdp_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap_3430sdp_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c +index a5933cc..2ec2d76 100644 +--- a/arch/arm/mach-omap2/board-3630sdp.c ++++ b/arch/arm/mach-omap2/board-3630sdp.c +@@ -219,7 +219,7 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_sdp_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap_sdp_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c +index 5e438a7..0bed0a4 100644 +--- a/arch/arm/mach-omap2/board-am3517crane.c ++++ b/arch/arm/mach-omap2/board-am3517crane.c +@@ -104,7 +104,7 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = am3517_crane_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = am3517_crane_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c +index 63af417..0db0fb8 100644 +--- a/arch/arm/mach-omap2/board-am3517evm.c ++++ b/arch/arm/mach-omap2/board-am3517evm.c +@@ -494,7 +494,7 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = am3517_evm_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = am3517_evm_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c +index b124bdf..93576c8 100644 +--- a/arch/arm/mach-omap2/board-apollon.c ++++ b/arch/arm/mach-omap2/board-apollon.c +@@ -354,7 +354,7 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") + .reserve = omap_reserve, + .map_io = omap_apollon_map_io, + .init_early = omap_apollon_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = omap_apollon_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c +index ceb581e..43b1de5 100644 +--- a/arch/arm/mach-omap2/board-cm-t35.c ++++ b/arch/arm/mach-omap2/board-cm-t35.c +@@ -644,7 +644,7 @@ MACHINE_START(CM_T35, "Compulab CM-T35") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = cm_t35_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = cm_t35_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c +index c3a9fd3..8f15222 100644 +--- a/arch/arm/mach-omap2/board-cm-t3517.c ++++ b/arch/arm/mach-omap2/board-cm-t3517.c +@@ -304,7 +304,7 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = cm_t3517_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = cm_t3517_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c +index ead9c1d..73f3a22 100644 +--- a/arch/arm/mach-omap2/board-devkit8000.c ++++ b/arch/arm/mach-omap2/board-devkit8000.c +@@ -440,7 +440,7 @@ static void __init devkit8000_init_early(void) + + static void __init devkit8000_init_irq(void) + { +- omap_init_irq(); ++ omap3_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); + #endif +diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c +index 73e3c31..ccd503a 100644 +--- a/arch/arm/mach-omap2/board-generic.c ++++ b/arch/arm/mach-omap2/board-generic.c +@@ -70,7 +70,7 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") + .reserve = omap_reserve, + .map_io = omap_generic_map_io, + .init_early = omap_generic_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = omap_generic_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c +index bac7933..2e16d6c 100644 +--- a/arch/arm/mach-omap2/board-h4.c ++++ b/arch/arm/mach-omap2/board-h4.c +@@ -298,7 +298,7 @@ static void __init omap_h4_init_early(void) + + static void __init omap_h4_init_irq(void) + { +- omap_init_irq(); ++ omap2_init_irq(); + } + + static struct at24_platform_data m24c01 = { +diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c +index 84d2846..f22a76a 100644 +--- a/arch/arm/mach-omap2/board-igep0020.c ++++ b/arch/arm/mach-omap2/board-igep0020.c +@@ -706,7 +706,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = igep_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = igep_init, + .timer = &omap_timer, + MACHINE_END +@@ -716,7 +716,7 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = igep_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = igep_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c +index 2d7e0ae..9671843 100644 +--- a/arch/arm/mach-omap2/board-ldp.c ++++ b/arch/arm/mach-omap2/board-ldp.c +@@ -348,7 +348,7 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_ldp_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap_ldp_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c +index 8d74318..9c791a2 100644 +--- a/arch/arm/mach-omap2/board-n8x0.c ++++ b/arch/arm/mach-omap2/board-n8x0.c +@@ -699,7 +699,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800") + .reserve = omap_reserve, + .map_io = n8x0_map_io, + .init_early = n8x0_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, + .timer = &omap_timer, + MACHINE_END +@@ -709,7 +709,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810") + .reserve = omap_reserve, + .map_io = n8x0_map_io, + .init_early = n8x0_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, + .timer = &omap_timer, + MACHINE_END +@@ -719,7 +719,7 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") + .reserve = omap_reserve, + .map_io = n8x0_map_io, + .init_early = n8x0_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 8ef0e19..eaead5e 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -483,7 +483,7 @@ static void __init omap3_beagle_init_early(void) + + static void __init omap3_beagle_init_irq(void) + { +- omap_init_irq(); ++ omap3_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); + #endif +diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c +index e2202dd..d39f53f 100644 +--- a/arch/arm/mach-omap2/board-omap3evm.c ++++ b/arch/arm/mach-omap2/board-omap3evm.c +@@ -739,7 +739,7 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap3_evm_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap3_evm_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c +index eaefb59..b63f1c2 100644 +--- a/arch/arm/mach-omap2/board-omap3logic.c ++++ b/arch/arm/mach-omap2/board-omap3logic.c +@@ -213,7 +213,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") + .boot_params = 0x80000100, + .map_io = omap3_map_io, + .init_early = omap3logic_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap3logic_init, + .timer = &omap_timer, + MACHINE_END +@@ -222,7 +222,7 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") + .boot_params = 0x80000100, + .map_io = omap3_map_io, + .init_early = omap3logic_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap3logic_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c +index 130a278..1d90b90 100644 +--- a/arch/arm/mach-omap2/board-omap3pandora.c ++++ b/arch/arm/mach-omap2/board-omap3pandora.c +@@ -650,7 +650,7 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap3pandora_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap3pandora_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c +index 63d12a3..dfa1401 100644 +--- a/arch/arm/mach-omap2/board-omap3stalker.c ++++ b/arch/arm/mach-omap2/board-omap3stalker.c +@@ -491,7 +491,7 @@ static void __init omap3_stalker_init_early(void) + + static void __init omap3_stalker_init_irq(void) + { +- omap_init_irq(); ++ omap3_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); + #endif +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index c80e2c3..ae97910 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -371,7 +371,7 @@ static void __init omap3_touchbook_init_early(void) + + static void __init omap3_touchbook_init_irq(void) + { +- omap_init_irq(); ++ omap3_init_irq(); + #ifdef CONFIG_OMAP_32K_TIMER + omap2_gp_clockevent_set_gptimer(12); + #endif +diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c +index 031a9a6..e3928f2 100644 +--- a/arch/arm/mach-omap2/board-overo.c ++++ b/arch/arm/mach-omap2/board-overo.c +@@ -615,7 +615,7 @@ MACHINE_START(OVERO, "Gumstix Overo") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = overo_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = overo_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c +index 42d10b1..9c3d115 100644 +--- a/arch/arm/mach-omap2/board-rm680.c ++++ b/arch/arm/mach-omap2/board-rm680.c +@@ -163,7 +163,7 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") + .reserve = omap_reserve, + .map_io = rm680_map_io, + .init_early = rm680_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = rm680_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c +index fec4cac..ee35e4e 100644 +--- a/arch/arm/mach-omap2/board-rx51.c ++++ b/arch/arm/mach-omap2/board-rx51.c +@@ -160,7 +160,7 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") + .reserve = rx51_reserve, + .map_io = rx51_map_io, + .init_early = rx51_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = rx51_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c +index 09fa7bf..713c20f 100644 +--- a/arch/arm/mach-omap2/board-ti8168evm.c ++++ b/arch/arm/mach-omap2/board-ti8168evm.c +@@ -33,11 +33,6 @@ static void __init ti8168_init_early(void) + omap2_init_common_devices(NULL, NULL); + } + +-static void __init ti8168_evm_init_irq(void) +-{ +- omap_init_irq(); +-} +- + static void __init ti8168_evm_init(void) + { + omap_serial_init(); +@@ -56,7 +51,7 @@ MACHINE_START(TI8168EVM, "ti8168evm") + .boot_params = 0x80000100, + .map_io = ti8168_evm_map_io, + .init_early = ti8168_init_early, +- .init_irq = ti8168_evm_init_irq, ++ .init_irq = ti816x_init_irq, + .timer = &omap_timer, + .init_machine = ti8168_evm_init, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c +index 4b133d7..97a3f0b 100644 +--- a/arch/arm/mach-omap2/board-zoom.c ++++ b/arch/arm/mach-omap2/board-zoom.c +@@ -137,7 +137,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_zoom_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap_zoom_init, + .timer = &omap_timer, + MACHINE_END +@@ -147,7 +147,7 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") + .reserve = omap_reserve, + .map_io = omap3_map_io, + .init_early = omap_zoom_init_early, +- .init_irq = omap_init_irq, ++ .init_irq = omap3_init_irq, + .init_machine = omap_zoom_init, + .timer = &omap_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c +index 441e79d..2ce1ce6 100644 +--- a/arch/arm/mach-omap2/io.c ++++ b/arch/arm/mach-omap2/io.c +@@ -333,23 +333,9 @@ static int _set_hwmod_postsetup_state(struct omap_hwmod *oh, void *data) + return omap_hwmod_set_postsetup_state(oh, *(u8 *)data); + } + ++/* See irq.c, omap4-common.c and entry-macro.S */ + void __iomem *omap_irq_base; + +-/* +- * Initialize asm_irq_base for entry-macro.S +- */ +-static inline void omap_irq_base_init(void) +-{ +- if (cpu_is_omap24xx()) +- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP24XX_IC_BASE); +- else if (cpu_is_omap34xx()) +- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP34XX_IC_BASE); +- else if (cpu_is_omap44xx()) +- omap_irq_base = OMAP2_L4_IO_ADDRESS(OMAP44XX_GIC_CPU_BASE); +- else +- pr_err("Could not initialize omap_irq_base\n"); +-} +- + void __init omap2_init_common_infrastructure(void) + { + u8 postsetup_state; +@@ -422,7 +408,6 @@ void __init omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0, + _omap2_init_reprogram_sdrc(); + } + +- omap_irq_base_init(); + } + + /* +diff --git a/arch/arm/mach-omap2/irq.c b/arch/arm/mach-omap2/irq.c +index 3af2b7a..3a12f75 100644 +--- a/arch/arm/mach-omap2/irq.c ++++ b/arch/arm/mach-omap2/irq.c +@@ -141,25 +141,20 @@ omap_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) + IRQ_NOREQUEST | IRQ_NOPROBE, 0); + } + +-void __init omap_init_irq(void) ++static void __init omap_init_irq(u32 base, int nr_irqs) + { + unsigned long nr_of_irqs = 0; + unsigned int nr_banks = 0; + int i, j; + ++ omap_irq_base = ioremap(base, SZ_4K); ++ if (WARN_ON(!omap_irq_base)) ++ return; ++ + for (i = 0; i < ARRAY_SIZE(irq_banks); i++) { +- unsigned long base = 0; + struct omap_irq_bank *bank = irq_banks + i; + +- if (cpu_is_omap24xx()) +- base = OMAP24XX_IC_BASE; +- else if (cpu_is_omap34xx()) +- base = OMAP34XX_IC_BASE; +- +- BUG_ON(!base); +- +- if (cpu_is_ti816x()) +- bank->nr_irqs = 128; ++ bank->nr_irqs = nr_irqs; + + /* Static mapping, never released */ + bank->base_reg = ioremap(base, SZ_4K); +@@ -181,6 +176,21 @@ void __init omap_init_irq(void) + nr_of_irqs, nr_banks, nr_banks > 1 ? "s" : ""); + } + ++void __init omap2_init_irq(void) ++{ ++ omap_init_irq(OMAP24XX_IC_BASE, 96); ++} ++ ++void __init omap3_init_irq(void) ++{ ++ omap_init_irq(OMAP34XX_IC_BASE, 96); ++} ++ ++void __init ti816x_init_irq(void) ++{ ++ omap_init_irq(OMAP34XX_IC_BASE, 128); ++} ++ + #ifdef CONFIG_ARCH_OMAP3 + static struct omap3_intc_regs intc_context[ARRAY_SIZE(irq_banks)]; + +diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c +index 9ef8c29..35ac3e5 100644 +--- a/arch/arm/mach-omap2/omap4-common.c ++++ b/arch/arm/mach-omap2/omap4-common.c +@@ -19,6 +19,8 @@ + #include + #include + ++#include ++ + #include + #include + +@@ -31,17 +33,15 @@ void __iomem *gic_dist_base_addr; + + void __init gic_init_irq(void) + { +- void __iomem *gic_cpu_base; +- + /* Static mapping, never released */ + gic_dist_base_addr = ioremap(OMAP44XX_GIC_DIST_BASE, SZ_4K); + BUG_ON(!gic_dist_base_addr); + + /* Static mapping, never released */ +- gic_cpu_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); +- BUG_ON(!gic_cpu_base); ++ omap_irq_base = ioremap(OMAP44XX_GIC_CPU_BASE, SZ_512); ++ BUG_ON(!omap_irq_base); + +- gic_init(0, 29, gic_dist_base_addr, gic_cpu_base); ++ gic_init(0, 29, gic_dist_base_addr, omap_irq_base); + } + + #ifdef CONFIG_CACHE_L2X0 +diff --git a/arch/arm/plat-omap/include/plat/irqs.h b/arch/arm/plat-omap/include/plat/irqs.h +index 5a25098..c884320 100644 +--- a/arch/arm/plat-omap/include/plat/irqs.h ++++ b/arch/arm/plat-omap/include/plat/irqs.h +@@ -428,7 +428,11 @@ + #define INTCPS_NR_IRQS 96 + + #ifndef __ASSEMBLY__ +-extern void omap_init_irq(void); ++extern void __iomem *omap_irq_base; ++void omap1_init_irq(void); ++void omap2_init_irq(void); ++void omap3_init_irq(void); ++void ti816x_init_irq(void); + extern int omap_irq_pending(void); + void omap_intc_save_context(void); + void omap_intc_restore_context(void); +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0004-omap-Set-separate-timer-init-functions-to-avoid-cpu_.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0004-omap-Set-separate-timer-init-functions-to-avoid-cpu_.patch new file mode 100644 index 00000000..6adc71f8 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0004-omap-Set-separate-timer-init-functions-to-avoid-cpu_.patch @@ -0,0 +1,689 @@ +From 9eb6982ba830b50a9d3759609633341aff91a6ec Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:48 -0700 +Subject: [PATCH 004/149] omap: Set separate timer init functions to avoid cpu_is_omap tests + +This is needed for the following patches so we can initialize the +rest of the hardware timers later on. + +As with the init_irq calls, there's no need to do cpu_is_omap calls +during the timer init as we only care about the major omap generation. +This means that we can initialize the sys_timer with the .timer +entries alone. + +Note that for now we just set stubs for the various sys_timer entries +that will get populated in a later patch. The following patches will +also remove the omap_dm_timer_init calls and change the init for the +rest of the hardware timers to happen with an arch_initcall. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap1/board-ams-delta.c | 2 +- + arch/arm/mach-omap1/board-fsample.c | 2 +- + arch/arm/mach-omap1/board-generic.c | 2 +- + arch/arm/mach-omap1/board-h2.c | 2 +- + arch/arm/mach-omap1/board-h3.c | 2 +- + arch/arm/mach-omap1/board-htcherald.c | 2 +- + arch/arm/mach-omap1/board-innovator.c | 2 +- + arch/arm/mach-omap1/board-nokia770.c | 2 +- + arch/arm/mach-omap1/board-osk.c | 2 +- + arch/arm/mach-omap1/board-palmte.c | 2 +- + arch/arm/mach-omap1/board-palmtt.c | 2 +- + arch/arm/mach-omap1/board-palmz71.c | 2 +- + arch/arm/mach-omap1/board-perseus2.c | 2 +- + arch/arm/mach-omap1/board-sx1.c | 2 +- + arch/arm/mach-omap1/board-voiceblue.c | 2 +- + arch/arm/mach-omap1/time.c | 6 ++-- + arch/arm/mach-omap2/board-2430sdp.c | 2 +- + arch/arm/mach-omap2/board-3430sdp.c | 2 +- + arch/arm/mach-omap2/board-3630sdp.c | 2 +- + arch/arm/mach-omap2/board-4430sdp.c | 2 +- + arch/arm/mach-omap2/board-am3517crane.c | 2 +- + arch/arm/mach-omap2/board-am3517evm.c | 2 +- + arch/arm/mach-omap2/board-apollon.c | 2 +- + arch/arm/mach-omap2/board-cm-t35.c | 2 +- + arch/arm/mach-omap2/board-cm-t3517.c | 2 +- + arch/arm/mach-omap2/board-devkit8000.c | 2 +- + arch/arm/mach-omap2/board-generic.c | 2 +- + arch/arm/mach-omap2/board-h4.c | 2 +- + arch/arm/mach-omap2/board-igep0020.c | 4 +- + arch/arm/mach-omap2/board-ldp.c | 2 +- + arch/arm/mach-omap2/board-n8x0.c | 6 ++-- + arch/arm/mach-omap2/board-omap3beagle.c | 2 +- + arch/arm/mach-omap2/board-omap3evm.c | 2 +- + arch/arm/mach-omap2/board-omap3logic.c | 4 +- + arch/arm/mach-omap2/board-omap3pandora.c | 2 +- + arch/arm/mach-omap2/board-omap3stalker.c | 2 +- + arch/arm/mach-omap2/board-omap3touchbook.c | 2 +- + arch/arm/mach-omap2/board-omap4panda.c | 2 +- + arch/arm/mach-omap2/board-overo.c | 2 +- + arch/arm/mach-omap2/board-rm680.c | 2 +- + arch/arm/mach-omap2/board-rx51.c | 2 +- + arch/arm/mach-omap2/board-ti8168evm.c | 2 +- + arch/arm/mach-omap2/board-zoom.c | 4 +- + arch/arm/mach-omap2/timer-gp.c | 41 +++++++++++++++++++++------- + arch/arm/plat-omap/include/plat/common.h | 6 +++- + arch/arm/plat-omap/include/plat/dmtimer.h | 1 - + 46 files changed, 86 insertions(+), 62 deletions(-) + +diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c +index e3caef8..312ea6b 100644 +--- a/arch/arm/mach-omap1/board-ams-delta.c ++++ b/arch/arm/mach-omap1/board-ams-delta.c +@@ -391,7 +391,7 @@ MACHINE_START(AMS_DELTA, "Amstrad E3 (Delta)") + .reserve = omap_reserve, + .init_irq = ams_delta_init_irq, + .init_machine = ams_delta_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END + + EXPORT_SYMBOL(ams_delta_latch1_write); +diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c +index eaff305..a6b1bea 100644 +--- a/arch/arm/mach-omap1/board-fsample.c ++++ b/arch/arm/mach-omap1/board-fsample.c +@@ -394,5 +394,5 @@ MACHINE_START(OMAP_FSAMPLE, "OMAP730 F-Sample") + .reserve = omap_reserve, + .init_irq = omap_fsample_init_irq, + .init_machine = omap_fsample_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-generic.c b/arch/arm/mach-omap1/board-generic.c +index 3fd6b40..04fc356 100644 +--- a/arch/arm/mach-omap1/board-generic.c ++++ b/arch/arm/mach-omap1/board-generic.c +@@ -99,5 +99,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP1510/1610/1710") + .reserve = omap_reserve, + .init_irq = omap_generic_init_irq, + .init_machine = omap_generic_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c +index 8147b04..cb7fb1a 100644 +--- a/arch/arm/mach-omap1/board-h2.c ++++ b/arch/arm/mach-omap1/board-h2.c +@@ -466,5 +466,5 @@ MACHINE_START(OMAP_H2, "TI-H2") + .reserve = omap_reserve, + .init_irq = h2_init_irq, + .init_machine = h2_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-h3.c b/arch/arm/mach-omap1/board-h3.c +index 1b448f6..31f3487 100644 +--- a/arch/arm/mach-omap1/board-h3.c ++++ b/arch/arm/mach-omap1/board-h3.c +@@ -454,5 +454,5 @@ MACHINE_START(OMAP_H3, "TI OMAP1710 H3 board") + .reserve = omap_reserve, + .init_irq = h3_init_irq, + .init_machine = h3_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c +index 1bd4d8e..36e06ea 100644 +--- a/arch/arm/mach-omap1/board-htcherald.c ++++ b/arch/arm/mach-omap1/board-htcherald.c +@@ -616,5 +616,5 @@ MACHINE_START(HERALD, "HTC Herald") + .reserve = omap_reserve, + .init_irq = htcherald_init_irq, + .init_machine = htcherald_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c +index 5926b0c..0b1ba46 100644 +--- a/arch/arm/mach-omap1/board-innovator.c ++++ b/arch/arm/mach-omap1/board-innovator.c +@@ -464,5 +464,5 @@ MACHINE_START(OMAP_INNOVATOR, "TI-Innovator") + .reserve = omap_reserve, + .init_irq = innovator_init_irq, + .init_machine = innovator_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c +index e3cf21d..5469ce2 100644 +--- a/arch/arm/mach-omap1/board-nokia770.c ++++ b/arch/arm/mach-omap1/board-nokia770.c +@@ -269,5 +269,5 @@ MACHINE_START(NOKIA770, "Nokia 770") + .reserve = omap_reserve, + .init_irq = omap_nokia770_init_irq, + .init_machine = omap_nokia770_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-osk.c b/arch/arm/mach-omap1/board-osk.c +index 1e7823d..b08a213 100644 +--- a/arch/arm/mach-omap1/board-osk.c ++++ b/arch/arm/mach-omap1/board-osk.c +@@ -588,5 +588,5 @@ MACHINE_START(OMAP_OSK, "TI-OSK") + .reserve = omap_reserve, + .init_irq = osk_init_irq, + .init_machine = osk_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c +index 8b6a881..459cb6b 100644 +--- a/arch/arm/mach-omap1/board-palmte.c ++++ b/arch/arm/mach-omap1/board-palmte.c +@@ -280,5 +280,5 @@ MACHINE_START(OMAP_PALMTE, "OMAP310 based Palm Tungsten E") + .reserve = omap_reserve, + .init_irq = omap_palmte_init_irq, + .init_machine = omap_palmte_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c +index f2de43d..b214f45 100644 +--- a/arch/arm/mach-omap1/board-palmtt.c ++++ b/arch/arm/mach-omap1/board-palmtt.c +@@ -326,5 +326,5 @@ MACHINE_START(OMAP_PALMTT, "OMAP1510 based Palm Tungsten|T") + .reserve = omap_reserve, + .init_irq = omap_palmtt_init_irq, + .init_machine = omap_palmtt_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c +index 6665d2d..9b0ea48 100644 +--- a/arch/arm/mach-omap1/board-palmz71.c ++++ b/arch/arm/mach-omap1/board-palmz71.c +@@ -346,5 +346,5 @@ MACHINE_START(OMAP_PALMZ71, "OMAP310 based Palm Zire71") + .reserve = omap_reserve, + .init_irq = omap_palmz71_init_irq, + .init_machine = omap_palmz71_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-perseus2.c b/arch/arm/mach-omap1/board-perseus2.c +index 7f019e5..67acd41 100644 +--- a/arch/arm/mach-omap1/board-perseus2.c ++++ b/arch/arm/mach-omap1/board-perseus2.c +@@ -355,5 +355,5 @@ MACHINE_START(OMAP_PERSEUS2, "OMAP730 Perseus2") + .reserve = omap_reserve, + .init_irq = omap_perseus2_init_irq, + .init_machine = omap_perseus2_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c +index 24f0f7b..9c3b7c5 100644 +--- a/arch/arm/mach-omap1/board-sx1.c ++++ b/arch/arm/mach-omap1/board-sx1.c +@@ -426,5 +426,5 @@ MACHINE_START(SX1, "OMAP310 based Siemens SX1") + .reserve = omap_reserve, + .init_irq = omap_sx1_init_irq, + .init_machine = omap_sx1_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c +index 98826e2..036edc0 100644 +--- a/arch/arm/mach-omap1/board-voiceblue.c ++++ b/arch/arm/mach-omap1/board-voiceblue.c +@@ -306,5 +306,5 @@ MACHINE_START(VOICEBLUE, "VoiceBlue OMAP5910") + .reserve = omap_reserve, + .init_irq = voiceblue_init_irq, + .init_machine = voiceblue_init, +- .timer = &omap_timer, ++ .timer = &omap1_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c +index 03e1e10..a183777 100644 +--- a/arch/arm/mach-omap1/time.c ++++ b/arch/arm/mach-omap1/time.c +@@ -297,7 +297,7 @@ static inline int omap_32k_timer_usable(void) + * Timer initialization + * --------------------------------------------------------------------------- + */ +-static void __init omap_timer_init(void) ++static void __init omap1_timer_init(void) + { + if (omap_32k_timer_usable()) { + preferred_sched_clock_init(1); +@@ -307,6 +307,6 @@ static void __init omap_timer_init(void) + } + } + +-struct sys_timer omap_timer = { +- .init = omap_timer_init, ++struct sys_timer omap1_timer = { ++ .init = omap1_timer_init, + }; +diff --git a/arch/arm/mach-omap2/board-2430sdp.c b/arch/arm/mach-omap2/board-2430sdp.c +index 45cabc5..2028464 100644 +--- a/arch/arm/mach-omap2/board-2430sdp.c ++++ b/arch/arm/mach-omap2/board-2430sdp.c +@@ -262,5 +262,5 @@ MACHINE_START(OMAP_2430SDP, "OMAP2430 sdp2430 board") + .init_early = omap_2430sdp_init_early, + .init_irq = omap2_init_irq, + .init_machine = omap_2430sdp_init, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c +index 85b207f..12fae21 100644 +--- a/arch/arm/mach-omap2/board-3430sdp.c ++++ b/arch/arm/mach-omap2/board-3430sdp.c +@@ -806,5 +806,5 @@ MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board") + .init_early = omap_3430sdp_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_3430sdp_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c +index 2ec2d76..e4f37b5 100644 +--- a/arch/arm/mach-omap2/board-3630sdp.c ++++ b/arch/arm/mach-omap2/board-3630sdp.c +@@ -221,5 +221,5 @@ MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board") + .init_early = omap_sdp_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_sdp_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c +index 39a8062..e8caced 100644 +--- a/arch/arm/mach-omap2/board-4430sdp.c ++++ b/arch/arm/mach-omap2/board-4430sdp.c +@@ -768,5 +768,5 @@ MACHINE_START(OMAP_4430SDP, "OMAP4430 4430SDP board") + .init_early = omap_4430sdp_init_early, + .init_irq = gic_init_irq, + .init_machine = omap_4430sdp_init, +- .timer = &omap_timer, ++ .timer = &omap4_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c +index 0bed0a4..5f2b55f 100644 +--- a/arch/arm/mach-omap2/board-am3517crane.c ++++ b/arch/arm/mach-omap2/board-am3517crane.c +@@ -106,5 +106,5 @@ MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") + .init_early = am3517_crane_init_early, + .init_irq = omap3_init_irq, + .init_machine = am3517_crane_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-am3517evm.c b/arch/arm/mach-omap2/board-am3517evm.c +index 0db0fb8..f3006c3 100644 +--- a/arch/arm/mach-omap2/board-am3517evm.c ++++ b/arch/arm/mach-omap2/board-am3517evm.c +@@ -496,5 +496,5 @@ MACHINE_START(OMAP3517EVM, "OMAP3517/AM3517 EVM") + .init_early = am3517_evm_init_early, + .init_irq = omap3_init_irq, + .init_machine = am3517_evm_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c +index 93576c8..7021170 100644 +--- a/arch/arm/mach-omap2/board-apollon.c ++++ b/arch/arm/mach-omap2/board-apollon.c +@@ -356,5 +356,5 @@ MACHINE_START(OMAP_APOLLON, "OMAP24xx Apollon") + .init_early = omap_apollon_init_early, + .init_irq = omap2_init_irq, + .init_machine = omap_apollon_init, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c +index 43b1de5..1a18d3b 100644 +--- a/arch/arm/mach-omap2/board-cm-t35.c ++++ b/arch/arm/mach-omap2/board-cm-t35.c +@@ -646,5 +646,5 @@ MACHINE_START(CM_T35, "Compulab CM-T35") + .init_early = cm_t35_init_early, + .init_irq = omap3_init_irq, + .init_machine = cm_t35_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c +index 8f15222..aa67240 100644 +--- a/arch/arm/mach-omap2/board-cm-t3517.c ++++ b/arch/arm/mach-omap2/board-cm-t3517.c +@@ -306,5 +306,5 @@ MACHINE_START(CM_T3517, "Compulab CM-T3517") + .init_early = cm_t3517_init_early, + .init_irq = omap3_init_irq, + .init_machine = cm_t3517_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c +index 73f3a22..46d144d 100644 +--- a/arch/arm/mach-omap2/board-devkit8000.c ++++ b/arch/arm/mach-omap2/board-devkit8000.c +@@ -709,5 +709,5 @@ MACHINE_START(DEVKIT8000, "OMAP3 Devkit8000") + .init_early = devkit8000_init_early, + .init_irq = devkit8000_init_irq, + .init_machine = devkit8000_init, +- .timer = &omap_timer, ++ .timer = &omap3_secure_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c +index ccd503a..c6ecf60 100644 +--- a/arch/arm/mach-omap2/board-generic.c ++++ b/arch/arm/mach-omap2/board-generic.c +@@ -72,5 +72,5 @@ MACHINE_START(OMAP_GENERIC, "Generic OMAP24xx") + .init_early = omap_generic_init_early, + .init_irq = omap2_init_irq, + .init_machine = omap_generic_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c +index 2e16d6c..45de2b3 100644 +--- a/arch/arm/mach-omap2/board-h4.c ++++ b/arch/arm/mach-omap2/board-h4.c +@@ -388,5 +388,5 @@ MACHINE_START(OMAP_H4, "OMAP2420 H4 board") + .init_early = omap_h4_init_early, + .init_irq = omap_h4_init_irq, + .init_machine = omap_h4_init, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c +index f22a76a..f683835 100644 +--- a/arch/arm/mach-omap2/board-igep0020.c ++++ b/arch/arm/mach-omap2/board-igep0020.c +@@ -708,7 +708,7 @@ MACHINE_START(IGEP0020, "IGEP v2 board") + .init_early = igep_init_early, + .init_irq = omap3_init_irq, + .init_machine = igep_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END + + MACHINE_START(IGEP0030, "IGEP OMAP3 module") +@@ -718,5 +718,5 @@ MACHINE_START(IGEP0030, "IGEP OMAP3 module") + .init_early = igep_init_early, + .init_irq = omap3_init_irq, + .init_machine = igep_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c +index 9671843..5d4328f 100644 +--- a/arch/arm/mach-omap2/board-ldp.c ++++ b/arch/arm/mach-omap2/board-ldp.c +@@ -350,5 +350,5 @@ MACHINE_START(OMAP_LDP, "OMAP LDP board") + .init_early = omap_ldp_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_ldp_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n8x0.c +index 9c791a2..e11f0c5 100644 +--- a/arch/arm/mach-omap2/board-n8x0.c ++++ b/arch/arm/mach-omap2/board-n8x0.c +@@ -701,7 +701,7 @@ MACHINE_START(NOKIA_N800, "Nokia N800") + .init_early = n8x0_init_early, + .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END + + MACHINE_START(NOKIA_N810, "Nokia N810") +@@ -711,7 +711,7 @@ MACHINE_START(NOKIA_N810, "Nokia N810") + .init_early = n8x0_init_early, + .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END + + MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") +@@ -721,5 +721,5 @@ MACHINE_START(NOKIA_N810_WIMAX, "Nokia N810 WiMAX") + .init_early = n8x0_init_early, + .init_irq = omap2_init_irq, + .init_machine = n8x0_init_machine, +- .timer = &omap_timer, ++ .timer = &omap2_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index eaead5e..9ee16f6 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -596,5 +596,5 @@ MACHINE_START(OMAP3_BEAGLE, "OMAP3 Beagle Board") + .init_early = omap3_beagle_init_early, + .init_irq = omap3_beagle_init_irq, + .init_machine = omap3_beagle_init, +- .timer = &omap_timer, ++ .timer = &omap3_secure_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c +index d39f53f..6f957ed 100644 +--- a/arch/arm/mach-omap2/board-omap3evm.c ++++ b/arch/arm/mach-omap2/board-omap3evm.c +@@ -741,5 +741,5 @@ MACHINE_START(OMAP3EVM, "OMAP3 EVM") + .init_early = omap3_evm_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap3_evm_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c +index b63f1c2..469259a 100644 +--- a/arch/arm/mach-omap2/board-omap3logic.c ++++ b/arch/arm/mach-omap2/board-omap3logic.c +@@ -215,7 +215,7 @@ MACHINE_START(OMAP3_TORPEDO, "Logic OMAP3 Torpedo board") + .init_early = omap3logic_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap3logic_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END + + MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") +@@ -224,5 +224,5 @@ MACHINE_START(OMAP3530_LV_SOM, "OMAP Logic 3530 LV SOM board") + .init_early = omap3logic_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap3logic_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c +index 1d90b90..d4ea940 100644 +--- a/arch/arm/mach-omap2/board-omap3pandora.c ++++ b/arch/arm/mach-omap2/board-omap3pandora.c +@@ -652,5 +652,5 @@ MACHINE_START(OMAP3_PANDORA, "Pandora Handheld Console") + .init_early = omap3pandora_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap3pandora_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c +index dfa1401..2fa8fae 100644 +--- a/arch/arm/mach-omap2/board-omap3stalker.c ++++ b/arch/arm/mach-omap2/board-omap3stalker.c +@@ -557,5 +557,5 @@ MACHINE_START(SBC3530, "OMAP3 STALKER") + .init_early = omap3_stalker_init_early, + .init_irq = omap3_stalker_init_irq, + .init_machine = omap3_stalker_init, +- .timer = &omap_timer, ++ .timer = &omap3_secure_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index ae97910..8c71fd2 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -449,5 +449,5 @@ MACHINE_START(TOUCHBOOK, "OMAP3 touchbook Board") + .init_early = omap3_touchbook_init_early, + .init_irq = omap3_touchbook_init_irq, + .init_machine = omap3_touchbook_init, +- .timer = &omap_timer, ++ .timer = &omap3_secure_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c +index 6d2372b..dc1d6dc 100644 +--- a/arch/arm/mach-omap2/board-omap4panda.c ++++ b/arch/arm/mach-omap2/board-omap4panda.c +@@ -712,5 +712,5 @@ MACHINE_START(OMAP4_PANDA, "OMAP4 Panda board") + .init_early = omap4_panda_init_early, + .init_irq = gic_init_irq, + .init_machine = omap4_panda_init, +- .timer = &omap_timer, ++ .timer = &omap4_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c +index e3928f2..1bf2f39 100644 +--- a/arch/arm/mach-omap2/board-overo.c ++++ b/arch/arm/mach-omap2/board-overo.c +@@ -617,5 +617,5 @@ MACHINE_START(OVERO, "Gumstix Overo") + .init_early = overo_init_early, + .init_irq = omap3_init_irq, + .init_machine = overo_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-rm680.c b/arch/arm/mach-omap2/board-rm680.c +index 9c3d115..54dceb1 100644 +--- a/arch/arm/mach-omap2/board-rm680.c ++++ b/arch/arm/mach-omap2/board-rm680.c +@@ -165,5 +165,5 @@ MACHINE_START(NOKIA_RM680, "Nokia RM-680 board") + .init_early = rm680_init_early, + .init_irq = omap3_init_irq, + .init_machine = rm680_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c +index ee35e4e..5ea142f 100644 +--- a/arch/arm/mach-omap2/board-rx51.c ++++ b/arch/arm/mach-omap2/board-rx51.c +@@ -162,5 +162,5 @@ MACHINE_START(NOKIA_RX51, "Nokia RX-51 board") + .init_early = rx51_init_early, + .init_irq = omap3_init_irq, + .init_machine = rx51_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-ti8168evm.c b/arch/arm/mach-omap2/board-ti8168evm.c +index 713c20f..a85d5b0 100644 +--- a/arch/arm/mach-omap2/board-ti8168evm.c ++++ b/arch/arm/mach-omap2/board-ti8168evm.c +@@ -52,6 +52,6 @@ MACHINE_START(TI8168EVM, "ti8168evm") + .map_io = ti8168_evm_map_io, + .init_early = ti8168_init_early, + .init_irq = ti816x_init_irq, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + .init_machine = ti8168_evm_init, + MACHINE_END +diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c +index 97a3f0b..8a98c3c 100644 +--- a/arch/arm/mach-omap2/board-zoom.c ++++ b/arch/arm/mach-omap2/board-zoom.c +@@ -139,7 +139,7 @@ MACHINE_START(OMAP_ZOOM2, "OMAP Zoom2 board") + .init_early = omap_zoom_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_zoom_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END + + MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") +@@ -149,5 +149,5 @@ MACHINE_START(OMAP_ZOOM3, "OMAP Zoom3 board") + .init_early = omap_zoom_init_early, + .init_irq = omap3_init_irq, + .init_machine = omap_zoom_init, +- .timer = &omap_timer, ++ .timer = &omap3_timer, + MACHINE_END +diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c +index 3b9cf85..a0d8e83 100644 +--- a/arch/arm/mach-omap2/timer-gp.c ++++ b/arch/arm/mach-omap2/timer-gp.c +@@ -247,20 +247,41 @@ static void __init omap2_gp_clocksource_init(void) + } + #endif + +-static void __init omap2_gp_timer_init(void) ++#define OMAP_SYS_TIMER_INIT(name) \ ++static void __init omap##name##_timer_init(void) \ ++{ \ ++ omap_dm_timer_init(); \ ++ omap2_gp_clockevent_init(); \ ++ omap2_gp_clocksource_init(); \ ++} ++ ++#define OMAP_SYS_TIMER(name) \ ++struct sys_timer omap##name##_timer = { \ ++ .init = omap##name##_timer_init, \ ++}; ++ ++#ifdef CONFIG_ARCH_OMAP2 ++OMAP_SYS_TIMER_INIT(2) ++OMAP_SYS_TIMER(2) ++#endif ++ ++#ifdef CONFIG_ARCH_OMAP3 ++OMAP_SYS_TIMER_INIT(3) ++OMAP_SYS_TIMER(3) ++OMAP_SYS_TIMER_INIT(3_secure) ++OMAP_SYS_TIMER(3_secure) ++#endif ++ ++#ifdef CONFIG_ARCH_OMAP4 ++static void __init omap4_timer_init(void) + { + #ifdef CONFIG_LOCAL_TIMERS +- if (cpu_is_omap44xx()) { +- twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); +- BUG_ON(!twd_base); +- } ++ twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); ++ BUG_ON(!twd_base); + #endif + omap_dm_timer_init(); +- + omap2_gp_clockevent_init(); + omap2_gp_clocksource_init(); + } +- +-struct sys_timer omap_timer = { +- .init = omap2_gp_timer_init, +-}; ++OMAP_SYS_TIMER(4) ++#endif +diff --git a/arch/arm/plat-omap/include/plat/common.h b/arch/arm/plat-omap/include/plat/common.h +index 5288130..4564cc6 100644 +--- a/arch/arm/plat-omap/include/plat/common.h ++++ b/arch/arm/plat-omap/include/plat/common.h +@@ -34,7 +34,11 @@ + struct sys_timer; + + extern void omap_map_common_io(void); +-extern struct sys_timer omap_timer; ++extern struct sys_timer omap1_timer; ++extern struct sys_timer omap2_timer; ++extern struct sys_timer omap3_timer; ++extern struct sys_timer omap3_secure_timer; ++extern struct sys_timer omap4_timer; + extern bool omap_32k_timer_init(void); + extern int __init omap_init_clocksource_32k(void); + extern unsigned long long notrace omap_32k_sched_clock(void); +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index d6c70d2..330bd17 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -57,7 +57,6 @@ + #define OMAP_TIMER_IP_VERSION_1 0x1 + struct omap_dm_timer; + extern struct omap_dm_timer *gptimer_wakeup; +-extern struct sys_timer omap_timer; + struct clk; + + int omap_dm_timer_init(void); +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0005-omap-Move-dmtimer-defines-to-dmtimer.h.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0005-omap-Move-dmtimer-defines-to-dmtimer.h.patch new file mode 100644 index 00000000..91416a1e --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0005-omap-Move-dmtimer-defines-to-dmtimer.h.patch @@ -0,0 +1,287 @@ +From 77203d7fdc186db617c03d3ef28981b77af3b077 Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:48 -0700 +Subject: [PATCH 005/149] omap: Move dmtimer defines to dmtimer.h + +These will be needed when dmtimer platform init code gets split +for omap1 and omap2+. These will also be needed for separate +sys_timer init and driver init for the rest of the hardware timers +in the following patches. No functional changes. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/plat-omap/dmtimer.c | 121 ---------------------------- + arch/arm/plat-omap/include/plat/dmtimer.h | 125 +++++++++++++++++++++++++++++ + 2 files changed, 125 insertions(+), 121 deletions(-) + +diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c +index ee9f6eb..dfdc3b2 100644 +--- a/arch/arm/plat-omap/dmtimer.c ++++ b/arch/arm/plat-omap/dmtimer.c +@@ -41,127 +41,6 @@ + #include + #include + +-/* register offsets */ +-#define _OMAP_TIMER_ID_OFFSET 0x00 +-#define _OMAP_TIMER_OCP_CFG_OFFSET 0x10 +-#define _OMAP_TIMER_SYS_STAT_OFFSET 0x14 +-#define _OMAP_TIMER_STAT_OFFSET 0x18 +-#define _OMAP_TIMER_INT_EN_OFFSET 0x1c +-#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20 +-#define _OMAP_TIMER_CTRL_OFFSET 0x24 +-#define OMAP_TIMER_CTRL_GPOCFG (1 << 14) +-#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13) +-#define OMAP_TIMER_CTRL_PT (1 << 12) +-#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8) +-#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8) +-#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8) +-#define OMAP_TIMER_CTRL_SCPWM (1 << 7) +-#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */ +-#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */ +-#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* prescaler value shift */ +-#define OMAP_TIMER_CTRL_POSTED (1 << 2) +-#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */ +-#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */ +-#define _OMAP_TIMER_COUNTER_OFFSET 0x28 +-#define _OMAP_TIMER_LOAD_OFFSET 0x2c +-#define _OMAP_TIMER_TRIGGER_OFFSET 0x30 +-#define _OMAP_TIMER_WRITE_PEND_OFFSET 0x34 +-#define WP_NONE 0 /* no write pending bit */ +-#define WP_TCLR (1 << 0) +-#define WP_TCRR (1 << 1) +-#define WP_TLDR (1 << 2) +-#define WP_TTGR (1 << 3) +-#define WP_TMAR (1 << 4) +-#define WP_TPIR (1 << 5) +-#define WP_TNIR (1 << 6) +-#define WP_TCVR (1 << 7) +-#define WP_TOCR (1 << 8) +-#define WP_TOWR (1 << 9) +-#define _OMAP_TIMER_MATCH_OFFSET 0x38 +-#define _OMAP_TIMER_CAPTURE_OFFSET 0x3c +-#define _OMAP_TIMER_IF_CTRL_OFFSET 0x40 +-#define _OMAP_TIMER_CAPTURE2_OFFSET 0x44 /* TCAR2, 34xx only */ +-#define _OMAP_TIMER_TICK_POS_OFFSET 0x48 /* TPIR, 34xx only */ +-#define _OMAP_TIMER_TICK_NEG_OFFSET 0x4c /* TNIR, 34xx only */ +-#define _OMAP_TIMER_TICK_COUNT_OFFSET 0x50 /* TCVR, 34xx only */ +-#define _OMAP_TIMER_TICK_INT_MASK_SET_OFFSET 0x54 /* TOCR, 34xx only */ +-#define _OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET 0x58 /* TOWR, 34xx only */ +- +-/* register offsets with the write pending bit encoded */ +-#define WPSHIFT 16 +- +-#define OMAP_TIMER_ID_REG (_OMAP_TIMER_ID_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_OCP_CFG_REG (_OMAP_TIMER_OCP_CFG_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_SYS_STAT_REG (_OMAP_TIMER_SYS_STAT_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_STAT_REG (_OMAP_TIMER_STAT_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_INT_EN_REG (_OMAP_TIMER_INT_EN_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_CTRL_REG (_OMAP_TIMER_CTRL_OFFSET \ +- | (WP_TCLR << WPSHIFT)) +- +-#define OMAP_TIMER_COUNTER_REG (_OMAP_TIMER_COUNTER_OFFSET \ +- | (WP_TCRR << WPSHIFT)) +- +-#define OMAP_TIMER_LOAD_REG (_OMAP_TIMER_LOAD_OFFSET \ +- | (WP_TLDR << WPSHIFT)) +- +-#define OMAP_TIMER_TRIGGER_REG (_OMAP_TIMER_TRIGGER_OFFSET \ +- | (WP_TTGR << WPSHIFT)) +- +-#define OMAP_TIMER_WRITE_PEND_REG (_OMAP_TIMER_WRITE_PEND_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_MATCH_REG (_OMAP_TIMER_MATCH_OFFSET \ +- | (WP_TMAR << WPSHIFT)) +- +-#define OMAP_TIMER_CAPTURE_REG (_OMAP_TIMER_CAPTURE_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_IF_CTRL_REG (_OMAP_TIMER_IF_CTRL_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_CAPTURE2_REG (_OMAP_TIMER_CAPTURE2_OFFSET \ +- | (WP_NONE << WPSHIFT)) +- +-#define OMAP_TIMER_TICK_POS_REG (_OMAP_TIMER_TICK_POS_OFFSET \ +- | (WP_TPIR << WPSHIFT)) +- +-#define OMAP_TIMER_TICK_NEG_REG (_OMAP_TIMER_TICK_NEG_OFFSET \ +- | (WP_TNIR << WPSHIFT)) +- +-#define OMAP_TIMER_TICK_COUNT_REG (_OMAP_TIMER_TICK_COUNT_OFFSET \ +- | (WP_TCVR << WPSHIFT)) +- +-#define OMAP_TIMER_TICK_INT_MASK_SET_REG \ +- (_OMAP_TIMER_TICK_INT_MASK_SET_OFFSET | (WP_TOCR << WPSHIFT)) +- +-#define OMAP_TIMER_TICK_INT_MASK_COUNT_REG \ +- (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT)) +- +-struct omap_dm_timer { +- unsigned long phys_base; +- int irq; +-#ifdef CONFIG_ARCH_OMAP2PLUS +- struct clk *iclk, *fclk; +-#endif +- void __iomem *io_base; +- unsigned reserved:1; +- unsigned enabled:1; +- unsigned posted:1; +-}; +- + static int dm_timer_count; + + #ifdef CONFIG_ARCH_OMAP1 +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index 330bd17..3203105 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -92,5 +92,130 @@ void omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value + + int omap_dm_timers_active(void); + ++/* ++ * Do not use the defines below, they are not needed. They should be only ++ * used by dmtimer.c and sys_timer related code. ++ */ ++ ++/* register offsets */ ++#define _OMAP_TIMER_ID_OFFSET 0x00 ++#define _OMAP_TIMER_OCP_CFG_OFFSET 0x10 ++#define _OMAP_TIMER_SYS_STAT_OFFSET 0x14 ++#define _OMAP_TIMER_STAT_OFFSET 0x18 ++#define _OMAP_TIMER_INT_EN_OFFSET 0x1c ++#define _OMAP_TIMER_WAKEUP_EN_OFFSET 0x20 ++#define _OMAP_TIMER_CTRL_OFFSET 0x24 ++#define OMAP_TIMER_CTRL_GPOCFG (1 << 14) ++#define OMAP_TIMER_CTRL_CAPTMODE (1 << 13) ++#define OMAP_TIMER_CTRL_PT (1 << 12) ++#define OMAP_TIMER_CTRL_TCM_LOWTOHIGH (0x1 << 8) ++#define OMAP_TIMER_CTRL_TCM_HIGHTOLOW (0x2 << 8) ++#define OMAP_TIMER_CTRL_TCM_BOTHEDGES (0x3 << 8) ++#define OMAP_TIMER_CTRL_SCPWM (1 << 7) ++#define OMAP_TIMER_CTRL_CE (1 << 6) /* compare enable */ ++#define OMAP_TIMER_CTRL_PRE (1 << 5) /* prescaler enable */ ++#define OMAP_TIMER_CTRL_PTV_SHIFT 2 /* prescaler value shift */ ++#define OMAP_TIMER_CTRL_POSTED (1 << 2) ++#define OMAP_TIMER_CTRL_AR (1 << 1) /* auto-reload enable */ ++#define OMAP_TIMER_CTRL_ST (1 << 0) /* start timer */ ++#define _OMAP_TIMER_COUNTER_OFFSET 0x28 ++#define _OMAP_TIMER_LOAD_OFFSET 0x2c ++#define _OMAP_TIMER_TRIGGER_OFFSET 0x30 ++#define _OMAP_TIMER_WRITE_PEND_OFFSET 0x34 ++#define WP_NONE 0 /* no write pending bit */ ++#define WP_TCLR (1 << 0) ++#define WP_TCRR (1 << 1) ++#define WP_TLDR (1 << 2) ++#define WP_TTGR (1 << 3) ++#define WP_TMAR (1 << 4) ++#define WP_TPIR (1 << 5) ++#define WP_TNIR (1 << 6) ++#define WP_TCVR (1 << 7) ++#define WP_TOCR (1 << 8) ++#define WP_TOWR (1 << 9) ++#define _OMAP_TIMER_MATCH_OFFSET 0x38 ++#define _OMAP_TIMER_CAPTURE_OFFSET 0x3c ++#define _OMAP_TIMER_IF_CTRL_OFFSET 0x40 ++#define _OMAP_TIMER_CAPTURE2_OFFSET 0x44 /* TCAR2, 34xx only */ ++#define _OMAP_TIMER_TICK_POS_OFFSET 0x48 /* TPIR, 34xx only */ ++#define _OMAP_TIMER_TICK_NEG_OFFSET 0x4c /* TNIR, 34xx only */ ++#define _OMAP_TIMER_TICK_COUNT_OFFSET 0x50 /* TCVR, 34xx only */ ++#define _OMAP_TIMER_TICK_INT_MASK_SET_OFFSET 0x54 /* TOCR, 34xx only */ ++#define _OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET 0x58 /* TOWR, 34xx only */ ++ ++/* register offsets with the write pending bit encoded */ ++#define WPSHIFT 16 ++ ++#define OMAP_TIMER_ID_REG (_OMAP_TIMER_ID_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_OCP_CFG_REG (_OMAP_TIMER_OCP_CFG_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_SYS_STAT_REG (_OMAP_TIMER_SYS_STAT_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_STAT_REG (_OMAP_TIMER_STAT_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_INT_EN_REG (_OMAP_TIMER_INT_EN_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_WAKEUP_EN_REG (_OMAP_TIMER_WAKEUP_EN_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_CTRL_REG (_OMAP_TIMER_CTRL_OFFSET \ ++ | (WP_TCLR << WPSHIFT)) ++ ++#define OMAP_TIMER_COUNTER_REG (_OMAP_TIMER_COUNTER_OFFSET \ ++ | (WP_TCRR << WPSHIFT)) ++ ++#define OMAP_TIMER_LOAD_REG (_OMAP_TIMER_LOAD_OFFSET \ ++ | (WP_TLDR << WPSHIFT)) ++ ++#define OMAP_TIMER_TRIGGER_REG (_OMAP_TIMER_TRIGGER_OFFSET \ ++ | (WP_TTGR << WPSHIFT)) ++ ++#define OMAP_TIMER_WRITE_PEND_REG (_OMAP_TIMER_WRITE_PEND_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_MATCH_REG (_OMAP_TIMER_MATCH_OFFSET \ ++ | (WP_TMAR << WPSHIFT)) ++ ++#define OMAP_TIMER_CAPTURE_REG (_OMAP_TIMER_CAPTURE_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_IF_CTRL_REG (_OMAP_TIMER_IF_CTRL_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_CAPTURE2_REG (_OMAP_TIMER_CAPTURE2_OFFSET \ ++ | (WP_NONE << WPSHIFT)) ++ ++#define OMAP_TIMER_TICK_POS_REG (_OMAP_TIMER_TICK_POS_OFFSET \ ++ | (WP_TPIR << WPSHIFT)) ++ ++#define OMAP_TIMER_TICK_NEG_REG (_OMAP_TIMER_TICK_NEG_OFFSET \ ++ | (WP_TNIR << WPSHIFT)) ++ ++#define OMAP_TIMER_TICK_COUNT_REG (_OMAP_TIMER_TICK_COUNT_OFFSET \ ++ | (WP_TCVR << WPSHIFT)) ++ ++#define OMAP_TIMER_TICK_INT_MASK_SET_REG \ ++ (_OMAP_TIMER_TICK_INT_MASK_SET_OFFSET | (WP_TOCR << WPSHIFT)) ++ ++#define OMAP_TIMER_TICK_INT_MASK_COUNT_REG \ ++ (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT)) ++ ++struct omap_dm_timer { ++ unsigned long phys_base; ++ int irq; ++#ifdef CONFIG_ARCH_OMAP2PLUS ++ struct clk *iclk, *fclk; ++#endif ++ void __iomem *io_base; ++ unsigned reserved:1; ++ unsigned enabled:1; ++ unsigned posted:1; ++}; + + #endif /* __ASM_ARCH_DMTIMER_H */ +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0006-omap-Make-a-subset-of-dmtimer-functions-into-inline-.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0006-omap-Make-a-subset-of-dmtimer-functions-into-inline-.patch new file mode 100644 index 00000000..894c209d --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0006-omap-Make-a-subset-of-dmtimer-functions-into-inline-.patch @@ -0,0 +1,323 @@ +From e37c3d49a7642a25996d86d97d4e6f36e4c7ed8a Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:48 -0700 +Subject: [PATCH 006/149] omap: Make a subset of dmtimer functions into inline functions + +This will allow us to share the code between system timer and +dmtimer device driver code without having to initialize all the +dmtimers early. This change will also make the timer_set_next_event +more efficient as the inline functions will optimize the code +better for the timer reprogramming. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/plat-omap/dmtimer.c | 78 ++++--------------- + arch/arm/plat-omap/include/plat/dmtimer.h | 119 +++++++++++++++++++++++++++++ + 2 files changed, 136 insertions(+), 61 deletions(-) + +diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c +index dfdc3b2..7c5cb4e 100644 +--- a/arch/arm/plat-omap/dmtimer.c ++++ b/arch/arm/plat-omap/dmtimer.c +@@ -170,11 +170,7 @@ static spinlock_t dm_timer_lock; + */ + static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg) + { +- if (timer->posted) +- while (readl(timer->io_base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) +- & (reg >> WPSHIFT)) +- cpu_relax(); +- return readl(timer->io_base + (reg & 0xff)); ++ return __omap_dm_timer_read(timer->io_base, reg, timer->posted); + } + + /* +@@ -186,11 +182,7 @@ static inline u32 omap_dm_timer_read_reg(struct omap_dm_timer *timer, u32 reg) + static void omap_dm_timer_write_reg(struct omap_dm_timer *timer, u32 reg, + u32 value) + { +- if (timer->posted) +- while (readl(timer->io_base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) +- & (reg >> WPSHIFT)) +- cpu_relax(); +- writel(value, timer->io_base + (reg & 0xff)); ++ __omap_dm_timer_write(timer->io_base, reg, value, timer->posted); + } + + static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer) +@@ -209,7 +201,7 @@ static void omap_dm_timer_wait_for_reset(struct omap_dm_timer *timer) + + static void omap_dm_timer_reset(struct omap_dm_timer *timer) + { +- u32 l; ++ int autoidle = 0, wakeup = 0; + + if (!cpu_class_is_omap2() || timer != &dm_timers[0]) { + omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, 0x06); +@@ -217,28 +209,21 @@ static void omap_dm_timer_reset(struct omap_dm_timer *timer) + } + omap_dm_timer_set_source(timer, OMAP_TIMER_SRC_32_KHZ); + +- l = omap_dm_timer_read_reg(timer, OMAP_TIMER_OCP_CFG_REG); +- l |= 0x02 << 3; /* Set to smart-idle mode */ +- l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ +- + /* Enable autoidle on OMAP2 / OMAP3 */ + if (cpu_is_omap24xx() || cpu_is_omap34xx()) +- l |= 0x1 << 0; ++ autoidle = 1; + + /* + * Enable wake-up on OMAP2 CPUs. + */ + if (cpu_class_is_omap2()) +- l |= 1 << 2; +- omap_dm_timer_write_reg(timer, OMAP_TIMER_OCP_CFG_REG, l); ++ wakeup = 1; + +- /* Match hardware reset default of posted mode */ +- omap_dm_timer_write_reg(timer, OMAP_TIMER_IF_CTRL_REG, +- OMAP_TIMER_CTRL_POSTED); ++ __omap_dm_timer_reset(timer->io_base, autoidle, wakeup); + timer->posted = 1; + } + +-static void omap_dm_timer_prepare(struct omap_dm_timer *timer) ++void omap_dm_timer_prepare(struct omap_dm_timer *timer) + { + omap_dm_timer_enable(timer); + omap_dm_timer_reset(timer); +@@ -410,25 +395,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_start); + + void omap_dm_timer_stop(struct omap_dm_timer *timer) + { +- u32 l; ++ unsigned long rate = 0; + +- l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); +- if (l & OMAP_TIMER_CTRL_ST) { +- l &= ~0x1; +- omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); + #ifdef CONFIG_ARCH_OMAP2PLUS +- /* Readback to make sure write has completed */ +- omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); +- /* +- * Wait for functional clock period x 3.5 to make sure that +- * timer is stopped +- */ +- udelay(3500000 / clk_get_rate(timer->fclk) + 1); ++ rate = clk_get_rate(timer->fclk); + #endif +- } +- /* Ack possibly pending interrupt */ +- omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, +- OMAP_TIMER_INT_OVERFLOW); ++ ++ __omap_dm_timer_stop(timer->io_base, timer->posted, rate); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_stop); + +@@ -451,22 +424,11 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); + + int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) + { +- int ret = -EINVAL; +- + if (source < 0 || source >= 3) + return -EINVAL; + +- clk_disable(timer->fclk); +- ret = clk_set_parent(timer->fclk, dm_source_clocks[source]); +- clk_enable(timer->fclk); +- +- /* +- * When the functional clock disappears, too quick writes seem +- * to cause an abort. XXX Is this still necessary? +- */ +- __delay(300000); +- +- return ret; ++ return __omap_dm_timer_set_source(timer->fclk, ++ dm_source_clocks[source]); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); + +@@ -504,8 +466,7 @@ void omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, + } + l |= OMAP_TIMER_CTRL_ST; + +- omap_dm_timer_write_reg(timer, OMAP_TIMER_COUNTER_REG, load); +- omap_dm_timer_write_reg(timer, OMAP_TIMER_CTRL_REG, l); ++ __omap_dm_timer_load_start(timer->io_base, l, load, timer->posted); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start); + +@@ -558,8 +519,7 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler); + void omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, + unsigned int value) + { +- omap_dm_timer_write_reg(timer, OMAP_TIMER_INT_EN_REG, value); +- omap_dm_timer_write_reg(timer, OMAP_TIMER_WAKEUP_EN_REG, value); ++ __omap_dm_timer_int_enable(timer->io_base, value); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable); + +@@ -575,17 +535,13 @@ EXPORT_SYMBOL_GPL(omap_dm_timer_read_status); + + void omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) + { +- omap_dm_timer_write_reg(timer, OMAP_TIMER_STAT_REG, value); ++ __omap_dm_timer_write_status(timer->io_base, value); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_write_status); + + unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) + { +- unsigned int l; +- +- l = omap_dm_timer_read_reg(timer, OMAP_TIMER_COUNTER_REG); +- +- return l; ++ return __omap_dm_timer_read_counter(timer->io_base, timer->posted); + } + EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter); + +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index 3203105..54664a7 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -32,6 +32,9 @@ + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#include ++#include ++ + #ifndef __ASM_ARCH_DMTIMER_H + #define __ASM_ARCH_DMTIMER_H + +@@ -218,4 +221,120 @@ struct omap_dm_timer { + unsigned posted:1; + }; + ++void omap_dm_timer_prepare(struct omap_dm_timer *timer); ++ ++static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg, ++ int posted) ++{ ++ if (posted) ++ while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) ++ & (reg >> WPSHIFT)) ++ cpu_relax(); ++ ++ return __raw_readl(base + (reg & 0xff)); ++} ++ ++static inline void __omap_dm_timer_write(void __iomem *base, u32 reg, u32 val, ++ int posted) ++{ ++ if (posted) ++ while (__raw_readl(base + (OMAP_TIMER_WRITE_PEND_REG & 0xff)) ++ & (reg >> WPSHIFT)) ++ cpu_relax(); ++ ++ __raw_writel(val, base + (reg & 0xff)); ++} ++ ++/* Assumes the source clock has been set by caller */ ++static inline void __omap_dm_timer_reset(void __iomem *base, int autoidle, ++ int wakeup) ++{ ++ u32 l; ++ ++ l = __omap_dm_timer_read(base, OMAP_TIMER_OCP_CFG_REG, 0); ++ l |= 0x02 << 3; /* Set to smart-idle mode */ ++ l |= 0x2 << 8; /* Set clock activity to perserve f-clock on idle */ ++ ++ if (autoidle) ++ l |= 0x1 << 0; ++ ++ if (wakeup) ++ l |= 1 << 2; ++ ++ __omap_dm_timer_write(base, OMAP_TIMER_OCP_CFG_REG, l, 0); ++ ++ /* Match hardware reset default of posted mode */ ++ __omap_dm_timer_write(base, OMAP_TIMER_IF_CTRL_REG, ++ OMAP_TIMER_CTRL_POSTED, 0); ++} ++ ++static inline int __omap_dm_timer_set_source(struct clk *timer_fck, ++ struct clk *parent) ++{ ++ int ret; ++ ++ clk_disable(timer_fck); ++ ret = clk_set_parent(timer_fck, parent); ++ clk_enable(timer_fck); ++ ++ /* ++ * When the functional clock disappears, too quick writes seem ++ * to cause an abort. XXX Is this still necessary? ++ */ ++ __delay(300000); ++ ++ return ret; ++} ++ ++static inline void __omap_dm_timer_stop(void __iomem *base, int posted, ++ unsigned long rate) ++{ ++ u32 l; ++ ++ l = __omap_dm_timer_read(base, OMAP_TIMER_CTRL_REG, posted); ++ if (l & OMAP_TIMER_CTRL_ST) { ++ l &= ~0x1; ++ __omap_dm_timer_write(base, OMAP_TIMER_CTRL_REG, l, posted); ++#ifdef CONFIG_ARCH_OMAP2PLUS ++ /* Readback to make sure write has completed */ ++ __omap_dm_timer_read(base, OMAP_TIMER_CTRL_REG, posted); ++ /* ++ * Wait for functional clock period x 3.5 to make sure that ++ * timer is stopped ++ */ ++ udelay(3500000 / rate + 1); ++#endif ++ } ++ ++ /* Ack possibly pending interrupt */ ++ __omap_dm_timer_write(base, OMAP_TIMER_STAT_REG, ++ OMAP_TIMER_INT_OVERFLOW, 0); ++} ++ ++static inline void __omap_dm_timer_load_start(void __iomem *base, u32 ctrl, ++ unsigned int load, int posted) ++{ ++ __omap_dm_timer_write(base, OMAP_TIMER_COUNTER_REG, load, posted); ++ __omap_dm_timer_write(base, OMAP_TIMER_CTRL_REG, ctrl, posted); ++} ++ ++static inline void __omap_dm_timer_int_enable(void __iomem *base, ++ unsigned int value) ++{ ++ __omap_dm_timer_write(base, OMAP_TIMER_INT_EN_REG, value, 0); ++ __omap_dm_timer_write(base, OMAP_TIMER_WAKEUP_EN_REG, value, 0); ++} ++ ++static inline unsigned int __omap_dm_timer_read_counter(void __iomem *base, ++ int posted) ++{ ++ return __omap_dm_timer_read(base, OMAP_TIMER_COUNTER_REG, posted); ++} ++ ++static inline void __omap_dm_timer_write_status(void __iomem *base, ++ unsigned int value) ++{ ++ __omap_dm_timer_write(base, OMAP_TIMER_STAT_REG, value, 0); ++} ++ + #endif /* __ASM_ARCH_DMTIMER_H */ +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0007-omap2-Use-dmtimer-macros-for-clockevent.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0007-omap2-Use-dmtimer-macros-for-clockevent.patch new file mode 100644 index 00000000..403547b3 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0007-omap2-Use-dmtimer-macros-for-clockevent.patch @@ -0,0 +1,279 @@ +From 8f20e73dc841e924d8e9cb97b83119f2b45c9dbb Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:48 -0700 +Subject: [PATCH 007/149] omap2+: Use dmtimer macros for clockevent + +This patch makes timer-gp.c to use only a subset of dmtimer +functions without the need to initialize dmtimer code early. + +Also note that now with the inline functions, timer_set_next_event +becomes more efficient in the lines of assembly code. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap2/timer-gp.c | 147 ++++++++++++++++++++++------- + arch/arm/plat-omap/include/plat/dmtimer.h | 1 + + 2 files changed, 113 insertions(+), 35 deletions(-) + +diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c +index a0d8e83..62c0d5c 100644 +--- a/arch/arm/mach-omap2/timer-gp.c ++++ b/arch/arm/mach-omap2/timer-gp.c +@@ -45,10 +45,33 @@ + + #include "timer-gp.h" + ++/* Parent clocks, eventually these will come from the clock framework */ ++ ++#define OMAP2_MPU_SOURCE "sys_ck" ++#define OMAP3_MPU_SOURCE OMAP2_MPU_SOURCE ++#define OMAP4_MPU_SOURCE "sys_clkin_ck" ++#define OMAP2_32K_SOURCE "func_32k_ck" ++#define OMAP3_32K_SOURCE "omap_32k_fck" ++#define OMAP4_32K_SOURCE "sys_32k_ck" ++ ++#ifdef CONFIG_OMAP_32K_TIMER ++#define OMAP2_CLKEV_SOURCE OMAP2_32K_SOURCE ++#define OMAP3_CLKEV_SOURCE OMAP3_32K_SOURCE ++#define OMAP4_CLKEV_SOURCE OMAP4_32K_SOURCE ++#define OMAP3_SECURE_TIMER 12 ++#else ++#define OMAP2_CLKEV_SOURCE OMAP2_MPU_SOURCE ++#define OMAP3_CLKEV_SOURCE OMAP3_MPU_SOURCE ++#define OMAP4_CLKEV_SOURCE OMAP4_MPU_SOURCE ++#define OMAP3_SECURE_TIMER 1 ++#endif + + /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ + #define MAX_GPTIMER_ID 12 + ++/* Clockevent code */ ++ ++static struct omap_dm_timer clkev; + static struct omap_dm_timer *gptimer; + static struct clock_event_device clockevent_gpt; + static u8 __initdata gptimer_id = 1; +@@ -57,10 +80,9 @@ struct omap_dm_timer *gptimer_wakeup; + + static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) + { +- struct omap_dm_timer *gpt = (struct omap_dm_timer *)dev_id; + struct clock_event_device *evt = &clockevent_gpt; + +- omap_dm_timer_write_status(gpt, OMAP_TIMER_INT_OVERFLOW); ++ __omap_dm_timer_write_status(clkev.io_base, OMAP_TIMER_INT_OVERFLOW); + + evt->event_handler(evt); + return IRQ_HANDLED; +@@ -75,7 +97,8 @@ static struct irqaction omap2_gp_timer_irq = { + static int omap2_gp_timer_set_next_event(unsigned long cycles, + struct clock_event_device *evt) + { +- omap_dm_timer_set_load_start(gptimer, 0, 0xffffffff - cycles); ++ __omap_dm_timer_load_start(clkev.io_base, OMAP_TIMER_CTRL_ST, ++ 0xffffffff - cycles, 1); + + return 0; + } +@@ -85,13 +108,18 @@ static void omap2_gp_timer_set_mode(enum clock_event_mode mode, + { + u32 period; + +- omap_dm_timer_stop(gptimer); ++ __omap_dm_timer_stop(clkev.io_base, 1, clkev.rate); + + switch (mode) { + case CLOCK_EVT_MODE_PERIODIC: +- period = clk_get_rate(omap_dm_timer_get_fclk(gptimer)) / HZ; ++ period = clkev.rate / HZ; + period -= 1; +- omap_dm_timer_set_load_start(gptimer, 1, 0xffffffff - period); ++ /* Looks like we need to first set the load value separately */ ++ __omap_dm_timer_write(clkev.io_base, OMAP_TIMER_LOAD_REG, ++ 0xffffffff - period, 1); ++ __omap_dm_timer_load_start(clkev.io_base, ++ OMAP_TIMER_CTRL_AR | OMAP_TIMER_CTRL_ST, ++ 0xffffffff - period, 1); + break; + case CLOCK_EVT_MODE_ONESHOT: + break; +@@ -130,43 +158,89 @@ int __init omap2_gp_clockevent_set_gptimer(u8 id) + return 0; + } + +-static void __init omap2_gp_clockevent_init(void) ++static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, ++ int gptimer_id, ++ const char *fck_source) + { +- u32 tick_rate; +- int src; +- char clockevent_hwmod_name[8]; /* 8 = sizeof("timerXX0") */ ++ char name[10]; /* 10 = sizeof("gptXX_Xck0") */ ++ struct omap_hwmod *oh; ++ size_t size; ++ int res = 0; ++ ++ sprintf(name, "timer%d", gptimer_id); ++ omap_hwmod_setup_one(name); ++ oh = omap_hwmod_lookup(name); ++ if (!oh) ++ return -ENODEV; ++ ++ timer->irq = oh->mpu_irqs[0].irq; ++ timer->phys_base = oh->slaves[0]->addr->pa_start; ++ size = oh->slaves[0]->addr->pa_end - timer->phys_base; ++ ++ /* Static mapping, never released */ ++ timer->io_base = ioremap(timer->phys_base, size); ++ if (!timer->io_base) ++ return -ENXIO; ++ ++ /* After the dmtimer is using hwmod these clocks won't be needed */ ++ sprintf(name, "gpt%d_fck", gptimer_id); ++ timer->fclk = clk_get(NULL, name); ++ if (IS_ERR(timer->fclk)) ++ return -ENODEV; ++ ++ sprintf(name, "gpt%d_ick", gptimer_id); ++ timer->iclk = clk_get(NULL, name); ++ if (IS_ERR(timer->iclk)) { ++ clk_put(timer->fclk); ++ return -ENODEV; ++ } + +- inited = 1; ++ omap_hwmod_enable(oh); ++ ++ if (gptimer_id != 12) { ++ struct clk *src; ++ ++ src = clk_get(NULL, fck_source); ++ if (IS_ERR(src)) { ++ res = -EINVAL; ++ } else { ++ res = __omap_dm_timer_set_source(timer->fclk, src); ++ if (IS_ERR_VALUE(res)) ++ pr_warning("%s: timer%i cannot set source\n", ++ __func__, gptimer_id); ++ clk_put(src); ++ } ++ } ++ __omap_dm_timer_reset(timer->io_base, 1, 1); ++ timer->posted = 1; ++ ++ timer->rate = clk_get_rate(timer->fclk); + +- sprintf(clockevent_hwmod_name, "timer%d", gptimer_id); +- omap_hwmod_setup_one(clockevent_hwmod_name); ++ timer->reserved = 1; + + gptimer = omap_dm_timer_request_specific(gptimer_id); + BUG_ON(gptimer == NULL); + gptimer_wakeup = gptimer; + +-#if defined(CONFIG_OMAP_32K_TIMER) +- src = OMAP_TIMER_SRC_32_KHZ; +-#else +- src = OMAP_TIMER_SRC_SYS_CLK; +- WARN(gptimer_id == 12, "WARNING: GPTIMER12 can only use the " +- "secure 32KiHz clock source\n"); +-#endif ++ return res; ++} + +- if (gptimer_id != 12) +- WARN(IS_ERR_VALUE(omap_dm_timer_set_source(gptimer, src)), +- "timer-gp: omap_dm_timer_set_source() failed\n"); ++static void __init omap2_gp_clockevent_init(int gptimer_id, ++ const char *fck_source) ++{ ++ int res; + +- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer)); ++ inited = 1; + +- pr_info("OMAP clockevent source: GPTIMER%d at %u Hz\n", +- gptimer_id, tick_rate); ++ res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); ++ BUG_ON(res); + + omap2_gp_timer_irq.dev_id = (void *)gptimer; +- setup_irq(omap_dm_timer_get_irq(gptimer), &omap2_gp_timer_irq); +- omap_dm_timer_set_int_enable(gptimer, OMAP_TIMER_INT_OVERFLOW); ++ setup_irq(clkev.irq, &omap2_gp_timer_irq); + +- clockevent_gpt.mult = div_sc(tick_rate, NSEC_PER_SEC, ++ __omap_dm_timer_int_enable(clkev.io_base, OMAP_TIMER_INT_OVERFLOW); ++ ++ clockevent_gpt.mult = div_sc(clkev.rate, NSEC_PER_SEC, + clockevent_gpt.shift); + clockevent_gpt.max_delta_ns = + clockevent_delta2ns(0xffffffff, &clockevent_gpt); +@@ -176,6 +250,9 @@ static void __init omap2_gp_clockevent_init(void) + + clockevent_gpt.cpumask = cpumask_of(0); + clockevents_register_device(&clockevent_gpt); ++ ++ pr_info("OMAP clockevent source: GPTIMER%d at %lu Hz\n", ++ gptimer_id, clkev.rate); + } + + /* Clocksource code */ +@@ -247,11 +324,11 @@ static void __init omap2_gp_clocksource_init(void) + } + #endif + +-#define OMAP_SYS_TIMER_INIT(name) \ ++#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src) \ + static void __init omap##name##_timer_init(void) \ + { \ + omap_dm_timer_init(); \ +- omap2_gp_clockevent_init(); \ ++ omap2_gp_clockevent_init((clkev_nr), clkev_src); \ + omap2_gp_clocksource_init(); \ + } + +@@ -261,14 +338,14 @@ struct sys_timer omap##name##_timer = { \ + }; + + #ifdef CONFIG_ARCH_OMAP2 +-OMAP_SYS_TIMER_INIT(2) ++OMAP_SYS_TIMER_INIT(2, 1, OMAP2_CLKEV_SOURCE) + OMAP_SYS_TIMER(2) + #endif + + #ifdef CONFIG_ARCH_OMAP3 +-OMAP_SYS_TIMER_INIT(3) ++OMAP_SYS_TIMER_INIT(3, 1, OMAP3_CLKEV_SOURCE) + OMAP_SYS_TIMER(3) +-OMAP_SYS_TIMER_INIT(3_secure) ++OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE) + OMAP_SYS_TIMER(3_secure) + #endif + +@@ -280,7 +357,7 @@ static void __init omap4_timer_init(void) + BUG_ON(!twd_base); + #endif + omap_dm_timer_init(); +- omap2_gp_clockevent_init(); ++ omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); + omap2_gp_clocksource_init(); + } + OMAP_SYS_TIMER(4) +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index 54664a7..dd8b3ff 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -216,6 +216,7 @@ struct omap_dm_timer { + struct clk *iclk, *fclk; + #endif + void __iomem *io_base; ++ unsigned long rate; + unsigned reserved:1; + unsigned enabled:1; + unsigned posted:1; +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0008-omap2-Remove-gptimer_wakeup-for-now.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0008-omap2-Remove-gptimer_wakeup-for-now.patch new file mode 100644 index 00000000..3e8f0525 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0008-omap2-Remove-gptimer_wakeup-for-now.patch @@ -0,0 +1,177 @@ +From 426a4d3d331abef9fb16e9207885bda1db8c7d69 Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:49 -0700 +Subject: [PATCH 008/149] omap2+: Remove gptimer_wakeup for now + +This removes the support for setting the wake-up timer for debugging. + +Later on we can reserve gptimer1 for PM code only and have similar +functionality. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap2/pm-debug.c | 28 ---------------------------- + arch/arm/mach-omap2/pm.h | 6 ------ + arch/arm/mach-omap2/pm34xx.c | 4 ---- + arch/arm/mach-omap2/timer-gp.c | 8 +------- + arch/arm/plat-omap/include/plat/dmtimer.h | 1 - + 5 files changed, 1 insertions(+), 46 deletions(-) + +diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c +index e01da45..2c35bd3 100644 +--- a/arch/arm/mach-omap2/pm-debug.c ++++ b/arch/arm/mach-omap2/pm-debug.c +@@ -31,7 +31,6 @@ + #include + #include "powerdomain.h" + #include "clockdomain.h" +-#include + #include + + #include "cm2xxx_3xxx.h" +@@ -41,8 +40,6 @@ + int omap2_pm_debug; + u32 enable_off_mode; + u32 sleep_while_idle; +-u32 wakeup_timer_seconds; +-u32 wakeup_timer_milliseconds; + + #define DUMP_PRM_MOD_REG(mod, reg) \ + regs[reg_count].name = #mod "." #reg; \ +@@ -162,23 +159,6 @@ void omap2_pm_dump(int mode, int resume, unsigned int us) + printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val); + } + +-void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds) +-{ +- u32 tick_rate, cycles; +- +- if (!seconds && !milliseconds) +- return; +- +- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup)); +- cycles = tick_rate * seconds + tick_rate * milliseconds / 1000; +- omap_dm_timer_stop(gptimer_wakeup); +- omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles); +- +- pr_info("PM: Resume timer in %u.%03u secs" +- " (%d ticks at %d ticks/sec.)\n", +- seconds, milliseconds, cycles, tick_rate); +-} +- + #ifdef CONFIG_DEBUG_FS + #include + #include +@@ -576,9 +556,6 @@ static int option_set(void *data, u64 val) + { + u32 *option = data; + +- if (option == &wakeup_timer_milliseconds && val >= 1000) +- return -EINVAL; +- + *option = val; + + if (option == &enable_off_mode) { +@@ -641,11 +618,6 @@ static int pm_dbg_init(void) + &enable_off_mode, &pm_dbg_option_fops); + (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_IWUSR, d, +- &wakeup_timer_seconds, &pm_dbg_option_fops); +- (void) debugfs_create_file("wakeup_timer_milliseconds", +- S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds, +- &pm_dbg_option_fops); + pm_dbg_init_done = 1; + + return 0; +diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h +index 45bcfce..c3a367e 100644 +--- a/arch/arm/mach-omap2/pm.h ++++ b/arch/arm/mach-omap2/pm.h +@@ -60,19 +60,13 @@ inline void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) + extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); + extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); + +-extern u32 wakeup_timer_seconds; +-extern u32 wakeup_timer_milliseconds; +-extern struct omap_dm_timer *gptimer_wakeup; +- + #ifdef CONFIG_PM_DEBUG + extern void omap2_pm_dump(int mode, int resume, unsigned int us); +-extern void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds); + extern int omap2_pm_debug; + extern u32 enable_off_mode; + extern u32 sleep_while_idle; + #else + #define omap2_pm_dump(mode, resume, us) do {} while (0); +-#define omap2_pm_wakeup_on_timer(seconds, milliseconds) do {} while (0); + #define omap2_pm_debug 0 + #define enable_off_mode 0 + #define sleep_while_idle 0 +diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c +index c155c9d..4cb636a 100644 +--- a/arch/arm/mach-omap2/pm34xx.c ++++ b/arch/arm/mach-omap2/pm34xx.c +@@ -534,10 +534,6 @@ static int omap3_pm_suspend(void) + struct power_state *pwrst; + int state, ret = 0; + +- if (wakeup_timer_seconds || wakeup_timer_milliseconds) +- omap2_pm_wakeup_on_timer(wakeup_timer_seconds, +- wakeup_timer_milliseconds); +- + /* Read current next_pwrsts */ + list_for_each_entry(pwrst, &pwrst_list, node) + pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm); +diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c +index 62c0d5c..578e9df 100644 +--- a/arch/arm/mach-omap2/timer-gp.c ++++ b/arch/arm/mach-omap2/timer-gp.c +@@ -72,11 +72,9 @@ + /* Clockevent code */ + + static struct omap_dm_timer clkev; +-static struct omap_dm_timer *gptimer; + static struct clock_event_device clockevent_gpt; + static u8 __initdata gptimer_id = 1; + static u8 __initdata inited; +-struct omap_dm_timer *gptimer_wakeup; + + static irqreturn_t omap2_gp_timer_interrupt(int irq, void *dev_id) + { +@@ -218,10 +216,6 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, + + timer->reserved = 1; + +- gptimer = omap_dm_timer_request_specific(gptimer_id); +- BUG_ON(gptimer == NULL); +- gptimer_wakeup = gptimer; +- + return res; + } + +@@ -235,7 +229,7 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, + res = omap_dm_timer_init_one(&clkev, gptimer_id, fck_source); + BUG_ON(res); + +- omap2_gp_timer_irq.dev_id = (void *)gptimer; ++ omap2_gp_timer_irq.dev_id = (void *)&clkev; + setup_irq(clkev.irq, &omap2_gp_timer_irq); + + __omap_dm_timer_int_enable(clkev.io_base, OMAP_TIMER_INT_OVERFLOW); +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index dd8b3ff..8adcb18 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -59,7 +59,6 @@ + */ + #define OMAP_TIMER_IP_VERSION_1 0x1 + struct omap_dm_timer; +-extern struct omap_dm_timer *gptimer_wakeup; + struct clk; + + int omap_dm_timer_init(void); +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0009-OMAP3-SR-make-notify-independent-of-class.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0009-OMAP3-SR-make-notify-independent-of-class.patch new file mode 100644 index 00000000..7a2f91b2 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0009-OMAP3-SR-make-notify-independent-of-class.patch @@ -0,0 +1,47 @@ +From 492d2ffec3453c8fc887c73963d8e77ef9677189 Mon Sep 17 00:00:00 2001 +From: Nishanth Menon +Date: Mon, 14 Feb 2011 12:16:36 +0530 +Subject: [PATCH 009/149] OMAP3+: SR: make notify independent of class + +Interrupt notification mechanism of SmartReflex can be used by the +choice of implementation of the class driver. For example, Class 2 and +Class 1.5 of SmartReflex can both use the interrupt notification to +identify the transition of voltage or other events. + +Hence, the actual class does not matter for notifier. Let the class +driver's handling decide how it should be used. SmartReflex driver +should provide just the primitives. + +Signed-off-by: Nishanth Menon +Signed-off-by: Kevin Hilman +--- + arch/arm/mach-omap2/smartreflex.c | 6 ++---- + 1 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c +index fb7dc52..3ee7261 100644 +--- a/arch/arm/mach-omap2/smartreflex.c ++++ b/arch/arm/mach-omap2/smartreflex.c +@@ -143,7 +143,7 @@ static irqreturn_t sr_interrupt(int irq, void *data) + sr_write_reg(sr_info, IRQSTATUS, status); + } + +- if (sr_class->class_type == SR_CLASS2 && sr_class->notify) ++ if (sr_class->notify) + sr_class->notify(sr_info->voltdm, status); + + return IRQ_HANDLED; +@@ -258,9 +258,7 @@ static int sr_late_init(struct omap_sr *sr_info) + struct resource *mem; + int ret = 0; + +- if (sr_class->class_type == SR_CLASS2 && +- sr_class->notify_flags && sr_info->irq) { +- ++ if (sr_class->notify && sr_class->notify_flags && sr_info->irq) { + name = kasprintf(GFP_KERNEL, "sr_%s", sr_info->voltdm->name); + if (name == NULL) { + ret = -ENOMEM; +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0001-OMAP3-SR-disable-interrupt-by-default.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0010-OMAP3-SR-disable-interrupt-by-default.patch similarity index 82% rename from recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0001-OMAP3-SR-disable-interrupt-by-default.patch rename to recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0010-OMAP3-SR-disable-interrupt-by-default.patch index ebb1f14e..447d2424 100644 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0001-OMAP3-SR-disable-interrupt-by-default.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0010-OMAP3-SR-disable-interrupt-by-default.patch @@ -1,7 +1,7 @@ -From 0c06ec8074efa965a12ce79122ab64cebbb27dc9 Mon Sep 17 00:00:00 2001 +From 7810a0932b5e0d4fdf6c34cff735e227f5af8392 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 12:41:10 +0530 -Subject: [PATCH 1/7] OMAP3+: SR: disable interrupt by default +Subject: [PATCH 010/149] OMAP3+: SR: disable interrupt by default We will enable and disable interrupt on a need basis in the class driver. We need to keep the IRQ disabled by default else the @@ -20,10 +20,10 @@ Signed-off-by: Kevin Hilman 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c -index fb7dc52..998b57f 100644 +index 3ee7261..616ef62 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c -@@ -270,6 +270,7 @@ static int sr_late_init(struct omap_sr *sr_info) +@@ -268,6 +268,7 @@ static int sr_late_init(struct omap_sr *sr_info) 0, name, (void *)sr_info); if (ret) goto error; diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0002-OMAP3-SR-enable-disable-SR-only-on-need.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch similarity index 81% rename from recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0002-OMAP3-SR-enable-disable-SR-only-on-need.patch rename to recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch index 761e56db..d50e3ad1 100644 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0002-OMAP3-SR-enable-disable-SR-only-on-need.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0011-OMAP3-SR-enable-disable-SR-only-on-need.patch @@ -1,7 +1,7 @@ -From 2c555d8ee3544326033cb3b0ead6c0eb48cb4919 Mon Sep 17 00:00:00 2001 +From 50c59ea316d283dddb432ed03cffcb42a25bf7b9 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 21:14:17 +0530 -Subject: [PATCH 2/7] OMAP3+: SR: enable/disable SR only on need +Subject: [PATCH 011/149] OMAP3+: SR: enable/disable SR only on need Since we already know the state of the autocomp enablement, we can see if the requested state is different from the current state and @@ -14,10 +14,10 @@ Signed-off-by: Kevin Hilman 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c -index 998b57f..a4b4319 100644 +index 616ef62..3bd9fac 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c -@@ -809,10 +809,13 @@ static int omap_sr_autocomp_store(void *data, u64 val) +@@ -807,10 +807,13 @@ static int omap_sr_autocomp_store(void *data, u64 val) return -EINVAL; } diff --git a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0003-OMAP3-SR-fix-cosmetic-indentation.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0012-OMAP3-SR-fix-cosmetic-indentation.patch similarity index 86% rename from recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0003-OMAP3-SR-fix-cosmetic-indentation.patch rename to recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0012-OMAP3-SR-fix-cosmetic-indentation.patch index b528a9e7..3a0cb6b8 100644 --- a/recipes-kernel/linux/linux-3.0/for_3.1/pm-misc/0003-OMAP3-SR-fix-cosmetic-indentation.patch +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0012-OMAP3-SR-fix-cosmetic-indentation.patch @@ -1,7 +1,7 @@ -From 60b31f5fad1dda709f3e38ad88dcc8d1496db52d Mon Sep 17 00:00:00 2001 +From 0871e261feec9b1e02efc91201aeab9f11bc5ce3 Mon Sep 17 00:00:00 2001 From: Nishanth Menon Date: Mon, 14 Feb 2011 12:33:13 +0530 -Subject: [PATCH 3/7] OMAP3+: SR: fix cosmetic indentation +Subject: [PATCH 012/149] OMAP3+: SR: fix cosmetic indentation Error label case seems to have a 2 tab indentation when just 1 is necessary. @@ -13,10 +13,10 @@ Signed-off-by: Kevin Hilman 1 files changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c -index a4b4319..931879d 100644 +index 3bd9fac..2ce2fb7 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c -@@ -279,16 +279,16 @@ static int sr_late_init(struct omap_sr *sr_info) +@@ -277,16 +277,16 @@ static int sr_late_init(struct omap_sr *sr_info) return ret; error: diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0013-omap2-Reserve-clocksource-and-timesource-and-initial.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0013-omap2-Reserve-clocksource-and-timesource-and-initial.patch new file mode 100644 index 00000000..da63459c --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0013-omap2-Reserve-clocksource-and-timesource-and-initial.patch @@ -0,0 +1,125 @@ +From c3c0bfa5bf8ccbea4189cb76b842c51b8e3756c7 Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:49 -0700 +Subject: [PATCH 013/149] omap2+: Reserve clocksource and timesource and initialize dmtimer later + +There's no need to initialize the dmtimer framework early. +Just mark the clocksource and timesource as reserved, and +initialize dmtimer with an arch_initcall. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap1/timer32k.c | 4 ---- + arch/arm/mach-omap2/timer-gp.c | 6 ++++-- + arch/arm/plat-omap/dmtimer.c | 10 +++++++++- + arch/arm/plat-omap/include/plat/dmtimer.h | 3 +-- + 4 files changed, 14 insertions(+), 9 deletions(-) + +diff --git a/arch/arm/mach-omap1/timer32k.c b/arch/arm/mach-omap1/timer32k.c +index 13d7b8f..96604a5 100644 +--- a/arch/arm/mach-omap1/timer32k.c ++++ b/arch/arm/mach-omap1/timer32k.c +@@ -183,10 +183,6 @@ static __init void omap_init_32k_timer(void) + bool __init omap_32k_timer_init(void) + { + omap_init_clocksource_32k(); +- +-#ifdef CONFIG_OMAP_DM_TIMER +- omap_dm_timer_init(); +-#endif + omap_init_32k_timer(); + + return true; +diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c +index 578e9df..cf2ec85 100644 +--- a/arch/arm/mach-omap2/timer-gp.c ++++ b/arch/arm/mach-omap2/timer-gp.c +@@ -69,6 +69,8 @@ + /* MAX_GPTIMER_ID: number of GPTIMERs on the chip */ + #define MAX_GPTIMER_ID 12 + ++u32 sys_timer_reserved; ++ + /* Clockevent code */ + + static struct omap_dm_timer clkev; +@@ -195,6 +197,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, + + omap_hwmod_enable(oh); + ++ sys_timer_reserved |= (1 << (gptimer_id - 1)); ++ + if (gptimer_id != 12) { + struct clk *src; + +@@ -321,7 +325,6 @@ static void __init omap2_gp_clocksource_init(void) + #define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src) \ + static void __init omap##name##_timer_init(void) \ + { \ +- omap_dm_timer_init(); \ + omap2_gp_clockevent_init((clkev_nr), clkev_src); \ + omap2_gp_clocksource_init(); \ + } +@@ -350,7 +353,6 @@ static void __init omap4_timer_init(void) + twd_base = ioremap(OMAP44XX_LOCAL_TWD_BASE, SZ_256); + BUG_ON(!twd_base); + #endif +- omap_dm_timer_init(); + omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); + omap2_gp_clocksource_init(); + } +diff --git a/arch/arm/plat-omap/dmtimer.c b/arch/arm/plat-omap/dmtimer.c +index 7c5cb4e..8dfb818 100644 +--- a/arch/arm/plat-omap/dmtimer.c ++++ b/arch/arm/plat-omap/dmtimer.c +@@ -572,7 +572,7 @@ int omap_dm_timers_active(void) + } + EXPORT_SYMBOL_GPL(omap_dm_timers_active); + +-int __init omap_dm_timer_init(void) ++static int __init omap_dm_timer_init(void) + { + struct omap_dm_timer *timer; + int i, map_size = SZ_8K; /* Module 4KB + L4 4KB except on omap1 */ +@@ -625,8 +625,16 @@ int __init omap_dm_timer_init(void) + sprintf(clk_name, "gpt%d_fck", i + 1); + timer->fclk = clk_get(NULL, clk_name); + } ++ ++ /* One or two timers may be set up early for sys_timer */ ++ if (sys_timer_reserved & (1 << i)) { ++ timer->reserved = 1; ++ timer->posted = 1; ++ } + #endif + } + + return 0; + } ++ ++arch_initcall(omap_dm_timer_init); +diff --git a/arch/arm/plat-omap/include/plat/dmtimer.h b/arch/arm/plat-omap/include/plat/dmtimer.h +index 8adcb18..d0f3a2d 100644 +--- a/arch/arm/plat-omap/include/plat/dmtimer.h ++++ b/arch/arm/plat-omap/include/plat/dmtimer.h +@@ -61,8 +61,6 @@ + struct omap_dm_timer; + struct clk; + +-int omap_dm_timer_init(void); +- + struct omap_dm_timer *omap_dm_timer_request(void); + struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); + void omap_dm_timer_free(struct omap_dm_timer *timer); +@@ -221,6 +219,7 @@ struct omap_dm_timer { + unsigned posted:1; + }; + ++extern u32 sys_timer_reserved; + void omap_dm_timer_prepare(struct omap_dm_timer *timer); + + static inline u32 __omap_dm_timer_read(void __iomem *base, u32 reg, +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0014-omap2-Use-dmtimer-macros-for-clocksource.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0014-omap2-Use-dmtimer-macros-for-clocksource.patch new file mode 100644 index 00000000..a1a407ee --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0014-omap2-Use-dmtimer-macros-for-clocksource.patch @@ -0,0 +1,163 @@ +From 939c8d3b49f31a6e88d36a9915e1393d26533ba8 Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:49 -0700 +Subject: [PATCH 014/149] omap2+: Use dmtimer macros for clocksource + +Use dmtimer macros for clocksource. As with the clockevent, +this allows us to initialize the rest of dmtimer code later on. + +Note that eventually we will be initializing the timesource +from init_early so sched_clock will work properly for +CONFIG_PRINTK_TIME. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap2/timer-gp.c | 64 +++++++++++++++++++++---------------- + arch/arm/plat-omap/counter_32k.c | 2 +- + 2 files changed, 37 insertions(+), 29 deletions(-) + +diff --git a/arch/arm/mach-omap2/timer-gp.c b/arch/arm/mach-omap2/timer-gp.c +index cf2ec85..2b8cb70 100644 +--- a/arch/arm/mach-omap2/timer-gp.c ++++ b/arch/arm/mach-omap2/timer-gp.c +@@ -262,20 +262,22 @@ static void __init omap2_gp_clockevent_init(int gptimer_id, + * sync counter. See clocksource setup in plat-omap/counter_32k.c + */ + +-static void __init omap2_gp_clocksource_init(void) ++static void __init omap2_gp_clocksource_init(int unused, const char *dummy) + { + omap_init_clocksource_32k(); + } + + #else ++ ++static struct omap_dm_timer clksrc; ++ + /* + * clocksource + */ + static DEFINE_CLOCK_DATA(cd); +-static struct omap_dm_timer *gpt_clocksource; + static cycle_t clocksource_read_cycles(struct clocksource *cs) + { +- return (cycle_t)omap_dm_timer_read_counter(gpt_clocksource); ++ return (cycle_t)__omap_dm_timer_read_counter(clksrc.io_base, 1); + } + + static struct clocksource clocksource_gpt = { +@@ -290,43 +292,48 @@ static void notrace dmtimer_update_sched_clock(void) + { + u32 cyc; + +- cyc = omap_dm_timer_read_counter(gpt_clocksource); ++ cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1); + + update_sched_clock(&cd, cyc, (u32)~0); + } + +-/* Setup free-running counter for clocksource */ +-static void __init omap2_gp_clocksource_init(void) ++unsigned long long notrace sched_clock(void) + { +- static struct omap_dm_timer *gpt; +- u32 tick_rate; +- static char err1[] __initdata = KERN_ERR +- "%s: failed to request dm-timer\n"; +- static char err2[] __initdata = KERN_ERR +- "%s: can't register clocksource!\n"; ++ u32 cyc = 0; + +- gpt = omap_dm_timer_request(); +- if (!gpt) +- printk(err1, clocksource_gpt.name); +- gpt_clocksource = gpt; ++ if (clksrc.reserved) ++ cyc = __omap_dm_timer_read_counter(clksrc.io_base, 1); + +- omap_dm_timer_set_source(gpt, OMAP_TIMER_SRC_SYS_CLK); +- tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gpt)); ++ return cyc_to_sched_clock(&cd, cyc, (u32)~0); ++} ++ ++/* Setup free-running counter for clocksource */ ++static void __init omap2_gp_clocksource_init(int gptimer_id, ++ const char *fck_source) ++{ ++ int res; ++ ++ res = omap_dm_timer_init_one(&clksrc, gptimer_id, fck_source); ++ BUG_ON(res); + +- omap_dm_timer_set_load_start(gpt, 1, 0); ++ pr_info("OMAP clocksource: GPTIMER%d at %lu Hz\n", ++ gptimer_id, clksrc.rate); + +- init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate); ++ __omap_dm_timer_load_start(clksrc.io_base, OMAP_TIMER_CTRL_ST, 0, 1); ++ init_sched_clock(&cd, dmtimer_update_sched_clock, 32, clksrc.rate); + +- if (clocksource_register_hz(&clocksource_gpt, tick_rate)) +- printk(err2, clocksource_gpt.name); ++ if (clocksource_register_hz(&clocksource_gpt, clksrc.rate)) ++ pr_err("Could not register clocksource %s\n", ++ clocksource_gpt.name); + } + #endif + +-#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src) \ ++#define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, \ ++ clksrc_nr, clksrc_src) \ + static void __init omap##name##_timer_init(void) \ + { \ + omap2_gp_clockevent_init((clkev_nr), clkev_src); \ +- omap2_gp_clocksource_init(); \ ++ omap2_gp_clocksource_init((clksrc_nr), clksrc_src); \ + } + + #define OMAP_SYS_TIMER(name) \ +@@ -335,14 +342,15 @@ struct sys_timer omap##name##_timer = { \ + }; + + #ifdef CONFIG_ARCH_OMAP2 +-OMAP_SYS_TIMER_INIT(2, 1, OMAP2_CLKEV_SOURCE) ++OMAP_SYS_TIMER_INIT(2, 1, OMAP2_CLKEV_SOURCE, 2, OMAP2_MPU_SOURCE) + OMAP_SYS_TIMER(2) + #endif + + #ifdef CONFIG_ARCH_OMAP3 +-OMAP_SYS_TIMER_INIT(3, 1, OMAP3_CLKEV_SOURCE) ++OMAP_SYS_TIMER_INIT(3, 1, OMAP3_CLKEV_SOURCE, 2, OMAP3_MPU_SOURCE) + OMAP_SYS_TIMER(3) +-OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE) ++OMAP_SYS_TIMER_INIT(3_secure, OMAP3_SECURE_TIMER, OMAP3_CLKEV_SOURCE, ++ 2, OMAP3_MPU_SOURCE) + OMAP_SYS_TIMER(3_secure) + #endif + +@@ -354,7 +362,7 @@ static void __init omap4_timer_init(void) + BUG_ON(!twd_base); + #endif + omap2_gp_clockevent_init(1, OMAP4_CLKEV_SOURCE); +- omap2_gp_clocksource_init(); ++ omap2_gp_clocksource_init(2, OMAP4_MPU_SOURCE); + } + OMAP_SYS_TIMER(4) + #endif +diff --git a/arch/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c +index f7fed60..c13bc3d 100644 +--- a/arch/arm/plat-omap/counter_32k.c ++++ b/arch/arm/plat-omap/counter_32k.c +@@ -126,7 +126,7 @@ static inline unsigned long long notrace _omap_32k_sched_clock(void) + return cyc_to_fixed_sched_clock(&cd, cyc, (u32)~0, SC_MULT, SC_SHIFT); + } + +-#ifndef CONFIG_OMAP_MPU_TIMER ++#if defined(CONFIG_OMAP_32K_TIMER) && !defined(CONFIG_OMAP_MPU_TIMER) + unsigned long long notrace sched_clock(void) + { + return _omap_32k_sched_clock(); +-- +1.6.6.1 + diff --git a/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0015-omap2-Remove-omap2_gp_clockevent_set_gptimer.patch b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0015-omap2-Remove-omap2_gp_clockevent_set_gptimer.patch new file mode 100644 index 00000000..b7bb2b32 --- /dev/null +++ b/recipes-kernel/linux/linux-3.0/pm-wip/voltdm/0015-omap2-Remove-omap2_gp_clockevent_set_gptimer.patch @@ -0,0 +1,240 @@ +From ccf883ffc7c3bfcdf80ecb20e4015986e7b91d0e Mon Sep 17 00:00:00 2001 +From: Tony Lindgren +Date: Tue, 29 Mar 2011 15:54:49 -0700 +Subject: [PATCH 015/149] omap2+: Remove omap2_gp_clockevent_set_gptimer + +This is no longer needed as we now just set the desired +.timer in MACHINE_START. We can now also remove timer-gp.h. + +Signed-off-by: Tony Lindgren +Reviewed-by: Kevin Hilman +--- + arch/arm/mach-omap2/board-4430sdp.c | 4 ---- + arch/arm/mach-omap2/board-devkit8000.c | 4 ---- + arch/arm/mach-omap2/board-omap3beagle.c | 4 ---- + arch/arm/mach-omap2/board-omap3logic.c | 1 - + arch/arm/mach-omap2/board-omap3stalker.c | 4 ---- + arch/arm/mach-omap2/board-omap3touchbook.c | 4 ---- + arch/arm/mach-omap2/board-omap4panda.c | 1 - + arch/arm/mach-omap2/timer-gp.c | 26 -------------------------- + arch/arm/mach-omap2/timer-gp.h | 16 ---------------- + 9 files changed, 0 insertions(+), 64 deletions(-) + delete mode 100644 arch/arm/mach-omap2/timer-gp.h + +diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c +index e8caced..d7df07e 100644 +--- a/arch/arm/mach-omap2/board-4430sdp.c ++++ b/arch/arm/mach-omap2/board-4430sdp.c +@@ -40,7 +40,6 @@ + + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "control.h" + #include "common-board-devices.h" + +@@ -295,9 +294,6 @@ static void __init omap_4430sdp_init_early(void) + { + omap2_init_common_infrastructure(); + omap2_init_common_devices(NULL, NULL); +-#ifdef CONFIG_OMAP_32K_TIMER +- omap2_gp_clockevent_set_gptimer(1); +-#endif + } + + static struct omap_musb_board_data musb_board_data = { +diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c +index 46d144d..949dbea 100644 +--- a/arch/arm/mach-omap2/board-devkit8000.c ++++ b/arch/arm/mach-omap2/board-devkit8000.c +@@ -58,7 +58,6 @@ + + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "common-board-devices.h" + + #define OMAP_DM9000_GPIO_IRQ 25 +@@ -441,9 +440,6 @@ static void __init devkit8000_init_early(void) + static void __init devkit8000_init_irq(void) + { + omap3_init_irq(); +-#ifdef CONFIG_OMAP_32K_TIMER +- omap2_gp_clockevent_set_gptimer(12); +-#endif + } + + #define OMAP_DM9000_BASE 0x2c000000 +diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c +index 9ee16f6..2d8dfb3 100644 +--- a/arch/arm/mach-omap2/board-omap3beagle.c ++++ b/arch/arm/mach-omap2/board-omap3beagle.c +@@ -50,7 +50,6 @@ + + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "pm.h" + #include "common-board-devices.h" + +@@ -484,9 +483,6 @@ static void __init omap3_beagle_init_early(void) + static void __init omap3_beagle_init_irq(void) + { + omap3_init_irq(); +-#ifdef CONFIG_OMAP_32K_TIMER +- omap2_gp_clockevent_set_gptimer(12); +-#endif + } + + static struct platform_device *omap3_beagle_devices[] __initdata = { +diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c +index 469259a..703aeb5 100644 +--- a/arch/arm/mach-omap2/board-omap3logic.c ++++ b/arch/arm/mach-omap2/board-omap3logic.c +@@ -35,7 +35,6 @@ + + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "control.h" + #include "common-board-devices.h" + +diff --git a/arch/arm/mach-omap2/board-omap3stalker.c b/arch/arm/mach-omap2/board-omap3stalker.c +index 2fa8fae..b8ad4dd 100644 +--- a/arch/arm/mach-omap2/board-omap3stalker.c ++++ b/arch/arm/mach-omap2/board-omap3stalker.c +@@ -52,7 +52,6 @@ + #include "sdram-micron-mt46h32m32lf-6.h" + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "common-board-devices.h" + + #if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) +@@ -492,9 +491,6 @@ static void __init omap3_stalker_init_early(void) + static void __init omap3_stalker_init_irq(void) + { + omap3_init_irq(); +-#ifdef CONFIG_OMAP_32K_TIMER +- omap2_gp_clockevent_set_gptimer(12); +-#endif + } + + static struct platform_device *omap3_stalker_devices[] __initdata = { +diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c +index 8c71fd2..57e6ed3 100644 +--- a/arch/arm/mach-omap2/board-omap3touchbook.c ++++ b/arch/arm/mach-omap2/board-omap3touchbook.c +@@ -51,7 +51,6 @@ + + #include "mux.h" + #include "hsmmc.h" +-#include "timer-gp.h" + #include "common-board-devices.h" + + #include +@@ -372,9 +371,6 @@ static void __init omap3_touchbook_init_early(void) + static void __init omap3_touchbook_init_irq(void) + { + omap3_init_irq(); +-#ifdef CONFIG_OMAP_32K_TIMER +- omap2_gp_clockevent_set_gptimer(12); +-#endif + } + + static struct platform_device *omap3_touchbook_devices[] __initdata = { +diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c +index dc1d6dc..ee2034e 100644 +--- a/arch/arm/mach-omap2/board-omap4panda.c ++++ b/arch/arm/mach-omap2/board-omap4panda.c +@@ -41,7 +41,6 @@ + #include + #include + #include