Path: blob/master/arch/arm/mach-mxs/include/mach/uncompress.h
10820 views
/*1* arch/arm/mach-mxs/include/mach/uncompress.h2*3* Copyright (C) 1999 ARM Limited4* Copyright (C) Shane Nay ([email protected])5* Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved.6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License as published by9* the Free Software Foundation; either version 2 of the License, or10* (at your option) any later version.11*12* This program is distributed in the hope that it will be useful,13* but WITHOUT ANY WARRANTY; without even the implied warranty of14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15* GNU General Public License for more details.16*/17#ifndef __MACH_MXS_UNCOMPRESS_H__18#define __MACH_MXS_UNCOMPRESS_H__1920#include <asm/mach-types.h>2122unsigned long mxs_duart_base;2324#define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x)))2526#define MXS_DUART_DR 0x0027#define MXS_DUART_FR 0x1828#define MXS_DUART_FR_TXFE (1 << 7)29#define MXS_DUART_CR 0x3030#define MXS_DUART_CR_UARTEN (1 << 0)3132/*33* The following code assumes the serial port has already been34* initialized by the bootloader. If it's not, the output is35* simply discarded.36*/3738static void putc(int ch)39{40if (!mxs_duart_base)41return;42if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN))43return;4445while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE))46barrier();4748MXS_DUART(MXS_DUART_DR) = ch;49}5051static inline void flush(void)52{53}5455#define MX23_DUART_BASE_ADDR 0x8007000056#define MX28_DUART_BASE_ADDR 0x800740005758static inline void __arch_decomp_setup(unsigned long arch_id)59{60switch (arch_id) {61case MACH_TYPE_MX23EVK:62mxs_duart_base = MX23_DUART_BASE_ADDR;63break;64case MACH_TYPE_MX28EVK:65case MACH_TYPE_TX28:66mxs_duart_base = MX28_DUART_BASE_ADDR;67break;68default:69break;70}71}7273#define arch_decomp_setup() __arch_decomp_setup(arch_id)74#define arch_decomp_wdog()7576#endif /* __MACH_MXS_UNCOMPRESS_H__ */777879