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