|
Re: Debian on NSA310S? July 22, 2015 05:07PM |
Registered: 8 years ago Posts: 118 |
|
Re: Debian on NSA310S? July 23, 2015 04:06AM |
Admin Registered: 13 years ago Posts: 18,576 |
/ # /sbin/halt led_state_map_addr = 4e Jul 23 08:50:57 NSA325-v2 linuxrc: starting pid 2781, tty '': '/etc/init.d/rc.shutdown' / # Starting "/etc/init.d/zypkg_controller.sh". Stopping all zypkgs via "/etc/init.d/zypkg_controller.sh" ... - shutdowning package "NFS" ... .... The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system halt md: stopping all md devices. Power down. egiga0: link down reg(3, 18) = 4985 egiga0: link up, full duplex, speed 1 Gbps reg(0, 18) = 0 egiga0: link down reg(17, 16) = 4500 reg(17, 25) = 9e4c reg(17, 24) = 41ff reg(17, 23) = ffa5 egiga0: link up, full duplex, speed 1 Gbps ADDRCONF(NETDEV_CHANGE): egiga0: link becomes ready
|
Re: Debian on NSA310S? July 23, 2015 05:46AM |
Registered: 8 years ago Posts: 118 |
|
Re: Debian on NSA310S? July 23, 2015 05:51AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 23, 2015 06:08AM |
Registered: 12 years ago Posts: 365 |
/ # /sbin/halt save exit: isCheckpointed 1 led_state_map_addr = 4e Jan 1 00:02:10 NSA310S linuxrc: starting pid 2603, tty '': '/etc/init.d/rc.shutdown' / # Starting "/etc/init.d/zypkg_controller.sh". Stopping all zypkgs via "/etc/init.d/zypkg_controller.sh" ... - shutdowning package "NFS" ... . . . The system is going down NOW! Sent SIGTERM to all processes Sent SIGKILL to all processes Requesting system halt md: stopping all md devices. Power down. reg(0, 4) = 0x21 reg(0, 9) = 0x0 egiga0: link down reg(0, 0) = 0x1140 reg(3, 18) = 0x4985 reg(3, 17) = 0x4420 reg(0, 18) = 0x0 reg(17, 16) = 0x4500 reg(17, 25) = 0xf45c reg(17, 24) = 0x2fab reg(17, 23) = 0x28feLast part looks the same on "halt" and "poweroff". Only a "link down" message. No "link up". Switch says "10HDX".
void zyxel_power_off(void *no_used)
{
if(atomic_read(&shutdown_enable))
{
#if defined CONFIG_MV_PHY_88E1310_WOL || defined CONFIG_MitraStar_STG315 || defined CONFIG_MitraStar_STG326
unsigned char mac_addr[6];
int ethPortNum = 0;
MV_U16 phy_reg;
mvEthMacAddrGet(0, mac_addr);
/* Power Saving */
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),4,0x21); // Page 0 Register 4 = 0x21
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 4, &phy_reg);
printk(KERN_ERR"reg(0, 4) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),9,0x0); // Page 0 Register 9 = 0x0
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 9, &phy_reg);
printk(KERN_ERR"reg(0, 9) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),0,0x9140); // reset eth-phy
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 0, &phy_reg);
printk(KERN_ERR"reg(0, 0) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x3);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),18,0x4985); /* Page 3 Register 18 = 0x4985 */
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 18, &phy_reg);
printk(KERN_ERR"reg(3, 18) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x3);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),17,0x4420); // Page 3 Register 17 = 0x4420
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 17, &phy_reg);
printk(KERN_ERR"reg(3, 17) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),18,0x80); /* Page 0 Register 18 = 0x80 */
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 18, &phy_reg);
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 13, &phy_reg);
printk(KERN_ERR"reg(0, 18) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x11);
if(atomic_read(&wol_enable))
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),16,0x5500); /* Page 17 Register16 = 0x5500 */
else
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),16, 0x5500 & ~(0x1 << 14));/* bit14 Magic Packet Match Enable*/
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 16, &phy_reg);
printk(KERN_ERR"reg(17, 16) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x11);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),25,mac_addr[1] << 8 | mac_addr[0]); /* Page 17 Register 25 = mac[1]mac[0] */
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 25, &phy_reg);
printk(KERN_ERR"reg(17, 25) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x11);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),24,mac_addr[3] << 8 | mac_addr[2]); /* Page 17 Register 24 = mac[3]mac[2] */
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 24, &phy_reg);
printk(KERN_ERR"reg(17, 24) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x11);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),23,mac_addr[5] << 8 | mac_addr[4]); /* Page 17 Register 23 = mac[5]mac[4] */
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 23, &phy_reg);
printk(KERN_ERR"reg(17, 23) = 0x%x\n", phy_reg);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 0x13, &phy_reg);
#endif
/* Output low */
gpio_out(POWER_OFF_GPIO_REG_OFFSET, 0x1);
}
}
Note the "reset eth-phy" comment in line 1142!
|
Re: Debian on NSA310S? July 23, 2015 06:39AM |
Admin Registered: 13 years ago Posts: 18,576 |
egiga0: link down
reg(0, 0) = 0x1140
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0);
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),0,0x9140); // reset eth-phy
mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 0, &phy_reg);
printk(KERN_ERR"reg(0, 0) = 0x%x\n", phy_reg);
|
Re: Debian on NSA310S? July 23, 2015 06:47AM |
Registered: 12 years ago Posts: 365 |
mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x0); mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),18,0x80); /* Page 0 Register 18 = 0x80 */ mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 18, &phy_reg); mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 13, &phy_reg); printk(KERN_ERR"reg(0, 18) = 0x%x\n", phy_reg); mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),22 ,0x11); if(atomic_read(&wol_enable)) mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),16,0x5500); /* Page 17 Register16 = 0x5500 */ else mvEthPhyRegWrite(mvBoardPhyAddrGet(ethPortNum),16, 0x5500 & ~(0x1 << 14));/* bit14 Magic Packet Match Enable*/ mvEthPhyRegRead(mvBoardPhyAddrGet(ethPortNum), 16, &phy_reg); printk(KERN_ERR"reg(17, 16) = 0x%x\n", phy_reg);
reg(0, 18) = 0x0 reg(17, 16) = 0x4500But I only think the output comes from there. May come from somewhere completly different...
|
Re: Debian on NSA310S? July 23, 2015 03:36PM |
Registered: 8 years ago Posts: 295 |
|
Re: Debian on NSA310S? July 23, 2015 05:03PM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 24, 2015 11:03AM |
Registered: 8 years ago Posts: 42 |
Hi!Quote
osa
> I have alse "link not ready" fixed with this patch
>
>
> Can I somehow try this with phypeek and phypoke?
> Tried with
>> phypoke 1 22 3 >> Gives error "illegal address"...
phypoke 1 16 3
phypoke 1 16 3 phypoke 1 16 0My network works after restart ( patch hacks regs earier so it works "at boot")
|
Re: Debian on NSA310S? July 25, 2015 06:38AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 25, 2015 12:16PM |
Registered: 12 years ago Posts: 365 |
> phypoke 1 16 3 >>
> phypoke 1 16 3 > phypoke 1 16 0 >> My network works after restart ( patch hacks regs
root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Speed: 10Mb/s Duplex: Half Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: no root@debian:~# phypoke 1 16 0 base address = b5dbf000 [ 86.679122] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 100 Mb/s, full duplex, flow control disabled words[0] = phypoke words[1] = 1 words[2] = 16 words[3] = 0 :GbitPhy[0x00000001:0x00000016] <= 0x00000000 root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: yes root@debian:~#So: phy inititalzed but link not working. But: will work after next reboot!
root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Speed: 10Mb/s Duplex: Half Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: no root@debian:~# phypoke 1 16 0 base address = b5dbf000 [ 86.679122] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 100 Mb/s, full duplex, flow control disabled words[0] = phypoke words[1] = 1 words[2] = 16 words[3] = 0 :GbitPhy[0x00000001:0x00000016] <= 0x00000000 root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: yes root@debian:~# phypoke 9 300 base address = b5db8000 words[0] = phypoke words[1] = 1 words[2] = 9 words[3] = 300 :GbitPhy[0x00000001:0x00000009] <= 0x00000300 root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: yes root@debian:~# phypoke 1 0 9140 base address = b5e6e000 [ 120.042058] mv643xx_eth_port mv643xx_eth_port.0 eth0: link down words[0] = phypoke words[1] = 1 words[2] = 0 words[3] = 9140 :GbitPhy[0x00000001:0x00000000] <= 0x00009140 [ 122.347532] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled root@debian:~# ethtool eth0 Settings for eth0: Supported ports: [ TP AUI BNC MII FIBRE ] Supported link modes: Not reported Supported pause frame use: No Supports auto-negotiation: No Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full Link partner advertised pause frame use: No Link partner advertised auto-negotiation: Yes Speed: 100Mb/s Duplex: Full Port: MII PHYAD: 1 Transceiver: external Auto-negotiation: on Supports Wake-on: d Wake-on: d Link detected: yes root@debian:~#Link is brought up immediately. If I leave out the
phypoke 9 300Link will not come up.
Speed: 100Mb/s Duplex: Fullafter the final poke. But my switch tells me its really 1000FDX. Don't ask me why.
|
Re: Debian on NSA310S? July 26, 2015 06:43PM |
Admin Registered: 13 years ago Posts: 18,576 |
> $ kwboottool/kwboot -t -B 115200 /dev/ttyUSB0 -b > uboot.2014.07-tld-3.nsa310.uart.kwb >>
> . > . > 92 % > [................................................. > .....................] > 94 % > [................................................. > .....................] > 96 % > [................................................. > .....................] > 99 % [....................................] > [Type Ctrl-\ + c to quit] >> Cursor blinks in the next line. No further output.
|
Re: Debian on NSA310S? July 27, 2015 06:19PM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 27, 2015 06:45PM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 28, 2015 03:22AM |
Registered: 12 years ago Posts: 365 |
root@debian:~# ethtool eth0
Settings for eth0:
Supported ports: [ TP AUI BNC MII FIBRE ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Speed: 10Mb/s
Duplex: Half
Port: MII
PHYAD: 1
Transceiver: external
Auto-negotiation: on
Supports Wake-on: d
Wake-on: d
Link detected: no
|
Re: Debian on NSA310S? July 28, 2015 03:37AM |
Registered: 8 years ago Posts: 118 |
> root@debian:~# ethtool eth0 > Settings for eth0: > Supported ports: [ TP AUI BNC MII FIBRE ] > Supported link modes: Not reported > Supported pause frame use: No > Supports auto-negotiation: No > Advertised link modes: Not reported > Advertised pause frame use: No > Advertised auto-negotiation: No > Speed: 10Mb/s > Duplex: Half > Port: MII > PHYAD: 1 > Transceiver: external > Auto-negotiation: on > Supports Wake-on: d > Wake-on: d > Link detected: no >>
|
Re: Debian on NSA310S? July 28, 2015 04:10AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 28, 2015 11:47PM |
Admin Registered: 13 years ago Posts: 18,576 |
../kwboot-tool/kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-1.1.4-bodhi.nsa310s.uart.bin
Sending boot message. Please reboot the target...|
Sending boot image...
0 % [......................................................................]
1 % [......................................................................]
3 % [......................................................................]
92 % [......................................................................]
94 % [......................................................................]
96 % [......................................................................]
97 % [......................................................................]
99 % [.......]
[Type Ctrl-\ + c to quit]
__ __ _ _
| \/ | __ _ _ ____ _____| | |
| |\/| |/ _` | '__\ \ / / _ \ | |
| | | | (_| | | \ V / __/ | |
|_| |_|\__,_|_| \_/ \___|_|_|
_ _ ____ _
| | | | | __ ) ___ ___ | |_
| | | |___| _ \ / _ \ / _ \| __|
| |_| |___| |_) | (_) | (_) | |_
\___/ |____/ \___/ \___/ \__|
** MARVELL BOARD: DB6702A-GMtech LE
U-Boot 1.1.4 (Jul 28 2015 - 21:10:06) Marvell version: 3.6.0
U-Boot code: 00600000 -> 0067FFF0 BSS: -> 006CFB00
Soc: 88F6702 A1 CPU running @ 1000Mhz L2 running @ 500Mhz
SysClock = 400Mhz , TClock = 166Mhz
DRAM (DDR2) CAS Latency = 5 tRP = 5 tRAS = 18 tRCD=6
DRAM CS[0] base 0x00000000 size 256MB
DRAM Total size 256MB 16bit width
Addresses 10M - 0M are saved for the U-Boot usage.
Mem malloc Initialization (10M - 7M): Done
NAND:128 MB
Flash: 0 kB
CPU : Marvell Feroceon (Rev 1)
Kernel address is 0xc80000.
Streaming disabled
Write allocate disabled
USB 0: host mode
PEX 0: interface detected no Link.
Net: egiga0 [PRIME]
Hit any key to stop autoboot: 0
|
Re: Debian on NSA310S? July 29, 2015 02:41AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 29, 2015 04:27AM |
Registered: 8 years ago Posts: 118 |
|
Re: Debian on NSA310S? July 29, 2015 04:39AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 29, 2015 12:56PM |
Registered: 8 years ago Posts: 118 |
|
Re: Debian on NSA310S? July 30, 2015 04:24AM |
Registered: 12 years ago Posts: 365 |
#!/bin/sh -x
### BEGIN INIT INFO
# Provides: nsa310s-phyup
### Required-Start: $local_fs $network
# Required-Start: $local_fs
# Required-Stop:
# X-Start-Before: $network
# Should-Start:
### Default-Start: 1 2 3 4 5
# Default-Start: S
# Default-Stop:
# Short-Description: Fix for ZyXEL NSA-310S ethernet not comming up.
# Description: Init of ethernet phy for ZyXEL NSA-301S.
### END INIT INFO
PATH=/sbin:/usr/sbin:/bin:/usr/bin
do_start () {
## for LED settings
/sbin/phypoke 1 16 3
/sbin/phypoke 1 10 1017
/sbin/phypoke 1 11 4408
#The MCU set the phy to 10-Mb mode as low-power status.
#We have to set it back when booting up.
/sbin/phypoke 1 16 0
/sbin/phypoke 1 4 1e1
/sbin/phypoke 1 9 300
## Downshift enable for network testing
/sbin/phypoke 1 10 3860
/sbin/phypoke 1 0 9140
}
case "$1" in
start|"")
echo "ZyXEL NSA-310S ethernet init"
do_start
;;
restart|reload|force-reload)
echo "Error: argument '$1' not supported" >&2
exit 3
;;
stop|status)
# No-op
;;
*)
echo "Usage: bootmisc.sh [start|stop]" >&2
exit 3
;;
esac
:
Tested different places (before network start / after network start, etc.) but no luck.
|
Re: Debian on NSA310S? July 30, 2015 05:31AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 30, 2015 05:36AM |
Admin Registered: 13 years ago Posts: 18,576 |
|
Re: Debian on NSA310S? July 30, 2015 06:26AM |
Registered: 8 years ago Posts: 118 |
|
Re: Debian on NSA310S? July 30, 2015 07:14AM |
Registered: 8 years ago Posts: 295 |
[ 24.219904] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled [ 24.229738] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [....] Configuring network interfaces...Internet Systems Consortium DHCP Client 4.3.1 Copyright 2004-2014 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ Listening on LPF/eth0/5c:f4:ab:e3:e6:1e Sending on LPF/eth0/5c:f4:ab:e3:e6:1e Sending on Socket/fallback DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6 DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11 DHCPREQUEST on eth0 to 255.255.255.255 port 67 DHCPOFFER from 192.168.1.1 DHCPACK from 192.168.1.1 Reloading /etc/samba/smb.conf: smbd. bound to 192.168.1.168 -- renewal in 20943 seconds. done.
|
Re: Debian on NSA310S? July 30, 2015 07:37AM |
Registered: 12 years ago Posts: 365 |
|
Re: Debian on NSA310S? July 30, 2015 09:58AM |
Registered: 8 years ago Posts: 295 |