From owner-freebsd-ppc@FreeBSD.ORG Mon Apr 13 22:28:13 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 BF17EA38 for ; Mon, 13 Apr 2015 22:28:13 +0000 (UTC) Received: from mail-la0-x234.google.com (mail-la0-x234.google.com [IPv6:2a00:1450:4010:c03::234]) (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 4386023C for ; Mon, 13 Apr 2015 22:28:13 +0000 (UTC) Received: by laat2 with SMTP id t2so68876513laa.1 for ; Mon, 13 Apr 2015 15:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=oc9hREpdA6xM7WUiRslcaXCb5oaBVvpzFvDLlMSYMRg=; b=pxv7l0kiQ5VTl0dbcrFsGAVEIlTtSVR893JB2jQ6lgFc8vSaifmddieJ9jvyg20jUW KzhtP5BAyrPqkJCLL5NzoZI1RYQ8XilwPqA6efdqydgzQHjbNWt/fUfQpSTLwx2Ma3Qt eWwo9PJ+bMeR2TX0Ui8ZwhCnyrfsXsh+64vwBzMWktaIZuPqmFDXzGiSMIk3CAPm7Fk0 +1Ea1bC0+aFyrr8xlueGryFf00MUn0YEmkajS+xUqgteJc6lLQIdDQYM8z/5kd3U3BXJ cWqGe2VOvS3+C4K6P7YMvtLnfWnIU1SX7vKOi1jY4/Q9zf8/GSfGVwanXuDiqILChITR mN0g== MIME-Version: 1.0 X-Received: by 10.112.163.168 with SMTP id yj8mr14815635lbb.36.1428964091434; Mon, 13 Apr 2015 15:28:11 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.25.130.5 with HTTP; Mon, 13 Apr 2015 15:28:11 -0700 (PDT) Date: Mon, 13 Apr 2015 15:28:11 -0700 X-Google-Sender-Auth: IJZLL-Lcb-YQNI9w1rzbIdpv6wY Message-ID: Subject: Should the MPC8544 root complex really show up as a device? From: Justin Hibbits To: FreeBSD PowerPC ML Content-Type: text/plain; charset=UTF-8 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: Mon, 13 Apr 2015 22:28:13 -0000 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? I looked at pciconf -rb pci1:0:0:0 0x404, and the byte there (LTSSM) reads as 0x16, so I'm assuming that means there's a link on the other side (I haven't pulled the card to check if that becomes 0 once I pull it out yet). There's a comment in the Linux fsl_pci source saying that the root complex comes up with bogus resources, I don't know if that has something to do with it. The rb_pci from DD-WRT adds some extra stuff, but I don't think it's relevant to this. Thanks, Justin From owner-freebsd-ppc@FreeBSD.ORG Mon Apr 13 22:40:13 2015 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28B4FE02 for ; Mon, 13 Apr 2015 22:40:13 +0000 (UTC) Received: from mail.xcllnt.net (mail.xcllnt.net [50.0.150.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D018B3B9 for ; Mon, 13 Apr 2015 22:40:12 +0000 (UTC) Received: from [10.1.254.5] (69-12-170-18.dedicated.static.sonic.net [69.12.170.18]) (authenticated bits=0) by mail.xcllnt.net (8.14.9/8.14.9) with ESMTP id t3DMdrZG053870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 13 Apr 2015 15:39:54 -0700 (PDT) (envelope-from marcel@xcllnt.net) Subject: Re: Should the MPC8544 root complex really show up as a device? Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AC670492-680B-4AA4-9F81-8C95FA738B02"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.5b6 From: Marcel Moolenaar In-Reply-To: Date: Mon, 13 Apr 2015 15:39:46 -0700 Cc: FreeBSD PowerPC ML Message-Id: <6368B454-B882-4D0B-ACBE-02AE0F78D7C5@xcllnt.net> References: To: Justin Hibbits X-Mailer: Apple Mail (2.2098) 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: Mon, 13 Apr 2015 22:40:13 -0000 --Apple-Mail=_AC670492-680B-4AA4-9F81-8C95FA738B02 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Apr 13, 2015, at 3:28 PM, Justin Hibbits = wrote: >=20 > 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. =46rom 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 --Apple-Mail=_AC670492-680B-4AA4-9F81-8C95FA738B02 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJVLEWzAAoJEIda8t8f0tjj2iAQAII0nto3+Lz6pSo1ztBMjxE/ h0qtwgx5tuMTVkhjFHNIiaHY99/KBrdmq/OfH7NanL0zu0BpNV72tp24ub3++K/O CW6osYY5pZicP2nfKXec34cuNt8Vn1B4t17X3SjJ8JCwrtBEWis3LimDyNhL7nGv OaowkG7ldmznktESoNMQnwMAx+wV1CkWb5rynivq7dGO8RbqjZwFDiQuLaFiNZ61 JuoKlLX9B4sl8kq8ZNx3vRUuOFlccO6+pikeDOG7jkPhlQqev6RcdZw5hhXEKIO6 jj0H2+g5Fh362d/enKR+kK0LXTqFGxTe1DGbqQwaQsMmnxbe5SkwVY/g52SIycOH hfpDNhPuS+pcOLLmccJQNiY2esCkcLioTz4PnRmHysDikr9asRKWCcSL9l/HiaUx GnKv1zQWwpi+oobN1xb+0p/oIEXTLCfB3SXl8H4DlR7Slwv7TlUzQGSjy+GrXc15 SSRPAkANYOULjnRreSLM3h7eL//LfvzUY7tt/8iNYC61jQo2SSYq681ao/6pq17l oCxlUhmWg72iVmxipk+2g7Rjq3piKEZL/H/YepOZYVPdSYd1cuMc4i/tR8Faow0+ OFXM2w2trdDHGmVY/14ixZpwVLRQ2k3EdsQoHR8ctZCqMv5ofUtUtITRvmMguS2b bh9BpD9Qaih2apPFsQwI =LCqj -----END PGP SIGNATURE----- --Apple-Mail=_AC670492-680B-4AA4-9F81-8C95FA738B02-- From owner-freebsd-ppc@FreeBSD.ORG Wed Apr 15 17:17:48 2015 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A84CB2A for ; Wed, 15 Apr 2015 17:17:48 +0000 (UTC) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::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 8CAF3F20 for ; Wed, 15 Apr 2015 17:17:47 +0000 (UTC) Received: by lagv1 with SMTP id v1so37914147lag.3 for ; Wed, 15 Apr 2015 10:17:45 -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; bh=inOJF2xAZLzII9HYsr6L/EHSxblsSoyFdcKYx3dVAek=; b=xnQx9bR0lePBEdXPSWqG0572CMXv5PzTZ6wOwA9xvTOUG8IGU+YeoT3oiGxbTedy9A dc9c1DUQywhZ8BjNCXOWGxXc6B6Vlw64Sf64wUUuBWXdkHSUFMKaajCHyV/xd/kTD92C G76iAOn6oi2TjxNigN20qIpq+QBPyAmUPo9s+ML4gbj9UDOwUvgcMsPKpAgOHbqXB5W3 TZwwoWDvJ7n0hR1e0JXESQ3ufZI7Vbs2tWyphNVyyoIrlgwkUJRWkE2BI4wqecjEKR30 aOWX/+1Cfj+s7NRRkHAid7pABdIaw4mUd8XOpn7XzB3ZgHzXbED3t7TS8XXD0ozISuFi APzA== MIME-Version: 1.0 X-Received: by 10.112.125.167 with SMTP id mr7mr24891202lbb.106.1429118265565; Wed, 15 Apr 2015 10:17:45 -0700 (PDT) Sender: chmeeedalf@gmail.com Received: by 10.25.130.5 with HTTP; Wed, 15 Apr 2015 10:17:45 -0700 (PDT) In-Reply-To: <6368B454-B882-4D0B-ACBE-02AE0F78D7C5@xcllnt.net> References: <6368B454-B882-4D0B-ACBE-02AE0F78D7C5@xcllnt.net> Date: Wed, 15 Apr 2015 10:17:45 -0700 X-Google-Sender-Auth: Ti8ISUvxT8TamwbtOXrOjOlnLCE 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: multipart/mixed; boundary=089e012284ec8fc45a0513c68646 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: Wed, 15 Apr 2015 17:17:48 -0000 --089e012284ec8fc45a0513c68646 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, Apr 13, 2015 at 3:39 PM, Marcel Moolenaar wrote= : > >> On Apr 13, 2015, at 3:28 PM, Justin Hibbits wrot= e: >> >> 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 --089e012284ec8fc45a0513c68646 Content-Type: text/plain; charset=US-ASCII; name="pci_mpc85xx.diff" Content-Disposition: attachment; filename="pci_mpc85xx.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_i8izapb91 SW5kZXg6IHN5cy9wb3dlcnBjL21wYzg1eHgvcGNpX21wYzg1eHguYwo9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBz eXMvcG93ZXJwYy9tcGM4NXh4L3BjaV9tcGM4NXh4LmMJKHJldmlzaW9uIDI4MTU0MSkKKysrIHN5 cy9wb3dlcnBjL21wYzg1eHgvcGNpX21wYzg1eHguYwkod29ya2luZyBjb3B5KQpAQCAtMjY5LDYg KzI2OSw3IEBACiAKIAlpZiAoc2MtPnNjX3BjaWUpIHsKIAkJbHRzc20gPSBmc2xfcGNpYl9jZmdy ZWFkKHNjLCAwLCAwLCAwLCBQQ0lSX0xUU1NNLCAxKTsKKwkJcHJpbnRmKCJQQ0kgJWQ6IExUU1NN ID0gJXhcbiIsIGRldmljZV9nZXRfdW5pdChkZXYpLCBsdHNzbSk7CiAJCWlmIChsdHNzbSA8IExU U1NNX1NUQVRfTDApIHsKIAkJCWlmIChib290dmVyYm9zZSkKIAkJCQlwcmludGYoIlBDSSAlZDog bm8gUENJRSBsaW5rLCBza2lwcGluZ1xuIiwKQEAgLTQ0NSw2ICs0NDYsMTkgQEAKIAl9CiB9CiAK K3N0YXRpYyB2b2lkCitmc2xfcGNpYl9pbml0X2ZzbChzdHJ1Y3QgZnNsX3BjaWJfc29mdGMgKnNj L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fQlJJREdFX1BDSTsKKwkJCQlmc2xfcGNpYl93cml0ZV9jb25maWcoc2MtPnNj X2RldiwgYnVzLCBzbG90LCBmdW5jLCBQQ0lSX0NMQVNTLCBjbGFzcywgMSk7CisJCQkJZnNsX3Bj aWJfd3JpdGVfY29uZmlnKHNjLT5zY19kZXYsIGJ1cywgc2xvdCwgZnVuYywgUENJUl9TVUJDTEFT Uywgc3ViY2xhc3MsIDEpOworCQkJfQorCiAJCQkvKiBBbGxvdyBvbmx5IHByb3BlciBQQ0ktUENJ IGJyaWdlcyAqLwogCQkJaWYgKGNsYXNzICE9IFBDSUNfQlJJREdFKQogCQkJCWNvbnRpbnVlOwo= --089e012284ec8fc45a0513c68646-- 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 From owner-freebsd-ppc@FreeBSD.ORG Sat Apr 18 20:41:45 2015 Return-Path: Delivered-To: freebsd-ppc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 35BE4419 for ; Sat, 18 Apr 2015 20:41:45 +0000 (UTC) Received: from asp.reflexion.net (outbound-243.asp.reflexion.net [69.84.129.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2A2FEDB for ; Sat, 18 Apr 2015 20:41:43 +0000 (UTC) Received: (qmail 730 invoked from network); 18 Apr 2015 20:35:03 -0000 Received: from unknown (HELO rtc-sm-01.app.dca.reflexion.local) (10.81.150.1) by 0 (rfx-qmail) with SMTP; 18 Apr 2015 20:35:03 -0000 Received: by rtc-sm-01.app.dca.reflexion.local (Reflexion email security v7.51.0) with SMTP; Sat, 18 Apr 2015 16:35:03 -0400 (EDT) Received: (qmail 16224 invoked from network); 18 Apr 2015 20:35:02 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 18 Apr 2015 20:35:02 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id 5B468B1E001; Sat, 18 Apr 2015 13:34:58 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: Shorter version: -m elf32ppc_fbsd (and elf_i386_fbsd ?) vs. -Wl, -m, elf32ppc_fbsd problems (11.0-CURRENT and 10.1-STABLE) From: Mark Millard In-Reply-To: Date: Sat, 18 Apr 2015 13:35:01 -0700 Cc: freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: References: <0D8F0A9A-593E-4FEE-8F01-20799DE946B2@dsl-only.net> <7049E178-9FC8-4590-95AD-F80A2BBC3F01@dsl-only.net> To: Warner Losh X-Mailer: Apple Mail (2.2098) 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: Sat, 18 Apr 2015 20:41:45 -0000 [Looks like I'll soon be mostly suspending my FreeBSD explorations for a = notable time again. So this completes my notes for the subject and = related material. It includes only what I concluded should be changed.] The following are all appropriate Makefile.inc changes as far as I can = tell. The i386 case uses LD_FLAGS instead and is commented indicating = that it uses ${LD} directly and does not use ${CC}. So chaining it is = not appropriate. # svnlite diff sys/boot/ofw/Makefile.inc sys/boot/powerpc/Makefile.inc = sys/boot/uboot/Makefile.inc Index: sys/boot/ofw/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/ofw/Makefile.inc (revision 281630) +++ sys/boot/ofw/Makefile.inc (working copy) @@ -2,7 +2,7 @@ =20 .if ${MACHINE_ARCH} =3D=3D "powerpc64" CFLAGS+=3D -m32 -mcpu=3Dpowerpc -LDFLAGS+=3D -m elf32ppc_fbsd +LDFLAGS+=3D -Wl,-m -Wl,elf32ppc_fbsd .endif =20 .include "../Makefile.inc" Index: sys/boot/powerpc/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/powerpc/Makefile.inc (revision 281630) +++ sys/boot/powerpc/Makefile.inc (working copy) @@ -2,7 +2,7 @@ =20 .if ${MACHINE_ARCH} =3D=3D "powerpc64" CFLAGS+=3D -m32 -mcpu=3Dpowerpc -LDFLAGS+=3D -m elf32ppc_fbsd +LDFLAGS+=3D -Wl,-m -Wl,elf32ppc_fbsd .endif =20 .include "../Makefile.inc" Index: sys/boot/uboot/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- sys/boot/uboot/Makefile.inc (revision 281630) +++ sys/boot/uboot/Makefile.inc (working copy) @@ -2,7 +2,7 @@ =20 .if ${MACHINE_ARCH} =3D=3D "powerpc64" CFLAGS+=3D -m32 -mcpu=3Dpowerpc -LDFLAGS+=3D -m elf32ppc_fbsd +LDFLAGS+=3D -Wl,-m -Wl,elf32ppc_fbsd .endif =20 .include "../Makefile.inc" =3D=3D=3D Mark Millard markmi at dsl-only.net From owner-freebsd-ppc@FreeBSD.ORG Sat Apr 18 21:00:54 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 B873CB58 for ; Sat, 18 Apr 2015 21:00:54 +0000 (UTC) Received: from asp.reflexion.net (outbound-243.asp.reflexion.net [69.84.129.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 625B4108 for ; Sat, 18 Apr 2015 21:00:53 +0000 (UTC) Received: (qmail 24244 invoked from network); 18 Apr 2015 21:00:53 -0000 Received: from unknown (HELO mail-cs-02.app.dca.reflexion.local) (10.81.19.2) by 0 (rfx-qmail) with SMTP; 18 Apr 2015 21:00:53 -0000 Received: by mail-cs-02.app.dca.reflexion.local (Reflexion email security v7.51.0) with SMTP; Sat, 18 Apr 2015 17:00:53 -0400 (EDT) Received: (qmail 26693 invoked from network); 18 Apr 2015 21:00:52 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (DHE-RSA-AES256-SHA encrypted) SMTP; 18 Apr 2015 21:00:52 -0000 X-No-Relay: not in my network X-No-Relay: not in my network X-No-Relay: not in my network Received: from [192.168.1.8] (c-67-189-19-145.hsd1.or.comcast.net [67.189.19.145]) by iron2.pdx.net (Postfix) with ESMTPSA id 092AAB1E001; Sat, 18 Apr 2015 14:00:48 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: gcc-4.9.1/gcc/config/rs6000/freebsd64.h vs. FreeBSD's powerpc (non-64) L"..." and wchar_t (other gcc ports too?) From: Mark Millard In-Reply-To: <3734A273-6178-4AF5-B066-DEEB6CFC7F1C@dsl-only.net> Date: Sat, 18 Apr 2015 14:00:51 -0700 Cc: freebsd-toolchain@freebsd.org, FreeBSD PowerPC ML Content-Transfer-Encoding: quoted-printable Message-Id: <5994D629-964B-4394-B6DD-2C2D6907882F@dsl-only.net> References: <5B228278-A967-46D4-8F56-08E47008D009@dsl-only.net> <3734A273-6178-4AF5-B066-DEEB6CFC7F1C@dsl-only.net> To: freebsd-ports@freebsd.org X-Mailer: Apple Mail (2.2098) 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: Sat, 18 Apr 2015 21:00:54 -0000 [Looks like I'll soon be suspending my FreeBSD explorations for a time = again. So this completes my notes for the subject and related material.] Reminder of the "long int" issue in = gcc-4.9.1/gcc/config/rs6000/freebsd64.h that gets the wrong type for L" = . . . " notation for FreeBSD: > /* rs6000.h gets this wrong for FreeBSD. We use the GCC defaults = instead. */ > #undef WCHAR_TYPE > #define WCHAR_TYPE (TARGET_64BIT ? "int" : "long int") > #undef WCHAR_TYPE_SIZE > #define WCHAR_TYPE_SIZE 32 I did try changing my = /usr/obj/portswork/usr/ports/devel/powerpc64-gcc/work/gcc-4.9.1/gcc/config= /rs6000/freebsd64.h so that WCHAR_TYPE would always use "int" and = rebuilding powerpc64-gcc. With that I was able to compile lib32, no = longer having a bad type for the L prefix notation on string literals. So I expect that requesting a fix upstream and/or patching such files in = gcc ports that have such a "long int" for powerpc FreeBSD targets is = appropriate. Side note likely specific to my context in some way . . . Unfortunately that lib32 built did not mean that using it worked. A -g = -m32 compile/link of > int main() > { > return 0; > } produces something for which ./a.out segmentation faults in a way that = neither the system nor the port gdb can report on where. For now it looks like I'm not going to have the time to work on figuring = out any of the issues involved. =3D=3D=3D Mark Millard markmi at dsl-only.net