2 * Copyright 2016 Freescale Semiconductor, Inc.
4 * SPDX-License-Identifier: GPL-2.0+
9 #include <fdt_support.h>
11 #include <asm/arch/clock.h>
12 #include <asm/arch/fsl_serdes.h>
13 #ifdef CONFIG_FSL_LS_PPA
14 #include <asm/arch/ppa.h>
16 #include <asm/arch/fdt.h>
17 #include <asm/arch/soc.h>
23 #include <fsl_esdhc.h>
28 #include "../common/qixis.h"
29 #include "ls1012aqds_qixis.h"
31 DECLARE_GLOBAL_DATA_PTR;
38 sw = QIXIS_READ(arch);
39 printf("Board Arch: V%d, ", sw >> 4);
40 printf("Board version: %c, boot from ", (sw & 0xf) + 'A' - 1);
42 sw = QIXIS_READ(brdcfg[QIXIS_LBMAP_BRDCFG_REG]);
44 if (sw & QIXIS_LBMAP_ALTBANK)
49 printf("FPGA: v%d (%s), build %d",
50 (int)QIXIS_READ(scver), qixis_read_tag(buf),
51 (int)qixis_read_minor());
53 /* the timestamp string contains "\n" at the end */
54 printf(" on %s", qixis_read_time(buf));
60 static const struct fsl_mmdc_info mparam = {
61 0x05180000, /* mdctl */
62 0x00030035, /* mdpdc */
63 0x12554000, /* mdotc */
64 0xbabf7954, /* mdcfg0 */
65 0xdb328f64, /* mdcfg1 */
66 0x01ff00db, /* mdcfg2 */
67 0x00001680, /* mdmisc */
68 0x0f3c8000, /* mdref */
69 0x00002000, /* mdrwd */
70 0x00bf1023, /* mdor */
71 0x0000003f, /* mdasp */
72 0x0000022a, /* mpodtctrl */
73 0xa1390003, /* mpzqhwctrl */
78 gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
83 int board_early_init_f(void)
85 fsl_lsch2_early_init_f();
90 #ifdef CONFIG_MISC_INIT_R
93 u8 mux_sdhc_cd = 0x80;
97 i2c_write(CONFIG_SYS_I2C_FPGA_ADDR, 0x5a, 1, &mux_sdhc_cd, 1);
104 struct ccsr_cci400 *cci = (struct ccsr_cci400 *)
105 CONFIG_SYS_CCI400_ADDR;
107 /* Set CCI-400 control override register to enable barrier
109 out_le32(&cci->ctrl_ord,
110 CCI400_CTRLORD_EN_BARRIER);
112 #ifdef CONFIG_SYS_FSL_ERRATUM_A010315
116 #ifdef CONFIG_ENV_IS_NOWHERE
117 gd->env_addr = (ulong)&default_environment[0];
120 #ifdef CONFIG_FSL_LS_PPA
126 int board_eth_init(bd_t *bis)
128 return pci_eth_init(bis);
131 int esdhc_status_fixup(void *blob, const char *compat)
133 char esdhc0_path[] = "/soc/esdhc@1560000";
134 char esdhc1_path[] = "/soc/esdhc@1580000";
137 do_fixup_by_path(blob, esdhc0_path, "status", "okay",
141 * The Presence Detect 2 register detects the installation
142 * of cards in various PCI Express or SGMII slots.
144 * STAT_PRS2[7:5]: Specifies the type of card installed in the
145 * SDHC2 Adapter slot. 0b111 indicates no adapter is installed.
147 card_id = (QIXIS_READ(present2) & 0xe0) >> 5;
149 /* If no adapter is installed in SDHC2, disable SDHC2 */
151 do_fixup_by_path(blob, esdhc1_path, "status", "disabled",
152 sizeof("disabled"), 1);
154 do_fixup_by_path(blob, esdhc1_path, "status", "okay",
159 #ifdef CONFIG_OF_BOARD_SETUP
160 int ft_board_setup(void *blob, bd_t *bd)
162 arch_fixup_fdt(blob);
164 ft_cpu_setup(blob, bd);