Skip to content

Commit cbd9b7b

Browse files
committed
main, kboot: Move tunables/cpufreq/clk from main to kboot
I already screwed something up in cpufreq, and it makes it difficult to understand what happened if it happens in stage1 before the proxy runs, and difficult to undo in stage2. Let's move all this stuff to kboot, since it isn't necessary until then (and this will also avoid doing unnecessary init for macOS under the HV). If we need it in proxy scripts, we can add proxy commands for this later. Signed-off-by: Hector Martin <[email protected]>
1 parent 145d390 commit cbd9b7b

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/kboot.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include "kboot.h"
66
#include "adt.h"
77
#include "assert.h"
8+
#include "clk.h"
9+
#include "cpufreq.h"
810
#include "dapf.h"
911
#include "devicetree.h"
1012
#include "exception.h"
@@ -15,6 +17,7 @@
1517
#include "pmgr.h"
1618
#include "sep.h"
1719
#include "smp.h"
20+
#include "tunables.h"
1821
#include "types.h"
1922
#include "usb.h"
2023
#include "utils.h"
@@ -1977,6 +1980,10 @@ int kboot_prepare_dt(void *fdt)
19771980

19781981
int kboot_boot(void *kernel)
19791982
{
1983+
tunables_apply_static();
1984+
clk_init();
1985+
cpufreq_init();
1986+
19801987
usb_init();
19811988
pcie_init();
19821989
dapf_init_all();

src/main.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
#include "adt.h"
99
#include "aic.h"
10-
#include "clk.h"
11-
#include "cpufreq.h"
1210
#include "display.h"
1311
#include "exception.h"
1412
#include "fb.h"
@@ -24,7 +22,6 @@
2422
#include "sep.h"
2523
#include "smp.h"
2624
#include "string.h"
27-
#include "tunables.h"
2825
#include "uart.h"
2926
#include "uartproxy.h"
3027
#include "usb.h"
@@ -154,7 +151,6 @@ void m1n1_main(void)
154151
wdt_disable();
155152
#ifndef BRINGUP
156153
pmgr_init();
157-
tunables_apply_static();
158154

159155
#ifdef USE_FB
160156
display_init();
@@ -170,8 +166,6 @@ void m1n1_main(void)
170166
#endif
171167
#endif
172168

173-
clk_init();
174-
cpufreq_init();
175169
sep_init();
176170
#endif
177171

0 commit comments

Comments
 (0)