mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 17/23] ARM: omap: enable am33xx_uart_soft_reset for AM35xx
Date: Fri, 14 Dec 2018 15:17:24 +0100	[thread overview]
Message-ID: <20181214141730.26181-18-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20181214141730.26181-1-s.hauer@pengutronix.de>

am33xx_uart_soft_reset() can be used on AM35xx aswell, so move it
to a more generic place where it can be added to am35xx compilation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/mach-omap/Makefile                   |  3 +-
 arch/arm/mach-omap/am33xx_generic.c           | 27 ----------------
 arch/arm/mach-omap/am3xxx.c                   | 32 +++++++++++++++++++
 .../mach-omap/include/mach/am3xxx-silicon.h   |  6 ++++
 4 files changed, 40 insertions(+), 28 deletions(-)
 create mode 100644 arch/arm/mach-omap/am3xxx.c
 create mode 100644 arch/arm/mach-omap/include/mach/am3xxx-silicon.h

diff --git a/arch/arm/mach-omap/Makefile b/arch/arm/mach-omap/Makefile
index e6132342e1..901cc90373 100644
--- a/arch/arm/mach-omap/Makefile
+++ b/arch/arm/mach-omap/Makefile
@@ -21,7 +21,8 @@ obj-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
 pbl-$(CONFIG_ARCH_OMAP3) += omap3_generic.o auxcr.o
 obj-$(CONFIG_ARCH_OMAP4) += omap4_generic.o omap4_clock.o
 pbl-$(CONFIG_ARCH_OMAP4) += omap4_generic.o omap4_clock.o
-obj-pbl-$(CONFIG_ARCH_AM33XX) += am33xx_generic.o am33xx_clock.o am33xx_mux.o
+obj-pbl-$(CONFIG_ARCH_AM33XX) += am33xx_generic.o am33xx_clock.o am33xx_mux.o am3xxx.o
+obj-pbl-$(CONFIG_ARCH_AM35XX) += am3xxx.o
 obj-$(CONFIG_ARCH_AM33XX) += am33xx_scrm.o
 obj-$(CONFIG_ARCH_OMAP3) += omap3_clock.o
 pbl-$(CONFIG_ARCH_OMAP3) += omap3_clock.o
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index c446431537..fe3c4a8b17 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -262,33 +262,6 @@ int am33xx_devices_init(void)
 	return 0;
 }
 
-/* UART Defines */
-#define UART_SYSCFG_OFFSET	0x54
-#define UART_SYSSTS_OFFSET	0x58
-
-#define UART_CLK_RUNNING_MASK	0x1
-#define UART_RESET		(0x1 << 1)
-#define UART_SMART_IDLE_EN	(0x1 << 0x3)
-
-void am33xx_uart_soft_reset(void __iomem *uart_base)
-{
-	int reg;
-
-	reg = readl(uart_base + UART_SYSCFG_OFFSET);
-	reg |= UART_RESET;
-	writel(reg, (uart_base + UART_SYSCFG_OFFSET));
-
-	while ((readl(uart_base + UART_SYSSTS_OFFSET) &
-		UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK)
-		;
-
-	/* Disable smart idle */
-	reg = readl((uart_base + UART_SYSCFG_OFFSET));
-	reg |= UART_SMART_IDLE_EN;
-	writel(reg, (uart_base + UART_SYSCFG_OFFSET));
-}
-
-
 #define VTP_CTRL_READY		(0x1 << 5)
 #define VTP_CTRL_ENABLE		(0x1 << 6)
 #define VTP_CTRL_START_EN	(0x1)
diff --git a/arch/arm/mach-omap/am3xxx.c b/arch/arm/mach-omap/am3xxx.c
new file mode 100644
index 0000000000..75965a8e0e
--- /dev/null
+++ b/arch/arm/mach-omap/am3xxx.c
@@ -0,0 +1,32 @@
+#include <common.h>
+#include <io.h>
+#include <mach/am3xxx-silicon.h>
+
+/* UART Defines */
+#define UART_SYSCFG_OFFSET	0x54
+#define UART_SYSSTS_OFFSET	0x58
+
+#define UART_CLK_RUNNING_MASK	0x1
+#define UART_RESET		(0x1 << 1)
+#define UART_SMART_IDLE_EN	(0x1 << 0x3)
+
+void am3xxx_uart_soft_reset(void __iomem *uart_base)
+{
+	int reg;
+
+	reg = readl(uart_base + UART_SYSCFG_OFFSET);
+	reg |= UART_RESET;
+	writel(reg, (uart_base + UART_SYSCFG_OFFSET));
+
+	while ((readl(uart_base + UART_SYSSTS_OFFSET) &
+		UART_CLK_RUNNING_MASK) != UART_CLK_RUNNING_MASK)
+		;
+
+	/* Disable smart idle */
+	reg = readl((uart_base + UART_SYSCFG_OFFSET));
+	reg |= UART_SMART_IDLE_EN;
+	writel(reg, (uart_base + UART_SYSCFG_OFFSET));
+}
+
+void am33xx_uart_soft_reset(void __iomem *uart_base)
+	__alias(am3xxx_uart_soft_reset);
\ No newline at end of file
diff --git a/arch/arm/mach-omap/include/mach/am3xxx-silicon.h b/arch/arm/mach-omap/include/mach/am3xxx-silicon.h
new file mode 100644
index 0000000000..c5f73ad457
--- /dev/null
+++ b/arch/arm/mach-omap/include/mach/am3xxx-silicon.h
@@ -0,0 +1,6 @@
+#ifndef __ASM_ARCH_AM33XX_H
+#define __ASM_ARCH_AM33XX_H
+
+void am3xxx_uart_soft_reset(void __iomem *uart_base);
+
+#endif /* __ASM_ARCH_AM33XX_H */
\ No newline at end of file
-- 
2.19.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2018-12-14 14:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 14:17 [PATCH 00/23] AM3517 support Sascha Hauer
2018-12-14 14:17 ` [PATCH 01/23] net: davinci-emac: fix buggy channel tear down Sascha Hauer
2018-12-14 14:17 ` [PATCH 02/23] net: davinci-emac: Add timeout to polling loop Sascha Hauer
2018-12-14 14:17 ` [PATCH 03/23] net: davinci-emac: switch to device tree support Sascha Hauer
2018-12-14 14:17 ` [PATCH 04/23] mci: omap: Improve error handling Sascha Hauer
2018-12-14 14:17 ` [PATCH 05/23] mci: omap: use IS_ENABLED() rather than #ifdef Sascha Hauer
2018-12-14 14:17 ` [PATCH 06/23] mtd: nand: omap: Use dev_dbg when a struct device * is available Sascha Hauer
2018-12-14 14:17 ` [PATCH 07/23] mtd: nand: omap: Fix hamming correct return values Sascha Hauer
2018-12-14 14:17 ` [PATCH 08/23] mtd: nand: omap: Disable subpage reads in hardware ecc mode Sascha Hauer
2018-12-14 14:17 ` [PATCH 09/23] mtd: nand: omap: remove unused function argument Sascha Hauer
2018-12-14 14:17 ` [PATCH 10/23] mtd: nand: omap: fix bch8_hw_romcode ecc layout Sascha Hauer
2018-12-14 14:17 ` [PATCH 11/23] mtd: nand: omap: set eccbytes correctly Sascha Hauer
2018-12-14 14:17 ` [PATCH 12/23] mtd: nand: omap: unbreak BCH8 support Sascha Hauer
2018-12-14 14:17 ` [PATCH 13/23] ARM: omap: Add missing include Sascha Hauer
2018-12-14 14:17 ` [PATCH 14/23] ARM: omap: dmtimer: Turn into a driver Sascha Hauer
2018-12-17 13:37   ` Teresa Remmet
2018-12-18  7:46     ` Sascha Hauer
2018-12-14 14:17 ` [PATCH 15/23] ARM: omap: 32ktimer: " Sascha Hauer
2018-12-14 14:17 ` [PATCH 16/23] ARM: omap: Add AM35XX support Sascha Hauer
2018-12-14 14:17 ` Sascha Hauer [this message]
2018-12-14 14:17 ` [PATCH 18/23] ARM: omap3: Add support for reset reason detection Sascha Hauer
2018-12-14 14:17 ` [PATCH 19/23] ARM: omap: Add AM3517 specific mux configuration Sascha Hauer
2018-12-14 14:17 ` [PATCH 20/23] ARM: omap: Add emif4 support for AM3517 Sascha Hauer
2018-12-14 14:17 ` [PATCH 21/23] ARM: omap: AM3517: Change default clock rate " Sascha Hauer
2018-12-14 14:17 ` [PATCH 22/23] ARM: omap: Add board support for WAGO pfc200 platform Sascha Hauer
2019-01-07 11:40   ` Heinrich.Toews
2019-01-07 11:46     ` Sascha Hauer
2018-12-14 14:17 ` [PATCH 23/23] ARM: omap: am33xx_defconfig: Enable more boards and rename Sascha Hauer
2018-12-14 16:22 ` [PATCH 00/23] AM3517 support Ladislav Michl
2018-12-14 19:32   ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181214141730.26181-18-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox