p1010rdb.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  1. /*
  2. * Copyright 2010-2011 Freescale Semiconductor, Inc.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. #include <common.h>
  7. #include <asm/processor.h>
  8. #include <asm/mmu.h>
  9. #include <asm/cache.h>
  10. #include <asm/immap_85xx.h>
  11. #include <asm/io.h>
  12. #include <miiphy.h>
  13. #include <libfdt.h>
  14. #include <fdt_support.h>
  15. #include <fsl_mdio.h>
  16. #include <tsec.h>
  17. #include <mmc.h>
  18. #include <netdev.h>
  19. #include <pci.h>
  20. #include <asm/fsl_serdes.h>
  21. #include <fsl_ifc.h>
  22. #include <asm/fsl_pci.h>
  23. #include <hwconfig.h>
  24. #include <i2c.h>
  25. DECLARE_GLOBAL_DATA_PTR;
  26. #define GPIO4_PCIE_RESET_SET 0x08000000
  27. #define MUX_CPLD_CAN_UART 0x00
  28. #define MUX_CPLD_TDM 0x01
  29. #define MUX_CPLD_SPICS0_FLASH 0x00
  30. #define MUX_CPLD_SPICS0_SLIC 0x02
  31. #define PMUXCR1_IFC_MASK 0x00ffff00
  32. #define PMUXCR1_SDHC_MASK 0x00fff000
  33. #define PMUXCR1_SDHC_ENABLE 0x00555000
  34. enum {
  35. MUX_TYPE_IFC,
  36. MUX_TYPE_SDHC,
  37. MUX_TYPE_SPIFLASH,
  38. MUX_TYPE_TDM,
  39. MUX_TYPE_CAN,
  40. MUX_TYPE_CS0_NOR,
  41. MUX_TYPE_CS0_NAND,
  42. };
  43. enum {
  44. I2C_READ_BANK,
  45. I2C_READ_PCB_VER,
  46. };
  47. static uint sd_ifc_mux;
  48. struct cpld_data {
  49. u8 cpld_ver; /* cpld revision */
  50. #if defined(CONFIG_P1010RDB_PA)
  51. u8 pcba_ver; /* pcb revision number */
  52. u8 twindie_ddr3;
  53. u8 res1[6];
  54. u8 bank_sel; /* NOR Flash bank */
  55. u8 res2[5];
  56. u8 usb2_sel;
  57. u8 res3[1];
  58. u8 porsw_sel;
  59. u8 tdm_can_sel;
  60. u8 spi_cs0_sel; /* SPI CS0 SLIC/SPI Flash */
  61. u8 por0; /* POR Options */
  62. u8 por1; /* POR Options */
  63. u8 por2; /* POR Options */
  64. u8 por3; /* POR Options */
  65. #elif defined(CONFIG_P1010RDB_PB)
  66. u8 rom_loc;
  67. #endif
  68. };
  69. int board_early_init_f(void)
  70. {
  71. ccsr_gpio_t *pgpio = (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR);
  72. struct fsl_ifc *ifc = (void *)CONFIG_SYS_IFC_ADDR;
  73. /* Clock configuration to access CPLD using IFC(GPCM) */
  74. setbits_be32(&ifc->ifc_gcr, 1 << IFC_GCR_TBCTL_TRN_TIME_SHIFT);
  75. /*
  76. * Reset PCIe slots via GPIO4
  77. */
  78. setbits_be32(&pgpio->gpdir, GPIO4_PCIE_RESET_SET);
  79. setbits_be32(&pgpio->gpdat, GPIO4_PCIE_RESET_SET);
  80. return 0;
  81. }
  82. int board_early_init_r(void)
  83. {
  84. const unsigned int flashbase = CONFIG_SYS_FLASH_BASE;
  85. const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
  86. /*
  87. * Remap Boot flash region to caching-inhibited
  88. * so that flash can be erased properly.
  89. */
  90. /* Flush d-cache and invalidate i-cache of any FLASH data */
  91. flush_dcache();
  92. invalidate_icache();
  93. /* invalidate existing TLB entry for flash */
  94. disable_tlb(flash_esel);
  95. set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
  96. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  97. 0, flash_esel, BOOKE_PAGESZ_16M, 1);
  98. set_tlb(1, flashbase + 0x1000000,
  99. CONFIG_SYS_FLASH_BASE_PHYS + 0x1000000,
  100. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  101. 0, flash_esel+1, BOOKE_PAGESZ_16M, 1);
  102. return 0;
  103. }
  104. #ifdef CONFIG_PCI
  105. void pci_init_board(void)
  106. {
  107. fsl_pcie_init_board(0);
  108. }
  109. #endif /* ifdef CONFIG_PCI */
  110. int config_board_mux(int ctrl_type)
  111. {
  112. ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  113. u8 tmp;
  114. #if defined(CONFIG_P1010RDB_PA)
  115. struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
  116. switch (ctrl_type) {
  117. case MUX_TYPE_IFC:
  118. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  119. tmp = 0xf0;
  120. i2c_write(I2C_PCA9557_ADDR1, 3, 1, &tmp, 1);
  121. tmp = 0x01;
  122. i2c_write(I2C_PCA9557_ADDR1, 1, 1, &tmp, 1);
  123. sd_ifc_mux = MUX_TYPE_IFC;
  124. clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
  125. break;
  126. case MUX_TYPE_SDHC:
  127. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  128. tmp = 0xf0;
  129. i2c_write(I2C_PCA9557_ADDR1, 3, 1, &tmp, 1);
  130. tmp = 0x05;
  131. i2c_write(I2C_PCA9557_ADDR1, 1, 1, &tmp, 1);
  132. sd_ifc_mux = MUX_TYPE_SDHC;
  133. clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
  134. PMUXCR1_SDHC_ENABLE);
  135. break;
  136. case MUX_TYPE_SPIFLASH:
  137. out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_FLASH);
  138. break;
  139. case MUX_TYPE_TDM:
  140. out_8(&cpld_data->tdm_can_sel, MUX_CPLD_TDM);
  141. out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_SLIC);
  142. break;
  143. case MUX_TYPE_CAN:
  144. out_8(&cpld_data->tdm_can_sel, MUX_CPLD_CAN_UART);
  145. break;
  146. default:
  147. break;
  148. }
  149. #elif defined(CONFIG_P1010RDB_PB)
  150. uint orig_bus = i2c_get_bus_num();
  151. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  152. switch (ctrl_type) {
  153. case MUX_TYPE_IFC:
  154. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  155. clrbits_8(&tmp, 0x04);
  156. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  157. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  158. clrbits_8(&tmp, 0x04);
  159. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  160. sd_ifc_mux = MUX_TYPE_IFC;
  161. clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
  162. break;
  163. case MUX_TYPE_SDHC:
  164. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  165. setbits_8(&tmp, 0x04);
  166. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  167. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  168. clrbits_8(&tmp, 0x04);
  169. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  170. sd_ifc_mux = MUX_TYPE_SDHC;
  171. clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
  172. PMUXCR1_SDHC_ENABLE);
  173. break;
  174. case MUX_TYPE_SPIFLASH:
  175. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  176. clrbits_8(&tmp, 0x80);
  177. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  178. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  179. clrbits_8(&tmp, 0x80);
  180. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  181. break;
  182. case MUX_TYPE_TDM:
  183. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  184. setbits_8(&tmp, 0x82);
  185. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  186. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  187. clrbits_8(&tmp, 0x82);
  188. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  189. break;
  190. case MUX_TYPE_CAN:
  191. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  192. clrbits_8(&tmp, 0x02);
  193. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  194. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  195. clrbits_8(&tmp, 0x02);
  196. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  197. break;
  198. case MUX_TYPE_CS0_NOR:
  199. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  200. clrbits_8(&tmp, 0x08);
  201. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  202. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  203. clrbits_8(&tmp, 0x08);
  204. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  205. break;
  206. case MUX_TYPE_CS0_NAND:
  207. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  208. setbits_8(&tmp, 0x08);
  209. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  210. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  211. clrbits_8(&tmp, 0x08);
  212. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  213. break;
  214. default:
  215. break;
  216. }
  217. i2c_set_bus_num(orig_bus);
  218. #endif
  219. return 0;
  220. }
  221. #ifdef CONFIG_P1010RDB_PB
  222. int i2c_pca9557_read(int type)
  223. {
  224. u8 val;
  225. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  226. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &val, 1);
  227. switch (type) {
  228. case I2C_READ_BANK:
  229. val = (val & 0x10) >> 4;
  230. break;
  231. case I2C_READ_PCB_VER:
  232. val = ((val & 0x60) >> 5) + 1;
  233. break;
  234. default:
  235. break;
  236. }
  237. return val;
  238. }
  239. #endif
  240. int checkboard(void)
  241. {
  242. struct cpu_type *cpu;
  243. struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
  244. u8 val;
  245. cpu = gd->arch.cpu;
  246. #if defined(CONFIG_P1010RDB_PA)
  247. printf("Board: %sRDB-PA, ", cpu->name);
  248. #elif defined(CONFIG_P1010RDB_PB)
  249. printf("Board: %sRDB-PB, ", cpu->name);
  250. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  251. i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE);
  252. val = 0x0; /* no polarity inversion */
  253. i2c_write(I2C_PCA9557_ADDR2, 2, 1, &val, 1);
  254. #endif
  255. #ifdef CONFIG_SDCARD
  256. /* switch to IFC to read info from CPLD */
  257. config_board_mux(MUX_TYPE_IFC);
  258. #endif
  259. #if defined(CONFIG_P1010RDB_PA)
  260. val = (in_8(&cpld_data->pcba_ver) & 0xf);
  261. printf("PCB: v%x.0\n", val);
  262. #elif defined(CONFIG_P1010RDB_PB)
  263. val = in_8(&cpld_data->cpld_ver);
  264. printf("CPLD: v%x.%x, ", val >> 4, val & 0xf);
  265. printf("PCB: v%x.0, ", i2c_pca9557_read(I2C_READ_PCB_VER));
  266. val = in_8(&cpld_data->rom_loc) & 0xf;
  267. puts("Boot from: ");
  268. switch (val) {
  269. case 0xf:
  270. config_board_mux(MUX_TYPE_CS0_NOR);
  271. printf("NOR vBank%d\n", i2c_pca9557_read(I2C_READ_BANK));
  272. break;
  273. case 0xe:
  274. puts("SDHC\n");
  275. val = 0x60; /* set pca9557 pin input/output */
  276. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &val, 1);
  277. break;
  278. case 0x5:
  279. config_board_mux(MUX_TYPE_IFC);
  280. config_board_mux(MUX_TYPE_CS0_NAND);
  281. puts("NAND\n");
  282. break;
  283. case 0x6:
  284. config_board_mux(MUX_TYPE_IFC);
  285. puts("SPI\n");
  286. break;
  287. default:
  288. puts("unknown\n");
  289. break;
  290. }
  291. #endif
  292. return 0;
  293. }
  294. #ifdef CONFIG_TSEC_ENET
  295. int board_eth_init(bd_t *bis)
  296. {
  297. struct fsl_pq_mdio_info mdio_info;
  298. struct tsec_info_struct tsec_info[4];
  299. struct cpu_type *cpu;
  300. int num = 0;
  301. cpu = gd->arch.cpu;
  302. #ifdef CONFIG_TSEC1
  303. SET_STD_TSEC_INFO(tsec_info[num], 1);
  304. num++;
  305. #endif
  306. #ifdef CONFIG_TSEC2
  307. SET_STD_TSEC_INFO(tsec_info[num], 2);
  308. num++;
  309. #endif
  310. #ifdef CONFIG_TSEC3
  311. /* P1014 and it's derivatives do not support eTSEC3 */
  312. if (cpu->soc_ver != SVR_P1014) {
  313. SET_STD_TSEC_INFO(tsec_info[num], 3);
  314. num++;
  315. }
  316. #endif
  317. if (!num) {
  318. printf("No TSECs initialized\n");
  319. return 0;
  320. }
  321. mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
  322. mdio_info.name = DEFAULT_MII_NAME;
  323. fsl_pq_mdio_init(bis, &mdio_info);
  324. tsec_eth_init(bis, tsec_info, num);
  325. return pci_eth_init(bis);
  326. }
  327. #endif
  328. #if defined(CONFIG_OF_BOARD_SETUP)
  329. void fdt_del_flexcan(void *blob)
  330. {
  331. int nodeoff = 0;
  332. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  333. "fsl,p1010-flexcan")) >= 0) {
  334. fdt_del_node(blob, nodeoff);
  335. }
  336. }
  337. void fdt_del_spi_flash(void *blob)
  338. {
  339. int nodeoff = 0;
  340. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  341. "spansion,s25sl12801")) >= 0) {
  342. fdt_del_node(blob, nodeoff);
  343. }
  344. }
  345. void fdt_del_spi_slic(void *blob)
  346. {
  347. int nodeoff = 0;
  348. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  349. "zarlink,le88266")) >= 0) {
  350. fdt_del_node(blob, nodeoff);
  351. }
  352. }
  353. void fdt_del_tdm(void *blob)
  354. {
  355. int nodeoff = 0;
  356. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  357. "fsl,starlite-tdm")) >= 0) {
  358. fdt_del_node(blob, nodeoff);
  359. }
  360. }
  361. void fdt_del_sdhc(void *blob)
  362. {
  363. int nodeoff = 0;
  364. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  365. "fsl,esdhc")) >= 0) {
  366. fdt_del_node(blob, nodeoff);
  367. }
  368. }
  369. void fdt_del_ifc(void *blob)
  370. {
  371. int nodeoff = 0;
  372. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  373. "fsl,ifc")) >= 0) {
  374. fdt_del_node(blob, nodeoff);
  375. }
  376. }
  377. void fdt_disable_uart1(void *blob)
  378. {
  379. int nodeoff;
  380. nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,ns16550",
  381. CONFIG_SYS_NS16550_COM2);
  382. if (nodeoff > 0) {
  383. fdt_status_disabled(blob, nodeoff);
  384. } else {
  385. printf("WARNING unable to set status for fsl,ns16550 "
  386. "uart1: %s\n", fdt_strerror(nodeoff));
  387. }
  388. }
  389. void ft_board_setup(void *blob, bd_t *bd)
  390. {
  391. phys_addr_t base;
  392. phys_size_t size;
  393. struct cpu_type *cpu;
  394. cpu = gd->arch.cpu;
  395. ft_cpu_setup(blob, bd);
  396. base = getenv_bootm_low();
  397. size = getenv_bootm_size();
  398. #if defined(CONFIG_PCI)
  399. FT_FSL_PCI_SETUP;
  400. #endif
  401. fdt_fixup_memory(blob, (u64)base, (u64)size);
  402. #if defined(CONFIG_HAS_FSL_DR_USB)
  403. fdt_fixup_dr_usb(blob, bd);
  404. #endif
  405. /* P1014 and it's derivatives don't support CAN and eTSEC3 */
  406. if (cpu->soc_ver == SVR_P1014) {
  407. fdt_del_flexcan(blob);
  408. fdt_del_node_and_alias(blob, "ethernet2");
  409. }
  410. /* Delete IFC node as IFC pins are multiplexing with SDHC */
  411. if (sd_ifc_mux != MUX_TYPE_IFC)
  412. fdt_del_ifc(blob);
  413. else
  414. fdt_del_sdhc(blob);
  415. if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "can")) {
  416. fdt_del_tdm(blob);
  417. fdt_del_spi_slic(blob);
  418. } else if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "tdm")) {
  419. fdt_del_flexcan(blob);
  420. fdt_del_spi_flash(blob);
  421. fdt_disable_uart1(blob);
  422. } else {
  423. /*
  424. * If we don't set fsl_p1010mux:tdm_can to "can" or "tdm"
  425. * explicitly, defaultly spi_cs_sel to spi-flash instead of
  426. * to tdm/slic.
  427. */
  428. fdt_del_tdm(blob);
  429. fdt_del_flexcan(blob);
  430. fdt_disable_uart1(blob);
  431. }
  432. }
  433. #endif
  434. #ifdef CONFIG_SDCARD
  435. int board_mmc_init(bd_t *bis)
  436. {
  437. config_board_mux(MUX_TYPE_SDHC);
  438. return -1;
  439. }
  440. #else
  441. void board_reset(void)
  442. {
  443. /* mux to IFC to enable CPLD for reset */
  444. if (sd_ifc_mux != MUX_TYPE_IFC)
  445. config_board_mux(MUX_TYPE_IFC);
  446. }
  447. #endif
  448. int misc_init_r(void)
  449. {
  450. ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  451. if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "can")) {
  452. clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN1_TDM |
  453. MPC85xx_PMUXCR_CAN1_UART |
  454. MPC85xx_PMUXCR_CAN2_TDM |
  455. MPC85xx_PMUXCR_CAN2_UART);
  456. config_board_mux(MUX_TYPE_CAN);
  457. } else if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "tdm")) {
  458. clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN2_UART |
  459. MPC85xx_PMUXCR_CAN1_UART);
  460. setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN2_TDM |
  461. MPC85xx_PMUXCR_CAN1_TDM);
  462. clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_GPIO);
  463. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_TDM);
  464. config_board_mux(MUX_TYPE_TDM);
  465. } else {
  466. /* defaultly spi_cs_sel to flash */
  467. config_board_mux(MUX_TYPE_SPIFLASH);
  468. }
  469. if (hwconfig("esdhc"))
  470. config_board_mux(MUX_TYPE_SDHC);
  471. else if (hwconfig("ifc"))
  472. config_board_mux(MUX_TYPE_IFC);
  473. #ifdef CONFIG_P1010RDB_PB
  474. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_GPIO01_DRVVBUS);
  475. #endif
  476. return 0;
  477. }
  478. static int pin_mux_cmd(cmd_tbl_t *cmdtp, int flag, int argc,
  479. char * const argv[])
  480. {
  481. if (argc < 2)
  482. return CMD_RET_USAGE;
  483. if (strcmp(argv[1], "ifc") == 0)
  484. config_board_mux(MUX_TYPE_IFC);
  485. else if (strcmp(argv[1], "sdhc") == 0)
  486. config_board_mux(MUX_TYPE_SDHC);
  487. else
  488. return CMD_RET_USAGE;
  489. return 0;
  490. }
  491. U_BOOT_CMD(
  492. mux, 2, 0, pin_mux_cmd,
  493. "configure multiplexing pin for IFC/SDHC bus in runtime",
  494. "bus_type (e.g. mux sdhc)"
  495. );