Lines Matching +full:address +full:- +full:width
1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: exregion - ACPI default op_region (address space) handlers
6 * Copyright (C) 2000 - 2018, Intel Corp.
21 * PARAMETERS: function - Read or Write operation
22 * address - Where in the space to read or write
23 * bit_width - Field width in bits (8, 16, or 32)
24 * value - Pointer to in or out value
25 * handler_context - Pointer to Handler's context
26 * region_context - Pointer to context specific to the
31 * DESCRIPTION: Handler for the System Memory address space (Op Region)
36 acpi_physical_address address, in acpi_ex_system_memory_space_handler() argument
53 /* Validate and translate the bit width */ in acpi_ex_system_memory_space_handler()
78 ACPI_ERROR((AE_INFO, "Invalid SystemMemory width %u", in acpi_ex_system_memory_space_handler()
85 * Hardware does not support non-aligned data transfers, we must verify in acpi_ex_system_memory_space_handler()
88 (void)acpi_ut_short_divide((u64) address, length, NULL, &remainder); in acpi_ex_system_memory_space_handler()
96 * Is 1) Address below the current mapping? OR in acpi_ex_system_memory_space_handler()
97 * 2) Address beyond the current mapping? in acpi_ex_system_memory_space_handler()
99 if ((address < mem_info->mapped_physical_address) || in acpi_ex_system_memory_space_handler()
100 (((u64) address + length) > ((u64) in acpi_ex_system_memory_space_handler()
101 mem_info->mapped_physical_address + in acpi_ex_system_memory_space_handler()
102 mem_info->mapped_length))) { in acpi_ex_system_memory_space_handler()
107 if (mem_info->mapped_length) { in acpi_ex_system_memory_space_handler()
111 acpi_os_unmap_memory(mem_info->mapped_logical_address, in acpi_ex_system_memory_space_handler()
112 mem_info->mapped_length); in acpi_ex_system_memory_space_handler()
116 * October 2009: Attempt to map from the requested address to the in acpi_ex_system_memory_space_handler()
121 ((mem_info->address + mem_info->length) - address); in acpi_ex_system_memory_space_handler()
135 (ACPI_ROUND_UP(address, ACPI_DEFAULT_PAGE_SIZE) - address); in acpi_ex_system_memory_space_handler()
144 /* Create a new mapping starting at the address given */ in acpi_ex_system_memory_space_handler()
146 mem_info->mapped_logical_address = in acpi_ex_system_memory_space_handler()
147 acpi_os_map_memory(address, map_length); in acpi_ex_system_memory_space_handler()
148 if (!mem_info->mapped_logical_address) { in acpi_ex_system_memory_space_handler()
151 ACPI_FORMAT_UINT64(address), in acpi_ex_system_memory_space_handler()
153 mem_info->mapped_length = 0; in acpi_ex_system_memory_space_handler()
157 /* Save the physical address and mapping size */ in acpi_ex_system_memory_space_handler()
159 mem_info->mapped_physical_address = address; in acpi_ex_system_memory_space_handler()
160 mem_info->mapped_length = map_length; in acpi_ex_system_memory_space_handler()
164 * Generate a logical pointer corresponding to the address we want to in acpi_ex_system_memory_space_handler()
167 logical_addr_ptr = mem_info->mapped_logical_address + in acpi_ex_system_memory_space_handler()
168 ((u64) address - (u64) mem_info->mapped_physical_address); in acpi_ex_system_memory_space_handler()
171 "System-Memory (width %u) R/W %u Address=%8.8X%8.8X\n", in acpi_ex_system_memory_space_handler()
172 bit_width, function, ACPI_FORMAT_UINT64(address))); in acpi_ex_system_memory_space_handler()
177 * Note: For machines that do not support non-aligned transfers, the target in acpi_ex_system_memory_space_handler()
178 * address was checked for alignment above. We do not attempt to break the in acpi_ex_system_memory_space_handler()
179 * transfer up into smaller (byte-size) chunks because the AML specifically in acpi_ex_system_memory_space_handler()
180 * asked for a transfer width that the hardware may require. in acpi_ex_system_memory_space_handler()
259 * PARAMETERS: function - Read or Write operation
260 * address - Where in the space to read or write
261 * bit_width - Field width in bits (8, 16, or 32)
262 * value - Pointer to in or out value
263 * handler_context - Pointer to Handler's context
264 * region_context - Pointer to context specific to the
269 * DESCRIPTION: Handler for the System IO address space (Op Region)
275 acpi_physical_address address, in acpi_ex_system_io_space_handler() argument
286 "System-IO (width %u) R/W %u Address=%8.8X%8.8X\n", in acpi_ex_system_io_space_handler()
287 bit_width, function, ACPI_FORMAT_UINT64(address))); in acpi_ex_system_io_space_handler()
294 status = acpi_hw_read_port((acpi_io_address)address, in acpi_ex_system_io_space_handler()
301 status = acpi_hw_write_port((acpi_io_address)address, in acpi_ex_system_io_space_handler()
318 * PARAMETERS: function - Read or Write operation
319 * address - Where in the space to read or write
320 * bit_width - Field width in bits (8, 16, or 32)
321 * value - Pointer to in or out value
322 * handler_context - Pointer to Handler's context
323 * region_context - Pointer to context specific to the
328 * DESCRIPTION: Handler for the PCI Config address space (Op Region)
334 acpi_physical_address address, in acpi_ex_pci_config_space_handler() argument
348 * pci_segment is the PCI bus segment range 0-31 in acpi_ex_pci_config_space_handler()
349 * pci_bus is the PCI bus number range 0-255 in acpi_ex_pci_config_space_handler()
350 * pci_device is the PCI device number range 0-31 in acpi_ex_pci_config_space_handler()
352 * pci_register is the Config space register range 0-255 bytes in acpi_ex_pci_config_space_handler()
354 * value - input value for write, output address for read in acpi_ex_pci_config_space_handler()
358 pci_register = (u16) (u32) address; in acpi_ex_pci_config_space_handler()
361 "Pci-Config %u (%u) Seg(%04x) Bus(%04x) " in acpi_ex_pci_config_space_handler()
363 function, bit_width, pci_id->segment, pci_id->bus, in acpi_ex_pci_config_space_handler()
364 pci_id->device, pci_id->function, pci_register)); in acpi_ex_pci_config_space_handler()
395 * PARAMETERS: function - Read or Write operation
396 * address - Where in the space to read or write
397 * bit_width - Field width in bits (8, 16, or 32)
398 * value - Pointer to in or out value
399 * handler_context - Pointer to Handler's context
400 * region_context - Pointer to context specific to the
405 * DESCRIPTION: Handler for the CMOS address space (Op Region)
411 acpi_physical_address address, in acpi_ex_cmos_space_handler() argument
427 * PARAMETERS: function - Read or Write operation
428 * address - Where in the space to read or write
429 * bit_width - Field width in bits (8, 16, or 32)
430 * value - Pointer to in or out value
431 * handler_context - Pointer to Handler's context
432 * region_context - Pointer to context specific to the
437 * DESCRIPTION: Handler for the PCI bar_target address space (Op Region)
443 acpi_physical_address address, in acpi_ex_pci_bar_space_handler() argument
459 * PARAMETERS: function - Read or Write operation
460 * address - Where in the space to read or write
461 * bit_width - Field width in bits (8, 16, or 32)
462 * value - Pointer to in or out value
463 * handler_context - Pointer to Handler's context
464 * region_context - Pointer to context specific to the
469 * DESCRIPTION: Handler for the Data Table address space (Op Region)
475 acpi_physical_address address, in acpi_ex_data_table_space_handler() argument
490 ACPI_PHYSADDR_TO_PTR(address), ACPI_DIV_8(bit_width)); in acpi_ex_data_table_space_handler()
495 memcpy(ACPI_PHYSADDR_TO_PTR(address), in acpi_ex_data_table_space_handler()