1 // SPDX-License-Identifier: GPL-2.0
3 * Raspberry Pi 4 firmware reset driver
5 * Copyright (C) 2020 Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
9 #include <reset-uclass.h>
10 #include <asm/arch/msg.h>
11 #include <dt-bindings/reset/raspberrypi,firmware-reset.h>
13 static int raspberrypi_reset_request(struct reset_ctl *reset_ctl)
15 if (reset_ctl->id >= RASPBERRYPI_FIRMWARE_RESET_NUM_IDS)
21 static int raspberrypi_reset_assert(struct reset_ctl *reset_ctl)
23 switch (reset_ctl->id) {
24 case RASPBERRYPI_FIRMWARE_RESET_ID_USB:
25 bcm2711_notify_vl805_reset();
32 struct reset_ops raspberrypi_reset_ops = {
33 .request = raspberrypi_reset_request,
34 .rst_assert = raspberrypi_reset_assert,
37 static const struct udevice_id raspberrypi_reset_ids[] = {
38 { .compatible = "raspberrypi,firmware-reset" },
42 U_BOOT_DRIVER(raspberrypi_reset) = {
43 .name = "raspberrypi-reset",
45 .of_match = raspberrypi_reset_ids,
46 .ops = &raspberrypi_reset_ops,