forked from christinaa/rpi-open-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BCM2708PlatformStartup.cc
43 lines (35 loc) · 968 Bytes
/
BCM2708PlatformStartup.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* VideoCore4_Drivers
* Copyright (c) 2017 Kristina Brooks
*
* BCM2708 power management driver.
*/
#include <drivers/IODevice.hpp>
#include <drivers/BCM2708PowerManagement.hpp>
static IODevice* startDeviceByTag(uint32_t tag) {
IODevice* dev = IODevice::findByTag(tag);
if (!dev) {
panic("unable to find device with tag 0x%X in the registry", tag);
}
dev->start();
return dev;
}
extern "C" void PEStartPlatform() {
IODevice* imagePm = PowerManagementDomain::getDeviceForDomain(kCprPowerDomainImage);
assert(imagePm);
IODevice* usbPm = PowerManagementDomain::getDeviceForDomain(kCprPowerDomainUSB);
assert(usbPm);
/*
* All devices in the IMAGE domain have to be disabled before
* starting the domain itself.
*/
usbPm->stop();
/* Bring up IMAGE power domain */
imagePm->start();
/* Now we can re-enable USB power domain */
usbPm->start();
/* Start USB PHY */
startDeviceByTag('USBP');
/* Start ARM */
startDeviceByTag('ARMC');
}