From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel@savoirfairelinux.com,
"David S. Miller" <davem@davemloft.net>,
Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [PATCH net-next v2 2/3] net: dsa: mv88e6xxx: rework EEPROM access
Date: Thu, 21 Jul 2016 02:43:07 +0200 [thread overview]
Message-ID: <20160721004307.GD22834@lunn.ch> (raw)
In-Reply-To: <20160720221836.28218-3-vivien.didelot@savoirfairelinux.com>
On Wed, Jul 20, 2016 at 06:18:35PM -0400, Vivien Didelot wrote:
> The 6352 family of switches and compatibles provide a 8-bit address and
> 16-bit data access to an optional EEPROM.
>
> Newer chip such as the 6390 family slightly changed the access to 16-bit
> address and 8-bit data.
>
> This commit cleans up the EEPROM access code for 16-bit access and makes
> it easy to eventually introduce future support for 8-bit access.
>
> Here's a list of notable changes brought by this patch:
>
> - provide Global2 unlocked helpers for EEPROM commands
> - remove eeprom_mutex, only reg_lock is necessary for driver functions
> - eeprom_len is 0 for chip without EEPROM, so return it directly
> - the Running bit must be 0 before r/w, so wait for Busy *and* Running
> - remove now unused mv88e6xxx_wait and mv88e6xxx_reg_write
> - other than that, the logic (in _{get,set}_eeprom16) didn't change
>
> Chips with an 8-bit EEPROM access will require to implement the
> 8-suffixed variant of G2 helpers and the related flag:
>
> #define MV88E6XXX_FLAGS_EEPROM8 \
> (MV88E6XXX_FLAG_G2_EEPROM_CMD | \
> MV88E6XXX_FLAG_G2_EEPROM_ADDR)
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
next prev parent reply other threads:[~2016-07-21 0:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-20 22:18 [PATCH net-next v2 0/3] net: dsa: mv88e6xxx: rework EEPROM code Vivien Didelot
2016-07-20 22:18 ` [PATCH net-next v2 1/3] net: dsa: mv88e6xxx: remove unused phy_mutex Vivien Didelot
2016-07-21 0:36 ` Andrew Lunn
2016-07-20 22:18 ` [PATCH net-next v2 2/3] net: dsa: mv88e6xxx: rework EEPROM access Vivien Didelot
2016-07-21 0:43 ` Andrew Lunn [this message]
2016-07-20 22:18 ` [PATCH net-next v2 3/3] net: dsa: mv88e6xxx: kill last locked reg_read Vivien Didelot
2016-07-21 0:44 ` Andrew Lunn
2016-07-21 4:11 ` [PATCH net-next v2 0/3] net: dsa: mv88e6xxx: rework EEPROM code David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160721004307.GD22834@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kernel@savoirfairelinux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).