diff options
author | Waldemar Brodkorb <wbx@openadk.org> | 2015-02-15 09:45:39 -0600 |
---|---|---|
committer | Waldemar Brodkorb <wbx@openadk.org> | 2015-02-19 14:51:28 -0600 |
commit | 164f50489ad76684ec2155b66e1ecae52b95dd94 (patch) | |
tree | fe6f745de20d727367f2f2db1cf7034051837bcf | |
parent | f453f2605a456e5c4dfe788e1cc1e04e075d87c2 (diff) |
add support for coldfire with gcc 4.9.2/binutils 2.25
The annoying kernel panic after boot is back :(
-rw-r--r-- | target/linux/config/Config.in.kernel | 17 | ||||
-rw-r--r-- | target/m68k/qemu-m68k/patches/3.19/m68k-coldfire-fec.patch | 118 | ||||
-rw-r--r-- | target/m68k/qemu-m68k/patches/3.19/qemu-coldfire.patch | 24 | ||||
-rw-r--r-- | toolchain/binutils/Makefile | 2 | ||||
-rw-r--r-- | toolchain/elf2flt/Makefile.inc | 2 | ||||
-rw-r--r-- | toolchain/gcc/patches/4.9.2/disable-atomics.m68k | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/4.9.2/disable-tm.m68k | 14 |
7 files changed, 181 insertions, 8 deletions
diff --git a/target/linux/config/Config.in.kernel b/target/linux/config/Config.in.kernel index b303c473d..fc4ecb8d6 100644 --- a/target/linux/config/Config.in.kernel +++ b/target/linux/config/Config.in.kernel @@ -134,6 +134,7 @@ config ADK_KERNEL_COMP_XZ select ADK_KERNEL_RD_XZ select ADK_KERNEL_KERNEL_XZ select ADK_KERNEL_INITRAMFS_COMPRESSION_XZ + depends on !ADK_TARGET_UCLINUX config ADK_KERNEL_COMP_LZ4 bool "use LZ4 compression" @@ -141,30 +142,34 @@ config ADK_KERNEL_COMP_LZ4 select ADK_KERNEL_KERNEL_LZ4 select ADK_KERNEL_INITRAMFS_COMPRESSION_LZ4 depends on ADK_TARGET_ARCH_X86 || ADK_TARGET_ARCH_ARM + depends on !ADK_TARGET_UCLINUX config ADK_KERNEL_COMP_LZMA bool "use LZMA compression" select ADK_KERNEL_RD_LZMA select ADK_KERNEL_KERNEL_LZMA select ADK_KERNEL_INITRAMFS_COMPRESSION_LZMA + depends on !ADK_TARGET_UCLINUX config ADK_KERNEL_COMP_LZO bool "use LZO compression" select ADK_KERNEL_RD_LZO select ADK_KERNEL_KERNEL_LZO select ADK_KERNEL_INITRAMFS_COMPRESSION_LZO - -config ADK_KERNEL_COMP_GZIP - bool "use GZIP compression" - select ADK_KERNEL_RD_GZIP - select ADK_KERNEL_KERNEL_GZIP - select ADK_KERNEL_INITRAMFS_COMPRESSION_GZIP + depends on !ADK_TARGET_UCLINUX config ADK_KERNEL_COMP_BZIP2 bool "use BZIP2 compression" select ADK_KERNEL_RD_BZIP2 select ADK_KERNEL_KERNEL_BZIP2 select ADK_KERNEL_INITRAMFS_COMPRESSION_BZIP2 + depends on !ADK_TARGET_UCLINUX + +config ADK_KERNEL_COMP_GZIP + bool "use GZIP compression" + select ADK_KERNEL_RD_GZIP + select ADK_KERNEL_KERNEL_GZIP + select ADK_KERNEL_INITRAMFS_COMPRESSION_GZIP endchoice diff --git a/target/m68k/qemu-m68k/patches/3.19/m68k-coldfire-fec.patch b/target/m68k/qemu-m68k/patches/3.19/m68k-coldfire-fec.patch new file mode 100644 index 000000000..ceaa21ce6 --- /dev/null +++ b/target/m68k/qemu-m68k/patches/3.19/m68k-coldfire-fec.patch @@ -0,0 +1,118 @@ +diff -Nur linux-3.18.2.orig/drivers/net/ethernet/freescale/fec_main.c linux-3.18.2/drivers/net/ethernet/freescale/fec_main.c +--- linux-3.18.2.orig/drivers/net/ethernet/freescale/fec_main.c 2015-01-08 12:30:41.000000000 -0600 ++++ linux-3.18.2/drivers/net/ethernet/freescale/fec_main.c 2015-01-11 20:34:04.690309863 -0600 +@@ -136,7 +136,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. +@@ -154,7 +154,7 @@ + #else + #define FEC_FLASHMAC 0 + #endif +-#endif /* CONFIG_M5272 */ ++#endif /* CONFIG_COLDFIRE */ + + /* The FEC stores dest/src/type/vlan, data, and checksum for receive packets. + */ +@@ -978,7 +978,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) +@@ -1039,7 +1039,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) && +@@ -1057,13 +1057,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 +@@ -1078,7 +1078,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 +@@ -1656,7 +1656,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 +@@ -1930,7 +1930,7 @@ + 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 + } +@@ -2125,7 +2125,7 @@ + } + } + +-#if !defined(CONFIG_M5272) ++#if !defined(CONFIG_COLDFIRE) + + static void fec_enet_get_pauseparam(struct net_device *ndev, + struct ethtool_pauseparam *pause) +@@ -2280,7 +2280,7 @@ + return -EOPNOTSUPP; + } + } +-#endif /* !defined(CONFIG_M5272) */ ++#endif /* !defined(CONFIG_COLDFIRE) */ + + static int fec_enet_nway_reset(struct net_device *dev) + { +@@ -2466,7 +2466,7 @@ + .get_link = ethtool_op_get_link, + .get_coalesce = fec_enet_get_coalesce, + .set_coalesce = fec_enet_set_coalesce, +-#ifndef CONFIG_M5272 ++#ifndef CONFIG_COLDFIRE + .get_pauseparam = fec_enet_get_pauseparam, + .set_pauseparam = fec_enet_set_pauseparam, + .get_strings = fec_enet_get_strings, +@@ -3164,7 +3164,7 @@ + fep->num_rx_queues = num_rx_qs; + fep->num_tx_queues = num_tx_qs; + +-#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.19/qemu-coldfire.patch b/target/m68k/qemu-m68k/patches/3.19/qemu-coldfire.patch new file mode 100644 index 000000000..14d2f610b --- /dev/null +++ b/target/m68k/qemu-m68k/patches/3.19/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 <thomas.petazzoni at free-electrons.com> + +diff -Nur linux-3.17.7.orig/arch/m68k/Kconfig.cpu linux-3.17.7/arch/m68k/Kconfig.cpu +--- linux-3.17.7.orig/arch/m68k/Kconfig.cpu 2014-12-16 11:37:26.000000000 -0600 ++++ linux-3.17.7/arch/m68k/Kconfig.cpu 2014-12-27 14:12:19.291459730 -0600 +@@ -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/toolchain/binutils/Makefile b/toolchain/binutils/Makefile index 559df4174..18fc2137b 100644 --- a/toolchain/binutils/Makefile +++ b/toolchain/binutils/Makefile @@ -56,7 +56,7 @@ endif --disable-dependency-tracking \ --disable-libtool-lock \ --disable-nls \ - --disable-plugins \ + --enable-plugins \ --disable-werror \ --disable-install-libiberty \ ${CONFOPTS} \ diff --git a/toolchain/elf2flt/Makefile.inc b/toolchain/elf2flt/Makefile.inc index 56a0d696a..a3f39ab52 100644 --- a/toolchain/elf2flt/Makefile.inc +++ b/toolchain/elf2flt/Makefile.inc @@ -4,5 +4,5 @@ PKG_NAME:= elf2flt PKG_VERSION:= 20150129 PKG_RELEASE:= 1 -PKG_HASH:= b52b0d14f13af559c0b22578853a893cdc45025ea65779f9a8d759201e5409ed +PKG_HASH:= b0b9792723f380794c44db4124815f961f2cb87be156d4e2f560759f9f9f913b PKG_SITES:= http://www.openadk.org/distfiles/ diff --git a/toolchain/gcc/patches/4.9.2/disable-atomics.m68k b/toolchain/gcc/patches/4.9.2/disable-atomics.m68k new file mode 100644 index 000000000..4ab553218 --- /dev/null +++ b/toolchain/gcc/patches/4.9.2/disable-atomics.m68k @@ -0,0 +1,12 @@ +diff -Nur gcc-4.8.3.orig/libgcc/config.host gcc-4.8.3/libgcc/config.host +--- gcc-4.8.3.orig/libgcc/config.host 2014-03-20 17:12:30.000000000 +0100 ++++ gcc-4.8.3/libgcc/config.host 2014-07-26 13:15:06.359463368 +0200 +@@ -689,7 +689,7 @@ + m68k*-*-openbsd*) + ;; + m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc +- tmake_file="$tmake_file m68k/t-floatlib m68k/t-linux" ++ tmake_file="$tmake_file m68k/t-floatlib" + md_unwind_header=m68k/linux-unwind.h + ;; + m68k-*-linux*) # Motorola m68k's running GNU/Linux diff --git a/toolchain/gcc/patches/4.9.2/disable-tm.m68k b/toolchain/gcc/patches/4.9.2/disable-tm.m68k new file mode 100644 index 000000000..02b5cb854 --- /dev/null +++ b/toolchain/gcc/patches/4.9.2/disable-tm.m68k @@ -0,0 +1,14 @@ +diff -Nur gcc-4.8.3.orig/gcc/config/m68k/uclinux.h gcc-4.8.3/gcc/config/m68k/uclinux.h +--- gcc-4.8.3.orig/gcc/config/m68k/uclinux.h 2013-01-10 21:38:27.000000000 +0100 ++++ gcc-4.8.3/gcc/config/m68k/uclinux.h 2014-08-25 17:03:59.543127685 +0200 +@@ -20,6 +20,10 @@ + along with GCC; see the file COPYING3. If not see + <http://www.gnu.org/licenses/>. */ + ++/* Do not use TM clone registry. It breaks -msep-data (-fPIC) code. */ ++/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584 */ ++#define USE_TM_CLONE_REGISTRY 0 ++ + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ + "%{mshared-library-id=0|!mshared-library-id=*: crt1.o%s ;: Scrt1.o%s} \ |