From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gOs5V-0001mj-Ao for kernelnewbies@kernelnewbies.org; Mon, 19 Nov 2018 17:32:13 -0500 Received: from mr3.cc.vt.edu (mr3.cc.vt.edu [IPv6:2607:b400:92:8500:0:7f:b804:6b0a]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id wAJMWBYh001979 for ; Mon, 19 Nov 2018 17:32:11 -0500 Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mr3.cc.vt.edu (8.14.7/8.14.7) with ESMTP id wAJMW67H031924 for ; Mon, 19 Nov 2018 17:32:11 -0500 Received: by mail-qk1-f197.google.com with SMTP id y83so71338129qka.7 for ; Mon, 19 Nov 2018 14:32:11 -0800 (PST) From: valdis.kletnieks@vt.edu To: Ranran Subject: Re: Why eeprom driver is read-only ? In-Reply-To: References: Mime-Version: 1.0 Date: Mon, 19 Nov 2018 17:32:03 -0500 Message-ID: <177621.1542666723@turing-police.cc.vt.edu> Cc: ruben@mrbrklyn.com, kernelnewbies List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============8287940227358608072==" Errors-To: kernelnewbies-bounces@kernelnewbies.org Message-ID: <20181119223203.W8LP1K8k281zA73RRZqVt_h6Rp1BTeXwn-7BagQhF-o@z> --===============8287940227358608072== Content-Type: multipart/signed; boundary="==_Exmh_1542666723_2755P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1542666723_2755P Content-Type: text/plain; charset=us-ascii 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. --==_Exmh_1542666723_2755P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQEVAwUBW/M5440DS38y7CIcAQLgWAf9H048Lojji7Oa1SUvJSxYidQhcIZLkzYa HJXiJ81K9ZbbQ2Dvi3jy9iSrhHiDtyo6IMEc9ll4nOJWW4t3GriDAcxYZoLuKE6J xlazcB2VdGuf2ompA0AUUDWkWvbvKTTE50Sjga/T+jLSMIuJhwykMXCWF7wIFaUv t9t9wGJltrktaNJGNB1ujrsrI9emdlf7++Xz22uuoEdf34XFi9hSvsCfuFZCWoYW X4wjzt6Zlfk7roOGRFPzDbBcEEABphbShnM4MD+vovZLReUOPu3Yuwm70icp6Td8 iSAAu3ZXW4O2pY5t8oODesHbPLDJefjowzmj2kCouz3tsQNG106ZOg== =16l3 -----END PGP SIGNATURE----- --==_Exmh_1542666723_2755P-- --===============8287940227358608072== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============8287940227358608072==--