blob: e06618bd45963cd2310a1649c733f2f3a898f592 [file] [log] [blame]
Shashank Mittal246f8d02011-01-21 17:12:27 -08001/*
2 * Copyright (c) 2008, Google Inc.
3 * All rights reserved.
4 *
5 * Copyright (c) 2009-2011, Code Aurora Forum. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * * Neither the name of Google, Inc. nor the names of its contributors
17 * may be used to endorse or promote products derived from this
18 * software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
30 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include <debug.h>
35#include <kernel/thread.h>
36#include <platform/debug.h>
37#include <mddi.h>
38#include <dev/fbcon.h>
39
40static struct fbcon_config *fb_config;
41
42void platform_init_interrupts(void);
43void platform_init_timer();
44
45void uart3_clock_init(void);
46void uart_init(void);
47
48void acpu_clock_init(void);
49
50void mddi_clock_init(unsigned num, unsigned rate);
51
52void platform_early_init(void)
53{
Shashank Mittal2fad67f2011-04-08 19:45:10 -070054#if WITH_DEBUG_UART
55 uart1_clock_init();
56 uart_init();
57#endif
Shashank Mittal246f8d02011-01-21 17:12:27 -080058 platform_init_interrupts();
59 platform_init_timer();
60}
61
62void platform_init(void)
63{
64 dprintf(INFO, "platform_init()\n");
Shashank Mittal246f8d02011-01-21 17:12:27 -080065 acpu_clock_init();
Shashank Mittal246f8d02011-01-21 17:12:27 -080066}
67
68void display_init(void)
69{
70#if DISPLAY_TYPE_MDDI
71 fb_config = mddi_init();
72 ASSERT(fb_config);
73 fbcon_setup(fb_config);
74#endif
75#if DISPLAY_TYPE_LCDC
76 fb_config = lcdc_init();
77 ASSERT(fb_config);
78 fbcon_setup(fb_config);
79#endif
80}