Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3371092pxb; Mon, 16 Nov 2020 12:47:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbcRCnyM7jJRXEgmUjMS7Z8rwGPPGIV0PPW6LHysW6WynPMFe3h05YdwnOzVL4b0vYFJ+7 X-Received: by 2002:aa7:c499:: with SMTP id m25mr16994072edq.237.1605559620607; Mon, 16 Nov 2020 12:47:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605559620; cv=none; d=google.com; s=arc-20160816; b=Us7MptLAa+c1a2g8bsyt9LUtr838JZVod/w/D97tq/RHUf+xvWCGGAw1FD6vqkNUnP Ycl6YdKoFsRkmUkn6NA9BGElbKxqGc86oykuNCJ0YZg1Ve3CnTXwoumgd9UH3sBcK/IN 5U7YH4j2mJMijvPE7Vh8HfO7DemlAiFPqdMS6kmO3XdniSURUwSOKX3Go39f8PY5A313 oohKGuuOxR8ner3aBtGMiPc+4FC5xp87LwJgRxG4CTayuAIVJQSWyWSfcccamHcys8Mz 5Fr/Ek656U4aDt7oKTFIq6mIu2x02PngXy1E7trMbosL/AOgsoTqcHxOU80FCrza1ptb S3NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=O87+3X99zdDFjb31h/+BMI7yo4qZxe0+5ub8N10H7oQ=; b=ozXYQuo0H1jyVpdEX9ehO1pgmg0BC4SsssaOfX8e9a+Dq8thGC0Rdegaw70GBBuzAd r19FZe9WOeeyeflV2TeqsO0pPZZcSqCCW/Ey681E+3Ztn76vkEgHvUwbAAzCIhiC6wRg xYRlaZyerYailLGYDIi0JwhuJUt8dSoJgBq46N0Zoium9OTdxXlBv/yGU61resVvpP7i eeGvVj+jCReLABFtVqikklM5XOp2U/Z6lx11iq+7RJh7ikZX5ogZL8T8LTnSGXVX1r5s nfUijP3ZMhzewrIMlEzQWWg7FgBjiMUjZriasmQ4t8l1TG04s/i2dpr8oMrI60hFgw0+ rauw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f4si12567080edq.363.2020.11.16.12.46.38; Mon, 16 Nov 2020 12:47:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732651AbgKPRMW (ORCPT + 99 others); Mon, 16 Nov 2020 12:12:22 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:58315 "EHLO relay5-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732637AbgKPRMW (ORCPT ); Mon, 16 Nov 2020 12:12:22 -0500 X-Originating-IP: 91.175.115.186 Received: from localhost (91-175-115-186.subs.proxad.net [91.175.115.186]) (Authenticated sender: gregory.clement@bootlin.com) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 938971C0003; Mon, 16 Nov 2020 17:12:19 +0000 (UTC) From: Gregory CLEMENT To: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org Cc: Thomas Petazzoni , Alexandre Belloni , Lars Povlsen , , Gregory CLEMENT Subject: [PATCH 4/5] power: reset: ocelot: Add support 2 othe MIPS based SoCs Date: Mon, 16 Nov 2020 18:11:58 +0100 Message-Id: <20201116171159.1735315-5-gregory.clement@bootlin.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201116171159.1735315-1-gregory.clement@bootlin.com> References: <20201116171159.1735315-1-gregory.clement@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds reset support for Luton and Jaguar2 in the ocelot-reset driver. They are both MIPS based belonging to the VvoreIII family. Signed-off-by: Gregory CLEMENT --- drivers/power/reset/ocelot-reset.c | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/power/reset/ocelot-reset.c b/drivers/power/reset/ocelot-reset.c index a203c42e99d4..0f92416f2907 100644 --- a/drivers/power/reset/ocelot-reset.c +++ b/drivers/power/reset/ocelot-reset.c @@ -29,6 +29,8 @@ struct ocelot_reset_context { struct notifier_block restart_handler; }; +#define BIT_OFF_INVALID 32 + #define SOFT_SWC_RST BIT(1) #define SOFT_CHIP_RST BIT(0) @@ -77,9 +79,11 @@ static int ocelot_restart_handle(struct notifier_block *this, ctx->props->vcore_protect, 0); /* Make the SI back to boot mode */ - regmap_update_bits(ctx->cpu_ctrl, ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL, - IF_SI_OWNER_MASK << if_si_owner_bit, - IF_SI_OWNER_SIBM << if_si_owner_bit); + if (if_si_owner_bit != BIT_OFF_INVALID) + regmap_update_bits(ctx->cpu_ctrl, + ICPU_CFG_CPU_SYSTEM_CTRL_GENERAL_CTRL, + IF_SI_OWNER_MASK << if_si_owner_bit, + IF_SI_OWNER_SIBM << if_si_owner_bit); pr_emerg("Resetting SoC\n"); @@ -127,6 +131,20 @@ static int ocelot_reset_probe(struct platform_device *pdev) return err; } +static const struct reset_props reset_props_jaguar2 = { + .syscon = "mscc,ocelot-cpu-syscon", + .protect_reg = 0x20, + .vcore_protect = BIT(2), + .if_si_owner_bit = 6, +}; + +static const struct reset_props reset_props_luton = { + .syscon = "mscc,ocelot-cpu-syscon", + .protect_reg = 0x20, + .vcore_protect = BIT(2), + .if_si_owner_bit = BIT_OFF_INVALID, /* n/a */ +}; + static const struct reset_props reset_props_ocelot = { .syscon = "mscc,ocelot-cpu-syscon", .protect_reg = 0x20, @@ -143,6 +161,12 @@ static const struct reset_props reset_props_sparx5 = { static const struct of_device_id ocelot_reset_of_match[] = { { + .compatible = "mscc,jaguar2-chip-reset", + .data = &reset_props_jaguar2 + }, { + .compatible = "mscc,luton-chip-reset", + .data = &reset_props_luton + }, { .compatible = "mscc,ocelot-chip-reset", .data = &reset_props_ocelot }, { -- 2.29.2