]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
LPC23xx PLL: security IRQ locking added
authorMarek Peca <mp@duch.cz>
Mon, 7 Sep 2009 18:14:22 +0000 (20:14 +0200)
committerMarek Peca <mp@duch.cz>
Mon, 7 Sep 2009 18:14:22 +0000 (20:14 +0200)
arch/arm/mach-lpc21xx/libs/pll/pll_init.c

index 73a04a85cc83486f14e0c7c2e8dc93a0ebd67d25..97a3a770738c8d4e620541b78262f40bfcf05bb3 100644 (file)
@@ -1,3 +1,4 @@
+#include <cpu_def.h>
 #include <lpc2xxx.h>
 #include "pll.h"
 
@@ -11,6 +12,9 @@
  */
 void sys_pll_init(uint32_t f_cclk, uint32_t f_osc) {
   uint32_t m, p, p_max;
+  unsigned long flags;
+
+  save_and_cli(flags);
 
   /* turn memory acceleration off */
   MAMCR = 0x0;
@@ -36,6 +40,8 @@ void sys_pll_init(uint32_t f_cclk, uint32_t f_osc) {
   /* turn memory acceleration on */
   MAMTIM = f_cclk/20000000;
   MAMCR = 0x2;
+
+  restore_flags(flags);
 }
 
 #endif
@@ -44,6 +50,9 @@ void sys_pll_init(uint32_t f_cclk, uint32_t f_osc) {
 
 void lpc23xx_pll_init(int clk_src, int m, int n, int cclk_div) {
   unsigned u;
+  unsigned long flags;
+
+  save_and_cli(flags);
 
   /* turn memory acceleration off */
   MAMCR = 0x0;
@@ -79,6 +88,8 @@ void lpc23xx_pll_init(int clk_src, int m, int n, int cclk_div) {
   MAMTIM = f_cclk/20000000;
   MAMCR = 0x2;
   ***/
+
+  restore_flags(flags);
 }
 
 #endif