Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Freescale Semiconductor |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
Tom Rini | dec7ea0 | 2024-05-20 13:35:03 -0600 | [diff] [blame] | 6 | #include <config.h> |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 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 | { |
Tom Rini | 376b88a | 2022-10-28 20:27:13 -0400 | [diff] [blame] | 12 | void *scfg = (void *)CFG_SYS_FSL_SCFG_ADDR; |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 13 | int i; |
Vincent Siles | d097bd9 | 2016-05-18 14:41:14 +0200 | [diff] [blame] | 14 | u32 icid; |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 15 | |
Vincent Siles | d097bd9 | 2016-05-18 14:41:14 +0200 | [diff] [blame] | 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 | } |
Xiubo Li | 03d40aa | 2014-11-21 17:40:59 +0800 | [diff] [blame] | 20 | } |
Alison Wang | a825bb3 | 2015-01-16 17:21:34 +0800 | [diff] [blame] | 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 | |
Vincent Siles | 699b9f1 | 2016-04-22 09:52:07 +0200 | [diff] [blame] | 33 | out_le32((u32 *)(tbl[i].reg_offset), liodn); |
Alison Wang | a825bb3 | 2015-01-16 17:21:34 +0800 | [diff] [blame] | 34 | } |
| 35 | } |