Lines Matching +full:irqs +full:- +full:reserved

4  * Copyright (C) 2014 Freescale Semiconductor, Inc. All rights reserved.
23 #include "hw/platform-bus.h"
24 #include "hw/qdev-properties.h"
26 #include "qemu/error-report.h"
31 * Returns the PlatformBus IRQ number for a SysBusDevice irq number or -1 if
40 for (i = 0; i < pbus->num_irqs; i++) { in platform_bus_get_irqn()
41 if (pbus->irqs[i] == sbirq) { in platform_bus_get_irqn()
47 return -1; in platform_bus_get_irqn()
52 * -1 if the region is not mapped on this Platform bus.
57 MemoryRegion *pbus_mr = &pbus->mmio; in platform_bus_get_mmio_addr()
64 return -1; in platform_bus_get_mmio_addr()
71 return -1; in platform_bus_get_mmio_addr()
89 for (i = 0; i < pbus->num_irqs; i++) { in platform_bus_count_irqs()
90 if (pbus->irqs[i] == sbirq) { in platform_bus_count_irqs()
91 bitmap_set(pbus->used_irqs, i, 1); in platform_bus_count_irqs()
104 bitmap_zero(pbus->used_irqs, pbus->num_irqs); in plaform_bus_refresh_irqs()
111 int max_irqs = pbus->num_irqs; in platform_bus_map_irq()
119 irqn = find_first_zero_bit(pbus->used_irqs, max_irqs); in platform_bus_map_irq()
125 set_bit(irqn, pbus->used_irqs); in platform_bus_map_irq()
126 sysbus_connect_irq(sbdev, n, pbus->irqs[irqn]); in platform_bus_map_irq()
134 uint64_t alignment = (1ULL << (63 - clz64(size + size - 1))); in platform_bus_map_mmio()
147 for (off = 0; off < pbus->mmio_size; off += alignment) { in platform_bus_map_mmio()
148 MemoryRegion *mr = memory_region_find(&pbus->mmio, off, size).mr; in platform_bus_map_mmio()
164 memory_region_add_subregion(&pbus->mmio, off, sbdev_mr); in platform_bus_map_mmio()
193 memory_region_init(&pbus->mmio, OBJECT(dev), "platform bus", in platform_bus_realize()
194 pbus->mmio_size); in platform_bus_realize()
195 sysbus_init_mmio(d, &pbus->mmio); in platform_bus_realize()
197 pbus->used_irqs = bitmap_new(pbus->num_irqs); in platform_bus_realize()
198 pbus->irqs = g_new0(qemu_irq, pbus->num_irqs); in platform_bus_realize()
199 for (i = 0; i < pbus->num_irqs; i++) { in platform_bus_realize()
200 sysbus_init_irq(d, &pbus->irqs[i]); in platform_bus_realize()
203 /* some devices might be initialized before so update used IRQs map */ in platform_bus_realize()
217 dc->realize = platform_bus_realize; in platform_bus_class_init()