From owner-freebsd-mips@FreeBSD.ORG Thu May 5 01:44:36 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51489106566B for ; Thu, 5 May 2011 01:44:36 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0D7BD8FC13 for ; Thu, 5 May 2011 01:44:35 +0000 (UTC) Received: by yie12 with SMTP id 12so783858yie.13 for ; Wed, 04 May 2011 18:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=CH/vfwUNOul0V8npd7UNIoGeVt8/+m+G6npBYNcSFRw=; b=WZT2VhI/IORwEgEvnR1RO1d9996tOt9eq3/WwGm8n9K3ud28ppJC0hav9V8fAMfs1F KtyJMMt4ZWJWrEUfl8snjQ49iEBWG2qe+wsEtndB0wYtLaqwmE97aKYx012wGChsb0vf 8wHEzm+JKM8o37uiWrZiWDMKL/rZuuxa0emy0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=CcYrOCxXchMbKoxlJ951e6usUaw4bivj6Lm8vQRXku1QL3EZlusJ+AyuL5HtMAKF10 hYLrzf4wnp13Jb/NitXwzi9yO7U0jDI9LenWEBOMCaw4aq4Fb0wIdKrP1jZ6H9Ye4rjO CyWgrxAcmei8gx7v4hWcP3bsUNkuumBxhFFUc= MIME-Version: 1.0 Received: by 10.151.43.8 with SMTP id v8mr1635383ybj.296.1304559875237; Wed, 04 May 2011 18:44:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.151.109.2 with HTTP; Wed, 4 May 2011 18:44:35 -0700 (PDT) Date: Thu, 5 May 2011 09:44:35 +0800 X-Google-Sender-Auth: fQGr_rGVgBildfJirBPlCOjTRr0 Message-ID: From: Adrian Chadd To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: RFC: AHB handling for AR71xx/AR913x X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2011 01:44:36 -0000 Hi, Our AR71xx/AR913x SoC support doesn't have an explicit bus nexus for the atheros host bus (AHB), which various things hang off of. These things (the PCI bridge, USB, SPI and ethernet controllers on the AR71xx; the USB, SPI, ethernet, wireless MAC on the AR913x) currently directly connect to nexus0. Now, there's one case with the AR913x where this is a pain, and that's where a DDR flush should be done when IP2 is triggered. There's a similar case on the AR71xx/AR724x but currently the PCI and ethernet controllers do a DDR flush themselves. But there's no convenient place for this to occur for the AR913x wireless MAC (as it connects directly to nexus0). Additionally, according to the AR7100 datasheet, we should be tickling DDR_WB_FLUSH_USB (DDR_BASE+0xA4) after an ISR read. Our USB code doesn't currently handle that. (An aside note, the datasheet says that the DDR registers should be tickled twice, rather than the once we're doing it.) So I propose this: * create an AHB nexus, glued to nexus0; * glue the above devices to it rather than nexus0; * handle AHB errors in this nexus, to aid debugging; * call the relevant DDR flush for USB, PCI, WMAC, etc here That should tidy up all of the bus handling for these SoCs. What do people think? Thanks, Adrian