The mediatek board 'mt7621', is having a external watchdog timer, it resets the GPIO-18 every 500ms. To handle this scenario.
I modified the our dts file dummy.dts, added 'wdt-gpio' #include "mt7621.dtsi"/ { compatible = "mediatek,dummy", "mediatek,mt7621-soc"; model = "Dummy MT7621"; memory@0 { device_type = "memory"; reg = <0x0 0x8000000>; }; chosen { bootargs = "console=ttyS1,115200n8"; }; wdt-gpio { compatible = "linux,wdt-gpio"; gpios = <&gpio0 18 1>; hw_algo = "toggle"; hw_margin_ms = <400>; always-running = <1>; }; }; Added the following in Kernel config file, config-4.9 CONFIG_GPIO_WATCHDOG=y CONFIG_GPIO_WATCHDOG_ARCH_INITCALL=y to compile, drivers/watchdog/gpio_wdt.c But, this resulted in 'gpio_wdt_probe', getting called before mt7621_gpio. logs-> [ 0.410000] gpio_wdt_probe, [ 0.420000] gpio_wdt_probe, 170, priv->gpio=-517, flags=-2146148000 [ 0.490000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.490000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.500000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.500000] clocksource: Switched to clocksource GIC [ 0.510000] NET: Registered protocol family 2 So i modified drivers/watchdog/gpio_wdt.c -arch_initcall(gpio_wdt_init); +subsys_initcall(gpio_wdt_init); This resulted in, correct sequence.. mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.450000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.460000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.460000] of_get_named_gpio_flags, 112 [ 0.470000] gpio_wdt_probe, priv->gpio=18 [ 0.470000] gpio_wdt_probe, 216 The device WDT reset is not happening anymore, and boots fully.. [ 12.690000] br-lan: port 1(eth0.1) entered disabled state [ 12.700000] device eth0.1 entered promiscuous mode [ 12.710000] device eth0 entered promiscuous mode [ 12.720000] br-lan: port 1(eth0.1) entered blocking state [ 12.720000] br-lan: port 1(eth0.1) entered forwarding state [ 103.470000] mtk_soc_eth 1e100000.ethernet eth0: port 3 link down [ 111.710000] mtk_soc_eth 1e100000.ethernet eth0: port 3 link up But the issue is console not accepting commands when i press enter or type anything the command is not seen on the console. Can someone help me!! Mani
Starting kernel ... [ 0.000000] Linux version 4.9.20 (mani@mani) (gcc version 5.4.0 (LEDE GCC 5.4.0 r3990-d93482a) ) #0 SMP Tue Apr 11 13:05:09 2017 [ 0.000000] SoC Type: MediaTek MT7621 ver:1 eco:3 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU0 revision is: 0001992f (MIPS 1004Kc) [ 0.000000] MIPS: machine is Dummy MT7621 [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 08000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] VPE topology {2,2} total 4 [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [ 0.000000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] HighMem empty [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000000000000-0x0000000007ffffff] [ 0.000000] percpu: Embedded 12 pages/cpu @8110e000 s17712 r8192 d23248 u49152 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512 [ 0.000000] Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs,jffs2 [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes) [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Writing ErrCtl register=00000c00 [ 0.000000] Readback ErrCtl register=00000c00 [ 0.000000] Memory: 121848K/131072K available (3875K kernel code, 201K rwdata, 892K rodata, 2572K init, 256K bss, 9224K reserved, 0K cma-re) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] NR_IRQS:256 [ 0.000000] clocksource: GIC: mask: 0xffffffffffffffff max_cycles: 0xcaf478abb4, max_idle_ns: 440795247997 ns [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns [ 0.000000] Calibrating delay loop... 586.13 BogoMIPS (lpj=2930688) [ 0.070000] pid_max: default: 32768 minimum: 301 [ 0.070000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.080000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.090000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [ 0.090000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [ 0.090000] CPU1 revision is: 0001992f (MIPS 1004Kc) [ 0.170000] Synchronize counters for CPU 1: [ 0.170000] done. [ 0.170000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.170000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [ 0.170000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [ 0.170000] CPU2 revision is: 0001992f (MIPS 1004Kc) [ 0.250000] Synchronize counters for CPU 2: [ 0.250000] done. [ 0.250000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.250000] Primary data cache 32kB, 4-way, PIPT, no aliases, linesize 32 bytes [ 0.250000] MIPS secondary cache 256kB, 8-way, linesize 32 bytes. [ 0.250000] CPU3 revision is: 0001992f (MIPS 1004Kc) [ 0.330000] Synchronize counters for CPU 3: [ 0.330000] done. [ 0.330000] Brought up 4 CPUs [ 0.340000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.350000] futex hash table entries: 1024 (order: 3, 32768 bytes) [ 0.350000] pinctrl core: initialized pinctrl subsystem [ 0.360000] NET: Registered protocol family 16 [ 0.450000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.450000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.460000] mt7621_gpio 1e000600.gpio: registering 32 gpios [ 0.460000] of_get_named_gpio_flags, 112 [ 0.470000] gpio_wdt_probe, priv->gpio=18 [ 0.470000] gpio_wdt_probe, 216 [ 0.470000] clocksource: Switched to clocksource GIC [ 0.480000] NET: Registered protocol family 2 [ 0.480000] TCP established hash table entries: 1024 (order: 0, 4096 bytes) [ 0.480000] TCP bind hash table entries: 1024 (order: 1, 8192 bytes) [ 0.490000] TCP: Hash tables configured (established 1024 bind 1024) [ 0.500000] UDP hash table entries: 256 (order: 1, 8192 bytes) [ 0.500000] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) [ 0.510000] NET: Registered protocol family 1 [ 2.650000] Crashlog allocated RAM at address 0x3f00000 [ 2.660000] workingset: timestamp_bits=30 max_order=15 bucket_order=0 [ 2.670000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 2.680000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 2.690000] random: fast init done [ 2.690000] io scheduler noop registered [ 2.700000] io scheduler deadline registered (default) [ 2.700000] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled [ 2.710000] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 17, base_baud = 3125000) is a 16550A [ 2.720000] spi-mt7621 1e000b00.spi: sys_freq: 50000000 [ 2.730000] m25p80 spi32766.0: using chunked io (size=32) [ 2.730000] m25p80 spi32766.0: mx66l51235l (65536 Kbytes) [ 2.740000] 4 ofpart partitions found on MTD device spi32766.0 [ 2.740000] Creating 4 MTD partitions on "spi32766.0": [ 2.750000] 0x000000000000-0x000000030000 : "Bootloader" [ 2.750000] 0x000000030000-0x000000040000 : "Config" [ 2.760000] 0x000000040000-0x000000050000 : "factory" [ 2.770000] 0x000000050000-0x000001000000 : "firmware" [ 2.810000] libphy: Fixed MDIO Bus: probed [ 2.810000] netif_napi_add() called with weight 128 on device eth%d [ 2.830000] mtk_soc_eth 1e100000.ethernet: generated random MAC address f6:f0:dd:2a:92:c8 [ 2.840000] libphy: mdio: probed [ 4.250000] mtk_soc_eth 1e100000.ethernet: loaded mt7530 driver [ 4.260000] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 20 [ 4.270000] Netfilter messages via NETLINK v0.30. [ 4.270000] nf_conntrack version 0.5.0 (2048 buckets, 8192 max) [ 4.280000] NET: Registered protocol family 10 [ 4.290000] NET: Registered protocol family 17 [ 4.290000] 8021q: 802.1Q VLAN Support v1.8 [ 4.300000] hctosys: unable to open rtc device (rtc0) [ 4.300000] Warning: unable to open an initial console. [ 4.320000] Freeing unused kernel memory: 2572K (804dd000 - 80760000) [ 4.320000] This architecture does not have kernel memory protection. [ 4.340000] init: Console is alive [ 4.340000] init: - watchdog - [ 4.360000] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 4.360000] kmodloader: done loading kernel modules from /etc/modules-boot.d/* [ 4.380000] init: - preinit - [ 6.150000] mtk_soc_eth 1e100000.ethernet eth0: port 3 link up [ 6.570000] procd: - early - [ 6.580000] procd: - watchdog - [ 7.190000] procd: failed to set stdio [ 7.190000] procd: - ubus - [ 7.250000] procd: - init - [ 7.360000] kmodloader: loading kernel modules from /etc/modules.d/* [ 7.370000] tun: Universal TUN/TAP device driver, 1.6 [ 7.370000] tun: (C) 1999-2004 Max Krasnyansky <m...@qualcomm.com> [ 7.380000] ip6_tables: (C) 2000-2006 Netfilter Core Team [ 7.390000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 7.430000] xt_time: kernel timezone is -0000 [ 7.440000] PPP generic driver version 2.4.2 [ 7.440000] NET: Registered protocol family 24 [ 7.450000] kmodloader: done loading kernel modules from /etc/modules.d/* [ 11.280000] random: crng init done [ 12.690000] br-lan: port 1(eth0.1) entered blocking state [ 12.690000] br-lan: port 1(eth0.1) entered disabled state [ 12.700000] device eth0.1 entered promiscuous mode [ 12.710000] device eth0 entered promiscuous mode [ 12.720000] br-lan: port 1(eth0.1) entered blocking state [ 12.720000] br-lan: port 1(eth0.1) entered forwarding state [ 103.470000] mtk_soc_eth 1e100000.ethernet eth0: port 3 link down [ 111.710000] mtk_soc_eth 1e100000.ethernet eth0: port 3 link up
_______________________________________________ Lede-dev mailing list Lede-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/lede-dev