diff mbox

hvc_dcc : add support to armv4 and armv5 core

Message ID 1346404916-27616-1-git-send-email-castet.matthieu@free.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Matthieu Castet Aug. 31, 2012, 9:21 a.m. UTC
Signed-off-by: Matthieu Castet <matthieu.castet@parrot.com>
---
 drivers/tty/hvc/hvc_dcc.c |   34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

Comments

Alan Cox Aug. 31, 2012, 10:04 a.m. UTC | #1
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.
Matthieu CASTET Aug. 31, 2012, 10:29 a.m. UTC | #2
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.
Russell King - ARM Linux Aug. 31, 2012, 10:33 a.m. UTC | #3
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.
Russell King - ARM Linux Aug. 31, 2012, 10:59 a.m. UTC | #4
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.
Alan Cox Aug. 31, 2012, 10:59 a.m. UTC | #5
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
Matthieu CASTET Aug. 31, 2012, 11:48 a.m. UTC | #6
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
Alan Cox Aug. 31, 2012, 12:25 p.m. UTC | #7
> > 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
diff mbox

Patch

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