From 3b65ee34b908ce0c495c25987f5feb37ac163eab Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Dec 2019 21:41:54 -0700 Subject: x86: sandbox: Add a PMC emulator and test Add a simple PMC for sandbox to permit tests to run. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/sandbox/include/asm/test.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sandbox/include') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index b885e1a14f1..fa40d21f3f5 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -13,6 +13,7 @@ #define SANDBOX_PCI_VENDOR_ID 0x1234 #define SANDBOX_PCI_SWAP_CASE_EMUL_ID 0x5678 +#define SANDBOX_PCI_PMC_EMUL_ID 0x5677 #define SANDBOX_PCI_CLASS_CODE PCI_CLASS_CODE_COMM #define SANDBOX_PCI_CLASS_SUB_CODE PCI_CLASS_SUB_CODE_COMM_SERIAL -- cgit v1.2.3 From 3e17ffbb44cd24c53504179ff51a835502b183ed Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 6 Dec 2019 21:41:57 -0700 Subject: sandbox: Add PCI driver and test for p2sb Add a sandbox driver and PCI-device emulator for p2sb. Also add a test which uses a simple 'adder' driver to test the p2sb functionality. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- arch/sandbox/include/asm/test.h | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/sandbox/include') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index fa40d21f3f5..fdb0ecfed14 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -14,6 +14,7 @@ #define SANDBOX_PCI_VENDOR_ID 0x1234 #define SANDBOX_PCI_SWAP_CASE_EMUL_ID 0x5678 #define SANDBOX_PCI_PMC_EMUL_ID 0x5677 +#define SANDBOX_PCI_P2SB_EMUL_ID 0x5676 #define SANDBOX_PCI_CLASS_CODE PCI_CLASS_CODE_COMM #define SANDBOX_PCI_CLASS_SUB_CODE PCI_CLASS_SUB_CODE_COMM_SERIAL -- cgit v1.2.3 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') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index b885e1a14f1..f3a8b455d52 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 v1.2.3 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') diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index f3a8b455d52..7dd9aa58c55 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 v1.2.3