Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2902810ybz; Sun, 19 Apr 2020 12:29:58 -0700 (PDT) X-Google-Smtp-Source: APiQypKwHkpIJVJ1mu6sdhjYutOvQALYuSZ0cmDaeM1c3nOWUQECZu9pRzWDp+FNSYqArKawXhtF X-Received: by 2002:a17:907:2098:: with SMTP id pv24mr13045467ejb.22.1587324597880; Sun, 19 Apr 2020 12:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587324597; cv=none; d=google.com; s=arc-20160816; b=v/ZZmhhwnHPrWNcLOozYWTwXbNrfSCN+2u9AuYH0NQOosfMk8R6yC/P60neHGILRHF dfb80AI5K3sHusBxQimnBdbExFnwLvuIdQdp8EbUFPcNt5Lq2BLcBeo7rEBn8r+bGqJi NIiYNitGzoWwqxWUCEZ3Q+8D09/GsvwbI635RpL4QBpvs9NKwZFczAP20Hyh3gtPsaWS yhIkYETnbgQOM88YQ3HJRcjMxvIl9EGaHCCOSyfsal4NJbzof/3EZtX3kUhCDiLEcpBW 5adCZjEJBROvD0UIpXtpeZy1RexsCyOhRYZHbct+q1lEAULta3Bm+axvkkBHWKhSWcnD vrlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=pMhdquAr/HzwmzyKmiKytwMMb3XOVcxGDwBpxb4EVIg=; b=GmjZjk70hg+Rjns8YDKrJJE1Nuvgonvs1DEQBLoK7zlkNmcG9cumAimsdeR7tuVuMY KH0AWpWZ+taSoKZRFtsOz/uZ7jQQst68mHCZOLbzcnNo7vWSuwvzLZPwEW+m05q+Cack tkTPWNOEtmbLG4CttBis91DXW8Hr1a7zuvgeE6Ciae6DWt5+7+CKAMfKz/STTzIA9hf0 40JekDWZgzj52C1FUr3HGXtoEKb2fjzw8RV7E1UhU4ryHIw0etCdb/w1hffDE2oI8FGP AHKZGy+WbVZjZkpa+P/jxpXOwTM4NBdjJVzvWqL0RzwDPwGx2Rrd81ZfXz/x0k6auWot QZcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UlBQrYXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g15si18507282eje.418.2020.04.19.12.29.35; Sun, 19 Apr 2020 12:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UlBQrYXL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbgDST0r (ORCPT + 99 others); Sun, 19 Apr 2020 15:26:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbgDST0p (ORCPT ); Sun, 19 Apr 2020 15:26:45 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09438C061A0C; Sun, 19 Apr 2020 12:26:45 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id a22so3464899pjk.5; Sun, 19 Apr 2020 12:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pMhdquAr/HzwmzyKmiKytwMMb3XOVcxGDwBpxb4EVIg=; b=UlBQrYXLrdkGZ0G70SpLh4Q4zMV+/d8t+uiaDHD9q4axnbr0qlg85uy/xlPPPGwg/K d9GWK1QnkWSDbYzAOGgD653D3GY/kVmCCFPmmnsmax3a+ntw2LoNSZMr6eM1RrfunqbQ oOXOrQ9VJUKrRmZgOeHr7hEUEDiP0UQnHseBgOcvdbP7wbOJN8Qj4p/OyQXzFiZPRQld WJH28TWhCGh/hYlE2n0e+sQp2jcczEzB8RpxsJQOKR/0CKZFKI2KyI86GeytmpGj63fg rvAIR5+l5gbk8IHMKqHD8egXd2ZtreQFjlaN2KMA/9lBXEo6Sa0JqAA5/ibOKZWgTAoQ JrAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pMhdquAr/HzwmzyKmiKytwMMb3XOVcxGDwBpxb4EVIg=; b=JF5HwfXQS+h5O+o7Qmrl5Duh0GxABFFYe4YeyKyYK9wbgtlH9catu/tfsnWHDSsHAE qtCggMuzlFOOXAjBL9S87WN3WXOaeUnod+viW+jUiuOrAYsOP8SmLczsduLimGwf7T05 +r9ziOjrp62XLoUL+hLvyeO5atyklcwBNdhaxmehA83/Upo7UWq1jcPC80E/hrx24SmW VKr/23aIVwy5JPcJP5mORkBtPr0VwE1Udv/0VS04UDQqfTvzcbPgqUST/S8ZPqchG8kY +cYErOMJ2gXNIe61FdzGIIhFra0AZdae1CNo5iCqS5uP2Nte6AcJsAIcnYMyn44D+EYS u7uQ== X-Gm-Message-State: AGi0PubW0e0VGpZhni/IZk2/nx1Y72ncdCr8rGZa1s0umqCrU/beBEAf j5FsJ4bFcuuY2LsXz/D2nJka8szDbt8= X-Received: by 2002:a17:90a:d3ca:: with SMTP id d10mr4836977pjw.24.1587324404651; Sun, 19 Apr 2020 12:26:44 -0700 (PDT) Received: from mail.broadcom.com ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id x16sm22724383pfm.146.2020.04.19.12.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Apr 2020 12:26:44 -0700 (PDT) From: Kamal Dasu To: Kamal Dasu , bcm-kernel-feedback-list@broadcom.com, Mark Brown Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Patch v2 9/9] spi: bcm-qspi: MSPI_SPCR0_MSB MSTR bit exists only on legacy controllers Date: Sun, 19 Apr 2020 15:23:38 -0400 Message-Id: <20200419192339.32023-10-kdasu.kdev@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200419192339.32023-1-kdasu.kdev@gmail.com> References: <20200419192339.32023-1-kdasu.kdev@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set MASTER bit on the MSPI_SPCR0_MSB only for legacy MSPI and HIF_MSPI controllers. Fixes: fa236a7ef240 ("spi: bcm-qspi: Add Broadcom MSPI driver") Signed-off-by: Kamal Dasu --- drivers/spi/spi-bcm-qspi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c index 99f2cfcbb50c..681d09085175 100644 --- a/drivers/spi/spi-bcm-qspi.c +++ b/drivers/spi/spi-bcm-qspi.c @@ -576,11 +576,17 @@ static void bcm_qspi_hw_set_parms(struct bcm_qspi *qspi, spcr = clamp_val(spbr, bcm_qspi_spbr_min(qspi), QSPI_SPBR_MAX); bcm_qspi_write(qspi, MSPI, MSPI_SPCR0_LSB, spcr); - spcr = MSPI_MASTER_BIT; + if (!qspi->mspi_maj_rev) + /* legacy controller */ + spcr = MSPI_MASTER_BIT; + else + spcr = 0; + /* for 16 bit the data should be zero */ if (xp->bits_per_word != 16) spcr |= xp->bits_per_word << 2; spcr |= xp->mode & 3; + bcm_qspi_write(qspi, MSPI, MSPI_SPCR0_MSB, spcr); if (bcm_qspi_has_fastbr(qspi)) { -- 2.17.1