From 4036b6301efab9f5196e986a7e1d3925cf816c31 Mon Sep 17 00:00:00 2001 From: Stephen Warren Date: Thu, 24 May 2012 11:38:33 +0000 Subject: env_mmc: align buffers using ALLOC_CACHE_ALIGN_BUFFER This allows MMC drivers to perform cache flusing on the bufffers without issue. Signed-off-by: Stephen Warren Cc: Andy Fleming Signed-off-by: Tom Warren --- common/env_mmc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'common') diff --git a/common/env_mmc.c b/common/env_mmc.c index 0c58ae19b21..be2f2be205a 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; -- cgit v1.2.3 From 22b7cfff326b5de5bfe94d676d9051a115c6aad1 Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Thu, 5 Jan 2012 10:53:09 +0100 Subject: SPL: common/Makefile: Add image.c to SPL build This is needed for the SPEAr SPL support, as SPEAr uses the mkimage header to wrap and validate the images (SPL & U-Boot). Signed-off-by: Stefan Roese --- common/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common') diff --git a/common/Makefile b/common/Makefile index 31175e34d3b..483eb4daa30 100644 --- a/common/Makefile +++ b/common/Makefile @@ -31,7 +31,6 @@ COBJS-y += main.o COBJS-y += command.o COBJS-y += exports.o COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o -COBJS-y += image.o COBJS-y += s_record.o COBJS-$(CONFIG_SERIAL_MULTI) += serial.o COBJS-y += xyzModem.o @@ -191,6 +190,7 @@ COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += xyzModem.o endif COBJS-y += console.o COBJS-y += dlmalloc.o +COBJS-y += image.o COBJS-y += memsize.o COBJS-y += stdio.o -- cgit v1.2.3