There are too many structures storing the same sort of information. Move the
fields from struct tpm into struct tpm_chip and remove the former struct.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
-/* TPM configuration */
-struct tpm {
- struct udevice *dev;
- char inited;
-} tpm;
-
static struct tpm_chip g_chip;
/*
static struct tpm_chip g_chip;
/*
* @param dev Returns a configuration of TPM device
* @return 0 if ok, -1 on error
*/
* @param dev Returns a configuration of TPM device
* @return 0 if ok, -1 on error
*/
-static int tpm_decode_config(struct tpm *dev)
+static int tpm_decode_config(struct tpm_chip *chip)
{
const void *blob = gd->fdt_blob;
struct udevice *bus;
{
const void *blob = gd->fdt_blob;
struct udevice *bus;
* TODO(sjg@chromium.org): Older TPMs will need to use the older method
* in iic_tpm_read() so the offset length needs to be 0 here.
*/
* TODO(sjg@chromium.org): Older TPMs will need to use the older method
* in iic_tpm_read() so the offset length needs to be 0 here.
*/
- ret = i2c_get_chip(bus, chip_addr, 1, &dev->dev);
+ ret = i2c_get_chip(bus, chip_addr, 1, &chip->dev);
if (ret) {
debug("Cannot find device for node '%s: ret=%d'\n",
fdt_get_name(blob, node, NULL), ret);
if (ret) {
debug("Cannot find device for node '%s: ret=%d'\n",
fdt_get_name(blob, node, NULL), ret);
- if (tpm_decode_config(&tpm))
+ if (tpm_decode_config(&g_chip))
return -1;
debug("%s: done\n", __func__);
return -1;
debug("%s: done\n", __func__);
- rc = tpm_open_dev(tpm.dev);
+ rc = tpm_open_dev(g_chip.dev);
return rc;
}
int tis_close(void)
{
return rc;
}
int tis_close(void)
{
int len;
uint8_t buf[4096];
int len;
uint8_t buf[4096];
return -1;
if (sizeof(buf) < sbuf_size)
return -1;
if (sizeof(buf) < sbuf_size)
int is_open;
u8 req_complete_mask;
u8 req_complete_val;
int is_open;
u8 req_complete_mask;
u8 req_complete_val;