blob: 9d9c83f7167e8bca4cafef6bc11dc24e13216cbf [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +00002/*
3 * Copyright 2011-2012 Freescale Semiconductor, Inc.
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +00004 */
5
6#include <common.h>
7#include <asm/processor.h>
8#include <asm/mmu.h>
9#include <asm/cache.h>
10#include <asm/immap_85xx.h>
11#include <asm/io.h>
12#include <miiphy.h>
Masahiro Yamadab08c8c42018-03-05 01:20:11 +090013#include <linux/libfdt.h>
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000014#include <fdt_support.h>
15#include <fsl_mdio.h>
16#include <tsec.h>
Ashish Kumar7ac1a242014-10-07 18:02:23 +053017#include <jffs2/load_kernel.h>
18#include <mtd_node.h>
19#include <flash.h>
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000020#include <netdev.h>
21
22
23DECLARE_GLOBAL_DATA_PTR;
24
25int board_early_init_f(void)
26{
27 ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
28
29 clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42);
30 setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS);
31
32 clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43);
33 setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK |
34 MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD);
35 setbits_be32(&gur->halt_req_mask, HALTED_TO_HALT_REQ_MASK_0);
36 clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_IFC_AD_GPIO_MASK |
37 MPC85xx_PMUXCR_IFC_AD17_GPO_MASK,
38 MPC85xx_PMUXCR_IFC_AD_GPIO |
39 MPC85xx_PMUXCR_IFC_AD17_GPO | MPC85xx_PMUXCR_SDHC_USIM);
40
41 return 0;
42}
43
44int checkboard(void)
45{
46 struct cpu_type *cpu;
47
Simon Glass67ac13b2012-12-13 20:48:48 +000048 cpu = gd->arch.cpu;
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000049 printf("Board: %sRDB\n", cpu->name);
50
51 return 0;
52}
53
54#if defined(CONFIG_OF_BOARD_SETUP)
Ashish Kumar7ac1a242014-10-07 18:02:23 +053055#ifdef CONFIG_FDT_FIXUP_PARTITIONS
Masahiro Yamadab35fb6a2018-07-19 16:28:23 +090056static const struct node_info nodes[] = {
Ashish Kumar7ac1a242014-10-07 18:02:23 +053057 { "fsl,ifc-nand", MTD_DEV_TYPE_NAND, },
58};
59#endif
Simon Glasse895a4b2014-10-23 18:58:47 -060060int ft_board_setup(void *blob, bd_t *bd)
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000061{
62 phys_addr_t base;
63 phys_size_t size;
64
65 ft_cpu_setup(blob, bd);
66
Simon Glass723806c2017-08-03 12:22:15 -060067 base = env_get_bootm_low();
68 size = env_get_bootm_size();
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000069
70 fdt_fixup_memory(blob, (u64)base, (u64)size);
Ashish Kumar7ac1a242014-10-07 18:02:23 +053071#ifdef CONFIG_FDT_FIXUP_PARTITIONS
72 fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
73#endif
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000074
Sriram Dasha5c289b2016-09-16 17:12:15 +053075 fsl_fdt_fixup_dr_usb(blob, bd);
Simon Glasse895a4b2014-10-23 18:58:47 -060076
77 return 0;
Prabhakar Kushwaha7530d342012-04-24 20:17:15 +000078}
79#endif