All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-05 12:36 ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Aleksey Makarov, Russell King, Greg Kroah-Hartman, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang

'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
Redirection Table) [2] as a mandatory ACPI table that specifies the
configuration of serial console.

Move "earlycon" early_param handling to earlycon.c to parse this option once

Parse SPCR table, setup earlycon and register specified console.

Enable parsing this table on ARM64.  Earlycon should be set up as early as
possible.  ACPI boot tables are mapped in
arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
that's where we parse spcr.  So it has to be opted-in per-arch. When
ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
DT/ACPI decision is done.

Implement console_match() for pl011.

Based on the work by Leif Lindholm [3]
Thanks to Peter Hurley for explaining how this should work.

Should be applied to v4.8-rc5
Tested on QEMU and ThunderX.
SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.

v10:
- rebase to v4.8-rc5
- fix the issue with comparing the console name in pl011_console_match()
  (Russell King)
- fix build on sh arch (kbuild test robot)
- add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
- add Tested-by: Christopher Covington <cov@codeaurora.org>

v9:
https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov@linaro.org
- rebase to v4.8-rc1
- fix compilation for !CONFIG_SERIAL_EARLYCON case
- add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
- move constant check out of loop (Yury Norov)
- add '\n' to info message

v8:
https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov@linaro.org
- rebase to next-20160520
- remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
  as it have got to linux-next
- add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
  Peter Hurley <peter@hurleysoftware.com> (but see below)
- fix the patch "serial: pl011: add console matching function".  The patch by
  Christopher Covington [4] specifies that SBSA uart does 32-bit access to
  registers and this breaks the match function.  In this series the function
  was changed to match when SPCR specifies both mmio32 and mmio access.
  I removed Acked-by: Greg from this patch because of these changes.

v7:
https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org
- add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
  to serial"
- call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
  (Rafael J. Wysocki)
- fix a few minor issues (Rafael J. Wysocki)

v6:
https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov@linaro.org
- add documentation for parse_spcr() functioin (Yury Norov)
- don't initialize err variable (Yury Norov)
- add __initdata for the earlycon_init_is_deferred flag variable
- rename the function exported in "of/serial: move earlycon early_param handling
  to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
- defer initialization of DT earlycon until DT/ACPI decision is made
  (Rob Herring, Peter Hurley)
- use snprintf instead of sprintf (Andy Shevchenko)
- drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
  equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
  SPCR earlycon will not work on the kernels before 4.6

v5:
https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov@linaro.org
- drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
  it is ugly. Also because Christopher Covington came with a better solution [4]
- remove error message when the table is not provided by ACPI (Andy Shevchenko)
- rewrite spcr.c following the suggestions by Peter Hurley
- add console_match() for pl011 in a separate patch
- add EARLYCON_DECLARE for pl011 in a separate patch
- add patch "of/serial: move earlycon early_param handling to serial" from
  the GDB2 series

v4:
https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov@linaro.org
- drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
  ACPI developers work on a new API and asked not to do that.
  Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
  and cache the result. (Lv Zheng)
- fix some style issues (Yury Norov)

v3:
https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov@linaro.org

Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:

- drop acpi_match() member of struct console
- drop implementations of this member for pl011 and 8250
- drop the patch that renames some vars in printk.c as it is not needed anymore
- drop patch that introduces system wide acpi_table_parse2().
  Instead introduce a custom acpi_table_parse_spcr() in spcr.c

Instead of introducing a new match_acpi() member of struct console,
this patchset introduces a new function acpi_console_check().
This function is called when a new uart is registered at serial_core.c
the same way OF code checks for console.  If the registered uart is the
console specified by SPCR table, this function calls add_preferred_console()

The restrictions of this approach are:

- only serial consoles can be set up
- only consoles specified by the memory/io address can be set up
  (SPCR can specify devices by PCI id/PCI address)

v2:
https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org
- don't use SPCR if user specified console in command line
- fix initialization order of newcon->index = 0
- rename some variables at printk.c (Joe Perches, Peter Hurley)
- enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
- remove the retry loop for console registering (Peter Hurley).
  Instead, obtain SPCR with acpi_get_table().  That works after
  call to acpi_early_init() i. e. in any *_initcall()
- describe design decision behind introducing acpi_match() (Peter Hurley)
- fix compilation for x86 + ACPI (Graeme Gregory)
- introduce DBG2 constants in a separate patch (Andy Shevchenko)
- fix a typo in DBG2 constants (Andy Shevchenko)
- add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
- add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
- add documentation for functions
- add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
  accessor functions (Christopher Covington)
- change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
- introduce acpi_table_parse2() in a separate patch
- fix fetching the SPCR table early (Mark Salter)
- add a patch from Mark Salter that introduces support for matching 8250-based
  consoles

v1:
https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
[3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm@linaro.org
[4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov@codeaurora.org

Aleksey Makarov (3):
  ACPI: parse SPCR and enable matching console
  ARM64: ACPI: enable ACPI_SPCR_TABLE
  serial: pl011: add console matching function

Leif Lindholm (1):
  of/serial: move earlycon early_param handling to serial

 arch/arm64/Kconfig              |   1 +
 arch/arm64/kernel/acpi.c        |  11 +++-
 drivers/acpi/Kconfig            |   3 ++
 drivers/acpi/Makefile           |   1 +
 drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
 drivers/of/fdt.c                |  11 +---
 drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
 drivers/tty/serial/earlycon.c   |  19 ++++++-
 include/linux/acpi.h            |   6 +++
 include/linux/of_fdt.h          |   3 ++
 include/linux/serial_core.h     |   9 +++-
 11 files changed, 216 insertions(+), 14 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

-- 
2.9.3


^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-05 12:36 ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
Redirection Table) [2] as a mandatory ACPI table that specifies the
configuration of serial console.

Move "earlycon" early_param handling to earlycon.c to parse this option once

Parse SPCR table, setup earlycon and register specified console.

Enable parsing this table on ARM64.  Earlycon should be set up as early as
possible.  ACPI boot tables are mapped in
arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
that's where we parse spcr.  So it has to be opted-in per-arch. When
ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
DT/ACPI decision is done.

Implement console_match() for pl011.

Based on the work by Leif Lindholm [3]
Thanks to Peter Hurley for explaining how this should work.

Should be applied to v4.8-rc5
Tested on QEMU and ThunderX.
SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.

v10:
- rebase to v4.8-rc5
- fix the issue with comparing the console name in pl011_console_match()
  (Russell King)
- fix build on sh arch (kbuild test robot)
- add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
- add Tested-by: Christopher Covington <cov@codeaurora.org>

v9:
https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov at linaro.org
- rebase to v4.8-rc1
- fix compilation for !CONFIG_SERIAL_EARLYCON case
- add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
- move constant check out of loop (Yury Norov)
- add '\n' to info message

v8:
https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov at linaro.org
- rebase to next-20160520
- remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
  as it have got to linux-next
- add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
  Peter Hurley <peter@hurleysoftware.com> (but see below)
- fix the patch "serial: pl011: add console matching function".  The patch by
  Christopher Covington [4] specifies that SBSA uart does 32-bit access to
  registers and this breaks the match function.  In this series the function
  was changed to match when SPCR specifies both mmio32 and mmio access.
  I removed Acked-by: Greg from this patch because of these changes.

v7:
https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov at linaro.org
- add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
  to serial"
- call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
  (Rafael J. Wysocki)
- fix a few minor issues (Rafael J. Wysocki)

v6:
https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov at linaro.org
- add documentation for parse_spcr() functioin (Yury Norov)
- don't initialize err variable (Yury Norov)
- add __initdata for the earlycon_init_is_deferred flag variable
- rename the function exported in "of/serial: move earlycon early_param handling
  to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
- defer initialization of DT earlycon until DT/ACPI decision is made
  (Rob Herring, Peter Hurley)
- use snprintf instead of sprintf (Andy Shevchenko)
- drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
  equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
  SPCR earlycon will not work on the kernels before 4.6

v5:
https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov at linaro.org
- drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
  it is ugly. Also because Christopher Covington came with a better solution [4]
- remove error message when the table is not provided by ACPI (Andy Shevchenko)
- rewrite spcr.c following the suggestions by Peter Hurley
- add console_match() for pl011 in a separate patch
- add EARLYCON_DECLARE for pl011 in a separate patch
- add patch "of/serial: move earlycon early_param handling to serial" from
  the GDB2 series

v4:
https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov at linaro.org
- drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
  ACPI developers work on a new API and asked not to do that.
  Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
  and cache the result. (Lv Zheng)
- fix some style issues (Yury Norov)

v3:
https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov at linaro.org

Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:

- drop acpi_match() member of struct console
- drop implementations of this member for pl011 and 8250
- drop the patch that renames some vars in printk.c as it is not needed anymore
- drop patch that introduces system wide acpi_table_parse2().
  Instead introduce a custom acpi_table_parse_spcr() in spcr.c

Instead of introducing a new match_acpi() member of struct console,
this patchset introduces a new function acpi_console_check().
This function is called when a new uart is registered at serial_core.c
the same way OF code checks for console.  If the registered uart is the
console specified by SPCR table, this function calls add_preferred_console()

The restrictions of this approach are:

- only serial consoles can be set up
- only consoles specified by the memory/io address can be set up
  (SPCR can specify devices by PCI id/PCI address)

v2:
https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov at linaro.org
- don't use SPCR if user specified console in command line
- fix initialization order of newcon->index = 0
- rename some variables at printk.c (Joe Perches, Peter Hurley)
- enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
- remove the retry loop for console registering (Peter Hurley).
  Instead, obtain SPCR with acpi_get_table().  That works after
  call to acpi_early_init() i. e. in any *_initcall()
- describe design decision behind introducing acpi_match() (Peter Hurley)
- fix compilation for x86 + ACPI (Graeme Gregory)
- introduce DBG2 constants in a separate patch (Andy Shevchenko)
- fix a typo in DBG2 constants (Andy Shevchenko)
- add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
- add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
- add documentation for functions
- add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
  accessor functions (Christopher Covington)
- change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
- introduce acpi_table_parse2() in a separate patch
- fix fetching the SPCR table early (Mark Salter)
- add a patch from Mark Salter that introduces support for matching 8250-based
  consoles

v1:
https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov at linaro.org

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
[3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm at linaro.org
[4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov at codeaurora.org

Aleksey Makarov (3):
  ACPI: parse SPCR and enable matching console
  ARM64: ACPI: enable ACPI_SPCR_TABLE
  serial: pl011: add console matching function

Leif Lindholm (1):
  of/serial: move earlycon early_param handling to serial

 arch/arm64/Kconfig              |   1 +
 arch/arm64/kernel/acpi.c        |  11 +++-
 drivers/acpi/Kconfig            |   3 ++
 drivers/acpi/Makefile           |   1 +
 drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
 drivers/of/fdt.c                |  11 +---
 drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
 drivers/tty/serial/earlycon.c   |  19 ++++++-
 include/linux/acpi.h            |   6 +++
 include/linux/of_fdt.h          |   3 ++
 include/linux/serial_core.h     |   9 +++-
 11 files changed, 216 insertions(+), 14 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

-- 
2.9.3

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 1/4] of/serial: move earlycon early_param handling to serial
  2016-09-05 12:36 ` Aleksey Makarov
  (?)
@ 2016-09-05 12:36   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: Kefeng Wang, Yury Norov, Zheng, Lv, Frank Rowand, Russell King,
	linux-acpi, Andy Shevchenko, linux-serial, Mark Salter,
	Len Brown, devicetree, Jiri Slaby, Leif Lindholm,
	Aleksey Makarov, Rob Herring, Christopher Covington, Al Stone,
	linux-arm-kernel, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, linux-kernel

From: Leif Lindholm <leif.lindholm@linaro.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 1/4] of/serial: move earlycon early_param handling to serial
@ 2016-09-05 12:36   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Aleksey Makarov, Russell King, Greg Kroah-Hartman, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Rob Herring, Frank Rowand, Jiri Slaby,
	devicetree

From: Leif Lindholm <leif.lindholm@linaro.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 1/4] of/serial: move earlycon early_param handling to serial
@ 2016-09-05 12:36   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

From: Leif Lindholm <leif.lindholm@linaro.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 2/4] ACPI: parse SPCR and enable matching console
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-05 12:36   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Aleksey Makarov, Russell King, Greg Kroah-Hartman, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
Console Redirection Table) [2] as a mandatory ACPI table that
specifies the configuration of serial console.

Defer initialization of DT earlycon until ACPI/DT decision is made.

Parse the ACPI SPCR table, setup earlycon if required,
enable specified console.

Thanks to Peter Hurley for explaining how this should work.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/acpi/Kconfig          |   3 ++
 drivers/acpi/Makefile         |   1 +
 drivers/acpi/spcr.c           | 111 ++++++++++++++++++++++++++++++++++++++++++
 drivers/tty/serial/earlycon.c |  19 +++++++-
 include/linux/acpi.h          |   6 +++
 include/linux/serial_core.h   |   9 +++-
 6 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 6cef2d1..4a269f9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -77,6 +77,9 @@ config ACPI_DEBUGGER_USER
 
 endif
 
+config ACPI_SPCR_TABLE
+	bool
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index e5ada78..d799593 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -81,6 +81,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS)	+= ec_sys.o
 obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
 obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 obj-$(CONFIG_ACPI_CPPC_LIB)	+= cppc_acpi.o
+obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
 obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
 
 # processor has its own "processor." module_param namespace
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
new file mode 100644
index 0000000..e8d7bc7
--- /dev/null
+++ b/drivers/acpi/spcr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012, Intel Corporation
+ * Copyright (c) 2015, Red Hat, Inc.
+ * Copyright (c) 2015, 2016 Linaro Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#define pr_fmt(fmt) "ACPI: SPCR: " fmt
+
+#include <linux/acpi.h>
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/serial_core.h>
+
+/**
+ * parse_spcr() - parse ACPI SPCR table and add preferred console
+ *
+ * @earlycon: set up earlycon for the console specified by the table
+ *
+ * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
+ * defined to parse ACPI SPCR table.  As a result of the parsing preferred
+ * console is registered and if @earlycon is true, earlycon is set up.
+ *
+ * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
+ * from arch inintialization code as soon as the DT/ACPI decision is made.
+ *
+ */
+int __init parse_spcr(bool earlycon)
+{
+	static char opts[64];
+	struct acpi_table_spcr *table;
+	acpi_size table_size;
+	acpi_status status;
+	char *uart;
+	char *iotype;
+	int baud_rate;
+	int err;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0,
+					  (struct acpi_table_header **)&table,
+					  &table_size);
+
+	if (ACPI_FAILURE(status))
+		return -ENOENT;
+
+	if (table->header.revision < 2) {
+		err = -ENOENT;
+		pr_err("wrong table version\n");
+		goto done;
+	}
+
+	iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
+			"mmio" : "io";
+
+	switch (table->interface_type) {
+	case ACPI_DBG2_ARM_SBSA_32BIT:
+		iotype = "mmio32";
+		/* fall through */
+	case ACPI_DBG2_ARM_PL011:
+	case ACPI_DBG2_ARM_SBSA_GENERIC:
+	case ACPI_DBG2_BCM2835:
+		uart = "pl011";
+		break;
+	case ACPI_DBG2_16550_COMPATIBLE:
+	case ACPI_DBG2_16550_SUBSET:
+		uart = "uart";
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	switch (table->baud_rate) {
+	case 3:
+		baud_rate = 9600;
+		break;
+	case 4:
+		baud_rate = 19200;
+		break;
+	case 6:
+		baud_rate = 57600;
+		break;
+	case 7:
+		baud_rate = 115200;
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
+		 table->serial_port.address, baud_rate);
+
+	pr_info("console: %s\n", opts);
+
+	if (earlycon)
+		setup_earlycon(opts);
+
+	err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
+
+done:
+	early_acpi_os_unmap_memory((void __iomem *)table, table_size);
+	return err;
+}
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 7aae655..ea00b9f 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -21,6 +21,7 @@
 #include <linux/sizes.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/acpi.h>
 
 #ifdef CONFIG_FIX_EARLYCON_MEM
 #include <asm/fixmap.h>
@@ -199,6 +200,14 @@ int __init setup_earlycon(char *buf)
 	return -ENOENT;
 }
 
+/*
+ * When CONFIG_ACPI_SPCR_TABLE is defined, "earlycon" without parameters in
+ * command line does not start DT earlycon immediately, instead it defers
+ * starting it until DT/ACPI decision is made.  At that time if ACPI is enabled
+ * call parse_spcr(), else call early_init_dt_scan_chosen_stdout()
+ */
+bool earlycon_init_is_deferred __initdata;
+
 /* early_param wrapper for setup_earlycon() */
 static int __init param_setup_earlycon(char *buf)
 {
@@ -208,8 +217,14 @@ static int __init param_setup_earlycon(char *buf)
 	 * Just 'earlycon' is a valid param for devicetree earlycons;
 	 * don't generate a warning from parse_early_params() in that case
 	 */
-	if (!buf || !buf[0])
-		return early_init_dt_scan_chosen_stdout();
+	if (!buf || !buf[0]) {
+		if (IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) {
+			earlycon_init_is_deferred = true;
+			return 0;
+		} else {
+			return early_init_dt_scan_chosen_stdout();
+		}
+	}
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c5eaf2f..2353827 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1074,4 +1074,10 @@ void acpi_table_upgrade(void);
 static inline void acpi_table_upgrade(void) { }
 #endif
 
+#ifdef CONFIG_ACPI_SPCR_TABLE
+int parse_spcr(bool earlycon);
+#else
+static inline int parse_spcr(bool earlycon) { return 0; }
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 2f44e20..9e84cff 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -367,11 +367,18 @@ extern const struct earlycon_id __earlycon_table_end[];
 
 #define EARLYCON_DECLARE(_name, fn)	OF_EARLYCON_DECLARE(_name, "", fn)
 
-extern int setup_earlycon(char *buf);
 extern int of_setup_earlycon(const struct earlycon_id *match,
 			     unsigned long node,
 			     const char *options);
 
+#ifdef CONFIG_SERIAL_EARLYCON
+extern bool earlycon_init_is_deferred __initdata;
+int setup_earlycon(char *buf);
+#else
+static const bool earlycon_init_is_deferred;
+static inline int setup_earlycon(char *buf) { return 0; }
+#endif
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 2/4] ACPI: parse SPCR and enable matching console
@ 2016-09-05 12:36   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
Console Redirection Table) [2] as a mandatory ACPI table that
specifies the configuration of serial console.

Defer initialization of DT earlycon until ACPI/DT decision is made.

Parse the ACPI SPCR table, setup earlycon if required,
enable specified console.

Thanks to Peter Hurley for explaining how this should work.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/acpi/Kconfig          |   3 ++
 drivers/acpi/Makefile         |   1 +
 drivers/acpi/spcr.c           | 111 ++++++++++++++++++++++++++++++++++++++++++
 drivers/tty/serial/earlycon.c |  19 +++++++-
 include/linux/acpi.h          |   6 +++
 include/linux/serial_core.h   |   9 +++-
 6 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 6cef2d1..4a269f9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -77,6 +77,9 @@ config ACPI_DEBUGGER_USER
 
 endif
 
+config ACPI_SPCR_TABLE
+	bool
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index e5ada78..d799593 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -81,6 +81,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS)	+= ec_sys.o
 obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
 obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 obj-$(CONFIG_ACPI_CPPC_LIB)	+= cppc_acpi.o
+obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
 obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
 
 # processor has its own "processor." module_param namespace
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
new file mode 100644
index 0000000..e8d7bc7
--- /dev/null
+++ b/drivers/acpi/spcr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012, Intel Corporation
+ * Copyright (c) 2015, Red Hat, Inc.
+ * Copyright (c) 2015, 2016 Linaro Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#define pr_fmt(fmt) "ACPI: SPCR: " fmt
+
+#include <linux/acpi.h>
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/serial_core.h>
+
+/**
+ * parse_spcr() - parse ACPI SPCR table and add preferred console
+ *
+ * @earlycon: set up earlycon for the console specified by the table
+ *
+ * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
+ * defined to parse ACPI SPCR table.  As a result of the parsing preferred
+ * console is registered and if @earlycon is true, earlycon is set up.
+ *
+ * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
+ * from arch inintialization code as soon as the DT/ACPI decision is made.
+ *
+ */
+int __init parse_spcr(bool earlycon)
+{
+	static char opts[64];
+	struct acpi_table_spcr *table;
+	acpi_size table_size;
+	acpi_status status;
+	char *uart;
+	char *iotype;
+	int baud_rate;
+	int err;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0,
+					  (struct acpi_table_header **)&table,
+					  &table_size);
+
+	if (ACPI_FAILURE(status))
+		return -ENOENT;
+
+	if (table->header.revision < 2) {
+		err = -ENOENT;
+		pr_err("wrong table version\n");
+		goto done;
+	}
+
+	iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
+			"mmio" : "io";
+
+	switch (table->interface_type) {
+	case ACPI_DBG2_ARM_SBSA_32BIT:
+		iotype = "mmio32";
+		/* fall through */
+	case ACPI_DBG2_ARM_PL011:
+	case ACPI_DBG2_ARM_SBSA_GENERIC:
+	case ACPI_DBG2_BCM2835:
+		uart = "pl011";
+		break;
+	case ACPI_DBG2_16550_COMPATIBLE:
+	case ACPI_DBG2_16550_SUBSET:
+		uart = "uart";
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	switch (table->baud_rate) {
+	case 3:
+		baud_rate = 9600;
+		break;
+	case 4:
+		baud_rate = 19200;
+		break;
+	case 6:
+		baud_rate = 57600;
+		break;
+	case 7:
+		baud_rate = 115200;
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
+		 table->serial_port.address, baud_rate);
+
+	pr_info("console: %s\n", opts);
+
+	if (earlycon)
+		setup_earlycon(opts);
+
+	err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
+
+done:
+	early_acpi_os_unmap_memory((void __iomem *)table, table_size);
+	return err;
+}
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 7aae655..ea00b9f 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -21,6 +21,7 @@
 #include <linux/sizes.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/acpi.h>
 
 #ifdef CONFIG_FIX_EARLYCON_MEM
 #include <asm/fixmap.h>
@@ -199,6 +200,14 @@ int __init setup_earlycon(char *buf)
 	return -ENOENT;
 }
 
+/*
+ * When CONFIG_ACPI_SPCR_TABLE is defined, "earlycon" without parameters in
+ * command line does not start DT earlycon immediately, instead it defers
+ * starting it until DT/ACPI decision is made.  At that time if ACPI is enabled
+ * call parse_spcr(), else call early_init_dt_scan_chosen_stdout()
+ */
+bool earlycon_init_is_deferred __initdata;
+
 /* early_param wrapper for setup_earlycon() */
 static int __init param_setup_earlycon(char *buf)
 {
@@ -208,8 +217,14 @@ static int __init param_setup_earlycon(char *buf)
 	 * Just 'earlycon' is a valid param for devicetree earlycons;
 	 * don't generate a warning from parse_early_params() in that case
 	 */
-	if (!buf || !buf[0])
-		return early_init_dt_scan_chosen_stdout();
+	if (!buf || !buf[0]) {
+		if (IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) {
+			earlycon_init_is_deferred = true;
+			return 0;
+		} else {
+			return early_init_dt_scan_chosen_stdout();
+		}
+	}
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c5eaf2f..2353827 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1074,4 +1074,10 @@ void acpi_table_upgrade(void);
 static inline void acpi_table_upgrade(void) { }
 #endif
 
+#ifdef CONFIG_ACPI_SPCR_TABLE
+int parse_spcr(bool earlycon);
+#else
+static inline int parse_spcr(bool earlycon) { return 0; }
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 2f44e20..9e84cff 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -367,11 +367,18 @@ extern const struct earlycon_id __earlycon_table_end[];
 
 #define EARLYCON_DECLARE(_name, fn)	OF_EARLYCON_DECLARE(_name, "", fn)
 
-extern int setup_earlycon(char *buf);
 extern int of_setup_earlycon(const struct earlycon_id *match,
 			     unsigned long node,
 			     const char *options);
 
+#ifdef CONFIG_SERIAL_EARLYCON
+extern bool earlycon_init_is_deferred __initdata;
+int setup_earlycon(char *buf);
+#else
+static const bool earlycon_init_is_deferred;
+static inline int setup_earlycon(char *buf) { return 0; }
+#endif
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-05 12:36   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Aleksey Makarov, Russell King, Greg Kroah-Hartman, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Catalin Marinas, Will Deacon

SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64

Earlycon should be set up as early as possible.  ACPI boot tables are
mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
is called from setup_arch() and that's where we parse SPCR.
So it has to be opted-in per-arch.

When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
deferred until the DT/ACPI decision is done.  Initialize DT earlycon
if ACPI is disabled.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 arch/arm64/Kconfig       |  1 +
 arch/arm64/kernel/acpi.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f..11a2d36 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -4,6 +4,7 @@ config ARM64
 	select ACPI_GENERIC_GSI if ACPI
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ACPI_MCFG if ACPI
+	select ACPI_SPCR_TABLE if ACPI
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 3e4f1a4..252a6d9 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
+#include <linux/serial_core.h>
 
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
@@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
 	if (param_acpi_off ||
 	    (!param_acpi_on && !param_acpi_force &&
 	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
-		return;
+		goto done;
 
 	/*
 	 * ACPI is disabled at this point. Enable it in order to parse
@@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
 		if (!param_acpi_force)
 			disable_acpi();
 	}
+
+done:
+	if (acpi_disabled) {
+		if (earlycon_init_is_deferred)
+			early_init_dt_scan_chosen_stdout();
+	} else {
+		parse_spcr(earlycon_init_is_deferred);
+	}
 }
 
 #ifdef CONFIG_ACPI_APEI
-- 
2.9.3


^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-05 12:36   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64

Earlycon should be set up as early as possible.  ACPI boot tables are
mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
is called from setup_arch() and that's where we parse SPCR.
So it has to be opted-in per-arch.

When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
deferred until the DT/ACPI decision is done.  Initialize DT earlycon
if ACPI is disabled.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 arch/arm64/Kconfig       |  1 +
 arch/arm64/kernel/acpi.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f..11a2d36 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -4,6 +4,7 @@ config ARM64
 	select ACPI_GENERIC_GSI if ACPI
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ACPI_MCFG if ACPI
+	select ACPI_SPCR_TABLE if ACPI
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 3e4f1a4..252a6d9 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
+#include <linux/serial_core.h>
 
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
@@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
 	if (param_acpi_off ||
 	    (!param_acpi_on && !param_acpi_force &&
 	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
-		return;
+		goto done;
 
 	/*
 	 * ACPI is disabled at this point. Enable it in order to parse
@@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
 		if (!param_acpi_force)
 			disable_acpi();
 	}
+
+done:
+	if (acpi_disabled) {
+		if (earlycon_init_is_deferred)
+			early_init_dt_scan_chosen_stdout();
+	} else {
+		parse_spcr(earlycon_init_is_deferred);
+	}
 }
 
 #ifdef CONFIG_ACPI_APEI
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 4/4] serial: pl011: add console matching function
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-05 12:36   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Aleksey Makarov, Russell King, Greg Kroah-Hartman, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Russell King, Jiri Slaby

This patch adds function pl011_console_match() that implements
method match of struct console.  It allows to match consoles against
data specified in a string, for example taken from command line or
compiled by ACPI SPCR table handler.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/tty/serial/amba-pl011.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8a9e213..2f9af8a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2288,12 +2288,67 @@ static int __init pl011_console_setup(struct console *co, char *options)
 	return uart_set_options(&uap->port, co, baud, parity, bits, flow);
 }
 
+/**
+ *	pl011_console_match - non-standard console matching
+ *	@co:	  registering console
+ *	@name:	  name from console command line
+ *	@idx:	  index from console command line
+ *	@options: ptr to option string from console command line
+ *
+ *	Only attempts to match console command lines of the form:
+ *	    console=pl011,mmio|mmio32,<addr>[,<options>]
+ *	    console=pl011,0x<addr>[,<options>]
+ *	This form is used to register an initial earlycon boot console and
+ *	replace it with the amba_console at pl011 driver init.
+ *
+ *	Performs console setup for a match (as required by interface)
+ *	If no <options> are specified, then assume the h/w is already setup.
+ *
+ *	Returns 0 if console matches; otherwise non-zero to use default matching
+ */
+static int __init pl011_console_match(struct console *co, char *name, int idx,
+				      char *options)
+{
+	unsigned char iotype;
+	unsigned long addr;
+	int i;
+
+	if (strcmp(name, "pl011") != 0)
+		return -ENODEV;
+
+	if (uart_parse_earlycon(options, &iotype, &addr, &options))
+		return -ENODEV;
+
+	if (iotype != UPIO_MEM && iotype != UPIO_MEM32)
+		return -ENODEV;
+
+	/* try to match the port specified on the command line */
+	for (i = 0; i < ARRAY_SIZE(amba_ports); i++) {
+		struct uart_port *port;
+
+		if (!amba_ports[i])
+			continue;
+
+		port = &amba_ports[i]->port;
+
+		if (port->mapbase != addr)
+			continue;
+
+		co->index = i;
+		port->cons = co;
+		return pl011_console_setup(co, options);
+	}
+
+	return -ENODEV;
+}
+
 static struct uart_driver amba_reg;
 static struct console amba_console = {
 	.name		= "ttyAMA",
 	.write		= pl011_console_write,
 	.device		= uart_console_device,
 	.setup		= pl011_console_setup,
+	.match		= pl011_console_match,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
 	.data		= &amba_reg,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v10 4/4] serial: pl011: add console matching function
@ 2016-09-05 12:36   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-05 12:36 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds function pl011_console_match() that implements
method match of struct console.  It allows to match consoles against
data specified in a string, for example taken from command line or
compiled by ACPI SPCR table handler.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/tty/serial/amba-pl011.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8a9e213..2f9af8a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2288,12 +2288,67 @@ static int __init pl011_console_setup(struct console *co, char *options)
 	return uart_set_options(&uap->port, co, baud, parity, bits, flow);
 }
 
+/**
+ *	pl011_console_match - non-standard console matching
+ *	@co:	  registering console
+ *	@name:	  name from console command line
+ *	@idx:	  index from console command line
+ *	@options: ptr to option string from console command line
+ *
+ *	Only attempts to match console command lines of the form:
+ *	    console=pl011,mmio|mmio32,<addr>[,<options>]
+ *	    console=pl011,0x<addr>[,<options>]
+ *	This form is used to register an initial earlycon boot console and
+ *	replace it with the amba_console at pl011 driver init.
+ *
+ *	Performs console setup for a match (as required by interface)
+ *	If no <options> are specified, then assume the h/w is already setup.
+ *
+ *	Returns 0 if console matches; otherwise non-zero to use default matching
+ */
+static int __init pl011_console_match(struct console *co, char *name, int idx,
+				      char *options)
+{
+	unsigned char iotype;
+	unsigned long addr;
+	int i;
+
+	if (strcmp(name, "pl011") != 0)
+		return -ENODEV;
+
+	if (uart_parse_earlycon(options, &iotype, &addr, &options))
+		return -ENODEV;
+
+	if (iotype != UPIO_MEM && iotype != UPIO_MEM32)
+		return -ENODEV;
+
+	/* try to match the port specified on the command line */
+	for (i = 0; i < ARRAY_SIZE(amba_ports); i++) {
+		struct uart_port *port;
+
+		if (!amba_ports[i])
+			continue;
+
+		port = &amba_ports[i]->port;
+
+		if (port->mapbase != addr)
+			continue;
+
+		co->index = i;
+		port->cons = co;
+		return pl011_console_setup(co, options);
+	}
+
+	return -ENODEV;
+}
+
 static struct uart_driver amba_reg;
 static struct console amba_console = {
 	.name		= "ttyAMA",
 	.write		= pl011_console_write,
 	.device		= uart_console_device,
 	.setup		= pl011_console_setup,
+	.match		= pl011_console_match,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
 	.data		= &amba_reg,
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-05 12:36   ` Aleksey Makarov
@ 2016-09-07  9:30     ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-07  9:30 UTC (permalink / raw)
  To: Will Deacon, Catalin Marinas
  Cc: Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv, Kefeng Wang,
	Russell King, Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Mark Salter,
	Al Stone, linux-arm-kernel, Len Brown


On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> 
> Earlycon should be set up as early as possible.  ACPI boot tables are
> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> is called from setup_arch() and that's where we parse SPCR.
> So it has to be opted-in per-arch.
> 
> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> if ACPI is disabled.

Hi Will, Catalin,

Can you review this patch and consider ACKing it please?

Thank you
Aleksey Makarov

> Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
> Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Tested-by: Christopher Covington <cov@codeaurora.org>
> ---
>  arch/arm64/Kconfig       |  1 +
>  arch/arm64/kernel/acpi.c | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index bc3f00f..11a2d36 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -4,6 +4,7 @@ config ARM64
>  	select ACPI_GENERIC_GSI if ACPI
>  	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
>  	select ACPI_MCFG if ACPI
> +	select ACPI_SPCR_TABLE if ACPI
>  	select ARCH_HAS_DEVMEM_IS_ALLOWED
>  	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
>  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 3e4f1a4..252a6d9 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -24,6 +24,7 @@
>  #include <linux/memblock.h>
>  #include <linux/of_fdt.h>
>  #include <linux/smp.h>
> +#include <linux/serial_core.h>
>  
>  #include <asm/cputype.h>
>  #include <asm/cpu_ops.h>
> @@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
>  	if (param_acpi_off ||
>  	    (!param_acpi_on && !param_acpi_force &&
>  	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
> -		return;
> +		goto done;
>  
>  	/*
>  	 * ACPI is disabled at this point. Enable it in order to parse
> @@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
>  		if (!param_acpi_force)
>  			disable_acpi();
>  	}
> +
> +done:
> +	if (acpi_disabled) {
> +		if (earlycon_init_is_deferred)
> +			early_init_dt_scan_chosen_stdout();
> +	} else {
> +		parse_spcr(earlycon_init_is_deferred);
> +	}
>  }
>  
>  #ifdef CONFIG_ACPI_APEI
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-07  9:30     ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-07  9:30 UTC (permalink / raw)
  To: linux-arm-kernel


On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> 
> Earlycon should be set up as early as possible.  ACPI boot tables are
> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> is called from setup_arch() and that's where we parse SPCR.
> So it has to be opted-in per-arch.
> 
> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> if ACPI is disabled.

Hi Will, Catalin,

Can you review this patch and consider ACKing it please?

Thank you
Aleksey Makarov

> Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
> Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> Tested-by: Christopher Covington <cov@codeaurora.org>
> ---
>  arch/arm64/Kconfig       |  1 +
>  arch/arm64/kernel/acpi.c | 11 ++++++++++-
>  2 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index bc3f00f..11a2d36 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -4,6 +4,7 @@ config ARM64
>  	select ACPI_GENERIC_GSI if ACPI
>  	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
>  	select ACPI_MCFG if ACPI
> +	select ACPI_SPCR_TABLE if ACPI
>  	select ARCH_HAS_DEVMEM_IS_ALLOWED
>  	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
>  	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
> diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
> index 3e4f1a4..252a6d9 100644
> --- a/arch/arm64/kernel/acpi.c
> +++ b/arch/arm64/kernel/acpi.c
> @@ -24,6 +24,7 @@
>  #include <linux/memblock.h>
>  #include <linux/of_fdt.h>
>  #include <linux/smp.h>
> +#include <linux/serial_core.h>
>  
>  #include <asm/cputype.h>
>  #include <asm/cpu_ops.h>
> @@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
>  	if (param_acpi_off ||
>  	    (!param_acpi_on && !param_acpi_force &&
>  	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
> -		return;
> +		goto done;
>  
>  	/*
>  	 * ACPI is disabled at this point. Enable it in order to parse
> @@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
>  		if (!param_acpi_force)
>  			disable_acpi();
>  	}
> +
> +done:
> +	if (acpi_disabled) {
> +		if (earlycon_init_is_deferred)
> +			early_init_dt_scan_chosen_stdout();
> +	} else {
> +		parse_spcr(earlycon_init_is_deferred);
> +	}
>  }
>  
>  #ifdef CONFIG_ACPI_APEI
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-07  9:30     ` Aleksey Makarov
@ 2016-09-08 11:16       ` Will Deacon
  -1 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-08 11:16 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Mark Salter, Al Stone, linux-arm-kernel, Len Brown

On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > 
> > Earlycon should be set up as early as possible.  ACPI boot tables are
> > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > is called from setup_arch() and that's where we parse SPCR.
> > So it has to be opted-in per-arch.
> > 
> > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > if ACPI is disabled.
> 
> Hi Will, Catalin,
> 
> Can you review this patch and consider ACKing it please?

Hanjun, Al, Mark, Graeme -- any comments on this?

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-08 11:16       ` Will Deacon
  0 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-08 11:16 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > 
> > Earlycon should be set up as early as possible.  ACPI boot tables are
> > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > is called from setup_arch() and that's where we parse SPCR.
> > So it has to be opted-in per-arch.
> > 
> > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > if ACPI is disabled.
> 
> Hi Will, Catalin,
> 
> Can you review this patch and consider ACKing it please?

Hanjun, Al, Mark, Graeme -- any comments on this?

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-08 11:16       ` Will Deacon
  (?)
@ 2016-09-08 13:25         ` Graeme Gregory
  -1 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-08 13:25 UTC (permalink / raw)
  To: Will Deacon
  Cc: Aleksey Makarov, Catalin Marinas, Aleksey Makarov,
	Rafael J . Wysocki, Zheng, Lv, Kefeng Wang, Russell King,
	Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Mark Salter,
	Al Stone, linux-arm-kerne

On Thu, Sep 08, 2016 at 12:16:55PM +0100, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > 
> > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > 
> > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > is called from setup_arch() and that's where we parse SPCR.
> > > So it has to be opted-in per-arch.
> > > 
> > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > if ACPI is disabled.
> > 
> > Hi Will, Catalin,
> > 
> > Can you review this patch and consider ACKing it please?
> 
> Hanjun, Al, Mark, Graeme -- any comments on this?
> 
We have been using this series internally for a long while for boards
with SBSA UART. So IMO it is good to go. We have worked with some OEMs
to fix firmware bugs discovered with this patch series so it should work
with machines in the wild.

Graeme


^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-08 13:25         ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-08 13:25 UTC (permalink / raw)
  To: Will Deacon
  Cc: Aleksey Makarov, Catalin Marinas, Aleksey Makarov,
	Rafael J . Wysocki, Zheng, Lv, Kefeng Wang, Russell King,
	Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Mark Salter,
	Al Stone, linux-arm-kernel, Len Brown

On Thu, Sep 08, 2016 at 12:16:55PM +0100, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > 
> > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > 
> > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > is called from setup_arch() and that's where we parse SPCR.
> > > So it has to be opted-in per-arch.
> > > 
> > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > if ACPI is disabled.
> > 
> > Hi Will, Catalin,
> > 
> > Can you review this patch and consider ACKing it please?
> 
> Hanjun, Al, Mark, Graeme -- any comments on this?
> 
We have been using this series internally for a long while for boards
with SBSA UART. So IMO it is good to go. We have worked with some OEMs
to fix firmware bugs discovered with this patch series so it should work
with machines in the wild.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-08 13:25         ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-08 13:25 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 08, 2016 at 12:16:55PM +0100, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > 
> > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > 
> > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > is called from setup_arch() and that's where we parse SPCR.
> > > So it has to be opted-in per-arch.
> > > 
> > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > if ACPI is disabled.
> > 
> > Hi Will, Catalin,
> > 
> > Can you review this patch and consider ACKing it please?
> 
> Hanjun, Al, Mark, Graeme -- any comments on this?
> 
We have been using this series internally for a long while for boards
with SBSA UART. So IMO it is good to go. We have worked with some OEMs
to fix firmware bugs discovered with this patch series so it should work
with machines in the wild.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-08 11:16       ` Will Deacon
@ 2016-09-08 13:35         ` Hanjun Guo
  -1 siblings, 0 replies; 86+ messages in thread
From: Hanjun Guo @ 2016-09-08 13:35 UTC (permalink / raw)
  To: Will Deacon, Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Mark Salter, Al Stone, linux-arm-kernel, Len Brown

On 2016/9/8 19:16, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>
>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>
>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>> is called from setup_arch() and that's where we parse SPCR.
>>> So it has to be opted-in per-arch.
>>>
>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>> if ACPI is disabled.
>>
>> Hi Will, Catalin,
>>
>> Can you review this patch and consider ACKing it please?
>
> Hanjun, Al, Mark, Graeme -- any comments on this?

We tested this patch on D02, although d02 is 8250 based
uart, but this patch is the core part, which makes sense
to me,

Acked-by: Hanjun Guo <hanjun.guo@linaro.org>

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-08 13:35         ` Hanjun Guo
  0 siblings, 0 replies; 86+ messages in thread
From: Hanjun Guo @ 2016-09-08 13:35 UTC (permalink / raw)
  To: linux-arm-kernel

On 2016/9/8 19:16, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>
>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>
>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>> is called from setup_arch() and that's where we parse SPCR.
>>> So it has to be opted-in per-arch.
>>>
>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>> if ACPI is disabled.
>>
>> Hi Will, Catalin,
>>
>> Can you review this patch and consider ACKing it please?
>
> Hanjun, Al, Mark, Graeme -- any comments on this?

We tested this patch on D02, although d02 is 8250 based
uart, but this patch is the core part, which makes sense
to me,

Acked-by: Hanjun Guo <hanjun.guo@linaro.org>

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-08 11:16       ` Will Deacon
@ 2016-09-08 16:34         ` Mark Salter
  -1 siblings, 0 replies; 86+ messages in thread
From: Mark Salter @ 2016-09-08 16:34 UTC (permalink / raw)
  To: Will Deacon, Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Al Stone, linux-arm-kernel, Len Brown

On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > 
> > 
> > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > 
> > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > 
> > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > is called from setup_arch() and that's where we parse SPCR.
> > > So it has to be opted-in per-arch.
> > > 
> > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > if ACPI is disabled.
> > Hi Will, Catalin,
> > 
> > Can you review this patch and consider ACKing it please?
> Hanjun, Al, Mark, Graeme -- any comments on this?
> 
> Will

I think there is a problem still with systems using 32-bit access to 8250
UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
followup patch to resolve.


^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-08 16:34         ` Mark Salter
  0 siblings, 0 replies; 86+ messages in thread
From: Mark Salter @ 2016-09-08 16:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > 
> > 
> > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > 
> > > SBBR mentions SPCR as a mandatory ACPI table.??So enable it for ARM64
> > > 
> > > Earlycon should be set up as early as possible.??ACPI boot tables are
> > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > is called from setup_arch() and that's where we parse SPCR.
> > > So it has to be opted-in per-arch.
> > > 
> > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > deferred until the DT/ACPI decision is done.??Initialize DT earlycon
> > > if ACPI is disabled.
> > Hi Will, Catalin,
> > 
> > Can you review this patch and consider ACKing it please?
> Hanjun, Al, Mark, Graeme -- any comments on this?
> 
> Will

I think there is a problem still with systems using 32-bit access to 8250
UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
followup patch to resolve.

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-08 16:34         ` Mark Salter
  (?)
@ 2016-09-09  8:36           ` Graeme Gregory
  -1 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-09  8:36 UTC (permalink / raw)
  To: Mark Salter
  Cc: Will Deacon, Aleksey Makarov, Catalin Marinas, Aleksey Makarov,
	Rafael J . Wysocki, Zheng, Lv, Kefeng Wang, Russell King,
	Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Al Stone,
	linux-arm-kern

On Thu, Sep 08, 2016 at 12:34:16PM -0400, Mark Salter wrote:
> On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > > 
> > > 
> > > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > > 
> > > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > > 
> > > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > > is called from setup_arch() and that's where we parse SPCR.
> > > > So it has to be opted-in per-arch.
> > > > 
> > > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > > if ACPI is disabled.
> > > Hi Will, Catalin,
> > > 
> > > Can you review this patch and consider ACKing it please?
> > Hanjun, Al, Mark, Graeme -- any comments on this?
> > 
> > Will
> 
> I think there is a problem still with systems using 32-bit access to 8250
> UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> followup patch to resolve.
> 

We went over this with the HPE firmware people. The General Address
Structure has Register Bit Width and Access Size fields. If set
correctly then 8250 UART works.

AFAIK Moonshot firmware has this fix, I have no access to Mustang
firmware to verify on that platform.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09  8:36           ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-09  8:36 UTC (permalink / raw)
  To: Mark Salter
  Cc: Will Deacon, Aleksey Makarov, Catalin Marinas, Aleksey Makarov,
	Rafael J . Wysocki, Zheng, Lv, Kefeng Wang, Russell King,
	Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Al Stone,
	linux-arm-kernel, Len Brown

On Thu, Sep 08, 2016 at 12:34:16PM -0400, Mark Salter wrote:
> On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > > 
> > > 
> > > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > > 
> > > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > > 
> > > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > > is called from setup_arch() and that's where we parse SPCR.
> > > > So it has to be opted-in per-arch.
> > > > 
> > > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > > if ACPI is disabled.
> > > Hi Will, Catalin,
> > > 
> > > Can you review this patch and consider ACKing it please?
> > Hanjun, Al, Mark, Graeme -- any comments on this?
> > 
> > Will
> 
> I think there is a problem still with systems using 32-bit access to 8250
> UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> followup patch to resolve.
> 

We went over this with the HPE firmware people. The General Address
Structure has Register Bit Width and Access Size fields. If set
correctly then 8250 UART works.

AFAIK Moonshot firmware has this fix, I have no access to Mustang
firmware to verify on that platform.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09  8:36           ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2016-09-09  8:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Sep 08, 2016 at 12:34:16PM -0400, Mark Salter wrote:
> On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > > 
> > > 
> > > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > > 
> > > > SBBR mentions SPCR as a mandatory ACPI table.??So enable it for ARM64
> > > > 
> > > > Earlycon should be set up as early as possible.??ACPI boot tables are
> > > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > > is called from setup_arch() and that's where we parse SPCR.
> > > > So it has to be opted-in per-arch.
> > > > 
> > > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > > deferred until the DT/ACPI decision is done.??Initialize DT earlycon
> > > > if ACPI is disabled.
> > > Hi Will, Catalin,
> > > 
> > > Can you review this patch and consider ACKing it please?
> > Hanjun, Al, Mark, Graeme -- any comments on this?
> > 
> > Will
> 
> I think there is a problem still with systems using 32-bit access to 8250
> UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> followup patch to resolve.
> 

We went over this with the HPE firmware people. The General Address
Structure has Register Bit Width and Access Size fields. If set
correctly then 8250 UART works.

AFAIK Moonshot firmware has this fix, I have no access to Mustang
firmware to verify on that platform.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-08 16:34         ` Mark Salter
@ 2016-09-09  9:28           ` Hanjun Guo
  -1 siblings, 0 replies; 86+ messages in thread
From: Hanjun Guo @ 2016-09-09  9:28 UTC (permalink / raw)
  To: Mark Salter, Will Deacon, Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Al Stone, linux-arm-kernel, Len Brown

On 2016/9/9 0:34, Mark Salter wrote:
> On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
>> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>>
>>>
>>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>>>
>>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>>
>>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>>> is called from setup_arch() and that's where we parse SPCR.
>>>> So it has to be opted-in per-arch.
>>>>
>>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>>> if ACPI is disabled.
>>> Hi Will, Catalin,
>>>
>>> Can you review this patch and consider ACKing it please?
>> Hanjun, Al, Mark, Graeme -- any comments on this?
>>
>> Will
>
> I think there is a problem still with systems using 32-bit access to 8250
> UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> followup patch to resolve.

Hmm, I think you mean we can add patches later with the spec updated,
and this patch works with SBSA pl011 can go for now?

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09  9:28           ` Hanjun Guo
  0 siblings, 0 replies; 86+ messages in thread
From: Hanjun Guo @ 2016-09-09  9:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 2016/9/9 0:34, Mark Salter wrote:
> On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
>> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>>
>>>
>>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>>>
>>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>>
>>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>>> is called from setup_arch() and that's where we parse SPCR.
>>>> So it has to be opted-in per-arch.
>>>>
>>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>>> if ACPI is disabled.
>>> Hi Will, Catalin,
>>>
>>> Can you review this patch and consider ACKing it please?
>> Hanjun, Al, Mark, Graeme -- any comments on this?
>>
>> Will
>
> I think there is a problem still with systems using 32-bit access to 8250
> UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> followup patch to resolve.

Hmm, I think you mean we can add patches later with the spec updated,
and this patch works with SBSA pl011 can go for now?

Thanks
Hanjun

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-07  9:30     ` Aleksey Makarov
@ 2016-09-09  9:29       ` Will Deacon
  -1 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-09  9:29 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Mark Salter, Al Stone, linux-arm-kernel, Len Brown

On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > 
> > Earlycon should be set up as early as possible.  ACPI boot tables are
> > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > is called from setup_arch() and that's where we parse SPCR.
> > So it has to be opted-in per-arch.
> > 
> > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > if ACPI is disabled.
> 
> Hi Will, Catalin,
> 
> Can you review this patch and consider ACKing it please?

Since the ACPI folks seem happy with the series, then:

Acked-by: Will Deacon <will.deacon@arm.com>

for this patch.

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09  9:29       ` Will Deacon
  0 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-09  9:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > 
> > Earlycon should be set up as early as possible.  ACPI boot tables are
> > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > is called from setup_arch() and that's where we parse SPCR.
> > So it has to be opted-in per-arch.
> > 
> > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > if ACPI is disabled.
> 
> Hi Will, Catalin,
> 
> Can you review this patch and consider ACKing it please?

Since the ACPI folks seem happy with the series, then:

Acked-by: Will Deacon <will.deacon@arm.com>

for this patch.

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-09  9:29       ` Will Deacon
@ 2016-09-09 15:07         ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-09 15:07 UTC (permalink / raw)
  To: Will Deacon, Aleksey Makarov
  Cc: Catalin Marinas, Rafael J . Wysocki, Zheng, Lv, Kefeng Wang,
	Russell King, Peter Hurley, Graeme Gregory, Greg Kroah-Hartman,
	Andy Shevchenko, linux-kernel, Leif Lindholm, linux-acpi,
	Yury Norov, Christopher Covington, linux-serial, Mark Salter,
	Al Stone, linux-arm-kernel, Len Brown



On 09/09/2016 12:29 PM, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>
>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>
>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>> is called from setup_arch() and that's where we parse SPCR.
>>> So it has to be opted-in per-arch.
>>>
>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>> if ACPI is disabled.
>>
>> Hi Will, Catalin,
>>
>> Can you review this patch and consider ACKing it please?
> 
> Since the ACPI folks seem happy with the series, then:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 
> for this patch.

Thank you.  Can you pull the series?  Should I ask Rafael?

> 
> Will
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09 15:07         ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-09 15:07 UTC (permalink / raw)
  To: linux-arm-kernel



On 09/09/2016 12:29 PM, Will Deacon wrote:
> On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
>>
>> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
>>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
>>>
>>> Earlycon should be set up as early as possible.  ACPI boot tables are
>>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
>>> is called from setup_arch() and that's where we parse SPCR.
>>> So it has to be opted-in per-arch.
>>>
>>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
>>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
>>> if ACPI is disabled.
>>
>> Hi Will, Catalin,
>>
>> Can you review this patch and consider ACKing it please?
> 
> Since the ACPI folks seem happy with the series, then:
> 
> Acked-by: Will Deacon <will.deacon@arm.com>
> 
> for this patch.

Thank you.  Can you pull the series?  Should I ask Rafael?

> 
> Will
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-09 15:07         ` Aleksey Makarov
@ 2016-09-09 15:17           ` Will Deacon
  -1 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-09 15:17 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Aleksey Makarov, Catalin Marinas, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Mark Salter, Al Stone, linux-arm-kernel, Len Brown

On Fri, Sep 09, 2016 at 06:07:04PM +0300, Aleksey Makarov wrote:
> On 09/09/2016 12:29 PM, Will Deacon wrote:
> > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> >>
> >> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> >>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> >>>
> >>> Earlycon should be set up as early as possible.  ACPI boot tables are
> >>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> >>> is called from setup_arch() and that's where we parse SPCR.
> >>> So it has to be opted-in per-arch.
> >>>
> >>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> >>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> >>> if ACPI is disabled.
> >>
> >> Hi Will, Catalin,
> >>
> >> Can you review this patch and consider ACKing it please?
> > 
> > Since the ACPI folks seem happy with the series, then:
> > 
> > Acked-by: Will Deacon <will.deacon@arm.com>
> > 
> > for this patch.
> 
> Thank you.  Can you pull the series?  Should I ask Rafael?

The series should go via Rafael, since the bulk of the changes are
outside of arch/arm64.

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-09 15:17           ` Will Deacon
  0 siblings, 0 replies; 86+ messages in thread
From: Will Deacon @ 2016-09-09 15:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Sep 09, 2016 at 06:07:04PM +0300, Aleksey Makarov wrote:
> On 09/09/2016 12:29 PM, Will Deacon wrote:
> > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> >>
> >> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> >>> SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> >>>
> >>> Earlycon should be set up as early as possible.  ACPI boot tables are
> >>> mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> >>> is called from setup_arch() and that's where we parse SPCR.
> >>> So it has to be opted-in per-arch.
> >>>
> >>> When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> >>> deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> >>> if ACPI is disabled.
> >>
> >> Hi Will, Catalin,
> >>
> >> Can you review this patch and consider ACKing it please?
> > 
> > Since the ACPI folks seem happy with the series, then:
> > 
> > Acked-by: Will Deacon <will.deacon@arm.com>
> > 
> > for this patch.
> 
> Thank you.  Can you pull the series?  Should I ask Rafael?

The series should go via Rafael, since the bulk of the changes are
outside of arch/arm64.

Will

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-12 15:55   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-12 15:55 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel


On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.

Hi Rafael,

Could you pull these patches please?
Each of them is ACKed now.

Thank you
Aleksey Makarov

> Move "earlycon" early_param handling to earlycon.c to parse this option once
> 
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.
> 
> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov@linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov@linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov@linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov@linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm@linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov@codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-12 15:55   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-12 15:55 UTC (permalink / raw)
  To: linux-arm-kernel


On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.

Hi Rafael,

Could you pull these patches please?
Each of them is ACKed now.

Thank you
Aleksey Makarov

> Move "earlycon" early_param handling to earlycon.c to parse this option once
> 
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.
> 
> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov at linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov at linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov at linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov at linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov at linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov at linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov at linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm at linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov at codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-09  9:28           ` Hanjun Guo
@ 2016-09-13 18:45             ` Mark Salter
  -1 siblings, 0 replies; 86+ messages in thread
From: Mark Salter @ 2016-09-13 18:45 UTC (permalink / raw)
  To: Hanjun Guo, Will Deacon, Aleksey Makarov
  Cc: Catalin Marinas, Aleksey Makarov, Rafael J . Wysocki, Zheng, Lv,
	Kefeng Wang, Russell King, Peter Hurley, Graeme Gregory,
	Greg Kroah-Hartman, Andy Shevchenko, linux-kernel, Leif Lindholm,
	linux-acpi, Yury Norov, Christopher Covington, linux-serial,
	Al Stone, linux-arm-kernel, Len Brown

On Fri, 2016-09-09 at 17:28 +0800, Hanjun Guo wrote:
> On 2016/9/9 0:34, Mark Salter wrote:
> > 
> > On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> > > 
> > > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > > > 
> > > > 
> > > > 
> > > > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > > > 
> > > > > 
> > > > > SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64
> > > > > 
> > > > > Earlycon should be set up as early as possible.  ACPI boot tables are
> > > > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > > > is called from setup_arch() and that's where we parse SPCR.
> > > > > So it has to be opted-in per-arch.
> > > > > 
> > > > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > > > deferred until the DT/ACPI decision is done.  Initialize DT earlycon
> > > > > if ACPI is disabled.
> > > > Hi Will, Catalin,
> > > > 
> > > > Can you review this patch and consider ACKing it please?
> > > Hanjun, Al, Mark, Graeme -- any comments on this?
> > > 
> > > Will
> > I think there is a problem still with systems using 32-bit access to 8250
> > UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> > followup patch to resolve.
> Hmm, I think you mean we can add patches later with the spec updated,
> and this patch works with SBSA pl011 can go for now?

Yes, I think this series is fine for now.

> 
> Thanks
> Hanjun


^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-13 18:45             ` Mark Salter
  0 siblings, 0 replies; 86+ messages in thread
From: Mark Salter @ 2016-09-13 18:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 2016-09-09 at 17:28 +0800, Hanjun Guo wrote:
> On 2016/9/9 0:34, Mark Salter wrote:
> > 
> > On Thu, 2016-09-08 at 12:16 +0100, Will Deacon wrote:
> > > 
> > > On Wed, Sep 07, 2016 at 12:30:19PM +0300, Aleksey Makarov wrote:
> > > > 
> > > > 
> > > > 
> > > > On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > > > > 
> > > > > 
> > > > > SBBR mentions SPCR as a mandatory ACPI table.??So enable it for ARM64
> > > > > 
> > > > > Earlycon should be set up as early as possible.??ACPI boot tables are
> > > > > mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
> > > > > is called from setup_arch() and that's where we parse SPCR.
> > > > > So it has to be opted-in per-arch.
> > > > > 
> > > > > When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
> > > > > deferred until the DT/ACPI decision is done.??Initialize DT earlycon
> > > > > if ACPI is disabled.
> > > > Hi Will, Catalin,
> > > > 
> > > > Can you review this patch and consider ACKing it please?
> > > Hanjun, Al, Mark, Graeme -- any comments on this?
> > > 
> > > Will
> > I think there is a problem still with systems using 32-bit access to 8250
> > UARTs (i.e. Mustang) but that will need a DBG2 table spec change and
> > followup patch to resolve.
> Hmm, I think you mean we can add patches later with the spec updated,
> and this patch works with SBSA pl011 can go for now?

Yes, I think this series is fine for now.

> 
> Thanks
> Hanjun

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-16 13:40   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-16 13:40 UTC (permalink / raw)
  To: Rafael J . Wysocki
  Cc: linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Greg Kroah-Hartman, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi

+ CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.

Hi Rafael,

Could you pull these patches please?
Each of them is ACKed now.

Thank you
Aleksey Makarov

> Move "earlycon" early_param handling to earlycon.c to parse this option once
>
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.
> 
> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov@linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov@linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov@linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov@linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm@linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov@codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-16 13:40   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-16 13:40 UTC (permalink / raw)
  To: linux-arm-kernel

+ CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.

Hi Rafael,

Could you pull these patches please?
Each of them is ACKed now.

Thank you
Aleksey Makarov

> Move "earlycon" early_param handling to earlycon.c to parse this option once
>
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.
> 
> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov at linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov at linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov at linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov at linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov at linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov at linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov at linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm at linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov at codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-05 12:36 ` Aleksey Makarov
@ 2016-09-21 10:27   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-21 10:27 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi



On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.
> 
> Move "earlycon" early_param handling to earlycon.c to parse this option once
> 
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.

Hi Greg,

Can you consider picking this series for 4.9 please?

Thank you
Aleksey Makarov

> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov@linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov@linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov@linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov@linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov@linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov@linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov@linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov@linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm@linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov@codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 10:27   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-21 10:27 UTC (permalink / raw)
  To: linux-arm-kernel



On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> Redirection Table) [2] as a mandatory ACPI table that specifies the
> configuration of serial console.
> 
> Move "earlycon" early_param handling to earlycon.c to parse this option once
> 
> Parse SPCR table, setup earlycon and register specified console.
> 
> Enable parsing this table on ARM64.  Earlycon should be set up as early as
> possible.  ACPI boot tables are mapped in
> arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> that's where we parse spcr.  So it has to be opted-in per-arch. When
> ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> DT/ACPI decision is done.
> 
> Implement console_match() for pl011.

Hi Greg,

Can you consider picking this series for 4.9 please?

Thank you
Aleksey Makarov

> Based on the work by Leif Lindholm [3]
> Thanks to Peter Hurley for explaining how this should work.
> 
> Should be applied to v4.8-rc5
> Tested on QEMU and ThunderX.
> SPCR support is included in QEMU's ARM64 mach-virt since 2.4 release.
> 
> v10:
> - rebase to v4.8-rc5
> - fix the issue with comparing the console name in pl011_console_match()
>   (Russell King)
> - fix build on sh arch (kbuild test robot)
> - add Acked-by: Russell King <rmk+kernel@armlinux.org.uk> for 4/4
> - add Tested-by: Christopher Covington <cov@codeaurora.org>
> 
> v9:
> https://lkml.kernel.org/g/20160811153152.755-1-aleksey.makarov at linaro.org
> - rebase to v4.8-rc1
> - fix compilation for !CONFIG_SERIAL_EARLYCON case
> - add Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> for ACPI part
> - move constant check out of loop (Yury Norov)
> - add '\n' to info message
> 
> v8:
> https://lkml.kernel.org/g/1463749405-11640-1-git-send-email-aleksey.makarov at linaro.org
> - rebase to next-20160520
> - remove the patch "ACPICA: Headers: Add new constants for the DBG2 ACPI table"
>   as it have got to linux-next
> - add Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Reviewed-by:
>   Peter Hurley <peter@hurleysoftware.com> (but see below)
> - fix the patch "serial: pl011: add console matching function".  The patch by
>   Christopher Covington [4] specifies that SBSA uart does 32-bit access to
>   registers and this breaks the match function.  In this series the function
>   was changed to match when SPCR specifies both mmio32 and mmio access.
>   I removed Acked-by: Greg from this patch because of these changes.
> 
> v7:
> https://lkml.kernel.org/g/1459431629-27934-1-git-send-email-aleksey.makarov at linaro.org
> - add Acked-by: Rob Herring for "of/serial: move earlycon early_param handling
>   to serial"
> - call DT earlycon initialization from the arch ACPI code, not from parse_spcr()
>   (Rafael J. Wysocki)
> - fix a few minor issues (Rafael J. Wysocki)
> 
> v6:
> https://lkml.kernel.org/g/1458823925-19560-1-git-send-email-aleksey.makarov at linaro.org
> - add documentation for parse_spcr() functioin (Yury Norov)
> - don't initialize err variable (Yury Norov)
> - add __initdata for the earlycon_init_is_deferred flag variable
> - rename the function exported in "of/serial: move earlycon early_param handling
>   to serial" to avoid clash with the function from arch/microblaze/kernel/prom.c
> - defer initialization of DT earlycon until DT/ACPI decision is made
>   (Rob Herring, Peter Hurley)
> - use snprintf instead of sprintf (Andy Shevchenko)
> - drop patch that adds EARLYCON_DECLARE for pl011 as EARLYCON_DECLARE is
>   equivalent to OF_EARLYCON_DECLARE for 4.6+ (Peter Hurley).  This means that
>   SPCR earlycon will not work on the kernels before 4.6
> 
> v5:
> https://lkml.kernel.org/g/1458643595-14719-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "serial: pl011: use ACPI SPCR to setup 32-bit access" because
>   it is ugly. Also because Christopher Covington came with a better solution [4]
> - remove error message when the table is not provided by ACPI (Andy Shevchenko)
> - rewrite spcr.c following the suggestions by Peter Hurley
> - add console_match() for pl011 in a separate patch
> - add EARLYCON_DECLARE for pl011 in a separate patch
> - add patch "of/serial: move earlycon early_param handling to serial" from
>   the GDB2 series
> 
> v4:
> https://lkml.kernel.org/g/1456747355-15692-1-git-send-email-aleksey.makarov at linaro.org
> - drop patch "ACPI: change __init to __ref for early_acpi_os_unmap_memory()"
>   ACPI developers work on a new API and asked not to do that.
>   Instead, use acpi_get_table_with_size()/early_acpi_os_unmap_memory() once
>   and cache the result. (Lv Zheng)
> - fix some style issues (Yury Norov)
> 
> v3:
> https://lkml.kernel.org/g/1455559532-8305-1-git-send-email-aleksey.makarov at linaro.org
> 
> Greg Kroah-Hartman did not like v2 so I have rewritten this patchset:
> 
> - drop acpi_match() member of struct console
> - drop implementations of this member for pl011 and 8250
> - drop the patch that renames some vars in printk.c as it is not needed anymore
> - drop patch that introduces system wide acpi_table_parse2().
>   Instead introduce a custom acpi_table_parse_spcr() in spcr.c
> 
> Instead of introducing a new match_acpi() member of struct console,
> this patchset introduces a new function acpi_console_check().
> This function is called when a new uart is registered at serial_core.c
> the same way OF code checks for console.  If the registered uart is the
> console specified by SPCR table, this function calls add_preferred_console()
> 
> The restrictions of this approach are:
> 
> - only serial consoles can be set up
> - only consoles specified by the memory/io address can be set up
>   (SPCR can specify devices by PCI id/PCI address)
> 
> v2:
> https://lkml.kernel.org/g/1455299022-11641-1-git-send-email-aleksey.makarov at linaro.org
> - don't use SPCR if user specified console in command line
> - fix initialization order of newcon->index = 0
> - rename some variables at printk.c (Joe Perches, Peter Hurley)
> - enable ACPI_SPCR_TABLE in a separate patch (Andy Shevchenko)
> - remove the retry loop for console registering (Peter Hurley).
>   Instead, obtain SPCR with acpi_get_table().  That works after
>   call to acpi_early_init() i. e. in any *_initcall()
> - describe design decision behind introducing acpi_match() (Peter Hurley)
> - fix compilation for x86 + ACPI (Graeme Gregory)
> - introduce DBG2 constants in a separate patch (Andy Shevchenko)
> - fix a typo in DBG2 constants (Andy Shevchenko)
> - add ACPI_DBG2_ARM_SBSA_32BIT constant (Christopher Covington)
> - add support for ACPI_DBG2_ARM_SBSA_* consoles (Christopher Covington)
> - add documentation for functions
> - add a patch that uses SPCR to find if SBSA serial driver should use 32-bit
>   accessor functions (Christopher Covington)
> - change __init to __ref for early_acpi_os_unmap_memory() in a separate patch
> - introduce acpi_table_parse2() in a separate patch
> - fix fetching the SPCR table early (Mark Salter)
> - add a patch from Mark Salter that introduces support for matching 8250-based
>   consoles
> 
> v1:
> https://lkml.kernel.org/g/1453722324-22407-1-git-send-email-aleksey.makarov at linaro.org
> 
> [1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
> [2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx
> [3] https://lkml.kernel.org/g/1441716217-23786-1-git-send-email-leif.lindholm at linaro.org
> [4] https://lkml.kernel.org/g/1457415800-8799-1-git-send-email-cov at codeaurora.org
> 
> Aleksey Makarov (3):
>   ACPI: parse SPCR and enable matching console
>   ARM64: ACPI: enable ACPI_SPCR_TABLE
>   serial: pl011: add console matching function
> 
> Leif Lindholm (1):
>   of/serial: move earlycon early_param handling to serial
> 
>  arch/arm64/Kconfig              |   1 +
>  arch/arm64/kernel/acpi.c        |  11 +++-
>  drivers/acpi/Kconfig            |   3 ++
>  drivers/acpi/Makefile           |   1 +
>  drivers/acpi/spcr.c             | 111 ++++++++++++++++++++++++++++++++++++++++
>  drivers/of/fdt.c                |  11 +---
>  drivers/tty/serial/amba-pl011.c |  55 ++++++++++++++++++++
>  drivers/tty/serial/earlycon.c   |  19 ++++++-
>  include/linux/acpi.h            |   6 +++
>  include/linux/of_fdt.h          |   3 ++
>  include/linux/serial_core.h     |   9 +++-
>  11 files changed, 216 insertions(+), 14 deletions(-)
>  create mode 100644 drivers/acpi/spcr.c
> 

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-21 10:27   ` Aleksey Makarov
@ 2016-09-21 10:37     ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-21 10:37 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi

On Wed, Sep 21, 2016 at 01:27:30PM +0300, Aleksey Makarov wrote:
> 
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> > Redirection Table) [2] as a mandatory ACPI table that specifies the
> > configuration of serial console.
> > 
> > Move "earlycon" early_param handling to earlycon.c to parse this option once
> > 
> > Parse SPCR table, setup earlycon and register specified console.
> > 
> > Enable parsing this table on ARM64.  Earlycon should be set up as early as
> > possible.  ACPI boot tables are mapped in
> > arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> > that's where we parse spcr.  So it has to be opted-in per-arch. When
> > ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> > DT/ACPI decision is done.
> > 
> > Implement console_match() for pl011.
> 
> Hi Greg,
> 
> Can you consider picking this series for 4.9 please?

I thought you asked Rafael to take them, they are not in my queue
anymore because of that.  Don't try to shop-around for maintainers
please, that's kind of rude...

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 10:37     ` Greg Kroah-Hartman
  0 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-21 10:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 21, 2016 at 01:27:30PM +0300, Aleksey Makarov wrote:
> 
> 
> On 09/05/2016 03:36 PM, Aleksey Makarov wrote:
> > 'ARM Server Base Boot Requirements' [1] mentions SPCR (Serial Port Console
> > Redirection Table) [2] as a mandatory ACPI table that specifies the
> > configuration of serial console.
> > 
> > Move "earlycon" early_param handling to earlycon.c to parse this option once
> > 
> > Parse SPCR table, setup earlycon and register specified console.
> > 
> > Enable parsing this table on ARM64.  Earlycon should be set up as early as
> > possible.  ACPI boot tables are mapped in
> > arch/arm64/kernel/acpi.c:acpi_boot_table_init() called from setup_arch() and
> > that's where we parse spcr.  So it has to be opted-in per-arch. When
> > ACPI_SPCR_TABLE is defined initialization of DT earlycon is deferred until the
> > DT/ACPI decision is done.
> > 
> > Implement console_match() for pl011.
> 
> Hi Greg,
> 
> Can you consider picking this series for 4.9 please?

I thought you asked Rafael to take them, they are not in my queue
anymore because of that.  Don't try to shop-around for maintainers
please, that's kind of rude...

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-21 10:37     ` Greg Kroah-Hartman
  (?)
@ 2016-09-21 16:19       ` Timur Tabi
  -1 siblings, 0 replies; 86+ messages in thread
From: Timur Tabi @ 2016-09-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Zheng, Lv, Kefeng Wang, Lorenzo Pieralisi, Russell King,
	Peter Hurley, Graeme Gregory, Andy Shevchenko,
	Rafael J . Wysocki, lkml, Leif Lindholm, linux-acpi,
	Aleksey Makarov, Yury Norov, Christopher Covington, linux-serial,
	Mark Salter, Al Stone, linux-arm-kernel, Len Brown

On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> I thought you asked Rafael to take them, they are not in my queue
> anymore because of that.  Don't try to shop-around for maintainers
> please, that's kind of rude...

In Aleksey's defense, these patches have been floating around for far
too long, so I can understand his frustration.  But as you said, I
really hope Rafael picks these up for 4.9.  We need these patches for
ARM server.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 16:19       ` Timur Tabi
  0 siblings, 0 replies; 86+ messages in thread
From: Timur Tabi @ 2016-09-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Aleksey Makarov, Rafael J . Wysocki, linux-serial, linux-acpi,
	lkml, linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi

On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> I thought you asked Rafael to take them, they are not in my queue
> anymore because of that.  Don't try to shop-around for maintainers
> please, that's kind of rude...

In Aleksey's defense, these patches have been floating around for far
too long, so I can understand his frustration.  But as you said, I
really hope Rafael picks these up for 4.9.  We need these patches for
ARM server.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 16:19       ` Timur Tabi
  0 siblings, 0 replies; 86+ messages in thread
From: Timur Tabi @ 2016-09-21 16:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> I thought you asked Rafael to take them, they are not in my queue
> anymore because of that.  Don't try to shop-around for maintainers
> please, that's kind of rude...

In Aleksey's defense, these patches have been floating around for far
too long, so I can understand his frustration.  But as you said, I
really hope Rafael picks these up for 4.9.  We need these patches for
ARM server.

-- 
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-21 16:19       ` Timur Tabi
  (?)
@ 2016-09-21 16:38         ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-21 16:38 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Aleksey Makarov, Rafael J . Wysocki, linux-serial, linux-acpi,
	lkml, linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi

On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > I thought you asked Rafael to take them, they are not in my queue
> > anymore because of that.  Don't try to shop-around for maintainers
> > please, that's kind of rude...
> 
> In Aleksey's defense, these patches have been floating around for far
> too long, so I can understand his frustration.

I understand the frustration as well, cross-maintainer messy patches
like this are hard to get merged at times at they fall between the
cracks a lot.

> But as you said, I really hope Rafael picks these up for 4.9.  We need
> these patches for ARM server.

I thought I saw an email saying he would do so, but it might have been
for some other patchset, sorry...

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 16:38         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-21 16:38 UTC (permalink / raw)
  To: Timur Tabi
  Cc: Aleksey Makarov, Rafael J . Wysocki, linux-serial, linux-acpi,
	lkml, linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi

On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > I thought you asked Rafael to take them, they are not in my queue
> > anymore because of that.  Don't try to shop-around for maintainers
> > please, that's kind of rude...
> 
> In Aleksey's defense, these patches have been floating around for far
> too long, so I can understand his frustration.

I understand the frustration as well, cross-maintainer messy patches
like this are hard to get merged at times at they fall between the
cracks a lot.

> But as you said, I really hope Rafael picks these up for 4.9.  We need
> these patches for ARM server.

I thought I saw an email saying he would do so, but it might have been
for some other patchset, sorry...

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 16:38         ` Greg Kroah-Hartman
  0 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-21 16:38 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> >
> > I thought you asked Rafael to take them, they are not in my queue
> > anymore because of that.  Don't try to shop-around for maintainers
> > please, that's kind of rude...
> 
> In Aleksey's defense, these patches have been floating around for far
> too long, so I can understand his frustration.

I understand the frustration as well, cross-maintainer messy patches
like this are hard to get merged at times at they fall between the
cracks a lot.

> But as you said, I really hope Rafael picks these up for 4.9.  We need
> these patches for ARM server.

I thought I saw an email saying he would do so, but it might have been
for some other patchset, sorry...

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-21 16:38         ` Greg Kroah-Hartman
  (?)
@ 2016-09-21 17:22           ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-21 17:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Timur Tabi
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, lkml,
	linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi



On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>> <gregkh@linuxfoundation.org> wrote:
>>>
>>> I thought you asked Rafael to take them, they are not in my queue
>>> anymore because of that.  Don't try to shop-around for maintainers
>>> please, that's kind of rude...
>>
>> In Aleksey's defense, these patches have been floating around for far
>> too long, so I can understand his frustration.
> 
> I understand the frustration as well, cross-maintainer messy patches
> like this are hard to get merged at times at they fall between the
> cracks a lot.
> 
>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>> these patches for ARM server.
> 
> I thought I saw an email saying he would do so, but it might have been
> for some other patchset, sorry...

This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":

	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com

As for this patchset, Rafael ACKed the ACPI part:

	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com

but I can not find any acknowledge from him that he is ready to merge the series.
On the contrary, he expressed his doubt that he is "the right maintainer to send this to":

	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com

I asked the ARM64 people, they said they prefer Rafael to do that:

	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com

I interpreted the silence from Rafael as unwillingness to pull the series 
and thought it's OK to ask you.

I am sorry if this looks rude for Rafael, I did not mean that.

Thank you
Aleksey Makarov

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 17:22           ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-21 17:22 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Timur Tabi
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, lkml,
	linux-arm-kernel, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Lorenzo Pieralisi



On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>> <gregkh@linuxfoundation.org> wrote:
>>>
>>> I thought you asked Rafael to take them, they are not in my queue
>>> anymore because of that.  Don't try to shop-around for maintainers
>>> please, that's kind of rude...
>>
>> In Aleksey's defense, these patches have been floating around for far
>> too long, so I can understand his frustration.
> 
> I understand the frustration as well, cross-maintainer messy patches
> like this are hard to get merged at times at they fall between the
> cracks a lot.
> 
>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>> these patches for ARM server.
> 
> I thought I saw an email saying he would do so, but it might have been
> for some other patchset, sorry...

This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":

	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com

As for this patchset, Rafael ACKed the ACPI part:

	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com

but I can not find any acknowledge from him that he is ready to merge the series.
On the contrary, he expressed his doubt that he is "the right maintainer to send this to":

	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com

I asked the ARM64 people, they said they prefer Rafael to do that:

	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com

I interpreted the silence from Rafael as unwillingness to pull the series 
and thought it's OK to ask you.

I am sorry if this looks rude for Rafael, I did not mean that.

Thank you
Aleksey Makarov

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-21 17:22           ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-21 17:22 UTC (permalink / raw)
  To: linux-arm-kernel



On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>> <gregkh@linuxfoundation.org> wrote:
>>>
>>> I thought you asked Rafael to take them, they are not in my queue
>>> anymore because of that.  Don't try to shop-around for maintainers
>>> please, that's kind of rude...
>>
>> In Aleksey's defense, these patches have been floating around for far
>> too long, so I can understand his frustration.
> 
> I understand the frustration as well, cross-maintainer messy patches
> like this are hard to get merged at times at they fall between the
> cracks a lot.
> 
>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>> these patches for ARM server.
> 
> I thought I saw an email saying he would do so, but it might have been
> for some other patchset, sorry...

This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":

	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA at mail.gmail.com

As for this patchset, Rafael ACKed the ACPI part:

	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA at mail.gmail.com

but I can not find any acknowledge from him that he is ready to merge the series.
On the contrary, he expressed his doubt that he is "the right maintainer to send this to":

	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A at mail.gmail.com

I asked the ARM64 people, they said they prefer Rafael to do that:

	https://lkml.kernel.org/r/20160909151758.GA11418 at arm.com

I interpreted the silence from Rafael as unwillingness to pull the series 
and thought it's OK to ask you.

I am sorry if this looks rude for Rafael, I did not mean that.

Thank you
Aleksey Makarov

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-21 17:22           ` Aleksey Makarov
  (?)
@ 2016-09-26 19:48             ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-26 19:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Timur Tabi, Zheng, Lv, Kefeng Wang, Lorenzo Pieralisi,
	Russell King, Peter Hurley, Graeme Gregory, Rafael J . Wysocki,
	lkml, Leif Lindholm, linux-acpi, Andy Shevchenko, Yury Norov,
	Christopher Covington, linux-serial, Mark Salter, Al Stone,
	linux-arm-kernel, Len Brown



On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
>
>
> On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
>> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>>> <gregkh@linuxfoundation.org> wrote:
>>>>
>>>> I thought you asked Rafael to take them, they are not in my queue
>>>> anymore because of that.  Don't try to shop-around for maintainers
>>>> please, that's kind of rude...
>>>
>>> In Aleksey's defense, these patches have been floating around for far
>>> too long, so I can understand his frustration.
>>
>> I understand the frustration as well, cross-maintainer messy patches
>> like this are hard to get merged at times at they fall between the
>> cracks a lot.
>>
>>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>>> these patches for ARM server.
>>
>> I thought I saw an email saying he would do so, but it might have been
>> for some other patchset, sorry...
>
> This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
>
> 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com
>
> As for this patchset, Rafael ACKed the ACPI part:
>
> 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com
>
> but I can not find any acknowledge from him that he is ready to merge the series.
> On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
>
> 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com
>
> I asked the ARM64 people, they said they prefer Rafael to do that:
>
> 	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com
>
> I interpreted the silence from Rafael as unwillingness to pull the series
> and thought it's OK to ask you.
>
> I am sorry if this looks rude for Rafael, I did not mean that.

Hi Greg,

Can you give advise on how to deal with this situation please?

It looks like Rafael does not want to pull the patches.  Some time ago he wrote:

"Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.

The only patch here touching generic ACPI code is [3/5] (the [2/5] is
going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
don't you send it to the ARM64 maintainers instead?"

(https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com)

ARM64 maintainer said

"The series should go via Rafael, since the bulk of the changes are
outside of arch/arm64."

(https://lkml.kernel.org/r/20160909151758.GA11418@arm.com)

So should I continue to try to reach Rafael or ask another maintainer?
Can you pull it for 4.9?

Thank you
Aleksey Makarov

>
> Thank you
> Aleksey Makarov
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-26 19:48             ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-26 19:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Timur Tabi, Zheng, Lv, Kefeng Wang, Lorenzo Pieralisi,
	Russell King, Peter Hurley, Graeme Gregory, Rafael J . Wysocki,
	lkml, Leif Lindholm, linux-acpi, Andy Shevchenko, Yury Norov,
	Christopher Covington, linux-serial, Mark Salter, Al Stone,
	linux-arm-kernel, Len Brown



On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
>
>
> On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
>> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>>> <gregkh@linuxfoundation.org> wrote:
>>>>
>>>> I thought you asked Rafael to take them, they are not in my queue
>>>> anymore because of that.  Don't try to shop-around for maintainers
>>>> please, that's kind of rude...
>>>
>>> In Aleksey's defense, these patches have been floating around for far
>>> too long, so I can understand his frustration.
>>
>> I understand the frustration as well, cross-maintainer messy patches
>> like this are hard to get merged at times at they fall between the
>> cracks a lot.
>>
>>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>>> these patches for ARM server.
>>
>> I thought I saw an email saying he would do so, but it might have been
>> for some other patchset, sorry...
>
> This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
>
> 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com
>
> As for this patchset, Rafael ACKed the ACPI part:
>
> 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com
>
> but I can not find any acknowledge from him that he is ready to merge the series.
> On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
>
> 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com
>
> I asked the ARM64 people, they said they prefer Rafael to do that:
>
> 	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com
>
> I interpreted the silence from Rafael as unwillingness to pull the series
> and thought it's OK to ask you.
>
> I am sorry if this looks rude for Rafael, I did not mean that.

Hi Greg,

Can you give advise on how to deal with this situation please?

It looks like Rafael does not want to pull the patches.  Some time ago he wrote:

"Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.

The only patch here touching generic ACPI code is [3/5] (the [2/5] is
going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
don't you send it to the ARM64 maintainers instead?"

(https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com)

ARM64 maintainer said

"The series should go via Rafael, since the bulk of the changes are
outside of arch/arm64."

(https://lkml.kernel.org/r/20160909151758.GA11418@arm.com)

So should I continue to try to reach Rafael or ask another maintainer?
Can you pull it for 4.9?

Thank you
Aleksey Makarov

>
> Thank you
> Aleksey Makarov
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-26 19:48             ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-26 19:48 UTC (permalink / raw)
  To: linux-arm-kernel



On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
>
>
> On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
>> On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
>>> On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
>>> <gregkh@linuxfoundation.org> wrote:
>>>>
>>>> I thought you asked Rafael to take them, they are not in my queue
>>>> anymore because of that.  Don't try to shop-around for maintainers
>>>> please, that's kind of rude...
>>>
>>> In Aleksey's defense, these patches have been floating around for far
>>> too long, so I can understand his frustration.
>>
>> I understand the frustration as well, cross-maintainer messy patches
>> like this are hard to get merged at times at they fall between the
>> cracks a lot.
>>
>>> But as you said, I really hope Rafael picks these up for 4.9.  We need
>>> these patches for ARM server.
>>
>> I thought I saw an email saying he would do so, but it might have been
>> for some other patchset, sorry...
>
> This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
>
> 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA at mail.gmail.com
>
> As for this patchset, Rafael ACKed the ACPI part:
>
> 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA at mail.gmail.com
>
> but I can not find any acknowledge from him that he is ready to merge the series.
> On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
>
> 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A at mail.gmail.com
>
> I asked the ARM64 people, they said they prefer Rafael to do that:
>
> 	https://lkml.kernel.org/r/20160909151758.GA11418 at arm.com
>
> I interpreted the silence from Rafael as unwillingness to pull the series
> and thought it's OK to ask you.
>
> I am sorry if this looks rude for Rafael, I did not mean that.

Hi Greg,

Can you give advise on how to deal with this situation please?

It looks like Rafael does not want to pull the patches.  Some time ago he wrote:

"Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.

The only patch here touching generic ACPI code is [3/5] (the [2/5] is
going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
don't you send it to the ARM64 maintainers instead?"

(https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A at mail.gmail.com)

ARM64 maintainer said

"The series should go via Rafael, since the bulk of the changes are
outside of arch/arm64."

(https://lkml.kernel.org/r/20160909151758.GA11418 at arm.com)

So should I continue to try to reach Rafael or ask another maintainer?
Can you pull it for 4.9?

Thank you
Aleksey Makarov

>
> Thank you
> Aleksey Makarov
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
  2016-09-26 19:48             ` Aleksey Makarov
  (?)
@ 2016-09-27 15:19               ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-27 15:19 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Timur Tabi, Zheng, Lv, Kefeng Wang, Lorenzo Pieralisi,
	Russell King, Peter Hurley, Graeme Gregory, Rafael J . Wysocki,
	lkml, Leif Lindholm, linux-acpi, Andy Shevchenko, Yury Norov,
	Christopher Covington, linux-serial, Mark Salter, Al Stone,
	linux-arm-kernel, Len Brown

On Mon, Sep 26, 2016 at 12:48:47PM -0700, Aleksey Makarov wrote:
> 
> 
> On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
> > 
> > 
> > On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> > > On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> > > > On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > > 
> > > > > I thought you asked Rafael to take them, they are not in my queue
> > > > > anymore because of that.  Don't try to shop-around for maintainers
> > > > > please, that's kind of rude...
> > > > 
> > > > In Aleksey's defense, these patches have been floating around for far
> > > > too long, so I can understand his frustration.
> > > 
> > > I understand the frustration as well, cross-maintainer messy patches
> > > like this are hard to get merged at times at they fall between the
> > > cracks a lot.
> > > 
> > > > But as you said, I really hope Rafael picks these up for 4.9.  We need
> > > > these patches for ARM server.
> > > 
> > > I thought I saw an email saying he would do so, but it might have been
> > > for some other patchset, sorry...
> > 
> > This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com
> > 
> > As for this patchset, Rafael ACKed the ACPI part:
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com
> > 
> > but I can not find any acknowledge from him that he is ready to merge the series.
> > On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com
> > 
> > I asked the ARM64 people, they said they prefer Rafael to do that:
> > 
> > 	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com
> > 
> > I interpreted the silence from Rafael as unwillingness to pull the series
> > and thought it's OK to ask you.
> > 
> > I am sorry if this looks rude for Rafael, I did not mean that.
> 
> Hi Greg,
> 
> Can you give advise on how to deal with this situation please?
> 
> It looks like Rafael does not want to pull the patches.  Some time ago he wrote:
> 
> "Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.
> 
> The only patch here touching generic ACPI code is [3/5] (the [2/5] is
> going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
> don't you send it to the ARM64 maintainers instead?"
> 
> (https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com)
> 
> ARM64 maintainer said
> 
> "The series should go via Rafael, since the bulk of the changes are
> outside of arch/arm64."
> 
> (https://lkml.kernel.org/r/20160909151758.GA11418@arm.com)
> 
> So should I continue to try to reach Rafael or ask another maintainer?
> Can you pull it for 4.9?

crazy, no one wants to touch this :)

So, do you have acks from all of the relevant people?  If so, sure, I
can take it, can you resend me a full copy of the patches and I'll queue
them up?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-27 15:19               ` Greg Kroah-Hartman
  0 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-27 15:19 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Timur Tabi, Zheng, Lv, Kefeng Wang, Lorenzo Pieralisi,
	Russell King, Peter Hurley, Graeme Gregory, Rafael J . Wysocki,
	lkml, Leif Lindholm, linux-acpi, Andy Shevchenko, Yury Norov,
	Christopher Covington, linux-serial, Mark Salter, Al Stone,
	linux-arm-kernel, Len Brown

On Mon, Sep 26, 2016 at 12:48:47PM -0700, Aleksey Makarov wrote:
> 
> 
> On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
> > 
> > 
> > On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> > > On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> > > > On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > > 
> > > > > I thought you asked Rafael to take them, they are not in my queue
> > > > > anymore because of that.  Don't try to shop-around for maintainers
> > > > > please, that's kind of rude...
> > > > 
> > > > In Aleksey's defense, these patches have been floating around for far
> > > > too long, so I can understand his frustration.
> > > 
> > > I understand the frustration as well, cross-maintainer messy patches
> > > like this are hard to get merged at times at they fall between the
> > > cracks a lot.
> > > 
> > > > But as you said, I really hope Rafael picks these up for 4.9.  We need
> > > > these patches for ARM server.
> > > 
> > > I thought I saw an email saying he would do so, but it might have been
> > > for some other patchset, sorry...
> > 
> > This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA@mail.gmail.com
> > 
> > As for this patchset, Rafael ACKed the ACPI part:
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA@mail.gmail.com
> > 
> > but I can not find any acknowledge from him that he is ready to merge the series.
> > On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com
> > 
> > I asked the ARM64 people, they said they prefer Rafael to do that:
> > 
> > 	https://lkml.kernel.org/r/20160909151758.GA11418@arm.com
> > 
> > I interpreted the silence from Rafael as unwillingness to pull the series
> > and thought it's OK to ask you.
> > 
> > I am sorry if this looks rude for Rafael, I did not mean that.
> 
> Hi Greg,
> 
> Can you give advise on how to deal with this situation please?
> 
> It looks like Rafael does not want to pull the patches.  Some time ago he wrote:
> 
> "Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.
> 
> The only patch here touching generic ACPI code is [3/5] (the [2/5] is
> going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
> don't you send it to the ARM64 maintainers instead?"
> 
> (https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A@mail.gmail.com)
> 
> ARM64 maintainer said
> 
> "The series should go via Rafael, since the bulk of the changes are
> outside of arch/arm64."
> 
> (https://lkml.kernel.org/r/20160909151758.GA11418@arm.com)
> 
> So should I continue to try to reach Rafael or ask another maintainer?
> Can you pull it for 4.9?

crazy, no one wants to touch this :)

So, do you have acks from all of the relevant people?  If so, sure, I
can take it, can you resend me a full copy of the patches and I'll queue
them up?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v10 0/4] ACPI: parse the SPCR table
@ 2016-09-27 15:19               ` Greg Kroah-Hartman
  0 siblings, 0 replies; 86+ messages in thread
From: Greg Kroah-Hartman @ 2016-09-27 15:19 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 26, 2016 at 12:48:47PM -0700, Aleksey Makarov wrote:
> 
> 
> On 09/21/2016 10:22 AM, Aleksey Makarov wrote:
> > 
> > 
> > On 09/21/2016 07:38 PM, Greg Kroah-Hartman wrote:
> > > On Wed, Sep 21, 2016 at 11:19:35AM -0500, Timur Tabi wrote:
> > > > On Wed, Sep 21, 2016 at 5:37 AM, Greg Kroah-Hartman
> > > > <gregkh@linuxfoundation.org> wrote:
> > > > > 
> > > > > I thought you asked Rafael to take them, they are not in my queue
> > > > > anymore because of that.  Don't try to shop-around for maintainers
> > > > > please, that's kind of rude...
> > > > 
> > > > In Aleksey's defense, these patches have been floating around for far
> > > > too long, so I can understand his frustration.
> > > 
> > > I understand the frustration as well, cross-maintainer messy patches
> > > like this are hard to get merged at times at they fall between the
> > > cracks a lot.
> > > 
> > > > But as you said, I really hope Rafael picks these up for 4.9.  We need
> > > > these patches for ARM server.
> > > 
> > > I thought I saw an email saying he would do so, but it might have been
> > > for some other patchset, sorry...
> > 
> > This can be for "ACPI: ARM64: support for ACPI_TABLE_UPGRADE":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0goXsQ2umcDXU0six+QtxcKGZq7mxhgxuvXTH2iZt6YNA at mail.gmail.com
> > 
> > As for this patchset, Rafael ACKed the ACPI part:
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0hdoLTfjrD8+WxSoxM48dqbZK2KwY_h+63kHKHKgO=JFA at mail.gmail.com
> > 
> > but I can not find any acknowledge from him that he is ready to merge the series.
> > On the contrary, he expressed his doubt that he is "the right maintainer to send this to":
> > 
> > 	https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A at mail.gmail.com
> > 
> > I asked the ARM64 people, they said they prefer Rafael to do that:
> > 
> > 	https://lkml.kernel.org/r/20160909151758.GA11418 at arm.com
> > 
> > I interpreted the silence from Rafael as unwillingness to pull the series
> > and thought it's OK to ask you.
> > 
> > I am sorry if this looks rude for Rafael, I did not mean that.
> 
> Hi Greg,
> 
> Can you give advise on how to deal with this situation please?
> 
> It looks like Rafael does not want to pull the patches.  Some time ago he wrote:
> 
> "Honestly, I'm not sure why I'm regarded as the right maintainer to send this to.
> 
> The only patch here touching generic ACPI code is [3/5] (the [2/5] is
> going in through ACPICA) and the rest is all about ARM64 AFAICS.  Why
> don't you send it to the ARM64 maintainers instead?"
> 
> (https://lkml.kernel.org/r/CAJZ5v0gzjtFzig7nEumr83+J2dGb+OA8GNR2i45ZqznfV_hA-A at mail.gmail.com)
> 
> ARM64 maintainer said
> 
> "The series should go via Rafael, since the bulk of the changes are
> outside of arch/arm64."
> 
> (https://lkml.kernel.org/r/20160909151758.GA11418 at arm.com)
> 
> So should I continue to try to reach Rafael or ask another maintainer?
> Can you pull it for 4.9?

crazy, no one wants to touch this :)

So, do you have acks from all of the relevant people?  If so, sure, I
can take it, can you resend me a full copy of the patches and I'll queue
them up?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 1/4] of/serial: move earlycon early_param handling to serial
  2016-09-27 15:19               ` Greg Kroah-Hartman
  (?)
@ 2016-09-27 20:54                   ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Aleksey Makarov, Russell King, Len Brown, Leif Lindholm,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Rob Herring, Frank Rowand, Jiri

From: Leif Lindholm <leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Acked-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
Reviewed-by: Peter Hurley <peter-WaGBZJeGNqdsbIuE7sb01tBPR1lH4CV8@public.gmane.org>
Tested-by: Kefeng Wang <wangkefeng.wang-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Tested-by: Christopher Covington <cov-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.10.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 1/4] of/serial: move earlycon early_param handling to serial
@ 2016-09-27 20:54                   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Aleksey Makarov, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Rob Herring, Frank Rowand, Jiri Slaby,
	devicetree

From: Leif Lindholm <leif.lindholm@linaro.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 1/4] of/serial: move earlycon early_param handling to serial
@ 2016-09-27 20:54                   ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

From: Leif Lindholm <leif.lindholm@linaro.org>

We have multiple "earlycon" early_param handlers - merge the DT one into
the main earlycon one.  It's a cleanup that also will be useful
to defer setting up DT console until ACPI/DT decision is made.

Rename the exported function to avoid clashing with the function from
arch/microblaze/kernel/prom.c

Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rob Herring <robh@kernel.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/of/fdt.c              | 11 +----------
 drivers/tty/serial/earlycon.c |  2 +-
 include/linux/of_fdt.h        |  3 +++
 3 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 085c638..c89d5d2 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -924,7 +924,7 @@ static inline void early_init_dt_check_for_initrd(unsigned long node)
 
 #ifdef CONFIG_SERIAL_EARLYCON
 
-static int __init early_init_dt_scan_chosen_serial(void)
+int __init early_init_dt_scan_chosen_stdout(void)
 {
 	int offset;
 	const char *p, *q, *options = NULL;
@@ -968,15 +968,6 @@ static int __init early_init_dt_scan_chosen_serial(void)
 	}
 	return -ENODEV;
 }
-
-static int __init setup_of_earlycon(char *buf)
-{
-	if (buf)
-		return 0;
-
-	return early_init_dt_scan_chosen_serial();
-}
-early_param("earlycon", setup_of_earlycon);
 #endif
 
 /**
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 067783f..7aae655 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -209,7 +209,7 @@ static int __init param_setup_earlycon(char *buf)
 	 * don't generate a warning from parse_early_params() in that case
 	 */
 	if (!buf || !buf[0])
-		return 0;
+		return early_init_dt_scan_chosen_stdout();
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index 26c3302..4341f32 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -14,6 +14,7 @@
 
 #include <linux/types.h>
 #include <linux/init.h>
+#include <linux/errno.h>
 
 /* Definitions used by the flattened device tree */
 #define OF_DT_HEADER		0xd00dfeed	/* marker */
@@ -66,6 +67,7 @@ extern int early_init_dt_scan_chosen(unsigned long node, const char *uname,
 				     int depth, void *data);
 extern int early_init_dt_scan_memory(unsigned long node, const char *uname,
 				     int depth, void *data);
+extern int early_init_dt_scan_chosen_stdout(void);
 extern void early_init_fdt_scan_reserved_mem(void);
 extern void early_init_fdt_reserve_self(void);
 extern void early_init_dt_add_memory_arch(u64 base, u64 size);
@@ -94,6 +96,7 @@ extern void early_get_first_memblock_info(void *, phys_addr_t *);
 extern u64 of_flat_dt_translate_address(unsigned long node);
 extern void of_fdt_limit_memory(int limit);
 #else /* CONFIG_OF_FLATTREE */
+static inline int early_init_dt_scan_chosen_stdout(void) { return -ENODEV; }
 static inline void early_init_fdt_scan_reserved_mem(void) {}
 static inline void early_init_fdt_reserve_self(void) {}
 static inline const char *of_flat_dt_get_machine_name(void) { return NULL; }
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2016-09-27 20:54                   ` Aleksey Makarov
@ 2016-09-27 20:54                     ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Aleksey Makarov, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
Console Redirection Table) [2] as a mandatory ACPI table that
specifies the configuration of serial console.

Defer initialization of DT earlycon until ACPI/DT decision is made.

Parse the ACPI SPCR table, setup earlycon if required,
enable specified console.

Thanks to Peter Hurley for explaining how this should work.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/acpi/Kconfig          |   3 ++
 drivers/acpi/Makefile         |   1 +
 drivers/acpi/spcr.c           | 111 ++++++++++++++++++++++++++++++++++++++++++
 drivers/tty/serial/earlycon.c |  19 +++++++-
 include/linux/acpi.h          |   6 +++
 include/linux/serial_core.h   |   9 +++-
 6 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 6cef2d1..4a269f9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -77,6 +77,9 @@ config ACPI_DEBUGGER_USER
 
 endif
 
+config ACPI_SPCR_TABLE
+	bool
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index e5ada78..d799593 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -81,6 +81,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS)	+= ec_sys.o
 obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
 obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 obj-$(CONFIG_ACPI_CPPC_LIB)	+= cppc_acpi.o
+obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
 obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
 
 # processor has its own "processor." module_param namespace
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
new file mode 100644
index 0000000..e8d7bc7
--- /dev/null
+++ b/drivers/acpi/spcr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012, Intel Corporation
+ * Copyright (c) 2015, Red Hat, Inc.
+ * Copyright (c) 2015, 2016 Linaro Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#define pr_fmt(fmt) "ACPI: SPCR: " fmt
+
+#include <linux/acpi.h>
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/serial_core.h>
+
+/**
+ * parse_spcr() - parse ACPI SPCR table and add preferred console
+ *
+ * @earlycon: set up earlycon for the console specified by the table
+ *
+ * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
+ * defined to parse ACPI SPCR table.  As a result of the parsing preferred
+ * console is registered and if @earlycon is true, earlycon is set up.
+ *
+ * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
+ * from arch inintialization code as soon as the DT/ACPI decision is made.
+ *
+ */
+int __init parse_spcr(bool earlycon)
+{
+	static char opts[64];
+	struct acpi_table_spcr *table;
+	acpi_size table_size;
+	acpi_status status;
+	char *uart;
+	char *iotype;
+	int baud_rate;
+	int err;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0,
+					  (struct acpi_table_header **)&table,
+					  &table_size);
+
+	if (ACPI_FAILURE(status))
+		return -ENOENT;
+
+	if (table->header.revision < 2) {
+		err = -ENOENT;
+		pr_err("wrong table version\n");
+		goto done;
+	}
+
+	iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
+			"mmio" : "io";
+
+	switch (table->interface_type) {
+	case ACPI_DBG2_ARM_SBSA_32BIT:
+		iotype = "mmio32";
+		/* fall through */
+	case ACPI_DBG2_ARM_PL011:
+	case ACPI_DBG2_ARM_SBSA_GENERIC:
+	case ACPI_DBG2_BCM2835:
+		uart = "pl011";
+		break;
+	case ACPI_DBG2_16550_COMPATIBLE:
+	case ACPI_DBG2_16550_SUBSET:
+		uart = "uart";
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	switch (table->baud_rate) {
+	case 3:
+		baud_rate = 9600;
+		break;
+	case 4:
+		baud_rate = 19200;
+		break;
+	case 6:
+		baud_rate = 57600;
+		break;
+	case 7:
+		baud_rate = 115200;
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
+		 table->serial_port.address, baud_rate);
+
+	pr_info("console: %s\n", opts);
+
+	if (earlycon)
+		setup_earlycon(opts);
+
+	err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
+
+done:
+	early_acpi_os_unmap_memory((void __iomem *)table, table_size);
+	return err;
+}
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 7aae655..ea00b9f 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -21,6 +21,7 @@
 #include <linux/sizes.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/acpi.h>
 
 #ifdef CONFIG_FIX_EARLYCON_MEM
 #include <asm/fixmap.h>
@@ -199,6 +200,14 @@ int __init setup_earlycon(char *buf)
 	return -ENOENT;
 }
 
+/*
+ * When CONFIG_ACPI_SPCR_TABLE is defined, "earlycon" without parameters in
+ * command line does not start DT earlycon immediately, instead it defers
+ * starting it until DT/ACPI decision is made.  At that time if ACPI is enabled
+ * call parse_spcr(), else call early_init_dt_scan_chosen_stdout()
+ */
+bool earlycon_init_is_deferred __initdata;
+
 /* early_param wrapper for setup_earlycon() */
 static int __init param_setup_earlycon(char *buf)
 {
@@ -208,8 +217,14 @@ static int __init param_setup_earlycon(char *buf)
 	 * Just 'earlycon' is a valid param for devicetree earlycons;
 	 * don't generate a warning from parse_early_params() in that case
 	 */
-	if (!buf || !buf[0])
-		return early_init_dt_scan_chosen_stdout();
+	if (!buf || !buf[0]) {
+		if (IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) {
+			earlycon_init_is_deferred = true;
+			return 0;
+		} else {
+			return early_init_dt_scan_chosen_stdout();
+		}
+	}
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c5eaf2f..2353827 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1074,4 +1074,10 @@ void acpi_table_upgrade(void);
 static inline void acpi_table_upgrade(void) { }
 #endif
 
+#ifdef CONFIG_ACPI_SPCR_TABLE
+int parse_spcr(bool earlycon);
+#else
+static inline int parse_spcr(bool earlycon) { return 0; }
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 2f44e20..9e84cff 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -367,11 +367,18 @@ extern const struct earlycon_id __earlycon_table_end[];
 
 #define EARLYCON_DECLARE(_name, fn)	OF_EARLYCON_DECLARE(_name, "", fn)
 
-extern int setup_earlycon(char *buf);
 extern int of_setup_earlycon(const struct earlycon_id *match,
 			     unsigned long node,
 			     const char *options);
 
+#ifdef CONFIG_SERIAL_EARLYCON
+extern bool earlycon_init_is_deferred __initdata;
+int setup_earlycon(char *buf);
+#else
+static const bool earlycon_init_is_deferred;
+static inline int setup_earlycon(char *buf) { return 0; }
+#endif
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2016-09-27 20:54                     ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
Console Redirection Table) [2] as a mandatory ACPI table that
specifies the configuration of serial console.

Defer initialization of DT earlycon until ACPI/DT decision is made.

Parse the ACPI SPCR table, setup earlycon if required,
enable specified console.

Thanks to Peter Hurley for explaining how this should work.

[1] http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0044a/index.html
[2] https://msdn.microsoft.com/en-us/library/windows/hardware/dn639132(v=vs.85).aspx

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/acpi/Kconfig          |   3 ++
 drivers/acpi/Makefile         |   1 +
 drivers/acpi/spcr.c           | 111 ++++++++++++++++++++++++++++++++++++++++++
 drivers/tty/serial/earlycon.c |  19 +++++++-
 include/linux/acpi.h          |   6 +++
 include/linux/serial_core.h   |   9 +++-
 6 files changed, 146 insertions(+), 3 deletions(-)
 create mode 100644 drivers/acpi/spcr.c

diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index 6cef2d1..4a269f9 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -77,6 +77,9 @@ config ACPI_DEBUGGER_USER
 
 endif
 
+config ACPI_SPCR_TABLE
+	bool
+
 config ACPI_SLEEP
 	bool
 	depends on SUSPEND || HIBERNATION
diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
index e5ada78..d799593 100644
--- a/drivers/acpi/Makefile
+++ b/drivers/acpi/Makefile
@@ -81,6 +81,7 @@ obj-$(CONFIG_ACPI_EC_DEBUGFS)	+= ec_sys.o
 obj-$(CONFIG_ACPI_CUSTOM_METHOD)+= custom_method.o
 obj-$(CONFIG_ACPI_BGRT)		+= bgrt.o
 obj-$(CONFIG_ACPI_CPPC_LIB)	+= cppc_acpi.o
+obj-$(CONFIG_ACPI_SPCR_TABLE)	+= spcr.o
 obj-$(CONFIG_ACPI_DEBUGGER_USER) += acpi_dbg.o
 
 # processor has its own "processor." module_param namespace
diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
new file mode 100644
index 0000000..e8d7bc7
--- /dev/null
+++ b/drivers/acpi/spcr.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2012, Intel Corporation
+ * Copyright (c) 2015, Red Hat, Inc.
+ * Copyright (c) 2015, 2016 Linaro Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ */
+
+#define pr_fmt(fmt) "ACPI: SPCR: " fmt
+
+#include <linux/acpi.h>
+#include <linux/console.h>
+#include <linux/kernel.h>
+#include <linux/serial_core.h>
+
+/**
+ * parse_spcr() - parse ACPI SPCR table and add preferred console
+ *
+ * @earlycon: set up earlycon for the console specified by the table
+ *
+ * For the architectures with support for ACPI, CONFIG_ACPI_SPCR_TABLE may be
+ * defined to parse ACPI SPCR table.  As a result of the parsing preferred
+ * console is registered and if @earlycon is true, earlycon is set up.
+ *
+ * When CONFIG_ACPI_SPCR_TABLE is defined, this function should be called
+ * from arch inintialization code as soon as the DT/ACPI decision is made.
+ *
+ */
+int __init parse_spcr(bool earlycon)
+{
+	static char opts[64];
+	struct acpi_table_spcr *table;
+	acpi_size table_size;
+	acpi_status status;
+	char *uart;
+	char *iotype;
+	int baud_rate;
+	int err;
+
+	if (acpi_disabled)
+		return -ENODEV;
+
+	status = acpi_get_table_with_size(ACPI_SIG_SPCR, 0,
+					  (struct acpi_table_header **)&table,
+					  &table_size);
+
+	if (ACPI_FAILURE(status))
+		return -ENOENT;
+
+	if (table->header.revision < 2) {
+		err = -ENOENT;
+		pr_err("wrong table version\n");
+		goto done;
+	}
+
+	iotype = table->serial_port.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY ?
+			"mmio" : "io";
+
+	switch (table->interface_type) {
+	case ACPI_DBG2_ARM_SBSA_32BIT:
+		iotype = "mmio32";
+		/* fall through */
+	case ACPI_DBG2_ARM_PL011:
+	case ACPI_DBG2_ARM_SBSA_GENERIC:
+	case ACPI_DBG2_BCM2835:
+		uart = "pl011";
+		break;
+	case ACPI_DBG2_16550_COMPATIBLE:
+	case ACPI_DBG2_16550_SUBSET:
+		uart = "uart";
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	switch (table->baud_rate) {
+	case 3:
+		baud_rate = 9600;
+		break;
+	case 4:
+		baud_rate = 19200;
+		break;
+	case 6:
+		baud_rate = 57600;
+		break;
+	case 7:
+		baud_rate = 115200;
+		break;
+	default:
+		err = -ENOENT;
+		goto done;
+	}
+
+	snprintf(opts, sizeof(opts), "%s,%s,0x%llx,%d", uart, iotype,
+		 table->serial_port.address, baud_rate);
+
+	pr_info("console: %s\n", opts);
+
+	if (earlycon)
+		setup_earlycon(opts);
+
+	err = add_preferred_console(uart, 0, opts + strlen(uart) + 1);
+
+done:
+	early_acpi_os_unmap_memory((void __iomem *)table, table_size);
+	return err;
+}
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 7aae655..ea00b9f 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -21,6 +21,7 @@
 #include <linux/sizes.h>
 #include <linux/of.h>
 #include <linux/of_fdt.h>
+#include <linux/acpi.h>
 
 #ifdef CONFIG_FIX_EARLYCON_MEM
 #include <asm/fixmap.h>
@@ -199,6 +200,14 @@ int __init setup_earlycon(char *buf)
 	return -ENOENT;
 }
 
+/*
+ * When CONFIG_ACPI_SPCR_TABLE is defined, "earlycon" without parameters in
+ * command line does not start DT earlycon immediately, instead it defers
+ * starting it until DT/ACPI decision is made.  At that time if ACPI is enabled
+ * call parse_spcr(), else call early_init_dt_scan_chosen_stdout()
+ */
+bool earlycon_init_is_deferred __initdata;
+
 /* early_param wrapper for setup_earlycon() */
 static int __init param_setup_earlycon(char *buf)
 {
@@ -208,8 +217,14 @@ static int __init param_setup_earlycon(char *buf)
 	 * Just 'earlycon' is a valid param for devicetree earlycons;
 	 * don't generate a warning from parse_early_params() in that case
 	 */
-	if (!buf || !buf[0])
-		return early_init_dt_scan_chosen_stdout();
+	if (!buf || !buf[0]) {
+		if (IS_ENABLED(CONFIG_ACPI_SPCR_TABLE)) {
+			earlycon_init_is_deferred = true;
+			return 0;
+		} else {
+			return early_init_dt_scan_chosen_stdout();
+		}
+	}
 
 	err = setup_earlycon(buf);
 	if (err == -ENOENT || err == -EALREADY)
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index c5eaf2f..2353827 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -1074,4 +1074,10 @@ void acpi_table_upgrade(void);
 static inline void acpi_table_upgrade(void) { }
 #endif
 
+#ifdef CONFIG_ACPI_SPCR_TABLE
+int parse_spcr(bool earlycon);
+#else
+static inline int parse_spcr(bool earlycon) { return 0; }
+#endif
+
 #endif	/*_LINUX_ACPI_H*/
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 2f44e20..9e84cff 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -367,11 +367,18 @@ extern const struct earlycon_id __earlycon_table_end[];
 
 #define EARLYCON_DECLARE(_name, fn)	OF_EARLYCON_DECLARE(_name, "", fn)
 
-extern int setup_earlycon(char *buf);
 extern int of_setup_earlycon(const struct earlycon_id *match,
 			     unsigned long node,
 			     const char *options);
 
+#ifdef CONFIG_SERIAL_EARLYCON
+extern bool earlycon_init_is_deferred __initdata;
+int setup_earlycon(char *buf);
+#else
+static const bool earlycon_init_is_deferred;
+static inline int setup_earlycon(char *buf) { return 0; }
+#endif
+
 struct uart_port *uart_get_console(struct uart_port *ports, int nr,
 				   struct console *c);
 int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
  2016-09-27 20:54                   ` Aleksey Makarov
@ 2016-09-27 20:54                     ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Aleksey Makarov, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Catalin Marinas, Will Deacon

SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64

Earlycon should be set up as early as possible.  ACPI boot tables are
mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
is called from setup_arch() and that's where we parse SPCR.
So it has to be opted-in per-arch.

When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
deferred until the DT/ACPI decision is done.  Initialize DT earlycon
if ACPI is disabled.

Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 arch/arm64/Kconfig       |  1 +
 arch/arm64/kernel/acpi.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f..11a2d36 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -4,6 +4,7 @@ config ARM64
 	select ACPI_GENERIC_GSI if ACPI
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ACPI_MCFG if ACPI
+	select ACPI_SPCR_TABLE if ACPI
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 3e4f1a4..252a6d9 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
+#include <linux/serial_core.h>
 
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
@@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
 	if (param_acpi_off ||
 	    (!param_acpi_on && !param_acpi_force &&
 	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
-		return;
+		goto done;
 
 	/*
 	 * ACPI is disabled at this point. Enable it in order to parse
@@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
 		if (!param_acpi_force)
 			disable_acpi();
 	}
+
+done:
+	if (acpi_disabled) {
+		if (earlycon_init_is_deferred)
+			early_init_dt_scan_chosen_stdout();
+	} else {
+		parse_spcr(earlycon_init_is_deferred);
+	}
 }
 
 #ifdef CONFIG_ACPI_APEI
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE
@ 2016-09-27 20:54                     ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

SBBR mentions SPCR as a mandatory ACPI table.  So enable it for ARM64

Earlycon should be set up as early as possible.  ACPI boot tables are
mapped in arch/arm64/kernel/acpi.c:acpi_boot_table_init() that
is called from setup_arch() and that's where we parse SPCR.
So it has to be opted-in per-arch.

When ACPI_SPCR_TABLE is defined initialization of DT earlycon is
deferred until the DT/ACPI decision is done.  Initialize DT earlycon
if ACPI is disabled.

Acked-by: Will Deacon <will.deacon@arm.com>
Acked-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Tested-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 arch/arm64/Kconfig       |  1 +
 arch/arm64/kernel/acpi.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index bc3f00f..11a2d36 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -4,6 +4,7 @@ config ARM64
 	select ACPI_GENERIC_GSI if ACPI
 	select ACPI_REDUCED_HARDWARE_ONLY if ACPI
 	select ACPI_MCFG if ACPI
+	select ACPI_SPCR_TABLE if ACPI
 	select ARCH_HAS_DEVMEM_IS_ALLOWED
 	select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
 	select ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE
diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c
index 3e4f1a4..252a6d9 100644
--- a/arch/arm64/kernel/acpi.c
+++ b/arch/arm64/kernel/acpi.c
@@ -24,6 +24,7 @@
 #include <linux/memblock.h>
 #include <linux/of_fdt.h>
 #include <linux/smp.h>
+#include <linux/serial_core.h>
 
 #include <asm/cputype.h>
 #include <asm/cpu_ops.h>
@@ -206,7 +207,7 @@ void __init acpi_boot_table_init(void)
 	if (param_acpi_off ||
 	    (!param_acpi_on && !param_acpi_force &&
 	     of_scan_flat_dt(dt_scan_depth1_nodes, NULL)))
-		return;
+		goto done;
 
 	/*
 	 * ACPI is disabled at this point. Enable it in order to parse
@@ -226,6 +227,14 @@ void __init acpi_boot_table_init(void)
 		if (!param_acpi_force)
 			disable_acpi();
 	}
+
+done:
+	if (acpi_disabled) {
+		if (earlycon_init_is_deferred)
+			early_init_dt_scan_chosen_stdout();
+	} else {
+		parse_spcr(earlycon_init_is_deferred);
+	}
 }
 
 #ifdef CONFIG_ACPI_APEI
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 4/4] serial: pl011: add console matching function
  2016-09-27 20:54                   ` Aleksey Makarov
@ 2016-09-27 20:54                     ` Aleksey Makarov
  -1 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rafael J . Wysocki, linux-serial, linux-acpi, linux-kernel,
	linux-arm-kernel, Aleksey Makarov, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Russell King, Jiri Slaby

This patch adds function pl011_console_match() that implements
method match of struct console.  It allows to match consoles against
data specified in a string, for example taken from command line or
compiled by ACPI SPCR table handler.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/tty/serial/amba-pl011.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8a9e213..2f9af8a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2288,12 +2288,67 @@ static int __init pl011_console_setup(struct console *co, char *options)
 	return uart_set_options(&uap->port, co, baud, parity, bits, flow);
 }
 
+/**
+ *	pl011_console_match - non-standard console matching
+ *	@co:	  registering console
+ *	@name:	  name from console command line
+ *	@idx:	  index from console command line
+ *	@options: ptr to option string from console command line
+ *
+ *	Only attempts to match console command lines of the form:
+ *	    console=pl011,mmio|mmio32,<addr>[,<options>]
+ *	    console=pl011,0x<addr>[,<options>]
+ *	This form is used to register an initial earlycon boot console and
+ *	replace it with the amba_console at pl011 driver init.
+ *
+ *	Performs console setup for a match (as required by interface)
+ *	If no <options> are specified, then assume the h/w is already setup.
+ *
+ *	Returns 0 if console matches; otherwise non-zero to use default matching
+ */
+static int __init pl011_console_match(struct console *co, char *name, int idx,
+				      char *options)
+{
+	unsigned char iotype;
+	unsigned long addr;
+	int i;
+
+	if (strcmp(name, "pl011") != 0)
+		return -ENODEV;
+
+	if (uart_parse_earlycon(options, &iotype, &addr, &options))
+		return -ENODEV;
+
+	if (iotype != UPIO_MEM && iotype != UPIO_MEM32)
+		return -ENODEV;
+
+	/* try to match the port specified on the command line */
+	for (i = 0; i < ARRAY_SIZE(amba_ports); i++) {
+		struct uart_port *port;
+
+		if (!amba_ports[i])
+			continue;
+
+		port = &amba_ports[i]->port;
+
+		if (port->mapbase != addr)
+			continue;
+
+		co->index = i;
+		port->cons = co;
+		return pl011_console_setup(co, options);
+	}
+
+	return -ENODEV;
+}
+
 static struct uart_driver amba_reg;
 static struct console amba_console = {
 	.name		= "ttyAMA",
 	.write		= pl011_console_write,
 	.device		= uart_console_device,
 	.setup		= pl011_console_setup,
+	.match		= pl011_console_match,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
 	.data		= &amba_reg,
-- 
2.10.0


^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 4/4] serial: pl011: add console matching function
@ 2016-09-27 20:54                     ` Aleksey Makarov
  0 siblings, 0 replies; 86+ messages in thread
From: Aleksey Makarov @ 2016-09-27 20:54 UTC (permalink / raw)
  To: linux-arm-kernel

This patch adds function pl011_console_match() that implements
method match of struct console.  It allows to match consoles against
data specified in a string, for example taken from command line or
compiled by ACPI SPCR table handler.

Signed-off-by: Aleksey Makarov <aleksey.makarov@linaro.org>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Tested-by: Christopher Covington <cov@codeaurora.org>
---
 drivers/tty/serial/amba-pl011.c | 55 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 8a9e213..2f9af8a 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -2288,12 +2288,67 @@ static int __init pl011_console_setup(struct console *co, char *options)
 	return uart_set_options(&uap->port, co, baud, parity, bits, flow);
 }
 
+/**
+ *	pl011_console_match - non-standard console matching
+ *	@co:	  registering console
+ *	@name:	  name from console command line
+ *	@idx:	  index from console command line
+ *	@options: ptr to option string from console command line
+ *
+ *	Only attempts to match console command lines of the form:
+ *	    console=pl011,mmio|mmio32,<addr>[,<options>]
+ *	    console=pl011,0x<addr>[,<options>]
+ *	This form is used to register an initial earlycon boot console and
+ *	replace it with the amba_console at pl011 driver init.
+ *
+ *	Performs console setup for a match (as required by interface)
+ *	If no <options> are specified, then assume the h/w is already setup.
+ *
+ *	Returns 0 if console matches; otherwise non-zero to use default matching
+ */
+static int __init pl011_console_match(struct console *co, char *name, int idx,
+				      char *options)
+{
+	unsigned char iotype;
+	unsigned long addr;
+	int i;
+
+	if (strcmp(name, "pl011") != 0)
+		return -ENODEV;
+
+	if (uart_parse_earlycon(options, &iotype, &addr, &options))
+		return -ENODEV;
+
+	if (iotype != UPIO_MEM && iotype != UPIO_MEM32)
+		return -ENODEV;
+
+	/* try to match the port specified on the command line */
+	for (i = 0; i < ARRAY_SIZE(amba_ports); i++) {
+		struct uart_port *port;
+
+		if (!amba_ports[i])
+			continue;
+
+		port = &amba_ports[i]->port;
+
+		if (port->mapbase != addr)
+			continue;
+
+		co->index = i;
+		port->cons = co;
+		return pl011_console_setup(co, options);
+	}
+
+	return -ENODEV;
+}
+
 static struct uart_driver amba_reg;
 static struct console amba_console = {
 	.name		= "ttyAMA",
 	.write		= pl011_console_write,
 	.device		= uart_console_device,
 	.setup		= pl011_console_setup,
+	.match		= pl011_console_match,
 	.flags		= CON_PRINTBUFFER,
 	.index		= -1,
 	.data		= &amba_reg,
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2016-09-27 20:54                     ` Aleksey Makarov
@ 2017-09-11  9:11                       ` Andreas Schwab
  -1 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11  9:11 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-serial, linux-acpi,
	linux-kernel, linux-arm-kernel, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Sep 27 2016, Aleksey Makarov <aleksey.makarov@linaro.org> wrote:

> 'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
> Console Redirection Table) [2] as a mandatory ACPI table that
> specifies the configuration of serial console.
>
> Defer initialization of DT earlycon until ACPI/DT decision is made.
>
> Parse the ACPI SPCR table, setup earlycon if required,
> enable specified console.

How can I tell the kernel to ignore this table and use the console on
the command line instead?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11  9:11                       ` Andreas Schwab
  0 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11  9:11 UTC (permalink / raw)
  To: Aleksey Makarov
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-serial, linux-acpi,
	linux-kernel, linux-arm-kernel, Russell King, Len Brown,
	Leif Lindholm, Graeme Gregory, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Sep 27 2016, Aleksey Makarov <aleksey.makarov@linaro.org> wrote:

> 'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
> Console Redirection Table) [2] as a mandatory ACPI table that
> specifies the configuration of serial console.
>
> Defer initialization of DT earlycon until ACPI/DT decision is made.
>
> Parse the ACPI SPCR table, setup earlycon if required,
> enable specified console.

How can I tell the kernel to ignore this table and use the console on
the command line instead?

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11  9:11                       ` Andreas Schwab
@ 2017-09-11 11:05                         ` Leif Lindholm
  -1 siblings, 0 replies; 86+ messages in thread
From: Leif Lindholm @ 2017-09-11 11:05 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-serial, linux-acpi,
	linux-kernel, linux-arm-kernel, Russell King, Len Brown,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Jiri Slaby

I'm afraid Aleksey is no longer assigned to Linaro (you will probably
have seen a bounce).

On Mon, Sep 11, 2017 at 11:11:49AM +0200, Andreas Schwab wrote:
> On Sep 27 2016, Aleksey Makarov <aleksey.makarov@linaro.org> wrote:
> 
> > 'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
> > Console Redirection Table) [2] as a mandatory ACPI table that
> > specifies the configuration of serial console.
> >
> > Defer initialization of DT earlycon until ACPI/DT decision is made.
> >
> > Parse the ACPI SPCR table, setup earlycon if required,
> > enable specified console.
> 
> How can I tell the kernel to ignore this table and use the console on
> the command line instead?

I guess we could just ignore the table completely
	if (console_set_on_cmdline)
like its counterpart in of_console_check().

Like so (not tested beyond compile testing):

diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 324b35bfe781..c3cf0f1ebb8f 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -96,6 +96,9 @@ int __init parse_spcr(bool earlycon)
        int baud_rate;
	        int err;

+       if (console_set_on_cmdline)
+               return 0;
+
        if (acpi_disabled)
	                return -ENODEV;

Are you asking because you want to use a different console in a lab
setup or because there are issues with SPCR on your platform?

/
    Leif

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 11:05                         ` Leif Lindholm
  0 siblings, 0 replies; 86+ messages in thread
From: Leif Lindholm @ 2017-09-11 11:05 UTC (permalink / raw)
  To: linux-arm-kernel

I'm afraid Aleksey is no longer assigned to Linaro (you will probably
have seen a bounce).

On Mon, Sep 11, 2017 at 11:11:49AM +0200, Andreas Schwab wrote:
> On Sep 27 2016, Aleksey Makarov <aleksey.makarov@linaro.org> wrote:
> 
> > 'ARM Server Base Boot Requiremets' [1] mentions SPCR (Serial Port
> > Console Redirection Table) [2] as a mandatory ACPI table that
> > specifies the configuration of serial console.
> >
> > Defer initialization of DT earlycon until ACPI/DT decision is made.
> >
> > Parse the ACPI SPCR table, setup earlycon if required,
> > enable specified console.
> 
> How can I tell the kernel to ignore this table and use the console on
> the command line instead?

I guess we could just ignore the table completely
	if (console_set_on_cmdline)
like its counterpart in of_console_check().

Like so (not tested beyond compile testing):

diff --git a/drivers/acpi/spcr.c b/drivers/acpi/spcr.c
index 324b35bfe781..c3cf0f1ebb8f 100644
--- a/drivers/acpi/spcr.c
+++ b/drivers/acpi/spcr.c
@@ -96,6 +96,9 @@ int __init parse_spcr(bool earlycon)
        int baud_rate;
	        int err;

+       if (console_set_on_cmdline)
+               return 0;
+
        if (acpi_disabled)
	                return -ENODEV;

Are you asking because you want to use a different console in a lab
setup or because there are issues with SPCR on your platform?

/
    Leif

^ permalink raw reply related	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11 11:05                         ` Leif Lindholm
  (?)
@ 2017-09-11 11:39                           ` Andreas Schwab
  -1 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 11:39 UTC (permalink / raw)
  To: Leif Lindholm
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-serial, linux-acpi,
	linux-kernel, linux-arm-kernel, Russell King, Len Brown,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Jiri Slaby

On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:

> Are you asking because you want to use a different console in a lab
> setup or because there are issues with SPCR on your platform?

The console from the SPCR is not the one forwarded by the BMC.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 11:39                           ` Andreas Schwab
  0 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 11:39 UTC (permalink / raw)
  To: Leif Lindholm
  Cc: Greg Kroah-Hartman, Rafael J . Wysocki, linux-serial, linux-acpi,
	linux-kernel, linux-arm-kernel, Russell King, Len Brown,
	Graeme Gregory, Al Stone, Christopher Covington, Yury Norov,
	Peter Hurley, Andy Shevchenko, Zheng, Lv, Mark Salter,
	Kefeng Wang, Jiri Slaby

On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:

> Are you asking because you want to use a different console in a lab
> setup or because there are issues with SPCR on your platform?

The console from the SPCR is not the one forwarded by the BMC.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 11:39                           ` Andreas Schwab
  0 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 11:39 UTC (permalink / raw)
  To: linux-arm-kernel

On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:

> Are you asking because you want to use a different console in a lab
> setup or because there are issues with SPCR on your platform?

The console from the SPCR is not the one forwarded by the BMC.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11 11:39                           ` Andreas Schwab
  (?)
@ 2017-09-11 12:24                             ` Graeme Gregory
  -1 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 12:24 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On 11 September 2017 at 12:39, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
>> Are you asking because you want to use a different console in a lab
>> setup or because there are issues with SPCR on your platform?
>
> The console from the SPCR is not the one forwarded by the BMC.
>
Considering the SPCR table in question seems mildly insane, you could
always unload the SPCR in grub.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 12:24                             ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 12:24 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On 11 September 2017 at 12:39, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
>> Are you asking because you want to use a different console in a lab
>> setup or because there are issues with SPCR on your platform?
>
> The console from the SPCR is not the one forwarded by the BMC.
>
Considering the SPCR table in question seems mildly insane, you could
always unload the SPCR in grub.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 12:24                             ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 12:24 UTC (permalink / raw)
  To: linux-arm-kernel

On 11 September 2017 at 12:39, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>
>> Are you asking because you want to use a different console in a lab
>> setup or because there are issues with SPCR on your platform?
>
> The console from the SPCR is not the one forwarded by the BMC.
>
Considering the SPCR table in question seems mildly insane, you could
always unload the SPCR in grub.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11 12:24                             ` Graeme Gregory
  (?)
@ 2017-09-11 12:28                               ` Andreas Schwab
  -1 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 12:28 UTC (permalink / raw)
  To: Graeme Gregory
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:

> Considering the SPCR table in question seems mildly insane, you could
> always unload the SPCR in grub.

How do you "unload the SPCR"?  But in any case, console= should always
take precedence.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 12:28                               ` Andreas Schwab
  0 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 12:28 UTC (permalink / raw)
  To: Graeme Gregory
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:

> Considering the SPCR table in question seems mildly insane, you could
> always unload the SPCR in grub.

How do you "unload the SPCR"?  But in any case, console= should always
take precedence.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 12:28                               ` Andreas Schwab
  0 siblings, 0 replies; 86+ messages in thread
From: Andreas Schwab @ 2017-09-11 12:28 UTC (permalink / raw)
  To: linux-arm-kernel

On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:

> Considering the SPCR table in question seems mildly insane, you could
> always unload the SPCR in grub.

How do you "unload the SPCR"?  But in any case, console= should always
take precedence.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab at suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11 12:28                               ` Andreas Schwab
  (?)
@ 2017-09-11 13:03                                 ` Graeme Gregory
  -1 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 13:03 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On 11 September 2017 at 13:28, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
>
>> Considering the SPCR table in question seems mildly insane, you could
>> always unload the SPCR in grub.
>
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.
>
Ah apologies, I thought the acpi command in grub could delete a table,
but it seems it cannot.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 13:03                                 ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 13:03 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Leif Lindholm, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On 11 September 2017 at 13:28, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
>
>> Considering the SPCR table in question seems mildly insane, you could
>> always unload the SPCR in grub.
>
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.
>
Ah apologies, I thought the acpi command in grub could delete a table,
but it seems it cannot.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 13:03                                 ` Graeme Gregory
  0 siblings, 0 replies; 86+ messages in thread
From: Graeme Gregory @ 2017-09-11 13:03 UTC (permalink / raw)
  To: linux-arm-kernel

On 11 September 2017 at 13:28, Andreas Schwab <schwab@suse.de> wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
>
>> Considering the SPCR table in question seems mildly insane, you could
>> always unload the SPCR in grub.
>
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.
>
Ah apologies, I thought the acpi command in grub could delete a table,
but it seems it cannot.

Graeme

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
  2017-09-11 12:28                               ` Andreas Schwab
  (?)
@ 2017-09-11 13:23                                 ` Leif Lindholm
  -1 siblings, 0 replies; 86+ messages in thread
From: Leif Lindholm @ 2017-09-11 13:23 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Graeme Gregory, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Mon, Sep 11, 2017 at 02:28:20PM +0200, Andreas Schwab wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
> 
> > Considering the SPCR table in question seems mildly insane, you could
> > always unload the SPCR in grub.
> 
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.

I am not saying it shouldn't. But you should probably talk to your
supplier with regards to fixing their system.

The BMC knows which console you are attached to, and the firmware
still instructs the kernel to use something else.

/
    Leif

^ permalink raw reply	[flat|nested] 86+ messages in thread

* Re: [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 13:23                                 ` Leif Lindholm
  0 siblings, 0 replies; 86+ messages in thread
From: Leif Lindholm @ 2017-09-11 13:23 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Graeme Gregory, Greg Kroah-Hartman, Rafael J . Wysocki,
	linux-serial, linux-acpi, linux-kernel, linux-arm-kernel,
	Russell King, Len Brown, Al Stone, Christopher Covington,
	Yury Norov, Peter Hurley, Andy Shevchenko, Zheng, Lv,
	Mark Salter, Kefeng Wang, Jiri Slaby

On Mon, Sep 11, 2017 at 02:28:20PM +0200, Andreas Schwab wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
> 
> > Considering the SPCR table in question seems mildly insane, you could
> > always unload the SPCR in grub.
> 
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.

I am not saying it shouldn't. But you should probably talk to your
supplier with regards to fixing their system.

The BMC knows which console you are attached to, and the firmware
still instructs the kernel to use something else.

/
    Leif

^ permalink raw reply	[flat|nested] 86+ messages in thread

* [PATCH v11 2/4] ACPI: parse SPCR and enable matching console
@ 2017-09-11 13:23                                 ` Leif Lindholm
  0 siblings, 0 replies; 86+ messages in thread
From: Leif Lindholm @ 2017-09-11 13:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 11, 2017 at 02:28:20PM +0200, Andreas Schwab wrote:
> On Sep 11 2017, Graeme Gregory <graeme.gregory@linaro.org> wrote:
> 
> > Considering the SPCR table in question seems mildly insane, you could
> > always unload the SPCR in grub.
> 
> How do you "unload the SPCR"?  But in any case, console= should always
> take precedence.

I am not saying it shouldn't. But you should probably talk to your
supplier with regards to fixing their system.

The BMC knows which console you are attached to, and the firmware
still instructs the kernel to use something else.

/
    Leif

^ permalink raw reply	[flat|nested] 86+ messages in thread

end of thread, other threads:[~2017-09-11 13:23 UTC | newest]

Thread overview: 86+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-05 12:36 [PATCH v10 0/4] ACPI: parse the SPCR table Aleksey Makarov
2016-09-05 12:36 ` Aleksey Makarov
2016-09-05 12:36 ` [PATCH v10 1/4] of/serial: move earlycon early_param handling to serial Aleksey Makarov
2016-09-05 12:36   ` Aleksey Makarov
2016-09-05 12:36   ` Aleksey Makarov
2016-09-05 12:36 ` [PATCH v10 2/4] ACPI: parse SPCR and enable matching console Aleksey Makarov
2016-09-05 12:36   ` Aleksey Makarov
2016-09-05 12:36 ` [PATCH v10 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Aleksey Makarov
2016-09-05 12:36   ` Aleksey Makarov
2016-09-07  9:30   ` Aleksey Makarov
2016-09-07  9:30     ` Aleksey Makarov
2016-09-08 11:16     ` Will Deacon
2016-09-08 11:16       ` Will Deacon
2016-09-08 13:25       ` Graeme Gregory
2016-09-08 13:25         ` Graeme Gregory
2016-09-08 13:25         ` Graeme Gregory
2016-09-08 13:35       ` Hanjun Guo
2016-09-08 13:35         ` Hanjun Guo
2016-09-08 16:34       ` Mark Salter
2016-09-08 16:34         ` Mark Salter
2016-09-09  8:36         ` Graeme Gregory
2016-09-09  8:36           ` Graeme Gregory
2016-09-09  8:36           ` Graeme Gregory
2016-09-09  9:28         ` Hanjun Guo
2016-09-09  9:28           ` Hanjun Guo
2016-09-13 18:45           ` Mark Salter
2016-09-13 18:45             ` Mark Salter
2016-09-09  9:29     ` Will Deacon
2016-09-09  9:29       ` Will Deacon
2016-09-09 15:07       ` Aleksey Makarov
2016-09-09 15:07         ` Aleksey Makarov
2016-09-09 15:17         ` Will Deacon
2016-09-09 15:17           ` Will Deacon
2016-09-05 12:36 ` [PATCH v10 4/4] serial: pl011: add console matching function Aleksey Makarov
2016-09-05 12:36   ` Aleksey Makarov
2016-09-12 15:55 ` [PATCH v10 0/4] ACPI: parse the SPCR table Aleksey Makarov
2016-09-12 15:55   ` Aleksey Makarov
2016-09-16 13:40 ` Aleksey Makarov
2016-09-16 13:40   ` Aleksey Makarov
2016-09-21 10:27 ` Aleksey Makarov
2016-09-21 10:27   ` Aleksey Makarov
2016-09-21 10:37   ` Greg Kroah-Hartman
2016-09-21 10:37     ` Greg Kroah-Hartman
2016-09-21 16:19     ` Timur Tabi
2016-09-21 16:19       ` Timur Tabi
2016-09-21 16:19       ` Timur Tabi
2016-09-21 16:38       ` Greg Kroah-Hartman
2016-09-21 16:38         ` Greg Kroah-Hartman
2016-09-21 16:38         ` Greg Kroah-Hartman
2016-09-21 17:22         ` Aleksey Makarov
2016-09-21 17:22           ` Aleksey Makarov
2016-09-21 17:22           ` Aleksey Makarov
2016-09-26 19:48           ` Aleksey Makarov
2016-09-26 19:48             ` Aleksey Makarov
2016-09-26 19:48             ` Aleksey Makarov
2016-09-27 15:19             ` Greg Kroah-Hartman
2016-09-27 15:19               ` Greg Kroah-Hartman
2016-09-27 15:19               ` Greg Kroah-Hartman
     [not found]               ` <20160927151953.GB4371-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2016-09-27 20:54                 ` [PATCH v11 1/4] of/serial: move earlycon early_param handling to serial Aleksey Makarov
2016-09-27 20:54                   ` Aleksey Makarov
2016-09-27 20:54                   ` Aleksey Makarov
2016-09-27 20:54                   ` [PATCH v11 2/4] ACPI: parse SPCR and enable matching console Aleksey Makarov
2016-09-27 20:54                     ` Aleksey Makarov
2017-09-11  9:11                     ` Andreas Schwab
2017-09-11  9:11                       ` Andreas Schwab
2017-09-11 11:05                       ` Leif Lindholm
2017-09-11 11:05                         ` Leif Lindholm
2017-09-11 11:39                         ` Andreas Schwab
2017-09-11 11:39                           ` Andreas Schwab
2017-09-11 11:39                           ` Andreas Schwab
2017-09-11 12:24                           ` Graeme Gregory
2017-09-11 12:24                             ` Graeme Gregory
2017-09-11 12:24                             ` Graeme Gregory
2017-09-11 12:28                             ` Andreas Schwab
2017-09-11 12:28                               ` Andreas Schwab
2017-09-11 12:28                               ` Andreas Schwab
2017-09-11 13:03                               ` Graeme Gregory
2017-09-11 13:03                                 ` Graeme Gregory
2017-09-11 13:03                                 ` Graeme Gregory
2017-09-11 13:23                               ` Leif Lindholm
2017-09-11 13:23                                 ` Leif Lindholm
2017-09-11 13:23                                 ` Leif Lindholm
2016-09-27 20:54                   ` [PATCH v11 3/4] ARM64: ACPI: enable ACPI_SPCR_TABLE Aleksey Makarov
2016-09-27 20:54                     ` Aleksey Makarov
2016-09-27 20:54                   ` [PATCH v11 4/4] serial: pl011: add console matching function Aleksey Makarov
2016-09-27 20:54                     ` Aleksey Makarov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.