AM243x MCU+ SDK  09.02.01
pcie/pcie.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022-2024 Texas Instruments Incorporated
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef PCIE_H_
51 #define PCIE_H_
52 
53 #ifdef __cplusplus
54 extern "C" {
55 #endif
56 
57 #include <stdint.h>
58 
59 /* ========================================================================== */
60 /* Macros */
61 /* ========================================================================== */
62 
66 #define PCIE_MAX_PERIPHS (4U)
67 
72 #define PCIE_MAX_MSI_IRQ (32U)
73 
78 #define PCIE_MAX_MSIX_IRQ (2048U)
79 
84 #define PCIE_MAX_NUM_IBATU (6U)
85 
86 /* ========================================================================== */
87 /* Structures and Enums */
88 /* ========================================================================== */
89 
93 typedef enum
94 {
99 
103 typedef enum
104 {
105  PCIE_GEN1 = 1,
106  PCIE_GEN2 = 2,
107  PCIE_GEN3 = 3,
108 } Pcie_Gen;
109 
114 typedef enum
115 {
123 
128 typedef enum
129 {
133 
137 typedef enum
138 {
142 } Pcie_PwrState;
143 
147 typedef enum
148 {
154 } Pcie_IntPin;
155 
159 typedef void *Pcie_Handle;
160 
165 typedef struct
166 {
168  void *cfgBase;
170  void *dataBase;
172  uint32_t dataReserved;
174  void *devParams;
176 
180 typedef enum
181 {
185 
189 typedef enum
190 {
195 
199 typedef enum
200 {
204 
210 typedef enum Pcie_AtuRegionDir
211 {
215 
220 typedef enum Pcie_TlpType
221 {
227 
232 {
236 
240 typedef struct
241 {
243  uint32_t regionIndex;
247  uint32_t lowerBaseAddr;
249  uint32_t upperBaseAddr;
253  uint32_t lowerTargetAddr;
255  uint32_t upperTargetAddr;
256 } Pcie_ObAtuCfg;
257 
261 typedef struct
262 {
264  uint32_t regionIndex;
268  uint32_t lowerBaseAddr;
270  uint32_t upperBaseAddr;
274  uint32_t lowerTargetAddr;
276  uint32_t upperTargetAddr;
278  uint32_t barAperture;
280  uint32_t barCfg;
281 } Pcie_IbAtuCfg;
282 
286 typedef void (*Pcie_MsiIsr)(void *arg, uint32_t msiData);
287 
291 typedef void (*Pcie_MsixIsr)(void *arg, uint32_t msixData);
292 
297 typedef struct {
301  void *arg;
308  uint32_t intNum;
310 
315 typedef struct {
319  void *arg;
326  uint32_t intNum;
328 
332 typedef struct {
336  void *isrArgs[PCIE_MAX_MSI_IRQ];
338 
342 typedef struct {
346  void *isrArgs[PCIE_MAX_MSIX_IRQ];
348 
352 typedef struct {
353  /* Address to write to for MSIx interrupt */
354  uintptr_t addr;
355  /* Data to write to for MSIx interrupt */
356  uint32_t data;
357  /* Indentifies if a function is restricted from sending MSIx */
358  uint32_t vector_ctrl;
360 
361 typedef struct
362 {
364 } Pcie_MsixTbl;
365 
374 typedef struct
375 {
377  uint32_t deviceNum;
381  uint16_t vendorId;
383  uint16_t deviceId;
385  uint16_t subSysVendorId;
387  uint16_t subSystemId;
389  uint8_t classCode;
391  uint8_t subClassCode;
393  uint8_t progIntrface;
395  uint8_t revId;
399  uint32_t numLanes;
407  uint32_t obAtuNum;
411  uint32_t ibAtuNum;
417  uint32_t msiRingNum;
419  uint32_t msiIntNum;
423  uint32_t msiMmc;
425  uint32_t msiMme;
429  uint8_t *msiRingMem;
433  uint32_t msixRingNum;
435  uint32_t msixIntNum;
443  uint8_t *msixRingMem;
444 } Pcie_Attrs;
445 
449 typedef struct
450 {
456  uint32_t cfgDone;
457 } Pcie_Object;
458 
466 typedef struct
467 {
471 
478 typedef struct
479 {
482 } Pcie_InitCfg;
483 
484 
491 typedef struct
492 {
495 } Pcie_Config;
496 
505 typedef enum
506 {
510 
514 typedef enum
515 {
553 
563 typedef struct Pcie_BarCfg_s {
569  uint32_t base;
577  uint8_t idx;
579  uint8_t barxc;
581  uint8_t barxa;
582 } Pcie_BarCfg;
583 
588 typedef struct Pcie_IbTransCfg_s {
590  uint8_t ibBar;
592  uint32_t ibStartAddrLo;
594  uint32_t ibStartAddrHi;
596  uint32_t ibOffsetAddr;
598  uint8_t region;
600 
607 typedef struct Pcie_AtuRegionParams_s
608 {
617  uint32_t enableRegion;
623  uint32_t barNumber;
628  uint32_t lowerBaseAddr;
633  uint32_t upperBaseAddr;
643  uint32_t lowerTargetAddr;
648  uint32_t upperTargetAddr;
654 
656 extern Pcie_Config gPcieConfig[];
658 extern uint32_t gPcieConfigNum;
659 
660 /* ========================================================================== */
661 /* Function Declarations */
662 /* ========================================================================== */
663 
667 void Pcie_init(void);
668 
680 
688 void Pcie_close(Pcie_Handle handle);
689 
698 
709 
720 int32_t Pcie_getMemSpaceReserved (Pcie_Handle handle, uint32_t *resSize);
721 
732 int32_t Pcie_getMemSpaceRange (Pcie_Handle handle, void **base, uint32_t *size);
733 
742 int32_t Pcie_cfgBar (Pcie_Handle handle, const Pcie_BarCfg *barCfg);
743 
755  uint32_t atuRegionIndex, const Pcie_AtuRegionParams *atuRegionParams);
756 
767 int32_t Pcie_getVendorId(Pcie_Handle handle, Pcie_Location location,
768  uint32_t *vendorId, uint32_t *deviceId);
769 
778 int32_t Pcie_getPwrState(Pcie_Handle handle, Pcie_PwrState *pwrState);
779 
789 int32_t Pcie_getLinkParams(Pcie_Handle handle, Pcie_Gen *gen, uint32_t *numLanes);
790 
798 int32_t Pcie_isLinkUp(Pcie_Handle handle);
799 
807 int32_t Pcie_waitLinkUp(Pcie_Handle handle);
808 
819 
828 int32_t Pcie_LtssmCtrl (Pcie_Handle handle, uint8_t enable);
829 
837 int32_t Pcie_setLanes (Pcie_Handle handle);
838 
847 int32_t Pcie_cfgEP (Pcie_Handle handle);
848 
857 int32_t Pcie_cfgRC (Pcie_Handle handle);
858 
873 int32_t Pcie_setCfgEn(Pcie_Handle handle, int enable);
874 
886 int32_t Pcie_setSlotClockCnfg(Pcie_Handle handle, int enable);
887 
896 int32_t Pcie_setDwnStrIrq(Pcie_Handle handle, int enable);
897 
906 int32_t Pcie_setLnkDwnStateIrq(Pcie_Handle handle, int enable);
907 
916 int32_t Pcie_setPwrStateIrq(Pcie_Handle handle, int enable);
917 
926 int32_t Pcie_setHotResetIrq(Pcie_Handle handle, int enable);
927 
936 
945 
954 
955 #ifdef __cplusplus
956 }
957 #endif
958 
959 #endif /* PCIE_H_ */
960 
PCIE_INT_PIND
@ PCIE_INT_PIND
Definition: pcie/pcie.h:153
Pcie_IbAtuCfg::lowerBaseAddr
uint32_t lowerBaseAddr
Definition: pcie/pcie.h:268
Pcie_Attrs::msiMmc
uint32_t msiMmc
Definition: pcie/pcie.h:423
Pcie_RegisterMsixIsrParams
Pcie_RegisterMsixIsrParams specifies the parameters to register an ISR for MSIX.
Definition: pcie/pcie.h:315
Pcie_Config::attrs
Pcie_Attrs * attrs
Definition: pcie/pcie.h:494
Pcie_RegisterMsixIsrParams::isr
Pcie_MsixIsr isr
Definition: pcie/pcie.h:317
PCIE_EP_MODE
@ PCIE_EP_MODE
Definition: pcie/pcie.h:95
PCIE_LTSSM_CFG_LINKWD_ACEPT
@ PCIE_LTSSM_CFG_LINKWD_ACEPT
Definition: pcie/pcie.h:524
Pcie_ObAtuCfg::upperBaseAddr
uint32_t upperBaseAddr
Definition: pcie/pcie.h:249
PCIE_LTSSM_CFG_COMPLETE
@ PCIE_LTSSM_CFG_COMPLETE
Definition: pcie/pcie.h:527
PCIE_LTSSM_LPBK_ENTRY
@ PCIE_LTSSM_LPBK_ENTRY
Definition: pcie/pcie.h:542
Pcie_DeviceCfgBaseAddr::cfgBase
void * cfgBase
Definition: pcie/pcie.h:168
gPcieConfig
Pcie_Config gPcieConfig[]
Externally defined driver configuration array.
Pcie_IbAtuCfg::lowerTargetAddr
uint32_t lowerTargetAddr
Definition: pcie/pcie.h:274
Pcie_BarCfg::barxc
uint8_t barxc
Definition: pcie/pcie.h:579
Pcie_Attrs
PCIe atributes.
Definition: pcie/pcie.h:375
PCIE_BAR_RSVD
@ PCIE_BAR_RSVD
Definition: pcie/pcie.h:192
Pcie_IbAtuCfg
Pcie_IbAtuCfg specifies the Inbound ATU configurations for PCIe.
Definition: pcie/pcie.h:262
Pcie_IbAtuCfg::barCfg
uint32_t barCfg
Definition: pcie/pcie.h:280
size
uint16_t size
Definition: tisci_boardcfg.h:1
Pcie_AtuRegionParams::barNumber
uint32_t barNumber
Definition: pcie/pcie.h:623
PCIE_LTSSM_RCVRY_EQ3
@ PCIE_LTSSM_RCVRY_EQ3
Definition: pcie/pcie.h:551
PCIE_LTSSM_RCVRY_IDLE
@ PCIE_LTSSM_RCVRY_IDLE
Definition: pcie/pcie.h:532
Pcie_AtuRegionParams::matchMode
Pcie_AtuRegionMatchMode matchMode
Definition: pcie/pcie.h:619
Pcie_AtuRegionParams::lowerTargetAddr
uint32_t lowerTargetAddr
Definition: pcie/pcie.h:643
PCIE_TLP_TYPE_MEM
@ PCIE_TLP_TYPE_MEM
Definition: pcie/pcie.h:222
Pcie_close
void Pcie_close(Pcie_Handle handle)
Function to close PCIe peripheral specified by PCIe handle.
Pcie_IbTransCfg::ibOffsetAddr
uint32_t ibOffsetAddr
Definition: pcie/pcie.h:596
Pcie_PwrState
Pcie_PwrState
Enumeration for PCIE Power State.
Definition: pcie/pcie.h:138
Pcie_MsixTblEntry
PCIe MSIx table entry.
Definition: pcie/pcie.h:352
Pcie_ObAtuCfg::upperTargetAddr
uint32_t upperTargetAddr
Definition: pcie/pcie.h:255
Pcie_setPwrStateIrq
int32_t Pcie_setPwrStateIrq(Pcie_Handle handle, int enable)
Enable power management state interrupt in PCIE Controller.
Pcie_Attrs::operationMode
Pcie_Mode operationMode
Definition: pcie/pcie.h:379
Pcie_getPwrState
int32_t Pcie_getPwrState(Pcie_Handle handle, Pcie_PwrState *pwrState)
Get current PCIe Power State.
Pcie_LtssmCtrl
int32_t Pcie_LtssmCtrl(Pcie_Handle handle, uint8_t enable)
Enable/disable PCIe link training.
PCIE_TLP_TYPE_CFG
@ PCIE_TLP_TYPE_CFG
Definition: pcie/pcie.h:224
PCIE_REFCLK_MODE_EXT_NOSSC
@ PCIE_REFCLK_MODE_EXT_NOSSC
Definition: pcie/pcie.h:120
Pcie_RegisterMsiIsrParams::intNum
uint32_t intNum
Definition: pcie/pcie.h:308
PCIE_LTSSM_RCVRY_SPEED
@ PCIE_LTSSM_RCVRY_SPEED
Definition: pcie/pcie.h:530
PCIE_LTSSM_LPBK_EXIT_TIMEOUT
@ PCIE_LTSSM_LPBK_EXIT_TIMEOUT
Definition: pcie/pcie.h:545
Pcie_ackLnkDwnStateIrq
int32_t Pcie_ackLnkDwnStateIrq(Pcie_Handle handle)
Acknowledge link down status interrupt.
index
uint16_t index
Definition: tisci_rm_proxy.h:3
PCIE_REFCLK_MODE_INT_SSC_OUTEN
@ PCIE_REFCLK_MODE_INT_SSC_OUTEN
Definition: pcie/pcie.h:119
Pcie_DeviceCfgBaseAddr
The Pcie_DeviceCfg is used to specify device level configuration of the driver instance.
Definition: pcie/pcie.h:166
PCIE_LTSSM_HOT_RESET_ENTRY
@ PCIE_LTSSM_HOT_RESET_ENTRY
Definition: pcie/pcie.h:546
Pcie_DeviceCfg
PCIe device configuration.
Definition: pcie/pcie.h:467
Pcie_BarType
Pcie_BarType
These are the possible values for Type BAR configuration.
Definition: pcie/pcie.h:190
Pcie_getLinkParams
int32_t Pcie_getLinkParams(Pcie_Handle handle, Pcie_Gen *gen, uint32_t *numLanes)
Get current PCIe Link Parameter.
Pcie_IntPin
Pcie_IntPin
Enumeration for PCIE Legacy Interrupt Pin.
Definition: pcie/pcie.h:148
Pcie_MsixTbl
Definition: pcie/pcie.h:362
Pcie_IbAtuCfg::upperBaseAddr
uint32_t upperBaseAddr
Definition: pcie/pcie.h:270
Pcie_IbTransCfg
Inbound traslation configuration info The Pcie_IbTransCfg is used to configure the Inbound Translatio...
Definition: pcie/pcie.h:588
Pcie_SRIS_Mode
Pcie_SRIS_Mode
Enumeration for PCIe SRIS mode.
Definition: pcie/pcie.h:129
PCIE_LTSSM_L1_IDLE
@ PCIE_LTSSM_L1_IDLE
Definition: pcie/pcie.h:536
PCIE_LTSSM_RCVRY_LOCK
@ PCIE_LTSSM_RCVRY_LOCK
Definition: pcie/pcie.h:529
PCIE_ATU_REGION_DIR_OUTBOUND
@ PCIE_ATU_REGION_DIR_OUTBOUND
Definition: pcie/pcie.h:212
Pcie_BarCfg::barxa
uint8_t barxa
Definition: pcie/pcie.h:581
Pcie_Attrs::epMsixTbl
Pcie_MsixTbl * epMsixTbl
Definition: pcie/pcie.h:439
Pcie_Attrs::msiRingNum
uint32_t msiRingNum
Definition: pcie/pcie.h:417
Pcie_Attrs::obAtu
Pcie_ObAtuCfg * obAtu
Definition: pcie/pcie.h:405
Pcie_IbAtuCfg::regionIndex
uint32_t regionIndex
Definition: pcie/pcie.h:264
Pcie_Attrs::subSystemId
uint16_t subSystemId
Definition: pcie/pcie.h:387
Pcie_BarCfg::memSpace
Pcie_BarMem memSpace
Definition: pcie/pcie.h:575
PCIE_ATU_REGION_MATCH_MODE_BAR
@ PCIE_ATU_REGION_MATCH_MODE_BAR
Definition: pcie/pcie.h:234
PCIE_LTSSM_LPBK_EXIT
@ PCIE_LTSSM_LPBK_EXIT
Definition: pcie/pcie.h:544
Pcie_IbAtuCfg::upperTargetAddr
uint32_t upperTargetAddr
Definition: pcie/pcie.h:276
Pcie_setInterfaceMode
int32_t Pcie_setInterfaceMode(Pcie_Handle handle, Pcie_Mode mode, Pcie_Gen gen)
Set interfac mode (RC/EP)
Pcie_AtuRegionDir
Pcie_AtuRegionDir
Enum to select PCIe ATU(Address translation unit) region direction(Inbound or Outbound)....
Definition: pcie/pcie.h:211
Pcie_Attrs::vendorId
uint16_t vendorId
Definition: pcie/pcie.h:381
Pcie_setLanes
int32_t Pcie_setLanes(Pcie_Handle handle)
Set number of PCIe lanes as configured.
PCIE_PWR_STATE_D0
@ PCIE_PWR_STATE_D0
Definition: pcie/pcie.h:139
Pcie_TlpType
Pcie_TlpType
This enum is used to select PCIe TLP(Transaction layer packet) type while configuring inbound or outb...
Definition: pcie/pcie.h:221
Pcie_AtuRegionParams::lowerBaseAddr
uint32_t lowerBaseAddr
Definition: pcie/pcie.h:628
Pcie_BarPref
Pcie_BarPref
These are the possible values for Prefetch BAR configuration.
Definition: pcie/pcie.h:181
PCIE_TLP_TYPE_IO
@ PCIE_TLP_TYPE_IO
Definition: pcie/pcie.h:223
Pcie_cfgEP
int32_t Pcie_cfgEP(Pcie_Handle handle)
Configure Pcie for EP (End Point) operation. PCIe mode setting is NOT done here (Pcie_setInterfaceMod...
PCIE_LTSSM_DETECT_WAIT
@ PCIE_LTSSM_DETECT_WAIT
Definition: pcie/pcie.h:522
Pcie_setCfgEn
int32_t Pcie_setCfgEn(Pcie_Handle handle, int enable)
Set CONFIG_ENABLE to signal RC that the local EP configuration is completed.
Pcie_Location
Pcie_Location
Enumeration for PCIe access type remote/local.
Definition: pcie/pcie.h:506
Pcie_RegisterMsiIsrParams::isr
Pcie_MsiIsr isr
Definition: pcie/pcie.h:299
PCIE_LTSSM_DISABLED_IDLE
@ PCIE_LTSSM_DISABLED_IDLE
Definition: pcie/pcie.h:540
PCIE_LTSSM_POLL_CONFIG
@ PCIE_LTSSM_POLL_CONFIG
Definition: pcie/pcie.h:520
Pcie_Attrs::msiMme
uint32_t msiMme
Definition: pcie/pcie.h:425
Pcie_MsixIsr
void(* Pcie_MsixIsr)(void *arg, uint32_t msixData)
Function pointer for the PCIe MSIx ISR.
Definition: pcie/pcie.h:291
PCIE_GEN3
@ PCIE_GEN3
Definition: pcie/pcie.h:107
PCIE_MAX_MSI_IRQ
#define PCIE_MAX_MSI_IRQ
Maximum PCIe MSI interrupts supported.
Definition: pcie/pcie.h:72
PCIE_LEGACY_EP_MODE
@ PCIE_LEGACY_EP_MODE
Definition: pcie/pcie.h:96
Pcie_IbAtuCfg::regionWindowSize
uint32_t regionWindowSize
Definition: pcie/pcie.h:272
Pcie_Attrs::classCode
uint8_t classCode
Definition: pcie/pcie.h:389
Pcie_handleGetBases
Pcie_DeviceCfgBaseAddr * Pcie_handleGetBases(Pcie_Handle handle)
Get the device base address info for the PCIe peripheral.
PCIE_LTSSM_CFG_IDLE
@ PCIE_LTSSM_CFG_IDLE
Definition: pcie/pcie.h:528
Pcie_Object::bases
Pcie_DeviceCfgBaseAddr * bases
Definition: pcie/pcie.h:454
Pcie_Attrs::msiGlobalEventNum
uint32_t msiGlobalEventNum
Definition: pcie/pcie.h:415
Pcie_RegisterMsixIsrParams::arg
void * arg
Definition: pcie/pcie.h:319
Pcie_BarCfg
PCIe BAR configuration info.
Definition: pcie/pcie.h:563
Pcie_Attrs::msixRingNum
uint32_t msixRingNum
Definition: pcie/pcie.h:433
Pcie_IbTransCfg::ibStartAddrHi
uint32_t ibStartAddrHi
Definition: pcie/pcie.h:594
PCIE_BAR_MEM_IO
@ PCIE_BAR_MEM_IO
Definition: pcie/pcie.h:202
Pcie_LtssmState
Pcie_LtssmState
Enumeration for possible values for encoding LTSSM state.
Definition: pcie/pcie.h:515
PCIE_BAR_TYPE64
@ PCIE_BAR_TYPE64
Definition: pcie/pcie.h:193
Pcie_AtuRegionParams::tlpType
Pcie_TlpType tlpType
Definition: pcie/pcie.h:613
Pcie_BarCfg::type
Pcie_BarType type
Definition: pcie/pcie.h:573
Pcie_setHotResetIrq
int32_t Pcie_setHotResetIrq(Pcie_Handle handle, int enable)
Enable hot reset interrupt in PCIE Controller.
PCIE_LTSSM_LPBK_ACTIVE
@ PCIE_LTSSM_LPBK_ACTIVE
Definition: pcie/pcie.h:543
PCIE_REFCLK_MODE_INT_NOSSC_OUTDIS
@ PCIE_REFCLK_MODE_INT_NOSSC_OUTDIS
Definition: pcie/pcie.h:116
Pcie_IbTransCfg::ibStartAddrLo
uint32_t ibStartAddrLo
Definition: pcie/pcie.h:592
Pcie_Attrs::subClassCode
uint8_t subClassCode
Definition: pcie/pcie.h:391
PCIE_INT_PINA
@ PCIE_INT_PINA
Definition: pcie/pcie.h:150
Pcie_open
Pcie_Handle Pcie_open(uint32_t index)
This function opens a given PCIe peripheral.
PCIE_LTSSM_PRE_DETECT_QUIET
@ PCIE_LTSSM_PRE_DETECT_QUIET
Definition: pcie/pcie.h:521
PCIE_BAR_MEM_MEM
@ PCIE_BAR_MEM_MEM
Definition: pcie/pcie.h:201
PCIE_REFCLK_MODE_EXT_SSC
@ PCIE_REFCLK_MODE_EXT_SSC
Definition: pcie/pcie.h:121
PCIE_BAR_NON_PREF
@ PCIE_BAR_NON_PREF
Definition: pcie/pcie.h:182
Pcie_Mode
Pcie_Mode
These are the possible values for PCIe mode.
Definition: pcie/pcie.h:94
PCIE_LTSSM_L2_IDLE
@ PCIE_LTSSM_L2_IDLE
Definition: pcie/pcie.h:537
Pcie_MsixTblEntry::vector_ctrl
uint32_t vector_ctrl
Definition: pcie/pcie.h:358
PCIE_PWR_STATE_D1
@ PCIE_PWR_STATE_D1
Definition: pcie/pcie.h:140
PCIE_LTSSM_RCVRY_RCVRCFG
@ PCIE_LTSSM_RCVRY_RCVRCFG
Definition: pcie/pcie.h:531
PCIE_LTSSM_DISABLED_ENTRY
@ PCIE_LTSSM_DISABLED_ENTRY
Definition: pcie/pcie.h:539
Pcie_MsiIsrCtrl
PCIe MSI Isr control structure.
Definition: pcie/pcie.h:332
Pcie_RegisterMsixIsrParams::intNum
uint32_t intNum
Definition: pcie/pcie.h:326
Pcie_Attrs::msixIntNum
uint32_t msixIntNum
Definition: pcie/pcie.h:435
Pcie_setDwnStrIrq
int32_t Pcie_setDwnStrIrq(Pcie_Handle handle, int enable)
Enable downstream interrupt in PCIE Controller.
Pcie_DeviceCfgBaseAddr::devParams
void * devParams
Definition: pcie/pcie.h:174
Pcie_Attrs::msiRingMem
uint8_t * msiRingMem
Definition: pcie/pcie.h:429
PCIE_REFCLK_MODE_INT_NOSSC_OUTEN
@ PCIE_REFCLK_MODE_INT_NOSSC_OUTEN
Definition: pcie/pcie.h:118
PCIE_GEN2
@ PCIE_GEN2
Definition: pcie/pcie.h:106
PCIE_RC_MODE
@ PCIE_RC_MODE
Definition: pcie/pcie.h:97
Pcie_DeviceCfgBaseAddr::dataReserved
uint32_t dataReserved
Definition: pcie/pcie.h:172
Pcie_InitCfg
PCIe configuration for initalization.
Definition: pcie/pcie.h:479
Pcie_Gen
Pcie_Gen
Enumeration for PCIE generations.
Definition: pcie/pcie.h:104
PCIE_INT_PINB
@ PCIE_INT_PINB
Definition: pcie/pcie.h:151
Pcie_Attrs::msixGlobalEventNum
uint32_t msixGlobalEventNum
Definition: pcie/pcie.h:431
Pcie_AtuRegionParams
This Structure defines the ATU region parameters.
Definition: pcie/pcie.h:608
Pcie_AtuRegionParams::upperTargetAddr
uint32_t upperTargetAddr
Definition: pcie/pcie.h:648
Pcie_getMemSpaceReserved
int32_t Pcie_getMemSpaceReserved(Pcie_Handle handle, uint32_t *resSize)
Pcie_getMemSpaceReserved returns amount of reserved space between beginning of hardware's data area a...
Pcie_ObAtuCfg
Pcie_ObAtuCfg specifies the Outbound ATU configurations for PCIe.
Definition: pcie/pcie.h:241
Pcie_Attrs::msixIrqEnableFlag
uint32_t msixIrqEnableFlag
Definition: pcie/pcie.h:437
PCIE_LOCATION_REMOTE
@ PCIE_LOCATION_REMOTE
Definition: pcie/pcie.h:508
Pcie_Attrs::obAtuNum
uint32_t obAtuNum
Definition: pcie/pcie.h:407
Pcie_atuRegionConfig
int32_t Pcie_atuRegionConfig(Pcie_Handle handle, Pcie_Location location, uint32_t atuRegionIndex, const Pcie_AtuRegionParams *atuRegionParams)
Configure address translation registers.
Pcie_Attrs::deviceNum
uint32_t deviceNum
Definition: pcie/pcie.h:377
PCIE_LTSSM_DETECT_QUIET
@ PCIE_LTSSM_DETECT_QUIET
Definition: pcie/pcie.h:516
Pcie_RegisterMsiIsrParams::arg
void * arg
Definition: pcie/pcie.h:301
Pcie_AtuRegionParams::regionDir
Pcie_AtuRegionDir regionDir
Definition: pcie/pcie.h:609
PCIE_MAX_PERIPHS
#define PCIE_MAX_PERIPHS
Maximum PCIe devices supported by the driver.
Definition: pcie/pcie.h:66
Pcie_DeviceCfgBaseAddr::dataBase
void * dataBase
Definition: pcie/pcie.h:170
Pcie_Attrs::intPin
Pcie_IntPin intPin
Definition: pcie/pcie.h:413
PCIE_INT_PINNONE
@ PCIE_INT_PINNONE
Definition: pcie/pcie.h:149
Pcie_ObAtuCfg::lowerTargetAddr
uint32_t lowerTargetAddr
Definition: pcie/pcie.h:253
Pcie_cfgRC
int32_t Pcie_cfgRC(Pcie_Handle handle)
Configure Pcie for RC (Root Complex) operation. PCIe mode setting is NOT done here (Pcie_setInterface...
Pcie_cfgBar
int32_t Pcie_cfgBar(Pcie_Handle handle, const Pcie_BarCfg *barCfg)
Configure a BAR Register (32 bits)
Pcie_ObAtuCfg::tlpType
Pcie_TlpType tlpType
Definition: pcie/pcie.h:245
PCIE_LTSSM_DISABLED
@ PCIE_LTSSM_DISABLED
Definition: pcie/pcie.h:541
PCIE_GEN1
@ PCIE_GEN1
Definition: pcie/pcie.h:105
Pcie_Attrs::gen
Pcie_Gen gen
Definition: pcie/pcie.h:397
Pcie_BarCfg::base
uint32_t base
Definition: pcie/pcie.h:569
Pcie_waitLinkUp
int32_t Pcie_waitLinkUp(Pcie_Handle handle)
Wait for PCIe link training to complete.
Pcie_Attrs::progIntrface
uint8_t progIntrface
Definition: pcie/pcie.h:393
PCIE_REFCLK_SRIS_DISABLED
@ PCIE_REFCLK_SRIS_DISABLED
Definition: pcie/pcie.h:130
PCIE_LTSSM_CFG_LINKWD_START
@ PCIE_LTSSM_CFG_LINKWD_START
Definition: pcie/pcie.h:523
PCIE_LTSSM_CFG_LANENUM_WAIT
@ PCIE_LTSSM_CFG_LANENUM_WAIT
Definition: pcie/pcie.h:525
mode
char mode[32]
Definition: tisci_pm_core.h:1
PCIE_ATU_REGION_DIR_INBOUND
@ PCIE_ATU_REGION_DIR_INBOUND
Definition: pcie/pcie.h:213
Pcie_MsiIsr
void(* Pcie_MsiIsr)(void *arg, uint32_t msiData)
Function pointer for the PCIe MSI ISR.
Definition: pcie/pcie.h:286
Pcie_ObAtuCfg::regionIndex
uint32_t regionIndex
Definition: pcie/pcie.h:243
Pcie_Attrs::msixRingMem
uint8_t * msixRingMem
Definition: pcie/pcie.h:443
Pcie_RegisterMsiIsrParams
Pcie_RegisterMsiIsrParams specifies the parameters to register an ISR for MSI.
Definition: pcie/pcie.h:297
Pcie_Attrs::sris_mode
Pcie_SRIS_Mode sris_mode
Definition: pcie/pcie.h:403
Pcie_ObAtuCfg::regionWindowSize
uint32_t regionWindowSize
Definition: pcie/pcie.h:251
PCIE_LTSSM_L0
@ PCIE_LTSSM_L0
Definition: pcie/pcie.h:533
Pcie_MsixTblEntry::addr
uintptr_t addr
Definition: pcie/pcie.h:354
PCIE_LTSSM_POLL_COMPLIANCE
@ PCIE_LTSSM_POLL_COMPLIANCE
Definition: pcie/pcie.h:519
Pcie_BarCfg::location
Pcie_Location location
Definition: pcie/pcie.h:565
Pcie_ObAtuCfg::lowerBaseAddr
uint32_t lowerBaseAddr
Definition: pcie/pcie.h:247
Pcie_BarCfg::idx
uint8_t idx
Definition: pcie/pcie.h:577
gPcieConfigNum
uint32_t gPcieConfigNum
Externally defined driver configuration array size.
Pcie_checkLinkParams
int32_t Pcie_checkLinkParams(Pcie_Handle handle)
Verify if the link parameters is established as configured.
Pcie_Attrs::numLanes
uint32_t numLanes
Definition: pcie/pcie.h:399
Pcie_IbTransCfg::region
uint8_t region
Definition: pcie/pcie.h:598
Pcie_Attrs::ibAtuNum
uint32_t ibAtuNum
Definition: pcie/pcie.h:411
PCIE_LOCATION_LOCAL
@ PCIE_LOCATION_LOCAL
Definition: pcie/pcie.h:507
Pcie_RefClk_Mode
Pcie_RefClk_Mode
Enumeration for PCIe Reference Clock mode.
Definition: pcie/pcie.h:115
Pcie_Handle
void * Pcie_Handle
Driver handle returned by Pcie_open() call.
Definition: pcie/pcie.h:159
Pcie_Attrs::msiIrqEnableFlag
uint32_t msiIrqEnableFlag
Definition: pcie/pcie.h:421
Pcie_Config::object
Pcie_Object * object
Definition: pcie/pcie.h:493
Pcie_MsixIsrCtrl
ISR and arguement list for MSIx.
Definition: pcie/pcie.h:342
Pcie_Attrs::msiIsrCtrl
Pcie_MsiIsrCtrl * msiIsrCtrl
Definition: pcie/pcie.h:427
Pcie_ackPwrStateIrq
int32_t Pcie_ackPwrStateIrq(Pcie_Handle handle)
Acknowledge power management state interrupt.
PCIE_LTSSM_L2_WAKE
@ PCIE_LTSSM_L2_WAKE
Definition: pcie/pcie.h:538
Pcie_IbAtuCfg::barAperture
uint32_t barAperture
Definition: pcie/pcie.h:278
Pcie_Config
PCIE global configuration array.
Definition: pcie/pcie.h:492
PCIE_MAX_MSIX_IRQ
#define PCIE_MAX_MSIX_IRQ
Maxmium number of MSIx interrupts supported.
Definition: pcie/pcie.h:78
PCIE_BAR_PREF
@ PCIE_BAR_PREF
Definition: pcie/pcie.h:183
Pcie_IbAtuCfg::tlpType
Pcie_TlpType tlpType
Definition: pcie/pcie.h:266
PCIE_LTSSM_L0S
@ PCIE_LTSSM_L0S
Definition: pcie/pcie.h:534
Pcie_isLinkUp
int32_t Pcie_isLinkUp(Pcie_Handle handle)
Check if PCIe link training completed.
Pcie_Object
PCIe driver object.
Definition: pcie/pcie.h:450
PCIE_REFCLK_SRIS_ENABLED
@ PCIE_REFCLK_SRIS_ENABLED
Definition: pcie/pcie.h:131
Pcie_Attrs::msixIsrCtrl
Pcie_MsixIsrCtrl * msixIsrCtrl
Definition: pcie/pcie.h:441
Pcie_BarCfg::mode
Pcie_Mode mode
Definition: pcie/pcie.h:567
Pcie_Attrs::msiIntNum
uint32_t msiIntNum
Definition: pcie/pcie.h:419
Pcie_InitCfg::dev
Pcie_DeviceCfg dev
Definition: pcie/pcie.h:481
PCIE_BAR_TYPE32
@ PCIE_BAR_TYPE32
Definition: pcie/pcie.h:191
Pcie_IbTransCfg::ibBar
uint8_t ibBar
Definition: pcie/pcie.h:590
PCIE_PWR_STATE_D3hot
@ PCIE_PWR_STATE_D3hot
Definition: pcie/pcie.h:141
PCIE_LTSSM_CFG_LANENUM_ACEPT
@ PCIE_LTSSM_CFG_LANENUM_ACEPT
Definition: pcie/pcie.h:526
Pcie_Attrs::revId
uint8_t revId
Definition: pcie/pcie.h:395
PCIE_LTSSM_RCVRY_EQ0
@ PCIE_LTSSM_RCVRY_EQ0
Definition: pcie/pcie.h:548
Pcie_setLnkDwnStateIrq
int32_t Pcie_setLnkDwnStateIrq(Pcie_Handle handle, int enable)
Enable link down status interrupt in PCIE Controller.
Pcie_AtuRegionMatchMode
Pcie_AtuRegionMatchMode
Enum to select address or BAR match mode.
Definition: pcie/pcie.h:232
Pcie_getMemSpaceRange
int32_t Pcie_getMemSpaceRange(Pcie_Handle handle, void **base, uint32_t *size)
Returns the PCIe Internal Address Range for the memory space. This range is used for accessing memory...
Pcie_setSlotClockCnfg
int32_t Pcie_setSlotClockCnfg(Pcie_Handle handle, int enable)
Set slot clock configuration bit in Link Status Register.
Pcie_Attrs::subSysVendorId
uint16_t subSysVendorId
Definition: pcie/pcie.h:385
Pcie_BarMem
Pcie_BarMem
These are the possible values for Memory BAR configuration.
Definition: pcie/pcie.h:200
Pcie_Object::handle
Pcie_Handle handle
Definition: pcie/pcie.h:452
PCIE_ATU_REGION_MATCH_MODE_ADDR
@ PCIE_ATU_REGION_MATCH_MODE_ADDR
Definition: pcie/pcie.h:233
PCIE_LTSSM_RCVRY_EQ1
@ PCIE_LTSSM_RCVRY_EQ1
Definition: pcie/pcie.h:549
Pcie_init
void Pcie_init(void)
This function initializes the PCIe module.
Pcie_ackDwnStrIrq
int32_t Pcie_ackDwnStrIrq(Pcie_Handle handle)
Acknowledge downstream interrupt.
Pcie_AtuRegionParams::upperBaseAddr
uint32_t upperBaseAddr
Definition: pcie/pcie.h:633
Pcie_Attrs::refclk_mode
Pcie_RefClk_Mode refclk_mode
Definition: pcie/pcie.h:401
Pcie_AtuRegionParams::enableRegion
uint32_t enableRegion
Definition: pcie/pcie.h:617
Pcie_BarCfg::prefetch
Pcie_BarPref prefetch
Definition: pcie/pcie.h:571
PCIE_LTSSM_L123_SEND_EIDLE
@ PCIE_LTSSM_L123_SEND_EIDLE
Definition: pcie/pcie.h:535
Pcie_Attrs::ibAtu
Pcie_IbAtuCfg * ibAtu
Definition: pcie/pcie.h:409
PCIE_LTSSM_RCVRY_EQ2
@ PCIE_LTSSM_RCVRY_EQ2
Definition: pcie/pcie.h:550
Pcie_getVendorId
int32_t Pcie_getVendorId(Pcie_Handle handle, Pcie_Location location, uint32_t *vendorId, uint32_t *deviceId)
Get vendor ID and device ID of Pcie Device.
PCIE_LTSSM_HOT_RESET
@ PCIE_LTSSM_HOT_RESET
Definition: pcie/pcie.h:547
PCIE_LTSSM_POLL_ACTIVE
@ PCIE_LTSSM_POLL_ACTIVE
Definition: pcie/pcie.h:518
Pcie_AtuRegionParams::regionWindowSize
uint64_t regionWindowSize
Definition: pcie/pcie.h:638
PCIE_INT_PINC
@ PCIE_INT_PINC
Definition: pcie/pcie.h:152
Pcie_Attrs::deviceId
uint16_t deviceId
Definition: pcie/pcie.h:383
Pcie_MsixTblEntry::data
uint32_t data
Definition: pcie/pcie.h:356
PCIE_REFCLK_MODE_INT_SSC_OUTDIS
@ PCIE_REFCLK_MODE_INT_SSC_OUTDIS
Definition: pcie/pcie.h:117
Pcie_Object::cfgDone
uint32_t cfgDone
Definition: pcie/pcie.h:456
PCIE_LTSSM_DETECT_ACT
@ PCIE_LTSSM_DETECT_ACT
Definition: pcie/pcie.h:517