Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Module Name: rsdump - AML debugger support for resource structures.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10) #include "acresrc.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) #define _COMPONENT          ACPI_RESOURCES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) ACPI_MODULE_NAME("rsdump")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * All functions in this module are used by the AML Debugger only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18) /* Local prototypes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19) static void acpi_rs_out_string(const char *title, const char *value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21) static void acpi_rs_out_integer8(const char *title, u8 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) static void acpi_rs_out_integer16(const char *title, u16 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) static void acpi_rs_out_integer32(const char *title, u32 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) static void acpi_rs_out_integer64(const char *title, u64 value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) static void acpi_rs_out_title(const char *title);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) static void acpi_rs_dump_byte_list(u16 length, u8 *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) static void acpi_rs_dump_word_list(u16 length, u16 *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) static void acpi_rs_dump_dword_list(u8 length, u32 *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37) static void acpi_rs_dump_short_byte_list(u8 length, u8 *data);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40) acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) acpi_rs_dump_resource_label(char *title,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 			    struct acpi_resource_label *resource_label);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) static void acpi_rs_dump_address_common(union acpi_resource_data *resource);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * FUNCTION:    acpi_rs_dump_resource_list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55)  * PARAMETERS:  resource_list       - Pointer to a resource descriptor list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  * DESCRIPTION: Dispatches the structure to the correct dump routine.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63) void acpi_rs_dump_resource_list(struct acpi_resource *resource_list)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 	u32 count = 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	u32 type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 	/* Check if debug output enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 	if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76) 	/* Walk list and dump all resource descriptors (END_TAG terminates) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	do {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 		acpi_os_printf("\n[%02X] ", count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80) 		count++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) 		/* Validate Type before dispatch */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) 		type = resource_list->type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 		if (type > ACPI_RESOURCE_TYPE_MAX) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 			acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 			    ("Invalid descriptor type (%X) in resource list\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 			     resource_list->type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 		/* Sanity check the length. It must not be zero, or we loop forever */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94) 		if (!resource_list->length) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95) 			acpi_os_printf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 			    ("Invalid zero length descriptor in resource list\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) 		/* Dump the resource descriptor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) 		if (type == ACPI_RESOURCE_TYPE_SERIAL_BUS) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) 			acpi_rs_dump_descriptor(&resource_list->data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 						acpi_gbl_dump_serial_bus_dispatch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 						[resource_list->data.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 						 common_serial_bus.type]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 		} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 			acpi_rs_dump_descriptor(&resource_list->data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) 						acpi_gbl_dump_resource_dispatch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 						[type]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 		/* Point to the next resource structure */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) 		resource_list = ACPI_NEXT_RESOURCE(resource_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) 		/* Exit when END_TAG descriptor is reached */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) 	} while (type != ACPI_RESOURCE_TYPE_END_TAG);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124)  * FUNCTION:    acpi_rs_dump_irq_list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126)  * PARAMETERS:  route_table     - Pointer to the routing table to dump.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  * DESCRIPTION: Print IRQ routing table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) void acpi_rs_dump_irq_list(u8 *route_table)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) 	struct acpi_pci_routing_table *prt_element;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) 	u8 count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 	/* Check if debug output enabled */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 	if (!ACPI_IS_DEBUG_ENABLED(ACPI_LV_RESOURCES, _COMPONENT)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 	prt_element = ACPI_CAST_PTR(struct acpi_pci_routing_table, route_table);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 	/* Dump all table elements, Exit on zero length element */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) 	for (count = 0; prt_element->length; count++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 		acpi_os_printf("\n[%02X] PCI IRQ Routing Table Package\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 			       count);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 		acpi_rs_dump_descriptor(prt_element, acpi_rs_dump_prt);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) 		prt_element = ACPI_ADD_PTR(struct acpi_pci_routing_table,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 					   prt_element, prt_element->length);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  * FUNCTION:    acpi_rs_dump_descriptor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)  * PARAMETERS:  resource            - Buffer containing the resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)  *              table               - Table entry to decode the resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)  * DESCRIPTION: Dump a resource descriptor based on a dump table entry.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) acpi_rs_dump_descriptor(void *resource, struct acpi_rsdump_info *table)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) 	u8 *target = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) 	u8 *previous_target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	const char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 	u8 count;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 	/* First table entry must contain the table length (# of table entries) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) 	count = table->offset;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	while (count) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 		previous_target = target;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 		target = ACPI_ADD_PTR(u8, resource, table->offset);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 		name = table->name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 		switch (table->opcode) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 		case ACPI_RSD_TITLE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 			 * Optional resource title
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 			if (table->name) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 				acpi_os_printf("%s Resource\n", name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 			/* Strings */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 		case ACPI_RSD_LITERAL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 			acpi_rs_out_string(name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 					   ACPI_CAST_PTR(char, table->pointer));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 		case ACPI_RSD_STRING:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 			acpi_rs_out_string(name, ACPI_CAST_PTR(char, target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 			/* Data items, 8/16/32/64 bit */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 		case ACPI_RSD_UINT8:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 			if (table->pointer) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 				acpi_rs_out_string(name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) 						   table->pointer[*target]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 			} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 				acpi_rs_out_integer8(name, ACPI_GET8(target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 		case ACPI_RSD_UINT16:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) 			acpi_rs_out_integer16(name, ACPI_GET16(target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) 		case ACPI_RSD_UINT32:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 			acpi_rs_out_integer32(name, ACPI_GET32(target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 		case ACPI_RSD_UINT64:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 			acpi_rs_out_integer64(name, ACPI_GET64(target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) 			/* Flags: 1-bit and 2-bit flags supported */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) 		case ACPI_RSD_1BITFLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) 			acpi_rs_out_string(name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 					   table->pointer[*target & 0x01]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 		case ACPI_RSD_2BITFLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) 			acpi_rs_out_string(name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) 					   table->pointer[*target & 0x03]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 		case ACPI_RSD_3BITFLAG:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) 			acpi_rs_out_string(name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 					   table->pointer[*target & 0x07]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) 		case ACPI_RSD_SHORTLIST:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 			 * Short byte list (single line output) for DMA and IRQ resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 			 * Note: The list length is obtained from the previous table entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 			if (previous_target) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) 				acpi_rs_out_title(name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) 				acpi_rs_dump_short_byte_list(*previous_target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 							     target);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 		case ACPI_RSD_SHORTLISTX:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 			 * Short byte list (single line output) for GPIO vendor data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) 			 * Note: The list length is obtained from the previous table entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 			if (previous_target) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 				acpi_rs_out_title(name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 				acpi_rs_dump_short_byte_list(*previous_target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) 							     *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) 							     (ACPI_CAST_INDIRECT_PTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) 							      (u8, target)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) 		case ACPI_RSD_LONGLIST:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) 			 * Long byte list for Vendor resource data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) 			 * Note: The list length is obtained from the previous table entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) 			if (previous_target) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) 				acpi_rs_dump_byte_list(ACPI_GET16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) 						       (previous_target),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) 						       target);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) 		case ACPI_RSD_DWORDLIST:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) 			 * Dword list for Extended Interrupt resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) 			 * Note: The list length is obtained from the previous table entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) 			if (previous_target) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) 				acpi_rs_dump_dword_list(*previous_target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) 							ACPI_CAST_PTR(u32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) 								      target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) 		case ACPI_RSD_WORDLIST:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) 			 * Word list for GPIO Pin Table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) 			 * Note: The list length is obtained from the previous table entry
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) 			if (previous_target) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) 				acpi_rs_dump_word_list(*previous_target,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) 						       *(ACPI_CAST_INDIRECT_PTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) 							 (u16, target)));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) 			}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) 		case ACPI_RSD_ADDRESS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) 			 * Common flags for all Address resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) 			acpi_rs_dump_address_common(ACPI_CAST_PTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) 						    (union acpi_resource_data,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) 						     target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) 		case ACPI_RSD_SOURCE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) 			 * Optional resource_source for Address resources
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) 			acpi_rs_dump_resource_source(ACPI_CAST_PTR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) 						     (struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) 								   acpi_resource_source,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) 								   target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) 		case ACPI_RSD_LABEL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) 			 * resource_label
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) 			acpi_rs_dump_resource_label("Resource Label",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) 						    ACPI_CAST_PTR(struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) 								  acpi_resource_label,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) 								  target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) 		case ACPI_RSD_SOURCE_LABEL:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) 			/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) 			 * resource_source_label
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) 			 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) 			acpi_rs_dump_resource_label("Resource Source Label",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) 						    ACPI_CAST_PTR(struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) 								  acpi_resource_label,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) 								  target));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) 			break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) 		default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) 			acpi_os_printf("**** Invalid table opcode [%X] ****\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) 				       table->opcode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) 			return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) 		}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) 		table++;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) 		count--;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)  * FUNCTION:    acpi_rs_dump_resource_source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)  * PARAMETERS:  resource_source     - Pointer to a Resource Source struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382)  * DESCRIPTION: Common routine for dumping the optional resource_source and the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383)  *              corresponding resource_source_index.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) acpi_rs_dump_resource_source(struct acpi_resource_source *resource_source)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) 	if (resource_source->index == 0xFF) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) 		return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) 	acpi_rs_out_integer8("Resource Source Index", resource_source->index);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398) 	acpi_rs_out_string("Resource Source",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) 			   resource_source->string_ptr ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) 			   resource_source->string_ptr : "[Not Specified]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)  * FUNCTION:    acpi_rs_dump_resource_label
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407)  * PARAMETERS:  title              - Title of the dumped resource field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408)  *              resource_label     - Pointer to a Resource Label struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)  * DESCRIPTION: Common routine for dumping the resource_label
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) static void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) acpi_rs_dump_resource_label(char *title,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) 			    struct acpi_resource_label *resource_label)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) 	acpi_rs_out_string(title,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) 			   resource_label->string_ptr ?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) 			   resource_label->string_ptr : "[Not Specified]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429)  * FUNCTION:    acpi_rs_dump_address_common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431)  * PARAMETERS:  resource        - Pointer to an internal resource descriptor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435)  * DESCRIPTION: Dump the fields that are common to all Address resource
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436)  *              descriptors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) static void acpi_rs_dump_address_common(union acpi_resource_data *resource)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) 	ACPI_FUNCTION_ENTRY();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) 	/* Decode the type-specific flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) 	switch (resource->address.resource_type) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) 	case ACPI_MEMORY_RANGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) 		acpi_rs_dump_descriptor(resource, acpi_rs_dump_memory_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) 	case ACPI_IO_RANGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) 		acpi_rs_dump_descriptor(resource, acpi_rs_dump_io_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) 	case ACPI_BUS_NUMBER_RANGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) 		acpi_rs_out_string("Resource Type", "Bus Number Range");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) 	default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) 		acpi_rs_out_integer8("Resource Type",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) 				     (u8) resource->address.resource_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) 		break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) 	/* Decode the general flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) 	acpi_rs_dump_descriptor(resource, acpi_rs_dump_general_flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476)  * FUNCTION:    acpi_rs_out*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478)  * PARAMETERS:  title       - Name of the resource field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479)  *              value       - Value of the resource field
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483)  * DESCRIPTION: Miscellaneous helper functions to consistently format the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484)  *              output of the resource dump routines
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) static void acpi_rs_out_string(const char *title, const char *value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) 	acpi_os_printf("%27s : %s", title, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) 	if (!*value) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) 		acpi_os_printf("[NULL NAMESTRING]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) static void acpi_rs_out_integer8(const char *title, u8 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) 	acpi_os_printf("%27s : %2.2X\n", title, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) static void acpi_rs_out_integer16(const char *title, u16 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) 	acpi_os_printf("%27s : %4.4X\n", title, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) static void acpi_rs_out_integer32(const char *title, u32 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) 	acpi_os_printf("%27s : %8.8X\n", title, value);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) static void acpi_rs_out_integer64(const char *title, u64 value)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) 	acpi_os_printf("%27s : %8.8X%8.8X\n", title, ACPI_FORMAT_UINT64(value));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) static void acpi_rs_out_title(const char *title)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) 	acpi_os_printf("%27s : ", title);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529)  * FUNCTION:    acpi_rs_dump*List
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531)  * PARAMETERS:  length      - Number of elements in the list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532)  *              data        - Start of the list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)  * RETURN:      None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536)  * DESCRIPTION: Miscellaneous functions to dump lists of raw data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) static void acpi_rs_dump_byte_list(u16 length, u8 * data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) 	u16 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) 	for (i = 0; i < length; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) 		acpi_os_printf("%25s%2.2X : %2.2X\n", "Byte", i, data[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) static void acpi_rs_dump_short_byte_list(u8 length, u8 * data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) 	u8 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) 	for (i = 0; i < length; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) 		acpi_os_printf("%X ", data[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) 	acpi_os_printf("\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) static void acpi_rs_dump_dword_list(u8 length, u32 * data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) 	u8 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) 	for (i = 0; i < length; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) 		acpi_os_printf("%25s%2.2X : %8.8X\n", "Dword", i, data[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) static void acpi_rs_dump_word_list(u16 length, u16 *data)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) 	u16 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) 	for (i = 0; i < length; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) 		acpi_os_printf("%25s%2.2X : %4.4X\n", "Word", i, data[i]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) }