Message ID | 20191211132623.430-3-jagan@amarulasolutions.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBDW5YPXQKGQENYVW2ZA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id E3ACC3F076 for <linux-amarula@patchwork.amarulasolutions.com>; Wed, 11 Dec 2019 14:26:39 +0100 (CET) Received: by mail-pf1-f197.google.com with SMTP id q5sf2103733pfh.1 for <linux-amarula@patchwork.amarulasolutions.com>; Wed, 11 Dec 2019 05:26:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1576070798; cv=pass; d=google.com; s=arc-20160816; b=IVvsBGrNdf3IoWQM+xPSHIAqA/OGiq+xA/9C9XgoePjzLf7h/n+qO/gCnuQY4sEpNr 413EarzAukyvrlRE//07LgMPl5RvJSMiAoWSOPWqJZVWL3iMz9sTSxqvAbbRlt2nydHo a+tbwYsXOmbbPfmmZuHsqXII3grGuO+0iXgPhDSZdKfcqKPpt5ypKjUlBC05eP82ng7d L0xXbCWVwoH4w4x8VZR2tZAzs6CnFHtDtc+HNGzd0lMSN12ugp85/lGWrhRwlv87LT7n pmFS/zCISJ2cmP6zIbNolw8INj2ImAc3azGTCCOsdwiZKvz2RSebsy4AJrmj29CO/KP2 BxPA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=LojfZvEAPxS/F1Te301KH9sfXumd+nx4AgLEf5vePfI=; b=AsrFtnONmLXVO3Nua1BtuSa9IQ6GKcpgOjuyAUplQZ2+1T+s6CQgjE1KFVCBWlHKYa UeWR3bylBNVpJpd7EQmf5EhTXTEE1PO/9a+4PslexsYDH7zK4ARrxCUrmDXO2FPiOHp7 jv26H3lFZxTyHbbn2uGQteXYKSm2PDuk86cwdNiK/HuibAfadOxS94+OqFWwqS7O/rr4 81+nlzU/FELLQyN6iL7VYLN3vpmfX32v/4mcjqTdEugtIb3i9lm6E1jDmWN0dAsEuId/ ep9309UmDPbSzfn4QMREBowKsRSxpKsbkiQkGHbeUhgdV2qbBIj43JxunTq6Q4k70Za2 PPiw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+EFHP+d; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=LojfZvEAPxS/F1Te301KH9sfXumd+nx4AgLEf5vePfI=; b=PoddLqSh43ThPXBOb1nYWRXw9/PWVL7JScz5KLZdTTDLec1jFgVBcA+v3Nk7E8HuOF KXyMmZxWpe9xOeo2UXwJFQmP+PAUTiUA5iuV3O40XjXthR80Xi3Eil9TO1QBQ85mvw5H o9lP4D78fpUk1Wb4Fg12IWZVv6Gnoh9AmOods= 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:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=LojfZvEAPxS/F1Te301KH9sfXumd+nx4AgLEf5vePfI=; b=ZTBAxEPCCoUnqfvXENk+iDnx00/P+A5LlWj2ER2XEcpPnpZfls/V5c+QS4Zuz1l4vZ YKwdt9MTPdv0KKBX8wbw5q+jQ4BkBAQN3CYSvAYTTNaUfDGx3Hsg5BXYbWfTDkjW7zrX +K/4TJCvaI9qp20CFr8kBlheuIBaaiimDdb9IBfgnygyiwoHWATJuTpDzJdiBmuUMG4A xpX85zSsvE/4o7FSU3mwnEaJOa5koWq4IHylZBbnaEH9DyAbcGkY0XL8hpiEjpqJ9AQD vEjIQ0w+C2v8t4wDOxQ928MWMlzKz/V6+ZKWEWKEM29pJBOrhawy6zRWciStmFaDEFGV k/8w== X-Gm-Message-State: APjAAAWCM+nMS3LIxjlkm8Sxu9w+JhkUUWAhV2QAUe0jUesb/ZKHlB/Q Uj30rywdYdSUz7WFfuQyCeQd1UtG X-Google-Smtp-Source: APXvYqzxrYOp2XRlubRRoAyqli20IVZTv3BMleABFy1neuD5s8p24i5Fv3cxO8GW7iiwDaeZ957U0g== X-Received: by 2002:aa7:9f47:: with SMTP id h7mr3600593pfr.13.1576070798058; Wed, 11 Dec 2019 05:26:38 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:68cc:: with SMTP id k12ls527266pgt.15.gmail; Wed, 11 Dec 2019 05:26:37 -0800 (PST) X-Received: by 2002:a65:4206:: with SMTP id c6mr2501438pgq.46.1576070797524; Wed, 11 Dec 2019 05:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576070797; cv=none; d=google.com; s=arc-20160816; b=edel7ZD7uBcQwxjnETL+QTs4Qd6wWfsiuZzXcO0sDNVw0bE/hGYNJ9+4EGa8f0kZ0D DbAOqagN7ChCLf55kia3mY/D7h/xQ4kl/W7tWDQRpMkwxsXLip7X98ZnyE5tPU+xUpQ0 jsqDc+9NBMMWiqGeSOVokgTJj6VCiYr9dnkhOquMAABhK3zhbGbKU6+Al4KDpnvxIgP4 aWjIGJVVza5gGa/z7o4yFRFDh3uyI5C3W9IQjB71dl8s+rmkkAFy85tXp9d3zSbol+Vp xx6FYwnEa4o2l2IWMnfgbDra8hvj1xIfhdc4eIiYlljme1O/HBHByxhwWqmT22LRSjDh 7nDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=ObG5oFXVgbJieCK61dlo5Mt5bEHKF5QSUTpfYMRFq74=; b=YmCHOB2zCM7MOJNNAvuUlY6tmufu7nsw6qfKGck1qIFaKrxHdiZZM40scPRnByKsrS 6BaTaqBvDyqlZu5/RE/ZzeZAiL85yz2oWm23UDb/D1CYgpLPvksz2u0ucM/IJuHDj7ya +Tqvf6ys/ZotfNtFE8p+2NniIPpgo2HcooP6eTl/RxUbVDspODpT5ZZ8brxDpIHMNIqP 8Q4QXmXWHoDNeEYZYTxsJ8A2Ek3d/zhvSoI96Ll3lxOvsQpm57bg1GyuvRHE+uNun6Fv ysUpywQzkxMy14DtFQmZtnN5mmm6LaIap3rlHljbZANEpcYd0HBVoR1+nluQrsb43XYZ 63Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+EFHP+d; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id w23sor2453209pfn.6.2019.12.11.05.26.37 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Wed, 11 Dec 2019 05:26:37 -0800 (PST) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:aa7:9808:: with SMTP id e8mr3822249pfl.32.1576070797214; Wed, 11 Dec 2019 05:26:37 -0800 (PST) Received: from localhost.localdomain ([49.206.200.202]) by smtp.gmail.com with ESMTPSA id e23sm2716145pjt.23.2019.12.11.05.26.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Dec 2019 05:26:36 -0800 (PST) From: Jagan Teki <jagan@amarulasolutions.com> To: Simon Glass <sjg@chromium.org>, Kever Yang <kever.yang@rock-chips.com>, Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Cc: u-boot@lists.denx.de, linux-amarula <linux-amarula@amarulasolutions.com>, linux-rockchip@lists.infradead.org, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH 2/2] spi: rk_spi: Fix overflow max chunk size Date: Wed, 11 Dec 2019 18:56:23 +0530 Message-Id: <20191211132623.430-3-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 In-Reply-To: <20191211132623.430-1-jagan@amarulasolutions.com> References: <20191211132623.430-1-jagan@amarulasolutions.com> MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I+EFHP+d; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
Series |
|
Related |
show
|
diff --git a/drivers/spi/rk_spi.c b/drivers/spi/rk_spi.c index d9a310ce80..6059f2415a 100644 --- a/drivers/spi/rk_spi.c +++ b/drivers/spi/rk_spi.c @@ -367,7 +367,7 @@ static inline int rockchip_spi_16bit_reader(struct udevice *dev, * represented in CTRLR1. */ if (data && data->master_manages_fifo) - max_chunk_size = 0x10000; + max_chunk_size = 0xffff; // rockchip_spi_configure(dev, mode, size) rkspi_enable_chip(regs, false);
The max chunk size (in a single transaction) for the Rockchip SPI controller is 64Kframes (i.e. 0x10000 frames) of 8bit or 16bit frames and is encoded as (num_frames - 1) in CTRLR1. So the 0x10000 is offset value for 64K but the actual size value would be 'minus 1' from 0x10000. With the existing code of 0x10000 max chunk size leads to read failure when we try to read the flash with > 0x10000 size like, 1. sf read failure when with > 0x10000 2. Boot from SPI flash failed during spi_flash_read call in common/spl/spl_spi.c Observed and Tested in - Rockpro64 with Gigadevice flash - ROC-RK3399-PC with Winbond flash Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> --- drivers/spi/rk_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)