Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4d54f71 authored by Stewart Smith's avatar Stewart Smith Committed by Michael Ellerman
Browse files

powerpc/powernv: remove FW_FEATURE_OPALv3 and just use FW_FEATURE_OPAL



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_OPALv3 and instead use FW_FEATURE_OPAL
exclusively.

Signed-off-by: default avatarStewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7261aafc
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -51,7 +51,6 @@
#define FW_FEATURE_BEST_ENERGY	ASM_CONST(0x0000000080000000)
#define FW_FEATURE_TYPE1_AFFINITY ASM_CONST(0x0000000100000000)
#define FW_FEATURE_PRRN		ASM_CONST(0x0000000200000000)
#define FW_FEATURE_OPALv3	ASM_CONST(0x0000000400000000)

#ifndef __ASSEMBLY__

@@ -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_OPAL,
	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,
+2 −2
Original line number Diff line number Diff line
@@ -48,8 +48,8 @@ static int pnv_eeh_init(void)
	struct pci_controller *hose;
	struct pnv_phb *phb;

	if (!firmware_has_feature(FW_FEATURE_OPALv3)) {
		pr_warn("%s: OPALv3 is required !\n",
	if (!firmware_has_feature(FW_FEATURE_OPAL)) {
		pr_warn("%s: OPAL is required !\n",
			__func__);
		return -EINVAL;
	}
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ static int __init pnv_init_idle_states(void)
	if (cpuidle_disable != IDLE_NO_OVERRIDE)
		goto out;

	if (!firmware_has_feature(FW_FEATURE_OPALv3))
	if (!firmware_has_feature(FW_FEATURE_OPAL))
		goto out;

	power_mgt = of_find_node_by_path("/ibm,opal/power-mgt");
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ static const struct scom_controller opal_scom_controller = {

static int opal_xscom_init(void)
{
	if (firmware_has_feature(FW_FEATURE_OPALv3))
	if (firmware_has_feature(FW_FEATURE_OPAL))
		scom_init(&opal_scom_controller);
	return 0;
}
+11 −14
Original line number Diff line number Diff line
@@ -98,10 +98,9 @@ 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");
		powerpc_firmware_features |= FW_FEATURE_OPAL;
		pr_info("OPAL detected !\n");
	} else {
		panic("OPAL != V3 detected, no longer supported.\n");
	}
@@ -348,7 +347,6 @@ int opal_put_chars(uint32_t vtermno, const char *data, int total_len)
	 * enough room and be done with it
	 */
	spin_lock_irqsave(&opal_write_lock, flags);
	if (firmware_has_feature(FW_FEATURE_OPALv3)) {
	rc = opal_console_write_buffer_space(vtermno, &olen);
	len = be64_to_cpu(olen);
	if (rc || len < total_len) {
@@ -359,7 +357,6 @@ int opal_put_chars(uint32_t vtermno, const char *data, int total_len)
		opal_poll_events(NULL);
		return -EAGAIN;
	}
	}

	/* We still try to handle partial completions, though they
	 * should no longer happen.
Loading