From owner-freebsd-mips@FreeBSD.ORG Fri Jul 15 00:47:27 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 55A58106566C for ; Fri, 15 Jul 2011 00:47:27 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 223E08FC0A for ; Fri, 15 Jul 2011 00:47:26 +0000 (UTC) Received: by iwr19 with SMTP id 19so885045iwr.13 for ; Thu, 14 Jul 2011 17:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=R1cco+DxMbb2oHLrQfgEqUOUbIrv6EsVxMN/lqVUufk=; b=xrKF8+T9MR2D3ymouLDgaeKZ8eeQVe3gUL9IwgCTe5s7D1VG/KFKJmmpTVeh5N/QHu WL+7UwBAfkhUOj0a1ToSC1w9nOru4Tx56VgtSsutuJ8R41OcUk3szseODui5+j931yWp 5ewS5a6z3hDwR1w3wXfE9T1IR0LgI1s8LB0gg= MIME-Version: 1.0 Received: by 10.42.172.131 with SMTP id n3mr3412634icz.247.1310688973865; Thu, 14 Jul 2011 17:16:13 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.224.70 with HTTP; Thu, 14 Jul 2011 17:16:13 -0700 (PDT) Date: Fri, 15 Jul 2011 02:16:13 +0200 X-Google-Sender-Auth: VsDQGCtpXwdqgPQ3XPGohtxHauY Message-ID: From: Robert Millan To: freebsd-mips@freebsd.org Content-Type: multipart/mixed; boundary=90e6ba6e88eab2c3c304a8108e31 Subject: [PATCH] Fix initialization of i8259 controller on MALTA 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: Fri, 15 Jul 2011 00:47:27 -0000 --90e6ba6e88eab2c3c304a8108e31 Content-Type: text/plain; charset=UTF-8 Hi, i8259 controller is initialized incorrectly on MALTA. It writes mask bits to control register and control bits to mask register. The former causes ICW1_RESET|ICW1_LTIM combination to be written to control register, which on QEMU results in "level sensitive irq not supported" error. -- Robert Millan --90e6ba6e88eab2c3c304a8108e31 Content-Type: text/plain; charset=US-ASCII; name="malta_i8059.diff" Content-Disposition: attachment; filename="malta_i8059.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gq4eb4ok0 CkZpeCBpbml0aWFsaXphdGlvbiBvZiBpODI1OSBjb250cm9sbGVyLiAgT3Bwb3NpdGUgc2lkZSBp cyBpbgpxZW11LTAuMTQuMStkZnNnL2h3L2k4MjU5LmM6IHBpY19pb3BvcnRfd3JpdGUoKQoKLS0t IGEvc3lzL21pcHMvbWFsdGEvZ3RfcGNpLmMKKysrIGIvc3lzL21pcHMvbWFsdGEvZ3RfcGNpLmMK QEAgLTMyNiwxNSArMzI2LDE1IEBACiAJICAgIElDVzRfODA4Nik7CiAKIAkvKiBtYXNrIGFsbCBp bnRlcnJ1cHRzICovCi0JYnVzX3NwYWNlX3dyaXRlXzEoc2MtPnNjX3N0LCBzYy0+c2NfaW9oX2lj dTEsIDAsCisJYnVzX3NwYWNlX3dyaXRlXzEoc2MtPnNjX3N0LCBzYy0+c2NfaW9oX2ljdTEsIDEs CiAJICAgIHNjLT5zY19pbWFzayAmIDB4ZmYpOwogCiAJLyogZW5hYmxlIHNwZWNpYWwgbWFzayBt b2RlICovCi0JYnVzX3NwYWNlX3dyaXRlXzEoc2MtPnNjX3N0LCBzYy0+c2NfaW9oX2ljdTEsIDEs CisJYnVzX3NwYWNlX3dyaXRlXzEoc2MtPnNjX3N0LCBzYy0+c2NfaW9oX2ljdTEsIDAsCiAJICAg IE9DVzNfU0VMIHwgT0NXM19FU01NIHwgT0NXM19TTU0pOwogCiAJLyogcmVhZCBJUlIgYnkgZGVm YXVsdCAqLwotCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNjX2lvaF9pY3UxLCAx LAorCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNjX2lvaF9pY3UxLCAwLAogCSAg ICBPQ1czX1NFTCB8IE9DVzNfUlIpOwogCiAJLyogcmVzZXQsIHByb2dyYW0gZGV2aWNlLCA0IGJ5 dGVzICovCkBAIC0zNDgsMTUgKzM0OCwxNSBAQAogCSAgICBJQ1c0XzgwODYpOwogCiAJLyogbWFz ayBhbGwgaW50ZXJydXB0cyAqLwotCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNj X2lvaF9pY3UyLCAwLAorCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNjX2lvaF9p Y3UyLCAxLAogCSAgICBzYy0+c2NfaW1hc2sgJiAweGZmKTsKIAogCS8qIGVuYWJsZSBzcGVjaWFs IG1hc2sgbW9kZSAqLwotCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNjX2lvaF9p Y3UyLCAxLAorCWJ1c19zcGFjZV93cml0ZV8xKHNjLT5zY19zdCwgc2MtPnNjX2lvaF9pY3UyLCAw LAogCSAgICBPQ1czX1NFTCB8IE9DVzNfRVNNTSB8IE9DVzNfU01NKTsKIAogCS8qIHJlYWQgSVJS IGJ5IGRlZmF1bHQgKi8KLQlidXNfc3BhY2Vfd3JpdGVfMShzYy0+c2Nfc3QsIHNjLT5zY19pb2hf aWN1MiwgMSwKKwlidXNfc3BhY2Vfd3JpdGVfMShzYy0+c2Nfc3QsIHNjLT5zY19pb2hfaWN1Miwg MCwKIAkgICAgT0NXM19TRUwgfCBPQ1czX1JSKTsKIAogCS8qCg== --90e6ba6e88eab2c3c304a8108e31-- From owner-freebsd-mips@FreeBSD.ORG Fri Jul 15 06:25:31 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 3CAA5106564A for ; Fri, 15 Jul 2011 06:25:31 +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 F0B1C8FC18 for ; Fri, 15 Jul 2011 06:25:30 +0000 (UTC) Received: by gxk28 with SMTP id 28so511933gxk.13 for ; Thu, 14 Jul 2011 23:25:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=eEFY5mVre9NEL/0ajK1uprNF+se3Gfzj7jDXg7fU2u8=; b=q/DsClWv1NKYwJGgbEriscLfg430apxtyYws/F6IC6JrPK5e/etBwq9ngazAXtKf0u v3q0eXIY27s7dcmojgQldQfdiQ8NlqMMxEHOCB1EC96BvW7lv2AJdwFHHv5hJwQ4usEK PdIO54QpMZHaFAkvnbNwemVEdmoPsTaOoqiIA= MIME-Version: 1.0 Received: by 10.150.68.35 with SMTP id q35mr3013669yba.443.1310709468031; Thu, 14 Jul 2011 22:57:48 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.189.1 with HTTP; Thu, 14 Jul 2011 22:57:48 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jul 2011 13:57:48 +0800 X-Google-Sender-Auth: FCrrp1g-gqjZ7Hvo-NldtNyc_MA Message-ID: From: Adrian Chadd To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Fix initialization of i8259 controller on MALTA 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: Fri, 15 Jul 2011 06:25:31 -0000 Guys, Who is looking after the Malta stuff nowdays? I'll commit it if noone's currently looking after it (and just trust Robert= :-) adrian On 15 July 2011 08:16, Robert Millan wrote: > Hi, > > i8259 controller is initialized incorrectly on MALTA. =A0It writes mask > bits to control register and control bits to mask register. > > The former causes ICW1_RESET|ICW1_LTIM combination to be written to > control register, which on QEMU results in "level sensitive irq not > supported" error. > > -- > Robert Millan > > _______________________________________________ > 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 Fri Jul 15 10:08:10 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 85C53106566C for ; Fri, 15 Jul 2011 10:08:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 40F378FC12 for ; Fri, 15 Jul 2011 10:08:09 +0000 (UTC) Received: by vxg33 with SMTP id 33so1085200vxg.13 for ; Fri, 15 Jul 2011 03:08:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Ry6OViwCncid8greOwnQSUVSQOqU+a7+UcyH1/6qz/8=; b=QHTCvW0om/1uw90b9hGt2tG/xpySkDT+C5s3M5+ryj/9E5MkfuPS1ImL4JF1c2yk7z wGjeXcND1pRvpWHB/8+Qot1nxIN4nFhR4kvZbmxl70iffq3hTL1fZ4+qdNQXYqPmSBNX HqqP7SUY/ZxcepNRc96u6hhTTJwSBUjL+bUCQ= MIME-Version: 1.0 Received: by 10.52.97.8 with SMTP id dw8mr3694566vdb.150.1310724489388; Fri, 15 Jul 2011 03:08:09 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.52.160.3 with HTTP; Fri, 15 Jul 2011 03:08:09 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jul 2011 18:08:09 +0800 X-Google-Sender-Auth: d8fnI2BvokwFJfiIxAkSXTJSqOk Message-ID: From: Adrian Chadd To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Fix initialization of i8259 controller on MALTA 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: Fri, 15 Jul 2011 10:08:10 -0000 The obvious question - is QEMU correct here? Has anyone tried this on a real board? Adrian On 15 July 2011 08:16, Robert Millan wrote: > Hi, > > i8259 controller is initialized incorrectly on MALTA. =A0It writes mask > bits to control register and control bits to mask register. > > The former causes ICW1_RESET|ICW1_LTIM combination to be written to > control register, which on QEMU results in "level sensitive irq not > supported" error. > > -- > Robert Millan > > _______________________________________________ > 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 Fri Jul 15 12:55:47 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 066E9106564A for ; Fri, 15 Jul 2011 12:55:47 +0000 (UTC) (envelope-from ray@dlink.ua) Received: from dlink.ua (smtp.dlink.ua [193.138.187.146]) by mx1.freebsd.org (Postfix) with ESMTP id 839EC8FC08 for ; Fri, 15 Jul 2011 12:55:46 +0000 (UTC) Received: from gw-lan1.kiev.dlink.ua ([192.168.10.10] helo=terran.dlink.ua) by dlink.ua with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1QhhPL-0002Mj-Gf for freebsd-mips@freebsd.org; Fri, 15 Jul 2011 15:22:15 +0300 Date: Fri, 15 Jul 2011 15:22:10 +0300 From: Aleksandr Rybalko To: freebsd-mips@freebsd.org Message-Id: <20110715152210.88db1c98.ray@dlink.ua> Organization: D-Link X-Mailer: Sylpheed 2.7.1 (GTK+ 2.20.1; i386-portbld-freebsd8.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: dev/flash patch 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: Fri, 15 Jul 2011 12:55:47 -0000 Hi all, I have proposal to tidy mx25l driver, since he have macro's that called M25PXX_*. That name match a real(world known) name, but seems renaming whole driver is bigger pain than use well known for our users. Please let me know, if someone have objections or opinion differ from my. Patch: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Index: sys/dev/flash/mx25l.c =================================================================== --- sys/dev/flash/mx25l.c (revision 223926) +++ sys/dev/flash/mx25l.c (working copy) @@ -79,14 +79,14 @@ unsigned int sc_flags; }; -#define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define M25PXX_UNLOCK(_sc) mtx_unlock(& (_sc)->sc_mtx) -#define M25PXX_LOCK_INIT(_sc) \ +#define MX25L_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) +#define MX25L_UNLOCK(_sc) mtx_unlock(& (_sc)->sc_mtx) +#define MX25L_LOCK_INIT(_sc) \ mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ "mx25l", MTX_DEF) -#define M25PXX_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define M25PXX_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define M25PXX_ASSERT_UNLOCKED(_sc) mtx_assert (&_sc->sc_mtx, MA_NOTOWNED); +#define MX25L_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); +#define MX25L_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define MX25L_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); /* disk routines */ static int mx25l_open(struct disk *dp); @@ -356,7 +356,7 @@ sc = device_get_softc(dev); sc->sc_dev = dev; - M25PXX_LOCK_INIT(sc); + MX25L_LOCK_INIT(sc); ident = mx25l_get_device_ident(sc); if (ident == NULL) @@ -427,10 +427,10 @@ struct mx25l_softc *sc; sc = (struct mx25l_softc *)bp->bio_disk->d_drv1; - M25PXX_LOCK(sc); + MX25L_LOCK(sc); bioq_disksort(&sc->sc_bio_queue, bp); wakeup(sc); - M25PXX_UNLOCK(sc); + MX25L_UNLOCK(sc); } static void @@ -442,14 +442,14 @@ for (;;) { dev = sc->sc_dev; - M25PXX_LOCK(sc); + MX25L_LOCK(sc); do { bp = bioq_first(&sc->sc_bio_queue); if (bp == NULL) msleep(sc, &sc->sc_mtx, PRIBIO, "jobqueue", 0); } while (bp == NULL); bioq_remove(&sc->sc_bio_queue, bp); - M25PXX_UNLOCK(sc); + MX25L_UNLOCK(sc); switch (bp->bio_cmd) { case BIO_READ: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> -- Alexandr Rybalko aka Alex RAY From owner-freebsd-mips@FreeBSD.ORG Fri Jul 15 16:09:53 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 F16C4106566C; Fri, 15 Jul 2011 16:09:53 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id ACCF18FC14; Fri, 15 Jul 2011 16:09:53 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p6FG4RKk030260 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 15 Jul 2011 10:04:28 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Fri, 15 Jul 2011 10:02:59 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <023BB8FE-D486-4D3C-80F3-642BEB8FD72C@bsdimp.com> References: To: Adrian Chadd X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 15 Jul 2011 10:04:28 -0600 (MDT) Cc: freebsd-mips@FreeBSD.org Subject: Re: [PATCH] Fix initialization of i8259 controller on MALTA 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: Fri, 15 Jul 2011 16:09:54 -0000 On Jul 15, 2011, at 4:08 AM, Adrian Chadd wrote: > The obvious question - is QEMU correct here? >=20 > Has anyone tried this on a real board? I'm not sure this has booted on a real board in a long time. Not = because it is broken, but because the MALTA boards are kinda old. Warner >=20 > Adrian >=20 > On 15 July 2011 08:16, Robert Millan wrote: >> Hi, >>=20 >> i8259 controller is initialized incorrectly on MALTA. It writes mask >> bits to control register and control bits to mask register. >>=20 >> The former causes ICW1_RESET|ICW1_LTIM combination to be written to >> control register, which on QEMU results in "level sensitive irq not >> supported" error. >>=20 >> -- >> Robert Millan >>=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 >>=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 >=20 From owner-freebsd-mips@FreeBSD.ORG Fri Jul 15 16:30:46 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 478FF106564A for ; Fri, 15 Jul 2011 16:30:46 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id DDEC08FC18 for ; Fri, 15 Jul 2011 16:30:45 +0000 (UTC) Received: from [10.30.101.53] ([209.117.142.2]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id p6FGRl3M030463 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Fri, 15 Jul 2011 10:27:49 -0600 (MDT) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20110715152210.88db1c98.ray@dlink.ua> Date: Fri, 15 Jul 2011 10:27:38 -0600 Content-Transfer-Encoding: 7bit Message-Id: References: <20110715152210.88db1c98.ray@dlink.ua> To: Aleksandr Rybalko X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Fri, 15 Jul 2011 10:27:50 -0600 (MDT) Cc: freebsd-mips@FreeBSD.org Subject: Re: dev/flash patch 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: Fri, 15 Jul 2011 16:30:46 -0000 this patch looks good to me. Warner On Jul 15, 2011, at 6:22 AM, Aleksandr Rybalko wrote: > Hi all, > > I have proposal to tidy mx25l driver, since he have macro's that called > M25PXX_*. That name match a real(world known) name, but seems renaming > whole driver is bigger pain than use well known for our users. > > Please let me know, if someone have objections or opinion differ from > my. > > Patch: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > Index: sys/dev/flash/mx25l.c > =================================================================== > --- sys/dev/flash/mx25l.c (revision 223926) > +++ sys/dev/flash/mx25l.c (working copy) > @@ -79,14 +79,14 @@ > unsigned int sc_flags; > }; > > -#define M25PXX_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) > -#define M25PXX_UNLOCK(_sc) mtx_unlock(& > (_sc)->sc_mtx) -#define M25PXX_LOCK_INIT(_sc) \ > +#define MX25L_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) > +#define MX25L_UNLOCK(_sc) mtx_unlock(& > (_sc)->sc_mtx) +#define MX25L_LOCK_INIT(_sc) \ > mtx_init(&_sc->sc_mtx, device_get_nameunit(_sc->sc_dev), \ > "mx25l", MTX_DEF) > -#define M25PXX_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); > -#define M25PXX_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, > MA_OWNED); -#define M25PXX_ASSERT_UNLOCKED(_sc) mtx_assert > (&_sc->sc_mtx, MA_NOTOWNED); +#define MX25L_LOCK_DESTROY(_sc) > mtx_destroy(&_sc->sc_mtx); +#define MX25L_ASSERT_LOCKED(_sc) > mtx_assert(&_sc->sc_mtx, MA_OWNED); +#define MX25L_ASSERT_UNLOCKED(_sc) > mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); > /* disk routines */ > static int mx25l_open(struct disk *dp); > @@ -356,7 +356,7 @@ > > sc = device_get_softc(dev); > sc->sc_dev = dev; > - M25PXX_LOCK_INIT(sc); > + MX25L_LOCK_INIT(sc); > > ident = mx25l_get_device_ident(sc); > if (ident == NULL) > @@ -427,10 +427,10 @@ > struct mx25l_softc *sc; > > sc = (struct mx25l_softc *)bp->bio_disk->d_drv1; > - M25PXX_LOCK(sc); > + MX25L_LOCK(sc); > bioq_disksort(&sc->sc_bio_queue, bp); > wakeup(sc); > - M25PXX_UNLOCK(sc); > + MX25L_UNLOCK(sc); > } > > static void > @@ -442,14 +442,14 @@ > > for (;;) { > dev = sc->sc_dev; > - M25PXX_LOCK(sc); > + MX25L_LOCK(sc); > do { > bp = bioq_first(&sc->sc_bio_queue); > if (bp == NULL) > msleep(sc, &sc->sc_mtx, PRIBIO, > "jobqueue", 0); } while (bp == NULL); > bioq_remove(&sc->sc_bio_queue, bp); > - M25PXX_UNLOCK(sc); > + MX25L_UNLOCK(sc); > > switch (bp->bio_cmd) { > case BIO_READ: >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > > -- > Alexandr Rybalko > aka Alex RAY > _______________________________________________ > 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 Fri Jul 15 19:03:47 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 B3CAB1065670 for ; Fri, 15 Jul 2011 19:03:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 72F6E8FC12 for ; Fri, 15 Jul 2011 19:03:47 +0000 (UTC) Received: by iwr19 with SMTP id 19so1739501iwr.13 for ; Fri, 15 Jul 2011 12:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=9LYa+N0VlJzVL3ukCvGU5XzOreQVyGAn3oRPHZF+P3k=; b=Uu5a10+0Ljinm57EGnpK9Vd2+Ba0/A3ncTh7F9xN7gF+TQudkrBgplwNYSx67QigPH MPRQvVofi4Xh6gUdWLC42v9hkzrDwvlIzzFOuLpYc/b34m7T47P73pNw+CUW/JP3aSnK KbeaqzUnL0aXnWu8uNFVdMlIywIXRN9emToOQ= MIME-Version: 1.0 Received: by 10.42.166.3 with SMTP id m3mr4307718icy.113.1310756626640; Fri, 15 Jul 2011 12:03:46 -0700 (PDT) Sender: rmh.aybabtu@gmail.com Received: by 10.42.224.70 with HTTP; Fri, 15 Jul 2011 12:03:46 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jul 2011 21:03:46 +0200 X-Google-Sender-Auth: JU-1hxxYpZG3CYqHWSGRgHbhB7Y Message-ID: From: Robert Millan To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Fix initialization of i8259 controller on MALTA 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: Fri, 15 Jul 2011 19:03:47 -0000 2011/7/15 Adrian Chadd : > The obvious question - is QEMU correct here? > > Has anyone tried this on a real board? I can't try a real board. But in case this helps, the comments in sys/dev/ic/i8259.h confirm that the even address is the right place for sending OCW3 commands. So does i8259_init() routine in sys/x86/isa/atpic.c, which also confirms that IMR is the odd address. However, this code is used on x86 only. -- Robert Millan From owner-freebsd-mips@FreeBSD.ORG Sat Jul 16 00:30:37 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 79D7F106566B for ; Sat, 16 Jul 2011 00:30:37 +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 38CFA8FC14 for ; Sat, 16 Jul 2011 00:30:36 +0000 (UTC) Received: by gxk28 with SMTP id 28so911943gxk.13 for ; Fri, 15 Jul 2011 17:30:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=IZx9YOuPhevCVTqqta5FwreTxXDUf7ttPtGRWCyjd/s=; b=Xpa+HXxtWX9YrSreOAzXvabu4rCtJHadLcZM/I8Zy0SSnnW6KeDqC/2rTUMBL+2oSQ Y/XjN61BGxoI3hkeDBXz9nSXIBAzo44ptfcER3yHgAfLw6TcFTtTJuQNFuccVQlXiIpi xyvh5sSer1hU9Z26KZNGMdxhSgM8SWLhIfFO0= MIME-Version: 1.0 Received: by 10.150.46.4 with SMTP id t4mr3871947ybt.386.1310776235491; Fri, 15 Jul 2011 17:30:35 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.150.197.5 with HTTP; Fri, 15 Jul 2011 17:30:35 -0700 (PDT) In-Reply-To: References: Date: Sat, 16 Jul 2011 08:30:35 +0800 X-Google-Sender-Auth: DEWtqC-_M7p4eLCQtMisdN9i-aY Message-ID: From: Adrian Chadd To: Robert Millan Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips@freebsd.org Subject: Re: [PATCH] Fix initialization of i8259 controller on MALTA 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: Sat, 16 Jul 2011 00:30:37 -0000 Committed in r224072. Thanks! Adrian On 15 July 2011 08:16, Robert Millan wrote: > Hi, > > i8259 controller is initialized incorrectly on MALTA. =A0It writes mask > bits to control register and control bits to mask register. > > The former causes ICW1_RESET|ICW1_LTIM combination to be written to > control register, which on QEMU results in "level sensitive irq not > supported" error. > > -- > Robert Millan > > _______________________________________________ > 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" > >