mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Antony Pavlov <antonynpavlov@gmail.com>
To: barebox@lists.infradead.org
Cc: Oleksij Rempel <linux@rempel-privat.de>
Subject: [PATCH v2 3/9] MIPS: ath79: add pbl_ar9331_uart_enable macro
Date: Tue,  3 Nov 2015 08:23:50 +0300	[thread overview]
Message-ID: <1446528236-30236-4-git-send-email-antonynpavlov@gmail.com> (raw)
In-Reply-To: <1446528236-30236-1-git-send-email-antonynpavlov@gmail.com>

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
---
 arch/mips/include/asm/pbl_macros.h              | 11 +++++++++++
 arch/mips/mach-ath79/include/mach/ar71xx_regs.h |  3 +++
 arch/mips/mach-ath79/include/mach/pbl_macros.h  |  7 +++++++
 3 files changed, 21 insertions(+)

diff --git a/arch/mips/include/asm/pbl_macros.h b/arch/mips/include/asm/pbl_macros.h
index db46d0d..681b40a 100644
--- a/arch/mips/include/asm/pbl_macros.h
+++ b/arch/mips/include/asm/pbl_macros.h
@@ -37,6 +37,17 @@
 	.set	pop
 	.endm
 
+	.macro	pbl_reg_set val addr
+	.set push
+	.set noreorder
+	li	t9, \addr
+	li	t8, \val
+	lw	t7, 0(t9)
+	or	t7, t8
+	sw	t7, 0(t9)
+	.set	pop
+	.endm
+
 	.macro	pbl_reg_clr clr addr
 	.set push
 	.set noreorder
diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
index 0b84c55..4cbe94a 100644
--- a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
+++ b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h
@@ -67,6 +67,9 @@
 #define AR71XX_GPIO_REG_INT_PENDING	0x20
 #define AR71XX_GPIO_REG_INT_ENABLE	0x24
 #define AR71XX_GPIO_REG_FUNC		0x28
+/* Warning! GPIO_FUNC[15] must be written with 1 */
+#define AR933X_GPIO_FUNC_RSRV15			BIT(15)
+#define AR933X_GPIO_FUNC_UART_EN		BIT(1)
 
 /*
  * PLL block
diff --git a/arch/mips/mach-ath79/include/mach/pbl_macros.h b/arch/mips/mach-ath79/include/mach/pbl_macros.h
index f0e0174..4ef90dc 100644
--- a/arch/mips/mach-ath79/include/mach/pbl_macros.h
+++ b/arch/mips/mach-ath79/include/mach/pbl_macros.h
@@ -129,4 +129,11 @@
 	.set	pop
 .endm
 
+#define GPIO_FUNC	((KSEG1 | AR71XX_GPIO_BASE) | AR71XX_GPIO_REG_FUNC)
+
+.macro	pbl_ar9331_uart_enable
+	pbl_reg_set AR933X_GPIO_FUNC_UART_EN \
+			| AR933X_GPIO_FUNC_RSRV15, GPIO_FUNC
+.endm
+
 #endif /* __ASM_MACH_ATH79_PBL_MACROS_H */
-- 
2.6.2


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

  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 ` Antony Pavlov [this message]
2015-11-03  5:23 ` [PATCH v2 4/9] MIPS: ath79: add debug_ll_ar9331_init macro Antony Pavlov
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-4-git-send-email-antonynpavlov@gmail.com \
    --to=antonynpavlov@gmail.com \
    --cc=barebox@lists.infradead.org \
    --cc=linux@rempel-privat.de \
    /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