2 * Copyright (c) 1994-1998 Mark Brinicombe.
3 * Copyright (c) 1994 Brini.
4 * Copyright (c) 2012, 2013 The FreeBSD Foundation
8 * This code is derived from software written for Brini by Mark Brinicombe
9 * Portions of this software were developed by Oleksandr Rybalko
10 * under sponsorship from the FreeBSD Foundation.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. All advertising materials mentioning features or use of this software
21 * must display the following acknowledgement:
22 * This product includes software developed by Brini.
23 * 4. The name of the company nor the name of the author may be used to
24 * endorse or promote products derived from this software without specific
25 * prior written permission.
27 * THIS SOFTWARE IS PROVIDED BY BRINI ``AS IS'' AND ANY EXPRESS OR IMPLIED
28 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
29 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
30 * IN NO EVENT SHALL BRINI OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
31 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
32 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
33 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
39 * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45
42 #include "opt_platform.h"
44 #include <sys/cdefs.h>
45 __FBSDID("$FreeBSD$");
47 #define _ARM32_BUS_DMA_PRIVATE
48 #include <sys/param.h>
49 #include <sys/systm.h>
51 #include <sys/reboot.h>
56 #include <machine/bus.h>
57 #include <machine/frame.h> /* For trapframe_t, used in <machine/machdep.h> */
58 #include <machine/machdep.h>
59 #include <machine/pmap.h>
61 #include <dev/fdt/fdt_common.h>
63 #define IMX51_DEV_VIRT_BASE 0xe0000000
65 initarm_lastaddr(void)
68 boothowto |= RB_VERBOSE|RB_MULTIPLE;
71 if (fdt_immr_addr(IMX51_DEV_VIRT_BASE) != 0)
74 /* Platform-specific initialisation */
75 return (fdt_immr_va - ARM_NOCACHE_KVA_SIZE);
79 * Set initial values of GPIO output ports
82 initarm_gpio_init(void)
88 initarm_late_init(void)
93 #define FDT_DEVMAP_MAX 2
94 static struct pmap_devmap fdt_devmap[FDT_DEVMAP_MAX] = {
100 * Construct pmap_devmap[] with DT-derived config data.
103 platform_devmap_init(void)
107 * Map segment where UART1 and UART2 located.
109 fdt_devmap[0].pd_va = IMX51_DEV_VIRT_BASE + 0x03f00000;
110 fdt_devmap[0].pd_pa = 0x73f00000;
111 fdt_devmap[0].pd_size = 0x00100000;
112 fdt_devmap[0].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
113 fdt_devmap[0].pd_cache = PTE_NOCACHE;
115 pmap_devmap_bootstrap_table = &fdt_devmap[0];
119 struct arm32_dma_range *
120 bus_dma_get_range(void)
127 bus_dma_get_range_nb(void)
137 printf("Reset ...\n");
138 /* Clear n_reset flag */
139 *((volatile u_int16_t *)(IMX51_DEV_VIRT_BASE + 0x03f98000)) =