From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rob Herring <robh@kernel.org>
Cc: Ivo Sieben <meltedpianoman@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Mark Rutland <mark.rutland@arm.com>,
Chris Wright <chrisw@sous-sol.org>,
Wolfram Sang <wsa@the-dreams.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] eeprom: at25: Add DT support for EEPROMs with odd address bits
Date: Tue, 5 Dec 2017 09:57:58 +0100 [thread overview]
Message-ID: <CAMuHMdUDPFhSwkHg2wm7yCNAfdUP8wAR9OXxbcu6SDhtZqe2+A@mail.gmail.com> (raw)
In-Reply-To: <20171204211705.543xjzvttbrt65pm@rob-hp-laptop>
Hi Rob,
On Mon, Dec 4, 2017 at 10:17 PM, Rob Herring <robh@kernel.org> wrote:
> On Mon, Dec 04, 2017 at 10:17:47AM +0100, Geert Uytterhoeven wrote:
>> On Thu, Nov 30, 2017 at 2:29 PM, Geert Uytterhoeven
>> <geert+renesas@glider.be> wrote:
>> > Certain EEPROMS have a size that is larger than the number of address
>> > bytes would allow, and store the MSB of the address in bit 3 of the
>> > instruction byte.
>> >
>> > This can be described in platform data using EE_INSTR_BIT3_IS_ADDR, or
>> > in DT using the obsolete legacy "at25,addr-mode" property.
>> > But currently there exists no non-deprecated way to describe this in DT.
>> >
>> > Hence extend the existing "address-width" DT property to allow
>> > specifying 9, 17, or 25 address bits, and enable support for that in the
>> > driver.
>> >
>> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> > ---
>> > EEPROMs using 9 address bits are common (e.g. M95040, 25AA040/25LC040).
>> > Do EEPROMs using 17 or 25 address bits, as mentioned in
>> > include/linux/spi/eeprom.h, really exist?
>> > Or should we just limit it to a single odd value (9 bits)?
>>
>> At least for the real Atmel parts, only the AT25040 part uses odd (8 +
>> 1 bit) addressing.
>
> Seems like we should have a specific compatible for it.
Possibly. But currently all configuration is done through DT properties, not
through matching on compatible values.
>> AT25M01 uses 3-byte addressing (it needs 17 bits).
>
> Do you need to know it is 17-bit vs. 24-bits? I'm guessing not as the
> unused bits are probably don't care.
The 17 bits can be derived from the EEPROM size in bytes (1 Mb = 128 KiB).
What is important to know is how to pass addresses to the device:
1. 3 address bytes, OR
2. 2 address bytes, and the odd MSB bit in the command byte.
But apparently the second scheme is not used for 17-bit addressing.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
next prev parent reply other threads:[~2017-12-05 8:57 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-30 13:29 [PATCH 0/3] eeprom: at25: Add DT support for 25lc040 Geert Uytterhoeven
2017-11-30 13:29 ` [PATCH 1/3] eeprom: at25: Add DT support for EEPROMs with odd address bits Geert Uytterhoeven
2017-12-04 9:17 ` Geert Uytterhoeven
2017-12-04 21:17 ` Rob Herring
2017-12-05 8:57 ` Geert Uytterhoeven [this message]
[not found] ` <CAMuHMdUDPFhSwkHg2wm7yCNAfdUP8wAR9OXxbcu6SDhtZqe2+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-05 9:09 ` Geert Uytterhoeven
2017-12-05 13:56 ` Rob Herring
2017-12-05 14:01 ` Geert Uytterhoeven
[not found] ` <CAMuHMdWczQ0KiH7soGLKxX8CQEwxA=kVDc_saYqgytE2U_3WKw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-04 22:00 ` Ivo Sieben
2017-12-05 8:59 ` Geert Uytterhoeven
[not found] ` <1512048586-17534-1-git-send-email-geert+renesas-gXvu3+zWzMSzQB+pC5nmwQ@public.gmane.org>
2017-11-30 13:29 ` [PATCH 2/3] dt-bindings: eeprom: at25: Grammar s/are can/can/ Geert Uytterhoeven
2017-12-04 21:22 ` [PATCH 0/3] eeprom: at25: Add DT support for 25lc040 Rob Herring
2017-12-05 9:04 ` Geert Uytterhoeven
2017-12-06 21:12 ` Rob Herring
2017-11-30 13:29 ` [PATCH 3/3] dt-bindings: eeprom: at25: Document device-specific compatible values Geert Uytterhoeven
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=CAMuHMdUDPFhSwkHg2wm7yCNAfdUP8wAR9OXxbcu6SDhtZqe2+A@mail.gmail.com \
--to=geert@linux-m68k.org \
--cc=arnd@arndb.de \
--cc=chrisw@sous-sol.org \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=meltedpianoman@gmail.com \
--cc=robh@kernel.org \
--cc=wsa@the-dreams.de \
/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).