]>
git.ipfire.org Git - people/ms/u-boot.git/blob - board/compulab/cm_fx6/cm_fx6.c
2 * Board functions for Compulab CM-FX6 board
4 * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
6 * Author: Nikita Kiryanov <nikita@compulab.co.il>
8 * SPDX-License-Identifier: GPL-2.0+
12 #include <fsl_esdhc.h>
13 #include <asm/arch/sys_proto.h>
16 DECLARE_GLOBAL_DATA_PTR
;
18 #ifdef CONFIG_FSL_ESDHC
19 static struct fsl_esdhc_cfg usdhc_cfg
[3] = {
25 static enum mxc_clock usdhc_clk
[3] = {
31 int board_mmc_init(bd_t
*bis
)
35 cm_fx6_set_usdhc_iomux();
36 for (i
= 0; i
< CONFIG_SYS_FSL_USDHC_NUM
; i
++) {
37 usdhc_cfg
[i
].sdhc_clk
= mxc_get_clock(usdhc_clk
[i
]);
38 usdhc_cfg
[i
].max_bus_width
= 4;
39 fsl_esdhc_initialize(bis
, &usdhc_cfg
[i
]);
40 enable_usdhc_clk(1, i
);
49 gd
->bd
->bi_boot_params
= PHYS_SDRAM_1
+ 0x100;
55 puts("Board: CM-FX6\n");
59 void dram_init_banksize(void)
61 gd
->bd
->bi_dram
[0].start
= PHYS_SDRAM_1
;
62 gd
->bd
->bi_dram
[1].start
= PHYS_SDRAM_2
;
64 switch (gd
->ram_size
) {
65 case 0x10000000: /* DDR_16BIT_256MB */
66 gd
->bd
->bi_dram
[0].size
= 0x10000000;
67 gd
->bd
->bi_dram
[1].size
= 0;
69 case 0x20000000: /* DDR_32BIT_512MB */
70 gd
->bd
->bi_dram
[0].size
= 0x20000000;
71 gd
->bd
->bi_dram
[1].size
= 0;
74 if (is_cpu_type(MXC_CPU_MX6SOLO
)) { /* DDR_32BIT_1GB */
75 gd
->bd
->bi_dram
[0].size
= 0x20000000;
76 gd
->bd
->bi_dram
[1].size
= 0x20000000;
77 } else { /* DDR_64BIT_1GB */
78 gd
->bd
->bi_dram
[0].size
= 0x40000000;
79 gd
->bd
->bi_dram
[1].size
= 0;
82 case 0x80000000: /* DDR_64BIT_2GB */
83 gd
->bd
->bi_dram
[0].size
= 0x40000000;
84 gd
->bd
->bi_dram
[1].size
= 0x40000000;
86 case 0xEFF00000: /* DDR_64BIT_4GB */
87 gd
->bd
->bi_dram
[0].size
= 0x70000000;
88 gd
->bd
->bi_dram
[1].size
= 0x7FF00000;
95 gd
->ram_size
= imx_ddr_size();
96 switch (gd
->ram_size
) {
103 gd
->ram_size
-= 0x100000;
106 printf("ERROR: Unsupported DRAM size 0x%lx\n", gd
->ram_size
);