* [PATCH 4/5] pxa25x_udc: stop handling gpio-vbus internally
From: Dmitry Eremin-Solenikov @ 2011-02-14 12:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297686800-27599-1-git-send-email-dbaryshkov@gmail.com>
Stop handling gpio-vbus internally. All boards that depended on this
functionality have been converted to use gpio-vbus tranceiver. All
new boards can use it right from the start. Drop unused code.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/usb/gadget/pxa25x_udc.c | 76 ++++-----------------------------------
1 files changed, 7 insertions(+), 69 deletions(-)
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index b37f92c..444b60a 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -139,24 +139,6 @@ static const char ep0name [] = "ep0";
static void pxa25x_ep_fifo_flush (struct usb_ep *ep);
static void nuke (struct pxa25x_ep *, int status);
-/* one GPIO should be used to detect VBUS from the host */
-static int is_vbus_present(void)
-{
- struct pxa2xx_udc_mach_info *mach = the_controller->mach;
-
- if (gpio_is_valid(mach->gpio_vbus)) {
- int value = gpio_get_value(mach->gpio_vbus);
-
- if (mach->gpio_vbus_inverted)
- return !value;
- else
- return !!value;
- }
- if (mach->udc_is_connected)
- return mach->udc_is_connected();
- return 1;
-}
-
/* one GPIO should control a D+ pullup, so host sees this device (or not) */
static void pullup_off(void)
{
@@ -1055,7 +1037,7 @@ udc_seq_show(struct seq_file *m, void *_d)
"%s version: %s\nGadget driver: %s\nHost %s\n\n",
driver_name, DRIVER_VERSION SIZE_STR "(pio)",
dev->driver ? dev->driver->driver.name : "(none)",
- is_vbus_present() ? "full speed" : "disconnected");
+ dev->gadget.speed == USB_SPEED_FULL ? "full speed" : "disconnected");
/* registers for device and ep0 */
seq_printf(m,
@@ -1094,7 +1076,7 @@ udc_seq_show(struct seq_file *m, void *_d)
(tmp & UDCCFR_ACM) ? " acm" : "");
}
- if (!is_vbus_present() || !dev->driver)
+ if (dev->gadget.speed != USB_SPEED_FULL || !dev->driver)
goto done;
seq_printf(m, "ep0 IN %lu/%lu, OUT %lu/%lu\nirqs %lu\n\n",
@@ -1435,14 +1417,6 @@ lubbock_vbus_irq(int irq, void *_dev)
#endif
-static irqreturn_t udc_vbus_irq(int irq, void *_dev)
-{
- struct pxa25x_udc *dev = _dev;
-
- pxa25x_udc_vbus_session(&dev->gadget, is_vbus_present());
- return IRQ_HANDLED;
-}
-
/*-------------------------------------------------------------------------*/
@@ -1766,12 +1740,9 @@ pxa25x_udc_irq(int irq, void *_dev)
if (unlikely(udccr & UDCCR_SUSIR)) {
udc_ack_int_UDCCR(UDCCR_SUSIR);
handled = 1;
- DBG(DBG_VERBOSE, "USB suspend%s\n", is_vbus_present()
- ? "" : "+disconnect");
+ DBG(DBG_VERBOSE, "USB suspend\n");
- if (!is_vbus_present())
- stop_activity(dev, dev->driver);
- else if (dev->gadget.speed != USB_SPEED_UNKNOWN
+ if (dev->gadget.speed != USB_SPEED_UNKNOWN
&& dev->driver
&& dev->driver->suspend)
dev->driver->suspend(&dev->gadget);
@@ -1786,8 +1757,7 @@ pxa25x_udc_irq(int irq, void *_dev)
if (dev->gadget.speed != USB_SPEED_UNKNOWN
&& dev->driver
- && dev->driver->resume
- && is_vbus_present())
+ && dev->driver->resume)
dev->driver->resume(&dev->gadget);
}
@@ -2137,7 +2107,7 @@ static struct pxa25x_udc memory = {
static int __init pxa25x_udc_probe(struct platform_device *pdev)
{
struct pxa25x_udc *dev = &memory;
- int retval, vbus_irq, irq;
+ int retval, irq;
u32 chiprev;
/* insist on Intel/ARM/XScale */
@@ -2199,19 +2169,6 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
dev->transceiver = otg_get_transceiver();
- if (gpio_is_valid(dev->mach->gpio_vbus)) {
- if ((retval = gpio_request(dev->mach->gpio_vbus,
- "pxa25x_udc GPIO VBUS"))) {
- dev_dbg(&pdev->dev,
- "can't get vbus gpio %d, err: %d\n",
- dev->mach->gpio_vbus, retval);
- goto err_gpio_vbus;
- }
- gpio_direction_input(dev->mach->gpio_vbus);
- vbus_irq = gpio_to_irq(dev->mach->gpio_vbus);
- } else
- vbus_irq = 0;
-
if (gpio_is_valid(dev->mach->gpio_pullup)) {
if ((retval = gpio_request(dev->mach->gpio_pullup,
"pca25x_udc GPIO PULLUP"))) {
@@ -2237,7 +2194,7 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
udc_disable(dev);
udc_reinit(dev);
- dev->vbus = !!is_vbus_present();
+ dev->vbus = 0;
/* irq setup after old hardware state is cleaned up */
retval = request_irq(irq, pxa25x_udc_irq,
@@ -2273,22 +2230,10 @@ lubbock_fail0:
}
} else
#endif
- if (vbus_irq) {
- retval = request_irq(vbus_irq, udc_vbus_irq,
- IRQF_DISABLED | IRQF_SAMPLE_RANDOM |
- IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
- driver_name, dev);
- if (retval != 0) {
- pr_err("%s: can't get irq %i, err %d\n",
- driver_name, vbus_irq, retval);
- goto err_vbus_irq;
- }
- }
create_debug_files(dev);
return 0;
- err_vbus_irq:
#ifdef CONFIG_ARCH_LUBBOCK
free_irq(LUBBOCK_USB_DISC_IRQ, dev);
err_irq_lub:
@@ -2298,9 +2243,6 @@ lubbock_fail0:
if (gpio_is_valid(dev->mach->gpio_pullup))
gpio_free(dev->mach->gpio_pullup);
err_gpio_pullup:
- if (gpio_is_valid(dev->mach->gpio_vbus))
- gpio_free(dev->mach->gpio_vbus);
- err_gpio_vbus:
if (dev->transceiver) {
otg_put_transceiver(dev->transceiver);
dev->transceiver = NULL;
@@ -2337,10 +2279,6 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
free_irq(LUBBOCK_USB_IRQ, dev);
}
#endif
- if (gpio_is_valid(dev->mach->gpio_vbus)) {
- free_irq(gpio_to_irq(dev->mach->gpio_vbus), dev);
- gpio_free(dev->mach->gpio_vbus);
- }
if (gpio_is_valid(dev->mach->gpio_pullup))
gpio_free(dev->mach->gpio_pullup);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 3/5] tosa: switch to using gpio-vbus transceiver
From: Dmitry Eremin-Solenikov @ 2011-02-14 12:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297686800-27599-1-git-send-email-dbaryshkov@gmail.com>
Switch from handling gpio-vbus in pxa25x_udc to using standard gpio-vbus
tranceiver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-pxa/tosa.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index af152e7..88b2329 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -34,6 +34,7 @@
#include <linux/spi/spi.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/input/matrix_keypad.h>
+#include <linux/usb/gpio_vbus.h>
#include <asm/setup.h>
#include <asm/mach-types.h>
@@ -240,12 +241,20 @@ static struct scoop_pcmcia_config tosa_pcmcia_config = {
/*
* USB Device Controller
*/
-static struct pxa2xx_udc_mach_info udc_info __initdata = {
+static struct gpio_vbus_mach_info tosa_udc_info = {
.gpio_pullup = TOSA_GPIO_USB_PULLUP,
.gpio_vbus = TOSA_GPIO_USB_IN,
.gpio_vbus_inverted = 1,
};
+static struct platform_device tosa_gpio_vbus = {
+ .name = "gpio-vbus",
+ .id = -1,
+ .dev = {
+ .platform_data = &tosa_udc_info,
+ },
+};
+
/*
* MMC/SD Device
*/
@@ -885,6 +894,7 @@ static struct platform_device *devices[] __initdata = {
&tosaled_device,
&tosa_bt_device,
&sharpsl_rom_device,
+ &tosa_gpio_vbus,
};
static void tosa_poweroff(void)
@@ -931,7 +941,6 @@ static void __init tosa_init(void)
dummy = gpiochip_reserve(TOSA_TC6393XB_GPIO_BASE, 16);
pxa_set_mci_info(&tosa_mci_platform_data);
- pxa_set_udc_info(&udc_info);
pxa_set_ficp_info(&tosa_ficp_platform_data);
pxa_set_i2c_info(NULL);
pxa_set_ac97_info(NULL);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 2/5] gumstix: switch to using gpio-vbus transceiver
From: Dmitry Eremin-Solenikov @ 2011-02-14 12:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297686800-27599-1-git-send-email-dbaryshkov@gmail.com>
Switch from handling gpio-vbus in pxa25x_udc to using standard gpio-vbus
tranceiver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Steve Sakoman <sakoman@gmail.com>
---
arch/arm/mach-pxa/gumstix.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
index 6fd319e..d65e4bd 100644
--- a/arch/arm/mach-pxa/gumstix.c
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -26,6 +26,7 @@
#include <linux/gpio.h>
#include <linux/err.h>
#include <linux/clk.h>
+#include <linux/usb/gpio_vbus.h>
#include <asm/setup.h>
#include <asm/memory.h>
@@ -106,14 +107,22 @@ static void __init gumstix_mmc_init(void)
#endif
#ifdef CONFIG_USB_GADGET_PXA25X
-static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
+static struct gpio_vbus_mach_info gumstix_udc_info = {
.gpio_vbus = GPIO_GUMSTIX_USB_GPIOn,
.gpio_pullup = GPIO_GUMSTIX_USB_GPIOx,
};
+static struct platform_device gumstix_gpio_vbus = {
+ .name = "gpio-vbus",
+ .id = -1,
+ .dev = {
+ .platform_data = &gumstix_udc_info,
+ },
+};
+
static void __init gumstix_udc_init(void)
{
- pxa_set_udc_info(&gumstix_udc_info);
+ platform_device_register(&gumstix_gpio_vbus);
}
#else
static void gumstix_udc_init(void)
--
1.7.2.3
^ permalink raw reply related
* [PATCH 1/5] eseries: switch to using gpio-vbus transceiver
From: Dmitry Eremin-Solenikov @ 2011-02-14 12:33 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297686800-27599-1-git-send-email-dbaryshkov@gmail.com>
Switch from handling gpio-vbus in pxa25x_udc to using standard gpio-vbus
tranceiver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Ian Molton <spyro@f2s.com>
---
arch/arm/mach-pxa/eseries.c | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c
index edca0a0..6b09645 100644
--- a/arch/arm/mach-pxa/eseries.c
+++ b/arch/arm/mach-pxa/eseries.c
@@ -20,6 +20,7 @@
#include <linux/mfd/t7l66xb.h>
#include <linux/mtd/nand.h>
#include <linux/mtd/partitions.h>
+#include <linux/usb/gpio_vbus.h>
#include <video/w100fb.h>
@@ -51,12 +52,20 @@ void __init eseries_fixup(struct machine_desc *desc,
mi->bank[0].size = (64*1024*1024);
}
-struct pxa2xx_udc_mach_info e7xx_udc_mach_info = {
+struct gpio_vbus_mach_info e7xx_udc_info = {
.gpio_vbus = GPIO_E7XX_USB_DISC,
.gpio_pullup = GPIO_E7XX_USB_PULLUP,
.gpio_pullup_inverted = 1
};
+static struct platform_device e7xx_gpio_vbus = {
+ .name = "gpio-vbus",
+ .id = -1,
+ .dev = {
+ .platform_data = &e7xx_udc_info,
+ },
+};
+
struct pxaficp_platform_data e7xx_ficp_platform_data = {
.gpio_pwdown = GPIO_E7XX_IR_OFF,
.transceiver_cap = IR_SIRMODE | IR_OFF,
@@ -165,6 +174,7 @@ static struct platform_device e330_tc6387xb_device = {
static struct platform_device *e330_devices[] __initdata = {
&e330_tc6387xb_device,
+ &e7xx_gpio_vbus,
};
static void __init e330_init(void)
@@ -175,7 +185,6 @@ static void __init e330_init(void)
eseries_register_clks();
eseries_get_tmio_gpios();
platform_add_devices(ARRAY_AND_SIZE(e330_devices));
- pxa_set_udc_info(&e7xx_udc_mach_info);
}
MACHINE_START(E330, "Toshiba e330")
@@ -214,6 +223,7 @@ static struct platform_device e350_t7l66xb_device = {
static struct platform_device *e350_devices[] __initdata = {
&e350_t7l66xb_device,
+ &e7xx_gpio_vbus,
};
static void __init e350_init(void)
@@ -224,7 +234,6 @@ static void __init e350_init(void)
eseries_register_clks();
eseries_get_tmio_gpios();
platform_add_devices(ARRAY_AND_SIZE(e350_devices));
- pxa_set_udc_info(&e7xx_udc_mach_info);
}
MACHINE_START(E350, "Toshiba e350")
@@ -333,6 +342,7 @@ static struct platform_device e400_t7l66xb_device = {
static struct platform_device *e400_devices[] __initdata = {
&e400_t7l66xb_device,
+ &e7xx_gpio_vbus,
};
static void __init e400_init(void)
@@ -346,7 +356,6 @@ static void __init e400_init(void)
eseries_get_tmio_gpios();
set_pxa_fb_info(&e400_pxafb_mach_info);
platform_add_devices(ARRAY_AND_SIZE(e400_devices));
- pxa_set_udc_info(&e7xx_udc_mach_info);
}
MACHINE_START(E400, "Toshiba e400")
@@ -519,6 +528,7 @@ static struct platform_device e740_t7l66xb_device = {
static struct platform_device *e740_devices[] __initdata = {
&e740_fb_device,
&e740_t7l66xb_device,
+ &e7xx_gpio_vbus,
};
static void __init e740_init(void)
@@ -532,7 +542,6 @@ static void __init e740_init(void)
"UDCCLK", &pxa25x_device_udc.dev),
eseries_get_tmio_gpios();
platform_add_devices(ARRAY_AND_SIZE(e740_devices));
- pxa_set_udc_info(&e7xx_udc_mach_info);
pxa_set_ac97_info(NULL);
pxa_set_ficp_info(&e7xx_ficp_platform_data);
}
@@ -711,6 +720,7 @@ static struct platform_device e750_tc6393xb_device = {
static struct platform_device *e750_devices[] __initdata = {
&e750_fb_device,
&e750_tc6393xb_device,
+ &e7xx_gpio_vbus,
};
static void __init e750_init(void)
@@ -723,7 +733,6 @@ static void __init e750_init(void)
"GPIO11_CLK", NULL),
eseries_get_tmio_gpios();
platform_add_devices(ARRAY_AND_SIZE(e750_devices));
- pxa_set_udc_info(&e7xx_udc_mach_info);
pxa_set_ac97_info(NULL);
pxa_set_ficp_info(&e7xx_ficp_platform_data);
}
@@ -873,12 +882,21 @@ static struct platform_device e800_fb_device = {
/* --------------------------- UDC definitions --------------------------- */
-static struct pxa2xx_udc_mach_info e800_udc_mach_info = {
+static struct gpio_vbus_mach_info e800_udc_info = {
.gpio_vbus = GPIO_E800_USB_DISC,
.gpio_pullup = GPIO_E800_USB_PULLUP,
.gpio_pullup_inverted = 1
};
+static struct platform_device e800_gpio_vbus = {
+ .name = "gpio-vbus",
+ .id = -1,
+ .dev = {
+ .platform_data = &e800_udc_info,
+ },
+};
+
+
/* ----------------- e800 tc6393xb parameters ------------------ */
static struct tc6393xb_platform_data e800_tc6393xb_info = {
@@ -907,6 +925,7 @@ static struct platform_device e800_tc6393xb_device = {
static struct platform_device *e800_devices[] __initdata = {
&e800_fb_device,
&e800_tc6393xb_device,
+ &e800_gpio_vbus,
};
static void __init e800_init(void)
@@ -919,7 +938,6 @@ static void __init e800_init(void)
"GPIO11_CLK", NULL),
eseries_get_tmio_gpios();
platform_add_devices(ARRAY_AND_SIZE(e800_devices));
- pxa_set_udc_info(&e800_udc_mach_info);
pxa_set_ac97_info(NULL);
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/5][RESENT] Get rid of gpio-vbus related code from pxa25x_udc
From: Dmitry Eremin-Solenikov @ 2011-02-14 12:33 UTC (permalink / raw)
To: linux-arm-kernel
Currently pxa25x_udc contains some code duplicating gpio-vbus functionality.
Please merge this serie of patches (based on v2.6.38-rc4), which makes all
relevant platforms use gpio-vbus tranceiver instead of relying on pxa25x_udc
and then drop support for gpio-vbus handling in pxa25x_udc.
Please tell me if I should rebase these patches on top of some other commit.
The following changes since commit 100b33c8bd8a3235fd0b7948338d6cbb3db3c63d:
Linux 2.6.38-rc4 (2011-02-07 16:03:55 -0800)
Dmitry Eremin-Solenikov (5):
eseries: switch to using gpio-vbus transceiver
gumstix: switch to using gpio-vbus transceiver
tosa: switch to using gpio-vbus transceiver
pxa25x_udc: stop handling gpio-vbus internally
pxa2xx: drop gpio_vbus field from info struct
arch/arm/include/asm/mach/udc_pxa2xx.h | 2 -
arch/arm/mach-pxa/corgi.c | 1 -
arch/arm/mach-pxa/devices.c | 1 -
arch/arm/mach-pxa/eseries.c | 34 +++++++++++---
arch/arm/mach-pxa/gumstix.c | 13 +++++-
arch/arm/mach-pxa/tosa.c | 13 +++++-
drivers/usb/gadget/pxa25x_udc.c | 76 +++-----------------------------
7 files changed, 55 insertions(+), 85 deletions(-)
^ permalink raw reply
* [PATCH v2 5/7] omap: dpll: Enable all OMAP3/4 dpll autoidle late at boot
From: Rajendra Nayak @ 2011-02-14 12:32 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102121741340.21991@utopia.booyaka.com>
Hi Paul,
> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Sunday, February 13, 2011 6:13 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; b-cousson at ti.com; khilman at ti.com;
santosh.shilimkar at ti.com; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH v2 5/7] omap: dpll: Enable all OMAP3/4 dpll autoidle
late at boot
>
> On Thu, 10 Feb 2011, Rajendra Nayak wrote:
>
> > Enable all dpll autoidle for OMAP4 and OMAP3 (OMAP3
> > already had dpll autoidle turned on, but was done
> > using low level cm accessor apis).
> > On OMAP3, replace the cm accessor apis doing this
> > with the now available support for doing this in
> > clock framework, using omap_clk_enable_autoidle().
>
> I propose this patch instead. What do you think? Care to reply with a
> Reviewed-by: and/or Tested-by: ?
I agree, this is a better approach than what I proposed
in my patch.
Since I already tested the clk_autoidle_a_2.6.39 branch
which also has this patch included, you can add a
Tested-by: Rajendra Nayak <rnayak@ti.com>
Regards,
Rajendra
>
>
> - Paul
>
> From: Paul Walmsley <paul@pwsan.com>
> Date: Sat, 12 Feb 2011 17:36:38 -0600
> Subject: [PATCH] OMAP2+: clock: autoidle as many clocks as possible in
OMAP2+-common PM code
>
> Attempt to enable autoidle for as many clocks as possible in the
> OMAP2+-common PM code. Currently, this only enables DPLL autoidle for
> OMAP3/4 DPLLs; but it should also eventually enable autoidle for other
> clocks and the OMAP2 DPLL/APLLs.
>
> Based on a patch by Rajendra Nayak <rnayak@ti.com> that did this in
> the pm34xx.c/pm44xx.c code, rather than the common PM code.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> arch/arm/mach-omap2/pm.c | 8 ++++++++
> arch/arm/mach-omap2/pm34xx.c | 17 -----------------
> 2 files changed, 8 insertions(+), 17 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
> index d5a102c..b507702 100644
> --- a/arch/arm/mach-omap2/pm.c
> +++ b/arch/arm/mach-omap2/pm.c
> @@ -262,6 +262,14 @@ static int __init omap2_common_pm_late_init(void)
> /* Smartreflex device init */
> omap_devinit_smartreflex();
>
> + /*
> + * Set all OMAP3/4 DPLLs to autoidle.
> + * XXX TODO: Add all the iclk autoidles in here as well,
> + * the OMAP2 DPLL, the OMAP2 APLLs, and the AUTOEXTCLKMODE
> + * control here too.
> + */
> + omap_clk_enable_autoidle_all();
> +
> return 0;
> }
> late_initcall(omap2_common_pm_late_init);
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 2f864e4..1fe2e73 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -814,23 +814,6 @@ static void __init prcm_setup_regs(void)
> omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
>
> /*
> - * Set all plls to autoidle. This is needed until autoidle is
> - * enabled by clockfw
> - */
> - omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_IVA2_DPLL_SHIFT,
> - OMAP3430_IVA2_MOD, CM_AUTOIDLE2);
> - omap2_cm_write_mod_reg(1 << OMAP3430_AUTO_MPU_DPLL_SHIFT,
> - MPU_MOD,
> - CM_AUTOIDLE2);
> - omap2_cm_write_mod_reg((1 << OMAP3430_AUTO_PERIPH_DPLL_SHIFT) |
> - (1 << OMAP3430_AUTO_CORE_DPLL_SHIFT),
> - PLL_MOD,
> - CM_AUTOIDLE);
> - omap2_cm_write_mod_reg(1 << OMAP3430ES2_AUTO_PERIPH2_DPLL_SHIFT,
> - PLL_MOD,
> - CM_AUTOIDLE2);
> -
> - /*
> * Enable control of expternal oscillator through
> * sys_clkreq. In the long run clock framework should
> * take care of this.
> --
> 1.7.2.3
^ permalink raw reply
* [PATCH v2 4/7] omap: dpll: Add allow_idle/deny_idle support for all DPLL's
From: Rajendra Nayak @ 2011-02-14 12:29 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102121727140.21991@utopia.booyaka.com>
Hi Paul,
> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Sunday, February 13, 2011 5:58 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; b-cousson at ti.com; khilman at ti.com;
santosh.shilimkar at ti.com; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH v2 4/7] omap: dpll: Add allow_idle/deny_idle support
for all DPLL's
>
> On Thu, 10 Feb 2011, Rajendra Nayak wrote:
>
> > All OMAP3/4 dpll's support hardware level autogating.
> > Populate allow_idle/deny_idle function pointers for all
> > DPLL's in clkops.
> >
> > Signed-off-by: Rajendra Nayak <rnayak@ti.com>
>
> Thanks, queued for 2.6.39. Two questions though. Was the OMAP4
> autogeneration script updated? Also, any technical reason why you
didn't
> add the OMAP2 DPLL?
Yes, the autogen scripts are updated, however they are
currently in a separate branch (dpll-gatectrl).
Will merge them into master soon.
No real reason for not adding OMAP2 dpll autoidle support.
Its just that I started off trying to do this for OMAP4, and
then found me touching some omap3 stuff and hence
also did it for OMAP3.(For some reason I thought there
were no DPLL's in OMAP2).
Regards,
Rajendra
>
>
> - Paul
^ permalink raw reply
* [PATCH v2 3/7] omap: clock: Add allow_idle/deny_idle support in clkops
From: Rajendra Nayak @ 2011-02-14 12:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102121643250.21991@utopia.booyaka.com>
Hi Paul,
> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Sunday, February 13, 2011 5:35 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; b-cousson at ti.com; khilman at ti.com;
santosh.shilimkar at ti.com; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH v2 3/7] omap: clock: Add allow_idle/deny_idle
support in clkops
>
> Hi Rajendra
>
> On Thu, 10 Feb 2011, Rajendra Nayak wrote:
>
> > diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
> > index fc62fb5..6889c5a 100644
> > --- a/arch/arm/plat-omap/clock.c
> > +++ b/arch/arm/plat-omap/clock.c
> > @@ -335,6 +335,32 @@ struct clk *omap_clk_get_by_name(const char
*name)
> > return ret;
> > }
> >
> > +void omap_clk_enable_autoidle(void)
> > +{
> > + struct clk *c;
> > +
> > + mutex_lock(&clocks_mutex);
>
> With the current OMAP clock code, it isn't sufficient to use a mutex
here.
> Your underlying functions have to read, modify, and write a register
that
> is also touched by clock functions like clk_set_rate(), which take the
> clockfw spinlock and not the mutex. This is potentially racy and could
> result in inconsistencies between the internal clock tree data and the
> hardware settings.
>
> While it is true that these functions are currently only called during
PM
> init, I'd rather not commit code that is subject to known races into the
> tree.
>
> So, before applying this patch, the mutexes have been converted into
> spinlocks. I would appreciate it if you could help test this. Updated
> patch follows, which has been queued for 2.6.39 as part of the
> 'clk_autoidle_a_2.6.39' branch of git://git.pwsan.com/linux-2.6.
I used the clk_autoidle_a_2.6.39 branch and tested OFF mode
in suspend on 3430sdp.
I also tested CORE ret in suspend (using some out of tree patches)
on 4430sdp.
A couple of issues on the clk_autoidle_a_2.6.39 branch:
-1- There seems to be a missing fix which causes an abort
at boot on omap4
http://marc.info/?l=linux-omap&m=129768574027232&w=2
-2- There is a trivial fix (Patch below) needed which otherwise
breaks build
----
^ permalink raw reply
* [PATCH][RESEND] ARM: vexpress: add support for multiple core tiles
From: Will Deacon @ 2011-02-14 12:18 UTC (permalink / raw)
To: linux-arm-kernel
The current Versatile Express BSP defines the MACHINE_START macro
in the core tile code.
This patch moves this into the generic board code and introduces a
method for determining the current tile at runtime, allowing the
Kernel to have support for multiple tiles compiled in. Tile-specific
functions are executed via a descriptor struct containing the correct
implementations for the current tile.
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Signed-off-by: Will Deacon <will.deacon@arm.com>
---
Russell - this has been sitting in your patch system for a while now and
I've been rebasing it onto -next so that it applies cleanly. I haven't
seen any conflicts lately so I wondered if there was anything else pending
or if this can now be merged? It's a pre-requisite for the A5 and A15 BSPs
which we hope to post soon.
arch/arm/mach-vexpress/core.h | 6 --
arch/arm/mach-vexpress/ct-ca9x4.c | 45 ++++++++++-----
arch/arm/mach-vexpress/include/mach/ct-ca9x4.h | 2 +
arch/arm/mach-vexpress/include/mach/motherboard.h | 22 +++++++
arch/arm/mach-vexpress/platsmp.c | 31 +---------
arch/arm/mach-vexpress/v2m.c | 65 +++++++++++++++++----
6 files changed, 110 insertions(+), 61 deletions(-)
diff --git a/arch/arm/mach-vexpress/core.h b/arch/arm/mach-vexpress/core.h
index e0312a1..f439715 100644
--- a/arch/arm/mach-vexpress/core.h
+++ b/arch/arm/mach-vexpress/core.h
@@ -17,9 +17,3 @@ struct amba_device name##_device = { \
.irq = IRQ_##base, \
/* .dma = DMA_##base,*/ \
}
-
-struct map_desc;
-
-void v2m_map_io(struct map_desc *tile, size_t num);
-void v2m_init_early(void);
-extern struct sys_timer v2m_timer;
diff --git a/arch/arm/mach-vexpress/ct-ca9x4.c b/arch/arm/mach-vexpress/ct-ca9x4.c
index 30d5a5b..ebc22e7 100644
--- a/arch/arm/mach-vexpress/ct-ca9x4.c
+++ b/arch/arm/mach-vexpress/ct-ca9x4.c
@@ -10,19 +10,17 @@
#include <linux/amba/clcd.h>
#include <linux/clkdev.h>
-#include <asm/pgtable.h>
#include <asm/hardware/arm_timer.h>
#include <asm/hardware/cache-l2x0.h>
#include <asm/hardware/gic.h>
-#include <asm/mach-types.h>
#include <asm/pmu.h>
+#include <asm/smp_scu.h>
#include <asm/smp_twd.h>
#include <mach/ct-ca9x4.h>
#include <asm/hardware/timer-sp.h>
-#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
@@ -58,7 +56,7 @@ static void __init ct_ca9x4_map_io(void)
#ifdef CONFIG_LOCAL_TIMERS
twd_base = MMIO_P2V(A9_MPCORE_TWD);
#endif
- v2m_map_io(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
+ iotable_init(ct_ca9x4_io_desc, ARRAY_SIZE(ct_ca9x4_io_desc));
}
static void __init ct_ca9x4_init_irq(void)
@@ -183,8 +181,6 @@ static struct platform_device pmu_device = {
static void __init ct_ca9x4_init_early(void)
{
clkdev_add_table(lookups, ARRAY_SIZE(lookups));
-
- v2m_init_early();
}
static void __init ct_ca9x4_init(void)
@@ -207,15 +203,34 @@ static void __init ct_ca9x4_init(void)
platform_device_register(&pmu_device);
}
-MACHINE_START(VEXPRESS, "ARM-Versatile Express CA9x4")
- .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
+#ifdef CONFIG_SMP
+static void ct_ca9x4_init_cpu_map(void)
+{
+ int i, ncores = scu_get_core_count(MMIO_P2V(A9_MPCORE_SCU));
+
+ for (i = 0; i < ncores; ++i)
+ set_cpu_possible(i, true);
+}
+
+static void ct_ca9x4_smp_enable(unsigned int max_cpus)
+{
+ int i;
+ for (i = 0; i < max_cpus; i++)
+ set_cpu_present(i, true);
+
+ scu_enable(MMIO_P2V(A9_MPCORE_SCU));
+}
+#endif
+
+struct ct_desc ct_ca9x4_desc __initdata = {
+ .id = V2M_CT_ID_CA9,
+ .name = "CA9x4",
.map_io = ct_ca9x4_map_io,
- .init_irq = ct_ca9x4_init_irq,
.init_early = ct_ca9x4_init_early,
-#if 0
- .timer = &ct_ca9x4_timer,
-#else
- .timer = &v2m_timer,
+ .init_irq = ct_ca9x4_init_irq,
+ .init_tile = ct_ca9x4_init,
+#ifdef CONFIG_SMP
+ .init_cpu_map = ct_ca9x4_init_cpu_map,
+ .smp_enable = ct_ca9x4_smp_enable,
#endif
- .init_machine = ct_ca9x4_init,
-MACHINE_END
+};
diff --git a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
index f9e2f8d..a34d3d4 100644
--- a/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
+++ b/arch/arm/mach-vexpress/include/mach/ct-ca9x4.h
@@ -45,4 +45,6 @@
#define IRQ_CT_CA9X4_PMU_CPU2 94
#define IRQ_CT_CA9X4_PMU_CPU3 95
+extern struct ct_desc ct_ca9x4_desc;
+
#endif
diff --git a/arch/arm/mach-vexpress/include/mach/motherboard.h b/arch/arm/mach-vexpress/include/mach/motherboard.h
index 98a8ded..0a3a375 100644
--- a/arch/arm/mach-vexpress/include/mach/motherboard.h
+++ b/arch/arm/mach-vexpress/include/mach/motherboard.h
@@ -118,4 +118,26 @@
int v2m_cfg_write(u32 devfn, u32 data);
int v2m_cfg_read(u32 devfn, u32 *data);
+/*
+ * Core tile IDs
+ */
+#define V2M_CT_ID_CA9 0x0c000191
+#define V2M_CT_ID_UNSUPPORTED 0xff000191
+#define V2M_CT_ID_MASK 0xff000fff
+
+struct ct_desc {
+ u32 id;
+ const char *name;
+ void (*map_io)(void);
+ void (*init_early)(void);
+ void (*init_irq)(void);
+ void (*init_tile)(void);
+#ifdef CONFIG_SMP
+ void (*init_cpu_map)(void);
+ void (*smp_enable)(unsigned int);
+#endif
+};
+
+extern struct ct_desc *ct_desc;
+
#endif
diff --git a/arch/arm/mach-vexpress/platsmp.c b/arch/arm/mach-vexpress/platsmp.c
index 1892702..2b5f7ac 100644
--- a/arch/arm/mach-vexpress/platsmp.c
+++ b/arch/arm/mach-vexpress/platsmp.c
@@ -13,10 +13,8 @@
#include <linux/smp.h>
#include <linux/io.h>
-#include <asm/smp_scu.h>
#include <asm/unified.h>
-#include <mach/ct-ca9x4.h>
#include <mach/motherboard.h>
#define V2M_PA_CS7 0x10000000
@@ -24,47 +22,22 @@
extern void versatile_secondary_startup(void);
-static void __iomem *scu_base_addr(void)
-{
- return MMIO_P2V(A9_MPCORE_SCU);
-}
-
/*
* Initialise the CPU possible map early - this describes the CPUs
* which may be present or become present in the system.
*/
void __init smp_init_cpus(void)
{
- void __iomem *scu_base = scu_base_addr();
- unsigned int i, ncores;
-
- ncores = scu_base ? scu_get_core_count(scu_base) : 1;
-
- /* sanity check */
- if (ncores > NR_CPUS) {
- printk(KERN_WARNING
- "vexpress: no. of cores (%d) greater than configured "
- "maximum of %d - clipping\n",
- ncores, NR_CPUS);
- ncores = NR_CPUS;
- }
-
- for (i = 0; i < ncores; i++)
- set_cpu_possible(i, true);
+ ct_desc->init_cpu_map();
}
void __init platform_smp_prepare_cpus(unsigned int max_cpus)
{
- int i;
-
/*
* Initialise the present map, which describes the set of CPUs
* actually populated at the present time.
*/
- for (i = 0; i < max_cpus; i++)
- set_cpu_present(i, true);
-
- scu_enable(scu_base_addr());
+ ct_desc->smp_enable(max_cpus);
/*
* Write the address of secondary startup into the
diff --git a/arch/arm/mach-vexpress/v2m.c b/arch/arm/mach-vexpress/v2m.c
index 63ef663..ba46e8e 100644
--- a/arch/arm/mach-vexpress/v2m.c
+++ b/arch/arm/mach-vexpress/v2m.c
@@ -14,7 +14,9 @@
#include <linux/usb/isp1760.h>
#include <linux/clkdev.h>
+#include <asm/mach-types.h>
#include <asm/sizes.h>
+#include <asm/mach/arch.h>
#include <asm/mach/flash.h>
#include <asm/mach/map.h>
#include <asm/mach/time.h>
@@ -22,6 +24,7 @@
#include <asm/hardware/timer-sp.h>
#include <asm/hardware/sp810.h>
+#include <mach/ct-ca9x4.h>
#include <mach/motherboard.h>
#include <plat/sched_clock.h>
@@ -43,14 +46,9 @@ static struct map_desc v2m_io_desc[] __initdata = {
},
};
-void __init v2m_map_io(struct map_desc *tile, size_t num)
-{
- iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
- iotable_init(tile, num);
-}
-
-void __init v2m_init_early(void)
+static void __init v2m_init_early(void)
{
+ ct_desc->init_early();
versatile_sched_clock_init(MMIO_P2V(V2M_SYS_24MHZ), 24000000);
}
@@ -71,7 +69,7 @@ static void __init v2m_timer_init(void)
sp804_clockevents_init(MMIO_P2V(V2M_TIMER0), IRQ_V2M_TIMER0);
}
-struct sys_timer v2m_timer = {
+static struct sys_timer v2m_timer = {
.init = v2m_timer_init,
};
@@ -380,7 +378,44 @@ static void v2m_restart(char str, const char *cmd)
printk(KERN_EMERG "Unable to reboot\n");
}
-static int __init v2m_init(void)
+struct ct_desc *ct_desc;
+
+static struct ct_desc *ct_descs[] __initdata = {
+#ifdef CONFIG_ARCH_VEXPRESS_CA9X4
+ &ct_ca9x4_desc,
+#endif
+};
+
+static void __init v2m_populate_ct_desc(void)
+{
+ int i;
+ u32 current_tile_id;
+
+ ct_desc = NULL;
+ current_tile_id = readl(MMIO_P2V(V2M_SYS_PROCID0)) & V2M_CT_ID_MASK;
+
+ for (i = 0; i < ARRAY_SIZE(ct_descs) && !ct_desc; ++i)
+ if (ct_descs[i]->id == current_tile_id)
+ ct_desc = ct_descs[i];
+
+ if (!ct_desc)
+ panic("vexpress: failed to populate core tile description "
+ "for tile ID 0x%8x\n", current_tile_id);
+}
+
+static void __init v2m_map_io(void)
+{
+ iotable_init(v2m_io_desc, ARRAY_SIZE(v2m_io_desc));
+ v2m_populate_ct_desc();
+ ct_desc->map_io();
+}
+
+static void __init v2m_init_irq(void)
+{
+ ct_desc->init_irq();
+}
+
+static void __init v2m_init(void)
{
int i;
@@ -399,6 +434,14 @@ static int __init v2m_init(void)
pm_power_off = v2m_power_off;
arm_pm_restart = v2m_restart;
- return 0;
+ ct_desc->init_tile();
}
-arch_initcall(v2m_init);
+
+MACHINE_START(VEXPRESS, "ARM-Versatile Express")
+ .boot_params = PLAT_PHYS_OFFSET + 0x00000100,
+ .map_io = v2m_map_io,
+ .init_early = v2m_init_early,
+ .init_irq = v2m_init_irq,
+ .timer = &v2m_timer,
+ .init_machine = v2m_init,
+MACHINE_END
--
1.7.0.4
^ permalink raw reply related
* [PATCH] OMAP: clock: Fix compile break with a
From: Rajendra Nayak @ 2011-02-14 12:17 UTC (permalink / raw)
To: linux-arm-kernel
s/spin_lock_irq*/spin_unlock_irq*
Trivial fix to do a s/spin_lock_irqrestore/spin_unlock_irqrestore
and fix the compile break.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/plat-omap/clock.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
index 585533a..a2b069f 100644
--- a/arch/arm/plat-omap/clock.c
+++ b/arch/arm/plat-omap/clock.c
@@ -346,7 +346,7 @@ void omap_clk_enable_autoidle_all(void)
if (c->ops->allow_idle)
c->ops->allow_idle(c);
- spin_lock_irqrestore(&clockfw_lock, flags);
+ spin_unlock_irqrestore(&clockfw_lock, flags);
}
void omap_clk_disable_autoidle_all(void)
@@ -360,7 +360,7 @@ void omap_clk_disable_autoidle_all(void)
if (c->ops->deny_idle)
c->ops->deny_idle(c);
- spin_lock_irqrestore(&clockfw_lock, flags);
+ spin_unlock_irqrestore(&clockfw_lock, flags);
}
/*
--
1.7.0.4
Regards,
Rajendra
>
>
> - Paul
>
> From: Rajendra Nayak <rnayak@ti.com>
> Date: Thu, 10 Feb 2011 14:46:36 +0530
> Subject: [PATCH] omap: clock: Add allow_idle/deny_idle support in clkops
>
> On OMAP various clock nodes (dpll's, mx post dividers, interface clocks)
> support hardware level autogating which can be controlled from
> software.
> Support such functionality by adding two new function pointer
> allow_idle and deny_idle in the clkops structure.
>
> These function pointers can be populated for any clock
> node which supports hardware level autogating.
>
> Also add 2 new functions (omap_clk_enable_auotidle and
> omap_clk_disable_autoidle) which can be called from
> architecture specific PM core code, if hardware level
> autogating (for all supported clock nodes) is to be
> enabled or disabled.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> [paul at pwsan.com: use spinlock rather than mutex due to race]
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> arch/arm/plat-omap/clock.c | 28
++++++++++++++++++++++++++++
> arch/arm/plat-omap/include/plat/clock.h | 6 ++++++
> 2 files changed, 34 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c
> index fc62fb5..0cdac8d 100644
> --- a/arch/arm/plat-omap/clock.c
> +++ b/arch/arm/plat-omap/clock.c
> @@ -335,6 +335,34 @@ struct clk *omap_clk_get_by_name(const char *name)
> return ret;
> }
>
> +void omap_clk_enable_autoidle(void)
> +{
> + struct clk *c;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&clockfw_lock, flags);
> +
> + list_for_each_entry(c, &clocks, node)
> + if (c->ops->allow_idle)
> + c->ops->allow_idle(c);
> +
> + spin_lock_irqrestore(&clockfw_lock, flags);
> +}
> +
> +void omap_clk_disable_autoidle(void)
> +{
> + struct clk *c;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&clockfw_lock, flags);
> +
> + list_for_each_entry(c, &clocks, node)
> + if (c->ops->deny_idle)
> + c->ops->deny_idle(c);
> +
> + spin_lock_irqrestore(&clockfw_lock, flags);
> +}
> +
> /*
> * Low level helpers
> */
> diff --git a/arch/arm/plat-omap/include/plat/clock.h
b/arch/arm/plat-omap/include/plat/clock.h
> index 8eb0ada..167f1e0f 100644
> --- a/arch/arm/plat-omap/include/plat/clock.h
> +++ b/arch/arm/plat-omap/include/plat/clock.h
> @@ -25,6 +25,8 @@ struct clockdomain;
> * @disable: fn ptr that enables the current clock in hardware
> * @find_idlest: function returning the IDLEST register for the clock's
IP blk
> * @find_companion: function returning the "companion" clk reg for the
clock
> + * @allow_idle: fn ptr that enables autoidle for the current clock in
hardware
> + * @deny_idle: fn ptr that disables autoidle for the current clock in
hardware
> *
> * A "companion" clk is an accompanying clock to the one being queried
> * that must be enabled for the IP module connected to the clock to
> @@ -42,6 +44,8 @@ struct clkops {
> u8 *, u8 *);
> void (*find_companion)(struct clk *, void
__iomem **,
> u8 *);
> + void (*allow_idle)(struct clk *);
> + void (*deny_idle)(struct clk *);
> };
>
> #ifdef CONFIG_ARCH_OMAP2PLUS
> @@ -292,6 +296,8 @@ extern void clk_init_cpufreq_table(struct
cpufreq_frequency_table **table);
> extern void clk_exit_cpufreq_table(struct cpufreq_frequency_table
**table);
> #endif
> extern struct clk *omap_clk_get_by_name(const char *name);
> +extern void omap_clk_enable_autoidle(void);
> +extern void omap_clk_disable_autoidle(void);
>
> extern const struct clkops clkops_null;
>
> --
> 1.7.2.3
^ permalink raw reply related
* [PATCH 1/7] omap: clock: Check for enable/disable ops support
From: Rajendra Nayak @ 2011-02-14 12:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102121615130.21991@utopia.booyaka.com>
Hi Paul,
> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Sunday, February 13, 2011 4:48 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; b-cousson at ti.com; khilman at ti.com;
santosh.shilimkar at ti.com; linux-arm-
> kernel at lists.infradead.org
> Subject: Re: [PATCH 1/7] omap: clock: Check for enable/disable ops
support
>
> On Tue, 8 Feb 2011, Rajendra Nayak wrote:
>
> > Check if enable/disable operations are supported for a given
> > clock node before attempting to call them.
> >
> > Signed-off-by: Rajendra Nayak <rnayak@ti.com>
>
> Thanks, queued in branch 'clk_a_2.6.39' of
git://git.pwsan.com/linux-2.6.
This patch seems to be needed in clk_autoidle_a_2.6.39 too,
without which there is an abort at boot on OMAP4.
Regards,
Rajendra
>
> This patch is integrated as part of the tag
> 'tmp-integration-2.6.39-20110212-003' and the branch
'integration-2.6.39'
> of git://git.pwsan.com/linux-integration.
>
>
> - Paul
^ permalink raw reply
* [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
From: Will Deacon @ 2011-02-14 12:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110214103738.5796.44268.stgit@e102109-lin.cambridge.arm.com>
Hi Catalin,
> Subject: [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
>
> This patch adds THREAD_NOTIFY_COPY for colling registered handlers
> during the copy_thread() function call. It also changes the VFP handler
> to use a switch statement rather than if..else and ignore this event.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> ---
> arch/arm/include/asm/thread_notify.h | 1 +
> arch/arm/kernel/process.c | 2 ++
> arch/arm/vfp/vfpmodule.c | 22 +++++++++++++++-------
> 3 files changed, 18 insertions(+), 7 deletions(-)
This would be useful for the hw-breakpoint code, where we need to clear
(memset 0) the breakpoint structures in the child so that they don't get
unregistered later on.
However, we also need to flush (unregister) breakpoints in flush_thread
so that they don't persist across an exec. Ideally, we'd have a single
notifier block and act on THREAD_NOTIFY_{FLUSH,COPY} accordingly, but
the problem is that THREAD_NOTIFY_FLUSH is only notified *after* zeroing
most of the thread structure, so the call is currently inlined into
flush_thread and we don't use a notifier.
This could be solved by either notifying the FLUSH before zeroing the
various thread structures or by moving the zeroing of the debug struct
into the hw-breakpoint notifier. The latter probably makes more sense
once we've removed the single-step functionality from ptrace.
Will
^ permalink raw reply
* [PATCH 3/3] OMAP4: clockdomain: Add wkup/sleep dependency support
From: Rajendra Nayak @ 2011-02-14 12:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <alpine.DEB.2.00.1102121529100.21991@utopia.booyaka.com>
Hi Paul,
> -----Original Message-----
> From: Paul Walmsley [mailto:paul at pwsan.com]
> Sent: Sunday, February 13, 2011 4:27 AM
> To: Rajendra Nayak
> Cc: linux-omap at vger.kernel.org; Kevin Hilman; Benoit Cousson;
linux-arm-kernel at lists.infradead.org
> Subject: RE: [PATCH 3/3] OMAP4: clockdomain: Add wkup/sleep dependency
support
>
> On Fri, 11 Feb 2011, Rajendra Nayak wrote:
>
> > > Does that sound okay to you?
> >
> > Yep, that sounds better.
>
> Here's an updated patch for the main code and the OMAP2/3
implementation.
> Comments, testing welcome.
>
> The stable integration tag with this change is
> 'integration-2.6.39-20110212-001' of
git://git.pwsan.com/linux-integration
Thanks for the changes. I used the 'integration-2.6.39-20110212-002'
tag (with the OMAP4 changes as well) and tested OFF mode in suspend
on my 3430sdp.
Also boot tested (making sure all static deps are cleared at boot)
on my 4430sdp.
There were however, still some prints stating wkup dependencies not yet
being supported on OMAP4, which I removed as part of the patch which I
posted here..
http://marc.info/?l=linux-omap&m=129768517726431&w=2
regards,
Rajendra
>
>
> - Paul
>
>
> From: Rajendra Nayak <rnayak@ti.com>
> Date: Tue, 8 Feb 2011 14:25:34 -0700
> Subject: [PATCH] OMAP: clockdomain: Arch specific funcs to handle deps
>
> Define the following architecture specific funtions for omap2/3
> .clkdm_add_wkdep
> .clkdm_del_wkdep
> .clkdm_read_wkdep
> .clkdm_clear_all_wkdeps
> .clkdm_add_sleepdep
> .clkdm_del_sleepdep
> .clkdm_read_sleepdep
> .clkdm_clear_all_sleepdeps
>
> Convert the platform-independent framework to call these functions.
> With this also move the clkdm lookups for all wkdep_srcs and
> sleepdep_srcs at clkdm_init.
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> [paul at pwsan.com: fixed loop termination conditions in
omap*_clkdm_clear_all_*();
> thanks to Kevin Hilman for finding and helping fix those bugs; also
> avoid re-resolving clockdomains during init; abstracted out clkdm_dep
walk]
> Cc: Kevin Hilman <khilman@ti.com>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> ---
> arch/arm/mach-omap2/Makefile | 2 +
> arch/arm/mach-omap2/clockdomain.c | 177
++++++++++++----------
> arch/arm/mach-omap2/clockdomain.h | 6 +-
> arch/arm/mach-omap2/clockdomain2xxx_3xxx.c | 130
++++++++++++++++
> arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c | 9 +-
> arch/arm/mach-omap2/io.c | 6 +-
> 6 files changed, 246 insertions(+), 84 deletions(-)
> create mode 100644 arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
>
> diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
> index 1c0c2b0..6b2824d 100644
> --- a/arch/arm/mach-omap2/Makefile
> +++ b/arch/arm/mach-omap2/Makefile
> @@ -102,8 +102,10 @@ obj-$(CONFIG_ARCH_OMAP4) +=
$(powerdomain-common) \
>
> # PRCM clockdomain control
> obj-$(CONFIG_ARCH_OMAP2) += clockdomain.o \
> + clockdomain2xxx_3xxx.o \
> clockdomains2xxx_3xxx_data.o
> obj-$(CONFIG_ARCH_OMAP3) += clockdomain.o \
> + clockdomain2xxx_3xxx.o \
> clockdomains2xxx_3xxx_data.o
> obj-$(CONFIG_ARCH_OMAP4) += clockdomain.o \
> clockdomains44xx_data.o
> diff --git a/arch/arm/mach-omap2/clockdomain.c
b/arch/arm/mach-omap2/clockdomain.c
> index f70b06a..895c153 100644
> --- a/arch/arm/mach-omap2/clockdomain.c
> +++ b/arch/arm/mach-omap2/clockdomain.c
> @@ -287,6 +287,32 @@ static void _disable_hwsup(struct clockdomain
*clkdm)
> BUG();
> }
>
> +/**
> + * _resolve_clkdm_deps() - resolve clkdm_names in @clkdm_deps to clkdms
> + * @clkdm: clockdomain that we are resolving dependencies for
> + * @clkdm_deps: ptr to array of struct clkdm_deps to resolve
> + *
> + * Iterates through @clkdm_deps, looking up the struct clockdomain
named by
> + * clkdm_name and storing the clockdomain pointer in the struct
clkdm_dep.
> + * No return value.
> + */
> +static void _resolve_clkdm_deps(struct clockdomain *clkdm,
> + struct clkdm_dep *clkdm_deps)
> +{
> + struct clkdm_dep *cd;
> +
> + for (cd = clkdm_deps; cd && cd->clkdm_name; cd++) {
> + if (!omap_chip_is(cd->omap_chip))
> + continue;
> + if (cd->clkdm)
> + continue;
> + cd->clkdm = _clkdm_lookup(cd->clkdm_name);
> +
> + WARN(!cd->clkdm, "clockdomain: %s: could not find clkdm %s
while resolving dependencies - should
> never happen",
> + clkdm->name, cd->clkdm_name);
> + }
> +}
> +
> /* Public functions */
>
> /**
> @@ -333,7 +359,10 @@ void clkdm_init(struct clockdomain **clkdms,
> else if (clkdm->flags & CLKDM_CAN_DISABLE_AUTO)
> omap2_clkdm_deny_idle(clkdm);
>
> + _resolve_clkdm_deps(clkdm, clkdm->wkdep_srcs);
> clkdm_clear_all_wkdeps(clkdm);
> +
> + _resolve_clkdm_deps(clkdm, clkdm->sleepdep_srcs);
> clkdm_clear_all_sleepdeps(clkdm);
> }
> }
> @@ -430,6 +459,7 @@ struct powerdomain *clkdm_get_pwrdm(struct
clockdomain *clkdm)
> int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> + int ret = 0;
>
> if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
> pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
> @@ -441,21 +471,26 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> return -EINVAL;
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_add_wkdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear wake up
of "
> "%s when %s wakes up\n", clkdm1->name,
clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> if (atomic_inc_return(&cd->wkdep_usecount) == 1) {
> pr_debug("clockdomain: hardware will wake up %s when %s
wakes "
> "up\n", clkdm1->name, clkdm2->name);
>
> - omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
> - clkdm1->pwrdm.ptr->prcm_offs,
PM_WKDEP);
> + ret = arch_clkdm->clkdm_add_wkdep(clkdm1, clkdm2);
> }
>
> - return 0;
> + return ret;
> }
>
> /**
> @@ -471,6 +506,7 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> + int ret = 0;
>
> if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
> pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
> @@ -482,21 +518,26 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> return -EINVAL;
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_del_wkdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear wake up
of "
> "%s when %s wakes up\n", clkdm1->name,
clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> if (atomic_dec_return(&cd->wkdep_usecount) == 0) {
> pr_debug("clockdomain: hardware will no longer wake up %s
"
> "after %s wakes up\n", clkdm1->name,
clkdm2->name);
>
> - omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
> - clkdm1->pwrdm.ptr->prcm_offs,
PM_WKDEP);
> + ret = arch_clkdm->clkdm_del_wkdep(clkdm1, clkdm2);
> }
>
> - return 0;
> + return ret;
> }
>
> /**
> @@ -516,6 +557,7 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> + int ret = 0;
>
> if (!clkdm1 || !clkdm2)
> return -EINVAL;
> @@ -527,15 +569,20 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> }
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_read_wkdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear wake up
of "
> "%s when %s wakes up\n", clkdm1->name,
clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> /* XXX It's faster to return the atomic wkdep_usecount */
> - return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
PM_WKDEP,
> - (1 << clkdm2->dep_bit));
> + return arch_clkdm->clkdm_read_wkdep(clkdm1, clkdm2);
> }
>
> /**
> @@ -550,9 +597,6 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> */
> int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
> {
> - struct clkdm_dep *cd;
> - u32 mask = 0;
> -
> if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
> pr_err("clockdomain: %s: %s: not yet implemented\n",
> clkdm->name, __func__);
> @@ -562,21 +606,10 @@ int clkdm_clear_all_wkdeps(struct clockdomain
*clkdm)
> if (!clkdm)
> return -EINVAL;
>
> - for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
> - if (!omap_chip_is(cd->omap_chip))
> - continue;
> -
> - if (!cd->clkdm && cd->clkdm_name)
> - cd->clkdm = _clkdm_lookup(cd->clkdm_name);
> -
> - /* PRM accesses are slow, so minimize them */
> - mask |= 1 << cd->clkdm->dep_bit;
> - atomic_set(&cd->wkdep_usecount, 0);
> - }
> -
> - omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
PM_WKDEP);
> + if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_wkdeps)
> + return -EINVAL;
>
> - return 0;
> + return arch_clkdm->clkdm_clear_all_wkdeps(clkdm);
> }
>
> /**
> @@ -594,31 +627,33 @@ int clkdm_clear_all_wkdeps(struct clockdomain
*clkdm)
> int clkdm_add_sleepdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> -
> - if (!cpu_is_omap34xx())
> - return -EINVAL;
> + int ret = 0;
>
> if (!clkdm1 || !clkdm2)
> return -EINVAL;
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_add_sleepdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear sleep "
> "dependency affecting %s from %s\n",
clkdm1->name,
> clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> if (atomic_inc_return(&cd->sleepdep_usecount) == 1) {
> pr_debug("clockdomain: will prevent %s from sleeping if %s
"
> "is active\n", clkdm1->name, clkdm2->name);
>
> - omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
> - clkdm1->pwrdm.ptr->prcm_offs,
> - OMAP3430_CM_SLEEPDEP);
> + ret = arch_clkdm->clkdm_add_sleepdep(clkdm1, clkdm2);
> }
>
> - return 0;
> + return ret;
> }
>
> /**
> @@ -636,19 +671,23 @@ int clkdm_add_sleepdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> int clkdm_del_sleepdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> -
> - if (!cpu_is_omap34xx())
> - return -EINVAL;
> + int ret = 0;
>
> if (!clkdm1 || !clkdm2)
> return -EINVAL;
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_del_sleepdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear sleep "
> "dependency affecting %s from %s\n",
clkdm1->name,
> clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> if (atomic_dec_return(&cd->sleepdep_usecount) == 0) {
> @@ -656,12 +695,10 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> "sleeping if %s is active\n", clkdm1->name,
> clkdm2->name);
>
> - omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
> - clkdm1->pwrdm.ptr->prcm_offs,
> - OMAP3430_CM_SLEEPDEP);
> + ret = arch_clkdm->clkdm_del_sleepdep(clkdm1, clkdm2);
> }
>
> - return 0;
> + return ret;
> }
>
> /**
> @@ -683,25 +720,27 @@ int clkdm_del_sleepdep(struct clockdomain *clkdm1,
struct clockdomain *clkdm2)
> int clkdm_read_sleepdep(struct clockdomain *clkdm1, struct clockdomain
*clkdm2)
> {
> struct clkdm_dep *cd;
> -
> - if (!cpu_is_omap34xx())
> - return -EINVAL;
> + int ret = 0;
>
> if (!clkdm1 || !clkdm2)
> return -EINVAL;
>
> cd = _clkdm_deps_lookup(clkdm2, clkdm1->sleepdep_srcs);
> - if (IS_ERR(cd)) {
> + if (IS_ERR(cd))
> + ret = PTR_ERR(cd);
> +
> + if (!arch_clkdm || !arch_clkdm->clkdm_read_sleepdep)
> + ret = -EINVAL;
> +
> + if (ret) {
> pr_debug("clockdomain: hardware cannot set/clear sleep "
> "dependency affecting %s from %s\n",
clkdm1->name,
> clkdm2->name);
> - return PTR_ERR(cd);
> + return ret;
> }
>
> /* XXX It's faster to return the atomic sleepdep_usecount */
> - return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
> - OMAP3430_CM_SLEEPDEP,
> - (1 << clkdm2->dep_bit));
> + return arch_clkdm->clkdm_read_sleepdep(clkdm1, clkdm2);
> }
>
> /**
> @@ -716,31 +755,13 @@ int clkdm_read_sleepdep(struct clockdomain
*clkdm1, struct clockdomain *clkdm2)
> */
> int clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
> {
> - struct clkdm_dep *cd;
> - u32 mask = 0;
> -
> - if (!cpu_is_omap34xx())
> - return -EINVAL;
> -
> if (!clkdm)
> return -EINVAL;
>
> - for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
> - if (!omap_chip_is(cd->omap_chip))
> - continue;
> -
> - if (!cd->clkdm && cd->clkdm_name)
> - cd->clkdm = _clkdm_lookup(cd->clkdm_name);
> -
> - /* PRM accesses are slow, so minimize them */
> - mask |= 1 << cd->clkdm->dep_bit;
> - atomic_set(&cd->sleepdep_usecount, 0);
> - }
> -
> - omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
> - OMAP3430_CM_SLEEPDEP);
> + if (!arch_clkdm || !arch_clkdm->clkdm_clear_all_sleepdeps)
> + return -EINVAL;
>
> - return 0;
> + return arch_clkdm->clkdm_clear_all_sleepdeps(clkdm);
> }
>
> /**
> diff --git a/arch/arm/mach-omap2/clockdomain.h
b/arch/arm/mach-omap2/clockdomain.h
> index 71ad265..90b6d6a 100644
> --- a/arch/arm/mach-omap2/clockdomain.h
> +++ b/arch/arm/mach-omap2/clockdomain.h
> @@ -176,7 +176,11 @@ int omap2_clkdm_sleep(struct clockdomain *clkdm);
> int omap2_clkdm_clk_enable(struct clockdomain *clkdm, struct clk *clk);
> int omap2_clkdm_clk_disable(struct clockdomain *clkdm, struct clk
*clk);
>
> -extern void __init omap2_clockdomains_init(void);
> +extern void __init omap2xxx_clockdomains_init(void);
> +extern void __init omap3xxx_clockdomains_init(void);
> extern void __init omap44xx_clockdomains_init(void);
>
> +extern struct clkdm_ops omap2_clkdm_operations;
> +extern struct clkdm_ops omap3_clkdm_operations;
> +
> #endif
> diff --git a/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
> new file mode 100644
> index 0000000..a1fd6fd
> --- /dev/null
> +++ b/arch/arm/mach-omap2/clockdomain2xxx_3xxx.c
> @@ -0,0 +1,130 @@
> +/*
> + * OMAP2 and OMAP3 clockdomain control
> + *
> + * Copyright (C) 2008-2010 Texas Instruments, Inc.
> + * Copyright (C) 2008-2010 Nokia Corporation
> + *
> + * Derived from mach-omap2/clockdomain.c written by Paul Walmsley
> + * Rajendra Nayak <rnayak@ti.com>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/types.h>
> +#include <plat/prcm.h>
> +#include "prm.h"
> +#include "prm2xxx_3xxx.h"
> +#include "cm.h"
> +#include "cm2xxx_3xxx.h"
> +#include "cm-regbits-24xx.h"
> +#include "cm-regbits-34xx.h"
> +#include "clockdomain.h"
> +
> +static int omap2_clkdm_add_wkdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + omap2_prm_set_mod_reg_bits((1 << clkdm2->dep_bit),
> + clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
> + return 0;
> +}
> +
> +static int omap2_clkdm_del_wkdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + omap2_prm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
> + clkdm1->pwrdm.ptr->prcm_offs, PM_WKDEP);
> + return 0;
> +}
> +
> +static int omap2_clkdm_read_wkdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
> + PM_WKDEP, (1 << clkdm2->dep_bit));
> +}
> +
> +static int omap2_clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
> +{
> + struct clkdm_dep *cd;
> + u32 mask = 0;
> +
> + for (cd = clkdm->wkdep_srcs; cd && cd->clkdm_name; cd++) {
> + if (!omap_chip_is(cd->omap_chip))
> + continue;
> + if (!cd->clkdm)
> + continue; /* only happens if data is erroneous */
> +
> + /* PRM accesses are slow, so minimize them */
> + mask |= 1 << cd->clkdm->dep_bit;
> + atomic_set(&cd->wkdep_usecount, 0);
> + }
> +
> + omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
> + PM_WKDEP);
> + return 0;
> +}
> +
> +static int omap3_clkdm_add_sleepdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + omap2_cm_set_mod_reg_bits((1 << clkdm2->dep_bit),
> + clkdm1->pwrdm.ptr->prcm_offs,
> + OMAP3430_CM_SLEEPDEP);
> + return 0;
> +}
> +
> +static int omap3_clkdm_del_sleepdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + omap2_cm_clear_mod_reg_bits((1 << clkdm2->dep_bit),
> + clkdm1->pwrdm.ptr->prcm_offs,
> + OMAP3430_CM_SLEEPDEP);
> + return 0;
> +}
> +
> +static int omap3_clkdm_read_sleepdep(struct clockdomain *clkdm1,
> + struct clockdomain
*clkdm2)
> +{
> + return omap2_prm_read_mod_bits_shift(clkdm1->pwrdm.ptr->prcm_offs,
> + OMAP3430_CM_SLEEPDEP, (1 <<
clkdm2->dep_bit));
> +}
> +
> +static int omap3_clkdm_clear_all_sleepdeps(struct clockdomain *clkdm)
> +{
> + struct clkdm_dep *cd;
> + u32 mask = 0;
> +
> + for (cd = clkdm->sleepdep_srcs; cd && cd->clkdm_name; cd++) {
> + if (!omap_chip_is(cd->omap_chip))
> + continue;
> + if (!cd->clkdm)
> + continue; /* only happens if data is erroneous */
> +
> + /* PRM accesses are slow, so minimize them */
> + mask |= 1 << cd->clkdm->dep_bit;
> + atomic_set(&cd->sleepdep_usecount, 0);
> + }
> + omap2_prm_clear_mod_reg_bits(mask, clkdm->pwrdm.ptr->prcm_offs,
> + OMAP3430_CM_SLEEPDEP);
> + return 0;
> +}
> +
> +struct clkdm_ops omap2_clkdm_operations = {
> + .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
> + .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
> + .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
> + .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
> +};
> +
> +struct clkdm_ops omap3_clkdm_operations = {
> + .clkdm_add_wkdep = omap2_clkdm_add_wkdep,
> + .clkdm_del_wkdep = omap2_clkdm_del_wkdep,
> + .clkdm_read_wkdep = omap2_clkdm_read_wkdep,
> + .clkdm_clear_all_wkdeps = omap2_clkdm_clear_all_wkdeps,
> + .clkdm_add_sleepdep = omap3_clkdm_add_sleepdep,
> + .clkdm_del_sleepdep = omap3_clkdm_del_sleepdep,
> + .clkdm_read_sleepdep = omap3_clkdm_read_sleepdep,
> + .clkdm_clear_all_sleepdeps = omap3_clkdm_clear_all_sleepdeps,
> +};
> diff --git a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
b/arch/arm/mach-
> omap2/clockdomains2xxx_3xxx_data.c
> index 8cab07a..f85de72 100644
> --- a/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
> +++ b/arch/arm/mach-omap2/clockdomains2xxx_3xxx_data.c
> @@ -854,7 +854,12 @@ static struct clockdomain *clockdomains_omap2[]
__initdata = {
> NULL,
> };
>
> -void __init omap2_clockdomains_init(void)
> +void __init omap2xxx_clockdomains_init(void)
> {
> - clkdm_init(clockdomains_omap2, clkdm_autodeps, NULL);
> + clkdm_init(clockdomains_omap2, clkdm_autodeps,
&omap2_clkdm_operations);
> +}
> +
> +void __init omap3xxx_clockdomains_init(void)
> +{
> + clkdm_init(clockdomains_omap2, clkdm_autodeps,
&omap3_clkdm_operations);
> }
> diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c
> index c203204..89cbba2 100644
> --- a/arch/arm/mach-omap2/io.c
> +++ b/arch/arm/mach-omap2/io.c
> @@ -337,15 +337,15 @@ void __init omap2_init_common_infrastructure(void)
>
> if (cpu_is_omap242x()) {
> omap2xxx_powerdomains_init();
> - omap2_clockdomains_init();
> + omap2xxx_clockdomains_init();
> omap2420_hwmod_init();
> } else if (cpu_is_omap243x()) {
> omap2xxx_powerdomains_init();
> - omap2_clockdomains_init();
> + omap2xxx_clockdomains_init();
> omap2430_hwmod_init();
> } else if (cpu_is_omap34xx()) {
> omap3xxx_powerdomains_init();
> - omap2_clockdomains_init();
> + omap3xxx_clockdomains_init();
> omap3xxx_hwmod_init();
> } else if (cpu_is_omap44xx()) {
> omap44xx_powerdomains_init();
> --
> 1.7.2.3
^ permalink raw reply
* [PATCH] mx3fb: Fix parameter to sdc_init_panel
From: Alexander Stein @ 2011-02-14 12:06 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <Pine.LNX.4.64.1102140856070.7331@axis700.grange>
On Monday 14 February 2011, 08:57:04 Guennadi Liakhovetski wrote:
> On Mon, 14 Feb 2011, Alexander Stein wrote:
> > On Thursday 10 February 2011, 14:01:17 Alexander Stein wrote:
> > > On Thursday 10 February 2011, 13:48:23 Guennadi Liakhovetski wrote:
> > > > > I don't know which display you used, but I guess your right_margin
> > > > > (and lower_margin) needs to be adjusted.
> > > >
> > > > Ok, agree. But then you need to adjust all current users and have
> > > > them tested... Otherwise, of course, you can just adjust your
> > > > platform panel data to work with the current calculations, even
> > > > though in principle your patch seems to be doing the right thing
> > > > (tm), according to the manual. But if applied as is without fixing
> > > > all the users, it can very well break them...
> > >
> > > Ok, I've just seen there are some model defines in mx3fb.c which would
> > > also be affected.
> > > I'll try to find all mx3fb users and fix their videomodes and repost a
> > > new patch.
> >
> > Uh, this seems next to impossible for me to handle it my own. I checked
> > some users of the mx3fb but I cant say which ones will be affected and
> > which ones not (e.g. without any hsync/vsync, on data enable).
> > I've not idea how to fix it then.
>
> Well, you can, of course, adjust parameters for your platform to be able
> to run with this incorrect parameter definition...
This is just an ugly work-around. Depending on the settings you may even get
an overflow resulting in a not-working display at all.
Alexander
^ permalink raw reply
* [PATCH] OMAP4: clockdomain: Remove pr_errs' stating unsupported wkdep
From: Rajendra Nayak @ 2011-02-14 12:06 UTC (permalink / raw)
To: linux-arm-kernel
Now that wkup and sleep dependencies are supported (in the
form of static deps) for OMAP4, remove all instances of
pr_errs' stating dependencies are still unsupported
on OMAP4.
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
Patch applies on the integration-2.6.39 of
git://git.pwsan.com/linux-integration which
has the dependency support for omap4 queued
up.
arch/arm/mach-omap2/clockdomain.c | 24 ------------------------
1 files changed, 0 insertions(+), 24 deletions(-)
diff --git a/arch/arm/mach-omap2/clockdomain.c b/arch/arm/mach-omap2/clockdomain.c
index 70d2420..a0341de 100644
--- a/arch/arm/mach-omap2/clockdomain.c
+++ b/arch/arm/mach-omap2/clockdomain.c
@@ -400,12 +400,6 @@ int clkdm_add_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
struct clkdm_dep *cd;
int ret = 0;
- if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
- pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
- clkdm1->name, clkdm2->name, __func__);
- return -EINVAL;
- }
-
if (!clkdm1 || !clkdm2)
return -EINVAL;
@@ -447,12 +441,6 @@ int clkdm_del_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
struct clkdm_dep *cd;
int ret = 0;
- if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
- pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
- clkdm1->name, clkdm2->name, __func__);
- return -EINVAL;
- }
-
if (!clkdm1 || !clkdm2)
return -EINVAL;
@@ -501,12 +489,6 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
if (!clkdm1 || !clkdm2)
return -EINVAL;
- if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
- pr_err("clockdomain: %s/%s: %s: not yet implemented\n",
- clkdm1->name, clkdm2->name, __func__);
- return -EINVAL;
- }
-
cd = _clkdm_deps_lookup(clkdm2, clkdm1->wkdep_srcs);
if (IS_ERR(cd))
ret = PTR_ERR(cd);
@@ -536,12 +518,6 @@ int clkdm_read_wkdep(struct clockdomain *clkdm1, struct clockdomain *clkdm2)
*/
int clkdm_clear_all_wkdeps(struct clockdomain *clkdm)
{
- if (!cpu_is_omap24xx() && !cpu_is_omap34xx()) {
- pr_err("clockdomain: %s: %s: not yet implemented\n",
- clkdm->name, __func__);
- return -EINVAL;
- }
-
if (!clkdm)
return -EINVAL;
--
1.7.0.4
^ permalink raw reply related
* [PATCH] dmaengine: add slave-dma maintainer
From: Dan Williams @ 2011-02-14 11:58 UTC (permalink / raw)
To: linux-arm-kernel
Slave-dma has become the predominant usage model for dmaengine and needs
special attention. Memory-to-memory dma usage cases will continue to be
maintained by Dan.
Cc: Alan Cox <alan@linux.intel.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
Several factors have contributed to the need to add a co-maintainer
to dmaengine. First my time is being consumed in other areas [1].
Also, after Russell's review of amba-pl08x it became clear that the
semantics of the slave interface need to specified [2]. My work on the
iop-adma and ioatdma drivers has been limited to the memory-to-memory
use cases (NET_DMA and ASYNC_TX_DMA). Without direct slave-dma api
experience (client driver or dma driver) it is difficult to parse its
needs outside of its base similarities with the memory-to-memory case.
I have asked my colleague, Vinod Koul, to:
1/ put more definition around the slave api and usages to try to ensure
consistent behavior across drivers (as much as possible)
2/ help review and merge new drivers according to this definition
Vinod wrote the intel_mid_dma driver and expects to be involved with
slave-dma for the foreseeable future.
I will continue to maintain the memory-to-memory and related async_tx
usages of dmaengine (that need fixing [3]), but it is clear that this
usage has become a secondary role for the dmaengine infrastructure.
--
Dan
[1]: http://marc.info/?l=linux-scsi&m=129703780424729&w=2
[2]: http://marc.info/?l=linux-arm-kernel&m=129383280413633&w=2
[3]: http://marc.info/?l=linux-arm-kernel&m=129407269402930&w=2
MAINTAINERS | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 55592f8..e2f0992 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2124,6 +2124,7 @@ S: Supported
F: fs/dlm/
DMA GENERIC OFFLOAD ENGINE SUBSYSTEM
+M: Vinod Koul <vinod.koul@intel.com>
M: Dan Williams <dan.j.williams@intel.com>
S: Supported
F: drivers/dma/
^ permalink raw reply related
* [PATCH] ARM: vfp: Always save VFP state in vfp_pm_suspend
From: Catalin Marinas @ 2011-02-14 11:42 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297638813-1315-1-git-send-email-ccross@android.com>
On Sun, 2011-02-13 at 23:13 +0000, Colin Cross wrote:
> vfp_pm_suspend should save the VFP state any time there is
> a last_VFP_context. If it only saves when the VFP is enabled,
> the state can get lost when, on a UP system:
> Thread 1 uses the VFP
> Context switch occurs to thread 2, VFP is disabled but the
> VFP context is not saved to allow lazy save and restore
> Thread 2 initiates suspend
> vfp_pm_suspend is called with the VFP disabled, but the
> context has not been saved.
At this point is it guaranteed that the thread won't migrate to another
CPU? If not, we should use get/put_cpu.
> --- a/arch/arm/vfp/vfpmodule.c
> +++ b/arch/arm/vfp/vfpmodule.c
> @@ -415,13 +415,12 @@ static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
> struct thread_info *ti = current_thread_info();
> u32 fpexc = fmrx(FPEXC);
>
> - /* if vfp is on, then save state for resumption */
> - if (fpexc & FPEXC_EN) {
> + /* save state for resume */
> + if (last_VFP_context[ti->cpu]) {
> printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
> - vfp_save_state(&ti->vfpstate, fpexc);
> -
> - /* disable, just in case */
> - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
> + fmxr(FPEXC, fpexc | FPEXC_EN);
> + vfp_save_state(last_VFP_context[ti->cpu], fpexc);
> + fmxr(FPEXC, fpexc & ~FPEXC_EN);
> }
We may want to set the last_VFP_context to NULL so that after resuming
(to the same thread) we force the VFP reload from the vfpstate
structure. The vfp_support_entry code ignores the reloading if the
last_VFP_context is the same as vfpstate.
--
Catalin
^ permalink raw reply
* [PATCH] ARM: errata: pl310 cache sync operation may be faulty
From: srinidhi kasagar @ 2011-02-14 11:37 UTC (permalink / raw)
To: linux-arm-kernel
The effect of cache sync operation is to drain the store
buffer and wait for all internal buffers to be empty. In
normal conditions, store buffer is able to merge the
normal memory writes within its 32-byte data buffers.
Due to this erratum present in r3p0, the effect of cache
sync operation on the store buffer still remains when
the operation completes. This means that the store buffer
is always asked to drain and this prevents it from merging
any further writes.
This can severely affect performance on the write traffic
esp. on Normal memory NC one.
The proposed workaround is to replace the normal offset of
cache sync operation(0x730) by another offset targeting an
unmapped PL310 register 0x740.
Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
---
arch/arm/Kconfig | 15 +++++++++++++++
arch/arm/include/asm/hardware/cache-l2x0.h | 1 +
arch/arm/mm/cache-l2x0.c | 6 ++++++
3 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d5eb308..0b67a9f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1186,6 +1186,21 @@ config ARM_ERRATA_743622
visible impact on the overall performance or power consumption of the
processor.
+config ARM_ERRATA_753970
+ bool "ARM errata: cache sync operation may be faulty"
+ depends on CACHE_PL310
+ help
+ This option enables the workaround for the 753970 PL310 (r3p0) erratum.
+
+ Under some condition the effect of cache sync operation on
+ the store buffer still remains when the operation completes.
+ This means that the store buffer is always asked to drain and
+ this prevents it from merging any further writes. The workaround
+ is to replace the normal offset of cache sync operation (0x730)
+ by another offset targeting an unmapped PL310 register 0x740.
+ This has the same effect as the cache sync operation: store buffer
+ drain and waiting for all buffers empty.
+
endmenu
source "arch/arm/common/Kconfig"
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 5aeec1e..16bd480 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -36,6 +36,7 @@
#define L2X0_RAW_INTR_STAT 0x21C
#define L2X0_INTR_CLEAR 0x220
#define L2X0_CACHE_SYNC 0x730
+#define L2X0_DUMMY_REG 0x740
#define L2X0_INV_LINE_PA 0x770
#define L2X0_INV_WAY 0x77C
#define L2X0_CLEAN_LINE_PA 0x7B0
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 170c9bb..f2ce38e 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -49,7 +49,13 @@ static inline void cache_wait(void __iomem *reg, unsigned long mask)
static inline void cache_sync(void)
{
void __iomem *base = l2x0_base;
+
+#ifdef CONFIG_ARM_ERRATA_753970
+ /* write to an unmmapped register */
+ writel_relaxed(0, base + L2X0_DUMMY_REG);
+#else
writel_relaxed(0, base + L2X0_CACHE_SYNC);
+#endif
cache_wait(base + L2X0_CACHE_SYNC, 1);
}
--
1.7.0.4
^ permalink raw reply related
* [PATCH] ARM: errata: pl310 cache sync operation may be faulty
From: srinidhi kasagar @ 2011-02-14 11:37 UTC (permalink / raw)
To: linux-arm-kernel
The effect of cache sync operation is to drain the store
buffer and wait for all internal buffers to be empty. In
normal conditions, store buffer is able to merge the
normal memory writes within its 32-byte data buffers.
Due to this erratum present in r3p0, the effect of cache
sync operation on the store buffer still remains when
the operation completes. This means that the store buffer
is always asked to drain and this prevents it from merging
any further writes.
This can severely affect performance on the write traffic
esp. on Normal memory NC one.
The proposed workaround is to replace the normal offset of
cache sync operation(0x730) by another offset targeting an
unmapped PL310 register 0x740.
Signed-off-by: srinidhi kasagar <srinidhi.kasagar@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
---
arch/arm/Kconfig | 15 +++++++++++++++
arch/arm/include/asm/hardware/cache-l2x0.h | 1 +
arch/arm/mm/cache-l2x0.c | 6 ++++++
3 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index d5eb308..0b67a9f 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1186,6 +1186,21 @@ config ARM_ERRATA_743622
visible impact on the overall performance or power consumption of the
processor.
+config ARM_ERRATA_753970
+ bool "ARM errata: cache sync operation may be faulty"
+ depends on CACHE_PL310
+ help
+ This option enables the workaround for the 753970 PL310 (r3p0) erratum.
+
+ Under some condition the effect of cache sync operation on
+ the store buffer still remains when the operation completes.
+ This means that the store buffer is always asked to drain and
+ this prevents it from merging any further writes. The workaround
+ is to replace the normal offset of cache sync operation (0x730)
+ by another offset targeting an unmapped PL310 register 0x740.
+ This has the same effect as the cache sync operation: store buffer
+ drain and waiting for all buffers empty.
+
endmenu
source "arch/arm/common/Kconfig"
diff --git a/arch/arm/include/asm/hardware/cache-l2x0.h b/arch/arm/include/asm/hardware/cache-l2x0.h
index 5aeec1e..16bd480 100644
--- a/arch/arm/include/asm/hardware/cache-l2x0.h
+++ b/arch/arm/include/asm/hardware/cache-l2x0.h
@@ -36,6 +36,7 @@
#define L2X0_RAW_INTR_STAT 0x21C
#define L2X0_INTR_CLEAR 0x220
#define L2X0_CACHE_SYNC 0x730
+#define L2X0_DUMMY_REG 0x740
#define L2X0_INV_LINE_PA 0x770
#define L2X0_INV_WAY 0x77C
#define L2X0_CLEAN_LINE_PA 0x7B0
diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 170c9bb..8cabe09 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -49,8 +49,14 @@ static inline void cache_wait(void __iomem *reg, unsigned long mask)
static inline void cache_sync(void)
{
void __iomem *base = l2x0_base;
+
+#ifdef CONFIG_ARM_ERRATA_753970
+ /* write to an unmmapped register */
+ writel_relaxed(0, base + L2X0_DUMMY_REG);
+#else
writel_relaxed(0, base + L2X0_CACHE_SYNC);
cache_wait(base + L2X0_CACHE_SYNC, 1);
+#endif
}
static inline void l2x0_clean_line(unsigned long addr)
--
1.7.0.4
^ permalink raw reply related
* [PATCH] OMAP: IOMMU: add missing function declaration
From: David Cohen @ 2011-02-14 11:26 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTikUMURq-=okRju5YJroMEShHH6_eEMSvrg11UxC@mail.gmail.com>
On Mon, Feb 14, 2011 at 12:36 AM, Varadarajan, Charulatha <charu@ti.com> wrote:
> On Sat, Feb 12, 2011 at 19:09, David Cohen <dacohen@gmail.com> wrote:
>> Function declaration 'iopgtable_lookup_entry' is missing from header
>> file.
>
> Is this done because of any error?
> You may add a comment on why this is required.
The function is exported by iommu module, but no other driver is using
it so far. So, it's wrong but currently we have only a sparse warning.
I can add this information to the patch description.
Br,
David
>
>>
>> Signed-off-by: David Cohen <dacohen@gmail.com>
>> ---
>> ?arch/arm/plat-omap/include/plat/iommu.h | ? ?2 ++
>> ?1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/arch/arm/plat-omap/include/plat/iommu.h b/arch/arm/plat-omap/include/plat/iommu.h
>> index 9e8c104..5a2475f 100644
>> --- a/arch/arm/plat-omap/include/plat/iommu.h
>> +++ b/arch/arm/plat-omap/include/plat/iommu.h
>> @@ -163,6 +163,8 @@ extern void flush_iotlb_range(struct iommu *obj, u32 start, u32 end);
>> ?extern void flush_iotlb_all(struct iommu *obj);
>>
>> ?extern int iopgtable_store_entry(struct iommu *obj, struct iotlb_entry *e);
>> +extern void iopgtable_lookup_entry(struct iommu *obj, u32 da, u32 **ppgd,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?u32 **ppte);
>> ?extern size_t iopgtable_clear_entry(struct iommu *obj, u32 iova);
>>
>> ?extern int iommu_set_da_range(struct iommu *obj, u32 start, u32 end);
>> --
>> 1.7.1
>>
>
^ permalink raw reply
* [PATCH 0/11] ARM: EXYNOS4: Change ARCH name, ARCH_EXYNOS4 from ARCH_S5PV310
From: Kyungmin Park @ 2011-02-14 11:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297671787-10571-1-git-send-email-kgene.kim@samsung.com>
Hi,
Wow, fast move, but need to more explanation.
what's the exact meaning of exynos4210?
Exynos4 is prefix and remaining are variants?
Now you changed all s5pv310 to exynos4. if new exynos4xxx chip are
comes then how to handle this one?
e.g., exynos4220 or later.
it's also conflict with mach-exynos4. do you handle all exynos4 series
at this mach directory?
historically there's no rules of the base RAM address at least samsung chips.
Thank you,
Kyungmin Park
On Mon, Feb 14, 2011 at 5:22 PM, Kukjin Kim <kgene.kim@samsung.com> wrote:
> This patch set changes to ARCH_EXYNOS4 from ARCH_S5PV310 for supporting Samsung's
> new brand name EXYNOS. Samsung officially announced about the brand name of EXYNOS
> at MWC 2011 and The EXYNOS4 integrates a ARM Cortex A9 microporcessor with several
> other peripherals to support features such as multimedai, storage, graphics and gaming.
> Especially, the EXYNOS4210 CPU which is one of EXYNOS4 SoC series can be used in
> products such as Mobile devices.
>
> This patch set consists of the following patches.
>
> [PATCH 01/11] ARM: EXYNOS4: Add EXYNOS4 CPU initialization support
> [PATCH 02/11] ARM: EXYNOS4: Update Clock part
> [PATCH 03/11] ARM: EXYNOS4: Update IRQ part
> [PATCH 04/11] ARM: EXYNOS4: Update Timer part
> [PATCH 05/11] ARM: EXYNOS4: Update device support
> [PATCH 06/11] ARM: EXYNOS4: Moved board support files
> [PATCH 07/11] ARM: EXYNOS4: Update Kconfig and Makefile for the new ARCH_EXYNOS4
> [PATCH 08/11] ARM: exynos4_defconfig: Add defconfig for EXYNOS4
> [PATCH 09/11] mtd: OneNAND: Change dependency of ARCH_EXYNOS4
> [PATCH 10/11] ASoC: Change dependency of ARCH_EXYNOS4
> [PATCH 11/11] tty: Change dependency of ARCH_EXYNOS4
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
^ permalink raw reply
* [PATCH 2/2] ARM: Preserve the VFP state during fork
From: Catalin Marinas @ 2011-02-14 10:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110214103528.5796.99616.stgit@e102109-lin.cambridge.arm.com>
VFP registers d16-d31 are callee saved registers and must be preserved
during function calls, including fork(). The VFP configuration should
also be preserved. The patch copies the full VFP state to the child
process.
Reported-by: Paul Wright <paul.wright@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm/vfp/vfpmodule.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 5153135..cb7a88c 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -78,6 +78,14 @@ static void vfp_thread_exit(struct thread_info *thread)
put_cpu();
}
+static void vfp_thread_copy(struct thread_info *thread)
+{
+ struct thread_info *parent = current_thread_info();
+
+ vfp_sync_hwstate(parent);
+ thread->vfpstate = parent->vfpstate;
+}
+
/*
* When this function is called with the following 'cmd's, the following
* is true while this function is being run:
@@ -148,6 +156,10 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
case THREAD_NOTIFY_EXIT:
vfp_thread_exit(thread);
break;
+
+ case THREAD_NOTIFY_COPY:
+ vfp_thread_copy(thread);
+ break;
}
return NOTIFY_DONE;
^ permalink raw reply related
* [PATCH 1/2] ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
From: Catalin Marinas @ 2011-02-14 10:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110214103528.5796.99616.stgit@e102109-lin.cambridge.arm.com>
This patch adds THREAD_NOTIFY_COPY for colling registered handlers
during the copy_thread() function call. It also changes the VFP handler
to use a switch statement rather than if..else and ignore this event.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
---
arch/arm/include/asm/thread_notify.h | 1 +
arch/arm/kernel/process.c | 2 ++
arch/arm/vfp/vfpmodule.c | 22 +++++++++++++++-------
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/arch/arm/include/asm/thread_notify.h b/arch/arm/include/asm/thread_notify.h
index c4391ba..1dc9806 100644
--- a/arch/arm/include/asm/thread_notify.h
+++ b/arch/arm/include/asm/thread_notify.h
@@ -43,6 +43,7 @@ static inline void thread_notify(unsigned long rc, struct thread_info *thread)
#define THREAD_NOTIFY_FLUSH 0
#define THREAD_NOTIFY_EXIT 1
#define THREAD_NOTIFY_SWITCH 2
+#define THREAD_NOTIFY_COPY 3
#endif
#endif
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 94bbedb..5e1e541 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -372,6 +372,8 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start,
if (clone_flags & CLONE_SETTLS)
thread->tp_value = regs->ARM_r3;
+ thread_notify(THREAD_NOTIFY_COPY, thread);
+
return 0;
}
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
index 0797cb5..5153135 100644
--- a/arch/arm/vfp/vfpmodule.c
+++ b/arch/arm/vfp/vfpmodule.c
@@ -104,12 +104,17 @@ static void vfp_thread_exit(struct thread_info *thread)
static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
{
struct thread_info *thread = v;
+ u32 fpexc;
+#ifdef CONFIG_SMP
+ unsigned int cpu;
+#endif
- if (likely(cmd == THREAD_NOTIFY_SWITCH)) {
- u32 fpexc = fmrx(FPEXC);
+ switch (cmd) {
+ case THREAD_NOTIFY_SWITCH:
+ fpexc = fmrx(FPEXC);
#ifdef CONFIG_SMP
- unsigned int cpu = thread->cpu;
+ cpu = thread->cpu;
/*
* On SMP, if VFP is enabled, save the old state in
@@ -134,13 +139,16 @@ static int vfp_notifier(struct notifier_block *self, unsigned long cmd, void *v)
* old state.
*/
fmxr(FPEXC, fpexc & ~FPEXC_EN);
- return NOTIFY_DONE;
- }
+ break;
- if (cmd == THREAD_NOTIFY_FLUSH)
+ case THREAD_NOTIFY_FLUSH:
vfp_thread_flush(thread);
- else
+ break;
+
+ case THREAD_NOTIFY_EXIT:
vfp_thread_exit(thread);
+ break;
+ }
return NOTIFY_DONE;
}
^ permalink raw reply related
* [PATCH 0/2] Preserve the VFP state across the fork() call
From: Catalin Marinas @ 2011-02-14 10:37 UTC (permalink / raw)
To: linux-arm-kernel
The VFP state should be copied to the child process during the fork()
system call. This is important because the d16-d31 registers are callee
saved and the compiler may use them for preserving data across function
calls.
Catalin Marinas (2):
ARM: Introduce THREAD_NOTIFY_COPY for copy_thread() hooks
ARM: Preserve the VFP state during fork
arch/arm/include/asm/thread_notify.h | 1 +
arch/arm/kernel/process.c | 2 ++
arch/arm/vfp/vfpmodule.c | 34 +++++++++++++++++++++++++++-------
3 files changed, 30 insertions(+), 7 deletions(-)
--
Catalin
^ permalink raw reply
* [PATCH] tosa-bt: drop setting LED trigger name, as it's unsupported now
From: Dmitry Eremin-Solenikov @ 2011-02-14 10:36 UTC (permalink / raw)
To: linux-arm-kernel
Since 2e48928d8a0f38c1b5c81eb3f1294de8a6382c68 it's no longer possible to set
the name of the LED trigger for RFKILL events. Drop respective code from tosa-bt.c
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: John W. Linville <linville@tuxdriver.com>
---
arch/arm/mach-pxa/tosa-bt.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/tosa-bt.c b/arch/arm/mach-pxa/tosa-bt.c
index c31e601..b9b1e5c 100644
--- a/arch/arm/mach-pxa/tosa-bt.c
+++ b/arch/arm/mach-pxa/tosa-bt.c
@@ -81,8 +81,6 @@ static int tosa_bt_probe(struct platform_device *dev)
goto err_rfk_alloc;
}
- rfkill_set_led_trigger_name(rfk, "tosa-bt");
-
rc = rfkill_register(rfk);
if (rc)
goto err_rfkill;
--
1.7.2.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox