Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: 6904/1: MTD: Add integrator-flash feature to physmap

In the process of moving platforms away from integrator-flash
(aka armflash), add to physmap the few features that make
armflash unique:

- optionnal probing for the AFS partition type
- init() and exit() methods, used by Integrator to control
write access to the various onboard programmable components

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

authored by

Marc Zyngier and committed by
Russell King
b7281ca2 c1d10d18

+17 -1
+15 -1
drivers/mtd/maps/physmap.c
··· 67 67 if (info->mtd[i] != NULL) 68 68 map_destroy(info->mtd[i]); 69 69 } 70 + 71 + if (physmap_data->exit) 72 + physmap_data->exit(dev); 73 + 70 74 return 0; 71 75 } 72 76 ··· 81 77 "map_rom", 82 78 NULL }; 83 79 #ifdef CONFIG_MTD_PARTITIONS 84 - static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", NULL }; 80 + static const char *part_probe_types[] = { "cmdlinepart", "RedBoot", 81 + #ifdef CONFIG_MTD_AFS_PARTS 82 + "afs", 83 + #endif 84 + NULL }; 85 85 #endif 86 86 87 87 static int physmap_flash_probe(struct platform_device *dev) ··· 106 98 if (info == NULL) { 107 99 err = -ENOMEM; 108 100 goto err_out; 101 + } 102 + 103 + if (physmap_data->init) { 104 + err = physmap_data->init(dev); 105 + if (err) 106 + goto err_out; 109 107 } 110 108 111 109 platform_set_drvdata(dev, info);
+2
include/linux/mtd/physmap.h
··· 22 22 23 23 struct physmap_flash_data { 24 24 unsigned int width; 25 + int (*init)(struct platform_device *); 26 + void (*exit)(struct platform_device *); 25 27 void (*set_vpp)(struct map_info *, int); 26 28 unsigned int nr_parts; 27 29 unsigned int pfow_base;