dm: lpc: only emulate COM ports specified in command line
Currently lpc emulates all the supported COM ports no matter it is configured or not in command line. Change the behavior to only emulate those specified in command line. Tracked-On: #8537 Signed-off-by: Jiaqing Zhao <jiaqing.zhao@linux.intel.com> Reviewed-by: Jian Jun Chen <jian.jun.chen@intel.com>
This commit is contained in:
parent
c3e40801dc
commit
852f10cc31
|
@ -87,6 +87,7 @@ lpc_device_parse(const char *opts)
|
||||||
if (lpcdev != NULL) {
|
if (lpcdev != NULL) {
|
||||||
for (unit = 0; unit < LPC_UART_NUM; unit++) {
|
for (unit = 0; unit < LPC_UART_NUM; unit++) {
|
||||||
if (strcasecmp(lpcdev, lpc_uart_names[unit]) == 0) {
|
if (strcasecmp(lpcdev, lpc_uart_names[unit]) == 0) {
|
||||||
|
lpc_uart_vdev[unit].enabled = 1;
|
||||||
lpc_uart_vdev[unit].opts = str;
|
lpc_uart_vdev[unit].opts = str;
|
||||||
error = 0;
|
error = 0;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -202,6 +203,9 @@ lpc_init(struct vmctx *ctx)
|
||||||
lpc_uart = &lpc_uart_vdev[unit];
|
lpc_uart = &lpc_uart_vdev[unit];
|
||||||
name = lpc_uart_names[unit];
|
name = lpc_uart_names[unit];
|
||||||
|
|
||||||
|
if (lpc_uart->enabled == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (uart_legacy_alloc(unit,
|
if (uart_legacy_alloc(unit,
|
||||||
&lpc_uart->iobase,
|
&lpc_uart->iobase,
|
||||||
&lpc_uart->irq) != 0) {
|
&lpc_uart->irq) != 0) {
|
||||||
|
|
Loading…
Reference in New Issue