aboutsummaryrefslogtreecommitdiff
path: root/sys/mips/atheros
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2013-07-21 03:52:52 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2013-07-21 03:52:52 +0000
commit6dbf63db676e99bc3ba9afa7b491381e774d9f36 (patch)
tree1767cfddef87615259b1c9e260f073e0ffabe8a6 /sys/mips/atheros
parent766c980a8baf8c80237cbef988386eacae13ffe9 (diff)
downloadsrc-6dbf63db676e99bc3ba9afa7b491381e774d9f36.tar.gz
src-6dbf63db676e99bc3ba9afa7b491381e774d9f36.zip
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.
Notes
Notes: svn path=/head/; revision=253508
Diffstat (limited to 'sys/mips/atheros')
-rw-r--r--sys/mips/atheros/ar71xx_chip.c4
-rw-r--r--sys/mips/atheros/ar724x_chip.c2
-rw-r--r--sys/mips/atheros/ar91xx_chip.c2
-rw-r--r--sys/mips/atheros/ar933x_chip.c4
4 files changed, 12 insertions, 0 deletions
diff --git a/sys/mips/atheros/ar71xx_chip.c b/sys/mips/atheros/ar71xx_chip.c
index d141b1c35067..db7920f6b258 100644
--- a/sys/mips/atheros/ar71xx_chip.c
+++ b/sys/mips/atheros/ar71xx_chip.c
@@ -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;
}
/*
diff --git a/sys/mips/atheros/ar724x_chip.c b/sys/mips/atheros/ar724x_chip.c
index 74502d5a71be..c06eca63cd22 100644
--- a/sys/mips/atheros/ar724x_chip.c
+++ b/sys/mips/atheros/ar724x_chip.c
@@ -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
diff --git a/sys/mips/atheros/ar91xx_chip.c b/sys/mips/atheros/ar91xx_chip.c
index 37feaf7ebdbb..a4174b47363d 100644
--- a/sys/mips/atheros/ar91xx_chip.c
+++ b/sys/mips/atheros/ar91xx_chip.c
@@ -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
diff --git a/sys/mips/atheros/ar933x_chip.c b/sys/mips/atheros/ar933x_chip.c
index cf0de55331f2..1b68cadd7a56 100644
--- a/sys/mips/atheros/ar933x_chip.c
+++ b/sys/mips/atheros/ar933x_chip.c
@@ -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