diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-04 14:48:50 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-13 10:35:13 +0100 |
commit | 91cad66628c1af4693c1a5553a72f825bd4d63d6 (patch) | |
tree | 868738368c3e9d77f196e2146814f00910bd3c26 /arch/arm/mach-layerscape/include/mach/debug_ll.h | |
parent | e3d7b77adf0345d2f600151b9e1d114e5c2c919f (diff) | |
download | barebox-91cad66628c1af4693c1a5553a72f825bd4d63d6.tar.gz barebox-91cad66628c1af4693c1a5553a72f825bd4d63d6.tar.xz |
ARM: Add basic Layerscape support
This adds basic Layerscape support:
- Makefile/Kconfig
- Register maps
- errata workarounds
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-layerscape/include/mach/debug_ll.h')
-rw-r--r-- | arch/arm/mach-layerscape/include/mach/debug_ll.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/arm/mach-layerscape/include/mach/debug_ll.h b/arch/arm/mach-layerscape/include/mach/debug_ll.h new file mode 100644 index 0000000000..2658a4a7c9 --- /dev/null +++ b/arch/arm/mach-layerscape/include/mach/debug_ll.h @@ -0,0 +1,34 @@ +#ifndef __INCLUDE_ARCH_DEBUG_LL_H__ +#define __INCLUDE_ARCH_DEBUG_LL_H__ + +#include <io.h> +#include <soc/fsl/immap_lsch2.h> + +#define __LS_UART_BASE(num) LSCH2_NS16550_COM##num +#define LS_UART_BASE(num) __LS_UART_BASE(num) + +static inline uint8_t debug_ll_read_reg(int reg) +{ + void __iomem *base = IOMEM(LS_UART_BASE(CONFIG_DEBUG_LAYERSCAPE_UART_PORT)); + + return readb(base + reg); +} + +static inline void debug_ll_write_reg(int reg, uint8_t val) +{ + void __iomem *base = IOMEM(LS_UART_BASE(CONFIG_DEBUG_LAYERSCAPE_UART_PORT)); + + writeb(val, base + reg); +} + +#include <debug_ll/ns16550.h> + +static inline void debug_ll_init(void) +{ + uint16_t divisor; + + divisor = debug_ll_ns16550_calc_divisor(300000000); + debug_ll_ns16550_init(divisor); +} + +#endif /* __INCLUDE_ARCH_DEBUG_LL_H__ */ |