/* The bootstrap configuration provides default settings for the pci inbound map (PIM). But the bootstrap config choices are limited and may not be sufficient for a given board. Override weak default pci_master_init()  */
static void wait_for_pci_ready(void)
/* The bootstrap configuration provides default settings for the pci inbound map (PIM). But the bootstrap config choices are limited and may not be sufficient for a given board. Override weak default pci_master_init()  */
static void wait_for_pci_ready(void)
{
	int i;
	char *s = getenv("pcidelay");
	if (s) {
		int ms = simple_strtoul(s, NULL, 10);
		printf("PCI:   Waiting for %d ms\n", ms);
		for (i=0; i<ms; i++)
			udelay(1000);
	}
	if (!(in_be32((void*)GPIO1_IR) & GPIO1_PPC_EREADY)) {
		printf("PCI:   Waiting for EREADY (CTRL-C to skip) ... ");
		while (1) {
			if (ctrlc()) {
				puts("abort\n");
				break;
			}
			if (in_be32((void*)GPIO1_IR) & GPIO1_PPC_EREADY) {
				printf("done\n");
				break;
			}
		}
	}
}