summaryrefslogtreecommitdiff
path: root/board/amcc/yosemite/yosemite.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-10-24 22:25:11 +0200
committerWolfgang Denk <wd@denx.de>2009-10-24 22:25:11 +0200
commit09cc0487b8cccc9013649052c62be244158be2ad (patch)
tree9232060ebf7ec2aff40f007cbf099e9a58a8a96a /board/amcc/yosemite/yosemite.c
parenta89805f324a060b66a59ec911dbbdba400003deb (diff)
parent4ee63268152594bb7af6bec2b59d53bba68082bf (diff)
downloadu-boot-imx-09cc0487b8cccc9013649052c62be244158be2ad.zip
u-boot-imx-09cc0487b8cccc9013649052c62be244158be2ad.tar.gz
u-boot-imx-09cc0487b8cccc9013649052c62be244158be2ad.tar.bz2
Merge branch 'master' of /home/wd/git/u-boot/custodians
Diffstat (limited to 'board/amcc/yosemite/yosemite.c')
-rw-r--r--board/amcc/yosemite/yosemite.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/board/amcc/yosemite/yosemite.c b/board/amcc/yosemite/yosemite.c
index 7ceccfa..ccbeb0e 100644
--- a/board/amcc/yosemite/yosemite.c
+++ b/board/amcc/yosemite/yosemite.c
@@ -33,6 +33,15 @@ DECLARE_GLOBAL_DATA_PTR;
extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; /* info for FLASH chips */
+static inline u32 get_async_pci_freq(void)
+{
+ if (in_8((void *)(CONFIG_SYS_BCSR_BASE + 5)) &
+ CONFIG_SYS_BCSR5_PCI66EN)
+ return 66666666;
+ else
+ return 33333333;
+}
+
int board_early_init_f(void)
{
register uint reg;
@@ -106,6 +115,9 @@ int board_early_init_f(void)
mtsdr(SDR0_PFC0, 0x00003e00); /* Pin function */
mtsdr(SDR0_PFC1, 0x00048000); /* Pin function: UART0 has 4 pins */
+ /* Check and reconfigure the PCI sync clock if necessary */
+ ppc4xx_pci_sync_clock_config(get_async_pci_freq());
+
/*clear tmrclk divisor */
*(unsigned char *)(CONFIG_SYS_BCSR_BASE | 0x04) = 0x00;
@@ -178,7 +190,7 @@ int checkboard(void)
{
char *s = getenv("serial#");
u8 rev;
- u8 val;
+ u32 clock = get_async_pci_freq();
#ifdef CONFIG_440EP
printf("Board: Yosemite - AMCC PPC440EP Evaluation Board");
@@ -187,8 +199,7 @@ int checkboard(void)
#endif
rev = in_8((void *)(CONFIG_SYS_BCSR_BASE + 0));
- val = in_8((void *)(CONFIG_SYS_BCSR_BASE + 5)) & CONFIG_SYS_BCSR5_PCI66EN;
- printf(", Rev. %X, PCI=%d MHz", rev, val ? 66 : 33);
+ printf(", Rev. %X, PCI-Async=%d MHz", rev, clock / 1000000);
if (s != NULL) {
puts(", serial# ");
@@ -196,6 +207,15 @@ int checkboard(void)
}
putc('\n');
+ /*
+ * Reconfiguration of the PCI sync clock is already done,
+ * now check again if everything is in range:
+ */
+ if (ppc4xx_pci_sync_clock_config(clock)) {
+ printf("ERROR: PCI clocking incorrect (async=%d "
+ "sync=%ld)!\n", clock, get_PCI_freq());
+ }
+
return (0);
}