lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <33ed7b90da8439aecb3544c3ff7dcfb511e03b8e.1554457026.git.vitor.soares@synopsys.com>
Date:   Mon,  8 Apr 2019 12:31:23 +0200
From:   Vitor Soares <vitor.soares@...opsys.com>
To:     linux-kernel@...r.kernel.org
Cc:     Vitor Soares <vitor.soares@...opsys.com>,
        Eugeniy Paltsev <eugeniy.Paltsev@...opsys.com>,
        Alexey Brodkin <alexey.brodkin@...opsys.com>,
        Joao Pinto <joao.pinto@...opsys.com>,
        Jose Abreu <jose.abreu@...opsys.com>,
        Luis Oliveira <luis.oliveira@...opsys.com>,
        Gustavo Pimentel <gustavo.pimentel@...opsys.com>,
        Nelson Costa <nelson.costa@...opsys.com>,
        Pedro Sousa <pedrom.sousa@...opsys.com>,
        Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH] reset: axs10x: Implement assert and deassert callbacks

Some custom IP-block connected to ARC AXS10x board need assert and
deassert functions to control reset signal of selected peripherals.

This patch improve AXS10x reset driver by adding assert and deassert
callbacks.

Signed-off-by: Vitor Soares <vitor.soares@...opsys.com>

Cc: Eugeniy Paltsev <eugeniy.Paltsev@...opsys.com>
Cc: Alexey Brodkin <abrodkin@...opsys.com>
Cc: Joao Pinto <jpinto@...opsys.com>
Cc: Jose Abreu <jose.abreu@...opsys.com>
Cc: Luis Oliveira <lolivei@...opsys.com>
Cc: Gustavo Pimentel <gustavo.pimentel@...opsys.com>
Cc: Nelson Costa <nelson.costa@...opsys.com>
Cc: Pedro Sousa <pedrom.sousa@...opsys.com>
Cc: Philipp Zabel <p.zabel@...gutronix.de>
---
 drivers/reset/reset-axs10x.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/reset/reset-axs10x.c b/drivers/reset/reset-axs10x.c
index a854ef41..12dac8b 100644
--- a/drivers/reset/reset-axs10x.c
+++ b/drivers/reset/reset-axs10x.c
@@ -37,8 +37,36 @@ static int axs10x_reset_reset(struct reset_controller_dev *rcdev,
 	return 0;
 }
 
+static int axs10x_reset_assert(struct reset_controller_dev *rcdev,
+			       unsigned long id)
+{
+	struct axs10x_rst *rst = to_axs10x_rst(rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&rst->lock, flags);
+	writel(readl(rst->regs_rst) & ~BIT(id), rst->regs_rst);
+	spin_unlock_irqrestore(&rst->lock, flags);
+
+	return 0;
+}
+
+static int axs10x_reset_deassert(struct reset_controller_dev *rcdev,
+				 unsigned long id)
+{
+	struct axs10x_rst *rst = to_axs10x_rst(rcdev);
+	unsigned long flags;
+
+	spin_lock_irqsave(&rst->lock, flags);
+	writel(readl(rst->regs_rst) | BIT(id), rst->regs_rst);
+	spin_unlock_irqrestore(&rst->lock, flags);
+
+	return 0;
+}
+
 static const struct reset_control_ops axs10x_reset_ops = {
-	.reset	= axs10x_reset_reset,
+	.reset		= axs10x_reset_reset,
+	.assert		= axs10x_reset_assert,
+	.deassert	= axs10x_reset_deassert,
 };
 
 static int axs10x_reset_probe(struct platform_device *pdev)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ