1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2015 Google, Inc
4 * Written by Simon Glass <sjg@chromium.org>
12 #define BIOS_CTRL_BIOSWE BIT(0)
14 /* Operations for the Platform Controller Hub */
17 * get_spi_base() - get the address of SPI base
19 * @dev: PCH device to check
20 * @sbasep: Returns address of SPI base if available, else 0
21 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
23 int (*get_spi_base)(struct udevice *dev, ulong *sbasep);
26 * set_spi_protect() - set whether SPI flash is protected or not
28 * @dev: PCH device to adjust
29 * @protect: true to protect, false to unprotect
31 * @return 0 on success, -ENOSYS if not implemented
33 int (*set_spi_protect)(struct udevice *dev, bool protect);
36 * get_gpio_base() - get the address of GPIO base
38 * @dev: PCH device to check
39 * @gbasep: Returns address of GPIO base if available, else 0
40 * @return 0 if OK, -ve on error (e.g. there is no GPIO base)
42 int (*get_gpio_base)(struct udevice *dev, u32 *gbasep);
45 * get_io_base() - get the address of IO base
47 * @dev: PCH device to check
48 * @iobasep: Returns address of IO base if available, else 0
49 * @return 0 if OK, -ve on error (e.g. there is no IO base)
51 int (*get_io_base)(struct udevice *dev, u32 *iobasep);
54 #define pch_get_ops(dev) ((struct pch_ops *)(dev)->driver->ops)
57 * pch_get_spi_base() - get the address of SPI base
59 * @dev: PCH device to check
60 * @sbasep: Returns address of SPI base if available, else 0
61 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
63 int pch_get_spi_base(struct udevice *dev, ulong *sbasep);
66 * set_spi_protect() - set whether SPI flash is protected or not
68 * @dev: PCH device to adjust
69 * @protect: true to protect, false to unprotect
71 * @return 0 on success, -ENOSYS if not implemented
73 int pch_set_spi_protect(struct udevice *dev, bool protect);
76 * pch_get_gpio_base() - get the address of GPIO base
78 * @dev: PCH device to check
79 * @gbasep: Returns address of GPIO base if available, else 0
80 * @return 0 if OK, -ve on error (e.g. there is no GPIO base)
82 int pch_get_gpio_base(struct udevice *dev, u32 *gbasep);
85 * pch_get_io_base() - get the address of IO base
87 * @dev: PCH device to check
88 * @iobasep: Returns address of IO base if available, else 0
89 * @return 0 if OK, -ve on error (e.g. there is no IO base)
91 int pch_get_io_base(struct udevice *dev, u32 *iobasep);