common.c 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Miscellaneous DA8XX functions.
  3. *
  4. * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #include <asm/io.h>
  21. #include <asm/arch/hardware.h>
  22. #include <asm/arch/da8xx_common.h>
  23. #ifndef CONFIG_USE_IRQ
  24. void irq_init(void)
  25. {
  26. /*
  27. * Mask all IRQs by clearing the global enable and setting
  28. * the enable clear for all the 90 interrupts.
  29. */
  30. writel(0, &davinci_aintc_regs->ger);
  31. writel(0, &davinci_aintc_regs->hier);
  32. writel(0xffffffff, &davinci_aintc_regs->ecr1);
  33. writel(0xffffffff, &davinci_aintc_regs->ecr2);
  34. writel(0xffffffff, &davinci_aintc_regs->ecr3);
  35. }
  36. #endif
  37. /*
  38. * Enable PSC for various peripherals.
  39. */
  40. int da8xx_configure_lpsc_items(const struct lpsc_resource *item,
  41. const int n_items)
  42. {
  43. int i;
  44. for (i = 0; i < n_items; i++)
  45. lpsc_on(item[i].lpsc_no);
  46. return 0;
  47. }
  48. #if defined(CONFIG_DRIVER_TI_EMAC) && defined(CONFIG_MACH_DAVINCI_DA850_EVM)
  49. void da850_emac_mii_mode_sel(int mode_sel)
  50. {
  51. int val;
  52. val = readl(&davinci_syscfg_regs->cfgchip3);
  53. if (mode_sel == 0)
  54. val &= ~(1 << 8);
  55. else
  56. val |= (1 << 8);
  57. writel(val, &davinci_syscfg_regs->cfgchip3);
  58. }
  59. #endif