From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
To: Florian Fainelli <florian.fainelli@broadcom.com>,
f.fainelli@gmail.com, gregkh@linuxfoundation.org,
wahrenst@gmx.net, p.zabel@pengutronix.de,
linux-kernel@vger.kernel.org
Cc: linux-usb@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
bcm-kernel-feedback-list@broadcom.com, tim.gover@raspberrypi.org,
linux-pci@vger.kernel.org, helgaas@kernel.org,
andy.shevchenko@gmail.com, mathias.nyman@linux.intel.com,
lorenzo.pieralisi@arm.com
Subject: Re: [PATCH v2 2/9] reset: Add Raspberry Pi 4 firmware reset controller
Date: Wed, 10 Jun 2020 17:37:58 +0200 [thread overview]
Message-ID: <82a21cbdca6bced2ee8e4e5a857faaa31a672193.camel@suse.de> (raw)
In-Reply-To: <6ab60539-5aa2-17dc-21d5-1bae9ec259f6@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 3806 bytes --]
On Tue, 2020-06-09 at 11:14 -0700, Florian Fainelli wrote:
>
> On 6/9/2020 10:49 AM, Nicolas Saenz Julienne wrote:
> > Raspberry Pi 4's co-processor controls some of the board's HW
> > initialization process, but it's up to Linux to trigger it when
> > relevant. Introduce a reset controller capable of interfacing with
> > RPi4's co-processor that models these firmware initialization routines as
> > reset lines.
> >
> > Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> >
> > ---
> >
> > Changes since v1:
> > - Make the whole driver less USB centric as per Florian's comments
> >
> > drivers/reset/Kconfig | 11 +++
> > drivers/reset/Makefile | 1 +
> > drivers/reset/reset-raspberrypi.c | 126 ++++++++++++++++++++++++++++++
> > 3 files changed, 138 insertions(+)
> > create mode 100644 drivers/reset/reset-raspberrypi.c
> >
> > diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig
> > index d9efbfd29646..97e848740e13 100644
> > --- a/drivers/reset/Kconfig
> > +++ b/drivers/reset/Kconfig
> > @@ -140,6 +140,17 @@ config RESET_QCOM_PDC
> > to control reset signals provided by PDC for Modem, Compute,
> > Display, GPU, Debug, AOP, Sensors, Audio, SP and APPS.
> >
> > +config RESET_RASPBERRYPI
> > + tristate "Raspberry Pi 4 Firmware Reset Driver"
> > + depends on RASPBERRYPI_FIRMWARE || (RASPBERRYPI_FIRMWARE=n &&
> > COMPILE_TEST)
> > + default USB_XHCI_PCI
> > + help
> > + Raspberry Pi 4's co-processor controls some of the board's HW
> > + initialization process, but it's up to Linux to trigger it when
> > + relevant. This driver provides a reset controller capable of
> > + interfacing with RPi4's co-processor and model these firmware
> > + initialization routines as reset lines.
> > +
> > config RESET_SCMI
> > tristate "Reset driver controlled via ARM SCMI interface"
> > depends on ARM_SCMI_PROTOCOL || COMPILE_TEST
> > diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile
> > index 249ed357c997..16947610cc3b 100644
> > --- a/drivers/reset/Makefile
> > +++ b/drivers/reset/Makefile
> > @@ -21,6 +21,7 @@ obj-$(CONFIG_RESET_OXNAS) += reset-oxnas.o
> > obj-$(CONFIG_RESET_PISTACHIO) += reset-pistachio.o
> > obj-$(CONFIG_RESET_QCOM_AOSS) += reset-qcom-aoss.o
> > obj-$(CONFIG_RESET_QCOM_PDC) += reset-qcom-pdc.o
> > +obj-$(CONFIG_RESET_RASPBERRYPI) += reset-raspberrypi.o
> > obj-$(CONFIG_RESET_SCMI) += reset-scmi.o
> > obj-$(CONFIG_RESET_SIMPLE) += reset-simple.o
> > obj-$(CONFIG_RESET_STM32MP157) += reset-stm32mp1.o
> > diff --git a/drivers/reset/reset-raspberrypi.c b/drivers/reset/reset-
> > raspberrypi.c
> > new file mode 100644
> > index 000000000000..5fc8c6319a20
> > --- /dev/null
> > +++ b/drivers/reset/reset-raspberrypi.c
> > @@ -0,0 +1,126 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Raspberry Pi 4 firmware reset driver
> > + *
> > + * Copyright (C) 2020 Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> > + */
> > +#include <linux/delay.h>
> > +#include <linux/device.h>
> > +#include <linux/module.h>
> > +#include <linux/of.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/reset-controller.h>
> > +#include <soc/bcm2835/raspberrypi-firmware.h>
> > +
> > +struct rpi_reset {
> > + struct reset_controller_dev rcdev;
> > + struct rpi_firmware *fw;
> > +};
> > +
> > +enum rpi_reset_ids {
> > + RASPBERRYPI_FIRMWARE_RESET_ID_USB,
>
> You should probably move this to a header file under
> include/dt-bindings/reset/ in order to ensure that what gets referenced
> by the DTS is in sync with what the driver knows about.
>
> With that:
>
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Thanks! Will fix that on v3.
Regards,
Nicolas
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-06-10 15:38 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 17:49 [PATCH v2 0/9] Raspberry Pi 4 USB firmware initialization rework Nicolas Saenz Julienne
2020-06-09 17:49 ` [PATCH v2 1/9] dt-bindings: reset: Add a binding for the RPi Firmware reset controller Nicolas Saenz Julienne
2020-06-09 18:07 ` Florian Fainelli
2020-06-10 15:37 ` Nicolas Saenz Julienne
2020-06-09 17:49 ` [PATCH v2 2/9] reset: Add Raspberry Pi 4 firmware " Nicolas Saenz Julienne
2020-06-09 18:14 ` Florian Fainelli
2020-06-10 15:37 ` Nicolas Saenz Julienne [this message]
2020-06-09 17:49 ` [PATCH v2 3/9] ARM: dts: bcm2711: Add firmware usb reset node Nicolas Saenz Julienne
2020-06-09 18:16 ` Florian Fainelli
2020-06-09 17:49 ` [PATCH v2 4/9] ARM: dts: bcm2711: Add reset controller to xHCI node Nicolas Saenz Julienne
2020-06-09 18:16 ` Florian Fainelli
2020-06-09 17:49 ` [PATCH v2 5/9] usb: xhci-pci: Add support for reset controllers Nicolas Saenz Julienne
2020-06-09 18:13 ` Florian Fainelli
2020-06-10 15:49 ` Nicolas Saenz Julienne
2020-06-09 17:49 ` [PATCH v2 6/9] Revert "USB: pci-quirks: Add Raspberry Pi 4 quirk" Nicolas Saenz Julienne
2020-06-09 18:14 ` Florian Fainelli
2020-06-09 17:50 ` [PATCH v2 7/9] usb: host: pci-quirks: Bypass xHCI quirks for Raspberry Pi 4 Nicolas Saenz Julienne
2020-06-09 18:43 ` Andy Shevchenko
2020-06-10 15:57 ` Nicolas Saenz Julienne
2020-06-09 17:50 ` [PATCH v2 8/9] Revert "firmware: raspberrypi: Introduce vl805 init routine" Nicolas Saenz Julienne
2020-06-09 18:15 ` Florian Fainelli
2020-06-09 17:50 ` [PATCH v2 9/9] Revert "PCI: brcmstb: Wait for Raspberry Pi's firmware when present" Nicolas Saenz Julienne
2020-06-09 18:15 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82a21cbdca6bced2ee8e4e5a857faaa31a672193.camel@suse.de \
--to=nsaenzjulienne@suse.de \
--cc=andy.shevchenko@gmail.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=helgaas@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=mathias.nyman@linux.intel.com \
--cc=p.zabel@pengutronix.de \
--cc=tim.gover@raspberrypi.org \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome