soc.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * (C) Copyright 2007
  3. * Sascha Hauer, Pengutronix
  4. *
  5. * (C) Copyright 2009 Freescale Semiconductor, Inc.
  6. *
  7. * See file CREDITS for list of people who contributed to this
  8. * project.
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  23. * MA 02111-1307 USA
  24. */
  25. #include <common.h>
  26. #include <asm/errno.h>
  27. #include <asm/io.h>
  28. #include <asm/arch/imx-regs.h>
  29. #include <asm/arch/clock.h>
  30. #include <asm/arch/sys_proto.h>
  31. u32 get_cpu_rev(void)
  32. {
  33. int system_rev = 0x61000 | CHIP_REV_1_0;
  34. return system_rev;
  35. }
  36. #ifdef CONFIG_ARCH_CPU_INIT
  37. void init_aips(void)
  38. {
  39. u32 reg = AIPS1_BASE_ADDR;
  40. /*
  41. * Set all MPROTx to be non-bufferable, trusted for R/W,
  42. * not forced to user-mode.
  43. */
  44. writel(0x77777777, reg + 0x00);
  45. writel(0x77777777, reg + 0x04);
  46. reg = AIPS2_BASE_ADDR;
  47. writel(0x77777777, reg + 0x00);
  48. writel(0x77777777, reg + 0x04);
  49. }
  50. int arch_cpu_init(void)
  51. {
  52. init_aips();
  53. return 0;
  54. }
  55. #endif
  56. #if defined(CONFIG_FEC_MXC)
  57. void imx_get_mac_from_fuse(unsigned char *mac)
  58. {
  59. struct iim_regs *iim = (struct iim_regs *)IMX_IIM_BASE;
  60. struct fuse_bank *bank = &iim->bank[4];
  61. struct fuse_bank4_regs *fuse =
  62. (struct fuse_bank4_regs *)bank->fuse_regs;
  63. u32 mac_lo = readl(&fuse->mac_addr_low);
  64. u32 mac_hi = readl(&fuse->mac_addr_high);
  65. *(u32 *)mac = mac_lo;
  66. mac[4] = mac_hi & 0xff;
  67. mac[5] = (mac_hi >> 8) & 0xff;
  68. }
  69. #endif