AnsweredAssumed Answered

关于i.mx537中cs0与其他cs设备有干扰,寻求解决方法

Question asked by yue lu on Nov 17, 2015
Latest reply on Nov 21, 2015 by yue lu

关于i.mx537中cs0与其他cs设备有干扰,目前cs0连接NorFlash,C3连接FPGA,在擦写NorFlash是FPGA的值也发生改变,已经按照手册设置IOMUXC,问题还是存在。

 

/* Config CS0 settings for nor flash */

static void weim_cs_config(void)

{

 

  u32 reg;

  void __iomem *base, *iomuxc_base;

  iomuxc_base = ioremap(MX53_BASE_ADDR(IOMUXC_BASE_ADDR), SZ_4K);

  printk(KERN_INFO "iomuxc_base=0x%x\n",iomuxc_base);

 

  reg = readl(iomuxc_base + 0x4);

  reg &= ~0xFFF;

  reg |= 0b001001001001;

  writel(reg, (iomuxc_base + 0x4));

  iounmap(iomuxc_base);

 

 

  base=ioremap(MX53_BASE_ADDR(WEIM_BASE_ADDR), SZ_4K);

  printk(KERN_INFO "weim_base=0x%x\n",base);

 

  //cs0

  __raw_writel(0b01000111111100101111100000110001, base + 0x00);

  __raw_writel(0x0, base + 0x04);

  __raw_writel(0b00100000000000000111011101110111, base + 0x08);

  __raw_writel(0b00000000000000000111001101110111, base + 0x0c);

  __raw_writel(0b00111111111000111111111111111111, base + 0x10);

  __raw_writel(0x0, base + 0x14);

  //cs1

  __raw_writel(0b01000111111100101111100000110001, base + 0x18);

  __raw_writel(0x0, base + 0x1c);

  __raw_writel(0b00100000000000000111011101110111, base + 0x20);

  __raw_writel(0b00000000000000000111001101110111, base + 0x24);

  __raw_writel(0b00111111111000111111111111111111, base + 0x28);

  __raw_writel(0x0, base + 0x2c);

  //cs2

  __raw_writel(0b01000111111100101111100000110001, base + 0x30);

  __raw_writel(0x0, base + 0x34);

  __raw_writel(0b00100000000000000111011101110111, base + 0x38);

  __raw_writel(0b00000000000000000111001101110111, base + 0x3c);

  __raw_writel(0b00111111111000111111111111111111, base + 0x40);

  __raw_writel(0x0, base + 0x44);

  //cs3

  __raw_writel(0b01000111111100101111100000110001, base + 0x48);

  __raw_writel(0x0, base + 0x4c);

  __raw_writel(0b00100000000000000111011101110111, base + 0x50);

  __raw_writel(0b00000000000000000111001101110111, base + 0x54);

  __raw_writel(0b00011111111000111111111111111111, base + 0x58);

  __raw_writel(0x0, base + 0x5c);

 

  __raw_writel(0x00000000, (base + 0x90));

 

 

  iounmap(base);

 

  return;

}

Outcomes