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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <13D59CF9CEBAF94592A12E8AE55501350A611EA9@DE02WEMBXB.internal.synopsys.com>
Date:   Mon, 8 Apr 2019 13:25:52 +0000
From:   Vitor Soares <vitor.soares@...opsys.com>
To:     Eugeniy Paltsev <eugeniy.paltsev@...opsys.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "vitor.soares@...opsys.com" <vitor.soares@...opsys.com>
CC:     Joao Pinto <joao.pinto@...opsys.com>,
        "nelson.costa@...opsys.com" <nelson.costa@...opsys.com>,
        Luis de Oliveira <luis.oliveira@...opsys.com>,
        "eugeniy.Paltsev@...opsys.com" <eugeniy.paltsev@...opsys.com>,
        "gustavo.pimentel@...opsys.com" <gustavo.pimentel@...opsys.com>,
        "Alexey Brodkin" <alexey.brodkin@...opsys.com>,
        "jose.abreu@...opsys.com" <jose.abreu@...opsys.com>,
        "p.zabel@...gutronix.de" <p.zabel@...gutronix.de>,
        "pedrom.sousa@...opsys.com" <pedrom.sousa@...opsys.com>
Subject: RE: [PATCH] reset: axs10x: Implement assert and deassert callbacks

Hi Eugeniy,

From: Eugeniy Paltsev <paltsev@...opsys.com>
Date: Mon, Apr 08, 2019 at 12:40:00

> Hi Vitor,
> 
> On Mon, 2019-04-08 at 12:31 +0200, Vitor Soares wrote:
> > 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.
> 
> 
> In the AXS10x reset driver only 'reset' callback is intentionally 
> > implemented.
> AXS10x is FPGA based boards and with our default firmware AXS10x reset 
> > register is implemented as self-deasserted.
> 

I have another reset block connect through AXI.

> Do you have somehow modified AXS10x firmware where reset register is not 
> > self-deasserted?
> In that case "simple-reset" driver will be suitable for you, I guess.

I will try it.

> Otherwise this implementation is incorrect - there should be no 'assert' for 
> > reset controller with self-deasserted logic.

So the assert and reset callback are mutually exclusive?

> 
> 
> > 
> > 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)
> -- 
>  Eugeniy Paltsev
> 

Best regards,
Vitor Soares

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ