From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5D9EC282C7 for ; Sat, 26 Jan 2019 17:35:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8A322218A2 for ; Sat, 26 Jan 2019 17:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726229AbfAZRfp (ORCPT ); Sat, 26 Jan 2019 12:35:45 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:55454 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726070AbfAZRfp (ORCPT ); Sat, 26 Jan 2019 12:35:45 -0500 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::bf5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id C9F3F14970A99; Sat, 26 Jan 2019 09:35:44 -0800 (PST) Date: Sat, 26 Jan 2019 09:35:44 -0800 (PST) Message-Id: <20190126.093544.1739344002260262403.davem@davemloft.net> To: Bryan.Whitehead@microchip.com Cc: netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: Re: [PATCH v2 net-next] lan743x: Provide Read/Write Access to on chip OTP From: David Miller In-Reply-To: <1548274727-23771-1-git-send-email-Bryan.Whitehead@microchip.com> References: <1548274727-23771-1-git-send-email-Bryan.Whitehead@microchip.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 26 Jan 2019 09:35:44 -0800 (PST) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bryan Whitehead Date: Wed, 23 Jan 2019 15:18:47 -0500 > The LAN743x includes on chip One-Time-Programmable (OTP) memory. > > This patch extends the ethtool EEPROM read/write interface to > access OTP memory space. > > The currently existing interface is limited, as it does not > allow OTP read, and OTP writes are restricted to > offset==0, length==512, and data[0]==0xF3. > > This patch removes these restrictions and adds a private flag > called OTP_ACCESS, which is used to switch between EEPROM, and > OTP modes. > > The private flag OTP_ACCESS is configurable through the > ethtool --set-priv-flags command. > And visible through the > ethtool --show-priv-flags command. > > By default OTP_ACCESS is false, and there for previously existing > EEPROM commands will work exactly the same. However now access to > OTP requires one extra step of setting OTP_ACCESS to true. This > flag controls the read, write, and length reporting, functions > of ethtool. > > EEPROM presence is not checked when setting or clearing this flag. > If the EEPROM is not present, the user, as before, will need to > diagnose that using existing read and write function of ethtool, > while OTP_ACCESS is false. > > Updates for V2: > Added comments as to why this patch is needed. > Added comments explaining that EEPROM presence is not check > when setting or clearing the OTP_ACCESS flag. > Added length checking to all otp/eeprom read/write functions. > > Signed-off-by: Bryan Whitehead Applied, thanks.