1 /*
2  * Copyright 2011-2012 Freescale Semiconductor, Inc.
3  *
4  * See file CREDITS for list of people who contributed to this
5  * project.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 2 of
10  * the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20  * MA 02111-1307 USA
21  */
22 
23 #include <common.h>
24 #include <asm/processor.h>
25 #include <asm/mmu.h>
26 #include <asm/cache.h>
27 #include <asm/immap_85xx.h>
28 #include <asm/io.h>
29 #include <miiphy.h>
30 #include <libfdt.h>
31 #include <fdt_support.h>
32 #include <fsl_mdio.h>
33 #include <tsec.h>
34 #include <netdev.h>
35 
36 
37 DECLARE_GLOBAL_DATA_PTR;
38 
39 int board_early_init_f(void)
40 {
41 	ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
42 
43 	clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42);
44 	setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS);
45 
46 	clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43);
47 	setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK |
48 			MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD);
49 	setbits_be32(&gur->halt_req_mask, HALTED_TO_HALT_REQ_MASK_0);
50 	clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_IFC_AD_GPIO_MASK |
51 			MPC85xx_PMUXCR_IFC_AD17_GPO_MASK,
52 			MPC85xx_PMUXCR_IFC_AD_GPIO |
53 			MPC85xx_PMUXCR_IFC_AD17_GPO | MPC85xx_PMUXCR_SDHC_USIM);
54 
55 	return 0;
56 }
57 
58 int checkboard(void)
59 {
60 	struct cpu_type *cpu;
61 
62 	cpu = gd->arch.cpu;
63 	printf("Board: %sRDB\n", cpu->name);
64 
65 	return 0;
66 }
67 
68 #if defined(CONFIG_OF_BOARD_SETUP)
69 void ft_board_setup(void *blob, bd_t *bd)
70 {
71 	phys_addr_t base;
72 	phys_size_t size;
73 
74 	ft_cpu_setup(blob, bd);
75 
76 	base = getenv_bootm_low();
77 	size = getenv_bootm_size();
78 
79 	fdt_fixup_memory(blob, (u64)base, (u64)size);
80 
81 	fdt_fixup_dr_usb(blob, bd);
82 }
83 #endif
84