From owner-freebsd-mips@FreeBSD.ORG Tue Aug 17 16:21:09 2010 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 20A6C10656AE for ; Tue, 17 Aug 2010 16:21:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-gx0-f182.google.com (mail-gx0-f182.google.com [209.85.161.182]) by mx1.freebsd.org (Postfix) with ESMTP id D51D18FC19 for ; Tue, 17 Aug 2010 16:21:07 +0000 (UTC) Received: by gxk24 with SMTP id 24so3220259gxk.13 for ; Tue, 17 Aug 2010 09:21:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=YbUL5vCRaZUc+p63aO/CGj3heeILONBDCVe7uq1FH4I=; b=kbAt0N6xSnyEHWuf984+sHaF8C8uRwCrzpUoOJrYDW4chS2mWzVRgMc+pws3tJawmE sMXQaKCddXUbA95PD69/1XzO6Ybh/3Ub9JOI0/BLOSACExBXV1mlOsIHfm0thxJhNIm5 nhYUcGfXbrKgJ5YBY9xZ1rH1UiptiMpBdHO3U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=NXpsd7pbHlZa9TgONqa1mf9OwMd4WH1RMg6AF5xcfe224eeG937OtVkw0vNuk1GZ3V cyzTu73tOPP8OGx1BYgU18+zMYHoJMNNoQr/Cu+0zqzMK7RWVG75wux9ca78tEQGklE8 3B/qN16QuOPqrRYLRyeHTScfPd37I98pmyx2I= MIME-Version: 1.0 Received: by 10.100.10.9 with SMTP id 9mr2904367anj.110.1282062066872; Tue, 17 Aug 2010 09:21:06 -0700 (PDT) Received: by 10.101.90.18 with HTTP; Tue, 17 Aug 2010 09:21:06 -0700 (PDT) Date: Wed, 18 Aug 2010 00:21:06 +0800 Message-ID: From: Adrian Chadd To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: WIP: AR91XX (and AR724X, maybe) support 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: Tue, 17 Aug 2010 16:21:09 -0000 Hi everyone, I've purchased a TP-LINK TL-WR1043ND which has an AR9132 SoC (+ on-chip AR9100 11n) in it. I've begun porting AR91xx and AR724X support over from Linux. Sans USB support, the kernel boots to mountroot>. This (currently GPL-tainted, so don't commit it!) patch is against -head: http://people.freebsd.org/~adrian/rspro/ar91xx-support.1.diff The patch introduces a set of CPU operations which implement the main per-chip differences. The dmesg (without USB; so it doesn't panic early in startup): http://people.freebsd.org/~adrian/rspro/dmesg-TL-WR1943ND.txt USB panics shortly after probe: ehci0: at mem 0x1b000000-0x1bffffff irq 1 on nexus0 ehci0: [ITHREAD] usbus0: set host controller mode usbus0: EHCI version 0.42 Trap cause = 5 (address error (store) - kernel mode) [ thread pid 0 tid 100000 ] Stopped at generic_bs_w_4+0x4: sw a3,0(a1) I've tested this patch on my AR7161 (in the routerstation pro) and have booted it to multi-user mode. Platform stuff that needs doing: * Need to finish porting the AR91xx related stubs * Need to finish porting (but not test :/) the AR724X related stubs * The USB code panics, figure out what is missing there * Add stubs for USB DDR flushing (which aren't used at the moment, but I'll get to it) * Add a stub to control the peripherals currently controlled via GPIO pins. At least USB differs between the two. * Modify if_arge to use the cpu op struct to get and set the pll * Add in the WMAC specifics for the AR91xx * If I can find an AR724x, find the PCIe specifics General stuff: * Go digging through the rest of the Linux headers and figure out what other differences there are; implement those * Finish rewriting the GPL chunks that are left Board stuff: * Find the flash device details; modify the flash driver to support that * Find out why arge0/arge1 aren't being correctly probed (arge0 has no PHY; arge1 has a bogus MAC) and rectify the situation enough so one of the interfaces is usable Adrian