Switch ARM platforms from integrator-flash to physmap
Subsystems (7)
v6 cover Switch ARM platforms from integrator-flash to physmap
As the integrator-flash driver is mostly a duplicate of physmap, move all users of this driver to physmap and get rid of the then unused driver.
Also change the set_vpp() method in physmap to pass the platform_device instead of the map_info. This allows for a substantial cleanup in drivers/mtd/maps/pismo.c
This patch set has been ok'ed by RMK, who is willing to take it through his tree. This requires an ACK from the MTD maintainers. David Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it via the MTD tree.
Changes since v5:
- Removed #ifdef around the afs partition name, as requested by Artem Bityutskiy
- Dropped changes to board-at572d940hf_ek.c, as the board is to be removed from the tree
Changes since v4:
- Changed set_vpp() method in physmap
- Rebased against v2.6.39-rc7
Changes since v3:
- Dropped patch for aaec2000 platform (removed from tree)
- Rebased against next-20110317
Changes since v2:
- Add integrator-flash's init()/exit() methods in order to control write access to the various onboard programmable components, as per RMK request.
- Rebased against 2.6.38-rc2
Changes since initial revision:
- Rebased against linux-next (20110107). It should apply cleanly on top of Linus' tree, except for a small conflict in the last patch of the serie.
Marc Zyngier (8):
MTD: Add integrator-flash feature to physmap
ARM: Realview: Use physmap driver instead of integrator-flash
ARM: Versatile: Use physmap driver instead of integrator-flash
ARM: VExpress: Use physmap driver instead of integrator-flash
ARM: Integrator/AP: Use physmap driver instead of integrator-flash
ARM: Integrator/CP: Use physmap driver instead of integrator-flash
MTD: Remove integrator-flash
MTD: physmap: let set_vpp() pass a platform_device instead of a
map_info
arch/arm/configs/realview-smp_defconfig | 2 +- arch/arm/configs/realview_defconfig | 2 +- arch/arm/configs/versatile_defconfig | 2 +- arch/arm/mach-integrator/integrator_ap.c | 13 +- arch/arm/mach-integrator/integrator_cp.c | 13 +- arch/arm/mach-omap1/flash.c | 2 +- arch/arm/mach-pxa/hx4700.c | 2 +- arch/arm/mach-pxa/magician.c | 2 +- arch/arm/mach-realview/core.c | 31 +--- arch/arm/mach-s3c2410/nor-simtec.c | 2 +- arch/arm/mach-versatile/core.c | 31 +--- arch/arm/mach-vexpress/v2m.c | 22 +-- arch/arm/plat-omap/include/plat/flash.h | 2 +- drivers/mtd/Kconfig | 3 +- drivers/mtd/maps/Makefile | 1 - drivers/mtd/maps/integrator-flash.c | 309 ------------------------------ drivers/mtd/maps/physmap.c | 28 +++- drivers/mtd/maps/pismo.c | 40 +---- include/linux/mtd/physmap.h | 4 +- 19 files changed, 65 insertions(+), 446 deletions(-) delete mode 100644 drivers/mtd/maps/integrator-flash.c
PATCH v6 1/8 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
--- drivers/mtd/maps/physmap.c | 16 +++++++++++++++- include/linux/mtd/physmap.h | 2 ++ 2 files changed, 17 insertions(+), 1 deletions(-)
drivers/mtd/maps/physmap.c +15 -1
@@ -67,6 +67,10 @@ static int physmap_flash_remove(struct platform_device *dev)if (info->mtd[i] !=NULL )map_destroy (info->mtd[i]); } + +if (physmap_data->exit) + physmap_data->exit (dev); +return 0 ; }
@@ -77,7 +81,11 @@ static const char *rom_probe_types[] = {"map_rom" , NULL };#ifdef CONFIG_MTD_PARTITIONS -static const char *part_probe_types[] = {"cmdlinepart" ,"RedBoot" ,NULL }; +static const char *part_probe_types[] = {"cmdlinepart" ,"RedBoot" , +#ifdef CONFIG_MTD_AFS_PARTS +"afs" , +#endif +NULL };#endif static int physmap_flash_probe (struct platform_device *dev)
@@ -100,6 +108,12 @@ static int physmap_flash_probe(struct platform_device *dev) goto err_out; } +if (physmap_data->init) { + err = physmap_data->init (dev); +if (err) + goto err_out; + } +platform_set_drvdata (dev, info);for (i =0 ; i < dev->num_resources; i++) {
include/linux/mtd/physmap.h +2 -0
@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);void (*set_vpp)(struct map_info *,int );unsigned int nr_parts;unsigned int pfow_base;
Signature · 1 line
1.7.0.4
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
In reply to Marc ZyngierHello.
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>
[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);
How about a declaration for 'struct platform_device' beforehand? This breaks
build on other platforms at least...
WBR, Sergei
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Quoted 23 lines · On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov <[email protected]> wrote:
Hello.
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
Quoted 6 lines
include/linux/mtd/physmap.h +0
-0@@ -22,6 +22,8 @@ struct map_info;
Quoted 7 lines
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 4 lines
include/linux/mtd/physmap.h +2
-0struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...
Sure. Please send a patch.
M.
Signature · 1 line
I'm the slime oozin' out from your TV set...
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Quoted 29 lines · Marc Zyngier
Quoted 20 lines · On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control ? write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
Quoted 6 lines
include/linux/mtd/physmap.h +0
-0@@ -22,6 +22,8 @@ struct map_info;Quoted 7 lines
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 4 lines
include/linux/mtd/physmap.h +2
-0?struct physmap_flash_data { ? ? unsigned int ? ? ? ? ? ?width; + ? int ? ? ? ? ? ? ? ? ? ? (*init)(struct platform_device *); + ? void ? ? ? ? ? ? ? ? ? ?(*exit)(struct platform_device *);? ? How about a declaration for 'struct
platform_device' beforehand? This breaks build on other platforms at least...
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
-mike
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Quoted 30 lines · Mike Frysinger
Quoted 29 lines · Marc Zyngier
Quoted 27 lines · On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...
Quoted 5 lines
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
-mike
The change went in via Russell's tree, I sent him a fix. It looks like he did not merge it. Now I'm not sure who should merge this patch. I'll ping dwmw2.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Hello.
Quoted 24 lines · Artem Bityutskiy
Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Quoted 9 lines
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
-mikeThe change went in via Russell's tree, I sent him a fix. It looks like he did not merge it.
Russell doesn't merge patches sent to him AFAIK, they need to be put into
his patch system first.
WBR, Sergei
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
In reply to Mike FrysingerQuoted 30 lines · Mike Frysinger
Quoted 29 lines · Marc Zyngier
Quoted 27 lines · On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...
Quoted 4 lines
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
Mike,
Sorry I missed your earlier comment about this. My bad.
Now, about my reply to Sergei:
* Sergei identified the problem, and proposed a valid fix. It's only fair he gets credited for his work (yes, you did it before he did, but I didn't know it). The SOB on a patch is the proper way of managing the attribution.
* Posting a patch is the quickest way for the maintainer (in this case David) to be able to push a fix to mainline.
* It also helps other folks reading the ML and facing the same issue. They can grab the patch, apply it locally and go on with their own stuff until the patch is merged.
* The person reporting the problem probably has a configuration showing the problem. If any of my platforms had shown that error, I would have fixed it long before it hit the mailing list.
Now, to keep everyone happy, an untested patch. David, can you please apply it?
Cheers,
M.
Quoted 1 line
From
1440a857e119b90df68e87cf9da87fce870c86cfMon Sep 17 00:00:00 2001
From: Marc Zyngier <[email protected]>
Date: Wed, 1 Jun 2011 08:37:28 +0100
Subject: [PATCH] MTD: Fix physmap compilation error
Commit b7281ca2a4 (MTD: Add integrator-flash feature to physmap) broke some platforms by using 'struct platform_device' without declaring it.
Add a forward declaration to keep everyone happy.
Fix proposed by both Mike Frysinger and Sergei Shtylyov.
--- include/linux/mtd/physmap.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/linux/mtd/physmap.h +1 -0
@@ -19,6 +19,7 @@#include <linux/mtd/partitions.h> struct map_info ; +struct platform_device ;struct physmap_flash_data {unsigned int width;
Signature · 5 lines
1.7.0.4 -- Reality is an implementation detail.
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
Quoted 67 lines · Marc Zyngier
Quoted 30 lines · Mike Frysinger
Quoted 29 lines · Marc Zyngier
Quoted 27 lines · On Tue, 31 May 2011 23:11:14 +0400 Sergei Shtylyov wrote:
Quoted 11 lines · Marc Zyngier
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...Quoted 4 lines
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
Mike,
Sorry I missed your earlier comment about this. My bad.
Now, about my reply to Sergei:
* Sergei identified the problem, and proposed a valid fix. It's only fair he gets credited for his work (yes, you did it before he did, but I didn't know it). The SOB on a patch is the proper way of managing the attribution.
* Posting a patch is the quickest way for the maintainer (in this case David) to be able to push a fix to mainline.
* It also helps other folks reading the ML and facing the same issue. They can grab the patch, apply it locally and go on with their own stuff until the patch is merged.
* The person reporting the problem probably has a configuration showing the problem. If any of my platforms had shown that error, I would have fixed it long before it hit the mailing list.Now, to keep everyone happy, an untested patch. David, can you please apply it?
Cheers,
M.Quoted 1 line
From
1440a857e119b90df68e87cf9da87fce870c86cfMon Sep 17 00:00:00 2001From: Marc Zyngier <[email protected]>
Date: Wed, 1 Jun 2011 08:37:28 +0100
Subject: [PATCH] MTD: Fix physmap compilation error
Quoted 7 lines
Commit
b7281ca2a4(MTD: Add integrator-flash feature to physmap) broke some platforms by using 'structplatform_device' without declaring it.Add a forward declaration to keep everyone happy.
Fix proposed by both Mike Frysinger and Sergei Shtylyov.
The first person who sent a patch was Randy, so we already have the patch, now it is only about merging it.
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v6 1/8 MTD: Add integrator-flash feature to physmap
In reply to Marc ZyngierQuoted 34 lines · Marc Zyngier
Quoted 25 lines
Quoted 24 lines
Quoted 24 lines
Quoted 9 lines
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()andexit()methods, used by Integrator to control write access to the various onboard programmable componentsSigned-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>[...]
include/linux/mtd/physmap.h struct map_info; · line 26
Quoted 10 lines
include/linux/mtd/physmap.h +2
-0@@ -22,6 +22,8 @@ struct map_info;struct physmap_flash_data {unsigned int width; +int (*init)(struct platform_device *); +void (*exit)(struct platform_device *);How about a declaration for 'struct
platform_device' beforehand? This breaks
build on other platforms at least...Quoted 4 lines
Quoted 1 line
Sure. Please send a patch.
uhh, what ? you broke things, so you fix them. i already pointed out this breakage to you over a week ago.
Mike,
Sorry I missed your earlier comment about this. My bad.
Quoted 14 lines
Now, about my reply to Sergei:
* Sergei identified the problem, and proposed a valid fix. It's only fair he gets credited for his work (yes, you did it before he did, but I didn't know it). The SOB on a patch is the proper way of managing the attribution.
* Posting a patch is the quickest way for the maintainer (in this case David) to be able to push a fix to mainline.
* It also helps other folks reading the ML and facing the same issue. They can grab the patch, apply it locally and go on with their own stuff until the patch is merged.
* The person reporting the problem probably has a configuration showing the problem. If any of my platforms had shown that error, I would have fixed it long before it hit the mailing list.
Actually, I'm not a primary reporter. The issue came up on the #mipslinux
IRC channel, I then just remembered that I saw the patch set touching this file, and it was easy enough to complain to you after finding the corresponding mails.
This happens to break MIPS platforms because they use warnings-as-errors
option of gcc.
WBR, Sergei
PATCH v6 2/8 ARM: Realview: Use physmap driver instead of integrator-flash
In reply to Marc ZyngierTested on a PB11-MPCore.
--- arch/arm/configs/realview-smp_defconfig | 2 +- arch/arm/configs/realview_defconfig | 2 +- arch/arm/mach-realview/core.c | 31 ++++--------------------------- 3 files changed, 6 insertions(+), 29 deletions(-)
arch/arm/configs/realview-smp_defconfig +1 -1
@@ -38,7 +38,7 @@ CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y CONFIG_MTD_CFI_INTELEXT=y CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_ARM_INTEGRATOR=y +CONFIG_MTD_PHYSMAP=y CONFIG_ARM_CHARLCD=y CONFIG_NETDEVICES=y CONFIG_SMSC_PHY=y
arch/arm/configs/realview_defconfig +1 -1
@@ -37,7 +37,7 @@ CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y CONFIG_MTD_CFI_INTELEXT=y CONFIG_MTD_CFI_AMDSTD=y -CONFIG_MTD_ARM_INTEGRATOR=y +CONFIG_MTD_PHYSMAP=y CONFIG_ARM_CHARLCD=y CONFIG_NETDEVICES=y CONFIG_SMSC_PHY=y
arch/arm/mach-realview/core.c +4 -27
@@ -31,6 +31,7 @@#include <linux/amba/mmci.h> #include <linux/gfp.h> #include <linux/clkdev.h> +#include <linux/mtd/physmap.h> #include <asm/system.h> #include <mach/hardware.h>
@@ -41,7 +42,6 @@#include <asm/hardware/icst.h> #include <asm/mach/arch.h> -#include <asm/mach/flash.h> #include <asm/mach/irq.h> #include <asm/mach/map.h>
@@ -77,27 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) -static int realview_flash_init (void ) -{ -u32 val; - - val =__raw_readl (REALVIEW_FLASHCTRL ); - val &= ~REALVIEW_FLASHPROG_FLVPPEN ; -__raw_writel (val,REALVIEW_FLASHCTRL ); - -return 0 ; -} - -static void realview_flash_exit (void ) -{ -u32 val; - - val =__raw_readl (REALVIEW_FLASHCTRL ); - val &= ~REALVIEW_FLASHPROG_FLVPPEN ; -__raw_writel (val,REALVIEW_FLASHCTRL ); -} - -static void realview_flash_set_vpp (int on) +static void realview_flash_set_vpp (struct map_info *map,int on) {u32 val;
@@ -109,16 +89,13 @@ static void realview_flash_set_vpp(int on)__raw_writel (val,REALVIEW_FLASHCTRL ); } -static struct flash_platform_data realview_flash_data = { - .map_name ="cfi_probe" , +static struct physmap_flash_data realview_flash_data = { .width =4 , - .init = realview_flash_init, - .exit = realview_flash_exit, .set_vpp = realview_flash_set_vpp, };struct platform_device realview_flash_device = { - .name ="armflash" , + .name ="physmap-flash" , .id =0 , .dev = { .platform_data = &realview_flash_data,
Signature · 1 line
1.7.0.4
PATCH v6 3/8 ARM: Versatile: Use physmap driver instead of integrator-flash
In reply to Marc Zyngier--- arch/arm/configs/versatile_defconfig | 2 +- arch/arm/mach-versatile/core.c | 31 ++++--------------------------- 2 files changed, 5 insertions(+), 28 deletions(-)
arch/arm/configs/versatile_defconfig +1 -1
@@ -32,7 +32,7 @@ CONFIG_MTD_BLOCK=y CONFIG_MTD_CFI=y CONFIG_MTD_CFI_ADV_OPTIONS=y CONFIG_MTD_CFI_INTELEXT=y -CONFIG_MTD_ARM_INTEGRATOR=y +CONFIG_MTD_PHYSMAP=y CONFIG_BLK_DEV_RAM=y CONFIG_EEPROM_LEGACY=m CONFIG_NETDEVICES=y
arch/arm/mach-versatile/core.c +4 -27
@@ -32,6 +32,7 @@#include <linux/io.h> #include <linux/gfp.h> #include <linux/clkdev.h> +#include <linux/mtd/physmap.h> #include <asm/system.h> #include <asm/irq.h>
@@ -42,7 +43,6 @@#include <asm/mach-types.h> #include <asm/mach/arch.h> -#include <asm/mach/flash.h> #include <asm/mach/irq.h> #include <asm/mach/time.h> #include <asm/mach/map.h>
@@ -190,27 +190,7 @@ void __init versatile_map_io(void)#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) -static int versatile_flash_init (void ) -{ -u32 val; - - val =__raw_readl (VERSATILE_FLASHCTRL ); - val &= ~VERSATILE_FLASHPROG_FLVPPEN ; -__raw_writel (val,VERSATILE_FLASHCTRL ); - -return 0 ; -} - -static void versatile_flash_exit (void ) -{ -u32 val; - - val =__raw_readl (VERSATILE_FLASHCTRL ); - val &= ~VERSATILE_FLASHPROG_FLVPPEN ; -__raw_writel (val,VERSATILE_FLASHCTRL ); -} - -static void versatile_flash_set_vpp (int on) +static void versatile_flash_set_vpp (struct map_info *map,int on) {u32 val;
@@ -222,11 +202,8 @@ static void versatile_flash_set_vpp(int on)__raw_writel (val,VERSATILE_FLASHCTRL ); } -static struct flash_platform_data versatile_flash_data = { - .map_name ="cfi_probe" , +static struct physmap_flash_data versatile_flash_data = { .width =4 , - .init = versatile_flash_init, - .exit = versatile_flash_exit, .set_vpp = versatile_flash_set_vpp, };
@@ -237,7 +214,7 @@ static struct resource versatile_flash_resource = { };static struct platform_device versatile_flash_device = { - .name ="armflash" , + .name ="physmap-flash" , .id =0 , .dev = { .platform_data = &versatile_flash_data,
Signature · 1 line
1.7.0.4
PATCH v6 4/8 ARM: VExpress: Use physmap driver instead of integrator-flash
In reply to Marc Zyngier--- arch/arm/mach-vexpress/v2m.c | 22 ++++------------------ 1 files changed, 4 insertions(+), 18 deletions(-)
arch/arm/mach-vexpress/v2m.c +4 -18
@@ -13,11 +13,11 @@#include <linux/sysdev.h> #include <linux/usb/isp1760.h> #include <linux/clkdev.h> +#include <linux/mtd/physmap.h> #include <asm/mach-types.h> #include <asm/sizes.h> #include <asm/mach/arch.h> -#include <asm/mach/flash.h> #include <asm/mach/map.h> #include <asm/mach/time.h> #include <asm/hardware/arm_timer.h>
@@ -206,27 +206,13 @@ static struct platform_device v2m_usb_device = { .dev.platform_data = &v2m_usb_config, }; -static int v2m_flash_init (void ) -{ -writel (0 ,MMIO_P2V (V2M_SYS_FLASH )); -return 0 ; -} - -static void v2m_flash_exit (void ) -{ -writel (0 ,MMIO_P2V (V2M_SYS_FLASH )); -} - -static void v2m_flash_set_vpp (int on) +static void v2m_flash_set_vpp (struct map_info *map,int on) {writel (on !=0 ,MMIO_P2V (V2M_SYS_FLASH )); } -static struct flash_platform_data v2m_flash_data = { - .map_name ="cfi_probe" , +static struct physmap_flash_data v2m_flash_data = { .width =4 , - .init = v2m_flash_init, - .exit = v2m_flash_exit, .set_vpp = v2m_flash_set_vpp, };
@@ -243,7 +229,7 @@ static struct resource v2m_flash_resources[] = { };static struct platform_device v2m_flash_device = { - .name ="armflash" , + .name ="physmap-flash" , .id =-1 , .resource = v2m_flash_resources, .num_resources =ARRAY_SIZE (v2m_flash_resources),
Signature · 1 line
1.7.0.4
PATCH v6 5/8 ARM: Integrator/AP: Use physmap driver instead of integrator-flash
In reply to Marc Zyngier--- arch/arm/mach-integrator/integrator_ap.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
arch/arm/mach-integrator/integrator_ap.c +6 -7
@@ -31,6 +31,7 @@#include <linux/clockchips.h> #include <linux/interrupt.h> #include <linux/io.h> +#include <linux/mtd/physmap.h> #include <mach/hardware.h> #include <mach/platform.h>
@@ -43,7 +44,6 @@#include <mach/lm.h> #include <asm/mach/arch.h> -#include <asm/mach/flash.h> #include <asm/mach/irq.h> #include <asm/mach/map.h> #include <asm/mach/time.h>
@@ -230,7 +230,7 @@ device_initcall(irq_init_sysfs);#define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)#define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET) -static int ap_flash_init (void ) +static int ap_flash_init (struct platform_device *dev) {u32 tmp;
@@ -247,7 +247,7 @@ static int ap_flash_init(void)return 0 ; } -static void ap_flash_exit (void ) +static void ap_flash_exit (struct platform_device *dev) {u32 tmp;
@@ -263,15 +263,14 @@ static void ap_flash_exit(void) } } -static void ap_flash_set_vpp (int on) +static void ap_flash_set_vpp (struct map_info *map,int on) {void __iomem *reg = on ?SC_CTRLS :SC_CTRLC ;writel (INTEGRATOR_SC_CTRL_nFLVPPEN, reg); } -static struct flash_platform_data ap_flash_data = { - .map_name ="cfi_probe" , +static struct physmap_flash_data ap_flash_data = { .width =4 , .init = ap_flash_init, .exit = ap_flash_exit,
@@ -285,7 +284,7 @@ static struct resource cfi_flash_resource = { };static struct platform_device cfi_flash_device = { - .name ="armflash" , + .name ="physmap-flash" , .id =0 , .dev = { .platform_data = &ap_flash_data,
Signature · 1 line
1.7.0.4
PATCH v6 6/8 ARM: Integrator/CP: Use physmap driver instead of integrator-flash
In reply to Marc ZyngierTested with an ARM-1136 core tile.
--- arch/arm/mach-integrator/integrator_cp.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-)
arch/arm/mach-integrator/integrator_cp.c +6 -7
@@ -22,6 +22,7 @@#include <linux/io.h> #include <linux/gfp.h> #include <linux/clkdev.h> +#include <linux/mtd/physmap.h> #include <mach/hardware.h> #include <mach/platform.h>
@@ -35,7 +36,6 @@#include <mach/lm.h> #include <asm/mach/arch.h> -#include <asm/mach/flash.h> #include <asm/mach/irq.h> #include <asm/mach/map.h> #include <asm/mach/time.h>
@@ -239,7 +239,7 @@ static struct clk_lookup cp_lookups[] = {/* * Flash handling. */ -static int intcp_flash_init (void ) +static int intcp_flash_init (struct platform_device *dev) {u32 val;
@@ -250,7 +250,7 @@ static int intcp_flash_init(void)return 0 ; } -static void intcp_flash_exit (void ) +static void intcp_flash_exit (struct platform_device *dev) {u32 val;
@@ -259,7 +259,7 @@ static void intcp_flash_exit(void)writel (val,INTCP_VA_CTRL_BASE +INTCP_FLASHPROG ); } -static void intcp_flash_set_vpp (int on) +static void intcp_flash_set_vpp (struct map_info *map,int on) {u32 val;
@@ -271,8 +271,7 @@ static void intcp_flash_set_vpp(int on)writel (val,INTCP_VA_CTRL_BASE +INTCP_FLASHPROG ); } -static struct flash_platform_data intcp_flash_data = { - .map_name ="cfi_probe" , +static struct physmap_flash_data intcp_flash_data = { .width =4 , .init = intcp_flash_init, .exit = intcp_flash_exit,
@@ -286,7 +285,7 @@ static struct resource intcp_flash_resource = { };static struct platform_device intcp_flash_device = { - .name ="armflash" , + .name ="physmap-flash" , .id =0 , .dev = { .platform_data = &intcp_flash_data,
Signature · 1 line
1.7.0.4
PATCH v6 7/8 MTD: Remove integrator-flash
In reply to Marc ZyngierAs there is now no in-tree user of integrator-flash, remove it completely.
--- drivers/mtd/Kconfig | 3 +- drivers/mtd/maps/Makefile | 1 - drivers/mtd/maps/integrator-flash.c | 309 ----------------------------------- 3 files changed, 1 insertions(+), 312 deletions(-) delete mode 100644 drivers/mtd/maps/integrator-flash.c
drivers/mtd/Kconfig +1 -2
@@ -148,8 +148,7 @@ config MTD_AFS_PARTS You will still need the parsing functions to be called by the driver for your particular device. It won't happen automatically. The - 'armflash' map driver (CONFIG_MTD_ARM_INTEGRATOR) does this, for - example. + 'physmap' map driver (CONFIG_MTD_PHYSMAP) does this, for example. config MTD_OF_PARTS def_bool y
drivers/mtd/maps/Makefile +0 -1
@@ -8,7 +8,6 @@ endif # Chip mappings obj-$(CONFIG_MTD_CDB89712) += cdb89712.o -obj-$(CONFIG_MTD_ARM_INTEGRATOR)+= integrator-flash.o obj-$(CONFIG_MTD_CFI_FLAGADM) += cfi_flagadm.o obj-$(CONFIG_MTD_DC21285) += dc21285.o obj-$(CONFIG_MTD_DILNETPC) += dilnetpc.o
drivers/mtd/maps/integrator-flash.c deleted +0 -309
309 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH v6 7/8 MTD: Remove integrator-flash
Quoted 6 lines · Marc Zyngier
As there is now no in-tree user of integrator-flash, remove it completely.
Signed-off-by Marc Zyngier <[email protected]>Acked-by Catalin Marinas <[email protected]>Cc David Woodhouse <[email protected]>
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v6 8/8 MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
In reply to Marc ZyngierThe set_vpp() method provided by physmap passes a map_info back to the platform code, which has little relevance as far as the platform is concerned (this parameter is completely unused).
Instead, pass the platform_device, which can be used in the pismo driver to retrieve some important information in a nicer way, instead of the hack that was in place.
The empty set_vpp function in board-at572d940hf_ek.c is left untouched, as the board/SoC is scheduled for removal.
--- arch/arm/mach-integrator/integrator_ap.c | 2 +- arch/arm/mach-integrator/integrator_cp.c | 2 +- arch/arm/mach-omap1/flash.c | 2 +- arch/arm/mach-pxa/hx4700.c | 2 +- arch/arm/mach-pxa/magician.c | 2 +- arch/arm/mach-realview/core.c | 2 +- arch/arm/mach-s3c2410/nor-simtec.c | 2 +- arch/arm/mach-versatile/core.c | 2 +- arch/arm/mach-vexpress/v2m.c | 2 +- arch/arm/plat-omap/include/plat/flash.h | 2 +- drivers/mtd/maps/physmap.c | 20 +++++++++++--- drivers/mtd/maps/pismo.c | 40 ++--------------------------- include/linux/mtd/physmap.h | 2 +- 13 files changed, 29 insertions(+), 53 deletions(-)
arch/arm/mach-integrator/integrator_ap.c +1 -1
@@ -263,7 +263,7 @@ static void ap_flash_exit(struct platform_device *dev) } } -static void ap_flash_set_vpp (struct map_info *map,int on) +static void ap_flash_set_vpp (struct platform_device *pdev,int on) {void __iomem *reg = on ?SC_CTRLS :SC_CTRLC ;
arch/arm/mach-integrator/integrator_cp.c +1 -1
@@ -259,7 +259,7 @@ static void intcp_flash_exit(struct platform_device *dev)writel (val,INTCP_VA_CTRL_BASE +INTCP_FLASHPROG ); } -static void intcp_flash_set_vpp (struct map_info *map,int on) +static void intcp_flash_set_vpp (struct platform_device *pdev,int on) {u32 val;
arch/arm/mach-omap1/flash.c +1 -1
@@ -13,7 +13,7 @@#include <plat/tc.h> #include <plat/flash.h> -void omap1_set_vpp (struct map_info *map,int enable) +void omap1_set_vpp (struct platform_device *pdev,int enable) {static int count;u32 l;
arch/arm/mach-pxa/hx4700.c +1 -1
@@ -735,7 +735,7 @@ static struct platform_device bq24022 = {* StrataFlash */ -static void hx4700_set_vpp (struct map_info *map,int vpp) +static void hx4700_set_vpp (struct platform_device *pdev,int vpp) {gpio_set_value (GPIO91_HX4700_FLASH_VPEN , vpp); }
arch/arm/mach-pxa/magician.c +1 -1
@@ -662,7 +662,7 @@ static struct pxaohci_platform_data magician_ohci_info = {* StrataFlash */ -static void magician_set_vpp (struct map_info *map,int vpp) +static void magician_set_vpp (struct platform_device *pdev,int vpp) {gpio_set_value (EGPIO_MAGICIAN_FLASH_VPP , vpp); }
arch/arm/mach-realview/core.c +1 -1
@@ -77,7 +77,7 @@ void __init realview_adjust_zones(unsigned long *size, unsigned long *hole)#define REALVIEW_FLASHCTRL (__io_address(REALVIEW_SYS_BASE) + REALVIEW_SYS_FLASH_OFFSET) -static void realview_flash_set_vpp (struct map_info *map,int on) +static void realview_flash_set_vpp (struct platform_device *pdev,int on) {u32 val;
arch/arm/mach-s3c2410/nor-simtec.c +1 -1
@@ -32,7 +32,7 @@#include "nor-simtec.h" -static void simtec_nor_vpp (struct map_info *map,int vpp) +static void simtec_nor_vpp (struct platform_device *pdev,int vpp) {unsigned int val;unsigned long flags;
arch/arm/mach-versatile/core.c +1 -1
@@ -190,7 +190,7 @@ void __init versatile_map_io(void)#define VERSATILE_FLASHCTRL (__io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_FLASH_OFFSET) -static void versatile_flash_set_vpp (struct map_info *map,int on) +static void versatile_flash_set_vpp (struct platform_device *pdev,int on) {u32 val;
arch/arm/mach-vexpress/v2m.c +1 -1
@@ -206,7 +206,7 @@ static struct platform_device v2m_usb_device = { .dev.platform_data = &v2m_usb_config, }; -static void v2m_flash_set_vpp (struct map_info *map,int on) +static void v2m_flash_set_vpp (struct platform_device *pdev,int on) {writel (on !=0 ,MMIO_P2V (V2M_SYS_FLASH )); }
arch/arm/plat-omap/include/plat/flash.h +1 -1
@@ -11,6 +11,6 @@#include <linux/mtd/map.h> -extern void omap1_set_vpp (struct map_info *map,int enable); +extern void omap1_set_vpp (struct platform_device *pdev,int enable);#endif
drivers/mtd/maps/physmap.c +15 -5
@@ -74,6 +74,18 @@ static int physmap_flash_remove(struct platform_device *dev)return 0 ; } +static void physmap_set_vpp (struct map_info *map,int state) +{ +struct platform_device *pdev; +struct physmap_flash_data *physmap_data; + + pdev = (struct platform_device *)map->map_priv_1; + physmap_data = pdev->dev.platform_data; + +if (physmap_data->set_vpp) + physmap_data->set_vpp (pdev, state); +} +static const char *rom_probe_types[] = {"cfi_probe" ,"jedec_probe" ,
@@ -81,10 +93,7 @@ static const char *rom_probe_types[] = {"map_rom" , NULL };#ifdef CONFIG_MTD_PARTITIONS -static const char *part_probe_types[] = {"cmdlinepart" ,"RedBoot" , -#ifdef CONFIG_MTD_AFS_PARTS -"afs" , -#endif +static const char *part_probe_types[] = {"cmdlinepart" ,"RedBoot" ,"afs" ,NULL };#endif
@@ -134,8 +143,9 @@ static int physmap_flash_probe(struct platform_device *dev) info->map[i].phys = dev->resource[i].start; info->map[i].size =resource_size (&dev->resource[i]); info->map[i].bankwidth = physmap_data->width; - info->map[i].set_vpp = physmap_data->set_vpp; + info->map[i].set_vpp = physmap_set_vpp; info->map[i].pfow_base = physmap_data->pfow_base; + info->map[i].map_priv_1 = (unsigned long )dev; info->map[i].virt =devm_ioremap (&dev->dev, info->map[i].phys, info->map[i].size);
drivers/mtd/maps/pismo.c +3 -37
@@ -50,39 +50,13 @@ struct pismo_data {struct platform_device *dev[PISMO_NUM_CS ]; }; -/* FIXME: set_vpp could do with a better calling convention */ -static struct pismo_data *vpp_pismo; -static DEFINE_MUTEX (pismo_mutex); - -static int pismo_setvpp_probe_fix (struct pismo_data *pismo) +static void pismo_set_vpp (struct platform_device *pdev,int on) { -mutex_lock (&pismo_mutex); -if (vpp_pismo) { -mutex_unlock (&pismo_mutex); -kfree (pismo); -return -EBUSY ; - } - vpp_pismo = pismo; -mutex_unlock (&pismo_mutex); -return 0 ; -} - -static void pismo_setvpp_remove_fix (struct pismo_data *pismo) -{ -mutex_lock (&pismo_mutex); -if (vpp_pismo == pismo) - vpp_pismo =NULL ; -mutex_unlock (&pismo_mutex); -} - -static void pismo_set_vpp (struct map_info *map,int on) -{ -struct pismo_data *pismo = vpp_pismo; +struct i2c_client *client =to_i2c_client (pdev->dev.parent); +struct pismo_data *pismo =i2c_get_clientdata (client); pismo->vpp (pismo->vpp_data, on); } -/* end of hack */ -static unsigned int __devinit pismo_width_to_bytes (unsigned int width) {
@@ -231,9 +205,6 @@ static int __devexit pismo_remove(struct i2c_client *client)for (i =0 ; i <ARRAY_SIZE (pismo->dev); i++)platform_device_unregister (pismo->dev[i]); -/* FIXME: set_vpp needs saner arguments */ -pismo_setvpp_remove_fix (pismo); -kfree (pismo);return 0 ;
@@ -257,11 +228,6 @@ static int __devinit pismo_probe(struct i2c_client *client,if (!pismo)return -ENOMEM ; -/* FIXME: set_vpp needs saner arguments */ - ret =pismo_setvpp_probe_fix (pismo); -if (ret) -return ret; - pismo->client = client;if (pdata) { pismo->vpp = pdata->set_vpp;
include/linux/mtd/physmap.h +1 -1
@@ -24,7 +24,7 @@ struct physmap_flash_data {unsigned int width;int (*init)(struct platform_device *);void (*exit)(struct platform_device *); -void (*set_vpp)(struct map_info *,int ); +void (*set_vpp)(struct platform_device *,int );unsigned int nr_parts;unsigned int pfow_base;char *probe_type;
Signature · 1 line
1.7.0.4
PATCH v6 8/8 MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
Quoted 11 lines · Marc Zyngier
The
set_vpp()method provided by physmap passes amap_infoback to the platform code, which has little relevance as far as the platform is concerned (this parameter is completely unused).Instead, pass the
platform_device, which can be used in the pismo driver to retrieve some important information in a nicer way, instead of the hack that was in place.The empty
set_vppfunction inboard-at572d940hf_ek.cis left untouched, as the board/SoC is scheduled for removal.
Quoted 9 lines
Cc Andrew Victor <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Russell King <[email protected]>Cc Philipp Zabel <[email protected]>Cc Eric Miao <[email protected]>Cc Ben Dooks <[email protected]>Cc David Woodhouse <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
PATCH v6 8/8 MTD: physmap: let set_vpp() pass a platform_device instead of a map_info
Quoted 22 lines · Artem Bityutskiy
Quoted 11 lines · Marc Zyngier
The
set_vpp()method provided by physmap passes amap_infoback to the platform code, which has little relevance as far as the platform is concerned (this parameter is completely unused).Instead, pass the
platform_device, which can be used in the pismo driver to retrieve some important information in a nicer way, instead of the hack that was in place.The empty
set_vppfunction inboard-at572d940hf_ek.cis left untouched, as the board/SoC is scheduled for removal.Quoted 9 lines
Cc Andrew Victor <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Russell King <[email protected]>Cc Philipp Zabel <[email protected]>Cc Eric Miao <[email protected]>Cc Ben Dooks <[email protected]>Cc David Woodhouse <[email protected]>Signed-off-by Marc Zyngier <[email protected]>
Quoted 1 line
Acked-by Artem Bityutskiy <[email protected]>
Best Regards,
J.
v6 cover Switch ARM platforms from integrator-flash to physmap
In reply to Marc ZyngierQuoted 4 lines · Marc Zyngier
As the integrator-flash driver is mostly a duplicate of physmap, move all users of this driver to physmap and get rid of the then unused driver.
Quoted 8 lines
Also change the
set_vpp()method in physmap to pass theplatform_deviceinstead of themap_info. This allows for a substantial cleanup indrivers/mtd/maps/pismo.cThis patch set has been ok'ed by RMK, who is willing to take it through his tree. This requires an ACK from the MTD maintainers. David Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it via the MTD tree.
I assume the whole series will go in via some subsystem arm tree?
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)
v6 cover Switch ARM platforms from integrator-flash to physmap
Quoted 9 lines · Artem Bityutskiy
Quoted 8 lines · Marc Zyngier
As the integrator-flash driver is mostly a duplicate of physmap, move all users of this driver to physmap and get rid of the then unused driver.
Also change the
set_vpp()method in physmap to pass theplatform_deviceinstead of themap_info. This allows for a substantial cleanup indrivers/mtd/maps/pismo.c
Quoted 7 lines
Quoted 4 lines
This patch set has been ok'ed by RMK, who is willing to take it through his tree. This requires an ACK from the MTD maintainers. David Woodhouse cc-ed on the whole patch set in case he'd prefer to merge it via the MTD tree.
I assume the whole series will go in via some subsystem arm tree?
Yes, it's been merged by Russell into his tree yesterday, after David's ack.
M.
Signature · 1 line
Reality is an implementation detail.
v6 cover Switch ARM platforms from integrator-flash to physmap
Quoted 2 lines · Marc Zyngier
Yes, it's been merged by Russell into his tree yesterday, after David's ack.
... and I've just added the new acks we've had today.
v6 cover Switch ARM platforms from integrator-flash to physmap
Quoted 5 lines · Russell King - ARM Linux
Quoted 2 lines · Marc Zyngier
Yes, it's been merged by Russell into his tree yesterday, after David's ack.
... and I've just added the new acks we've had today.
Thank you!
Signature · 2 lines
Best Regards, Artem Bityutskiy (????? ????????)