blob: 3881ebdcf52d2385c201961acfae43a079f17ded [file] [log] [blame]
Deepa Dinamani7d6c8972011-12-14 15:16:56 -08001/*
2 * Copyright (c) 2009, Google Inc.
3 * All rights reserved.
4 * Copyright (c) 2009-2012, 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 <platform/iomap.h>
35#include <reg.h>
36#include <target.h>
37#include <platform.h>
38
39static unsigned int target_id;
40extern void dmb(void);
41
42static void target_detect(void);
43
44#define COPPER_TARGET_ID 3999
45
Deepa Dinamanica5ad852012-05-07 18:19:47 -070046static uint32_t mmc_sdc_base[] =
47 { MSM_SDC1_BASE, MSM_SDC2_BASE, MSM_SDC3_BASE, MSM_SDC4_BASE };
48
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080049void target_early_init(void)
50{
51
52}
53
54void target_init(void)
55{
Deepa Dinamanica5ad852012-05-07 18:19:47 -070056 uint32_t base_addr;
57 uint8_t slot;
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080058
59 dprintf(INFO, "target_init()\n");
60
61 target_id = COPPER_TARGET_ID;
62
Deepa Dinamanica5ad852012-05-07 18:19:47 -070063 /* Trying Slot 1*/
64 slot = 1;
65 base_addr = mmc_sdc_base[slot - 1];
66 if (mmc_boot_main(slot, base_addr))
67 {
68 dprintf(CRITICAL, "mmc init failed!");
69 ASSERT(0);
70 }
71
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080072}
73
74unsigned board_machtype(void)
75{
76 return target_id;
77}
78
79/* Do any target specific intialization needed before entering fastboot mode */
80void target_fastboot_init(void)
81{
82
83}