From patchwork Fri Jun 9 09:59:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 103447 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp127891qgd; Fri, 9 Jun 2017 03:00:00 -0700 (PDT) X-Received: by 10.98.58.217 with SMTP id v86mr17770733pfj.115.1497002400445; Fri, 09 Jun 2017 03:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497002400; cv=none; d=google.com; s=arc-20160816; b=r/gtn9Kdp9IIoP1rpuHTpiuKhV66qNtDzzNnrHu/mtNWsAn1SLXtJIN3deMgkgrMQD P81xLZGgt90kHUfgjIlj01uLqeOsAoIOJ4sVZw2ef2ivyFim49d5odgt3mALmVe3m33L pMI4s7BIk1EvR7t8VV2aWM2Dr7Mu8mA2oGEsvCXt3CCzf0lBPqm9VCAEQPlt8rnTfN/M 4mwbYB6ZqHe6cNZjChA2ouo9i8ZJecjRIql65aldwdQLyTjUBN+nzEenbj7CoHxMstON bzv6PPUPqYYYjV0HguOXwfAOvEcEyls/r5FRyIZcF4X5o2BsvnfqIiRV97NMWu3pyvLy /NbA== 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:arc-authentication-results; bh=v3Mfz9aUu+V9a6fs+DewXPhDFURlOGfJX9iZZ3STCvw=; b=F7uBIwDP/ZgmXBb61rYxvK5V3Vb+GnCgkL3z00VDeQ4XXoC+LloWTgClczzEcv3iiI APabnt25xwtAujW3J8CNrSE1utBiiynoLPoxfznfLfdrJK7GjqilFJG4A80sUtOOCFc8 bG4tTt33ZRid/y5BgpSCmn5hG50queCG+b864KvNyTAI7JpPTzK6D68TdDS2Ae4L2NXh tAgrUCfnJCrSuJFYJwRK9pSnndFmZe935vzNu0Szm8AoTx3LNAu4Bch5Y2SJ6TUl5t5E pwL6mXVIoB0yV8JKfG3aETXqxdz989i8UmupV38sWU7a+/HitRp0vINojaBebcXQKKQj HphQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si6673369pgs.309.2017.06.09.03.00.00; Fri, 09 Jun 2017 03:00:00 -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=@linaro.org; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbdFIJ7s (ORCPT + 25 others); Fri, 9 Jun 2017 05:59:48 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:33130 "EHLO mail-wr0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751519AbdFIJ7l (ORCPT ); Fri, 9 Jun 2017 05:59:41 -0400 Received: by mail-wr0-f173.google.com with SMTP id v104so28250732wrb.0 for ; Fri, 09 Jun 2017 02:59:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=v3Mfz9aUu+V9a6fs+DewXPhDFURlOGfJX9iZZ3STCvw=; b=Sekvv9RHmFrCuQtrTqIONjJzr+JM8VRkMCzHxdAbQ1Iu8jxSXcgv8dRO8f+HGChUFQ VMl1lpi0gOd54NYc+cnLWbLSJOLRGo5zkAC4Y9YmknmXTG14WqkjUmm76MWEB96uwIFh cDWHiwtqnpM2QW7UaOSHPs6OkSlJ4W7ULctNs= 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=v3Mfz9aUu+V9a6fs+DewXPhDFURlOGfJX9iZZ3STCvw=; b=FSo1iXZ143Yx9e45uN8R5QTz5S+A2qgo1PDPN4PB/N7gNZFZU+RdpXNUNK8y7/SIwq p6fC+3tQ2c/Ozt5hGpX7enlINhyfuA7v0W5eGJdnrni/RZpYPChqNIiHqtaMuYmw3v8W /aeCA+JnjQ+oalQzBt5Xhj661q5PYQs69UqfXjKE3yqE2ZSV4SHS+mKoUTI/d1mbvo7F ouEYLGWIc0QMo8MoJlkK59IZkHz/VhFNJ/UjXZZzzqfWhc3CzsllL+nlElBgXt2bAI/T 7imK3D7q39Aeyu0VUr/QMmsM+Gd/MFmPLCl7L8kD7If4jDB/kfbCY6UuryF9E/sUn2jv OoHw== X-Gm-Message-State: AODbwcDQEmgiduSJYucCLsXLsk5rX4IeGIyrMMvDme+9cuag9mJ/yMCo hxwcrDpiySV6UGk1 X-Received: by 10.223.131.166 with SMTP id 35mr3670351wre.161.1497002379976; Fri, 09 Jun 2017 02:59:39 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id g46sm1031207wrg.69.2017.06.09.02.59.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Jun 2017 02:59:39 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: srinivas.kandagatla@linaro.org, linux-kernel@vger.kernel.org, Oza Pawandeep , Scott Branden Subject: [PATCH 1/5] nvmem: correct Broadcom OTP controller driver writes Date: Fri, 9 Jun 2017 10:59:06 +0100 Message-Id: <20170609095910.4090-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170609095910.4090-1-srinivas.kandagatla@linaro.org> References: <20170609095910.4090-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oza Pawandeep - use data write offset to write otp data instead of read offset - use OTP program command 0x8 to write otp with ECC rather than just command 0xA without ECC Fixes: 9d59c6e8ae27 ("nvmem: Add the Broadcom OTP controller driver") Signed-off-by: Oza Pawandeep Signed-off-by: Scott Branden Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/bcm-ocotp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.11.0 diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index 646cadbf1f93..3c56e3b2bd65 100644 --- a/drivers/nvmem/bcm-ocotp.c +++ b/drivers/nvmem/bcm-ocotp.c @@ -34,7 +34,7 @@ #define OTPC_CMD_READ 0x0 #define OTPC_CMD_OTP_PROG_ENABLE 0x2 #define OTPC_CMD_OTP_PROG_DISABLE 0x3 -#define OTPC_CMD_PROGRAM 0xA +#define OTPC_CMD_PROGRAM 0x8 /* OTPC Status Bits */ #define OTPC_STAT_CMD_DONE BIT(1) @@ -209,7 +209,7 @@ static int bcm_otpc_write(void *context, unsigned int offset, void *val, set_command(priv->base, OTPC_CMD_PROGRAM); set_cpu_address(priv->base, address++); for (i = 0; i < priv->map->otpc_row_size; i++) { - writel(*buf, priv->base + priv->map->data_r_offset[i]); + writel(*buf, priv->base + priv->map->data_w_offset[i]); buf++; bytes_written += sizeof(*buf); }