prom.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2008 Maxime Bizon <mbizon@freebox.fr>
  7. */
  8. #include <linux/init.h>
  9. #include <linux/bootmem.h>
  10. #include <asm/bootinfo.h>
  11. #include <bcm63xx_board.h>
  12. #include <bcm63xx_cpu.h>
  13. #include <bcm63xx_io.h>
  14. #include <bcm63xx_regs.h>
  15. #include <bcm63xx_gpio.h>
  16. void __init prom_init(void)
  17. {
  18. u32 reg, mask;
  19. bcm63xx_cpu_init();
  20. /* stop any running watchdog */
  21. bcm_wdt_writel(WDT_STOP_1, WDT_CTL_REG);
  22. bcm_wdt_writel(WDT_STOP_2, WDT_CTL_REG);
  23. /* disable all hardware blocks clock for now */
  24. if (BCMCPU_IS_6338())
  25. mask = CKCTL_6338_ALL_SAFE_EN;
  26. else if (BCMCPU_IS_6345())
  27. mask = CKCTL_6345_ALL_SAFE_EN;
  28. else if (BCMCPU_IS_6348())
  29. mask = CKCTL_6348_ALL_SAFE_EN;
  30. else
  31. /* BCMCPU_IS_6358() */
  32. mask = CKCTL_6358_ALL_SAFE_EN;
  33. reg = bcm_perf_readl(PERF_CKCTL_REG);
  34. reg &= ~mask;
  35. bcm_perf_writel(reg, PERF_CKCTL_REG);
  36. /* assign command line from kernel config */
  37. strcpy(arcs_cmdline, CONFIG_CMDLINE);
  38. /* register gpiochip */
  39. bcm63xx_gpio_init();
  40. /* do low level board init */
  41. board_prom_init();
  42. }
  43. void __init prom_free_prom_memory(void)
  44. {
  45. }