27 Commits

Author SHA1 Message Date
Travis Geiselbrecht
e4d65228b5 [mp] restructure the sequence of how cpus are brought up
- Move a bit of the shared logic of secondary bootstrapping into a new
  function, lk_secondary_cpu_entry_early() which sets the current cpu
  pointer before calling the first half of the secondary LK_INIT
  routines.
- Create the per cpu idle threads on the main cpu instead of the
  secondary as they come up.
- Tweak all of the SMP capable architectures to use this new path.
- Move the top level mp routines into a separate file top/mp.c
- A bit more correctly ifdef out more SMP code.
2025-10-12 19:47:33 -07:00
Travis Geiselbrecht
6f24850de8 [dev][arm-generic-timer] print initialization configuration
This may be unsafe if the platform hasn't initialized a uart or console
by the time this is run. May need to revert or change this if it's an
issue.
2024-08-11 12:18:32 -07:00
Travis Geiselbrecht
fcb65c9a88 [dev/lib][warnings] fix -Wmissing-declarations warnings in dev/ and lib/ 2021-10-21 23:16:20 -07:00
Travis Geiselbrecht
01f9a97dc1 [arch][openrisc] fix up and get the OpenRISC port working again
Previous to now it had always relied on a custom patched gcc
and a custom sim. In the interim since the initial port went in
some time in 2015 GCC and QEMU have both officially picked up support
for the architecture and the machine that was emulated in the previous
emultor.

Using gcc 10.2 fix up the build and get it basically working. Timers
seem to not be working right but it's probably fairly easy to fix.
2020-10-21 02:34:50 -07:00
Travis Geiselbrecht
cba9e47987 [license] replace the longer full MIT license with a shorter one
Used scripts/replacelic. Everything seems to build fine.
2019-07-05 17:22:23 -07:00
Travis Geiselbrecht
d8fa82cb91 [formatting] run everything through codestyle
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.

See scripts/codestyle
2019-06-19 21:02:24 -07:00
Travis Geiselbrecht
1b7a28efb8 [include][lk] fixup lk/ include path move 2019-06-19 19:46:11 -07:00
Travis Geiselbrecht
d569c090ea [vim] remove vim expandtab comments on most of the files 2016-02-14 12:32:07 -08:00
Travis Geiselbrecht
2eb32a4369 [style] mass reformat all the non external code to 4 space indents
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.

Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
2016-02-14 12:24:01 -08:00
Travis Geiselbrecht
3b2d7a268b [make] remove the need for a module to manually add $(LOCAL_DIR)/include to the global include path
Pretty much every module in the system was already doing it, so do it
automatically.
2015-10-19 19:07:16 -07:00
Travis Geiselbrecht
586fe3d831 [include][trace] move LTRACEF_LEVEL out of timer code into generic header
Seems useful enough.
2015-06-02 21:11:51 -07:00
Travis Geiselbrecht
842cb7a7ae [warnings] fix warnings post-smp
Most of the warnings are printf related due to lk_time_t now being defined as an
unsigned int instead of unsigned long.
2015-06-02 21:03:05 -07:00
Travis Geiselbrecht
f0fad1590b [init][smp] have secondary init run in arch code up to threading, and complete in secondary thread
-move the per-cpu initialization of the gic and cortex-a9 timer into an init hook.
  This removes the hard coded call in arm/arch.c
-make sure the timer initialization happens in the pre-threading callback, in case
  a secondary init hook needs the timer.
2015-03-27 14:14:12 -07:00
Arve Hjønnevåg
a17d19dae0 [dev][timer][arm_generic] Add arm64 support and select timer based on TIMER_ARM_GENERIC_SELECTED
TIMER_ARM_GENERIC_SELECTED can be set to CNTP, CNTPS or CNTV. CNTP is
used by default.

Change-Id: Idbce233062f244cee8245f48c6ad272111b7c58b
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
e92da54410 [dev][timer][arm_generic] Add resume handler
Trigger a timer interrupt on cpu resume since the timer may have been reset.

Change-Id: I38af303f704dc88e2eb053d645ead460b7547937
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
d242e308b7 [dev][timer][arm_generic] Register interrupt handlers on secondary cpus
Change-Id: Ib67a0b7725781b5513b32263938f80e0ed3902a3
2015-03-11 19:57:17 -07:00
Travis Geiselbrecht
c77cc67d86 [dev][timer][arm_generic] add support for overriding frequency at init time 2015-03-10 16:43:55 -07:00
Travis Geiselbrecht
a6f4e6ff15 [arch][arm] add ARM SMP support
-Also adds support to the following ARM-related drivers:
    dev/cache/pl310
    dev/interrupt/arm_gic
    dev/timer/arm_cortex_a9
2015-03-10 16:43:55 -07:00
Travis Geiselbrecht
8fb2c54304 [kernel] remove critical_section, move everything to spinlocks 2015-03-10 16:43:54 -07:00
Stefan Kristiansson
c3dc155f16 [arch][or1k] add or1k (OpenRISC 1000) architecture
This add support for the OpenRISC 1000 architecture, and
as the architecture specification defines an on-chip tick-timer
and interrupt controller, drivers for those are included in
this commit.
Support to utilize the MMU is implemented,
and it can be opted in and out with WITH_KERNEL_VM
2015-03-06 19:03:34 +02:00
Michael Ryleev
e913bf139a [dev][timer][arm_generic] Disable LOCAL_TRACE
Change-Id: Ia548485412b08069e2b490b11e525afe2d714061
2014-11-04 15:16:16 -08:00
Michael Ryleev
116eb2c6ac [dev][timer][arm_generic] Switch to use lib/fixed_point
Change-Id: I7fd5e2a30d1ca10ded2b6ec9e3be8a3eb14cf644
2014-11-04 15:16:16 -08:00
Travis Geiselbrecht
3decc796e0 [dev][timer][cortex_a9] move timer to fixed point divide routines 2014-09-29 16:37:54 -07:00
Travis Geiselbrecht
06f1e752cd [lib][fixed_point] move fixed point routines into a separate library 2014-09-29 16:37:54 -07:00
Travis Geiselbrecht
db17ccca0a [dev][timer][cortex-a9] do not allow ticks of 0 to be set
-Make sure tick values passed in are within valid range of hardware.
2014-09-26 15:45:47 -07:00
Travis Geiselbrecht
8d685b931e [dev][timer][arm_generic] implementation of generic timer for cortex-a15 and related cores 2014-08-26 00:56:55 -07:00
Travis Geiselbrecht
1b08f503e9 [dev][timer] add generic cortex-a9 timer driver
Shared between devices that have a cortex-a9 or cortex-a5 core.
Seems that later cortex-a* devices implemented a different timer.
2014-05-11 00:45:15 -07:00