blob: f32d1757db7927d708458aece6cf490e8ce2f695 [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>
Srinath714194e2011-04-18 17:40:35 -040014#include <asm/io.h>
Tom Rini54c0b7b2011-09-03 21:51:50 -040015#include <asm/arch/mmc_host_def.h>
Srinath714194e2011-04-18 17:40:35 -040016#include <asm/arch/mem.h>
17#include <asm/arch/mux.h>
18#include <asm/arch/sys_proto.h>
19#include <asm/mach-types.h>
20#include <i2c.h>
21#include "am3517crane.h"
22
23DECLARE_GLOBAL_DATA_PTR;
24
25/*
26 * Routine: board_init
27 * Description: Early hardware init.
28 */
29int board_init(void)
30{
31 gpmc_init(); /* in SRAM or SDRAM, finish GPMC */
32 /* board id for Linux */
33 gd->bd->bi_arch_number = MACH_TYPE_CRANEBOARD;
34 /* boot param addr */
35 gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100);
36
37 return 0;
38}
39
40/*
41 * Routine: misc_init_r
42 * Description: Init i2c, ethernet, etc... (done here so udelay works)
43 */
44int misc_init_r(void)
45{
Adam Ford49e96f22017-08-07 13:11:19 -050046#ifdef CONFIG_SYS_I2C_OMAP24XX
Heiko Schocherf53f2b82013-10-22 11:03:18 +020047 i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE);
Srinath714194e2011-04-18 17:40:35 -040048#endif
49
Paul Kocialkowski6bc318e2015-08-27 19:37:13 +020050 omap_die_id_display();
Srinath714194e2011-04-18 17:40:35 -040051
52 return 0;
53}
54
55/*
56 * Routine: set_muxconf_regs
57 * Description: Setting up the configuration Mux registers specific to the
58 * hardware. Many pins need to be moved from protect to primary
59 * mode.
60 */
61void set_muxconf_regs(void)
62{
63 MUX_AM3517CRANE();
64}
Tom Rini54c0b7b2011-09-03 21:51:50 -040065
Masahiro Yamada0a780172017-05-09 20:31:39 +090066#if defined(CONFIG_MMC)
Masahiro Yamadaf7ed78b2020-06-26 15:13:33 +090067int board_mmc_init(struct bd_info *bis)
Tom Rini54c0b7b2011-09-03 21:51:50 -040068{
Nikita Kiryanov4be9dbc2012-12-03 02:19:47 +000069 return omap_mmc_init(0, 0, 0, -1, -1);
Tom Rini54c0b7b2011-09-03 21:51:50 -040070}
71#endif