From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 14:37:21 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 65518755 for ; Sun, 29 Sep 2013 14:37:21 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 023A929A1 for ; Sun, 29 Sep 2013 14:37:20 +0000 (UTC) Received: by mail-wi0-f175.google.com with SMTP id ez12so2700128wid.2 for ; Sun, 29 Sep 2013 07:37:19 -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:content-type; bh=84SxJKIn6AX1X4Xb1BChmNDg7aEjgCq1rQ7G7BnE41E=; b=QIV4ygIyMHTmULSPcEgd5ynGiTcELbijgljGq966INgBPMuQpgDlI4FYeR38hy6HDL 2pPxMF66FZ8aQYYzlW2aJkqtRAFIAorOpZwOrOKDjpiX2Bfaa1E+Q0rXVaRg0FaHPdss uikY5JISQbHiGeYorTpsexr0aFLYkdKfQZjOfgq5LH/hyCVtUI233aMGEiIBzLjEyxpV V6DsfS6EwIdg07eUdJurJtEtHBvlYZFByViUfOyCZxRPRBtP/F430pqPk/VCIzvwWou/ Epy40OKmOsdSRKV1VGVdt3/9zGFjTYS8LGJ0KFR/DoxlLCE/5XIOCeYUYuCy/3K5el43 F4Eg== MIME-Version: 1.0 X-Received: by 10.180.10.136 with SMTP id i8mr10082747wib.46.1380465439393; Sun, 29 Sep 2013 07:37:19 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Sun, 29 Sep 2013 07:37:19 -0700 (PDT) In-Reply-To: References: Date: Sun, 29 Sep 2013 07:37:19 -0700 X-Google-Sender-Auth: fJvPXV9PRHC6wWHtSqHiYbw1Vbw Message-ID: Subject: Re: [rfc] mips74k/ar9344 support From: Adrian Chadd To: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 14:37:21 -0000 grr, wrong list. also, try this: http://people.freebsd.org/~adrian/mips/20130929-mips74k-2.diff -adrian ---------- Forwarded message ---------- From: Adrian Chadd Date: 29 September 2013 04:38 Subject: [rfc] mips74k/ar9344 support To: "freebsd-wireless@freebsd.org" Hi! Here's an initial hacked up patch to get the AR9344 to mountroot> . (Which isn't true - it panics due to missing PHY setup on if_arge; I'll fix that up soon.) http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff The specific changes: * add CPU_MIPS24KC and CPU_MIPS74KC * mips32r2 CPUs require an EHB as a hazard for things, rather than NOPs * mips74k cores have a different CCA (cache coherency attributes) than the default - I lifted this from the netbsd mips support. now, the ar71xx CPUs are all currently marked as CPU_MIPS4KC. I'll follow this up with a commit to change that. There may be things we can optimise in the CPU_MIPS24KC case. Warner and I have started talking about how to properly fix all of the hazard handling. We'll discuss that later. I'd like to commit this to -HEAD so people wishing to hack on mips74k platforms can do stuff. Does anyone have any issues with the above? Thanks, -adrian From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 14:43:39 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3A57C8EA for ; Sun, 29 Sep 2013 14:43:39 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ee0-f48.google.com (mail-ee0-f48.google.com [74.125.83.48]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C34A129ED for ; Sun, 29 Sep 2013 14:43:38 +0000 (UTC) Received: by mail-ee0-f48.google.com with SMTP id l10so2138332eei.35 for ; Sun, 29 Sep 2013 07:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=syyp7hjJSvIdj7+2lmuQtxfOQyd1eQSJkNt9WCwBJk8=; b=drbFZaxhvHXhLQa2L8ebqeWanMIVdeK2YkkVt/8Drg5Sh3fehgjN/3LGdbEt3A/Cvj 2LcqRZRPJrnJDzcOUJ/S4NRFVG0eWOaUcG8LMf3WvdyLuv7Y8IzN4syZyw880o02CL6/ fmQZvjCZlw6bmFhnjEq7Fgt/zwAVOLizDanBLPjjFEBeNVDEj6DWmm38zN3f3QL/wfTZ H6o+cwikj32XnJJm02neqv7RvLz+Qg8rDa+pxByrnZBG4zmJH5v0qJZVBTa3HOT9h1Je oO+zXMyQckIq4XSH45HjP6nn7IlBijXTEprgLljYWhNjI/o1otI/sQKlzwF22bCHfDEL 4Eiw== X-Gm-Message-State: ALoCoQk3lY0DLo8aIJP86sgRRgvKmK14h/GLCHx3pkp4QB4bR9o/AO1frrBAPwH2TOEK7jObfsmo X-Received: by 10.15.64.1 with SMTP id n1mr29380040eex.15.1380465810696; Sun, 29 Sep 2013 07:43:30 -0700 (PDT) Received: from ?IPv6:2a02:dd0:3:100:129a:ddff:feb5:90b2? ([2a02:dd0:3:100:129a:ddff:feb5:90b2]) by mx.google.com with ESMTPSA id a6sm40081002eei.10.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Sep 2013 07:43:30 -0700 (PDT) Sender: Warner Losh Subject: Re: [rfc] mips74k/ar9344 support Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 29 Sep 2013 16:43:28 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <945A50E4-685D-4CC7-88B5-89278744E389@bsdimp.com> References: To: Adrian Chadd X-Mailer: Apple Mail (2.1085) Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 14:43:39 -0000 I'd be tempted to use 'sll zero, 3' instead of '.word 0xc0' and define a = macro for it. Why 'sll zero,3' instead of ehb? It allows us to use it on = older MIPS platforms as well... (because it will assemble in other = modes, not for binutils issues)... Speaking of which, I'd also change the last 'nop' on the HAZARD_DELAY = and ITLBNOPFIX to be 'sll zero, 3' as well. This will be an appropriate = nop on older kit, as well as 'fail safe' when someone starts to cope = with newer compilers. Ditto COP0_SYNC. On Sep 29, 2013, at 4:37 PM, Adrian Chadd wrote: > grr, wrong list. >=20 > also, try this: >=20 > = http://people.freebsd.org/~adrian/mips/20130929-mips74k-2.diff >=20 >=20 >=20 > -adrian >=20 > ---------- Forwarded message ---------- > From: Adrian Chadd > Date: 29 September 2013 04:38 > Subject: [rfc] mips74k/ar9344 support > To: "freebsd-wireless@freebsd.org" >=20 >=20 > Hi! >=20 > Here's an initial hacked up patch to get the AR9344 to mountroot> . >=20 > (Which isn't true - it panics due to missing PHY setup on if_arge; = I'll fix > that up soon.) >=20 > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff >=20 > The specific changes: >=20 > * add CPU_MIPS24KC and CPU_MIPS74KC > * mips32r2 CPUs require an EHB as a hazard for things, rather than = NOPs > * mips74k cores have a different CCA (cache coherency attributes) than = the > default - I lifted this from the netbsd mips support. >=20 > now, the ar71xx CPUs are all currently marked as CPU_MIPS4KC. I'll = follow > this up with a commit to change that. There may be things we can = optimise > in the CPU_MIPS24KC case. >=20 > Warner and I have started talking about how to properly fix all of the > hazard handling. We'll discuss that later. >=20 > I'd like to commit this to -HEAD so people wishing to hack on mips74k > platforms can do stuff. Does anyone have any issues with the above? >=20 > Thanks, >=20 >=20 >=20 > -adrian > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org" From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 14:50:34 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 09D0495E for ; Sun, 29 Sep 2013 14:50:34 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x235.google.com (mail-we0-x235.google.com [IPv6:2a00:1450:400c:c03::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 89D642A35 for ; Sun, 29 Sep 2013 14:50:33 +0000 (UTC) Received: by mail-we0-f181.google.com with SMTP id p61so4351460wes.26 for ; Sun, 29 Sep 2013 07:50:32 -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=tXZcc+0yjQn+UYr/bw4NK5sEwgdvZN2cE4wvPpHQye4=; b=xi9RYd5mSdS64wZyORbpQjcee1DXQtjUVTd+x5kGFcijgvjDJ6EDI1yRJq8IJ0uVU5 4NGP3jLUxQ1NlPPz7eQC3rZEqDPA2eonubFcTUNFR7ceDbq2NKVJr/V1d2SaLtcBDalL cM01eynXlBEMD89YejAORYp3Usr1YeishvxXbcROd31mEjVbhiLmpHp8FoR05/ZPshhJ CywlacQSegDgK+zgMhLM7wqLxfoj3t0z68Aqs4lg2r3hQtnx0MwTtZtIvqnaZg57ECzg 8n6/TvDVTh2es/vPiWVw7rYz6F3N0QRo7tzUvN7pUeUL6HZPhsFfkguqVb+q5LpOenn/ bF/g== MIME-Version: 1.0 X-Received: by 10.180.109.132 with SMTP id hs4mr10112483wib.46.1380466231971; Sun, 29 Sep 2013 07:50:31 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Sun, 29 Sep 2013 07:50:31 -0700 (PDT) In-Reply-To: <945A50E4-685D-4CC7-88B5-89278744E389@bsdimp.com> References: <945A50E4-685D-4CC7-88B5-89278744E389@bsdimp.com> Date: Sun, 29 Sep 2013 07:50:31 -0700 X-Google-Sender-Auth: yBXlEMQ3UcrVe86Tnfh70nRKZ-w Message-ID: Subject: Re: [rfc] mips74k/ar9344 support From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 14:50:34 -0000 Hi, Right: http://people.freebsd.org/~adrian/mips/20130929-mips74k-3.diff -adrian On 29 September 2013 07:43, Warner Losh wrote: > I'd be tempted to use 'sll zero, 3' instead of '.word 0xc0' and define a > macro for it. Why 'sll zero,3' instead of ehb? It allows us to use it on > older MIPS platforms as well... (because it will assemble in other modes, > not for binutils issues)... > > Speaking of which, I'd also change the last 'nop' on the HAZARD_DELAY and > ITLBNOPFIX to be 'sll zero, 3' as well. This will be an appropriate nop on > older kit, as well as 'fail safe' when someone starts to cope with newer > compilers. Ditto COP0_SYNC. > > On Sep 29, 2013, at 4:37 PM, Adrian Chadd wrote: > > > grr, wrong list. > > > > also, try this: > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-2.diff< > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff> > > > > > > > > -adrian > > > > ---------- Forwarded message ---------- > > From: Adrian Chadd > > Date: 29 September 2013 04:38 > > Subject: [rfc] mips74k/ar9344 support > > To: "freebsd-wireless@freebsd.org" > > > > > > Hi! > > > > Here's an initial hacked up patch to get the AR9344 to mountroot> . > > > > (Which isn't true - it panics due to missing PHY setup on if_arge; I'll > fix > > that up soon.) > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff > > > > The specific changes: > > > > * add CPU_MIPS24KC and CPU_MIPS74KC > > * mips32r2 CPUs require an EHB as a hazard for things, rather than NOPs > > * mips74k cores have a different CCA (cache coherency attributes) than > the > > default - I lifted this from the netbsd mips support. > > > > now, the ar71xx CPUs are all currently marked as CPU_MIPS4KC. I'll follow > > this up with a commit to change that. There may be things we can optimise > > in the CPU_MIPS24KC case. > > > > Warner and I have started talking about how to properly fix all of the > > hazard handling. We'll discuss that later. > > > > I'd like to commit this to -HEAD so people wishing to hack on mips74k > > platforms can do stuff. Does anyone have any issues with the above? > > > > Thanks, > > > > > > > > -adrian > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > > From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 14:57:10 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 58211E3B for ; Sun, 29 Sep 2013 14:57:10 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ea0-f174.google.com (mail-ea0-f174.google.com [209.85.215.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E07312A76 for ; Sun, 29 Sep 2013 14:57:09 +0000 (UTC) Received: by mail-ea0-f174.google.com with SMTP id z15so2132588ead.19 for ; Sun, 29 Sep 2013 07:57:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=AqKP4pSOHVIoZGiC9XChgET6uqdnHKWyNy/qDQkQ+ME=; b=lgRvU30sUVaMGbHJynqFUOQjnQBSjp1QAYtnt6Q7CPbqTo/mo5XQpjMDsiSDk8Kac/ xwMlqKTpDqYZqfDP2YLXVn8xPltA6om5pLAyeaOykx5c6zxOG70i/Q6lOdpSSGzbTNf1 lJ9otQQ8fLHTjR/9DrAT1Qnd/BsWY8h0pn2j/R883k8JM3ZNFWBgqaHnAi3R6dMZdEM2 zybnrqpA/p6OgHbFB9Xfh+O4EsS3ov1t3gefi7ahIX1Cs9vj5AcgRZx+JVOTH6sf8yAF hEKM7iQUXQihmdbeD1BIVFH/3XfAl540QHweL+atpBTsdOHqRDZdksLQ2oSvs9Q7waLZ +Png== X-Gm-Message-State: ALoCoQklZXRA7HI4vnvIn+KiHHaN73yXipyers59v5o+yIowDfHXFhqq5vPKgqSKp8H3stq/rVrW X-Received: by 10.15.44.199 with SMTP id z47mr334889eev.64.1380466627942; Sun, 29 Sep 2013 07:57:07 -0700 (PDT) Received: from ?IPv6:2a02:dd0:3:100:129a:ddff:feb5:90b2? ([2a02:dd0:3:100:129a:ddff:feb5:90b2]) by mx.google.com with ESMTPSA id x47sm40155839eea.16.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Sep 2013 07:57:07 -0700 (PDT) Sender: Warner Losh Subject: Re: [rfc] mips74k/ar9344 support Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sun, 29 Sep 2013 16:57:04 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <945A50E4-685D-4CC7-88B5-89278744E389@bsdimp.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1085) Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 14:57:10 -0000 More comments: For COP0_HAZARD, I'd add a pointer to See Mips Run, 2nd Ed in a comment = on explaining why. You're also still using .word 0xc0 in cpuregs.h. Warner On Sep 29, 2013, at 4:50 PM, Adrian Chadd wrote: > Hi, >=20 > Right: >=20 > http://people.freebsd.org/~adrian/mips/20130929-mips74k-3.diff >=20 >=20 >=20 > -adrian >=20 >=20 >=20 > On 29 September 2013 07:43, Warner Losh wrote: > I'd be tempted to use 'sll zero, 3' instead of '.word 0xc0' and define = a macro for it. Why 'sll zero,3' instead of ehb? It allows us to use it = on older MIPS platforms as well... (because it will assemble in other = modes, not for binutils issues)... >=20 > Speaking of which, I'd also change the last 'nop' on the HAZARD_DELAY = and ITLBNOPFIX to be 'sll zero, 3' as well. This will be an appropriate = nop on older kit, as well as 'fail safe' when someone starts to cope = with newer compilers. Ditto COP0_SYNC. >=20 > On Sep 29, 2013, at 4:37 PM, Adrian Chadd wrote: >=20 > > grr, wrong list. > > > > also, try this: > > > > = http://people.freebsd.org/~adrian/mips/20130929-mips74k-2.diff > > > > > > > > -adrian > > > > ---------- Forwarded message ---------- > > From: Adrian Chadd > > Date: 29 September 2013 04:38 > > Subject: [rfc] mips74k/ar9344 support > > To: "freebsd-wireless@freebsd.org" > > > > > > Hi! > > > > Here's an initial hacked up patch to get the AR9344 to mountroot> . > > > > (Which isn't true - it panics due to missing PHY setup on if_arge; = I'll fix > > that up soon.) > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff > > > > The specific changes: > > > > * add CPU_MIPS24KC and CPU_MIPS74KC > > * mips32r2 CPUs require an EHB as a hazard for things, rather than = NOPs > > * mips74k cores have a different CCA (cache coherency attributes) = than the > > default - I lifted this from the netbsd mips support. > > > > now, the ar71xx CPUs are all currently marked as CPU_MIPS4KC. I'll = follow > > this up with a commit to change that. There may be things we can = optimise > > in the CPU_MIPS24KC case. > > > > Warner and I have started talking about how to properly fix all of = the > > hazard handling. We'll discuss that later. > > > > I'd like to commit this to -HEAD so people wishing to hack on = mips74k > > platforms can do stuff. Does anyone have any issues with the above? > > > > Thanks, > > > > > > > > -adrian > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org" >=20 >=20 From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 15:33:57 2013 Return-Path: Delivered-To: mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AA53C3EE for ; Sun, 29 Sep 2013 15:33:57 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 323D32BBB for ; Sun, 29 Sep 2013 15:33:56 +0000 (UTC) Received: by mail-ee0-f44.google.com with SMTP id b47so2170795eek.17 for ; Sun, 29 Sep 2013 08:33:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:subject:date:message-id :to:mime-version; bh=AFM2qEYuzCaBxC91y/cqGxYSyrkyJAWSgJENFt/rTZo=; b=C1dxvnz3MtTxK8B0eKIBfQtIshRmwlRdS8VNt7x6kRh33uPCkTaWXZKHn2l/osmpZz DqSUTs7C8NxA3Orn9Bztfpba3zmbHMky67kN234MM9wdIR8LihgsB08bUSHwN3tlOStq YwyECo6lINB/mBDxf0azWhI1ihzZIDYQjkS4Qt//Cz5rlu3MYYUTNCsuZ1Y7i0kSxouV 9Yaxj4N4tYPjMBWkg2VJihoClPbYson8T0/L+7wKZPAcUrAXk+6MwKI1iiJK+PR3vkum C0l813eCe90wxWM/WqUZcaKrStqzvsAzfVhAaTsikC44HjfoIAUH6yrVEwlXwH2LCimP tU2Q== X-Gm-Message-State: ALoCoQkfn6nbKRVl0w9AQyzvrmfn8YRbfyXVmbKSslxbMiGv8//o+xrTmm2Wihx+W4B7rZrGn7Or X-Received: by 10.15.67.131 with SMTP id u3mr28818561eex.34.1380465321022; Sun, 29 Sep 2013 07:35:21 -0700 (PDT) Received: from ?IPv6:2a02:dd0:3:100:129a:ddff:feb5:90b2? ([2a02:dd0:3:100:129a:ddff:feb5:90b2]) by mx.google.com with ESMTPSA id h45sm40048503eeg.5.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 29 Sep 2013 07:35:20 -0700 (PDT) Sender: Warner Losh From: Warner Losh Content-Type: multipart/mixed; boundary=Apple-Mail-4-578676191 Subject: Minor cleanup Date: Sun, 29 Sep 2013 16:35:18 +0200 Message-Id: <768FD7A4-CC9B-4034-8FAF-2C98A2095B6C@bsdimp.com> To: "freebsd-mips@FreeBSD.org" Mime-Version: 1.0 (Apple Message framework v1085) X-Mailer: Apple Mail (2.1085) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 15:33:57 -0000 --Apple-Mail-4-578676191 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Greetings, Looking for someone to review this minor cleanup on mips. I've moved a = few little things from asm.h, where they don't belong, into pcb.h where = they do. I've also moved a little duplication out of swtch.S and = exception.S into pcb.h. http://people.freebsd.org/~imp/mips-1.diff Warner --Apple-Mail-4-578676191 Content-Disposition: attachment; filename=mips-1.diff Content-Type: application/octet-stream; name="mips-1.diff" Content-Transfer-Encoding: 7bit Index: sys/mips/include/asm.h =================================================================== --- sys/mips/include/asm.h (revision 255930) +++ sys/mips/include/asm.h (working copy) @@ -262,38 +262,6 @@ .align 3 /* - * Call ast if required - * - * XXX Do we really need to disable interrupts? - */ -#define DO_AST \ -44: \ - mfc0 t0, MIPS_COP_0_STATUS ;\ - and a0, t0, MIPS_SR_INT_IE ;\ - xor t0, a0, t0 ;\ - mtc0 t0, MIPS_COP_0_STATUS ;\ - COP0_SYNC ;\ - GET_CPU_PCPU(s1) ;\ - PTR_L s3, PC_CURPCB(s1) ;\ - PTR_L s1, PC_CURTHREAD(s1) ;\ - lw s2, TD_FLAGS(s1) ;\ - li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ - and s2, s0 ;\ - mfc0 t0, MIPS_COP_0_STATUS ;\ - or t0, a0, t0 ;\ - mtc0 t0, MIPS_COP_0_STATUS ;\ - COP0_SYNC ;\ - beq s2, zero, 4f ;\ - nop ;\ - PTR_LA s0, _C_LABEL(ast) ;\ - jalr s0 ;\ - PTR_ADDU a0, s3, U_PCB_REGS ;\ - j 44b ;\ - nop ;\ -4: - - -/* * XXX retain dialects XXX */ #define ALEAF(x) XLEAF(x) Index: sys/mips/include/pcb.h =================================================================== --- sys/mips/include/pcb.h (revision 255930) +++ sys/mips/include/pcb.h (working copy) @@ -79,6 +79,56 @@ void makectx(struct trapframe *, struct pcb *); int savectx(struct pcb *) __returns_twice; + +/* + * Call ast if required + * + * XXX Do we really need to disable interrupts? + */ +#define DO_AST \ +44: \ + mfc0 t0, MIPS_COP_0_STATUS ;\ + and a0, t0, MIPS_SR_INT_IE ;\ + xor t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ + GET_CPU_PCPU(s1) ;\ + PTR_L s3, PC_CURPCB(s1) ;\ + PTR_L s1, PC_CURTHREAD(s1) ;\ + lw s2, TD_FLAGS(s1) ;\ + li s0, TDF_ASTPENDING | TDF_NEEDRESCHED;\ + and s2, s0 ;\ + mfc0 t0, MIPS_COP_0_STATUS ;\ + or t0, a0, t0 ;\ + mtc0 t0, MIPS_COP_0_STATUS ;\ + COP0_SYNC ;\ + beq s2, zero, 4f ;\ + nop ;\ + PTR_LA s0, _C_LABEL(ast) ;\ + jalr s0 ;\ + PTR_ADDU a0, s3, U_PCB_REGS ;\ + j 44b ;\ + nop ;\ +4: + +#define SAVE_U_PCB_REG(reg, offs, base) \ + REG_S reg, U_PCB_REGS + (SZREG * offs) (base) + +#define RESTORE_U_PCB_REG(reg, offs, base) \ + REG_L reg, U_PCB_REGS + (SZREG * offs) (base) + +#define SAVE_U_PCB_FPREG(reg, offs, base) \ + FP_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define RESTORE_U_PCB_FPREG(reg, offs, base) \ + FP_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define SAVE_U_PCB_FPSR(reg, offs, base) \ + REG_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + +#define RESTORE_U_PCB_FPSR(reg, offs, base) \ + REG_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) + #endif #endif Index: sys/mips/mips/exception.S =================================================================== --- sys/mips/mips/exception.S (revision 255930) +++ sys/mips/mips/exception.S (working copy) @@ -61,6 +61,7 @@ #include #include #include +#include #include "assym.s" @@ -411,12 +412,6 @@ END(MipsKernGenException) -#define SAVE_U_PCB_REG(reg, offs, base) \ - REG_S reg, U_PCB_REGS + (SZREG * offs) (base) - -#define RESTORE_U_PCB_REG(reg, offs, base) \ - REG_L reg, U_PCB_REGS + (SZREG * offs) (base) - /*---------------------------------------------------------------------------- * * MipsUserGenException -- Index: sys/mips/mips/swtch.S =================================================================== --- sys/mips/mips/swtch.S (revision 255930) +++ sys/mips/mips/swtch.S (working copy) @@ -68,31 +68,6 @@ .set noreorder # Noreorder is default style! -#define SAVE_U_PCB_REG(reg, offs, base) \ - REG_S reg, U_PCB_REGS + (SZREG * offs) (base) - -#define RESTORE_U_PCB_REG(reg, offs, base) \ - REG_L reg, U_PCB_REGS + (SZREG * offs) (base) - -#define SAVE_U_PCB_FPREG(reg, offs, base) \ - FP_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define RESTORE_U_PCB_FPREG(reg, offs, base) \ - FP_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define SAVE_U_PCB_FPSR(reg, offs, base) \ - REG_S reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define RESTORE_U_PCB_FPSR(reg, offs, base) \ - REG_L reg, U_PCB_FPREGS + (SZFPREG * offs) (base) - -#define SAVE_U_PCB_CONTEXT(reg, offs, base) \ - REG_S reg, U_PCB_CONTEXT + (SZREG * offs) (base) - -#define RESTORE_U_PCB_CONTEXT(reg, offs, base) \ - REG_L reg, U_PCB_CONTEXT + (SZREG * offs) (base) - - /* * Setup for and return to user. */ --Apple-Mail-4-578676191-- From owner-freebsd-mips@FreeBSD.ORG Sun Sep 29 15:54:38 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 3AC685D3 for ; Sun, 29 Sep 2013 15:54:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wg0-x233.google.com (mail-wg0-x233.google.com [IPv6:2a00:1450:400c:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B94292C5C for ; Sun, 29 Sep 2013 15:54:37 +0000 (UTC) Received: by mail-wg0-f51.google.com with SMTP id c11so4503553wgh.6 for ; Sun, 29 Sep 2013 08:54:36 -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=UTqGrigzTDCK8c4Wya4Pg5w3bFCH/UF7VSB8+0aDTDY=; b=SI3SkF2nHaDw+ovpvszFcn5U7BglaZxfw7wQ6zgmYk+pQCvcElndklJHO9azmtfU6U dOYHYbaM+8E8TfoJNPATiYmOOooYAwyDfZMItp29brIubSYpJgZpM9LaeHQwQu7OuLOr i19Hi2XJOyIenD5NHp3WZKZ9HalgwjbgcZ/3LMl4t/KZz5OafCBWImIdS73OZIt94vca kM+9u0rhb1sP79rzgBMy0D5nkf7H8ziAWSWDgyLHy/5GzlCO3KWe1CB7Q9VV2bgTMHQy 7Tmm92+iSeLZAza1yzPlmKA5Ywsb/liDXGv/UPEBO2tLKrae7Q5Hh01duuHa9oCDi5nt JtIA== MIME-Version: 1.0 X-Received: by 10.180.109.132 with SMTP id hs4mr10267936wib.46.1380470076023; Sun, 29 Sep 2013 08:54:36 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Sun, 29 Sep 2013 08:54:35 -0700 (PDT) In-Reply-To: References: <945A50E4-685D-4CC7-88B5-89278744E389@bsdimp.com> Date: Sun, 29 Sep 2013 08:54:35 -0700 X-Google-Sender-Auth: BbENG0yzOoenmpp_mMcCRTE9_R8 Message-ID: Subject: Re: [rfc] mips74k/ar9344 support From: Adrian Chadd To: Warner Losh Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2013 15:54:38 -0000 Hi, http://people.freebsd.org/~adrian/mips/20130929-mips74k-4.diff It turns out that with the XSTRING() stuff going on with COP0_SYNC, we can't just put "sll zero,zero,3" in. It complains. So, use .word 0xc0 for now. Next, it exposed elf_trampoline.c - opt_global.h should be included before the cpu register stuff. -adrian On 29 September 2013 07:57, Warner Losh wrote: > More comments: > > For COP0_HAZARD, I'd add a pointer to See Mips Run, 2nd Ed in a comment on > explaining why. > > You're also still using .word 0xc0 in cpuregs.h. > > Warner > > On Sep 29, 2013, at 4:50 PM, Adrian Chadd wrote: > > > Hi, > > > > Right: > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-3.diff > > > > > > > > -adrian > > > > > > > > On 29 September 2013 07:43, Warner Losh wrote: > > I'd be tempted to use 'sll zero, 3' instead of '.word 0xc0' and define a > macro for it. Why 'sll zero,3' instead of ehb? It allows us to use it on > older MIPS platforms as well... (because it will assemble in other modes, > not for binutils issues)... > > > > Speaking of which, I'd also change the last 'nop' on the HAZARD_DELAY > and ITLBNOPFIX to be 'sll zero, 3' as well. This will be an appropriate nop > on older kit, as well as 'fail safe' when someone starts to cope with newer > compilers. Ditto COP0_SYNC. > > > > On Sep 29, 2013, at 4:37 PM, Adrian Chadd wrote: > > > > > grr, wrong list. > > > > > > also, try this: > > > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-2.diff< > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff> > > > > > > > > > > > > -adrian > > > > > > ---------- Forwarded message ---------- > > > From: Adrian Chadd > > > Date: 29 September 2013 04:38 > > > Subject: [rfc] mips74k/ar9344 support > > > To: "freebsd-wireless@freebsd.org" > > > > > > > > > Hi! > > > > > > Here's an initial hacked up patch to get the AR9344 to mountroot> . > > > > > > (Which isn't true - it panics due to missing PHY setup on if_arge; > I'll fix > > > that up soon.) > > > > > > http://people.freebsd.org/~adrian/mips/20130929-mips74k-1.diff > > > > > > The specific changes: > > > > > > * add CPU_MIPS24KC and CPU_MIPS74KC > > > * mips32r2 CPUs require an EHB as a hazard for things, rather than NOPs > > > * mips74k cores have a different CCA (cache coherency attributes) than > the > > > default - I lifted this from the netbsd mips support. > > > > > > now, the ar71xx CPUs are all currently marked as CPU_MIPS4KC. I'll > follow > > > this up with a commit to change that. There may be things we can > optimise > > > in the CPU_MIPS24KC case. > > > > > > Warner and I have started talking about how to properly fix all of the > > > hazard handling. We'll discuss that later. > > > > > > I'd like to commit this to -HEAD so people wishing to hack on mips74k > > > platforms can do stuff. Does anyone have any issues with the above? > > > > > > Thanks, > > > > > > > > > > > > -adrian > > > _______________________________________________ > > > freebsd-mips@freebsd.org mailing list > > > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > > > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org > " > > > > > > From owner-freebsd-mips@FreeBSD.ORG Mon Sep 30 11:06:47 2013 Return-Path: Delivered-To: freebsd-mips@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id E6EF3DFB for ; Mon, 30 Sep 2013 11:06:47 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D3FD12BF3 for ; Mon, 30 Sep 2013 11:06:47 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r8UB6lRS053526 for ; Mon, 30 Sep 2013 11:06:47 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r8UB6lLc053524 for freebsd-mips@FreeBSD.org; Mon, 30 Sep 2013 11:06:47 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 30 Sep 2013 11:06:47 GMT Message-Id: <201309301106.r8UB6lLc053524@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-mips@FreeBSD.org Subject: Current problem reports assigned to freebsd-mips@FreeBSD.org X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 11:06:48 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/177876 mips [mips] kernel stack overflow panic on mips64, EdgeRout o kern/165951 mips [ar913x] [ath] DDR flush isn't being done for the WMAC 2 problems total. From owner-freebsd-mips@FreeBSD.ORG Mon Sep 30 17:09:44 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 2216B811 for ; Mon, 30 Sep 2013 17:09:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x22d.google.com (mail-wi0-x22d.google.com [IPv6:2a00:1450:400c:c05::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B385B25E2 for ; Mon, 30 Sep 2013 17:09:43 +0000 (UTC) Received: by mail-wi0-f173.google.com with SMTP id hq15so4233007wib.0 for ; Mon, 30 Sep 2013 10:09:41 -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=DTPSvnasnP+GBByj6SJgl/QxqHcDm1U3GvzD6GkX7SA=; b=jM5t1lynVMrXf12dzBg+SlLXBfdgg6fFXH4wlrQxfbYcaBR+45VmZdJnjkpvt6F1pD WfVgj7/5eAoSpWYMK7Bjby/dKLqsvLATRTBfxGMb5AVo8B2dqm3l6ZaSyW5qvMaN9OSi VDYAk0tAAJYXF2sN99SAszO8ZjxKmKeocXgXDWrTDjAsh+2wog5KJFQNwb/3rw19zXR+ RYVknu1UMhT88xxPn9w0Twzc0FcSOcoKreL5xo3M9h2Lk2jjuNTws27ThY6ZMqw+kGkI zCFzF/bRNLxpWyACwvfemg7ftyykR9xwmgOoUibnOIX7WpBvOhFzrX1cMnGsd6DTh5M+ EysQ== MIME-Version: 1.0 X-Received: by 10.180.109.132 with SMTP id hs4mr14722826wib.46.1380560981141; Mon, 30 Sep 2013 10:09:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.216.73.133 with HTTP; Mon, 30 Sep 2013 10:09:41 -0700 (PDT) In-Reply-To: <180563C9-541F-47F9-8C90-35686BBC6471@bluezbox.com> References: <180563C9-541F-47F9-8C90-35686BBC6471@bluezbox.com> Date: Mon, 30 Sep 2013 10:09:41 -0700 X-Google-Sender-Auth: C56OMfsyCx3aSzfYDxpv7N86oMM Message-ID: Subject: Re: FreeBSD/MIPS emulation From: Adrian Chadd To: Oleksandr Tymoshenko Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2013 17:09:44 -0000 Hi! I've verified that MALTA + mipsel works. I'll check MALTA + mipseb later tonight/tomorrow. I don't know if my qemu package has the relevant patch though; but I'll see if I can get it committed to the port so it isn't such a big problem for us. It's about time that we generated some generic initial rootfs for this stuff as part of the release process. Thanks! -adrian On 4 September 2013 15:46, Oleksandr Tymoshenko wrote: > Hello, > > I've just posted short overview of FreeBSD/MIPS emulation options > and thought it might be of some interest to freebsd-mips crowd: > http://kernelnomicon.org/?p=401 > > The plan is to get some feedback, fill in blanks if there are any > and move this stuff to wiki.freebsd.org. So if you feel there is > something missing in the post - let me know. > > I'll be working with qemu and gxemul ports maintainers to get > patches mentioned in the article merged to ports tree. > > Thanks > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" > From owner-freebsd-mips@FreeBSD.ORG Tue Oct 1 15:57:58 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 92FCCCDB for ; Tue, 1 Oct 2013 15:57:58 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f175.google.com (mail-ie0-f175.google.com [209.85.223.175]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60BBA25C8 for ; Tue, 1 Oct 2013 15:57:58 +0000 (UTC) Received: by mail-ie0-f175.google.com with SMTP id e14so14446589iej.34 for ; Tue, 01 Oct 2013 08:57:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=zuHFMA8L9UOiWspqkgBOTa6Pj0m8foIlyOYGmHf/m5k=; b=AF45wH9Y01RsKAghfsTBzNcKVAvy/m3aNoq28AVMrLdnzjCIWg91jescvR6dP+t1ri /ZIVIb5vwGj5f5VnFWIYYUjhGHl/kpHb1j/WSKjiALIgVzzrAzfJHHkSSdDewT8Up+So LphcnhPXh7633svdet+I8N0CVCgj4yenVqd/OZcVJ9N1SJb6jN7lCddCsTNiZQjG12jZ D5gy32Uea0fDdvRYmbhMezVbH4ZW21B1STVbCYIuKUWDiK8PAS5Cmm8kX/EAp1P+2IJT AM7k/Wbmc1VMmFEMzSKNaCTijDm8U+2UTgA2jOQYFSurCIZKZcQOPFkz3Cal0FA3v+Y5 TmMw== X-Gm-Message-State: ALoCoQn1TzXDEDVFwON83wP44f0CmpyOgAAYkNM0gcrtjNZyI1C93MPS9lL/aFwcpU3S/CCcFzJv X-Received: by 10.43.114.6 with SMTP id ey6mr404784icc.87.1380643077620; Tue, 01 Oct 2013 08:57:57 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id ih14sm4202450igb.7.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Oct 2013 08:57:55 -0700 (PDT) Sender: Warner Losh Subject: Re: FreeBSD/MIPS emulation Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Tue, 1 Oct 2013 09:57:54 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <3CB8B78B-43F3-4891-9E68-E2CE3EDED96D@bsdimp.com> References: <180563C9-541F-47F9-8C90-35686BBC6471@bluezbox.com> To: Adrian Chadd X-Mailer: Apple Mail (2.1085) Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 15:57:58 -0000 On Sep 30, 2013, at 11:09 AM, Adrian Chadd wrote: > Hi! >=20 > I've verified that MALTA + mipsel works. >=20 > I'll check MALTA + mipseb later tonight/tomorrow. I don't know if my = qemu > package has the relevant patch though; but I'll see if I can get it > committed to the port so it isn't such a big problem for us. >=20 > It's about time that we generated some generic initial rootfs for this > stuff as part of the release process. I'd love to ship big-endian mips64 and little endian mips images as part = of the release process. Maybe 10.0 as a dry/unofficial run with a real = run in 10.1? Warner > Thanks! >=20 >=20 >=20 > -adrian >=20 >=20 >=20 > On 4 September 2013 15:46, Oleksandr Tymoshenko = wrote: >=20 >> Hello, >>=20 >> I've just posted short overview of FreeBSD/MIPS emulation options >> and thought it might be of some interest to freebsd-mips crowd: >> http://kernelnomicon.org/?p=3D401 >>=20 >> The plan is to get some feedback, fill in blanks if there are any >> and move this stuff to wiki.freebsd.org. So if you feel there is >> something missing in the post - let me know. >>=20 >> I'll be working with qemu and gxemul ports maintainers to get >> patches mentioned in the article merged to ports tree. >>=20 >> Thanks >>=20 >>=20 >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-mips >> To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org" >>=20 > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org" From owner-freebsd-mips@FreeBSD.ORG Sat Oct 5 17:18:51 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 52069D39 for ; Sat, 5 Oct 2013 17:18:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-x236.google.com (mail-pb0-x236.google.com [IPv6:2607:f8b0:400e:c01::236]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2C3A62C25 for ; Sat, 5 Oct 2013 17:18:51 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id ro12so5315923pbb.13 for ; Sat, 05 Oct 2013 10:18:50 -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=KV9PKgf3fohsZbVCb1nCjX6H2z4/ZNCF1ueqSXNyM6g=; b=wKnXp07vDrw5VAGtuV/8Aag+BbpQZlYdb1pNU114OSeqMr1FZcBg8qdahgvgwLaUmO o9u6hkN3Kd8l6ExguDCyxyWSVD22peLaLuqU1fqz35QEL1eCaGpwIHzmO9DocE4IDuH8 vBKxKcnj55hX5Z6fijgaJUc03gs97CVo6Yz1PV240RYVyUywd5ZDI+wFnped9Ez73zYr 25xl94vaiFum+tBzAZW2VVfoQsXcfOzzRrYfMEaMqeMQxoBWAyYUpalHSCsJmZMUzT59 Tfpb/1/rtxvDwiY3fTQ8ZyNxrNZhPmszbkDPOAFn3jAexH679Z9qOGno417EY2Mc+jyQ 8ahg== MIME-Version: 1.0 X-Received: by 10.68.52.170 with SMTP id u10mr21159502pbo.34.1380993530555; Sat, 05 Oct 2013 10:18:50 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.70.42.10 with HTTP; Sat, 5 Oct 2013 10:18:50 -0700 (PDT) Date: Sat, 5 Oct 2013 10:18:50 -0700 X-Google-Sender-Auth: esd-vnBp3v1QkeHQLw41lGtWTUc Message-ID: Subject: How's bus-space stuff supposed to work with superscalar MIPS? From: Adrian Chadd To: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 17:18:51 -0000 Hi all, I've been bringing up the AR9344 PHY and after a lot of digging, I discovered that I can fix things by changing ARGE_WRITE() (ie, write to the ethernet space registers) to: bus_write_4(); bus_read_4(); .. to (what I'm guessing here) flush the write out before the next instruction is run. So, given this particular hilarity has shown up, what's the story with doing IO accesses on a superscalar MIPS CPU? If it's going to kseg1, is it somehow going to magically enforce ordering? Or am I right in thinking we will need explicit barriers here? I'd like to sneak this into the initial mips74k bringup support that I'm going to commit to -HEAD soon. Thanks, -adrian From owner-freebsd-mips@FreeBSD.ORG Sat Oct 5 23:07:16 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D7BE2C50; Sat, 5 Oct 2013 23:07:16 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from mx0.deglitch.com (backbone.deglitch.com [78.110.53.255]) by mx1.freebsd.org (Postfix) with ESMTP id 907A02A64; Sat, 5 Oct 2013 23:07:16 +0000 (UTC) Received: from [192.168.11.3] (c-71-198-23-5.hsd1.ca.comcast.net [71.198.23.5]) by mx0.deglitch.com (Postfix) with ESMTPSA id 5D1D08FC2B; Sun, 6 Oct 2013 03:07:02 +0400 (MSK) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <5AD9EE93-9D19-4A07-B189-43DA0C4A85E9@FreeBSD.org> X-Mailer: iPad Mail (10B329) From: Stanislav Sedov Subject: Re: How's bus-space stuff supposed to work with superscalar MIPS? Date: Sat, 5 Oct 2013 16:06:58 -0700 To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 23:07:16 -0000 On Oct 5, 2013, at 10:18 AM, Adrian Chadd wrote: > Hi all, >=20 > I've been bringing up the AR9344 PHY and after a lot of digging, I > discovered that I can fix things by changing ARGE_WRITE() (ie, write to th= e > ethernet space registers) to: >=20 > bus_write_4(); > bus_read_4(); >=20 > .. to (what I'm guessing here) flush the write out before the next > instruction is run. >=20 > So, given this particular hilarity has shown up, what's the story with > doing IO accesses on a superscalar MIPS CPU? If it's going to kseg1, is it= > somehow going to magically enforce ordering? Or am I right in thinking we > will need explicit barriers here? >=20 I don't know specifics of mips74k, but usually one indeed needs memory barri= ers when performing read of write operation sequences that require ordering on device I/O (e.g changing the ring and writing the new ring index afterwards)= . I would not be surprised if the cpu reorders i/o bus memory access, especially a mul= ti-issue one. It is a good idea to have barriers where needed regardless. We have special= macros for them which are defined to nothing on the in-order platforms.= From owner-freebsd-mips@FreeBSD.ORG Sat Oct 5 23:51:42 2013 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 206CD332; Sat, 5 Oct 2013 23:51:42 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-qc0-x22d.google.com (mail-qc0-x22d.google.com [IPv6:2607:f8b0:400d:c01::22d]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C3B2D2BED; Sat, 5 Oct 2013 23:51:41 +0000 (UTC) Received: by mail-qc0-f173.google.com with SMTP id c3so3831083qcv.18 for ; Sat, 05 Oct 2013 16:51:40 -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=TPyLwlQNifI8wEhTgPgDFvenm/OhTH00xXk/NpRSuYk=; b=T22cqHwY2CRMOmrYu8ERV1FsXj8CPJsjtFburKcPtL7XVauPlwwNZRpgJA/rQs5SFp /IRY2MsqSvL3az+YKd5w1eM5Fjj8Vkd5ewVaq5obM4nbOi83wGcQhsqoeEW+H8Xq/Y/O 8PEL2q8Fuk8qaNg4Yd6HbpoGOXzS9cSVMQeb5zGdby5M0dVt20gYtf8tB912nFpJJ94C CEtHP8DFd2mq0q4ArMj2uwPDIhsXN+jlqD4RxvOvTX3KM+qFNwSaFU9FPQPhY15Rtg/H zlWfaWjTAOWs0om9IJQ/Of9BPii+wX6Zgm9+EyETmdTQJD2IMaPou50NBNvUwhnCr1sl rR0Q== MIME-Version: 1.0 X-Received: by 10.49.104.5 with SMTP id ga5mr26664212qeb.53.1381017100093; Sat, 05 Oct 2013 16:51:40 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.207.66 with HTTP; Sat, 5 Oct 2013 16:51:39 -0700 (PDT) In-Reply-To: <5AD9EE93-9D19-4A07-B189-43DA0C4A85E9@FreeBSD.org> References: <5AD9EE93-9D19-4A07-B189-43DA0C4A85E9@FreeBSD.org> Date: Sat, 5 Oct 2013 16:51:39 -0700 X-Google-Sender-Auth: RfGM9JvqZEGc_WzBkANnVRtX9lo Message-ID: Subject: Re: How's bus-space stuff supposed to work with superscalar MIPS? From: Adrian Chadd To: Stanislav Sedov Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "freebsd-mips@freebsd.org" X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Oct 2013 23:51:42 -0000 On 5 October 2013 16:06, Stanislav Sedov wrote: > > On Oct 5, 2013, at 10:18 AM, Adrian Chadd wrote: > > > Hi all, > > > > I've been bringing up the AR9344 PHY and after a lot of digging, I > > discovered that I can fix things by changing ARGE_WRITE() (ie, write to > the > > ethernet space registers) to: > > > > bus_write_4(); > > bus_read_4(); > > > > .. to (what I'm guessing here) flush the write out before the next > > instruction is run. > > > > So, given this particular hilarity has shown up, what's the story with > > doing IO accesses on a superscalar MIPS CPU? If it's going to kseg1, is > it > > somehow going to magically enforce ordering? Or am I right in thinking we > > will need explicit barriers here? > > > > I don't know specifics of mips74k, but usually one indeed needs memory > barriers > when performing read of write operation sequences that require ordering on > device I/O (e.g changing the ring and writing the new ring index > afterwards). I would > not be surprised if the cpu reorders i/o bus memory access, especially a > multi-issue > one. > > It is a good idea to have barriers where needed regardless. We have > special macros > for them which are defined to nothing on the in-order platforms. Right. I know this stuff. I really though want to know this kind of stuff: * What the specifics are for superscalar MIPS CPUs; * What the bus space stuff should be be providing by default (and I've been down this path once, with ath(4) bugs, PPC, and the bus space macros not enforcing flushes after IO operations, even though the API requires drivers do it themselves..); * Whether it should be enough to map space COHERENT - then it's up to the underlying bus implementation to implement enforcing ordering. -adrian