1660673afSXiubo Li /* 2660673afSXiubo Li * Copyright 2014 Freescale Semiconductor 3660673afSXiubo Li * 4660673afSXiubo Li * SPDX-License-Identifier: GPL-2.0+ 5660673afSXiubo Li */ 6660673afSXiubo Li 7660673afSXiubo Li #include <common.h> 8660673afSXiubo Li #include <asm/io.h> 9660673afSXiubo Li #include <asm/arch/ls102xa_stream_id.h> 10660673afSXiubo Li ls102xa_config_smmu_stream_id(struct smmu_stream_id * id,uint32_t num)11660673afSXiubo Livoid ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num) 12660673afSXiubo Li { 1315b96ad8SVincent Siles void *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; 14660673afSXiubo Li int i; 15*c4f97b1fSVincent Siles u32 icid; 16660673afSXiubo Li 17*c4f97b1fSVincent Siles for (i = 0; i < num; i++) { 18*c4f97b1fSVincent Siles icid = (id[i].stream_id & 0xff) << 24; 19*c4f97b1fSVincent Siles out_be32((u32 *)(scfg + id[i].offset), icid); 20*c4f97b1fSVincent Siles } 21660673afSXiubo Li } 228133574eSAlison Wang ls1021x_config_caam_stream_id(struct liodn_id_table * tbl,int size)238133574eSAlison Wangvoid ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size) 248133574eSAlison Wang { 258133574eSAlison Wang int i; 268133574eSAlison Wang u32 liodn; 278133574eSAlison Wang 288133574eSAlison Wang for (i = 0; i < size; i++) { 298133574eSAlison Wang if (tbl[i].num_ids == 2) 308133574eSAlison Wang liodn = (tbl[i].id[0] << 16) | tbl[i].id[1]; 318133574eSAlison Wang else 328133574eSAlison Wang liodn = tbl[i].id[0]; 338133574eSAlison Wang 3412cbf20dSVincent Siles out_le32((u32 *)(tbl[i].reg_offset), liodn); 358133574eSAlison Wang } 368133574eSAlison Wang } 37