/* * Set the Intel flash back to read mode since some old boot * loaders don't.
*/ staticint nettel_reboot_notifier(struct notifier_block *nb, unsignedlong val, void *v)
{ struct cfi_private *cfi = nettel_intel_map.fldrv_priv; unsignedlong b;
/* Make sure all FLASH chips are put back into read mode */ for (b = 0; (b < nettel_intel_partitions[3].size); b += 0x100000) {
cfi_send_gen_cmd(0xff, 0x55, b, &nettel_intel_map, cfi,
cfi->device_type, NULL);
} return(NOTIFY_OK);
}
/* * Save the CS settings then ensure ROMCS1 and ROMCS2 are off, * otherwise they might clash with where we try to map BOOTCS.
*/
orig_bootcspar = *amdpar;
orig_romcs1par = *intel0par;
*intel0par = 0;
*intel1par = 0; #endif
/* * The first thing to do is determine if we have a separate * boot FLASH device. Typically this is a small (1 to 2MB) * AMD FLASH part. It seems that device size is about the * only way to tell if this is the case...
*/
amdaddr = 0x20000000;
maxsize = AMD_WINDOW_MAXSIZE;
/* The high BIOS partition is only present for 2MB units */
num_amd_partitions = NUM_AMD_PARTITIONS; if (amd_mtd->size < AMD_WINDOW_MAXSIZE)
num_amd_partitions--; /* Don't add the partition until after the primary INTEL's */
#ifdef CONFIG_MTD_CFI_INTELEXT /* * Map the Intel flash into memory after the AMD * It has to start on a multiple of maxsize.
*/
maxsize = SC520_PAR_TO_SIZE(orig_romcs1par); if (maxsize < (32 * 1024 * 1024))
maxsize = (32 * 1024 * 1024);
intel0addr = amdaddr + maxsize; #endif
} else { #ifdef CONFIG_MTD_CFI_INTELEXT /* INTEL boot FLASH */
intelboot++;
#ifdef CONFIG_MTD_CFI_INTELEXT /* * We have determined the INTEL FLASH configuration, so lets * go ahead and probe for them now.
*/
/* Set PAR to the maximum size */ if (maxsize < (32 * 1024 * 1024))
maxsize = (32 * 1024 * 1024);
*intel0par = SC520_PAR(intel0cs, intel0addr, maxsize);
/* Turn other PAR off so the first probe doesn't find it */
*intel1par = 0;
/* Probe for the size of the first Intel flash */
nettel_intel_map.size = maxsize;
nettel_intel_map.phys = intel0addr;
nettel_intel_map.virt = ioremap(intel0addr, maxsize); if (!nettel_intel_map.virt) {
printk("SNAPGEAR: failed to ioremap() ROMCS1\n");
rc = -EIO; goto out_unmap2;
}
simple_map_init(&nettel_intel_map);
/* Set PAR to the detected size */
intel0size = intel_mtd->size;
*intel0par = SC520_PAR(intel0cs, intel0addr, intel0size);
/* * Map second Intel FLASH right after first. Set its size to the * same maxsize used for the first Intel FLASH.
*/
intel1addr = intel0addr + intel0size;
*intel1par = SC520_PAR(intel1cs, intel1addr, maxsize);
__asm__ ("wbinvd");
maxsize += intel0size;
/* Delete the old map and probe again to do both chips */
map_destroy(intel_mtd);
intel_mtd = NULL;
iounmap(nettel_intel_map.virt);
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.