Lines Matching +full:conf +full:- +full:pd
1 /*-
2 * Copyright (c) 2008-2010 Rui Paulo
6 * Copyright (c) 2016-2019 Netflix, Inc. written by M. Warner Losh
96 * in the event no currdev is found. -2 means always break, -1 means
133 status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, 0); in has_keyboard()
136 status = BS->LocateHandle(ByProtocol, &inputid, 0, &sz, in has_keyboard()
170 if ((EISA_ID_TO_NUM(acpi->HID) & 0xff00) == 0x300 && in has_keyboard()
171 (acpi->HID & 0xffff) == PNP_EISA_ID_CONST) { in has_keyboard()
185 if (usb->DeviceClass == 3 && /* HID */ in has_keyboard()
186 usb->DeviceSubClass == 1 && /* Boot devices */ in has_keyboard()
187 usb->DeviceProtocol == 1) { /* Boot keyboards */ in has_keyboard()
227 * pointer is non-null, we're a partition not a full disk in set_currdev_pdinfo()
230 if (dp->pd_devsw->dv_type == DEVT_DISK) { in set_currdev_pdinfo()
233 currdev.dd.d_dev = dp->pd_devsw; in set_currdev_pdinfo()
234 if (dp->pd_parent == NULL) { in set_currdev_pdinfo()
235 currdev.dd.d_unit = dp->pd_unit; in set_currdev_pdinfo()
239 currdev.dd.d_unit = dp->pd_parent->pd_unit; in set_currdev_pdinfo()
240 currdev.d_slice = dp->pd_unit; in set_currdev_pdinfo()
245 set_currdev_devsw(dp->pd_devsw, dp->pd_unit); in set_currdev_pdinfo()
256 stat(PATH_BOOTABLE_TOKEN, &st) == 0 || /* non-standard layout */ in sanity_check_currdev()
281 setenv("zfs-bootonce", buf, 1); in probe_zfs_currdev()
318 if (efizfs_get_guid_by_handle(pp->pd_handle, &guid)) in try_as_currdev()
346 #define SIZE(dp, edp) (size_t)((intptr_t)(void *)edp - (intptr_t)(void *)dp)
455 ucs2_to_utf8(fp->PathName, &kernel); in match_boot_info()
481 * Look at the passed-in boot_info, if any. If we find it then we need
488 * partition that has either /boot/defaults/loader.conf on it or
492 * a concession to buggy UEFI implementations, like u-boot, if
546 * a follow-on boot image in that boot_info, use that. In this in find_currdev()
550 * loader.conf. in find_currdev()
557 case BAD_CHOICE: /* specified file not found -> error */ in find_currdev()
595 dp = efiblk_get_pdinfo_by_handle(boot_img->DeviceHandle); in find_currdev()
597 text = efi_devpath_name(dp->pd_devpath); in find_currdev()
605 if (dp->pd_parent != NULL) { in find_currdev()
607 dp = dp->pd_parent; in find_currdev()
608 STAILQ_FOREACH(pp, &dp->pd_part, pd_link) { in find_currdev()
617 text = efi_devpath_name(pp->pd_devpath); in find_currdev()
634 if (efi_handle_lookup(boot_img->DeviceHandle, &dev, &unit, &extra) == 0) { in find_currdev()
675 if (fail_timeout == -2) /* Always break to OK */ in interactive_interrupt()
677 if (fail_timeout == -1) /* Never break to OK */ in interactive_interrupt()
682 fail_timeout - (int)(now - then)); in interactive_interrupt()
690 } while (now - then < fail_timeout); in interactive_interrupt()
710 * args from UCS-2 to ASCII (16 to 8 bit) as they are copied (though this in parse_args()
711 * method is flawed for non-ASCII characters). in parse_args()
746 while (length--) in acpi_checksum()
764 rsdt = (ACPI_TABLE_RSDT *)(uintptr_t)rsdp->RsdtPhysicalAddress; in acpi_find_table()
765 xsdt = (ACPI_TABLE_XSDT *)(uintptr_t)rsdp->XsdtPhysicalAddress; in acpi_find_table()
766 if (rsdp->Revision < 2) { in acpi_find_table()
773 entries = (sdp->Length - sizeof(ACPI_TABLE_HEADER)) / addr_size; in acpi_find_table()
776 addr = le32toh(rsdt->TableOffsetEntry[i]); in acpi_find_table()
778 addr = le64toh(xsdt->TableOffsetEntry[i]); in acpi_find_table()
782 if (acpi_checksum(sdp, sdp->Length)) { in acpi_find_table()
784 sdp->Signature); in acpi_find_table()
787 if (memcmp(sig, sdp->Signature, 4) == 0) in acpi_find_table()
805 [0x0d] = "pl011", /* Arm SBSA 32-bit width */ in acpi_uart_type()
818 static int baud[] = { 0, -1, -1, 9600, 19200, -1, 57600, 115200 }; in acpi_uart_baud()
821 return (-1); in acpi_uart_baud()
831 return (-1); in acpi_uart_regionwidth()
832 return (1 << (rw - 1)); in acpi_uart_regionwidth()
849 * the uart(4) console string. We use io == -1 to select between I/O ports and
857 int br, db, io, rs, rw, sb, xo, pv, pd; in check_acpi_spcr() local
865 dt = acpi_uart_type(spcr->InterfaceType); in check_acpi_spcr()
867 printf("UART Type %d not known\n", spcr->InterfaceType); in check_acpi_spcr()
872 io = -1; in check_acpi_spcr()
873 pv = spcr->PciVendorId; in check_acpi_spcr()
874 pd = spcr->PciDeviceId; in check_acpi_spcr()
875 if (pv == 0xffff && pd == 0xffff) { in check_acpi_spcr()
876 if (spcr->SerialPort.SpaceId == 1) in check_acpi_spcr()
877 io = spcr->SerialPort.Address; in check_acpi_spcr()
879 mm = spcr->SerialPort.Address; in check_acpi_spcr()
880 rs = ffs(spcr->SerialPort.BitWidth) - 4; in check_acpi_spcr()
881 rw = acpi_uart_regionwidth(spcr->SerialPort.AccessWidth); in check_acpi_spcr()
888 pa = acpi_uart_parity(spcr->Parity); in check_acpi_spcr()
889 sb = spcr->StopBits; in check_acpi_spcr()
897 if (spcr->Header.Revision <= 2) in check_acpi_spcr()
900 xo = spcr->UartClkFreq; in check_acpi_spcr()
903 * PreciseBaudrate, when non-zero, is to be preferred. It's only valid, in check_acpi_spcr()
905 * old, we do the old-style table lookup. Otherwise we believe it. in check_acpi_spcr()
907 if (spcr->Header.Revision <= 3 || spcr->PreciseBaudrate == 0) in check_acpi_spcr()
908 br = acpi_uart_baud(spcr->BaudRate); in check_acpi_spcr()
910 br = spcr->PreciseBaudrate; in check_acpi_spcr()
912 if (io != -1) { in check_acpi_spcr()
915 } else if (pv != 0xffff && pd != 0xffff) { in check_acpi_spcr()
916 asprintf(&val, "db:%d,dt:%s,pv:%#x,pd:%#x,pa:%s,br:%d,xo=%d", in check_acpi_spcr()
917 db, dt, pv, pd, pa, br, xo); in check_acpi_spcr()
934 * and if we don't, we default to video. If there's a dual-console situation
991 if (EISA_ID_TO_NUM(acpi->HID) == 0x501) { in parse_uefi_con_out()
992 setenv_int("efi_8250_uid", acpi->UID); in parse_uefi_con_out()
999 setenv_int("efi_com_speed", uart->BaudRate); in parse_uefi_con_out()
1049 int fd = -1; in parse_loader_efi_config()
1059 if (fd == -1) in parse_loader_efi_config()
1099 * it here, even if the typical idium would have '- 1' here to in read_loader_env()
1112 parse_loader_efi_config(boot_img->DeviceHandle, fn); in read_loader_env()
1135 revision = rsdp->Revision; in acpi_detect()
1140 strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); in acpi_detect()
1141 buf[sizeof(rsdp->OemId)] = '\0'; in acpi_detect()
1143 sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); in acpi_detect()
1148 (unsigned long long)rsdp->XsdtPhysicalAddress); in acpi_detect()
1150 sprintf(buf, "%d", rsdp->Length); in acpi_detect()
1161 for (k = 0; k < ST->NumberOfTableEntries; k++) { in efi_smbios_detect()
1163 VOID *const VT = ST->ConfigurationTable[k].VendorTable; in efi_smbios_detect()
1167 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()
1280 * there, which are subtly different than loader.conf variables. Only 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()
1557 if (devsw[i]->dv_cleanup != NULL) in command_poweroff()
1558 (devsw[i]->dv_cleanup)(); in command_poweroff()
1560 RS->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL); in command_poweroff()
1574 if (devsw[i]->dv_cleanup != NULL) in command_reboot()
1575 (devsw[i]->dv_cleanup)(); in command_reboot()
1577 RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); in command_reboot()
1597 status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); in command_memmap()
1603 status = BS->GetMemoryMap(&sz, map, &key, &dsz, &dver); in command_memmap()
1621 efi_memory_type(p->Type), (uintmax_t)p->PhysicalStart, in command_memmap()
1622 (uintmax_t)p->VirtualStart, (uintmax_t)p->NumberOfPages); in command_memmap()
1626 if (p->Attribute & EFI_MEMORY_UC) in command_memmap()
1628 if (p->Attribute & EFI_MEMORY_WC) in command_memmap()
1630 if (p->Attribute & EFI_MEMORY_WT) in command_memmap()
1632 if (p->Attribute & EFI_MEMORY_WB) in command_memmap()
1634 if (p->Attribute & EFI_MEMORY_UCE) in command_memmap()
1636 if (p->Attribute & EFI_MEMORY_WP) in command_memmap()
1638 if (p->Attribute & EFI_MEMORY_RP) in command_memmap()
1640 if (p->Attribute & EFI_MEMORY_XP) in command_memmap()
1642 if (p->Attribute & EFI_MEMORY_NV) in command_memmap()
1644 if (p->Attribute & EFI_MEMORY_MORE_RELIABLE) in command_memmap()
1646 if (p->Attribute & EFI_MEMORY_RO) in command_memmap()
1666 (unsigned long)ST->NumberOfTableEntries); in command_configuration()
1668 for (i = 0; i < ST->NumberOfTableEntries; i++) { in command_configuration()
1672 guid = &ST->ConfigurationTable[i].VendorGuid; in command_configuration()
1680 printf(" at %p\n", ST->ConfigurationTable[i].VendorTable); in command_configuration()
1699 conout = ST->ConOut; in command_mode()
1707 status = conout->QueryMode(conout, mode, &cols, &rows); in command_mode()
1712 status = conout->SetMode(conout, mode); in command_mode()
1721 printf("Current mode: %d\n", conout->Mode->Mode); in command_mode()
1722 for (i = 0; i <= conout->Mode->MaxMode; i++) { in command_mode()
1723 status = conout->QueryMode(conout, i, &cols, &rows); in command_mode()
1772 status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer); in command_lsefi()
1783 status = BS->LocateHandle(AllHandles, NULL, NULL, &bufsz, buffer); in command_lsefi()
1802 status = BS->ProtocolsPerHandle(handle, &protocols, &nproto); in command_lsefi()
1820 BS->FreePool(protocols); in command_lsefi()
1884 if (fstat(fd, &st) < -1) { in command_chain()
1890 status = BS->AllocatePool(EfiLoaderCode, (UINTN)st.st_size, &buf); in command_chain()
1898 (void)BS->FreePool(buf); in command_chain()
1903 status = BS->LoadImage(FALSE, IH, NULL, buf, st.st_size, &loaderhandle); in command_chain()
1904 (void)BS->FreePool(buf); in command_chain()
1920 loaded_image->LoadOptions = argp = malloc (len); in command_chain()
1921 loaded_image->LoadOptionsSize = len; in command_chain()
1928 *(--argv) = 0; in command_chain()
1936 pdinfo_t *hd, *pd; in command_chain() local
1938 switch (dev->d_dev->dv_type) { in command_chain()
1942 loaded_image->DeviceHandle = in command_chain()
1943 efizfs_get_handle_by_guid(z_dev->pool_guid); in command_chain()
1947 loaded_image->DeviceHandle = in command_chain()
1948 efi_find_handle(dev->d_dev, dev->d_unit); in command_chain()
1952 if (STAILQ_EMPTY(&hd->pd_part)) { in command_chain()
1953 loaded_image->DeviceHandle = hd->pd_handle; in command_chain()
1957 STAILQ_FOREACH(pd, &hd->pd_part, pd_link) { in command_chain()
1961 if (pd->pd_unit == (uint32_t)d_dev->d_slice) { in command_chain()
1962 loaded_image->DeviceHandle = in command_chain()
1963 pd->pd_handle; in command_chain()
1972 status = BS->StartImage(loaderhandle, NULL, NULL); in command_chain()
1975 free(loaded_image->LoadOptions); in command_chain()
1976 loaded_image->LoadOptions = NULL; in command_chain()
1977 status = BS->UnloadImage(loaded_image); in command_chain()
2006 rootpath[sizeof(rootpath) -1] = '\0'; in command_netserver()