mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-30 08:31:03 +00:00
8260: Making the use of gd->pci_clk dependant on the CONFIG_PCI
Signed-off-by: Matvejchikov Ilya <matvejchikov@gmail.com>
This commit is contained in:
parent
6361ad4b59
commit
9196b44334
1 changed files with 27 additions and 20 deletions
|
@ -162,6 +162,30 @@ int get_clocks (void)
|
|||
gd->cpu_clk = clkin;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PCI
|
||||
gd->pci_clk = clkin;
|
||||
|
||||
if (sccr & SCCR_PCI_MODE) {
|
||||
uint pci_div;
|
||||
uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
|
||||
|
||||
if (sccr & SCCR_PCI_MODCK) {
|
||||
pci_div = 2;
|
||||
if (pcidf == 9) {
|
||||
pci_div *= 5;
|
||||
} else if (pcidf == 0xB) {
|
||||
pci_div *= 6;
|
||||
} else {
|
||||
pci_div *= (pcidf + 1);
|
||||
}
|
||||
} else {
|
||||
pci_div = pcidf + 1;
|
||||
}
|
||||
|
||||
gd->pci_clk = (gd->cpm_clk * 2) / pci_div;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
@ -220,26 +244,9 @@ int prt_8260_clks (void)
|
|||
|
||||
printf (" - cpu_clk %10ld, cpm_clk %10ld, bus_clk %10ld\n",
|
||||
gd->cpu_clk, gd->cpm_clk, gd->bus_clk);
|
||||
|
||||
if (sccr & SCCR_PCI_MODE) {
|
||||
uint pci_div;
|
||||
uint pcidf = (sccr & SCCR_PCIDF_MSK) >> SCCR_PCIDF_SHIFT;
|
||||
|
||||
if (sccr & SCCR_PCI_MODCK) {
|
||||
pci_div = 2;
|
||||
if (pcidf == 9) {
|
||||
pci_div *= 5;
|
||||
} else if (pcidf == 0xB) {
|
||||
pci_div *= 6;
|
||||
} else {
|
||||
pci_div *= (pcidf + 1);
|
||||
}
|
||||
} else {
|
||||
pci_div = pcidf + 1;
|
||||
}
|
||||
|
||||
printf (" - pci_clk %10ld\n", (gd->cpm_clk * 2) / pci_div);
|
||||
}
|
||||
#ifdef CONFIG_PCI
|
||||
printf (" - pci_clk %10ld\n", gd->pci_clk);
|
||||
#endif
|
||||
putc ('\n');
|
||||
|
||||
return (0);
|
||||
|
|
Loading…
Reference in a new issue