Initialise the watchdog and UART frequencies.

For all pre-AR933x chips, the frequency is just the APB frequency.
For the AR933x, the UART frequency is different but we just hacked around
it.

For the AR934x, there's a different PLL setting for these, so they have
to be broken out.
This commit is contained in:
Adrian Chadd 2013-07-21 03:52:52 +00:00
parent 766c980a8b
commit 6dbf63db67
4 changed files with 12 additions and 0 deletions

View File

@ -78,6 +78,8 @@ __FBSDID("$FreeBSD$");
uint32_t u_ar71xx_cpu_freq;
uint32_t u_ar71xx_ahb_freq;
uint32_t u_ar71xx_ddr_freq;
uint32_t u_ar71xx_uart_freq;
uint32_t u_ar71xx_wdt_freq;
uint32_t u_ar71xx_refclk;
static void
@ -107,6 +109,8 @@ ar71xx_chip_detect_sys_frequency(void)
div = (((pll >> AR71XX_AHB_DIV_SHIFT) & AR71XX_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
}
/*

View File

@ -90,6 +90,8 @@ ar724x_chip_detect_sys_frequency(void)
div = (((pll >> AR724X_AHB_DIV_SHIFT) & AR724X_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
}
static void

View File

@ -84,6 +84,8 @@ ar91xx_chip_detect_sys_frequency(void)
div = (((pll >> AR91XX_AHB_DIV_SHIFT) & AR91XX_AHB_DIV_MASK) + 1) * 2;
u_ar71xx_ahb_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_uart_freq = u_ar71xx_cpu_freq / div;
u_ar71xx_wdt_freq = u_ar71xx_cpu_freq / div;
}
static void

View File

@ -114,6 +114,10 @@ ar933x_chip_detect_sys_frequency(void)
AR933X_PLL_CLOCK_CTRL_AHB_DIV_MASK) + 1;
u_ar71xx_ahb_freq = freq / t;
}
/* XXX uart should be the refclk, no? */
u_ar71xx_uart_freq = u_ar71xx_ahb_freq;
u_ar71xx_wdt_freq = u_ar71xx_ahb_freq;
}
static void