summaryrefslogtreecommitdiff
path: root/include/lmb.h
diff options
context:
space:
mode:
authorSimon Goldschmidt <simon.k.r.goldschmidt@gmail.com>2019-01-26 22:13:04 +0100
committerTom Rini <trini@konsulko.com>2019-02-02 08:19:17 -0500
commit9cc2323feebdde500f50f7abb855045dbde765cb (patch)
tree7d4c0bf226c098a560620457a6e4a96321a47bee /include/lmb.h
parente3b4fc9598388f47632a8c802aaa68b1154526f2 (diff)
lmb: handle more than one DRAM BANK
This fixes the automatic lmb initialization and reservation for boards with more than one DRAM bank. This fixes the CVE-2018-18439 and -18440 fixes that only allowed to load files into the firs DRAM bank from fs and via tftp. Found-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/lmb.h')
-rw-r--r--include/lmb.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/lmb.h b/include/lmb.h
index e87c0b0ada..3b338dfee0 100644
--- a/include/lmb.h
+++ b/include/lmb.h
@@ -4,6 +4,8 @@
#ifdef __KERNEL__
#include <asm/types.h>
+#include <asm/u-boot.h>
+
/*
* Logical memory blocks.
*
@@ -29,8 +31,9 @@ struct lmb {
};
extern void lmb_init(struct lmb *lmb);
-extern void lmb_init_and_reserve(struct lmb *lmb, phys_addr_t base,
- phys_size_t size, void *fdt_blob);
+extern void lmb_init_and_reserve(struct lmb *lmb, bd_t *bd, void *fdt_blob);
+extern void lmb_init_and_reserve_range(struct lmb *lmb, phys_addr_t base,
+ phys_size_t size, void *fdt_blob);
extern long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size);
extern long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size);
extern phys_addr_t lmb_alloc(struct lmb *lmb, phys_size_t size, ulong align);