blob: 3d5404ee100a1b9d8c8748fecacbc3f22a3b7862 [file] [log] [blame]
Xiubo Li03d40aa2014-11-21 17:40:59 +08001/*
2 * Copyright 2014 Freescale Semiconductor
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <asm/io.h>
9#include <asm/arch/ls102xa_stream_id.h>
10
11void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num)
12{
Vincent Silesea2acc02016-04-22 09:52:06 +020013 void *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR;
Xiubo Li03d40aa2014-11-21 17:40:59 +080014 int i;
15
16 for (i = 0; i < num; i++)
Vincent Silesea2acc02016-04-22 09:52:06 +020017 out_be32((u32 *)(scfg + id[i].offset), id[i].stream_id);
Xiubo Li03d40aa2014-11-21 17:40:59 +080018}
Alison Wanga825bb32015-01-16 17:21:34 +080019
20void ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size)
21{
22 int i;
23 u32 liodn;
24
25 for (i = 0; i < size; i++) {
26 if (tbl[i].num_ids == 2)
27 liodn = (tbl[i].id[0] << 16) | tbl[i].id[1];
28 else
29 liodn = tbl[i].id[0];
30
Vincent Siles699b9f12016-04-22 09:52:07 +020031 out_le32((u32 *)(tbl[i].reg_offset), liodn);
Alison Wanga825bb32015-01-16 17:21:34 +080032 }
33}