1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 19 #ifndef __COMMON_H_ 20 #define __COMMON_H_ 21 #include "types.h" 22 /*----------------------------------------------------------------- 23 * set cpu mode interface 24 ------------------------------------------------------------------*/ 25 void set_mod_normal(); 26 void set_mod_slow(); 27 28 /*----------------------------------------------------------------- 29 * serial interface 30 ------------------------------------------------------------------*/ 31 int serial_init (); 32 int serial_deinit(); 33 void serial_putc (const char c); 34 void serial_putchar (const char c); 35 void serial_puts (const char *s); 36 void serial_flush(); 37 int serial_getc (void); 38 int serial_tstc (void); 39 40 /*----------------------------------------------------------------- 41 * mmc interface 42 ------------------------------------------------------------------*/ 43 int mmc_init(); 44 void mmc_deinit(); 45 size_t mmc_read(void *ptr, size_t size); 46 47 48 /*----------------------------------------------------------------- 49 * timer interface 50 ------------------------------------------------------------------*/ 51 int timer_init(); 52 void timer_deinit(); 53 void timer_start(); 54 unsigned long timer_get_val(); 55 unsigned long timer_get_divider(); 56 57 /*----------------------------------------------------------------- 58 * I cache interface 59 ------------------------------------------------------------------*/ 60 void open_I_cache(); 61 void close_I_cache(); 62 63 /*----------------------------------------------------------------- 64 * mem operation interface 65 ------------------------------------------------------------------*/ 66 void* memset(void * s,int c,size_t count); 67 void* memcpy(void * dest,const void *src,size_t count); 68 69 #endif /*__COMMON_H_*/ 70