1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| struct stm32_uart_info stm32f4_info = { .stm32f4 = true, .uart_enable_bit = 13, .has_fifo = false, };
struct stm32_uart_info stm32f7_info = { .uart_enable_bit = 0, .stm32f4 = false, .has_fifo = true, };
struct stm32_uart_info stm32h7_info = { .uart_enable_bit = 0, .stm32f4 = false, .has_fifo = true, };
static const struct udevice_id stm32_serial_id[] = { { .compatible = "st,stm32-uart", .data = (ulong)&stm32f4_info}, { .compatible = "st,stm32f7-uart", .data = (ulong)&stm32f7_info}, { .compatible = "st,stm32h7-uart", .data = (ulong)&stm32h7_info}, {} };
static const struct dm_serial_ops stm32_serial_ops = { .putc = stm32_serial_putc, .pending = stm32_serial_pending, .getc = stm32_serial_getc, .setbrg = stm32_serial_setbrg, .setconfig = stm32_serial_setconfig };
U_BOOT_DRIVER(serial_stm32) = { .name = "serial_stm32", .id = UCLASS_SERIAL, .of_match = of_match_ptr(stm32_serial_id), .of_to_plat = of_match_ptr(stm32_serial_of_to_plat), .plat_auto = sizeof(struct stm32x7_serial_plat), .ops = &stm32_serial_ops, .probe = stm32_serial_probe, #if !CONFIG_IS_ENABLED(OF_CONTROL) .flags = DM_FLAG_PRE_RELOC, #endif };
|