blob: 1f3adc1e882d8ea8a4fb762b9faab3ac2fbab2cf [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>
Prabhakar Kushwaha5b404be2017-01-30 17:05:35 +053012#ifdef CONFIG_FSL_LS_PPA
13#include <asm/arch/ppa.h>
14#endif
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053015#include <asm/arch/soc.h>
16#include <hwconfig.h>
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053017#include <environment.h>
18#include <fsl_mmdc.h>
19#include <netdev.h>
20
21DECLARE_GLOBAL_DATA_PTR;
22
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053023int checkboard(void)
24{
25 puts("Board: LS1012AFRDM ");
26
27 return 0;
28}
29
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053030int dram_init(void)
31{
York Sun1fdcc8d2016-09-26 08:09:25 -070032 static const struct fsl_mmdc_info mparam = {
33 0x04180000, /* mdctl */
34 0x00030035, /* mdpdc */
35 0x12554000, /* mdotc */
36 0xbabf7954, /* mdcfg0 */
37 0xdb328f64, /* mdcfg1 */
38 0x01ff00db, /* mdcfg2 */
39 0x00001680, /* mdmisc */
40 0x0f3c8000, /* mdref */
41 0x00002000, /* mdrwd */
42 0x00bf1023, /* mdor */
43 0x0000003f, /* mdasp */
44 0x0000022a, /* mpodtctrl */
45 0xa1390003, /* mpzqhwctrl */
46 };
47
48 mmdc_init(&mparam);
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053049
50 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
51
52 return 0;
53}
54
55int board_eth_init(bd_t *bis)
56{
57 return pci_eth_init(bis);
58}
59
60int board_early_init_f(void)
61{
62 fsl_lsch2_early_init_f();
63
64 return 0;
65}
66
67int board_init(void)
68{
69 struct ccsr_cci400 *cci = (struct ccsr_cci400 *)CONFIG_SYS_CCI400_ADDR;
70 /*
71 * Set CCI-400 control override register to enable barrier
72 * transaction
73 */
74 out_le32(&cci->ctrl_ord, CCI400_CTRLORD_EN_BARRIER);
75
76#ifdef CONFIG_ENV_IS_NOWHERE
77 gd->env_addr = (ulong)&default_environment[0];
78#endif
79
Prabhakar Kushwaha5b404be2017-01-30 17:05:35 +053080#ifdef CONFIG_FSL_LS_PPA
81 ppa_init();
82#endif
Prabhakar Kushwahaff78aa22016-06-03 18:41:36 +053083 return 0;
84}
85
86int ft_board_setup(void *blob, bd_t *bd)
87{
88 arch_fixup_fdt(blob);
89
90 ft_cpu_setup(blob, bd);
91
92 return 0;
93}