/* * Overwrite weak is_pci_host() * * This routine is called to determine if a pci scan should be * performed. With various hardware environments (especially cPCI and * PPMC) it's insufficient to depend on the state of the arbiter enable * bit in the strap register, or generic host/adapter assumptions. * * Return 0 for adapter mode, non-zero for host (monarch) mode. */ int is_pci_host(struct pci_controller *hose) { char *s; if (!is_monarch()) { /* * Overwrite PCI identification when running in * non-monarch mode * This should be moved into pci_target_init() * when it is sometimes available for 405 CPUs */ 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; }
int do_inta(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { if (is_monarch()) { printf("This command is only supported in non-monarch mode\n"); return -1; } if (argc > 1) { if (argv[1][0] == '0') { /* assert */ printf("inta# asserted\n"); out_be32((void*)GPIO1_TCR, in_be32((void*)GPIO1_TCR) | GPIO1_INTA_FAKE); } else { /* deassert */ printf("inta# deasserted\n"); out_be32((void*)GPIO1_TCR, in_be32((void*)GPIO1_TCR) & ~GPIO1_INTA_FAKE); } } else { printf("inta# is %s\n", in_be32((void*)GPIO1_TCR) & GPIO1_INTA_FAKE ? "active" : "inactive"); } return 0; }
int misc_init_r(void) { int i; struct ppc4xx_gpio *gpio0 = (struct ppc4xx_gpio *)GPIO_BASE; struct pmc405de_cpld *cpld = (struct pmc405de_cpld *)CONFIG_SYS_CPLD_BASE; if (!is_monarch()) { /* PCI configuration done: release EREADY */ setbits_be32(&gpio0->or, CONFIG_SYS_GPIO_EREADY); setbits_be32(&gpio0->tcr, CONFIG_SYS_GPIO_EREADY); } /* turn off POST LED */ out_8(&cpld->control, CPLD_CONTROL_POSTLED_N | CPLD_CONTROL_POSTLED_GATE); /* turn on LEDs: RUN, A, B */ clrbits_be32(&gpio0->or, CONFIG_SYS_GPIO_LEDRUN_N | CONFIG_SYS_GPIO_LEDA_N | CONFIG_SYS_GPIO_LEDB_N); for (i=0; i < 200; i++) udelay(1000); /* turn off LEDs: A, B */ setbits_be32(&gpio0->or, CONFIG_SYS_GPIO_LEDA_N | CONFIG_SYS_GPIO_LEDB_N); return (0); }
int is_pci_host(struct pci_controller *hose) { if (is_monarch()) { wait_for_pci_ready(); return 1; /* return 1 for host controller */ } else { return 0; /* return 0 for adapter controller */ } }
static void __init p3p440_setup_hose(void) { struct pci_controller *hose; if (!is_monarch()) { /* * REMARK: This Non-Monarch mode need perhaps some changes. * It's not tested at all, because of lack of hardware. --sr */ printk("P3P440-PCI: Non-Monarch detected, skipping PCI init!\n"); return; } /* Configure windows on the PCI-X host bridge */ p3p440_setup_pcix(); hose = pcibios_alloc_controller(); if (!hose) return; hose->first_busno = 0; hose->last_busno = 0xff; hose->pci_mem_offset = P3P440_PCI_MEM_OFFSET; pci_init_resource(&hose->io_resource, P3P440_PCI_LOWER_IO, P3P440_PCI_UPPER_IO, IORESOURCE_IO, "PCI host bridge"); pci_init_resource(&hose->mem_resources[0], P3P440_PCI_LOWER_MEM, P3P440_PCI_UPPER_MEM, IORESOURCE_MEM, "PCI host bridge"); hose->io_space.start = P3P440_PCI_LOWER_IO; hose->io_space.end = P3P440_PCI_UPPER_IO; hose->mem_space.start = P3P440_PCI_LOWER_MEM; hose->mem_space.end = P3P440_PCI_UPPER_MEM; hose->io_base_virt = ioremap64(P3P440_PCI_IO_BASE, P3P440_PCI_IO_SIZE); isa_io_base = (unsigned long)hose->io_base_virt; setup_indirect_pci(hose, PCIX0_CFGA, PCIX0_CFGD); hose->set_cfg_type = 1; hose->last_busno = pciauto_bus_scan(hose, hose->first_busno); ppc_md.pci_swizzle = common_swizzle; ppc_md.pci_map_irq = p3p440_map_irq; }
/* * Check Board Identity */ int checkboard(void) { puts("Board: esd GmbH - PMC-CPU/405-DE"); gd->board_type = board_revision(); printf(", Rev 1.%ld, ", gd->board_type); if (!is_monarch()) puts("non-"); printf("monarch, PCI=%s MHz, PLD-Rev 1.%d\n", pci_is_66mhz() ? "66" : "33", cpld_revision()); return 0; }
void ft_board_setup(void *blob, bd_t *bd) { int rc; __ft_board_setup(blob, bd); /* * Disable PCI in non-monarch mode. */ if (!is_monarch()) { rc = fdt_find_and_setprop(blob, "/plb/pci@ec000000", "status", "disabled", sizeof("disabled"), 1); if (rc) { printf("Unable to update property status in PCI node, " "err=%s\n", fdt_strerror(rc)); } } }
int checkboard(void) { char *s = getenv("serial#"); printf("Board: P3P440"); if (s != NULL) { puts(", serial# "); puts(s); } if (is_monarch()) { puts(", Monarch"); } else { puts(", None-Monarch"); } putc('\n'); return (0); }
int checkboard(void) { char buf[64]; int i = getenv_f("serial#", buf, sizeof(buf)); printf("Board: P3P440"); if (i > 0) { puts(", serial# "); puts(buf); } if (is_monarch()) { puts(", Monarch"); } else { puts(", None-Monarch"); } putc('\n'); return (0); }