.. | .. |
---|
63 | 63 | #define PMU_PWR_DWN_ST (0x108) |
---|
64 | 64 | #define PMU_PWR_GATE_SFTCON (0x110) |
---|
65 | 65 | |
---|
| 66 | +#define PMU_BUS_IDLE_NPU BIT(18) |
---|
| 67 | +#define PMU_BUS_IDLE_VEPU BIT(9) |
---|
| 68 | + |
---|
66 | 69 | #define CRU_BASE 0xFF490000 |
---|
67 | 70 | #define CRU_CLKSEL_CON02 0x108 |
---|
68 | 71 | #define CRU_CLKSEL_CON03 0x10c |
---|
.. | .. |
---|
548 | 551 | * CONFIG_DM_RAMDISK: for ramboot that without SPL. |
---|
549 | 552 | */ |
---|
550 | 553 | #if defined(CONFIG_SPL_BUILD) || defined(CONFIG_DM_RAMDISK) |
---|
| 554 | + u32 pd_st, idle_st; |
---|
551 | 555 | int delay; |
---|
552 | 556 | |
---|
553 | 557 | /* |
---|
.. | .. |
---|
624 | 628 | do { |
---|
625 | 629 | udelay(1); |
---|
626 | 630 | delay--; |
---|
627 | | - if (delay == 0) { |
---|
628 | | - printf("Fail to set domain."); |
---|
629 | | - hang(); |
---|
630 | | - } |
---|
631 | | - } while (readl(PMU_BASE_ADDR + PMU_PWR_DWN_ST)); |
---|
| 631 | + } while (delay && readl(PMU_BASE_ADDR + PMU_PWR_DWN_ST)); |
---|
632 | 632 | |
---|
633 | 633 | /* release all idle request */ |
---|
634 | 634 | writel(0xffff0000, PMU_BASE_ADDR + PMU_BUS_IDLE_SFTCON(0)); |
---|
.. | .. |
---|
639 | 639 | do { |
---|
640 | 640 | udelay(1); |
---|
641 | 641 | delay--; |
---|
642 | | - if (delay == 0) { |
---|
643 | | - printf("Fail to get ack on domain.\n"); |
---|
644 | | - hang(); |
---|
645 | | - } |
---|
646 | | - } while (readl(PMU_BASE_ADDR + PMU_BUS_IDLE_ACK)); |
---|
| 642 | + } while (delay && readl(PMU_BASE_ADDR + PMU_BUS_IDLE_ACK)); |
---|
647 | 643 | |
---|
648 | 644 | delay = 1000; |
---|
649 | 645 | /* wait idle status */ |
---|
650 | 646 | do { |
---|
651 | 647 | udelay(1); |
---|
652 | 648 | delay--; |
---|
653 | | - if (delay == 0) { |
---|
654 | | - printf("Fail to set idle on domain.\n"); |
---|
655 | | - hang(); |
---|
656 | | - } |
---|
657 | | - } while (readl(PMU_BASE_ADDR + PMU_BUS_IDLE_ST)); |
---|
| 649 | + } while (delay && readl(PMU_BASE_ADDR + PMU_BUS_IDLE_ST)); |
---|
| 650 | + |
---|
| 651 | + pd_st = readl(PMU_BASE_ADDR + PMU_PWR_DWN_ST); |
---|
| 652 | + idle_st = readl(PMU_BASE_ADDR + PMU_BUS_IDLE_ST); |
---|
| 653 | + |
---|
| 654 | + if (pd_st || idle_st) { |
---|
| 655 | + printf("PMU_PWR_DOWN_ST: 0x%08x\n", pd_st); |
---|
| 656 | + printf("PMU_BUS_IDLE_ST: 0x%08x\n", idle_st); |
---|
| 657 | + |
---|
| 658 | + if (idle_st & PMU_BUS_IDLE_NPU) |
---|
| 659 | + printf("Failed to enable PD_NPU, please check VDD_NPU is supplied\n"); |
---|
| 660 | + |
---|
| 661 | + if (idle_st & PMU_BUS_IDLE_VEPU) |
---|
| 662 | + printf("Failed to enable PD_VEPU, please check VDD_VEPU is supplied\n"); |
---|
| 663 | + |
---|
| 664 | + hang(); |
---|
| 665 | + } |
---|
658 | 666 | |
---|
659 | 667 | writel(0x303, USB_HOST_PRIORITY_REG); |
---|
660 | 668 | writel(0x303, USB_OTG_PRIORITY_REG); |
---|