Commit Graph

66 Commits

Author SHA1 Message Date
Travis Geiselbrecht
121d0b603b [arch] tighten up linker scripts to make sure the section sentinels cover just what they need 2015-11-06 19:32:51 -08:00
Travis Geiselbrecht
35ebee0e40 [merge] branch 'heapswitch'
This picks up the major work of allowing multiple heap implementations
and enable dlmalloc as an alternate heap to the simple existing one
(now called 'miniheap').

Also added a novm page allocator for memory management on systems too small
or missing an mmu to have a vm. Not much more than a simple bitmap allocator
that the heap pulls from. Allows for other heaps and/or users of physical
memory to coexist and span multiple banks of memory.
2015-10-20 16:53:00 -07:00
Travis Geiselbrecht
88d0001cdc [arch][arm] add lk.elf.stack to the generated list so it gets removed in the clean target 2015-10-19 19:47:29 -07:00
Travis Geiselbrecht
e58d0759ec [arch][multiple] finally solve the linker-script-not-updated problem
If a make variable was modified in a way that would cause the linker
script to need to be regenerated on arches that use generated linker
scripts, make sure we get a fresh copy.

Reuse the same generate-then-replace logic that goes into config.h
files.
2015-10-19 19:43:31 -07: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
7c09e82033 [make] make sure MEMBASE and MEMSIZE are always set exactly once 2015-10-15 17:22:16 -07:00
Travis Geiselbrecht
4bade47a7e [platform][armemu] add support for a fake armemu cpu
For the moment fix it as a armv7-a cpu with no mmu and no thumb.
2015-08-31 22:02:57 -07:00
Travis Geiselbrecht
4a5f8667bd [arch][arm] allow building with the KERNEL_VM and ARM_WITH_MMU turned off 2015-08-31 22:02:57 -07:00
Travis Geiselbrecht
b1024ec276 [arch][arm-m] add cache flush routines for cortex-m cpus that support it 2015-08-21 11:33:05 -07:00
Travis Geiselbrecht
88c923d88f [arch][arm-m] add support for m7 cache, add memory barrier in systick driver
The memory barrier is needed to order the reading of the val register to ensure
it is read properly on M7 cores.
2015-07-10 00:50:05 -07:00
Travis Geiselbrecht
d8ee04f2bf [arch][arm] initial support for cortex-m7 2015-07-08 02:24:59 -07:00
Travis Geiselbrecht
96ba54f187 [merge] merge back from smp branch 2015-05-28 12:52:41 -07:00
John Grossman
5f804f25fc [lk][arch] Add spin_cycles
Add an architecture specific function which spins for a specific
number of CPU cycles.  Currently implemented for ARM-M only.

Change-Id: Idbf2a83186cf5ffa239d644dc732fe3d419431c1
Signed-off-by: John Grossman <johngro@google.com>
2015-05-19 16:28:07 -07:00
Arve Hjønnevåg
2c9c5959e7 Merge branch 'master' of https://github.com/travisg/lk into smp
Change-Id: Iecb11d57b6f089234c0826932bdb229588939750
2015-05-18 16:49:37 -07:00
Arve Hjønnevåg
8f0d310616 [arch][arm/arm64] Support systems with mutiple clusters
Set SMP_CPU_CLUSTER_SHIFT to the number of bits needed within
each cluster.
All clusters except the last one, need to have the name number
of cpus to avoid gaps.

Also, add a SMP_CPU_ID_BITS variable and limit this to 8 bits
on the bcm2835 platform instead of ignoring cluster ids by default
on arm.

Change-Id: I1d0be1d9c99d5b85368ce71623e6e7d14fefd604
2015-05-13 20:20:39 -07:00
Travis Geiselbrecht
79e69c75e1 [arch][arm] implement a few arm DCC accessor routines
DCC is a 32bit read/write fifo for communication with a jtag
based host.

Change-Id: Ied343562f51949731f33b9ac2281632d22eab03c
2015-04-27 16:29:45 -07:00
Travis Geiselbrecht
646006acec [arch][arm] add fpu support to cortex-a7 make file 2015-04-18 14:25:26 -07:00
Travis Geiselbrecht
8eb710ec4f [arch][arm] remove dcc.S from the build
Was accidentally deleted in previous change, but was unused anyway,
2015-04-07 12:38:24 -07:00
Michael Ryleev
953dfdf72e [arch][arm][arm][mmu] Implement arch_mmu_pick_spot routine
This implementation handles ARCH_MMU_FLAG_NS attribute only.

Enable pick spot support if support for non-secure memory
is required (WITH_NS_MAPPING make variable is set to true).

Change-Id: I8f575f36ba729dc148c6320a4e0bbb4c6eec14a4
2015-03-19 18:01:13 -07:00
Michael Ryleev
d5e602de06 [arch][arm] Add an option to compile without vfp support for cortex-a15
If ARM_WITHOUT_VFP_NEON is set to 'true' compile without VFP or NEON support.

Change-Id: Iff8abfe1a89f7b50a11528aa0af7ee6a115cd8dd
2015-03-19 18:01:10 -07:00
Michael Ryleev
75066f7050 [arch][arm] Cumulative support for building binaries with multiple toolchains
Change-Id: I5559eb41ecaa631d09e9ddaa952281002ee58306
2015-03-19 18:01:10 -07:00
Arve Hjønnevåg
3d5a0da377 [arm] Cortex-A15 support
Change-Id: Icb8779e485e876080dd76961e88a618afa722171
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
a45b5e15bc [arch][arm] Allow custom SMP_MAX_CPUS values.
Change-Id: I8485fe8fbabd09c3f1e664d5b8a06f630371b346
2015-03-11 19:57:16 -07:00
Travis Geiselbrecht
bd4e7a9b7d [arch][arm] add support for cortex-a7 SMP
-add hooks for weirdo bcm2836 interrupt controller
-remove the relaxed thread and mpidr register accessors (may be able to relax them again)
-deal with (or not) cpus with non zero cluster ids
2015-03-10 16:43:55 -07:00
Travis Geiselbrecht
e2f65c93cf [arch][arm-m] fix arm-m after SMP changes 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
17b1d8772c [arch][arm] turn on linker GC for big arm by default 2014-10-23 13:22:34 -07:00
Travis Geiselbrecht
cb41b90187 [vm] allow config space to set kernel address space size, ARM sets to top 3GB 2014-07-24 15:26:34 -07:00
Travis Geiselbrecht
503f30f685 Merge remote-tracking branch 'github/vm'
Conflicts:
	platform/vexpress-a9/include/platform/vexpress-a9.h
	platform/zynq/rules.mk
2014-07-24 01:29:43 -07:00
Travis Geiselbrecht
4d011b03b1 [arch][arm] fix floating point test code on thumb2 only devices 2014-07-14 17:33:07 -07:00
Travis Geiselbrecht
986d1590cb [kernel][vm] first stab at a virtual memory manager
Add kernel/vm code to handle memory management in large page-aligned
regions of virtual space. This is composed via a pmm (physical
memory manager) and vmm (virtual memory manager) and the architecturally
specific code to manage the mmu.

Add ARMv7 paging code.
2014-07-11 18:06:37 -07:00
Travis Geiselbrecht
738983cfc0 [arch][arm] support for ARM floating point up through neon
-add code to undefined handler to trap arm/thumb vfp/neon instructions
-add infrastructure for enabling/disabling the fpu on v7 cpus
2014-06-11 15:01:49 -07:00
Travis Geiselbrecht
3146eef43f [dev][cache] initial implementation of PL310 cache controller
-Hook into the arm cache flush routines
2014-06-03 21:16:46 -07:00
Travis Geiselbrecht
6f047f889d [arch][arm] add support for cortex-a9 2014-04-18 21:43:03 -07:00
Travis Geiselbrecht
f21ad5d749 [make] miscellaneous make system tweaks
-Have arch set the default optimization level. Most will use
 O2, but arm-m sets to Os.
-Make the link time garbage collection be optional. Only set
 for arm-m.
2014-03-22 21:03:03 -07:00
Travis Geiselbrecht
684cde6c03 [arch][arm-m] refactor systick code into separate module
Add generic support for running systick in monotonic mode and providing
current_time() routines.

Platforms may choose not to use this, thus it is moved into an optional
module.
2014-03-18 19:43:11 -07:00
Travis Geiselbrecht
07e24dfcf9 [arch][arm-m] fix arch_cycle_count on cortex-m
A bad #ifdef broke it somewhere along the line.
2014-03-05 12:53:46 -08:00
Travis Geiselbrecht
f2ddb950d8 [arch][arm] reimplement CP15 accessor routines in a much cleaner way
-Implement static inline assembly routines to get to the registers from C.
2014-01-25 20:30:47 -08:00
Travis Geiselbrecht
3f5ffe3c9a [arch][arm] remove support for pre armv6 cpus 2014-01-25 20:30:47 -08:00
Travis Geiselbrecht
28bc7f4b6d [arch] factor some common parts of linker scripts into a separate file
INCLUDE the parts of the linker script that are specific to lk into
each of the arch's scripts.
2013-06-20 21:03:56 -07:00
Travis Geiselbrecht
d5cf22f40d [make] rename DEFINES to GLOBAL_DEFINES
To fix your module makefiles:
-Change DEFINES to GLOBAL_DEFINES
2013-06-07 22:26:38 -07:00
Travis Geiselbrecht
e002c58b59 [make] rename INCLUDES -> GLOBAL_INCLUDES
To be more consistent, rename make variable INCLUDES to GLOBAL_INCLUDES.
Also remove the need to put -I in front of each field, the make system
will do that for you.

To fix your module makefiles:
-Change INCLUDES -> GLOBAL_INCLUDES
-Remove -I prefix
2013-06-07 22:26:06 -07:00
Eren Türkay
1fe39d0976 [arch][arm] rules.mk: add rules for arm-linux-gnueabi toolchain
Add rules for finding arm-linux-gnueabi toolchain and set no stack
protection.

When compiled under this toolchain, we get the following linking errors
in the final stage:

undefined reference to `__stack_chk_guard'
undefined reference to `__stack_chk_fail'
undefined reference to `__stack_chk_guard'

Stack protection is default on this toolchain but we don't need it.
2013-05-05 18:26:22 -07:00
Travis Geiselbrecht
1f6fec3126 [arch][arm] try to search for different arm toolchains
tries in the particular order:
arm-eabi-
arm-elf-
arm-none-eabi-
2012-12-27 18:52:26 -08:00
Travis Geiselbrecht
280ce21fc2 [arch][arm-m] add support for cortex-m4 and cortex-m4f
-This will break platforms, since it renames a few cm3.h style
headers to cm.h
2012-11-11 20:08:50 -08:00
Travis Geiselbrecht
ee9000e002 [arch][arm] add python app to try to guess stack usage per function
Just a simple app that looks at push and add sp, #num lines to guess
the size of the function. Only tested against thumb2 code.

Generates build-*/lk.stack
2012-11-11 13:59:30 -08:00
Travis Geiselbrecht
1f2fd10de4 [arch][arm-m] add new version of CMSIS lib v3.0.1 2012-09-20 13:30:26 -07:00
Travis Geiselbrecht
97cfd0bfa4 [make] update all of the rules.mk to use the new module system 2012-08-31 15:52:24 -07:00
Travis Geiselbrecht
9ef4e385fa [arm-m] add simple systick driver 2012-05-10 18:59:29 -07:00
Travis Geiselbrecht
06d781f162 [arch][kernel] handle default stack size better
-let arch define the default stack size in ARCH_DEFAULT_STACK_SIZE
-platform/target/project can override with CUSTOM_DEFAULT_STACK_SIZE
2012-05-10 16:25:44 -07:00