exynos5_machdep.c revision 252391
1139749Simp/*- 284059Swpaul * Copyright (c) 2013 Ruslan Bukin <br@bsdpad.com> 384059Swpaul * All rights reserved. 484059Swpaul * 584059Swpaul * Redistribution and use in source and binary forms, with or without 684059Swpaul * modification, are permitted provided that the following conditions 784059Swpaul * are met: 884059Swpaul * 1. Redistributions of source code must retain the above copyright 984059Swpaul * notice, this list of conditions and the following disclaimer. 1084059Swpaul * 2. Redistributions in binary form must reproduce the above copyright 1184059Swpaul * notice, this list of conditions and the following disclaimer in the 1284059Swpaul * documentation and/or other materials provided with the distribution. 1384059Swpaul * 1484059Swpaul * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1584059Swpaul * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1684059Swpaul * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1784059Swpaul * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1884059Swpaul * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1984059Swpaul * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2084059Swpaul * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2184059Swpaul * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2284059Swpaul * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2384059Swpaul * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2484059Swpaul * SUCH DAMAGE. 2584059Swpaul */ 2684059Swpaul 2784059Swpaul#include "opt_ddb.h" 2884059Swpaul#include "opt_platform.h" 2984059Swpaul 3084059Swpaul#include <sys/cdefs.h> 3184059Swpaul__FBSDID("$FreeBSD: head/sys/arm/samsung/exynos/exynos5_machdep.c 252391 2013-06-29 23:39:05Z ray $"); 3284059Swpaul 3384059Swpaul#define _ARM32_BUS_DMA_PRIVATE 3484059Swpaul#include <sys/param.h> 3584059Swpaul#include <sys/systm.h> 3684059Swpaul#include <sys/bus.h> 3784059Swpaul 3884059Swpaul#include <vm/vm.h> 3984059Swpaul#include <vm/pmap.h> 4084059Swpaul 4184059Swpaul#include <machine/bus.h> 4284059Swpaul#include <machine/frame.h> /* For trapframe_t, used in <machine/machdep.h> */ 4384059Swpaul#include <machine/machdep.h> 4484059Swpaul#include <machine/pmap.h> 4584059Swpaul 4684059Swpaul#include <dev/fdt/fdt_common.h> 4784059Swpaul 4884059Swpaul#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 4984059Swpaul 5084059Swpaulextern int unmapped_buf_allowed; 5184059Swpaul 5284059Swpaulvm_offset_t 5384059Swpaulinitarm_lastaddr(void) 5484059Swpaul{ 5584059Swpaul 5684059Swpaul return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); 5784059Swpaul} 5884059Swpaul 5984059Swpaulvoid 6084059Swpaulinitarm_gpio_init(void) 6184059Swpaul{ 6284059Swpaul} 6384059Swpaul 64166676Sjkimvoid 65166676Sjkiminitarm_late_init(void) 66166676Sjkim{ 67166676Sjkim 68166676Sjkim /* XXX: PR arm/180080 */ 69166676Sjkim unmapped_buf_allowed = 0; 70166676Sjkim} 71166676Sjkim 72166676Sjkim#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1) /* FIXME */ 73166676Sjkimstatic struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { 74226814Syongari { 0, 0, 0, 0, 0, } 75226814Syongari}; 76226814Syongari 77226814Syongari/* 78226814Syongari * Construct pmap_devmap[] with DT-derived config data. 79226814Syongari */ 80226821Syongariint 81226815Syongariplatform_devmap_init(void) 82226815Syongari{ 83166676Sjkim int i; 84166676Sjkim 85166676Sjkim i = 0; 86166676Sjkim fdt_devmap[i].pd_va = 0xe2C00000; 87166676Sjkim fdt_devmap[i].pd_pa = 0x12C00000; 88214428Syongari fdt_devmap[i].pd_size = 0x100000; 89166676Sjkim fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; 90166676Sjkim fdt_devmap[i].pd_cache = PTE_NOCACHE; 9184059Swpaul i++; 92166676Sjkim 93226814Syongari pmap_devmap_bootstrap_table = &fdt_devmap[0]; 94166676Sjkim return (0); 95226864Syongari} 96226864Syongari 97226864Syongaristruct arm32_dma_range * 98226864Syongaribus_dma_get_range(void) 99226864Syongari{ 100226864Syongari 101226864Syongari return (NULL); 102226864Syongari} 103226867Syongari 104226867Syongariint 105226821Syongaribus_dma_get_range_nb(void) 106226821Syongari{ 107226821Syongari 108226821Syongari return (0); 109226821Syongari} 110226821Syongari