From owner-freebsd-ppc@FreeBSD.ORG Thu Apr 16 05:52:57 2015 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3E0411 for ; Thu, 16 Apr 2015 05:52:57 +0000 (UTC) Received: from mail-qk0-x22e.google.com (mail-qk0-x22e.google.com [IPv6:2607:f8b0:400d:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5769FDE for ; Thu, 16 Apr 2015 05:52:56 +0000 (UTC) Received: by qkx62 with SMTP id 62so123301666qkx.0 for ; Wed, 15 Apr 2015 22:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=6kuwsZB7VbNImFYB2+7rOeJlJZiKRGw+AXEqCHlYw/0=; b=UkBPVk1z1sNihT51OPBepkJJdvsUFelIiX2x00q8OAjDK3Nexf1htkSQp04XKnzs30 yeDyjNDxDhhMo/xP7lQJEtJZMaKAkAw2iU4Iauqu5hFk+h+0q/fPL3PxppFaX/VumMcV 8+qYhSxXWV/PX4hfhj1gkW0cIqVWV1SpGMpTjsTPHEKdd6Z13n69FwdX3Zzs8C6nksek gm4xLYuqSJA5K3eK8+e4/ssuXn7LFxrdcolGxHuamolab0NuTCyPjeBjbEeGaXO5ZBpL PqmytmR8qRqDYnKFWT+ZfbhiWxo4vEdTwtwrgXAlFAjgLtZdZ4x5s+vt03eGksNoj4Cy rHPA== MIME-Version: 1.0 X-Received: by 10.55.20.30 with SMTP id e30mr49690039qkh.45.1429163576006; Wed, 15 Apr 2015 22:52:56 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.140.84.179 with HTTP; Wed, 15 Apr 2015 22:52:55 -0700 (PDT) In-Reply-To: References: <6368B454-B882-4D0B-ACBE-02AE0F78D7C5@xcllnt.net> Date: Wed, 15 Apr 2015 22:52:55 -0700 X-Google-Sender-Auth: CFrT4l7EaMvr_WDGIw_hiYQ3y-0 Message-ID: Subject: Re: Should the MPC8544 root complex really show up as a device? From: Justin Hibbits To: Marcel Moolenaar Cc: FreeBSD PowerPC ML Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-ppc@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting FreeBSD to the PowerPC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Apr 2015 05:52:57 -0000 On Wed, Apr 15, 2015 at 10:17 AM, Justin Hibbits wr= ote: > On Mon, Apr 13, 2015 at 3:39 PM, Marcel Moolenaar wro= te: >> >>> On Apr 13, 2015, at 3:28 PM, Justin Hibbits wro= te: >>> >>> I'm trying to get the mini-PCIe slot on my RouterBoard RB800 working, >>> and running into a snag. It works just fine in RouterOS (Linux), but >>> on FreeBSD, the card in the slot doesn't show up. From all my >>> Googling, it appears the slot should show up on PCIe controller 1, but >>> the only device that shows up is the root complex as 1/0:0:0, as type >>> Processor. Should this show up anyway? Shouldn't the device behind >>> it show up instead? >> >> The problem is that the device is flagged as a processor, not >> as a PCI bridge. That=E2=80=99s why it shows up and also why you don=E2= =80=99t >> find anything underneath. One way to fix it is by spoofing the >> device type in sys/powerpc/mpc85xx/pci_mpc85xx.c or otherwise >> by changing common PCI code to accept this device as a (host) >> bridge. >> >> HTH, >> >> -- >> Marcel Moolenaar >> marcel@xcllnt.net > > Thanks Marcel, > > I did try spoofing it in pci_mpc85xx.c, with the attached patch (patch > includes quite a bit of debug as well). The reference manual doesn't > indicate if the root complex appears on every controller, or just the > first (there are 3 PCIe controllers on the MPC8544, and only the first > has this device showing up). Maybe I'm missing something. This is > new to me, and PCI configuration has always baffled me. Trying to > read bus 1 on the controller (which is configured in the Second Bus > register), I only saw 0xff returned during probing in fsl_pcib_init(). > Been looking at the Linux driver for hints, but not a whole lot has > come from that. > > Unfortunately, the last couple days my RouterBoard has decided it > doesn't want to boot FreeBSD, so I have to debug that before I can > continue working on this, but PCI register 0x4B0 (CFG_READY) seems a > contender for needing initialized, although the documentation doesn't > indicate if it's only relevant for EP mode or also relevant for RC > mode. > > - Justin One thing I just discovered: Removing the card from the minipcie slot causes the Processor device to disappear. - Justin