Skip to contentSkip to conversation

PrimeCell Peripherals

U-Boot Roman Mashak 2 participants 14 messages Sep 23, 2008 – Sep 25, 2008

lore
Share & tools
lore
#0 lore raw

Hello all,

the board I'm porting U-Boot on, has several peripheral devices, which are, according to datasheet, are based on PrimeCell PLxx blocks (for example, vector interrupt controller is PL190 based; GPIOs are based on PL061 block and so on). I understand that PrimeCells are IP cores, which build up a variety of controllers for peripherals.

Therefore I wonder, how well does U-Boot support ARM's PrimeCell peripherals? Greping sources gave only a couple of hits. I think these basic controllers like GPIO, interrupt controller etc., which are widely used on many ARM based platforms (i.e. (AMBA bus-compliant), but marked in U-Boot sources with different names or so ?

Thanks in advance.

Signature · 1 line
Roman Mashak
#1 lore raw

Hi,

Quoted 1 line
Quoted 1 line

how well does U-Boot support ARM's PrimeCell peripherals?

What do u mean by support.

I use U-booot as The Primary Bootloader on arm926ej-s based Board.

By Default U-boot supports few Primecell peripherals drivers like PL0x1 UART.

I developed few others my self, like pl18x mmc, rtc, gpio.

I recently sent a patch for RTC pl031.

U too can contribute if u can send patch's for other peripherals.

Regards
Gururaja

Signature · 2 lines
View this message in context: http://www.nabble.com/-U-Boot--PrimeCell-Peripherals-tp19627089p19628769.html
Sent from the Uboot - Users mailing list archive at Nabble.com.
#2 lore raw

Hello,

2008/9/23 Hebbar <[email protected]>:

Quoted 4 lines

I use U-booot as The Primary Bootloader on arm926ej-s based Board.

By Default U-boot supports few Primecell peripherals drivers like PL0x1 UART.

Right, that's what I've found in the U-Boot sources. How come that widely used interrupt controllers like PL19x are not supported by default?

Quoted 3 lines

I developed few others my self, like pl18x mmc, rtc, gpio.

I recently sent a patch for RTC pl031.

Yes, I saw that patch. Are you planning to send patch for GPIO as well?

Signature · 1 line
Roman Mashak
#3 lore raw

Hi,

Quoted 6 lines

From: Roman Mashak [mailto:romez777 at gmail.com]
Subject: Re: [U-Boot] PrimeCell Peripherals

Right, that's what I've found in the U-Boot sources. How come that widely used interrupt controllers like PL19x are not supported by default?

Thats because Most of the ARM based boards doesnt use Interrupts. Atleast as far as i have seen. IIRC U-boot is a single process bootloader & hence Interrupts are not so much supported. Is there any interrupt related drivers in U-boot for other platforms?

Quoted 3 lines
Quoted 1 line

I recently sent a patch for RTC pl031.

Yes, I saw that patch. Are you planning to send patch for GPIO as well?

I havent done any Framework kind of a driver for GPIO. For me, it just works like a standalone & hence i cannot submit the same. Later when i get time. I will prepare a GPIO Framework and submit for RFC in ML

Regards
Gururaja

#4 lore raw

Hello,

2008/9/23 Gururaja Hebbar K R <[email protected]>:

Quoted 3 lines

Thats because Most of the ARM based boards doesnt use Interrupts. Atleast as far as i have seen. IIRC U-boot is a single process bootloader & hence Interrupts are not so much supported. Is there any interrupt related drivers in U-boot for other platforms?

In U-Boot source tree there are number of drivers with interrupt service routines running (for example, $(U_BOOT)/drivers/net/bcm570x.c) as well as various interrupts related macros (some of them not used thought), if this is what you mean. Perhaps these definitions are for future ?

Signature · 1 line
Roman Mashak
#5 lore raw

Hi,

Quoted 6 lines

In U-Boot source tree there are number of drivers with interrupt service routines running (for example, $(U_BOOT)/drivers/net/bcm570x.c) as well as various interrupts related macros (some of them not used thought), if this is what you mean.
Perhaps these definitions are for future ?

At $(U_BOOT)/drivers/net/bcm570x.c files header, it says

* Broadcom BCM570x Ethernet Driver for U-Boot.
* Support 5701, 5702, 5703, and 5704. Single instance driver.

--> Single Instance Driver. Does this mean it doesn't handle Interrupt. Sorry I cannot say more as I don't have any knowledge abt this

Also,

CONFIG_BCM570x is used in $(U_BOOT)/include/configs/BMW.h which is a MPC based Board.

May be MPC uses interrupts for its operation inside U-Boot.

Regards
Gururaja

#6 lore raw

Hi,

2008/9/23 Gururaja Hebbar K R <[email protected]>:

Quoted 5 lines

At $(U_BOOT)/drivers/net/bcm570x.c files header, it says

* Broadcom BCM570x Ethernet Driver for U-Boot.
* Support 5701, 5702, 5703, and 5704. Single instance driver.

Quoted 8 lines

--> Single Instance Driver. Does this mean it doesn't handle Interrupt. Sorry I cannot say more as I don't have any knowledge abt this

Also,

CONFIG_BCM570x is used in $(U_BOOT)/include/configs/BMW.h which is a MPC based Board.

May be MPC uses interrupts for its operation inside U-Boot.

Probably you're right and interrupts related stuff is meanugful on PPC platform; moreover README says about interrupts mainly in PPC or PowerPC marked sections.

Signature · 1 line
Roman Mashak
#7 lore raw
In reply to Gururaja Hebbar K R

To add a bit to my previous message.

2008/9/23 Gururaja Hebbar K R <[email protected]>:

Quoted 1 line

Thats because Most of the ARM based boards doesnt use Interrupts. Atleast as far as i have seen.

As far as I understood from U-Boot's README, a standalone mode can and may want to use interrupts -- so it'd reasonable to have interrupts controllers support, isn't it? Correct me if I'm wrong, just trying to understand the architecture of U-Boot more deeply.

Quoted 2 lines

IIRC U-boot is a single process bootloader & hence Interrupts are not so much supported. Is there any interrupt related drivers in U-boot for other platforms?

Signature · 1 line
Roman Mashak
#8 lore raw

HI,

Quoted 10 lines

From: Roman Mashak [mailto:romez777 at gmail.com]
Subject: Re: [U-Boot] PrimeCell Peripherals

To add a bit to my previous message.

As far as I understood from U-Boot's README, a standalone mode can and may want to use interrupts -- so it'd reasonable to have interrupts controllers support, isn't it? Correct me if I'm wrong, just trying to understand the architecture of U-Boot more deeply.

U-boots readme is general for all platforms.

Yes, U-boot ARM supports interrupt mode, but generally not used.
Also standalone can use interrupt mode if the u-boot it is running on is configured to support irq i.e., CONFIG_USE_IRQ is defined.

Then the user has to also define a do_irq command to support the same

Kindly look at below file for do_irq function definitions & its usage.

uboot\cpu\arm720t\interrupts.c
uboot\cpu\arm920t\interrupts.c

i havent seen this function definitions for arm926ej-s except

#ifndef CONFIG_USE_IRQ
void do_irq (struct pt_regs *pt_regs)
{
...

Regards
Gururaja

#9 lore raw

Hello,

2008/9/23 Gururaja Hebbar K R <[email protected]>:

[skip]

Quoted 7 lines

Then the user has to also define a do_irq command to support the same

Kindly look at below file for do_irq function definitions & its usage.

uboot\cpu\arm720t\interrupts.c
uboot\cpu\arm920t\interrupts.c

Quoted 6 lines

i havent seen this function definitions for arm926ej-s except

#ifndef CONFIG_USE_IRQ
void do_irq (struct pt_regs *pt_regs)
{
...

I'm a bit confused: 'do_irq' is defined in several files, including CPU-specific (arm920t, 720t etc.) and ARM architecture library ($(U_BOOT)/lib_arm). So if we build for arm920t-based platform (provided that CONFIG_USE_IRQ is defined), then which one will be actually compiled in resulting image?

Thanks.

Signature · 1 line
Roman Mashak
#10 lore raw

Hi,

Quoted 8 lines

From: Roman Mashak [mailto:romez777 at gmail.com]
Subject: Re: [U-Boot] PrimeCell Peripherals

I'm a bit confused: 'do_irq' is defined in several files, including CPU-specific (arm920t, 720t etc.) and ARM architecture library ($(U_BOOT)/lib_arm). So if we build for arm920t-based platform (provided that CONFIG_USE_IRQ is defined), then which one will be actually compiled in resulting image?

Looking at uboot\cpu\arm920t\interrupts.c
a. If ARM920_IRQ_CALLBACK is defined (which is only used in s3c2410), function is called which points to s3c2410_irq() b. if the platform is CONFIG_ARCH_INTEGRATOR, then it is assumed that it is
for timer interrupt (which is not necessary be since timer interrupt is not enabled in integrator)

Looking at uboot\cpu\arm720t\interrupts.c
a. if CONFIG_S3C4510B is defined then platform specific interrupt handler is called ( IRQ_HANDLER[pending>>2].m_func() ) b. Noting for integrator
c here is the interesting part

Since LPC2292 uses the interrupt controller similar to VIC, It uses the VICVectAddr to get the respective function address & jumps to it.

So, a similar function i.e., do_irq is needed for arm926ej-s. Again inside it, a similar steps as in lpc2292 can be done to jump to respective function.

But i am not seeing anyone using this function yet.

Regards
Gururaja

#11 lore raw

Hello,

2008/9/24 Gururaja Hebbar K R <[email protected]>:

Quoted 5 lines
Quoted 5 lines

I'm a bit confused: 'do_irq' is defined in several files, including CPU-specific (arm920t, 720t etc.) and ARM architecture library ($(U_BOOT)/lib_arm). So if we build for arm920t-based platform (provided that CONFIG_USE_IRQ is defined), then which one will be actually compiled in resulting image?

[skip]

I must've confused you with the question. Let me try again: suppose we build U-Boot for arm920t based target, in such a case, two files defining 'do_irq' routine will be in compiled in -- $(UBOOT)/lib_arm/interrupts.c and $(UBOOT)/cpu/arm920t/interrupts.c. Therefore I was wondering how it turns out that in the target image one 'do_irq' function exists? Perhaps it's u-boot irrelevant question and rather concern GNU toolchains behavior?

Thanks.

Signature · 1 line
Roman Mashak
#12 lore raw

Hi,

Quoted 3 lines

From: Roman Mashak [mailto:romez777 at gmail.com]
Subject: Re: [U-Boot] PrimeCell Peripherals
I must've confused you with the question.

No u havent. Sorry to say that u havent checked the code properly

Quoted 2 lines

suppose we build U-Boot for arm920t based target, in such a case, two files defining 'do_irq' routine will be in compiled

No it will not be.

in $(UBOOT)/lib_arm/interrupts.c

#ifndef CONFIG_USE_IRQ ---> if not defined
void do_irq (struct pt_regs *pt_regs)
{
....
....

in $(UBOOT)/cpu/arm920t/interrupts.c

#ifdef CONFIG_USE_IRQ ---> if defined
#include <asm/proc-armv/ptrace.h>
void do_irq (struct pt_regs *pt_regs)
{
...
...

So both are mutual exclusive and finally only one will be compiled.

Quoted 3 lines

Therefore I was wondering how it turns out that in the target image one 'do_irq' function exists? Perhaps it's u-boot irrelevant question and rather concern GNU toolchains behavior?

Its U-boot code style & GNU Toolchain compiler procedure in handling preprocessor statements.

Regards
Gururaja

#13 lore raw

Hello,

2008/9/24 Gururaja Hebbar K R <[email protected]>:

[skip]

Quoted 1 line

So both are mutual exclusive and finally only one will be compiled.

Exactly! Really I didn't spot that subtle difference -- #ifdef, #ifndef. Thanks for pointing out.

Signature · 1 line
Roman Mashak