[okl4-developer] regarding interrupts
Gabi Voiculescu
boy3dfx2 at yahoo.com
Thu Apr 17 15:32:17 EST 2008
Hi.
I am struggling to get past the THRD1200 test when using test_libs=all on my okl4 1.5.2 release.
I have two questions for you:
*************************************************************************************
1. Where do I specify in the build scripts that I want to be able to break in the kdb using the ESC key? I remember somewhere the implicit platforms had this feature turned on by default. I know I found it a few months ago but I can't find the particular line again. I need to add my own platform over there. Alternatively, can you tell me how I can enable this feature in the build command line?
**************************************************************************************
2. In platform/xxx/include/intctrl.h I have a function called is_irq_available().
What is it's purpose?
I have seen that on couple of platforms where the return from this function is always not null (gumstix, for example), and others on which certain interrupt numbers are protected (the function returns false for them), and as I saw in my run the interrupt is left disabled from then on. Why do you protect certain irq's? Or is that they are simply absent (register bit is not used on the platform)?
**************************************************************************************
3. I need to give to the platform dependent timer driver two memory pages.
I need someone to confirm I used the dx file and the scan_devices() function properly. The code still does not work.
All the examples I see only use one (which is mapped in device_core.c with device_add_resource).
For my goal I added the following in device_core.c' s scan_devices:
........................
/* timer device */
memsection_lookup((objref_t) env_memsection_base(iguana_getenv("OKL4_VTIMER_SERVER")),
&server_);
timer_server = thread_l4tid(server_);
device_add_resource(timer_server, 0x10105000,0, MEMORY_RESOURCE, &env); /* sfr area for timer */
dprintf("[device_core] timer - added resources: memory 0x10105000\n");
device_add_resource(timer_server, 0x10120000,0, MEMORY_RESOURCE, &env); /* sfr area for Dev chip IC */
dprintf("[device_core] timer - added resources: memory 0x10120000\n");
device_add_resource(timer_server, 41,0, INTERRUPT_RESOURCE, &env);
dprintf("[device_core] timer - added resources: irq 41\n");
device = device_create(timer_server, &me, TIMER, &env);
dprintf("[device_core] timer - created\n");
timer_device = device.ref.obj;
..........................................
As you can see, I need to add two memory resources to the driver. All is because I need to also use the endirq register in the driver and I can't simply import it with <plat/...h> because the driver is built separately.
I have duplicated the resource and block objects in the .dx file as following:
<resource name="main" rtype="mem_space_t" />
<block name="main" space_type="mem" space="main" register_size="32">
<register name="tload" offset="0x00" type="rw"/>
<register name="tvalue" offset="0x04" type="ro"/>
<!-- We only use the first timer in the dual timer module -->
<register name="tcontrol" offset="0x08" type="rw">
<field name="timeren" bits="7"/>
<field name="timermode" bits="6"/>
<field name="inten" bits="5"/>
<field name="rsvd" bits="4"/>
<field name="timerpre" bits="3:2"/>
<field name="timersize" bits="1"/>
<field name="oneshot" bits="0"/>
</register>
<register name="tintclr" offset="0x0c" type="wo">
<field name="rsvd" bits="31:1"/>
<field name="intclr" bits="0"/>
</register>
<register name="tris" offset="0x10" type="ro"/>
<register name="tmis" offset="0x14" type="ro"/>
<register name="tbgload" offset="0x18" type="rw"/>
</block>
<!-- this is what I need to add...a second SFR area -->
<resource name="ic_int" rtype="mem_space_t" />
<block name="ic_int" space_type="mem" space="ic_int" register_size="32">
<register name="control" offset="0x000" type="rw">
<field name = "rsvd" bits="31:1"/>
<field name = "enable" bits="0"/>
</register>
<register name = "endirq" offset="0x010" type="wo">
<field name = "raz" bits="31:13"/>
<field name = "cpuid" bits="12:10"/>
<field name = "intid" bits="9:0"/>
</register>
</block>
Thanks,
Gabi Voiculescu
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080416/54fc5623/attachment.htm
More information about the Developer
mailing list