]>
git.ipfire.org Git - people/ms/u-boot.git/blob - include/reset.h
2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
12 RESET_WARM
, /* Reset CPU, keep GPIOs active */
13 RESET_COLD
, /* Reset CPU and GPIOs */
14 RESET_POWER
, /* Reset PMIC (remove and restore power) */
21 * request() - request a reset of the given type
23 * Note that this function may return before the reset takes effect.
25 * @type: Reset type to request
26 * @return -EINPROGRESS if the reset has been started and
27 * will complete soon, -EPROTONOSUPPORT if not supported
28 * by this device, 0 if the reset has already happened
29 * (in which case this method will not actually return)
31 int (*request
)(struct udevice
*dev
, enum reset_t type
);
34 #define reset_get_ops(dev) ((struct reset_ops *)(dev)->driver->ops)
37 * reset_request() - request a reset
39 * @type: Reset type to request
40 * @return 0 if OK, -EPROTONOSUPPORT if not supported by this device
42 int reset_request(struct udevice
*dev
, enum reset_t type
);
45 * reset_walk() - cause a reset
47 * This works through the available reset devices until it finds one that can
48 * perform a reset. If the provided reset type is not available, the next one
51 * If this function fails to reset, it will display a message and halt
53 * @type: Reset type to request
54 * @return -EINPROGRESS if a reset is in progress, -ENOSYS if not available
56 int reset_walk(enum reset_t type
);
59 * reset_walk_halt() - try to reset, otherwise halt
61 * This calls reset_walk(). If it returns, indicating that reset is not
62 * supported, it prints a message and halts.
64 void reset_walk_halt(enum reset_t type
);
67 * reset_cpu() - calls reset_walk(RESET_WARM)
69 void reset_cpu(ulong addr
);