Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 1 | /* |
Tom Rini | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 2 | * (C) Copyright 2004-2011 |
Dirk Behme | f904cdb | 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 | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 14 | * SPDX-License-Identifier: GPL-2.0+ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 15 | */ |
| 16 | #include <common.h> |
Simon Glass | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 17 | #include <dm.h> |
| 18 | #include <ns16550.h> |
Uri Mashiach | 2d8d190 | 2017-01-19 10:51:45 +0200 | [diff] [blame] | 19 | #ifdef CONFIG_LED_STATUS |
Jason Kridner | 70d8c94 | 2011-04-18 17:23:35 -0400 | [diff] [blame] | 20 | #include <status_led.h> |
| 21 | #endif |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 22 | #include <twl4030.h> |
Masahiro Yamada | 6ae3900 | 2017-11-30 13:45:24 +0900 | [diff] [blame] | 23 | #include <linux/mtd/rawnand.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 24 | #include <asm/io.h> |
Steve Sakoman | 0cd3114 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 25 | #include <asm/arch/mmc_host_def.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 26 | #include <asm/arch/mux.h> |
Tom Rini | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 27 | #include <asm/arch/mem.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 28 | #include <asm/arch/sys_proto.h> |
Sanjeev Premi | 84c3b63 | 2011-09-08 10:51:01 -0400 | [diff] [blame] | 29 | #include <asm/gpio.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 30 | #include <asm/mach-types.h> |
Ilya Yanok | c642b15 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 31 | #include <asm/omap_musb.h> |
Masahiro Yamada | 1221ce4 | 2016-09-21 11:28:55 +0900 | [diff] [blame] | 32 | #include <linux/errno.h> |
Ilya Yanok | c642b15 | 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 | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 36 | #include "beagle.h" |
Jason Kridner | f835ea7 | 2010-07-21 07:41:25 -0500 | [diff] [blame] | 37 | #include <command.h> |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 38 | |
Tom Rini | 8850c5d | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 39 | #ifdef CONFIG_USB_EHCI_HCD |
Govindraj.R | 43b6239 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 40 | #include <usb.h> |
| 41 | #include <asm/ehci-omap.h> |
| 42 | #endif |
| 43 | |
Koen Kooi | ca5f80a | 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 | ee8485f | 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 | 6cce550 | 2012-01-03 04:14:35 +0000 | [diff] [blame] | 59 | #define BCT_BRETTL3 0x01000F00 |
Peter Meerwald | ef88e60 | 2012-06-28 05:38:35 +0000 | [diff] [blame] | 60 | #define BCT_BRETTL4 0x02000F00 |
robertcnelson@gmail.com | 8a1f2dc | 2013-02-04 06:03:30 +0000 | [diff] [blame] | 61 | #define LSR_COM6L_ADPT 0x01001300 |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 62 | #define BEAGLE_NO_EEPROM 0xffffffff |
| 63 | |
John Rigby | 2956532 | 2010-12-20 18:27:51 -0700 | [diff] [blame] | 64 | DECLARE_GLOBAL_DATA_PTR; |
| 65 | |
Koen Kooi | ca5f80a | 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 | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 75 | static const struct ns16550_platdata beagle_serial = { |
Adam Ford | 2f6ed3b | 2016-03-07 21:08:49 -0600 | [diff] [blame] | 76 | .base = OMAP34XX_UART3, |
| 77 | .reg_shift = 2, |
Heiko Schocher | 17fa032 | 2017-01-18 08:05:49 +0100 | [diff] [blame] | 78 | .clock = V_NS16550_CLK, |
| 79 | .fcr = UART_FCR_DEFVAL, |
Simon Glass | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | U_BOOT_DEVICE(beagle_uart) = { |
Thomas Chou | c7b9686 | 2015-11-19 21:48:12 +0800 | [diff] [blame] | 83 | "ns16550_serial", |
Simon Glass | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 84 | &beagle_serial |
| 85 | }; |
| 86 | |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 87 | /* |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 88 | * Routine: board_init |
| 89 | * Description: Early hardware init. |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 90 | */ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 91 | int board_init(void) |
| 92 | { |
Dirk Behme | f904cdb | 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 | 2d8d190 | 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 | 70d8c94 | 2011-04-18 17:23:35 -0400 | [diff] [blame] | 101 | #endif |
| 102 | |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 103 | return 0; |
| 104 | } |
| 105 | |
Derald D. Woods | 4b37928 | 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 | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 117 | /* |
Steve Sakoman | 06b95bd | 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 | 8ce4e5f | 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 | 06b95bd | 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 | 8ce4e5f | 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 | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 128 | */ |
Peter Meerwald | fff1a57 | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 129 | static int get_board_revision(void) |
Dirk Behme | f956fd0 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 130 | { |
Simon Glass | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 131 | static int revision = -1; |
Dirk Behme | f956fd0 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 132 | |
Simon Glass | b3f4ca1 | 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 | f956fd0 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 140 | |
Simon Glass | b3f4ca1 | 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 | 718763c | 2009-06-03 01:53:57 -0500 | [diff] [blame] | 147 | } |
Dirk Behme | f956fd0 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 148 | |
Steve Sakoman | 06b95bd | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 149 | return revision; |
Dirk Behme | f956fd0 | 2009-02-12 18:55:41 +0100 | [diff] [blame] | 150 | } |
| 151 | |
Tom Rini | 75c57a3 | 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 | 8c4445d | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 158 | void get_board_mem_timings(struct board_sdrc_timings *timings) |
Tom Rini | 75c57a3 | 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 | 8c4445d | 2012-11-13 07:40:28 +0000 | [diff] [blame] | 169 | timings->mr = MICRON_V_MR_165; |
Tom Rini | 75c57a3 | 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 | 8c4445d | 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 | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 178 | break; |
robertcnelson@gmail.com | 223b8aa | 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 | 8c4445d | 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 | 223b8aa | 2012-01-27 07:09:42 +0000 | [diff] [blame] | 185 | break; |
Tom Rini | 75c57a3 | 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 | 8c4445d | 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 | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 192 | break; |
| 193 | } |
Nishanth Menon | af4d896 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 194 | case REVISION_XM_AB: |
Tom Rini | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 195 | case REVISION_XM_C: |
| 196 | if (pop_mfr == 0) { |
| 197 | /* 256MB DDR */ |
Peter Barada | 8c4445d | 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 | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 202 | } else { |
| 203 | /* 512MB DDR */ |
Peter Barada | 8c4445d | 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 | 75c57a3 | 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 | 8c4445d | 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 | 75c57a3 | 2011-11-18 12:48:08 +0000 | [diff] [blame] | 216 | } |
| 217 | } |
| 218 | #endif |
| 219 | |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 220 | /* |
Koen Kooi | ca5f80a | 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 | fff1a57 | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 226 | static unsigned int get_expansion_id(void) |
Koen Kooi | ca5f80a | 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 | ff229ec | 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 | ca5f80a | 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 | 2c30c18 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 253 | #ifdef CONFIG_VIDEO_OMAP3 |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 254 | /* |
Jason Kridner | 3f16ab9 | 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 | fff1a57 | 2012-07-02 03:19:03 +0000 | [diff] [blame] | 258 | static void beagle_display_init(void) |
Jason Kridner | 3f16ab9 | 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 | af4d896 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 267 | case REVISION_XM_AB: |
Jason Kridner | 3f16ab9 | 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 | 4258aa6 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 276 | * Enable DVI power |
| 277 | */ |
Anatolij Gustschin | 3fbc693 | 2012-03-27 23:05:07 +0000 | [diff] [blame] | 278 | static void beagle_dvi_pup(void) |
| 279 | { |
Peter Meerwald | 4258aa6 | 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 | b3f4ca1 | 2014-10-22 21:37:15 -0600 | [diff] [blame] | 286 | gpio_request(170, "dvi"); |
Peter Meerwald | 4258aa6 | 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 | af4d896 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 290 | case REVISION_XM_AB: |
Peter Meerwald | 4258aa6 | 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 | 2c30c18 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 306 | #endif |
Peter Meerwald | 4258aa6 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 307 | |
Ilya Yanok | c642b15 | 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 | 95de1e2 | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 321 | #if defined(CONFIG_USB_MUSB_HOST) |
Ilya Yanok | c642b15 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 322 | .mode = MUSB_HOST, |
Paul Kocialkowski | 95de1e2 | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 323 | #elif defined(CONFIG_USB_MUSB_GADGET) |
Ilya Yanok | c642b15 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 324 | .mode = MUSB_PERIPHERAL, |
| 325 | #else |
Paul Kocialkowski | 95de1e2 | 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 | c642b15 | 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 | 4258aa6 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 335 | /* |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 336 | * Routine: misc_init_r |
| 337 | * Description: Configure board specific parts |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 338 | */ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 339 | int misc_init_r(void) |
| 340 | { |
Dirk Behme | 97a099e | 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 | f14a522 | 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 | 548a64d | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 344 | bool generate_fake_mac = false; |
Alexander Kochetkov | 04e2a13 | 2014-09-29 21:46:48 +0400 | [diff] [blame] | 345 | u32 value; |
Steve Kipisz | d4e53f0 | 2011-04-18 17:27:00 -0400 | [diff] [blame] | 346 | |
| 347 | /* Enable i2c2 pullup resisters */ |
Alexander Kochetkov | 04e2a13 | 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 | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 351 | |
Steve Sakoman | 06b95bd | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 355 | env_set("beaglerev", "AxBx"); |
Steve Sakoman | 06b95bd | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 359 | env_set("beaglerev", "Cx"); |
Steve Sakoman | 06b95bd | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 364 | env_set("beaglerev", "C4"); |
Steve Sakoman | 06b95bd | 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 | af4d896 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 372 | case REVISION_XM_AB: |
| 373 | printf("Beagle xM Rev A/B\n"); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 374 | env_set("beaglerev", "xMAB"); |
Steve Sakoman | 08cbba2ab | 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 | 548a64d | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 381 | generate_fake_mac = true; |
Steve Sakoman | 08cbba2ab | 2010-08-19 20:56:11 -0700 | [diff] [blame] | 382 | break; |
Koen Kooi | 1ffcb34 | 2011-06-17 09:37:37 +0200 | [diff] [blame] | 383 | case REVISION_XM_C: |
| 384 | printf("Beagle xM Rev C\n"); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 385 | env_set("beaglerev", "xMC"); |
Koen Kooi | 1ffcb34 | 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 | 548a64d | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 392 | generate_fake_mac = true; |
Koen Kooi | 1ffcb34 | 2011-06-17 09:37:37 +0200 | [diff] [blame] | 393 | break; |
Steve Sakoman | 06b95bd | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 394 | default: |
| 395 | printf("Beagle unknown 0x%02x\n", get_board_revision()); |
Koen Kooi | f6e593b | 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 | 548a64d | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 402 | generate_fake_mac = true; |
Steve Sakoman | 06b95bd | 2010-08-12 15:17:37 -0700 | [diff] [blame] | 403 | } |
| 404 | |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 411 | env_set("buddy", "zippy"); |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 418 | env_set("buddy", "zippy2"); |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 426 | env_set("buddy", "trainer"); |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 433 | env_set("defaultdisplay", "showdoglcd"); |
| 434 | env_set("buddy", "showdog"); |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 439 | env_set("buddy", "beaglefpga"); |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 440 | break; |
Koen Kooi | ee8485f | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 441 | case LW_BEAGLETOUCH: |
| 442 | printf("Recognized Liquidware BeagleTouch board\n"); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 443 | env_set("buddy", "beagletouch"); |
Koen Kooi | ee8485f | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 444 | break; |
| 445 | case BRAINMUX_LCDOG: |
| 446 | printf("Recognized Brainmux LCDog board\n"); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 447 | env_set("buddy", "lcdog"); |
Koen Kooi | ee8485f | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 451 | env_set("buddy", "lcdogtouch"); |
Koen Kooi | ee8485f | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 456 | env_set("buddy", "bbtoys-wifi"); |
Masahiro Yamada | 51855e8 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 457 | break; |
Koen Kooi | ee8485f | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 458 | case BBTOYS_VGA: |
| 459 | printf("Recognized BeagleBoardToys VGA board\n"); |
Masahiro Yamada | 51855e8 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 460 | break; |
Koen Kooi | ee8485f | 2011-04-18 17:29:35 -0400 | [diff] [blame] | 461 | case BBTOYS_LCD: |
| 462 | printf("Recognized BeagleBoardToys LCD board\n"); |
Masahiro Yamada | 51855e8 | 2017-06-13 15:17:28 +0900 | [diff] [blame] | 463 | break; |
Peter Meerwald | 6cce550 | 2012-01-03 04:14:35 +0000 | [diff] [blame] | 464 | case BCT_BRETTL3: |
Peter Meerwald | ef88e60 | 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 | 8a1f2dc | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 473 | env_set("buddy", "lsr-com6l-adpt"); |
robertcnelson@gmail.com | 8a1f2dc | 2013-02-04 06:03:30 +0000 | [diff] [blame] | 474 | break; |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 475 | case BEAGLE_NO_EEPROM: |
| 476 | printf("No EEPROM on expansion board\n"); |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 477 | env_set("buddy", "none"); |
Koen Kooi | ca5f80a | 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 | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 482 | env_set("buddy", "unknown"); |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 483 | } |
| 484 | |
| 485 | if (expansion_config.content == 1) |
Simon Glass | 382bee5 | 2017-08-03 12:22:09 -0600 | [diff] [blame] | 486 | env_set(expansion_config.env_var, expansion_config.env_setting); |
Koen Kooi | ca5f80a | 2010-09-20 10:21:33 -0700 | [diff] [blame] | 487 | |
Tom Rix | 2c15513 | 2009-06-28 12:52:30 -0500 | [diff] [blame] | 488 | twl4030_power_init(); |
Christian Spielberger | 38a77c3 | 2011-08-24 17:17:31 -0500 | [diff] [blame] | 489 | switch (get_board_revision()) { |
Nishanth Menon | af4d896 | 2013-07-15 07:11:30 -0500 | [diff] [blame] | 490 | case REVISION_XM_AB: |
Christian Spielberger | 38a77c3 | 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 | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 497 | |
Bob Feretich | 52d82e4 | 2011-02-24 13:16:44 +0000 | [diff] [blame] | 498 | /* Set GPIO states before they are made outputs */ |
Dirk Behme | f904cdb | 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 | 52d82e4 | 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 | 679f82c | 2015-08-27 19:37:13 +0200 | [diff] [blame] | 509 | omap_die_id_display(); |
Peter Meerwald | 4258aa6 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 510 | |
Peter Meerwald | 2c30c18 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 511 | #ifdef CONFIG_VIDEO_OMAP3 |
Peter Meerwald | 4258aa6 | 2012-02-08 05:24:26 +0000 | [diff] [blame] | 512 | beagle_dvi_pup(); |
Jason Kridner | 3f16ab9 | 2011-04-19 14:01:13 -0500 | [diff] [blame] | 513 | beagle_display_init(); |
| 514 | omap3_dss_enable(); |
Peter Meerwald | 2c30c18 | 2012-07-10 06:07:34 +0000 | [diff] [blame] | 515 | #endif |
Dirk Behme | e6a6a70 | 2009-03-12 19:30:50 +0100 | [diff] [blame] | 516 | |
Ilya Yanok | c642b15 | 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 | 07815eb | 2015-08-27 19:37:12 +0200 | [diff] [blame] | 521 | if (generate_fake_mac) |
| 522 | omap_die_id_usbethaddr(); |
Nishanth Menon | 548a64d | 2014-03-28 11:00:06 -0500 | [diff] [blame] | 523 | |
Derald D. Woods | ebf6e26 | 2018-02-26 17:52:57 -0600 | [diff] [blame] | 524 | #if defined(CONFIG_MTDIDS_DEFAULT) && defined(CONFIG_MTDPARTS_DEFAULT) |
| 525 | if (strlen(CONFIG_MTDIDS_DEFAULT)) |
| 526 | env_set("mtdids", CONFIG_MTDIDS_DEFAULT); |
| 527 | |
| 528 | if (strlen(CONFIG_MTDPARTS_DEFAULT)) |
| 529 | env_set("mtdparts", CONFIG_MTDPARTS_DEFAULT); |
| 530 | #endif |
| 531 | |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 532 | return 0; |
| 533 | } |
| 534 | |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 535 | /* |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 536 | * Routine: set_muxconf_regs |
| 537 | * Description: Setting up the configuration Mux registers specific to the |
| 538 | * hardware. Many pins need to be moved from protect to primary |
| 539 | * mode. |
Tom Rix | 5891151 | 2009-04-01 22:02:20 -0500 | [diff] [blame] | 540 | */ |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 541 | void set_muxconf_regs(void) |
| 542 | { |
| 543 | MUX_BEAGLE(); |
Dirk Behme | f904cdb | 2009-01-27 18:19:12 +0100 | [diff] [blame] | 544 | } |
Steve Sakoman | 0cd3114 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 545 | |
Masahiro Yamada | 4aa2ba3 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 546 | #if defined(CONFIG_MMC) |
Steve Sakoman | 0cd3114 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 547 | int board_mmc_init(bd_t *bis) |
| 548 | { |
Nikita Kiryanov | e3913f5 | 2012-12-03 02:19:47 +0000 | [diff] [blame] | 549 | return omap_mmc_init(0, 0, 0, -1, -1); |
Steve Sakoman | 0cd3114 | 2010-09-19 21:19:48 -0700 | [diff] [blame] | 550 | } |
| 551 | #endif |
Alexander Holler | d90859a | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 552 | |
Masahiro Yamada | 4aa2ba3 | 2017-05-09 20:31:39 +0900 | [diff] [blame] | 553 | #if defined(CONFIG_MMC) |
Paul Kocialkowski | aac5450 | 2014-11-08 20:55:47 +0100 | [diff] [blame] | 554 | void board_mmc_power_init(void) |
| 555 | { |
| 556 | twl4030_power_mmc_init(0); |
| 557 | } |
| 558 | #endif |
| 559 | |
Tom Rini | 8850c5d | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 560 | #if defined(CONFIG_USB_EHCI_HCD) && !defined(CONFIG_SPL_BUILD) |
Alexander Holler | d90859a | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 561 | /* Call usb_stop() before starting the kernel */ |
| 562 | void show_boot_progress(int val) |
| 563 | { |
Simon Glass | 578ac1e | 2011-12-10 11:07:54 +0000 | [diff] [blame] | 564 | if (val == BOOTSTAGE_ID_RUN_OS) |
Alexander Holler | d90859a | 2011-04-19 09:30:35 -0400 | [diff] [blame] | 565 | usb_stop(); |
| 566 | } |
Govindraj.R | 43b6239 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 567 | |
| 568 | static struct omap_usbhs_board_data usbhs_bdata = { |
| 569 | .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, |
| 570 | .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY, |
| 571 | .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED |
| 572 | }; |
| 573 | |
Troy Kisky | 127efc4 | 2013-10-10 15:27:57 -0700 | [diff] [blame] | 574 | int ehci_hcd_init(int index, enum usb_init_type init, |
| 575 | struct ehci_hccr **hccr, struct ehci_hcor **hcor) |
Govindraj.R | 43b6239 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 576 | { |
Mateusz Zalega | 16297cf | 2013-10-04 19:22:26 +0200 | [diff] [blame] | 577 | return omap_ehci_hcd_init(index, &usbhs_bdata, hccr, hcor); |
Govindraj.R | 43b6239 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 578 | } |
| 579 | |
Lucas Stach | 676ae06 | 2012-09-26 00:14:35 +0200 | [diff] [blame] | 580 | int ehci_hcd_stop(int index) |
Govindraj.R | 43b6239 | 2012-02-06 03:55:34 +0000 | [diff] [blame] | 581 | { |
| 582 | return omap_ehci_hcd_stop(); |
| 583 | } |
| 584 | |
Tom Rini | 8850c5d | 2017-05-12 22:33:27 -0400 | [diff] [blame] | 585 | #endif /* CONFIG_USB_EHCI_HCD */ |
Ilya Yanok | c642b15 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 586 | |
Paul Kocialkowski | 95de1e2 | 2015-08-04 17:04:06 +0200 | [diff] [blame] | 587 | #if defined(CONFIG_USB_ETHER) && defined(CONFIG_USB_MUSB_GADGET) |
Ilya Yanok | c642b15 | 2012-11-06 13:48:30 +0000 | [diff] [blame] | 588 | int board_eth_init(bd_t *bis) |
| 589 | { |
| 590 | return usb_eth_initialize(bis); |
| 591 | } |
| 592 | #endif |