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

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

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: office@denx.de =====================================================================

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
On Jan 8, 2008 6:04 PM, Stefan Roese sr@denx.de wrote:
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: office@denx.de =====================================================================

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

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.
Regards Andreas Schweigstill

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.
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: office@denx.de =====================================================================

On 1/8/08, Stefan Roese sr@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 ?
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: office@denx.de =====================================================================

Chetan Nanda wrote:
On 1/8/08, Stefan Roese sr@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

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

In message 7f245da80801080411g4f8e4f82xdb0f6271a8b20f5a@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
participants (5)
-
Andreas Schweigstill
-
Ben Warren
-
Chetan Nanda
-
Stefan Roese
-
Wolfgang Denk