Freescale iMX515 同步访问模式,2个可用的时序参数配置

时间:2022-08-27 23:13:25
Freescale iMX515 同步访问模式,2个可用的时序参数配置
Author: Xiaoyong Wen, wen_kernel@163.com
Date: 2012-5-17
Version: 1.0.0
All rights reserved, Please indicate the source if reproduce.

同步访问模式,2个可用的时序参数配置
1. 133MHz, 寄存器配置。
volatile u32 val;
val = 0x5<<28 | 0x0<<20 | 0x1<<16 | 0x1<<14 | 0x0<<12 | 0x3<<5 | 0xf
writel(val, weim_CS0GCR1);

val = 0x2<<0;
writel(val, WEIM_CS0GCR2);

val = 0x16<<24 | 0x0<<20 | 0x6<<16 | 0x0<<12;
writel(val, WEIM_CS0RCR1);

val = 0x7<<8 | 0x0<<4 | 0x0<<3 | 0x0<<0;
writel(val, WEIM_CS0RCR2);

val = 0x1<<30 | /*0x3f*/0x16<<24 | 0x1<<21 | 0x6<<18 | 0x1<<9 | 0x0<<6 | 0x0<<3;
writel(val, WEIM_CS0WCR1);

val = 0;
writel(val, WEIM_CS0WCR2);

val = 0x0<<1 | 0x0<<0;
writel(val, WEIM_WCR);

val = readl(WEIM_WIAR);
val |= 0x1<<4; /* enalbe ACLK */
writel(val, WEIM_WIAR);

2. 133/2 MHZ,寄存器配置
volatile u32 val;
val = 0x00000011;
writel(val, WEIM_WIAR);
/* Request access to WEIM config registers */
while(!(( __raw_readl(weim_vaddr + WEIM_WIAR)) & 0x00000002))
{
      pr_info("WEIM: wait");
}

val = 0x0771108F;
writel(val, weim_CS0GCR1);

val = 0x00000003;
writel(val, WEIM_CS0GCR2);

val = 0x08023000;
writel(val, WEIM_CS0RCR1);

val = 0x00000000;
writel(val, WEIM_CS0RCR2);

val = 0x08080E40;
writel(val, WEIM_CS0WCR1);

val = 0x00000000;
writel(val, WEIM_CS0WCR2);

val = 0x00000020;
writel(val, WEIM_WCR);