• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * arch/arm/mach-iop33x/include/mach/uncompress.h
4  */
5 
6 #include <asm/types.h>
7 #include <asm/mach-types.h>
8 #include <linux/serial_reg.h>
9 #include <mach/hardware.h>
10 
11 volatile u32 *uart_base;
12 
13 #define TX_DONE		(UART_LSR_TEMT | UART_LSR_THRE)
14 
putc(char c)15 static inline void putc(char c)
16 {
17 	while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
18 		barrier();
19 	uart_base[UART_TX] = c;
20 }
21 
flush(void)22 static inline void flush(void)
23 {
24 }
25 
__arch_decomp_setup(unsigned long arch_id)26 static __inline__ void __arch_decomp_setup(unsigned long arch_id)
27 {
28 	if (machine_is_iq80331() || machine_is_iq80332())
29 		uart_base = (volatile u32 *)IOP33X_UART0_PHYS;
30 	else
31 		uart_base = (volatile u32 *)0xfe800000;
32 }
33 
34 /*
35  * nothing to do
36  */
37 #define arch_decomp_setup()	__arch_decomp_setup(arch_id)
38