Re: qemu/m68k
Greg Ungerer <[email protected]>
| Newsgroups | gmane.linux.uclinux.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Waldemar, On 22/08/14 06:25, Waldemar Brodkorb wrote: >>> Do you have a suggestion why I get a segfault after first executed >>> command? Similar behaviour Thomas Petazzoni have seen, while he was >>> trying to run buildroot in Qemu/m68k. See here: >>> http://lists.busybox.net/pipermail/buildroot/2012-April/052585.html >> >> No, I haven't seen that behavior. Is it a hush problem? >> Maybe try a simpler shell to see if you get the same result. > > Okay, it seems a problem with my uClibc version or configuration. > Still investigating. But using the sash from uClinux works fine > with my own kernel. Ok, at least that gives you a working base to go from. >>> qemu: hardware error: mcf_fec_read: Bad address 0x1c4 >> >> Hmmm, yeah, it does stop there. Not sure why. I will need to look >> more closely at that. > > Did you found anything? Yep. The problem is that the FEC driver is writing to registers that don't exist in the FEC hardware module on the ColdFire family. Support for some of the extended registers used on the FEC are used on ARM implementations, and they had added support for those in more recent years. I never picked those up on real hardware. Accesses to those on addresses cause no (visible) problems. Anyway, attached is a patch I propose to fix it. I will be sending this to the linux net-dev list soon. > BTW: Are Cisco devices not official supported by uClinux? > I recently had the luck to find an old Cisco 1000 Series router > with a M68360 Motorola CPU. I like to use it probably for some > runtime testing, if I can boot Linux on it. I don't think anything is "official" in uClinux really :-) There is some old and probably very crufty support for the 68360 in mainline. Not sure what platforms it was used on. Regards Greg _______________________________________________ uClinux-dev mailing list [email protected] http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by [email protected] To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
0001-net-fec-do-not-read-write-undefined-registers-on-Col.patch
(text/x-diff, 3.9 KB)
From 66b3d160150bee108c40e032214a2d93d782aff1 Mon Sep 17 00:00:00 2001 From: Greg Ungerer <[email protected]> Date: Mon, 18 Aug 2014 16:47:43 +1000 Subject: [PATCH] net: fec: do not read/write undefined registers on ColdFire FEC The Freescale FEC hardware module is used on many different SoC parts, across at least 3 different CPU architectures. The FEC implementation on the ColdFire family parts does not define the following registers: FEC_R_FIFO_RSFL FEC_R_FIFO_RSEM FEC_R_FIFO_RAEM FEC_R_FIFO_RAFL FEC_RACC FEC_MIIGSK_CFGR FEC_MIIGSK_ENR But the driver reads and writes to those undefined locations. Those reads and writes don't seem to have any side effects on real hardware. At least none that have been observed so far. But they will trip qemu to trigger a trap for an undefined access. Modify the conditionals that currently exist in the driver to be used when compiling for any ColdFire architecture (not just the M5272). Signed-off-by: Greg Ungerer <[email protected]> --- drivers/net/ethernet/freescale/fec_main.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 4f87dff..b9045bb 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -832,7 +832,9 @@ fec_restart(struct net_device *ndev) const struct platform_device_id *id_entry = platform_get_device_id(fep->pdev); int i; +#if !defined(CONFIG_COLDFIRE) u32 val; +#endif u32 temp_mac[2]; u32 rcntl = OPT_FRAME_SIZE | 0x04; u32 ecntl = 0x2; /* ETHEREN */ @@ -889,7 +891,7 @@ fec_restart(struct net_device *ndev) /* Set MII speed */ writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED); -#if !defined(CONFIG_M5272) +#if !defined(CONFIG_COLDFIRE) /* set RX checksum */ val = readl(fep->hwp + FEC_RACC); if (fep->csum_flags & FLAG_RX_CSUM_ENABLED) @@ -950,7 +952,7 @@ fec_restart(struct net_device *ndev) #endif } -#if !defined(CONFIG_M5272) +#if !defined(CONFIG_COLDFIRE) /* enable pause frame*/ if ((fep->pause_flag & FEC_PAUSE_FLAG_ENABLE) || ((fep->pause_flag & FEC_PAUSE_FLAG_AUTONEG) && @@ -968,7 +970,7 @@ fec_restart(struct net_device *ndev) } else { rcntl &= ~FEC_ENET_FCE; } -#endif /* !defined(CONFIG_M5272) */ +#endif /* !defined(CONFIG_COLDFIRE) */ writel(rcntl, fep->hwp + FEC_R_CNTRL); @@ -1689,7 +1691,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) if (id_entry->driver_data & FEC_QUIRK_HAS_GBIT) { phy_dev->supported &= PHY_GBIT_FEATURES; phy_dev->supported &= ~SUPPORTED_1000baseT_Half; -#if !defined(CONFIG_M5272) +#if !defined(CONFIG_COLDFIRE) phy_dev->supported |= SUPPORTED_Pause; #endif } @@ -1884,7 +1886,7 @@ static int fec_enet_get_ts_info(struct net_device *ndev, } } -#if !defined(CONFIG_M5272) +#if !defined(CONFIG_COLDFIRE) static void fec_enet_get_pauseparam(struct net_device *ndev, struct ethtool_pauseparam *pause) @@ -2039,7 +2041,7 @@ static int fec_enet_get_sset_count(struct net_device *dev, int sset) return -EOPNOTSUPP; } } -#endif /* !defined(CONFIG_M5272) */ +#endif /* !defined(CONFIG_COLDFIRE) */ static int fec_enet_nway_reset(struct net_device *dev) { @@ -2058,7 +2060,7 @@ static const struct ethtool_ops fec_enet_ethtool_ops = { .get_drvinfo = fec_enet_get_drvinfo, .nway_reset = fec_enet_nway_reset, .get_link = ethtool_op_get_link, -#ifndef CONFIG_M5272 +#ifndef CONFIG_COLDFIRE .get_pauseparam = fec_enet_get_pauseparam, .set_pauseparam = fec_enet_set_pauseparam, .get_strings = fec_enet_get_strings, @@ -2561,7 +2563,7 @@ fec_probe(struct platform_device *pdev) /* setup board info structure */ fep = netdev_priv(ndev); -#if !defined(CONFIG_M5272) +#if !defined(CONFIG_COLDFIRE) /* default enable pause frame auto negotiation */ if (pdev->id_entry && (pdev->id_entry->driver_data & FEC_QUIRK_HAS_GBIT)) -- 1.9.1