From 61163945cfec8c88d9d77e6c53b76a91760fa07f Mon Sep 17 00:00:00 2001 From: Antony Pavlov Date: Tue, 3 Nov 2015 08:23:50 +0300 Subject: MIPS: ath79: add pbl_ar9331_uart_enable macro Signed-off-by: Oleksij Rempel Signed-off-by: Antony Pavlov Signed-off-by: Sascha Hauer --- arch/mips/mach-ath79/include/mach/ar71xx_regs.h | 3 +++ arch/mips/mach-ath79/include/mach/pbl_macros.h | 7 +++++++ 2 files changed, 10 insertions(+) (limited to 'arch/mips/mach-ath79') diff --git a/arch/mips/mach-ath79/include/mach/ar71xx_regs.h b/arch/mips/mach-ath79/include/mach/ar71xx_regs.h index 0b84c5521d..4cbe94a487 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 f0e0174a41..4ef90dc204 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 */ -- cgit v1.2.3