Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-07-12 Thread Simon Goldschmidt

Am 12.07.2019 um 07:23 schrieb Simon Goldschmidt:

On Fri, Jul 12, 2019 at 7:15 AM Marek Vasut  wrote:


On 7/10/19 9:22 PM, Simon Goldschmidt wrote:

Am 09.05.2019 um 21:53 schrieb Marek Vasut:

On 5/9/19 8:55 PM, Simon Goldschmidt wrote:



On 09.05.19 20:08, Simon Goldschmidt wrote:

This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.

Signed-off-by: Simon Goldschmidt 
---

Changes in v3:
- moved socfpga gen5 sysreset driver to extra patch

Changes in v2: None

drivers/sysreset/Kconfig|  7 
drivers/sysreset/Makefile   |  1 +
drivers/sysreset/sysreset_socfpga.c | 56
+
3 files changed, 64 insertions(+)
create mode 100644 drivers/sysreset/sysreset_socfpga.c


I just noticed patman complained about new files regarding MAINTAINERS.
Should these new drivers be listed in the MAINTAINERS file under the
socfpga section? I noticed other platforms seem to do that but we don't.
How is this handled?


I think that's sane.


Sorry for the delay of nearly two months, but what did you mean by this?
Add the files to MAINTAINERS?


I think so.


Right, I think so, too. Just was reluctant as it was the first being
added there...


Oh well, I just saw I first need to solve the issues in the "spl: 
kconfig: separate sysreset and firmware drivers from misc" patch 
(https://patchwork.ozlabs.org/patch/1097203/) and send its v3, or else 
including sysreset in SPL needs CONFIG_SPL_DRIVERS_MISC_SUPPORT set :-(


Regards,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-07-11 Thread Simon Goldschmidt
On Fri, Jul 12, 2019 at 7:15 AM Marek Vasut  wrote:
>
> On 7/10/19 9:22 PM, Simon Goldschmidt wrote:
> > Am 09.05.2019 um 21:53 schrieb Marek Vasut:
> >> On 5/9/19 8:55 PM, Simon Goldschmidt wrote:
> >>>
> >>>
> >>> On 09.05.19 20:08, Simon Goldschmidt wrote:
>  This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.
> 
>  Signed-off-by: Simon Goldschmidt 
>  ---
> 
>  Changes in v3:
>  - moved socfpga gen5 sysreset driver to extra patch
> 
>  Changes in v2: None
> 
> drivers/sysreset/Kconfig|  7 
> drivers/sysreset/Makefile   |  1 +
> drivers/sysreset/sysreset_socfpga.c | 56
>  +
> 3 files changed, 64 insertions(+)
> create mode 100644 drivers/sysreset/sysreset_socfpga.c
> >>>
> >>> I just noticed patman complained about new files regarding MAINTAINERS.
> >>> Should these new drivers be listed in the MAINTAINERS file under the
> >>> socfpga section? I noticed other platforms seem to do that but we don't.
> >>> How is this handled?
> >>
> >> I think that's sane.
> >
> > Sorry for the delay of nearly two months, but what did you mean by this?
> > Add the files to MAINTAINERS?
>
> I think so.

Right, I think so, too. Just was reluctant as it was the first being
added there...

Thanks,
Simon
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-07-11 Thread Marek Vasut
On 7/10/19 9:22 PM, Simon Goldschmidt wrote:
> Am 09.05.2019 um 21:53 schrieb Marek Vasut:
>> On 5/9/19 8:55 PM, Simon Goldschmidt wrote:
>>>
>>>
>>> On 09.05.19 20:08, Simon Goldschmidt wrote:
 This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.

 Signed-off-by: Simon Goldschmidt 
 ---

 Changes in v3:
 - moved socfpga gen5 sysreset driver to extra patch

 Changes in v2: None

    drivers/sysreset/Kconfig    |  7 
    drivers/sysreset/Makefile   |  1 +
    drivers/sysreset/sysreset_socfpga.c | 56
 +
    3 files changed, 64 insertions(+)
    create mode 100644 drivers/sysreset/sysreset_socfpga.c
>>>
>>> I just noticed patman complained about new files regarding MAINTAINERS.
>>> Should these new drivers be listed in the MAINTAINERS file under the
>>> socfpga section? I noticed other platforms seem to do that but we don't.
>>> How is this handled?
>>
>> I think that's sane.
> 
> Sorry for the delay of nearly two months, but what did you mean by this?
> Add the files to MAINTAINERS?

I think so.
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-07-10 Thread Simon Goldschmidt

Am 09.05.2019 um 21:53 schrieb Marek Vasut:

On 5/9/19 8:55 PM, Simon Goldschmidt wrote:



On 09.05.19 20:08, Simon Goldschmidt wrote:

This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.

Signed-off-by: Simon Goldschmidt 
---

Changes in v3:
- moved socfpga gen5 sysreset driver to extra patch

Changes in v2: None

   drivers/sysreset/Kconfig    |  7 
   drivers/sysreset/Makefile   |  1 +
   drivers/sysreset/sysreset_socfpga.c | 56 +
   3 files changed, 64 insertions(+)
   create mode 100644 drivers/sysreset/sysreset_socfpga.c


I just noticed patman complained about new files regarding MAINTAINERS.
Should these new drivers be listed in the MAINTAINERS file under the
socfpga section? I noticed other platforms seem to do that but we don't.
How is this handled?


I think that's sane.


Sorry for the delay of nearly two months, but what did you mean by this? 
Add the files to MAINTAINERS?


Thanks,
Simon


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-05-09 Thread Marek Vasut
On 5/9/19 8:08 PM, Simon Goldschmidt wrote:
> This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.
> 
> Signed-off-by: Simon Goldschmidt 
> ---
> 
> Changes in v3:
> - moved socfpga gen5 sysreset driver to extra patch
> 
> Changes in v2: None

[...]

> +static int socfpga_sysreset_request(struct udevice *dev,
> + enum sysreset_t type)
> +{
> + struct socfpga_sysreset_data *data = dev_get_priv(dev);
> +
> + switch (type) {
> + case SYSRESET_WARM:
> + writel(1 << RSTMGR_CTRL_SWWARMRSTREQ_LSB,
> +>rstmgr_base->ctrl);
> + break;
> + case SYSRESET_COLD:
> + writel(1 << RSTMGR_CTRL_SWCOLDRSTREQ_LSB,

BIT(RSTMGR...LSB)

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-05-09 Thread Marek Vasut
On 5/9/19 8:55 PM, Simon Goldschmidt wrote:
> 
> 
> On 09.05.19 20:08, Simon Goldschmidt wrote:
>> This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.
>>
>> Signed-off-by: Simon Goldschmidt 
>> ---
>>
>> Changes in v3:
>> - moved socfpga gen5 sysreset driver to extra patch
>>
>> Changes in v2: None
>>
>>   drivers/sysreset/Kconfig    |  7 
>>   drivers/sysreset/Makefile   |  1 +
>>   drivers/sysreset/sysreset_socfpga.c | 56 +
>>   3 files changed, 64 insertions(+)
>>   create mode 100644 drivers/sysreset/sysreset_socfpga.c
> 
> I just noticed patman complained about new files regarding MAINTAINERS.
> Should these new drivers be listed in the MAINTAINERS file under the
> socfpga section? I noticed other platforms seem to do that but we don't.
> How is this handled?

I think that's sane.

-- 
Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/4] sysreset: socfpga: gen5: add sysreset driver

2019-05-09 Thread Simon Goldschmidt



On 09.05.19 20:08, Simon Goldschmidt wrote:

This adds a UCLASS_SYSRESET sysreset driver for socfgpa gen5.

Signed-off-by: Simon Goldschmidt 
---

Changes in v3:
- moved socfpga gen5 sysreset driver to extra patch

Changes in v2: None

  drivers/sysreset/Kconfig|  7 
  drivers/sysreset/Makefile   |  1 +
  drivers/sysreset/sysreset_socfpga.c | 56 +
  3 files changed, 64 insertions(+)
  create mode 100644 drivers/sysreset/sysreset_socfpga.c


I just noticed patman complained about new files regarding MAINTAINERS.
Should these new drivers be listed in the MAINTAINERS file under the 
socfpga section? I noticed other platforms seem to do that but we don't. 
How is this handled?


Regards,
Simon



diff --git a/drivers/sysreset/Kconfig b/drivers/sysreset/Kconfig
index 8ce3e2e207..066838c106 100644
--- a/drivers/sysreset/Kconfig
+++ b/drivers/sysreset/Kconfig
@@ -36,6 +36,13 @@ config SYSRESET_PSCI
  Enable PSCI SYSTEM_RESET function call.  To use this, PSCI firmware
  must be running on your system.
  
+config SYSRESET_SOCFPGA

+   bool "Enable support for Intel SOCFPGA family"
+   depends on ARCH_SOCFPGA && (TARGET_SOCFPGA_GEN5 || 
TARGET_SOCFPGA_ARRIA10)
+   help
+ This enables the system reset driver support for Intel SOCFPGA SoCs
+ (Cyclone 5, Arria 5 and Arria 10).
+
  config SYSRESET_TI_SCI
bool "TI System Control Interface (TI SCI) system reset driver"
depends on TI_SCI_PROTOCOL
diff --git a/drivers/sysreset/Makefile b/drivers/sysreset/Makefile
index b3728ac17f..0241b0132d 100644
--- a/drivers/sysreset/Makefile
+++ b/drivers/sysreset/Makefile
@@ -11,6 +11,7 @@ obj-$(CONFIG_SYSRESET_GPIO) += sysreset_gpio.o
  obj-$(CONFIG_SYSRESET_MCP83XX) += sysreset_mpc83xx.o
  obj-$(CONFIG_SYSRESET_MICROBLAZE) += sysreset_microblaze.o
  obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
+obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
  obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
  obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
  obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
diff --git a/drivers/sysreset/sysreset_socfpga.c 
b/drivers/sysreset/sysreset_socfpga.c
new file mode 100644
index 00..fc1ba72d5b
--- /dev/null
+++ b/drivers/sysreset/sysreset_socfpga.c
@@ -0,0 +1,56 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Pepperl+Fuchs
+ * Simon Goldschmidt 
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+struct socfpga_sysreset_data {
+   struct socfpga_reset_manager *rstmgr_base;
+};
+
+static int socfpga_sysreset_request(struct udevice *dev,
+   enum sysreset_t type)
+{
+   struct socfpga_sysreset_data *data = dev_get_priv(dev);
+
+   switch (type) {
+   case SYSRESET_WARM:
+   writel(1 << RSTMGR_CTRL_SWWARMRSTREQ_LSB,
+  >rstmgr_base->ctrl);
+   break;
+   case SYSRESET_COLD:
+   writel(1 << RSTMGR_CTRL_SWCOLDRSTREQ_LSB,
+  >rstmgr_base->ctrl);
+   break;
+   default:
+   return -EPROTONOSUPPORT;
+   }
+   return -EINPROGRESS;
+}
+
+static int socfpga_sysreset_probe(struct udevice *dev)
+{
+   struct socfpga_sysreset_data *data = dev_get_priv(dev);
+
+   data->rstmgr_base = devfdt_get_addr_ptr(dev);
+   return 0;
+}
+
+static struct sysreset_ops socfpga_sysreset = {
+   .request = socfpga_sysreset_request,
+};
+
+U_BOOT_DRIVER(sysreset_socfpga) = {
+   .id = UCLASS_SYSRESET,
+   .name   = "socfpga_sysreset",
+   .priv_auto_alloc_size = sizeof(struct socfpga_sysreset_data),
+   .ops= _sysreset,
+   .probe  = socfpga_sysreset_probe,
+};


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot