* [PATCH] mach-omap: add HAS_DEBUG_LL
@ 2012-03-05 10:33 Jan Weitzel
2012-03-05 17:13 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Jan Weitzel @ 2012-03-05 10:33 UTC (permalink / raw)
To: barebox
Add support for debug_ll
Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
---
arch/arm/Kconfig | 1 +
arch/arm/mach-omap/include/mach/debug_ll.h | 54 ++++++++++++++++++++++++++++
2 files changed, 55 insertions(+), 0 deletions(-)
create mode 100644 arch/arm/mach-omap/include/mach/debug_ll.h
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4c0ee58..67a1009 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -61,6 +61,7 @@ config ARCH_NOMADIK
config ARCH_OMAP
bool "TI OMAP"
+ select HAS_DEBUG_LL
config ARCH_PXA
bool "Intel/Marvell PXA based"
diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
new file mode 100644
index 0000000..be388d1
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/debug_ll.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011
+ * Author: Jan Weitzel <j.weitzel@phytec.de>
+ * based on arch/arm/mach-versatile/include/mach/debug_ll.h
+ *
+ * barebox is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * barebox 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with barebox. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __MACH_DEBUG_LL_H__
+#define __MACH_DEBUG_LL_H__
+
+#include <asm/io.h>
+
+#ifdef CONFIG_ARCH_OMAP3
+#include <mach/omap3-silicon.h>
+
+#ifdef CONFIG_OMAP3EVM_UART1
+#define UART_BASE OMAP_UART1_BASE
+#else
+#define UART_BASE OMAP_UART3_BASE
+#endif
+
+#endif
+
+#ifdef CONFIG_ARCH_OMAP4
+#include <mach/omap4-silicon.h>
+#define UART_BASE OMAP44XX_UART3_BASE
+#endif
+
+#define LSR_THRE 0x20 /* Xmit holding register empty */
+#define LSR (5 << 2)
+#define THR (0 << 2)
+
+static inline void putc(char c)
+{
+ /* Wait until there is space in the FIFO */
+ while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
+ /* Send the character */
+ writeb(c, UART_BASE + THR);
+ /* Wait to make sure it hits the line, in case we die too soon. */
+ while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
+}
+#endif
--
1.7.0.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mach-omap: add HAS_DEBUG_LL
2012-03-05 10:33 [PATCH] mach-omap: add HAS_DEBUG_LL Jan Weitzel
@ 2012-03-05 17:13 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2012-03-05 17:13 UTC (permalink / raw)
To: Jan Weitzel; +Cc: barebox
On Mon, Mar 05, 2012 at 11:33:26AM +0100, Jan Weitzel wrote:
> Add support for debug_ll
>
> Signed-off-by: Jan Weitzel <j.weitzel@phytec.de>
Applied, thanks
Sascha
> ---
> arch/arm/Kconfig | 1 +
> arch/arm/mach-omap/include/mach/debug_ll.h | 54 ++++++++++++++++++++++++++++
> 2 files changed, 55 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-omap/include/mach/debug_ll.h
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 4c0ee58..67a1009 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -61,6 +61,7 @@ config ARCH_NOMADIK
>
> config ARCH_OMAP
> bool "TI OMAP"
> + select HAS_DEBUG_LL
>
> config ARCH_PXA
> bool "Intel/Marvell PXA based"
> diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h
> new file mode 100644
> index 0000000..be388d1
> --- /dev/null
> +++ b/arch/arm/mach-omap/include/mach/debug_ll.h
> @@ -0,0 +1,54 @@
> +/*
> + * Copyright (C) 2011
> + * Author: Jan Weitzel <j.weitzel@phytec.de>
> + * based on arch/arm/mach-versatile/include/mach/debug_ll.h
> + *
> + * barebox is free software: you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation, either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * barebox 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 General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with barebox. If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef __MACH_DEBUG_LL_H__
> +#define __MACH_DEBUG_LL_H__
> +
> +#include <asm/io.h>
> +
> +#ifdef CONFIG_ARCH_OMAP3
> +#include <mach/omap3-silicon.h>
> +
> +#ifdef CONFIG_OMAP3EVM_UART1
> +#define UART_BASE OMAP_UART1_BASE
> +#else
> +#define UART_BASE OMAP_UART3_BASE
> +#endif
> +
> +#endif
> +
> +#ifdef CONFIG_ARCH_OMAP4
> +#include <mach/omap4-silicon.h>
> +#define UART_BASE OMAP44XX_UART3_BASE
> +#endif
> +
> +#define LSR_THRE 0x20 /* Xmit holding register empty */
> +#define LSR (5 << 2)
> +#define THR (0 << 2)
> +
> +static inline void putc(char c)
> +{
> + /* Wait until there is space in the FIFO */
> + while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
> + /* Send the character */
> + writeb(c, UART_BASE + THR);
> + /* Wait to make sure it hits the line, in case we die too soon. */
> + while ((readb(UART_BASE + LSR) & LSR_THRE) == 0);
> +}
> +#endif
> --
> 1.7.0.4
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-05 17:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-05 10:33 [PATCH] mach-omap: add HAS_DEBUG_LL Jan Weitzel
2012-03-05 17:13 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox