From: ben bodley <benb@m2tech.co.nz>
To: Wentao Xu <xuwentao@yahoo.com>
Cc: mailing list <linuxppc-embedded@lists.linuxppc.org>
Subject: Re: why open("dev/console",O_RDWR,0) get stuck
Date: Thu, 29 Jun 2000 11:28:48 +1200 [thread overview]
Message-ID: <395A8A30.5D99549A@m2tech.co.nz> (raw)
In-Reply-To: 20000627095430.17482.qmail@web2105.mail.yahoo.com
Wentao Xu wrote:
> I have the code from Monta Vista on my prietary board,
> I find
> it get stuck in the open("dev/console",..) in fucntion
> init()
> in init/main.c, just before to start the shell from
> ramdisk.
> So I put a printk("ppc405_uic_enable\n") in function
> ppc405_uic_enable()
> and a printk("ppc405_uic_disable_and_ack\n") in
> function ppc405_uic_disable_and_ack().
> both functions are in file
> arch\ppc\kernel\ppc4xx_pic.c.
>
> At last I found a output of infinite train of
> ppc405_uic_enable
> ppc405_uic_disable_and_ack
> ppc405_uic_enable
> ppc405_uic_disable_and_ack
> ppc405_uic_enable
> ppc405_uic_disable_and_ack
> ppc405_uic_enable
> ppc405_uic_disable_and_ack
> ........,
>
>
this is occuring because you have not set the polarity/level of the interrupt
pin correctly.. you must set the DCRs, UICPR (defines the polarity of the
interrupt), and UICTR (which defines whether the pin is level or edge
triggered, this is for external interrupts)...
-----------
example: to set an external irq pin to positve, edge triggered:-
unsigned long uicpr, uictr;
uicpr = mfdcr(DCRN_UICPR);
uicpr |= 1 << (31 - IRQ_NO);
mtdcr(DCRN_UICPR, uicpr);
uictr = mfdcr(DCRN_UICTR);
uictr |= 1 << (31 - IRQ_NO);
mtdcr(DCRN_UICTR, uictr);
----------
whats happening is the interrupt is going off constantly, as the pins default
to negative, level triggering... see ibm stb guide chapter 6 for more info..
cheers,
ben
--
/\\------------------------------------------------------------------
:::::::::::..ben.b..m2technologyltd.nz..64.9.4448307.130..:::::::::::
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-06-28 23:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-27 9:54 why open("dev/console",O_RDWR,0) get stuck Wentao Xu
2000-06-28 23:28 ` ben bodley [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-06-29 3:23 Wentao Xu
2000-06-29 3:50 ` ben bodley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=395A8A30.5D99549A@m2tech.co.nz \
--to=benb@m2tech.co.nz \
--cc=linuxppc-embedded@lists.linuxppc.org \
--cc=xuwentao@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).