Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2016 13:10:24 +0100
From:      Attila Balogh <bat@netadmin.hu>
To:        freebsd-net@freebsd.org
Cc:        ppc@freebsd.org
Subject:   RB1100 network detection
Message-ID:  <71D01AD4-CC62-4CA0-938B-743ED420D18F@netadmin.hu>

next in thread | raw e-mail | index | archive | help
Hi Guys,

i am trying to get FreeBSD running on Mikrotik RB1100.

the box is pretty much straightforward, has a P2020E/P2010 SOC with 3 GE =
controllers.
two of the controllers has an AR8327 on them, the third one is connected =
to an AR8035 rgmii phy.
there are two PCIe GE controllers (AR8131).

after some poking the box booted 10.3 prerelease via bootp, but failed =
to find the phy and
to enumerate the switches. but the switches are my least concern, first =
get the box running freebsd
properly.

so the boot ended up in a kernel panic:
transfer started ................................................... =
transfer ok, time=3D2.09s
setting up elf image... OK
jumping to kernel code
GDB: no debug ports present
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2016 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights =
reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.3-PRERELEASE #0: Tue Jan 19 20:23:09 CET 2016
    bat@ppcbuilder:/usr/obj/powerpc.powerpc/usr/src/sys/MPC85XX powerpc
gcc version 4.2.1 20070831 patched [FreeBSD]
WARNING: WITNESS option enabled, expect reduced performance.
cpu0: Freescale e500v2 core revision 5.1, 1066.65 MHz
cpu0: Features 84000000<PPC32,MMU>
cpu0: HID0 80804000<EMCP,DOZE,TBEN>
real memory  =3D 2080358400 (1983 MB)
avail memory =3D 2040160256 (1945 MB)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0: dev=3D0 (BSP)
cpu1: dev=3D1
random device not loaded; using insecure entropy
random: <Software, Yarrow> initialized
ofwbus0: <Open Firmware Device Tree> on nexus0
simplebus0: <Flattened device tree simple bus> mem 0xe0000000-0xe00fffff =
on ofwbus0
openpic0: <OpenPIC Interrupt Controller> mem 0x40000-0x7ffff on =
simplebus0
uart0: <16550 or compatible> mem 0x4500-0x45ff irq 42 on simplebus0
uart0: console (115339,n,8,1)
tsec0: <Enhanced Three-Speed Ethernet Controller> mem 0x26000-0x26fff =
irq 31,32,33 on simplebus0
mii_attach: invalid phyloc 33575
tsec0: attaching PHYs failed
tsec0: could not be configured
device_attach: tsec0 attach returned 6
tsec0: <Enhanced Three-Speed Ethernet Controller> mem 0x24000-0x24fff =
irq 29,30,34 on simplebus0
mii_attach: invalid phyloc 33575
tsec0: attaching PHYs failed
tsec0: could not be configured
device_attach: tsec0 attach returned 6
tsec0: <Enhanced Three-Speed Ethernet Controller> mem 0x25000-0x25fff =
irq 35,36,40 on simplebus0
miibus0: <MII bus> on tsec0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0: OUI 0x00c82e, model 0x0003, rev. 3
ukphy0:  no media present
ifmedia_set: no match for 0x0/0xfffffff
panic: ifmedia_set
cpuid =3D 0
KDB: enter: panic
[ thread pid 0 tid 100000 ]
Stopped at      kdb_enter+0x60: addi    r0, r0, 0x0

i did some changes to atphy and miidevs to get past the detection (just =
added the model number).
miibus0: <MII bus> on tsec2
atphy0: <Atheros AR8035 10/100/1000 PHY> PHY 1 on miibus0
atphy0: OUI 0x00c82e, model 0x0003, rev. 3
atphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, =
1000baseT-FDX, 1000baseT-FDX-master, auto
tsec0: attaching PHYs OK!
tsec0: Ethernet address: d4:ca:6d:33:57:90
tsec0: so far we cool
tsec0: tx int ok
tsec0: rx int ok
tsec0: err int ok

so at least i got rid of panic, properly retrieved mac address, but the =
box does not see link. i=E2=80=99ll try to look into this and asked Pyun =
who wrote the atphy part
for help and advices.

since bootp is wired to this ethernet controller, it does not want to =
seek further. so i disabled it, and added alc to the kernel config. =
although pci is also in
the config, pci bus is not detected and enumerated, so no chance to =
detect the pcie GEs.

i need some kind of network support to able to connect to NFS to have a =
root fs, so either way (pcie ge or rgmii on tsec) is a good fix for me.

i tried to insert ramdisk into the kernel with some minimal tools to =
look around. it gets to mountroot but fails to mount the ufs on md0 with =
error 22.
i am crosscompiling the stuff on 10.2-release on i386, and created the =
disk image using the usual manual way.
if someone is able to give a hint why this latter could fail, i=E2=80=99d =
be very happy!

kind regards,
Attila

block diagram:
=
http://www.cloudrouterswitches.com/images/Ethernet-Routers/RB1100AHx2-Bloc=
k-Diagram.jpg =
<http://www.cloudrouterswitches.com/images/Ethernet-Routers/RB1100AHx2-Blo=
ck-Diagram.jpg>

the kernel config:
# Custom kernel for Freescale MPC85XX development boards like the CDS =
etc.
#
# $FreeBSD: stable/10/sys/powerpc/conf/MPC85XX 266331 2014-05-17 =
17:34:37Z ian $
#

cpu		BOOKE
cpu		BOOKE_E500
ident		MPC85XX

machine		powerpc	powerpc

makeoptions	DEBUG=3D"-Wa,-me500 -g"
makeoptions	NO_MODULES=3Dyes

options 	FPU_EMU

options 	_KPOSIX_PRIORITY_SCHEDULING
options 	ALT_BREAK_TO_DEBUGGER
options 	BREAK_TO_DEBUGGER
options 	BOOTP
options 	BOOTP_NFSROOT
options 	BOOTP_NFSV3
options 	BOOTP_WIRED_TO=3Dtsec0
options 	CD9660
options 	COMPAT_43
options 	DDB
#options 	DEADLKRES
options 	DEVICE_POLLING
#options 	DIAGNOSTIC
options 	FDT
makeoptions	FDT_DTS_FILE=3Dmpc8572ds.dts
#makeoptions	FDT_DTS_FILE=3Dmpc8555cds.dts
options 	FFS
options 	GDB
options 	GEOM_PART_GPT
options 	INET
#options 	INET6
#options 	INVARIANTS
#options 	INVARIANT_SUPPORT
options 	KDB
options 	KTRACE
options 	MD_ROOT
options 	MPC85XX
options 	MSDOSFS
options 	NFS_ROOT
options 	NFSCL
options 	NFSLOCKD
options 	PROCFS
options 	PSEUDOFS
options 	SCHED_ULE
options 	CAPABILITIES
options 	CAPABILITY_MODE
options 	SMP
options 	SYSVMSG
options 	SYSVSEM
options 	SYSVSHM
#options 	WITNESS
#options 	WITNESS_SKIPSPIN

device		ata
device		bpf
device		cfi
device		crypto
device		cryptodev
device		da
device		ds1553
#device		em
device		alc
device		ether
#device		fxp
device		iic
device		iicbus
#device		isa
device		loop
device		md
device		miibus
device		pass
device		pci
#device		quicc
device		random
#device		rl
device		scbus
device		scc
#device		sec
device		tsec
device		tun
device		uart
options 	USB_DEBUG	# enable debug msgs
#device		uhci
#device		umass
#device		usb
#device		vlan
device		nand
device		gpio

#options	   ROOTDEVNAME=3D\"ufs:md0\"
#options	   MD_ROOT_SIZE=3D8192
#makeoptions	   MFS_IMAGE=3D/test/root.img

device mmc
device mmcsd
device sdhci

device etherswitch
device miiproxy
device arswitch=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?71D01AD4-CC62-4CA0-938B-743ED420D18F>