Re: [PATCH v6 024/102] sandbox: Add PCI driver and test for p2sb

2019-12-07 Thread Bin Meng
On Sat, Dec 7, 2019 at 12:47 PM Simon Glass  wrote:
>
> 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 
> ---
>
> Changes in v6:
> - Correct a few unrelated defconfig changes
> - Drop unwanted debug printf()
>
> Changes in v5: None
> Changes in v4:
> - Drop change to message about a missing uclass
> - Drop empty operations struct since p2sb does not need it
> - Drop pmic_pm8916 driver name and use a sandbox name instead
> - Split out mmio changes into a separate patch
>
> Changes in v3:
> - Fix build errors in sandbox_spl, etc
>
> Changes in v2: None
>
>  arch/sandbox/dts/test.dts  |  13 ++
>  arch/sandbox/include/asm/test.h|   1 +
>  configs/sandbox64_defconfig|   3 +
>  configs/sandbox_defconfig  |   1 +
>  configs/sandbox_flattree_defconfig |   3 +
>  configs/sandbox_spl_defconfig  |   3 +
>  configs/tools-only_defconfig   |   2 +
>  drivers/misc/Makefile  |   2 +
>  drivers/misc/p2sb_emul.c   | 272 +
>  drivers/misc/p2sb_sandbox.c|  39 +
>  drivers/misc/sandbox_adder.c   |  60 +++
>  test/dm/Makefile   |   1 +
>  test/dm/p2sb.c |  28 +++
>  13 files changed, 428 insertions(+)
>  create mode 100644 drivers/misc/p2sb_emul.c
>  create mode 100644 drivers/misc/p2sb_sandbox.c
>  create mode 100644 drivers/misc/sandbox_adder.c
>  create mode 100644 test/dm/p2sb.c
>

applied to u-boot-x86/next, thanks!


[PATCH v6 024/102] sandbox: Add PCI driver and test for p2sb

2019-12-06 Thread Simon Glass
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 
---

Changes in v6:
- Correct a few unrelated defconfig changes
- Drop unwanted debug printf()

Changes in v5: None
Changes in v4:
- Drop change to message about a missing uclass
- Drop empty operations struct since p2sb does not need it
- Drop pmic_pm8916 driver name and use a sandbox name instead
- Split out mmio changes into a separate patch

Changes in v3:
- Fix build errors in sandbox_spl, etc

Changes in v2: None

 arch/sandbox/dts/test.dts  |  13 ++
 arch/sandbox/include/asm/test.h|   1 +
 configs/sandbox64_defconfig|   3 +
 configs/sandbox_defconfig  |   1 +
 configs/sandbox_flattree_defconfig |   3 +
 configs/sandbox_spl_defconfig  |   3 +
 configs/tools-only_defconfig   |   2 +
 drivers/misc/Makefile  |   2 +
 drivers/misc/p2sb_emul.c   | 272 +
 drivers/misc/p2sb_sandbox.c|  39 +
 drivers/misc/sandbox_adder.c   |  60 +++
 test/dm/Makefile   |   1 +
 test/dm/p2sb.c |  28 +++
 13 files changed, 428 insertions(+)
 create mode 100644 drivers/misc/p2sb_emul.c
 create mode 100644 drivers/misc/p2sb_sandbox.c
 create mode 100644 drivers/misc/sandbox_adder.c
 create mode 100644 test/dm/p2sb.c

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index 99905677ab..9c8c4e2709 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -471,6 +471,16 @@
   0x01000810 0 0 0 0>;
sandbox,emul = <_case_emul0_1>;
};
+   p2sb-pci@2,0 {
+   compatible = "sandbox,p2sb";
+   reg = <0x02001010 0 0 0 0>;
+   sandbox,emul = <_emul>;
+
+   adder {
+   intel,p2sb-port-id = <3>;
+   compatible = "sandbox,adder";
+   };
+   };
pci@1e,0 {
compatible = "sandbox,pmc";
reg = <0xf000 0 0 0 0>;
@@ -502,6 +512,9 @@
swap_case_emul0_1f: emul0@1f,0 {
compatible = "sandbox,swap-case";
};
+   p2sb_emul: emul@2,0 {
+   compatible = "sandbox,p2sb-emul";
+   };
pmc_emul1e: emul@1e,0 {
compatible = "sandbox,pmc-emul";
};
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index fa40d21f3f..fdb0ecfed1 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_ID0x5677
+#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
 
diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
index d467841205..d1ca9eb3da 100644
--- a/configs/sandbox64_defconfig
+++ b/configs/sandbox64_defconfig
@@ -83,6 +83,8 @@ CONFIG_DEVRES=y
 CONFIG_DEBUG_DEVRES=y
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_AXI=y
+CONFIG_AXI_SANDBOX=y
 CONFIG_CLK=y
 CONFIG_CPU=y
 CONFIG_DM_DEMO=y
@@ -202,3 +204,4 @@ CONFIG_TEST_FDTDEC=y
 CONFIG_UNIT_TEST=y
 CONFIG_UT_TIME=y
 CONFIG_UT_DM=y
+CONFIG_P2SB=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index ed7ff78a86..cc8b44ad28 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -132,6 +132,7 @@ CONFIG_CROS_EC_I2C=y
 CONFIG_CROS_EC_LPC=y
 CONFIG_CROS_EC_SANDBOX=y
 CONFIG_CROS_EC_SPI=y
+CONFIG_P2SB=y
 CONFIG_PWRSEQ=y
 CONFIG_SPL_PWRSEQ=y
 CONFIG_I2C_EEPROM=y
diff --git a/configs/sandbox_flattree_defconfig 
b/configs/sandbox_flattree_defconfig
index 02969f95f1..8477542cb5 100644
--- a/configs/sandbox_flattree_defconfig
+++ b/configs/sandbox_flattree_defconfig
@@ -67,6 +67,8 @@ CONFIG_DEVRES=y
 CONFIG_DEBUG_DEVRES=y
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_AXI=y
+CONFIG_AXI_SANDBOX=y
 CONFIG_CLK=y
 CONFIG_CLK_COMPOSITE_CCF=y
 CONFIG_SANDBOX_CLK_CCF=y
@@ -117,6 +119,7 @@ CONFIG_PCI=y
 CONFIG_DM_PCI=y
 CONFIG_DM_PCI_COMPAT=y
 CONFIG_PCI_SANDBOX=y
+CONFIG_P2SB=y
 CONFIG_PHY=y
 CONFIG_PHY_SANDBOX=y
 CONFIG_PINCTRL=y
diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 3b0f15de88..bcc04f0877 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -88,6 +88,8 @@ CONFIG_DEBUG_DEVRES=y
 # CONFIG_SPL_SIMPLE_BUS is not set
 CONFIG_ADC=y
 CONFIG_ADC_SANDBOX=y
+CONFIG_AXI=y
+CONFIG_AXI_SANDBOX=y
 CONFIG_CLK=y
 CONFIG_CPU=y
 CONFIG_DM_DEMO=y
@@ -201,3 +203,4 @@ CONFIG_ERRNO_STR=y
 CONFIG_UNIT_TEST=y