diff options
Diffstat (limited to 'drivers/acpi/spcr.c')
-rw-r--r-- | drivers/acpi/spcr.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c index 324b35bfe781..89e97d21a89c 100644 --- a/drivers/acpi/spcr.c +++ b/drivers/acpi/spcr.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * occasionally getting stuck as 1. To avoid the potential for a hang, check | 21 | * occasionally getting stuck as 1. To avoid the potential for a hang, check |
22 | * TXFE == 0 instead of BUSY == 1. This may not be suitable for all UART | 22 | * TXFE == 0 instead of BUSY == 1. This may not be suitable for all UART |
23 | * implementations, so only do so if an affected platform is detected in | 23 | * implementations, so only do so if an affected platform is detected in |
24 | * parse_spcr(). | 24 | * acpi_parse_spcr(). |
25 | */ | 25 | */ |
26 | bool qdf2400_e44_present; | 26 | bool qdf2400_e44_present; |
27 | EXPORT_SYMBOL(qdf2400_e44_present); | 27 | EXPORT_SYMBOL(qdf2400_e44_present); |
@@ -74,19 +74,21 @@ static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | /** | 76 | /** |
77 | * parse_spcr() - parse ACPI SPCR table and add preferred console | 77 | * acpi_parse_spcr() - parse ACPI SPCR table and add preferred console |
78 | * | 78 | * |
79 | * @earlycon: set up earlycon for the console specified by the table | 79 | * @enable_earlycon: set up earlycon for the console specified by the table |
80 | * @enable_console: setup the console specified by the table. | ||
80 | * | 81 | * |
81 | * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be | 82 | * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be |
82 | * defined to parse ACPI SPCR table. As a result of the parsing preferred | 83 | * defined to parse ACPI SPCR table. As a result of the parsing preferred |
83 | * console is registered and if @earlycon is true, earlycon is set up. | 84 | * console is registered and if @enable_earlycon is true, earlycon is set up. |
85 | * If @enable_console is true the system console is also configured. | ||
84 | * | 86 | * |
85 | * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called | 87 | * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called |
86 | * from arch initialization code as soon as the DT/ACPI decision is made. | 88 | * from arch initialization code as soon as the DT/ACPI decision is made. |
87 | * | 89 | * |
88 | */ | 90 | */ |
89 | int __init parse_spcr(bool earlycon) | 91 | int __init acpi_parse_spcr(bool enable_earlycon, bool enable_console) |
90 | { | 92 | { |
91 | static char opts[64]; | 93 | static char opts[64]; |
92 | struct acpi_table_spcr *table; | 94 | struct acpi_table_spcr *table; |
@@ -105,11 +107,8 @@ int __init parse_spcr(bool earlycon) | |||
105 | if (ACPI_FAILURE(status)) | 107 | if (ACPI_FAILURE(status)) |
106 | return -ENOENT; | 108 | return -ENOENT; |
107 | 109 | ||
108 | if (table->header.revision < 2) { | 110 | if (table->header.revision < 2) |
109 | err = -ENOENT; | 111 | pr_info("SPCR table version %d\n", table->header.revision); |
110 | pr_err("wrong table version\n"); | ||
111 | goto done; | ||
112 | } | ||
113 | 112 | ||
114 | if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { | 113 | if (table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) { |
115 | switch (ACPI_ACCESS_BIT_WIDTH(( | 114 | switch (ACPI_ACCESS_BIT_WIDTH(( |
@@ -185,7 +184,7 @@ int __init parse_spcr(bool earlycon) | |||
185 | */ | 184 | */ |
186 | if (qdf2400_erratum_44_present(&table->header)) { | 185 | if (qdf2400_erratum_44_present(&table->header)) { |
187 | qdf2400_e44_present = true; | 186 | qdf2400_e44_present = true; |
188 | if (earlycon) | 187 | if (enable_earlycon) |
189 | uart = "qdf2400_e44"; | 188 | uart = "qdf2400_e44"; |
190 | } | 189 | } |
191 | 190 | ||
@@ -205,11 +204,13 @@ int __init parse_spcr(bool earlycon) | |||
205 | 204 | ||
206 | pr_info("console: %s\n", opts); | 205 | pr_info("console: %s\n", opts); |
207 | 206 | ||
208 | if (earlycon) | 207 | if (enable_earlycon) |
209 | setup_earlycon(opts); | 208 | setup_earlycon(opts); |
210 | 209 | ||
211 | err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); | 210 | if (enable_console) |
212 | 211 | err = add_preferred_console(uart, 0, opts + strlen(uart) + 1); | |
212 | else | ||
213 | err = 0; | ||
213 | done: | 214 | done: |
214 | acpi_put_table((struct acpi_table_header *)table); | 215 | acpi_put_table((struct acpi_table_header *)table); |
215 | return err; | 216 | return err; |