Re: [PATCH v2 2/9] reset: Add Raspberry Pi 4 firmware reset controller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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@xxxxxxx>
> 
> ---
> 
> 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@xxxxxxx>
> + */
> +#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@xxxxxxxxx>
-- 
Florian



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux