You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.4 KiB

#include <stddef.h>
#include "fpgaEmmcCfg.h"
unsigned char getDspId(void);
static int dsp_emmc_enable(FPGAEMMC_DEV *fdev)
{
int id = getDspId();
if ((id == 1) && (fdev->device_num == 0))
return 1;
if ((id == 3) && (fdev->device_num == 1))
return 1;
return 0;
}
FPGAEMMC_DEV emmcDev[] = {
{ /*DSP1*/
.device_num = 0,
.emmc_ctl_reg = 0x7c001000,
.emmc_opt_reg = 0x7c005000,
.emmc_opt_len = 0x2,
.emmc_size = 0x700000000UL, //28G
.iddr_edge_sel = 0,
.iddr_edge_sel_cmd = 1,
.dsr = 0x404, /* < 0, don't care, default: 0x404 */
.is_enabled = dsp_emmc_enable,
},
{ /*DSP3*/
.device_num = 1,
.emmc_ctl_reg = 0x7c000000,
.emmc_opt_reg = 0x7c001000,
.emmc_opt_len = 0x2,
.emmc_size = 0x700000000UL, //28G
.iddr_edge_sel = 0,
.iddr_edge_sel_cmd = 1,
.dsr = -1, /* don't care */
.is_enabled = dsp_emmc_enable,
},
};
unsigned int emmcGetDeviceNum(void)
{
return sizeof(emmcDev) / sizeof(emmcDev[0]);
}
FPGAEMMC_DEV *emmcGetDeviceConfig(int nr)
{
if ((nr >= 0) && (nr < emmcGetDeviceNum())) {
return &emmcDev[nr];
}
return NULL;
}