Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 11 | void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num) |
| 12 | { |
Vincent Siles | ea2acc0 | 2016-04-22 09:52:06 +0200 | [diff] [blame] | 13 | void *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR; |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 14 | int i; |
Vincent Siles | d097bd9 | 2016-05-18 14:41:14 +0200 | [diff] [blame^] | 15 | u32 icid; |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 16 | |
Vincent Siles | d097bd9 | 2016-05-18 14:41:14 +0200 | [diff] [blame^] | 17 | for (i = 0; i < num; i++) { |
| 18 | icid = (id[i].stream_id & 0xff) << 24; |
| 19 | out_be32((u32 *)(scfg + id[i].offset), icid); |
| 20 | } |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 21 | } |
Alison Wang | a825bb3 | 2015-01-16 17:21:34 +0800 | [diff] [blame] | 22 | |
| 23 | void ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size) |
| 24 | { |
| 25 | int i; |
| 26 | u32 liodn; |
| 27 | |
| 28 | for (i = 0; i < size; i++) { |
| 29 | if (tbl[i].num_ids == 2) |
| 30 | liodn = (tbl[i].id[0] << 16) | tbl[i].id[1]; |
| 31 | else |
| 32 | liodn = tbl[i].id[0]; |
| 33 | |
Vincent Siles | 699b9f1 | 2016-04-22 09:52:07 +0200 | [diff] [blame] | 34 | out_le32((u32 *)(tbl[i].reg_offset), liodn); |
Alison Wang | a825bb3 | 2015-01-16 17:21:34 +0800 | [diff] [blame] | 35 | } |
| 36 | } |