2 * Based on corenet_ds.c
4 * SPDX-License-Identifier: GPL-2.0+
10 #include <linux/compiler.h>
12 #include <asm/processor.h>
13 #include <asm/cache.h>
14 #include <asm/immap_85xx.h>
15 #include <asm/fsl_law.h>
16 #include <asm/fsl_serdes.h>
17 #include <asm/fsl_portals.h>
18 #include <asm/fsl_liodn.h>
23 #include "../common/eeprom.h"
25 DECLARE_GLOBAL_DATA_PTR
;
27 #define GPIO_OPENDRAIN 0x30000000
28 #define GPIO_DIR 0x3c000004
29 #define GPIO_INITIAL 0x30000000
30 #define GPIO_VGA_SWITCH 0x00001000
34 printf("Board: CYRUS\n");
39 int board_early_init_f(void)
41 ccsr_gur_t
*gur
= (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR
);
42 ccsr_gpio_t
*pgpio
= (void *)(CONFIG_SYS_MPC85xx_GPIO_ADDR
);
45 * Only use DDR1_MCK0/3 and DDR2_MCK0/3
46 * disable DDR1_MCK1/2/4/5 and DDR2_MCK1/2/4/5 to reduce
47 * the noise introduced by these unterminated and unused clock pairs.
49 setbits_be32(&gur
->ddrclkdr
, 0x001B001B);
51 /* Set GPIO reset lines to open-drain, tristate */
52 setbits_be32(&pgpio
->gpdat
, GPIO_INITIAL
);
53 setbits_be32(&pgpio
->gpodr
, GPIO_OPENDRAIN
);
55 /* Set GPIO Direction */
56 setbits_be32(&pgpio
->gpdir
, GPIO_DIR
);
61 int board_early_init_r(void)
63 fsl_lbc_t
*lbc
= LBC_BASE_ADDR
;
65 out_be32(&lbc
->lbcr
, 0);
66 /* 1 clock LALE cycle */
67 out_be32(&lbc
->lcrr
, 0x80000000 | CONFIG_SYS_LBC_LCRR
);
71 #ifdef CONFIG_SYS_DPAA_QBMAN
83 int ft_board_setup(void *blob
, bd_t
*bd
)
88 ft_cpu_setup(blob
, bd
);
90 base
= getenv_bootm_low();
91 size
= getenv_bootm_size();
93 fdt_fixup_memory(blob
, (u64
)base
, (u64
)size
);
96 pci_of_setup(blob
, bd
);
99 fdt_fixup_liodn(blob
);
100 fsl_fdt_fixup_dr_usb(blob
, bd
);
102 #ifdef CONFIG_SYS_DPAA_FMAN
103 fdt_fixup_fman_ethernet(blob
);
109 int mac_read_from_eeprom(void)
111 init_eeprom(CONFIG_SYS_EEPROM_BUS_NUM
,
112 CONFIG_SYS_I2C_EEPROM_ADDR
,
113 CONFIG_SYS_I2C_EEPROM_ADDR_LEN
);
115 return mac_read_from_eeprom_common();