cpu.c 2.3 KB

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