diff options
author | Michal Simek <michal.simek@xilinx.com> | 2016-12-06 16:31:53 +0100 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2016-12-08 10:04:20 +0100 |
commit | 8a5db0ab9ab40d26729657e92f83af8d00bc3861 (patch) | |
tree | a59e415df2ceefb64e8514ad5f3c2035eeb40ba7 /board/xilinx/zynq | |
parent | 64b67fb24bf4dfd4e15a6e43ba2ed4e5fa31b5b0 (diff) | |
download | u-boot-8a5db0ab9ab40d26729657e92f83af8d00bc3861.tar.gz |
zynqmp works
Diffstat (limited to 'board/xilinx/zynq')
-rw-r--r-- | board/xilinx/zynq/board.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/board/xilinx/zynq/board.c b/board/xilinx/zynq/board.c index c5e7b99d97..4daff8f4f1 100644 --- a/board/xilinx/zynq/board.c +++ b/board/xilinx/zynq/board.c @@ -135,6 +135,34 @@ static const void *get_memory_reg_prop(const void *fdt, int *lenp) return fdt_getprop(fdt, offset, "reg", lenp); } +int dram_init(void) +{ + const void *fdt = gd->fdt_blob; + const fdt32_t *val; + int ac, sc, len; + + ac = fdt_address_cells(fdt, 0); + sc = fdt_size_cells(fdt, 0); + if (ac < 0 || sc < 1 || sc > 2) { + printf("invalid address/size cells\n"); + return -EINVAL; + } + + val = get_memory_reg_prop(fdt, &len); + if (len / sizeof(*val) < ac + sc) + return -EINVAL; + + val += ac; + + gd->ram_size = fdtdec_get_number(val, sc); + + debug("DRAM size = %08lx\n", (unsigned long)gd->ram_size); + + zynq_ddrc_init(); + + return 0; +} + void dram_init_banksize(void) { const void *fdt = gd->fdt_blob; @@ -168,34 +196,6 @@ void dram_init_banksize(void) (unsigned long)gd->bd->bi_dram[i].size); } } - -int dram_init(void) -{ - const void *fdt = gd->fdt_blob; - const fdt32_t *val; - int ac, sc, len; - - ac = fdt_address_cells(fdt, 0); - sc = fdt_size_cells(fdt, 0); - if (ac < 0 || sc < 1 || sc > 2) { - printf("invalid address/size cells\n"); - return -EINVAL; - } - - val = get_memory_reg_prop(fdt, &len); - if (len / sizeof(*val) < ac + sc) - return -EINVAL; - - val += ac; - - gd->ram_size = fdtdec_get_number(val, sc); - - debug("DRAM size = %08lx\n", (unsigned long)gd->ram_size); - - zynq_ddrc_init(); - - return 0; -} #else int dram_init(void) { |