Simon Goldschmidt | ebfb9fb | 2019-07-15 21:47:54 +0200 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | /* |
| 3 | * Copyright (C) 2019 Pepperl+Fuchs |
| 4 | * Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> |
| 5 | */ |
| 6 | |
Simon Goldschmidt | ebfb9fb | 2019-07-15 21:47:54 +0200 | [diff] [blame] | 7 | #include <dm.h> |
| 8 | #include <errno.h> |
| 9 | #include <sysreset.h> |
| 10 | #include <asm/arch/mailbox_s10.h> |
| 11 | |
| 12 | static int socfpga_sysreset_request(struct udevice *dev, |
| 13 | enum sysreset_t type) |
| 14 | { |
| 15 | puts("Mailbox: Issuing mailbox cmd REBOOT_HPS\n"); |
| 16 | mbox_reset_cold(); |
| 17 | return -EINPROGRESS; |
| 18 | } |
| 19 | |
| 20 | static struct sysreset_ops socfpga_sysreset = { |
| 21 | .request = socfpga_sysreset_request, |
| 22 | }; |
| 23 | |
| 24 | U_BOOT_DRIVER(sysreset_socfpga) = { |
| 25 | .id = UCLASS_SYSRESET, |
| 26 | .name = "socfpga_sysreset", |
| 27 | .ops = &socfpga_sysreset, |
| 28 | }; |