Lines Matching +full:coresight +full:- +full:stm

1 /*-
81 switch (res->Type) { in acpi_lookup_irq_handler()
83 irqnum = res->Data.Irq.InterruptCount; in acpi_lookup_irq_handler()
85 if (res->Data.Irq.Interrupts[i] == req->irq) { in acpi_lookup_irq_handler()
91 trig = res->Data.Irq.Triggering; in acpi_lookup_irq_handler()
92 pol = res->Data.Irq.Polarity; in acpi_lookup_irq_handler()
95 irqnum = res->Data.ExtendedIrq.InterruptCount; in acpi_lookup_irq_handler()
97 if (res->Data.ExtendedIrq.Interrupts[i] == req->irq) { in acpi_lookup_irq_handler()
103 trig = res->Data.ExtendedIrq.Triggering; in acpi_lookup_irq_handler()
104 pol = res->Data.ExtendedIrq.Polarity; in acpi_lookup_irq_handler()
111 if (req->checkrid) { in acpi_lookup_irq_handler()
112 if (req->counter != req->rid) { in acpi_lookup_irq_handler()
113 req->counter++; in acpi_lookup_irq_handler()
117 req->found = 1; in acpi_lookup_irq_handler()
118 req->pol = pol; in acpi_lookup_irq_handler()
119 req->trig = trig; in acpi_lookup_irq_handler()
120 if (req->acpi_res != NULL) in acpi_lookup_irq_handler()
121 bcopy(res, req->acpi_res, len); in acpi_lookup_irq_handler()
151 switch (res->Type) { in acpi_config_intr()
153 KASSERT(res->Data.Irq.InterruptCount == 1, in acpi_config_intr()
155 irq = res->Data.Irq.Interrupts[0]; in acpi_config_intr()
156 trig = res->Data.Irq.Triggering; in acpi_config_intr()
157 pol = res->Data.Irq.Polarity; in acpi_config_intr()
160 KASSERT(res->Data.ExtendedIrq.InterruptCount == 1, in acpi_config_intr()
162 irq = res->Data.ExtendedIrq.Interrupts[0]; in acpi_config_intr()
163 trig = res->Data.ExtendedIrq.Triggering; in acpi_config_intr()
164 pol = res->Data.ExtendedIrq.Polarity; in acpi_config_intr()
167 panic("%s: bad resource type %u", __func__, res->Type); in acpi_config_intr()
173 device_printf(dev, "forcing active-hi polarity for IRQ %u\n", irq); in acpi_config_intr()
249 dev = arc->dev; in acpi_parse_resource()
250 set = arc->set; in acpi_parse_resource()
252 switch (res->Type) { in acpi_parse_resource()
257 if (res->Data.FixedIo.AddressLength <= 0) in acpi_parse_resource()
260 res->Data.FixedIo.Address, res->Data.FixedIo.AddressLength)); in acpi_parse_resource()
261 set->set_ioport(dev, arc->context, res->Data.FixedIo.Address, in acpi_parse_resource()
262 res->Data.FixedIo.AddressLength); in acpi_parse_resource()
265 if (res->Data.Io.AddressLength <= 0) in acpi_parse_resource()
267 if (res->Data.Io.Minimum == res->Data.Io.Maximum) { in acpi_parse_resource()
269 res->Data.Io.Minimum, res->Data.Io.AddressLength)); in acpi_parse_resource()
270 set->set_ioport(dev, arc->context, res->Data.Io.Minimum, in acpi_parse_resource()
271 res->Data.Io.AddressLength); in acpi_parse_resource()
273 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Io 0x%x-0x%x/%d\n", in acpi_parse_resource()
274 res->Data.Io.Minimum, res->Data.Io.Maximum, in acpi_parse_resource()
275 res->Data.Io.AddressLength)); in acpi_parse_resource()
276 set->set_iorange(dev, arc->context, res->Data.Io.Minimum, in acpi_parse_resource()
277 res->Data.Io.Maximum, res->Data.Io.AddressLength, in acpi_parse_resource()
278 res->Data.Io.Alignment); in acpi_parse_resource()
282 if (res->Data.FixedMemory32.AddressLength <= 0) in acpi_parse_resource()
285 res->Data.FixedMemory32.Address, in acpi_parse_resource()
286 res->Data.FixedMemory32.AddressLength)); in acpi_parse_resource()
287 set->set_memory(dev, arc->context, res->Data.FixedMemory32.Address, in acpi_parse_resource()
288 res->Data.FixedMemory32.AddressLength); in acpi_parse_resource()
291 if (res->Data.Memory32.AddressLength <= 0) in acpi_parse_resource()
293 if (res->Data.Memory32.Minimum == res->Data.Memory32.Maximum) { in acpi_parse_resource()
295 res->Data.Memory32.Minimum, res->Data.Memory32.AddressLength)); in acpi_parse_resource()
296 set->set_memory(dev, arc->context, res->Data.Memory32.Minimum, in acpi_parse_resource()
297 res->Data.Memory32.AddressLength); in acpi_parse_resource()
299 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory32 0x%x-0x%x/%d\n", in acpi_parse_resource()
300 res->Data.Memory32.Minimum, res->Data.Memory32.Maximum, in acpi_parse_resource()
301 res->Data.Memory32.AddressLength)); in acpi_parse_resource()
302 set->set_memoryrange(dev, arc->context, res->Data.Memory32.Minimum, in acpi_parse_resource()
303 res->Data.Memory32.Maximum, res->Data.Memory32.AddressLength, in acpi_parse_resource()
304 res->Data.Memory32.Alignment); in acpi_parse_resource()
308 if (res->Data.Memory24.AddressLength <= 0) in acpi_parse_resource()
310 if (res->Data.Memory24.Minimum == res->Data.Memory24.Maximum) { in acpi_parse_resource()
312 res->Data.Memory24.Minimum, res->Data.Memory24.AddressLength)); in acpi_parse_resource()
313 set->set_memory(dev, arc->context, res->Data.Memory24.Minimum, in acpi_parse_resource()
314 res->Data.Memory24.AddressLength); in acpi_parse_resource()
316 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "Memory24 0x%x-0x%x/%d\n", in acpi_parse_resource()
317 res->Data.Memory24.Minimum, res->Data.Memory24.Maximum, in acpi_parse_resource()
318 res->Data.Memory24.AddressLength)); in acpi_parse_resource()
319 set->set_memoryrange(dev, arc->context, res->Data.Memory24.Minimum, in acpi_parse_resource()
320 res->Data.Memory24.Maximum, res->Data.Memory24.AddressLength, in acpi_parse_resource()
321 res->Data.Memory24.Alignment); in acpi_parse_resource()
330 set->set_irq(dev, arc->context, res->Data.Irq.Interrupts, in acpi_parse_resource()
331 res->Data.Irq.InterruptCount, res->Data.Irq.Triggering, in acpi_parse_resource()
332 res->Data.Irq.Polarity); in acpi_parse_resource()
340 set->set_drq(dev, arc->context, res->Data.Dma.Channels, in acpi_parse_resource()
341 res->Data.Dma.ChannelCount); in acpi_parse_resource()
345 set->set_start_dependent(dev, arc->context, in acpi_parse_resource()
346 res->Data.StartDpf.CompatibilityPriority); in acpi_parse_resource()
350 set->set_end_dependent(dev, arc->context); in acpi_parse_resource()
356 switch (res->Type) { in acpi_parse_resource()
358 gran = res->Data.Address16.Address.Granularity; in acpi_parse_resource()
359 min = res->Data.Address16.Address.Minimum; in acpi_parse_resource()
360 max = res->Data.Address16.Address.Maximum; in acpi_parse_resource()
361 length = res->Data.Address16.Address.AddressLength; in acpi_parse_resource()
367 gran = res->Data.Address32.Address.Granularity; in acpi_parse_resource()
368 min = res->Data.Address32.Address.Minimum; in acpi_parse_resource()
369 max = res->Data.Address32.Address.Maximum; in acpi_parse_resource()
370 length = res->Data.Address32.Address.AddressLength; in acpi_parse_resource()
376 gran = res->Data.Address64.Address.Granularity; in acpi_parse_resource()
377 min = res->Data.Address64.Address.Minimum; in acpi_parse_resource()
378 max = res->Data.Address64.Address.Maximum; in acpi_parse_resource()
379 length = res->Data.Address64.Address.AddressLength; in acpi_parse_resource()
385 KASSERT(res->Type == ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64, in acpi_parse_resource()
387 gran = res->Data.ExtAddress64.Address.Granularity; in acpi_parse_resource()
388 min = res->Data.ExtAddress64.Address.Minimum; in acpi_parse_resource()
389 max = res->Data.ExtAddress64.Address.Maximum; in acpi_parse_resource()
390 length = res->Data.ExtAddress64.Address.AddressLength; in acpi_parse_resource()
398 if (!arc->ignore_producer_flag && in acpi_parse_resource()
399 res->Data.Address.ProducerConsumer != ACPI_CONSUMER) { in acpi_parse_resource()
402 acpi_address_range_name(res->Data.Address.ResourceType))); in acpi_parse_resource()
405 if (res->Data.Address.ResourceType != ACPI_MEMORY_RANGE && in acpi_parse_resource()
406 res->Data.Address.ResourceType != ACPI_IO_RANGE) { in acpi_parse_resource()
408 "ignored %s for non-memory, non-I/O\n", name)); in acpi_parse_resource()
413 if (min > ULONG_MAX || (res->Data.Address.MaxAddressFixed && max > in acpi_parse_resource()
422 if (res->Data.Address.MinAddressFixed == ACPI_ADDRESS_FIXED && in acpi_parse_resource()
423 res->Data.Address.MaxAddressFixed == ACPI_ADDRESS_FIXED) { in acpi_parse_resource()
424 if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
427 set->set_memory(dev, arc->context, min, length); in acpi_parse_resource()
431 set->set_ioport(dev, arc->context, min, length); in acpi_parse_resource()
433 } else if (res->Data.Address.MinAddressFixed != ACPI_ADDRESS_FIXED && in acpi_parse_resource()
434 res->Data.Address.MaxAddressFixed != ACPI_ADDRESS_FIXED) { in acpi_parse_resource()
437 if ((min + length - 1) > max) { in acpi_parse_resource()
440 (uintmax_t)min, (uintmax_t)(min + length - 1), in acpi_parse_resource()
443 if (res->Data.Address.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
447 set->set_memory(dev, arc->context, min, length); in acpi_parse_resource()
451 set->set_ioport(dev, arc->context, min, length); in acpi_parse_resource()
455 if (res->Data.Address32.ResourceType == ACPI_MEMORY_RANGE) { in acpi_parse_resource()
457 "%s/Memory 0x%jx-0x%jx/%ju\n", name, (uintmax_t)min, in acpi_parse_resource()
459 set->set_memoryrange(dev, arc->context, min, max, length, gran); in acpi_parse_resource()
461 ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s/IO 0x%jx-0x%jx/%ju\n", in acpi_parse_resource()
463 set->set_iorange(dev, arc->context, min, max, length, gran); in acpi_parse_resource()
468 if (res->Data.ExtendedIrq.ProducerConsumer != ACPI_CONSUMER) { in acpi_parse_resource()
472 set->set_ext_irq(dev, arc->context, res->Data.ExtendedIrq.Interrupts, in acpi_parse_resource()
473 res->Data.ExtendedIrq.InterruptCount, in acpi_parse_resource()
474 res->Data.ExtendedIrq.Triggering, res->Data.ExtendedIrq.Polarity); in acpi_parse_resource()
489 * Note that it might be nice to also locate ACPI-specific resource items, such
492 * We really need to split the resource-fetching code out from the
493 * resource-parsing code, since we may want to use the parsing
505 set->set_init(dev, arg, &arc.context); in acpi_parse_resources()
518 * ARM Coresight on N1SDP set ResourceProducer on memory resources. in acpi_parse_resources()
519 * Coresight devices: ETM, STM, TPIU, ETF/ETR, REP, FUN. in acpi_parse_resources()
540 printf("can't fetch resources for %s - %s\n", in acpi_parse_resources()
544 set->set_done(dev, arc.context); in acpi_parse_resources()
549 * Resource-set vectors used to attach _CRS-derived resources
618 * under the PCI bridge. Do allow the one known-correct case on in acpi_res_ignore()
623 if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) { in acpi_res_ignore()
624 if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) { in acpi_res_ignore()
649 cp->ar_parent = arg; in acpi_res_set_init()
674 bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, base, length); in acpi_res_set_ioport()
701 bus_set_resource(dev, SYS_RES_IOPORT, cp->ar_nio++, low, length); in acpi_res_set_iorange()
718 bus_set_resource(dev, SYS_RES_MEMORY, cp->ar_nmem++, base, length); in acpi_res_set_memory()
745 bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); in acpi_res_set_irq()
762 bus_set_resource(dev, SYS_RES_IRQ, cp->ar_nirq++, irq[i], 1); in acpi_res_set_ext_irq()
780 bus_set_resource(dev, SYS_RES_DRQ, cp->ar_ndrq++, *drq, 1); in acpi_res_set_drq()
804 * Resource-owning placeholders for IO and memory pseudo-devices.
868 bus_rl = &bus_sc->sysres_rl; in acpi_sysres_attach()
870 if (dev_rle->type != SYS_RES_IOPORT && dev_rle->type != SYS_RES_MEMORY) in acpi_sysres_attach()
873 start = dev_rle->start; in acpi_sysres_attach()
874 end = dev_rle->end; in acpi_sysres_attach()
875 count = dev_rle->count; in acpi_sysres_attach()
876 type = dev_rle->type; in acpi_sysres_attach()
880 if (bus_rle->type != type) in acpi_sysres_attach()
884 if (start >= bus_rle->start && end <= bus_rle->end) in acpi_sysres_attach()
888 if (start < bus_rle->start && end >= bus_rle->start) { in acpi_sysres_attach()
889 bus_rle->count += bus_rle->start - start; in acpi_sysres_attach()
890 bus_rle->start = start; in acpi_sysres_attach()
895 if (start <= bus_rle->end && end > bus_rle->end) { in acpi_sysres_attach()
896 bus_rle->count += end - bus_rle->end; in acpi_sysres_attach()
897 bus_rle->end = end; in acpi_sysres_attach()