From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Subject: [PATCH v2 4/9] MIPS: ath79: add debug_ll_ar9331_init macro
Date: Tue, 3 Nov 2015 08:23:51 +0300 [thread overview]
Message-ID: <1446528236-30236-5-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1446528236-30236-1-git-send-email-antonynpavlov@gmail.com>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
arch/mips/mach-ath79/include/mach/debug_ll.h | 29 ++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/arch/mips/mach-ath79/include/mach/debug_ll.h b/arch/mips/mach-ath79/include/mach/debug_ll.h
index d3813af..e0c3f79 100644
--- a/arch/mips/mach-ath79/include/mach/debug_ll.h
+++ b/arch/mips/mach-ath79/include/mach/debug_ll.h
@@ -63,6 +63,35 @@ static inline void PUTC_LL(int ch)
* Macros for use in assembly language code
*/
+#define AR933X_UART_CS_REG 0x04
+#define UART_CS_REG ((KSEG1 | AR933X_UART_BASE) | AR933X_UART_CS_REG)
+#define AR933X_UART_CS_IF_MODE_S 2
+#define AR933X_UART_CS_IF_MODE_DCE 2
+#define AR933X_UART_CS_TX_READY_ORIDE BIT(7)
+#define AR933X_UART_CS_RX_READY_ORIDE BIT(8)
+
+/*
+ * simple uart clock setup
+ * from u-boot_mod/u-boot/cpu/mips/ar7240/hornet_serial.c
+ */
+#define BAUD_CLOCK 25000000
+#define CLOCK_SCALE ((BAUD_CLOCK / (16 * CONFIG_BAUDRATE)) - 1)
+#define CLOCK_STEP 0x2000
+
+#define AR933X_UART_CLOCK_REG 0x08
+#define CLOCK_REG ((KSEG1 | AR933X_UART_BASE) | AR933X_UART_CLOCK_REG)
+
+.macro debug_ll_ar9331_init
+#ifdef CONFIG_DEBUG_LL
+
+ pbl_reg_writel ((AR933X_UART_CS_IF_MODE_DCE << AR933X_UART_CS_IF_MODE_S) \
+ | AR933X_UART_CS_TX_READY_ORIDE \
+ | AR933X_UART_CS_RX_READY_ORIDE), UART_CS_REG
+ pbl_reg_writel ((CLOCK_SCALE << 16) | CLOCK_STEP), CLOCK_REG
+
+#endif /* CONFIG_DEBUG_LL */
+.endm
+
/*
* output a character in a0
*/
--
2.6.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-11-03 5:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 5:23 [PATCH v2 0/9] MIPS: ath79: add ar9331 pbl support Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 1/9] MIPS: ath79: add pbl_ar9331_pll macro Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 2/9] MIPS: ath79: add pbl_ar9331_ddr2_config macro Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 3/9] MIPS: ath79: add pbl_ar9331_uart_enable macro Antony Pavlov
2015-11-03 5:23 ` Antony Pavlov [this message]
2015-11-03 5:23 ` [PATCH v2 5/9] MIPS: ath79: add black-swift board support Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 6/9] MIPS: ath79: add black-swift_defconfig Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 7/9] MIPS: ath79: add pbl_ar9331_ddr1_config macro Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 8/9] MIPS: tplink-mr3020: add pbl low level init Antony Pavlov
2015-11-03 5:23 ` [PATCH v2 9/9] MIPS: tplink-mr3020_defconfig: enable pbl; make image shorter Antony Pavlov
2015-11-03 7:26 ` [PATCH v2 0/9] MIPS: ath79: add ar9331 pbl support 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=1446528236-30236-5-git-send-email-antonynpavlov@gmail.com \
--to=antonynpavlov@gmail.com \
--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