Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/uart/uart_cpu_arm64.c
Show First 20 Lines • Show All 143 Lines • ▼ Show 20 Lines | uart_cpu_acpi_probe(struct uart_class **classp, bus_space_tag_t *bst, | ||||
} | } | ||||
err = acpi_map_addr(&spcr->SerialPort, bst, bsh, PAGE_SIZE); | err = acpi_map_addr(&spcr->SerialPort, bst, bsh, PAGE_SIZE); | ||||
if (err != 0) | if (err != 0) | ||||
goto out; | goto out; | ||||
*classp = cd->cd_class; | *classp = cd->cd_class; | ||||
*rclk = 0; | *rclk = 0; | ||||
*shiftp = 2; | |||||
*iowidthp = spcr->SerialPort.BitWidth / 8; | *iowidthp = spcr->SerialPort.BitWidth / 8; | ||||
switch (spcr->InterfaceType) { | |||||
andrew: `ACPI_DBG2_ARM_SBSA_32BIT` should be added to the pl011 acpi compat data so this is unneeded. | |||||
case ACPI_DBG2_16550_COMPATIBLE: /* fallthrough */ | |||||
case ACPI_DBG2_16550_SUBSET: | |||||
Not Done Inline Actionssmall nit: {} optional. no big deal either way. imp: small nit: {} optional. no big deal either way.
| |||||
*shiftp = 0; | |||||
Done Inline ActionsDo we need the BitWidth and AccessWidth checks? andrew: Do we need the BitWidth and AccessWidth checks? | |||||
break; | |||||
Done Inline ActionsThis should be if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) == UART_F_IGNORE_SPCR_REGSHFT) { andrew: This should be
```
if ((cd->cd_quirks & UART_F_IGNORE_SPCR_REGSHFT) ==… | |||||
case ACPI_DBG2_ARM_PL011: /* fallthrough */ | |||||
case ACPI_DBG2_ARM_SBSA_32BIT: | |||||
case ACPI_DBG2_ARM_SBSA_GENERIC: | |||||
*shiftp = 2; | |||||
break; | |||||
default: | |||||
printf("uart_cpu_acpi_probe: unknown InterfaceType %d", | |||||
spcr->InterfaceType); | |||||
Done Inline ActionsShould still default to *shiftp = 2 in this case I think? emaste: Should still default to `*shiftp = 2` in this case I think? | |||||
*shiftp = 2; | |||||
} | |||||
out: | out: | ||||
acpi_unmap_table(spcr); | acpi_unmap_table(spcr); | ||||
return (err); | return (err); | ||||
} | } | ||||
#endif | #endif | ||||
int | int | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |
ACPI_DBG2_ARM_SBSA_32BIT should be added to the pl011 acpi compat data so this is unneeded.