staticint bcm63xx_get_fallback_sprom(struct ssb_bus *bus, struct ssb_sprom *out)
{ if (bus->bustype == SSB_BUSTYPE_PCI) {
memcpy(out, &bcm63xx_sprom, sizeof(struct ssb_sprom)); return 0;
} else {
pr_err("unable to fill SPROM for given bustype\n"); return -EINVAL;
}
} #endif/* CONFIG_SSB_PCIHOST */
/* * return board name for /proc/cpuinfo
*/ constchar *board_get_name(void)
{ return board.name;
}
/* * early init callback, read nvram data from flash and checksum it
*/ void __init board_prom_init(void)
{ unsignedint i;
u8 *boot_addr, *cfe; char cfe_version[32]; char *board_name = NULL;
u32 val; struct bcm_hcs *hcs;
/* read base address of boot chip select (0) * 6328/6362 do not have MPI but boot from a fixed address
*/ if (BCMCPU_IS_6328() || BCMCPU_IS_6362()) {
val = 0x18000000;
} else {
val = bcm_mpi_readl(MPI_CSBASE_REG(0));
val &= MPI_CSBASE_BASE_MASK;
}
boot_addr = (u8 *)KSEG1ADDR(val);
if (BCMCPU_IS_3368()) {
hcs = (struct bcm_hcs *)boot_addr;
board_name = hcs->filename;
} else {
board_name = bcm63xx_nvram_get_name();
} /* find board by name */ for (i = 0; i < ARRAY_SIZE(bcm963xx_boards); i++) { if (strncmp(board_name, bcm963xx_boards[i]->name, 16)) continue; /* copy, board desc array is marked initdata */
memcpy(&board, bcm963xx_boards[i], sizeof(board)); break;
}
/* bail out if board is not found, will complain later */ if (!board.name[0]) { char name[17];
memcpy(name, board_name, 16);
name[16] = 0;
pr_err("unknown bcm963xx board: %s\n", name); return;
}
/* setup pin multiplexing depending on board enabled device, * this has to be done this early since PCI init is done
* inside arch_initcall */
val = 0;
#ifdef CONFIG_PCI if (board.has_pci) {
bcm63xx_pci_enabled = 1; if (BCMCPU_IS_6348())
val |= GPIO_MODE_6348_G2_PCI;
} #endif/* CONFIG_PCI */
if (board.has_pccard) { if (BCMCPU_IS_6348())
val |= GPIO_MODE_6348_G1_MII_PCCARD;
}
if (board.has_enet0 && !board.enet0.use_internal_phy) { if (BCMCPU_IS_6348())
val |= GPIO_MODE_6348_G3_EXT_MII |
GPIO_MODE_6348_G0_EXT_MII;
}
if (board.has_enet1 && !board.enet1.use_internal_phy) { if (BCMCPU_IS_6348())
val |= GPIO_MODE_6348_G3_EXT_MII |
GPIO_MODE_6348_G0_EXT_MII;
}
bcm_gpio_writel(val, GPIO_MODE_REG);
}
/* * second stage init callback, good time to panic if we couldn't * identify on which board we're running since early printk is working
*/ void __init board_setup(void)
{ if (!board.name[0])
panic("unable to detect bcm963xx board");
pr_info("board name: %s\n", board.name);
/* make sure we're running on expected cpu */ if (bcm63xx_get_cpu_id() != board.expected_cpu_id)
panic("unexpected CPU for bcm963xx board");
}
/* * third stage init callback, register all board devices.
*/ int __init board_register_devices(void)
{ if (board.has_uart0)
bcm63xx_uart_register(0);
if (board.has_uart1)
bcm63xx_uart_register(1);
if (board.has_pccard)
bcm63xx_pcmcia_register();
if (board.has_enet0 &&
!bcm63xx_nvram_get_mac_address(board.enet0.mac_addr))
bcm63xx_enet_register(0, &board.enet0);
if (board.has_enet1 &&
!bcm63xx_nvram_get_mac_address(board.enet1.mac_addr))
bcm63xx_enet_register(1, &board.enet1);
if (board.has_enetsw &&
!bcm63xx_nvram_get_mac_address(board.enetsw.mac_addr))
bcm63xx_enetsw_register(&board.enetsw);
if (board.has_usbd)
bcm63xx_usbd_register(&board.usbd);
/* Generate MAC address for WLAN and register our SPROM, * do this after registering enet devices
*/ #ifdef CONFIG_SSB_PCIHOST if (!bcm63xx_nvram_get_mac_address(bcm63xx_sprom.il0mac)) {
memcpy(bcm63xx_sprom.et0mac, bcm63xx_sprom.il0mac, ETH_ALEN);
memcpy(bcm63xx_sprom.et1mac, bcm63xx_sprom.il0mac, ETH_ALEN); if (ssb_arch_register_fallback_sprom(
&bcm63xx_get_fallback_sprom) < 0)
pr_err("failed to register fallback SPROM\n");
} #endif/* CONFIG_SSB_PCIHOST */
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.