|
@@ -334,7 +334,7 @@ static int mtk_packet_engine_setup(struct mtk_cryp *cryp)
|
|
/* Enable the 4 rings for the packet engines. */
|
|
/* Enable the 4 rings for the packet engines. */
|
|
mtk_desc_ring_link(cryp, 0xf);
|
|
mtk_desc_ring_link(cryp, 0xf);
|
|
|
|
|
|
- for (i = 0; i < RING_MAX; i++) {
|
|
|
|
|
|
+ for (i = 0; i < MTK_RING_MAX; i++) {
|
|
mtk_cmd_desc_ring_setup(cryp, i, &cap);
|
|
mtk_cmd_desc_ring_setup(cryp, i, &cap);
|
|
mtk_res_desc_ring_setup(cryp, i, &cap);
|
|
mtk_res_desc_ring_setup(cryp, i, &cap);
|
|
}
|
|
}
|
|
@@ -359,7 +359,7 @@ static int mtk_aic_cap_check(struct mtk_cryp *cryp, int hw)
|
|
{
|
|
{
|
|
u32 val;
|
|
u32 val;
|
|
|
|
|
|
- if (hw == RING_MAX)
|
|
|
|
|
|
+ if (hw == MTK_RING_MAX)
|
|
val = readl(cryp->base + AIC_G_VERSION);
|
|
val = readl(cryp->base + AIC_G_VERSION);
|
|
else
|
|
else
|
|
val = readl(cryp->base + AIC_VERSION(hw));
|
|
val = readl(cryp->base + AIC_VERSION(hw));
|
|
@@ -368,7 +368,7 @@ static int mtk_aic_cap_check(struct mtk_cryp *cryp, int hw)
|
|
if (val != MTK_AIC_VER11 && val != MTK_AIC_VER12)
|
|
if (val != MTK_AIC_VER11 && val != MTK_AIC_VER12)
|
|
return -ENXIO;
|
|
return -ENXIO;
|
|
|
|
|
|
- if (hw == RING_MAX)
|
|
|
|
|
|
+ if (hw == MTK_RING_MAX)
|
|
val = readl(cryp->base + AIC_G_OPTIONS);
|
|
val = readl(cryp->base + AIC_G_OPTIONS);
|
|
else
|
|
else
|
|
val = readl(cryp->base + AIC_OPTIONS(hw));
|
|
val = readl(cryp->base + AIC_OPTIONS(hw));
|
|
@@ -389,7 +389,7 @@ static int mtk_aic_init(struct mtk_cryp *cryp, int hw)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
/* Disable all interrupts and set initial configuration */
|
|
/* Disable all interrupts and set initial configuration */
|
|
- if (hw == RING_MAX) {
|
|
|
|
|
|
+ if (hw == MTK_RING_MAX) {
|
|
writel(0, cryp->base + AIC_G_ENABLE_CTRL);
|
|
writel(0, cryp->base + AIC_G_ENABLE_CTRL);
|
|
writel(0, cryp->base + AIC_G_POL_CTRL);
|
|
writel(0, cryp->base + AIC_G_POL_CTRL);
|
|
writel(0, cryp->base + AIC_G_TYPE_CTRL);
|
|
writel(0, cryp->base + AIC_G_TYPE_CTRL);
|
|
@@ -431,7 +431,7 @@ static void mtk_desc_dma_free(struct mtk_cryp *cryp)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < RING_MAX; i++) {
|
|
|
|
|
|
+ for (i = 0; i < MTK_RING_MAX; i++) {
|
|
dma_free_coherent(cryp->dev, MTK_DESC_RING_SZ,
|
|
dma_free_coherent(cryp->dev, MTK_DESC_RING_SZ,
|
|
cryp->ring[i]->res_base,
|
|
cryp->ring[i]->res_base,
|
|
cryp->ring[i]->res_dma);
|
|
cryp->ring[i]->res_dma);
|
|
@@ -447,7 +447,7 @@ static int mtk_desc_ring_alloc(struct mtk_cryp *cryp)
|
|
struct mtk_ring **ring = cryp->ring;
|
|
struct mtk_ring **ring = cryp->ring;
|
|
int i, err = ENOMEM;
|
|
int i, err = ENOMEM;
|
|
|
|
|
|
- for (i = 0; i < RING_MAX; i++) {
|
|
|
|
|
|
+ for (i = 0; i < MTK_RING_MAX; i++) {
|
|
ring[i] = kzalloc(sizeof(**ring), GFP_KERNEL);
|
|
ring[i] = kzalloc(sizeof(**ring), GFP_KERNEL);
|
|
if (!ring[i])
|
|
if (!ring[i])
|
|
goto err_cleanup;
|
|
goto err_cleanup;
|