socfpga_machdep.c revision 272896
1316722Sdelphij/*- 2275970Scy * Copyright (c) 2014 Ruslan Bukin <br@bsdpad.com> 3275970Scy * All rights reserved. 4275970Scy * 5275970Scy * This software was developed by SRI International and the University of 6316722Sdelphij * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) 7275970Scy * ("CTSRD"), as part of the DARPA CRASH research programme. 8275970Scy * 9275970Scy * Redistribution and use in source and binary forms, with or without 10275970Scy * modification, are permitted provided that the following conditions 11275970Scy * are met: 12275970Scy * 1. Redistributions of source code must retain the above copyright 13275970Scy * notice, this list of conditions and the following disclaimer. 14275970Scy * 2. Redistributions in binary form must reproduce the above copyright 15275970Scy * notice, this list of conditions and the following disclaimer in the 16275970Scy * documentation and/or other materials provided with the distribution. 17275970Scy * 18275970Scy * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 19275970Scy * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20275970Scy * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21275970Scy * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 22275970Scy * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23275970Scy * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24275970Scy * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25275970Scy * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26275970Scy * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27275970Scy * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28275970Scy * SUCH DAMAGE. 29275970Scy */ 30275970Scy 31275970Scy#include "opt_ddb.h" 32275970Scy#include "opt_platform.h" 33275970Scy 34275970Scy#include <sys/cdefs.h> 35275970Scy__FBSDID("$FreeBSD: head/sys/arm/altera/socfpga/socfpga_machdep.c 272896 2014-10-10 14:35:51Z br $"); 36275970Scy 37275970Scy#define _ARM32_BUS_DMA_PRIVATE 38275970Scy#include <sys/param.h> 39275970Scy#include <sys/systm.h> 40275970Scy#include <sys/bus.h> 41275970Scy 42275970Scy#include <vm/vm.h> 43275970Scy 44275970Scy#include <machine/armreg.h> 45275970Scy#include <machine/bus.h> 46275970Scy#include <machine/devmap.h> 47275970Scy#include <machine/machdep.h> 48275970Scy#include <machine/platform.h> 49275970Scy 50275970Scyvm_offset_t 51275970Scyplatform_lastaddr(void) 52275970Scy{ 53275970Scy 54275970Scy return (arm_devmap_lastaddr()); 55275970Scy} 56275970Scy 57275970Scyvoid 58275970Scyplatform_probe_and_attach(void) 59275970Scy{ 60275970Scy 61275970Scy} 62275970Scy 63275970Scyvoid 64275970Scyplatform_gpio_init(void) 65275970Scy{ 66275970Scy 67275970Scy} 68275970Scy 69275970Scyvoid 70275970Scyplatform_late_init(void) 71275970Scy{ 72275970Scy 73275970Scy} 74275970Scy 75275970Scyint 76platform_devmap_init(void) 77{ 78 79 /* UART */ 80 arm_devmap_add_entry(0xffc00000, 0x100000); 81 82 /* 83 * USB OTG 84 * 85 * We use static device map for USB due to some bug in the Altera 86 * which throws Translation Fault (P) exception on high load. 87 * It might be caused due to some power save options being turned 88 * on or something else. 89 */ 90 arm_devmap_add_entry(0xffb00000, 0x100000); 91 92 /* dwmmc */ 93 arm_devmap_add_entry(0xff700000, 0x100000); 94 95 /* scu */ 96 arm_devmap_add_entry(0xfff00000, 0x100000); 97 98 return (0); 99} 100 101struct arm32_dma_range * 102bus_dma_get_range(void) 103{ 104 105 return (NULL); 106} 107 108int 109bus_dma_get_range_nb(void) 110{ 111 112 return (0); 113} 114