From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ladislav Michl Subject: Re: [PATCH v2 2/3] OMAP: SDP: Introducing 'board-sdp-flash.c' for flash init Date: Mon, 8 Feb 2010 14:52:09 +0100 Message-ID: <20100208135209.GA11847@localhost.localdomain> References: Reply-To: Ladislav Michl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.seznam.cz ([77.75.76.43]:59525 "EHLO smtp.seznam.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751283Ab0BHMwO (ORCPT ); Mon, 8 Feb 2010 07:52:14 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Vimal Singh Cc: linux-omap@vger.kernel.org, Tony Lindgren > diff --git a/arch/arm/mach-omap2/board-sdp-flash.c > b/arch/arm/mach-omap2/board-sdp-flash.c > new file mode 100644 > index 0000000..54ef19f > --- /dev/null > +++ b/arch/arm/mach-omap2/board-sdp-flash.c [snip] > +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); > + } > + } > + } > +} Hmm, as you are adding files into arch/arm/mach-omap2 directory, is there a chance cpu_class_is_omap1() ever returns non-zero? > +static struct physmap_flash_data sdp_nor_data = { > + .width = 2, > + .set_vpp = omap_set_vpp, > +}; ... and in case there is not, just leave set_vpp set to NULL and delete this incarnation of omap_set_vpp.