Index: head/sys/arm/mv/armada38x/armada38x.c =================================================================== --- head/sys/arm/mv/armada38x/armada38x.c +++ head/sys/arm/mv/armada38x/armada38x.c @@ -61,7 +61,7 @@ } uint32_t -get_tclk(void) +get_tclk_armada38x(void) { uint32_t sar; @@ -78,7 +78,7 @@ } uint32_t -get_cpu_freq(void) +get_cpu_freq_armada38x(void) { uint32_t sar; Index: head/sys/arm/mv/armada38x/std.armada38x =================================================================== --- head/sys/arm/mv/armada38x/std.armada38x +++ head/sys/arm/mv/armada38x/std.armada38x @@ -1,6 +1,7 @@ # $FreeBSD$ files "../mv/armada38x/files.armada38x" files "../mv/files.mv" +files "../mv/files.arm7" cpu CPU_CORTEXA machine arm armv7 Index: head/sys/arm/mv/armadaxp/armadaxp.c =================================================================== --- head/sys/arm/mv/armadaxp/armadaxp.c +++ head/sys/arm/mv/armadaxp/armadaxp.c @@ -138,7 +138,7 @@ } uint32_t -get_tclk(void) +get_tclk_armadaxp(void) { uint32_t cputype; @@ -152,7 +152,7 @@ } uint32_t -get_cpu_freq(void) +get_cpu_freq_armadaxp(void) { return (0); Index: head/sys/arm/mv/files.arm7 =================================================================== --- head/sys/arm/mv/files.arm7 +++ head/sys/arm/mv/files.arm7 @@ -0,0 +1,3 @@ +# $FreeBSD$ +arm/mv/armada38x/armada38x.c standard +arm/mv/armadaxp/armadaxp.c standard Index: head/sys/arm/mv/mv_common.c =================================================================== --- head/sys/arm/mv/mv_common.c +++ head/sys/arm/mv/mv_common.c @@ -230,6 +230,7 @@ typedef uint32_t (*win_read_t)(int); typedef void (*win_write_t)(int, uint32_t); typedef int (*win_cesa_attr_t)(int); +typedef uint32_t (*get_t)(void); struct decode_win_spec { read_cpu_ctrl_t read_cpu_ctrl; @@ -249,6 +250,10 @@ win_read_t ddr_sz_read; win_write_t ddr_br_write; win_write_t ddr_sz_write; +#if __ARM_ARCH >= 6 + get_t get_tclk; + get_t get_cpu_freq; +#endif }; struct decode_win_spec *soc_decode_win_spec; @@ -273,6 +278,10 @@ &ddr_armv7_sz_read, &ddr_armv7_br_write, &ddr_armv7_sz_write, +#if __ARM_ARCH >= 6 + &get_tclk_armada38x, + &get_cpu_freq_armada38x, +#endif }, { &read_cpu_ctrl_armv7, @@ -292,6 +301,10 @@ &ddr_armv7_sz_read, &ddr_armv7_br_write, &ddr_armv7_sz_write, +#if __ARM_ARCH >= 6 + &get_tclk_armadaxp, + &get_cpu_freq_armadaxp, +#endif }, { &read_cpu_ctrl_armv5, @@ -311,6 +324,10 @@ &ddr_armv5_sz_read, &ddr_armv5_br_write, &ddr_armv5_sz_write, +#if __ARM_ARCH >= 6 + NULL, + NULL, +#endif }, }; @@ -2951,6 +2968,28 @@ { "mrvl,DB-78460", &fdt_fixup_ranges }, { NULL, NULL } }; + +#if __ARM_ARCH >= 6 +uint32_t +get_tclk(void) +{ + + if (soc_decode_win_spec->get_tclk != NULL) + return soc_decode_win_spec->get_tclk(); + else + return -1; +} + +uint32_t +get_cpu_freq(void) +{ + + if (soc_decode_win_spec->get_cpu_freq != NULL) + return soc_decode_win_spec->get_cpu_freq(); + else + return -1; +} +#endif #ifndef INTRNG static int Index: head/sys/arm/mv/mvvar.h =================================================================== --- head/sys/arm/mv/mvvar.h +++ head/sys/arm/mv/mvvar.h @@ -148,4 +148,9 @@ vm_offset_t); int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); enum soc_family mv_check_soc_family(void); + +uint32_t get_tclk_armadaxp(void); +uint32_t get_tclk_armada38x(void); +uint32_t get_cpu_freq_armadaxp(void); +uint32_t get_cpu_freq_armada38x(void); #endif /* _MVVAR_H_ */ Index: head/sys/arm/mv/std-pj4b.mv =================================================================== --- head/sys/arm/mv/std-pj4b.mv +++ head/sys/arm/mv/std-pj4b.mv @@ -1,6 +1,7 @@ # $FreeBSD$ files "../mv/files.mv" +files "../mv/files.arm7" cpu CPU_MV_PJ4B machine arm armv7 makeoptions CONF_CFLAGS="-march=armv7a"