linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stewart Smith <stewart@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Stewart Smith <stewart@linux.vnet.ibm.com>
Subject: [PATCH 3/4] powerpc/powernv: remove FW_FEATURE_OPAL and just use FW_FEATURE_OPALv3
Date: Fri, 27 Nov 2015 15:45:25 +1100	[thread overview]
Message-ID: <1448599526-31073-4-git-send-email-stewart@linux.vnet.ibm.com> (raw)
In-Reply-To: <1448599526-31073-1-git-send-email-stewart@linux.vnet.ibm.com>

Long ago, only in the lab, there was OPALv1 and OPALv2. Now there is
just OPALv3, with nobody ever expecting anything on pre-OPALv3 to
be cared about or supported by mainline kernels.

So, let's remove FW_FEATURE_OPAL and instead use FW_FEATURE_OPALv3
exclusively.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
---
 arch/powerpc/include/asm/firmware.h    | 3 +--
 arch/powerpc/mm/numa.c                 | 4 ++--
 arch/powerpc/platforms/powernv/opal.c  | 3 +--
 arch/powerpc/platforms/powernv/pci.c   | 2 +-
 arch/powerpc/platforms/powernv/setup.c | 8 +++-----
 arch/powerpc/sysdev/xics/ics-opal.c    | 2 +-
 drivers/i2c/busses/i2c-opal.c          | 2 +-
 drivers/rtc/rtc-opal.c                 | 2 +-
 drivers/tty/hvc/hvc_opal.c             | 2 +-
 9 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/arch/powerpc/include/asm/firmware.h b/arch/powerpc/include/asm/firmware.h
index 50af5e5ea86f..3901e2ee3f16 100644
--- a/arch/powerpc/include/asm/firmware.h
+++ b/arch/powerpc/include/asm/firmware.h
@@ -46,7 +46,6 @@
 #define FW_FEATURE_CMO		ASM_CONST(0x0000000002000000)
 #define FW_FEATURE_VPHN		ASM_CONST(0x0000000004000000)
 #define FW_FEATURE_XCMO		ASM_CONST(0x0000000008000000)
-#define FW_FEATURE_OPAL		ASM_CONST(0x0000000010000000)
 #define FW_FEATURE_SET_MODE	ASM_CONST(0x0000000040000000)
 #define FW_FEATURE_BEST_ENERGY	ASM_CONST(0x0000000080000000)
 #define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000)
@@ -69,7 +68,7 @@ enum {
 		FW_FEATURE_SET_MODE | FW_FEATURE_BEST_ENERGY |
 		FW_FEATURE_TYPE1_AFFINITY | FW_FEATURE_PRRN,
 	FW_FEATURE_PSERIES_ALWAYS = 0,
-	FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPAL | FW_FEATURE_OPALv3,
+	FW_FEATURE_POWERNV_POSSIBLE = FW_FEATURE_OPALv3,
 	FW_FEATURE_POWERNV_ALWAYS = 0,
 	FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
 	FW_FEATURE_PS3_ALWAYS = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 669a15e7fa76..06da32c6a007 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -297,7 +297,7 @@ static int __init find_min_common_depth(void)
 	int depth;
 	struct device_node *root;
 
-	if (firmware_has_feature(FW_FEATURE_OPAL))
+	if (firmware_has_feature(FW_FEATURE_OPALv3))
 		root = of_find_node_by_path("/ibm,opal");
 	else
 		root = of_find_node_by_path("/rtas");
@@ -327,7 +327,7 @@ static int __init find_min_common_depth(void)
 
 	distance_ref_points_depth /= sizeof(int);
 
-	if (firmware_has_feature(FW_FEATURE_OPAL) ||
+	if (firmware_has_feature(FW_FEATURE_OPALv3) ||
 	    firmware_has_feature(FW_FEATURE_TYPE1_AFFINITY)) {
 		dbg("Using form 1 affinity\n");
 		form1_affinity = 1;
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 5ce51d9b4ca6..bcb6581ec75c 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -98,7 +98,6 @@ int __init early_init_dt_scan_opal(unsigned long node,
 	pr_debug("OPAL Entry = 0x%llx (sizep=%p runtimesz=%d)\n",
 		 opal.size, sizep, runtimesz);
 
-	powerpc_firmware_features |= FW_FEATURE_OPAL;
 	if (of_flat_dt_is_compatible(node, "ibm,opal-v3")) {
 		powerpc_firmware_features |= FW_FEATURE_OPALv3;
 		pr_info("OPAL V3 detected !\n");
@@ -180,7 +179,7 @@ static int __init opal_register_exception_handlers(void)
 #ifdef __BIG_ENDIAN__
 	u64 glue;
 
-	if (!(powerpc_firmware_features & FW_FEATURE_OPAL))
+	if (!(powerpc_firmware_features & FW_FEATURE_OPALv3))
 		return -ENODEV;
 
 	/* Hookup some exception handlers except machine check. We use the
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index f2dd77234240..6041b795f593 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -786,7 +786,7 @@ void __init pnv_pci_init(void)
 	pci_add_flags(PCI_CAN_SKIP_ISA_ALIGN);
 
 	/* If we don't have OPAL, eg. in sim, just skip PCI probe */
-	if (!firmware_has_feature(FW_FEATURE_OPAL))
+	if (!firmware_has_feature(FW_FEATURE_OPALv3))
 		return;
 
 	/* Look for IODA IO-Hubs. We don't support mixing IODA
diff --git a/arch/powerpc/platforms/powernv/setup.c b/arch/powerpc/platforms/powernv/setup.c
index 80e7ed362ffa..d79b07f1b33b 100644
--- a/arch/powerpc/platforms/powernv/setup.c
+++ b/arch/powerpc/platforms/powernv/setup.c
@@ -49,7 +49,7 @@ static void __init pnv_setup_arch(void)
 	pnv_pci_init();
 
 	/* Setup RTC and NVRAM callbacks */
-	if (firmware_has_feature(FW_FEATURE_OPAL))
+	if (firmware_has_feature(FW_FEATURE_OPALv3))
 		opal_nvram_init();
 
 	/* Enable NAP mode */
@@ -67,7 +67,7 @@ static void __init pnv_init_early(void)
 	opal_lpc_init();
 
 #ifdef CONFIG_HVC_OPAL
-	if (firmware_has_feature(FW_FEATURE_OPAL))
+	if (firmware_has_feature(FW_FEATURE_OPALv3))
 		hvc_opal_init_early();
 	else
 #endif
@@ -92,8 +92,6 @@ static void pnv_show_cpuinfo(struct seq_file *m)
 	seq_printf(m, "machine\t\t: PowerNV %s\n", model);
 	if (firmware_has_feature(FW_FEATURE_OPALv3))
 		seq_printf(m, "firmware\t: OPAL v3\n");
-	else if (firmware_has_feature(FW_FEATURE_OPAL))
-		seq_printf(m, "firmware\t: OPAL v1\n");
 	else
 		seq_printf(m, "firmware\t: BML\n");
 	of_node_put(root);
@@ -277,7 +275,7 @@ static int __init pnv_probe(void)
 
 	hpte_init_native();
 
-	if (firmware_has_feature(FW_FEATURE_OPAL))
+	if (firmware_has_feature(FW_FEATURE_OPALv3))
 		pnv_setup_machdep_opal();
 
 	pr_debug("PowerNV detected !\n");
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c
index 27c936c080a6..ac60ef2aff80 100644
--- a/arch/powerpc/sysdev/xics/ics-opal.c
+++ b/arch/powerpc/sysdev/xics/ics-opal.c
@@ -226,7 +226,7 @@ static long ics_opal_get_server(struct ics *ics, unsigned long vec)
 
 int __init ics_opal_init(void)
 {
-	if (!firmware_has_feature(FW_FEATURE_OPAL))
+	if (!firmware_has_feature(FW_FEATURE_OPALv3))
 		return -ENODEV;
 
 	/* We need to patch our irq chip's EOI to point to the
diff --git a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
index 75dd6d041241..39f99207400f 100644
--- a/drivers/i2c/busses/i2c-opal.c
+++ b/drivers/i2c/busses/i2c-opal.c
@@ -276,7 +276,7 @@ static struct platform_driver i2c_opal_driver = {
 
 static int __init i2c_opal_init(void)
 {
-	if (!firmware_has_feature(FW_FEATURE_OPAL))
+	if (!firmware_has_feature(FW_FEATURE_OPALv3))
 		return -ENODEV;
 
 	return platform_driver_register(&i2c_opal_driver);
diff --git a/drivers/rtc/rtc-opal.c b/drivers/rtc/rtc-opal.c
index df39ce02a99d..56da8e7ae83f 100644
--- a/drivers/rtc/rtc-opal.c
+++ b/drivers/rtc/rtc-opal.c
@@ -244,7 +244,7 @@ static struct platform_driver opal_rtc_driver = {
 
 static int __init opal_rtc_init(void)
 {
-	if (!firmware_has_feature(FW_FEATURE_OPAL))
+	if (!firmware_has_feature(FW_FEATURE_OPALv3))
 		return -ENODEV;
 
 	return platform_driver_register(&opal_rtc_driver);
diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 47b54c6aefd2..580369310e0d 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -255,7 +255,7 @@ static struct platform_driver hvc_opal_driver = {
 
 static int __init hvc_opal_init(void)
 {
-	if (!firmware_has_feature(FW_FEATURE_OPAL))
+	if (!firmware_has_feature(FW_FEATURE_OPALv3))
 		return -ENODEV;
 
 	/* Register as a vio device to receive callbacks */
-- 
2.1.4

  parent reply	other threads:[~2015-11-27  4:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27  4:45 [PATCH 0/4] Remove OPAL pre-v3 support Stewart Smith
2015-11-27  4:45 ` [PATCH 1/4] powerpc/powernv: panic() on OPAL < V3 Stewart Smith
2015-11-27  5:36   ` Andrew Donnellan
2015-11-27  5:43     ` Stewart Smith
2015-11-27  5:56       ` Andrew Donnellan
2015-11-30  0:20     ` Andrew Donnellan
2015-11-27  7:13   ` kbuild test robot
2015-11-27  4:45 ` [PATCH 2/4] powerpc/powernv: Remove OPALv2 firmware define and references Stewart Smith
2015-11-27  5:31   ` Andrew Donnellan
2015-11-27  4:45 ` Stewart Smith [this message]
2015-11-27  5:45   ` [PATCH 3/4] powerpc/powernv: remove FW_FEATURE_OPAL and just use FW_FEATURE_OPALv3 Andrew Donnellan
2015-12-01  3:56   ` Michael Ellerman
2015-12-03  6:06     ` Stewart Smith
2015-12-03  8:55       ` Michael Ellerman
2015-11-27  4:45 ` [PATCH 4/4] powerpc/powernv: remove logic for pre-OPALv3 firmware Stewart Smith
2015-11-27  5:55   ` Andrew Donnellan
2015-12-09  6:18 ` [PATCH v2 0/3] Remove OPAL pre-v3 support Stewart Smith
2015-12-09  6:18 ` [PATCH v2 1/3] powerpc/powernv: panic() on OPAL < V3 Stewart Smith
2015-12-17 11:57   ` [v2,1/3] " Michael Ellerman
2015-12-09  6:18 ` [PATCH v2 2/3] powerpc/powernv: Remove OPALv2 firmware define and references Stewart Smith
2015-12-09  6:18 ` [PATCH v2 3/3] powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL Stewart Smith

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=1448599526-31073-4-git-send-email-stewart@linux.vnet.ibm.com \
    --to=stewart@linux.vnet.ibm.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).