summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91sam9g20.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/at91sam9g20.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/at91sam9g20.c')
-rw-r--r--sys/arm/at91/at91sam9g20.c64
1 files changed, 3 insertions, 61 deletions
diff --git a/sys/arm/at91/at91sam9g20.c b/sys/arm/at91/at91sam9g20.c
index 324064c..73876b0 100644
--- a/sys/arm/at91/at91sam9g20.c
+++ b/sys/arm/at91/at91sam9g20.c
@@ -47,12 +47,6 @@ __FBSDID("$FreeBSD$");
#include <arm/at91/at91_pmcvar.h>
#include <arm/at91/at91_rstreg.h>
-struct at91sam9_softc {
- bus_space_tag_t sc_st;
- bus_space_handle_t sc_sh;
- bus_space_handle_t sc_matrix_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
@@ -153,44 +147,9 @@ at91_pll_outb(int freq)
}
static void
-at91_identify(driver_t *drv, device_t parent)
-{
-
- if (at91_cpu_is(AT91_T_SAM9G20))
- at91_add_child(parent, 0, "at91sam", 9, 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)
+at91_clock_init(void)
{
struct at91_pmc_clock *clk;
- struct at91sam9_softc *sc = device_get_softc(dev);
- struct at91_softc *at91sc = device_get_softc(device_get_parent(dev));
- uint32_t i;
-
- sc->sc_st = at91sc->sc_st;
- sc->sc_sh = at91sc->sc_sh;
-
- if (bus_space_subregion(sc->sc_st, sc->sc_sh,
- AT91SAM9G20_MATRIX_BASE, AT91SAM9G20_MATRIX_SIZE,
- &sc->sc_matrix_sh) != 0)
- panic("Enable to map matrix registers");
-
- /* activate NAND*/
- i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh,
- AT91SAM9G20_EBICSA);
- bus_space_write_4(sc->sc_st, sc->sc_matrix_sh,
- AT91SAM9G20_EBICSA,
- i | AT91_MATRIX_EBI_CS3A_SMC_SMARTMEDIA);
-
/* Update USB device port clock info */
clk = at91_pmc_clock_ref("udpck");
@@ -226,31 +185,14 @@ at91_attach(device_t dev)
clk->pll_div_mask = SAM9G20_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 at91sam9_driver = {
- "at91sam",
- at91_methods,
- sizeof(struct at91sam9_softc),
-};
-
-static devclass_t at91sam9_devclass;
-
-DRIVER_MODULE(at91sam, atmelarm, at91sam9_driver, at91sam9_devclass, 0, 0);
-
static struct at91_soc_data soc_data = {
.soc_delay = at91_pit_delay,
.soc_reset = at91_rst_cpu_reset,
+ .soc_clock_init = at91_clock_init,
.soc_irq_prio = at91_irq_prio,
- .soc_childpren = at91_devs,
+ .soc_children = at91_devs,
};
AT91_SOC(AT91_T_SAM9G20, &soc_data);
OpenPOWER on IntegriCloud