Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2014 Freescale Semiconductor, Inc. |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #include <common.h> |
| 7 | #include <command.h> |
Simon Glass | 0af6e2d | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 8 | #include <env.h> |
Simon Glass | 3bbe70c | 2019-12-28 10:44:54 -0700 | [diff] [blame] | 9 | #include <fdt_support.h> |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 10 | #include <i2c.h> |
Simon Glass | a7b5130 | 2019-11-14 12:57:46 -0700 | [diff] [blame] | 11 | #include <init.h> |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 12 | #include <netdev.h> |
| 13 | #include <linux/compiler.h> |
| 14 | #include <asm/mmu.h> |
| 15 | #include <asm/processor.h> |
| 16 | #include <asm/immap_85xx.h> |
| 17 | #include <asm/fsl_law.h> |
| 18 | #include <asm/fsl_serdes.h> |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 19 | #include <asm/fsl_liodn.h> |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 20 | #include <fm_eth.h> |
| 21 | #include "t102xrdb.h" |
York Sun | f9a0363 | 2016-12-28 08:43:34 -0800 | [diff] [blame] | 22 | #ifdef CONFIG_TARGET_T1024RDB |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 23 | #include "cpld.h" |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 24 | #elif defined(CONFIG_TARGET_T1023RDB) |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 25 | #include <i2c.h> |
| 26 | #include <mmc.h> |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 27 | #endif |
tang yuantian | 8dc02f3 | 2014-12-17 15:42:54 +0800 | [diff] [blame] | 28 | #include "../common/sleep.h" |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 29 | |
| 30 | DECLARE_GLOBAL_DATA_PTR; |
| 31 | |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 32 | #ifdef CONFIG_TARGET_T1023RDB |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 33 | enum { |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 34 | GPIO1_SD_SEL = 0x00020000, /* GPIO1_14, 0: eMMC, 1:SD/MMC */ |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 35 | GPIO1_EMMC_SEL, |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 36 | GPIO3_GET_VERSION, /* GPIO3_4/5, 00:RevB, 01: RevC */ |
| 37 | GPIO3_BRD_VER_MASK = 0x0c000000, |
| 38 | GPIO3_OFFSET = 0x2000, |
| 39 | I2C_GET_BANK, |
| 40 | I2C_SET_BANK0, |
| 41 | I2C_SET_BANK4, |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 42 | }; |
| 43 | #endif |
| 44 | |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 45 | int checkboard(void) |
| 46 | { |
| 47 | struct cpu_type *cpu = gd->arch.cpu; |
| 48 | static const char *freq[3] = {"100.00MHZ", "125.00MHz", "156.25MHZ"}; |
Shengzhou Liu | ccc57ef | 2014-12-17 16:51:08 +0800 | [diff] [blame] | 49 | ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); |
| 50 | u32 srds_s1; |
| 51 | |
| 52 | srds_s1 = in_be32(&gur->rcwsr[4]) & FSL_CORENET2_RCWSR4_SRDS1_PRTCL; |
| 53 | srds_s1 >>= FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT; |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 54 | |
| 55 | printf("Board: %sRDB, ", cpu->name); |
York Sun | f9a0363 | 2016-12-28 08:43:34 -0800 | [diff] [blame] | 56 | #if defined(CONFIG_TARGET_T1024RDB) |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 57 | printf("Board rev: 0x%02x CPLD ver: 0x%02x, ", |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 58 | CPLD_READ(hw_ver), CPLD_READ(sw_ver)); |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 59 | #elif defined(CONFIG_TARGET_T1023RDB) |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 60 | printf("Rev%c, ", t1023rdb_ctrl(GPIO3_GET_VERSION) + 'B'); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 61 | #endif |
| 62 | printf("boot from "); |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 63 | |
| 64 | #ifdef CONFIG_SDCARD |
| 65 | puts("SD/MMC\n"); |
| 66 | #elif CONFIG_SPIFLASH |
| 67 | puts("SPI\n"); |
York Sun | f9a0363 | 2016-12-28 08:43:34 -0800 | [diff] [blame] | 68 | #elif defined(CONFIG_TARGET_T1024RDB) |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 69 | u8 reg; |
| 70 | |
| 71 | reg = CPLD_READ(flash_csr); |
| 72 | |
| 73 | if (reg & CPLD_BOOT_SEL) { |
| 74 | puts("NAND\n"); |
| 75 | } else { |
| 76 | reg = ((reg & CPLD_LBMAP_MASK) >> CPLD_LBMAP_SHIFT); |
| 77 | printf("NOR vBank%d\n", reg); |
| 78 | } |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 79 | #elif defined(CONFIG_TARGET_T1023RDB) |
Miquel Raynal | d093536 | 2019-10-03 19:50:03 +0200 | [diff] [blame] | 80 | #ifdef CONFIG_MTD_RAW_NAND |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 81 | puts("NAND\n"); |
| 82 | #else |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 83 | printf("NOR vBank%d\n", t1023rdb_ctrl(I2C_GET_BANK)); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 84 | #endif |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 85 | #endif |
| 86 | |
| 87 | puts("SERDES Reference Clocks:\n"); |
Shengzhou Liu | ccc57ef | 2014-12-17 16:51:08 +0800 | [diff] [blame] | 88 | if (srds_s1 == 0x95) |
| 89 | printf("SD1_CLK1=%s, SD1_CLK2=%s\n", freq[2], freq[0]); |
| 90 | else |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 91 | printf("SD1_CLK1=%s, SD1_CLK2=%s\n", freq[0], freq[1]); |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 92 | |
| 93 | return 0; |
| 94 | } |
| 95 | |
York Sun | f9a0363 | 2016-12-28 08:43:34 -0800 | [diff] [blame] | 96 | #ifdef CONFIG_TARGET_T1024RDB |
Shengzhou Liu | ccc57ef | 2014-12-17 16:51:08 +0800 | [diff] [blame] | 97 | static void board_mux_lane(void) |
| 98 | { |
| 99 | ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); |
| 100 | u32 srds_prtcl_s1; |
| 101 | u8 reg = CPLD_READ(misc_ctl_status); |
| 102 | |
| 103 | srds_prtcl_s1 = in_be32(&gur->rcwsr[4]) & |
| 104 | FSL_CORENET2_RCWSR4_SRDS1_PRTCL; |
| 105 | srds_prtcl_s1 >>= FSL_CORENET2_RCWSR4_SRDS1_PRTCL_SHIFT; |
| 106 | |
| 107 | if (srds_prtcl_s1 == 0x95) { |
| 108 | /* Route Lane B to PCIE */ |
| 109 | CPLD_WRITE(misc_ctl_status, reg & ~CPLD_PCIE_SGMII_MUX); |
| 110 | } else { |
| 111 | /* Route Lane B to SGMII */ |
| 112 | CPLD_WRITE(misc_ctl_status, reg | CPLD_PCIE_SGMII_MUX); |
| 113 | } |
| 114 | CPLD_WRITE(boot_override, CPLD_OVERRIDE_MUX_EN); |
| 115 | } |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 116 | #endif |
Shengzhou Liu | ccc57ef | 2014-12-17 16:51:08 +0800 | [diff] [blame] | 117 | |
tang yuantian | 8dc02f3 | 2014-12-17 15:42:54 +0800 | [diff] [blame] | 118 | int board_early_init_f(void) |
| 119 | { |
| 120 | #if defined(CONFIG_DEEP_SLEEP) |
| 121 | if (is_warm_boot()) |
| 122 | fsl_dp_disable_console(); |
| 123 | #endif |
| 124 | |
| 125 | return 0; |
| 126 | } |
| 127 | |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 128 | int board_early_init_r(void) |
| 129 | { |
| 130 | #ifdef CONFIG_SYS_FLASH_BASE |
| 131 | const unsigned int flashbase = CONFIG_SYS_FLASH_BASE; |
| 132 | int flash_esel = find_tlb_idx((void *)flashbase, 1); |
| 133 | /* |
| 134 | * Remap Boot flash region to caching-inhibited |
| 135 | * so that flash can be erased properly. |
| 136 | */ |
| 137 | |
| 138 | /* Flush d-cache and invalidate i-cache of any FLASH data */ |
| 139 | flush_dcache(); |
| 140 | invalidate_icache(); |
| 141 | if (flash_esel == -1) { |
| 142 | /* very unlikely unless something is messed up */ |
| 143 | puts("Error: Could not find TLB for FLASH BASE\n"); |
| 144 | flash_esel = 2; /* give our best effort to continue */ |
| 145 | } else { |
| 146 | /* invalidate existing TLB entry for flash + promjet */ |
| 147 | disable_tlb(flash_esel); |
| 148 | } |
| 149 | |
| 150 | set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS, |
| 151 | MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G, |
| 152 | 0, flash_esel, BOOKE_PAGESZ_256M, 1); |
| 153 | #endif |
| 154 | |
York Sun | f9a0363 | 2016-12-28 08:43:34 -0800 | [diff] [blame] | 155 | #ifdef CONFIG_TARGET_T1024RDB |
Shengzhou Liu | ccc57ef | 2014-12-17 16:51:08 +0800 | [diff] [blame] | 156 | board_mux_lane(); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 157 | #endif |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 158 | |
| 159 | return 0; |
| 160 | } |
| 161 | |
| 162 | unsigned long get_board_sys_clk(void) |
| 163 | { |
| 164 | return CONFIG_SYS_CLK_FREQ; |
| 165 | } |
| 166 | |
| 167 | unsigned long get_board_ddr_clk(void) |
| 168 | { |
| 169 | return CONFIG_DDR_CLK_FREQ; |
| 170 | } |
| 171 | |
Shengzhou Liu | 52c4853 | 2017-04-10 16:00:08 +0800 | [diff] [blame] | 172 | #ifdef CONFIG_TARGET_T1024RDB |
| 173 | void board_reset(void) |
| 174 | { |
| 175 | CPLD_WRITE(reset_ctl1, CPLD_LBMAP_RESET); |
| 176 | } |
| 177 | #endif |
| 178 | |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 179 | int misc_init_r(void) |
| 180 | { |
| 181 | return 0; |
| 182 | } |
| 183 | |
| 184 | int ft_board_setup(void *blob, bd_t *bd) |
| 185 | { |
| 186 | phys_addr_t base; |
| 187 | phys_size_t size; |
| 188 | |
| 189 | ft_cpu_setup(blob, bd); |
| 190 | |
Simon Glass | da1a134 | 2017-08-03 12:22:15 -0600 | [diff] [blame] | 191 | base = env_get_bootm_low(); |
| 192 | size = env_get_bootm_size(); |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 193 | |
| 194 | fdt_fixup_memory(blob, (u64)base, (u64)size); |
| 195 | |
| 196 | #ifdef CONFIG_PCI |
| 197 | pci_of_setup(blob, bd); |
| 198 | #endif |
| 199 | |
| 200 | fdt_fixup_liodn(blob); |
Sriram Dash | 9fd465c | 2016-09-16 17:12:15 +0530 | [diff] [blame] | 201 | fsl_fdt_fixup_dr_usb(blob, bd); |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 202 | |
| 203 | #ifdef CONFIG_SYS_DPAA_FMAN |
| 204 | fdt_fixup_fman_ethernet(blob); |
| 205 | fdt_fixup_board_enet(blob); |
| 206 | #endif |
| 207 | |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 208 | #ifdef CONFIG_TARGET_T1023RDB |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 209 | if (t1023rdb_ctrl(GPIO3_GET_VERSION) > 0) |
| 210 | fdt_enable_nor(blob); |
| 211 | #endif |
| 212 | |
Shengzhou Liu | 4991240 | 2014-11-24 17:11:56 +0800 | [diff] [blame] | 213 | return 0; |
| 214 | } |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 215 | |
York Sun | 940ee4a | 2016-12-28 08:43:33 -0800 | [diff] [blame] | 216 | #ifdef CONFIG_TARGET_T1023RDB |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 217 | /* Enable NOR flash for RevC */ |
| 218 | static void fdt_enable_nor(void *blob) |
| 219 | { |
| 220 | int nodeoff = fdt_node_offset_by_compatible(blob, 0, "cfi-flash"); |
| 221 | |
| 222 | if (nodeoff >= 0) |
| 223 | fdt_status_okay(blob, nodeoff); |
| 224 | else |
| 225 | printf("WARNING unable to set status for NOR\n"); |
| 226 | } |
| 227 | |
| 228 | int board_mmc_getcd(struct mmc *mmc) |
| 229 | { |
| 230 | ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR); |
| 231 | u32 val = in_be32(&pgpio->gpdat); |
| 232 | |
| 233 | /* GPIO1_14, 0: eMMC, 1: SD/MMC */ |
| 234 | val &= GPIO1_SD_SEL; |
| 235 | |
| 236 | return val ? -1 : 1; |
| 237 | } |
| 238 | |
| 239 | int board_mmc_getwp(struct mmc *mmc) |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 240 | { |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 241 | ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR); |
| 242 | u32 val = in_be32(&pgpio->gpdat); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 243 | |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 244 | val &= GPIO1_SD_SEL; |
| 245 | |
| 246 | return val ? -1 : 0; |
| 247 | } |
| 248 | |
| 249 | static u32 t1023rdb_ctrl(u32 ctrl_type) |
| 250 | { |
| 251 | ccsr_gpio_t __iomem *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR); |
| 252 | ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); |
| 253 | u32 val, orig_bus = i2c_get_bus_num(); |
| 254 | u8 tmp; |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 255 | |
| 256 | switch (ctrl_type) { |
| 257 | case GPIO1_SD_SEL: |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 258 | val = in_be32(&pgpio->gpdat); |
| 259 | val |= GPIO1_SD_SEL; |
| 260 | out_be32(&pgpio->gpdat, val); |
| 261 | setbits_be32(&pgpio->gpdir, GPIO1_SD_SEL); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 262 | break; |
| 263 | case GPIO1_EMMC_SEL: |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 264 | val = in_be32(&pgpio->gpdat); |
| 265 | val &= ~GPIO1_SD_SEL; |
| 266 | out_be32(&pgpio->gpdat, val); |
| 267 | setbits_be32(&pgpio->gpdir, GPIO1_SD_SEL); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 268 | break; |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 269 | case GPIO3_GET_VERSION: |
| 270 | pgpio = (ccsr_gpio_t *)(CONFIG_SYS_MPC85xx_GPIO_ADDR |
| 271 | + GPIO3_OFFSET); |
| 272 | val = in_be32(&pgpio->gpdat); |
| 273 | val = ((val & GPIO3_BRD_VER_MASK) >> 26) & 0x3; |
| 274 | if (val == 0x3) /* GPIO3_4/5 not used on RevB */ |
| 275 | val = 0; |
| 276 | return val; |
| 277 | case I2C_GET_BANK: |
| 278 | i2c_set_bus_num(I2C_PCA6408_BUS_NUM); |
| 279 | i2c_read(I2C_PCA6408_ADDR, 0, 1, &tmp, 1); |
| 280 | tmp &= 0x7; |
| 281 | tmp = ((tmp & 1) << 2) | (tmp & 2) | ((tmp & 4) >> 2); |
| 282 | i2c_set_bus_num(orig_bus); |
| 283 | return tmp; |
| 284 | case I2C_SET_BANK0: |
| 285 | i2c_set_bus_num(I2C_PCA6408_BUS_NUM); |
| 286 | tmp = 0x0; |
| 287 | i2c_write(I2C_PCA6408_ADDR, 1, 1, &tmp, 1); |
| 288 | tmp = 0xf8; |
| 289 | i2c_write(I2C_PCA6408_ADDR, 3, 1, &tmp, 1); |
| 290 | /* asserting HRESET_REQ */ |
| 291 | out_be32(&gur->rstcr, 0x2); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 292 | break; |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 293 | case I2C_SET_BANK4: |
| 294 | i2c_set_bus_num(I2C_PCA6408_BUS_NUM); |
| 295 | tmp = 0x1; |
| 296 | i2c_write(I2C_PCA6408_ADDR, 1, 1, &tmp, 1); |
| 297 | tmp = 0xf8; |
| 298 | i2c_write(I2C_PCA6408_ADDR, 3, 1, &tmp, 1); |
| 299 | out_be32(&gur->rstcr, 0x2); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 300 | break; |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 301 | default: |
| 302 | break; |
| 303 | } |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 304 | return 0; |
| 305 | } |
| 306 | |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 307 | static int switch_cmd(cmd_tbl_t *cmdtp, int flag, int argc, |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 308 | char * const argv[]) |
| 309 | { |
| 310 | if (argc < 2) |
| 311 | return CMD_RET_USAGE; |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 312 | if (!strcmp(argv[1], "bank0")) |
| 313 | t1023rdb_ctrl(I2C_SET_BANK0); |
| 314 | else if (!strcmp(argv[1], "bank4") || !strcmp(argv[1], "altbank")) |
| 315 | t1023rdb_ctrl(I2C_SET_BANK4); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 316 | else if (!strcmp(argv[1], "sd")) |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 317 | t1023rdb_ctrl(GPIO1_SD_SEL); |
| 318 | else if (!strcmp(argv[1], "emmc")) |
| 319 | t1023rdb_ctrl(GPIO1_EMMC_SEL); |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 320 | else |
| 321 | return CMD_RET_USAGE; |
| 322 | return 0; |
| 323 | } |
| 324 | |
| 325 | U_BOOT_CMD( |
Shengzhou Liu | 0a19789 | 2015-06-17 16:37:01 +0800 | [diff] [blame] | 326 | switch, 2, 0, switch_cmd, |
| 327 | "for bank0/bank4/sd/emmc switch control in runtime", |
| 328 | "command (e.g. switch bank4)" |
Shengzhou Liu | 00d7e5b | 2015-03-27 15:48:34 +0800 | [diff] [blame] | 329 | ); |
| 330 | #endif |