Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 2 | /* |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 3 | * (C) Copyright 2004-2011 |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 4 | * Texas Instruments, <www.ti.com> |
| 5 | * |
| 6 | * Author : |
| 7 | * Manikandan Pillai <mani.pillai@ti.com> |
| 8 | * |
| 9 | * Derived from Beagle Board and 3430 SDP code by |
| 10 | * Richard Woodruff <r-woodruff2@ti.com> |
| 11 | * Syed Mohammed Khasim <khasim@ti.com> |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 12 | */ |
| 13 | #include <common.h> |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 14 | #include <dm.h> |
Simon Glass | 5e6201b | 2019-08-01 09:46:51 -0600 | [diff] [blame] | 15 | #include <env.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 16 | #include <init.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 17 | #include <net.h> |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 18 | #include <ns16550.h> |
Ben Warren | fbfdd3a | 2009-07-20 22:01:11 -0700 | [diff] [blame] | 19 | #include <netdev.h> |
Simon Glass | 3673618 | 2019-11-14 12:57:24 -0700 | [diff] [blame] | 20 | #include <serial.h> |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 21 | #include <asm/io.h> |
| 22 | #include <asm/arch/mem.h> |
| 23 | #include <asm/arch/mux.h> |
| 24 | #include <asm/arch/sys_proto.h> |
Vaibhav Hiremath | 4fdf2b7 | 2011-09-03 21:42:35 -0400 | [diff] [blame] | 25 | #include <asm/arch/mmc_host_def.h> |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 26 | #include <asm/gpio.h> |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 27 | #include <i2c.h> |
Paul Kocialkowski | 6955989 | 2014-11-08 20:55:47 +0100 | [diff] [blame] | 28 | #include <twl4030.h> |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 29 | #include <asm/mach-types.h> |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 30 | #include <asm/omap_musb.h> |
Masahiro Yamada | 2b7a873 | 2017-11-30 13:45:24 +0900 | [diff] [blame] | 31 | #include <linux/mtd/rawnand.h> |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 32 | #include <linux/usb/ch9.h> |
| 33 | #include <linux/usb/gadget.h> |
| 34 | #include <linux/usb/musb.h> |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 35 | #include "evm.h" |
| 36 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 37 | #define OMAP3EVM_GPIO_ETH_RST_GEN1 64 |
| 38 | #define OMAP3EVM_GPIO_ETH_RST_GEN2 7 |
Sriramakrishnan | 0f188c3 | 2011-07-18 09:21:55 -0400 | [diff] [blame] | 39 | |
John Rigby | 0d21ed0 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 40 | DECLARE_GLOBAL_DATA_PTR; |
| 41 | |
Dirk Behme | 85ed709 | 2010-12-18 07:40:28 +0100 | [diff] [blame] | 42 | static u32 omap3_evm_version; |
Ajay Kumar Gupta | 13fc2bd | 2010-06-10 11:20:49 +0530 | [diff] [blame] | 43 | |
Dirk Behme | 85ed709 | 2010-12-18 07:40:28 +0100 | [diff] [blame] | 44 | u32 get_omap3_evm_rev(void) |
Ajay Kumar Gupta | 13fc2bd | 2010-06-10 11:20:49 +0530 | [diff] [blame] | 45 | { |
| 46 | return omap3_evm_version; |
| 47 | } |
| 48 | |
| 49 | static void omap3_evm_get_revision(void) |
| 50 | { |
Sanjeev Premi | 88105fb | 2010-11-04 16:02:32 -0400 | [diff] [blame] | 51 | #if defined(CONFIG_CMD_NET) |
| 52 | /* |
| 53 | * Board revision can be ascertained only by identifying |
| 54 | * the Ethernet chipset. |
| 55 | */ |
Ajay Kumar Gupta | 13fc2bd | 2010-06-10 11:20:49 +0530 | [diff] [blame] | 56 | unsigned int smsc_id; |
| 57 | |
| 58 | /* Ethernet PHY ID is stored at ID_REV register */ |
| 59 | smsc_id = readl(CONFIG_SMC911X_BASE + 0x50) & 0xFFFF0000; |
| 60 | printf("Read back SMSC id 0x%x\n", smsc_id); |
| 61 | |
| 62 | switch (smsc_id) { |
| 63 | /* SMSC9115 chipset */ |
| 64 | case 0x01150000: |
| 65 | omap3_evm_version = OMAP3EVM_BOARD_GEN_1; |
| 66 | break; |
| 67 | /* SMSC 9220 chipset */ |
| 68 | case 0x92200000: |
| 69 | default: |
| 70 | omap3_evm_version = OMAP3EVM_BOARD_GEN_2; |
| 71 | } |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 72 | #else /* !CONFIG_CMD_NET */ |
Sanjeev Premi | 88105fb | 2010-11-04 16:02:32 -0400 | [diff] [blame] | 73 | #if defined(CONFIG_STATIC_BOARD_REV) |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 74 | /* Look for static defintion of the board revision */ |
Sanjeev Premi | 88105fb | 2010-11-04 16:02:32 -0400 | [diff] [blame] | 75 | omap3_evm_version = CONFIG_STATIC_BOARD_REV; |
| 76 | #else |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 77 | /* Fallback to the default above */ |
Sanjeev Premi | 88105fb | 2010-11-04 16:02:32 -0400 | [diff] [blame] | 78 | omap3_evm_version = OMAP3EVM_BOARD_GEN_2; |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 79 | #endif /* CONFIG_STATIC_BOARD_REV */ |
| 80 | #endif /* CONFIG_CMD_NET */ |
Ajay Kumar Gupta | 13fc2bd | 2010-06-10 11:20:49 +0530 | [diff] [blame] | 81 | } |
| 82 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 83 | #if defined(CONFIG_USB_MUSB_GADGET) || defined(CONFIG_USB_MUSB_HOST) |
| 84 | /* MUSB port on OMAP3EVM Rev >= E requires extvbus programming. */ |
Ajay Kumar Gupta | aeeac6b | 2010-06-10 11:20:50 +0530 | [diff] [blame] | 85 | u8 omap3_evm_need_extvbus(void) |
| 86 | { |
| 87 | u8 retval = 0; |
| 88 | |
| 89 | if (get_omap3_evm_rev() >= OMAP3EVM_BOARD_GEN_2) |
| 90 | retval = 1; |
| 91 | |
| 92 | return retval; |
| 93 | } |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 94 | #endif /* CONFIG_USB_MUSB_{GADGET,HOST} */ |
Ajay Kumar Gupta | aeeac6b | 2010-06-10 11:20:50 +0530 | [diff] [blame] | 95 | |
| 96 | /* |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 97 | * Routine: board_init |
| 98 | * Description: Early hardware init. |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 99 | */ |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 100 | int board_init(void) |
| 101 | { |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 102 | gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ |
| 103 | /* board id for Linux */ |
| 104 | gd->bd->bi_arch_number = MACH_TYPE_OMAP3EVM; |
| 105 | /* boot param addr */ |
| 106 | gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); |
| 107 | |
| 108 | return 0; |
| 109 | } |
| 110 | |
Derald D. Woods | 17f8f98 | 2017-09-02 17:43:05 -0500 | [diff] [blame] | 111 | #if defined(CONFIG_SPL_OS_BOOT) |
| 112 | int spl_start_uboot(void) |
| 113 | { |
| 114 | /* break into full u-boot on 'c' */ |
| 115 | if (serial_tstc() && serial_getc() == 'c') |
| 116 | return 1; |
| 117 | |
| 118 | return 0; |
| 119 | } |
| 120 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 121 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 122 | #if defined(CONFIG_SPL_BUILD) |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 123 | /* |
| 124 | * Routine: get_board_mem_timings |
| 125 | * Description: If we use SPL then there is no x-loader nor config header |
| 126 | * so we have to setup the DDR timings ourself on the first bank. This |
| 127 | * provides the timing values back to the function that configures |
| 128 | * the memory. |
| 129 | */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 130 | void get_board_mem_timings(struct board_sdrc_timings *timings) |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 131 | { |
| 132 | int pop_mfr, pop_id; |
| 133 | |
| 134 | /* |
| 135 | * We need to identify what PoP memory is on the board so that |
| 136 | * we know what timings to use. To map the ID values please see |
| 137 | * nand_ids.c |
| 138 | */ |
| 139 | identify_nand_chip(&pop_mfr, &pop_id); |
| 140 | |
| 141 | if (pop_mfr == NAND_MFR_HYNIX && pop_id == 0xbc) { |
| 142 | /* 256MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 143 | timings->mcfg = HYNIX_V_MCFG_200(256 << 20); |
| 144 | timings->ctrla = HYNIX_V_ACTIMA_200; |
| 145 | timings->ctrlb = HYNIX_V_ACTIMB_200; |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 146 | } else { |
| 147 | /* 128MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 148 | timings->mcfg = MICRON_V_MCFG_165(128 << 20); |
| 149 | timings->ctrla = MICRON_V_ACTIMA_165; |
| 150 | timings->ctrlb = MICRON_V_ACTIMB_165; |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 151 | } |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 152 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; |
| 153 | timings->mr = MICRON_V_MR_165; |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 154 | } |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 155 | #endif /* CONFIG_SPL_BUILD */ |
| 156 | |
| 157 | #if defined(CONFIG_USB_MUSB_OMAP2PLUS) |
| 158 | static struct musb_hdrc_config musb_config = { |
| 159 | .multipoint = 1, |
| 160 | .dyn_fifo = 1, |
| 161 | .num_eps = 16, |
| 162 | .ram_bits = 12, |
| 163 | }; |
| 164 | |
| 165 | static struct omap_musb_board_data musb_board_data = { |
| 166 | .interface_type = MUSB_INTERFACE_ULPI, |
| 167 | }; |
| 168 | |
| 169 | static struct musb_hdrc_platform_data musb_plat = { |
| 170 | #if defined(CONFIG_USB_MUSB_HOST) |
| 171 | .mode = MUSB_HOST, |
| 172 | #elif defined(CONFIG_USB_MUSB_GADGET) |
| 173 | .mode = MUSB_PERIPHERAL, |
| 174 | #else |
| 175 | #error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET" |
| 176 | #endif /* CONFIG_USB_MUSB_{GADGET,HOST} */ |
| 177 | .config = &musb_config, |
| 178 | .power = 100, |
| 179 | .platform_ops = &omap2430_ops, |
| 180 | .board_data = &musb_board_data, |
| 181 | }; |
| 182 | #endif /* CONFIG_USB_MUSB_OMAP2PLUS */ |
Tom Rini | 988a235 | 2011-11-18 12:48:09 +0000 | [diff] [blame] | 183 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 184 | /* |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 185 | * Routine: misc_init_r |
| 186 | * Description: Init ethernet (done here so udelay works) |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 187 | */ |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 188 | int misc_init_r(void) |
| 189 | { |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 190 | twl4030_power_init(); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 191 | |
Adam Ford | 49e96f2 | 2017-08-07 13:11:19 -0500 | [diff] [blame] | 192 | #ifdef CONFIG_SYS_I2C_OMAP24XX |
Heiko Schocher | f53f2b8 | 2013-10-22 11:03:18 +0200 | [diff] [blame] | 193 | i2c_init(CONFIG_SYS_OMAP24_I2C_SPEED, CONFIG_SYS_OMAP24_I2C_SLAVE); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 194 | #endif |
| 195 | |
| 196 | #if defined(CONFIG_CMD_NET) |
| 197 | setup_net_chip(); |
| 198 | #endif |
Sanjeev Premi | 88105fb | 2010-11-04 16:02:32 -0400 | [diff] [blame] | 199 | omap3_evm_get_revision(); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 200 | |
Sanjeev Premi | 5e09e44 | 2011-07-18 09:20:15 -0400 | [diff] [blame] | 201 | #if defined(CONFIG_CMD_NET) |
| 202 | reset_net_chip(); |
| 203 | #endif |
Paul Kocialkowski | 6bc318e | 2015-08-27 19:37:13 +0200 | [diff] [blame] | 204 | omap_die_id_display(); |
Dirk Behme | 12dbcf6 | 2009-03-12 19:30:50 +0100 | [diff] [blame] | 205 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 206 | #if defined(CONFIG_USB_MUSB_OMAP2PLUS) |
| 207 | musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE); |
| 208 | #endif |
| 209 | |
| 210 | #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) |
| 211 | omap_die_id_usbethaddr(); |
| 212 | #endif |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 213 | return 0; |
| 214 | } |
| 215 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 216 | /* |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 217 | * Routine: set_muxconf_regs |
| 218 | * Description: Setting up the configuration Mux registers specific to the |
| 219 | * hardware. Many pins need to be moved from protect to primary |
| 220 | * mode. |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 221 | */ |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 222 | void set_muxconf_regs(void) |
| 223 | { |
| 224 | MUX_EVM(); |
| 225 | } |
| 226 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 227 | #if defined(CONFIG_CMD_NET) |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 228 | /* |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 229 | * Routine: setup_net_chip |
| 230 | * Description: Setting up the configuration GPMC registers specific to the |
| 231 | * Ethernet hardware. |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 232 | */ |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 233 | static void setup_net_chip(void) |
| 234 | { |
Dirk Behme | dc7af20 | 2009-08-08 09:30:21 +0200 | [diff] [blame] | 235 | struct ctrl *ctrl_base = (struct ctrl *)OMAP34XX_CTRL_BASE; |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 236 | |
| 237 | /* Configure GPMC registers */ |
Dirk Behme | a4becd6 | 2009-08-08 09:30:22 +0200 | [diff] [blame] | 238 | writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[5].config1); |
| 239 | writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[5].config2); |
| 240 | writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[5].config3); |
| 241 | writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[5].config4); |
| 242 | writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[5].config5); |
| 243 | writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[5].config6); |
| 244 | writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[5].config7); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 245 | |
| 246 | /* Enable off mode for NWE in PADCONF_GPMC_NWE register */ |
| 247 | writew(readw(&ctrl_base ->gpmc_nwe) | 0x0E00, &ctrl_base->gpmc_nwe); |
| 248 | /* Enable off mode for NOE in PADCONF_GPMC_NADV_ALE register */ |
| 249 | writew(readw(&ctrl_base->gpmc_noe) | 0x0E00, &ctrl_base->gpmc_noe); |
| 250 | /* Enable off mode for ALE in PADCONF_GPMC_NADV_ALE register */ |
| 251 | writew(readw(&ctrl_base->gpmc_nadv_ale) | 0x0E00, |
| 252 | &ctrl_base->gpmc_nadv_ale); |
Sanjeev Premi | 5e09e44 | 2011-07-18 09:20:15 -0400 | [diff] [blame] | 253 | } |
| 254 | |
| 255 | /** |
| 256 | * Reset the ethernet chip. |
| 257 | */ |
| 258 | static void reset_net_chip(void) |
| 259 | { |
Sriramakrishnan | 0f188c3 | 2011-07-18 09:21:55 -0400 | [diff] [blame] | 260 | int ret; |
| 261 | int rst_gpio; |
| 262 | |
| 263 | if (get_omap3_evm_rev() == OMAP3EVM_BOARD_GEN_1) { |
| 264 | rst_gpio = OMAP3EVM_GPIO_ETH_RST_GEN1; |
| 265 | } else { |
| 266 | rst_gpio = OMAP3EVM_GPIO_ETH_RST_GEN2; |
| 267 | } |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 268 | |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 269 | ret = gpio_request(rst_gpio, ""); |
Sriramakrishnan | 0f188c3 | 2011-07-18 09:21:55 -0400 | [diff] [blame] | 270 | if (ret < 0) { |
| 271 | printf("Unable to get GPIO %d\n", rst_gpio); |
| 272 | return ; |
| 273 | } |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 274 | |
Sriramakrishnan | 0f188c3 | 2011-07-18 09:21:55 -0400 | [diff] [blame] | 275 | /* Configure as output */ |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 276 | gpio_direction_output(rst_gpio, 0); |
Sriramakrishnan | 0f188c3 | 2011-07-18 09:21:55 -0400 | [diff] [blame] | 277 | |
| 278 | /* Send a pulse on the GPIO pin */ |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 279 | gpio_set_value(rst_gpio, 1); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 280 | udelay(1); |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 281 | gpio_set_value(rst_gpio, 0); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 282 | udelay(1); |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 283 | gpio_set_value(rst_gpio, 1); |
Dirk Behme | bb732be | 2009-01-28 21:39:58 +0100 | [diff] [blame] | 284 | } |
Ben Warren | fbfdd3a | 2009-07-20 22:01:11 -0700 | [diff] [blame] | 285 | |
| 286 | int board_eth_init(bd_t *bis) |
| 287 | { |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 288 | #if defined(CONFIG_SMC911X) |
Derald D. Woods | ad147bf | 2017-12-16 14:14:50 -0600 | [diff] [blame] | 289 | env_set("ethaddr", NULL); |
| 290 | return smc911x_initialize(0, CONFIG_SMC911X_BASE); |
| 291 | #else |
| 292 | return 0; |
| 293 | #endif |
Ben Warren | fbfdd3a | 2009-07-20 22:01:11 -0700 | [diff] [blame] | 294 | } |
Sanjeev Premi | 654e3ce | 2011-07-18 09:23:00 -0400 | [diff] [blame] | 295 | #endif /* CONFIG_CMD_NET */ |
Vaibhav Hiremath | 4fdf2b7 | 2011-09-03 21:42:35 -0400 | [diff] [blame] | 296 | |
Masahiro Yamada | 0a78017 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 297 | #if defined(CONFIG_MMC) |
Vaibhav Hiremath | 4fdf2b7 | 2011-09-03 21:42:35 -0400 | [diff] [blame] | 298 | int board_mmc_init(bd_t *bis) |
| 299 | { |
Nikita Kiryanov | 4be9dbc | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 300 | return omap_mmc_init(0, 0, 0, -1, -1); |
Vaibhav Hiremath | 4fdf2b7 | 2011-09-03 21:42:35 -0400 | [diff] [blame] | 301 | } |
Paul Kocialkowski | 6955989 | 2014-11-08 20:55:47 +0100 | [diff] [blame] | 302 | |
Paul Kocialkowski | 6955989 | 2014-11-08 20:55:47 +0100 | [diff] [blame] | 303 | void board_mmc_power_init(void) |
| 304 | { |
| 305 | twl4030_power_mmc_init(0); |
| 306 | } |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 307 | #endif /* CONFIG_MMC */ |
| 308 | |
Derald D. Woods | 1b01bf9 | 2017-08-06 00:00:21 -0500 | [diff] [blame] | 309 | #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) && !defined(CONFIG_CMD_NET) |
| 310 | int board_eth_init(bd_t *bis) |
| 311 | { |
| 312 | return usb_eth_initialize(bis); |
| 313 | } |
| 314 | #endif /* CONFIG_USB_ETHER */ |