SMP on Xilinx Zynq

Joel Sherrill joel.sherrill at oarcorp.com
Sun Mar 1 16:42:22 UTC 2015



On March 1, 2015 10:40:41 AM CST, "Maldonado, Sergio E." <smaldona at slac.stanford.edu> wrote:
>Problem solved.  My MMU configuration did not have the RTEMS workspace
>memory set with the shared attribute.

Is this something the BSP could have detected and printed a helpful message?

>Thanks,
>
>Sergio
>
>On Feb 28, 2015, at 1:53 PM, Joel Sherrill <joel.sherrill at OARcorp.com>
>wrote:
>
>> 
>> 
>> On February 28, 2015 2:37:32 PM CST, "Maldonado, Sergio E."
><smaldona at slac.stanford.edu> wrote:
>>> I have CONFIGURE_SMP_MAXIMUM_PROCESSORS set to 2 and defined the
>symbol
>>> bsp_processor_count, also 2.
>>> 
>>> Sometime last year, I was able to get SMP working with both cores,
>but
>>> I see that the RTEMS code base has advanced significantly since.
>> 
>> I don't have the hardware and am not in a position to try it on qemu.
>Hopefully someone with hardware will try it soon.
>> 
>>> Thanks,
>>> 
>>> Sergio
>>> 
>>> On Feb 28, 2015, at 12:27 PM, Joel Sherrill
><joel.sherrill at OARcorp.com>
>>> wrote:
>>> 
>>>> 
>>>> 
>>>> On February 28, 2015 12:38:54 PM CST, "Maldonado, Sergio E."
>>> <smaldona at slac.stanford.edu> wrote:
>>>>> Hello,
>>>>> 
>>>>> Attempting to get SMP working on my Xilinx Zynq platform.  
>>>>> I'm currently running RTEMS compiled from the head of the git repo
>>>>> master branch (as of 2/28/15), so I should have the latest
>updates.
>>>>> 
>>>>> The problem I have is that multitasking does not work when both
>>> cores
>>>>> are enabled.
>>>>> 
>>>>> I'm looking for some input on what could be going wrong and how to
>>> fix
>>>>> it.
>>>>> 
>>>>> Scenario:
>>>>> 
>>>>> At system boot, I can verify that core 0 completes RTEMS boot_card
>>>>> initialization, and starts multitasking.
>>>>> However, Core 0 does _not_ execute the Init task entry point and
>>>>> instead goes straight to its idle loop.
>>>>> 
>>>>> Meanwhile, Core 1 starts and executes until it reaches the first
>>>>> _CPU_Context_Switch/_CPU_Context_Restore call.
>>>>> If I step into Core 1, I can see that it never returns from this
>>>>> routine and stays in an infinite loop of the following
>instructions
>>>> 
>>>> Did you configure multiple cores? There are SMP specific
>>> configuration parameters such as number of cores in the system.
>>>> 
>>>>> 
>>>>> 83		bne	.L_check_thread_dispatch_necessary
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:131
>>>>> 131		GET_SELF_CPU_CONTROL	r2, r3
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:134
>>>>> 134		ldrb	r4, [r2, #PER_CPU_DISPATCH_NEEDED]
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:135
>>>>> 135		cmp	r4, #0
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:136
>>>>> 136		beq	.L_check_is_executing
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:80
>>>>> 80		add	r3, r1, #ARM_CONTEXT_CONTROL_IS_EXECUTING_OFFSET
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:81
>>>>> 81		ldrexb	r4, [r3]
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:82
>>>>> 82		cmp	r4, #0
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:83
>>>>> 83		bne	.L_check_thread_dispatch_necessary
>>>>> (gdb) s
>>>>> ?? ()
>>>>> at
>>>>> 
>>>
>../../../../../../../../src/c/src/../../cpukit/score/cpu/arm/cpu_asm.S:131
>>>>> 131		GET_SELF_CPU_CONTROL	r2, r3
>>>>> (gdb) s
>>>>> ...
>>>>> 
>>>>> 
>>>>> Consequently, the Init task entry point is never executed by
>either
>>>>> core, and the system does not complete startup.
>>>>> 
>>>>> Any thoughts on why Core 1 will not complete its transition to
>>>>> multitasking?
>>>>> 
>>>>> Here's a piece of information that might be useful:
>>>>> 
>>>>> When I configure RTEMS SMP with just 1 processor, the system
>>>>> successfully starts multitasking and the Init task entry point
>>> _does_
>>>>> get executed by Core 0.
>>>>> 
>>>>> Thank you,
>>>>> 
>>>>> Sergio Maldonado - SLAC
>>>>> 
>>>>> _______________________________________________
>>>>> users mailing list
>>>>> users at rtems.org
>>>>> http://lists.rtems.org/mailman/listinfo/users
>>>> 
>>>> --joel
>> 
>> --joel

--joel


More information about the users mailing list