From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Savinay Dharmappa <savinay.dharmappa@ti.com>
Cc: Aleksey Makarov <amakarov@ru.mvista.com>,
Sergei Shtylyov <sshtylyov@ru.mvista.com>,
davinci-linux-open-source@linux.davincidsp.com,
linux-mtd@lists.infradead.org
Subject: Re: [PATCH v3 2/2] davinci: Platform support for OMAP-L137/AM17x NOR flash driver
Date: Fri, 19 Nov 2010 14:42:28 +0300 [thread overview]
Message-ID: <4CE662A4.6060204@mvista.com> (raw)
In-Reply-To: <1290160488-10344-1-git-send-email-savinay.dharmappa@ti.com>
Hello.
On 19-11-2010 12:54, Savinay Dharmappa wrote:
> From: Aleksey Makarov <amakarov@ru.mvista.com>
> Adds platform support for OMAP-L137/AM17x NOR flash driver.
> Also, configures chip select 3 to control NOR flash's upper
> address lines.
> Signed-off-by: Aleksey Makarov <amakarov@ru.mvista.com>
> Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Signed-off-by: Savinay Dharmappa <savinay.dharmappa@ti.com>
[...]
> diff --git a/arch/arm/mach-davinci/board-da830-evm.c b/arch/arm/mach-davinci/board-da830-evm.c
> index b52a3a1..c807c1b 100644
> --- a/arch/arm/mach-davinci/board-da830-evm.c
> +++ b/arch/arm/mach-davinci/board-da830-evm.c
> @@ -20,6 +20,8 @@
> #include<linux/i2c/at24.h>
> #include<linux/mtd/mtd.h>
> #include<linux/mtd/partitions.h>
> +#include<linux/mtd/latch-addr-flash.h>
> +#include<linux/clk.h>
>
> #include<asm/mach-types.h>
> #include<asm/mach/arch.h>
> @@ -429,6 +431,220 @@ static inline void da830_evm_init_nand(int mux_mode)
> static inline void da830_evm_init_nand(int mux_mode) { }
> #endif
>
> +#ifdef CONFIG_DA830_UI_NOR
> +/*
> + * Number of lines going to the NOR flash that are latched using
> + * AEMIF address lines B_EMIF_BA0-B_EMIF_A12 on CS2.
You still left the words about latching the low address bytes...
> + */
> +#define NOR_WINDOW_SIZE_LOG2 15
> +#define NOR_WINDOW_SIZE (1<< NOR_WINDOW_SIZE_LOG2)
> +
> +static struct {
> + struct clk *clk;
> + struct {
> + void __iomem *addr;
> + } latch, aemif;
Don't need a structure here anymore.
> +static void da830_evm_nor_set_window(unsigned long offset, void *data)
> +{
> + /*
> + * CS2 and CS3 address lines are used to address NOR flash. Address
> + * line
Only "lines".
> A0-A14 going to
Rather "from"...
> the NOR flash are connected to AEMIF address
> + * lines B_EMIF_BA0-B_EMIF_A12 on CS2. Address lines A15-A23 of the
> + * NOR flash are connected to AEMIF address lines B_EMIF_A0-B_EMIF_A6
> + * on CS3.
They are not connected but latched from B_EMIF_A0-B_EMIF_A6 on CS3.
> + /* Setup AEMIF -- timings, etc. */
> +
> + /* Set maximum wait cycles */
> + davinci_aemif_setup_timing(&da830_evm_norflash_timing,
> + da830_evm_nor.aemif.addr, cs);
> +
> + davinci_aemif_setup_timing(&da830_evm_norflash_timing,
> + da830_evm_nor.aemif.addr, cs + 1);
> +
> + /* Setup the window to access the latch */
> + res = request_mem_region(DA8XX_AEMIF_CS3_BASE, PAGE_SIZE,
> + "DA830 UI NOR address latch");
> + if (res == NULL) {
> + pr_err("%s: could not request address latch region\n",
> + __func__);
> + goto err_aemif_ioremap;
> + }
> +
> + da830_evm_nor.latch.addr =
> + ioremap_nocache(DA8XX_AEMIF_CS3_BASE, PAGE_SIZE);
> + if (da830_evm_nor.latch.addr == NULL) {
> + pr_err("%s: could not remap address latch region\n", __func__);
> + goto err_latch_region;
> + }
> + return 0;
> +
> +err_latch_region:
> + release_mem_region(DA8XX_AEMIF_CS3_BASE, PAGE_SIZE);
> +
> +err_aemif_ioremap:
> + iounmap(da830_evm_nor.aemif.addr);
> +
> +err_aemif_region:
> + release_mem_region(DA8XX_AEMIF_CTL_BASE, SZ_32K);
> +
> +err_clk:
> + clk_disable(da830_evm_nor.clk);
> + clk_put(da830_evm_nor.clk);
> +
> + return -EBUSY;
You should return -ENOMEM for ioremap() failures...
WBR, Sergei
prev parent reply other threads:[~2010-11-19 11:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-19 9:54 [PATCH v3 2/2] davinci: Platform support for OMAP-L137/AM17x NOR flash driver Savinay Dharmappa
2010-11-19 11:42 ` Sergei Shtylyov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4CE662A4.6060204@mvista.com \
--to=sshtylyov@mvista.com \
--cc=amakarov@ru.mvista.com \
--cc=davinci-linux-open-source@linux.davincidsp.com \
--cc=linux-mtd@lists.infradead.org \
--cc=savinay.dharmappa@ti.com \
--cc=sshtylyov@ru.mvista.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).