From owner-freebsd-embedded@FreeBSD.ORG Wed Jul 17 23:54:17 2013 Return-Path: Delivered-To: freebsd-embedded@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C19CB51F; Wed, 17 Jul 2013 23:54:17 +0000 (UTC) (envelope-from hiren.panchasara@gmail.com) Received: from mail-ea0-x234.google.com (mail-ea0-x234.google.com [IPv6:2a00:1450:4013:c01::234]) by mx1.freebsd.org (Postfix) with ESMTP id 2E31F5EA; Wed, 17 Jul 2013 23:54:17 +0000 (UTC) Received: by mail-ea0-f180.google.com with SMTP id k10so1372171eaj.39 for ; Wed, 17 Jul 2013 16:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lPTN4zxr9qOhMOTsJWIAyqTRsMqMLi+QlnQseMUAGHE=; b=nvvy81h+YBI+kZTIIvMFsj+3cmlOC4dmpQu9Tab+Q0sMUZe51vLDzdYiPTow1GIrjG L8Qndj7J59YPMuYdBdaB+HAzadLBYx1tljaJLuPmBj/SwkZA6uYQ26ivIvnstkbOls/k N4yWOPyILvb2wqoL3BADBIKXk8J6R14f2IiEQGfCxgWIr9BVMnNuVXAaHL7UeIF9A/FS 8YCL5O2W3umdZjiI86pYf+31YGskx3F99wjK2RUNJP7rlKV38EcaeEDk9SNUdgBvahj9 SjlYw0ervVXxAmEcebJy9SUgF/b7ZYWrL6GVx6T3JkAcdqDrntA+nQC0Cym6E8SCY0RS EngQ== MIME-Version: 1.0 X-Received: by 10.15.55.199 with SMTP id v47mr8437011eew.41.1374105255621; Wed, 17 Jul 2013 16:54:15 -0700 (PDT) Received: by 10.14.119.203 with HTTP; Wed, 17 Jul 2013 16:54:15 -0700 (PDT) In-Reply-To: References: Date: Wed, 17 Jul 2013 16:54:15 -0700 Message-ID: Subject: Re: Making Picostation m2HP work From: hiren panchasara To: Luiz Otavio O Souza Content-Type: text/plain; charset=UTF-8 Cc: freebsd-embedded X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jul 2013 23:54:17 -0000 On Tue, Jul 16, 2013 at 6:48 AM, Luiz Otavio O Souza wrote: > On 16 July 2013 00:52, Adrian Chadd wrote: >> >> Right, >> >> you have to get the mdio bus configured up right, then attach arswitch to >> it. >> >> Then you tell arge0/arge1 what PHY it speaks to, via Stefan's mdioproxy >> stuff. >> >> _then_ arge0/arge1 will come up. >> >> Now, as for how you do that - i'd have to re-read the datasheet and >> write some documentation: >> >> * one of them (I think arge0) is directly glued to arswitch with no >> PHY per se - it's hard-programmed with a MIIbus mode (RMGII I think?) >> and 100/full or 1000/full > > > It's usually the arge1 which is dedicated to switch and it's hard-programmed > as 1000/full (even when the switch ports are just 10/100). > > arge0 is the 'WAN' port (using the dedicated PHY 4). > > The MDIO is at arge0 on ar7240 and at arge1 on ar7241. > > [...] >> >> >> I'll follow this up with a post explaining how the miibus, mdiobus, >> mdioproxy stuff and how arswitch is configured. Then I'll braindump >> that into the wiki. > > > Thanks Adrian! > > Stefan also has a nice documentation about how this stuff fits together: > > https://wiki.freebsd.org/StefanBethke/EtherSwitch > http://www.bsdcan.org/2012/schedule/attachments/201_BSDCan-2012-Bethke-Ethernet-Switch-Framework.pdf > Thanks a lot Adrian and Luiz for the explanation. I've built just the kernel with in-tree (-head) kernconf AP91 and hints file from Luiz: http://pastebin.com/Z647yiZh And I am seeing arge0/1 attaching: ar7240> go 80050100 ## Starting application at 0x80050100 ... CPU platform: Atheros AR7241 rev 1 CPU Frequency=390 MHz CPU DDR Frequency=390 MHz CPU AHB Frequency=195 MHz platform frequency: 390000000 CPU reference clock: 5 MHz arguments: a0 = 00000001 a1 = 81f4fcbc a2 = 00000010 a3 = fffffffe Cmd line:argv is invalid Environment: envp is invalid Cache info: picache_stride = 4096 picache_loopcount = 16 pdcache_stride = 4096 pdcache_loopcount = 8 cpu0: MIPS Technologies processor v116.147 MMU: Standard TLB, 16 entries L1 i-cache: 4 ways of 512 sets, 32 bytes per line L1 d-cache: 4 ways of 256 sets, 32 bytes per line Config1=0x9ee3519e Config3=0x20 KDB: debugger backends: ddb KDB: current backend: ddb Copyright (c) 1992-2013 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.0-CURRENT #1 r252757M: Wed Jul 17 16:45:15 PDT 2013 root@flymockour-l7.corp.yahoo.com:/usr/home/hirenp/head/obj/mips.mips/usr/home/hirenp/head/sys/AP91 mips gcc version 4.2.1 20070831 patched [FreeBSD] real memory = 16777216 (16384K bytes) avail memory = 11968512 (11MB) random device not loaded; using insecure entropy nexus0: clock0: on nexus0 Timecounter "MIPS32" frequency 195000000 Hz quality 800 Event timer "MIPS32" frequency 195000000 Hz quality 800 argemdio0: at mem 0x1a000000-0x1a000fff on nexus0 mdio0: on argemdio0 mdioproxy0: on mdio0 arswitch0: on mdio0 miibus0: on arswitch0 ukphy0: PHY 0 on miibus0 ukphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto miibus1: on arswitch0 ukphy1: PHY 1 on miibus1 ukphy1: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto miibus2: on arswitch0 ukphy2: PHY 2 on miibus2 ukphy2: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto miibus3: on arswitch0 ukphy3: PHY 3 on miibus3 ukphy3: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto mdio1: on arswitch0 mdioproxy1: on mdio1 etherswitch0: on arswitch0 apb0 at irq 4 on nexus0 uart0: <16550 or compatible> on apb0 uart0: console (115200,n,8,1) pcib0 at irq 0 on nexus0 pcib0: found EEPROM at 0x1fff1000 on 0.0.0 pcib0: EEPROM firmware: 0x1fff1000 @ 4096 bytes pcib0: device EEPROM 'pcib.0.bus.0.0.0.eeprom_firmware' registered pci0: on pcib0 pci0: at device 0.0 (no driver attached) arge0: at mem 0x19000000-0x19000fff irq 2 on nexus0 arge0: Overriding MAC from EEPROM miiproxy0: on arge0 miiproxy0: attached to target mdio1 arge0: finishing attachment, phymask 0010, proxy set miibus4: on miiproxy0 ukphy4: PHY 4 on miibus4 ukphy4: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto arge0: Ethernet address: 8e:42:00:5c:3c:04 arge1: at mem 0x1a000000-0x1a000fff irq 3 on nexus0 arge1: finishing attachment, phymask 0000, proxy null arge1: Ethernet address: 8e:42:00:5c:3c:05 spi0: at mem 0x1f000000-0x1f00000f on nexus0 spibus0: on spi0 mx25l0: at cs 0 on spibus0 mx25l0: w25q64, sector 65536 bytes, 128 sectors ar71xx_wdog0: on nexus0 ar71xx_wdog0: Previous reset was due to watchdog timeout Timecounters tick every 1.000 msec arswitch0port1: link state changed to DOWN arswitch0port2: link state changed to DOWN arswitch0port3: link state changed to DOWN arswitch0port4: link state changed to DOWN Trying to mount root from ufs:/dev/map/rootfs.uncompress []... mountroot: waiting for device /dev/map/rootfs.uncompress ... Mounting from ufs:/dev/map/rootfs.uncompress failed with error 19. Loader variables: Manual root filesystem specification: : [options] Mount using filesystem and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:tank cd9660:/dev/acd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) Abort manual input