Srinath | 714194e | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 1 | /* |
| 2 | * am3517crane.c - board file for AM3517 CraneBoard |
| 3 | * |
| 4 | * Author: Srinath.R <srinath@mistralsolutions.com> |
| 5 | * |
| 6 | * Based on logicpd/am3517evm/am3517evm.c |
| 7 | * |
| 8 | * Copyright (C) 2011 Mistral Solutions Pvt Ltd |
| 9 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 10 | * SPDX-License-Identifier: GPL-2.0+ |
Srinath | 714194e | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 11 | */ |
| 12 | |
| 13 | #include <common.h> |
| 14 | #include <asm/io.h> |
Tom Rini | 54c0b7b | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 15 | #include <asm/arch/mmc_host_def.h> |
Srinath | 714194e | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 16 | #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 | |
| 23 | DECLARE_GLOBAL_DATA_PTR; |
| 24 | |
| 25 | /* |
| 26 | * Routine: board_init |
| 27 | * Description: Early hardware init. |
| 28 | */ |
| 29 | int 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 | */ |
| 44 | int misc_init_r(void) |
| 45 | { |
Heiko Schocher | f53f2b8 | 2013-10-22 11:03:18 +0200 | [diff] [blame] | 46 | #ifdef CONFIG_SYS_I2C_OMAP34XX |
| 47 | i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); |
Srinath | 714194e | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 48 | #endif |
| 49 | |
| 50 | dieid_num_r(); |
| 51 | |
| 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 | */ |
| 61 | void set_muxconf_regs(void) |
| 62 | { |
| 63 | MUX_AM3517CRANE(); |
| 64 | } |
Tom Rini | 54c0b7b | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 65 | |
Tom Rini | 9e34185 | 2011-11-18 12:48:11 +0000 | [diff] [blame] | 66 | #if defined(CONFIG_GENERIC_MMC) && !defined(CONFIG_SPL_BUILD) |
Tom Rini | 54c0b7b | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 67 | int board_mmc_init(bd_t *bis) |
| 68 | { |
Nikita Kiryanov | 4be9dbc | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 69 | return omap_mmc_init(0, 0, 0, -1, -1); |
Tom Rini | 54c0b7b | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 70 | } |
| 71 | #endif |