From 94e7279adcfef41cc30980616c031f6f75dbbd73 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 28 Aug 2014 15:02:54 +0200 Subject: bootsup fine now. strange. because networking works now?. patch from Greg Ungerer --- package/simpleinit/files/inittab | 2 - target/config/Config.in.qemuopts | 4 +- target/linux/patches/3.15.8/qemu-coldfire.patch | 24 ---- target/linux/patches/3.16.1/qemu-coldfire.patch | 24 ---- target/m68k/Makefile | 2 +- .../qemu-m68k/patches/3.15.8/qemu-coldfire.patch | 24 ++++ .../patches/3.16.1/m68k-coldfire-fec.patch | 145 +++++++++++++++++++++ .../qemu-m68k/patches/3.16.1/qemu-coldfire.patch | 24 ++++ 8 files changed, 196 insertions(+), 53 deletions(-) delete mode 100644 target/linux/patches/3.15.8/qemu-coldfire.patch delete mode 100644 target/linux/patches/3.16.1/qemu-coldfire.patch create mode 100644 target/m68k/qemu-m68k/patches/3.15.8/qemu-coldfire.patch create mode 100644 target/m68k/qemu-m68k/patches/3.16.1/m68k-coldfire-fec.patch create mode 100644 target/m68k/qemu-m68k/patches/3.16.1/qemu-coldfire.patch diff --git a/package/simpleinit/files/inittab b/package/simpleinit/files/inittab index 1c4744d6a..e69de29bb 100644 --- a/package/simpleinit/files/inittab +++ b/package/simpleinit/files/inittab @@ -1,2 +0,0 @@ -# example -#inet:unknown:/bin/inetd diff --git a/target/config/Config.in.qemuopts b/target/config/Config.in.qemuopts index 55ea6bcbb..7087fbfa4 100644 --- a/target/config/Config.in.qemuopts +++ b/target/config/Config.in.qemuopts @@ -2,7 +2,7 @@ # material, please see the LICENCE file in the top-level directory. menu "Qemu configuration" -depends on ADK_TARGET_QEMU +depends on ADK_TARGET_QEMU && !ADK_TARGET_SYSTEM_QEMU_M68K config ADK_QEMU_ARGS string @@ -29,7 +29,7 @@ endchoice choice prompt "Qemu Emulation with storage device" -depends on ADK_TARGET_QEMU && !ADK_TARGET_SYSTEM_QEMU_XTENSA && !ADK_TARGET_SYSTEM_QEMU_AARCH64 +depends on ADK_TARGET_QEMU && !ADK_TARGET_SYSTEM_QEMU_XTENSA && !ADK_TARGET_SYSTEM_QEMU_AARCH64 && !ADK_TARGET_SYSTEM_QEMU_M68K default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_ARCHIVE default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_SQUASHFS default ADK_TARGET_QEMU_WITH_BLOCK if ADK_TARGET_ROOTFS_JFFS2 diff --git a/target/linux/patches/3.15.8/qemu-coldfire.patch b/target/linux/patches/3.15.8/qemu-coldfire.patch deleted file mode 100644 index 503fe8ef3..000000000 --- a/target/linux/patches/3.15.8/qemu-coldfire.patch +++ /dev/null @@ -1,24 +0,0 @@ -m68k: enabled software emulation of separate supervisor/user stack - -Recent Coldfires have separate supervisor and user stack pointers, but -since older Coldfires didn't have that, the Linux kernel has a kind of -emulation mechanism for those pointers. - -Apparently, according to the Kconfig.cpu file, the 5208 is supposed to -support such separate pointers, but Qemu doesn't implement it. So we -cheat a bit here and force the usage of emulated separate stack -pointers. - -Signed-off-by: Thomas Petazzoni - -diff -Nur linux-3.16.orig/arch/m68k/Kconfig.cpu linux-3.16/arch/m68k/Kconfig.cpu ---- linux-3.16.orig/arch/m68k/Kconfig.cpu 2014-08-04 00:25:02.000000000 +0200 -+++ linux-3.16/arch/m68k/Kconfig.cpu 2014-08-13 16:58:59.568332805 +0200 -@@ -146,6 +146,7 @@ - depends on !MMU - select GENERIC_CLOCKEVENTS - select HAVE_CACHE_SPLIT -+ select COLDFIRE_SW_A7 - help - Freescale Coldfire 5207/5208 processor support. - diff --git a/target/linux/patches/3.16.1/qemu-coldfire.patch b/target/linux/patches/3.16.1/qemu-coldfire.patch deleted file mode 100644 index 503fe8ef3..000000000 --- a/target/linux/patches/3.16.1/qemu-coldfire.patch +++ /dev/null @@ -1,24 +0,0 @@ -m68k: enabled software emulation of separate supervisor/user stack - -Recent Coldfires have separate supervisor and user stack pointers, but -since older Coldfires didn't have that, the Linux kernel has a kind of -emulation mechanism for those pointers. - -Apparently, according to the Kconfig.cpu file, the 5208 is supposed to -support such separate pointers, but Qemu doesn't implement it. So we -cheat a bit here and force the usage of emulated separate stack -pointers. - -Signed-off-by: Thomas Petazzoni - -diff -Nur linux-3.16.orig/arch/m68k/Kconfig.cpu linux-3.16/arch/m68k/Kconfig.cpu ---- linux-3.16.orig/arch/m68k/Kconfig.cpu 2014-08-04 00:25:02.000000000 +0200 -+++ linux-3.16/arch/m68k/Kconfig.cpu 2014-08-13 16:58:59.568332805 +0200 -@@ -146,6 +146,7 @@ - depends on !MMU - select GENERIC_CLOCKEVENTS - select HAVE_CACHE_SPLIT -+ select COLDFIRE_SW_A7 - help - Freescale Coldfire 5207/5208 processor support. - diff --git a/target/m68k/Makefile b/target/m68k/Makefile index 8e64dc764..36fd45ad8 100644 --- a/target/m68k/Makefile +++ b/target/m68k/Makefile @@ -9,7 +9,7 @@ include $(ADK_TOPDIR)/mk/image.mk KERNEL:=$(LINUX_DIR)/vmlinux QEMU_ARGS:=${ADK_QEMU_ARGS} -QEMU_ARGS+=-M mcf5208evb -cpu m5208 +QEMU_ARGS+=-nographic -M mcf5208evb -cpu m5208 # target helper text ifeq ($(ADK_TARGET_FS),archive) diff --git a/target/m68k/qemu-m68k/patches/3.15.8/qemu-coldfire.patch b/target/m68k/qemu-m68k/patches/3.15.8/qemu-coldfire.patch new file mode 100644 index 000000000..503fe8ef3 --- /dev/null +++ b/target/m68k/qemu-m68k/patches/3.15.8/qemu-coldfire.patch @@ -0,0 +1,24 @@ +m68k: enabled software emulation of separate supervisor/user stack + +Recent Coldfires have separate supervisor and user stack pointers, but +since older Coldfires didn't have that, the Linux kernel has a kind of +emulation mechanism for those pointers. + +Apparently, according to the Kconfig.cpu file, the 5208 is supposed to +support such separate pointers, but Qemu doesn't implement it. So we +cheat a bit here and force the usage of emulated separate stack +pointers. + +Signed-off-by: Thomas Petazzoni + +diff -Nur linux-3.16.orig/arch/m68k/Kconfig.cpu linux-3.16/arch/m68k/Kconfig.cpu +--- linux-3.16.orig/arch/m68k/Kconfig.cpu 2014-08-04 00:25:02.000000000 +0200 ++++ linux-3.16/arch/m68k/Kconfig.cpu 2014-08-13 16:58:59.568332805 +0200 +@@ -146,6 +146,7 @@ + depends on !MMU + select GENERIC_CLOCKEVENTS + select HAVE_CACHE_SPLIT ++ select COLDFIRE_SW_A7 + help + Freescale Coldfire 5207/5208 processor support. + diff --git a/target/m68k/qemu-m68k/patches/3.16.1/m68k-coldfire-fec.patch b/target/m68k/qemu-m68k/patches/3.16.1/m68k-coldfire-fec.patch new file mode 100644 index 000000000..60dfadb6d --- /dev/null +++ b/target/m68k/qemu-m68k/patches/3.16.1/m68k-coldfire-fec.patch @@ -0,0 +1,145 @@ +diff -Nur linux-3.16.1.orig/drivers/net/ethernet/freescale/fec_main.c linux-3.16.1/drivers/net/ethernet/freescale/fec_main.c +--- linux-3.16.1.orig/drivers/net/ethernet/freescale/fec_main.c 2014-08-14 04:36:35.000000000 +0200 ++++ linux-3.16.1/drivers/net/ethernet/freescale/fec_main.c 2014-08-28 14:14:15.573666435 +0200 +@@ -154,7 +154,7 @@ + module_param_array(macaddr, byte, NULL, 0); + MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); + +-#if defined(CONFIG_M5272) ++#if defined(CONFIG_COLDFIRE) + /* + * Some hardware gets it MAC address out of local flash memory. + * if this is non-zero then assume it is the address to get MAC from. +@@ -165,14 +165,14 @@ + #define FEC_FLASHMAC 0xf0006000 + #elif defined(CONFIG_CANCam) + #define FEC_FLASHMAC 0xf0020000 +-#elif defined (CONFIG_M5272C3) ++#elif defined (CONFIG_COLDFIREC3) + #define FEC_FLASHMAC (0xffe04000 + 4) + #elif defined(CONFIG_MOD5272) + #define FEC_FLASHMAC 0xffc0406b + #else + #define FEC_FLASHMAC 0 + #endif +-#endif /* CONFIG_M5272 */ ++#endif /* CONFIG_COLDFIRE */ + + /* Interrupt events/masks. */ + #define FEC_ENET_HBERR ((uint)0x80000000) /* Heartbeat error */ +@@ -826,7 +826,9 @@ + 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 */ +@@ -892,7 +894,7 @@ + /* 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) +@@ -953,7 +955,7 @@ + #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) && +@@ -971,13 +973,13 @@ + } else { + rcntl &= ~FEC_ENET_FCE; + } +-#endif /* !defined(CONFIG_M5272) */ ++#endif /* !defined(CONFIG_COLDFIRE) */ + + writel(rcntl, fep->hwp + FEC_R_CNTRL); + + /* Setup multicast filter. */ + set_multicast_list(ndev); +-#ifndef CONFIG_M5272 ++#ifndef CONFIG_COLDFIRE + writel(0, fep->hwp + FEC_HASH_TABLE_HIGH); + writel(0, fep->hwp + FEC_HASH_TABLE_LOW); + #endif +@@ -992,7 +994,7 @@ + if (fep->bufdesc_ex) + ecntl |= (1 << 4); + +-#ifndef CONFIG_M5272 ++#ifndef CONFIG_COLDFIRE + /* Enable the MIB statistic event counters */ + writel(0 << 31, fep->hwp + FEC_MIB_CTRLSTAT); + #endif +@@ -1442,7 +1444,7 @@ + * 3) from flash or fuse (via platform data) + */ + if (!is_valid_ether_addr(iap)) { +-#ifdef CONFIG_M5272 ++#ifdef CONFIG_COLDFIRE + if (FEC_FLASHMAC) + iap = (unsigned char *)FEC_FLASHMAC; + #else +@@ -1667,7 +1669,7 @@ + /* mask with MAC supported features */ + if (id_entry->driver_data & FEC_QUIRK_HAS_GBIT) { + phy_dev->supported &= PHY_GBIT_FEATURES; +-#if !defined(CONFIG_M5272) ++#if !defined(CONFIG_COLDFIRE) + phy_dev->supported |= SUPPORTED_Pause; + #endif + } +@@ -1853,7 +1855,7 @@ + } + } + +-#if !defined(CONFIG_M5272) ++#if !defined(CONFIG_COLDFIRE) + + static void fec_enet_get_pauseparam(struct net_device *ndev, + struct ethtool_pauseparam *pause) +@@ -1999,7 +2001,7 @@ + return -EOPNOTSUPP; + } + } +-#endif /* !defined(CONFIG_M5272) */ ++#endif /* !defined(CONFIG_COLDFIRE) */ + + static int fec_enet_nway_reset(struct net_device *dev) + { +@@ -2013,7 +2015,7 @@ + } + + static const struct ethtool_ops fec_enet_ethtool_ops = { +-#if !defined(CONFIG_M5272) ++#if !defined(CONFIG_COLDFIRE) + .get_pauseparam = fec_enet_get_pauseparam, + .set_pauseparam = fec_enet_set_pauseparam, + #endif +@@ -2023,7 +2025,7 @@ + .get_link = ethtool_op_get_link, + .get_ts_info = fec_enet_get_ts_info, + .nway_reset = fec_enet_nway_reset, +-#ifndef CONFIG_M5272 ++#ifndef CONFIG_COLDFIRE + .get_ethtool_stats = fec_enet_get_ethtool_stats, + .get_strings = fec_enet_get_strings, + .get_sset_count = fec_enet_get_sset_count, +@@ -2500,7 +2502,7 @@ + /* 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)) diff --git a/target/m68k/qemu-m68k/patches/3.16.1/qemu-coldfire.patch b/target/m68k/qemu-m68k/patches/3.16.1/qemu-coldfire.patch new file mode 100644 index 000000000..503fe8ef3 --- /dev/null +++ b/target/m68k/qemu-m68k/patches/3.16.1/qemu-coldfire.patch @@ -0,0 +1,24 @@ +m68k: enabled software emulation of separate supervisor/user stack + +Recent Coldfires have separate supervisor and user stack pointers, but +since older Coldfires didn't have that, the Linux kernel has a kind of +emulation mechanism for those pointers. + +Apparently, according to the Kconfig.cpu file, the 5208 is supposed to +support such separate pointers, but Qemu doesn't implement it. So we +cheat a bit here and force the usage of emulated separate stack +pointers. + +Signed-off-by: Thomas Petazzoni + +diff -Nur linux-3.16.orig/arch/m68k/Kconfig.cpu linux-3.16/arch/m68k/Kconfig.cpu +--- linux-3.16.orig/arch/m68k/Kconfig.cpu 2014-08-04 00:25:02.000000000 +0200 ++++ linux-3.16/arch/m68k/Kconfig.cpu 2014-08-13 16:58:59.568332805 +0200 +@@ -146,6 +146,7 @@ + depends on !MMU + select GENERIC_CLOCKEVENTS + select HAVE_CACHE_SPLIT ++ select COLDFIRE_SW_A7 + help + Freescale Coldfire 5207/5208 processor support. + -- cgit v1.2.3