2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
13 #define BIOS_CTRL_BIOSWE BIT(0)
15 /* Operations for the Platform Controller Hub */
18 * get_spi_base() - get the address of SPI base
20 * @dev: PCH device to check
21 * @sbasep: Returns address of SPI base if available, else 0
22 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
24 int (*get_spi_base)(struct udevice *dev, ulong *sbasep);
27 * set_spi_protect() - set whether SPI flash is protected or not
29 * @dev: PCH device to adjust
30 * @protect: true to protect, false to unprotect
32 * @return 0 on success, -ENOSYS if not implemented
34 int (*set_spi_protect)(struct udevice *dev, bool protect);
37 * get_gpio_base() - get the address of GPIO base
39 * @dev: PCH device to check
40 * @gbasep: Returns address of GPIO base if available, else 0
41 * @return 0 if OK, -ve on error (e.g. there is no GPIO base)
43 int (*get_gpio_base)(struct udevice *dev, u32 *gbasep);
46 #define pch_get_ops(dev) ((struct pch_ops *)(dev)->driver->ops)
49 * pch_get_spi_base() - get the address of SPI base
51 * @dev: PCH device to check
52 * @sbasep: Returns address of SPI base if available, else 0
53 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
55 int pch_get_spi_base(struct udevice *dev, ulong *sbasep);
58 * set_spi_protect() - set whether SPI flash is protected or not
60 * @dev: PCH device to adjust
61 * @protect: true to protect, false to unprotect
63 * @return 0 on success, -ENOSYS if not implemented
65 int pch_set_spi_protect(struct udevice *dev, bool protect);
68 * pch_get_gpio_base() - get the address of GPIO base
70 * @dev: PCH device to check
71 * @gbasep: Returns address of GPIO base if available, else 0
72 * @return 0 if OK, -ve on error (e.g. there is no GPIO base)
74 int pch_get_gpio_base(struct udevice *dev, u32 *gbasep);