Lines Matching +full:cfi +full:- +full:flash
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Cobalt NOR flash functions
5 * Copyright 2012-2015 Cisco Systems, Inc. and/or its affiliates.
11 #include <linux/mtd/cfi.h>
14 #include "cobalt-flash.h"
19 .name = "cobalt-flash",
29 r.x[0] = cobalt_bus_read32(map->virt, ADRS(offset)); in flash_read16()
43 cobalt_bus_write16(map->virt, ADRS(offset), data); in flash_write16()
54 data = cobalt_bus_read32(map->virt, ADRS(src)); in flash_copy_from()
59 len--; in flash_copy_from()
78 len--; in flash_copy_to()
81 cobalt_bus_write16(map->virt, ADRS(dest - 2), data); in flash_copy_to()
90 BUG_ON(!map_bankwidth_supported(map->bankwidth)); in cobalt_flash_probe()
91 map->virt = cobalt->bar1; in cobalt_flash_probe()
92 map->read = flash_read16; in cobalt_flash_probe()
93 map->write = flash_write16; in cobalt_flash_probe()
94 map->copy_from = flash_copy_from; in cobalt_flash_probe()
95 map->copy_to = flash_copy_to; in cobalt_flash_probe()
98 cobalt->mtd = mtd; in cobalt_flash_probe()
100 cobalt_err("Probe CFI flash failed!\n"); in cobalt_flash_probe()
101 return -1; in cobalt_flash_probe()
104 mtd->owner = THIS_MODULE; in cobalt_flash_probe()
105 mtd->dev.parent = &cobalt->pci_dev->dev; in cobalt_flash_probe()
112 if (cobalt->mtd) { in cobalt_flash_remove()
113 mtd_device_unregister(cobalt->mtd); in cobalt_flash_remove()
114 map_destroy(cobalt->mtd); in cobalt_flash_remove()