From 22e93511be2e012d3f807641b07e09b649a71ef6 Mon Sep 17 00:00:00 2001 From: Robert Beckett Date: Mon, 28 Oct 2019 17:44:58 +0000 Subject: dm: i2c: EEPROM simulator allow tests visibility of addr and offset Improve i2c EEPROM simulator testing by providing access functions to check the previous chip addr and offset. Given that we can now directly test the offsets, also simplified the offset mapping and allow for wrapping acceses. Signed-off-by: Robert Beckett Reviewed-by: Heiko Schocher --- arch/sandbox/include/asm/test.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'arch/sandbox/include/asm') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index b885e1a14f..f3a8b455d5 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -72,6 +72,10 @@ void sandbox_i2c_eeprom_set_test_mode(struct udevice *dev, void sandbox_i2c_eeprom_set_offset_len(struct udevice *dev, int offset_len); +uint sanbox_i2c_eeprom_get_prev_addr(struct udevice *dev); + +uint sanbox_i2c_eeprom_get_prev_offset(struct udevice *dev); + /** * sandbox_i2c_rtc_set_offset() - set the time offset from system/base time * -- cgit From 951674ac7e3db23eb3b2b87c27387364a9e38ca2 Mon Sep 17 00:00:00 2001 From: Robert Beckett Date: Mon, 28 Oct 2019 17:44:59 +0000 Subject: dm: i2c: EEPROM simulator add tests for addr offset mask Add support for setting the chip address offset mask to EEPROM sumulator and add tests to test it. Signed-off-by: Robert Beckett Reviewed-by: Heiko Schocher --- arch/sandbox/include/asm/test.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arch/sandbox/include/asm') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index f3a8b455d5..7dd9aa58c5 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -72,6 +72,9 @@ void sandbox_i2c_eeprom_set_test_mode(struct udevice *dev, void sandbox_i2c_eeprom_set_offset_len(struct udevice *dev, int offset_len); +void sandbox_i2c_eeprom_set_chip_addr_offset_mask(struct udevice *dev, + uint mask); + uint sanbox_i2c_eeprom_get_prev_addr(struct udevice *dev); uint sanbox_i2c_eeprom_get_prev_offset(struct udevice *dev); -- cgit