Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3825111imm; Sat, 21 Jul 2018 04:10:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc/ZWKimB2wGh2O8gaGIqioNL1hAs5YFXhQ8OTB6B1z5/vAdG3GqF33+AVt7YIxRkBXqd/7 X-Received: by 2002:a63:4a07:: with SMTP id x7-v6mr5341576pga.34.1532171415165; Sat, 21 Jul 2018 04:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532171415; cv=none; d=google.com; s=arc-20160816; b=pYga0MpOjWsTnKcJE90bE+HuJtNsdb1HThzSh75LoWsd2gMAYOZKiuYrNthPiB5w+k oQolWYHOfAYzlE6wUiiDjFBT3TDeOkZZHveGLizA+Qa808HbCMkYnuKOZLGsxQ31JIVv OukfJvPefAjigRi0p5+DmagXxNUnFxeVYM6CYgZOyKD5bbQ2mPIUomz7bEGHYHYAnE6y e6y2hx+/nn+DpKb1KSK0xP0//VpBhWtKK+xZGvHurO5QUkK2t2LFvc07Gt674esAULxK J4P7vH/cJxULGThHMEhaKqcAKlZm+SYDB0oqzvu3W/IahIDiIck1q5EXOz4FDk/wVbL/ 8GcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=GGigVRljM3YICg0n3wEOEQ+zKhyB1T5rEZF84jaJ9z4=; b=dCJ23rxLW6/JLCZN/Pw6TtZWXISsFjB41GpBZnAo4SXQ4zCouuuIIAASdp/VWi643g gam63Kl+maG+8A2zwxn9VJFDd2Hx/azgO8SkPYiDJxd8A0hEsqpKKkfzuM0PrvEAqOEL c/kmyX/m03bRT+DH/FJvAEBmfvoBpQ2ZEmk9I9u4Wu8H5LKSsqAonmGmJOLgRDKE8Onh E6Zn5t2M43skldt18mqvbypD4PePq//ioch+GINjXy5V/b7T9GKjPQHGGC5bAGMA8FCt M2Z5T6Vc1OCvzsKjqyD3gL+cCEFDeeNA0wFEgm254E6yd5ZeOYFO/60lOzgVv2trTM3K lR/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=v553SaQ1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l15-v6si3710798pgh.593.2018.07.21.04.10.00; Sat, 21 Jul 2018 04:10:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@crapouillou.net header.s=mail header.b=v553SaQ1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728322AbeGUMAN (ORCPT + 99 others); Sat, 21 Jul 2018 08:00:13 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:44658 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727500AbeGUMAL (ORCPT ); Sat, 21 Jul 2018 08:00:11 -0400 From: Paul Cercueil To: Vinod Koul , Rob Herring , Mark Rutland , Ralf Baechle , Paul Burton , James Hogan , Zubair Lutfullah Kakakhel Cc: Mathieu Malaterre , Daniel Silsby , Paul Cercueil , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: [PATCH v3 09/18] dmaengine: dma-jz4780: Add support for the JZ4725B SoC Date: Sat, 21 Jul 2018 13:06:34 +0200 Message-Id: <20180721110643.19624-10-paul@crapouillou.net> In-Reply-To: <20180721110643.19624-1-paul@crapouillou.net> References: <20180721110643.19624-1-paul@crapouillou.net> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1532171269; bh=GGigVRljM3YICg0n3wEOEQ+zKhyB1T5rEZF84jaJ9z4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=v553SaQ1ezWW7wYvwITvHsIlP45JFaYurg5PlX00jZgDyQk2nMF+t/8H+fGtLSvKQitNG8VlYFrvh8LVh/0BXWlb3s1Nz9drsW9CP8XsUmodDw7uaOyLwgBShmdEpJVzmrFuIYIHi+oqaem6MyeYPyiJ/wunZ55KnJy1kPdUwJ0= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The JZ4725B has one DMA core starring six DMA channels. As for the JZ4770, each DMA channel's clock can be enabled with a register write, the difference here being that once started, it is not possible to turn it off. Signed-off-by: Paul Cercueil Tested-by: Mathieu Malaterre Reviewed-by: PrasannaKumar Muralidharan --- drivers/dma/dma-jz4780.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) v2: - Add comments about channel enabling/disabling - The documentation update is now in patch 01/17 v3: No change diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c index 084d4023637e..88ce3f0157f6 100644 --- a/drivers/dma/dma-jz4780.c +++ b/drivers/dma/dma-jz4780.c @@ -136,6 +136,7 @@ struct jz4780_dma_chan { enum jz_version { ID_JZ4740, + ID_JZ4725B, ID_JZ4770, ID_JZ4780, }; @@ -209,8 +210,12 @@ static inline void jz4780_dma_ctrl_writel(struct jz4780_dma_dev *jzdma, static inline void jz4780_dma_chan_enable(struct jz4780_dma_dev *jzdma, unsigned int chn) { - if (jzdma->version == ID_JZ4770) + if (jzdma->version == ID_JZ4770) { jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKES, BIT(chn)); + } else if (jzdma->version == ID_JZ4725B) { + /* JZ4725B has no DCKES, it uses DCKE to enable channels */ + jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKE, BIT(chn)); + } } static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev *jzdma, @@ -218,6 +223,8 @@ static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev *jzdma, { if (jzdma->version == ID_JZ4770) jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKEC, BIT(chn)); + + /* On JZ4725B it is not possible to stop a DMA channel once enabled */ } static struct jz4780_dma_desc *jz4780_dma_desc_alloc( @@ -805,12 +812,14 @@ static struct dma_chan *jz4780_of_dma_xlate(struct of_phandle_args *dma_spec, static const struct jz4780_dma_soc_data jz4780_dma_soc_data[] = { [ID_JZ4740] = { .nb_channels = 6, .transfer_ord_max = 5, }, + [ID_JZ4725B] = { .nb_channels = 6, .transfer_ord_max = 5, }, [ID_JZ4770] = { .nb_channels = 6, .transfer_ord_max = 6, }, [ID_JZ4780] = { .nb_channels = 32, .transfer_ord_max = 7, }, }; static const struct of_device_id jz4780_dma_dt_match[] = { { .compatible = "ingenic,jz4740-dma", .data = (void *)ID_JZ4740 }, + { .compatible = "ingenic,jz4725b-dma", .data = (void *)ID_JZ4725B }, { .compatible = "ingenic,jz4770-dma", .data = (void *)ID_JZ4770 }, { .compatible = "ingenic,jz4780-dma", .data = (void *)ID_JZ4780 }, {}, -- 2.11.0