diff options
author | Florian Fainelli <florian@openwrt.org> | 2009-05-06 18:12:49 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2009-05-06 18:12:49 +0000 |
commit | 70f94ae2ab0e5460b817ad7b670f071d904d8bab (patch) | |
tree | 89145ffa8eb280689e41008eacbd8057e3ac0dc7 /target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch | |
parent | 731a0e4791eafdb464c13b02383fae6711e72813 (diff) | |
download | upstream-70f94ae2ab0e5460b817ad7b670f071d904d8bab.tar.gz upstream-70f94ae2ab0e5460b817ad7b670f071d904d8bab.tar.bz2 upstream-70f94ae2ab0e5460b817ad7b670f071d904d8bab.zip |
add support for the Cavium Octeon SoC, tested on a Mototech evaluation board
SVN-Revision: 15640
Diffstat (limited to 'target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch')
-rw-r--r-- | target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch b/target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch new file mode 100644 index 0000000000..53ebffc8bd --- /dev/null +++ b/target/linux/cavium-octeon/patches/001-handle_removal_h_constraint.patch @@ -0,0 +1,52 @@ +This is an incomplete proof of concept that I applied to be able to +build a 64 bit kernel with GCC-4.4. It doesn't handle the 32 bit case +or the R4000_WAR case. + +Comments welcome. + +Signed-off-by: David Daney <ddaney@caviumnetworks.com> +--- + arch/mips/include/asm/compiler.h | 7 +++++++ + arch/mips/include/asm/delay.h | 4 ++++ + 2 files changed, 11 insertions(+), 0 deletions(-) + +diff --git a/arch/mips/include/asm/compiler.h b/arch/mips/include/asm/compiler.h +index 71f5c5c..1f0954d 100644 +--- a/arch/mips/include/asm/compiler.h ++++ b/arch/mips/include/asm/compiler.h +@@ -16,4 +16,11 @@ + #define GCC_REG_ACCUM "accum" + #endif + ++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) ++#define GCC_NO_H_CONSTRAINT ++#ifdef CONFIG_64BIT ++typedef unsigned int uint128_t __attribute__((mode(TI))); ++#endif ++#endif ++ + #endif /* _ASM_COMPILER_H */ +diff --git a/arch/mips/include/asm/delay.h b/arch/mips/include/asm/delay.h +index b0bccd2..3e467e8 100644 +--- a/arch/mips/include/asm/delay.h ++++ b/arch/mips/include/asm/delay.h +@@ -83,10 +83,14 @@ static inline void __udelay(unsigned long usecs, unsigned long lpj) + : "r" (usecs), "r" (lpj) + : GCC_REG_ACCUM); + else if (sizeof(long) == 8 && !R4000_WAR) ++#ifdef GCC_NO_H_CONSTRAINT ++ usecs = ((uint128_t)usecs * lpj) >> 64; ++#else + __asm__("dmultu\t%2, %3" + : "=h" (usecs), "=l" (lo) + : "r" (usecs), "r" (lpj) + : GCC_REG_ACCUM); ++#endif + else if (sizeof(long) == 8 && R4000_WAR) + __asm__("dmultu\t%3, %4\n\tmfhi\t%0" + : "=r" (usecs), "=h" (hi), "=l" (lo) +-- +1.5.6.5 + + + |