linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hvc_dcc : add support to armv4 and armv5 core
@ 2012-08-31  9:21 Matthieu CASTET
  2012-08-31 10:04 ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu CASTET @ 2012-08-31  9:21 UTC (permalink / raw)
  To: linux-kernel, linux-arm-kernel, gregkh
  Cc: sboyd, arnd, Matthieu CASTET, Matthieu Castet

Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
---
 drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
index 44fbeba..489e9e5 100644
--- a/drivers/tty/hvc/hvc_dcc.c
+++ b/drivers/tty/hvc/hvc_dcc.c
@@ -26,6 +26,7 @@
 
 #include "hvc_console.h"
 
+#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V7)
 /* DCC Status Bits */
 #define DCC_STATUS_RX		(1 << 30)
 #define DCC_STATUS_TX		(1 << 29)
@@ -58,6 +59,39 @@ static inline void __dcc_putchar(char c)
 		: "r" (c));
 	isb();
 }
+#else
+/* DCC Status Bits */
+#define DCC_STATUS_RX		(1 << 0)
+#define DCC_STATUS_TX		(1 << 1)
+
+/* primitive JTAG1 protocol utilities */
+static inline u32 __dcc_getstatus(void)
+{
+	u32 ret;
+
+	asm __volatile__ ("mrc p14, 0, %0, c0, c0	@ read comms ctrl reg"
+		: "=r" (ret));
+
+	return ret;
+}
+
+static inline char __dcc_getchar(void)
+{
+	char c;
+
+	asm __volatile__ ("mrc p14, 0, %0, c1, c0	@ read comms data reg"
+		: "=r" (c));
+
+	return c;
+}
+
+static inline void __dcc_putchar(unsigned char c)
+{
+	asm __volatile__ ("mcr p14, 0, %0, c1, c0	@ write a char"
+		: /* no output register */
+		: "r" (c));
+}
+#endif
 
 static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
 {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31  9:21 [PATCH] hvc_dcc : add support to armv4 and armv5 core Matthieu CASTET
@ 2012-08-31 10:04 ` Alan Cox
  2012-08-31 10:29   ` Matthieu CASTET
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Cox @ 2012-08-31 10:04 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: linux-kernel, linux-arm-kernel, gregkh, sboyd, arnd, Matthieu Castet

On Fri, 31 Aug 2012 11:21:56 +0200
Matthieu CASTET <castet.matthieu@free.fr> wrote:

> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
> ---
>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)

This is a step in the wrong direction. This should all be runtime handled

NAK.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 10:04 ` Alan Cox
@ 2012-08-31 10:29   ` Matthieu CASTET
  2012-08-31 10:33     ` Russell King - ARM Linux
  0 siblings, 1 reply; 8+ messages in thread
From: Matthieu CASTET @ 2012-08-31 10:29 UTC (permalink / raw)
  To: Alan Cox
  Cc: Matthieu CASTET, linux-kernel, linux-arm-kernel, gregkh, sboyd, arnd

Alan Cox a écrit :
> On Fri, 31 Aug 2012 11:21:56 +0200
> Matthieu CASTET <castet.matthieu@free.fr> wrote:
> 
>> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
>> ---
>>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
>>  1 file changed, 34 insertions(+)
> 
> This is a step in the wrong direction. This should all be runtime handled
> 
> NAK.
> 

AFAIK you can't build a arm kernel that support arm6/armv7 and armv5.
And I am not sure it will be possible one day.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 10:29   ` Matthieu CASTET
@ 2012-08-31 10:33     ` Russell King - ARM Linux
  2012-08-31 10:59       ` Alan Cox
  0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2012-08-31 10:33 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Alan Cox, arnd, gregkh, sboyd, linux-kernel, Matthieu CASTET,
	linux-arm-kernel

On Fri, Aug 31, 2012 at 12:29:04PM +0200, Matthieu CASTET wrote:
> Alan Cox a écrit :
> > On Fri, 31 Aug 2012 11:21:56 +0200
> > Matthieu CASTET <castet.matthieu@free.fr> wrote:
> > 
> >> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
> >> ---
> >>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
> >>  1 file changed, 34 insertions(+)
> > 
> > This is a step in the wrong direction. This should all be runtime handled
> > 
> > NAK.
> > 
> 
> AFAIK you can't build a arm kernel that support arm6/armv7 and armv5.
> And I am not sure it will be possible one day.

There are no plans to ever make it possible; there are too many significant
differences between ARMv4, v5 architectures and ARMv6,v7 architectures
to warrant making this runtime selectable.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 10:59       ` Alan Cox
@ 2012-08-31 10:59         ` Russell King - ARM Linux
  2012-08-31 11:48         ` Matthieu CASTET
  1 sibling, 0 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2012-08-31 10:59 UTC (permalink / raw)
  To: Alan Cox
  Cc: Matthieu CASTET, arnd, gregkh, sboyd, linux-kernel,
	Matthieu CASTET, linux-arm-kernel

On Fri, Aug 31, 2012 at 11:59:39AM +0100, Alan Cox wrote:
> On Fri, 31 Aug 2012 11:33:51 +0100
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> 
> > On Fri, Aug 31, 2012 at 12:29:04PM +0200, Matthieu CASTET wrote:
> > > Alan Cox a écrit :
> > > > On Fri, 31 Aug 2012 11:21:56 +0200
> > > > Matthieu CASTET <castet.matthieu@free.fr> wrote:
> > > > 
> > > >> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
> > > >> ---
> > > >>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
> > > >>  1 file changed, 34 insertions(+)
> > > > 
> > > > This is a step in the wrong direction. This should all be runtime handled
> > > > 
> > > > NAK.
> > > > 
> > > 
> > > AFAIK you can't build a arm kernel that support arm6/armv7 and armv5.
> > > And I am not sure it will be possible one day.
> > 
> > There are no plans to ever make it possible; there are too many significant
> > differences between ARMv4, v5 architectures and ARMv6,v7 architectures
> > to warrant making this runtime selectable.
> 
> Then bury this crap in platform files please not in the drivers/tty layer
> code. Make it a platform driver provided callback or something.

Platform driver callbacks via platform data are incompatible with DT,
which is where folk elsewhere in the kernel community have kicked ARM
towards, away from the platform driver/device with platform data model.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 10:33     ` Russell King - ARM Linux
@ 2012-08-31 10:59       ` Alan Cox
  2012-08-31 10:59         ` Russell King - ARM Linux
  2012-08-31 11:48         ` Matthieu CASTET
  0 siblings, 2 replies; 8+ messages in thread
From: Alan Cox @ 2012-08-31 10:59 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Matthieu CASTET, arnd, gregkh, sboyd, linux-kernel,
	Matthieu CASTET, linux-arm-kernel

On Fri, 31 Aug 2012 11:33:51 +0100
Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:

> On Fri, Aug 31, 2012 at 12:29:04PM +0200, Matthieu CASTET wrote:
> > Alan Cox a écrit :
> > > On Fri, 31 Aug 2012 11:21:56 +0200
> > > Matthieu CASTET <castet.matthieu@free.fr> wrote:
> > > 
> > >> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
> > >> ---
> > >>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
> > >>  1 file changed, 34 insertions(+)
> > > 
> > > This is a step in the wrong direction. This should all be runtime handled
> > > 
> > > NAK.
> > > 
> > 
> > AFAIK you can't build a arm kernel that support arm6/armv7 and armv5.
> > And I am not sure it will be possible one day.
> 
> There are no plans to ever make it possible; there are too many significant
> differences between ARMv4, v5 architectures and ARMv6,v7 architectures
> to warrant making this runtime selectable.

Then bury this crap in platform files please not in the drivers/tty layer
code. Make it a platform driver provided callback or something.

Alan

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 10:59       ` Alan Cox
  2012-08-31 10:59         ` Russell King - ARM Linux
@ 2012-08-31 11:48         ` Matthieu CASTET
  2012-08-31 12:25           ` Alan Cox
  1 sibling, 1 reply; 8+ messages in thread
From: Matthieu CASTET @ 2012-08-31 11:48 UTC (permalink / raw)
  To: Alan Cox
  Cc: Russell King - ARM Linux, arnd, gregkh, sboyd, linux-kernel,
	Matthieu CASTET, linux-arm-kernel

Alan Cox a écrit :
> On Fri, 31 Aug 2012 11:33:51 +0100
> Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> 
>> On Fri, Aug 31, 2012 at 12:29:04PM +0200, Matthieu CASTET wrote:
>>> Alan Cox a écrit :
>>>> On Fri, 31 Aug 2012 11:21:56 +0200
>>>> Matthieu CASTET <castet.matthieu@free.fr> wrote:
>>>>
>>>>> Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
>>>>> ---
>>>>>  drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
>>>>>  1 file changed, 34 insertions(+)
>>>> This is a step in the wrong direction. This should all be runtime handled
>>>>
>>>> NAK.
>>>>
>>> AFAIK you can't build a arm kernel that support arm6/armv7 and armv5.
>>> And I am not sure it will be possible one day.
>> There are no plans to ever make it possible; there are too many significant
>> differences between ARMv4, v5 architectures and ARMv6,v7 architectures
>> to warrant making this runtime selectable.
> 
> Then bury this crap in platform files please not in the drivers/tty layer
> code. Make it a platform driver provided callback or something.
> 
I posted a new v2 patch that make the selection dynamic.


Matthieu

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core
  2012-08-31 11:48         ` Matthieu CASTET
@ 2012-08-31 12:25           ` Alan Cox
  0 siblings, 0 replies; 8+ messages in thread
From: Alan Cox @ 2012-08-31 12:25 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Russell King - ARM Linux, arnd, gregkh, sboyd, linux-kernel,
	Matthieu CASTET, linux-arm-kernel

> > Then bury this crap in platform files please not in the drivers/tty layer
> > code. Make it a platform driver provided callback or something.
> > 
> I posted a new v2 patch that make the selection dynamic.

Thanks - fine with that one - or with burying it in headers etc in the arm
subdirs.

Greg's email address btw has changed - you want his current one as
suse.de bounces.

Alan

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-08-31 12:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-31  9:21 [PATCH] hvc_dcc : add support to armv4 and armv5 core Matthieu CASTET
2012-08-31 10:04 ` Alan Cox
2012-08-31 10:29   ` Matthieu CASTET
2012-08-31 10:33     ` Russell King - ARM Linux
2012-08-31 10:59       ` Alan Cox
2012-08-31 10:59         ` Russell King - ARM Linux
2012-08-31 11:48         ` Matthieu CASTET
2012-08-31 12:25           ` Alan Cox

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).