/*1* Atheros AR71XX/AR724X/AR913X SoC early printk support2*3* Copyright (C) 2008-2010 Gabor Juhos <[email protected]>4* Copyright (C) 2008 Imre Kaloz <[email protected]>5*6* This program is free software; you can redistribute it and/or modify it7* under the terms of the GNU General Public License version 2 as published8* by the Free Software Foundation.9*/1011#include <linux/io.h>12#include <linux/serial_reg.h>13#include <asm/addrspace.h>1415#include <asm/mach-ath79/ar71xx_regs.h>1617static inline void prom_wait_thre(void __iomem *base)18{19u32 lsr;2021do {22lsr = __raw_readl(base + UART_LSR * 4);23if (lsr & UART_LSR_THRE)24break;25} while (1);26}2728void prom_putchar(unsigned char ch)29{30void __iomem *base = (void __iomem *)(KSEG1ADDR(AR71XX_UART_BASE));3132prom_wait_thre(base);33__raw_writel(ch, base + UART_TX * 4);34prom_wait_thre(base);35}363738