1*7634fe3cSAlexander Graf #ifndef HW_PLATFORM_BUS_H 2*7634fe3cSAlexander Graf #define HW_PLATFORM_BUS_H 1 3*7634fe3cSAlexander Graf 4*7634fe3cSAlexander Graf /* 5*7634fe3cSAlexander Graf * Platform Bus device to support dynamic Sysbus devices 6*7634fe3cSAlexander Graf * 7*7634fe3cSAlexander Graf * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved. 8*7634fe3cSAlexander Graf * 9*7634fe3cSAlexander Graf * Author: Alexander Graf, <agraf@suse.de> 10*7634fe3cSAlexander Graf * 11*7634fe3cSAlexander Graf * This library is free software; you can redistribute it and/or 12*7634fe3cSAlexander Graf * modify it under the terms of the GNU Lesser General Public 13*7634fe3cSAlexander Graf * License as published by the Free Software Foundation; either 14*7634fe3cSAlexander Graf * version 2 of the License, or (at your option) any later version. 15*7634fe3cSAlexander Graf * 16*7634fe3cSAlexander Graf * This library is distributed in the hope that it will be useful, 17*7634fe3cSAlexander Graf * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*7634fe3cSAlexander Graf * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19*7634fe3cSAlexander Graf * Lesser General Public License for more details. 20*7634fe3cSAlexander Graf * 21*7634fe3cSAlexander Graf * You should have received a copy of the GNU Lesser General Public 22*7634fe3cSAlexander Graf * License along with this library; if not, see <http://www.gnu.org/licenses/>. 23*7634fe3cSAlexander Graf */ 24*7634fe3cSAlexander Graf 25*7634fe3cSAlexander Graf #include "hw/sysbus.h" 26*7634fe3cSAlexander Graf 27*7634fe3cSAlexander Graf typedef struct PlatformBusDevice PlatformBusDevice; 28*7634fe3cSAlexander Graf 29*7634fe3cSAlexander Graf #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" 30*7634fe3cSAlexander Graf #define PLATFORM_BUS_DEVICE(obj) \ 31*7634fe3cSAlexander Graf OBJECT_CHECK(PlatformBusDevice, (obj), TYPE_PLATFORM_BUS_DEVICE) 32*7634fe3cSAlexander Graf #define PLATFORM_BUS_DEVICE_CLASS(klass) \ 33*7634fe3cSAlexander Graf OBJECT_CLASS_CHECK(PlatformBusDeviceClass, (klass), TYPE_PLATFORM_BUS_DEVICE) 34*7634fe3cSAlexander Graf #define PLATFORM_BUS_DEVICE_GET_CLASS(obj) \ 35*7634fe3cSAlexander Graf OBJECT_GET_CLASS(PlatformBusDeviceClass, (obj), TYPE_PLATFORM_BUS_DEVICE) 36*7634fe3cSAlexander Graf 37*7634fe3cSAlexander Graf struct PlatformBusDevice { 38*7634fe3cSAlexander Graf /*< private >*/ 39*7634fe3cSAlexander Graf SysBusDevice parent_obj; 40*7634fe3cSAlexander Graf Notifier notifier; 41*7634fe3cSAlexander Graf bool done_gathering; 42*7634fe3cSAlexander Graf 43*7634fe3cSAlexander Graf /*< public >*/ 44*7634fe3cSAlexander Graf uint32_t mmio_size; 45*7634fe3cSAlexander Graf MemoryRegion mmio; 46*7634fe3cSAlexander Graf 47*7634fe3cSAlexander Graf uint32_t num_irqs; 48*7634fe3cSAlexander Graf qemu_irq *irqs; 49*7634fe3cSAlexander Graf unsigned long *used_irqs; 50*7634fe3cSAlexander Graf }; 51*7634fe3cSAlexander Graf 52*7634fe3cSAlexander Graf int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev, 53*7634fe3cSAlexander Graf int n); 54*7634fe3cSAlexander Graf hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev, 55*7634fe3cSAlexander Graf int n); 56*7634fe3cSAlexander Graf 57*7634fe3cSAlexander Graf #endif /* !HW_PLATFORM_BUS_H */ 58