diff options
author | adrian <adrian@FreeBSD.org> | 2010-08-19 02:03:12 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2010-08-19 02:03:12 +0000 |
commit | 1c6fde75b32cd476ed4247f4e2870435fb6fe143 (patch) | |
tree | af5f12c83bfc167d9e173e3a136bae5cae9c3f2b /sys/mips/atheros/ar71xx_machdep.c | |
parent | 9a8b3cac780596343c946cecea69c661e3615e12 (diff) | |
download | FreeBSD-src-1c6fde75b32cd476ed4247f4e2870435fb6fe143.zip FreeBSD-src-1c6fde75b32cd476ed4247f4e2870435fb6fe143.tar.gz |
Preparation work for supporting the AR91xx and AR724x.
* Implement a SoC probe function, from Linux, which determines the
SoC family, type and revision. This only probes the AR71xx series
SoC and (currently) panics on others.
* Migrate some of the AR71XX specific hardware init (USB device, determining
system frequencies) into using the cpuops introduced in an earlier commit.
Other SoC specific hardware stuff (per-device flush/WB, GPIO pin wiring,
Ethernet PLL setup, other things I've likely missed) will be introduced in
subsequent commits.
Reviewed by: imp@
Obtained from: (partially) Linux
Diffstat (limited to 'sys/mips/atheros/ar71xx_machdep.c')
-rw-r--r-- | sys/mips/atheros/ar71xx_machdep.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/mips/atheros/ar71xx_machdep.c b/sys/mips/atheros/ar71xx_machdep.c index 6cb68ce..a390167 100644 --- a/sys/mips/atheros/ar71xx_machdep.c +++ b/sys/mips/atheros/ar71xx_machdep.c @@ -57,6 +57,9 @@ __FBSDID("$FreeBSD$"); #include <mips/atheros/ar71xxreg.h> +#include <mips/atheros/ar71xx_setup.h> +#include <mips/atheros/ar71xx_cpudef.h> + extern char edata[], end[]; uint32_t ar711_base_mac[ETHER_ADDR_LEN]; @@ -202,11 +205,21 @@ platform_start(__register_t a0 __unused, __register_t a1 __unused, * should be called first. */ init_param1(); + + /* Detect the system type - this is needed for subsequent chipset-specific calls */ + ar71xx_detect_sys_type(); + ar71xx_detect_sys_frequency(); + platform_counter_freq = ar71xx_cpu_freq(); mips_timer_init_params(platform_counter_freq, 1); cninit(); init_static_kenv(boot1_env, sizeof(boot1_env)); + printf("CPU platform: %s\n", ar71xx_get_system_type()); + printf("CPU Frequency=%d MHz\n", u_ar71xx_cpu_freq / 1000000); + printf("CPU DDR Frequency=%d MHz\n", u_ar71xx_ddr_freq / 1000000); + printf("CPU AHB Frequency=%d MHz\n", u_ar71xx_ahb_freq / 1000000); + printf("platform frequency: %lld\n", platform_counter_freq); printf("arguments: \n"); printf(" a0 = %08x\n", a0); |