/* * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> * Copyright (C) 2006 Michael Buesch <m@bues.ch> * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> * Copyright (C) 2010-2012 Hauke Mehrtens <hauke@hauke-m.de> * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* * CBR addr doesn't change and we can cache it. * For broken SoC/Bootloader CBR addr might also be provided via DT * with "brcm,bmips-cbr-reg" in the "cpus" node.
*/ void __iomem *bmips_cbr_addr __read_mostly;
union bcm47xx_bus bcm47xx_bus;
EXPORT_SYMBOL(bcm47xx_bus);
#ifdef CONFIG_BCM47XX_BCMA staticvoid __init bcm47xx_register_bcma(void)
{ int err;
err = bcma_host_soc_register(&bcm47xx_bus.bcma); if (err)
panic("Failed to register BCMA bus (err %d)", err);
} #endif
/* * Memory setup is done in the early part of MIPS's arch_mem_init. It's supposed * to detect memory and record it with memblock_add. * Any extra initializaion performed here must not use kmalloc or bootmem.
*/ void __init plat_mem_setup(void)
{ struct cpuinfo_mips *c = ¤t_cpu_data;
dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (!dev) return NULL;
err = dev_set_name(dev, "bcm47xx_soc"); if (err) {
pr_err("Failed to set SoC device name: %d\n", err);
kfree(dev); return NULL;
}
err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (err)
pr_err("Failed to set SoC DMA mask: %d\n", err);
return dev;
} #endif
/* * This finishes bus initialization doing things that were not possible without * kmalloc. Make sure to call it late enough (after mm_init).
*/ void __init bcm47xx_bus_setup(void)
{ #ifdef CONFIG_BCM47XX_BCMA if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA) { int err;
bcm47xx_bus.bcma.dev = bcm47xx_setup_device(); if (!bcm47xx_bus.bcma.dev)
panic("Failed to setup SoC device\n");
err = bcma_host_soc_init(&bcm47xx_bus.bcma); if (err)
panic("Failed to initialize BCMA bus (err %d)", err);
} #endif
/* With bus initialized we can access NVRAM and detect the board */
bcm47xx_board_detect();
mips_set_machine_name(bcm47xx_board_get_name());
}
staticint __init bcm47xx_cpu_fixes(void)
{ switch (bcm47xx_bus_type) { #ifdef CONFIG_BCM47XX_SSB case BCM47XX_BUS_TYPE_SSB: /* Nothing to do */ break; #endif #ifdef CONFIG_BCM47XX_BCMA case BCM47XX_BUS_TYPE_BCMA: /* The BCM4706 has a problem with the CPU wait instruction. * When r4k_wait or r4k_wait_irqoff is used will just hang and * not return from a msleep(). Removing the cpu_wait * functionality is a workaround for this problem. The BCM4716 * does not have this problem.
*/ if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706)
cpu_wait = NULL; break; #endif
} return 0;
}
arch_initcall(bcm47xx_cpu_fixes);
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.