]>
Commit | Line | Data |
---|---|---|
83d290c5 | 1 | // SPDX-License-Identifier: GPL-2.0+ |
660673af XL |
2 | /* |
3 | * Copyright 2014 Freescale Semiconductor | |
660673af XL |
4 | */ |
5 | ||
6 | #include <common.h> | |
7 | #include <asm/io.h> | |
8 | #include <asm/arch/ls102xa_stream_id.h> | |
9 | ||
10 | void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num) | |
11 | { | |
15b96ad8 | 12 | void *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; |
660673af | 13 | int i; |
c4f97b1f | 14 | u32 icid; |
660673af | 15 | |
c4f97b1f VS |
16 | for (i = 0; i < num; i++) { |
17 | icid = (id[i].stream_id & 0xff) << 24; | |
18 | out_be32((u32 *)(scfg + id[i].offset), icid); | |
19 | } | |
660673af | 20 | } |
8133574e AW |
21 | |
22 | void ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size) | |
23 | { | |
24 | int i; | |
25 | u32 liodn; | |
26 | ||
27 | for (i = 0; i < size; i++) { | |
28 | if (tbl[i].num_ids == 2) | |
29 | liodn = (tbl[i].id[0] << 16) | tbl[i].id[1]; | |
30 | else | |
31 | liodn = tbl[i].id[0]; | |
32 | ||
12cbf20d | 33 | out_le32((u32 *)(tbl[i].reg_offset), liodn); |
8133574e AW |
34 | } |
35 | } |