[LS1046] smc_call cannot get the correct result

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[LS1046] smc_call cannot get the correct result

1,136 Views
linxx
Contributor I
I'm confused about the smc_call, the regs[1] printed was always ffffffff when running the tfa_get_dram_size() routine cited from u-boot in flexbuild_lsdk2108,
it's also the case when regs0]=SMC_DRAM_BANK_INFO
Is there any precondition ( for CPU or SDRAM) should be mentioned when using smc_call?
 
phys_size_t tfa_get_dram_size(void)
{
    struct pt_regs regs;
    phys_size_t dram_size = 0;

    regs.regs[0] = SMC_DRAM_BANK_INFO;
    regs.regs[1] = -1;

    smc_call(&regs);
    if (regs.regs[0])
        return 0;
    printf("regs[0]=%x regs[1]=%x\n",regs.regs[0],regs.regs[1]);
    dram_size = regs.regs[1];
    return dram_size;
}
0 Kudos
Reply
0 Replies