116239Sjkh/*- 24Srgrimes * Copyright (c) 2012 Oleksandr Tymoshenko. 3509Srgrimes * All rights reserved. 450477Speter * 54Srgrimes * This code is derived from software written for Brini by Mark Brinicombe 6509Srgrimes * 7509Srgrimes * Redistribution and use in source and binary forms, with or without 84Srgrimes * modification, are permitted provided that the following conditions 94Srgrimes * are met: 104Srgrimes * 1. Redistributions of source code must retain the above copyright 114Srgrimes * notice, this list of conditions and the following disclaimer. 124Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 134Srgrimes * notice, this list of conditions and the following disclaimer in the 144Srgrimes * documentation and/or other materials provided with the distribution. 1585532Sru * 3. All advertising materials mentioning features or use of this software 164Srgrimes * must display the following acknowledgement: 174Srgrimes * This product includes software developed by Brini. 184Srgrimes * 4. The name of the company nor the name of the author may be used to 1930640Speter * endorse or promote products derived from this software without specific 20169612Swkoszek * prior written permission. 2130640Speter * 2227674Sphk * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED 2327674Sphk * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2452651Smarcel * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 252056Swollman * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 262056Swollman * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 272056Swollman * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 2879014Simp * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 292056Swollman * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3052651Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3185909Simp * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 324Srgrimes * SUCH DAMAGE. 33250840Smarcel * 34250840Smarcel */ 35154975Snyan 3689345Snyan#include "opt_ddb.h" 37154975Snyan#include "opt_platform.h" 38154975Snyan#include "opt_global.h" 39218893Sdim 40232263Sdim#include <sys/cdefs.h> 41232263Sdim__FBSDID("$FreeBSD$"); 42232263Sdim 43218893Sdim#define _ARM32_BUS_DMA_PRIVATE 445327Sgibbs#include <sys/param.h> 455327Sgibbs#include <sys/systm.h> 464Srgrimes#include <sys/bus.h> 474Srgrimes 4869135Speter#include <vm/vm.h> 494Srgrimes#include <vm/pmap.h> 5069135Speter 5111918Sdg#include <machine/bus.h> 5269135Speter#include <machine/frame.h> /* For trapframe_t, used in <machine/machdep.h> */ 5338778Snsouch#include <machine/machdep.h> 546802Sgibbs#include <machine/pmap.h> 556802Sgibbs 5686273Simp#include <dev/fdt/fdt_common.h> 5786273Simp 5885909Simp/* Start of address space used for bootstrap map */ 59#define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 60 61vm_offset_t 62initarm_lastaddr(void) 63{ 64 65 return (DEVMAP_BOOTSTRAP_MAP_START - ARM_NOCACHE_KVA_SIZE); 66} 67 68void 69initarm_gpio_init(void) 70{ 71} 72 73void 74initarm_late_init(void) 75{ 76} 77 78#define FDT_DEVMAP_MAX (2) /* FIXME */ 79static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = { 80 { 0, 0, 0, 0, 0, }, 81 { 0, 0, 0, 0, 0, } 82}; 83 84 85/* 86 * Construct pmap_devmap[] with DT-derived config data. 87 */ 88int 89platform_devmap_init(void) 90{ 91 int i = 0; 92 fdt_devmap[i].pd_va = 0xf0100000; 93 fdt_devmap[i].pd_pa = 0x10100000; 94 fdt_devmap[i].pd_size = 0x01000000; /* 1 MB */ 95 fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE; 96 fdt_devmap[i].pd_cache = PTE_DEVICE; 97 98 pmap_devmap_bootstrap_table = &fdt_devmap[0]; 99 return (0); 100} 101 102struct arm32_dma_range * 103bus_dma_get_range(void) 104{ 105 106 return (NULL); 107} 108 109int 110bus_dma_get_range_nb(void) 111{ 112 113 return (0); 114} 115 116void 117cpu_reset() 118{ 119 printf("cpu_reset\n"); 120 while (1); 121} 122 123