p1010rdb.c 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  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_TARGET_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_TARGET_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, (void *)NULL};
  73. /* Clock configuration to access CPLD using IFC(GPCM) */
  74. setbits_be32(&ifc.gregs->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. int 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. if (flash_esel == -1) {
  94. /* very unlikely unless something is messed up */
  95. puts("Error: Could not find TLB for FLASH BASE\n");
  96. flash_esel = 2; /* give our best effort to continue */
  97. } else {
  98. /* invalidate existing TLB entry for flash */
  99. disable_tlb(flash_esel);
  100. }
  101. set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
  102. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  103. 0, flash_esel, BOOKE_PAGESZ_16M, 1);
  104. set_tlb(1, flashbase + 0x1000000,
  105. CONFIG_SYS_FLASH_BASE_PHYS + 0x1000000,
  106. MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  107. 0, flash_esel+1, BOOKE_PAGESZ_16M, 1);
  108. return 0;
  109. }
  110. #ifdef CONFIG_PCI
  111. void pci_init_board(void)
  112. {
  113. fsl_pcie_init_board(0);
  114. }
  115. #endif /* ifdef CONFIG_PCI */
  116. int config_board_mux(int ctrl_type)
  117. {
  118. ccsr_gur_t __iomem *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  119. u8 tmp;
  120. #if defined(CONFIG_TARGET_P1010RDB_PA)
  121. struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
  122. switch (ctrl_type) {
  123. case MUX_TYPE_IFC:
  124. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  125. tmp = 0xf0;
  126. i2c_write(I2C_PCA9557_ADDR1, 3, 1, &tmp, 1);
  127. tmp = 0x01;
  128. i2c_write(I2C_PCA9557_ADDR1, 1, 1, &tmp, 1);
  129. sd_ifc_mux = MUX_TYPE_IFC;
  130. clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
  131. break;
  132. case MUX_TYPE_SDHC:
  133. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  134. tmp = 0xf0;
  135. i2c_write(I2C_PCA9557_ADDR1, 3, 1, &tmp, 1);
  136. tmp = 0x05;
  137. i2c_write(I2C_PCA9557_ADDR1, 1, 1, &tmp, 1);
  138. sd_ifc_mux = MUX_TYPE_SDHC;
  139. clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
  140. PMUXCR1_SDHC_ENABLE);
  141. break;
  142. case MUX_TYPE_SPIFLASH:
  143. out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_FLASH);
  144. break;
  145. case MUX_TYPE_TDM:
  146. out_8(&cpld_data->tdm_can_sel, MUX_CPLD_TDM);
  147. out_8(&cpld_data->spi_cs0_sel, MUX_CPLD_SPICS0_SLIC);
  148. break;
  149. case MUX_TYPE_CAN:
  150. out_8(&cpld_data->tdm_can_sel, MUX_CPLD_CAN_UART);
  151. break;
  152. default:
  153. break;
  154. }
  155. #elif defined(CONFIG_TARGET_P1010RDB_PB)
  156. uint orig_bus = i2c_get_bus_num();
  157. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  158. switch (ctrl_type) {
  159. case MUX_TYPE_IFC:
  160. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  161. clrbits_8(&tmp, 0x04);
  162. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  163. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  164. clrbits_8(&tmp, 0x04);
  165. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  166. sd_ifc_mux = MUX_TYPE_IFC;
  167. clrbits_be32(&gur->pmuxcr, PMUXCR1_IFC_MASK);
  168. break;
  169. case MUX_TYPE_SDHC:
  170. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  171. setbits_8(&tmp, 0x04);
  172. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  173. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  174. clrbits_8(&tmp, 0x04);
  175. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  176. sd_ifc_mux = MUX_TYPE_SDHC;
  177. clrsetbits_be32(&gur->pmuxcr, PMUXCR1_SDHC_MASK,
  178. PMUXCR1_SDHC_ENABLE);
  179. break;
  180. case MUX_TYPE_SPIFLASH:
  181. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  182. clrbits_8(&tmp, 0x80);
  183. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  184. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  185. clrbits_8(&tmp, 0x80);
  186. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  187. break;
  188. case MUX_TYPE_TDM:
  189. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  190. setbits_8(&tmp, 0x82);
  191. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  192. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  193. clrbits_8(&tmp, 0x82);
  194. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  195. break;
  196. case MUX_TYPE_CAN:
  197. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  198. clrbits_8(&tmp, 0x02);
  199. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  200. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  201. clrbits_8(&tmp, 0x02);
  202. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  203. break;
  204. case MUX_TYPE_CS0_NOR:
  205. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  206. clrbits_8(&tmp, 0x08);
  207. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  208. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  209. clrbits_8(&tmp, 0x08);
  210. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  211. break;
  212. case MUX_TYPE_CS0_NAND:
  213. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &tmp, 1);
  214. setbits_8(&tmp, 0x08);
  215. i2c_write(I2C_PCA9557_ADDR2, 1, 1, &tmp, 1);
  216. i2c_read(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  217. clrbits_8(&tmp, 0x08);
  218. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &tmp, 1);
  219. break;
  220. default:
  221. break;
  222. }
  223. i2c_set_bus_num(orig_bus);
  224. #endif
  225. return 0;
  226. }
  227. #ifdef CONFIG_TARGET_P1010RDB_PB
  228. int i2c_pca9557_read(int type)
  229. {
  230. u8 val;
  231. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  232. i2c_read(I2C_PCA9557_ADDR2, 0, 1, &val, 1);
  233. switch (type) {
  234. case I2C_READ_BANK:
  235. val = (val & 0x10) >> 4;
  236. break;
  237. case I2C_READ_PCB_VER:
  238. val = ((val & 0x60) >> 5) + 1;
  239. break;
  240. default:
  241. break;
  242. }
  243. return val;
  244. }
  245. #endif
  246. int checkboard(void)
  247. {
  248. struct cpu_type *cpu;
  249. struct cpld_data *cpld_data = (void *)(CONFIG_SYS_CPLD_BASE);
  250. u8 val;
  251. cpu = gd->arch.cpu;
  252. #if defined(CONFIG_TARGET_P1010RDB_PA)
  253. printf("Board: %sRDB-PA, ", cpu->name);
  254. #elif defined(CONFIG_TARGET_P1010RDB_PB)
  255. printf("Board: %sRDB-PB, ", cpu->name);
  256. i2c_set_bus_num(I2C_PCA9557_BUS_NUM);
  257. i2c_init(CONFIG_SYS_FSL_I2C_SPEED, CONFIG_SYS_FSL_I2C_SLAVE);
  258. val = 0x0; /* no polarity inversion */
  259. i2c_write(I2C_PCA9557_ADDR2, 2, 1, &val, 1);
  260. #endif
  261. #ifdef CONFIG_SDCARD
  262. /* switch to IFC to read info from CPLD */
  263. config_board_mux(MUX_TYPE_IFC);
  264. #endif
  265. #if defined(CONFIG_TARGET_P1010RDB_PA)
  266. val = (in_8(&cpld_data->pcba_ver) & 0xf);
  267. printf("PCB: v%x.0\n", val);
  268. #elif defined(CONFIG_TARGET_P1010RDB_PB)
  269. val = in_8(&cpld_data->cpld_ver);
  270. printf("CPLD: v%x.%x, ", val >> 4, val & 0xf);
  271. printf("PCB: v%x.0, ", i2c_pca9557_read(I2C_READ_PCB_VER));
  272. val = in_8(&cpld_data->rom_loc) & 0xf;
  273. puts("Boot from: ");
  274. switch (val) {
  275. case 0xf:
  276. config_board_mux(MUX_TYPE_CS0_NOR);
  277. printf("NOR vBank%d\n", i2c_pca9557_read(I2C_READ_BANK));
  278. break;
  279. case 0xe:
  280. puts("SDHC\n");
  281. val = 0x60; /* set pca9557 pin input/output */
  282. i2c_write(I2C_PCA9557_ADDR2, 3, 1, &val, 1);
  283. break;
  284. case 0x5:
  285. config_board_mux(MUX_TYPE_IFC);
  286. config_board_mux(MUX_TYPE_CS0_NAND);
  287. puts("NAND\n");
  288. break;
  289. case 0x6:
  290. config_board_mux(MUX_TYPE_IFC);
  291. puts("SPI\n");
  292. break;
  293. default:
  294. puts("unknown\n");
  295. break;
  296. }
  297. #endif
  298. return 0;
  299. }
  300. int board_eth_init(bd_t *bis)
  301. {
  302. #ifdef CONFIG_TSEC_ENET
  303. struct fsl_pq_mdio_info mdio_info;
  304. struct tsec_info_struct tsec_info[4];
  305. struct cpu_type *cpu;
  306. int num = 0;
  307. cpu = gd->arch.cpu;
  308. #ifdef CONFIG_TSEC1
  309. SET_STD_TSEC_INFO(tsec_info[num], 1);
  310. num++;
  311. #endif
  312. #ifdef CONFIG_TSEC2
  313. SET_STD_TSEC_INFO(tsec_info[num], 2);
  314. num++;
  315. #endif
  316. #ifdef CONFIG_TSEC3
  317. /* P1014 and it's derivatives do not support eTSEC3 */
  318. if (cpu->soc_ver != SVR_P1014) {
  319. SET_STD_TSEC_INFO(tsec_info[num], 3);
  320. num++;
  321. }
  322. #endif
  323. if (!num) {
  324. printf("No TSECs initialized\n");
  325. return 0;
  326. }
  327. mdio_info.regs = (struct tsec_mii_mng *)CONFIG_SYS_MDIO_BASE_ADDR;
  328. mdio_info.name = DEFAULT_MII_NAME;
  329. fsl_pq_mdio_init(bis, &mdio_info);
  330. tsec_eth_init(bis, tsec_info, num);
  331. #endif
  332. return pci_eth_init(bis);
  333. }
  334. #if defined(CONFIG_OF_BOARD_SETUP)
  335. void fdt_del_flexcan(void *blob)
  336. {
  337. int nodeoff = 0;
  338. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  339. "fsl,p1010-flexcan")) >= 0) {
  340. fdt_del_node(blob, nodeoff);
  341. }
  342. }
  343. void fdt_del_spi_flash(void *blob)
  344. {
  345. int nodeoff = 0;
  346. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  347. "spansion,s25sl12801")) >= 0) {
  348. fdt_del_node(blob, nodeoff);
  349. }
  350. }
  351. void fdt_del_spi_slic(void *blob)
  352. {
  353. int nodeoff = 0;
  354. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  355. "zarlink,le88266")) >= 0) {
  356. fdt_del_node(blob, nodeoff);
  357. }
  358. }
  359. void fdt_del_tdm(void *blob)
  360. {
  361. int nodeoff = 0;
  362. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  363. "fsl,starlite-tdm")) >= 0) {
  364. fdt_del_node(blob, nodeoff);
  365. }
  366. }
  367. void fdt_del_sdhc(void *blob)
  368. {
  369. int nodeoff = 0;
  370. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  371. "fsl,esdhc")) >= 0) {
  372. fdt_del_node(blob, nodeoff);
  373. }
  374. }
  375. void fdt_del_ifc(void *blob)
  376. {
  377. int nodeoff = 0;
  378. while ((nodeoff = fdt_node_offset_by_compatible(blob, 0,
  379. "fsl,ifc")) >= 0) {
  380. fdt_del_node(blob, nodeoff);
  381. }
  382. }
  383. void fdt_disable_uart1(void *blob)
  384. {
  385. int nodeoff;
  386. nodeoff = fdt_node_offset_by_compat_reg(blob, "fsl,ns16550",
  387. CONFIG_SYS_NS16550_COM2);
  388. if (nodeoff > 0) {
  389. fdt_status_disabled(blob, nodeoff);
  390. } else {
  391. printf("WARNING unable to set status for fsl,ns16550 "
  392. "uart1: %s\n", fdt_strerror(nodeoff));
  393. }
  394. }
  395. int ft_board_setup(void *blob, bd_t *bd)
  396. {
  397. phys_addr_t base;
  398. phys_size_t size;
  399. struct cpu_type *cpu;
  400. cpu = gd->arch.cpu;
  401. ft_cpu_setup(blob, bd);
  402. base = getenv_bootm_low();
  403. size = getenv_bootm_size();
  404. #if defined(CONFIG_PCI)
  405. FT_FSL_PCI_SETUP;
  406. #endif
  407. fdt_fixup_memory(blob, (u64)base, (u64)size);
  408. #if defined(CONFIG_HAS_FSL_DR_USB)
  409. fsl_fdt_fixup_dr_usb(blob, bd);
  410. #endif
  411. /* P1014 and it's derivatives don't support CAN and eTSEC3 */
  412. if (cpu->soc_ver == SVR_P1014) {
  413. fdt_del_flexcan(blob);
  414. fdt_del_node_and_alias(blob, "ethernet2");
  415. }
  416. /* Delete IFC node as IFC pins are multiplexing with SDHC */
  417. if (sd_ifc_mux != MUX_TYPE_IFC)
  418. fdt_del_ifc(blob);
  419. else
  420. fdt_del_sdhc(blob);
  421. if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "can")) {
  422. fdt_del_tdm(blob);
  423. fdt_del_spi_slic(blob);
  424. } else if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "tdm")) {
  425. fdt_del_flexcan(blob);
  426. fdt_del_spi_flash(blob);
  427. fdt_disable_uart1(blob);
  428. } else {
  429. /*
  430. * If we don't set fsl_p1010mux:tdm_can to "can" or "tdm"
  431. * explicitly, defaultly spi_cs_sel to spi-flash instead of
  432. * to tdm/slic.
  433. */
  434. fdt_del_tdm(blob);
  435. fdt_del_flexcan(blob);
  436. fdt_disable_uart1(blob);
  437. }
  438. return 0;
  439. }
  440. #endif
  441. #ifdef CONFIG_SDCARD
  442. int board_mmc_init(bd_t *bis)
  443. {
  444. config_board_mux(MUX_TYPE_SDHC);
  445. return -1;
  446. }
  447. #else
  448. void board_reset(void)
  449. {
  450. /* mux to IFC to enable CPLD for reset */
  451. if (sd_ifc_mux != MUX_TYPE_IFC)
  452. config_board_mux(MUX_TYPE_IFC);
  453. }
  454. #endif
  455. int misc_init_r(void)
  456. {
  457. ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
  458. if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "can")) {
  459. clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN1_TDM |
  460. MPC85xx_PMUXCR_CAN1_UART |
  461. MPC85xx_PMUXCR_CAN2_TDM |
  462. MPC85xx_PMUXCR_CAN2_UART);
  463. config_board_mux(MUX_TYPE_CAN);
  464. } else if (hwconfig_subarg_cmp("fsl_p1010mux", "tdm_can", "tdm")) {
  465. clrbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN2_UART |
  466. MPC85xx_PMUXCR_CAN1_UART);
  467. setbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_CAN2_TDM |
  468. MPC85xx_PMUXCR_CAN1_TDM);
  469. clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_GPIO);
  470. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_TDM);
  471. config_board_mux(MUX_TYPE_TDM);
  472. } else {
  473. /* defaultly spi_cs_sel to flash */
  474. config_board_mux(MUX_TYPE_SPIFLASH);
  475. }
  476. if (hwconfig("esdhc"))
  477. config_board_mux(MUX_TYPE_SDHC);
  478. else if (hwconfig("ifc"))
  479. config_board_mux(MUX_TYPE_IFC);
  480. #ifdef CONFIG_TARGET_P1010RDB_PB
  481. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_GPIO01_DRVVBUS);
  482. #endif
  483. return 0;
  484. }
  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. );