[U-Boot-Users] Do we enable Interrupts in U-Boot?

1,047 views
Skip to first unread message

Chetan Nanda

unread,
Jan 8, 2008, 7:11:12 AM1/8/08
to Matthias Fuchs, u-boot...@lists.sourceforge.net, s...@denx.de
Hi All,
I am using a custom board (similar to MALTA) with MIPS - 4KEC processor on it.
I use u-boot to load linux on our board.

My Question is :
Do we enable interrupt in u-boot code for UART and ETHERNET or we
have running in Polling Mode?

Thanks,
nandac

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
U-Boot-Users mailing list
U-Boot...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Stefan Roese

unread,
Jan 8, 2008, 7:34:48 AM1/8/08
to u-boot...@lists.sourceforge.net, Matthias Fuchs
On Tuesday 08 January 2008, Chetan Nanda wrote:
> I am using a custom board (similar to MALTA) with MIPS - 4KEC processor on
> it. I use u-boot to load linux on our board.
>
> My Question is :
> Do we enable interrupt in u-boot code for UART and ETHERNET or we
> have running in Polling Mode?

Normally all this is done in polling mode.

Best regards,
Stefan

=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: off...@denx.de
=====================================================================

Wolfgang Denk

unread,
Jan 8, 2008, 7:47:22 AM1/8/08
to Chetan Nanda, Matthias Fuchs, s...@denx.de, u-boot...@lists.sourceforge.net
In message <7f245da80801080411g4f8...@mail.gmail.com> you wrote:
>
> Do we enable interrupt in u-boot code for UART and ETHERNET or we
> have running in Polling Mode?

I don;t know what you are doing, but I usually use polling mode.

Please see also http://www.denx.de/wiki/view/UBoot/DesignRequirements

Best regards,

Wolfgang Denk

--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
######## This message was made from 100% recycled electrons. ########

Chetan Nanda

unread,
Jan 8, 2008, 7:52:36 AM1/8/08
to Stefan Roese, u-boot...@lists.sourceforge.net, Matthias Fuchs
In that case there must be some threads that continuously check for
pending requests from UART, ETHERNET or so ..
But I don't find any sort of threading inside u-boot code

Andreas Schweigstill

unread,
Jan 8, 2008, 8:03:40 AM1/8/08
to u-boot...@lists.sourceforge.net
Hello!

Chetan Nanda schrieb:


> In that case there must be some threads that continuously check for
> pending requests from UART, ETHERNET or so ..
> But I don't find any sort of threading inside u-boot code

No, the peripherals get only polled when they are used. That's why
a device running U-Boot usually won't respond to ping/ICMP echo.
Network driver polling only occurs from NetLoop(); this function will
be used only for most (all?) network commands.

U-Boot doesn't implement any kind of threading. Keep in mind that U-Boot
is *not* an operating system but only a bootloader.

There have been lots of requests for some kind of multitasking but it
would be quite time-consuming to implement this without breaking
compatibility with many software parts why rely on the fact that they
have full control over the system when running.

Regards
Andreas Schweigstill

--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

Andreas Schweigstill

unread,
Jan 8, 2008, 8:08:54 AM1/8/08
to u-boot...@lists.sourceforge.net
Hello!

Andreas Schweigstill schrieb:


> There have been lots of requests for some kind of multitasking but it
> would be quite time-consuming to implement this without breaking
> compatibility with many software parts why rely on the fact that they
> have full control over the system when running.

And I also forgot to mention that sometimes it is a really big advantage
to rely on no interrupt handlers running in the background. If I want to
test some hardware I usually write a small test program as a U-Boot
command and don't write a Linux or RTOS driver because I need a "bare"
system with a command line processor.

Stefan Roese

unread,
Jan 8, 2008, 8:27:56 AM1/8/08
to Chetan Nanda, u-boot...@lists.sourceforge.net, Matthias Fuchs
On Tuesday 08 January 2008, Chetan Nanda wrote:
> In that case there must be some threads that continuously check for
> pending requests from UART, ETHERNET or so ..

Threads? U-Boot is not an full blown OS. No threads are needed in this
bootloader.

> But I don't find any sort of threading inside u-boot code

U-Boot "sits" there and waits for some input from the console, or for an
ethernet reply packet. This can be done using polling without any performance
penalty.

Chetan Nanda

unread,
Jan 8, 2008, 10:27:29 AM1/8/08
to Stefan Roese, u-boot...@lists.sourceforge.net, Matthias Fuchs
On 1/8/08, Stefan Roese <s...@denx.de> wrote:
> On Tuesday 08 January 2008, Chetan Nanda wrote:
> > In that case there must be some threads that continuously check for
> > pending requests from UART, ETHERNET or so ..
>
> Threads? U-Boot is not an full blown OS. No threads are needed in this
> bootloader.
>
> > But I don't find any sort of threading inside u-boot code
>
> U-Boot "sits" there and waits for some input from the console, or for an
> ethernet reply packet. This can be done using polling without any performance
> penalty.
>
Thanks, for explaining the things,
But how can we wait for two events simultaneously (that is also under
a single thread of execution)? Can you give me pointer to the code ?

Ben Warren

unread,
Jan 8, 2008, 10:35:13 AM1/8/08
to Chetan Nanda, u-boot...@lists.sourceforge.net, Stefan Roese, Matthias Fuchs
Chetan Nanda wrote:
> On 1/8/08, Stefan Roese <s...@denx.de> wrote:
>
>> On Tuesday 08 January 2008, Chetan Nanda wrote:
>>
>>> In that case there must be some threads that continuously check for
>>> pending requests from UART, ETHERNET or so ..
>>>
>> Threads? U-Boot is not an full blown OS. No threads are needed in this
>> bootloader.
>>
>>
>>> But I don't find any sort of threading inside u-boot code
>>>
>> U-Boot "sits" there and waits for some input from the console, or for an
>> ethernet reply packet. This can be done using polling without any performance
>> penalty.
>>
>>
> Thanks, for explaining the things,
> But how can we wait for two events simultaneously (that is also under
> a single thread of execution)? Can you give me pointer to the code ?
>
We don't. Everything's single-threaded and poll-based.

regards,
Ben

Andreas Schweigstill

unread,
Jan 8, 2008, 12:51:23 PM1/8/08
to u-boot...@lists.sourceforge.net
Hello!

Chetan Nanda schrieb:


> Thanks, for explaining the things,
> But how can we wait for two events simultaneously (that is also under
> a single thread of execution)? Can you give me pointer to the code ?

As mentioned before, U-Boot is not an operating system which provides
such means. It doesn't have a driver layer with file operations similar
to Linux. The only way to wait for events exactly simultaneously is
using a hardware which provides these events in one hardware register.

Usually one would poll the event sources:

...

while (1) {
if (driver_a_check_data_available()) {
driver_a_read_data();
}
if (driver_b_check_data_available()) {
driver_b_read_data();
}
}

if this will be implemented in an U-Boot command, you probably want
this loop also to be left, e.g. by pressing Ctrl-C:

while (!ctrlc()) {
...
}

Regards
Andreas Schweigstill

--
Dipl.-Phys. Andreas Schweigstill
Schweigstill IT | Embedded Systems
Schauenburgerstraße 116, D-24118 Kiel, Germany
Phone: (+49) 431 5606-435, Fax: (+49) 431 5606-436
Mobile: (+49) 171 6921973, Web: http://www.schweigstill.de/

-------------------------------------------------------------------------

Reply all
Reply to author
Forward
0 new messages