bsc9131rdb.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Copyright 2011-2012 Freescale Semiconductor, Inc.
  4. */
  5. #include <common.h>
  6. #include <asm/processor.h>
  7. #include <asm/mmu.h>
  8. #include <asm/cache.h>
  9. #include <asm/immap_85xx.h>
  10. #include <asm/io.h>
  11. #include <miiphy.h>
  12. #include <linux/libfdt.h>
  13. #include <fdt_support.h>
  14. #include <fsl_mdio.h>
  15. #include <tsec.h>
  16. #include <jffs2/load_kernel.h>
  17. #include <mtd_node.h>
  18. #include <flash.h>
  19. #include <netdev.h>
  20. DECLARE_GLOBAL_DATA_PTR;
  21. int board_early_init_f(void)
  22. {
  23. ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
  24. clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_GPIO42);
  25. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_CTS_B0_DSP_TMS);
  26. clrbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_GPIO43);
  27. setbits_be32(&gur->pmuxcr2, MPC85xx_PMUXCR2_UART_RTS_B0_DSP_TCK |
  28. MPC85xx_PMUXCR2_UART_CTS_B1_SIM_PD);
  29. setbits_be32(&gur->halt_req_mask, HALTED_TO_HALT_REQ_MASK_0);
  30. clrsetbits_be32(&gur->pmuxcr, MPC85xx_PMUXCR_IFC_AD_GPIO_MASK |
  31. MPC85xx_PMUXCR_IFC_AD17_GPO_MASK,
  32. MPC85xx_PMUXCR_IFC_AD_GPIO |
  33. MPC85xx_PMUXCR_IFC_AD17_GPO | MPC85xx_PMUXCR_SDHC_USIM);
  34. return 0;
  35. }
  36. int checkboard(void)
  37. {
  38. struct cpu_type *cpu;
  39. cpu = gd->arch.cpu;
  40. printf("Board: %sRDB\n", cpu->name);
  41. return 0;
  42. }
  43. #if defined(CONFIG_OF_BOARD_SETUP)
  44. #ifdef CONFIG_FDT_FIXUP_PARTITIONS
  45. struct node_info nodes[] = {
  46. { "fsl,ifc-nand", MTD_DEV_TYPE_NAND, },
  47. };
  48. #endif
  49. int ft_board_setup(void *blob, bd_t *bd)
  50. {
  51. phys_addr_t base;
  52. phys_size_t size;
  53. ft_cpu_setup(blob, bd);
  54. base = env_get_bootm_low();
  55. size = env_get_bootm_size();
  56. fdt_fixup_memory(blob, (u64)base, (u64)size);
  57. #ifdef CONFIG_FDT_FIXUP_PARTITIONS
  58. fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
  59. #endif
  60. fsl_fdt_fixup_dr_usb(blob, bd);
  61. return 0;
  62. }
  63. #endif