Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 1 | #ifndef HW_PLATFORM_BUS_H |
Markus Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 2 | #define HW_PLATFORM_BUS_H |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 3 | |
| 4 | /* |
| 5 | * Platform Bus device to support dynamic Sysbus devices |
| 6 | * |
| 7 | * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved. |
| 8 | * |
| 9 | * Author: Alexander Graf, <agraf@suse.de> |
| 10 | * |
| 11 | * This library is free software; you can redistribute it and/or |
| 12 | * modify it under the terms of the GNU Lesser General Public |
| 13 | * License as published by the Free Software Foundation; either |
Chetan Pant | 61f3c91 | 2020-10-23 12:44:24 +0000 | [diff] [blame] | 14 | * version 2.1 of the License, or (at your option) any later version. |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 15 | * |
| 16 | * This library is distributed in the hope that it will be useful, |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 19 | * Lesser General Public License for more details. |
| 20 | * |
| 21 | * You should have received a copy of the GNU Lesser General Public |
| 22 | * License along with this library; if not, see <http://www.gnu.org/licenses/>. |
| 23 | */ |
| 24 | |
| 25 | #include "hw/sysbus.h" |
Eduardo Habkost | db1015e | 2020-09-03 16:43:22 -0400 | [diff] [blame] | 26 | #include "qom/object.h" |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 27 | |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 28 | |
| 29 | #define TYPE_PLATFORM_BUS_DEVICE "platform-bus-device" |
Eduardo Habkost | 8063396 | 2020-09-16 14:25:19 -0400 | [diff] [blame] | 30 | OBJECT_DECLARE_SIMPLE_TYPE(PlatformBusDevice, PLATFORM_BUS_DEVICE) |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 31 | |
| 32 | struct PlatformBusDevice { |
| 33 | /*< private >*/ |
| 34 | SysBusDevice parent_obj; |
Alexander Graf | 7634fe3 | 2014-09-24 13:16:11 +0200 | [diff] [blame] | 35 | |
| 36 | /*< public >*/ |
| 37 | uint32_t mmio_size; |
| 38 | MemoryRegion mmio; |
| 39 | |
| 40 | uint32_t num_irqs; |
| 41 | qemu_irq *irqs; |
| 42 | unsigned long *used_irqs; |
| 43 | }; |
| 44 | |
| 45 | int platform_bus_get_irqn(PlatformBusDevice *platform_bus, SysBusDevice *sbdev, |
| 46 | int n); |
| 47 | hwaddr platform_bus_get_mmio_addr(PlatformBusDevice *pbus, SysBusDevice *sbdev, |
| 48 | int n); |
| 49 | |
Igor Mammedov | a3fc839 | 2018-05-10 18:10:56 +0100 | [diff] [blame] | 50 | void platform_bus_link_device(PlatformBusDevice *pbus, SysBusDevice *sbdev); |
| 51 | |
Markus Armbruster | 175de52 | 2016-06-29 15:29:06 +0200 | [diff] [blame] | 52 | #endif /* HW_PLATFORM_BUS_H */ |