mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 05:50:17 +00:00 
			
		
		
		
	As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
// SPDX-License-Identifier: GPL-2.0
 | 
						|
/*
 | 
						|
 * Raspberry Pi 4 firmware reset driver
 | 
						|
 *
 | 
						|
 * Copyright (C) 2020 Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
 | 
						|
 */
 | 
						|
#include <dm.h>
 | 
						|
#include <reset-uclass.h>
 | 
						|
#include <asm/arch/msg.h>
 | 
						|
#include <dt-bindings/reset/raspberrypi,firmware-reset.h>
 | 
						|
 | 
						|
static int raspberrypi_reset_request(struct reset_ctl *reset_ctl)
 | 
						|
{
 | 
						|
	if (reset_ctl->id >= RASPBERRYPI_FIRMWARE_RESET_NUM_IDS)
 | 
						|
		return -EINVAL;
 | 
						|
 | 
						|
	return 0;
 | 
						|
}
 | 
						|
 | 
						|
static int raspberrypi_reset_assert(struct reset_ctl *reset_ctl)
 | 
						|
{
 | 
						|
	switch (reset_ctl->id) {
 | 
						|
	case RASPBERRYPI_FIRMWARE_RESET_ID_USB:
 | 
						|
		bcm2711_notify_vl805_reset();
 | 
						|
		return 0;
 | 
						|
	default:
 | 
						|
		return -EINVAL;
 | 
						|
	}
 | 
						|
}
 | 
						|
 | 
						|
struct reset_ops raspberrypi_reset_ops = {
 | 
						|
	.request = raspberrypi_reset_request,
 | 
						|
	.rst_assert = raspberrypi_reset_assert,
 | 
						|
};
 | 
						|
 | 
						|
static const struct udevice_id raspberrypi_reset_ids[] = {
 | 
						|
	{ .compatible = "raspberrypi,firmware-reset" },
 | 
						|
	{ }
 | 
						|
};
 | 
						|
 | 
						|
U_BOOT_DRIVER(raspberrypi_reset) = {
 | 
						|
	.name = "raspberrypi-reset",
 | 
						|
	.id = UCLASS_RESET,
 | 
						|
	.of_match = raspberrypi_reset_ids,
 | 
						|
	.ops = &raspberrypi_reset_ops,
 | 
						|
};
 |