cpu.c 2.2 KB

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