Lines Matching +full:keyboard +full:- +full:controller +full:- +full:style
1 /*-
2 * Copyright (c) 2008-2010 Rui Paulo
6 * Copyright (c) 2016-2019 Netflix, Inc. written by M. Warner Losh
106 * in the event no currdev is found. -2 means always break, -1 means
143 status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, 0); in has_keyboard()
146 status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, in has_keyboard()
168 * Check for the ACPI keyboard node. All PNP3xx nodes in has_keyboard()
170 * unclear of there's always a keyboard node when in has_keyboard()
171 * there's a keyboard controller, or if there's only one in has_keyboard()
172 * when a keyboard is detected at boot. in has_keyboard()
180 if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && in has_keyboard()
181 (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { in has_keyboard()
186 * Check for USB keyboard node, if present. Unlike a in has_keyboard()
187 * PS/2 keyboard, these definitely only appear when in has_keyboard()
195 if (usb->DeviceClass == 3 && /* HID */ in has_keyboard()
196 usb->DeviceSubClass == 1 && /* Boot devices */ in has_keyboard()
197 usb->DeviceProtocol == 1) { /* Boot keyboards */ in has_keyboard()
237 * pointer is non-null, we're a partition not a full disk in set_currdev_pdinfo()
240 if (dp->pd_devsw->dv_type == DEVT_DISK) { in set_currdev_pdinfo()
243 currdev.dd.d_dev = dp->pd_devsw; in set_currdev_pdinfo()
244 if (dp->pd_parent == NULL) { in set_currdev_pdinfo()
245 currdev.dd.d_unit = dp->pd_unit; in set_currdev_pdinfo()
249 currdev.dd.d_unit = dp->pd_parent->pd_unit; in set_currdev_pdinfo()
250 currdev.d_slice = dp->pd_unit; in set_currdev_pdinfo()
255 set_currdev_devsw(dp->pd_devsw, dp->pd_unit); in set_currdev_pdinfo()
266 stat(PATH_BOOTABLE_TOKEN, &st) == 0 || /* non-standard layout */ in sanity_check_currdev()
291 setenv("zfs-bootonce", buf, 1); in probe_zfs_currdev()
328 if (efizfs_get_guid_by_handle(pp->pd_handle, &guid)) in try_as_currdev()
356 #define SIZE(dp, edp) (size_t)((intptr_t)(void *)edp - (intptr_t)(void *)dp)
465 ucs2_to_utf8(fp->PathName, &kernel); in match_boot_info()
491 * Look at the passed-in boot_info, if any. If we find it then we need
502 * a concession to buggy UEFI implementations, like u-boot, if
556 * a follow-on boot image in that boot_info, use that. In this in find_currdev()
567 case BAD_CHOICE: /* specified file not found -> error */ in find_currdev()
605 dp = efiblk_get_pdinfo_by_handle(boot_img->DeviceHandle); in find_currdev()
607 text = efi_devpath_name(dp->pd_devpath); in find_currdev()
615 if (dp->pd_parent != NULL) { in find_currdev()
617 dp = dp->pd_parent; in find_currdev()
618 STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { in find_currdev()
627 text = efi_devpath_name(pp->pd_devpath); in find_currdev()
644 if (efi_handle_lookup(boot_img->DeviceHandle, &dev, &unit, &extra) == 0) { in find_currdev()
685 if (fail_timeout == -2) /* Always break to OK */ in interactive_interrupt()
687 if (fail_timeout == -1) /* Never break to OK */ in interactive_interrupt()
692 fail_timeout - (int)(now - then)); in interactive_interrupt()
700 } while (now - then < fail_timeout); in interactive_interrupt()
720 * args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this in parse_args()
721 * method is flawed for non-ASCII characters). in parse_args()
756 while (length--) in acpi_checksum()
774 rsdt = (ACPI_TABLE_RSDT *)(uintptr_t)rsdp->RsdtPhysicalAddress; in acpi_find_table()
775 xsdt = (ACPI_TABLE_XSDT *)(uintptr_t)rsdp->XsdtPhysicalAddress; in acpi_find_table()
776 if (rsdp->Revision < 2) { in acpi_find_table()
783 entries = (sdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size; in acpi_find_table()
786 addr = le32toh(rsdt->TableOffsetEntry[i]); in acpi_find_table()
788 addr = le64toh(xsdt->TableOffsetEntry[i]); in acpi_find_table()
792 if (acpi_checksum(sdp, sdp->Length)) { in acpi_find_table()
794 sdp->Signature); in acpi_find_table()
797 if (memcmp(sig, sdp->Signature, 4) == 0) in acpi_find_table()
815 [0x0d] = "pl011", /* Arm SBSA 32-bit width */ in acpi_uart_type()
828 static int baud[] = { 0, -1, -1, 9600, 19200, -1, 57600, 115200 }; in acpi_uart_baud()
831 return (-1); in acpi_uart_baud()
841 return (-1); in acpi_uart_regionwidth()
842 return (1 << (rw - 1)); in acpi_uart_regionwidth()
859 * the uart(4) console string. We use io == -1 to select between I/O ports and
875 dt = acpi_uart_type(spcr->InterfaceType); in check_acpi_spcr()
877 printf("UART Type %d not known\n", spcr->InterfaceType); in check_acpi_spcr()
882 io = -1; in check_acpi_spcr()
883 pv = spcr->PciVendorId; in check_acpi_spcr()
884 pd = spcr->PciDeviceId; in check_acpi_spcr()
886 if (spcr->SerialPort.SpaceId == 1) in check_acpi_spcr()
887 io = spcr->SerialPort.Address; in check_acpi_spcr()
889 mm = spcr->SerialPort.Address; in check_acpi_spcr()
890 rs = ffs(spcr->SerialPort.BitWidth) - 4; in check_acpi_spcr()
891 rw = acpi_uart_regionwidth(spcr->SerialPort.AccessWidth); in check_acpi_spcr()
898 pa = acpi_uart_parity(spcr->Parity); in check_acpi_spcr()
899 sb = spcr->StopBits; in check_acpi_spcr()
907 if (spcr->Header.Revision <= 2) in check_acpi_spcr()
910 xo = spcr->UartClkFreq; in check_acpi_spcr()
913 * PreciseBaudrate, when non-zero, is to be preferred. It's only valid, in check_acpi_spcr()
915 * old, we do the old-style table lookup. Otherwise we believe it. in check_acpi_spcr()
917 if (spcr->Header.Revision <= 3 || spcr->PreciseBaudrate == 0) in check_acpi_spcr()
918 br = acpi_uart_baud(spcr->BaudRate); in check_acpi_spcr()
920 br = spcr->PreciseBaudrate; in check_acpi_spcr()
922 if (io != -1) { in check_acpi_spcr()
944 * and if we don't, we default to video. If there's a dual-console situation
1001 if (EISA_ID_TO_NUM(acpi->HID) == 0x501) { in parse_uefi_con_out()
1002 setenv_int("efi_8250_uid", acpi->UID); in parse_uefi_con_out()
1009 setenv_int("efi_com_speed", uart->BaudRate); in parse_uefi_con_out()
1059 int fd = -1; in parse_loader_efi_config()
1069 if (fd == -1) in parse_loader_efi_config()
1109 * it here, even if the typical idium would have '- 1' here to in read_loader_env()
1122 parse_loader_efi_config(boot_img->DeviceHandle, fn); in read_loader_env()
1145 revision = rsdp->Revision; in acpi_detect()
1150 strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); in acpi_detect()
1151 buf[sizeof(rsdp->OemId)] = '\0'; in acpi_detect()
1153 sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); in acpi_detect()
1158 (unsigned long long)rsdp->XsdtPhysicalAddress); in acpi_detect()
1160 sprintf(buf, "%d", rsdp->Length); in acpi_detect()
1171 for (k = 0; k < ST->NumberOfTableEntries; k++) { in efi_smbios_detect()
1173 VOID *const VT = ST->ConfigurationTable[k].VendorTable; in efi_smbios_detect()
1177 guid = &ST->ConfigurationTable[k].VendorGuid; in efi_smbios_detect()
1226 * Chicken-and-egg problem; we want to have console output early, but in main()
1269 * args (eg -h) or via the UEFI ConOut variable. in main()
1332 /* case VIDEO_ONLY can't happen -- it's the first if above */ in main()
1355 printf(" Image base: 0x%lx\n", (unsigned long)boot_img->ImageBase); in main()
1356 printf(" EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, in main()
1357 ST->Hdr.Revision & 0xffff); in main()
1358 printf(" EFI Firmware: %S (rev %d.%02d)\n", ST->FirmwareVendor, in main()
1359 ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0xffff); in main()
1363 text = efi_devpath_name(boot_img->FilePath); in main()
1370 rv = OpenProtocolByHandle(boot_img->DeviceHandle, &devid, in main()
1404 is_last = boot_order[(sz / sizeof(boot_order[0])) - 1] == boot_current; in main()
1408 * u-boot doesn't set BootOrder, but otherwise participates in the in main()
1443 BS->SetWatchdogTimer(0, 0, 0, NULL); in main()
1476 COMMAND_SET(efi_seed_entropy, "efi-seed-entropy", "try to get entropy from the EFI RNG", command_se…
1497 * size of a single Fortuna pool -- i.e. not enough to ensure in command_seed_entropy()
1498 * that Fortuna is safely seeded -- don't expand it since we in command_seed_entropy()
1506 status = BS->LocateProtocol(&rng_guid, NULL, (VOID **)&rng); in command_seed_entropy()
1523 TSENTER2("rng->GetRNG"); in command_seed_entropy()
1524 status = rng->GetRNG(rng, NULL, size_efi, (UINT8 *)buf_efi); in command_seed_entropy()
1558 if (devsw[i]->dv_cleanup != NULL) in command_poweroff()
1559 (devsw[i]->dv_cleanup)(); in command_poweroff()
1561 RS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL); in command_poweroff()
1575 if (devsw[i]->dv_cleanup != NULL) in command_reboot()
1576 (devsw[i]->dv_cleanup)(); in command_reboot()
1578 RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); in command_reboot()
1598 status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); in command_memmap()
1604 status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); in command_memmap()
1622 efi_memory_type(p->Type), (uintmax_t)p->PhysicalStart, in command_memmap()
1623 (uintmax_t)p->VirtualStart, (uintmax_t)p->NumberOfPages); in command_memmap()
1627 if (p->Attribute & EFI_MEMORY_UC) in command_memmap()
1629 if (p->Attribute & EFI_MEMORY_WC) in command_memmap()
1631 if (p->Attribute & EFI_MEMORY_WT) in command_memmap()
1633 if (p->Attribute & EFI_MEMORY_WB) in command_memmap()
1635 if (p->Attribute & EFI_MEMORY_UCE) in command_memmap()
1637 if (p->Attribute & EFI_MEMORY_WP) in command_memmap()
1639 if (p->Attribute & EFI_MEMORY_RP) in command_memmap()
1641 if (p->Attribute & EFI_MEMORY_XP) in command_memmap()
1643 if (p->Attribute & EFI_MEMORY_NV) in command_memmap()
1645 if (p->Attribute & EFI_MEMORY_MORE_RELIABLE) in command_memmap()
1647 if (p->Attribute & EFI_MEMORY_RO) in command_memmap()
1667 (unsigned long)ST->NumberOfTableEntries); in command_configuration()
1669 for (i = 0; i < ST->NumberOfTableEntries; i++) { in command_configuration()
1673 guid = &ST->ConfigurationTable[i].VendorGuid; in command_configuration()
1681 printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); in command_configuration()
1700 conout = ST->ConOut; in command_mode()
1708 status = conout->QueryMode(conout, mode, &cols, &rows); in command_mode()
1713 status = conout->SetMode(conout, mode); in command_mode()
1722 printf("Current mode: %d\n", conout->Mode->Mode); in command_mode()
1723 for (i = 0; i <= conout->Mode->MaxMode; i++) { in command_mode()
1724 status = conout->QueryMode(conout, i, &cols, &rows); in command_mode()
1773 status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer); in command_lsefi()
1784 status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer); in command_lsefi()
1803 status = BS->ProtocolsPerHandle(handle, &protocols, &nproto); in command_lsefi()
1821 BS->FreePool(protocols); in command_lsefi()
1885 if (fstat(fd, &st) < -1) { in command_chain()
1891 status = BS->AllocatePool(EfiLoaderCode, (UINTN)st.st_size, &buf); in command_chain()
1899 (void)BS->FreePool(buf); in command_chain()
1904 status = BS->LoadImage(FALSE, IH, NULL, buf, st.st_size, &loaderhandle); in command_chain()
1905 (void)BS->FreePool(buf); in command_chain()
1921 loaded_image->LoadOptions = argp = malloc (len); in command_chain()
1922 loaded_image->LoadOptionsSize = len; in command_chain()
1929 *(--argv) = 0; in command_chain()
1939 switch (dev->d_dev->dv_type) { in command_chain()
1943 loaded_image->DeviceHandle = in command_chain()
1944 efizfs_get_handle_by_guid(z_dev->pool_guid); in command_chain()
1948 loaded_image->DeviceHandle = in command_chain()
1949 efi_find_handle(dev->d_dev, dev->d_unit); in command_chain()
1953 if (STAILQ_EMPTY(&hd->pd_part)) { in command_chain()
1954 loaded_image->DeviceHandle = hd->pd_handle; in command_chain()
1958 STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { in command_chain()
1962 if (pd->pd_unit == (uint32_t)d_dev->d_slice) { in command_chain()
1963 loaded_image->DeviceHandle = in command_chain()
1964 pd->pd_handle; in command_chain()
1973 status = BS->StartImage(loaderhandle, NULL, NULL); in command_chain()
1976 free(loaded_image->LoadOptions); in command_chain()
1977 loaded_image->LoadOptions = NULL; in command_chain()
1978 status = BS->UnloadImage(loaded_image); in command_chain()
2007 rootpath[sizeof(rootpath) -1] = '\0'; in command_netserver()