diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2018-12-11 11:02:30 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-12-20 08:50:49 +0100 |
commit | e61b7432212ab5fcf61b7e1d33fcf6727ba84fdd (patch) | |
tree | 76acc4671c018f65496c6428f41ef54148204a73 /arch/arm/mach-omap/am3xxx.c | |
parent | 3d613cd7d1c468e8a9c3281ba3704eb2fec79360 (diff) | |
download | barebox-e61b7432212ab5fcf61b7e1d33fcf6727ba84fdd.tar.gz barebox-e61b7432212ab5fcf61b7e1d33fcf6727ba84fdd.tar.xz |
ARM: omap: enable am33xx_uart_soft_reset for AM35xx
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>
Diffstat (limited to 'arch/arm/mach-omap/am3xxx.c')
-rw-r--r-- | arch/arm/mach-omap/am3xxx.c | 32 |
1 files changed, 32 insertions, 0 deletions
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 |