From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephan Linz Date: Thu, 4 Mar 2004 09:48:12 +0100 Subject: [U-Boot-Users] Proposal to add "ispeed" (I2C speed) command In-Reply-To: <11176.216.110.51.8.1078335375.squirrel@www.orkun.us> References: <11176.216.110.51.8.1078335375.squirrel@www.orkun.us> Message-ID: <04030409481200.12732@pcj86> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tolunay, Am Mittwoch, 3. M?rz 2004 18:36 schrieb listmember at orkun.us: > We have some instrumentation hanging on I2C bus. I would like to introduce > a new u-boot command ispeed to set the i2c speed so fast devices would not > be constrained to the lowest denominator speed. Makes sense, but why do you need measuring datas in context of a bootloader ? > > If desired we can make be conditionally included if CONFIG_CMD_ISPEED > (suggestions?) so it would not take space when it is not needed (or > desired) on a particular board. The proposed syntax would be. > > ispeed {i2c bus speed} > > Since u-boot uses hex: 100kHz => 186A0, 400kHz => 61A80 Hm, I think you should expand the command syntax -- ex.: ispeed [i2c_bus_speed_in_hz] Without a argument 'ispeed' gets back the current setting. With an argument 'ispeed' converts the given string to ulong and setup the new speed. The argument can be a decimal integer, because simple_strtoul() from lib_generic/vsprintf.c understands base option 10. > I would also set an environment variable in ispeed command indicating > current i2c speed ("i2cspeed") so it could be used in scripts. Is it really needed ... I don't think so. You can read back the current setting with 'ispeed' and save the result into a environment variable of your choice. So you can use it again in another or the same script. Best Regards, Stephan Linz