2 * Copyright (c) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
5 * SPDX-License-Identifier: GPL-2.0+
19 #define BIOS_CTRL_BIOSWE BIT(0)
21 /* Operations for the Platform Controller Hub */
24 * get_sbase() - get the address of SPI base
26 * @dev: PCH device to check
27 * @sbasep: Returns address of SPI base if available, else 0
28 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
30 int (*get_sbase)(struct udevice *dev, ulong *sbasep);
33 * get_version() - get the PCH version
35 * @return version, or -ENOSYS if unknown
37 enum pch_version (*get_version)(struct udevice *dev);
40 * set_spi_protect() - set whether SPI flash is protected or not
42 * @dev: PCH device to adjust
43 * @protect: true to protect, false to unprotect
45 * @return 0 on success, -ENOSYS if not implemented
47 int (*set_spi_protect)(struct udevice *dev, bool protect);
50 #define pch_get_ops(dev) ((struct pch_ops *)(dev)->driver->ops)
53 * pch_get_sbase() - get the address of SPI base
55 * @dev: PCH device to check
56 * @sbasep: Returns address of SPI base if available, else 0
57 * @return 0 if OK, -ve on error (e.g. there is no SPI base)
59 int pch_get_sbase(struct udevice *dev, ulong *sbasep);
62 * pch_get_version() - get the PCH version
64 * @return version, or -ENOSYS if unknown
66 enum pch_version pch_get_version(struct udevice *dev);
69 * set_spi_protect() - set whether SPI flash is protected or not
71 * @dev: PCH device to adjust
72 * @protect: true to protect, false to unprotect
74 * @return 0 on success, -ENOSYS if not implemented
76 int pch_set_spi_protect(struct udevice *dev, bool protect);