cpu.c 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. *
  3. * (C) Copyright 2000-2003
  4. * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
  5. *
  6. * Copyright (C) 2004-2007, 2012 Freescale Semiconductor, Inc.
  7. * TsiChung Liew (Tsi-Chung.Liew@freescale.com)
  8. *
  9. * SPDX-License-Identifier: GPL-2.0+
  10. */
  11. #include <common.h>
  12. #include <watchdog.h>
  13. #include <command.h>
  14. #include <netdev.h>
  15. #include <asm/immap.h>
  16. #include <asm/io.h>
  17. DECLARE_GLOBAL_DATA_PTR;
  18. int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
  19. {
  20. rcm_t *rcm = (rcm_t *) (MMAP_RCM);
  21. udelay(1000);
  22. out_8(&rcm->rcr, RCM_RCR_FRCRSTOUT);
  23. udelay(10000);
  24. setbits_8(&rcm->rcr, RCM_RCR_SOFTRST);
  25. /* we don't return! */
  26. return 0;
  27. };
  28. #if defined(CONFIG_DISPLAY_CPUINFO)
  29. int print_cpuinfo(void)
  30. {
  31. ccm_t *ccm = (ccm_t *) MMAP_CCM;
  32. u16 msk;
  33. u16 id = 0;
  34. u8 ver;
  35. puts("CPU: ");
  36. msk = (in_be16(&ccm->cir) >> 6);
  37. ver = (in_be16(&ccm->cir) & 0x003f);
  38. switch (msk) {
  39. case 0x48:
  40. id = 54455;
  41. break;
  42. case 0x49:
  43. id = 54454;
  44. break;
  45. case 0x4a:
  46. id = 54453;
  47. break;
  48. case 0x4b:
  49. id = 54452;
  50. break;
  51. case 0x4d:
  52. id = 54451;
  53. break;
  54. case 0x4f:
  55. id = 54450;
  56. break;
  57. case 0x9F:
  58. id = 54410;
  59. break;
  60. case 0xA0:
  61. id = 54415;
  62. break;
  63. case 0xA1:
  64. id = 54416;
  65. break;
  66. case 0xA2:
  67. id = 54417;
  68. break;
  69. case 0xA3:
  70. id = 54418;
  71. break;
  72. }
  73. if (id) {
  74. char buf1[32], buf2[32], buf3[32];
  75. printf("Freescale MCF%d (Mask:%01x Version:%x)\n", id, msk,
  76. ver);
  77. printf(" CPU CLK %s MHz BUS CLK %s MHz FLB CLK %s MHz\n",
  78. strmhz(buf1, gd->cpu_clk),
  79. strmhz(buf2, gd->bus_clk),
  80. strmhz(buf3, gd->arch.flb_clk));
  81. #ifdef CONFIG_PCI
  82. printf(" PCI CLK %s MHz INP CLK %s MHz VCO CLK %s MHz\n",
  83. strmhz(buf1, gd->pci_clk),
  84. strmhz(buf2, gd->arch.inp_clk),
  85. strmhz(buf3, gd->arch.vco_clk));
  86. #else
  87. printf(" INP CLK %s MHz VCO CLK %s MHz\n",
  88. strmhz(buf1, gd->arch.inp_clk),
  89. strmhz(buf2, gd->arch.vco_clk));
  90. #endif
  91. }
  92. return 0;
  93. }
  94. #endif /* CONFIG_DISPLAY_CPUINFO */
  95. #if defined(CONFIG_MCFFEC)
  96. /* Default initializations for MCFFEC controllers. To override,
  97. * create a board-specific function called:
  98. * int board_eth_init(bd_t *bis)
  99. */
  100. int cpu_eth_init(bd_t *bis)
  101. {
  102. return mcffec_initialize(bis);
  103. }
  104. #endif