Re: [RFC] use physmap-flash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Ladislav Michl <Ladislav.Michl@xxxxxxxxx> [091205 15:34]:
> Hi!
> 
> and sorry for touching ancient stuff again... Also sorry for long Cc list,
> which is not even complete, because some projects seem to be dead now.
> 
> So, are there any objections to remove drivers/mtd/maps/omap_nor.c entirely
> in favour of physmap-flash?

Absolutely no objections from me!

Regards,

Tony
 
> $ rgrep omapflash arch/arm | sed "s/:.*//" | sort | uniq
> arch/arm/mach-omap1/board-fsample.c
> arch/arm/mach-omap1/board-h2.c
> arch/arm/mach-omap1/board-h3.c
> arch/arm/mach-omap1/board-innovator.c
> arch/arm/mach-omap1/board-osk.c
> arch/arm/mach-omap1/board-palmte.c
> arch/arm/mach-omap1/board-palmtt.c
> arch/arm/mach-omap1/board-palmz71.c
> arch/arm/mach-omap1/board-perseus2.c
> arch/arm/mach-omap1/board-sx1.c
> arch/arm/mach-omap2/board-2430sdp.c
> arch/arm/mach-omap2/board-h4.c
> 
> Note that list is missing board-voiceblue.c, which is converted by patch bellow.
> Function omap_set_vpp should be probably moved somewhere to plat-omap.
> Suggestions?
> 
> diff --git a/arch/arm/mach-omap1/board-voiceblue.c b/arch/arm/mach-omap1/board-voiceblue.c
> index 35c75c1..30e6d0d 100644
> --- a/arch/arm/mach-omap1/board-voiceblue.c
> +++ b/arch/arm/mach-omap1/board-voiceblue.c
> @@ -22,11 +22,11 @@
>  #include <linux/reboot.h>
>  #include <linux/serial_8250.h>
>  #include <linux/serial_reg.h>
> +#include <linux/mtd/physmap.h>
>  
>  #include <mach/hardware.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> -#include <asm/mach/flash.h>
>  #include <asm/mach/map.h>
>  
>  #include <plat/common.h>
> @@ -85,9 +85,31 @@ static int __init ext_uart_init(void)
>  }
>  arch_initcall(ext_uart_init);
>  
> -static struct flash_platform_data voiceblue_flash_data = {
> -	.map_name	= "cfi_probe",
> +static void omap_set_vpp(struct map_info *map, int enable)
> +{
> +	static int count;
> +	u32 l;
> +
> +	if (cpu_class_is_omap1()) {
> +		if (enable) {
> +			if (count++ == 0) {
> +				l = omap_readl(EMIFS_CONFIG);
> +				l |= OMAP_EMIFS_CONFIG_WP;
> +				omap_writel(l, EMIFS_CONFIG);
> +			}
> +		} else {
> +			if (count && (--count == 0)) {
> +				l = omap_readl(EMIFS_CONFIG);
> +				l &= ~OMAP_EMIFS_CONFIG_WP;
> +				omap_writel(l, EMIFS_CONFIG);
> +			}
> +		}
> +	}
> +}
> +
> +static struct physmap_flash_data voiceblue_flash_data = {
>  	.width		= 2,
> +	.set_vpp	= omap_set_vpp,
>  };
>  
>  static struct resource voiceblue_flash_resource = {
> @@ -97,7 +119,7 @@ static struct resource voiceblue_flash_resource = {
>  };
>  
>  static struct platform_device voiceblue_flash_device = {
> -	.name		= "omapflash",
> +	.name		= "physmap-flash",
>  	.id		= 0,
>  	.dev		= {
>  		.platform_data	= &voiceblue_flash_data,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux