Index: firmware/export/system.h =================================================================== --- firmware/export/system.h (revision 28569) +++ firmware/export/system.h (working copy) @@ -309,18 +309,22 @@ } #endif -#ifndef CACHEALIGN_SIZE /* could be elsewhere for a particular reason */ +/* Calculate CACHEALIGN_SIZE from CACHEALIGN_BITS */ +#ifdef CACHEALIGN_SIZE + /* undefine, if defined. always calculate from CACHEALIGN_BITS */ + #undef CACHEALIGN_SIZE +#endif #ifdef CACHEALIGN_BITS -/* 2^CACHEALIGN_BITS = the byte size */ -#define CACHEALIGN_SIZE (1u << CACHEALIGN_BITS) + /* CACHEALIGN_BITS = 2 ^ CACHEALIGN_BITS */ + #define CACHEALIGN_SIZE (1u << CACHEALIGN_BITS) + #warning ping #else -#define CACHEALIGN_SIZE 16 /* FIXME */ + /* FIXME: set to maximum known cache alignment of supported CPUs */ + #define CACHEALIGN_BITS 5 + #define CACHEALIGN_SIZE 32 #endif -#endif /* CACHEALIGN_SIZE */ -#ifdef PROC_NEEDS_CACHEALIGN /* Cache alignment attributes and sizes are enabled */ - #define CACHEALIGN_ATTR __attribute__((aligned(CACHEALIGN_SIZE))) /* Aligns x up to a CACHEALIGN_SIZE boundary */ #define CACHEALIGN_UP(x) \ @@ -335,19 +339,6 @@ #define CACHEALIGN_BUFFER(start, size) \ ALIGN_BUFFER((start), (size), CACHEALIGN_SIZE) -#else /* ndef PROC_NEEDS_CACHEALIGN */ - -/* Cache alignment attributes and sizes are not enabled */ -#define CACHEALIGN_ATTR -#define CACHEALIGN_AT_LEAST_ATTR(x) \ - __attribute__((aligned(x))) -#define CACHEALIGN_UP(x) (x) -#define CACHEALIGN_DOWN(x) (x) -/* Make no adjustments */ -#define CACHEALIGN_BUFFER(start, size) - -#endif /* PROC_NEEDS_CACHEALIGN */ - #ifdef STORAGE_WANTS_ALIGN #define STORAGE_ALIGN_ATTR __attribute__((aligned(CACHEALIGN_SIZE))) #define STORAGE_ALIGN_DOWN(x) \ Index: firmware/export/imx31l.h =================================================================== --- firmware/export/imx31l.h (revision 28569) +++ firmware/export/imx31l.h (working copy) @@ -38,7 +38,6 @@ #define FRAME ((void *)(FRAME_PHYS_ADDR+0x100000-CSD0_BASE_ADDR)) #define CACHEALIGN_BITS 5 -#define CACHEALIGN_SIZE 32 #define NOCACHE_BASE CSD0_BASE_ADDR /* USBOTG */ Index: firmware/target/arm/system-target.h =================================================================== --- firmware/target/arm/system-target.h (revision 28569) +++ firmware/target/arm/system-target.h (working copy) @@ -158,10 +158,6 @@ ((typeof (a))((uintptr_t)(a) | UNCACHED_BASE_ADDR)) #endif /* BOOTLOADER */ -/* Certain data needs to be out of the way of cache line interference - * such as data for COP use or for use with UNCACHED_ADDR */ -#define PROC_NEEDS_CACHEALIGN - #if defined(CPU_PP502x) && defined(HAVE_ATA_DMA) #define STORAGE_WANTS_ALIGN #endif