blob: b1017d6c9b7636db594948a9c5c6b7ed6273dbd9 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Srinath714194e2011-04-18 17:40:35 -04002/*
3 * am3517crane.c - board file for AM3517 CraneBoard
4 *
5 * Author: Srinath.R <srinath@mistralsolutions.com>
6 *
7 * Based on logicpd/am3517evm/am3517evm.c
8 *
9 * Copyright (C) 2011 Mistral Solutions Pvt Ltd
Srinath714194e2011-04-18 17:40:35 -040010 */
11
12#include <common.h>
Simon Glass97589732020-05-10 11:40:02 -060013#include <init.h>
Simon Glass3ba929a2020-10-30 21:38:53 -060014#include <asm/global_data.h>
Srinath714194e2011-04-18 17:40:35 -040015#include <asm/io.h>
Tom Rini54c0b7b2011-09-03 21:51:50 -040016#include <asm/arch/mmc_host_def.h>
Srinath714194e2011-04-18 17:40:35 -040017#include <asm/arch/mem.h>
18#include <asm/arch/mux.h>
19#include <asm/arch/sys_proto.h>
20#include <asm/mach-types.h>
21#include <i2c.h>
22#include "am3517crane.h"
23
24DECLARE_GLOBAL_DATA_PTR;
25
26/*
27 * Routine: board_init
28 * Description: Early hardware init.
29 */
30int board_init(void)
31{
32 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
33 /* board id for Linux */
34 gd->bd->bi_arch_number = MACH_TYPE_CRANEBOARD;
35 /* boot param addr */
36 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
37
38 return 0;
39}
40
41/*
42 * Routine: misc_init_r
43 * Description: Init i2c, ethernet, etc... (done here so udelay works)
44 */
45int misc_init_r(void)
46{
Adam Ford49e96f22017-08-07 13:11:19 -050047#ifdef CONFIG_SYS_I2C_OMAP24XX
Heiko Schocherf53f2b82013-10-22 11:03:18 +020048 i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
Srinath714194e2011-04-18 17:40:35 -040049#endif
50
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +020051 omap_die_id_display();
Srinath714194e2011-04-18 17:40:35 -040052
53 return 0;
54}
55
56/*
57 * Routine: set_muxconf_regs
58 * Description: Setting up the configuration Mux registers specific to the
59 * hardware. Many pins need to be moved from protect to primary
60 * mode.
61 */
62void set_muxconf_regs(void)
63{
64 MUX_AM3517CRANE();
65}
Tom Rini54c0b7b2011-09-03 21:51:50 -040066
Masahiro Yamada0a780172017-05-09 20:31:39 +090067#if defined(CONFIG_MMC)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090068int board_mmc_init(struct bd_info *bis)
Tom Rini54c0b7b2011-09-03 21:51:50 -040069{
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +000070 return omap_mmc_init(0, 0, 0, -1, -1);
Tom Rini54c0b7b2011-09-03 21:51:50 -040071}
72#endif