bcm2835_machdep.c (274668) | bcm2835_machdep.c (280558) |
---|---|
1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko. 3 * Copyright (c) 1994-1998 Mark Brinicombe. 4 * Copyright (c) 1994 Brini. 5 * All rights reserved. 6 * 7 * This code is derived from software written for Brini by Mark Brinicombe 8 * --- 26 unchanged lines hidden (view full) --- 35 * 36 * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 37 */ 38 39#include "opt_ddb.h" 40#include "opt_platform.h" 41 42#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2012 Oleksandr Tymoshenko. 3 * Copyright (c) 1994-1998 Mark Brinicombe. 4 * Copyright (c) 1994 Brini. 5 * All rights reserved. 6 * 7 * This code is derived from software written for Brini by Mark Brinicombe 8 * --- 26 unchanged lines hidden (view full) --- 35 * 36 * from: FreeBSD: //depot/projects/arm/src/sys/arm/at91/kb920x_machdep.c, rev 45 37 */ 38 39#include "opt_ddb.h" 40#include "opt_platform.h" 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c 274668 2014-11-18 17:06:56Z imp $"); | 43__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c 280558 2015-03-25 10:59:42Z andrew $"); |
44 45#define _ARM32_BUS_DMA_PRIVATE 46#include <sys/param.h> 47#include <sys/systm.h> 48#include <sys/bus.h> 49 50#include <vm/vm.h> 51#include <vm/pmap.h> --- 31 unchanged lines hidden (view full) --- 83 board_set_serial(fdt64_to_cpu(*((uint64_t *)cells))); 84 85 len = OF_getprop(system, "linux,revision", &cells, sizeof(cells)); 86 if (len > 0) 87 board_set_revision(fdt32_to_cpu(*((uint32_t *)cells))); 88 } 89} 90 | 44 45#define _ARM32_BUS_DMA_PRIVATE 46#include <sys/param.h> 47#include <sys/systm.h> 48#include <sys/bus.h> 49 50#include <vm/vm.h> 51#include <vm/pmap.h> --- 31 unchanged lines hidden (view full) --- 83 board_set_serial(fdt64_to_cpu(*((uint64_t *)cells))); 84 85 len = OF_getprop(system, "linux,revision", &cells, sizeof(cells)); 86 if (len > 0) 87 board_set_revision(fdt32_to_cpu(*((uint32_t *)cells))); 88 } 89} 90 |
91#ifdef SOC_BCM2835 |
|
91/* 92 * Set up static device mappings. 93 * All on-chip peripherals exist in a 16MB range starting at 0x20000000. 94 * Map the entire range using 1MB section mappings. 95 */ 96static int 97bcm2835_devmap_init(platform_t plat) 98{ 99 100 arm_devmap_add_entry(0x20000000, 0x01000000); 101 return (0); 102} | 92/* 93 * Set up static device mappings. 94 * All on-chip peripherals exist in a 16MB range starting at 0x20000000. 95 * Map the entire range using 1MB section mappings. 96 */ 97static int 98bcm2835_devmap_init(platform_t plat) 99{ 100 101 arm_devmap_add_entry(0x20000000, 0x01000000); 102 return (0); 103} |
104#endif |
|
103 | 105 |
106#ifdef SOC_BCM2836 107static int 108bcm2836_devmap_init(platform_t plat) 109{ 110 111 arm_devmap_add_entry(0x3f000000, 0x01000000); 112 return (0); 113} 114#endif 115 |
|
104struct arm32_dma_range * 105bus_dma_get_range(void) 106{ 107 108 return (NULL); 109} 110 111int --- 4 unchanged lines hidden (view full) --- 116} 117 118void 119cpu_reset() 120{ 121 bcmwd_watchdog_reset(); 122 while (1); 123} | 116struct arm32_dma_range * 117bus_dma_get_range(void) 118{ 119 120 return (NULL); 121} 122 123int --- 4 unchanged lines hidden (view full) --- 128} 129 130void 131cpu_reset() 132{ 133 bcmwd_watchdog_reset(); 134 while (1); 135} |
136 137#ifdef SOC_BCM2835 |
|
124static platform_method_t bcm2835_methods[] = { 125 PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), 126 PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), 127 PLATFORMMETHOD(platform_late_init, bcm2835_late_init), 128 129 PLATFORMMETHOD_END, 130}; | 138static platform_method_t bcm2835_methods[] = { 139 PLATFORMMETHOD(platform_devmap_init, bcm2835_devmap_init), 140 PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), 141 PLATFORMMETHOD(platform_late_init, bcm2835_late_init), 142 143 PLATFORMMETHOD_END, 144}; |
131 | |
132FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); | 145FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); |
146#endif |
|
133 | 147 |
148#ifdef SOC_BCM2836 149static platform_method_t bcm2836_methods[] = { 150 PLATFORMMETHOD(platform_devmap_init, bcm2836_devmap_init), 151 PLATFORMMETHOD(platform_lastaddr, bcm2835_lastaddr), 152 PLATFORMMETHOD(platform_late_init, bcm2835_late_init), 153 154 PLATFORMMETHOD_END, 155}; 156FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709"); 157#endif |
|