/* Return 0 for adapter mode, non-zero for host (monarch) mode.  */
int is_pci_host(struct pci_controller *hose)
/* Return 0 for adapter mode, non-zero for host (monarch) mode.  */
int is_pci_host(struct pci_controller *hose)
{
	char *s;
	if (!is_monarch()) {
		pci_write_config_word(PCIDEVID_405GP,
				      PCI_SUBSYSTEM_ID,
				      CONFIG_SYS_PCI_SUBSYS_ID_NONMONARCH);
		pci_write_config_word(PCIDEVID_405GP,
				      PCI_CLASS_SUB_CODE,
				      CONFIG_SYS_PCI_CLASSCODE_NONMONARCH);
	}
	s = getenv("pciscan");
	if (s == NULL) {
		if (is_monarch()) {
			wait_for_pci_ready();
			return 1;
		} else {
			return 0;
		}
	} else {
		if (!strcmp(s, "yes"))
			return 1;
	}
	return 0;
}