summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2018-11-23 17:25:27 -0500
committerTom Rini <trini@konsulko.com>2018-11-23 17:25:27 -0500
commit5830791d91d1200854ef78fcb32f808c8080f0f0 (patch)
treec9ec3c59244371d8ad9992a2ba332a7b50d33950 /include
parenta3e1653ddeb02f39481eba572275016171e9670c (diff)
parenta58986ca8b53d8c7a441397082f84edc7f47d19f (diff)
Merge tag 'pull-tg18' of git://git.denx.de/u-boot-dm
Various minor sandbox improvements Better buildman warning handling Misc other things
Diffstat (limited to 'include')
-rw-r--r--include/cros_ec.h89
-rw-r--r--include/fdtdec.h1
-rw-r--r--include/log.h1
-rw-r--r--include/misc.h8
-rw-r--r--include/os.h14
-rw-r--r--include/spi_flash.h27
-rw-r--r--include/video.h5
7 files changed, 139 insertions, 6 deletions
diff --git a/include/cros_ec.h b/include/cros_ec.h
index 4771e6b7d1..f4b9b7a5c2 100644
--- a/include/cros_ec.h
+++ b/include/cros_ec.h
@@ -187,6 +187,14 @@ int cros_ec_flash_protect(struct udevice *dev, uint32_t set_mask,
uint32_t set_flags,
struct ec_response_flash_protect *resp);
+/**
+ * Notify EC of current boot mode
+ *
+ * @param dev CROS-EC device
+ * @param vboot_mode Verified boot mode
+ * @return 0 if ok, <0 on error
+ */
+int cros_ec_entering_mode(struct udevice *dev, int mode);
/**
* Run internal tests on the cros_ec interface.
@@ -397,4 +405,85 @@ struct i2c_msg;
int cros_ec_i2c_tunnel(struct udevice *dev, int port, struct i2c_msg *msg,
int nmsgs);
+/**
+ * cros_ec_get_events_b() - Get event mask B
+ *
+ * @return value of event mask, default value of 0 if it could not be read
+ */
+uint64_t cros_ec_get_events_b(struct udevice *dev);
+
+/**
+ * cros_ec_clear_events_b() - Clear even mask B
+ *
+ * Any pending events in the B range are cleared
+ *
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_clear_events_b(struct udevice *dev, uint64_t mask);
+
+/**
+ * cros_ec_efs_verify() - tell the EC to verify one of its images
+ *
+ * @param dev CROS-EC device
+ * @param region Flash region to query
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_efs_verify(struct udevice *dev, enum ec_flash_region region);
+
+/**
+ * cros_ec_battery_cutoff() - Request that the battery be cut off
+ *
+ * This tells the battery to stop supplying power. This is used before shipping
+ * a device to ensure that the battery remains charged while the device is
+ * shipped or sitting on the shelf waiting to be purchased.
+ *
+ * @param dev CROS-EC device
+ * @param flags Flags to use (EC_BATTERY_CUTOFF_FLAG_...)
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_battery_cutoff(struct udevice *dev, uint8_t flags);
+
+/**
+ * cros_ec_read_limit_power() - Check if power is limited by batter/charger
+ *
+ * Sometimes the battery is low and / or the device is connected to a charger
+ * that cannot supply much power.
+ *
+ * @param dev CROS-EC device
+ * @param limit_powerp Returns whether power is limited (0 or 1)
+ * @return 0 if OK, -ENOSYS if the EC does not support this comment, -EINVAL
+ * if the EC returned an invalid response
+ */
+int cros_ec_read_limit_power(struct udevice *dev, int *limit_powerp);
+
+/**
+ * cros_ec_config_powerbtn() - Configure the behaviour of the power button
+ *
+ * @param dev CROS-EC device
+ * @param flags Flags to use (EC_POWER_BUTTON_...)
+ * @return 0 if OK, -ve on error
+ */
+int cros_ec_config_powerbtn(struct udevice *dev, uint32_t flags);
+
+/**
+ * cros_ec_get_lid_shutdown_mask() - Set the lid shutdown mask
+ *
+ * Determines whether a lid close event is reported
+ *
+ * @param dev CROS-EC device
+ * @return shufdown mas if OK, -ve on error
+ */
+int cros_ec_get_lid_shutdown_mask(struct udevice *dev);
+
+/**
+ * cros_ec_set_lid_shutdown_mask() - Set the lid shutdown mask
+ *
+ * Set whether a lid close event is reported
+ *
+ * @param dev CROS-EC device
+ * @param enable true to enable reporting, false to disable
+ * @return shufdown mas if OK, -ve on error
+ */
+int cros_ec_set_lid_shutdown_mask(struct udevice *dev, int enable);
+
#endif
diff --git a/include/fdtdec.h b/include/fdtdec.h
index c26df50543..b15da00fb2 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -956,6 +956,7 @@ int fdtdec_setup(void);
* Called when CONFIG_OF_BOARD is defined, or if CONFIG_OF_SEPARATE is defined
* and the board implements it.
*/
+void *board_fdt_blob_setup(void);
/*
* Decode the size of memory
diff --git a/include/log.h b/include/log.h
index a872fc6ef5..deab82966b 100644
--- a/include/log.h
+++ b/include/log.h
@@ -47,6 +47,7 @@ enum log_category_t {
LOGC_DT, /* Device-tree */
LOGC_EFI, /* EFI implementation */
LOGC_ALLOC, /* Memory allocation */
+ LOGC_SANDBOX, /* Related to the sandbox board */
LOGC_COUNT, /* Number of log categories */
LOGC_END, /* Sentinel value for a list of log categories */
diff --git a/include/misc.h b/include/misc.h
index 50515852b2..12d1325ee2 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -13,7 +13,7 @@
* @buf: pointer to data buffer
* @size: data size in bytes to read the device
*
- * Return: 0 if OK, -ve on error
+ * Return: number of bytes read if OK (may be 0 if EOF), -ve on error
*/
int misc_read(struct udevice *dev, int offset, void *buf, int size);
@@ -24,7 +24,7 @@ int misc_read(struct udevice *dev, int offset, void *buf, int size);
* @buf: pointer to data buffer
* @size: data size in bytes to write the device
*
- * Return: 0 if OK, -ve on error
+ * Return: number of bytes written if OK (may be < @size), -ve on error
*/
int misc_write(struct udevice *dev, int offset, void *buf, int size);
@@ -90,7 +90,7 @@ struct misc_ops {
* @buf: pointer to data buffer
* @size: data size in bytes to read the device
*
- * Return: 0 if OK, -ve on error
+ * Return: number of bytes read if OK (may be 0 if EOF), -ve on error
*/
int (*read)(struct udevice *dev, int offset, void *buf, int size);
@@ -101,7 +101,7 @@ struct misc_ops {
* @buf: pointer to data buffer
* @size: data size in bytes to write the device
*
- * Return: 0 if OK, -ve on error
+ * Return: number of bytes written if OK (may be < @size), -ve on error
*/
int (*write)(struct udevice *dev, int offset, const void *buf,
int size);
diff --git a/include/os.h b/include/os.h
index 28eb625284..6f33b08cf0 100644
--- a/include/os.h
+++ b/include/os.h
@@ -350,4 +350,18 @@ int os_mprotect_allow(void *start, size_t len);
*/
int os_write_file(const char *name, const void *buf, int size);
+/**
+ * os_read_file() - Read a file from the host filesystem
+ *
+ * This can be useful when reading test data into sandbox for use by test
+ * routines. The data is allocated using os_malloc() and should be freed by
+ * the caller.
+ *
+ * @name: File path to read from
+ * @bufp: Returns buffer containing data read
+ * @sizep: Returns size of data
+ * @return 0 if OK, -ve on error
+ */
+int os_read_file(const char *name, void **bufp, int *sizep);
+
#endif
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 0ec98fb55d..e427e960d5 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -112,6 +112,19 @@ struct dm_spi_flash_ops {
int (*write)(struct udevice *dev, u32 offset, size_t len,
const void *buf);
int (*erase)(struct udevice *dev, u32 offset, size_t len);
+ /**
+ * get_sw_write_prot() - Check state of software write-protect feature
+ *
+ * SPI flash chips can lock a region of the flash defined by a
+ * 'protected area'. This function checks if this protected area is
+ * defined.
+ *
+ * @dev: SPI flash device
+ * @return 0 if no region is write-protected, 1 if a region is
+ * write-protected, -ENOSYS if the driver does not implement this,
+ * other -ve value on error
+ */
+ int (*get_sw_write_prot)(struct udevice *dev);
};
/* Access the serial operations for a device */
@@ -153,6 +166,20 @@ int spi_flash_write_dm(struct udevice *dev, u32 offset, size_t len,
*/
int spi_flash_erase_dm(struct udevice *dev, u32 offset, size_t len);
+/**
+ * spl_flash_get_sw_write_prot() - Check state of software write-protect feature
+ *
+ * SPI flash chips can lock a region of the flash defined by a
+ * 'protected area'. This function checks if this protected area is
+ * defined.
+ *
+ * @dev: SPI flash device
+ * @return 0 if no region is write-protected, 1 if a region is
+ * write-protected, -ENOSYS if the driver does not implement this,
+ * other -ve value on error
+ */
+int spl_flash_get_sw_write_prot(struct udevice *dev);
+
int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs,
unsigned int max_hz, unsigned int spi_mode,
struct udevice **devp);
diff --git a/include/video.h b/include/video.h
index 75200f0e45..3f9139eea4 100644
--- a/include/video.h
+++ b/include/video.h
@@ -191,9 +191,10 @@ void video_set_flush_dcache(struct udevice *dev, bool flush);
/**
* Set default colors and attributes
*
- * @priv device information
+ * @dev: video device
+ * @invert true to invert colours
*/
-void video_set_default_colors(struct video_priv *priv);
+void video_set_default_colors(struct udevice *dev, bool invert);
#endif /* CONFIG_DM_VIDEO */