* [U-Boot] [PATCH] env_nand: align NAND buffers
@ 2012-07-30 17:38 Stephen Warren
2012-07-30 20:36 ` Simon Glass
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Stephen Warren @ 2012-07-30 17:38 UTC (permalink / raw)
To: u-boot
From: Stephen Warren <swarren@nvidia.com>
This allows cache flush/invalidate operations to succeed on the buffers.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
common/env_nand.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/common/env_nand.c b/common/env_nand.c
index e8daec9..e635472 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -226,7 +226,7 @@ int saveenv(void)
int saveenv(void)
{
int ret = 0;
- env_t env_new;
+ ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t));
ssize_t len;
char *res;
nand_erase_options_t nand_erase_options;
@@ -238,20 +238,20 @@ int saveenv(void)
if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
return 1;
- res = (char *)&env_new.data;
+ res = (char *)&env_new->data;
len = hexport_r(&env_htab, '\0', &res, ENV_SIZE, 0, NULL);
if (len < 0) {
error("Cannot export environment: errno = %d\n", errno);
return 1;
}
- env_new.crc = crc32(0, env_new.data, ENV_SIZE);
+ env_new->crc = crc32(0, env_new->data, ENV_SIZE);
puts("Erasing Nand...\n");
if (nand_erase_opts(&nand_info[0], &nand_erase_options))
return 1;
puts("Writing to Nand... ");
- if (writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new)) {
+ if (writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new)) {
puts("FAILED!\n");
return 1;
}
@@ -398,7 +398,7 @@ void env_relocate_spec(void)
{
#if !defined(ENV_IS_EMBEDDED)
int ret;
- char buf[CONFIG_ENV_SIZE];
+ ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
#if defined(CONFIG_ENV_OFFSET_OOB)
ret = get_nand_env_oob(&nand_info[0], &nand_env_oob_offset);
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
2012-07-30 17:38 [U-Boot] [PATCH] env_nand: align NAND buffers Stephen Warren
@ 2012-07-30 20:36 ` Simon Glass
2012-07-30 21:10 ` Wolfgang Denk
2012-07-30 23:01 ` Scott Wood
2012-09-02 15:40 ` Wolfgang Denk
2 siblings, 1 reply; 7+ messages in thread
From: Simon Glass @ 2012-07-30 20:36 UTC (permalink / raw)
To: u-boot
On Mon, Jul 30, 2012 at 6:38 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This allows cache flush/invalidate operations to succeed on the buffers.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
> ---
> common/env_nand.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/common/env_nand.c b/common/env_nand.c
> index e8daec9..e635472 100644
> --- a/common/env_nand.c
> +++ b/common/env_nand.c
> @@ -226,7 +226,7 @@ int saveenv(void)
> int saveenv(void)
> {
> int ret = 0;
> - env_t env_new;
> + ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t));
I think this should b
> ssize_t len;
> char *res;
> nand_erase_options_t nand_erase_options;
> @@ -238,20 +238,20 @@ int saveenv(void)
> if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
> return 1;
>
> - res = (char *)&env_new.data;
> + res = (char *)&env_new->data;
> len = hexport_r(&env_htab, '\0', &res, ENV_SIZE, 0, NULL);
> if (len < 0) {
> error("Cannot export environment: errno = %d\n", errno);
> return 1;
> }
> - env_new.crc = crc32(0, env_new.data, ENV_SIZE);
> + env_new->crc = crc32(0, env_new->data, ENV_SIZE);
>
> puts("Erasing Nand...\n");
> if (nand_erase_opts(&nand_info[0], &nand_erase_options))
> return 1;
>
> puts("Writing to Nand... ");
> - if (writeenv(CONFIG_ENV_OFFSET, (u_char *)&env_new)) {
> + if (writeenv(CONFIG_ENV_OFFSET, (u_char *)env_new)) {
> puts("FAILED!\n");
> return 1;
> }
> @@ -398,7 +398,7 @@ void env_relocate_spec(void)
> {
> #if !defined(ENV_IS_EMBEDDED)
> int ret;
> - char buf[CONFIG_ENV_SIZE];
> + ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
>
> #if defined(CONFIG_ENV_OFFSET_OOB)
> ret = get_nand_env_oob(&nand_info[0], &nand_env_oob_offset);
> --
> 1.7.0.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
2012-07-30 20:36 ` Simon Glass
@ 2012-07-30 21:10 ` Wolfgang Denk
2012-07-30 21:43 ` Simon Glass
0 siblings, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2012-07-30 21:10 UTC (permalink / raw)
To: u-boot
Dear Simon Glass,
In message <CAPnjgZ2gJLhmZyXB1DW=83GBdf1QNv_=Q+QfprAwCzx4Yq7_sA@mail.gmail.com> you wrote:
>
> > - env_t env_new;
> > + ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t));
>
> I think this should b
Should be ... ???
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Be wiser than other people if you can, but do not tell them so.
-- Philip Earl of Chesterfield
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
2012-07-30 21:10 ` Wolfgang Denk
@ 2012-07-30 21:43 ` Simon Glass
0 siblings, 0 replies; 7+ messages in thread
From: Simon Glass @ 2012-07-30 21:43 UTC (permalink / raw)
To: u-boot
Hi Wolfgang,
On Mon, Jul 30, 2012 at 10:10 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Simon Glass,
>
> In message <CAPnjgZ2gJLhmZyXB1DW=83GBdf1QNv_=Q+QfprAwCzx4Yq7_sA@mail.gmail.com> you wrote:
>>
>> > - env_t env_new;
>> > + ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, sizeof(env_t));
>>
>> I think this should b
>
> Should be ... ???
Sorry, I started a comment, but thought better of it. It looks fine to me.
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Be wiser than other people if you can, but do not tell them so.
> -- Philip Earl of Chesterfield
Regards,
Simon
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
2012-07-30 17:38 [U-Boot] [PATCH] env_nand: align NAND buffers Stephen Warren
2012-07-30 20:36 ` Simon Glass
@ 2012-07-30 23:01 ` Scott Wood
[not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379D9FEF5D@HQMAIL04.nvidia.com>
2012-09-02 15:40 ` Wolfgang Denk
2 siblings, 1 reply; 7+ messages in thread
From: Scott Wood @ 2012-07-30 23:01 UTC (permalink / raw)
To: u-boot
On 07/30/2012 12:38 PM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This allows cache flush/invalidate operations to succeed on the buffers.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> common/env_nand.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
Acked-by: Scott Wood <scottwood@freescale.com>
I'm assuming you want it to go with the Tegra patches and not via my tree.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
[not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379D9FEF5D@HQMAIL04.nvidia.com>
@ 2012-07-31 16:39 ` Scott Wood
0 siblings, 0 replies; 7+ messages in thread
From: Scott Wood @ 2012-07-31 16:39 UTC (permalink / raw)
To: u-boot
On 07/31/2012 10:59 AM, Tom Warren wrote:
> Scott,
>
>> -----Original Message-----
>> From: Scott Wood [mailto:scottwood at freescale.com]
>> Sent: Monday, July 30, 2012 4:01 PM
>> To: Stephen Warren
>> Cc: Tom Warren; Simon Glass; U-Boot Mailing List; Stephen Warren
>> Subject: Re: [PATCH] env_nand: align NAND buffers
>>
>> On 07/30/2012 12:38 PM, Stephen Warren wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> This allows cache flush/invalidate operations to succeed on the buffers.
>>>
>>> Signed-off-by: Stephen Warren <swarren@nvidia.com>
>>> ---
>>> common/env_nand.c | 10 +++++-----
>>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>
>> Acked-by: Scott Wood <scottwood@freescale.com>
>>
>> I'm assuming you want it to go with the Tegra patches and not via my tree.
> I'm fine with taking the env_nand and cmd_nand changes thru the Tegra tree. Let me know if that's OK with you.
It's OK with me.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] env_nand: align NAND buffers
2012-07-30 17:38 [U-Boot] [PATCH] env_nand: align NAND buffers Stephen Warren
2012-07-30 20:36 ` Simon Glass
2012-07-30 23:01 ` Scott Wood
@ 2012-09-02 15:40 ` Wolfgang Denk
2 siblings, 0 replies; 7+ messages in thread
From: Wolfgang Denk @ 2012-09-02 15:40 UTC (permalink / raw)
To: u-boot
Dear Stephen Warren,
In message <1343669918-2114-1-git-send-email-swarren@wwwdotorg.org> you wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> This allows cache flush/invalidate operations to succeed on the buffers.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> common/env_nand.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Violence in reality is quite different from theory.
-- Spock, "The Cloud Minders", stardate 5818.4
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-09-02 15:40 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-30 17:38 [U-Boot] [PATCH] env_nand: align NAND buffers Stephen Warren
2012-07-30 20:36 ` Simon Glass
2012-07-30 21:10 ` Wolfgang Denk
2012-07-30 21:43 ` Simon Glass
2012-07-30 23:01 ` Scott Wood
[not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379D9FEF5D@HQMAIL04.nvidia.com>
2012-07-31 16:39 ` Scott Wood
2012-09-02 15:40 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox