Author: imp Date: Sun Feb 9 20:58:03 2014 New Revision: 261684 URL: http://svnweb.freebsd.org/changeset/base/261684
Log: Add FDT attachment. Modified: head/sys/arm/at91/at91_pmc.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sun Feb 9 20:57:26 2014 (r261683) +++ head/sys/arm/at91/at91_pmc.c Sun Feb 9 20:58:03 2014 (r261684) @@ -24,6 +24,8 @@ * SUCH DAMAGE. */ +#include "opt_platform.h" + #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); @@ -49,6 +51,12 @@ __FBSDID("$FreeBSD$"); #include <arm/at91/at91_pmcreg.h> #include <arm/at91/at91_pmcvar.h> +#ifdef FDT +#include <dev/fdt/fdt_common.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> +#endif + static struct at91_pmc_softc { bus_space_tag_t sc_st; bus_space_handle_t sc_sh; @@ -526,6 +534,8 @@ at91_pmc_init_clock(void) uint32_t mckr; uint32_t mdiv; + soc_info.soc_data->soc_clock_init(); + main_clock = at91_pmc_sense_main_clock(); if (at91_is_sam9() || at91_is_sam9xe()) { @@ -650,7 +660,10 @@ errout: static int at91_pmc_probe(device_t dev) { - +#ifdef FDT + if (!ofw_bus_is_compatible(dev, "atmel,at91rm9200-pmc")) + return (ENXIO); +#endif device_set_desc(dev, "PMC"); return (0); } @@ -695,5 +708,10 @@ static driver_t at91_pmc_driver = { }; static devclass_t at91_pmc_devclass; +#ifdef FDT +DRIVER_MODULE(at91_pmc, simplebus, at91_pmc_driver, at91_pmc_devclass, NULL, + NULL); +#else DRIVER_MODULE(at91_pmc, atmelarm, at91_pmc_driver, at91_pmc_devclass, NULL, NULL); +#endif _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"