mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-10 14:43:54 +08:00
d2912cb15b
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
72 lines
1.5 KiB
C
72 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* arch/arm/mach-pxa/include/mach/uncompress.h
|
|
*
|
|
* Author: Nicolas Pitre
|
|
* Copyright: (C) 2001 MontaVista Software Inc.
|
|
*/
|
|
|
|
#include <linux/serial_reg.h>
|
|
#include <asm/mach-types.h>
|
|
|
|
#define FFUART_BASE (0x40100000)
|
|
#define BTUART_BASE (0x40200000)
|
|
#define STUART_BASE (0x40700000)
|
|
|
|
unsigned long uart_base;
|
|
unsigned int uart_shift;
|
|
unsigned int uart_is_pxa;
|
|
|
|
static inline unsigned char uart_read(int offset)
|
|
{
|
|
return *(volatile unsigned char *)(uart_base + (offset << uart_shift));
|
|
}
|
|
|
|
static inline void uart_write(unsigned char val, int offset)
|
|
{
|
|
*(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val;
|
|
}
|
|
|
|
static inline int uart_is_enabled(void)
|
|
{
|
|
/* assume enabled by default for non-PXA uarts */
|
|
return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1;
|
|
}
|
|
|
|
static inline void putc(char c)
|
|
{
|
|
if (!uart_is_enabled())
|
|
return;
|
|
|
|
while (!(uart_read(UART_LSR) & UART_LSR_THRE))
|
|
barrier();
|
|
|
|
uart_write(c, UART_TX);
|
|
}
|
|
|
|
/*
|
|
* This does not append a newline
|
|
*/
|
|
static inline void flush(void)
|
|
{
|
|
}
|
|
|
|
static inline void arch_decomp_setup(void)
|
|
{
|
|
/* initialize to default */
|
|
uart_base = FFUART_BASE;
|
|
uart_shift = 2;
|
|
uart_is_pxa = 1;
|
|
|
|
if (machine_is_littleton() || machine_is_intelmote2()
|
|
|| machine_is_csb726() || machine_is_stargate2()
|
|
|| machine_is_cm_x300() || machine_is_balloon3())
|
|
uart_base = STUART_BASE;
|
|
|
|
if (machine_is_arcom_zeus()) {
|
|
uart_base = 0x10000000; /* nCS4 */
|
|
uart_shift = 1;
|
|
uart_is_pxa = 0;
|
|
}
|
|
}
|