Guest User

Untitled

a guest
Jan 10th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. /*
  2. * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8.  
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13.  
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18.  
  19. #include <linux/module.h>
  20. #include <linux/io.h>
  21.  
  22. unsigned int __mxc_cpu_type;
  23. EXPORT_SYMBOL(__mxc_cpu_type);
  24.  
  25. void mxc_set_cpu_type(unsigned int type)
  26. {
  27. __mxc_cpu_type = type;
  28. }
  29.  
  30.  
  31. #ifdef CONFIG_IPIPE
  32. void ipipe_mach_allow_hwtimer_uaccess(unsigned long aips1, unsigned long aips2)
  33. {
  34. volatile unsigned long aips_reg;
  35.  
  36. if (!cpu_is_mx27()) {
  37. /*
  38. * S/W workaround: Clear the off platform peripheral modules
  39. * Supervisor Protect bit for SDMA to access them.
  40. */
  41. __raw_writel(0x0, aips1 + 0x40);
  42. __raw_writel(0x0, aips1 + 0x44);
  43. __raw_writel(0x0, aips1 + 0x48);
  44. __raw_writel(0x0, aips1 + 0x4C);
  45. aips_reg = __raw_readl(aips1 + 0x50);
  46. aips_reg &= 0x00FFFFFF;
  47. __raw_writel(aips_reg, aips1 + 0x50);
  48.  
  49. __raw_writel(0x0, aips2 + 0x40);
  50. __raw_writel(0x0, aips2 + 0x44);
  51. __raw_writel(0x0, aips2 + 0x48);
  52. __raw_writel(0x0, aips2 + 0x4C);
  53. aips_reg = __raw_readl(aips2 + 0x50);
  54. aips_reg &= 0x00FFFFFF;
  55. __raw_writel(aips_reg, aips2 + 0x50);
  56. } else {
  57. aips_reg = __raw_readl(aips1 + 8);
  58. aips_reg &= ~(1 << aips2);
  59. __raw_writel(aips_reg, aips1 + 8);
  60. }
  61. }
  62. #endif /* CONFIG_IPIPE */
Advertisement
Add Comment
Please, Sign In to add comment