blob: 3362b60de530d90f7e32593e6cfdd31d1a04c90c [file] [log] [blame]
Shashank Mittal23b8f422010-04-16 19:27:21 -07001/*
2 * Copyright (c) 2009, Google Inc.
3 * All rights reserved.
4 * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 * * Neither the name of Google, Inc. nor the names of its contributors
16 * may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <debug.h>
34#include <dev/keys.h>
35#include <dev/gpio_keypad.h>
36#include <lib/ptable.h>
37#include <dev/flash.h>
38#include <smem.h>
39
40#define LINUX_MACHTYPE_SURF 0xf656a
41
42
43void keypad_init(void);
44
45static int emmc_boot = -1; /* set to uninitialized */
46int target_is_emmc_boot(void);
47
48void target_init(void)
49{
50
51 dprintf(INFO, "target_init()\n");
52
Chandan Uddarajubedca152010-06-02 23:05:15 -070053#if (!ENABLE_NANDWRITE)
54 keys_init();
55 keypad_init();
56#endif
Shashank Mittal23b8f422010-04-16 19:27:21 -070057 if(mmc_boot_main())
58 {
59 dprintf(CRITICAL, "mmc init failed!");
60 ASSERT(0);
61 }
62}
63
64unsigned board_machtype(void)
65{
66 return LINUX_MACHTYPE_SURF;
67}
68
69void reboot_device(unsigned reboot_reason)
70{
71 return;
72}
73
74unsigned check_reboot_mode(void)
75{
76 return 0;
77}
78
79void target_battery_charging_enable(unsigned enable, unsigned disconnect)
80{
81}