summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91_pmc.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2014-02-09 20:58:03 +0000
committerimp <imp@FreeBSD.org>2014-02-09 20:58:03 +0000
commit5d72dffadda514d765a2813fbf7667e3334c7f2e (patch)
tree34b09c6b3d86c2dd93bd9f2ca8efef93dd6e906a /sys/arm/at91/at91_pmc.c
parentb4092f910752d4eb5da1d065ff7e57a7a3979999 (diff)
downloadFreeBSD-src-5d72dffadda514d765a2813fbf7667e3334c7f2e.zip
FreeBSD-src-5d72dffadda514d765a2813fbf7667e3334c7f2e.tar.gz
Add FDT attachment.
Diffstat (limited to 'sys/arm/at91/at91_pmc.c')
-rw-r--r--sys/arm/at91/at91_pmc.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/arm/at91/at91_pmc.c b/sys/arm/at91/at91_pmc.c
index d811d38..904709b 100644
--- a/sys/arm/at91/at91_pmc.c
+++ b/sys/arm/at91/at91_pmc.c
@@ -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
OpenPOWER on IntegriCloud