diff mbox

[2/3] ARM: CSR: mapping early DEBUG_LL uart

Message ID 1309945678-18813-3-git-send-email-bs14@csr.com (mailing list archive)
State New, archived
Headers show

Commit Message

Barry Song July 6, 2011, 9:47 a.m. UTC
Signed-off-by: Barry Song <bs14@csr.com>
---
 arch/arm/mach-prima2/Makefile |    1 +
 arch/arm/mach-prima2/lluart.c |   25 +++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-prima2/lluart.c

Comments

Russell King - ARM Linux July 6, 2011, 11:05 a.m. UTC | #1
On Wed, Jul 06, 2011 at 02:47:57AM -0700, Barry Song wrote:
> Signed-off-by: Barry Song <bs14@csr.com>

Surely this should be part of the first patch, which won't build without
this one if DEBUG_LL is enabled?
Arnd Bergmann July 6, 2011, 11:15 a.m. UTC | #2
On Wednesday 06 July 2011, Barry Song wrote:
> Signed-off-by: Barry Song <bs14@csr.com>
> ---
>  arch/arm/mach-prima2/Makefile |    1 +
>  arch/arm/mach-prima2/lluart.c |   25 +++++++++++++++++++++++++
>  2 files changed, 26 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/mach-prima2/lluart.c

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Barry Song July 6, 2011, 11:53 a.m. UTC | #3
hi Russell,

2011/7/6 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Wed, Jul 06, 2011 at 02:47:57AM -0700, Barry Song wrote:
>> Signed-off-by: Barry Song <bs14@csr.com>
>
> Surely this should be part of the first patch, which won't build without
> this one if DEBUG_LL is enabled?

i guess that can get fixed by:

static void __init sirfsoc_map_io(void)
{
        sirfsoc_map_lluart();
}

MACHINE_START(PRIMA2_EVB, "prima2cb")
      ...
       .map_io         = sirfsoc_map_io,
      ...
MACHINE_END

>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

Thanks
barry
Barry Song July 6, 2011, 11:56 a.m. UTC | #4
2011/7/6 Barry Song <21cnbao@gmail.com>:
> hi Russell,
>
> 2011/7/6 Russell King - ARM Linux <linux@arm.linux.org.uk>:
>> On Wed, Jul 06, 2011 at 02:47:57AM -0700, Barry Song wrote:
>>> Signed-off-by: Barry Song <bs14@csr.com>
>>
>> Surely this should be part of the first patch, which won't build without
>> this one if DEBUG_LL is enabled?
>
> i guess that can get fixed by:

oh. no, it can't be fixed by any way....

>
> static void __init sirfsoc_map_io(void)
> {
>        sirfsoc_map_lluart();
> }
>
> MACHINE_START(PRIMA2_EVB, "prima2cb")
>      ...
>       .map_io         = sirfsoc_map_io,
>      ...
> MACHINE_END
>
>>
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>>
>
> Thanks
> barry
>
Russell King - ARM Linux July 6, 2011, 12:10 p.m. UTC | #5
On Wed, Jul 06, 2011 at 07:53:14PM +0800, Barry Song wrote:
> hi Russell,
> 
> 2011/7/6 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Wed, Jul 06, 2011 at 02:47:57AM -0700, Barry Song wrote:
> >> Signed-off-by: Barry Song <bs14@csr.com>
> >
> > Surely this should be part of the first patch, which won't build without
> > this one if DEBUG_LL is enabled?
> 
> i guess that can get fixed by:
> 
> static void __init sirfsoc_map_io(void)
> {
>         sirfsoc_map_lluart();
> }
> 
> MACHINE_START(PRIMA2_EVB, "prima2cb")
>       ...
>        .map_io         = sirfsoc_map_io,
>       ...
> MACHINE_END

That doesn't really change anything.  If you build the first patch without
the second patch with DEBUG_LL enabled, you'll get a build failure because
sirfsoc_map_lluart is not defined.

Either omit the .map_io initializer in the first patch and add it in the
second patch, or combine the two patches together.
Barry Song July 6, 2011, 12:29 p.m. UTC | #6
Hi Russell,
Thanks.

2011/7/6 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Wed, Jul 06, 2011 at 07:53:14PM +0800, Barry Song wrote:
>> hi Russell,
>>
>> 2011/7/6 Russell King - ARM Linux <linux@arm.linux.org.uk>:
>> > On Wed, Jul 06, 2011 at 02:47:57AM -0700, Barry Song wrote:
>> >> Signed-off-by: Barry Song <bs14@csr.com>
>> >
>> > Surely this should be part of the first patch, which won't build without
>> > this one if DEBUG_LL is enabled?
>>
>> i guess that can get fixed by:
>>
>> static void __init sirfsoc_map_io(void)
>> {
>>         sirfsoc_map_lluart();
>> }
>>
>> MACHINE_START(PRIMA2_EVB, "prima2cb")
>>       ...
>>        .map_io         = sirfsoc_map_io,
>>       ...
>> MACHINE_END
>
> That doesn't really change anything.  If you build the first patch without
> the second patch with DEBUG_LL enabled, you'll get a build failure because
> sirfsoc_map_lluart is not defined.
>
> Either omit the .map_io initializer in the first patch and add it in the
> second patch, or combine the two patches together.

real. thanks! to keep this as a separate patch as required in earlier
thread, i will omit the .map_io initializer in the first patch.

>
barry
diff mbox

Patch

diff --git a/arch/arm/mach-prima2/Makefile b/arch/arm/mach-prima2/Makefile
index d44f7ae..f2fba66 100644
--- a/arch/arm/mach-prima2/Makefile
+++ b/arch/arm/mach-prima2/Makefile
@@ -3,3 +3,4 @@  obj-y += irq.o
 obj-y += clock.o
 obj-y += rstc.o
 obj-y += prima2.o
+obj-$(CONFIG_DEBUG_LL) += lluart.o
diff --git a/arch/arm/mach-prima2/lluart.c b/arch/arm/mach-prima2/lluart.c
new file mode 100644
index 0000000..a89f9b3
--- /dev/null
+++ b/arch/arm/mach-prima2/lluart.c
@@ -0,0 +1,25 @@ 
+/*
+ * Static memory mapping for DEBUG_LL
+ *
+ * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company.
+ *
+ * Licensed under GPLv2 or later.
+ */
+
+#include <linux/kernel.h>
+#include <asm/page.h>
+#include <asm/mach/map.h>
+#include <mach/map.h>
+#include <mach/uart.h>
+
+void __init sirfsoc_map_lluart(void)
+{
+	struct map_desc sirfsoc_lluart_map = {
+		.virtual        = SIRFSOC_UART1_VA_BASE,
+		.pfn            = __phys_to_pfn(SIRFSOC_UART1_PA_BASE),
+		.length         = SIRFSOC_UART1_SIZE,
+		.type           = MT_DEVICE,
+	};
+
+	iotable_init(&sirfsoc_lluart_map, 1);
+}