SH4: SCI improvement
Subsystems (2)
PATCH 1/1 SH4: SCI improvement
This patch simply implement one register of SH4's SCI := Serial Communication Interface.
R2D evaluation board uses SCI for SPI connection. So, Linux kernel for R2D with default configuration causes a QEMU assertion failure when it initializes SPI driver. This patch avoids it and reduces the kernel config modification work for QEMU.
Completing SCI implementation task is left. Other board support is desirable to confirm this task, which uses SCI for a serial terminal.
Regards,
Shin-ichiro KAWASAKI
hw/sh_serial.c +6 -6
@@ -168,19 +168,19 @@ } }else { +switch (offs) {#if 0 -switch (offs) {case 0x0c : ret = s->dr;break ;case 0x10 : ret =0 ;break ; +#endif case 0x1c : - ret = s->sptr; -break ; + s->sptr = val &0x8f ; +return ; } -#endif }fprintf (stderr,"sh_serial: unsupported write to 0x%02x\n" , offs);
@@ -260,8 +260,8 @@ } }else { +switch (offs) {#if 0 -switch (offs) {case 0x0c : ret = s->dr;break ;
@@ -271,11 +271,11 @@case 0x14 : ret = s->rx_fifo[0 ];break ; +#endif case 0x1c : ret = s->sptr;break ; } -#endif }#ifdef DEBUG_SERIAL printf("sh_serial: read base=0x%08lx offs=0x%02x val=0x%x\n",
hi Shin-san,
I'm trying to use u-boot with qemu on the r2d but I've the following problem maybe you can help me.
I've add the flash support at 0xA0000000
and have qemu refusing to boot from it
qemu: fatal: Trying to execute code outside RAM or ROM at 0xa000000A
I've also try to boot u-boot as a kernel and have the output working but not the input. Impossible to type anything
U-Boot 2008.10-00237-g6d56cf3 (Nov 23 2008 - 21:08:17)
CPU: SH4
BOARD: Renesas Solutions R2D Plus
DRAM: 64MB
Timer with period zero, disabling
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
FLASH: 0MB
*** Warning - bad CRC, using default environment
In: serial Out: serial Err: serial Net: No ethernet found.
=>
Best Regards,
J.
Hi, Jean-san!
It seems a good idea to make u-boot run on SH4-QEMU, for brushing up SH4 emulation.
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
I've add the flash support at
0xA0000000
and have qemu refusing to boot from it
qemu: fatal: Trying to execute code outside RAM or ROM at0xa000000AI've also try to boot u-boot as a kernel and have the output working but not the input. Impossible to type anything
I'm afraid that I have no idea about these two points now.
I just guess MMU emulation and SCIF emulation might not be enough to run u-boot.
To investigate them more closely, I downloaded current u-boot git repository, build if for r2d, and run u-boot.bin with -kernel option. But u-boot couldn't boot with assertion failures. Following two parts caused them.
- MMUCR initialization with 16 bit word write causes failure. QEMU only implements 32 bit write for it, following SH7750 document.
- BSC's PCR access cause failure.
QEMU does not implement it yet.
Have you handled them?
Regards,
Shin-ichiro KAWASAKI
Quoted 19 lines
U-Boot 2008.10-00237-g6d56cf3 (Nov 23 2008 - 21:08:17)
CPU: SH4
BOARD: Renesas Solutions R2D Plus
DRAM: 64MB
Timer with period zero, disabling
## Unknown FLASH on Bank 1 - Size =0x00000000= 0 MB
FLASH: 0MB
*** Warning - bad CRC, using default environmentIn: serial Out: serial Err: serial Net: No ethernet found.=>
Best Regards,
J.
Quoted 20 lines · Shin-ichiro KAWASAKI
Hi, Jean-san!
It seems a good idea to make u-boot run on SH4-QEMU, for brushing up SH4 emulation.
Quoted 6 lines · Jean-Christophe PLAGNIOL-VILLARD
I've add the flash support at
0xA0000000
and have qemu refusing to boot from it
qemu: fatal: Trying to execute code outside RAM or ROM at0xa000000AI've also try to boot u-boot as a kernel and have the output working but not the input. Impossible to type anything
I'm afraid that I have no idea about these two points now.
I just guess MMU emulation and SCIF emulation might not be enough to run u-boot.To investigate them more closely, I downloaded current u-boot git repository, build if for r2d, and run u-boot.bin with -kernel option. But u-boot couldn't boot with assertion failures. Following two parts caused them.
Quoted 6 lines
- MMUCR initialization with 16 bit word write causes failure. QEMU only implements 32 bit write for it, following SH7750 document.
- BSC's PCR access cause failure. QEMU does not implement it yet.Have you handled them?
you need to apply 1 patch on u-boot
r2dplus fix register access
I've send to the U-Boot ML
and 2 patchs to qemu
Quoted 1 line
From you
sh4: pci and mmu support
and from I
SH7750/51: add register BCR3, NCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 support
Best Regards,
J.
Quoted 1 line
From
54e5318dbc1beb1eb37843dc94331ce2d6d48f60Mon Sep 17 00:00:00 2001
From: Jean-Christophe PLAGNIOL-VILLARD <[email protected]>
Date: Thu, 4 Dec 2008 13:24:00 +0100
Subject: [PATCH] r2dplus fix register access
--- board/renesas/r2dplus/lowlevel_init.S | 2 +- drivers/pci/pci_sh7751.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
board/renesas/r2dplus/lowlevel_init.S +1 -1
@@ -21,7 +21,7 @@ lowlevel_init: mov.l MMUCR_A,r1 mov.l MMUCR_D,r0 - mov.w r0,@r1 + mov.l r0,@r1 mov.l BCR1_A,r1 mov.l BCR1_D,r0
drivers/pci/pci_sh7751.c +2 -2
@@ -187,8 +187,8 @@ int pci_sh7751_init(struct pci_controller *hose)/* Copy BSC registers into PCI BSC */ p4_out (inl (SH7751_BCR1 ),SH7751_PCIBCR1 ); -p4_out (inl (SH7751_BCR2 ),SH7751_PCIBCR2 ); -p4_out (inl (SH7751_BCR3 ),SH7751_PCIBCR3 ); +p4_out (inw (SH7751_BCR2 ),SH7751_PCIBCR2 ); +p4_out (inw (SH7751_BCR3 ),SH7751_PCIBCR3 );p4_out (inl (SH7751_WCR1 ),SH7751_PCIWCR1 );p4_out (inl (SH7751_WCR2 ),SH7751_PCIWCR2 );p4_out (inl (SH7751_WCR3 ),SH7751_PCIWCR3 );
Signature · 1 line
1.5.6.5
Quoted 30 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 18 lines · Shin-ichiro KAWASAKI
Hi, Jean-san!
It seems a good idea to make u-boot run on SH4-QEMU, for brushing up SH4 emulation.
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
I've add the flash support at
0xA0000000
and have qemu refusing to boot from it
qemu: fatal: Trying to execute code outside RAM or ROM at0xa000000AI've also try to boot u-boot as a kernel and have the output working but not the input. Impossible to type anythingI'm afraid that I have no idea about these two points now.
I just guess MMU emulation and SCIF emulation might not be enough to run u-boot.To investigate them more closely, I downloaded current u-boot git repository, build if for r2d, and run u-boot.bin with -kernel option. But u-boot couldn't boot with assertion failures. Following two parts caused them.
Quoted 6 lines
- MMUCR initialization with 16 bit word write causes failure. QEMU only implements 32 bit write for it, following SH7750 document.
- BSC's PCR access cause failure. QEMU does not implement it yet.Have you handled them?
you need to apply 1 patch on u-boot
r2dplus fix register access
I've send to the U-Boot ML
Quoted 7 lines
and 2 patchs to qemu
Quoted 1 line
From you
sh4: pci and mmu support
and from I
SH7750/51: add register BCR3, NCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 support
Thanks.
One more simple modification seems necessary to avoid assertion error, as attached to this mail. With these patches, I saw that the U-boot for r2dplus boots cleanly when it is passed with -kernel option to qemu. Does it help you?
# Please be sure to give two '-serial' options in qemu command line.
I'm interested in the flash support, which will make it more easy to handle linux kernel boot conditions for qemu-sh users.
Regards,
Shin-ichiro KAWASAKI
hw/sh_serial.c +0 -2
@@ -242,11 +242,9 @@ static uint32_t sh_serial_ioport_read(void *opaque, uint32_t offs) s->flags &= ~SH_SERIAL_FLAG_RDF ; }break ; -#if 0 case 0x18 : ret = s->fcr;break ; -#endif case 0x1c : ret = s->rx_cnt;break ;
Quoted 41 lines · Shin-ichiro KAWASAKI
Quoted 30 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 18 lines · Shin-ichiro KAWASAKI
Hi, Jean-san!
It seems a good idea to make u-boot run on SH4-QEMU, for brushing up SH4 emulation.
Quoted 5 lines · Jean-Christophe PLAGNIOL-VILLARD
I've add the flash support at
0xA0000000
and have qemu refusing to boot from it
qemu: fatal: Trying to execute code outside RAM or ROM at0xa000000AI've also try to boot u-boot as a kernel and have the output working but not the input. Impossible to type anythingI'm afraid that I have no idea about these two points now.
I just guess MMU emulation and SCIF emulation might not be enough to run u-boot.To investigate them more closely, I downloaded current u-boot git repository, build if for r2d, and run u-boot.bin with -kernel option. But u-boot couldn't boot with assertion failures. Following two parts caused them.
Quoted 6 lines
- MMUCR initialization with 16 bit word write causes failure. QEMU only implements 32 bit write for it, following SH7750 document.
- BSC's PCR access cause failure. QEMU does not implement it yet.Have you handled them?
you need to apply 1 patch on u-boot
r2dplus fix register access
I've send to the U-Boot MLQuoted 7 lines
and 2 patchs to qemu
Quoted 1 line
From you
sh4: pci and mmu support
and from I
SH7750/51: add register BCR3, NCR4, PCR, RTCOR, RTCNT, RTCSR, SDMR2, SDMR3 and fix BCR2 supportThanks.
Quoted 8 lines
One more simple modification seems necessary to avoid assertion error, as attached to this mail. With these patches, I saw that the U-boot for r2dplus boots cleanly when it is passed with -kernel option to qemu. Does it help you?
# Please be sure to give two '-serial' options in qemu command line.I'm interested in the flash support, which will make it more easy to handle linux kernel boot conditions for qemu-sh users.
I've add it but I need to add the 0xa0000000 accessible Maybe Yoshii-san have a patch about it
Best Regards,
J.
Aurelien Jarno
AppliedQuoted 11 lines · Shin-ichiro KAWASAKI
This patch simply implement one register of SH4's SCI := Serial Communication Interface.
R2D evaluation board uses SCI for SPI connection. So, Linux kernel for R2D with default configuration causes a QEMU assertion failure when it initializes SPI driver. This patch avoids it and reduces the kernel config modification work for QEMU.
Completing SCI implementation task is left. Other board support is desirable to confirm this task, which uses SCI for a serial terminal.
Regards,
Shin-ichiro KAWASAKI
Thanks, applied.
Quoted 56 lines
Signed-off-by Shin-ichiro KAWASAKI <[email protected]>Index:
trunk/hw/sh_serial.c
===================================================================hw/sh_serial.c +6
-6@@ -168,19 +168,19 @@ } }else { +switch (offs) {#if 0 -switch (offs) {case 0x0c : ret = s->dr;break ;case 0x10 : ret =0 ;break ; +#endif case 0x1c : - ret = s->sptr; -break ; + s->sptr = val &0x8f ; +return ; } -#endif }fprintf (stderr,"sh_serial: unsupported write to 0x%02x\n" , offs);@@ -260,8 +260,8 @@ } }else { +switch (offs) {#if 0 -switch (offs) {case 0x0c : ret = s->dr;break ;@@ -271,11 +271,11 @@case 0x14 : ret = s->rx_fifo[0 ];break ; +#endif case 0x1c : ret = s->sptr;break ; } -#endif }#ifdef DEBUG_SERIAL printf("sh_serial: read base=0x%08lx offs=0x%02x val=0x%x\n",
Signature · 4 lines
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [email protected] | [email protected] `- people.debian.org/~aurel32 | www.aurel32.net
Quoted 6 lines · Shin-ichiro KAWASAKI
This patch simply implement one register of SH4's SCI := Serial Communication Interface.
R2D evaluation board uses SCI for SPI connection. So, Linux kernel for R2D with default configuration causes a QEMU assertion failure when it initializes SPI driver. This patch avoids it and reduces the kernel config modification work for QEMU.
Quoted 9 lines
Completing SCI implementation task is left. Other board support is desirable to confirm this task, which uses SCI for a serial terminal.
Regards,
Shin-ichiro KAWASAKISigned-off-by Shin-ichiro KAWASAKI <[email protected]>
After this, are you able to use the standard defconfig for R2D? If so, I can kill off the qemu defconfig in-tree. If not, please send updates for the qemu defconfig so we can make sure that the kernel and the qemu tree are in sync with regards to feature completeness.
Quoted 10 lines · Paul Mundt
Quoted 9 lines · Shin-ichiro KAWASAKI
This patch simply implement one register of SH4's SCI := Serial Communication Interface.
R2D evaluation board uses SCI for SPI connection. So, Linux kernel for R2D with default configuration causes a QEMU assertion failure when it initializes SPI driver. This patch avoids it and reduces the kernel config modification work for QEMU.
Completing SCI implementation task is left. Other board support is desirable to confirm this task, which uses SCI for a serial terminal.
Quoted 7 lines
Quoted 6 lines
Regards,
Shin-ichiro KAWASAKISigned-off-by Shin-ichiro KAWASAKI <[email protected]>After this, are you able to use the standard defconfig for R2D?
Yes. With current QEMU svn HEAD, we can use rts7751r2dplus_defconfig with no kernel halts nor segmentation fault.
# USB and NIC are not available, but drivers for them cause no drawbacks.
Quoted 4 lines
If so, I
can kill off the qemu defconfig in-tree. If not, please send updates for the qemu defconfig so we can make sure that the kernel and the qemu tree are in sync with regards to feature completeness.
I think the qemu defconfig's role is over.
It's earlier than I expected. Thank you all!
Regards,
Shin-ichiro KAWASAKI