2018-05-06 21:58:06 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2014-11-21 09:40:59 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2014 Freescale Semiconductor
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <asm/io.h>
|
|
|
|
#include <asm/arch/ls102xa_stream_id.h>
|
|
|
|
|
|
|
|
void ls102xa_config_smmu_stream_id(struct smmu_stream_id *id, uint32_t num)
|
|
|
|
{
|
2016-04-22 07:52:06 +00:00
|
|
|
void *scfg = (void *)CONFIG_SYS_FSL_SCFG_ADDR;
|
2014-11-21 09:40:59 +00:00
|
|
|
int i;
|
2016-05-18 12:41:14 +00:00
|
|
|
u32 icid;
|
2014-11-21 09:40:59 +00:00
|
|
|
|
2016-05-18 12:41:14 +00:00
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
icid = (id[i].stream_id & 0xff) << 24;
|
|
|
|
out_be32((u32 *)(scfg + id[i].offset), icid);
|
|
|
|
}
|
2014-11-21 09:40:59 +00:00
|
|
|
}
|
2015-01-16 09:21:34 +00:00
|
|
|
|
|
|
|
void ls1021x_config_caam_stream_id(struct liodn_id_table *tbl, int size)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u32 liodn;
|
|
|
|
|
|
|
|
for (i = 0; i < size; i++) {
|
|
|
|
if (tbl[i].num_ids == 2)
|
|
|
|
liodn = (tbl[i].id[0] << 16) | tbl[i].id[1];
|
|
|
|
else
|
|
|
|
liodn = tbl[i].id[0];
|
|
|
|
|
2016-04-22 07:52:07 +00:00
|
|
|
out_le32((u32 *)(tbl[i].reg_offset), liodn);
|
2015-01-16 09:21:34 +00:00
|
|
|
}
|
|
|
|
}
|