Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 2 | /* |
| 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 |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #include <common.h> |
Simon Glass | 691d719 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 13 | #include <init.h> |
Simon Glass | 401d1c4 | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 14 | #include <asm/global_data.h> |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 15 | #include <asm/io.h> |
Tom Rini | a5a8821 | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 16 | #include <asm/arch/mmc_host_def.h> |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 17 | #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 | |
| 24 | DECLARE_GLOBAL_DATA_PTR; |
| 25 | |
| 26 | /* |
| 27 | * Routine: board_init |
| 28 | * Description: Early hardware init. |
| 29 | */ |
| 30 | int 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 | */ |
| 45 | int misc_init_r(void) |
| 46 | { |
Adam Ford | 94d50be | 2017-08-07 13:11:19 -0500 | [diff] [blame] | 47 | #ifdef CONFIG_SYS_I2C_OMAP24XX |
Heiko Schocher | 6789e84 | 2013-10-22 11:03:18 +0200 | [diff] [blame] | 48 | i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 49 | #endif |
| 50 | |
Paul Kocialkowski | 679f82c | 2015-08-27 19:37:13 +0200 | [diff] [blame] | 51 | omap_die_id_display(); |
Srinath | 915162d | 2011-04-18 17:40:35 -0400 | [diff] [blame] | 52 | |
| 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 | */ |
| 62 | void set_muxconf_regs(void) |
| 63 | { |
| 64 | MUX_AM3517CRANE(); |
| 65 | } |
Tom Rini | a5a8821 | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 66 | |
Masahiro Yamada | 4aa2ba3 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 67 | #if defined(CONFIG_MMC) |
Masahiro Yamada | b75d8dc | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 68 | int board_mmc_init(struct bd_info *bis) |
Tom Rini | a5a8821 | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 69 | { |
Nikita Kiryanov | e3913f5 | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 70 | return omap_mmc_init(0, 0, 0, -1, -1); |
Tom Rini | a5a8821 | 2011-09-03 21:51:50 -0400 | [diff] [blame] | 71 | } |
| 72 | #endif |