exynos5_machdep.c revision 257660
1252391Sray/*-
2252391Sray * Copyright (c) 2013 Ruslan Bukin <br@bsdpad.com>
3252391Sray * All rights reserved.
4252391Sray *
5252391Sray * Redistribution and use in source and binary forms, with or without
6252391Sray * modification, are permitted provided that the following conditions
7252391Sray * are met:
8252391Sray * 1. Redistributions of source code must retain the above copyright
9252391Sray *    notice, this list of conditions and the following disclaimer.
10252391Sray * 2. Redistributions in binary form must reproduce the above copyright
11252391Sray *    notice, this list of conditions and the following disclaimer in the
12252391Sray *    documentation and/or other materials provided with the distribution.
13252391Sray *
14252391Sray * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15252391Sray * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16252391Sray * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17252391Sray * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18252391Sray * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19252391Sray * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20252391Sray * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21252391Sray * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22252391Sray * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23252391Sray * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24252391Sray * SUCH DAMAGE.
25252391Sray */
26252391Sray
27252391Sray#include "opt_ddb.h"
28252391Sray#include "opt_platform.h"
29252391Sray
30252391Sray#include <sys/cdefs.h>
31252391Sray__FBSDID("$FreeBSD: head/sys/arm/samsung/exynos/exynos5_machdep.c 257660 2013-11-04 22:45:26Z ian $");
32252391Sray
33252391Sray#define _ARM32_BUS_DMA_PRIVATE
34252391Sray#include <sys/param.h>
35252391Sray#include <sys/systm.h>
36252391Sray#include <sys/bus.h>
37252391Sray
38252391Sray#include <vm/vm.h>
39252391Sray#include <vm/pmap.h>
40252391Sray
41252391Sray#include <machine/bus.h>
42257660Sian#include <machine/devmap.h>
43252391Sray#include <machine/machdep.h>
44252391Sray
45252391Sray#include <dev/fdt/fdt_common.h>
46252391Sray
47254495Scognet#define	DEVMAP_BOOTSTRAP_MAP_START 0xF0000000
48252391Sray
49252391Srayvm_offset_t
50252391Srayinitarm_lastaddr(void)
51252391Sray{
52252391Sray
53257201Sian	return (DEVMAP_BOOTSTRAP_MAP_START);
54252391Sray}
55252391Sray
56252391Srayvoid
57252391Srayinitarm_gpio_init(void)
58252391Sray{
59252391Sray}
60252391Sray
61252391Srayvoid
62252391Srayinitarm_late_init(void)
63252391Sray{
64252391Sray}
65252391Sray
66252391Sray#define FDT_DEVMAP_MAX	(1 + 2 + 1 + 1)	/* FIXME */
67257660Sianstatic struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = {
68252391Sray	{ 0, 0, 0, 0, 0, }
69252391Sray};
70252391Sray
71252391Sray/*
72252391Sray * Construct pmap_devmap[] with DT-derived config data.
73252391Sray */
74252391Srayint
75252391Srayplatform_devmap_init(void)
76252391Sray{
77252391Sray	int i;
78252391Sray
79252391Sray	i = 0;
80254495Scognet	fdt_devmap[i].pd_va = 0xf2C00000;
81252391Sray	fdt_devmap[i].pd_pa = 0x12C00000;
82252391Sray	fdt_devmap[i].pd_size = 0x100000;
83252391Sray	fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
84252391Sray	fdt_devmap[i].pd_cache = PTE_NOCACHE;
85252391Sray	i++;
86252391Sray
87257660Sian	arm_devmap_register_table(&fdt_devmap[0]);
88252391Sray	return (0);
89252391Sray}
90252391Sray
91252391Sraystruct arm32_dma_range *
92252391Sraybus_dma_get_range(void)
93252391Sray{
94252391Sray
95252391Sray	return (NULL);
96252391Sray}
97252391Sray
98252391Srayint
99252391Sraybus_dma_get_range_nb(void)
100252391Sray{
101252391Sray
102252391Sray	return (0);
103252391Sray}
104