xref: /kernel/linux/linux-5.10/arch/mips/lantiq/early_printk.c (revision 8c2ecf20)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /kernel/linux/linux-5.10/arch/mips/lantiq/
18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Copyright (C) 2010 John Crispin <john@phrozen.org>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <linux/cpu.h>
88c2ecf20Sopenharmony_ci#include <lantiq_soc.h>
98c2ecf20Sopenharmony_ci#include <asm/setup.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define ASC_BUF		1024
128c2ecf20Sopenharmony_ci#define LTQ_ASC_FSTAT	((u32 *)(LTQ_EARLY_ASC + 0x0048))
138c2ecf20Sopenharmony_ci#ifdef __BIG_ENDIAN
148c2ecf20Sopenharmony_ci#define LTQ_ASC_TBUF	((u32 *)(LTQ_EARLY_ASC + 0x0020 + 3))
158c2ecf20Sopenharmony_ci#else
168c2ecf20Sopenharmony_ci#define LTQ_ASC_TBUF	((u32 *)(LTQ_EARLY_ASC + 0x0020))
178c2ecf20Sopenharmony_ci#endif
188c2ecf20Sopenharmony_ci#define TXMASK		0x3F00
198c2ecf20Sopenharmony_ci#define TXOFFSET	8
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_civoid prom_putchar(char c)
228c2ecf20Sopenharmony_ci{
238c2ecf20Sopenharmony_ci	unsigned long flags;
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci	local_irq_save(flags);
268c2ecf20Sopenharmony_ci	do { } while ((ltq_r32(LTQ_ASC_FSTAT) & TXMASK) >> TXOFFSET);
278c2ecf20Sopenharmony_ci	if (c == '\n')
288c2ecf20Sopenharmony_ci		ltq_w8('\r', LTQ_ASC_TBUF);
298c2ecf20Sopenharmony_ci	ltq_w8(c, LTQ_ASC_TBUF);
308c2ecf20Sopenharmony_ci	local_irq_restore(flags);
318c2ecf20Sopenharmony_ci}
32

Indexes created Thu Nov 07 10:32:03 CST 2024