[LS1046] smc_call cannot get the correct result

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

[LS1046] smc_call cannot get the correct result

1,133 次查看
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 项奖励
回复
0 回复数