Document

当你觉得迷茫的时候,那就多学习

看门狗复位导致网口灯异常

类似上一个博客,之前是reboot启动导致LAN复位异常,网口灯不正常,忽略了看门狗启动也会导致LAN复位,这里修改一下

如下:

用的是linux4.4.12的内核 

 

vim   drivers/watchdog/omap_wdt.c

 

 

 static void omap_wdt_enable(struct omap_wdt_dev *wdev)
 {
      void __iomem *base = wdev->base;
      //add 2020-08-10
      static void *prm_reg_mem;
 
  #define PRM_REG_MEM  0x44E00F00
 
      if (!request_mem_region(PRM_REG_MEM, 8, "prm_reg_mem")){
          printk("request mem error\n");
      }
     else
     {
         prm_reg_mem = ioremap(PRM_REG_MEM, 8);
         __raw_writel(0xff, prm_reg_mem + 4);
         iounmap(prm_reg_mem);
         release_mem_region(PRM_REG_MEM, 8);
     }

     /* Sequence to enable the watchdog */
     writel_relaxed(0xBBBB, base + OMAP_WATCHDOG_SPR);
     while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10)
         cpu_relax();

     writel_relaxed(0x4444, base + OMAP_WATCHDOG_SPR);
     while ((readl_relaxed(base + OMAP_WATCHDOG_WPS)) & 0x10)
         cpu_relax();
 }

  

posted @ 2020-08-10 16:03  陈昌雄  阅读(261)  评论(0编辑  收藏  举报
Document

联系方式

qq: 2224505189

微信: 1935442635

奖励博主