主题: AM62A7 中讨论的其他器件
工具/软件:

This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具/软件:

尊敬的 Xue:
有一些寄存器允许用户读取/写入存储器中的 MR 寄存器。 以下是一些可轻松适应 C 代码的示例 GEL 函数。 仅当正确初始化和训练 DDR 控制器/PHY 时、这些函数才起作用。
wait()
{
unsigned int i;
for (I=0;I<10000;I++);
}
check_and_Ack_mrw()
{
while ((HW_RD_REG32 (CTL_BASE + DDRSS_CTL_351__SFR_OFFS)& 0x8)= 0x0)
wait();
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_359__SFR_OFFS、0x8);//确认状态模式位
wait();
}
check_and_Ack_Mr()
{
while ((HW_RD_REG32 (CTL_BASE + DDRSS_CTL_351__SFR_OFFS)& 0x4)= 0x0)
wait();
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_359__SFR_OFFS、0x4);//ack STATUS 模式位
wait();
}
hotmenu mr_Write(unsigned int mr_addr、unsigned int cs、unsigned int 数据)
{
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_190___SFR_OFFS、((1UL << 23)|(Cs << 8)| MR_addr);
wait();
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_225__SFR_OFFS、DATA);
//触发器写入
wait();
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_190___SFR_OFFS、((1UL << 25)|(1UL << 23)|(CS << 8)| MR_addr);//设置位 25 以进行写入
wait();
check_and_Ack_mrw();
GEL_TextOut(“将%x 写入 mr%d\n“、、、、、 DATA、mr_addr);
}
hotmenu mr_read (unsigned int mr_addr、unsigned int cs)
{
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_190___SFR_OFFS、((cs << 8)| MR_addr)<< 8);//CS0 MR0
HW_WR_REG32 (CTL_BASE + DDRSS_CTL_190__SFR_DIONS)((1UL<<16)|(CS << 8)| MR_addr)<< 8);//触发器读取
check_and_Ack_MRR ();
return (HW_RD_REG32 (CTL_BASE + DDRSS_CTL_192__SFR_OFFS));
}
此致、
James