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" >> > >