Edit online

Watchdog 配置

Watchdog 包含以下配置内容:
  1. 内核配置

    在 luban 根目录下执行 make kernel-menuconfig,进入 kernel 的功能配置,按如下选择:

    Linux
        Device Drivers
            [*] Watchdog Timer Support
                <*>   Artinchip SoC watchdog support
  2. DTS 参数配置
    Watchdog 驱动支持从 DTS 中配置的自定义参数,如下表:
    1. Watchdog 自定义参数
    参数名称 适用版本 类型 取值范围 功能说明
    dbg_continue V1.0 boolean 有 - 1,无 - 0 用 Jtag 进入 debug 状态时,计数是否继续默认值是 0,停止计数
    clr_thd V1.0 正整数 > 0 ,单位:秒 允许清除 WDT 的最小秒数
    注:
    1. 关于清除 WDT 的逻辑关系,请参考 Watchdog 清零的窗口示意图 的相关说明。
    2. 在 FPGA 环境,清零窗口的功能无效,需要屏蔽 thd 的判断逻辑。
  3. D211 配置
    common/d211.dtsi 中的参数配置:
    wdt0: watchdog@19000000 {
        compatible = "artinchip,aic-wdt-v1.0";
        reg = <0x0 0x19000000 0x0 0x1000>;
        interrupts-extended = <&plic0 64 IRQ_TYPE_LEVEL_HIGH>;
        clocks = <&cmu CLK_WDOG>;
        resets = <&rst RESET_WDOG>;
        dbg_continue;  // 使用 Jtag 进入 debug 状态时,计数是否继续。默认是暂停计数
        clr_thd = <3>;  // 用于设置 thd,单位:秒
    };
    注: 其中有两个扩展字段,如果没有配置将默认是 0。
  4. Board 配置
    xxx/board.dts 中的参数配置比较简单,只是说明是否要打开 Watchdog:
    &wdt0 {
        status = "okay";
    };