Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: build as static library #37512

Merged
merged 34 commits into from
Aug 17, 2021
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
1a39fa9
arm64: smp: arm64_smp_init to be done at PRE_KERNEL_2
dcpleung Aug 8, 2021
32ee069
drivers: interrupt_controller: build as static library
dcpleung Aug 4, 2021
a5a1bf3
cmake: add zephyr_library_include_directories_ifdef()
dcpleung Aug 4, 2021
0c54532
drivers: timer: build as static library
dcpleung Aug 4, 2021
c7e41a0
console: native_posix: change init priority to 99
dcpleung Aug 8, 2021
1ddbe0e
console: semihosting: remove unused include
dcpleung Aug 11, 2021
0d6447c
drivers: console: build as static library
dcpleung Aug 4, 2021
e276247
drivers: i2c: slave: group into i2c static library
dcpleung Aug 4, 2021
740dc80
drivers: pcie: build as static library
dcpleung Aug 4, 2021
cff1391
drivers: wifi: build as static library
dcpleung Aug 4, 2021
e93cf92
bluetooth: audio: build as static library
dcpleung Aug 4, 2021
564d81e
drivers: bluetooth: build as static library
dcpleung Aug 4, 2021
8004561
drivers: sensors: build as static libraries
dcpleung Aug 4, 2021
5eac434
drivers: can: build as static library
dcpleung Aug 4, 2021
8d4cc5f
drivers: clock_control: build as static library
dcpleung Aug 4, 2021
8765e20
drivers: disk: build as static library
dcpleung Aug 4, 2021
23f789f
drivers: edac: build as static library
dcpleung Aug 4, 2021
cd761a5
drivers: ethernet: build as static library
dcpleung Aug 4, 2021
0c89ba1
drivers: flash: build as static library
dcpleung Aug 4, 2021
96de8bb
drivers: hwinfo: build as static library
dcpleung Aug 4, 2021
f53293e
drivers: ieee802154: build as static library
dcpleung Aug 4, 2021
3c5a1f3
drivers: led: build as static library
dcpleung Aug 4, 2021
39adc50
drivers: led_strip: build as static library
dcpleung Aug 4, 2021
3939d1f
drivers: memc: build as static library
dcpleung Aug 4, 2021
12fc20a
drivers: modem: build as static library
dcpleung Aug 4, 2021
5bd9101
drivers: net: build as static library
dcpleung Aug 4, 2021
545b005
drivers: pinmux: build as static library
dcpleung Aug 4, 2021
231255f
drivers: ptp_clock: build as static library
dcpleung Aug 4, 2021
5aa4b73
drivers: usb: build as static library
dcpleung Aug 4, 2021
32b0281
drivers: watchdog: build as static library
dcpleung Aug 4, 2021
300b6c1
drivers: sys_con: build as static library
dcpleung Aug 6, 2021
56aa254
drivers: pm_cpu_ops: build as static library
dcpleung Aug 6, 2021
0625eac
display: change init priority config to 85
dcpleung Aug 8, 2021
2d4cefb
drivers: display: build as static library
dcpleung Aug 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arch/arm64/core/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,6 @@ static int arm64_smp_init(const struct device *dev)

return 0;
}
SYS_INIT(arm64_smp_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
SYS_INIT(arm64_smp_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this change have to do with building drivers as a static library?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm64_smp_init() has the same init level and priority as the GICv3 interrupt controller. The linking order is affected by the interrupt controller driver being inside a static library, resulting in the interrupt controller being initialized later than arm64_smp_init(). There are hard faults running arm64_smp_init() as it is setting up IRQs for IPI. This change is simply to make sure the interrupt controller is initialized first.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, thanks. Could you mention in the commit message that you found this while converting the interrupt controller drivers to build in a static library?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is under a separate commit (1c15674) with explanation in the commit message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message doesn't mention why the link order changed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah... because that commit is before the changes on driver. I have updated the commit message to say that it is in preparation for the driver changes. Does this work?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks


#endif