Lines Matching +full:cfi +full:- +full:flash

1 // SPDX-License-Identifier: GPL-2.0-only
3 * MTD map driver for BIOS Flash on Intel SCB2 boards
20 * * D8-D15 ignored
25 * logical address 0 hit higher-address sections of the chip, not physical 0.
29 * This driver assumes the chip is not write-protected by an external signal.
33 * updates for this board include 10 related (*.bio - &.bi9) binary files and
40 * offset 0x00000 to 0x4ffff (320k): unknown - SCSI BIOS, etc?
54 #include <linux/mtd/cfi.h>
66 .name = "SCB2 BIOS Flash",
76 struct map_info *map = mtd->priv; in scb2_fixup_mtd()
77 struct cfi_private *cfi = map->fldrv_priv; in scb2_fixup_mtd() local
80 if (cfi->cfiq->InterfaceDesc != CFI_INTERFACE_X16_ASYNC) { in scb2_fixup_mtd()
82 cfi->cfiq->InterfaceDesc); in scb2_fixup_mtd()
83 return -1; in scb2_fixup_mtd()
88 /* the chip is sometimes bigger than the map - what a waste */ in scb2_fixup_mtd()
89 mtd->size = map->size; in scb2_fixup_mtd()
93 * wired up - D8-D15 are tossed away. We read linear bytes, in scb2_fixup_mtd()
94 * but in reality we are getting 1/2 of each 16-bit read, in scb2_fixup_mtd()
95 * which LOOKS linear to us. Because CFI code accounts for in scb2_fixup_mtd()
101 * -- the problem is that addresses are 16-bit addressable in scb2_fixup_mtd()
102 * -- we end up erasing every-other block in scb2_fixup_mtd()
104 mtd->erasesize /= 2; in scb2_fixup_mtd()
105 for (i = 0; i < mtd->numeraseregions; i++) { in scb2_fixup_mtd()
106 struct mtd_erase_region_info *region = &mtd->eraseregions[i]; in scb2_fixup_mtd()
107 region->erasesize /= 2; in scb2_fixup_mtd()
113 * the chip, so all our erase-region info is wrong. Start cutting from in scb2_fixup_mtd()
116 for (i = 0; !done && i < mtd->numeraseregions; i++) { in scb2_fixup_mtd()
117 struct mtd_erase_region_info *region = &mtd->eraseregions[i]; in scb2_fixup_mtd()
119 if (region->numblocks * region->erasesize > mtd->size) { in scb2_fixup_mtd()
120 region->numblocks = ((unsigned long)mtd->size / in scb2_fixup_mtd()
121 region->erasesize); in scb2_fixup_mtd()
124 region->numblocks = 0; in scb2_fixup_mtd()
126 region->offset = 0; in scb2_fixup_mtd()
140 /* enable decoding of the flash region in the south bridge */ in scb2_flash_probe()
146 * The BIOS seems to mark the flash region as 'reserved' in scb2_flash_probe()
150 ": warning - can't reserve rom window, continuing\n"); in scb2_flash_probe()
160 return -ENOMEM; in scb2_flash_probe()
173 printk(KERN_ERR MODNAME ": flash probe failed!\n"); in scb2_flash_probe()
177 return -ENODEV; in scb2_flash_probe()
180 scb2_mtd->owner = THIS_MODULE; in scb2_flash_probe()
187 return -ENODEV; in scb2_flash_probe()
191 (unsigned long long)scb2_mtd->size, in scb2_flash_probe()
192 (unsigned long long)(SCB2_WINDOW - scb2_mtd->size)); in scb2_flash_probe()
204 /* disable flash writes */ in scb2_flash_remove()
205 mtd_lock(scb2_mtd, 0, scb2_mtd->size); in scb2_flash_remove()
228 .name = "Intel SCB2 BIOS Flash",
238 MODULE_DESCRIPTION("MTD map driver for Intel SCB2 BIOS Flash");