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