return 0;
}
-static enum pch_version bd82x6x_pch_get_version(struct udevice *dev)
-{
- return PCHV_9;
-}
-
static int bd82x6x_set_spi_protect(struct udevice *dev, bool protect)
{
uint8_t bios_cntl;
static const struct pch_ops bd82x6x_pch_ops = {
.get_sbase = bd82x6x_pch_get_sbase,
- .get_version = bd82x6x_pch_get_version,
.set_spi_protect = bd82x6x_set_spi_protect,
};
return ops->get_sbase(dev, sbasep);
}
-enum pch_version pch_get_version(struct udevice *dev)
-{
- struct pch_ops *ops = pch_get_ops(dev);
-
- if (!ops->get_version)
- return -ENOSYS;
-
- return ops->get_version(dev);
-}
-
int pch_set_spi_protect(struct udevice *dev, bool protect)
{
struct pch_ops *ops = pch_get_ops(dev);
return 0;
}
-static enum pch_version pch7_get_version(struct udevice *dev)
-{
- return PCHV_7;
-}
-
static int pch7_set_spi_protect(struct udevice *dev, bool protect)
{
uint8_t bios_cntl;
static const struct pch_ops pch7_ops = {
.get_sbase = pch7_get_sbase,
- .get_version = pch7_get_version,
.set_spi_protect = pch7_set_spi_protect,
};
return 0;
}
-static enum pch_version pch9_get_version(struct udevice *dev)
-{
- return PCHV_9;
-}
-
static const struct pch_ops pch9_ops = {
.get_sbase = pch9_get_sbase,
- .get_version = pch9_get_version,
};
static const struct udevice_id pch9_ids[] = {
#ifndef __pch_h
#define __pch_h
-enum pch_version {
- PCHV_UNKNOWN,
- PCHV_7,
- PCHV_9,
-};
-
#define PCH_RCBA 0xf0
#define BIOS_CTRL_BIOSWE BIT(0)
*/
int (*get_sbase)(struct udevice *dev, ulong *sbasep);
- /**
- * get_version() - get the PCH version
- *
- * @return version, or -ENOSYS if unknown
- */
- enum pch_version (*get_version)(struct udevice *dev);
-
/**
* set_spi_protect() - set whether SPI flash is protected or not
*
*/
int pch_get_sbase(struct udevice *dev, ulong *sbasep);
-/**
- * pch_get_version() - get the PCH version
- *
- * @return version, or -ENOSYS if unknown
- */
-enum pch_version pch_get_version(struct udevice *dev);
-
/**
* set_spi_protect() - set whether SPI flash is protected or not
*