]> git.kernelconcepts.de Git - karo-tx-redboot.git/blobdiff - packages/hal/arm/mx53/karo/v1_0/include/plf_io.h
Fixup messed up source code from previous release
[karo-tx-redboot.git] / packages / hal / arm / mx53 / karo / v1_0 / include / plf_io.h
index 4453514eb9ddb654d36d9b153418cfb29d904b55..7505819aeecd8fb51aad18f752631b92de5c63ad 100644 (file)
 #include CYGBLD_HAL_PLF_DEFS_H
 #include <cyg/hal/hal_soc.h>
 
+#define __ul(x)                        ((unsigned long)(x))
+#define CYGARC_PHYSICAL_ADDRESS(x) ((__ul(x) < SDRAM_SIZE) ?                   \
+       (__ul(x) + ((__ul(x) < RAM_BANK0_SIZE) ? \
+       RAM_BANK0_BASE : RAM_BANK1_BASE - RAM_BANK0_SIZE)) :    \
+       ((__ul(x) >= RAM_BANK0_BASE) && (__ul(x) < RAM_BANK0_BASE + SDRAM_SIZE)) ? \
+       (((__ul(x) < RAM_BANK0_BASE + RAM_BANK0_SIZE)) ? \
+       __ul(x) : __ul(x) - RAM_BANK0_BASE + RAM_BANK1_BASE - RAM_BANK0_SIZE) : ~0)
+
 #ifdef RAM_BANK1_SIZE
 #define CYGHWR_REDBOOT_LINUX_ATAG_MEM(_p_)                                                     \
        CYG_MACRO_START                                                                                                 \