1/*- 2 * Copyright (c) 2005 Olivier Houchard. All rights reserved. 3 * Copyright (c) 2010 Greg Ansley. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9260.c 238390 2012-07-12 04:23:11Z imp $"); |
29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/malloc.h> 35#include <sys/module.h> 36 --- 6 unchanged lines hidden (view full) --- 43#include <arm/at91/at91_aicreg.h> 44#include <arm/at91/at91sam9260reg.h> 45#include <arm/at91/at91_pitreg.h> 46#include <arm/at91/at91_pmcreg.h> 47#include <arm/at91/at91_pmcvar.h> 48#include <arm/at91/at91_rstreg.h> 49 50struct at91sam9_softc { |
51 bus_space_tag_t sc_st; 52 bus_space_handle_t sc_sh; 53 bus_space_handle_t sc_matrix_sh; 54}; 55 56/* 57 * Standard priority levels for the system. 0 is lowest and 7 is highest. 58 * These values are the ones Atmel uses for its Linux port --- 64 unchanged lines hidden (view full) --- 123 DEVICE("spi", SPI1, 1), 124 DEVICE("ate", EMAC, 0), 125 DEVICE("macb", EMAC, 0), 126 DEVICE("nand", NAND, 0), 127 DEVICE("ohci", OHCI, 0), 128 { 0, 0, 0, 0, 0 } 129}; 130 |
131static uint32_t 132at91_pll_outa(int freq) 133{ 134 135 if (freq > 195000000) 136 return (0x20000000); 137 else 138 return (0x20008000); --- 5 unchanged lines hidden (view full) --- 144 145 return (0x4000); 146} 147 148static void 149at91_identify(driver_t *drv, device_t parent) 150{ 151 |
152 if (soc_info.type == AT91_T_SAM9260) |
153 at91_add_child(parent, 0, "at91sam9260", 0, 0, 0, -1, 0, 0); |
154} 155 156static int 157at91_probe(device_t dev) 158{ 159 160 device_set_desc(dev, soc_info.name); 161 return (0); --- 4 unchanged lines hidden (view full) --- 166{ 167 struct at91_pmc_clock *clk; 168 struct at91sam9_softc *sc = device_get_softc(dev); 169 struct at91_softc *at91sc = device_get_softc(device_get_parent(dev)); 170 uint32_t i; 171 172 sc->sc_st = at91sc->sc_st; 173 sc->sc_sh = at91sc->sc_sh; |
174 175 if (bus_space_subregion(sc->sc_st, sc->sc_sh, 176 AT91SAM9260_MATRIX_BASE, AT91SAM9260_MATRIX_SIZE, 177 &sc->sc_matrix_sh) != 0) 178 panic("Enable to map matrix registers"); 179 180 /* activate NAND */ 181 i = bus_space_read_4(sc->sc_st, sc->sc_matrix_sh, --- 65 unchanged lines hidden (view full) --- 247 248DRIVER_MODULE(at91sam9260, atmelarm, at91sam9260_driver, at91sam9260_devclass, 249 NULL, NULL); 250 251static struct at91_soc_data soc_data = { 252 .soc_delay = at91_pit_delay, 253 .soc_reset = at91_rst_cpu_reset, 254 .soc_irq_prio = at91_irq_prio, |
255 .soc_children = at91_devs, |
256}; 257 258AT91_SOC(AT91_T_SAM9260, &soc_data); |