This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: LPC2XXX interrupt_acknowledge


Andrew,

if is it possible, commit please this one for the LPC2XXX varient too.

> This seems like a worthwhile thing to add to the LPC2xxx hal.
>
> ----- Original Message -----
> From: "Andrew Lunn" <andrew@lunn.ch>
> To: "Sergei Gavrikov" <sg@belvok.com>
> Cc: "Andrew Lunn" <andrew@lunn.ch>; "Andy Jackson" <andy@xylanta.com>;
> <ecos-patches@ecos.sourceware.org>
> Sent: Monday, May 08, 2006 10:59 AM
> Subject: Re: LPC2XXX interrupt_acknowledge
>
>
>> On Mon, May 08, 2006 at 02:06:57PM +0300, Sergei Gavrikov wrote:
>>> Andrew,
>>>
>>> Thank you for this commit. I have an eCos newbie question.
>>>
>>> I have looked var_misc.c sources for other ARM platforms. Most of them
>>> usually has call hal_plf_hardware_init() after the hal_if_init() call
>>> in
>>> the hal_hardware_init() epilogue. So, the platform layer has point for
>>> an
>>> additional hardware initializing in C. Sorry, but LPC2XXX variant init
>>> (in the lpc2xxx_misc.c) have no such a call. Therefore, we have one
>>> point for the early hardware initializing in the hal_platform_setup.h
>>> for the evolution boards (in assembler only). There is no other point
>>> for the hardware initializing in the lpc2xxx platforms.
>>
>> I had a similar problem with the AT91 varient HAL. What i did there was
>> add:
>>
>> #ifdef HAL_PLF_HARDWARE_INIT
>>    // Perform any platform specific initializations
>>    HAL_PLF_HARDWARE_INIT();
>> #endif
>>
>> into hal_hardware_init().
>>
>> The platform hal then has something like:
>>
>> //----------------------------------------------------------------------
>> // The platform needs this initialization during the
>> // hal_hardware_init() function in the varient HAL.
>> #ifndef __ASSEMBLER__
>> extern void hal_plf_hardware_init(void);
>> #define HAL_PLF_HARDWARE_INIT() \
>>    hal_plf_hardware_init()
>> #endif
>>
>> in plf_io.h and the necassary code in the _misc.c file.
>>
>> Doing it like this with a #define means you do not have to edit all
>> the platform HALs adding an empty function. You just have the function
>> when you need it.
>>
>>     Andrew
>
>
diff -ur ecos/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c ecos.patched/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c
--- ecos/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c	2006-05-08 12:54:56.000000000 +0300
+++ ecos.patched/packages/hal/arm/lpc2xxx/var/current/src/lpc2xxx_misc.c	2006-05-08 14:08:19.000000000 +0300
@@ -234,6 +234,12 @@
     lpc_set_vpbdiv(CYGNUM_HAL_ARM_LPC2XXX_VPBDIV,
                    CYGNUM_HAL_ARM_LPC2XXX_XCLKDIV);
 #endif
+
+#ifdef HAL_PLF_HARDWARE_INIT
+    // Perform any platform specific initializations
+    HAL_PLF_HARDWARE_INIT();
+#endif
+
     // Set up eCos/ROM interfaces
     hal_if_init();
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]