blob: 382581f3fa5f4f8da5cbbf791d25bc31a04ee3f2 [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>
Deepa Dinamani26e93262012-05-21 17:35:14 -070038#include <uart_dm.h>
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080039
40static unsigned int target_id;
41extern void dmb(void);
42
43static void target_detect(void);
44
45#define COPPER_TARGET_ID 3999
46
Deepa Dinamanica5ad852012-05-07 18:19:47 -070047static uint32_t mmc_sdc_base[] =
48 { MSM_SDC1_BASE, MSM_SDC2_BASE, MSM_SDC3_BASE, MSM_SDC4_BASE };
49
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080050void target_early_init(void)
51{
52
53}
54
55void target_init(void)
56{
Deepa Dinamanica5ad852012-05-07 18:19:47 -070057 uint32_t base_addr;
58 uint8_t slot;
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080059
Deepa Dinamani26e93262012-05-21 17:35:14 -070060 uart_dm_init(0, 0, BLSP1_UART0_BASE);
61
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080062 dprintf(INFO, "target_init()\n");
63
64 target_id = COPPER_TARGET_ID;
65
Deepa Dinamanica5ad852012-05-07 18:19:47 -070066 /* Trying Slot 1*/
67 slot = 1;
68 base_addr = mmc_sdc_base[slot - 1];
69 if (mmc_boot_main(slot, base_addr))
70 {
71 dprintf(CRITICAL, "mmc init failed!");
72 ASSERT(0);
73 }
74
Deepa Dinamani7d6c8972011-12-14 15:16:56 -080075}
76
77unsigned board_machtype(void)
78{
79 return target_id;
80}
81
82/* Do any target specific intialization needed before entering fastboot mode */
83void target_fastboot_init(void)
84{
85
86}