cpu.c 2.2 KB

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