17634fe3cSAlexander Graf #ifndef HW_PLATFORM_BUS_H 2175de524SMarkus Armbruster #define HW_PLATFORM_BUS_H 37634fe3cSAlexander Graf 47634fe3cSAlexander Graf /* 57634fe3cSAlexander Graf * Platform Bus device to support dynamic Sysbus devices 67634fe3cSAlexander Graf * 77634fe3cSAlexander Graf * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved. 87634fe3cSAlexander Graf * 97634fe3cSAlexander Graf * Author: Alexander Graf, <agraf@suse.de> 107634fe3cSAlexander Graf * 117634fe3cSAlexander Graf * This library is free software; you can redistribute it and/or 127634fe3cSAlexander Graf * modify it under the terms of the GNU Lesser General Public 137634fe3cSAlexander Graf * License as published by the Free Software Foundation; either 14*61f3c91aSChetan Pant * version 2.1 of the License, or (at your option) any later version. 157634fe3cSAlexander Graf * 167634fe3cSAlexander Graf * This library is distributed in the hope that it will be useful, 177634fe3cSAlexander Graf * but WITHOUT ANY WARRANTY; without even the implied warranty of 187634fe3cSAlexander Graf * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 197634fe3cSAlexander Graf * Lesser General Public License for more details. 207634fe3cSAlexander Graf * 217634fe3cSAlexander Graf * You should have received a copy of the GNU Lesser General Public 227634fe3cSAlexander Graf * License along with this library; if not, see <http://www.gnu.org/licenses/>. 237634fe3cSAlexander Graf */ 247634fe3cSAlexander Graf 257634fe3cSAlexander Graf #include "hw/sysbus.h" 26db1015e9SEduardo Habkost #include "qom/object.h" 277634fe3cSAlexander Graf 287634fe3cSAlexander Graf 297634fe3cSAlexander Graf #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" 308063396bSEduardo Habkost OBJECT_DECLARE_SIMPLE_TYPE(PlatformBusDevice, PLATFORM_BUS_DEVICE) 317634fe3cSAlexander Graf 327634fe3cSAlexander Graf struct PlatformBusDevice { 337634fe3cSAlexander Graf /*< private >*/ 347634fe3cSAlexander Graf SysBusDevice parent_obj; 357634fe3cSAlexander Graf 367634fe3cSAlexander Graf /*< public >*/ 377634fe3cSAlexander Graf uint32_t mmio_size; 387634fe3cSAlexander Graf MemoryRegion mmio; 397634fe3cSAlexander Graf 407634fe3cSAlexander Graf uint32_t num_irqs; 417634fe3cSAlexander Graf qemu_irq *irqs; 427634fe3cSAlexander Graf unsigned long *used_irqs; 437634fe3cSAlexander Graf }; 447634fe3cSAlexander Graf 457634fe3cSAlexander Graf int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev, 467634fe3cSAlexander Graf int n); 477634fe3cSAlexander Graf hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev, 487634fe3cSAlexander Graf int n); 497634fe3cSAlexander Graf 50a3fc8396SIgor Mammedov void platform_bus_link_device(PlatformBusDevice *pbus, SysBusDevice *sbdev); 51a3fc8396SIgor Mammedov 52175de524SMarkus Armbruster #endif /* HW_PLATFORM_BUS_H */ 53