]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib/lmb.c
sama5d3xek: run PHY's config
[karo-tx-uboot.git] / lib / lmb.c
index 081e4181b45c10c4980062eb5506ae4bfa0e4948..41a2be463565c6b519841902cba45b43839ef69a 100644 (file)
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -295,7 +295,10 @@ phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, phy
                if (max_addr == LMB_ALLOC_ANYWHERE)
                        base = lmb_align_down(lmbbase + lmbsize - size, align);
                else if (lmbbase < max_addr) {
-                       base = min(lmbbase + lmbsize, max_addr);
+                       base = lmbbase + lmbsize;
+                       if (base < lmbbase)
+                               base = -1;
+                       base = min(base, max_addr);
                        base = lmb_align_down(base - size, align);
                } else
                        continue;
@@ -332,14 +335,12 @@ int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr)
        return 0;
 }
 
-void __board_lmb_reserve(struct lmb *lmb)
+__weak void board_lmb_reserve(struct lmb *lmb)
 {
        /* please define platform specific board_lmb_reserve() */
 }
-void board_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__board_lmb_reserve")));
 
-void __arch_lmb_reserve(struct lmb *lmb)
+__weak void arch_lmb_reserve(struct lmb *lmb)
 {
        /* please define platform specific arch_lmb_reserve() */
 }
-void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak, alias("__arch_lmb_reserve")));