2019-06-04 11:11:33 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
2011-03-30 11:27:47 +04:00
|
|
|
/*
|
|
|
|
*
|
2016-05-05 10:57:56 +03:00
|
|
|
* Copyright (C) 2010 John Crispin <john@phrozen.org>
|
2011-03-30 11:27:47 +04:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/cpu.h>
|
|
|
|
#include <lantiq_soc.h>
|
2018-07-13 18:51:56 +03:00
|
|
|
#include <asm/setup.h>
|
2011-03-30 11:27:47 +04:00
|
|
|
|
|
|
|
#define ASC_BUF 1024
|
2012-05-02 14:27:38 +04:00
|
|
|
#define LTQ_ASC_FSTAT ((u32 *)(LTQ_EARLY_ASC + 0x0048))
|
|
|
|
#ifdef __BIG_ENDIAN
|
|
|
|
#define LTQ_ASC_TBUF ((u32 *)(LTQ_EARLY_ASC + 0x0020 + 3))
|
|
|
|
#else
|
|
|
|
#define LTQ_ASC_TBUF ((u32 *)(LTQ_EARLY_ASC + 0x0020))
|
|
|
|
#endif
|
2011-03-30 11:27:47 +04:00
|
|
|
#define TXMASK 0x3F00
|
|
|
|
#define TXOFFSET 8
|
|
|
|
|
|
|
|
void prom_putchar(char c)
|
|
|
|
{
|
|
|
|
unsigned long flags;
|
|
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
|
do { } while ((ltq_r32(LTQ_ASC_FSTAT) & TXMASK) >> TXOFFSET);
|
|
|
|
if (c == '\n')
|
2012-05-02 14:27:38 +04:00
|
|
|
ltq_w8('\r', LTQ_ASC_TBUF);
|
|
|
|
ltq_w8(c, LTQ_ASC_TBUF);
|
2011-03-30 11:27:47 +04:00
|
|
|
local_irq_restore(flags);
|
|
|
|
}
|