linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed
@ 2020-01-30 16:16 JaeJoon Jung
  2020-02-19  3:56 ` Yash Shah
  0 siblings, 1 reply; 3+ messages in thread
From: JaeJoon Jung @ 2020-01-30 16:16 UTC (permalink / raw)
  To: Yash Shah; +Cc: linux-riscv

Hello Yash Shah,

I am testing the your patch:
[PATCH v4 0/6] GPIO & Hierarchy IRQ support for HiFive Unleashed
from 2019-12-10 11:11 Yash Shah

I found out that you repaired the generic GPIO using bgpio_init(...) API.
bgpio_init() has 9 parameters, and the last is flags.
The flag getting to bgpio_init() is must be BGPIOF_READ_OUTPUT_REG_SET.

Because FU540 GPIOs have different input/output register,
If GPIO direction is input(SIFIVE_GPIO_INPUT_VAL), it must be read
input value(SIFIVE_GPIO_INPUT_EN).
If GPIO direction is output(SIFIVE_GPIO_OUTPUT_VAL), it must be read
output value(SIFIVE_GPIO_OUTPUT_EN).

If The flag is 0, GPIO output value is being reset and the value is
reading 0 always.

diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c
index 23d5e22694d1..1de1af452fcb 100644
--- a/drivers/gpio/gpio-sifive.c
+++ b/drivers/gpio/gpio-sifive.c
@@ -206,7 +206,7 @@ static int sifive_gpio_probe(struct platform_device *pdev)
                         NULL,
                         chip->base + SIFIVE_GPIO_OUTPUT_EN,
                         chip->base + SIFIVE_GPIO_INPUT_EN,
-                        0);
+                        BGPIOF_READ_OUTPUT_REG_SET);
        if (ret) {
                dev_err(dev, "unable to init generic GPIO\n");
                return ret;

Yours,
JaeJoon Jung


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed
  2020-01-30 16:16 [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed JaeJoon Jung
@ 2020-02-19  3:56 ` Yash Shah
  2020-02-19 21:14   ` JaeJoon Jung
  0 siblings, 1 reply; 3+ messages in thread
From: Yash Shah @ 2020-02-19  3:56 UTC (permalink / raw)
  To: JaeJoon Jung; +Cc: linux-riscv

> -----Original Message-----
> From: JaeJoon Jung <rgbi3307@gmail.com>
> Sent: 30 January 2020 21:47
> To: Yash Shah <yash.shah@sifive.com>
> Cc: linux-riscv <linux-riscv@lists.infradead.org>
> Subject: [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed
> 
> Hello Yash Shah,
> 
> I am testing the your patch:
> [PATCH v4 0/6] GPIO & Hierarchy IRQ support for HiFive Unleashed from
> 2019-12-10 11:11 Yash Shah
> 
> I found out that you repaired the generic GPIO using bgpio_init(...) API.
> bgpio_init() has 9 parameters, and the last is flags.
> The flag getting to bgpio_init() is must be BGPIOF_READ_OUTPUT_REG_SET.
> 
> Because FU540 GPIOs have different input/output register, If GPIO direction
> is input(SIFIVE_GPIO_INPUT_VAL), it must be read input
> value(SIFIVE_GPIO_INPUT_EN).
> If GPIO direction is output(SIFIVE_GPIO_OUTPUT_VAL), it must be read
> output value(SIFIVE_GPIO_OUTPUT_EN).
> 
> If The flag is 0, GPIO output value is being reset and the value is reading 0
> always.
> 
> diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index
> 23d5e22694d1..1de1af452fcb 100644
> --- a/drivers/gpio/gpio-sifive.c
> +++ b/drivers/gpio/gpio-sifive.c
> @@ -206,7 +206,7 @@ static int sifive_gpio_probe(struct platform_device
> *pdev)
>                          NULL,
>                          chip->base + SIFIVE_GPIO_OUTPUT_EN,
>                          chip->base + SIFIVE_GPIO_INPUT_EN,
> -                        0);
> +                        BGPIOF_READ_OUTPUT_REG_SET);
>         if (ret) {
>                 dev_err(dev, "unable to init generic GPIO\n");
>                 return ret;
> 
> Yours,
> JaeJoon Jung

Thanks for the bug report. I will look into this and send a fix.

- Yash

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed
  2020-02-19  3:56 ` Yash Shah
@ 2020-02-19 21:14   ` JaeJoon Jung
  0 siblings, 0 replies; 3+ messages in thread
From: JaeJoon Jung @ 2020-02-19 21:14 UTC (permalink / raw)
  To: Yash Shah; +Cc: linux-riscv

Great, thanks!
I am interested in RISC-V and SiFive.
If I find another bug, I will report.
JaeJoon Jung.

On Wed, 19 Feb 2020 at 12:56, Yash Shah <yash.shah@sifive.com> wrote:
>
> > -----Original Message-----
> > From: JaeJoon Jung <rgbi3307@gmail.com>
> > Sent: 30 January 2020 21:47
> > To: Yash Shah <yash.shah@sifive.com>
> > Cc: linux-riscv <linux-riscv@lists.infradead.org>
> > Subject: [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed
> >
> > Hello Yash Shah,
> >
> > I am testing the your patch:
> > [PATCH v4 0/6] GPIO & Hierarchy IRQ support for HiFive Unleashed from
> > 2019-12-10 11:11 Yash Shah
> >
> > I found out that you repaired the generic GPIO using bgpio_init(...) API.
> > bgpio_init() has 9 parameters, and the last is flags.
> > The flag getting to bgpio_init() is must be BGPIOF_READ_OUTPUT_REG_SET.
> >
> > Because FU540 GPIOs have different input/output register, If GPIO direction
> > is input(SIFIVE_GPIO_INPUT_VAL), it must be read input
> > value(SIFIVE_GPIO_INPUT_EN).
> > If GPIO direction is output(SIFIVE_GPIO_OUTPUT_VAL), it must be read
> > output value(SIFIVE_GPIO_OUTPUT_EN).
> >
> > If The flag is 0, GPIO output value is being reset and the value is reading 0
> > always.
> >
> > diff --git a/drivers/gpio/gpio-sifive.c b/drivers/gpio/gpio-sifive.c index
> > 23d5e22694d1..1de1af452fcb 100644
> > --- a/drivers/gpio/gpio-sifive.c
> > +++ b/drivers/gpio/gpio-sifive.c
> > @@ -206,7 +206,7 @@ static int sifive_gpio_probe(struct platform_device
> > *pdev)
> >                          NULL,
> >                          chip->base + SIFIVE_GPIO_OUTPUT_EN,
> >                          chip->base + SIFIVE_GPIO_INPUT_EN,
> > -                        0);
> > +                        BGPIOF_READ_OUTPUT_REG_SET);
> >         if (ret) {
> >                 dev_err(dev, "unable to init generic GPIO\n");
> >                 return ret;
> >
> > Yours,
> > JaeJoon Jung
>
> Thanks for the bug report. I will look into this and send a fix.
>
> - Yash


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-02-19 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-30 16:16 [bug report] GPIO & Hierarchy IRQ support for HiFive Unleashed JaeJoon Jung
2020-02-19  3:56 ` Yash Shah
2020-02-19 21:14   ` JaeJoon Jung

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).