j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
Author: blueswirl Date: Thu May 27 22:12:19 2010 New Revision: 788 URL: http://tracker.coreboot.org/trac/openbios/changeset/788
Log: pci: add host memory base to pci_arch_t
- sparc64 has PCI memory space at offset, therefore "ranges" property of host bridge must have different PCI and host memory addresses
Signed-off-by: Igor V. Kovalenko igor.v.kovalenko@gmail.com Signed-off-by: Blue Swirl blauwirbel@gmail.com
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c trunk/openbios-devel/arch/sparc64/openbios.c trunk/openbios-devel/drivers/pci.c trunk/openbios-devel/include/drivers/pci.h
Modified: trunk/openbios-devel/arch/ppc/qemu/init.c ============================================================================== --- trunk/openbios-devel/arch/ppc/qemu/init.c Thu May 27 22:12:16 2010 (r787) +++ trunk/openbios-devel/arch/ppc/qemu/init.c Thu May 27 22:12:19 2010 (r788) @@ -92,7 +92,8 @@ .cfg_data = 0x800c0000, .cfg_base = 0x80000000, .cfg_len = 0x00100000, - .mem_base = 0xf0000000, + .host_mem_base = 0xf0000000, + .pci_mem_base = 0xf0000000, .mem_len = 0x10000000, .io_base = 0x80000000, .io_len = 0x00010000, @@ -108,7 +109,8 @@ .cfg_data = 0xf2c00000, .cfg_base = 0xf2000000, .cfg_len = 0x02000000, - .mem_base = 0x80000000, + .host_mem_base = 0x80000000, + .pci_mem_base = 0x80000000, .mem_len = 0x10000000, .io_base = 0xf2000000, .io_len = 0x00800000, @@ -124,7 +126,8 @@ .cfg_data = 0xf0c00000, .cfg_base = 0xf0000000, .cfg_len = 0x02000000, - .mem_base = 0x80000000, + .host_mem_base = 0x80000000, + .pci_mem_base = 0x80000000, .mem_len = 0x10000000, .io_base = 0xf2000000, .io_len = 0x00800000, @@ -140,7 +143,8 @@ .cfg_data = 0xfee00000, .cfg_base = 0x80000000, .cfg_len = 0x7f000000, - .mem_base = 0x80000000, + .host_mem_base = 0x80000000, + .pci_mem_base = 0x80000000, .mem_len = 0x01000000, .io_base = 0xfe000000, .io_len = 0x00800000,
Modified: trunk/openbios-devel/arch/sparc64/openbios.c ============================================================================== --- trunk/openbios-devel/arch/sparc64/openbios.c Thu May 27 22:12:16 2010 (r787) +++ trunk/openbios-devel/arch/sparc64/openbios.c Thu May 27 22:12:19 2010 (r788) @@ -64,7 +64,8 @@ .cfg_data = APB_MEM_BASE, // PCI bus memory space .cfg_base = APB_SPECIAL_BASE, .cfg_len = 0x2000000, - .mem_base = APB_MEM_BASE, + .host_mem_base = APB_MEM_BASE, + .pci_mem_base = 0, .mem_len = 0x10000000, .io_base = APB_SPECIAL_BASE + 0x2000000ULL, // PCI Bus I/O space .io_len = 0x10000,
Modified: trunk/openbios-devel/drivers/pci.c ============================================================================== --- trunk/openbios-devel/drivers/pci.c Thu May 27 22:12:16 2010 (r787) +++ trunk/openbios-devel/drivers/pci.c Thu May 27 22:12:19 2010 (r788) @@ -455,10 +455,10 @@ ncells += host_encode_phys_addr(props + ncells, arch->rbase); ncells += pci_encode_size(props + ncells, arch->rlen); } - if (arch->mem_base) { + if (arch->host_mem_base) { ncells += pci_encode_phys_addr(props + ncells, 0, MEMORY_SPACE_32, - config->dev, 0, arch->mem_base); - ncells += host_encode_phys_addr(props + ncells, arch->mem_base); + config->dev, 0, arch->pci_mem_base); + ncells += host_encode_phys_addr(props + ncells, arch->host_mem_base); ncells += pci_encode_size(props + ncells, arch->mem_len); } set_property(dev, "ranges", (char *)props, ncells * sizeof(props[0])); @@ -1255,7 +1255,7 @@
/* Find all PCI bridges */
- mem_base = arch->mem_base; + mem_base = arch->pci_mem_base; /* I/O ports under 0x400 are used by devices mapped at fixed location. */ io_base = arch->io_base + 0x400;
Modified: trunk/openbios-devel/include/drivers/pci.h ============================================================================== --- trunk/openbios-devel/include/drivers/pci.h Thu May 27 22:12:16 2010 (r787) +++ trunk/openbios-devel/include/drivers/pci.h Thu May 27 22:12:19 2010 (r788) @@ -13,7 +13,8 @@ unsigned long cfg_data; unsigned long cfg_base; unsigned long cfg_len; - unsigned long mem_base; + unsigned long host_mem_base; /* in host memory space */ + unsigned long pci_mem_base; /* in PCI memory space */ unsigned long mem_len; unsigned long io_base; unsigned long io_len;