aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/debug/samsung.S
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-19 13:35:57 +0200
committerArnd Bergmann <arnd@arndb.de>2013-04-19 14:33:09 +0200
commit56b690481c4baed815b9e4acf5ea89eadb58ba17 (patch)
treea543108af0789de129150ec4662230eeafeae877 /arch/arm/include/debug/samsung.S
parentARM: tegra: build assembly files with -march=armv7-a (diff)
parentARM: exynos: enable multiplatform support (diff)
downloadlinux-dev-56b690481c4baed815b9e4acf5ea89eadb58ba17.tar.xz
linux-dev-56b690481c4baed815b9e4acf5ea89eadb58ba17.zip
Merge branch 'samsung/exynos-multiplatform' into next/multiplatform
These patches get us closer to adding multiplatform support on the Exynos platform, they are part of a longer series of patches. This would get all the simple stuff out of the way, and I don't think there is a big risk of introducing regressions with these. A lot of the other patches have already been merged into subsystem trees. After this series in in arm-soc, what is left comes down to * The ASoC conversion to dmaengine won't make it unless someone who knows that code better steps up to do it right away. This means that we won't have audio in a 3.10 multiplatform kernel on Exynos, but it will still work for users that don't enable multiplatform. * The irqchip (combiner), clk and clksource patches are all based on top of other changesets we pulled in from your trees, so I would not make them part of the next/multiplatform branch. We can apply them on top of the next/drivers branch once they are tested successfully. * A trivial patch is needed in the end to actually make CONFIG_ARCH_EXYNOS visible in multiplatform configurations. We will do that as a separate patch once everything else is there. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/include/debug/samsung.S')
-rw-r--r--arch/arm/include/debug/samsung.S87
1 files changed, 87 insertions, 0 deletions
diff --git a/arch/arm/include/debug/samsung.S b/arch/arm/include/debug/samsung.S
new file mode 100644
index 000000000000..f3a9cff6d5d4
--- /dev/null
+++ b/arch/arm/include/debug/samsung.S
@@ -0,0 +1,87 @@
+/* arch/arm/plat-samsung/include/plat/debug-macro.S
+ *
+ * Copyright 2005, 2007 Simtec Electronics
+ * http://armlinux.simtec.co.uk/
+ * Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+*/
+
+#include <plat/regs-serial.h>
+
+/* The S5PV210/S5PC110 implementations are as belows. */
+
+ .macro fifo_level_s5pv210 rd, rx
+ ldr \rd, [\rx, # S3C2410_UFSTAT]
+ and \rd, \rd, #S5PV210_UFSTAT_TXMASK
+ .endm
+
+ .macro fifo_full_s5pv210 rd, rx
+ ldr \rd, [\rx, # S3C2410_UFSTAT]
+ tst \rd, #S5PV210_UFSTAT_TXFULL
+ .endm
+
+/* The S3C2440 implementations are used by default as they are the
+ * most widely re-used */
+
+ .macro fifo_level_s3c2440 rd, rx
+ ldr \rd, [\rx, # S3C2410_UFSTAT]
+ and \rd, \rd, #S3C2440_UFSTAT_TXMASK
+ .endm
+
+#ifndef fifo_level
+#define fifo_level fifo_level_s3c2440
+#endif
+
+ .macro fifo_full_s3c2440 rd, rx
+ ldr \rd, [\rx, # S3C2410_UFSTAT]
+ tst \rd, #S3C2440_UFSTAT_TXFULL
+ .endm
+
+#ifndef fifo_full
+#define fifo_full fifo_full_s3c2440
+#endif
+
+ .macro senduart,rd,rx
+ strb \rd, [\rx, # S3C2410_UTXH]
+ .endm
+
+ .macro busyuart, rd, rx
+ ldr \rd, [\rx, # S3C2410_UFCON]
+ tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
+ beq 1001f @
+ @ FIFO enabled...
+1003:
+ fifo_full \rd, \rx
+ bne 1003b
+ b 1002f
+
+1001:
+ @ busy waiting for non fifo
+ ldr \rd, [\rx, # S3C2410_UTRSTAT]
+ tst \rd, #S3C2410_UTRSTAT_TXFE
+ beq 1001b
+
+1002: @ exit busyuart
+ .endm
+
+ .macro waituart,rd,rx
+ ldr \rd, [\rx, # S3C2410_UFCON]
+ tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled?
+ beq 1001f @
+ @ FIFO enabled...
+1003:
+ fifo_level \rd, \rx
+ teq \rd, #0
+ bne 1003b
+ b 1002f
+1001:
+ @ idle waiting for non fifo
+ ldr \rd, [\rx, # S3C2410_UTRSTAT]
+ tst \rd, #S3C2410_UTRSTAT_TXFE
+ beq 1001b
+
+1002: @ exit busyuart
+ .endm