All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/7] env_mmc: align buffers using ALLOC_CACHE_ALIGN_BUFFER
@ 2012-05-24 21:38 Stephen Warren
  2012-05-24 21:38 ` [U-Boot] [PATCH 2/7] sf: winbond: Add support for the Winbond W25Q80BL Stephen Warren
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Stephen Warren @ 2012-05-24 21:38 UTC (permalink / raw)
  To: u-boot

From: Stephen Warren <swarren@nvidia.com>

This allows MMC drivers to perform cache flusing on the bufffers
without issue.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Cc: Andy Fleming <afleming@gmail.com>
---
 common/env_mmc.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/common/env_mmc.c b/common/env_mmc.c
index 0c58ae1..be2f2be 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -95,7 +95,7 @@ static inline int write_env(struct mmc *mmc, unsigned long size,
 
 int saveenv(void)
 {
-	env_t	env_new;
+	ALLOC_CACHE_ALIGN_BUFFER(env_t, env_new, 1);
 	ssize_t	len;
 	char	*res;
 	struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
@@ -104,16 +104,16 @@ int saveenv(void)
 	if (init_mmc_for_env(mmc) || mmc_get_env_addr(mmc, &offset))
 		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[0], ENV_SIZE);
 	printf("Writing to MMC(%d)... ", CONFIG_SYS_MMC_ENV_DEV);
-	if (write_env(mmc, CONFIG_ENV_SIZE, offset, (u_char *)&env_new)) {
+	if (write_env(mmc, CONFIG_ENV_SIZE, offset, (u_char *)env_new)) {
 		puts("failed\n");
 		return 1;
 	}
@@ -140,7 +140,7 @@ static inline int read_env(struct mmc *mmc, unsigned long size,
 void env_relocate_spec(void)
 {
 #if !defined(ENV_IS_EMBEDDED)
-	char buf[CONFIG_ENV_SIZE];
+	ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
 	struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
 	u32 offset;
 
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-20  4:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-24 21:38 [U-Boot] [PATCH 1/7] env_mmc: align buffers using ALLOC_CACHE_ALIGN_BUFFER Stephen Warren
2012-05-24 21:38 ` [U-Boot] [PATCH 2/7] sf: winbond: Add support for the Winbond W25Q80BL Stephen Warren
2012-07-20  4:37   ` Mike Frysinger
2012-05-24 21:38 ` [U-Boot] [PATCH 3/7] tegra: ventana: store environment in eMMC Stephen Warren
2012-05-24 21:38 ` [U-Boot] [PATCH 4/7] tegra: whistler: " Stephen Warren
2012-05-24 21:38 ` [U-Boot] [PATCH 5/7] tegra: trimslice: store environment in SPI flash Stephen Warren
2012-05-24 21:38 ` [U-Boot] [PATCH 6/7] tegra: paz00: store environment in eMMC Stephen Warren
2012-05-24 21:38 ` [U-Boot] [PATCH 7/7] tegra: seaboard: disable SPI, move environment to eMMC Stephen Warren
2012-05-31 23:39   ` Simon Glass
2012-06-01  0:00     ` Stephen Warren
2012-06-01  1:06       ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.