summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-stm32mp/include/mach/debug_ll.h
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2019-06-11 11:43:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-06-13 08:22:47 +0200
commit09c9203cac8728926db8457ddaa88856afe014d9 (patch)
treea5b93d410d067d7601ebbf765c9e68cb6a263a38 /arch/arm/mach-stm32mp/include/mach/debug_ll.h
parentafa8665f9f1a5666c63db762fcad53e7425126ef (diff)
downloadbarebox-09c9203cac8728926db8457ddaa88856afe014d9.tar.gz
barebox-09c9203cac8728926db8457ddaa88856afe014d9.tar.xz
ARM: stm32mp1: rename to stm32mp
Serial and clk driver both depend on CONFIG_ARCH_STM32MP1, so either the Kconfig symbol or their depend needs to change. Patches posted by the vendor to Linux, U-Boot and their BSP Yocto-Layer speak of a STM32MP-Family of which the STM32MP1 is the first series, thus rename the arch by dropping the 1. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-stm32mp/include/mach/debug_ll.h')
-rw-r--r--arch/arm/mach-stm32mp/include/mach/debug_ll.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-stm32mp/include/mach/debug_ll.h b/arch/arm/mach-stm32mp/include/mach/debug_ll.h
new file mode 100644
index 0000000000..99fedb91fe
--- /dev/null
+++ b/arch/arm/mach-stm32mp/include/mach/debug_ll.h
@@ -0,0 +1,28 @@
+#ifndef __MACH_STM32MP1_DEBUG_LL_H
+#define __MACH_STM32MP1_DEBUG_LL_H
+
+#include <io.h>
+#include <mach/stm32.h>
+
+#define DEBUG_LL_UART_ADDR STM32_UART4_BASE
+
+#define CR1_OFFSET 0x00
+#define CR3_OFFSET 0x08
+#define BRR_OFFSET 0x0c
+#define ISR_OFFSET 0x1c
+#define ICR_OFFSET 0x20
+#define RDR_OFFSET 0x24
+#define TDR_OFFSET 0x28
+
+#define USART_ISR_TXE BIT(7)
+
+static inline void PUTC_LL(int c)
+{
+ void __iomem *base = IOMEM(DEBUG_LL_UART_ADDR);
+
+ writel(c, base + TDR_OFFSET);
+
+ while ((readl(base + ISR_OFFSET) & USART_ISR_TXE) == 0);
+}
+
+#endif /* __MACH_STM32MP1_DEBUG_LL_H */