* [PATCH 2/2] ARM: remove the 4x expansion presumption while decompressing the kernel
From: Nicolas Pitre @ 2011-02-17 20:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217185223.GA30606@n2100.arm.linux.org.uk>
On Thu, 17 Feb 2011, Russell King - ARM Linux wrote:
> On Thu, Feb 17, 2011 at 10:51:56AM -0700, Grant Likely wrote:
> > As for knowing where it can relocate to, we already know (actually
> > current code just makes an assumption) about how long the kernel
> > proper image is and where it wants to live in the zImage's head.S.
> > Assuming enough ram, if r6 reflects the size of the zImage + the size
> > of the appended data then it should be good.
>
> That isn't a valid argument. Just because "the decompressor already
> does it" does not mean that it'll work with ramdisks. We've been
> lucky so far that it has worked with the kernel - and that's exactly
> what it is - luck.
Two things here:
1) It is possible to know the length of an ATAG or DT block. The size
of a ramdisk image is not known without external information.
2) If the size of a ramdisk was discoverable by the zImage code, and if
the ramdisk image was simply appended to zImage itself, then there
would be no guessing as to where to allocate and load things as
separate blobs.
Let's suppose zImage is 1MB in size, the appended ramdisk image is 16MB,
and the decompressed kernel is 3MB. And for simplicity let's ignore
TEXT_OFFSET for the moment.
If zImage is loaded at 3MB from start of physical memory (or above) then
nothing needs to be relocated. It will simply decompress the kernel
from 0MB up to 3MB from start of physical memory. If a ramdisk is
appended to zImage then that location can be passed straight to the
kernel. We only need to make sure the kernel .bss is not larger than
1MB in that case which should be the norm. No guessing, no reliance on
luck. The only limitation is that you need at least 20MB of RAM here,
and there is no way around it whatever the booting method. (Actually you
could save 1MB by not using zImage but a straight Image, but if you're
so tight in RAM you shouldn't use a ramdisk to start with.)
If zImage is loaded at 0MB (typical) then it has to move things around.
Currently the code decompress the kernel and store it from the 1MB
address up to the 4MB address, and then move the kernel back down to 0MB
(a 3MB copy). What my patch does is to have zImage copy itself (1MB
large) to the 3MB address and then decompress the kernel from 0MB to
3MB.
Now if there is a ramdisk image appended to zImage, the zImage
relocation becomes a 17MB copy. And to be 100% safe, we might consider
the end of the kernel .bss to determine the relocation address for
zImage. But still, the final situation is the same as the case where no
relocation is needed. The ramdisk image is relocated along with zImage
to the optimal location i.e. from 4MB upwards. Again, no guessing, no
reliance on luck, no risk of overwriting a separately loaded ramdisk.
Of course this doesn't work on targets with segmented memory such as on
SA1100. For those the conventional method of loading the kernel in one
segment and the ramdisk in another must be preserved.
But with modern ARM machines, it would be far simpler to just
cat zImage ramdisk.gz > boot_image
and load that boot_image anywhere in memory and no bother with guesses
as to where to separately load the ramdisk and hope it won't get
overwritten at some point by the kernel decompressor.
But we're not there with initrd yet. I believe the rework of the
decompressor code has great value on its own. And then the
concatenation trick could be used for DTB which can be easily be self
sized. Doing that with a ramdisk image would require some information
header in between. But one step at a time.
Nicolas
^ permalink raw reply
* [PATCH v2 2/2] ARM: mach-mx5: Add watchdog support for MX53 based boards
From: Uwe Kleine-König @ 2011-02-17 20:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297973393-31388-2-git-send-email-fabio.estevam@freescale.com>
Hi Fabio,
On Thu, Feb 17, 2011 at 06:09:53PM -0200, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
both patches look fine now
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH v2 2/2] ARM: mach-mx5: Add watchdog support for MX53 based boards
From: Fabio Estevam @ 2011-02-17 20:09 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297973393-31388-1-git-send-email-fabio.estevam@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-mx5/Kconfig | 3 +++
arch/arm/mach-mx5/board-mx53_evk.c | 1 +
arch/arm/mach-mx5/board-mx53_loco.c | 1 +
arch/arm/mach-mx5/board-mx53_smd.c | 1 +
4 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 10b6008..9a291f6 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -126,6 +126,7 @@ config MACH_MX51_EFIKAMX
config MACH_MX53_EVK
bool "Support MX53 EVK platforms"
select SOC_IMX53
+ select IMX_HAVE_PLATFORM_IMX2_WDT
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_IMX_I2C
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
@@ -137,6 +138,7 @@ config MACH_MX53_EVK
config MACH_MX53_SMD
bool "Support MX53 SMD platforms"
select SOC_IMX53
+ select IMX_HAVE_PLATFORM_IMX2_WDT
select IMX_HAVE_PLATFORM_IMX_UART
help
Include support for MX53 SMD platform. This includes specific
@@ -145,6 +147,7 @@ config MACH_MX53_SMD
config MACH_MX53_LOCO
bool "Support MX53 LOCO platforms"
select SOC_IMX53
+ select IMX_HAVE_PLATFORM_IMX2_WDT
select IMX_HAVE_PLATFORM_IMX_UART
help
Include support for MX53 LOCO platform. This includes specific
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index 8ed316b..652e1e0 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -137,6 +137,7 @@ static void __init mx53_evk_board_init(void)
spi_register_board_info(mx53_evk_spi_board_info,
ARRAY_SIZE(mx53_evk_spi_board_info));
imx53_add_ecspi(0, &mx53_evk_spi_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_evk_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index 0fea252..6005f49 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -69,6 +69,7 @@ static void __init mx53_loco_board_init(void)
imx53_add_imx_uart(0, NULL);
mx53_loco_fec_reset();
imx53_add_fec(&mx53_loco_fec_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_loco_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index fa0fad8..8a8694c 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -90,6 +90,7 @@ static void __init mx53_smd_board_init(void)
mx53_smd_init_uart();
mx53_smd_fec_reset();
imx53_add_fec(&mx53_smd_fec_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_smd_timer_init(void)
--
1.6.0.4
^ permalink raw reply related
* [PATCH v2 1/2] ARM: mx5: Add watchdog support for MX53
From: Fabio Estevam @ 2011-02-17 20:09 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-mx5/clock-mx51-mx53.c | 2 ++
arch/arm/mach-mx5/devices-imx53.h | 4 ++++
arch/arm/mach-mx5/mm.c | 2 +-
arch/arm/plat-mxc/devices/platform-imx2-wdt.c | 9 +++++++++
arch/arm/plat-mxc/include/mach/mx53.h | 2 +-
5 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index c66be0e..8164b1d 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1336,6 +1336,8 @@ static struct clk_lookup mx53_lookups[] = {
_REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk)
_REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk)
_REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk)
+ _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
+ _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
};
static void clk_tree_init(void)
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index 8639735..9251008 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -29,3 +29,7 @@ imx53_sdhci_esdhc_imx_data[] __initconst;
extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst;
#define imx53_add_ecspi(id, pdata) \
imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
+
+extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst;
+#define imx53_add_imx2_wdt(id, pdata) \
+ imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 8730cd1..ff55730 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -66,7 +66,7 @@ void __init imx53_init_early(void)
{
mxc_set_cpu_type(MXC_CPU_MX53);
mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR));
- mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG_BASE_ADDR));
+ mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
}
int imx51_register_gpios(void);
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index e0aec61..5e07ef2 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -53,6 +53,15 @@ const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
};
#endif /* ifdef CONFIG_SOC_IMX51 */
+#ifdef CONFIG_SOC_IMX53
+const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
+#define imx53_imx2_wdt_data_entry(_id, _hwid) \
+ imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
+ imx53_imx2_wdt_data_entry(0, 1),
+ imx53_imx2_wdt_data_entry(1, 2),
+};
+#endif /* ifdef CONFIG_SOC_IMX53 */
+
struct platform_device *__init imx_add_imx2_wdt(
const struct imx_imx2_wdt_data *data)
{
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index d7a8e52..ace1786 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -79,7 +79,7 @@
#define MX53_GPIO3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0008C000)
#define MX53_GPIO4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00090000)
#define MX53_KPP_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00094000)
-#define MX53_WDOG_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000)
+#define MX53_WDOG1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000)
#define MX53_WDOG2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0009C000)
#define MX53_GPT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A0000)
#define MX53_SRTC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A4000)
--
1.6.0.4
^ permalink raw reply related
* [PATCH 2/6] ARM: pm: add generic CPU suspend/resume support
From: Colin Cross @ 2011-02-17 20:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297939312.7096.32.camel@e102568-lin.cambridge.arm.com>
On Thu, Feb 17, 2011 at 2:41 AM, Lorenzo Pieralisi
<lorenzo.pieralisi@arm.com> wrote:
> Colin,
>
> On Tue, 2011-02-15 at 16:26 -0800, Colin Cross wrote:
>> On Tue, Feb 15, 2011 at 3:04 AM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > On Fri, Feb 11, 2011 at 06:50:57PM -0800, Colin Cross wrote:
>> >> > +ENDPROC(cpu_resume_turn_mmu_on)
>> >> > +cpu_resume_after_mmu:
>> >> > + ? ? ? str ? ? r5, [r2, r4, lsl #2] ? ?@ restore old mapping
>> >> > +#ifdef MULTI_CACHE
>> >> > + ? ? ? ldr ? ? r10, =cpu_cache
>> >> > + ? ? ? ldr ? ? pc, [r10, #CACHE_FLUSH_KERN_ALL]
>> >> > +#else
>> >> > + ? ? ? b ? ? ? __cpuc_flush_kern_all
>> >> > +#endif
>> >
>> > I think we can eliminate this cache flush by delaying the cache enable
>> > as below. ?Could you see whether Tegra 2 survives this please?
>> > Thanks.
>> >
>> > diff --git a/arch/arm/kernel/sleep.S b/arch/arm/kernel/sleep.S
>> > index bed1876..193be5f 100644
>> > --- a/arch/arm/kernel/sleep.S
>> > +++ b/arch/arm/kernel/sleep.S
>> > @@ -4,6 +4,7 @@
>> > ?#include <asm/assembler.h>
>> > ?#include <asm/glue-cache.h>
>> > ?#include <asm/glue-proc.h>
>> > +#include <asm/system.h>
>> > ? ? ? ?.text
>> >
>> > ?/*
>> > @@ -81,25 +82,22 @@ ENTRY(cpu_resume_mmu)
>> > ? ? ? ?str ? ? r3, [r2, r4, lsl #2] ? ?@ setup 1:1 mapping for mmu code
>> > ? ? ? ?sub ? ? r2, r2, r1
>> > ? ? ? ?ldr ? ? r3, =cpu_resume_after_mmu
>> > + ? ? ? bic ? ? r1, r0, #CR_C ? ? ? ? ? @ ensure D-cache is disabled
>> > ? ? ? ?b ? ? ? cpu_resume_turn_mmu_on
>> > ?ENDPROC(cpu_resume_mmu)
>> > ? ? ? ?.ltorg
>> > ? ? ? ?.align ?5
>> > ?cpu_resume_turn_mmu_on:
>> > - ? ? ? mcr ? ? p15, 0, r0, c1, c0, 0 ? @ turn on MMU, caches, etc
>> > - ? ? ? mrc ? ? p15, 0, r0, c0, c0, 0 ? @ read id reg
>> > - ? ? ? mov ? ? r0, r0
>> > - ? ? ? mov ? ? r0, r0
>> > + ? ? ? mcr ? ? p15, 0, r1, c1, c0, 0 ? @ turn on MMU, I-cache, etc
>> > + ? ? ? mrc ? ? p15, 0, r1, c0, c0, 0 ? @ read id reg
>> > + ? ? ? mov ? ? r1, r1
>> > + ? ? ? mov ? ? r1, r1
>> > ? ? ? ?mov ? ? pc, r3 ? ? ? ? ? ? ? ? ?@ jump to virtual address
>> > ?ENDPROC(cpu_resume_turn_mmu_on)
>> > ?cpu_resume_after_mmu:
>> > ? ? ? ?str ? ? r5, [r2, r4, lsl #2] ? ?@ restore old mapping
>> > -#ifdef MULTI_CACHE
>> > - ? ? ? ldr ? ? r10, =cpu_cache
>> > - ? ? ? ldr ? ? pc, [r10, #CACHE_FLUSH_KERN_ALL]
>> > -#else
>> > - ? ? ? b ? ? ? __cpuc_flush_kern_all
>> > -#endif
>> > + ? ? ? mcr ? ? p15, 0, r0, c1, c0, 0 ? @ turn on D-cache
>> > + ? ? ? mov ? ? pc, lr
>> >
>> > ?/*
>> > ?* Note: Yes, part of the following code is located into the .data section.
>> >
>> >
>>
>> Tested-by: Colin Cross <ccross@android.com>
>>
>> Works for Tegra 2 cpuidle and suspend.
>>
>
> When calling suspend from cpuidle, do you flush the stack (ie CPU
> context) from L2 using outer_cache functions ? This has to be done when
> one CPU is shut down with L2 enabled for the MMU off resume path to work
> properly.
Tegra2 has the power rails of the two cpus tied together, so the cpu
that suspends first only needs to go through cpu_resume if the other
cpu has also suspended and flushed the entire L2 cache. On platforms
that can power gate the cpus individually you will need to flush the
stack and stack pointer in cpu_suspend. I have a patch that does the
flushes in cpu_suspend, but it failed on the way back up because the
page table modifications got lost behind the L2, and I haven't retried
it since Russell fixed that.
> I think that on resume you invalidate L1 in the reset vector before
> jumping to cpu_resume, correct ?
I manually invalidate the L1 Dcache, but not the Icache.
^ permalink raw reply
* [PATCH 2/2] ARM: remove the 4x expansion presumption while decompressing the kernel
From: Rob Herring @ 2011-02-17 19:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217185223.GA30606@n2100.arm.linux.org.uk>
On 02/17/2011 12:52 PM, Russell King - ARM Linux wrote:
> On Thu, Feb 17, 2011 at 10:51:56AM -0700, Grant Likely wrote:
>> As for knowing where it can relocate to, we already know (actually
>> current code just makes an assumption) about how long the kernel
>> proper image is and where it wants to live in the zImage's head.S.
>> Assuming enough ram, if r6 reflects the size of the zImage + the size
>> of the appended data then it should be good.
>
> That isn't a valid argument. Just because "the decompressor already
> does it" does not mean that it'll work with ramdisks. We've been
> lucky so far that it has worked with the kernel - and that's exactly
> what it is - luck.
>
> It works for a 1-2MB kernel. A 16MB ramdisk is a completely different
> kettle of bytes.
The capability to add an initramfs into the kernel binary already exists
within the kernel build system. The primary difference here is when the
initramfs is added. Doing that after the kernel build is the more sane
approach. For example, if you want to include kernel modules in your
initramfs and a single image, the current method is kind of broken. You
have to build the kernel once to build the modules, then build it again
to update the initramfs.
If the ramdisk size is the only issue, then you would be okay with
adding couple of KB of dtb image?
Rob
>
> _______________________________________________
> 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: mach-mx5: Add watchdog support for MX53 based boards
From: Uwe Kleine-König @ 2011-02-17 19:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297969066-14810-2-git-send-email-fabio.estevam@freescale.com>
Hi Fabio,
just a small nitpick below,
On Thu, Feb 17, 2011 at 04:57:46PM -0200, Fabio Estevam wrote:
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/mach-mx5/Kconfig | 3 +++
> arch/arm/mach-mx5/board-mx53_evk.c | 1 +
> arch/arm/mach-mx5/board-mx53_loco.c | 1 +
> arch/arm/mach-mx5/board-mx53_smd.c | 1 +
> 4 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
> index 10b6008..8441462 100644
> --- a/arch/arm/mach-mx5/Kconfig
> +++ b/arch/arm/mach-mx5/Kconfig
> @@ -128,6 +128,7 @@ config MACH_MX53_EVK
> select SOC_IMX53
> select IMX_HAVE_PLATFORM_IMX_UART
> select IMX_HAVE_PLATFORM_IMX_I2C
> + select IMX_HAVE_PLATFORM_IMX2_WDT
IMX2 sorts before IMX_
Other than that ack for both patches.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Felipe Balbi @ 2011-02-17 19:08 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217181849.GV20795@atomide.com>
On Thu, Feb 17, 2011 at 10:18:49AM -0800, Tony Lindgren wrote:
> * Cousson, Benoit <b-cousson@ti.com> [110217 09:45]:
> >
> > Done, boot tested, and that does remove the warning about the
> > missing opt clock you had with the previous data.
> >
> > git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
> >
> > Just let me know if it does break anything else.
>
> Pulled into omap-for-linus. Also now merged are the devel-hwspinlock
> and devel-mcspi branches.
Ok good. Tomorrow I'll send you a proper pull request for my part, will
leave testusb running over night.
--
balbi
^ permalink raw reply
* [PATCH 2/2] ARM: mach-mx5: Add watchdog support for MX53 based boards
From: Fabio Estevam @ 2011-02-17 18:57 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297969066-14810-1-git-send-email-fabio.estevam@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-mx5/Kconfig | 3 +++
arch/arm/mach-mx5/board-mx53_evk.c | 1 +
arch/arm/mach-mx5/board-mx53_loco.c | 1 +
arch/arm/mach-mx5/board-mx53_smd.c | 1 +
4 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index 10b6008..8441462 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -128,6 +128,7 @@ config MACH_MX53_EVK
select SOC_IMX53
select IMX_HAVE_PLATFORM_IMX_UART
select IMX_HAVE_PLATFORM_IMX_I2C
+ select IMX_HAVE_PLATFORM_IMX2_WDT
select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
select IMX_HAVE_PLATFORM_SPI_IMX
help
@@ -138,6 +139,7 @@ config MACH_MX53_SMD
bool "Support MX53 SMD platforms"
select SOC_IMX53
select IMX_HAVE_PLATFORM_IMX_UART
+ select IMX_HAVE_PLATFORM_IMX2_WDT
help
Include support for MX53 SMD platform. This includes specific
configurations for the board and its peripherals.
@@ -146,6 +148,7 @@ config MACH_MX53_LOCO
bool "Support MX53 LOCO platforms"
select SOC_IMX53
select IMX_HAVE_PLATFORM_IMX_UART
+ select IMX_HAVE_PLATFORM_IMX2_WDT
help
Include support for MX53 LOCO platform. This includes specific
configurations for the board and its peripherals.
diff --git a/arch/arm/mach-mx5/board-mx53_evk.c b/arch/arm/mach-mx5/board-mx53_evk.c
index 8ed316b..652e1e0 100644
--- a/arch/arm/mach-mx5/board-mx53_evk.c
+++ b/arch/arm/mach-mx5/board-mx53_evk.c
@@ -137,6 +137,7 @@ static void __init mx53_evk_board_init(void)
spi_register_board_info(mx53_evk_spi_board_info,
ARRAY_SIZE(mx53_evk_spi_board_info));
imx53_add_ecspi(0, &mx53_evk_spi_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_evk_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_loco.c b/arch/arm/mach-mx5/board-mx53_loco.c
index 0fea252..6005f49 100644
--- a/arch/arm/mach-mx5/board-mx53_loco.c
+++ b/arch/arm/mach-mx5/board-mx53_loco.c
@@ -69,6 +69,7 @@ static void __init mx53_loco_board_init(void)
imx53_add_imx_uart(0, NULL);
mx53_loco_fec_reset();
imx53_add_fec(&mx53_loco_fec_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_loco_timer_init(void)
diff --git a/arch/arm/mach-mx5/board-mx53_smd.c b/arch/arm/mach-mx5/board-mx53_smd.c
index fa0fad8..8a8694c 100644
--- a/arch/arm/mach-mx5/board-mx53_smd.c
+++ b/arch/arm/mach-mx5/board-mx53_smd.c
@@ -90,6 +90,7 @@ static void __init mx53_smd_board_init(void)
mx53_smd_init_uart();
mx53_smd_fec_reset();
imx53_add_fec(&mx53_smd_fec_data);
+ imx53_add_imx2_wdt(0, NULL);
}
static void __init mx53_smd_timer_init(void)
--
1.6.0.4
^ permalink raw reply related
* [PATCH 1/2] ARM: mx5: Add watchdog support for MX53
From: Fabio Estevam @ 2011-02-17 18:57 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-mx5/clock-mx51-mx53.c | 2 ++
arch/arm/mach-mx5/devices-imx53.h | 4 ++++
arch/arm/mach-mx5/mm.c | 2 +-
arch/arm/plat-mxc/devices/platform-imx2-wdt.c | 9 +++++++++
arch/arm/plat-mxc/include/mach/mx53.h | 2 +-
5 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-mx5/clock-mx51-mx53.c b/arch/arm/mach-mx5/clock-mx51-mx53.c
index c66be0e..8164b1d 100644
--- a/arch/arm/mach-mx5/clock-mx51-mx53.c
+++ b/arch/arm/mach-mx5/clock-mx51-mx53.c
@@ -1336,6 +1336,8 @@ static struct clk_lookup mx53_lookups[] = {
_REGISTER_CLOCK("imx53-ecspi.0", NULL, ecspi1_clk)
_REGISTER_CLOCK("imx53-ecspi.1", NULL, ecspi2_clk)
_REGISTER_CLOCK("imx53-cspi.0", NULL, cspi_clk)
+ _REGISTER_CLOCK("imx2-wdt.0", NULL, dummy_clk)
+ _REGISTER_CLOCK("imx2-wdt.1", NULL, dummy_clk)
};
static void clk_tree_init(void)
diff --git a/arch/arm/mach-mx5/devices-imx53.h b/arch/arm/mach-mx5/devices-imx53.h
index 8639735..9251008 100644
--- a/arch/arm/mach-mx5/devices-imx53.h
+++ b/arch/arm/mach-mx5/devices-imx53.h
@@ -29,3 +29,7 @@ imx53_sdhci_esdhc_imx_data[] __initconst;
extern const struct imx_spi_imx_data imx53_ecspi_data[] __initconst;
#define imx53_add_ecspi(id, pdata) \
imx_add_spi_imx(&imx53_ecspi_data[id], pdata)
+
+extern const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst;
+#define imx53_add_imx2_wdt(id, pdata) \
+ imx_add_imx2_wdt(&imx53_imx2_wdt_data[id])
diff --git a/arch/arm/mach-mx5/mm.c b/arch/arm/mach-mx5/mm.c
index 8730cd1..ff55730 100644
--- a/arch/arm/mach-mx5/mm.c
+++ b/arch/arm/mach-mx5/mm.c
@@ -66,7 +66,7 @@ void __init imx53_init_early(void)
{
mxc_set_cpu_type(MXC_CPU_MX53);
mxc_iomux_v3_init(MX53_IO_ADDRESS(MX53_IOMUXC_BASE_ADDR));
- mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG_BASE_ADDR));
+ mxc_arch_reset_init(MX53_IO_ADDRESS(MX53_WDOG1_BASE_ADDR));
}
int imx51_register_gpios(void);
diff --git a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
index e0aec61..5e07ef2 100644
--- a/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
+++ b/arch/arm/plat-mxc/devices/platform-imx2-wdt.c
@@ -53,6 +53,15 @@ const struct imx_imx2_wdt_data imx51_imx2_wdt_data[] __initconst = {
};
#endif /* ifdef CONFIG_SOC_IMX51 */
+#ifdef CONFIG_SOC_IMX53
+const struct imx_imx2_wdt_data imx53_imx2_wdt_data[] __initconst = {
+#define imx53_imx2_wdt_data_entry(_id, _hwid) \
+ imx_imx2_wdt_data_entry(MX53, _id, _hwid, SZ_16K)
+ imx53_imx2_wdt_data_entry(0, 1),
+ imx53_imx2_wdt_data_entry(1, 2),
+};
+#endif /* ifdef CONFIG_SOC_IMX53 */
+
struct platform_device *__init imx_add_imx2_wdt(
const struct imx_imx2_wdt_data *data)
{
diff --git a/arch/arm/plat-mxc/include/mach/mx53.h b/arch/arm/plat-mxc/include/mach/mx53.h
index d7a8e52..ace1786 100644
--- a/arch/arm/plat-mxc/include/mach/mx53.h
+++ b/arch/arm/plat-mxc/include/mach/mx53.h
@@ -79,7 +79,7 @@
#define MX53_GPIO3_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0008C000)
#define MX53_GPIO4_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00090000)
#define MX53_KPP_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00094000)
-#define MX53_WDOG_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000)
+#define MX53_WDOG1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x00098000)
#define MX53_WDOG2_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x0009C000)
#define MX53_GPT1_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A0000)
#define MX53_SRTC_BASE_ADDR (MX53_AIPS1_BASE_ADDR + 0x000A4000)
--
1.6.0.4
^ permalink raw reply related
* [PATCH 1/2] ARM: PXA: PXAFB: Fix double-free issue.
From: Russell King - ARM Linux @ 2011-02-17 18:56 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <201102171917.41442.marek.vasut@gmail.com>
On Thu, Feb 17, 2011 at 07:17:41PM +0100, Marek Vasut wrote:
> Why are you getting rid of the atomic operations ?
Because they're idiotic. Just because something is called "atomic"
doesn't make it so, and this is one instance where it's absolutely
useless.
The open and release functions are called with a mutex held. Only
_one_ thread can be inside these at any one time. So what use does
additionally doing an atomic operation within an already thread-safe
environment gain you?
> Besides, "if (ofb->usage++ == 0)" looks suspicious, especially if you later
> declare it as uint32_t.
No. You're not understanding the code. This is equivalent to:
usage = ofb->usage;
ofb->usage = usage + 1;
if (usage == 0)
And if you write it like that, then it is obvious. It's your understanding
of what a post-increment looks like which is suspicious here.
> > @@ -733,12 +739,24 @@ static int overlayfb_release(struct fb_info *info,
> > int user) {
> > struct pxafb_layer *ofb = (struct pxafb_layer*) info;
> >
>
> DTTO, why no atomic?
Because this is already a thread-safe code region.
> > ofb->video_mem = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
> > @@ -891,7 +910,7 @@ static void __devinit init_pxafb_overlay(struct
> > pxafb_info *fbi,
> >
> > ofb->id = id;
> > ofb->ops = &ofb_ops[id];
>
> DTTO
An initializing store by which a machine can write the entire contents in
one instruction _is_ by its very nature atomic.
atomic_t is one of the most over(ab)used types because people just don't
think about the code they're writing. ;(
^ permalink raw reply
* [PATCH 2/2] ARM: remove the 4x expansion presumption while decompressing the kernel
From: Russell King - ARM Linux @ 2011-02-17 18:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217175156.GB31812@angua.secretlab.ca>
On Thu, Feb 17, 2011 at 10:51:56AM -0700, Grant Likely wrote:
> As for knowing where it can relocate to, we already know (actually
> current code just makes an assumption) about how long the kernel
> proper image is and where it wants to live in the zImage's head.S.
> Assuming enough ram, if r6 reflects the size of the zImage + the size
> of the appended data then it should be good.
That isn't a valid argument. Just because "the decompressor already
does it" does not mean that it'll work with ramdisks. We've been
lucky so far that it has worked with the kernel - and that's exactly
what it is - luck.
It works for a 1-2MB kernel. A 16MB ramdisk is a completely different
kettle of bytes.
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Tony Lindgren @ 2011-02-17 18:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D5D5F13.2010602@ti.com>
* Cousson, Benoit <b-cousson@ti.com> [110217 09:45]:
>
> Done, boot tested, and that does remove the warning about the
> missing opt clock you had with the previous data.
>
> git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
>
> Just let me know if it does break anything else.
Pulled into omap-for-linus. Also now merged are the devel-hwspinlock
and devel-mcspi branches.
Tony
^ permalink raw reply
* [PATCH 1/2] ARM: PXA: PXAFB: Fix double-free issue.
From: Marek Vasut @ 2011-02-17 18:17 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297928588-10545-1-git-send-email-anarsoul@gmail.com>
On Thursday 17 February 2011 08:43:07 Vasily Khoruzhick wrote:
> From: Russell King - ARM Linux <linux@arm.linux.org.uk>
>
> From: Russell King - ARM Linux <linux@arm.linux.org.uk>
>
> Release callback tries to free memory even if it was not allocated in
> map_video_memory, fix it.
>
> Added by Vasily Khoruzhick:
>
> - Clear x_res/y_res fields of fb.var on release, to make sure
> our callback will be called on next FBIOPUT_VSCREENINFO ioctl.
> - Disable overlay only if it was enabled.
>
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> drivers/video/pxafb.c | 55
> +++++++++++++++++++++++++++++++++--------------- drivers/video/pxafb.h |
> 2 +-
> 2 files changed, 39 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
> index 825b665..c6aad56 100644
> --- a/drivers/video/pxafb.c
> +++ b/drivers/video/pxafb.c
> @@ -629,6 +629,9 @@ static void overlay1fb_disable(struct pxafb_layer *ofb)
> {
> uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5);
>
> + if (!(lcd_readl(ofb->fbi, OVL1C1) & OVLxC1_OEN))
> + return;
> +
> lcd_writel(ofb->fbi, OVL1C1, ofb->control[0] & ~OVLxC1_OEN);
>
> lcd_writel(ofb->fbi, LCSR1, LCSR1_BS(1));
> @@ -636,7 +639,8 @@ static void overlay1fb_disable(struct pxafb_layer *ofb)
> lcd_writel(ofb->fbi, FBR1, ofb->fbi->fdadr[DMA_OV1] | 0x3);
>
> if (wait_for_completion_timeout(&ofb->branch_done, 1 * HZ) == 0)
> - pr_warning("%s: timeout disabling overlay1\n", __func__);
> + pr_warning("%s: timeout disabling overlay1\n",
> + __func__);
>
> lcd_writel(ofb->fbi, LCCR5, lccr5);
> }
> @@ -687,6 +691,9 @@ static void overlay2fb_disable(struct pxafb_layer *ofb)
> {
> uint32_t lccr5 = lcd_readl(ofb->fbi, LCCR5);
>
> + if (!(lcd_readl(ofb->fbi, OVL2C1) & OVLxC1_OEN))
> + return;
> +
> lcd_writel(ofb->fbi, OVL2C1, ofb->control[0] & ~OVLxC1_OEN);
>
> lcd_writel(ofb->fbi, LCSR1, LCSR1_BS(2));
> @@ -696,7 +703,8 @@ static void overlay2fb_disable(struct pxafb_layer *ofb)
> lcd_writel(ofb->fbi, FBR4, ofb->fbi->fdadr[DMA_OV2_Cr] | 0x3);
>
> if (wait_for_completion_timeout(&ofb->branch_done, 1 * HZ) == 0)
> - pr_warning("%s: timeout disabling overlay2\n", __func__);
> + pr_warning("%s: timeout disabling overlay2\n",
> + __func__);
> }
>
> static struct pxafb_layer_ops ofb_ops[] = {
> @@ -720,12 +728,10 @@ static int overlayfb_open(struct fb_info *info, int
> user) if (user == 0)
> return -ENODEV;
>
Why are you getting rid of the atomic operations ?
Besides, "if (ofb->usage++ == 0)" looks suspicious, especially if you later
declare it as uint32_t.
> - /* allow only one user at a time */
> - if (atomic_inc_and_test(&ofb->usage))
> - return -EBUSY;
> + if (ofb->usage++ == 0)
> + /* unblank the base framebuffer */
> + fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
>
> - /* unblank the base framebuffer */
> - fb_blank(&ofb->fbi->fb, FB_BLANK_UNBLANK);
> return 0;
> }
>
> @@ -733,12 +739,24 @@ static int overlayfb_release(struct fb_info *info,
> int user) {
> struct pxafb_layer *ofb = (struct pxafb_layer*) info;
>
DTTO, why no atomic?
> - atomic_dec(&ofb->usage);
> - ofb->ops->disable(ofb);
> -
> - free_pages_exact(ofb->video_mem, ofb->video_mem_size);
> - ofb->video_mem = NULL;
> - ofb->video_mem_size = 0;
> + if (--ofb->usage == 0) {
> + ofb->ops->disable(ofb);
> + ofb->fb.var.height = -1;
> + ofb->fb.var.width = -1;
> + ofb->fb.var.xres = ofb->fb.var.xres_virtual = 0;
> + ofb->fb.var.yres = ofb->fb.var.yres_virtual = 0;
> +
> + mutex_lock(&ofb->fb.mm_lock);
> + ofb->fb.fix.smem_start = 0;
> + ofb->fb.fix.smem_len = 0;
> + mutex_unlock(&ofb->fb.mm_lock);
> +
> + if (ofb->video_mem) {
> + free_pages_exact(ofb->video_mem, ofb->video_mem_size);
> + ofb->video_mem = NULL;
> + ofb->video_mem_size = 0;
> + }
> + }
> return 0;
> }
>
> @@ -817,7 +835,8 @@ static int overlayfb_map_video_memory(struct
> pxafb_layer *ofb) if (ofb->video_mem_size >= size)
> return 0;
>
> - free_pages_exact(ofb->video_mem, ofb->video_mem_size);
> + /* don't re-allocate: userspace may have the buffer mapped */
> + return -EINVAL;
> }
>
> ofb->video_mem = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO);
> @@ -891,7 +910,7 @@ static void __devinit init_pxafb_overlay(struct
> pxafb_info *fbi,
>
> ofb->id = id;
> ofb->ops = &ofb_ops[id];
DTTO
> - atomic_set(&ofb->usage, 0);
> + ofb->usage = 0;
> ofb->fbi = fbi;
> init_completion(&ofb->branch_done);
> }
> @@ -1368,7 +1387,8 @@ static int pxafb_activate_var(struct
> fb_var_screeninfo *var, (lcd_readl(fbi, LCCR3) != fbi->reg_lccr3) ||
> (lcd_readl(fbi, LCCR4) != fbi->reg_lccr4) ||
> (lcd_readl(fbi, FDADR0) != fbi->fdadr[0]) ||
> - (lcd_readl(fbi, FDADR1) != fbi->fdadr[1]))
> + ((fbi->lccr0 & LCCR0_SDS) &&
> + (lcd_readl(fbi, FDADR1) != fbi->fdadr[1])))
> pxafb_schedule_work(fbi, C_REENABLE);
>
> return 0;
> @@ -1420,7 +1440,8 @@ static void pxafb_enable_controller(struct pxafb_info
> *fbi) lcd_writel(fbi, LCCR0, fbi->reg_lccr0 & ~LCCR0_ENB);
>
> lcd_writel(fbi, FDADR0, fbi->fdadr[0]);
> - lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> + if (fbi->lccr0 & LCCR0_SDS)
> + lcd_writel(fbi, FDADR1, fbi->fdadr[1]);
> lcd_writel(fbi, LCCR0, fbi->reg_lccr0 | LCCR0_ENB);
> }
>
> diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h
> index 2353521..84e3ae1 100644
> --- a/drivers/video/pxafb.h
> +++ b/drivers/video/pxafb.h
> @@ -92,7 +92,7 @@ struct pxafb_layer_ops {
> struct pxafb_layer {
> struct fb_info fb;
> int id;
DTTO, here.
> - atomic_t usage;
> + uint32_t usage;
> uint32_t control[2];
>
> struct pxafb_layer_ops *ops;
^ permalink raw reply
* [PATCH 7/7] ARM i.MX51 babbage: Add framebuffer support
From: Arnaud Patard (Rtp) @ 2011-02-17 18:11 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297865452-32181-8-git-send-email-s.hauer@pengutronix.de>
Sascha Hauer <s.hauer@pengutronix.de> writes:
Hi,
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> arch/arm/mach-mx5/Kconfig | 1 +
> arch/arm/mach-mx5/board-mx51_babbage.c | 74 ++++++++++++++++++++++++++++++++
> 2 files changed, 75 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
> index de4fa992f..89e71da 100644
> --- a/arch/arm/mach-mx5/Kconfig
> +++ b/arch/arm/mach-mx5/Kconfig
> @@ -42,6 +42,7 @@ config MACH_MX51_BABBAGE
> select IMX_HAVE_PLATFORM_IMX_UART
> select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
> select IMX_HAVE_PLATFORM_SPI_IMX
> + select IMX_HAVE_PLATFORM_IMX_IPUV3
> help
> Include support for MX51 Babbage platform, also known as MX51EVK in
> u-boot. This includes specific configurations for the board and its
> diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
> index 1d231e8..c5170e8 100644
> --- a/arch/arm/mach-mx5/board-mx51_babbage.c
> +++ b/arch/arm/mach-mx5/board-mx51_babbage.c
> @@ -22,11 +22,13 @@
> #include <linux/input.h>
> #include <linux/spi/flash.h>
> #include <linux/spi/spi.h>
> +#include <linux/mfd/imx-ipu-v3.h>
>
> #include <mach/common.h>
> #include <mach/hardware.h>
> #include <mach/iomux-mx51.h>
> #include <mach/mxc_ehci.h>
> +#include <mach/ipu-v3.h>
>
> #include <asm/irq.h>
> #include <asm/setup.h>
> @@ -158,6 +160,41 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
> MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
> MX51_PAD_CSPI1_SS0__GPIO4_24,
> MX51_PAD_CSPI1_SS1__GPIO4_25,
> +
> + /* Display */
> + MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
> + MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
> + MX51_PAD_NANDF_D12__GPIO3_28,
> +
> + MX51_PAD_DISP1_DAT0__DISP1_DAT0,
> + MX51_PAD_DISP1_DAT1__DISP1_DAT1,
> + MX51_PAD_DISP1_DAT2__DISP1_DAT2,
> + MX51_PAD_DISP1_DAT3__DISP1_DAT3,
> + MX51_PAD_DISP1_DAT4__DISP1_DAT4,
> + MX51_PAD_DISP1_DAT5__DISP1_DAT5,
> + MX51_PAD_DISP1_DAT6__DISP1_DAT6,
> + MX51_PAD_DISP1_DAT7__DISP1_DAT7,
> + MX51_PAD_DISP1_DAT8__DISP1_DAT8,
> + MX51_PAD_DISP1_DAT9__DISP1_DAT9,
> + MX51_PAD_DISP1_DAT10__DISP1_DAT10,
> + MX51_PAD_DISP1_DAT11__DISP1_DAT11,
> + MX51_PAD_DISP1_DAT12__DISP1_DAT12,
> + MX51_PAD_DISP1_DAT13__DISP1_DAT13,
> + MX51_PAD_DISP1_DAT14__DISP1_DAT14,
> + MX51_PAD_DISP1_DAT15__DISP1_DAT15,
> + MX51_PAD_DISP1_DAT16__DISP1_DAT16,
> + MX51_PAD_DISP1_DAT17__DISP1_DAT17,
> + MX51_PAD_DISP1_DAT18__DISP1_DAT18,
> + MX51_PAD_DISP1_DAT19__DISP1_DAT19,
> + MX51_PAD_DISP1_DAT20__DISP1_DAT20,
> + MX51_PAD_DISP1_DAT21__DISP1_DAT21,
> + MX51_PAD_DISP1_DAT22__DISP1_DAT22,
> + MX51_PAD_DISP1_DAT23__DISP1_DAT23,
> +#define MX51_PAD_DI_GP4__IPU_DI2_PIN15 IOMUX_PAD(0x758, 0x350, 4, 0x0, 0, NO_PAD_CTRL)
> + MX51_PAD_DI_GP4__IPU_DI2_PIN15,
> +
> + /* I2C DVI enable */
> + MX51_PAD_CSI2_HSYNC__GPIO4_14,
> };
>
> /* Serial ports */
> @@ -346,6 +383,23 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
> .num_chipselect = ARRAY_SIZE(mx51_babbage_spi_cs),
> };
>
> +static struct ipuv3_fb_platform_data babbage_fb0_data = {
> + .interface_pix_fmt = IPU_PIX_FMT_RGB24,
> + .flags = IMX_IPU_FB_USE_MODEDB | IMX_IPU_FB_USE_OVERLAY,
> + .display = 0,
> +};
> +
> +static struct ipuv3_fb_platform_data babbage_fb1_data = {
> + .interface_pix_fmt = IPU_PIX_FMT_RGB565,
> + .flags = IMX_IPU_FB_USE_MODEDB,
> + .display = 1,
> +};
> +
> +static struct imx_ipuv3_platform_data ipu_data = {
> + .fb_head0_platform_data = &babbage_fb0_data,
> + .fb_head1_platform_data = &babbage_fb1_data,
> +};
> +
> /*
> * Board specific initialization.
> */
> @@ -392,6 +446,26 @@ static void __init mxc_board_init(void)
> ARRAY_SIZE(mx51_babbage_spi_board_info));
> imx51_add_ecspi(0, &mx51_babbage_spi_pdata);
> imx51_add_imx2_wdt(0, NULL);
> +
> +#define GPIO_DVI_DETECT (2 * 32 + 28)
> +#define GPIO_DVI_RESET (2 * 32 + 5)
> +#define GPIO_DVI_PWRDN (2 * 32 + 6)
> +#define GPIO_DVI_I2C (3 * 32 + 14)
What about using IMX_GPIO_NR() ?
Arnaud
^ permalink raw reply
* [PATCH 1/7] Add a mfd IPUv3 driver
From: Arnaud Patard (Rtp) @ 2011-02-17 18:10 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297865452-32181-2-git-send-email-s.hauer@pengutronix.de>
Sascha Hauer <s.hauer@pengutronix.de> writes:
Hi,
> The IPU is the Image Processing Unit found on i.MX51/53 SoCs. It
> features several units for image processing, this patch adds support
> for the units needed for Framebuffer support, namely:
>
> - Display Controller (dc)
> - Display Interface (di)
> - Display Multi Fifo Controller (dmfc)
> - Display Processor (dp)
> - Image DMA Controller (idmac)
>
> This patch is based on the Freescale driver, but follows a different
> approach. The Freescale code implements logical idmac channels and
> the handling of the subunits is hidden in common idmac code pathes
> in big switch/case statements. This patch instead just provides code
> and resource management for the different subunits. The user, in this
> case the framebuffer driver, decides how the different units play
> together.
>
> The IPU has other units missing in this patch:
>
> - CMOS Sensor Interface (csi)
> - Video Deinterlacer (vdi)
> - Sensor Multi FIFO Controler (smfc)
> - Image Converter (ic)
> - Image Rotator (irt)
>
> So expect more files to come in this directory.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: linux-kernel at vger.kernel.org
> Cc: linux-fbdev at vger.kernel.org
> Cc: Paul Mundt <lethal@linux-sh.org>
> Cc: Samuel Ortiz <sameo@linux.intel.com>
> ---
> arch/arm/plat-mxc/include/mach/ipu-v3.h | 49 +++
> drivers/video/Kconfig | 2 +
> drivers/video/Makefile | 1 +
> drivers/video/imx-ipu-v3/Makefile | 3 +
> drivers/video/imx-ipu-v3/ipu-common.c | 708 +++++++++++++++++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-cpmem.c | 612 ++++++++++++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-dc.c | 364 ++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-di.c | 550 ++++++++++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-dmfc.c | 355 ++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-dp.c | 476 +++++++++++++++++++++
> drivers/video/imx-ipu-v3/ipu-prv.h | 216 ++++++++++
> include/linux/mfd/imx-ipu-v3.h | 219 ++++++++++
> 12 files changed, 3555 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/plat-mxc/include/mach/ipu-v3.h
> create mode 100644 drivers/video/imx-ipu-v3/Makefile
> create mode 100644 drivers/video/imx-ipu-v3/ipu-common.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-cpmem.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-dc.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-di.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-dmfc.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-dp.c
> create mode 100644 drivers/video/imx-ipu-v3/ipu-prv.h
> create mode 100644 include/linux/mfd/imx-ipu-v3.h
[...]
> diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
> index 6bafb51b..ffdb37a 100644
> --- a/drivers/video/Kconfig
> +++ b/drivers/video/Kconfig
> @@ -26,6 +26,8 @@ source "drivers/gpu/drm/Kconfig"
>
> source "drivers/gpu/stub/Kconfig"
>
> +source "drivers/video/imx-ipu-v3/Kconfig"
> +
I don't see such a Kconfig file in this patch. Got lost while moving
from mfd to video ?
> config VGASTATE
> tristate
> default n
> diff --git a/drivers/video/Makefile b/drivers/video/Makefile
> index 8c8fabd..f4921ab 100644
> --- a/drivers/video/Makefile
> +++ b/drivers/video/Makefile
> @@ -153,6 +153,7 @@ obj-$(CONFIG_FB_BFIN_T350MCQB) += bfin-t350mcqb-fb.o
> obj-$(CONFIG_FB_BFIN_7393) += bfin_adv7393fb.o
> obj-$(CONFIG_FB_MX3) += mx3fb.o
> obj-$(CONFIG_FB_DA8XX) += da8xx-fb.o
> +obj-$(CONFIG_MFD_IMX_IPU_V3) += imx-ipu-v3/
Now that files are in drivers/video, do we want to keep MFD in the name ?
Arnaud
^ permalink raw reply
* [RFC 1/5] ARM: P2V: separate PHYS_OFFSET from platform definitions
From: JD (Jiandong) Zheng @ 2011-02-17 18:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <AANLkTinwQwPK7Lg4dxkLGBxvp1hz489iAB6YrSG45e75@mail.gmail.com>
On Wed, Jan 5, 2011 at 4:22 AM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> This uncouple PHYS_OFFSET from the platform definitions, thereby
> facilitating run-time computation of the physical memory offset.
>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> arch/arm/include/asm/memory.h | 2 ++
> arch/arm/kernel/tcm.c | 2 +-
> arch/arm/mach-bcmring/include/mach/hardware.h | 2 +-
> arch/arm/mach-bcmring/include/mach/memory.h | 2 +-
Acked-by: Jiandong Zheng <jdzheng@broadcom.com>
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Felipe Balbi @ 2011-02-17 18:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217175217.GI14574@legolas.emea.dhcp.ti.com>
On Thu, Feb 17, 2011 at 07:52:17PM +0200, Felipe Balbi wrote:
> On Thu, Feb 17, 2011 at 06:46:59PM +0100, Cousson, Benoit wrote:
> > On 2/17/2011 6:37 PM, Balbi, Felipe wrote:
> > >On Thu, Feb 17, 2011 at 06:24:53PM +0100, Cousson, Benoit wrote:
> > >>On 2/17/2011 6:17 PM, Balbi, Felipe wrote:
> > >>>On Thu, Feb 17, 2011 at 06:14:24PM +0100, Cousson, Benoit wrote:
> > >>>>On 2/17/2011 5:59 PM, Tony Lindgren wrote:
> > >>>>>* Felipe Balbi<balbi@ti.com> [110217 08:20]:
> > >>>>>>On Thu, Feb 17, 2011 at 08:20:01AM -0800, Tony Lindgren wrote:
> > >>>>>>>
> > >>>>>>>Maybe no need to rebase, I'll apply Benoit's series first into
> > >>>>>>>omap-for-linus, then let's applying the other hwmod related patches
> > >>>>>>>should be trivial.
> > >>>>>>
> > >>>>>>So I can drop the omap4 HWMOD part from my branch ?
> > >>>>>
> > >>>>>Yeh assuming Benoit's data is correct.
> > >>>>
> > >>>>Of course, it is :-)
> > >>>>
> > >>>>Then I will add USB in my series.
> > >>>
> > >>>BTW, which branch should I use from your tree to test ?
> > >>
> > >>I'll put that in the refresh version of the branch I have done for
> > >>Tony. I messed up the McSPI changelog... and Tony caught me :-)
> > >>
> > >>I'll push that in 5 minutes.
> > >
> > >cool, let me know
> >
> > Done, boot tested, and that does remove the warning about the missing
> > opt clock you had with the previous data.
> >
> > git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
> >
> > Just let me know if it does break anything else.
>
> Ok, pulling ;-)
Just tested, all good ;-) Tomorrow I'll test more and send my pull
request.
--
balbi
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Felipe Balbi @ 2011-02-17 17:52 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D5D5F13.2010602@ti.com>
On Thu, Feb 17, 2011 at 06:46:59PM +0100, Cousson, Benoit wrote:
> On 2/17/2011 6:37 PM, Balbi, Felipe wrote:
> >On Thu, Feb 17, 2011 at 06:24:53PM +0100, Cousson, Benoit wrote:
> >>On 2/17/2011 6:17 PM, Balbi, Felipe wrote:
> >>>On Thu, Feb 17, 2011 at 06:14:24PM +0100, Cousson, Benoit wrote:
> >>>>On 2/17/2011 5:59 PM, Tony Lindgren wrote:
> >>>>>* Felipe Balbi<balbi@ti.com> [110217 08:20]:
> >>>>>>On Thu, Feb 17, 2011 at 08:20:01AM -0800, Tony Lindgren wrote:
> >>>>>>>
> >>>>>>>Maybe no need to rebase, I'll apply Benoit's series first into
> >>>>>>>omap-for-linus, then let's applying the other hwmod related patches
> >>>>>>>should be trivial.
> >>>>>>
> >>>>>>So I can drop the omap4 HWMOD part from my branch ?
> >>>>>
> >>>>>Yeh assuming Benoit's data is correct.
> >>>>
> >>>>Of course, it is :-)
> >>>>
> >>>>Then I will add USB in my series.
> >>>
> >>>BTW, which branch should I use from your tree to test ?
> >>
> >>I'll put that in the refresh version of the branch I have done for
> >>Tony. I messed up the McSPI changelog... and Tony caught me :-)
> >>
> >>I'll push that in 5 minutes.
> >
> >cool, let me know
>
> Done, boot tested, and that does remove the warning about the missing
> opt clock you had with the previous data.
>
> git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
>
> Just let me know if it does break anything else.
Ok, pulling ;-)
--
balbi
^ permalink raw reply
* [PATCH 2/2] ARM: remove the 4x expansion presumption while decompressing the kernel
From: Grant Likely @ 2011-02-17 17:51 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217092617.GB24627@n2100.arm.linux.org.uk>
On Thu, Feb 17, 2011 at 09:26:17AM +0000, Russell King - ARM Linux wrote:
> On Wed, Feb 16, 2011 at 05:09:23PM -0700, Grant Likely wrote:
> > Patch looks good to me, but on a related note, I'm looking for a way
> > to also find the end of .bss.
> >
> > When John looks at adding support for appending an initrd and/or dtb
> > to the zimage, it will be important to make sure the start of the
> > initrd/dtb does not overlap the ram the kernel is expecting to be
> > empty and available.
>
> Appending data to the zImage has already been solved with the 'bootp'
> stuff - and I'm afraid to say that merely catting a zImage with something
> else just isn't going to work. There's no way for the zImage decompressor
> to know that there's anything on the end of the image, and there's no way
> for it to know where it can relocate itself to or where in memory it can
> safely decompress to in such scenarios.
Even with weird memory, looking for an image header immediately after
the end of the image is a pretty safe thing to do. As long as the
type and size of the appended data can be determined from the data
header it should work just fine. John is investigating this now for
compressed ramdisks.
As for knowing where it can relocate to, we already know (actually
current code just makes an assumption) about how long the kernel
proper image is and where it wants to live in the zImage's head.S.
Assuming enough ram, if r6 reflects the size of the zImage + the size
of the appended data then it should be good.
>
> While such stuff may be possible with architectures where you know memory
> always starts at zero and extends contiguously for N MB where N is some
> number larger than 16, we don't have that luxury on ARM. Sometimes it
> might be in 4MB chunks scattered throughout the physical address space
> at maybe 256MB offset from zero. Or maybe 32MB chunks starting at 3GB.
> etc.
Of course this makes assumptions about the size of memory available
to the image (which the current zImage also does), and that it is safe
to use a large hunk of ram immediately after the zImage. If your
system has weird memory, then you *have* to know the constraints of
your system and make sure the zImage (+ appended data) is:
1) in a region large enough to hold it, and
2a) doesn't overlap what the kernel proper needs, or
2b) has enough space behind it that it can be relocated safely
before uncompressing the kernel
This is not really any different from today, the zImage still must
make assumptions about where it can do a relocation to or from (either
by relocating vmlinux after decompressing as in current code, or by
relocating the wrapped image before decompressing as in Nicolas'
patch). The data size can be up being a lot larger though.
So, I agree, when RAM is weird this may not be feasible, but there are
also a large number of systems where ram is *not* weird and this is a
useful feature...
Actually concerning this; the initial work that John completed was to
meet the requirements of a client. I posted it for interest sake, but
I wasn't planning to try and get it merged. I didn't think it would
be of much use outside of my client's use case, but after talking with
Nicolas and others we decided it could be useful and we're going to
spend the time to see if we can make it a general solution. If it
doesn't work, then all we've lost is a bit of time, but I do think it
is a viable feature.
g.
>
> And that's why the 'bootp' stuff takes a fixed address for where to
> locate the initrd - the only person who knows where its safe to do so is
> the person building the image for the platform.
^ permalink raw reply
* [PATCH 2/8] OMAP4: hwmod data: Add McSPI
From: Cousson, Benoit @ 2011-02-17 17:47 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217170514.GS20795@atomide.com>
On 2/17/2011 6:05 PM, Tony Lindgren wrote:
> Hi,
>
> Noticed one cosmetic thing below.
>
> * Benoit Cousson<b-cousson@ti.com> [110217 02:23]:
>> Update omap4 hwmod file with McSPI info.
>>
>> Signed-off-by: Benoit Cousson<b-cousson@ti.com>
>> Signed-off-by: Charulatha V<charu@ti.com>
>> Signed-off-by: Govindraj.R<govindraj.raja@ti.com>
>> Acked-by: Grant Likely<grant.likely@secretlab.ca>
>> Reviewed-by: Kevin Hilman<khilman@ti.com>
>> ---
> ^^^ That should not be here, it shows up in your commit.
>
>> [b-cousson at ti.com: Remove dev_attr to prevent dependency
>> with device code. It will have to be re-added along with
>> the original series]
>
> As the above should be part of the commit too. Care to
> refresh your branch for that?
Done. I added the USBOTG for Felipe as well.
Thanks,
Benoit
---
The following changes since commit 85e2efbb1db9a18d218006706d6e4fbeb0216213:
Linus Torvalds (1):
Linux 2.6.38-rc5
are available in the git repository at:
git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
Benoit Cousson (9):
OMAP4: hwmod data: Add hwspinlock
OMAP4: hwmod data: Add McSPI
OMAP4: hwmod data: Add timer
OMAP4: hwmod data: Add DSS, DISPC, DSI1&2, RFBI, HDMI and VENC
OMAP4: hwmod data: Add mailbox
OMAP4: hwmod data: Add DMIC
OMAP4: hwmod data: Add McBSP
OMAP4: hwmod data: Add AESS, McPDM, bandgap, counter_32k, MMC, KBD, ISS & IPU
OMAP4: hwmod data: Add USBOTG
arch/arm/mach-omap2/omap_hwmod_44xx_data.c | 3119 +++++++++++++++++++++++++++-
1 files changed, 3072 insertions(+), 47 deletions(-)
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Cousson, Benoit @ 2011-02-17 17:46 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20110217173711.GF14574@legolas.emea.dhcp.ti.com>
On 2/17/2011 6:37 PM, Balbi, Felipe wrote:
> On Thu, Feb 17, 2011 at 06:24:53PM +0100, Cousson, Benoit wrote:
>> On 2/17/2011 6:17 PM, Balbi, Felipe wrote:
>>> On Thu, Feb 17, 2011 at 06:14:24PM +0100, Cousson, Benoit wrote:
>>>> On 2/17/2011 5:59 PM, Tony Lindgren wrote:
>>>>> * Felipe Balbi<balbi@ti.com> [110217 08:20]:
>>>>>> On Thu, Feb 17, 2011 at 08:20:01AM -0800, Tony Lindgren wrote:
>>>>>>>
>>>>>>> Maybe no need to rebase, I'll apply Benoit's series first into
>>>>>>> omap-for-linus, then let's applying the other hwmod related patches
>>>>>>> should be trivial.
>>>>>>
>>>>>> So I can drop the omap4 HWMOD part from my branch ?
>>>>>
>>>>> Yeh assuming Benoit's data is correct.
>>>>
>>>> Of course, it is :-)
>>>>
>>>> Then I will add USB in my series.
>>>
>>> BTW, which branch should I use from your tree to test ?
>>
>> I'll put that in the refresh version of the branch I have done for
>> Tony. I messed up the McSPI changelog... and Tony caught me :-)
>>
>> I'll push that in 5 minutes.
>
> cool, let me know
Done, boot tested, and that does remove the warning about the missing
opt clock you had with the previous data.
git://gitorious.org/omap-pm/linux.git for_2.6.39/omap4_hwmod_data
Just let me know if it does break anything else.
Thanks,
Benoit
^ permalink raw reply
* [PATCH V4] ST SPEAr: PCIE gadget suppport
From: Randy Dunlap @ 2011-02-17 17:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297939844-6433-1-git-send-email-pratyush.anand@st.com>
On Thu, 17 Feb 2011 16:20:44 +0530 Pratyush Anand wrote:
> This is a configurable gadget. can be configured by configfs interface. Any
> IP available at PCIE bus can be programmed to be used by host
> controller.It supoorts both INTX and MSI.
> By default, gadget is configured for INTX and SYSRAM1 is mapped to BAR0
> with size 0x1000
>
> Changes since V3:
> - support for multiple instances of such device
> - changes to minizie portability issue on 64 bit machine
> - unnecessary typecast removed
> - sysfs_streq used in place of complex code
>
> Changes since V2:
> - driver has been moved from sysfs to configfs
> - Documentation/ABI directory has also been updated
> - typo error in documenation has been corrected
> - clk value is checked after encapsulating by IS_ERR
>
> Changes since V1:
> - __iomem added for register addresses
> - kerneldoc comment removed whereever not required.
> - help node moved from sysfs to documentation/misc-devices
> - strict_strtoul used instead of sscanf
>
> Signed-off-by: Pratyush Anand <pratyush.anand@st.com>
> ---
> .../ABI/testing/configfs-spear-pcie-gadget | 30 +
> Documentation/misc-devices/spear-pcie-gadget.txt | 129 +++
> drivers/misc/Kconfig | 10 +
> drivers/misc/Makefile | 1 +
> drivers/misc/spear13xx_pcie_gadget.c | 904 ++++++++++++++++++++
> 5 files changed, 1074 insertions(+), 0 deletions(-)
> create mode 100644 Documentation/ABI/testing/configfs-spear-pcie-gadget
> create mode 100644 Documentation/misc-devices/spear-pcie-gadget.txt
> create mode 100644 drivers/misc/spear13xx_pcie_gadget.c
>
> diff --git a/Documentation/ABI/testing/configfs-spear-pcie-gadget b/Documentation/ABI/testing/configfs-spear-pcie-gadget
> new file mode 100644
> index 0000000..3a1e653
> --- /dev/null
> +++ b/Documentation/ABI/testing/configfs-spear-pcie-gadget
> @@ -0,0 +1,30 @@
> +What: /config/pcie-gadget
> +Date: Feb 2011
> +KernelVersion: 2.6.37
> +Contact: Pratyush Anand <pratyush.anand@st.com>
> +Description:
> +
> + Interface is used to configure selected dual mode pcie controller
PCIe
> + as device and then program its various registers to configure it
> + as a particular device type.
> + This interfaces can be used to show spear's pcie device capability.
PCIe
> +
> + Nodes are only visible when configfs is mounted. To mount configfs
> + in /config directory use:
> + # mount -t configfs none /config/
> +
> + /config/pcie-gadget/
> + link ... used to enable ltssm and read its status.
> + int_type ...used to configure and read type of supported
> + interrupt
> + no_of_msi ... used to configure number of MSI vector needed and
> + to read no of MSI granted.
> + inta ... write 1 to assert INTA and 0 to de-assert.
> + send_msi ... write MSI vector to be sent.
> + vendor_id ... used to write and read vendor id (hex)
> + device_id ... used to write and read device id (hex)
> + bar0_size ... used to write and read bar0_size
> + bar0_address ... used to write and read bar0 mapped area in hex.
> + bar0_rw_offset ... used to write and read offset of bar0 where
> + bar0_data will be written or read.
> + bar0_data ... used to write and read data at bar0_rw_offset.
> diff --git a/Documentation/misc-devices/spear-pcie-gadget.txt b/Documentation/misc-devices/spear-pcie-gadget.txt
> new file mode 100644
> index 0000000..7361793
> --- /dev/null
> +++ b/Documentation/misc-devices/spear-pcie-gadget.txt
> @@ -0,0 +1,129 @@
> +Spear PCIE Gadget Driver:
PCIe
> +
> +Author
> +=============
> +Pratyush Anand (pratyush.anand at st.com)
> +
> +Location
> +============
> +driver/misc/spear13xx_pcie_gadget.c
> +
> +Supported Chip:
> +===================
> +SPEAr1300
> +SPEAr1310
> +
> +Menuconfig option:
> +==========================
> +Device Drivers
> + Misc devices
> + PCIE gadget support for SPEAr13XX platform
ditto
> +purpose
> +===========
> +This driver has several nodes which can read/written by configfs interface.
which can be read/written
> +Its main purpose is to configure selected dual mode pcie controller as device
PCIe
> +and then program its various registers to configure it as a particular device
> +type. This driver can be used to show spear's pcie device capability.
ditto
> +
> +Description of different nodes:
> +=================================
> +
> +read behavior of nodes:
> +------------------------------
> +link :gives ltssm status.
> +int_type :type of supported interrupt
> +no_of_msi :zero if MSI is not enabled by host. A positive value is the
> + number of MSI vector granted.
> +vendor_id :returns programmed vendor id (hex)
> +device_id :returns programmed device id(hex)
> +bar0_size: :returns size of bar0 in hex.
> +bar0_address :returns address of bar0 mapped area in hex.
> +bar0_rw_offset :returns offset of bar0 for which bar0_data will return value.
> +bar0_data :returns data at bar0_rw_offset.
> +
> +write behavior of nodes:
> +------------------------------
> +link :write UP to enable ltsmm DOWN to disable
> +int_type :write interrupt type to be configured and (int_type could be
> + INTA, MSI or NO_INT).select MSI only when you have programmed
NO_INT). Select MSI
> + no_of_msi node.
> +no_of_msi :number of MSI vector needed.
> +inta :write 1 to assert INTA and 0 to de-assert.
> +send_msi :write MSI vector to be sent.
> +vendor_id :write vendor id(hex) to be programmed.
> +device_id :write device id(hex) to be programmed.
> +bar0_size :write size of bar0 in hex. default bar0 size is 1000 (hex)
> + bytes.
> +bar0_address :write address of bar0 mapped area in hex. (default mapping of
> + bar0 is SYSRAM1(E0800000).Always program bar size before bar
(E0800000). Always
> + address. kernel might modify bar size and address to align. So
Kernel for alignment, so
> + read back bar size and address after writing to cross check.
> +bar0_rw_offset :write offset of bar0 for which bar0_data will write value.
> +bar0_data :write data to be written at bar0_rw_offset.
> +
> +Node programming example
> +===========================
> +Program all PCIE registers in such a way that when this device is connected
PCIe
> +to the pcie host, then host sees this device as 1MB RAM.
ditto
> +#mount -t configfs none /Config
> +# cd /config/pcie_gadget/
> +Now you have all the nodes in this directory.
> +program vendor id as 0x104a
> +# echo 104A >> vendor_id
> +
> +program device id as 0xCD80
> +# echo CD80 >> device_id
> +
> +program BAR0 size as 1MB
> +# echo 100000 >> bar0_size
> +
> +check for programmed bar0 size
> +# cat bar0_size
> +
> +Program BAR0 Address as DDR (0x2100000).this is the physical address of
(0x2100000). This
> +memory, which is to be made visible to pcie host. Similarly any other peripheral
PCIe
> +can also be made visible to pcie host. e.g if you program base address of UART
PCIe host. E.g., if
> +as BAR0 address then when this device will be connected to a host, it will be
> +visible as UART.
> +# echo 2100000 >> bar0_address
> +
> +program interrupt type : INTA
> +# echo INTA >> int_type
> +
> +go for link up now.
> +# echo UP >> link
> +
> +It will have to be insured that, once link up is done on gadget, then only host
> +is initialized and start to search pcie devices on its port.
PCIe
> +
> +/*wait till link is up*/
> +# cat link
> +wait till it returns UP.
> +
> +To assert INTA
> +# echo 1 >> inta
> +
> +To de-assert INTA
> +# echo 0 >> inta
> +
> +if MSI is to be used as interrupt, program no of msi vector needed (say4)
> +# echo 4 >> no_of_msi
> +
> +select MSI as interrupt type
> +# echo MSI >> int_type
> +
> +go for link up now
> +# echo UP >> link
> +
> +wait till link is up
> +# cat link
> +An application can repetitively read this node till link is found UP. It can
> +sleep between two read.
> +
> +wait till msi is enabled
> +# cat no_of_msi
> +Should return 4 (number of requested MSI vector)
> +
> +to send msi vector 2
> +# echo 2 >> send_msi
> +#cd -
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 4d073f1..c364a9b 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -394,6 +394,16 @@ config DS1682
> This driver can also be built as a module. If so, the module
> will be called ds1682.
>
> +config SPEAR13XX_PCIE_GADGET
> + bool "PCIE gadget support for SPEAr13XX platform"
> + depends on ARCH_SPEAR13XX
> + default n
> + help
> + This option enables gadget support for PCIE controller. If
PCIe
> + board file defines any controller as PCIE endpoint then a sysfs
ditto
> + entry will be created for that controller. User can use these
> + sysfs node to configure PCIE EP as per his requirements.
ditto
> +
> config TI_DAC7512
> tristate "Texas Instruments DAC7512"
> depends on SPI && SYSFS
> diff --git a/drivers/misc/Makefile b/drivers/misc/Makefile
> index 98009cc..c489536 100644
> --- a/drivers/misc/Makefile
> +++ b/drivers/misc/Makefile
> @@ -37,6 +37,7 @@ obj-$(CONFIG_IWMC3200TOP) += iwmc3200top/
> obj-$(CONFIG_HMC6352) += hmc6352.o
> obj-y += eeprom/
> obj-y += cb710/
> +obj-$(CONFIG_SPEAR13XX_PCIE_GADGET) += spear13xx_pcie_gadget.o
> obj-$(CONFIG_VMWARE_BALLOON) += vmw_balloon.o
> obj-$(CONFIG_ARM_CHARLCD) += arm-charlcd.o
> obj-$(CONFIG_PCH_PHUB) += pch_phub.o
> diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
> new file mode 100644
> index 0000000..86f821b
> --- /dev/null
> +++ b/drivers/misc/spear13xx_pcie_gadget.c
> @@ -0,0 +1,904 @@
> +/*
> + * drivers/misc/spear13xx_pcie_gadget.c
> + *
> + * Copyright (C) 2010 ST Microelectronics
> + * Pratyush Anand<pratyush.anand@st.com>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
...
> +static ssize_t pcie_gadget_store_send_msi(
> + struct spear_pcie_gadget_config *config,
> + const char *buf, size_t count)
> +{
> + struct pcie_app_reg __iomem *app_reg = config->va_app_base;
> + ulong vector;
> + u32 ven_msi;
> +
> + if (strict_strtoul(buf, 0, &vector))
> + return -EINVAL;
> +
> + if (!config->configured_msi)
> + return -EINVAL;
> +
> + if (vector >= config->configured_msi)
> + return -EINVAL;
> +
> + ven_msi = readl(&app_reg->ven_msi_1);
> + ven_msi &= ~VEN_MSI_FUN_NUM_MASK;
> + ven_msi |= 0 << VEN_MSI_FUN_NUM_ID;
> + ven_msi &= ~VEN_MSI_TC_MASK;
> + ven_msi |= 0 << VEN_MSI_TC_ID;
> + ven_msi &= ~VEN_MSI_VECTOR_MASK;
> + ven_msi |= vector << VEN_MSI_VECTOR_ID;
> +
> + /*generating interrupt for msi vector*/
/* generating interrupt for MSI vector */
> + ven_msi |= VEN_MSI_REQ_EN;
> + writel(ven_msi, &app_reg->ven_msi_1);
> + /*need to wait till this bit is cleared, it is not cleared
> + * autometically[Bug RTL] TBD*/
automatically
Please use the normal kernel multi-line comment style:
/*
* need to wait till this bit is cleared, it is not cleared
* automatically [Bug RTL] TBD
*/
> + udelay(1);
> + ven_msi &= ~VEN_MSI_REQ_EN;
> + writel(ven_msi, &app_reg->ven_msi_1);
> +
> + return count;
> +}
...
> +static ssize_t pcie_gadget_store_bar0_size(
> + struct spear_pcie_gadget_config *config,
> + const char *buf, size_t count)
> +{
> + ulong size;
> + u32 pos, pos1;
> + u32 no_of_bit = 0;
> +
> + if (strict_strtoul(buf, 0, &size))
> + return -EINVAL;
> + /* as per PCIE specs, min bar size supported is 128 bytes. But
> + * our controller supports min as 256*/
Use kernel multi-line comment style.
"PCIe"
> + if (size <= 0x100)
> + size = 0x100;
> + /* max bar size is 1MB*/
> + else if (size >= 0x100000)
> + size = 0x100000;
> + else {
> + pos = 0;
> + pos1 = 0;
> + while (pos < 21) {
> + pos = find_next_bit((ulong *)&size, 21, pos);
> + if (pos != 21)
> + pos1 = pos + 1;
> + pos++;
> + no_of_bit++;
> + }
> + if (no_of_bit == 2)
> + pos1--;
> +
> + size = 1 << pos1;
> + }
> + config->bar0_size = size;
> + spear_dbi_write_reg(config, PCIE_BAR0_MASK_REG, 4, size - 1);
> +
> + return count;
> +}
...
> +static int __devinit spear_pcie_gadget_probe(struct platform_device *pdev)
> +{
> + struct resource *res0, *res1;
> + unsigned int status = 0;
> + int irq;
> + struct clk *clk;
> + static struct pcie_gadget_target *target;
> + struct spear_pcie_gadget_config *config;
> + struct config_item *cg_item;
> + struct configfs_subsystem *subsys;
> +
> + /* get resource for application registers*/
> +
> + res0 = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res0) {
> + dev_err(&pdev->dev, "no resource defined\n");
> + return -EBUSY;
> + }
> + if (!request_mem_region(res0->start, resource_size(res0),
> + pdev->name)) {
> + dev_err(&pdev->dev, "pcie gadget region already claimed\n");
> + return -EBUSY;
> + }
> + /* get resource for dbi registers*/
> +
> + res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> + if (!res1) {
> + dev_err(&pdev->dev, "no resource defined\n");
> + goto err_rel_res0;
> + }
> + if (!request_mem_region(res1->start, resource_size(res1),
> + pdev->name)) {
> + dev_err(&pdev->dev, "pcie gadget region already claimed\n");
> + goto err_rel_res0;
> + }
> +
> + target = kzalloc(sizeof(*target), GFP_KERNEL);
> + if (!target) {
> + dev_err(&pdev->dev, "out of memory\n");
> + status = -ENOMEM;
> + goto err_rel_res;
> + }
> +
> + cg_item = &target->subsys.su_group.cg_item;
> + sprintf(cg_item->ci_namebuf, "pcie_gadget.%d", pdev->id);
> + cg_item->ci_type = &pcie_gadget_target_type;
> + config = &target->config;
> + config->va_app_base = (void __iomem *)ioremap(res0->start,
> + resource_size(res0));
> + if (!config->va_app_base) {
> + dev_err(&pdev->dev, "ioremap fail\n");
> + status = -ENOMEM;
> + goto err_kzalloc;
> + }
> +
> + config->base = (void __iomem *)res1->start;
> +
> + config->va_dbi_base = (void __iomem *)ioremap(res1->start,
> + resource_size(res1));
> + if (!config->va_dbi_base) {
> + dev_err(&pdev->dev, "ioremap fail\n");
> + status = -ENOMEM;
> + goto err_iounmap_app;
> + }
> +
> + dev_set_drvdata(&pdev->dev, target);
> +
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0) {
> + dev_err(&pdev->dev, "no update irq?\n");
> + status = irq;
> + goto err_iounmap;
> + }
> +
> + status = request_irq(irq, spear_pcie_gadget_irq, 0, pdev->name, NULL);
> + if (status) {
> + dev_err(&pdev->dev, "pcie gadget interrupt IRQ%d already \
> + claimed\n", irq);
> + goto err_iounmap;
> + }
> +
> + /* Register configfs hooks */
> + subsys = &target->subsys;
> + config_group_init(&subsys->su_group);
> + mutex_init(&subsys->su_mutex);
> + status = configfs_register_subsystem(subsys);
> + if (status)
> + goto err_irq;
> +
> + /* init basic pcie application registers*/
> + /* do not enable clock if it is PCIE0.Ideally , all controller should
> + * have been independent from others with respect to clock. But PCIE1
> + * and 2 depends on PCIE0.So PCIE0 clk is provided during board init.*/
Use kernel multi-line comment style.
> + if (pdev->id == 1) {
> + /* Ideally CFG Clock should have been also enabled here. But
> + * it is done currently during board init routne*/
ditto
s/routne/routine/
> + clk = clk_get_sys("pcie1", NULL);
> + if (IS_ERR(clk)) {
> + pr_err("%s:couldn't get clk for pcie1\n", __func__);
> + goto err_irq;
> + }
> + if (clk_enable(clk)) {
> + pr_err("%s:couldn't enable clk for pcie1\n", __func__);
> + goto err_irq;
> + }
> + } else if (pdev->id == 2) {
> + /* Ideally CFG Clock should have been also enabled here. But
> + * it is done currently during board init routne*/
same comments as above
> + clk = clk_get_sys("pcie2", NULL);
> + if (IS_ERR(clk)) {
> + pr_err("%s:couldn't get clk for pcie2\n", __func__);
> + goto err_irq;
> + }
> + if (clk_enable(clk)) {
> + pr_err("%s:couldn't enable clk for pcie2\n", __func__);
> + goto err_irq;
> + }
> + }
> + spear13xx_pcie_device_init(config);
> +
> + return 0;
> +err_irq:
> + free_irq(irq, NULL);
> +err_iounmap:
> + iounmap(config->va_dbi_base);
> +err_iounmap_app:
> + iounmap(config->va_app_base);
> +err_kzalloc:
> + kfree(config);
> +err_rel_res:
> + release_mem_region(res1->start, resource_size(res1));
> +err_rel_res0:
> + release_mem_region(res0->start, resource_size(res0));
> + return status;
> +}
...
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
^ permalink raw reply
* [PATCH] amba: move to pm ops
From: Takashi Iwai @ 2011-02-17 17:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1297928986-31171-1-git-send-email-rabin.vincent@stericsson.com>
At Thu, 17 Feb 2011 13:19:46 +0530,
Rabin Vincent wrote:
>
> Support pm_ops in the AMBA bus instead of the legacy ops. pm_ops is needed
> for runtime pm, and there is also a general move to convert drivers to
> dev_pm_ops rather than bus specific PM ops in order to facilitate core
> development.
>
> Since there are only 6 AMBA drivers using suspend/resume, convert them all in
> one go and directly use the GENERIC_SUBSYS_PM_OPS in the bus.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Chris Ball <cjb@laptop.org>
> Cc: Grant Likely <grant.likely@secretlab.ca>
> Cc: Takashi Iwai <tiwai@suse.de>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
For sound/arm/aaci.c,
Acked-by: Takashi Iwai <tiwai@suse.de>
Though, this would result in a zero-filled *_pm struct when
CONFIG_PM_* isn't set? It's a few bytes wastes ;)
thanks,
Takashi
> ---
> drivers/amba/bus.c | 25 ++-----------------------
> drivers/input/serio/ambakmi.c | 13 ++++++++++---
> drivers/mmc/host/mmci.c | 17 ++++++++++-------
> drivers/spi/amba-pl022.c | 15 +++++++++------
> drivers/tty/serial/amba-pl010.c | 20 ++++++++++++++------
> drivers/tty/serial/amba-pl011.c | 22 +++++++++++++---------
> include/linux/amba/bus.h | 4 ++--
> sound/arm/aaci.c | 18 ++++++++++--------
> 8 files changed, 70 insertions(+), 64 deletions(-)
>
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index ca96b0a..402b07e 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -13,12 +13,12 @@
> #include <linux/string.h>
> #include <linux/slab.h>
> #include <linux/io.h>
> +#include <linux/pm.h>
> #include <linux/amba/bus.h>
>
> #include <asm/irq.h>
> #include <asm/sizes.h>
>
> -#define to_amba_device(d) container_of(d, struct amba_device, dev)
> #define to_amba_driver(d) container_of(d, struct amba_driver, drv)
>
> static struct amba_id *
> @@ -57,26 +57,6 @@ static int amba_uevent(struct device *dev, struct kobj_uevent_env *env)
> #define amba_uevent NULL
> #endif
>
> -static int amba_suspend(struct device *dev, pm_message_t state)
> -{
> - struct amba_driver *drv = to_amba_driver(dev->driver);
> - int ret = 0;
> -
> - if (dev->driver && drv->suspend)
> - ret = drv->suspend(to_amba_device(dev), state);
> - return ret;
> -}
> -
> -static int amba_resume(struct device *dev)
> -{
> - struct amba_driver *drv = to_amba_driver(dev->driver);
> - int ret = 0;
> -
> - if (dev->driver && drv->resume)
> - ret = drv->resume(to_amba_device(dev));
> - return ret;
> -}
> -
> #define amba_attr_func(name,fmt,arg...) \
> static ssize_t name##_show(struct device *_dev, \
> struct device_attribute *attr, char *buf) \
> @@ -111,8 +91,7 @@ struct bus_type amba_bustype = {
> .dev_attrs = amba_dev_attrs,
> .match = amba_match,
> .uevent = amba_uevent,
> - .suspend = amba_suspend,
> - .resume = amba_resume,
> + .pm = GENERIC_SUBSYS_PM_OPS,
> };
>
> static int __init amba_init(void)
> diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c
> index 92563a6..c710437 100644
> --- a/drivers/input/serio/ambakmi.c
> +++ b/drivers/input/serio/ambakmi.c
> @@ -176,15 +176,22 @@ static int __devexit amba_kmi_remove(struct amba_device *dev)
> return 0;
> }
>
> -static int amba_kmi_resume(struct amba_device *dev)
> +#ifdef CONFIG_PM_SLEEP
> +static int amba_kmi_resume(struct device *dev)
> {
> - struct amba_kmi_port *kmi = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct amba_kmi_port *kmi = amba_get_drvdata(adev);
>
> /* kick the serio layer to rescan this port */
> serio_reconnect(kmi->io);
>
> return 0;
> }
> +#else
> +#define amba_kmi_resume NULL
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(amba_kmi_pm, NULL, amba_kmi_resume);
>
> static struct amba_id amba_kmi_idtable[] = {
> {
> @@ -198,11 +205,11 @@ static struct amba_driver ambakmi_driver = {
> .drv = {
> .name = "kmi-pl050",
> .owner = THIS_MODULE,
> + .pm = &amba_kmi_pm,
> },
> .id_table = amba_kmi_idtable,
> .probe = amba_kmi_probe,
> .remove = __devexit_p(amba_kmi_remove),
> - .resume = amba_kmi_resume,
> };
>
> static int __init amba_kmi_init(void)
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index 8a29c9f..18e142b 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -1236,10 +1236,11 @@ static int __devexit mmci_remove(struct amba_device *dev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int mmci_suspend(struct amba_device *dev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int mmci_suspend(struct device *dev)
> {
> - struct mmc_host *mmc = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct mmc_host *mmc = amba_get_drvdata(adev);
> int ret = 0;
>
> if (mmc) {
> @@ -1253,9 +1254,10 @@ static int mmci_suspend(struct amba_device *dev, pm_message_t state)
> return ret;
> }
>
> -static int mmci_resume(struct amba_device *dev)
> +static int mmci_resume(struct device *dev)
> {
> - struct mmc_host *mmc = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct mmc_host *mmc = amba_get_drvdata(adev);
> int ret = 0;
>
> if (mmc) {
> @@ -1273,6 +1275,8 @@ static int mmci_resume(struct amba_device *dev)
> #define mmci_resume NULL
> #endif
>
> +static SIMPLE_DEV_PM_OPS(mmci_pm, mmci_suspend, mmci_resume);
> +
> static struct amba_id mmci_ids[] = {
> {
> .id = 0x00041180,
> @@ -1306,11 +1310,10 @@ static struct amba_id mmci_ids[] = {
> static struct amba_driver mmci_driver = {
> .drv = {
> .name = DRIVER_NAME,
> + .pm = &mmci_pm,
> },
> .probe = mmci_probe,
> .remove = __devexit_p(mmci_remove),
> - .suspend = mmci_suspend,
> - .resume = mmci_resume,
> .id_table = mmci_ids,
> };
>
> diff --git a/drivers/spi/amba-pl022.c b/drivers/spi/amba-pl022.c
> index 71a1219..eb16ea5 100644
> --- a/drivers/spi/amba-pl022.c
> +++ b/drivers/spi/amba-pl022.c
> @@ -2184,9 +2184,10 @@ pl022_remove(struct amba_device *adev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int pl022_suspend(struct amba_device *adev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int pl022_suspend(struct device *dev)
> {
> + struct amba_device *adev = to_amba_device(dev);
> struct pl022 *pl022 = amba_get_drvdata(adev);
> int status = 0;
>
> @@ -2203,8 +2204,9 @@ static int pl022_suspend(struct amba_device *adev, pm_message_t state)
> return 0;
> }
>
> -static int pl022_resume(struct amba_device *adev)
> +static int pl022_resume(struct device *dev)
> {
> + struct amba_device *adev = to_amba_device(dev);
> struct pl022 *pl022 = amba_get_drvdata(adev);
> int status = 0;
>
> @@ -2220,7 +2222,9 @@ static int pl022_resume(struct amba_device *adev)
> #else
> #define pl022_suspend NULL
> #define pl022_resume NULL
> -#endif /* CONFIG_PM */
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(pl022_pm, pl022_suspend, pl022_resume);
>
> static struct vendor_data vendor_arm = {
> .fifodepth = 8,
> @@ -2284,12 +2288,11 @@ static struct amba_id pl022_ids[] = {
> static struct amba_driver pl022_driver = {
> .drv = {
> .name = "ssp-pl022",
> + .pm = &pl022_pm,
> },
> .id_table = pl022_ids,
> .probe = pl022_probe,
> .remove = __devexit_p(pl022_remove),
> - .suspend = pl022_suspend,
> - .resume = pl022_resume,
> };
>
>
> diff --git a/drivers/tty/serial/amba-pl010.c b/drivers/tty/serial/amba-pl010.c
> index 2904aa0..5e0e62f 100644
> --- a/drivers/tty/serial/amba-pl010.c
> +++ b/drivers/tty/serial/amba-pl010.c
> @@ -757,9 +757,11 @@ static int pl010_remove(struct amba_device *dev)
> return 0;
> }
>
> -static int pl010_suspend(struct amba_device *dev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int pl010_suspend(struct device *dev)
> {
> - struct uart_amba_port *uap = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct uart_amba_port *uap = amba_get_drvdata(adev);
>
> if (uap)
> uart_suspend_port(&amba_reg, &uap->port);
> @@ -767,15 +769,22 @@ static int pl010_suspend(struct amba_device *dev, pm_message_t state)
> return 0;
> }
>
> -static int pl010_resume(struct amba_device *dev)
> +static int pl010_resume(struct device *dev)
> {
> - struct uart_amba_port *uap = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct uart_amba_port *uap = amba_get_drvdata(adev);
>
> if (uap)
> uart_resume_port(&amba_reg, &uap->port);
>
> return 0;
> }
> +#else
> +#define pl010_suspend NULL
> +#define pl010_resume NULL
> +#endif
> +
> +static SIMPLE_DEV_PM_OPS(pl010_pm, pl010_suspend, pl010_resume);
>
> static struct amba_id pl010_ids[] = {
> {
> @@ -788,12 +797,11 @@ static struct amba_id pl010_ids[] = {
> static struct amba_driver pl010_driver = {
> .drv = {
> .name = "uart-pl010",
> + .pm = &pl010_pm,
> },
> .id_table = pl010_ids,
> .probe = pl010_probe,
> .remove = pl010_remove,
> - .suspend = pl010_suspend,
> - .resume = pl010_resume,
> };
>
> static int __init pl010_init(void)
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index e76d7d0..52a5e18 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -1438,10 +1438,11 @@ static int pl011_remove(struct amba_device *dev)
> return 0;
> }
>
> -#ifdef CONFIG_PM
> -static int pl011_suspend(struct amba_device *dev, pm_message_t state)
> +#ifdef CONFIG_PM_SLEEP
> +static int pl011_suspend(struct device *dev)
> {
> - struct uart_amba_port *uap = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct uart_amba_port *uap = amba_get_drvdata(adev);
>
> if (!uap)
> return -EINVAL;
> @@ -1449,17 +1450,23 @@ static int pl011_suspend(struct amba_device *dev, pm_message_t state)
> return uart_suspend_port(&amba_reg, &uap->port);
> }
>
> -static int pl011_resume(struct amba_device *dev)
> +static int pl011_resume(struct device *dev)
> {
> - struct uart_amba_port *uap = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct uart_amba_port *uap = amba_get_drvdata(adev);
>
> if (!uap)
> return -EINVAL;
>
> return uart_resume_port(&amba_reg, &uap->port);
> }
> +#else
> +#define pl011_suspend NULL
> +#define pl011_resume NULL
> #endif
>
> +static SIMPLE_DEV_PM_OPS(pl011_pm, pl011_suspend, pl011_resume);
> +
> static struct amba_id pl011_ids[] = {
> {
> .id = 0x00041011,
> @@ -1477,14 +1484,11 @@ static struct amba_id pl011_ids[] = {
> static struct amba_driver pl011_driver = {
> .drv = {
> .name = "uart-pl011",
> + .pm = &pl011_pm,
> },
> .id_table = pl011_ids,
> .probe = pl011_probe,
> .remove = pl011_remove,
> -#ifdef CONFIG_PM
> - .suspend = pl011_suspend,
> - .resume = pl011_resume,
> -#endif
> };
>
> static int __init pl011_init(void)
> diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
> index a0ccf28..2f48827 100644
> --- a/include/linux/amba/bus.h
> +++ b/include/linux/amba/bus.h
> @@ -46,8 +46,6 @@ struct amba_driver {
> int (*probe)(struct amba_device *, struct amba_id *);
> int (*remove)(struct amba_device *);
> void (*shutdown)(struct amba_device *);
> - int (*suspend)(struct amba_device *, pm_message_t);
> - int (*resume)(struct amba_device *);
> struct amba_id *id_table;
> };
>
> @@ -58,6 +56,8 @@ enum amba_vendor {
>
> extern struct bus_type amba_bustype;
>
> +#define to_amba_device(d) container_of(d, struct amba_device, dev)
> +
> #define amba_get_drvdata(d) dev_get_drvdata(&d->dev)
> #define amba_set_drvdata(d,p) dev_set_drvdata(&d->dev, p)
>
> diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
> index af5a152..040c5f0 100644
> --- a/sound/arm/aaci.c
> +++ b/sound/arm/aaci.c
> @@ -35,7 +35,7 @@
> /*
> * PM support is not complete. Turn it off.
> */
> -#undef CONFIG_PM
> +#undef CONFIG_PM_SLEEP
>
> static void aaci_ac97_select_codec(struct aaci *aaci, struct snd_ac97 *ac97)
> {
> @@ -752,7 +752,7 @@ static struct snd_pcm_ops aaci_capture_ops = {
> /*
> * Power Management.
> */
> -#ifdef CONFIG_PM
> +#ifdef CONFIG_PM_SLEEP
> static int aaci_do_suspend(struct snd_card *card, unsigned int state)
> {
> struct aaci *aaci = card->private_data;
> @@ -767,15 +767,17 @@ static int aaci_do_resume(struct snd_card *card, unsigned int state)
> return 0;
> }
>
> -static int aaci_suspend(struct amba_device *dev, pm_message_t state)
> +static int aaci_suspend(struct device *dev)
> {
> - struct snd_card *card = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct snd_card *card = amba_get_drvdata(adev);
> return card ? aaci_do_suspend(card) : 0;
> }
>
> -static int aaci_resume(struct amba_device *dev)
> +static int aaci_resume(struct device *dev)
> {
> - struct snd_card *card = amba_get_drvdata(dev);
> + struct amba_device *adev = to_amba_device(dev);
> + struct snd_card *card = amba_get_drvdata(adev);
> return card ? aaci_do_resume(card) : 0;
> }
> #else
> @@ -785,6 +787,7 @@ static int aaci_resume(struct amba_device *dev)
> #define aaci_resume NULL
> #endif
>
> +static SIMPLE_DEV_PM_OPS(aaci_pm, aaci_suspend, aaci_resume);
>
> static struct ac97_pcm ac97_defs[] __devinitdata = {
> [0] = { /* Front PCM */
> @@ -1099,11 +1102,10 @@ static struct amba_id aaci_ids[] = {
> static struct amba_driver aaci_driver = {
> .drv = {
> .name = DRIVER_NAME,
> + .pm = &aaci_pm,
> },
> .probe = aaci_probe,
> .remove = __devexit_p(aaci_remove),
> - .suspend = aaci_suspend,
> - .resume = aaci_resume,
> .id_table = aaci_ids,
> };
>
> --
> 1.7.2.dirty
>
^ permalink raw reply
* [patch-v2.6.39 6/7] OMAP4430: hwmod data: Adding USBOTG
From: Felipe Balbi @ 2011-02-17 17:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <4D5D59E5.6020307@ti.com>
On Thu, Feb 17, 2011 at 06:24:53PM +0100, Cousson, Benoit wrote:
> On 2/17/2011 6:17 PM, Balbi, Felipe wrote:
> >On Thu, Feb 17, 2011 at 06:14:24PM +0100, Cousson, Benoit wrote:
> >>On 2/17/2011 5:59 PM, Tony Lindgren wrote:
> >>>* Felipe Balbi<balbi@ti.com> [110217 08:20]:
> >>>>On Thu, Feb 17, 2011 at 08:20:01AM -0800, Tony Lindgren wrote:
> >>>>>
> >>>>>Maybe no need to rebase, I'll apply Benoit's series first into
> >>>>>omap-for-linus, then let's applying the other hwmod related patches
> >>>>>should be trivial.
> >>>>
> >>>>So I can drop the omap4 HWMOD part from my branch ?
> >>>
> >>>Yeh assuming Benoit's data is correct.
> >>
> >>Of course, it is :-)
> >>
> >>Then I will add USB in my series.
> >
> >BTW, which branch should I use from your tree to test ?
>
> I'll put that in the refresh version of the branch I have done for
> Tony. I messed up the McSPI changelog... and Tony caught me :-)
>
> I'll push that in 5 minutes.
cool, let me know
--
balbi
^ permalink raw reply
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