2012-08-31 09:22:08

by matthieu castet

[permalink] [raw]
Subject: [PATCH] hvc_dcc : add support to armv4 and armv5 core

Signed-off-by: Matthieu Castet <[email protected]>
---
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


2012-08-31 10:00:56

by Alan

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

On Fri, 31 Aug 2012 11:21:56 +0200
Matthieu CASTET <[email protected]> wrote:

> Signed-off-by: Matthieu Castet <[email protected]>
> ---
> 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.

2012-08-31 10:29:10

by Matthieu CASTET

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

Alan Cox a ?crit :
> On Fri, 31 Aug 2012 11:21:56 +0200
> Matthieu CASTET <[email protected]> wrote:
>
>> Signed-off-by: Matthieu Castet <[email protected]>
>> ---
>> 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.

2012-08-31 10:34:18

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

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 <[email protected]> wrote:
> >
> >> Signed-off-by: Matthieu Castet <[email protected]>
> >> ---
> >> 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.

2012-08-31 10:56:12

by Alan

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

On Fri, 31 Aug 2012 11:33:51 +0100
Russell King - ARM Linux <[email protected]> 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 <[email protected]> wrote:
> > >
> > >> Signed-off-by: Matthieu Castet <[email protected]>
> > >> ---
> > >> 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

2012-08-31 10:59:23

by Russell King - ARM Linux

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

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 <[email protected]> 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 <[email protected]> wrote:
> > > >
> > > >> Signed-off-by: Matthieu Castet <[email protected]>
> > > >> ---
> > > >> 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.

2012-08-31 11:48:21

by Matthieu CASTET

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

Alan Cox a ?crit :
> On Fri, 31 Aug 2012 11:33:51 +0100
> Russell King - ARM Linux <[email protected]> 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 <[email protected]> wrote:
>>>>
>>>>> Signed-off-by: Matthieu Castet <[email protected]>
>>>>> ---
>>>>> 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

2012-08-31 12:21:22

by Alan

[permalink] [raw]
Subject: Re: [PATCH] hvc_dcc : add support to armv4 and armv5 core

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