hi igorpadykov
thank you for your reply
i am giving the code what i am trying
i have done what you suggested, still its not working
i am debugging with DS5 in single core0 mode.( my debugger is not connecting in SMP mode )
i have some doughts
1) with out cpu init also SGI works right ,if already GIC initialized to other cores
example:
core0
1. gic init
2. cpu_init
3. register interrupt routine
4. enable interuupt(id,priority,cpu)
core1
1. SGI to core0 i think its works fine
2) some times its working but some times its not i dont what is the problem
3) why my debugger unable to connect in SMP mode
include "sdk.h"
#include "platform_init.h"
#include "timer.h"
#include "cpu_utility.h"
#include "cortex_a9.h"
#include "MP_Mutexes.h"
#define DUALCORE
//#undef DUALCORE
#define CHIP_MX6SDL
int gicTestDone;
void my_isr(void)
{
int cpu_id;
cpu_id = cpu_get_current();
my_string("Hello from core ");
print_cpu_id();//id no
if(cpu_id == 0)
gic_send_sgi(SW_INTERRUPT_3, 2, kGicSgiFilter_UseTargetList);//interrupt to core1
if(cpu_id == 1)
{
gicTestDone=0;
up=0;
}
}
// Set MAX_CPUS as desired; will be forced to no greater than actual number of cpus.
#define MAX_CPUS 2;
static unsigned int num_cpus = MAX_CPUS;
void configure_cpu(uint32_t cpu)
{
const unsigned int all_ways = 0xf;
disable_strict_align_check();
// Enable branch prediction
arm_branch_target_cache_invalidate();
arm_branch_prediction_enable();
// Enable L1 caches
arm_dcache_enable();
arm_dcache_invalidate();
arm_icache_enable();
arm_icache_invalidate();
// Invalidate SCU copy of TAG RAMs
scu_secure_invalidate(cpu, all_ways);
// Join SMP
scu_join_smp();
scu_enable_maintenance_broadcast();
}
void obc_main(void * arg)
{
uint64_t start_time, done_time;
uint32_t cpu_id = cpu_get_current();
int i;
if (cpu_id == 0)
{
int cpu_count = cpu_get_cores();
gicTestDone = 1;
register_interrupt_routine(SW_INTERRUPT_3, my_isr);// register interrupt
enable_interrupt(SW_INTERRUPT_3, CPU_0, 0);//enable int
if (num_cpus > cpu_count)
{
num_cpus = cpu_count;
}
scu_enable();
configure_cpu(cpu_id);
/* secondary cores starting */
for (i = 1; i < num_cpus; i++)
{
cpu_start_secondary(i, &obc_main, 0);
}
while (gicTestDone)
{
my_string("END of GIC Test \n\r");
}
}
else
{
configure_cpu(cpu_id);
gic_init_cpu();//init CPU interface
//gic_init();
int core1_cpsr;
__asm{mrs core1_cpsr,cpsr}
core1_cpsr &= 0xffffff7f;//set CPSR I bit
__asm{msr cpsr_c,core1_cpsr}
enable_interrupt(SW_INTERRUPT_3, CPU_1, 0);
gic_send_sgi(SW_INTERRUPT_3, 1, kGicSgiFilter_UseTargetList);
while(1);
}
}
void main(void)
{
platform_init();
obc_main(0);
}
if you find any errors please give me the corrections
in my custom board i am distributing routines to both the cores for bare-metal applpication in SMP code
this code i have taken from SMP_PRIMES from SDK and modified according to my application
with out GIC both the cores working fine with some printf with mutex
please give reply as soon as possible
thank you
regards
Saida