NetBSD Problem Report #47977

From www@NetBSD.org  Sun Jun 30 14:51:07 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8087E7170F
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 30 Jun 2013 14:51:07 +0000 (UTC)
Message-Id: <20130630145106.46344717B9@mollari.NetBSD.org>
Date: Sun, 30 Jun 2013 14:51:06 +0000 (UTC)
From: tcort@netbsd.org
Reply-To: tcort@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: [PATCH] usr.sbin/i2cscan: support scans using only 1 byte reads
X-Send-Pr-Version: www-1.0

>Number:         47977
>Category:       bin
>Synopsis:       [PATCH] usr.sbin/i2cscan: support scans using only 1 byte reads
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jun 30 14:55:00 +0000 2013
>Closed-Date:    Wed Jul 10 15:21:11 +0000 2013
>Last-Modified:  Wed Jul 10 15:21:11 +0000 2013
>Originator:     Thomas Cort
>Release:        
>Organization:
>Environment:
>Description:
With some ARM SoCs, dm37xx (BeagleBoard-xM) for example, 0 byte writes (i.e. quick writes) on the i2c bus are not supported. With the dm37xx in particular, it treats an I2C_CNT value of 0 as 65536. The i2cscan program uses 0 byte writes to probe devices in almost all of the slave address ranges. The driver for the dm37xx (src/sys/arch/arm/omap/omap3_i2c.c) returns EINVAL when a zero byte write is attempted. This means that a lot of devices go undetected by i2cscan on boards that don't support 0 byte writes.
>How-To-Repeat:

>Fix:
The Linux equivalent of i2cscan (i2cdetect from i2c-tools) provides a '-r' command line option to scan using 1 byte reads. The patch linked to below enables similar functionality in i2cscan. The '-r' command line option will cause all probes to be 1 byte reads. There is a second patch to update the man page.

http://tomcort.com/netbsd/i2cscan.c.patch
http://tomcort.com/netbsd/i2cscan.8.patch

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: tcort@NetBSD.org
State-Changed-When: Wed, 10 Jul 2013 15:21:11 +0000
State-Changed-Why:
Change committed after review and OK from jmcneill@


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.