A couple of BSP questions

Michael Hamel mhamel at adi.co.nz
Wed May 14 23:05:39 UTC 2008


On 15/05/2008, at 10:34 AM, Till Straumann wrote:

>> Hi,
>>
>> I am making progress with a PPC405EX BSP and am trying to move  
>> code  into a generic libcpu/powerpc/ppc4xx directory, but I'm not  
>> sure how  to organise it. I have conditional sections that need to  
>> know whether  a PPC405EX/EXr or a GP/GPr/CR is in use (e.g DCR  
>> values).
> Can't these be made run-time tests?


I can certainly do that, it leads to a little more code though; e.g  
BSP_UIC_UART0 is 0 on the 405GP and 26 on the 405EX (sigh). So you  
wind up with something like:

if (get_ppc_cpu_type==PPC_405EX)
   uartIrqConnData.name = BSP_UIC_UART0_EX
else
   uartIrqConnData.name = BSP_UIC_UART0_GP

rather than:

uartIrqConnData.name = BSP_UIC_UART0

On the other hand this makes the include files easier to write, so I  
guess it all comes out in the wash. I'll go to runtime checks.


Thanks,

---
" The boy stood on the burning deck, whence all but he had fled!
Twit."

Michael Hamel
ADInstruments Ltd, Dunedin, NZ




More information about the users mailing list