* Question about sh-sci on SH7723
@ 2009-04-08 6:40 morimoto.kuninori
2009-04-08 13:32 ` takasi-y
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-08 6:40 UTC (permalink / raw)
To: linux-sh
Hi all
I have question about sh-sci on SH7723.
There are SCSPTRx define on sh-sci.h
--------------------------------------------
#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
# define SCSPTR0 0xa4050160
# define SCSPTR1 0xa405013e
# define SCSPTR2 0xa4050160
# define SCSPTR3 0xa405013e
# define SCSPTR4 0xa4050128
# define SCSPTR5 0xa4050128
--------------------------------------------
0xa4050xxxx are IO port.
And this define is used on sci_rxd_in function.
--------------------------------------------
#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
static inline int sci_rxd_in(struct uart_port *port)
{
if (port->mapbase = 0xffe00000)
return ctrl_inb(SCSPTR0) & 0x0008 ? 1 : 0; /* SCIF0 */
if (port->mapbase = 0xffe10000)
return ctrl_inb(SCSPTR1) & 0x0020 ? 1 : 0; /* SCIF1 */
if (port->mapbase = 0xffe20000)
return ctrl_inb(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF2 */
if (port->mapbase = 0xa4e30000)
return ctrl_inb(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF3 */
if (port->mapbase = 0xa4e40000)
return ctrl_inb(SCSPTR4) & 0x0001 ? 1 : 0; /* SCIF4 */
if (port->mapbase = 0xa4e50000)
return ctrl_inb(SCSPTR5) & 0x0008 ? 1 : 0; /* SCIF5 */
return 1;
}
--------------------------------------------
This function seems check "rx break".
But, for example
------------------------------
ctrl_inb(SCSPTR0) & 0x0008 ? 1 : 0; /* SCIF0 */
------------------------------
seems return SCIF0_TXD value.
~~~
But TXD is output isn't it ?
Can we read this value though it is output ?
And why TXD ?
Can not we use SCFSR :: BRK value ?
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
@ 2009-04-08 13:32 ` takasi-y
2009-04-09 2:03 ` morimoto.kuninori
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: takasi-y @ 2009-04-08 13:32 UTC (permalink / raw)
To: linux-sh
Hi,
> I have question about sh-sci on SH7723.
...
> seems return SCIF0_TXD value.
At least, old chips like 7709/7750 have SCPTR bit multiplexed.
It returns RXD when read, sets TxD when write.
What are SCPTR bits on SH7723 like?
# I think you would better asking your boss to put the HW manual on WWW.
/yoshii
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
2009-04-08 13:32 ` takasi-y
@ 2009-04-09 2:03 ` morimoto.kuninori
2009-04-09 2:51 ` Nobuhiro Iwamatsu
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-09 2:03 UTC (permalink / raw)
To: linux-sh
Dear yoshii
Thank you for comment
> > I have question about sh-sci on SH7723.
> ...
> > seems return SCIF0_TXD value.
> At least, old chips like 7709/7750 have SCPTR bit multiplexed.
> It returns RXD when read, sets TxD when write.
Hmm.
At least 7786/7785/7763 have SCSPTR register.
It indicates RXD/TXD for me.
May be it is same as 7709/7750's SCPTR.
(I don't have these manual)
> What are SCPTR bits on SH7723 like?
But SH7723 doesn't have SCPTR/SCSPTR register.
Therefore, I thought that it used IO port.
So, I thought that it should read RXD pin if it use IO port.
> # I think you would better asking your boss to put the HW manual on WWW.
Oops !
Is SH7723's manual un-public one ?
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
2009-04-08 13:32 ` takasi-y
2009-04-09 2:03 ` morimoto.kuninori
@ 2009-04-09 2:51 ` Nobuhiro Iwamatsu
2009-04-09 4:03 ` morimoto.kuninori
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Nobuhiro Iwamatsu @ 2009-04-09 2:51 UTC (permalink / raw)
To: linux-sh
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
morimoto.kuninori@renesas.com wrote:
> Dear yoshii
>
> Thank you for comment
>
>>> I have question about sh-sci on SH7723.
>> ...
>>> seems return SCIF0_TXD value.
>> At least, old chips like 7709/7750 have SCPTR bit multiplexed.
>> It returns RXD when read, sets TxD when write.
>
> Hmm.
> At least 7786/7785/7763 have SCSPTR register.
> It indicates RXD/TXD for me.
>
> May be it is same as 7709/7750's SCPTR.
> (I don't have these manual)
You can get these from renesas website.
>
>> What are SCPTR bits on SH7723 like?
>
> But SH7723 doesn't have SCPTR/SCSPTR register.
> Therefore, I thought that it used IO port.
>
> So, I thought that it should read RXD pin if it use IO port.
>
>> # I think you would better asking your boss to put the HW manual on WWW.
>
> Oops !
> Is SH7723's manual un-public one ?
>
I think that this is coding miss.
If you check implemenation of other SH CPU's(e.g. SH7722),
you can understand that other CPU checked RXD bit.
I attached patch to fix this.
Best regards,
Nobuhiro
[-- Attachment #2: 0001-sh-Fix-rxd-check-bit-of-sci_rxd_in-for-sh7723.patch --]
[-- Type: text/plain, Size: 1798 bytes --]
From 9dcbe0f455229250daa353d6b199d6f41b457e05 Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Date: Wed, 8 Apr 2009 16:10:19 +0900
Subject: [PATCH] sh: Fix rxd check bit of sci_rxd_in for sh7723
Reported-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
---
drivers/serial/sh-sci.h | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index d0aa82d..cc51500 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -591,15 +591,15 @@ static inline int sci_rxd_in(struct uart_port *port)
static inline int sci_rxd_in(struct uart_port *port)
{
if (port->mapbase == 0xffe00000)
- return ctrl_inb(SCSPTR0) & 0x0008 ? 1 : 0; /* SCIF0 */
+ return ctrl_inb(SCSPTR0) & 0x0010 ? 1 : 0; /* SCIF0 */
if (port->mapbase == 0xffe10000)
- return ctrl_inb(SCSPTR1) & 0x0020 ? 1 : 0; /* SCIF1 */
+ return ctrl_inb(SCSPTR1) & 0x0040 ? 1 : 0; /* SCIF1 */
if (port->mapbase == 0xffe20000)
- return ctrl_inb(SCSPTR2) & 0x0001 ? 1 : 0; /* SCIF2 */
+ return ctrl_inb(SCSPTR2) & 0x0002 ? 1 : 0; /* SCIF2 */
if (port->mapbase == 0xa4e30000)
- return ctrl_inb(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF3 */
+ return ctrl_inb(SCSPTR3) & 0x0002 ? 1 : 0; /* SCIF3 */
if (port->mapbase == 0xa4e40000)
- return ctrl_inb(SCSPTR4) & 0x0001 ? 1 : 0; /* SCIF4 */
+ return ctrl_inb(SCSPTR4) & 0x0002 ? 1 : 0; /* SCIF4 */
if (port->mapbase == 0xa4e50000)
return ctrl_inb(SCSPTR5) & 0x0008 ? 1 : 0; /* SCIF5 */
return 1;
--
1.6.2.2
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (2 preceding siblings ...)
2009-04-09 2:51 ` Nobuhiro Iwamatsu
@ 2009-04-09 4:03 ` morimoto.kuninori
2009-04-09 4:25 ` morimoto.kuninori
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-09 4:03 UTC (permalink / raw)
To: linux-sh
Dear Iwamatsu
> > But SH7723 doesn't have SCPTR/SCSPTR register.
> > Therefore, I thought that it used IO port.
> >
> > So, I thought that it should read RXD pin if it use IO port.
(snip)
> I think that this is coding miss.
> If you check implemenation of other SH CPU's(e.g. SH7722),
> you can understand that other CPU checked RXD bit.
If this is a just "coding miss", I can understand !!
Thank you
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (3 preceding siblings ...)
2009-04-09 4:03 ` morimoto.kuninori
@ 2009-04-09 4:25 ` morimoto.kuninori
2009-04-09 5:53 ` Nobuhiro Iwamatsu
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-09 4:25 UTC (permalink / raw)
To: linux-sh
Dear Iwamatsu
> > I think that this is coding miss.
> > If you check implemenation of other SH CPU's(e.g. SH7722),
> > you can understand that other CPU checked RXD bit.
>
> If this is a just "coding miss", I can understand !!
> Thank you
Oops.
But Can we really read RXD status from IO port ?
Because when we use SCIF/SCIFA,
function modules is selected in PFC.
it is not IO port.
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (4 preceding siblings ...)
2009-04-09 4:25 ` morimoto.kuninori
@ 2009-04-09 5:53 ` Nobuhiro Iwamatsu
2009-04-09 7:42 ` morimoto.kuninori
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: Nobuhiro Iwamatsu @ 2009-04-09 5:53 UTC (permalink / raw)
To: linux-sh
morimoto.kuninori@renesas.com wrote:
> Dear Iwamatsu
>
>>> I think that this is coding miss.
>>> If you check implemenation of other SH CPU's(e.g. SH7722),
>>> you can understand that other CPU checked RXD bit.
>> If this is a just "coding miss", I can understand !!
>> Thank you
>
> Oops.
> But Can we really read RXD status from IO port ?
> Because when we use SCIF/SCIFA,
> function modules is selected in PFC.
> it is not IO port.
>
We set function to use in PFC and it is from IO-port
and controls them.
For example, we want to get RXD of SCIF0, setup PSELC and PTCR,
and get value from PTDR.
OK?
Best regards,
Nobuhiro
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (5 preceding siblings ...)
2009-04-09 5:53 ` Nobuhiro Iwamatsu
@ 2009-04-09 7:42 ` morimoto.kuninori
2009-04-10 5:24 ` morimoto.kuninori
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-09 7:42 UTC (permalink / raw)
To: linux-sh
Dear Iwamatsu
> We set function to use in PFC and it is from IO-port
> and controls them.
>
> For example, we want to get RXD of SCIF0, setup PSELC and PTCR,
> and get value from PTDR.
Hmm....
Now I tried to watch PxDR behavior by JTAG.
Then, I can read data from PxDR if PxCR is "I/O".
But, I can not read data when PxCR is "Function".
It is always 0x00.
I think at least clock bit will change.
Do you know why ?
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (6 preceding siblings ...)
2009-04-09 7:42 ` morimoto.kuninori
@ 2009-04-10 5:24 ` morimoto.kuninori
2009-04-15 2:52 ` Nobuhiro Iwamatsu
2009-04-16 2:56 ` Kuninori Morimoto
9 siblings, 0 replies; 11+ messages in thread
From: morimoto.kuninori @ 2009-04-10 5:24 UTC (permalink / raw)
To: linux-sh
Dear Paul, Iwamatsu
> Now I tried to watch PxDR behavior by JTAG.
> Then, I can read data from PxDR if PxCR is "I/O".
> But, I can not read data when PxCR is "Function".
> It is always 0x00.
Is checking SCFSR::BRK (SCASSR::BRK) good idea ?
It indicate rx break.
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (7 preceding siblings ...)
2009-04-10 5:24 ` morimoto.kuninori
@ 2009-04-15 2:52 ` Nobuhiro Iwamatsu
2009-04-16 2:56 ` Kuninori Morimoto
9 siblings, 0 replies; 11+ messages in thread
From: Nobuhiro Iwamatsu @ 2009-04-15 2:52 UTC (permalink / raw)
To: linux-sh
morimoto.kuninori@renesas.com wrote:
> Dear Iwamatsu
>
>> We set function to use in PFC and it is from IO-port
>> and controls them.
>>
>> For example, we want to get RXD of SCIF0, setup PSELC and PTCR,
>> and get value from PTDR.
>
> Hmm....
> Now I tried to watch PxDR behavior by JTAG.
> Then, I can read data from PxDR if PxCR is "I/O".
> But, I can not read data when PxCR is "Function".
> It is always 0x00.
> I think at least clock bit will change.
>
> Do you know why ?
>
In current code, when sci_handle_errors was called ,
sci_rxd_in seemed to come to be called it.
Did you check this?
Thanks,
Nobuhiro
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Question about sh-sci on SH7723
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
` (8 preceding siblings ...)
2009-04-15 2:52 ` Nobuhiro Iwamatsu
@ 2009-04-16 2:56 ` Kuninori Morimoto
9 siblings, 0 replies; 11+ messages in thread
From: Kuninori Morimoto @ 2009-04-16 2:56 UTC (permalink / raw)
To: linux-sh
Dear Iwamatsu
> In current code, when sci_handle_errors was called ,
> sci_rxd_in seemed to come to be called it.
> Did you check this?
OK. Now I could understand.
I think sci_rxd_in function is not called in SH7723.
This function is for SCI which can not get
rx break status from register.
Best regards
--
Kuninori Morimoto
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-04-16 2:56 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 6:40 Question about sh-sci on SH7723 morimoto.kuninori
2009-04-08 13:32 ` takasi-y
2009-04-09 2:03 ` morimoto.kuninori
2009-04-09 2:51 ` Nobuhiro Iwamatsu
2009-04-09 4:03 ` morimoto.kuninori
2009-04-09 4:25 ` morimoto.kuninori
2009-04-09 5:53 ` Nobuhiro Iwamatsu
2009-04-09 7:42 ` morimoto.kuninori
2009-04-10 5:24 ` morimoto.kuninori
2009-04-15 2:52 ` Nobuhiro Iwamatsu
2009-04-16 2:56 ` Kuninori Morimoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox