2 * Copyright 2016 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
10 #include <asm/arch/clock.h>
11 #include <asm/arch/fsl_serdes.h>
12 #include <asm/arch/soc.h>
14 #include <environment.h>
18 DECLARE_GLOBAL_DATA_PTR;
22 puts("Board: LS1012AFRDM ");
29 static const struct fsl_mmdc_info mparam = {
30 0x04180000, /* mdctl */
31 0x00030035, /* mdpdc */
32 0x12554000, /* mdotc */
33 0xbabf7954, /* mdcfg0 */
34 0xdb328f64, /* mdcfg1 */
35 0x01ff00db, /* mdcfg2 */
36 0x00001680, /* mdmisc */
37 0x0f3c8000, /* mdref */
38 0x00002000, /* mdrwd */
39 0x00bf1023, /* mdor */
40 0x0000003f, /* mdasp */
41 0x0000022a, /* mpodtctrl */
42 0xa1390003, /* mpzqhwctrl */
47 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
52 int board_eth_init(bd_t *bis)
54 return pci_eth_init(bis);
57 int board_early_init_f(void)
59 fsl_lsch2_early_init_f();
66 struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
68 * Set CCI-400 control override register to enable barrier
71 out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
73 #ifdef CONFIG_ENV_IS_NOWHERE
74 gd->env_addr = (ulong)&default_environment[0];
80 int ft_board_setup(void *blob, bd_t *bd)
84 ft_cpu_setup(blob, bd);
89 void dram_init_banksize(void)
92 * gd->arch.secure_ram tracks the location of secure memory.
93 * It was set as if the memory starts from 0.
94 * The address needs to add the offset of its bank.
96 gd->bd->bi_dram[0].start = CONFIG_SYS_SDRAM_BASE;
97 if (gd->ram_size > CONFIG_SYS_DDR_BLOCK1_SIZE) {
98 gd->bd->bi_dram[0].size = CONFIG_SYS_DDR_BLOCK1_SIZE;
99 gd->bd->bi_dram[1].start = CONFIG_SYS_DDR_BLOCK2_BASE;
100 gd->bd->bi_dram[1].size = gd->ram_size -
101 CONFIG_SYS_DDR_BLOCK1_SIZE;
102 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
103 gd->arch.secure_ram = gd->bd->bi_dram[1].start +
104 gd->arch.secure_ram -
105 CONFIG_SYS_DDR_BLOCK1_SIZE;
106 gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;
109 gd->bd->bi_dram[0].size = gd->ram_size;
110 #ifdef CONFIG_SYS_MEM_RESERVE_SECURE
111 gd->arch.secure_ram = gd->bd->bi_dram[0].start +
113 gd->arch.secure_ram |= MEM_RESERVE_SECURE_MAINTAINED;