[5927] SH: On-chip PCI controller support (Takashi YOSHII).
Revision: 5927
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5927 Author: balrog Date: 2008-12-07 19:08:45 +0000 (Sun, 07 Dec 2008)
Log Message:
-----------
SH: On-chip PCI controller support (Takashi YOSHII).
This patch adds SuperH on-chip PCI controller(PCIC) support.
Modified Paths:
--------------
trunk/Makefile.target
trunk/target-sh4/helper.c
Added Paths:
-----------
trunk/hw/sh_pci.c
Modified: trunk/Makefile.target
===================================================================
Makefile.target +1 -1
@@ -710,7 +710,7 @@ endif ifeq ($(TARGET_BASE_ARCH), sh4) OBJS+= shix.o r2d.o sh7750.o sh7750_regnames.o tc58128.o -OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sm501.o serial.o +OBJS+= sh_timer.o ptimer.o sh_serial.o sh_intc.o sh_pci.o sm501.o serial.o OBJS+= ide.o endif ifeq ($(TARGET_BASE_ARCH), m68k)
Added: trunk/hw/sh_pci.c
===================================================================
hw/sh_pci.c +207 -0
207 lines not on this page · raw message
Modified: trunk/target-sh4/helper.c
===================================================================
target-sh4/helper.c +3 -0
@@ -439,6 +439,9 @@if (address >=0x80000000 && address <0xc0000000 ) {/* Mask upper 3 bits for P1 and P2 areas */ *physical = address &0x1fffffff ; + }else if (address >=0xfd000000 && address <0xfe000000 ) { +/* PCI memory space */ + *physical = address; }else if (address >=0xfc000000 ) {/* * Mask upper 3 bits for control registers in P4 area,
PATCH 1/1 sh4: sh_pci. Register resouces both at A7 and P4.
Add resource registration both for P4 and A7.
This is needed because of #5935 SH4: Eliminate P4 to A7 mangling. Additionally, {reg,iop,mem}base which is no longer used are removed.
--- hw/sh_pci.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)
hw/sh_pci.c +7 -10
@@ -29,9 +29,6 @@ typedef struct { PCIBus *bus; PCIDevice *dev; - uint32_t regbase; - uint32_t iopbase; - uint32_t membase; uint32_t par; uint32_t mbr; uint32_t iobr;
@@ -181,15 +178,15 @@ PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, p->dev =pci_register_device (p->bus,"SH PCIC" ,sizeof (PCIDevice),-1 ,NULL ,NULL ); - p->regbase =0x1e200000 ; - p->iopbase =0x1e240000 ; - p->membase =0xfd000000 ; reg =cpu_register_io_memory (0 , sh_pci_reg.r, sh_pci_reg.w, p); - mem =cpu_register_io_memory (0 , sh_pci_mem.r, sh_pci_mem.w, p); iop =cpu_register_io_memory (0 , sh_pci_iop.r, sh_pci_iop.w, p); -cpu_register_physical_memory (p->regbase,0x224 , reg); -cpu_register_physical_memory (p->iopbase,0x40000 , iop); -cpu_register_physical_memory (p->membase,0x1000000 , mem); + mem =cpu_register_io_memory (0 , sh_pci_mem.r, sh_pci_mem.w, p); +cpu_register_physical_memory (0x1e200000 ,0x224 , reg); +cpu_register_physical_memory (0x1e240000 ,0x40000 , iop); +cpu_register_physical_memory (0x1d000000 ,0x1000000 , mem); +cpu_register_physical_memory (0xfe200000 ,0x224 , reg); +cpu_register_physical_memory (0xfe240000 ,0x40000 , iop); +cpu_register_physical_memory (0xfd000000 ,0x1000000 , mem); p->dev->config[0x00 ] =0x54 ;// HITACHI p->dev->config[0x01 ] =0x10 ;//
Signature · 4 lines
1.5.6.3 /yoshii
Re: [Qemu-devel] [PATCH] sh4: sh_pci. Register resouces both at A7 and P4.
Quoted 5 lines · On 03:08 Mon 15 Dec , [email protected] wrote:
Add resource registration both for P4 and A7.
This is needed because of #5935 SH4: Eliminate P4 to A7 mangling. Additionally, {reg,iop,mem}base which is no longer used are removed.Signed-off-by Takashi YOSHII <[email protected]>
Tested with u-boot and works
Best Regards,
J.
Aurelien Jarno
AppliedRe: [Qemu-devel] [PATCH] sh4: sh_pci. Register resouces both at A7 and P4.
In reply to [email protected]Quoted 8 lines · On Mon, Dec 15, 2008 at 03:08:34AM +0900, [email protected] wrote:
Add resource registration both for P4 and A7.
This is needed because of #5935 SH4: Eliminate P4 to A7 mangling. Additionally, {reg,iop,mem}base which is no longer used are removed.Signed-off-by Takashi YOSHII <[email protected]>--- hw/sh_pci.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-)
Thanks, applied.
Quoted 45 lines
hw/sh_pci.c +7
-10@@ -29,9 +29,6 @@ typedef struct { PCIBus *bus; PCIDevice *dev; - uint32_t regbase; - uint32_t iopbase; - uint32_t membase; uint32_t par; uint32_t mbr; uint32_t iobr;@@ -181,15 +178,15 @@ PCIBus *sh_pci_register_bus(pci_set_irq_fn set_irq, pci_map_irq_fn map_irq, p->dev =pci_register_device (p->bus,"SH PCIC" ,sizeof (PCIDevice),-1 ,NULL ,NULL ); - p->regbase =0x1e200000 ; - p->iopbase =0x1e240000 ; - p->membase =0xfd000000 ; reg =cpu_register_io_memory (0 , sh_pci_reg.r, sh_pci_reg.w, p); - mem =cpu_register_io_memory (0 , sh_pci_mem.r, sh_pci_mem.w, p); iop =cpu_register_io_memory (0 , sh_pci_iop.r, sh_pci_iop.w, p); -cpu_register_physical_memory (p->regbase,0x224 , reg); -cpu_register_physical_memory (p->iopbase,0x40000 , iop); -cpu_register_physical_memory (p->membase,0x1000000 , mem); + mem =cpu_register_io_memory (0 , sh_pci_mem.r, sh_pci_mem.w, p); +cpu_register_physical_memory (0x1e200000 ,0x224 , reg); +cpu_register_physical_memory (0x1e240000 ,0x40000 , iop); +cpu_register_physical_memory (0x1d000000 ,0x1000000 , mem); +cpu_register_physical_memory (0xfe200000 ,0x224 , reg); +cpu_register_physical_memory (0xfe240000 ,0x40000 , iop); +cpu_register_physical_memory (0xfd000000 ,0x1000000 , mem); p->dev->config[0x00 ] =0x54 ;// HITACHI p->dev->config[0x01 ] =0x10 ;// Signature · 4 lines
1.5.6.3 /yoshii
Signature · 2 lines
Aurelien Jarno GPG: 1024D/F1BCDB73 [email protected] http://www.aurel32.net