cpu.c 2.3 KB

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