Lines Matching +full:preserved +full:- +full:memory +full:- +full:map

1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: hwregs - Read/write access functions for the various ACPI
39 * PARAMETERS: address - GAS register address
40 * reg - GAS register structure
41 * max_bit_width - Max bit_width supported (32 or 64)
69 if (!reg->bit_offset && reg->bit_width && in acpi_hw_get_access_bit_width()
70 ACPI_IS_POWER_OF_TWO(reg->bit_width) && in acpi_hw_get_access_bit_width()
71 ACPI_IS_ALIGNED(reg->bit_width, 8)) { in acpi_hw_get_access_bit_width()
72 access_bit_width = reg->bit_width; in acpi_hw_get_access_bit_width()
73 } else if (reg->access_width) { in acpi_hw_get_access_bit_width()
74 access_bit_width = ACPI_ACCESS_BIT_WIDTH(reg->access_width); in acpi_hw_get_access_bit_width()
77 ACPI_ROUND_UP_POWER_OF_TWO_8(reg->bit_offset + in acpi_hw_get_access_bit_width()
78 reg->bit_width); in acpi_hw_get_access_bit_width()
90 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO) { in acpi_hw_get_access_bit_width()
97 * a 32-bit accesses. in acpi_hw_get_access_bit_width()
109 * PARAMETERS: reg - GAS register structure
110 * max_bit_width - Max bit_width supported (32 or 64)
111 * address - Pointer to where the gas->address
139 ACPI_MOVE_64_TO_64(address, &reg->address); in acpi_hw_validate_register()
146 if ((reg->space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) && in acpi_hw_validate_register()
147 (reg->space_id != ACPI_ADR_SPACE_SYSTEM_IO)) { in acpi_hw_validate_register()
149 "Unsupported address space: 0x%X", reg->space_id)); in acpi_hw_validate_register()
155 if (reg->access_width > 4) { in acpi_hw_validate_register()
158 reg->access_width)); in acpi_hw_validate_register()
167 ACPI_ROUND_UP(reg->bit_offset + reg->bit_width, access_width); in acpi_hw_validate_register()
182 * PARAMETERS: value - Where the value is returned
183 * reg - GAS register structure
187 * DESCRIPTION: Read from either memory or IO space. This is a 64-bit max
216 * Initialize entire 64-bit return value to zero, convert access_width in acpi_hw_read()
221 bit_width = reg->bit_offset + reg->bit_width; in acpi_hw_read()
222 bit_offset = reg->bit_offset; in acpi_hw_read()
225 * Two address spaces supported: Memory or IO. PCI_Config is in acpi_hw_read()
232 bit_offset -= access_width; in acpi_hw_read()
234 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { in acpi_hw_read()
257 * ensured to be less than 64-bits by acpi_hw_validate_register(). in acpi_hw_read()
262 bit_width -= in acpi_hw_read()
271 acpi_ut_get_region_name(reg->space_id))); in acpi_hw_read()
280 * PARAMETERS: value - Value to be written
281 * reg - GAS register structure
285 * DESCRIPTION: Write to either memory or IO space. This is a 64-bit max
312 bit_width = reg->bit_offset + reg->bit_width; in acpi_hw_write()
313 bit_offset = reg->bit_offset; in acpi_hw_write()
316 * Two address spaces supported: Memory or IO. PCI_Config is in acpi_hw_write()
323 * ensured to be less than 64-bits by acpi_hw_validate_register(). in acpi_hw_write()
329 bit_offset -= access_width; in acpi_hw_write()
331 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { in acpi_hw_write()
352 * Index * access_width is ensured to be less than 32-bits by in acpi_hw_write()
355 bit_width -= in acpi_hw_write()
364 acpi_ut_get_region_name(reg->space_id))); in acpi_hw_write()
418 * PARAMETERS: register_id - Index of ACPI Register to access
422 * DESCRIPTION: Map register_id into a register bitmask.
443 * PARAMETERS: pm1a_control - Value to be written to PM1A control
444 * pm1b_control - Value to be written to PM1B control
480 * PARAMETERS: register_id - ACPI Register ID
481 * return_value - Where the register value is returned
497 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_read()
504 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_read()
511 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_read()
520 * Zero the write-only bits. From the ACPI specification, "Hardware in acpi_hw_register_read()
521 * Write-Only Bits": "Upon reads to registers with write-only bits, in acpi_hw_register_read()
522 * software masks out all write-only bits." in acpi_hw_register_read()
527 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ in acpi_hw_register_read()
536 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ in acpi_hw_register_read()
545 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ in acpi_hw_register_read()
569 * PARAMETERS: register_id - ACPI Register ID
570 * value - The value to write
600 case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_write()
603 * specification, ignored bits are to be preserved when writing. in acpi_hw_register_write()
618 case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_write()
625 case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */ in acpi_hw_register_write()
639 /* Insert the bits to be preserved */ in acpi_hw_register_write()
653 case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */ in acpi_hw_register_write()
655 * For control registers, all reserved bits must be preserved, in acpi_hw_register_write()
666 /* Insert the bits to be preserved */ in acpi_hw_register_write()
675 case ACPI_REGISTER_PM_TIMER: /* 32-bit access */ in acpi_hw_register_write()
680 case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */ in acpi_hw_register_write()
703 * PARAMETERS: value - Where the register value is returned
704 * register_a - First ACPI register (required)
705 * register_b - Second ACPI register (optional)
709 * DESCRIPTION: Read from the specified two-part ACPI register (such as PM1 A/B)
733 if (register_b->address) { in acpi_hw_read_multiple()
759 * PARAMETERS: value - The value to write
760 * register_a - First ACPI register (required)
761 * register_b - Second ACPI register (optional)
765 * DESCRIPTION: Write to the specified two-part ACPI register (such as PM1 A/B)
795 if (register_b->address) { in acpi_hw_write_multiple()