This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM3352: Cannot read INTC registers

Part Number: AM3352

Tool/software: Linux

Hi there,  I have been trying to follow the instructions in this thread on changing the gpio interrupt priority: https://e2e.ti.com/support/arm/sitara_arm/f/791/t/523690

First of all i wanted to read the current value of the INTC_ILRm registers, I have tried both devmem2 and omapconf to read 0x48200100 but i always get the follwong error. 

root:~# ./omapconf read 0x48200100
[ 6065.393717] Unhandled fault: external abort on non-linefetch (0x1018) at 0xb6e7d100
[ 6065.401448] pgd = dbb14000
[ 6065.404169] [b6e7d100] *pgd=9dfc4831, *pte=48200303, *ppte=48200a33

Even reading the INTC_REVISION register returns the same. So i've read other threads and I know that this error is returned when mapping memory for an unpowered and unclocked module. I can't see how the INTC module can be disabled since linux is booting and functioning correctly.

So i have also tried reading the INTC registers form the kernel driver irq-omap-intc. The following code builds and prints during boot but it always returns zero. 

static int __init omap_init_irq_of(struct device_node *node)
{
int ret;
int i;

omap_irq_base = of_iomap(node, 0);
if (WARN_ON(!omap_irq_base))
return -ENOMEM;

domain = irq_domain_add_linear(node, omap_nr_irqs,
&irq_generic_chip_ops, NULL);

for (i = 0; i < omap_nr_irqs; i++)
{
pr_info("INTC_ILR reg:0x%x val: 0x%x\n", (omap_irq_base + (INTC_ILR0 + (0x4 * i))), intc_readl(INTC_ILR0 + 0x4 * i));//96
}

read_intc_irl_n();
omap_irq_soft_reset();

ret = omap_alloc_gc_of(domain, omap_irq_base);
if (ret < 0)
irq_domain_remove(domain);

return ret;
}

So is it normal that the INTC registers are not readable or is it somehow possible that INTC module isn't enabled? I can't see it being likely that the INTC module can be disabled and I can't find INTC power and clock enable registers in the PRCM. 

Thanks in advance for any help you can offer. 

  • The software team have been notified. They will respond here.
  • Hi David,

    I confirm INTC can not be accessed by default from user space. I tried also from u-boot stage, and there I am able to access successfully:

    md [.b, .w, .l] address [# of objects]
    => md 0x48200000 1
    48200000: 00000050 P...
    => md 0x48200100 1
    48200100: 00000000 ....
    => md 0x48200010 1
    48200010: 00000000 ....


    I will check about the differences in INTC config between u-boot stage and linux kernel, and come back to you.

    Regards,
    Pavel
  • See section 6.1.2 Register Protection. I believe this is getting set so that you cannot access the registers in user space.

    Steve K.
  • David,

    As Steve explained, the protection feature is preventing you from access the INTC registers from user space. You can edit the INTC driver with commenting the protection enable function:

    linux-kernel/drivers/irqchip/irq-omap-intc.c

    static int __init omap_init_irq(u32 base, struct device_node *node)
    {
    ....
    //if (ret == 0)
    //omap_irq_enable_protection();

    return ret;
    }

    With this update applied, you should be able to access the INTC registers from user space with devmem2 tool.

    Regarding your attempt to access these registers from kernel level, I think this is not correct. Let me know if you still need to print the INTC registers from within the kernel.

    Regards,
    Pavel