Rtems-libbsd Networking Failed on Altcycv_devkit

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Aug 24 05:03:22 UTC 2017


On 23/08/17 22:30, Jianxium Yan wrote:

> Hi,
>
> I tried to run the rtems-libbsd networking testsuite samples on Altcycv_devkit board with RTEMS4.12, and found it is failed. The following is the message on the console.
> Attached is my network-config.h file. Does anyone know how to fix it?

You may have a look at the source code of the failed assert.

>
> SOCFPGA_CYCLONE5 # fatload mmc 0:1 0x300000 ftpd01.bin
> reading ftpd01.bin
> 3398976 bytes read in 162 ms (20 MiB/s)
> SOCFPGA_CYCLONE5 # go 0x300040
> ## Starting application at 0x00300040 ...
> *** LIBBSD FTPD 1 TEST ***
>
> RTEMS Shell on /dev/console. Use 'help' to list commands.
> [/] # xus0: <RTEMS Nexus device>
> dw_mmc0: <DesignWare Mobile Storage Host> on nexus0
> mmc0: <MMC/SD bus> on dw_mmc0
> mmcsd0: 16GB <SDHC SS16G 8.0 SN 0DCF4A42 MFG 04/2016 by 3 SD> at mmc0 50.0MHz/4bit/1-block
> dwcotg0: <DWC OTG 2.0 integrated USB controller> on nexus0
> usbus0 on dwcotg0
> dwc0: <Gigabit Ethernet Controller> on nexus0
> miibus0: <MII bus> on dwc0
> micphy0: <Micrel KSZ9031 10/100/1000 PHY> PHY 1 on miibus0
> micphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto
> emerg: assertion "0" failed: file "../../freebsd/sys/dev/mii/micphy.c", line 286, function: micphy_attach

#ifndef __rtems__
     miibus = device_get_parent(dev);
     parent = device_get_parent(miibus);

     if ((node = ofw_bus_get_node(parent)) == -1)
         return (ENXIO);

     if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ9031)
         ksz9031_load_values(sc, node);
     else
         ksz9021_load_values(sc, node);
#else /* __rtems__ */
     /* FIXME */
     if (sc->mii_mpd_model == MII_MODEL_MICREL_KSZ9031) {
         BSD_ASSERT(0);
     } else {
         ksz9021_write(sc, MII_KSZPHY_CLK_CONTROL_PAD_SKEW, 0xf0f0);
         ksz9021_write(sc, MII_KSZPHY_RX_DATA_PAD_SKEW, 0x0000);
         ksz9021_write(sc, MII_KSZPHY_TX_DATA_PAD_SKEW, 0x0000);
     }
#endif /* __rtems__ */

You probably don't have a Micrel PHY or the wrong model. The Altera 
Cyclone V support pre-dates the FDT support. It would be good to add the 
FDT support to this BSP and the corresponding libbsd drivers. You can 
try to use the generic PHY driver, e.g. replace

RTEMS_BSD_DRIVER_MIPHY;

with

SYSINIT_DRIVER_REFERENCE(ukphy, miibus);

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.




More information about the users mailing list