TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
|
Tenstorrent firmware update API. More...
#include <stdbool.h>
#include <zephyr/device.h>
#include <zephyr/drivers/gpio.h>
#include <tenstorrent/tt_boot_fs.h>
Go to the source code of this file.
Functions | |
int | tt_fwupdate_init (const struct device *dev, struct gpio_dt_spec mux) |
Set the external flash device and set the passed spi mux (if not null) to allow communication with the spi. | |
int | tt_fwupdate_complete (void) |
Called on the completion of the fwupdate operation, disables the spi mux if initialized in tt_fwupdate_init | |
int | tt_fwupdate (const char *tag, bool dry_run, bool reboot) |
Search for, verify, and apply firmware updates. | |
int | tt_fwupdate_confirm (void) |
Confirm that the current firmware has booted successfully. | |
int | tt_fwupdate_flash_image (const tt_boot_fs_fd *fd) |
Flash the image described by the provided boot filesystem file descriptor. | |
int | tt_fwupdate_is_confirmed (void) |
Check if the currently running firmware has been confirmed. | |
int | tt_fwupdate_validate_fd (const tt_boot_fs_fd *fd) |
Validate the provided boot filesystem file descriptor. | |
int | tt_fwupdate_validate_image (const tt_boot_fs_fd *fd) |
Validate the image described by the provided boot filesystem file descriptor. |
Tenstorrent firmware update API.
Search for, verify, and apply firmware updates.
reboot
is true, then this function does not return.tag | The tag (name) of the update image in the flash filesystem. |
dry_run | Only verify data and operations. Do not write to flash or reboot. |
reboot | If true, reboot after the update has been successfully written. |
0 | on success, if no firmware update is needed. |
1 | on success, if a firmware update was applied and a reboot is required. |
-EINVAL | if an argument is invalid. |
-EIO | if an I/O error occurs. |
-ENOENT | if the image is invalid an image named tag cannot be found. |
-ENODEV | if the current slot cannot be determined or a device is not ready. |
int tt_fwupdate_complete | ( | void | ) |
Called on the completion of the fwupdate operation, disables the spi mux if initialized in tt_fwupdate_init
0 | on success, if the spi mux was able to be set |
int tt_fwupdate_confirm | ( | void | ) |
Confirm that the current firmware has booted successfully.
0 | on success. |
-EIO | if an I/O erorr occurs. |
int tt_fwupdate_flash_image | ( | const tt_boot_fs_fd * | fd | ) |
Flash the image described by the provided boot filesystem file descriptor.
fd | A pointer to the file descriptor for the desired image. |
-EINVAL | if fd is NULL. |
-ENOENT | if the image is invalid. |
-EIO | if an I/O error occurs. |
-EFBIG | if the image is too large to fit in the slot. |
int tt_fwupdate_init | ( | const struct device * | dev, |
struct gpio_dt_spec | mux ) |
Set the external flash device and set the passed spi mux (if not null) to allow communication with the spi.
dev | The pointer to the external flash device to use. |
mux | The spi mux to set and disable on start and completion of the fw update operations. |
0 | on success, if the spi mux was able to be set |
int tt_fwupdate_is_confirmed | ( | void | ) |
Check if the currently running firmware has been confirmed.
0 | if the currently running firmware has not been confirmed. |
1 | if the currently running firmware has been confirmed. |
-EIO | if an I/O erorr occurs. |
int tt_fwupdate_validate_fd | ( | const tt_boot_fs_fd * | fd | ) |
Validate the provided boot filesystem file descriptor.
fd | A pointer to the file descriptor to validate. |
0 | if fd is valid. |
-EINVAL | if fd is NULL. |
-ENOENT | if fd is invalid. |
-EIO | if an I/O error occurs. |
int tt_fwupdate_validate_image | ( | const tt_boot_fs_fd * | fd | ) |
Validate the image described by the provided boot filesystem file descriptor.
fd | A pointer to the file descriptor for the desired image. |
-EINVAL | if fd is NULL. |
-ENOENT | if the image is invalid. |
-EIO | if an I/O error occurs. |