public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Albert ARIBAUD <albert.aribaud@free.fr>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V2 1/2] [NEXT] orion5x: fix relocation-incompatible code
Date: Mon, 27 Sep 2010 08:47:01 +0200	[thread overview]
Message-ID: <4CA03DE5.9050609@free.fr> (raw)
In-Reply-To: <F766E4F80769BD478052FB6533FA745D19A696E1AF@SC-VEXCH4.marvell.com>

Le 27/09/2010 08:36, Prafulla Wadaskar a ?crit :
>
>
>> -----Original Message-----
>> From: Albert ARIBAUD [mailto:albert.aribaud at free.fr]
>> Sent: Monday, September 27, 2010 12:05 PM
>> To: Prafulla Wadaskar
>> Cc: u-boot at lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik
>> Subject: Re: [U-Boot] [PATCH V2 1/2] [NEXT] orion5x: fix
>> relocation-incompatible code
>>
>> Le 27/09/2010 07:52, Prafulla Wadaskar a ?crit :
>>
>>>> + * NOTES:
>>
>>>> + * 2) in order to avoid losing access to BOOTCS when
>>>> disabling window 7,
>>>> + *    first configure window 6 for BOOTCS, then configure
>>>> window 7 for BOOTCS,
>>>> + *    then configure windows 6 for its own target.
>>
>>>> +/* Disable window 6, configure it for FLASH, enable it. */
>>>> +	writel(0,&winregs[6].ctrl);
>>>> +	writel(ORION5X_ADR_BOOTROM,&winregs[6].base);
>>>> +	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_BOOTROM,
>>>> +		ORION5X_TARGET_DEVICE, ORION5X_ATTR_BOOTROM,
>>>>    		ORION5X_WIN_ENABLE),&winregs[6].ctrl);
>>>> -	writel(ORION5X_ADR_DEV_CS2,&winregs[6].base);
>>>> -
>>>> -	/* Window 7: BOOT Memory address space */
>>>> +/* Disable window 7, configure it for FLASH, enable it. */
>>>> +	writel(0,&winregs[7].ctrl);
>>>> +	writel(ORION5X_ADR_BOOTROM,&winregs[7].base);
>>>>    	writel(ORION5X_CPU_WIN_CTRL_DATA(ORION5X_SZ_BOOTROM,
>>>>    		ORION5X_TARGET_DEVICE, ORION5X_ATTR_BOOTROM,
>>>>    		ORION5X_WIN_ENABLE),&winregs[7].ctrl);
>>>> -	writel(ORION5X_ADR_BOOTROM,&winregs[7].base);
>>>> +/* Disable window 6, configure it for its intended target,
>>>> enable it. */
>>>> +	writel(0,&winregs[6].ctrl);
>>>
>>> This conflicts with above win6 configuration.
>>> If done purposely then pls provide comments.
>>>
>>> Regards..
>>> Prafulla . .
>>
>> Er... The comment *is* there, right before the sequence.
>
> Why do you need to configure win6 twice?

Because if I don't set a window beside 7 to access BOOTCS, then 
reconfiguring window 7 (BOOTCs, i.e. FLASH) leaves the system with no 
access to BOOT CS thus no access to FLASH thus no way to continue 
executing this code, which runs from FLASH.

Thus I chose window 6 (I could have chosen any other, of course) and set 
it up for flash so that code can still run while reconfiguring window 7; 
then window 6 must, and can safely, be reconfigured for its own target.

(This issue of FLASH access does not happen on designs where boot is 
from NAND, of course; but the fix would be harmless even on these)

> Regards..
> Prafulla . .

Amicalement,
-- 
Albert.

  reply	other threads:[~2010-09-27  6:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-23 19:49 [U-Boot] [PATCH V2 1/2] [NEXT] orion5x: fix relocation-incompatible code Albert Aribaud
2010-09-23 19:49 ` [U-Boot] [PATCH V2 2/2] [NEXT] edminiv2: enable relocation Albert Aribaud
2010-10-11 11:30   ` Wolfgang Denk
2010-10-11 11:42     ` Albert ARIBAUD
2010-10-11 11:47       ` Albert ARIBAUD
2010-10-11 12:29         ` Wolfgang Denk
2010-10-11 12:30       ` Wolfgang Denk
2010-09-27  5:52 ` [U-Boot] [PATCH V2 1/2] [NEXT] orion5x: fix relocation-incompatible code Prafulla Wadaskar
2010-09-27  6:34   ` Albert ARIBAUD
2010-09-27  6:36     ` Prafulla Wadaskar
2010-09-27  6:47       ` Albert ARIBAUD [this message]
2010-10-11 12:37 ` Wolfgang Denk

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=4CA03DE5.9050609@free.fr \
    --to=albert.aribaud@free.fr \
    --cc=u-boot@lists.denx.de \
    /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