1 /* SPDX-License-Identifier: GPL-2.0+ */
10 #include <fsl_qbman.h>
12 struct icid_id_table {
16 phys_addr_t compat_addr;
20 u32 get_ppid_icid(int ppid_tbl_idx, int ppid);
21 int fdt_get_smmu_phandle(void *blob);
22 int fdt_set_iommu_prop(void *blob, int off, int smmu_ph, u32 *ids, int num_ids);
24 void fdt_fixup_icid(void *blob);
26 #define SET_ICID_ENTRY(name, idA, regA, addr, compataddr) \
30 .compat_addr = compataddr, \
34 #define SET_SCFG_ICID(compat, streamid, name, compataddr) \
35 SET_ICID_ENTRY(compat, streamid, (((streamid) << 24) | (1 << 23)), \
36 offsetof(struct ccsr_scfg, name) + CONFIG_SYS_FSL_SCFG_ADDR, \
39 #define SET_USB_ICID(usb_num, compat, streamid) \
40 SET_SCFG_ICID(compat, streamid, usb##usb_num##_icid,\
41 CONFIG_SYS_XHCI_USB##usb_num##_ADDR)
43 #define SET_SATA_ICID(compat, streamid) \
44 SET_SCFG_ICID(compat, streamid, sata_icid,\
47 #define SET_SDHC_ICID(streamid) \
48 SET_SCFG_ICID("fsl,esdhc", streamid, sdhc_icid,\
49 CONFIG_SYS_FSL_ESDHC_ADDR)
51 #define SET_QDMA_ICID(compat, streamid) \
52 SET_SCFG_ICID(compat, streamid, dma_icid,\
55 #define SET_EDMA_ICID(streamid) \
56 SET_SCFG_ICID("fsl,vf610-edma", streamid, edma_icid,\
59 #define SET_ETR_ICID(streamid) \
60 SET_SCFG_ICID(NULL, streamid, etr_icid, 0)
62 #define SET_DEBUG_ICID(streamid) \
63 SET_SCFG_ICID(NULL, streamid, debug_icid, 0)
65 #define SET_QMAN_ICID(streamid) \
66 SET_ICID_ENTRY("fsl,qman", streamid, streamid, \
67 offsetof(struct ccsr_qman, liodnr) + \
68 CONFIG_SYS_FSL_QMAN_ADDR, \
69 CONFIG_SYS_FSL_QMAN_ADDR)
71 #define SET_BMAN_ICID(streamid) \
72 SET_ICID_ENTRY("fsl,bman", streamid, streamid, \
73 offsetof(struct ccsr_bman, liodnr) + \
74 CONFIG_SYS_FSL_BMAN_ADDR, \
75 CONFIG_SYS_FSL_BMAN_ADDR)
77 extern struct icid_id_table icid_tbl[];
78 extern int icid_tbl_sz;