2 * Copyright 2014 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
7 #ifndef __FSL_LS102XA_STREAM_ID_H_
8 #define __FSL_LS102XA_STREAM_ID_H_
12 #define SET_LIODN_ENTRY_1(name, idA, off, compatoff) \
14 .id = { idA }, .num_ids = 1, \
15 .reg_offset = off + CONFIG_SYS_IMMR, \
16 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \
19 #define SET_LIODN_ENTRY_2(name, idA, idB, off, compatoff) \
21 .id = { idA, idB }, .num_ids = 2, \
22 .reg_offset = off + CONFIG_SYS_IMMR, \
23 .compat_offset = compatoff + CONFIG_SYS_CCSRBAR_PHYS, \
27 * handle both old and new versioned SEC properties:
28 * "fsl,secX.Y" became "fsl,sec-vX.Y" during development
30 #define SET_SEC_JR_LIODN_ENTRY(jrnum, liodnA, liodnB) \
31 SET_LIODN_ENTRY_2("fsl,sec4.0-job-ring", liodnA, liodnB, \
32 offsetof(ccsr_sec_t, jrliodnr[jrnum].ls) + \
33 CONFIG_SYS_FSL_SEC_OFFSET, \
34 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrnum), \
35 SET_LIODN_ENTRY_2("fsl,sec-v4.0-job-ring", liodnA, liodnB,\
36 offsetof(ccsr_sec_t, jrliodnr[jrnum].ls) + \
37 CONFIG_SYS_FSL_SEC_OFFSET, \
38 CONFIG_SYS_FSL_SEC_OFFSET + 0x1000 + 0x1000 * jrnum)
40 /* This is a bit evil since we treat rtic param as both a string & hex value */
41 #define SET_SEC_RTIC_LIODN_ENTRY(rtic, liodnA) \
42 SET_LIODN_ENTRY_1("fsl,sec4.0-rtic-memory", \
44 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
45 CONFIG_SYS_FSL_SEC_OFFSET, \
46 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa)), \
47 SET_LIODN_ENTRY_1("fsl,sec-v4.0-rtic-memory", \
49 offsetof(ccsr_sec_t, rticliodnr[0x##rtic-0xa].ls) + \
50 CONFIG_SYS_FSL_SEC_OFFSET, \
51 CONFIG_SYS_FSL_SEC_OFFSET + 0x6100 + 0x20 * (0x##rtic-0xa))
53 #define SET_SEC_DECO_LIODN_ENTRY(num, liodnA, liodnB) \
54 SET_LIODN_ENTRY_2(NULL, liodnA, liodnB, \
55 offsetof(ccsr_sec_t, decoliodnr[num].ls) + \
56 CONFIG_SYS_FSL_SEC_OFFSET, 0)
58 struct liodn_id_table {
62 phys_addr_t compat_offset;
63 unsigned long reg_offset;
66 struct smmu_stream_id {
72 void ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size);
73 void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num);