Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp577937rwr; Thu, 27 Apr 2023 05:40:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6W4yRl7iPXN8ZaDe3KrhuIFoYKJR/wGdGONlsDZ/6zKgRFGbpjOpD+pLiw+kzPZ2gU1/gJ X-Received: by 2002:a05:6a00:478e:b0:638:abf4:d49c with SMTP id dh14-20020a056a00478e00b00638abf4d49cmr1994973pfb.3.1682599244830; Thu, 27 Apr 2023 05:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682599244; cv=none; d=google.com; s=arc-20160816; b=ROeKtB6vUHngDwjqCKX3zHWM0BrVt4+B2HORckbJR8DotOp/V9h/PNvN/99+JfFWqB pyb/A0hTehGom6faBQx5DAfJAWJFOl6MZ5XMjujseNgOxYBqWQfOhB8/rYliiFwuofUz eqnx+RoFQvo/vQu/9nzohEW7tFEYPIVwnswpcdaRQVCGL+XRSgr2pK35NfyXqW6QXRsE jWMW1jbTR0epG9iHIG16dtN3W8FKQQVqhp3Z2dGFH9Nhol2i8A3WybWGQPTkApxyB05A t5tDc997GMwK4/yfEzLygUrBksGudmVOzbYNJsvjvb2yq7+HKPJ6+U4IPioE7GcZXY02 2n1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=S6Q/VO/y6Fq41tZ4izLIBk5IF+y5iSwGGeoALfMszCI=; b=nKsJluDYN/97ZiN1Rc01UK7b22XCXA3UOvGwWqUwNPc5skS2A1NNc/6IZVbMO1aOnI rtbD8pPD0MepPTP/hjCmxh4PIc74e/QurKXSwmeIKmCxAYSagWHWZ82PyqNBedDlcV7F DOXv4Y8M0y6nt5W6icwFqfMS59eQ/hMrv9YBibKDRAZkJTPCHYvhSg6yYSlYZ1pOAIPR n/98pimlDFYkLPd6G2ADJlm9v6t5oCTDR2x/cBWehcQaKCBnJCKrFHcGTpEnwv0Cxv1p M26JbBysXb1tiZ4Wrw3BrsI90kxAyYidX33vr7d8ZTsQ/CrDJlFlvAbWxvzSV0vVX9zU oJyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=7SF3AaYc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p185-20020a6229c2000000b00640d9c06df3si8847390pfp.329.2023.04.27.05.40.33; Thu, 27 Apr 2023 05:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=7SF3AaYc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242986AbjD0Mdd (ORCPT + 99 others); Thu, 27 Apr 2023 08:33:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243201AbjD0Mdb (ORCPT ); Thu, 27 Apr 2023 08:33:31 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D00D4ECA for ; Thu, 27 Apr 2023 05:33:26 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-556f4e20131so17568977b3.1 for ; Thu, 27 Apr 2023 05:33:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1682598805; x=1685190805; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=S6Q/VO/y6Fq41tZ4izLIBk5IF+y5iSwGGeoALfMszCI=; b=7SF3AaYcSGoW/ypNoGCNNc3chh/C711C/2zAVabYkzWAjXS5uyIHJjMv2VhpJCI9gE Ry4FjZgURKjz7Orp7MNpjEeG+C+Ud35NeSimsViU8ifp/RZjHbUQoHR2KqcOcI73D27C KIMkrFI0jgZiBCRYSEOaW7GJo+hme96imkeLIPRGUp+zzoG9rX9fqexYwtdXAne8cxIY E1Izj/Lk3eB8spEO5RpQr2XxNYls/ajcmzrfrQCxYOUnjVzOsNkXQl5IPHQMp67aon4J 2LojHEtH9Nkvr90LmeyKmUEzS6yaQ5RN4fuDox9tgy4P5j5DVnHnggAWctFk9STKNJQG 0m0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682598805; x=1685190805; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S6Q/VO/y6Fq41tZ4izLIBk5IF+y5iSwGGeoALfMszCI=; b=cOWDzh4dzg59uzm4qavsaYpvzwfcNBUl6ZuDQNh+7BNaEPSV2VGMxgph0juKyot0RO vqgzdYHv5WMJ61r5afZvG07oGFkGC7AOGmBP3C+z8AHKacIcSLZmrAHO0UTILbujxXkS bEt/bxxuLRZxiLfecTRs4pqAIOI9TQe6kGgJe/B/6eN75oActiz+nbW/4ftwL70Zw1GF y8Qrxbf9Gt6yAThd89SAnvBTXEC3svixROZEnHzhyziDwUeiAMBxBUtbX03M3di89xob Sl3OoQUegmQqvzspIX/EdJu2kgzV84feY5fOXJ39qnDrpCuIQhy3Edlu2TfVGFjWDZyu kf2A== X-Gm-Message-State: AC+VfDzOSJBz8HmWGesA+15i2JhQfAwQThNOcrotcjtkIG5k12WImLyg yOCRR49hBJ+6H+XX1okBo6S6i0hEcHB5UA== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:725:b0:54f:bb71:c7b3 with SMTP id bt5-20020a05690c072500b0054fbb71c7b3mr997276ywb.9.1682598805726; Thu, 27 Apr 2023 05:33:25 -0700 (PDT) Date: Thu, 27 Apr 2023 12:33:10 +0000 In-Reply-To: <20230427123314.1997152-1-joychakr@google.com> Mime-Version: 1.0 References: <20230427123314.1997152-1-joychakr@google.com> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog Message-ID: <20230427123314.1997152-2-joychakr@google.com> Subject: [PATCH v9 1/5] spi: dw: Add 32 bpw support to SPI DW DMA driver From: Joy Chakraborty To: Serge Semin , Mark Brown , Andy Shevchenko Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add Support for AxSize = 4 bytes configuration from dw dma driver if n_bytes i.e. number of bytes per write to fifo is 4. Number of bytes written to fifo per write is depended on the bits/word configuration being used which the DW core driver translates to n_bytes. Hence, for bits per word values between 17 and 32 n_bytes should be equal to 4. Signed-off-by: Joy Chakraborty Reviewed-by: Serge Semin Tested-by: Serge Semin * tested on Baikal-T1 based system with DW SPI-looped back interface transferring a chunk of data with DFS:8,12,16. --- drivers/spi/spi-dw-dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index ababb910b391..c1b42cb59965 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -208,12 +208,16 @@ static bool dw_spi_can_dma(struct spi_controller *master, static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) { - if (n_bytes == 1) + switch (n_bytes) { + case 1: return DMA_SLAVE_BUSWIDTH_1_BYTE; - else if (n_bytes == 2) + case 2: return DMA_SLAVE_BUSWIDTH_2_BYTES; - - return DMA_SLAVE_BUSWIDTH_UNDEFINED; + case 4: + return DMA_SLAVE_BUSWIDTH_4_BYTES; + default: + return DMA_SLAVE_BUSWIDTH_UNDEFINED; + } } static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed) -- 2.40.1.495.gc816e09b53d-goog