![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <string.h>
#include <assert.h>
#include <device/i2c.h>
#include <device/i2c_simple.h>
#include <endian.h>
#include <soc/timer.h>
#include <libbdk-arch/bdk-numa.h>
#include <libbdk-hal/bdk-config.h>
#include <libbdk-hal/bdk-twsi.h>
#include <libbdk-boot/bdk-watchdog.h>
Go to the source code of this file.
Functions | |
int64_t | bdk_twsix_read_ia (bdk_node_t node, int twsi_id, uint8_t dev_addr, uint16_t internal_addr, int num_bytes, int ia_width_bytes) |
Do a twsi read from a 7 bit device address using an (optional) internal address. More... | |
int | bdk_twsix_write_ia (bdk_node_t node, int twsi_id, uint8_t dev_addr, uint16_t internal_addr, int num_bytes, int ia_width_bytes, uint64_t data) |
Write 1-8 bytes to a TWSI device using an internal address. More... | |
void | bdk_watchdog_set (unsigned int timeout_ms) |
void | bdk_watchdog_poke (void) |
void | bdk_watchdog_disable (void) |
int | bdk_watchdog_is_running (void) |
int64_t bdk_twsix_read_ia | ( | bdk_node_t | node, |
int | twsi_id, | ||
uint8_t | dev_addr, | ||
uint16_t | internal_addr, | ||
int | num_bytes, | ||
int | ia_width_bytes | ||
) |
Do a twsi read from a 7 bit device address using an (optional) internal address.
Up to 4 bytes can be read at a time.
twsi_id | which TWSI bus to use |
dev_addr | Device address (7 bit) |
internal_addr | Internal address. Can be 0, 1 or 2 bytes in width |
num_bytes | Number of data bytes to read (1-4) |
ia_width_bytes | Internal address size in bytes (0, 1, or 2) |
Definition at line 35 of file bdk-coreboot.c.
References ARRAY_SIZE, assert, i2c_msg::buf, buf, i2c_msg::flags, I2C_M_RD, i2c_transfer(), i2c_msg::len, and i2c_msg::slave.
int bdk_twsix_write_ia | ( | bdk_node_t | node, |
int | twsi_id, | ||
uint8_t | dev_addr, | ||
uint16_t | internal_addr, | ||
int | num_bytes, | ||
int | ia_width_bytes, | ||
uint64_t | data | ||
) |
Write 1-8 bytes to a TWSI device using an internal address.
twsi_id | which TWSI interface to use |
dev_addr | TWSI device address (7 bit only) |
internal_addr | TWSI internal address (0, 8, or 16 bits) |
num_bytes | Number of bytes to write (1-8) |
ia_width_bytes | internal address width, in bytes (0, 1, 2) |
data | Data to write. Data is written MSB first on the twsi bus, and only the lower num_bytes bytes of the argument are valid. If a 2 byte write is done, only the low 2 bytes of the argument is used. |
Definition at line 77 of file bdk-coreboot.c.
References assert, i2c_msg::buf, buf, i2c_msg::flags, i2c_msg::len, memcpy(), platform_i2c_transfer(), and i2c_msg::slave.
Referenced by mainboard_enable().
Definition at line 108 of file bdk-coreboot.c.
References watchdog_disable().
int bdk_watchdog_is_running | ( | void | ) |
Definition at line 113 of file bdk-coreboot.c.
References watchdog_is_running().
Definition at line 103 of file bdk-coreboot.c.
References watchdog_poke().
Definition at line 98 of file bdk-coreboot.c.
References watchdog_set().