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: <82a21cbdca6bced2ee8e4e5a857faaa31a672193.camel@suse.de>
Date:   Wed, 10 Jun 2020 17:37:58 +0200
From:   Nicolas Saenz Julienne <nsaenzjulienne@...e.de>
To:     Florian Fainelli <florian.fainelli@...adcom.com>,
        f.fainelli@...il.com, gregkh@...uxfoundation.org, wahrenst@....net,
        p.zabel@...gutronix.de, linux-kernel@...r.kernel.org
Cc:     linux-usb@...r.kernel.org, linux-rpi-kernel@...ts.infradead.org,
        linux-arm-kernel@...ts.infradead.org,
        bcm-kernel-feedback-list@...adcom.com, tim.gover@...pberrypi.org,
        linux-pci@...r.kernel.org, helgaas@...nel.org,
        andy.shevchenko@...il.com, mathias.nyman@...ux.intel.com,
        lorenzo.pieralisi@....com
Subject: Re: [PATCH v2 2/9] reset: Add Raspberry Pi 4 firmware reset
 controller

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@...e.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@...e.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@...il.com>

Thanks! Will fix that on v3.

Regards,
Nicolas


Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ