++ coreidx = sb_coreidx(sbh);
++
++ /* Check strapping option if chipcommon exists */
++ if ((cc = sb_setcore(sbh, SB_CC, 0))) {
++ fltype = readl(&cc->capabilities) & CAP_FLASH_MASK;
++ if (fltype == PFLASH) {
++ bcm947xx_map.map_priv_2 = 1;
++ window_addr = 0x1c000000;
++ bcm947xx_map.size = window_size = 32 * 1024 * 1024;
++ if ((readl(&cc->flash_config) & CC_CFG_DS) == 0)
++ bcm947xx_map.bankwidth = 1;
++ }
++ } else {
++ fltype = PFLASH;
++ bcm947xx_map.map_priv_2 = 0;
++ window_addr = WINDOW_ADDR;
++ window_size = WINDOW_SIZE;
++ }
++
++ sb_setcoreidx(sbh, coreidx);
++
++ if (fltype != PFLASH) {
++ printk(KERN_ERR "pflash: found no supported devices\n");
++ ret = -ENODEV;
++ goto fail;
++ }
++ bcm947xx_map.virt = ioremap(window_addr, window_size);