From owner-freebsd-mips@freebsd.org Thu Mar 3 11:51:52 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9279A93308 for ; Thu, 3 Mar 2016 11:51:52 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9822FF12 for ; Thu, 3 Mar 2016 11:51:51 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 7A10A25D37C3 for ; Thu, 3 Mar 2016 11:51:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 98921C77005 for ; Thu, 3 Mar 2016 11:51:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id cMOyOhirbQ4u for ; Thu, 3 Mar 2016 11:51:39 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 54A36C76FEC for ; Thu, 3 Mar 2016 11:51:38 +0000 (UTC) From: "Bjoern A. Zeeb" Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: mipsn32 uboot fails to build Message-Id: <8A555877-759D-42BD-B360-3C7832D414FD@lists.zabbadoz.net> Date: Thu, 3 Mar 2016 11:51:37 +0000 To: freebsd-mips@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2016 11:51:52 -0000 Hi, can someone please fix this? =3D=3D=3D> sys/boot/mips/uboot (all) metadata.o: In function `md_copymodules': = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :228: undefined reference to `elf32_relocation_offset' = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :228: undefined reference to `elf32_relocation_offset' metadata.o: In function `md_load': = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :348: undefined reference to `elf32_relocation_offset' = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :348: undefined reference to `elf32_relocation_offset' = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :356: undefined reference to `elf32_relocation_offset' = metadata.o:/scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common= /metadata.c:356: more undefined references to `elf32_relocation_offset' = follow = /storage/head/obj//mips.mipsn32/scratch/tmp/bz/head.svn/sys/boot/mips/uboo= t/../../uboot/lib/libuboot.a(elf_freebsd.o): In function = `elf32_uboot_load': elf_freebsd.c:(.text+0xa0): undefined reference to `elf32_loadfile' elf_freebsd.c:(.text+0xa0): relocation truncated to fit: R_MIPS_26 = against `elf32_loadfile' = /storage/head/obj//mips.mipsn32/scratch/tmp/bz/head.svn/sys/boot/mips/uboo= t/../../fdt/libfdt.a(fdt_loader_cmd.o): In function `fdt_setup_fdtp': fdt_loader_cmd.c:(.text+0x1bd0): undefined reference to = `elf32_relocation_offset' fdt_loader_cmd.c:(.text+0x1bd4): undefined reference to = `elf32_relocation_offset' --- ubldr --- *** [ubldr] Error code 1 bmake: stopped in /scratch/tmp/bz/head.svn/sys/boot/mips/uboot --- all --- *** [all] Error code 1 From owner-freebsd-mips@freebsd.org Thu Mar 3 20:22:24 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F84FA942AB for ; Thu, 3 Mar 2016 20:22:24 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::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 90745EF6 for ; Thu, 3 Mar 2016 20:22:23 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lb0-x234.google.com with SMTP id x1so37508212lbj.3 for ; Thu, 03 Mar 2016 12:22:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to; bh=AunVcWtzbVG49D3pQJk9+VMOdpVEJNWHiZWjsEiKaxc=; b=eDOSU4K1cgZCyHRCGqeans4mZ3U9prlxUAVxMXaO9cOSR8FJvLKGbutS9nVYi5ZXC9 jzOWzEE4VFTY8jvv1OEUYWxxM/dyTtKteRCk+F1T8XPxQXWQ47gFZBDp7RwwZgxGEs4B aHEFFq+08jk39GDBPZfejDC3zgYM/PC+1U1p7Z2y4ED6gnfUz7OHqhJK6YNGjFinHx92 W9lVGZI22p8sP6Hw5E9i7MYyWDpqYs8Ii1FU392sjxoAdOvqQmyS42+p3MHqMFNkImuX u4mfUjZq1UQcZEP7a+rDymo//foO8UNtNUvB+9KJhR6iOYNdxs9Tajl8yBdHqjxsMFLh ipcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to; bh=AunVcWtzbVG49D3pQJk9+VMOdpVEJNWHiZWjsEiKaxc=; b=AFFVHQgbh1iNxvqaUSrQWdCPm5AhcYcrOsAm6T+VlizICpfTzsEdmnV9puQdDfJy/q aANcv6oUje89zfDN1i+5F12UxdgkoyLPAAOLByXo+wMwWZ4KJHba000DBIke3Gb1YNHG BqZ1CgYDEnQAMlkmyNQWniF4vBhrkazO0yyEeJWmleZj32VdRdxwaP0Yzvh/wdqmDrUM Wu8RolBuIkup2oCxxlZQVjstxsItEhNiaKJiSSxucqOLcrvAg9cGXa6V5wIdE3YEhYfW dGun02hp2QhFWHeFyoSu5TZoR6Aa3xMLsbYYt1/m2rSBUIbhIUGOuqufemiMd/u0yINq q2pw== X-Gm-Message-State: AD7BkJIZk0JLGaTS22SWseeE5H4fZT+792MCalb/Bi0yTmSBA72axA2mfexpDnl/Kw5ZiSTD4T8KSBtnV/RgNg== MIME-Version: 1.0 X-Received: by 10.25.152.135 with SMTP id a129mr1844831lfe.40.1457036541456; Thu, 03 Mar 2016 12:22:21 -0800 (PST) Received: by 10.112.180.138 with HTTP; Thu, 3 Mar 2016 12:22:21 -0800 (PST) Date: Thu, 3 Mar 2016 23:22:21 +0300 Message-ID: Subject: [BCM4718] Broken interrupts From: Michael Zhilin To: freebsd-mips@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Mar 2016 20:22:24 -0000 Hi, I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS RT-N16). Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual problem is broken interrupts. After enabling of interrupts in autoconf.c:configure_final the MipsException code is called, it works fine (including INTRNG), but cpu doesn't return to main thread (suprise!). I can see printf from clockintr, i.e. there are regular timer requests. But there is no printf from main thread (autoconf.c) after enabling of interrupts. Also I've tried to simplify MipsException to avoid any issue with saving/restoring registers: mfc0 k0, MIPS_COP_0_EXC_PC rfe jr k0 but still there is no return to main thread. I'm not familiar with JTAG and have no JTAG adapter for debugging. :( To be honest, I've lost hope. What could possibly be wrong? Here is github branch for reference: https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x Thank you in advance, Michael From owner-freebsd-mips@freebsd.org Fri Mar 4 05:39:18 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A8B9D98DC for ; Fri, 4 Mar 2016 05:39:18 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (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 81125A84 for ; Fri, 4 Mar 2016 05:39:18 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id p65so5716045wmp.1 for ; Thu, 03 Mar 2016 21:39:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=5HKB8w7SioFc+CU+LgmAOlpmKhxNS+CW+Odgr16+OkU=; b=D03VahD1abw22hZ07yu8VabOroMJkFk+PdODs5SHUWJWicBxiO9yk+Ded9Yb6TWNKy jAPgeCRYZoKAVG09dTP5kX1l+lxaSqz3jbje45vnvvPQ0bPW3ewQmGFL1e787PuvXdJN Awx65X1dpZfPXMvPxev4tmhgZPz9oFCWBKlayunoS/mYs8NiumMDMCGS1bguHy8QEcxS t51SR1A19qf621OmRfHOm9TEdbqC20cHiAnikyxeCddxcS5aVmynNmR0FC9wqT4mVgUd EOyFINZDHi/QDcAJyRvIyG8+pkAABCLyq1Kkif+GCwem4tY6Nr77d1pqRQPX/KYFx2lc dAbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=5HKB8w7SioFc+CU+LgmAOlpmKhxNS+CW+Odgr16+OkU=; b=T+ogJUSFy9Fq83p7b8PeO6QIiEU3kM8eJACTXEaVZvt/Bc/dxWNy2ejZcFtR7H6KhX yyoAK/I1H31yIZ0pIjxfI+QpG1iX2AylUZCT5cA0Dy9zEWX9gCo7hK2/Z2Zhp70ILhuh hwjHTubDlbgdeN2bRj+e2s0GnLQo4bwWsD8CmIaue8SPz4zCX8QON92ed3bZc68QUnHC mR1+QJIH7X/Yv1XeSaX0qou6H0M4Oh4TirRrjjB0Q4Fp2pfzyW10Nz+zlutv2UJksmE7 oezsnVdOuFhsr455qRViTV11ZKhqxkEk4QY+PDiLUtB3llVukazdMSSlZXu1uM3eBQiv Dq/g== X-Gm-Message-State: AD7BkJKzNNJ6KhO9ZIjCs8yh/tNrnVMxA1K8Xl/u/KWwJ/FiEaaAnp+6ry12JSCKHEfSJg== X-Received: by 10.194.63.75 with SMTP id e11mr6702131wjs.79.1457069956467; Thu, 03 Mar 2016 21:39:16 -0800 (PST) Received: from [10.0.50.9] ([94.155.70.123]) by smtp.gmail.com with ESMTPSA id 74sm1596375wmn.17.2016.03.03.21.39.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Mar 2016 21:39:15 -0800 (PST) Subject: Re: mipsn32 uboot fails to build Mime-Version: 1.0 (Mac OS X Mail 9.0 \(3094\)) Content-Type: multipart/signed; boundary="Apple-Mail=_18A76BCA-C08B-450C-90F5-D965AE3480D0"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Stanislav Galabov In-Reply-To: <8A555877-759D-42BD-B360-3C7832D414FD@lists.zabbadoz.net> Date: Fri, 4 Mar 2016 07:39:09 +0200 Cc: Stanislav Galabov , freebsd-mips@FreeBSD.org Message-Id: <6BE9C58C-9CE3-4D08-8304-440E4A766142@gmail.com> References: <8A555877-759D-42BD-B360-3C7832D414FD@lists.zabbadoz.net> To: "Bjoern A. Zeeb" X-Mailer: Apple Mail (2.3094) X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 05:39:18 -0000 --Apple-Mail=_18A76BCA-C08B-450C-90F5-D965AE3480D0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi Bjoern, Fixed in http://svnweb.freebsd.org/changeset/base/296378 . Sorry for the inconvenience. Best wishes, Stanislav > On Mar 3, 2016, at 13:51, Bjoern A. Zeeb = wrote: >=20 > Hi, >=20 > can someone please fix this? >=20 > =3D=3D=3D> sys/boot/mips/uboot (all) > metadata.o: In function `md_copymodules': > = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :228: undefined reference to `elf32_relocation_offset' > = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :228: undefined reference to `elf32_relocation_offset' > metadata.o: In function `md_load': > = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :348: undefined reference to `elf32_relocation_offset' > = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :348: undefined reference to `elf32_relocation_offset' > = /scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common/metadata.c= :356: undefined reference to `elf32_relocation_offset' > = metadata.o:/scratch/tmp/bz/head.svn/sys/boot/mips/uboot/../../uboot/common= /metadata.c:356: more undefined references to `elf32_relocation_offset' = follow > = /storage/head/obj//mips.mipsn32/scratch/tmp/bz/head.svn/sys/boot/mips/uboo= t/../../uboot/lib/libuboot.a(elf_freebsd.o): In function = `elf32_uboot_load': > elf_freebsd.c:(.text+0xa0): undefined reference to `elf32_loadfile' > elf_freebsd.c:(.text+0xa0): relocation truncated to fit: R_MIPS_26 = against `elf32_loadfile' > = /storage/head/obj//mips.mipsn32/scratch/tmp/bz/head.svn/sys/boot/mips/uboo= t/../../fdt/libfdt.a(fdt_loader_cmd.o): In function `fdt_setup_fdtp': > fdt_loader_cmd.c:(.text+0x1bd0): undefined reference to = `elf32_relocation_offset' > fdt_loader_cmd.c:(.text+0x1bd4): undefined reference to = `elf32_relocation_offset' > --- ubldr --- > *** [ubldr] Error code 1 >=20 > bmake: stopped in /scratch/tmp/bz/head.svn/sys/boot/mips/uboot > --- all --- > *** [all] Error code 1 >=20 > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to = "freebsd-mips-unsubscribe@freebsd.org" --Apple-Mail=_18A76BCA-C08B-450C-90F5-D965AE3480D0 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 iQEcBAEBCgAGBQJW2R9+AAoJEIKmgXSGgsogMbQH/R53dNfrN+K7hNoroKL1TrQv DRj24WOSwKrqGA0qM/Bd7ltaSnDq+gFK9XVYLVQZ7uG+zDzRmgRsLkh+hEYpiR/u 4F9hP1ZY3+5v3lNTxYXVR00zYsc97F8o0tbDlqDgrHo8ITrgONliMJgkCexuNJ3n 5eXs988lUwHrL22GjQegyH1xk7YD1YCnIf/zkzVXZLfl53hFKYMoyYgL1fsAW+8P CbUXS5yKVhf04FsNgmuOvMuluojd3ZPChP0sz7YFMnEKk5WNVFEtHeGbxi5Jyhbh 3AEUYQQfRQE/UTy0L7VXPcK1kqRU06VH/giJbcJGQQHKbpk3vEO5eVycA4xTWhM= =1mL4 -----END PGP SIGNATURE----- --Apple-Mail=_18A76BCA-C08B-450C-90F5-D965AE3480D0-- From owner-freebsd-mips@freebsd.org Fri Mar 4 08:56:16 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C72C89D99EA for ; Fri, 4 Mar 2016 08:56:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22a.google.com (mail-io0-x22a.google.com [IPv6:2607:f8b0:4001:c06::22a]) (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 93BD5C4D for ; Fri, 4 Mar 2016 08:56:16 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22a.google.com with SMTP id l127so55919318iof.3 for ; Fri, 04 Mar 2016 00:56:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=/aGpGTqDeU0TXkGMenVcqhgSa2z2gacxbPUzY6znZM4=; b=KhSzSypAAEQOnnO/yJ54aWE9RbKqwKWvlH1CYgGTA0DRiFFv4DTmSAldLGf3/M+ujD 5tkFIcQtLzSTTLlRJ2u8WfL1td87VVHRdV1QQ+d5y0WDMblllCpOY+9cSXlMe1ceN9dJ wGZ0T7hs9V7opOns46I9aqpKILDQ4h5xtPN+kDfvlGJPo5jHOjtU9ebwDlo9CduApfbO BYxe1Zs9VrTfPPe3pXTGY7MntT8GttQ14tx5VyLhZGllLLLDQw2GBKib1dXc0APKu8nW XW5WRJ0jhe+Mcur98VTEb+YjAlOPvZ5RwEkoVUX0TYxOmS/WRuCERUNbYAXciTcQuIF0 H4zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=/aGpGTqDeU0TXkGMenVcqhgSa2z2gacxbPUzY6znZM4=; b=XcuwbTTYLh7EisX8Us+8JBMgPnB4Er31R2kuk3faArPeS5wpJu+kkQWl5GsnHKkie+ mH1JB4Sai2gZLtw8FKiFvywjsxCiwBBXKCrTTxO00HO0GIvXvF7dDdAjC14yroBJW6Zk KKlI8JgX2cGNtI0ppiHton4uF75VnwJRp+teqvt1oY6xeN1LOL6KuUYH5l6E4JWmRXwl 2P1RMCk6VOKUNpqNj0agptNYku7u5h/KKAmNh7RjC6ZwP0A1ukymI5bffpWw+ptOV+EY rt6UI8Mk19JXuXRDtdCMCp/aVefMm7qjyfjQoFKqmDOtVyXYmaua/amrgCQoFFecdpAm reUw== X-Gm-Message-State: AD7BkJL7JncRbe2l4wkP/bRzAfRUvwmppKQdVo6nM4YIMCh53HLJEyzEApbtCDZ1fCVdFtFXK9heLRIJEQ0QqQ== MIME-Version: 1.0 X-Received: by 10.107.11.162 with SMTP id 34mr1857945iol.165.1457081775957; Fri, 04 Mar 2016 00:56:15 -0800 (PST) Received: by 10.36.14.19 with HTTP; Fri, 4 Mar 2016 00:56:15 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 00:56:15 -0800 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Adrian Chadd To: Michael Zhilin Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 08:56:17 -0000 hm, does kdb work (ie ,break to debugger at that point), or is the system hosed? is it something silly like it getting stuck servicing interrupts because they're not being correctly ACKed? -a On 3 March 2016 at 12:22, Michael Zhilin wrote: > Hi, > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS RT-N16). > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual problem > is broken interrupts. After enabling of interrupts in > autoconf.c:configure_final the MipsException code is called, it works fine > (including INTRNG), but cpu doesn't return to main thread (suprise!). > > I can see printf from clockintr, i.e. there are regular timer requests. But > there is no printf from main thread (autoconf.c) after enabling of > interrupts. > > Also I've tried to simplify MipsException to avoid any issue with > saving/restoring registers: > mfc0 k0, MIPS_COP_0_EXC_PC > rfe > jr k0 > > but still there is no return to main thread. > > I'm not familiar with JTAG and have no JTAG adapter for debugging. :( To be > honest, I've lost hope. > > What could possibly be wrong? Here is github branch for reference: > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x > > Thank you in advance, > Michael > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://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 Mar 4 11:19:45 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E398E9DA408 for ; Fri, 4 Mar 2016 11:19:45 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (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 67CD0261 for ; Fri, 4 Mar 2016 11:19:45 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lb0-x229.google.com with SMTP id cf7so40992174lbb.1 for ; Fri, 04 Mar 2016 03:19:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=iI44RCoPqsjjp27vBa7EU4ERfF6H+04QATvL+PSwkiU=; b=n7TKRyzYq0zHdao2j6qZCWW2ld9L/QtNLQaG2M9e6PcdT0KHcuVNOKQx3TVkrj7qkf u7pMWXxw6OvlCDDHMRp31An7cr/Vv7InykY9t/mDNGSQb2S7R6IMEEP2Dkn+IM81IZVZ RDmjMU3JOGtp5bUF+ct/TVu1E8tnhEPnGdY0LChlX9MWHc1v4dFqVS0sBk09z3wI9c5m cR1OnCBJQHwjNj8GPdneGNGRuJDk6ZSAuL/kc7ds/4X788NPQzfNMT3eyqxpvuFtxBt3 rux0cGdRiFwOzW9biUr7IfE8Zhno3N3WKenOPIFu5Bpp2KtxNPLWhO8CoIL1BYuiSO92 BG2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=iI44RCoPqsjjp27vBa7EU4ERfF6H+04QATvL+PSwkiU=; b=b5/0YECnX2SMz1dGoJGhJeu+KcIiZiyL6C9ATMxVZgwIjrz/+rHPD6ur2y2ZSBO16q ndJeSkjIIAh54bnjX0lNrLv9ReDg8CL5tmCTfaJ/fBFQV5ofZPNeb5ay0J+yFXuzsz5G YPQOzDNXl+Fzr8c6EwSAYOl9y3u+ydm1nAeLHkhksqrXTRtpCFxakV3QngV9/aSD21to XlQcRtHZTMdbEoVGgTf1n/GTRKouuOcuriIZnRqLGnRhIJvLAh9CePbj/XY8OcTIJ/S3 c3IC75h5M6vw5RazBfAABrw93a8mgVBqQkV4oxpGGpmoIDxzs61yVzlkmm2R5/PZj9KR cdWA== X-Gm-Message-State: AD7BkJJuIu/fyqmmjVHEQvFUa0p8AgRq0Ix8U1dnfdPqMYSGlsmyR8V0CVs/gnDbgoVcgqVXLwZLOU2iX3z9wg== MIME-Version: 1.0 X-Received: by 10.25.141.65 with SMTP id p62mr2283697lfd.10.1457090383264; Fri, 04 Mar 2016 03:19:43 -0800 (PST) Received: by 10.112.180.138 with HTTP; Fri, 4 Mar 2016 03:19:43 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 14:19:43 +0300 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Michael Zhilin To: Adrian Chadd Cc: "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 11:19:46 -0000 Hi Adrian! Yes, KDB works. And yes, (today's finding) something is silly that force make IRQ5 endless. After processing of previous request, next request is starting. According to mips docs found in google, IRQ5 must be triggered only if count == compare. In my case, count increments on 0x20000 roughly, compare is constant. There is another finding: cause register is always 0x8000, even after call mips_wr_compare(). I suppose that this is possible reason of infinite IRQ5 requests, but still don't know how to fix it... Thx, Michael On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd wrote: > hm, does kdb work (ie ,break to debugger at that point), or is the system > hosed? > > is it something silly like it getting stuck servicing interrupts > because they're not being correctly ACKed? > > > > -a > > > On 3 March 2016 at 12:22, Michael Zhilin wrote: > > Hi, > > > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS RT-N16). > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual > problem > > is broken interrupts. After enabling of interrupts in > > autoconf.c:configure_final the MipsException code is called, it works > fine > > (including INTRNG), but cpu doesn't return to main thread (suprise!). > > > > I can see printf from clockintr, i.e. there are regular timer requests. > But > > there is no printf from main thread (autoconf.c) after enabling of > > interrupts. > > > > Also I've tried to simplify MipsException to avoid any issue with > > saving/restoring registers: > > mfc0 k0, MIPS_COP_0_EXC_PC > > rfe > > jr k0 > > > > but still there is no return to main thread. > > > > I'm not familiar with JTAG and have no JTAG adapter for debugging. :( To > be > > honest, I've lost hope. > > > > What could possibly be wrong? Here is github branch for reference: > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x > > > > Thank you in advance, > > Michael > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > https://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 Mar 4 12:17:16 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35F599DA6B9 for ; Fri, 4 Mar 2016 12:17:16 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-vk0-x232.google.com (mail-vk0-x232.google.com [IPv6:2607:f8b0:400c:c05::232]) (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 E25EFAF6 for ; Fri, 4 Mar 2016 12:17:15 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by mail-vk0-x232.google.com with SMTP id e185so51821441vkb.1 for ; Fri, 04 Mar 2016 04:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=CzJaGfQR2H8hW7CwE2MbT+GoFm5ULrcltMBpqhscA24=; b=QEsyi8X2vC/4Xpl5SbDTCP3Ns7i526ZReRCS5ZnPwK8b9D8psP8BkmP3j1Nr6OkkWN gt2iV+pA7zbyRoelCo9+j+lt8gDq3nQUVMcPl2reVOSliw1bd+neKJhidZxweexF+z2G dVqiMS3eM7enDLmTPENgcmtcZRCOct3dUq9dQin4MZf5Yyb+DVh37x7IHEVTHxfOMIKU kh8Lx0PE+6Js/Fbau+LkBkjuAfY2IDbwqMdOINN8rg1ktVhyIVQ5Q51ei8oCjESDH8zt rlHwgaUHZ4lsGTYDVfyTv8xVag3FeNpgRTSvnzJ8jSeaO9NVO76Fo7j0DbMsNORTYFK0 Dsuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=CzJaGfQR2H8hW7CwE2MbT+GoFm5ULrcltMBpqhscA24=; b=Rh1jSlrffmFBP7/dBig2P9cyugmfP58kPRiYuZF/5oM7jJ/U4tI0kaXeIKIU/sIl4D 4NSZ1/0PPfvRSRqdd3TwmT00gaCli18i2Xc2JOSZWJzlU1DZkJFKvvI4dZ4zZl+bz6Ot +l87t0Cy2a+F5r1EPu3z2Vp5Uxgb/RoYLQrO8uknlHGf0X0eGOQUM2RbkAfN50ApQCsN h23HDhXITG5nlv27bUTxj4LwXt7HAgsWI1ak+9nYcwmZ2F0Zs8/FB8wNlv0w4Y/ee/1q /pUECoop1dy+hVydBBJIoC5a/YM7lY8I35C3c0TwoH9Z7cNGHy0bHiUMBKlqweJCe3pc fGQQ== X-Gm-Message-State: AD7BkJJ9/DvaE7M/MG+maNDzXyumuFaDzXRS5G71B5eWDlBfR/dMtDBdqO3WzJf4u7m7xXJfib5wNAsGId2+Zw== MIME-Version: 1.0 X-Received: by 10.31.45.143 with SMTP id t137mr5887308vkt.143.1457093834911; Fri, 04 Mar 2016 04:17:14 -0800 (PST) Received: by 10.31.183.147 with HTTP; Fri, 4 Mar 2016 04:17:14 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 14:17:14 +0200 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Stanislav Galabov To: Michael Zhilin Cc: Adrian Chadd , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 12:17:16 -0000 Hi Michael, If I understand correctly the goal is to use INTRNG for MIPS? If so, I didn't notice 'options MIPS_INTRNG' anywhere in your kernel config files... Please try to add this to your sys/mips/bcm471x/std.bcm471x for example and let us know how this goes. Best wishes, Stanislav On Fri, Mar 4, 2016 at 1:19 PM, Michael Zhilin wrote: > Hi Adrian! > > Yes, KDB works. And yes, (today's finding) something is silly that force > make IRQ5 endless. After processing of previous request, next request is > starting. According to mips docs found in google, IRQ5 must be triggered > only if count == compare. In my case, count increments on 0x20000 roughly, > compare is constant. There is another finding: cause register is always > 0x8000, even after call mips_wr_compare(). I suppose that this is possible > reason of infinite IRQ5 requests, but still don't know how to fix it... > > Thx, > Michael > > On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd > wrote: > > > hm, does kdb work (ie ,break to debugger at that point), or is the system > > hosed? > > > > is it something silly like it getting stuck servicing interrupts > > because they're not being correctly ACKed? > > > > > > > > -a > > > > > > On 3 March 2016 at 12:22, Michael Zhilin wrote: > > > Hi, > > > > > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS > RT-N16). > > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual > > problem > > > is broken interrupts. After enabling of interrupts in > > > autoconf.c:configure_final the MipsException code is called, it works > > fine > > > (including INTRNG), but cpu doesn't return to main thread (suprise!). > > > > > > I can see printf from clockintr, i.e. there are regular timer requests. > > But > > > there is no printf from main thread (autoconf.c) after enabling of > > > interrupts. > > > > > > Also I've tried to simplify MipsException to avoid any issue with > > > saving/restoring registers: > > > mfc0 k0, MIPS_COP_0_EXC_PC > > > rfe > > > jr k0 > > > > > > but still there is no return to main thread. > > > > > > I'm not familiar with JTAG and have no JTAG adapter for debugging. :( > To > > be > > > honest, I've lost hope. > > > > > > What could possibly be wrong? Here is github branch for reference: > > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x > > > > > > Thank you in advance, > > > Michael > > > _______________________________________________ > > > freebsd-mips@freebsd.org mailing list > > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips > > > To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org > " > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > https://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 Mar 4 12:31:20 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C1D69DA10C for ; Fri, 4 Mar 2016 12:31:20 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lb0-x233.google.com (mail-lb0-x233.google.com [IPv6:2a00:1450:4010:c04::233]) (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 EC293D17 for ; Fri, 4 Mar 2016 12:31:19 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lb0-x233.google.com with SMTP id x1so59196128lbj.3 for ; Fri, 04 Mar 2016 04:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=mHoNUe+9j3cAlkNuxzMcSx7UYzkTFkcdFWJ2spCWHEA=; b=eac0jHdcqFgwoeovUeWen/nc2IHxAd4Dvon+ekCN4l5SOqa5gA8MWepuvqBhKo4gwL xpguuimMkYsfKIrKezUs+/Km+6xoccN/63ynzytbBMxGyK6aBazAdzvRR0QP2KvhxPar rOBrif+CwotWBd+3hbrsh+wvpPY7U+K7F+nk8EyjXW2iRX4cGL5z6d+ovKabqa7WN2kd xXij71rorer7U1KUB7IKI0HsutHLDpu7m42eusmeq407Xa8FWLEBRfYRh6FvBuphnTX5 qNmSjORZcMSIVTDOFB7grBPHGkRg4e9b34qqF2l5V39mfOYaOngDD5FyT/fJpQzVyxwZ /ZRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=mHoNUe+9j3cAlkNuxzMcSx7UYzkTFkcdFWJ2spCWHEA=; b=MGzlt7MttX8ckPXhXic7PD3xxM5C/EBknsttyNyGTVnWmpMyLVGSO3TnGJWrHTxJHL NE4UxKSiZMP2/aI94fMFGG2Z1qvYFNICvCl4/ERzL3gZqNP+UjC4Za3gxTo+ZUueLHkL OiE/sgN0NhrPWkpmJX5cJqEq2GZ4yKxPYCF7CuLdhqfOjE5iv/jY2h2VoD0PZM1PwiE0 H5SChV4s7bHVqqwDF2SQF8C7+fiyelF8mJuYjolT9ldqy16cMVg4WVnh4u6teG4ECbtX zCaD4r1WBZOK36quaDfjAVLJ+fJ31EWstG4OKrNN0uVvBhPwFkTqiSCcfDU9eGvW0JLp gJIQ== X-Gm-Message-State: AD7BkJK+03iMR4vFYu2MntC7FZcrdj4c1FBjo7DYRcSO1Oq0Knw5N99db8y4ElizDdNoPe1eLFTWUiDgrTZfBw== MIME-Version: 1.0 X-Received: by 10.25.81.144 with SMTP id f138mr2974421lfb.146.1457094677677; Fri, 04 Mar 2016 04:31:17 -0800 (PST) Received: by 10.112.180.138 with HTTP; Fri, 4 Mar 2016 04:31:17 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 15:31:17 +0300 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Michael Zhilin To: Stanislav Galabov Cc: Adrian Chadd , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 12:31:20 -0000 Hi Stanislav, The option is here: https://github.com/Cka3o4Huk/freebsd/blob/user/mizhka/bcm471x/sys/mips/conf/BCM471x#L39. To verify that build handled it I've check it using objdump -S exception.o. INTRNG works fine: MipsKernIntr calls intr_handler from subr_intr and routes to clock. I suppose this behaviou's specific to particular MIPS processor (BCM4718). Thx, Michael On Fri, Mar 4, 2016 at 3:17 PM, Stanislav Galabov wrote: > Hi Michael, > > If I understand correctly the goal is to use INTRNG for MIPS? > If so, I didn't notice 'options MIPS_INTRNG' anywhere in your kernel > config files... > Please try to add this to your sys/mips/bcm471x/std.bcm471x for example > and let us know how this goes. > > Best wishes, > Stanislav > > On Fri, Mar 4, 2016 at 1:19 PM, Michael Zhilin wrote: > >> Hi Adrian! >> >> Yes, KDB works. And yes, (today's finding) something is silly that force >> make IRQ5 endless. After processing of previous request, next request is >> starting. According to mips docs found in google, IRQ5 must be triggered >> only if count == compare. In my case, count increments on 0x20000 roughly, >> compare is constant. There is another finding: cause register is always >> 0x8000, even after call mips_wr_compare(). I suppose that this is possible >> reason of infinite IRQ5 requests, but still don't know how to fix it... >> >> Thx, >> Michael >> >> On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd >> wrote: >> >> > hm, does kdb work (ie ,break to debugger at that point), or is the >> system >> > hosed? >> > >> > is it something silly like it getting stuck servicing interrupts >> > because they're not being correctly ACKed? >> > >> > >> > >> > -a >> > >> > >> > On 3 March 2016 at 12:22, Michael Zhilin wrote: >> > > Hi, >> > > >> > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS >> RT-N16). >> > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual >> > problem >> > > is broken interrupts. After enabling of interrupts in >> > > autoconf.c:configure_final the MipsException code is called, it works >> > fine >> > > (including INTRNG), but cpu doesn't return to main thread (suprise!). >> > > >> > > I can see printf from clockintr, i.e. there are regular timer >> requests. >> > But >> > > there is no printf from main thread (autoconf.c) after enabling of >> > > interrupts. >> > > >> > > Also I've tried to simplify MipsException to avoid any issue with >> > > saving/restoring registers: >> > > mfc0 k0, MIPS_COP_0_EXC_PC >> > > rfe >> > > jr k0 >> > > >> > > but still there is no return to main thread. >> > > >> > > I'm not familiar with JTAG and have no JTAG adapter for debugging. :( >> To >> > be >> > > honest, I've lost hope. >> > > >> > > What could possibly be wrong? Here is github branch for reference: >> > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x >> > > >> > > Thank you in advance, >> > > Michael >> > > _______________________________________________ >> > > freebsd-mips@freebsd.org mailing list >> > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips >> > > To unsubscribe, send any mail to " >> freebsd-mips-unsubscribe@freebsd.org" >> > >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> https://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 Mar 4 12:33:20 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D599DA2F5 for ; Fri, 4 Mar 2016 12:33:20 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: from mail-vk0-x22b.google.com (mail-vk0-x22b.google.com [IPv6:2607:f8b0:400c:c05::22b]) (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 BE090FD7 for ; Fri, 4 Mar 2016 12:33:19 +0000 (UTC) (envelope-from sgalabov@gmail.com) Received: by mail-vk0-x22b.google.com with SMTP id e6so52090379vkh.2 for ; Fri, 04 Mar 2016 04:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=PdrN2U5pmvdyGc+fGqF3B/Qzd1B5VXU0VQ8PTv1vUeQ=; b=sWeE8Vgol8d2qtnZpOtpuoPASE11CtSVDUXN/5zcPUgSwr9JYpEnDx6WJ3bwDvvACb nvgxgYmK6UsH6Ac8OaHWDQLnp6dwarap4ee9keINw+NO3+87Kk3Pj1HbNt0gEaLP99jK +8kIN9PMPcsHwgbxShrRWlHWNU7WhXHcJNNQljZzU0O29j3/5Z+IRw+V+PxWAmqGrp47 hMU6AoCAogCLm1/MVzJzkFA2neU/hTyU3GvPISUxAH35V1MgZRVBUEnCVo1h2muyApB/ UO16iCEt8ynIFFqBBurcftEtZSMpgMs0VYt5tRKEchQi3Gm+MYqytB9uz11tcIHs486i 74QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=PdrN2U5pmvdyGc+fGqF3B/Qzd1B5VXU0VQ8PTv1vUeQ=; b=TPxHgGeJbNA50sJq2Oar7ShQRqZjW8hvWjz0Ip+NEYOc0xloT0sdbp+of1pCYqiy4W DcOMFqptZ0VmAaPqX/1WLHLkh0RrW1l1nBUofjcVCe4YIe/t76ztpC1F+abvrJHIbelm v86JNI46pX5B8YaB5OniZHWMozLwj9GtbzBjcmsWwBlT6ceSyT1pprrqZ8VfrVGoF2rB 2WYVYoehVU/A+W7yscucu7hhL5+1PUdwx3BIO2KQTkQeI502RM7k9KDoon+ebGeyQiXe uWbjkicaIzQ+pmguUXdxbFfQTaY99L1JlFqnUeVc8aVc2ak+bHPyZjO3J8HUWLeMklpK QjrQ== X-Gm-Message-State: AD7BkJLrMKSP/1xmLeOom9Ap6oU3td2atXIShBlo4F85ROUIegSiX98lDYIER7j8ktMslBPcAG2K5GmTue/7ug== MIME-Version: 1.0 X-Received: by 10.31.45.143 with SMTP id t137mr5934204vkt.143.1457094798756; Fri, 04 Mar 2016 04:33:18 -0800 (PST) Received: by 10.31.183.147 with HTTP; Fri, 4 Mar 2016 04:33:18 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 14:33:18 +0200 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Stanislav Galabov To: Michael Zhilin Cc: Adrian Chadd , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 12:33:20 -0000 Also, before doing that, you'll have to add: MIPS_INTRNG opt_global.h to the end of sys/conf/options.mips Adrian, we somehow missed that in the commit of https://reviews.freebsd.org/D5182 although it is in the last diff I had attached... I'll put up a review for this on monday. Best wishes, Stanislav On Fri, Mar 4, 2016 at 2:17 PM, Stanislav Galabov wrote: > Hi Michael, > > If I understand correctly the goal is to use INTRNG for MIPS? > If so, I didn't notice 'options MIPS_INTRNG' anywhere in your kernel > config files... > Please try to add this to your sys/mips/bcm471x/std.bcm471x for example > and let us know how this goes. > > Best wishes, > Stanislav > > On Fri, Mar 4, 2016 at 1:19 PM, Michael Zhilin wrote: > >> Hi Adrian! >> >> Yes, KDB works. And yes, (today's finding) something is silly that force >> make IRQ5 endless. After processing of previous request, next request is >> starting. According to mips docs found in google, IRQ5 must be triggered >> only if count == compare. In my case, count increments on 0x20000 roughly, >> compare is constant. There is another finding: cause register is always >> 0x8000, even after call mips_wr_compare(). I suppose that this is possible >> reason of infinite IRQ5 requests, but still don't know how to fix it... >> >> Thx, >> Michael >> >> On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd >> wrote: >> >> > hm, does kdb work (ie ,break to debugger at that point), or is the >> system >> > hosed? >> > >> > is it something silly like it getting stuck servicing interrupts >> > because they're not being correctly ACKed? >> > >> > >> > >> > -a >> > >> > >> > On 3 March 2016 at 12:22, Michael Zhilin wrote: >> > > Hi, >> > > >> > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS >> RT-N16). >> > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual >> > problem >> > > is broken interrupts. After enabling of interrupts in >> > > autoconf.c:configure_final the MipsException code is called, it works >> > fine >> > > (including INTRNG), but cpu doesn't return to main thread (suprise!). >> > > >> > > I can see printf from clockintr, i.e. there are regular timer >> requests. >> > But >> > > there is no printf from main thread (autoconf.c) after enabling of >> > > interrupts. >> > > >> > > Also I've tried to simplify MipsException to avoid any issue with >> > > saving/restoring registers: >> > > mfc0 k0, MIPS_COP_0_EXC_PC >> > > rfe >> > > jr k0 >> > > >> > > but still there is no return to main thread. >> > > >> > > I'm not familiar with JTAG and have no JTAG adapter for debugging. :( >> To >> > be >> > > honest, I've lost hope. >> > > >> > > What could possibly be wrong? Here is github branch for reference: >> > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x >> > > >> > > Thank you in advance, >> > > Michael >> > > _______________________________________________ >> > > freebsd-mips@freebsd.org mailing list >> > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips >> > > To unsubscribe, send any mail to " >> freebsd-mips-unsubscribe@freebsd.org" >> > >> _______________________________________________ >> freebsd-mips@freebsd.org mailing list >> https://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 Mar 4 13:10:07 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B6EF9DB445 for ; Fri, 4 Mar 2016 13:10:07 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lb0-x229.google.com (mail-lb0-x229.google.com [IPv6:2a00:1450:4010:c04::229]) (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 A0DE198B for ; Fri, 4 Mar 2016 13:10:06 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lb0-x229.google.com with SMTP id k15so60465734lbg.0 for ; Fri, 04 Mar 2016 05:10:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=YmNcy5CuA+RsA4Bub96eukcFTGM2Sukcu+nGG4Kzaok=; b=Ss+nvyGM7UqxacNP3Y7qIFAXNnPEJnzFgr5YMTe4+eal1ig5qSiLjWY1IzZIfrrd3p uweLGTXjNXko66Q9fEgyyrCarphVDkooFDeOdqRDKeKtjbfCiR/ZnCakutoRmUB+Ypn4 QAL967kr1f5QXeKrOhTiQ/BBC9GBbviCwZAxQkXtE4Sx/M1ljYuZCHqfRFWXGrNQQDW4 /cSZc+eUXWYIzwXzxpzGzKtbq8VaX8zD0eZOtJwBKeE//pYTXBKPv4yYQSV1BhPjX6Kr IbRcNWRNdeH6zpVJFsC2WHXresCFczT9WP8JcGjsqQQadrCPAoVn9dBtYThd2xf420P8 BdBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=YmNcy5CuA+RsA4Bub96eukcFTGM2Sukcu+nGG4Kzaok=; b=GIvDfrTFvlM66SNjKTZcN9T33Rad7omHuzQ148CHH6FWj1LActNRGoouCxRnA5u99q kJFJDmKWWiAAKXpdWLXw8wdK8+pfsUkxNglLOp3+/ZZTyC4L3TYa9nAi0vPfr4SXXLDi GhN2Pf6UrQJOyfC7fFNnvZdqyceB831HRKNLmeKn4XuKC78PxC4/NwMOD44K4JuucIox PTa2v8s5fnQIAVei+sfPE6FeAj19KZLsD+QAAskD55o4EDSIujl8I5eYpPvJ3YsPk2RX N4jnDd/10PaOHEd4hDhlEESJdthZKXKSwqfeJSOcqf19a4JkhA//4aKhInf5JqeBfiNZ H10w== X-Gm-Message-State: AD7BkJLOzPeonaFJsbe9oIOZ+L/JYp1FxWU71c8K9GmncEwBtDEAISAdOaoSBx9r+Cpe46XpgijYjMJZ812HxA== MIME-Version: 1.0 X-Received: by 10.25.141.65 with SMTP id p62mr2420641lfd.10.1457097004760; Fri, 04 Mar 2016 05:10:04 -0800 (PST) Received: by 10.112.180.138 with HTTP; Fri, 4 Mar 2016 05:10:04 -0800 (PST) In-Reply-To: References: Date: Fri, 4 Mar 2016 16:10:04 +0300 Message-ID: Subject: Re: [BCM4718] Broken interrupts From: Michael Zhilin To: Stanislav Galabov Cc: Adrian Chadd , "freebsd-mips@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 13:10:07 -0000 Stanislav, I've added to BCM471x: makeoptions MIPS_INTRNG options MIPS_INTRNG to options.mips: MIPS_INTRNG opt_global.h Then removed all kernel object files and run buildkernel (thank you, Adrian, for freebsd-wifi-build scripts!). But it's still same behavior. Here is output of printfs before and after clock_intr: cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f2fe11a cmp=deadc0bb cause=8000 after clock_intr cnt=f45c9e6 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f6225e7 cmp=ffffffff cause=8000 after clock_intr cnt=f780e46 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=f946b1e cmp=ffffffff cause=8000 after clock_intr cnt=faa548a cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=fc6b178 cmp=ffffffff cause=8000 after clock_intr cnt=fdc9ae6 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=ff8f7b8 cmp=ffffffff cause=8000 after clock_intr cnt=100ee112 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=102b8fa8 cmp=ffffffff cause=8000 after clock_intr cnt=1041cc94 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=105e7b26 cmp=ffffffff cause=8000 after clock_intr cnt=1074b6c8 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10916586 cmp=ffffffff cause=8000 after clock_intr cnt=10a7a24c cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10c4510a cmp=ffffffff cause=8000 after clock_intr cnt=10da8c62 cmp=ffffffff cause=8000 cpupic0: Servicing interrupt 7 before clock_intr(0x80528100) cnt=10f73c6e cmp=ffffffff cause=8000 after clock_intr cnt=110d7838 cmp=ffffffff cause=8000 As I mentioned before, there are 2 symptoms: * cnt != cmp for IRQ5 triggering * cause is always 8000 (i.e. IP7 = 1) even after mips_wr_compare. Thanks! On Fri, Mar 4, 2016 at 3:33 PM, Stanislav Galabov wrote: > Also, before doing that, you'll have to add: > MIPS_INTRNG opt_global.h > to the end of sys/conf/options.mips > > Adrian, we somehow missed that in the commit of > https://reviews.freebsd.org/D5182 although it is in the last diff I had > attached... I'll put up a review for this on monday. > > Best wishes, > Stanislav > > On Fri, Mar 4, 2016 at 2:17 PM, Stanislav Galabov > wrote: > >> Hi Michael, >> >> If I understand correctly the goal is to use INTRNG for MIPS? >> If so, I didn't notice 'options MIPS_INTRNG' anywhere in your kernel >> config files... >> Please try to add this to your sys/mips/bcm471x/std.bcm471x for example >> and let us know how this goes. >> >> Best wishes, >> Stanislav >> >> On Fri, Mar 4, 2016 at 1:19 PM, Michael Zhilin wrote: >> >>> Hi Adrian! >>> >>> Yes, KDB works. And yes, (today's finding) something is silly that force >>> make IRQ5 endless. After processing of previous request, next request is >>> starting. According to mips docs found in google, IRQ5 must be triggered >>> only if count == compare. In my case, count increments on 0x20000 >>> roughly, >>> compare is constant. There is another finding: cause register is always >>> 0x8000, even after call mips_wr_compare(). I suppose that this is >>> possible >>> reason of infinite IRQ5 requests, but still don't know how to fix it... >>> >>> Thx, >>> Michael >>> >>> On Fri, Mar 4, 2016 at 11:56 AM, Adrian Chadd >>> wrote: >>> >>> > hm, does kdb work (ie ,break to debugger at that point), or is the >>> system >>> > hosed? >>> > >>> > is it something silly like it getting stuck servicing interrupts >>> > because they're not being correctly ACKed? >>> > >>> > >>> > >>> > -a >>> > >>> > >>> > On 3 March 2016 at 12:22, Michael Zhilin wrote: >>> > > Hi, >>> > > >>> > > I'm trying to load FreeBSD kernel on Broadcom MIPS router (ASUS >>> RT-N16). >>> > > Here is actual dmesg: http://pastebin.com/AtEz6kc9 . But my actual >>> > problem >>> > > is broken interrupts. After enabling of interrupts in >>> > > autoconf.c:configure_final the MipsException code is called, it works >>> > fine >>> > > (including INTRNG), but cpu doesn't return to main thread (suprise!). >>> > > >>> > > I can see printf from clockintr, i.e. there are regular timer >>> requests. >>> > But >>> > > there is no printf from main thread (autoconf.c) after enabling of >>> > > interrupts. >>> > > >>> > > Also I've tried to simplify MipsException to avoid any issue with >>> > > saving/restoring registers: >>> > > mfc0 k0, MIPS_COP_0_EXC_PC >>> > > rfe >>> > > jr k0 >>> > > >>> > > but still there is no return to main thread. >>> > > >>> > > I'm not familiar with JTAG and have no JTAG adapter for debugging. >>> :( To >>> > be >>> > > honest, I've lost hope. >>> > > >>> > > What could possibly be wrong? Here is github branch for reference: >>> > > https://github.com/Cka3o4Huk/freebsd/tree/user/mizhka/bcm471x >>> > > >>> > > Thank you in advance, >>> > > Michael >>> > > _______________________________________________ >>> > > freebsd-mips@freebsd.org mailing list >>> > > https://lists.freebsd.org/mailman/listinfo/freebsd-mips >>> > > To unsubscribe, send any mail to " >>> freebsd-mips-unsubscribe@freebsd.org" >>> > >>> _______________________________________________ >>> freebsd-mips@freebsd.org mailing list >>> https://lists.freebsd.org/mailman/listinfo/freebsd-mips >>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org" >>> >> >> >