aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Meng2018-10-15 04:21:22 -0500
committerSimon Glass2018-11-14 11:16:28 -0600
commit7a20614eb292c48b4a42c3b5314b26d975aa84b4 (patch)
treeb4640aef36e084ce1749e3ec72a0ce34c301d3bc /drivers
parenta8c5f8d3d02807f72d048950d72b0c73d55bd7fb (diff)
downloadu-boot-7a20614eb292c48b4a42c3b5314b26d975aa84b4.tar.gz
u-boot-7a20614eb292c48b4a42c3b5314b26d975aa84b4.tar.xz
u-boot-7a20614eb292c48b4a42c3b5314b26d975aa84b4.zip
test: dm: pci: Add cases for finding next PCI capability APIs
Add test cases to cover the two newly added PCI APIs: dm_pci_find_next_capability() & dm_pci_find_next_ext_capability(). Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/misc/swap_case.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/misc/swap_case.c b/drivers/misc/swap_case.c
index bffb809f14..fa608cec1b 100644
--- a/drivers/misc/swap_case.c
+++ b/drivers/misc/swap_case.c
@@ -124,12 +124,21 @@ static int sandbox_swap_case_read_config(struct udevice *emul, uint offset,
124 case PCI_CAP_ID_PM_OFFSET: 124 case PCI_CAP_ID_PM_OFFSET:
125 *valuep = (PCI_CAP_ID_EXP_OFFSET << 8) | PCI_CAP_ID_PM; 125 *valuep = (PCI_CAP_ID_EXP_OFFSET << 8) | PCI_CAP_ID_PM;
126 break; 126 break;
127 case PCI_CAP_ID_PM_OFFSET + PCI_CAP_LIST_NEXT:
128 *valuep = PCI_CAP_ID_EXP_OFFSET;
129 break;
127 case PCI_CAP_ID_EXP_OFFSET: 130 case PCI_CAP_ID_EXP_OFFSET:
128 *valuep = (PCI_CAP_ID_MSIX_OFFSET << 8) | PCI_CAP_ID_EXP; 131 *valuep = (PCI_CAP_ID_MSIX_OFFSET << 8) | PCI_CAP_ID_EXP;
129 break; 132 break;
133 case PCI_CAP_ID_EXP_OFFSET + PCI_CAP_LIST_NEXT:
134 *valuep = PCI_CAP_ID_MSIX_OFFSET;
135 break;
130 case PCI_CAP_ID_MSIX_OFFSET: 136 case PCI_CAP_ID_MSIX_OFFSET:
131 *valuep = PCI_CAP_ID_MSIX; 137 *valuep = PCI_CAP_ID_MSIX;
132 break; 138 break;
139 case PCI_CAP_ID_MSIX_OFFSET + PCI_CAP_LIST_NEXT:
140 *valuep = 0;
141 break;
133 case PCI_EXT_CAP_ID_ERR_OFFSET: 142 case PCI_EXT_CAP_ID_ERR_OFFSET:
134 *valuep = (PCI_EXT_CAP_ID_VC_OFFSET << 20) | PCI_EXT_CAP_ID_ERR; 143 *valuep = (PCI_EXT_CAP_ID_VC_OFFSET << 20) | PCI_EXT_CAP_ID_ERR;
135 break; 144 break;