Lines Matching full:sh
15 static void dump_dev_res(const struct shell *sh, ACPI_RESOURCE *res_lst) in dump_dev_res() argument
19 shell_print(sh, "**** ACPI Device Resource Info ****"); in dump_dev_res()
24 shell_error(sh, "Error: zero length found!"); in dump_dev_res()
30 shell_print(sh, "ACPI_RESOURCE_TYPE_IRQ"); in dump_dev_res()
33 shell_print(sh, "\tDescriptorLength: %x", irq_res->DescriptorLength); in dump_dev_res()
34 shell_print(sh, "\tTriggering: %x", irq_res->Triggering); in dump_dev_res()
35 shell_print(sh, "\tPolarity: %x", irq_res->Polarity); in dump_dev_res()
36 shell_print(sh, "\tShareable: %x", irq_res->Shareable); in dump_dev_res()
37 shell_print(sh, "\tInterruptCount: %d", irq_res->InterruptCount); in dump_dev_res()
38 shell_print(sh, "\tInterrupts[0]: %x", irq_res->Interrupts[0]); in dump_dev_res()
43 shell_print(sh, "ACPI_RESOURCE_TYPE_IO"); in dump_dev_res()
44 shell_print(sh, "\tIoDecode: %x", io_res->IoDecode); in dump_dev_res()
45 shell_print(sh, "\tAlignment: %x", io_res->Alignment); in dump_dev_res()
46 shell_print(sh, "\tAddressLength: %x", io_res->AddressLength); in dump_dev_res()
47 shell_print(sh, "\tMinimum: %x", io_res->Minimum); in dump_dev_res()
48 shell_print(sh, "\tMaximum: %x", io_res->Maximum); in dump_dev_res()
52 shell_print(sh, "ACPI_RESOURCE_TYPE_DMA"); in dump_dev_res()
55 shell_print(sh, "ACPI_RESOURCE_TYPE_START_DEPENDENT"); in dump_dev_res()
58 shell_print(sh, "ACPI_RESOURCE_TYPE_END_DEPENDENT"); in dump_dev_res()
61 shell_print(sh, "ACPI_RESOURCE_TYPE_FIXED_IO"); in dump_dev_res()
64 shell_print(sh, "ACPI_RESOURCE_TYPE_VENDOR"); in dump_dev_res()
67 shell_print(sh, "ACPI_RESOURCE_TYPE_MEMORY24"); in dump_dev_res()
72 shell_print(sh, "ACPI_RESOURCE_TYPE_MEMORY32"); in dump_dev_res()
73 shell_print(sh, "\tMinimum: %x", mem_res->Minimum); in dump_dev_res()
74 shell_print(sh, "\tMaximum: %x", mem_res->Maximum); in dump_dev_res()
80 shell_print(sh, "ACPI_RESOURCE_TYPE_FIXED_MEMORY32"); in dump_dev_res()
81 shell_print(sh, "\tAddress: %x", fix_mem_res->Address); in dump_dev_res()
85 shell_print(sh, "ACPI_RESOURCE_TYPE_ADDRESS16"); in dump_dev_res()
90 shell_print(sh, "ACPI_RESOURCE_TYPE_ADDRESS32"); in dump_dev_res()
91 shell_print(sh, "\tMinimum: %x", add_res->Address.Minimum); in dump_dev_res()
92 shell_print(sh, "\tMaximum: %x", add_res->Address.Maximum); in dump_dev_res()
98 shell_print(sh, "ACPI_RESOURCE_TYPE_ADDRESS64"); in dump_dev_res()
99 shell_print(sh, "\tMinimum: %llx", add_res64->Address.Minimum); in dump_dev_res()
100 shell_print(sh, "\tMaximum: %llx", add_res64->Address.Maximum); in dump_dev_res()
104 shell_print(sh, "ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64"); in dump_dev_res()
109 shell_print(sh, "ACPI_RESOURCE_TYPE_EXTENDED_IRQ"); in dump_dev_res()
110 shell_print(sh, "\tTriggering: %x", ext_irq_res->Triggering); in dump_dev_res()
111 shell_print(sh, "\tPolarity: %x", ext_irq_res->Polarity); in dump_dev_res()
112 shell_print(sh, "\tShareable: %s", ext_irq_res->Shareable ? "YES":"NO"); in dump_dev_res()
113 shell_print(sh, "\tInterruptCount: %d", ext_irq_res->InterruptCount); in dump_dev_res()
114 shell_print(sh, "\tInterrupts[0]: %d", ext_irq_res->Interrupts[0]); in dump_dev_res()
118 shell_print(sh, "ACPI_RESOURCE_TYPE_GENERIC_REGISTER"); in dump_dev_res()
121 shell_print(sh, "ACPI_RESOURCE_TYPE_GPIO"); in dump_dev_res()
124 shell_print(sh, "ACPI_RESOURCE_TYPE_FIXED_DMA"); in dump_dev_res()
127 shell_print(sh, "ACPI_RESOURCE_TYPE_SERIAL_BUS"); in dump_dev_res()
130 shell_print(sh, "ACPI_RESOURCE_TYPE_PIN_FUNCTION"); in dump_dev_res()
133 shell_print(sh, "ACPI_RESOURCE_TYPE_PIN_CONFIG"); in dump_dev_res()
136 shell_print(sh, "ACPI_RESOURCE_TYPE_PIN_GROUP"); in dump_dev_res()
139 shell_print(sh, "ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION"); in dump_dev_res()
142 shell_print(sh, "ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG"); in dump_dev_res()
145 shell_error(sh, "Unknown resource type %d", res->Type); in dump_dev_res()
153 static int dump_dev_crs(const struct shell *sh, size_t argc, char **argv) in dump_dev_crs() argument
159 shell_error(sh, "invalid argument"); in dump_dev_crs()
165 shell_error(sh, "Error on ACPI _CRS method: %d", status); in dump_dev_crs()
169 dump_dev_res(sh, res_lst); in dump_dev_crs()
176 static int dump_dev_prs(const struct shell *sh, size_t argc, char **argv) in dump_dev_prs() argument
182 shell_error(sh, "invalid argument"); in dump_dev_prs()
188 shell_error(sh, "Error in on ACPI _PRS method: %d", status); in dump_dev_prs()
192 dump_dev_res(sh, res_lst); in dump_dev_prs()
197 static int dump_prt(const struct shell *sh, size_t argc, char **argv) in dump_prt() argument
204 shell_error(sh, "invalid arguments [Eg: acpi prt <bus> <dev> <func>]"); in dump_prt()
215 shell_print(sh, "PCI Legacy IRQ for bus %d dev %d func %d is: %d", in dump_prt()
218 shell_print(sh, "PCI Legacy IRQ for bus %d dev %d func %d Not found", in dump_prt()
226 static int enum_dev(const struct shell *sh, size_t argc, char **argv) in enum_dev() argument
232 shell_error(sh, "Invalid arguments [Eg: acpi enum PNP0103 0]"); in enum_dev()
238 shell_error(sh, "acpi get device failed for HID: %s", argv[1]); in enum_dev()
242 shell_print(sh, "Name: %s", dev->path ? dev->path : "None"); in enum_dev()
246 dump_dev_res(sh, res_lst); in enum_dev()
254 static int enum_all_dev(const struct shell *sh, size_t argc, char **argv) in enum_all_dev() argument
261 shell_print(sh, "No more ACPI device found!"); in enum_all_dev()
269 shell_print(sh, "%d) Name: %s, HID: %s", i, dev->path ? dev->path : "None", in enum_all_dev()
277 static int get_acpi_dev_resource(const struct shell *sh, size_t argc, char **argv) in get_acpi_dev_resource() argument
291 shell_error(sh, "acpi get device failed for HID: %s", argv[1]); in get_acpi_dev_resource()
296 shell_print(sh, "Device Path: %s", dev->path); in get_acpi_dev_resource()
302 shell_print(sh, "Device MMIO resources"); in get_acpi_dev_resource()
304 shell_print(sh, "\tType: %x, Address: %p, Size: %d", in get_acpi_dev_resource()
315 shell_print(sh, "Device IRQ resources"); in get_acpi_dev_resource()
317 shell_print(sh, "\tIRQ Num: %x, Flags: %x", irq_res.irqs[i], in get_acpi_dev_resource()
326 static int read_table(const struct shell *sh, size_t argc, char **argv) in read_table() argument
336 shell_error(sh, "ACPI get table %s failed", argv[1]); in read_table()
340 shell_print(sh, "ACPI Table %s:", argv[1]); in read_table()
341 shell_print(sh, "\tSignature: %.4s", table->Signature); in read_table()
342 shell_print(sh, "\tTable Length: %d", table->Length); in read_table()
343 shell_print(sh, "\tRevision: %d", table->Revision); in read_table()
344 shell_print(sh, "\tOemId: %s", table->OemId); in read_table()