Try to fix some weird null registry
This commit is contained in:
parent
d514817b65
commit
dbb26b33c7
1 changed files with 4 additions and 2 deletions
|
@ -136,7 +136,7 @@ clkgpio::~clkgpio()
|
|||
|
||||
int clkgpio::SetPllNumber(int PllNo, int MashType)
|
||||
{
|
||||
//print_clock_tree();
|
||||
print_clock_tree();
|
||||
if (PllNo < 8)
|
||||
pllnumber = PllNo;
|
||||
else
|
||||
|
@ -169,6 +169,8 @@ uint64_t clkgpio::GetPllFrequency(int PllNo)
|
|||
//case clk_pllb:Freq=XOSC_FREQUENCY*((uint64_t)gpioreg[PLLB_CTRL]&0x3ff) +XOSC_FREQUENCY*(uint64_t)gpioreg[PLLB_FRAC]/(1<<20);break;
|
||||
case clk_pllc:
|
||||
//Freq = (XOSC_FREQUENCY * ((uint64_t)gpioreg[PLLC_CTRL] & 0x3ff) + (XOSC_FREQUENCY * (uint64_t)gpioreg[PLLC_FRAC]) / (1 << 20)) / (2*gpioreg[PLLC_PER] >> 1)) /((gpioreg[PLLC_CTRL] >> 12)&0x7) ;
|
||||
//dbg_printf(1, "Gpio reg %x %x\n",gpioreg[PLLC_PER],gpioreg[PLLC_CTRL] >> 12);
|
||||
if((gpioreg[PLLC_PER]!=0)&&(gpioreg[PLLC_CTRL] >> 12 != 0))
|
||||
Freq =( (XOSC_FREQUENCY * ((uint64_t)gpioreg[PLLC_CTRL] & 0x3ff) + (XOSC_FREQUENCY * (uint64_t)gpioreg[PLLC_FRAC]) / (1 << 20)) / (2*gpioreg[PLLC_PER] >> 1))/((gpioreg[PLLC_CTRL] >> 12)&0x7) ;
|
||||
break;
|
||||
case clk_plld:
|
||||
|
|
Loading…
Reference in a new issue