p1010rdb.c 13 KB

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