xref: /freebsd/sys/arm/mv/armadaxp/armadaxp.c (revision 16694521fe80f54bf8f37334fe9a54bc5c953a6a)
1*16694521SOleksandr Tymoshenko /*-
2*16694521SOleksandr Tymoshenko  * Copyright (c) 2011 Semihalf.
3*16694521SOleksandr Tymoshenko  * All rights reserved.
4*16694521SOleksandr Tymoshenko  *
5*16694521SOleksandr Tymoshenko  * Redistribution and use in source and binary forms, with or without
6*16694521SOleksandr Tymoshenko  * modification, are permitted provided that the following conditions
7*16694521SOleksandr Tymoshenko  * are met:
8*16694521SOleksandr Tymoshenko  * 1. Redistributions of source code must retain the above copyright
9*16694521SOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer.
10*16694521SOleksandr Tymoshenko  * 2. Redistributions in binary form must reproduce the above copyright
11*16694521SOleksandr Tymoshenko  *    notice, this list of conditions and the following disclaimer in the
12*16694521SOleksandr Tymoshenko  *    documentation and/or other materials provided with the distribution.
13*16694521SOleksandr Tymoshenko  *
14*16694521SOleksandr Tymoshenko  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15*16694521SOleksandr Tymoshenko  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16*16694521SOleksandr Tymoshenko  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17*16694521SOleksandr Tymoshenko  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18*16694521SOleksandr Tymoshenko  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19*16694521SOleksandr Tymoshenko  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20*16694521SOleksandr Tymoshenko  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21*16694521SOleksandr Tymoshenko  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22*16694521SOleksandr Tymoshenko  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23*16694521SOleksandr Tymoshenko  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24*16694521SOleksandr Tymoshenko  * SUCH DAMAGE.
25*16694521SOleksandr Tymoshenko  *
26*16694521SOleksandr Tymoshenko  * From: FreeBSD: src/sys/arm/mv/kirkwood/sheevaplug.c,v 1.2 2010/06/13 13:28:53
27*16694521SOleksandr Tymoshenko  */
28*16694521SOleksandr Tymoshenko 
29*16694521SOleksandr Tymoshenko #include <sys/cdefs.h>
30*16694521SOleksandr Tymoshenko __FBSDID("$FreeBSD$");
31*16694521SOleksandr Tymoshenko 
32*16694521SOleksandr Tymoshenko #include <sys/param.h>
33*16694521SOleksandr Tymoshenko #include <sys/systm.h>
34*16694521SOleksandr Tymoshenko #include <sys/bus.h>
35*16694521SOleksandr Tymoshenko 
36*16694521SOleksandr Tymoshenko #include <machine/bus.h>
37*16694521SOleksandr Tymoshenko 
38*16694521SOleksandr Tymoshenko #include <arm/mv/mvreg.h>
39*16694521SOleksandr Tymoshenko #include <arm/mv/mvvar.h>
40*16694521SOleksandr Tymoshenko 
41*16694521SOleksandr Tymoshenko #include <dev/fdt/fdt_common.h>
42*16694521SOleksandr Tymoshenko #include <dev/ofw/openfirm.h>
43*16694521SOleksandr Tymoshenko 
44*16694521SOleksandr Tymoshenko #include <machine/fdt.h>
45*16694521SOleksandr Tymoshenko 
46*16694521SOleksandr Tymoshenko struct resource_spec mv_gpio_res[] = {
47*16694521SOleksandr Tymoshenko 	{ SYS_RES_MEMORY,	0,	RF_ACTIVE },
48*16694521SOleksandr Tymoshenko 	{ SYS_RES_IRQ,		0,	RF_ACTIVE },
49*16694521SOleksandr Tymoshenko 	{ -1, 0 }
50*16694521SOleksandr Tymoshenko };
51*16694521SOleksandr Tymoshenko 
52*16694521SOleksandr Tymoshenko uint32_t
53*16694521SOleksandr Tymoshenko get_tclk(void)
54*16694521SOleksandr Tymoshenko {
55*16694521SOleksandr Tymoshenko 
56*16694521SOleksandr Tymoshenko 	return (TCLK_200MHZ);
57*16694521SOleksandr Tymoshenko }
58*16694521SOleksandr Tymoshenko 
59*16694521SOleksandr Tymoshenko uint32_t
60*16694521SOleksandr Tymoshenko get_l2clk(void)
61*16694521SOleksandr Tymoshenko {
62*16694521SOleksandr Tymoshenko 
63*16694521SOleksandr Tymoshenko 	return (TCLK_667MHZ);
64*16694521SOleksandr Tymoshenko }
65*16694521SOleksandr Tymoshenko 
66*16694521SOleksandr Tymoshenko int
67*16694521SOleksandr Tymoshenko fdt_pci_devmap(phandle_t node, struct pmap_devmap *devmap, vm_offset_t io_va,
68*16694521SOleksandr Tymoshenko     vm_offset_t mem_va)
69*16694521SOleksandr Tymoshenko {
70*16694521SOleksandr Tymoshenko 
71*16694521SOleksandr Tymoshenko 	return (0);
72*16694521SOleksandr Tymoshenko }
73*16694521SOleksandr Tymoshenko 
74