tizen 2.4 release
[profile/mobile/platform/kernel/u-boot-tm1.git] / nand_fdl / fdl-2 / src / migrate.c
1 #include "asm/arch/sci_types.h"
2 #include <common.h>
3 #include <stdarg.h>
4 #include <malloc.h>
5 #include <asm/arch/bits.h>
6 #include <asm/arch-sc8830/chip_drv_config_extern.h>
7
8 char * version_string="fdl2";
9
10 int printf(const char *fmt, ...)
11 {
12 #if 1
13         va_list args;
14         unsigned int i;
15         char printbuffer[CONFIG_SYS_PBSIZE];
16
17         va_start(args, fmt);
18         i = vsprintf(printbuffer, fmt, args);
19         serial_puts(printbuffer);
20         return i;
21 #endif
22         return 0;
23 }
24 void hang(void)
25 {
26         printf("###ERROR####Please RESET the board###\n");
27 }
28
29 #if defined (CONFIG_SYS_SC8800X_UART0)
30 #define UART_PHYS ARM_UART0_BASE
31 #elif defined (CONFIG_SYS_SC8800X_UART1)
32 #define UART_PHYS ARM_UART1_BASE
33 #elif defined (CONFIG_SYS_SC8800X_UART2)
34 #define UART_PHYS ARM_UART2_BASE
35 #elif defined (CONFIG_SYS_SC8800X_UART3)
36 #define UART_PHYS ARM_UART3_BASE
37 #else
38 #error "define CONFIG_SYS_SC88000X_UARTx in configs file to use UART driver"
39 #endif
40
41 #define __REG(x)     (*((volatile u32 *)(x)))
42
43 int board_init(void)
44 {
45         return 0;
46 }
47
48 int vprintf(const char *fmt, va_list args)
49 {
50         uint i;
51         char printbuffer[CONFIG_SYS_PBSIZE];
52
53         /* For this to work, printbuffer must be larger than
54          *       * anything we ever want to print.
55          *               */
56         i = vsprintf(printbuffer, fmt, args);
57
58         /* Print the string */
59         serial_puts(printbuffer);
60         return i;
61 }
62
63 void putc(const char c)
64 {
65         serial_putc(c);
66 }
67
68 void puts(const char *str)
69 {
70 //      serial_puts(str);
71 }
72
73 int ctrlc(void)
74 {
75         return 0;
76 }
77
78 int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
79 {
80         return 0;
81 }
82
83 void hw_watchdog_reset(void)
84 {
85 }
86
87 #if !((defined CONFIG_EMMC_BOOT)||(defined CONFIG_SC8830) || defined(CONFIG_SC9630))
88 uint32 SCI_GetTickCount(void)
89 {
90         volatile uint32 tmp_tick1;
91         volatile uint32 tmp_tick2;
92
93         tmp_tick1 = SYSTEM_CURRENT_CLOCK;
94         tmp_tick2 = SYSTEM_CURRENT_CLOCK;
95
96         while (tmp_tick1 != tmp_tick2)
97   {
98           tmp_tick1 = tmp_tick2;
99           tmp_tick2 = SYSTEM_CURRENT_CLOCK;
100           }
101
102         return tmp_tick1;
103 }
104 #endif