1/*- 2 * Copyright (c) 2005 Olivier Houchard. All rights reserved. 3 * Copyright (c) 2010 Greg Ansley. All rights reserved. 4 * Copyright (c) 2012 M. Warner Losh.. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/arm/at91/at91sam9x25.c 238390 2012-07-12 04:23:11Z imp $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/bus.h> 34#include <sys/kernel.h> 35#include <sys/malloc.h> 36#include <sys/module.h> 37 --- 5 unchanged lines hidden (view full) --- 43#include <arm/at91/at91_aicreg.h> 44#include <arm/at91/at91sam9x25reg.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 at91sam9x25_softc { |
51 int filler; |
52}; 53 54/* 55 * Standard priority levels for the system. 0 is lowest and 7 is highest. 56 * These values are the ones Atmel uses for its Linux port 57 */ 58static const int at91_irq_prio[32] = 59{ --- 64 unchanged lines hidden (view full) --- 124 DEVICE("macb", EMAC0, 0), 125 DEVICE("macb", EMAC1, 0), 126 DEVICE("nand", NAND, 0), 127 DEVICE("ohci", OHCI, 0), 128 DEVICE("ehci", EHCI, 0), 129 { 0, 0, 0, 0, 0 } 130}; 131 |
132static uint32_t 133at91_pll_outa(int freq) 134{ 135 136 switch (freq / 10000000) { 137 case 747 ... 801: return ((1 << 29) | (0 << 14)); 138 case 697 ... 746: return ((1 << 29) | (1 << 14)); 139 case 647 ... 696: return ((1 << 29) | (2 << 14)); --- 12 unchanged lines hidden (view full) --- 152 153 return (0); 154} 155 156static void 157at91_identify(driver_t *drv, device_t parent) 158{ 159 |
160 if (soc_info.type == AT91_T_SAM9X5 && soc_info.subtype == AT91_ST_SAM9X25) |
161 at91_add_child(parent, 0, "at91sam9x25", 0, 0, 0, -1, 0, 0); |
162} 163 164static int 165at91_probe(device_t dev) 166{ 167 168 device_set_desc(dev, "AT91SAM9X25"); 169 return (0); 170} 171 172static int 173at91_attach(device_t dev) 174{ 175 struct at91_pmc_clock *clk; |
176 |
177 /* Update USB device port clock info */ 178 clk = at91_pmc_clock_ref("udpck"); 179 clk->pmc_mask = PMC_SCER_UDP_SAM9; 180 at91_pmc_clock_deref(clk); 181 182 /* Update USB host port clock info */ 183 clk = at91_pmc_clock_ref("uhpck"); 184 clk->pmc_mask = PMC_SCER_UHP_SAM9; --- 42 unchanged lines hidden (view full) --- 227static devclass_t at91sam9x25_devclass; 228 229DRIVER_MODULE(at91sam9x25, atmelarm, at91sam9x25_driver, at91sam9x25_devclass, 0, 0); 230 231static struct at91_soc_data soc_data = { 232 .soc_delay = at91_pit_delay, 233 .soc_reset = at91_rst_cpu_reset, 234 .soc_irq_prio = at91_irq_prio, |
235 .soc_childpren = at91_devs, |
236}; 237 238AT91_SOC_SUB(AT91_T_SAM9X5, AT91_ST_SAM9X25, &soc_data); |