Skip to contentSkip to conversation

unicore32 additional architecture files: low-level lib: ocd debug

PATCH In review Guan Xuetao 1 participant 1 message Feb 16, 2011 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 4/12 unicore32 additional architecture files: low-level lib: ocd debug

Message-Id: <06d7425e545689763d420f50bb0e9fad2833eb74.1297842537.git.gxt@mprc.pku.edu.cn>
In-Reply-To: <[email protected]>
References: <[email protected]>
From: GuanXuetao <[email protected]>
Date: Sat, 15 Jan 2011 18:22:19 +0800

This patch implements low-level debug libraries with On-Chip-Debugger hardware support.

---
 arch/unicore32/include/mach/ocd.h    |   36 ++++++++++++++
 arch/unicore32/kernel/debug-macro.S  |   89 ++++++++++++++++++++++++++++++++++
 arch/unicore32/kernel/debug.S        |   85 ++++++++++++++++++++++++++++++++
 arch/unicore32/kernel/early_printk.c |   59 ++++++++++++++++++++++
 4 files changed, 269 insertions(+), 0 deletions(-)
 create mode 100644 arch/unicore32/include/mach/ocd.h
 create mode 100644 arch/unicore32/kernel/debug-macro.S
 create mode 100644 arch/unicore32/kernel/debug.S
 create mode 100644 arch/unicore32/kernel/early_printk.c
arch/unicore32/include/mach/ocd.h new file +36 -0
new file mode 100644
index 0000000..189fd71
@@ -0,0 +1,36 @@
+/*
+ * linux/arch/unicore32/include/mach/ocd.h
+ *
+ * Code specific to PKUnity SoC and UniCore ISA
+ *
+ * Copyright (C) 2001-2010 GUAN Xue-tao
+ *
+ * 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.
+ */
+
+#ifndef __MACH_PUV3_OCD_H__
+#define __MACH_PUV3_OCD_H__
+
+#if defined(CONFIG_DEBUG_OCD)
+static inline void ocd_putc(unsigned int c)
+{
+	int status, i = 0x2000000;
+
+	do {
+		if (--i < 0)
+			return;
+
+		asm volatile ("movc %0, p1.c0, #0" : "=r" (status));
+	} while (status & 2);
+
+	asm("movc p1.c1, %0, #1" : : "r" (c));
+}
+
+#define putc(ch)	ocd_putc(ch)
+#else
+#define putc(ch)
+#endif
+
+#endif
arch/unicore32/kernel/debug-macro.S new file +89 -0

89 lines not on this page · raw message

arch/unicore32/kernel/debug.S new file +85 -0

85 lines not on this page · raw message

arch/unicore32/kernel/early_printk.c new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
1.6.2.2