* [PATCH] bcm1480 serial build fix
@ 2007-07-22 7:55 Thiemo Seufer
2007-07-23 13:00 ` Maciej W. Rozycki
0 siblings, 1 reply; 7+ messages in thread
From: Thiemo Seufer @ 2007-07-22 7:55 UTC (permalink / raw)
To: linux-mips; +Cc: ralf
The appended patch restores serial functionality for the bcm1480.
I glued this together without reading documentation, so I'm not sure if
it is fully correct. It is good enough to build a kernel and have a
working serial console.
Signed-Off-By: Thiemo Seufer <ths@networkno.de>
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index 1d9d728..e7f5c0e 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -57,6 +57,12 @@
#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0)
#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line))
+#define DUART_CHANREG_SPACING BCM1480_DUART_CHANREG_SPACING
+
+#define R_DUART_IMRREG(line) R_BCM1480_DUART_IMRREG(line)
+#define R_DUART_INCHREG(line) R_BCM1480_DUART_INCHREG(line)
+#define R_DUART_ISRREG(line) R_BCM1480_DUART_ISRREG(line)
+
#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
#include <asm/sibyte/sb1250_regs.h>
#include <asm/sibyte/sb1250_int.h>
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
index 2738c13..c34d36b 100644
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -227,10 +227,15 @@
(A_BCM1480_DUART(chan) + \
BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
+#define DUART_IMRISR_SPACING 0x20
+#define DUART_INCHNG_SPACING 0x10
+
#define R_BCM1480_DUART_IMRREG(chan) \
(R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
#define R_BCM1480_DUART_ISRREG(chan) \
(R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
+#define R_BCM1480_DUART_INCHREG(chan) \
+ (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING)
#define A_BCM1480_DUART_IMRREG(chan) \
(A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-22 7:55 [PATCH] bcm1480 serial build fix Thiemo Seufer
@ 2007-07-23 13:00 ` Maciej W. Rozycki
2007-07-23 13:21 ` Ralf Baechle
2007-07-23 13:44 ` Thiemo Seufer
0 siblings, 2 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2007-07-23 13:00 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: linux-mips, ralf
On Sun, 22 Jul 2007, Thiemo Seufer wrote:
> diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
> index 2738c13..c34d36b 100644
> --- a/include/asm-mips/sibyte/bcm1480_regs.h
> +++ b/include/asm-mips/sibyte/bcm1480_regs.h
> @@ -227,10 +227,15 @@
> (A_BCM1480_DUART(chan) + \
> BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
>
> +#define DUART_IMRISR_SPACING 0x20
> +#define DUART_INCHNG_SPACING 0x10
> +
Aren't all the bits in "bcm1480_regs.h" meant to be prefixed with
BCM1480_DUART? If these are to be the same as for the BCM1250, then they
can probably be defined "in sb1250_regs.h" unconditionally.
These headers are a horrible mess anyway -- a single definition should be
enough to access the two DUARTs the BCM1480 seems to have...
Maciej
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-23 13:00 ` Maciej W. Rozycki
@ 2007-07-23 13:21 ` Ralf Baechle
2007-07-23 15:07 ` Maciej W. Rozycki
2007-07-23 13:44 ` Thiemo Seufer
1 sibling, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2007-07-23 13:21 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: Thiemo Seufer, linux-mips
On Mon, Jul 23, 2007 at 02:00:16PM +0100, Maciej W. Rozycki wrote:
> Aren't all the bits in "bcm1480_regs.h" meant to be prefixed with
> BCM1480_DUART? If these are to be the same as for the BCM1250, then they
> can probably be defined "in sb1250_regs.h" unconditionally.
>
> These headers are a horrible mess anyway -- a single definition should be
> enough to access the two DUARTs the BCM1480 seems to have...
The headers are autogenerated by Broadcom; they got some header-o-matic
which from a common source base will generate headers for Linux and
several other operating systems by adding (C) headers etc. Which makes
sorting them tricky ...
Ralf
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-23 13:21 ` Ralf Baechle
@ 2007-07-23 15:07 ` Maciej W. Rozycki
0 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2007-07-23 15:07 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Thiemo Seufer, linux-mips
On Mon, 23 Jul 2007, Ralf Baechle wrote:
> The headers are autogenerated by Broadcom; they got some header-o-matic
> which from a common source base will generate headers for Linux and
> several other operating systems by adding (C) headers etc. Which makes
> sorting them tricky ...
Well, I find it hardly an excuse... Garbage In, Garbage Out.
Maciej
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-23 13:00 ` Maciej W. Rozycki
2007-07-23 13:21 ` Ralf Baechle
@ 2007-07-23 13:44 ` Thiemo Seufer
2007-07-23 15:11 ` Maciej W. Rozycki
2007-08-24 14:32 ` Martin Michlmayr
1 sibling, 2 replies; 7+ messages in thread
From: Thiemo Seufer @ 2007-07-23 13:44 UTC (permalink / raw)
To: Maciej W. Rozycki; +Cc: linux-mips, ralf
Maciej W. Rozycki wrote:
> On Sun, 22 Jul 2007, Thiemo Seufer wrote:
>
> > diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
> > index 2738c13..c34d36b 100644
> > --- a/include/asm-mips/sibyte/bcm1480_regs.h
> > +++ b/include/asm-mips/sibyte/bcm1480_regs.h
> > @@ -227,10 +227,15 @@
> > (A_BCM1480_DUART(chan) + \
> > BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
> >
> > +#define DUART_IMRISR_SPACING 0x20
> > +#define DUART_INCHNG_SPACING 0x10
> > +
>
> Aren't all the bits in "bcm1480_regs.h" meant to be prefixed with
> BCM1480_DUART?
Appatenly not, guessing from the header's contents.
> If these are to be the same as for the BCM1250, then they
> can probably be defined "in sb1250_regs.h" unconditionally.
>
> These headers are a horrible mess anyway -- a single definition should be
> enough to access the two DUARTs the BCM1480 seems to have...
Indeed. I just took the path of least resistance to make it work again.
Thiemo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-23 13:44 ` Thiemo Seufer
@ 2007-07-23 15:11 ` Maciej W. Rozycki
2007-08-24 14:32 ` Martin Michlmayr
1 sibling, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2007-07-23 15:11 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: linux-mips, ralf
On Mon, 23 Jul 2007, Thiemo Seufer wrote:
> > Aren't all the bits in "bcm1480_regs.h" meant to be prefixed with
> > BCM1480_DUART?
>
> Appatenly not, guessing from the header's contents.
There are two or three exceptions buried indeed.
> > These headers are a horrible mess anyway -- a single definition should be
> > enough to access the two DUARTs the BCM1480 seems to have...
>
> Indeed. I just took the path of least resistance to make it work again.
Sure. :) But it looks like you merely follow the tradition here...
Maciej
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] bcm1480 serial build fix
2007-07-23 13:44 ` Thiemo Seufer
2007-07-23 15:11 ` Maciej W. Rozycki
@ 2007-08-24 14:32 ` Martin Michlmayr
1 sibling, 0 replies; 7+ messages in thread
From: Martin Michlmayr @ 2007-08-24 14:32 UTC (permalink / raw)
To: Thiemo Seufer; +Cc: Maciej W. Rozycki, linux-mips, ralf
* Thiemo Seufer <ths@networkno.de> [2007-07-23 14:44]:
> > These headers are a horrible mess anyway -- a single definition should be
> > enough to access the two DUARTs the BCM1480 seems to have...
> Indeed. I just took the path of least resistance to make it work again.
Maybe Ralf can apply it (at least for now). BCM1480 in git is
currently broken because of this.
From: Thiemo Seufer <ths@networkno.de>
Restore serial functionality for the bcm1480.
I glued this together without reading documentation, so I'm not sure if
it is fully correct. It is good enough to build a kernel and have a
working serial console.
Signed-Off-By: Thiemo Seufer <ths@networkno.de>
diff --git a/drivers/serial/sb1250-duart.c b/drivers/serial/sb1250-duart.c
index 1d9d728..e7f5c0e 100644
--- a/drivers/serial/sb1250-duart.c
+++ b/drivers/serial/sb1250-duart.c
@@ -57,6 +57,12 @@
#define SBD_CTRLREGS(line) A_BCM1480_DUART_CTRLREG((line), 0)
#define SBD_INT(line) (K_BCM1480_INT_UART_0 + (line))
+#define DUART_CHANREG_SPACING BCM1480_DUART_CHANREG_SPACING
+
+#define R_DUART_IMRREG(line) R_BCM1480_DUART_IMRREG(line)
+#define R_DUART_INCHREG(line) R_BCM1480_DUART_INCHREG(line)
+#define R_DUART_ISRREG(line) R_BCM1480_DUART_ISRREG(line)
+
#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
#include <asm/sibyte/sb1250_regs.h>
#include <asm/sibyte/sb1250_int.h>
diff --git a/include/asm-mips/sibyte/bcm1480_regs.h b/include/asm-mips/sibyte/bcm1480_regs.h
index 2738c13..c34d36b 100644
--- a/include/asm-mips/sibyte/bcm1480_regs.h
+++ b/include/asm-mips/sibyte/bcm1480_regs.h
@@ -227,10 +227,15 @@
(A_BCM1480_DUART(chan) + \
BCM1480_DUART_CHANREG_SPACING * 3 + (reg))
+#define DUART_IMRISR_SPACING 0x20
+#define DUART_INCHNG_SPACING 0x10
+
#define R_BCM1480_DUART_IMRREG(chan) \
(R_DUART_IMR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
#define R_BCM1480_DUART_ISRREG(chan) \
(R_DUART_ISR_A + ((chan) & 1) * DUART_IMRISR_SPACING)
+#define R_BCM1480_DUART_INCHREG(chan) \
+ (R_DUART_IN_CHNG_A + ((chan) & 1) * DUART_INCHNG_SPACING)
#define A_BCM1480_DUART_IMRREG(chan) \
(A_BCM1480_DUART_CTRLREG((chan), R_BCM1480_DUART_IMRREG(chan)))
--
Martin Michlmayr
http://www.cyrius.com/
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-24 14:33 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-22 7:55 [PATCH] bcm1480 serial build fix Thiemo Seufer
2007-07-23 13:00 ` Maciej W. Rozycki
2007-07-23 13:21 ` Ralf Baechle
2007-07-23 15:07 ` Maciej W. Rozycki
2007-07-23 13:44 ` Thiemo Seufer
2007-07-23 15:11 ` Maciej W. Rozycki
2007-08-24 14:32 ` Martin Michlmayr
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.