1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

lspcon_i2c_spi.c: Add SPI-master support for PS17{5,6}

This adds support for the Parade lspcon usb-c to HDMI protocol
translater part that is i2c-controlled. The support allows the
host to reach the SPI ROM that hangs off the part where it
stores its firmware.

Usage is as follows:
	flashrom -p lspcon_i2c_spi:bus=X
	where X is the bus number.

BUG=b:148746232
BRANCH=none
TEST=tested with following commands, read/write/erase works good.
	flashrom -p lspcon_i2c_spi:bus=7 -r /tmp/foo;
	flashrom -p lspcon_i2c_spi:bus=7 -E;
	flashrom -p lspcon_i2c_spi:bus=7 -w /tmp/foo;

Change-Id: I039e683252cfaf1ffef8694a3e8081b1b6b944f7
Signed-off-by: Shiyu Sun <sshiyu@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/39687
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Shiyu Sun
2020-03-19 14:37:57 +11:00
committed by Edward O'Callaghan
parent dc2c83bbc7
commit 13a2ef6cbd
6 changed files with 556 additions and 0 deletions

View File

@ -129,6 +129,9 @@ enum programmer {
#endif
#if CONFIG_STLINKV3_SPI == 1
PROGRAMMER_STLINKV3_SPI,
#endif
#if CONFIG_LSPCON_I2C_SPI == 1
PROGRAMMER_LSPCON_I2C_SPI,
#endif
PROGRAMMER_INVALID /* This must always be the last entry. */
};
@ -811,4 +814,9 @@ struct libusb_device_handle *usb_dev_get_by_vid_pid_serial(
struct libusb_device_handle *usb_dev_get_by_vid_pid_number(
struct libusb_context *usb_ctx, uint16_t vid, uint16_t pid, unsigned int num);
/* lspcon_i2c_spi.c */
#if CONFIG_LSPCON_I2C_SPI == 1
int lspcon_i2c_spi_init(void);
#endif
#endif /* !__PROGRAMMER_H__ */