kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: valdis.kletnieks@vt.edu (valdis.kletnieks at vt.edu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Why eeprom driver is read-only ?
Date: Mon, 19 Nov 2018 17:32:03 -0500	[thread overview]
Message-ID: <177621.1542666723@turing-police.cc.vt.edu> (raw)
In-Reply-To: <CAJ2oMhLXRqM6xR_FXD6ckX5D3m7iz2oeSd8B2qvZj8ka+oHMSA@mail.gmail.com>

On Tue, 20 Nov 2018 00:04:03 +0200, Ranran said:

> That's interesting...
> I think the name is confusing, because this chips are also writable.
>
> Not only this, but in arm the eeprom (at24) is writable!
> But in the x86 I am using, it is readonly in kernel code:
> https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/misc/eeprom/eeprom.c
> static struct bin_attribute eeprom_attr = {
> .attr = {
> .name = "eeprom",
> .mode = S_IRUGO,
> },
> .size = EEPROM_SIZE,
> .read = eeprom_read,
> };

Well, at least in the mainline kernel, we have this at the top of the eeprom.c file:

/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
                                        0x55, 0x56, 0x57, I2C_CLIENT_END };


/* Size of EEPROM in bytes */
#define EEPROM_SIZE             256

which is pretty obviously intended for "very small eeprom hanging off an I2C adapter",
and thus probably *NOT* the boot ROM that the BIOS lives in.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20181119/20996617/attachment.sig>

WARNING: multiple messages have this Message-ID (diff)
From: valdis.kletnieks@vt.edu
To: Ranran <ranshalit@gmail.com>
Cc: ruben@mrbrklyn.com, kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: Why eeprom driver is read-only ?
Date: Mon, 19 Nov 2018 17:32:03 -0500	[thread overview]
Message-ID: <177621.1542666723@turing-police.cc.vt.edu> (raw)
Message-ID: <20181119223203.W8LP1K8k281zA73RRZqVt_h6Rp1BTeXwn-7BagQhF-o@z> (raw)
In-Reply-To: <CAJ2oMhLXRqM6xR_FXD6ckX5D3m7iz2oeSd8B2qvZj8ka+oHMSA@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 993 bytes --]

On Tue, 20 Nov 2018 00:04:03 +0200, Ranran said:

> That's interesting...
> I think the name is confusing, because this chips are also writable.
>
> Not only this, but in arm the eeprom (at24) is writable!
> But in the x86 I am using, it is readonly in kernel code:
> https://android.googlesource.com/kernel/omap/+/glass-omap-xrr02/drivers/misc/eeprom/eeprom.c
> static struct bin_attribute eeprom_attr = {
> .attr = {
> .name = "eeprom",
> .mode = S_IRUGO,
> },
> .size = EEPROM_SIZE,
> .read = eeprom_read,
> };

Well, at least in the mainline kernel, we have this at the top of the eeprom.c file:

/* Addresses to scan */
static const unsigned short normal_i2c[] = { 0x50, 0x51, 0x52, 0x53, 0x54,
                                        0x55, 0x56, 0x57, I2C_CLIENT_END };


/* Size of EEPROM in bytes */
#define EEPROM_SIZE             256

which is pretty obviously intended for "very small eeprom hanging off an I2C adapter",
and thus probably *NOT* the boot ROM that the BIOS lives in.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 486 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  parent reply	other threads:[~2018-11-19 22:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19 12:08 Why eeprom driver is read-only ? Ranran
2018-11-19 12:08 ` Ranran
2018-11-19 13:12 ` Ruben Safir
2018-11-19 13:12   ` Ruben Safir
2018-11-19 13:48   ` Chriz Chow
2018-11-19 13:48     ` Chriz Chow
2018-11-19 22:04   ` Ranran
2018-11-19 22:04     ` Ranran
2018-11-19 22:32     ` valdis.kletnieks at vt.edu [this message]
2018-11-19 22:32       ` valdis.kletnieks
2018-11-20  6:44       ` Ranran
2018-11-20  6:44         ` Ranran
2018-11-19 14:07 ` valdis.kletnieks at vt.edu
2018-11-19 14:07   ` valdis.kletnieks

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=177621.1542666723@turing-police.cc.vt.edu \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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).