@@ -28,26 +28,38 @@ struct console_uart {
28
28
uint32_t reg_width ;
29
29
};
30
30
31
+ #ifndef CONFIG_SERIAL_REG_WIDTH
32
+ #if defined(CONFIG_SERIAL_PIO_BASE )
33
+ #define CONFIG_SERIAL_REG_WIDTH 1
34
+ #elif defined(CONFIG_SERIAL_PCI_BDF )
35
+ #define CONFIG_SERIAL_REG_WIDTH 4
36
+ #elif defined(CONFIG_SERIAL_MMIO_BASE )
37
+ #define CONFIG_SERIAL_REG_WIDTH 1
38
+ #else
39
+ #define CONFIG_SERIAL_REG_WIDTH 1
40
+ #endif
41
+ #endif
42
+
31
43
#if defined(CONFIG_SERIAL_PIO_BASE )
32
44
static struct console_uart uart = {
33
- .enabled = true,
34
- .type = PIO ,
35
- .port_address = CONFIG_SERIAL_PIO_BASE ,
36
- .reg_width = 1 ,
45
+ .enabled = true,
46
+ .type = PIO ,
47
+ .port_address = CONFIG_SERIAL_PIO_BASE ,
48
+ .reg_width = CONFIG_SERIAL_REG_WIDTH ,
37
49
};
38
50
#elif defined(CONFIG_SERIAL_PCI_BDF )
39
51
static struct console_uart uart = {
40
- .enabled = true,
41
- .type = PCI ,
42
- .bdf .value = CONFIG_SERIAL_PCI_BDF ,
43
- .reg_width = 4 ,
52
+ .enabled = true,
53
+ .type = PCI ,
54
+ .bdf .value = CONFIG_SERIAL_PCI_BDF ,
55
+ .reg_width = CONFIG_SERIAL_REG_WIDTH ,
44
56
};
45
57
#elif defined(CONFIG_SERIAL_MMIO_BASE )
46
58
static struct console_uart uart = {
47
- .enabled = true,
48
- .type = MMIO ,
49
- .mmio_base_vaddr = (void * )CONFIG_SERIAL_MMIO_BASE ,
50
- .reg_width = 1 ,
59
+ .enabled = true,
60
+ .type = MMIO ,
61
+ .mmio_base_vaddr = (void * )CONFIG_SERIAL_MMIO_BASE ,
62
+ .reg_width = CONFIG_SERIAL_REG_WIDTH ,
51
63
};
52
64
#endif
53
65
0 commit comments