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
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
=====================================================================
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 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 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.
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.
regards,
Ben
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/
-------------------------------------------------------------------------