Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2011-2012 Freescale Semiconductor, Inc. |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 4 | */ |
| 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> |
Simon Glass | 0af6e2d | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 12 | #include <env.h> |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 13 | #include <miiphy.h> |
Masahiro Yamada | 75f82d0 | 2018-03-05 01:20:11 +0900 | [diff] [blame] | 14 | #include <linux/libfdt.h> |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 15 | #include <fdt_support.h> |
| 16 | #include <fsl_mdio.h> |
| 17 | #include <tsec.h> |
Ashish Kumar | c457020 | 2014-10-07 18:02:23 +0530 | [diff] [blame] | 18 | #include <jffs2/load_kernel.h> |
| 19 | #include <mtd_node.h> |
| 20 | #include <flash.h> |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 21 | #include <netdev.h> |
| 22 | |
| 23 | |
| 24 | DECLARE_GLOBAL_DATA_PTR; |
| 25 | |
| 26 | int board_early_init_f(void) |
| 27 | { |
| 28 | ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR; |
| 29 | |
| 30 | clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42); |
| 31 | setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS); |
| 32 | |
| 33 | clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43); |
| 34 | setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK | |
| 35 | MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD); |
| 36 | setbits_be32(&gur->halt_req_mask, HALTED_TO_HALT_REQ_MASK_0); |
| 37 | clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_IFC_AD_GPIO_MASK | |
| 38 | MPC85xx_PMUXCR_IFC_AD17_GPO_MASK, |
| 39 | MPC85xx_PMUXCR_IFC_AD_GPIO | |
| 40 | MPC85xx_PMUXCR_IFC_AD17_GPO | MPC85xx_PMUXCR_SDHC_USIM); |
| 41 | |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | int checkboard(void) |
| 46 | { |
| 47 | struct cpu_type *cpu; |
| 48 | |
Simon Glass | a8b5739 | 2012-12-13 20:48:48 +0000 | [diff] [blame] | 49 | cpu = gd->arch.cpu; |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 50 | printf("Board: %sRDB\n", cpu->name); |
| 51 | |
| 52 | return 0; |
| 53 | } |
| 54 | |
| 55 | #if defined(CONFIG_OF_BOARD_SETUP) |
Ashish Kumar | c457020 | 2014-10-07 18:02:23 +0530 | [diff] [blame] | 56 | #ifdef CONFIG_FDT_FIXUP_PARTITIONS |
Masahiro Yamada | 20ead6f | 2018-07-19 16:28:23 +0900 | [diff] [blame] | 57 | static const struct node_info nodes[] = { |
Ashish Kumar | c457020 | 2014-10-07 18:02:23 +0530 | [diff] [blame] | 58 | { "fsl,ifc-nand", MTD_DEV_TYPE_NAND, }, |
| 59 | }; |
| 60 | #endif |
Simon Glass | 2aec3cc | 2014-10-23 18:58:47 -0600 | [diff] [blame] | 61 | int ft_board_setup(void *blob, bd_t *bd) |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 62 | { |
| 63 | phys_addr_t base; |
| 64 | phys_size_t size; |
| 65 | |
| 66 | ft_cpu_setup(blob, bd); |
| 67 | |
Simon Glass | da1a134 | 2017-08-03 12:22:15 -0600 | [diff] [blame] | 68 | base = env_get_bootm_low(); |
| 69 | size = env_get_bootm_size(); |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 70 | |
| 71 | fdt_fixup_memory(blob, (u64)base, (u64)size); |
Ashish Kumar | c457020 | 2014-10-07 18:02:23 +0530 | [diff] [blame] | 72 | #ifdef CONFIG_FDT_FIXUP_PARTITIONS |
| 73 | fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes)); |
| 74 | #endif |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 75 | |
Sriram Dash | 9fd465c | 2016-09-16 17:12:15 +0530 | [diff] [blame] | 76 | fsl_fdt_fixup_dr_usb(blob, bd); |
Simon Glass | 2aec3cc | 2014-10-23 18:58:47 -0600 | [diff] [blame] | 77 | |
| 78 | return 0; |
Prabhakar Kushwaha | 63956d5 | 2012-04-24 20:17:15 +0000 | [diff] [blame] | 79 | } |
| 80 | #endif |