09-17-2016, 06:50 PM
Take 1 (SSH over ethernet... this can't end well!!)
a) self-compiled devmem2 as wasn't in my packges list... wget www.lartmaker.nl/lartware/port/devmem2.c && gcc -o devmem2 devmem2.c
b). read EMAC register EMAC_CLK_REG at 0x1c00030
c). test ping to default gateway
d). write EMAC register EMAC_CLK_REG at 0x1c00030
promptly lost SSH connection... and device wouldn't reconnect on cable re-insertion. Good thing I'd started an auto-reboot timer just in case ;-)
---
Take 2 (with serial connection this time)
b). read EMAC register EMAC_CLK_REG at 0x1c00030
c). test ping to default gateway
d). write EMAC register EMAC_CLK_REG at 0x1c00030
e). test ping to default gateway
Other notes:
After executing d) above, very poor ping response from other device on network. Cable re-insertion made no difference whatsover.
Pinging pine from windows box:
Running e) (revert clock back to internal) resulted in immediate return to normal response.
Pinging pine64 from windows box again:
a) self-compiled devmem2 as wasn't in my packges list... wget www.lartmaker.nl/lartware/port/devmem2.c && gcc -o devmem2 devmem2.c
b). read EMAC register EMAC_CLK_REG at 0x1c00030
Code:
pfeerick@pine64:~$ sudo ./devmem2 0x1c00030 w
/dev/mem opened.
Memory mapped at address 0x7f8f8d4000.
Value at address 0x1C00030 (0x7f8f8d4030): 0x10C06
c). test ping to default gateway
Code:
pfeerick@pine64:~$ ping `ip route show 0.0.0.0/0 | awk '{print $3}'`
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.512 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.761 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.476 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.536 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.498 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=0.725 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=0.489 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=0.896 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=0.718 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.476 ms
^C
--- 192.168.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9009ms
rtt min/avg/max/mdev = 0.476/0.608/0.896/0.147 ms
d). write EMAC register EMAC_CLK_REG at 0x1c00030
Code:
sudo ./devmem2 0x1c00030 w 0x10C05
promptly lost SSH connection... and device wouldn't reconnect on cable re-insertion. Good thing I'd started an auto-reboot timer just in case ;-)
---
Take 2 (with serial connection this time)
b). read EMAC register EMAC_CLK_REG at 0x1c00030
Code:
pfeerick@pine64:~$ sudo ./devmem2 0x1c00030 w
/dev/mem opened.
Memory mapped at address 0x7fae01c000.
Value at address 0x1C00030 (0x7fae01c030): 0x10C06
c). test ping to default gateway
Code:
pfeerick@pine64:~$ ping `ip route show 0.0.0.0/0 | awk '{print $3}'`
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.931 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.568 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.796 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.618 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.847 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=0.674 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=0.892 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=0.714 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=0.740 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.563 ms
^C
--- 192.168.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8993ms
rtt min/avg/max/mdev = 0.563/0.734/0.931/0.126 ms
d). write EMAC register EMAC_CLK_REG at 0x1c00030
Code:
pfeerick@pine64:~$ sudo ./devmem2 0x1c00030 w 0x10C05
/dev/mem opened.
Memory mapped at address 0x7f908b4000.
Value at address 0x1C00030 (0x7f908b4030): 0x10C06
Written 0x10C05; readback 0x10C05
e). test ping to default gateway
Code:
pfeerick@pine64:~$ ping `ip route show 0.0.0.0/0 | awk '{print $3}'`
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.580 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=0.744 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=0.767 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.786 ms
64 bytes from 192.168.0.1: icmp_seq=11 ttl=64 time=1.20 ms
64 bytes from 192.168.0.1: icmp_seq=14 ttl=64 time=0.691 ms
64 bytes from 192.168.0.1: icmp_seq=15 ttl=64 time=0.717 ms
64 bytes from 192.168.0.1: icmp_seq=16 ttl=64 time=0.746 ms
64 bytes from 192.168.0.1: icmp_seq=18 ttl=64 time=0.802 ms
64 bytes from 192.168.0.1: icmp_seq=19 ttl=64 time=0.831 ms
^C
--- 192.168.0.1 ping statistics ---
20 packets transmitted, 10 received, 50% packet loss, time 19012ms
rtt min/avg/max/mdev = 0.580/0.786/1.201/0.155 ms
Other notes:
After executing d) above, very poor ping response from other device on network. Cable re-insertion made no difference whatsover.
Pinging pine from windows box:
Code:
Pinging 192.168.0.57 with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Request timed out.
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.0.57:
Packets: Sent = 16, Received = 2, Lost = 14 (87% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms
Running e) (revert clock back to internal) resulted in immediate return to normal response.
Code:
pfeerick@pine64:~$ ping `ip route show 0.0.0.0/0 | awk '{print $3}'`
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
64 bytes from 192.168.0.1: icmp_seq=1 ttl=64 time=0.904 ms
64 bytes from 192.168.0.1: icmp_seq=2 ttl=64 time=0.579 ms
64 bytes from 192.168.0.1: icmp_seq=3 ttl=64 time=0.606 ms
64 bytes from 192.168.0.1: icmp_seq=4 ttl=64 time=0.427 ms
64 bytes from 192.168.0.1: icmp_seq=5 ttl=64 time=0.647 ms
64 bytes from 192.168.0.1: icmp_seq=6 ttl=64 time=0.468 ms
64 bytes from 192.168.0.1: icmp_seq=7 ttl=64 time=0.687 ms
64 bytes from 192.168.0.1: icmp_seq=8 ttl=64 time=0.506 ms
64 bytes from 192.168.0.1: icmp_seq=9 ttl=64 time=0.726 ms
64 bytes from 192.168.0.1: icmp_seq=10 ttl=64 time=0.549 ms
^C
--- 192.168.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 8993ms
rtt min/avg/max/mdev = 0.427/0.609/0.904/0.136 ms
Pinging pine64 from windows box again:
Code:
C:\Users\Peter>ping -t 192.168.0.57
Pinging 192.168.0.57 with 32 bytes of data:
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Reply from 192.168.0.57: bytes=32 time=1ms TTL=64
Reply from 192.168.0.57: bytes=32 time=1ms TTL=64
Reply from 192.168.0.57: bytes=32 time<1ms TTL=64
Ping statistics for 192.168.0.57:
Packets: Sent = 6, Received = 6, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 1ms, Average = 0ms