blob: b03bdb82c67c903856277a9ae58c80c8dd6448f2 [file] [log] [blame]
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +05301/*
2 * Copyright 2016 Freescale Semiconductor, Inc.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#include <common.h>
8#include <i2c.h>
9#include <asm/io.h>
10#include <asm/arch/clock.h>
11#include <asm/arch/fsl_serdes.h>
12#include <asm/arch/soc.h>
13#include <hwconfig.h>
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053014#include <environment.h>
15#include <fsl_mmdc.h>
16#include <netdev.h>
17
18DECLARE_GLOBAL_DATA_PTR;
19
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053020int checkboard(void)
21{
22 puts("Board: LS1012AFRDM ");
23
24 return 0;
25}
26
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053027int dram_init(void)
28{
York Sun1fdcc8d2016-09-26 08:09:25 -070029 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 */
43 };
44
45 mmdc_init(&mparam);
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053046
47 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
48
49 return 0;
50}
51
52int board_eth_init(bd_t *bis)
53{
54 return pci_eth_init(bis);
55}
56
57int board_early_init_f(void)
58{
59 fsl_lsch2_early_init_f();
60
61 return 0;
62}
63
64int board_init(void)
65{
66 struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
67 /*
68 * Set CCI-400 control override register to enable barrier
69 * transaction
70 */
71 out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
72
73#ifdef CONFIG_ENV_IS_NOWHERE
74 gd->env_addr = (ulong)&default_environment[0];
75#endif
76
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053077 return 0;
78}
79
80int ft_board_setup(void *blob, bd_t *bd)
81{
82 arch_fixup_fdt(blob);
83
84 ft_cpu_setup(blob, bd);
85
86 return 0;
87}