Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 1 | /* |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 2 | * (C) Copyright 2004-2011 |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 3 | * Texas Instruments, <www.ti.com> |
| 4 | * |
| 5 | * Author : |
| 6 | * Sunil Kumar <sunilsaini05@gmail.com> |
| 7 | * Shashi Ranjan <shashiranjanmca05@gmail.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> |
| 12 | * |
| 13 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 14 | * SPDX-License-Identifier: GPL-2.0+ |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 15 | */ |
| 16 | #include <common.h> |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 17 | #include <dm.h> |
| 18 | #include <ns16550.h> |
Uri Mashiach | 4892d39 | 2017-01-19 10:51:45 +0200 | [diff] [blame] | 19 | #ifdef CONFIG_LED_STATUS |
Jason Kridner | c3ef8bc | 2011-04-18 17:23:35 -0400 | [diff] [blame] | 20 | #include <status_led.h> |
| 21 | #endif |
Tom Rix | 0f2a804 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 22 | #include <twl4030.h> |
Masahiro Yamada | 2b7a873 | 2017-11-30 13:45:24 +0900 | [diff] [blame] | 23 | #include <linux/mtd/rawnand.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 24 | #include <asm/io.h> |
Steve Sakoman | 57c6241 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 25 | #include <asm/arch/mmc_host_def.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 26 | #include <asm/arch/mux.h> |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 27 | #include <asm/arch/mem.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 28 | #include <asm/arch/sys_proto.h> |
Sanjeev Premi | 7b3dc82 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 29 | #include <asm/gpio.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 30 | #include <asm/mach-types.h> |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 31 | #include <asm/omap_musb.h> |
Masahiro Yamada | 56a931c | 2016-09-21 11:28:55 +0900 | [diff] [blame] | 32 | #include <linux/errno.h> |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 33 | #include <linux/usb/ch9.h> |
| 34 | #include <linux/usb/gadget.h> |
| 35 | #include <linux/usb/musb.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 36 | #include "beagle.h" |
Jason Kridner | 85a08fb | 2010-07-21 07:41:25 -0500 | [diff] [blame] | 37 | #include <command.h> |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 38 | |
Tom Rini | ceed5d2 | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 39 | #ifdef CONFIG_USB_EHCI_HCD |
Govindraj.R | edc16a0 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 40 | #include <usb.h> |
| 41 | #include <asm/ehci-omap.h> |
| 42 | #endif |
| 43 | |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 44 | #define TWL4030_I2C_BUS 0 |
| 45 | #define EXPANSION_EEPROM_I2C_BUS 1 |
| 46 | #define EXPANSION_EEPROM_I2C_ADDRESS 0x50 |
| 47 | |
| 48 | #define TINCANTOOLS_ZIPPY 0x01000100 |
| 49 | #define TINCANTOOLS_ZIPPY2 0x02000100 |
| 50 | #define TINCANTOOLS_TRAINER 0x04000100 |
| 51 | #define TINCANTOOLS_SHOWDOG 0x03000100 |
| 52 | #define KBADC_BEAGLEFPGA 0x01000600 |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 53 | #define LW_BEAGLETOUCH 0x01000700 |
| 54 | #define BRAINMUX_LCDOG 0x01000800 |
| 55 | #define BRAINMUX_LCDOGTOUCH 0x02000800 |
| 56 | #define BBTOYS_WIFI 0x01000B00 |
| 57 | #define BBTOYS_VGA 0x02000B00 |
| 58 | #define BBTOYS_LCD 0x03000B00 |
Peter Meerwald | 1aca738 | 2012-01-03 04:14:35 +0000 | [diff] [blame] | 59 | #define BCT_BRETTL3 0x01000F00 |
Peter Meerwald | ad5691f | 2012-06-28 05:38:35 +0000 | [diff] [blame] | 60 | #define BCT_BRETTL4 0x02000F00 |
robertcnelson@gmail.com | 346d7eb | 2013-02-04 06:03:30 +0000 | [diff] [blame] | 61 | #define LSR_COM6L_ADPT 0x01001300 |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 62 | #define BEAGLE_NO_EEPROM 0xffffffff |
| 63 | |
John Rigby | 0d21ed0 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 64 | DECLARE_GLOBAL_DATA_PTR; |
| 65 | |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 66 | static struct { |
| 67 | unsigned int device_vendor; |
| 68 | unsigned char revision; |
| 69 | unsigned char content; |
| 70 | char fab_revision[8]; |
| 71 | char env_var[16]; |
| 72 | char env_setting[64]; |
| 73 | } expansion_config; |
| 74 | |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 75 | static const struct ns16550_platdata beagle_serial = { |
Adam Ford | d1e22fa | 2016-03-07 21:08:49 -0600 | [diff] [blame] | 76 | .base = OMAP34XX_UART3, |
| 77 | .reg_shift = 2, |
Heiko Schocher | 06f108e | 2017-01-18 08:05:49 +0100 | [diff] [blame] | 78 | .clock = V_NS16550_CLK, |
| 79 | .fcr = UART_FCR_DEFVAL, |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | U_BOOT_DEVICE(beagle_uart) = { |
Thomas Chou | 52ac443 | 2015-11-19 21:48:12 +0800 | [diff] [blame] | 83 | "ns16550_serial", |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 84 | &beagle_serial |
| 85 | }; |
| 86 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 87 | /* |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 88 | * Routine: board_init |
| 89 | * Description: Early hardware init. |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 90 | */ |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 91 | int board_init(void) |
| 92 | { |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 93 | gpmc_init(); /* in SRAM or SDRAM, finish GPMC */ |
| 94 | /* board id for Linux */ |
| 95 | gd->bd->bi_arch_number = MACH_TYPE_OMAP3_BEAGLE; |
| 96 | /* boot param addr */ |
| 97 | gd->bd->bi_boot_params = (OMAP34XX_SDRC_CS0 + 0x100); |
| 98 | |
Uri Mashiach | 4892d39 | 2017-01-19 10:51:45 +0200 | [diff] [blame] | 99 | #if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE) |
| 100 | status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_ON); |
Jason Kridner | c3ef8bc | 2011-04-18 17:23:35 -0400 | [diff] [blame] | 101 | #endif |
| 102 | |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 103 | return 0; |
| 104 | } |
| 105 | |
Derald D. Woods | 2b6b089 | 2017-12-29 10:37:32 -0600 | [diff] [blame] | 106 | #if defined(CONFIG_SPL_OS_BOOT) |
| 107 | int spl_start_uboot(void) |
| 108 | { |
| 109 | /* break into full u-boot on 'c' */ |
| 110 | if (serial_tstc() && serial_getc() == 'c') |
| 111 | return 1; |
| 112 | |
| 113 | return 0; |
| 114 | } |
| 115 | #endif /* CONFIG_SPL_OS_BOOT */ |
| 116 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 117 | /* |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 118 | * Routine: get_board_revision |
| 119 | * Description: Detect if we are running on a Beagle revision Ax/Bx, |
Tom Rini | 4dfad75 | 2013-04-16 16:31:20 -0400 | [diff] [blame] | 120 | * C1/2/3, C4, xM Ax/Bx or xM Cx. This can be done by reading |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 121 | * the level of GPIO173, GPIO172 and GPIO171. This should |
| 122 | * result in |
| 123 | * GPIO173, GPIO172, GPIO171: 1 1 1 => Ax/Bx |
| 124 | * GPIO173, GPIO172, GPIO171: 1 1 0 => C1/2/3 |
| 125 | * GPIO173, GPIO172, GPIO171: 1 0 1 => C4 |
Tom Rini | 4dfad75 | 2013-04-16 16:31:20 -0400 | [diff] [blame] | 126 | * GPIO173, GPIO172, GPIO171: 0 1 0 => xM Cx |
| 127 | * GPIO173, GPIO172, GPIO171: 0 0 0 => xM Ax/Bx |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 128 | */ |
Peter Meerwald | a93ee5f | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 129 | static int get_board_revision(void) |
Dirk Behme | 7871611 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 130 | { |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 131 | static int revision = -1; |
Dirk Behme | 7871611 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 132 | |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 133 | if (revision == -1) { |
| 134 | if (!gpio_request(171, "rev0") && |
| 135 | !gpio_request(172, "rev1") && |
| 136 | !gpio_request(173, "rev2")) { |
| 137 | gpio_direction_input(171); |
| 138 | gpio_direction_input(172); |
| 139 | gpio_direction_input(173); |
Dirk Behme | 7871611 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 140 | |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 141 | revision = gpio_get_value(173) << 2 | |
| 142 | gpio_get_value(172) << 1 | |
| 143 | gpio_get_value(171); |
| 144 | } else { |
| 145 | printf("Error: unable to acquire board revision GPIOs\n"); |
| 146 | } |
Tom Rix | 70d0541 | 2009-06-03 01:53:57 -0500 | [diff] [blame] | 147 | } |
Dirk Behme | 7871611 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 148 | |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 149 | return revision; |
Dirk Behme | 7871611 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 150 | } |
| 151 | |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 152 | #ifdef CONFIG_SPL_BUILD |
| 153 | /* |
| 154 | * Routine: get_board_mem_timings |
| 155 | * Description: If we use SPL then there is no x-loader nor config header |
| 156 | * so we have to setup the DDR timings ourself on both banks. |
| 157 | */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 158 | void get_board_mem_timings(struct board_sdrc_timings *timings) |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 159 | { |
| 160 | int pop_mfr, pop_id; |
| 161 | |
| 162 | /* |
| 163 | * We need to identify what PoP memory is on the board so that |
| 164 | * we know what timings to use. If we can't identify it then |
| 165 | * we know it's an xM. To map the ID values please see nand_ids.c |
| 166 | */ |
| 167 | identify_nand_chip(&pop_mfr, &pop_id); |
| 168 | |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 169 | timings->mr = MICRON_V_MR_165; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 170 | switch (get_board_revision()) { |
| 171 | case REVISION_C4: |
| 172 | if (pop_mfr == NAND_MFR_STMICRO && pop_id == 0xba) { |
| 173 | /* 512MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 174 | timings->mcfg = NUMONYX_V_MCFG_165(512 << 20); |
| 175 | timings->ctrla = NUMONYX_V_ACTIMA_165; |
| 176 | timings->ctrlb = NUMONYX_V_ACTIMB_165; |
| 177 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 178 | break; |
robertcnelson@gmail.com | 4b949bb | 2012-01-27 07:09:42 +0000 | [diff] [blame] | 179 | } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xba) { |
| 180 | /* Beagleboard Rev C4, 512MB Nand/256MB DDR*/ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 181 | timings->mcfg = MICRON_V_MCFG_165(128 << 20); |
| 182 | timings->ctrla = MICRON_V_ACTIMA_165; |
| 183 | timings->ctrlb = MICRON_V_ACTIMB_165; |
| 184 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; |
robertcnelson@gmail.com | 4b949bb | 2012-01-27 07:09:42 +0000 | [diff] [blame] | 185 | break; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 186 | } else if (pop_mfr == NAND_MFR_MICRON && pop_id == 0xbc) { |
| 187 | /* Beagleboard Rev C5, 256MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 188 | timings->mcfg = MICRON_V_MCFG_200(256 << 20); |
| 189 | timings->ctrla = MICRON_V_ACTIMA_200; |
| 190 | timings->ctrlb = MICRON_V_ACTIMB_200; |
| 191 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 192 | break; |
| 193 | } |
Nishanth Menon | 1d65fb3 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 194 | case REVISION_XM_AB: |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 195 | case REVISION_XM_C: |
| 196 | if (pop_mfr == 0) { |
| 197 | /* 256MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 198 | timings->mcfg = MICRON_V_MCFG_200(256 << 20); |
| 199 | timings->ctrla = MICRON_V_ACTIMA_200; |
| 200 | timings->ctrlb = MICRON_V_ACTIMB_200; |
| 201 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_200MHz; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 202 | } else { |
| 203 | /* 512MB DDR */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 204 | timings->mcfg = NUMONYX_V_MCFG_165(512 << 20); |
| 205 | timings->ctrla = NUMONYX_V_ACTIMA_165; |
| 206 | timings->ctrlb = NUMONYX_V_ACTIMB_165; |
| 207 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 208 | } |
| 209 | break; |
| 210 | default: |
| 211 | /* Assume 128MB and Micron/165MHz timings to be safe */ |
Peter Barada | edb5c2f | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 212 | timings->mcfg = MICRON_V_MCFG_165(128 << 20); |
| 213 | timings->ctrla = MICRON_V_ACTIMA_165; |
| 214 | timings->ctrlb = MICRON_V_ACTIMB_165; |
| 215 | timings->rfr_ctrl = SDP_3430_SDRC_RFR_CTRL_165MHz; |
Tom Rini | 06c32fb | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | #endif |
| 219 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 220 | /* |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 221 | * Routine: get_expansion_id |
| 222 | * Description: This function checks for expansion board by checking I2C |
| 223 | * bus 1 for the availability of an AT24C01B serial EEPROM. |
| 224 | * returns the device_vendor field from the EEPROM |
| 225 | */ |
Peter Meerwald | a93ee5f | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 226 | static unsigned int get_expansion_id(void) |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 227 | { |
| 228 | i2c_set_bus_num(EXPANSION_EEPROM_I2C_BUS); |
| 229 | |
| 230 | /* return BEAGLE_NO_EEPROM if eeprom doesn't respond */ |
| 231 | if (i2c_probe(EXPANSION_EEPROM_I2C_ADDRESS) == 1) { |
| 232 | i2c_set_bus_num(TWL4030_I2C_BUS); |
| 233 | return BEAGLE_NO_EEPROM; |
| 234 | } |
| 235 | |
| 236 | /* read configuration data */ |
| 237 | i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 1, (u8 *)&expansion_config, |
| 238 | sizeof(expansion_config)); |
| 239 | |
robertcnelson@gmail.com | aba0c9c | 2013-02-04 06:03:10 +0000 | [diff] [blame] | 240 | /* retry reading configuration data with 16bit addressing */ |
| 241 | if ((expansion_config.device_vendor == 0xFFFFFF00) || |
| 242 | (expansion_config.device_vendor == 0xFFFFFFFF)) { |
| 243 | printf("EEPROM is blank or 8bit addressing failed: retrying with 16bit:\n"); |
| 244 | i2c_read(EXPANSION_EEPROM_I2C_ADDRESS, 0, 2, (u8 *)&expansion_config, |
| 245 | sizeof(expansion_config)); |
| 246 | } |
| 247 | |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 248 | i2c_set_bus_num(TWL4030_I2C_BUS); |
| 249 | |
| 250 | return expansion_config.device_vendor; |
| 251 | } |
| 252 | |
Peter Meerwald | a2f5456 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 253 | #ifdef CONFIG_VIDEO_OMAP3 |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 254 | /* |
Jason Kridner | b8f6ac5 | 2011-04-19 14:01:13 -0500 | [diff] [blame] | 255 | * Configure DSS to display background color on DVID |
| 256 | * Configure VENC to display color bar on S-Video |
| 257 | */ |
Peter Meerwald | a93ee5f | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 258 | static void beagle_display_init(void) |
Jason Kridner | b8f6ac5 | 2011-04-19 14:01:13 -0500 | [diff] [blame] | 259 | { |
| 260 | omap3_dss_venc_config(&venc_config_std_tv, VENC_HEIGHT, VENC_WIDTH); |
| 261 | switch (get_board_revision()) { |
| 262 | case REVISION_AXBX: |
| 263 | case REVISION_CX: |
| 264 | case REVISION_C4: |
| 265 | omap3_dss_panel_config(&dvid_cfg); |
| 266 | break; |
Nishanth Menon | 1d65fb3 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 267 | case REVISION_XM_AB: |
Jason Kridner | b8f6ac5 | 2011-04-19 14:01:13 -0500 | [diff] [blame] | 268 | case REVISION_XM_C: |
| 269 | default: |
| 270 | omap3_dss_panel_config(&dvid_cfg_xm); |
| 271 | break; |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | /* |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 276 | * Enable DVI power |
| 277 | */ |
Anatolij Gustschin | 359260b | 2012-03-27 23:05:07 +0000 | [diff] [blame] | 278 | static void beagle_dvi_pup(void) |
| 279 | { |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 280 | uchar val; |
| 281 | |
| 282 | switch (get_board_revision()) { |
| 283 | case REVISION_AXBX: |
| 284 | case REVISION_CX: |
| 285 | case REVISION_C4: |
Simon Glass | bc0f4ea | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 286 | gpio_request(170, "dvi"); |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 287 | gpio_direction_output(170, 0); |
| 288 | gpio_set_value(170, 1); |
| 289 | break; |
Nishanth Menon | 1d65fb3 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 290 | case REVISION_XM_AB: |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 291 | case REVISION_XM_C: |
| 292 | default: |
| 293 | #define GPIODATADIR1 (TWL4030_BASEADD_GPIO+3) |
| 294 | #define GPIODATAOUT1 (TWL4030_BASEADD_GPIO+6) |
| 295 | |
| 296 | i2c_read(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); |
| 297 | val |= 4; |
| 298 | i2c_write(TWL4030_CHIP_GPIO, GPIODATADIR1, 1, &val, 1); |
| 299 | |
| 300 | i2c_read(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); |
| 301 | val |= 4; |
| 302 | i2c_write(TWL4030_CHIP_GPIO, GPIODATAOUT1, 1, &val, 1); |
| 303 | break; |
| 304 | } |
| 305 | } |
Peter Meerwald | a2f5456 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 306 | #endif |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 307 | |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 308 | #ifdef CONFIG_USB_MUSB_OMAP2PLUS |
| 309 | static struct musb_hdrc_config musb_config = { |
| 310 | .multipoint = 1, |
| 311 | .dyn_fifo = 1, |
| 312 | .num_eps = 16, |
| 313 | .ram_bits = 12, |
| 314 | }; |
| 315 | |
| 316 | static struct omap_musb_board_data musb_board_data = { |
| 317 | .interface_type = MUSB_INTERFACE_ULPI, |
| 318 | }; |
| 319 | |
| 320 | static struct musb_hdrc_platform_data musb_plat = { |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 321 | #if defined(CONFIG_USB_MUSB_HOST) |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 322 | .mode = MUSB_HOST, |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 323 | #elif defined(CONFIG_USB_MUSB_GADGET) |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 324 | .mode = MUSB_PERIPHERAL, |
| 325 | #else |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 326 | #error "Please define either CONFIG_USB_MUSB_HOST or CONFIG_USB_MUSB_GADGET" |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 327 | #endif |
| 328 | .config = &musb_config, |
| 329 | .power = 100, |
| 330 | .platform_ops = &omap2430_ops, |
| 331 | .board_data = &musb_board_data, |
| 332 | }; |
| 333 | #endif |
| 334 | |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 335 | /* |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 336 | * Routine: misc_init_r |
| 337 | * Description: Configure board specific parts |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 338 | */ |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 339 | int misc_init_r(void) |
| 340 | { |
Dirk Behme | dc7af20 | 2009-08-08 09:30:21 +0200 | [diff] [blame] | 341 | struct gpio *gpio5_base = (struct gpio *)OMAP34XX_GPIO5_BASE; |
| 342 | struct gpio *gpio6_base = (struct gpio *)OMAP34XX_GPIO6_BASE; |
Jason Kridner | 40aebca | 2011-04-20 13:52:26 +0000 | [diff] [blame] | 343 | struct control_prog_io *prog_io_base = (struct control_prog_io *)OMAP34XX_CTRL_BASE; |
Nishanth Menon | 739b98f | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 344 | bool generate_fake_mac = false; |
Alexander Kochetkov | 7822fe0 | 2014-09-29 21:46:48 +0400 | [diff] [blame] | 345 | u32 value; |
Steve Kipisz | bf7438a | 2011-04-18 17:27:00 -0400 | [diff] [blame] | 346 | |
| 347 | /* Enable i2c2 pullup resisters */ |
Alexander Kochetkov | 7822fe0 | 2014-09-29 21:46:48 +0400 | [diff] [blame] | 348 | value = readl(&prog_io_base->io1); |
| 349 | value &= ~(PRG_I2C2_PULLUPRESX); |
| 350 | writel(value, &prog_io_base->io1); |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 351 | |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 352 | switch (get_board_revision()) { |
| 353 | case REVISION_AXBX: |
| 354 | printf("Beagle Rev Ax/Bx\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 355 | env_set("beaglerev", "AxBx"); |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 356 | break; |
| 357 | case REVISION_CX: |
| 358 | printf("Beagle Rev C1/C2/C3\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 359 | env_set("beaglerev", "Cx"); |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 360 | MUX_BEAGLE_C(); |
| 361 | break; |
| 362 | case REVISION_C4: |
| 363 | printf("Beagle Rev C4\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 364 | env_set("beaglerev", "C4"); |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 365 | MUX_BEAGLE_C(); |
| 366 | /* Set VAUX2 to 1.8V for EHCI PHY */ |
| 367 | twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, |
| 368 | TWL4030_PM_RECEIVER_VAUX2_VSEL_18, |
| 369 | TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, |
| 370 | TWL4030_PM_RECEIVER_DEV_GRP_P1); |
| 371 | break; |
Nishanth Menon | 1d65fb3 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 372 | case REVISION_XM_AB: |
| 373 | printf("Beagle xM Rev A/B\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 374 | env_set("beaglerev", "xMAB"); |
Steve Sakoman | ac92995 | 2010-08-19 20:56:11 -0700 | [diff] [blame] | 375 | MUX_BEAGLE_XM(); |
| 376 | /* Set VAUX2 to 1.8V for EHCI PHY */ |
| 377 | twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, |
| 378 | TWL4030_PM_RECEIVER_VAUX2_VSEL_18, |
| 379 | TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, |
| 380 | TWL4030_PM_RECEIVER_DEV_GRP_P1); |
Nishanth Menon | 739b98f | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 381 | generate_fake_mac = true; |
Steve Sakoman | ac92995 | 2010-08-19 20:56:11 -0700 | [diff] [blame] | 382 | break; |
Koen Kooi | 6330844 | 2011-06-17 09:37:37 +0200 | [diff] [blame] | 383 | case REVISION_XM_C: |
| 384 | printf("Beagle xM Rev C\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 385 | env_set("beaglerev", "xMC"); |
Koen Kooi | 6330844 | 2011-06-17 09:37:37 +0200 | [diff] [blame] | 386 | MUX_BEAGLE_XM(); |
| 387 | /* Set VAUX2 to 1.8V for EHCI PHY */ |
| 388 | twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, |
| 389 | TWL4030_PM_RECEIVER_VAUX2_VSEL_18, |
| 390 | TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, |
| 391 | TWL4030_PM_RECEIVER_DEV_GRP_P1); |
Nishanth Menon | 739b98f | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 392 | generate_fake_mac = true; |
Koen Kooi | 6330844 | 2011-06-17 09:37:37 +0200 | [diff] [blame] | 393 | break; |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 394 | default: |
| 395 | printf("Beagle unknown 0x%02x\n", get_board_revision()); |
Koen Kooi | 5b8018c | 2011-04-18 17:28:32 -0400 | [diff] [blame] | 396 | MUX_BEAGLE_XM(); |
| 397 | /* Set VAUX2 to 1.8V for EHCI PHY */ |
| 398 | twl4030_pmrecv_vsel_cfg(TWL4030_PM_RECEIVER_VAUX2_DEDICATED, |
| 399 | TWL4030_PM_RECEIVER_VAUX2_VSEL_18, |
| 400 | TWL4030_PM_RECEIVER_VAUX2_DEV_GRP, |
| 401 | TWL4030_PM_RECEIVER_DEV_GRP_P1); |
Nishanth Menon | 739b98f | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 402 | generate_fake_mac = true; |
Steve Sakoman | 3ca3376 | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 403 | } |
| 404 | |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 405 | switch (get_expansion_id()) { |
| 406 | case TINCANTOOLS_ZIPPY: |
| 407 | printf("Recognized Tincantools Zippy board (rev %d %s)\n", |
| 408 | expansion_config.revision, |
| 409 | expansion_config.fab_revision); |
| 410 | MUX_TINCANTOOLS_ZIPPY(); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 411 | env_set("buddy", "zippy"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 412 | break; |
| 413 | case TINCANTOOLS_ZIPPY2: |
| 414 | printf("Recognized Tincantools Zippy2 board (rev %d %s)\n", |
| 415 | expansion_config.revision, |
| 416 | expansion_config.fab_revision); |
| 417 | MUX_TINCANTOOLS_ZIPPY(); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 418 | env_set("buddy", "zippy2"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 419 | break; |
| 420 | case TINCANTOOLS_TRAINER: |
| 421 | printf("Recognized Tincantools Trainer board (rev %d %s)\n", |
| 422 | expansion_config.revision, |
| 423 | expansion_config.fab_revision); |
| 424 | MUX_TINCANTOOLS_ZIPPY(); |
| 425 | MUX_TINCANTOOLS_TRAINER(); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 426 | env_set("buddy", "trainer"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 427 | break; |
| 428 | case TINCANTOOLS_SHOWDOG: |
| 429 | printf("Recognized Tincantools Showdow board (rev %d %s)\n", |
| 430 | expansion_config.revision, |
| 431 | expansion_config.fab_revision); |
| 432 | /* Place holder for DSS2 definition for showdog lcd */ |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 433 | env_set("defaultdisplay", "showdoglcd"); |
| 434 | env_set("buddy", "showdog"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 435 | break; |
| 436 | case KBADC_BEAGLEFPGA: |
| 437 | printf("Recognized KBADC Beagle FPGA board\n"); |
| 438 | MUX_KBADC_BEAGLEFPGA(); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 439 | env_set("buddy", "beaglefpga"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 440 | break; |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 441 | case LW_BEAGLETOUCH: |
| 442 | printf("Recognized Liquidware BeagleTouch board\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 443 | env_set("buddy", "beagletouch"); |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 444 | break; |
| 445 | case BRAINMUX_LCDOG: |
| 446 | printf("Recognized Brainmux LCDog board\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 447 | env_set("buddy", "lcdog"); |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 448 | break; |
| 449 | case BRAINMUX_LCDOGTOUCH: |
| 450 | printf("Recognized Brainmux LCDog Touch board\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 451 | env_set("buddy", "lcdogtouch"); |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 452 | break; |
| 453 | case BBTOYS_WIFI: |
| 454 | printf("Recognized BeagleBoardToys WiFi board\n"); |
| 455 | MUX_BBTOYS_WIFI() |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 456 | env_set("buddy", "bbtoys-wifi"); |
Masahiro Yamada | 622b7b3 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 457 | break; |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 458 | case BBTOYS_VGA: |
| 459 | printf("Recognized BeagleBoardToys VGA board\n"); |
Masahiro Yamada | 622b7b3 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 460 | break; |
Koen Kooi | 3d5dac6 | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 461 | case BBTOYS_LCD: |
| 462 | printf("Recognized BeagleBoardToys LCD board\n"); |
Masahiro Yamada | 622b7b3 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 463 | break; |
Peter Meerwald | 1aca738 | 2012-01-03 04:14:35 +0000 | [diff] [blame] | 464 | case BCT_BRETTL3: |
Peter Meerwald | ad5691f | 2012-06-28 05:38:35 +0000 | [diff] [blame] | 465 | printf("Recognized bct electronic GmbH brettl3 board\n"); |
| 466 | break; |
| 467 | case BCT_BRETTL4: |
| 468 | printf("Recognized bct electronic GmbH brettl4 board\n"); |
| 469 | break; |
robertcnelson@gmail.com | 346d7eb | 2013-02-04 06:03:30 +0000 | [diff] [blame] | 470 | case LSR_COM6L_ADPT: |
| 471 | printf("Recognized LSR COM6L Adapter Board\n"); |
| 472 | MUX_BBTOYS_WIFI() |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 473 | env_set("buddy", "lsr-com6l-adpt"); |
robertcnelson@gmail.com | 346d7eb | 2013-02-04 06:03:30 +0000 | [diff] [blame] | 474 | break; |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 475 | case BEAGLE_NO_EEPROM: |
| 476 | printf("No EEPROM on expansion board\n"); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 477 | env_set("buddy", "none"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 478 | break; |
| 479 | default: |
| 480 | printf("Unrecognized expansion board: %x\n", |
| 481 | expansion_config.device_vendor); |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 482 | env_set("buddy", "unknown"); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | if (expansion_config.content == 1) |
Simon Glass | 6a38e41 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 486 | env_set(expansion_config.env_var, expansion_config.env_setting); |
Koen Kooi | b6241c2 | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 487 | |
Tom Rix | 0f2a804 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 488 | twl4030_power_init(); |
Christian Spielberger | 3be83dc | 2011-08-24 17:17:31 -0500 | [diff] [blame] | 489 | switch (get_board_revision()) { |
Nishanth Menon | 1d65fb3 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 490 | case REVISION_XM_AB: |
Christian Spielberger | 3be83dc | 2011-08-24 17:17:31 -0500 | [diff] [blame] | 491 | twl4030_led_init(TWL4030_LED_LEDEN_LEDBON); |
| 492 | break; |
| 493 | default: |
| 494 | twl4030_led_init(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON); |
| 495 | break; |
| 496 | } |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 497 | |
Bob Feretich | 0ad8951 | 2011-02-24 13:16:44 +0000 | [diff] [blame] | 498 | /* Set GPIO states before they are made outputs */ |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 499 | writel(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1, |
| 500 | &gpio6_base->setdataout); |
| 501 | writel(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | |
| 502 | GPIO15 | GPIO14 | GPIO13 | GPIO12, &gpio5_base->setdataout); |
| 503 | |
Bob Feretich | 0ad8951 | 2011-02-24 13:16:44 +0000 | [diff] [blame] | 504 | /* Configure GPIOs to output */ |
| 505 | writel(~(GPIO23 | GPIO10 | GPIO8 | GPIO2 | GPIO1), &gpio6_base->oe); |
| 506 | writel(~(GPIO31 | GPIO30 | GPIO29 | GPIO28 | GPIO22 | GPIO21 | |
| 507 | GPIO15 | GPIO14 | GPIO13 | GPIO12), &gpio5_base->oe); |
| 508 | |
Paul Kocialkowski | 6bc318e | 2015-08-27 19:37:13 +0200 | [diff] [blame] | 509 | omap_die_id_display(); |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 510 | |
Peter Meerwald | a2f5456 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 511 | #ifdef CONFIG_VIDEO_OMAP3 |
Peter Meerwald | 03ed046 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 512 | beagle_dvi_pup(); |
Jason Kridner | b8f6ac5 | 2011-04-19 14:01:13 -0500 | [diff] [blame] | 513 | beagle_display_init(); |
| 514 | omap3_dss_enable(); |
Peter Meerwald | a2f5456 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 515 | #endif |
Dirk Behme | 12dbcf6 | 2009-03-12 19:30:50 +0100 | [diff] [blame] | 516 | |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 517 | #ifdef CONFIG_USB_MUSB_OMAP2PLUS |
| 518 | musb_register(&musb_plat, &musb_board_data, (void *)MUSB_BASE); |
| 519 | #endif |
| 520 | |
Paul Kocialkowski | 2edadee | 2015-08-27 19:37:12 +0200 | [diff] [blame] | 521 | if (generate_fake_mac) |
| 522 | omap_die_id_usbethaddr(); |
Nishanth Menon | 739b98f | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 523 | |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 524 | return 0; |
| 525 | } |
| 526 | |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 527 | /* |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 528 | * Routine: set_muxconf_regs |
| 529 | * Description: Setting up the configuration Mux registers specific to the |
| 530 | * hardware. Many pins need to be moved from protect to primary |
| 531 | * mode. |
Tom Rix | 558bb83 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 532 | */ |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 533 | void set_muxconf_regs(void) |
| 534 | { |
| 535 | MUX_BEAGLE(); |
Dirk Behme | 2781f80 | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 536 | } |
Steve Sakoman | 57c6241 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 537 | |
Masahiro Yamada | 0a78017 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 538 | #if defined(CONFIG_MMC) |
Steve Sakoman | 57c6241 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 539 | int board_mmc_init(bd_t *bis) |
| 540 | { |
Nikita Kiryanov | 4be9dbc | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 541 | return omap_mmc_init(0, 0, 0, -1, -1); |
Steve Sakoman | 57c6241 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 542 | } |
| 543 | #endif |
Alexander Holler | 8f6f15c | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 544 | |
Masahiro Yamada | 0a78017 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 545 | #if defined(CONFIG_MMC) |
Paul Kocialkowski | 6955989 | 2014-11-08 20:55:47 +0100 | [diff] [blame] | 546 | void board_mmc_power_init(void) |
| 547 | { |
| 548 | twl4030_power_mmc_init(0); |
| 549 | } |
| 550 | #endif |
| 551 | |
Tom Rini | ceed5d2 | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 552 | #if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD) |
Alexander Holler | 8f6f15c | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 553 | /* Call usb_stop() before starting the kernel */ |
| 554 | void show_boot_progress(int val) |
| 555 | { |
Simon Glass | 2939564 | 2011-12-10 11:07:54 +0000 | [diff] [blame] | 556 | if (val == BOOTSTAGE_ID_RUN_OS) |
Alexander Holler | 8f6f15c | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 557 | usb_stop(); |
| 558 | } |
Govindraj.R | edc16a0 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 559 | |
| 560 | static struct omap_usbhs_board_data usbhs_bdata = { |
| 561 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
| 562 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
| 563 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED |
| 564 | }; |
| 565 | |
Troy Kisky | 7d6bbb9 | 2013-10-10 15:27:57 -0700 | [diff] [blame] | 566 | int ehci_hcd_init(int index, enum usb_init_type init, |
| 567 | struct ehci_hccr **hccr, struct ehci_hcor **hcor) |
Govindraj.R | edc16a0 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 568 | { |
Mateusz Zalega | d862f89 | 2013-10-04 19:22:26 +0200 | [diff] [blame] | 569 | return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); |
Govindraj.R | edc16a0 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 570 | } |
| 571 | |
Lucas Stach | 3494a4c | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 572 | int ehci_hcd_stop(int index) |
Govindraj.R | edc16a0 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 573 | { |
| 574 | return omap_ehci_hcd_stop(); |
| 575 | } |
| 576 | |
Tom Rini | ceed5d2 | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 577 | #endif /* CONFIG_USB_EHCI_HCD */ |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 578 | |
Paul Kocialkowski | f34dfcb | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 579 | #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) |
Ilya Yanok | cb7b2b8 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 580 | int board_eth_init(bd_t *bis) |
| 581 | { |
| 582 | return usb_eth_initialize(bis); |
| 583 | } |
| 584 | #endif |