changeset 124:190c68fa5689

l1_pwmgr.c: l1ctl_pgm_clk32() reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Thu, 12 May 2016 03:10:45 +0000
parents 63137aa0ad1f
children 813c4bb83603
files chipsetsw/layer1/cfile/l1_pwmgr.c
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_pwmgr.c	Thu May 12 02:18:21 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_pwmgr.c	Thu May 12 03:10:45 2016 +0000
@@ -380,10 +380,17 @@
   frac = (UWORD32)(((HF - (root*LF)) << 16) / LF);
 
 // previous ratio with frac + 0.5
+#if 0	/* original LoCosto code */
 #define RATIO2(HF,LF, root, frac)         \
 if(LF){                                       \
  root = (UWORD32)(HF/LF);                           \
   frac = (UWORD32)((((HF - (root*LF)) << 16) + 0.5*LF) / LF);}
+#else	/* FreeCalypso TCS211 reconstruction */
+#define RATIO2(HF,LF, root, frac)	\
+{					\
+  root = (UWORD32)(HF/LF);                           \
+  frac = (UWORD32)((((HF - (root*LF)) << 16) + 0.5*LF) / LF);}
+#endif
 
 #define HFTHEO(LF, root, frac, hftheo) \
   hftheo = root*LF + ((frac*LF) >>16);
@@ -1028,7 +1035,7 @@
     // that's why nb_hf is divided by 3*l1_config.dpll
     // RATIO2(nb_hf/(3*l1_config.dpll),nb_32khz,inc_sixteen,inc_frac);
     // this line above is equal to the ligne below:
-    lf=(UWORD32)((UWORD32)(3*((UWORD32)((UWORD32)(l1_config.dpll)*nb_32khz))));  //OMAPS00090550
+    lf=(UWORD32)(3*l1_config.dpll*nb_32khz);
     RATIO2(nb_hf,lf,inc_sixteen,inc_frac);
 
     // integer part