FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_pwmgr.c @ 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 |
comparison
equal
deleted
inserted
replaced
123:63137aa0ad1f | 124:190c68fa5689 |
---|---|
378 #define RATIO(HF,LF, root, frac) \ | 378 #define RATIO(HF,LF, root, frac) \ |
379 root = (UWORD32)(HF/LF); \ | 379 root = (UWORD32)(HF/LF); \ |
380 frac = (UWORD32)(((HF - (root*LF)) << 16) / LF); | 380 frac = (UWORD32)(((HF - (root*LF)) << 16) / LF); |
381 | 381 |
382 // previous ratio with frac + 0.5 | 382 // previous ratio with frac + 0.5 |
383 #if 0 /* original LoCosto code */ | |
383 #define RATIO2(HF,LF, root, frac) \ | 384 #define RATIO2(HF,LF, root, frac) \ |
384 if(LF){ \ | 385 if(LF){ \ |
385 root = (UWORD32)(HF/LF); \ | 386 root = (UWORD32)(HF/LF); \ |
386 frac = (UWORD32)((((HF - (root*LF)) << 16) + 0.5*LF) / LF);} | 387 frac = (UWORD32)((((HF - (root*LF)) << 16) + 0.5*LF) / LF);} |
388 #else /* FreeCalypso TCS211 reconstruction */ | |
389 #define RATIO2(HF,LF, root, frac) \ | |
390 { \ | |
391 root = (UWORD32)(HF/LF); \ | |
392 frac = (UWORD32)((((HF - (root*LF)) << 16) + 0.5*LF) / LF);} | |
393 #endif | |
387 | 394 |
388 #define HFTHEO(LF, root, frac, hftheo) \ | 395 #define HFTHEO(LF, root, frac, hftheo) \ |
389 hftheo = root*LF + ((frac*LF) >>16); | 396 hftheo = root*LF + ((frac*LF) >>16); |
390 | 397 |
391 #define SUM(HF, LF, nb, ind) \ | 398 #define SUM(HF, LF, nb, ind) \ |
1026 // REM: nb_hf is the real value of the high frequency (ex in nbr of 65Mhz clock) | 1033 // REM: nb_hf is the real value of the high frequency (ex in nbr of 65Mhz clock) |
1027 // To compute the ratio, nb_hf must be expressed in nbr of clock 4.33 Mhz | 1034 // To compute the ratio, nb_hf must be expressed in nbr of clock 4.33 Mhz |
1028 // that's why nb_hf is divided by 3*l1_config.dpll | 1035 // that's why nb_hf is divided by 3*l1_config.dpll |
1029 // RATIO2(nb_hf/(3*l1_config.dpll),nb_32khz,inc_sixteen,inc_frac); | 1036 // RATIO2(nb_hf/(3*l1_config.dpll),nb_32khz,inc_sixteen,inc_frac); |
1030 // this line above is equal to the ligne below: | 1037 // this line above is equal to the ligne below: |
1031 lf=(UWORD32)((UWORD32)(3*((UWORD32)((UWORD32)(l1_config.dpll)*nb_32khz)))); //OMAPS00090550 | 1038 lf=(UWORD32)(3*l1_config.dpll*nb_32khz); |
1032 RATIO2(nb_hf,lf,inc_sixteen,inc_frac); | 1039 RATIO2(nb_hf,lf,inc_sixteen,inc_frac); |
1033 | 1040 |
1034 // integer part | 1041 // integer part |
1035 ULDP_INCSIXTEEN_UPDATE(inc_sixteen); | 1042 ULDP_INCSIXTEEN_UPDATE(inc_sixteen); |
1036 | 1043 |