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