[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6ab60539-5aa2-17dc-21d5-1bae9ec259f6@broadcom.com>
Date: Tue, 9 Jun 2020 11:14:13 -0700
From: Florian Fainelli <florian.fainelli@...adcom.com>
To: Nicolas Saenz Julienne <nsaenzjulienne@...e.de>,
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 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>
--
Florian
Powered by blists - more mailing lists