From owner-freebsd-arm@FreeBSD.ORG Tue Aug 10 09:05:06 2010 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 732C71065675 for ; Tue, 10 Aug 2010 09:05:06 +0000 (UTC) (envelope-from mlfbsd@kanar.ci0.org) Received: from kanar.ci0.org (unknown [IPv6:2a01:e0b:1:50:40:63ff:feea:93a]) by mx1.freebsd.org (Postfix) with ESMTP id 1328D8FC1D for ; Tue, 10 Aug 2010 09:05:05 +0000 (UTC) Received: from kanar.ci0.org (pluxor@localhost [127.0.0.1]) by kanar.ci0.org (8.14.2/8.14.3) with ESMTP id o7A95XqL056986; Tue, 10 Aug 2010 11:05:33 +0200 (CEST) (envelope-from mlfbsd@kanar.ci0.org) Received: (from mlfbsd@localhost) by kanar.ci0.org (8.14.2/8.14.3/Submit) id o7A95Xop056985; Tue, 10 Aug 2010 11:05:33 +0200 (CEST) (envelope-from mlfbsd) Date: Tue, 10 Aug 2010 11:05:33 +0200 From: Olivier Houchard To: Ben Gray Message-ID: <20100810090533.GA56784@ci0.org> References: <4C607639.9050506@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C607639.9050506@gmail.com> User-Agent: Mutt/1.4.2.1i Cc: freebsd-arm@freebsd.org Subject: Re: OMAP3530 - Beagleboard and I2C problems X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2010 09:05:06 -0000 On Mon, Aug 09, 2010 at 10:42:17PM +0100, Ben Gray wrote: > Hi, > Hi Ben, > I've been working on a port of FreeBSD to Texas Instruments OMAP3530 > for a while now. I have the basic drivers, Clocks, MMC, DMA, GPIO's, > etc. The kernel is coming up, however it crashes with a seg fault when > starting the init process, this is probably caused by the hacks I had to > put in the pmap code to get it to work with ARMv7 MMU's, but that's an > email for another day. > That's great to hear ! How hackish is your work ? There's an ongoing work to support armv6/armv7, so maybe it's best to avoid duplicating efforts ? > The problem I'm currently having is with the I2C code and it is > perhaps highlighting a more fundamental problem with my port so far. > Currently I have an 'omap3' bus device, which is the parent for all the > other peripheral drivers (I2C, MMC, DMA, etc). These child bus drivers > are added during the attach call of the parent, but at that time IRQ's > are not enabled and nor is the system clocking code. So the problem I > have is that during the attach phase of the I2C device driver I want to > be able to send messages over the I2C bus, but my bus driver doesn't > work because IRQ's are still disabled. So what is the correct solution > for this? How do I delay device initialisation to after this? > If you need to do stuff once IRQ are enabled, you may try to use config_intrhook_establish(), that should do exactly what you need. Regards, Olivier