blob: 6ce150c4ad2abd50a8044db6549434184a006780 [file] [log] [blame]
Brian Swetland2500aa12009-01-01 04:33:55 -08001/*
2 * Copyright (c) 2008, Google Inc.
3 * All rights reserved.
4 *
Shashank Mittal4f99a882010-02-01 13:58:50 -08005 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
6 *
Brian Swetland2500aa12009-01-01 04:33:55 -08007 * 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>
Brian Swetland2500aa12009-01-01 04:33:55 -080035#include <kernel/thread.h>
36#include <platform/debug.h>
Chandan Uddaraju2943fd62010-06-21 10:56:39 -070037#include <mddi.h>
Dima Zavin36785e32009-01-28 17:26:43 -080038#include <dev/fbcon.h>
39
40static struct fbcon_config *fb_config;
Brian Swetland2500aa12009-01-01 04:33:55 -080041
42void platform_init_interrupts(void);
43void platform_init_timer();
44
Brian Swetlandf4acf732009-01-29 17:25:44 -080045void uart3_clock_init(void);
46void uart_init(void);
47
Chandan Uddarajufcc15f52009-11-17 21:02:46 -080048void acpu_clock_init(void);
49
Dima Zavin36785e32009-01-28 17:26:43 -080050void mddi_clock_init(unsigned num, unsigned rate);
51
Brian Swetland2500aa12009-01-01 04:33:55 -080052void platform_early_init(void)
53{
Chandan Uddarajucdde2bd2009-11-18 15:20:12 -080054 //uart3_clock_init();
Bikas Gurungd1aa5902010-10-01 23:45:33 -070055 //uart_init();
Brian Swetlandf4acf732009-01-29 17:25:44 -080056
Brian Swetland2500aa12009-01-01 04:33:55 -080057 platform_init_interrupts();
58 platform_init_timer();
59}
60
61void platform_init(void)
62{
63 dprintf(INFO, "platform_init()\n");
Dima Zavin36785e32009-01-28 17:26:43 -080064
Chandan Uddarajufcc15f52009-11-17 21:02:46 -080065 acpu_clock_init();
Chandan Uddaraju24120502009-12-12 19:17:04 -080066}
Chandan Uddarajufcc15f52009-11-17 21:02:46 -080067
Chandan Uddaraju24120502009-12-12 19:17:04 -080068void display_init(void)
69{
Chandan Uddaraju96f581d2009-11-24 22:38:40 -080070#if DISPLAY_TYPE_MDDI
Dima Zavin36785e32009-01-28 17:26:43 -080071 fb_config = mddi_init();
72 ASSERT(fb_config);
73 fbcon_setup(fb_config);
Chandan Uddaraju96f581d2009-11-24 22:38:40 -080074#endif
Shashank Mittal4f99a882010-02-01 13:58:50 -080075#if DISPLAY_TYPE_LCDC
76 fb_config = lcdc_init();
77 ASSERT(fb_config);
78 fbcon_setup(fb_config);
79#endif
Brian Swetland2500aa12009-01-01 04:33:55 -080080}