linux-mips
[Top] [All Lists]

Re: [PATCH V7] MIPS: lantiq: add NOR flash support

To: John Crispin <blogic@openwrt.org>
Subject: Re: [PATCH V7] MIPS: lantiq: add NOR flash support
From: Artem Bityutskiy <dedekind1@gmail.com>
Date: Tue, 05 Apr 2011 15:36:35 +0300
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org, Ralph Hempel <ralph.hempel@lantiq.com>, linux-mtd@lists.infradead.org, Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>, David Woodhouse <dwmw2@infradead.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:subject:from:reply-to:to:cc:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=2xYNuAScJ9PM9Whs4G+CHX2yGB1Vd8TqRecRSqMDsWw=; b=n9otRSjh2yl0fHkWIRNUFSuLUb1Ams+eOmkc1BuxeN34ispwp0wfxO8c1PDvu4zXKp OxpVDyi+5Nb4b2fXfLIyHUT5gujK7E9pClIsbQF8h3evBZ3bsD/QFiIJUHYjrDlHkAx1 pzxPPzXix1xPqXPUVLf1mNVmvQlaQnq+kDWlo=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:reply-to:to:cc:in-reply-to:references:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; b=F2IyGSubHLmdW1oubxnHBiIC7UNMwKMJjH1PnYQlcuC6d8w/Ar5+BZl1I4omIBzSW4 q/PRCJXljYKmrX/w0ZjACw3JddleCfHwmS3Bklb75BOiLDvUiXuZ9rilBNdmbs4EkNp6 FOgcuFcBrFcUlZpUqV8VLadpSC1Tj0i8Qe9H0=
In-reply-to: <1302006830-10345-1-git-send-email-blogic@openwrt.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1302006830-10345-1-git-send-email-blogic@openwrt.org>
Reply-to: dedekind1@gmail.com
Sender: linux-mips-bounce@linux-mips.org
On Tue, 2011-04-05 at 14:33 +0200, John Crispin wrote:
> +#include <lantiq_soc.h>
> +#include <lantiq_platform.h>
> +
> +/* 
> + * The NOR flash is connected to the same external bus unit (EBU) as PCI.
> + * To make PCI work we need to enable the endianess swapping for the address
> + * written to the EBU. This endianess swapping works for PCI correctly but
> + * fails for attached NOR devices. To workaround this we need to use a 
> complex
> + * map. The workaround involves swapping all addresses whilste probing the 
> chip.
> + * Once probing is complete we stop swapping the addresses but swizzle the
> + * unlock addresses to ensure that access to the NOR device works correctly.
> + */
> +
> +static int ltq_mtd_probing;
Disclamer: I do not really understand the PCI/swapping issue, even
though you wrote a comment about this, but still....

... I'm worried about this global variable. If you have multiple
instances of such NOR flash, then you theoretically may have a situation
when one of them is being probed, while another is being used for real.
And this single global switch will break the one which is used for real.

IOW, the right solution would be to have per-chip flag, not a global
flag.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)


<Prev in Thread] Current Thread [Next in Thread>