Permalink
Browse files

Main bcm2708 linux port

Signed-off-by: popcornmix <popcornmix@gmail.com>
  • Loading branch information...
popcornmix authored and bootc committed Jan 17, 2012
1 parent 7627ad8 commit a9c439d68b133b848d1dc0a9f3be657ba7068779
Showing with 10,171 additions and 91 deletions.
  1. +14 −0 arch/arm/Kconfig
  2. +1 −0 arch/arm/Makefile
  3. +7 −1 arch/arm/boot/compressed/Makefile
  4. +338 −0 arch/arm/boot/compressed/divdi3.c
  5. +151 −0 arch/arm/boot/compressed/longlong.h
  6. +1,558 −0 arch/arm/configs/bcmrpi_cutdown_defconfig
  7. +4 −0 arch/arm/kernel/armksyms.c
  8. +2 −1 arch/arm/lib/Makefile
  9. +338 −0 arch/arm/lib/divdi3.c
  10. +27 −0 arch/arm/lib/lib1funcs.S
  11. +151 −0 arch/arm/lib/longlong.h
  12. +25 −0 arch/arm/mach-bcm2708/Kconfig
  13. +8 −0 arch/arm/mach-bcm2708/Makefile
  14. +3 −0 arch/arm/mach-bcm2708/Makefile.boot
  15. +399 −0 arch/arm/mach-bcm2708/armctrl.c
  16. +27 −0 arch/arm/mach-bcm2708/armctrl.h
  17. +658 −0 arch/arm/mach-bcm2708/bcm2708.c
  18. +51 −0 arch/arm/mach-bcm2708/bcm2708.h
  19. +323 −0 arch/arm/mach-bcm2708/bcm2708_gpio.c
  20. +61 −0 arch/arm/mach-bcm2708/clock.c
  21. +24 −0 arch/arm/mach-bcm2708/clock.h
  22. +397 −0 arch/arm/mach-bcm2708/dma.c
  23. +419 −0 arch/arm/mach-bcm2708/include/mach/arm_control.h
  24. +60 −0 arch/arm/mach-bcm2708/include/mach/arm_power.h
  25. +7 −0 arch/arm/mach-bcm2708/include/mach/clkdev.h
  26. +24 −0 arch/arm/mach-bcm2708/include/mach/debug-macro.S
  27. +84 −0 arch/arm/mach-bcm2708/include/mach/dma.h
  28. +69 −0 arch/arm/mach-bcm2708/include/mach/entry-macro.S
  29. +38 −0 arch/arm/mach-bcm2708/include/mach/frc.h
  30. +48 −0 arch/arm/mach-bcm2708/include/mach/gpio.h
  31. +28 −0 arch/arm/mach-bcm2708/include/mach/hardware.h
  32. +28 −0 arch/arm/mach-bcm2708/include/mach/io.h
  33. +190 −0 arch/arm/mach-bcm2708/include/mach/irqs.h
  34. +185 −0 arch/arm/mach-bcm2708/include/mach/irqs.h.orig
  35. +59 −0 arch/arm/mach-bcm2708/include/mach/memory.h
  36. +210 −0 arch/arm/mach-bcm2708/include/mach/platform.h
  37. +210 −0 arch/arm/mach-bcm2708/include/mach/platform.h.orig
  38. +26 −0 arch/arm/mach-bcm2708/include/mach/power.h
  39. +53 −0 arch/arm/mach-bcm2708/include/mach/system.h
  40. +23 −0 arch/arm/mach-bcm2708/include/mach/timex.h
  41. +49 −0 arch/arm/mach-bcm2708/include/mach/uncompress.h
  42. +34 −0 arch/arm/mach-bcm2708/include/mach/vc_mem.h
  43. +42 −0 arch/arm/mach-bcm2708/include/mach/vcio.h
  44. +20 −0 arch/arm/mach-bcm2708/include/mach/vmalloc.h
  45. +193 −0 arch/arm/mach-bcm2708/power.c
  46. +467 −0 arch/arm/mach-bcm2708/vc_mem.c
  47. +309 −0 arch/arm/mach-bcm2708/vcio.c
  48. +1 −1 arch/arm/mm/Kconfig
  49. +4 −2 arch/arm/mm/alignment.c
  50. +12 −3 arch/arm/mm/proc-v6.S
  51. +29 −0 drivers/mmc/host/Kconfig
  52. +2 −0 drivers/mmc/host/Makefile
  53. +889 −0 drivers/mmc/host/bcm2708_mci.c
  54. +101 −0 drivers/mmc/host/bcm2708_mci.h
  55. +1,461 −0 drivers/mmc/host/sdhci-bcm2708.c
  56. +187 −83 drivers/mmc/host/sdhci.c
  57. +41 −0 drivers/mmc/host/sdhci.h
  58. +2 −0 include/linux/mmc/sdhci.h
View
@@ -955,6 +955,19 @@ config PLAT_SPEAR
help
Support for ST's SPEAr platform (SPEAr3xx, SPEAr6xx and SPEAr13xx).
+config ARCH_BCM2708
+ bool "Broadcom BCM2708 family"
+ select CPU_V6
+ select ARM_AMBA
+ select HAVE_CLK
+ select CLKDEV_LOOKUP
+ select GENERIC_CLOCKEVENTS
+ select ARM_ERRATA_411920
+ select MACH_BCM2708
+ select VC4
+ help
+ This enables support for Broadcom BCM2708 boards.
+
config ARCH_VT8500
bool "VIA/WonderMedia 85xx"
select CPU_ARM926T
@@ -1098,6 +1111,7 @@ source "arch/arm/plat-versatile/Kconfig"
source "arch/arm/mach-vt8500/Kconfig"
source "arch/arm/mach-w90x900/Kconfig"
+source "arch/arm/mach-bcm2708/Kconfig"
# Definitions to make life easier
config ARCH_ACORN
View
@@ -198,6 +198,7 @@ machine-$(CONFIG_MACH_SPEAR310) := spear3xx
machine-$(CONFIG_MACH_SPEAR320) := spear3xx
machine-$(CONFIG_MACH_SPEAR600) := spear6xx
machine-$(CONFIG_ARCH_ZYNQ) := zynq
+machine-$(CONFIG_ARCH_BCM2708) := bcm2708
# Platform directory name. This list is sorted alphanumerically
# by CONFIG_* macro name.
@@ -145,11 +145,17 @@ LDFLAGS_vmlinux += -X
LDFLAGS_vmlinux += -T
# For __aeabi_uidivmod
-lib1funcs = $(obj)/lib1funcs.o
+lib1funcs = $(obj)/lib1funcs.o $(obj)/divdi3.o
$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S
$(call cmd,shipped)
+$(obj)/longlong.h: $(srctree)/arch/$(SRCARCH)/lib/longlong.h FORCE
+ $(call cmd,shipped)
+
+$(obj)/divdi3.c: $(srctree)/arch/$(SRCARCH)/lib/divdi3.c $(obj)/longlong.h FORCE
+ $(call cmd,shipped)
+
# We need to prevent any GOTOFF relocs being used with references
# to symbols in the .bss section since we cannot relocate them
# independently from the rest at run time. This can be achieved by
@@ -0,0 +1,338 @@
+/* 64-bit multiplication and division
+ Copyright (C) 1989, 1992-1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include "longlong.h"
+
+#define W_TYPE_SIZE (sizeof(long))
+
+#ifdef __ARMEB__
+struct DWstruct { long high, low;};
+#else
+struct DWstruct { long low, high;};
+#endif
+
+typedef union { struct DWstruct s; long long ll; } DWunion;
+
+/* Prototypes of exported functions. */
+long long __divdi3 (long long u, long long v);
+long long __moddi3 (long long u, long long v);
+unsigned long long __udivdi3 (unsigned long long u, unsigned long long v);
+unsigned long long __umoddi3 (unsigned long long u, unsigned long long v);
+
+static unsigned long long
+__udivmoddi4 (unsigned long long n, unsigned long long d, unsigned long long *rp)
+{
+ DWunion ww;
+ DWunion nn, dd;
+ DWunion rr;
+ unsigned long d0, d1, n0, n1, n2;
+ unsigned long q0, q1;
+ unsigned long b, bm;
+
+ nn.ll = n;
+ dd.ll = d;
+
+ d0 = dd.s.low;
+ d1 = dd.s.high;
+ n0 = nn.s.low;
+ n1 = nn.s.high;
+
+#if !UDIV_NEEDS_NORMALIZATION
+ if (d1 == 0)
+ {
+ if (d0 > n1)
+ {
+ /* 0q = nn / 0D */
+
+ udiv_qrnnd (q0, n0, n1, n0, d0);
+ q1 = 0;
+
+ /* Remainder in n0. */
+ }
+ else
+ {
+ /* qq = NN / 0d */
+
+ if (d0 == 0)
+ d0 = 1 / d0; /* Divide intentionally by zero. */
+
+ udiv_qrnnd (q1, n1, 0, n1, d0);
+ udiv_qrnnd (q0, n0, n1, n0, d0);
+
+ /* Remainder in n0. */
+ }
+
+ if (rp != 0)
+ {
+ rr.s.low = n0;
+ rr.s.high = 0;
+ *rp = rr.ll;
+ }
+ }
+
+#else /* UDIV_NEEDS_NORMALIZATION */
+
+ if (d1 == 0)
+ {
+ if (d0 > n1)
+ {
+ /* 0q = nn / 0D */
+
+ count_leading_zeros (bm, d0);
+
+ if (bm != 0)
+ {
+ /* Normalize, i.e. make the most significant bit of the
+ denominator set. */
+
+ d0 = d0 << bm;
+ n1 = (n1 << bm) | (n0 >> (W_TYPE_SIZE - bm));
+ n0 = n0 << bm;
+ }
+
+ udiv_qrnnd (q0, n0, n1, n0, d0);
+ q1 = 0;
+
+ /* Remainder in n0 >> bm. */
+ }
+ else
+ {
+ /* qq = NN / 0d */
+
+ if (d0 == 0)
+ d0 = 1 / d0; /* Divide intentionally by zero. */
+
+ count_leading_zeros (bm, d0);
+
+ if (bm == 0)
+ {
+ /* From (n1 >= d0) /\ (the most significant bit of d0 is set),
+ conclude (the most significant bit of n1 is set) /\ (the
+ leading quotient digit q1 = 1).
+
+ This special case is necessary, not an optimization.
+ (Shifts counts of W_TYPE_SIZE are undefined.) */
+
+ n1 -= d0;
+ q1 = 1;
+ }
+ else
+ {
+ /* Normalize. */
+
+ b = W_TYPE_SIZE - bm;
+
+ d0 = d0 << bm;
+ n2 = n1 >> b;
+ n1 = (n1 << bm) | (n0 >> b);
+ n0 = n0 << bm;
+
+ udiv_qrnnd (q1, n1, n2, n1, d0);
+ }
+
+ /* n1 != d0... */
+
+ udiv_qrnnd (q0, n0, n1, n0, d0);
+
+ /* Remainder in n0 >> bm. */
+ }
+
+ if (rp != 0)
+ {
+ rr.s.low = n0 >> bm;
+ rr.s.high = 0;
+ *rp = rr.ll;
+ }
+ }
+#endif /* UDIV_NEEDS_NORMALIZATION */
+
+ else
+ {
+ if (d1 > n1)
+ {
+ /* 00 = nn / DD */
+
+ q0 = 0;
+ q1 = 0;
+
+ /* Remainder in n1n0. */
+ if (rp != 0)
+ {
+ rr.s.low = n0;
+ rr.s.high = n1;
+ *rp = rr.ll;
+ }
+ }
+ else
+ {
+ /* 0q = NN / dd */
+
+ count_leading_zeros (bm, d1);
+ if (bm == 0)
+ {
+ /* From (n1 >= d1) /\ (the most significant bit of d1 is set),
+ conclude (the most significant bit of n1 is set) /\ (the
+ quotient digit q0 = 0 or 1).
+
+ This special case is necessary, not an optimization. */
+
+ /* The condition on the next line takes advantage of that
+ n1 >= d1 (true due to program flow). */
+ if (n1 > d1 || n0 >= d0)
+ {
+ q0 = 1;
+ sub_ddmmss (n1, n0, n1, n0, d1, d0);
+ }
+ else
+ q0 = 0;
+
+ q1 = 0;
+
+ if (rp != 0)
+ {
+ rr.s.low = n0;
+ rr.s.high = n1;
+ *rp = rr.ll;
+ }
+ }
+ else
+ {
+ unsigned long m1, m0;
+ /* Normalize. */
+
+ b = W_TYPE_SIZE - bm;
+
+ d1 = (d1 << bm) | (d0 >> b);
+ d0 = d0 << bm;
+ n2 = n1 >> b;
+ n1 = (n1 << bm) | (n0 >> b);
+ n0 = n0 << bm;
+
+ udiv_qrnnd (q0, n1, n2, n1, d1);
+ umul_ppmm (m1, m0, q0, d0);
+
+ if (m1 > n1 || (m1 == n1 && m0 > n0))
+ {
+ q0--;
+ sub_ddmmss (m1, m0, m1, m0, d1, d0);
+ }
+
+ q1 = 0;
+
+ /* Remainder in (n1n0 - m1m0) >> bm. */
+ if (rp != 0)
+ {
+ sub_ddmmss (n1, n0, n1, n0, m1, m0);
+ rr.s.low = (n1 << b) | (n0 >> bm);
+ rr.s.high = n1 >> bm;
+ *rp = rr.ll;
+ }
+ }
+ }
+ }
+
+ ww.s.low = q0;
+ ww.s.high = q1;
+ return ww.ll;
+}
+
+long long
+__divdi3 (long long u, long long v)
+{
+ long c = 0;
+ long long w;
+
+ if (u < 0)
+ {
+ c = ~c;
+ u = -u;
+ }
+ if (v < 0)
+ {
+ c = ~c;
+ v = -v;
+ }
+ w = __udivmoddi4 (u, v, 0);
+ if (c)
+ w = -w;
+ return w;
+}
+
+long long
+__moddi3 (long long u, long long v)
+{
+ long c = 0;
+ long long w;
+
+ if (u < 0)
+ {
+ c = ~c;
+ u = -u;
+ }
+ if (v < 0)
+ v = -v;
+ __udivmoddi4 (u, v, &w);
+ if (c)
+ w = -w;
+ return w;
+}
+
+unsigned long long
+__udivdi3 (unsigned long long u, unsigned long long v)
+{
+ return __udivmoddi4 (u, v, 0);
+}
+
+unsigned long long
+__umoddi3 (unsigned long long u, unsigned long long v)
+{
+ unsigned long long w;
+
+ __udivmoddi4 (u, v, &w);
+ return w;
+}
+
+long long
+__gnu_ldivmod_helper (long long a,
+
+ long long b,
+ long long *remainder)
+{
+ long long quotient;
+
+ quotient = __divdi3 (a, b);
+ *remainder = a - b * quotient;
+
+ return quotient;
+}
+
+unsigned long long
+
+__gnu_uldivmod_helper (unsigned long long a,
+
+ unsigned long long b,
+ unsigned long long *remainder)
+{
+ unsigned long long quotient;
+
+ quotient = __udivdi3 (a, b);
+ *remainder = a - b * quotient;
+ return quotient;
+}
Oops, something went wrong.

0 comments on commit a9c439d

Please sign in to comment.