* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
@ 2010-02-18 20:26 Marc Zyngier
2010-02-19 6:17 ` Eric Miao
0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2010-02-18 20:26 UTC (permalink / raw)
To: linux-arm-kernel
Zeus console port is wired to a 8250-compatible device
(pxa UARTs are reserved to other uses). This patch
allows such a configuration in the uncompress sequence.
It has been regression-tested on a Viper using FFUART.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
---
arch/arm/mach-pxa/include/mach/uncompress.h | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h
index 237734b..dc94a34 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -13,17 +13,21 @@
#include <mach/regs-uart.h>
#include <asm/mach-types.h>
-#define __REG(x) ((volatile unsigned long *)x)
+#define __REG(x) ((volatile char *)x)
-static volatile unsigned long *UART = FFUART;
+static volatile char *UART = FFUART;
+static int shift = 2;
+static int is_pxa_uart = 1;
+
+#define UART_REG(x) UART[(x) << shift]
static inline void putc(char c)
{
- if (!(UART[UART_IER] & IER_UUE))
+ if (is_pxa_uart && !(UART_REG(UART_IER) & IER_UUE))
return;
- while (!(UART[UART_LSR] & LSR_TDRQ))
+ while (!(UART_REG(UART_LSR) & LSR_TDRQ))
barrier();
- UART[UART_TX] = c;
+ UART_REG(UART_TX) = c;
}
/*
@@ -39,6 +43,12 @@ static inline void arch_decomp_setup(void)
|| machine_is_csb726() || machine_is_stargate2()
|| machine_is_cm_x300() || machine_is_balloon3())
UART = STUART;
+
+ if (machine_is_arcom_zeus()) {
+ UART = __REG(0x10000000);
+ is_pxa_uart = 0;
+ shift = 1;
+ }
}
/*
--
1.7.0
--
I'm the slime oozin' out from your TV set...
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
@ 2010-02-18 20:27 Marc Zyngier
2010-02-18 20:34 ` Marc Zyngier
0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2010-02-18 20:27 UTC (permalink / raw)
To: linux-arm-kernel
Signed-off-by: Amit Walambe <amit.walambe@eurotech.com>
Signed-off-by: Marc Zyngier <maz@misterjones.org>
---
arch/arm/mach-pxa/zeus.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c
index 75f2a37..4034b98 100644
--- a/arch/arm/mach-pxa/zeus.c
+++ b/arch/arm/mach-pxa/zeus.c
@@ -509,7 +509,9 @@ static void zeus_ohci_exit(struct device *dev)
static struct pxaohci_platform_data zeus_ohci_platform_data = {
.port_mode = PMM_NPS_MODE,
- .flags = ENABLE_PORT_ALL | POWER_CONTROL_LOW | POWER_SENSE_LOW,
+ /* Clear Power Control Polarity Low and set Power Sense
+ * Polarity Low. Supply power to USB ports. */
+ .flags = ENABLE_PORT_ALL | POWER_SENSE_LOW,
.init = zeus_ohci_init,
.exit = zeus_ohci_exit,
};
--
1.7.0
--
I'm the slime oozin' out from your TV set...
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
2010-02-18 20:27 Marc Zyngier
@ 2010-02-18 20:34 ` Marc Zyngier
0 siblings, 0 replies; 6+ messages in thread
From: Marc Zyngier @ 2010-02-18 20:34 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 18 Feb 2010 20:27:13 +0000
Marc Zyngier <maz@misterjones.org> wrote:
Grmbl... Right patch, wrong title... Reposted as 2/5.
Sorry.
M.
--
I'm the slime oozin' out from your TV set...
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
2010-02-18 20:26 [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress Marc Zyngier
@ 2010-02-19 6:17 ` Eric Miao
2010-02-19 7:13 ` Marc Zyngier
0 siblings, 1 reply; 6+ messages in thread
From: Eric Miao @ 2010-02-19 6:17 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 19, 2010 at 4:26 AM, Marc Zyngier <maz@misterjones.org> wrote:
> Zeus console port is wired to a 8250-compatible device
> (pxa UARTs are reserved to other uses). This patch
> allows such a configuration in the uncompress sequence.
>
> It has been regression-tested on a Viper using FFUART.
>
> Signed-off-by: Marc Zyngier <maz@misterjones.org>
Hi Marc,
I would like to modify the patch a little bit as follows (and into two),
please let me know if you are OK (better to go with your Ack):
[ARM] pxa: refactor uncompress.h for non-PXA uarts
The original patch came from Marc Zyngier where support of 8250-compatible
UART is required to show the uncompress information. Modified a little bit
here, including changes below:
1. #include <mach/regs-uart.h> is actually not necessary
2. introduced uart_{read,write}() for different base and shift
3. introduced uart_is_enabled() and assumed enabled always for
non-PXA uarts
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h
b/arch/arm/mach-pxa/include/mach/uncompress.h
index 237734b..4888a21 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -10,20 +10,41 @@
*/
#include <linux/serial_reg.h>
-#include <mach/regs-uart.h>
#include <asm/mach-types.h>
-#define __REG(x) ((volatile unsigned long *)x)
+#define FFUART_BASE (0x40100000)
+#define BTUART_BASE (0x40200000)
+#define STUART_BASE (0x40700000)
-static volatile unsigned long *UART = FFUART;
+static unsigned long uart_base = FFUART_BASE;
+static unsigned int uart_shift = 2;
+static unsigned int uart_is_pxa = 1;
+
+static inline unsigned char uart_read(int offset)
+{
+ return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
+}
+
+static inline void uart_write(unsigned char val, int offset)
+{
+ *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
+}
+
+static inline int uart_is_enabled(void)
+{
+ /* assume enabled by default for non-PXA uarts */
+ return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
+}
static inline void putc(char c)
{
- if (!(UART[UART_IER] & IER_UUE))
+ if (!uart_is_enabled())
return;
- while (!(UART[UART_LSR] & LSR_TDRQ))
+
+ while (!(uart_read(UART_LSR) & UART_LSR_THRE))
barrier();
- UART[UART_TX] = c;
+
+ uart_write(c, UART_TX);
}
/*
@@ -38,7 +59,7 @@ static inline void arch_decomp_setup(void)
if (machine_is_littleton() || machine_is_intelmote2()
|| machine_is_csb726() || machine_is_stargate2()
|| machine_is_cm_x300() || machine_is_balloon3())
- UART = STUART;
+ uart_base = STUART_BASE;
}
/*
And
[ARM] pxa/zeus: allow usage of 8250-compatible UART in uncompress
Zeus console port is wired to a 8250-compatible device (pxa UARTs are
reserved to other uses). This patch allows such a configuration in the
uncompress sequence.
Signed-off-by: Marc Zyngier <maz@misterjones.org>
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h
b/arch/arm/mach-pxa/include/mach/uncompress.h
index 4888a21..5ef91d9 100644
--- a/arch/arm/mach-pxa/include/mach/uncompress.h
+++ b/arch/arm/mach-pxa/include/mach/uncompress.h
@@ -60,6 +60,12 @@ static inline void arch_decomp_setup(void)
|| machine_is_csb726() || machine_is_stargate2()
|| machine_is_cm_x300() || machine_is_balloon3())
uart_base = STUART_BASE;
+
+ if (machine_is_arcom_zeus()) {
+ uart_base = 0x10000000; /* nCS4 */
+ uart_shift = 1;
+ uart_is_pxa = 0;
+ }
}
/*
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
2010-02-19 6:17 ` Eric Miao
@ 2010-02-19 7:13 ` Marc Zyngier
2010-02-19 7:38 ` Eric Miao
0 siblings, 1 reply; 6+ messages in thread
From: Marc Zyngier @ 2010-02-19 7:13 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, 19 Feb 2010 14:17:52 +0800
Eric Miao <eric.y.miao@gmail.com> wrote:
> On Fri, Feb 19, 2010 at 4:26 AM, Marc Zyngier <maz@misterjones.org> wrote:
> > Zeus console port is wired to a 8250-compatible device
> > (pxa UARTs are reserved to other uses). This patch
> > allows such a configuration in the uncompress sequence.
> >
> > It has been regression-tested on a Viper using FFUART.
> >
> > Signed-off-by: Marc Zyngier <maz@misterjones.org>
>
> Hi Marc,
>
> I would like to modify the patch a little bit as follows (and into two),
> please let me know if you are OK (better to go with your Ack):
>
> [ARM] pxa: refactor uncompress.h for non-PXA uarts
>
> The original patch came from Marc Zyngier where support of 8250-compatible
> UART is required to show the uncompress information. Modified a little bit
> here, including changes below:
>
> 1. #include <mach/regs-uart.h> is actually not necessary
> 2. introduced uart_{read,write}() for different base and shift
> 3. introduced uart_is_enabled() and assumed enabled always for
> non-PXA uarts
>
> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Hi Eric,
Looks very good to me. Please find my
Acked-by: Marc Zyngier <maz@misterjones.org>
Thanks,
M.
--
I'm the slime oozin' out from your TV set...
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress
2010-02-19 7:13 ` Marc Zyngier
@ 2010-02-19 7:38 ` Eric Miao
0 siblings, 0 replies; 6+ messages in thread
From: Eric Miao @ 2010-02-19 7:38 UTC (permalink / raw)
To: linux-arm-kernel
On Fri, Feb 19, 2010 at 3:13 PM, Marc Zyngier <maz@misterjones.org> wrote:
> On Fri, 19 Feb 2010 14:17:52 +0800
> Eric Miao <eric.y.miao@gmail.com> wrote:
>
>> On Fri, Feb 19, 2010 at 4:26 AM, Marc Zyngier <maz@misterjones.org> wrote:
>> > Zeus console port is wired to a 8250-compatible device
>> > (pxa UARTs are reserved to other uses). This patch
>> > allows such a configuration in the uncompress sequence.
>> >
>> > It has been regression-tested on a Viper using FFUART.
>> >
>> > Signed-off-by: Marc Zyngier <maz@misterjones.org>
>>
>> Hi Marc,
>>
>> I would like to modify the patch a little bit as follows (and into two),
>> please let me know if you are OK (better to go with your Ack):
>>
>> ? ? [ARM] pxa: refactor uncompress.h for non-PXA uarts
>>
>> ? ? The original patch came from Marc Zyngier where support of 8250-compatible
>> ? ? UART is required to show the uncompress information. Modified a little bit
>> ? ? here, including changes below:
>>
>> ? ? 1. #include <mach/regs-uart.h> is actually not necessary
>> ? ? 2. introduced uart_{read,write}() for different base and shift
>> ? ? 3. introduced uart_is_enabled() and assumed enabled always for
>> ? ? ? ?non-PXA uarts
>>
>> ? ? Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
>
> Hi Eric,
>
> Looks very good to me. Please find my
>
> Acked-by: Marc Zyngier <maz@misterjones.org>
>
Thanks. Will push the merged result (together with the rest of
your patches) after a while.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-02-19 7:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-18 20:26 [PATCH 1/5] pxa/zeus: Allow usage of 8250-compatible UART in uncompress Marc Zyngier
2010-02-19 6:17 ` Eric Miao
2010-02-19 7:13 ` Marc Zyngier
2010-02-19 7:38 ` Eric Miao
-- strict thread matches above, loose matches on Subject: below --
2010-02-18 20:27 Marc Zyngier
2010-02-18 20:34 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).