From owner-freebsd-embedded@FreeBSD.ORG Tue Nov 29 00:39:06 2011 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CAEC106566C for ; Tue, 29 Nov 2011 00:39:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3265C8FC13 for ; Tue, 29 Nov 2011 00:39:06 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so1937135vbb.13 for ; Mon, 28 Nov 2011 16:39:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=iFsHuT4ueoJga3QvAZNo7NaRLYtSQSz0sxSDV1jAfP0=; b=sKgkjE0NKkKnGrZ3Zkwf8EddHCXM9FsnnzaV+XlNStIPVDSNF/QZ4NjtbREcmaNXPZ 1K5gBMnsEbDABT4Sjrsi+YM0BMO/i5xStIns2h7T+5NDGN/hD4aBo7gitviiwQjRz6HK /+HLKLsTfBxHZTnfhIcpDTxXkH7TR+HESmhOs= MIME-Version: 1.0 Received: by 10.52.26.179 with SMTP id m19mr4934777vdg.95.1322527144302; Mon, 28 Nov 2011 16:39:04 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.186.74 with HTTP; Mon, 28 Nov 2011 16:39:04 -0800 (PST) In-Reply-To: <5483EFA1-9D7B-4EE6-B888-F024BD1FF3A5@lassitu.de> References: <68ABED76-CB1F-405A-8036-EC254F7511FA@lassitu.de> <3B3DB17D-BF87-40EE-B1C1-445F178E8844@lassitu.de> <5483EFA1-9D7B-4EE6-B888-F024BD1FF3A5@lassitu.de> Date: Tue, 29 Nov 2011 08:39:04 +0800 X-Google-Sender-Auth: 8ukuQ3E6IhEmSa_JZCe3wJiOu6g Message-ID: From: Adrian Chadd To: Stefan Bethke Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-embedded@freebsd.org Subject: Re: TL-WR1043: switch X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2011 00:39:06 -0000 It looks like the code hard-codes: #define SCL_PIN 0 /* gpiobus mapped pin 6 */ #define SDA_PIN 1 /* gpiobus mapped pin 7 */ You could add some printf()s to sys/mips/atheros/ar71xx_gpio.c and log which GPIO pins are being twiddled. That'd answer your question immediately. Are they around the correct way? The wiki says that pin 18 is data and pin 19 is clock, but gpioiic has clock as pin '0' and data as pin '1'. You could try swapping the values of SCL_PIN and SDA_PIN. Ideally the gpiobus assignment above should specify which pins are clock and data via hints, eg: hint.gpioiic.0.at="gpiobus0" hint.gpioiic.0.pins=0xc0000 # Which pin range is being requested; this is parsed by the code in gpiobus? hint.gpioiic.0.datapin=0 # Relative to the above pin set hint.gpioiic.0.clockpin=1 # Relative to the above pin set Adrian