summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91rm9200.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2012-07-12 13:45:58 +0000
committerimp <imp@FreeBSD.org>2012-07-12 13:45:58 +0000
commit2344bfa1745160738ce7fc6477cee9942e61e566 (patch)
treedb82487c7187af878c7bd1e6d6a0a8f637912e5e /sys/arm/at91/at91rm9200.c
parent83a72cff11da31e7dea90d2f60bf1addc4858bf1 (diff)
downloadFreeBSD-src-2344bfa1745160738ce7fc6477cee9942e61e566.zip
FreeBSD-src-2344bfa1745160738ce7fc6477cee9942e61e566.tar.gz
Complete the transition away from newbus to populate the children to
the linker set of CPU modules. The newbus method, although clever, had many flaws: it didn't really support multiple SoC, many of the comments about order were just wrong, and it did a few things far too late to be useful. delay and cpu_reset now work much earlier in the boot process.
Diffstat (limited to 'sys/arm/at91/at91rm9200.c')
-rw-r--r--sys/arm/at91/at91rm9200.c67
1 files changed, 9 insertions, 58 deletions
diff --git a/sys/arm/at91/at91rm9200.c b/sys/arm/at91/at91rm9200.c
index 00b503b..a3201e3 100644
--- a/sys/arm/at91/at91rm9200.c
+++ b/sys/arm/at91/at91rm9200.c
@@ -46,14 +46,6 @@ __FBSDID("$FreeBSD$");
#include <arm/at91/at91_pmcvar.h>
#include <arm/at91/at91soc.h>
-
-struct at91rm92_softc {
- device_t dev;
- bus_space_tag_t sc_st;
- bus_space_handle_t sc_sh;
- bus_space_handle_t sc_sys_sh;
- bus_space_handle_t sc_aic_sh;
-};
/*
* Standard priority levels for the system. 0 is lowest and 7 is highest.
* These values are the ones Atmel uses for its Linux port, which differ
@@ -147,42 +139,19 @@ at91_pll_outb(int freq)
return (0x8000);
}
-static void
-at91_identify(driver_t *drv, device_t parent)
-{
-
- if (at91_cpu_is(AT91_T_RM9200))
- at91_add_child(parent, 0, "at91rm920", 0, 0, 0, -1, 0, 0);
-}
-
-static int
-at91_probe(device_t dev)
-{
-
- device_set_desc(dev, soc_info.name);
- return (0);
-}
-
-static int
-at91_attach(device_t dev)
-{
- struct at91_pmc_clock *clk;
- struct at91rm92_softc *sc = device_get_softc(dev);
- struct at91_softc *at91sc = device_get_softc(device_get_parent(dev));
-
- sc->sc_st = at91sc->sc_st;
- sc->sc_sh = at91sc->sc_sh;
- sc->dev = dev;
-
- if (bus_space_subregion(sc->sc_st, sc->sc_sh, AT91RM92_SYS_BASE,
- AT91RM92_SYS_SIZE, &sc->sc_sys_sh) != 0)
- panic("Enable to map system registers");
-
+#if 0
+/* -- XXX are these needed? */
/* Disable all interrupts for RTC (0xe24 == RTC_IDR) */
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xe24, 0xffffffff);
/* Disable all interrupts for the SDRAM controller */
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, 0xfa8, 0xffffffff);
+#endif
+
+static void
+at91_clock_init(void)
+{
+ struct at91_pmc_clock *clk;
/* Update USB device port clock info */
clk = at91_pmc_clock_ref("udpck");
@@ -218,30 +187,12 @@ at91_attach(device_t dev)
clk->pll_div_mask = RM9200_PLL_B_DIV_MASK;
clk->set_outb = at91_pll_outb;
at91_pmc_clock_deref(clk);
-
- return (0);
}
-static device_method_t at91_methods[] = {
- DEVMETHOD(device_probe, at91_probe),
- DEVMETHOD(device_attach, at91_attach),
- DEVMETHOD(device_identify, at91_identify),
- {0, 0},
-};
-
-static driver_t at91rm92_driver = {
- "at91rm920",
- at91_methods,
- sizeof(struct at91rm92_softc),
-};
-
-static devclass_t at91rm92_devclass;
-
-DRIVER_MODULE(at91rm920, atmelarm, at91rm92_driver, at91rm92_devclass, 0, 0);
-
static struct at91_soc_data soc_data = {
.soc_delay = at91_st_delay,
.soc_reset = at91_st_cpu_reset,
+ .soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
.soc_children = at91_devs,
};
OpenPOWER on IntegriCloud