From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: Andrey Nechypurenko <andreynech@googlemail.com>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai] Error requesting IRQ on DM3730 (BeagleBoard xM)
Date: Thu, 27 Sep 2012 23:14:51 +0200 [thread overview]
Message-ID: <5064C1CB.5070209@xenomai.org> (raw)
In-Reply-To: <CAOiXNkAxMRy5m+-2gwvNbx_YDCOFW-QHJRU-5hRTnBx=3HefAw@mail.gmail.com>
On 09/27/2012 11:08 PM, Andrey Nechypurenko wrote:
> On 27 September 2012 23:06, Gilles Chanteperdrix
> <gilles.chanteperdrix@xenomai.org> wrote:
>> On 09/27/2012 11:05 PM, Andrey Nechypurenko wrote:
>>
>>> retval = InitGPIO(channels, sizeof(channels) / sizeof(channels[0]));
>>
>>
>> The code for this funtion is missing.
>>
>> --
>> Gilles.
> static void __iomem *confmem = NULL;
>
>
> int
> InitGPIO(ChannelConfig *channels, size_t ch_count)
> {
> const u16 mode_value = (EN | PTD | M4);
> const u32 conf_val = ((1<<5)|(1<<2)|(1<<4)|(1<<3)|(1<<8)|(1<<6)|(1<<7));
> size_t i;
> u32 cur_val;
>
> rtdm_printk("TB6612FNG: configuring I/O pins mode\n");
> confmem = ioremap(0x48000000, 0x05cc);
>
> // STBY GPIO 133 - Bank 5, base addr 0x4905 6000
> iowrite16(mode_value, confmem + 0x215C + 2);
> // PWMA GPIO 130
> iowrite16(mode_value, confmem + 0x2158);
> // AIN1 GPIO 132
> iowrite16(mode_value, confmem + 0x215C);
> // AIN2 GPIO 131
> iowrite16(mode_value, confmem + 0x2158 + 2);
> // PWMB GPIO 136
> iowrite16(mode_value, confmem + 0x2164);
> // BIN1 GPIO 134
> iowrite16(mode_value, confmem + 0x2160);
> // BIN2 GPIO 135
> iowrite16(mode_value, confmem + 0x2160 + 2);
>
> // ENC1 GPIO 143
> iowrite16(IEN | mode_value, confmem + 0x2170 + 2);
>
>
> iounmap(confmem);
> confmem = NULL;
> confmem = ioremap(0x49050000, 0x05cc);
> if(!confmem)
> {
> rtdm_printk("TB6612FNG: GPIO bank mapping failed\n");
> return 2;
> }
> else
> rtdm_printk("TB6612FNG: GPIO bank mapped to address %p\n", confmem);
>
> // GPIO_OE - config pins as output
> cur_val = ioread32(confmem + 0x6034);
> iowrite32(cur_val & (~conf_val), confmem + 0x6034);
> // Disable the wakeupenable and irqenable intertupts
> cur_val = ioread32(confmem + 0x6080);
> iowrite32(cur_val | conf_val, confmem + 0x6080);
> // GPIO clear_irqenable1
> cur_val = ioread32(confmem + 0x6060);
> iowrite32(cur_val | conf_val, confmem + 0x6060);
> // GPIO clear_irqenable2 is offset
> cur_val = ioread32(confmem + 0x6070);
> iowrite32(cur_val | conf_val, confmem + 0x6070);
>
> // Enable interrupts for rotary encoders
> // 15 = (gpio)143 - 128
> // GPIO_OE - config pins as input
> cur_val = ioread32(confmem + 0x6034);
> iowrite32(cur_val | (1 << 15), confmem + 0x6034);
> // GPIO_RISINGDETECT
> iowrite32(1 << 15, confmem + 0x6048);
> //GPIO_FALLINGDETECT
> iowrite32(1 << 15, confmem + 0x604C);
> // GPIO_SETIRQENABLE1
> iowrite32(1 << 15, confmem + 0x6064);
> // GPIO_IRQENABLE1
> cur_val = ioread32(confmem + 0x601C);
> iowrite32(cur_val | (1 << 15), confmem + 0x601C);
> // GPIO_IRQSTATUS1
> iowrite32(1 << 15, confmem + 0x6018);
> return 0;
> }
>
You are really supposed to use the kernel API for these things, and not
touch the registers directly. But I agree that it is not the issue. No
sign of interrupt disabling. I think Jan already talked about the issue
you have:
http://www.xenomai.org/pipermail/xenomai/2012-September/026267.html
It is a false positive, you can safely ignore the warning or remove the
check from the code.
--
Gilles.
next prev parent reply other threads:[~2012-09-27 21:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-27 16:25 [Xenomai] Error requesting IRQ on DM3730 (BeagleBoard xM) Andrey Nechypurenko
2012-09-27 18:11 ` Gilles Chanteperdrix
2012-09-27 21:05 ` Andrey Nechypurenko
2012-09-27 21:06 ` Gilles Chanteperdrix
2012-09-27 21:08 ` Andrey Nechypurenko
2012-09-27 21:14 ` Gilles Chanteperdrix [this message]
2012-09-27 21:24 ` Andrey Nechypurenko
2012-09-27 21:26 ` Andrey Nechypurenko
2012-09-27 22:01 ` Gilles Chanteperdrix
2012-09-28 8:52 ` Andrey Nechypurenko
2012-09-28 10:17 ` Gilles Chanteperdrix
2012-09-27 21:10 ` Andrey Nechypurenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5064C1CB.5070209@xenomai.org \
--to=gilles.chanteperdrix@xenomai.org \
--cc=andreynech@googlemail.com \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.