linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: sjitindarsingh@gmail.com
Subject: [RFC] [PATCH 2/3] powernv/setup: Initialise opal_oppanel and display information on boot
Date: Tue,  2 Aug 2016 17:48:36 +1000	[thread overview]
Message-ID: <1470124117-24419-2-git-send-email-sjitindarsingh@gmail.com> (raw)
In-Reply-To: <1470124117-24419-1-git-send-email-sjitindarsingh@gmail.com>

Now that we have the ability to access the operator panel display from
within the kernel print out some platform information on boot.

Update the opal initialisation function to call the init function for the
new oppanel interface, this also removes the need to explicitly create the
platform device as this is now handled in the oppanel init function.

Now that we are able to access the operator panel display from the kernel
update the powernv platform progress function to write to the display.
Add a function to print some platform information to the display on
boot.

Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
---
 arch/powerpc/platforms/powernv/opal.c  |  8 +++++---
 arch/powerpc/platforms/powernv/setup.c | 27 +++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 228751a..62ea5e5 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -705,6 +705,11 @@ static int __init opal_init(void)
 	/* Initialise OPAL asynchronous completion interface */
 	opal_async_comp_init();
 
+#if defined(CONFIG_POWERNV_OP_PANEL) || defined(CONFIG_POWERNV_OP_PANEL_MODULE)
+	/* Initialise OPAL oppanel interface */
+	opal_oppanel_init();
+#endif /* CONFIG_POWERNV_OP_PANEL */
+
 	/* Initialise OPAL sensor interface */
 	opal_sensor_init();
 
@@ -751,9 +756,6 @@ static int __init opal_init(void)
 	opal_pdev_init(opal_node, "ibm,opal-flash");
 	opal_pdev_init(opal_node, "ibm,opal-prd");
 
-	/* Initialise platform device: oppanel interface */
-	opal_pdev_init(opal_node, "ibm,opal-oppanel");
-
 	/* Initialise OPAL kmsg dumper for flushing console on panic */
 	opal_kmsg_init();
 
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index ee6430b..0f0e557 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -27,6 +27,7 @@
 #include <linux/interrupt.h>
 #include <linux/bug.h>
 #include <linux/pci.h>
+#include <linux/utsname.h>
 #include <linux/cpufreq.h>
 
 #include <asm/machdep.h>
@@ -58,6 +59,29 @@ static void __init pnv_setup_arch(void)
 	/* XXX PMCS */
 }
 
+static int __init pnv_late_init(void)
+{
+#if defined(CONFIG_POWERNV_OP_PANEL) || defined(CONFIG_POWERNV_OP_PANEL_MODULE)
+	char msg[17] = {'\0'};
+#endif /* CONFIG_POWERNV_OP_PANEL */
+	/* Manually leave the kernel version on the panel */
+#ifdef __BIG_ENDIAN__
+	ppc_md.progress("Linux ppc64\n", 0);
+#else
+	ppc_md.progress("Linux ppc64le\n", 0);
+#endif
+#if defined(CONFIG_POWERNV_OP_PANEL) || defined(CONFIG_POWERNV_OP_PANEL_MODULE)
+	/* Limit what we print to 16 chars so the previous line remains */
+	memcpy(msg, init_utsname()->release, 16);
+	ppc_md.progress(msg, 0);
+#else
+	ppc_md.progress(init_utsname()->release, 0);
+#endif /* CONFIG_POWERNV_OP_PANEL */
+
+	return 0;
+}
+machine_late_initcall(powernv, pnv_late_init);
+
 static void __init pnv_init_early(void)
 {
 	/*
@@ -159,6 +183,9 @@ static void __noreturn pnv_halt(void)
 
 static void pnv_progress(char *s, unsigned short hex)
 {
+#if defined(CONFIG_POWERNV_OP_PANEL) || defined(CONFIG_POWERNV_OP_PANEL_MODULE)
+	opal_oppanel_write(s);
+#endif /* CONFIG_POWERNV_OP_PANEL */
 }
 
 static void pnv_shutdown(void)
-- 
2.5.5

  reply	other threads:[~2016-08-02  7:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-02  7:48 [RFC] [PATCH 1/3] powernv/opal: Introduce new opal_oppanel interface to expose the op_panel Suraj Jitindar Singh
2016-08-02  7:48 ` Suraj Jitindar Singh [this message]
2016-08-02  7:48 ` [RFC] [PATCH 3/3] powernv/oppanel: Update op_panel module to utilise opal_oppanel interface Suraj Jitindar Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1470124117-24419-2-git-send-email-sjitindarsingh@gmail.com \
    --to=sjitindarsingh@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).