| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * QEMU PCI bridge | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Copyright (c) 2004 Fabrice Bellard | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is free software; you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU General Public License as published by | 
					
						
							|  |  |  |  * the Free Software Foundation; either version 2 of the License, or | 
					
						
							|  |  |  |  * (at your option) any later version. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							|  |  |  |  * GNU General Public License for more details. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * You should have received a copy of the GNU General Public License | 
					
						
							|  |  |  |  * along with this program; if not, write to the Free Software | 
					
						
							|  |  |  |  * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * split out pci bus specific stuff from pci.[hc] to pci_bridge.[hc] | 
					
						
							|  |  |  |  * Copyright (c) 2009 Isaku Yamahata <yamahata at valinux co jp> | 
					
						
							|  |  |  |  *                    VA Linux Systems Japan K.K. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef QEMU_PCI_BRIDGE_H
 | 
					
						
							|  |  |  | #define QEMU_PCI_BRIDGE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-12-12 23:05:42 +02:00
										 |  |  | #include "hw/pci/pci.h"
 | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-06 16:46:17 +09:00
										 |  |  | int pci_bridge_ssvid_init(PCIDevice *dev, uint8_t offset, | 
					
						
							|  |  |  |                           uint16_t svid, uint16_t ssid); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | PCIDevice *pci_bridge_get_device(PCIBus *bus); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:42 +09:00
										 |  |  | PCIBus *pci_bridge_get_sec_bus(PCIBridge *br); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:42 +09:00
										 |  |  | pcibus_t pci_bridge_get_base(const PCIDevice *bridge, uint8_t type); | 
					
						
							|  |  |  | pcibus_t pci_bridge_get_limit(const PCIDevice *bridge, uint8_t type); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-07-09 11:40:02 -04:00
										 |  |  | void pci_bridge_update_mappings(PCIBridge *br); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:42 +09:00
										 |  |  | void pci_bridge_write_config(PCIDevice *d, | 
					
						
							|  |  |  |                              uint32_t address, uint32_t val, int len); | 
					
						
							| 
									
										
										
										
											2010-10-20 17:18:51 +09:00
										 |  |  | void pci_bridge_disable_base_limit(PCIDevice *dev); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:42 +09:00
										 |  |  | void pci_bridge_reset_reg(PCIDevice *dev); | 
					
						
							|  |  |  | void pci_bridge_reset(DeviceState *qdev); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-14 16:01:11 -06:00
										 |  |  | int pci_bridge_initfn(PCIDevice *pci_dev, const char *typename); | 
					
						
							| 
									
										
										
										
											2012-07-03 22:39:27 -06:00
										 |  |  | void pci_bridge_exitfn(PCIDevice *pci_dev); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:42 +09:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /*
 | 
					
						
							|  |  |  |  * before qdev initialization(qdev_init()), this function sets bus_name and | 
					
						
							|  |  |  |  * map_irq callback which are necessry for pci_bridge_initfn() to | 
					
						
							|  |  |  |  * initialize bus. | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | void pci_bridge_map_irq(PCIBridge *br, const char* bus_name, | 
					
						
							|  |  |  |                         pci_map_irq_fn map_irq); | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-03-04 11:23:49 +02:00
										 |  |  | /* TODO: add this define to pci_regs.h in linux and then in qemu. */ | 
					
						
							|  |  |  | #define  PCI_BRIDGE_CTL_VGA_16BIT	0x10	/* VGA 16-bit decode */
 | 
					
						
							|  |  |  | #define  PCI_BRIDGE_CTL_DISCARD		0x100	/* Primary discard timer */
 | 
					
						
							|  |  |  | #define  PCI_BRIDGE_CTL_SEC_DISCARD	0x200	/* Secondary discard timer */
 | 
					
						
							|  |  |  | #define  PCI_BRIDGE_CTL_DISCARD_STATUS	0x400	/* Discard timer status */
 | 
					
						
							|  |  |  | #define  PCI_BRIDGE_CTL_DISCARD_SERR	0x800	/* Discard timer SERR# enable */
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-07-13 13:01:39 +09:00
										 |  |  | #endif  /* QEMU_PCI_BRIDGE_H */
 |