190792Sgshapiro/* 2261363Sgshapiro * Copyright (C) 2010 The Android Open Source Project 390792Sgshapiro * All rights reserved. 490792Sgshapiro * 590792Sgshapiro * Redistribution and use in source and binary forms, with or without 690792Sgshapiro * modification, are permitted provided that the following conditions 790792Sgshapiro * are met: 890792Sgshapiro * * Redistributions of source code must retain the above copyright 990792Sgshapiro * notice, this list of conditions and the following disclaimer. 1090792Sgshapiro * * Redistributions in binary form must reproduce the above copyright 1190792Sgshapiro * notice, this list of conditions and the following disclaimer in 1290792Sgshapiro * the documentation and/or other materials provided with the 1390792Sgshapiro * distribution. 1490792Sgshapiro * 1590792Sgshapiro * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16266692Sgshapiro * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1790792Sgshapiro * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 1890792Sgshapiro * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 1990792Sgshapiro * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2090792Sgshapiro * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 2190792Sgshapiro * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 22157001Sgshapiro * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2390792Sgshapiro * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2490792Sgshapiro * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2590792Sgshapiro * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2690792Sgshapiro * SUCH DAMAGE. 2790792Sgshapiro */ 28285303Sgshapiro 2990792Sgshapiro#ifndef _ABOOT_H_ 3090792Sgshapiro#define _ABOOT_H_ 3190792Sgshapiro 3290792Sgshapiro#include <aboot/types.h> 3390792Sgshapiro#include <stdarg.h> 3490792Sgshapiro 3590792Sgshapirovoid serial_init(void); 3690792Sgshapirovoid serial_putc(char c); 3790792Sgshapirovoid serial_puts(const char *s); 3890792Sgshapiro 3990792Sgshapirovoid board_mux_init(void); 4090792Sgshapirovoid board_ddr_init(void); 4190792Sgshapiro 4290792Sgshapiroint printf(const char *fmt, ...); 4390792Sgshapiroint snprintf(char *str, size_t len, const char *fmt, ...); 4490792Sgshapiroint vsprintf(char *str, const char *fmt, va_list ap); 4590792Sgshapiroint vsnprintf(char *str, size_t len, const char *fmt, va_list ap); 4690792Sgshapiro 4790792Sgshapiroint strlen(const char *s); 4890792Sgshapirovoid memset(void *p, unsigned char c, unsigned len); 4990792Sgshapirovoid *memcpy(void *_dst, const void *_src, unsigned count); 5090792Sgshapiro 5190792Sgshapirovoid enable_irqs(void); 5290792Sgshapirovoid disable_irqs(void); 5390792Sgshapiro 5490792Sgshapiro/* funky TI-style stuff */ 5590792Sgshapirovoid sr32(u32 addr, u32 start_bit, u32 num_bits, u32 value); 5690792Sgshapirou32 wait_on_value(u32 read_bit_mask, u32 match_value, u32 read_addr, u32 bound); 5790792Sgshapirovoid sdelay(unsigned long loops); 5890792Sgshapiro 5990792Sgshapiro/* global configuration, changable by board file */ 6090792Sgshapiroextern unsigned cfg_machine_type; 6190792Sgshapiroextern unsigned cfg_uart_base; 6290792Sgshapiro 6390792Sgshapiro/* some extern functions */ 6490792Sgshapiroextern void scale_vcores(void); 6590792Sgshapiroextern void prcm_init(void); 6690792Sgshapiroextern void gpmc_init(void); 6790792Sgshapiroextern void board_late_init(void); 6890792Sgshapiroextern void prcm_init(void); 69285303Sgshapiroextern void configure_core_dpll_no_lock(void); 70110560Sgshapiroextern void lock_core_dpll_shadow(void); 71110560Sgshapiro 72110560Sgshapiro/* rev-id stuff */ 73110560Sgshapirotypedef enum { 7490792Sgshapiro OMAP_REV_INVALID, 7590792Sgshapiro OMAP_4430_ES1_DOT_0, 7690792Sgshapiro OMAP_4430_ES2_DOT_0, 7790792Sgshapiro OMAP_4430_ES2_DOT_1, 7890792Sgshapiro OMAP_4430_ES2_DOT_2, 7990792Sgshapiro OMAP_4430_ES2_DOT_3, 80157001Sgshapiro OMAP_4460_ES1_DOT_0, 81157001Sgshapiro OMAP_4460_ES1_DOT_1, 82157001Sgshapiro}omap_rev; 83157001Sgshapiro 84157001Sgshapiroextern omap_rev get_omap_rev(void); 8590792Sgshapiro 8690792Sgshapiro#endif 8790792Sgshapiro