Commit Graph

433 Commits

Author SHA1 Message Date
Elliot Berman
d239adf839 [arch][riscv] Add basic support for SiFive HiFive Unleashed
Most of changes were moving around where macros were defined, plus the
following:
- Remove requirement for floating point on RV64 to support booting
  monitor core on U54 SoC.
- Add support for Debug LEDs on HiFive Unleashed Board
2020-01-16 23:06:28 -08:00
Venkatesh Srinivas
128890f8a8 [platform][tms570-launchpad] Skeleton of port to TI LaunchXL2-TMS57012
* Adds target tms570-launchpad, for TI TMS570 Launchpad Dev Kit
(https://www.ti.com/store/ti/en/p/product/?p=LAUNCHXL2-TMS57012)

* Adds CPU definitions for Cortex R4F (BE) CPU, implementing
  ARMv7-R ISA. Does not yet add definitions for ARMv7 arch entry
  functions.

* Board does not yet build - platform.c/uart.c are empty, no GIC
  entry points provided.
2019-11-18 15:36:28 -08:00
Travis Geiselbrecht
bff17f7e99 [platform][riscv] add code to read the size of memory from the FDT
Tweak the novm allocator to let us more easily add a variable sized
arena at boot.

Also added code to trap secondary cpus and reenable the use of WFI
instruction.
2019-11-02 18:13:02 -07:00
Travis Geiselbrecht
fdc08a8446 [arch][riscv] port to riscv64
Very little needed to port except to conditionalize some assembly in the
context switch and exception code. Mostly needed to move build system
stuff around and add a new project.
2019-11-02 17:21:13 -07:00
Travis Geiselbrecht
ae5200595c [platform][riscv-virt] added support for QEMU's riscv 'virt' machine
The virt machine is a generic target, much like the arm virt machine.
Intended to be simple to use and a good target to run large systems like
linux on. At the moment simply support booting and simple uart and timer
support.
2019-11-02 14:19:36 -07:00
Travis Geiselbrecht
6cb02526b7 [include][console] split lib/console.h into two
TL;DR most uses of lib/console.h -> lk/console_cmd.h

Move the part that lets a piece of code somewhere in the system to
define a console command from the actual lib/console api to start an
instance of the console. Move in almost every place the user of the
console command definition to the new header, lk/console_cmd.h which is
always in the include path.

Also remove most uses of testing for WITH_LIB_CONSOLE since you can
almost always just safely define it and then let the linker remove it.
2019-07-13 16:56:33 -07:00
Travis Geiselbrecht
35a8d555a3 [include] move almost all of the remainder of top level includes into a subdir
Examples are include/platform.h -> platform/include/platform.h
include/target.h -> target/include/target.h

The old model generally considered these to be Always There includes,
but they're starting to stick out more and more so may as well actually
follow the model that most of the rest of the system follows.
2019-07-13 16:09:27 -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
b3450e6e57 [arch][x86] make sure the direction bit is clear on irq entry 2019-06-19 19:46:11 -07:00
Travis Geiselbrecht
220b91fe55 Merge pull request #211 from James-Zzz/master
[arch][x86] Bug fix and feature enhancement
2019-06-19 18:44:05 -07:00
Travis Geiselbrecht
a8d82f3ab0 [arch][arm-m] move some hand coded register inits to the CMSIS struct
No functional change.
2019-06-12 14:26:48 -07:00
Travis Geiselbrecht
1a45b90077 [arch][arm-m] clean up the low level exception code
Removes a need for a large #if for armv7-m vs armv6-m. Combine the
two paths with conditional assembly code.
2019-06-11 14:47:03 -07:00
Travis Geiselbrecht
39d02cf01f [build][arch][arm] squelch additional LIBGCC and compile flags echoing
Already printed elsewhere, quiet down the build a bit.
2019-03-23 09:57:19 -07:00
Travis Geiselbrecht
63be190d8b [target][sifive-e] Get LK working on a Sifive Hifive1 board
-added support for bringing up the clocks and setting up the gpio bits
before starting the uart.
-add a proper target init routine
-add scripts to flash board via openocd
-fixed bug in riscv interrupt save state where it wasn't saving mstatus
on irq entry.
-comment out cycle enabling, not implemented on this core
2019-02-18 22:13:22 -08:00
Travis Geiselbrecht
a0a6b10e0b [arch][riscv32] rename the qemu target sifive-e
The initial port is really a Sifive E platform. Call it what it is and
make space for bringing up the Sifive U and virt qemu target.
2019-02-17 20:29:50 -08:00
Travis Geiselbrecht
a53ce0c42c [arch][arm] move -Mreg-names-raw behind an arch specific flag 2019-02-17 20:27:54 -08:00
Travis Geiselbrecht
dc2fe55fa9 [arch][riscv] set up the global pointer register
The linker will automatically relax any dereferences and calculations
for symbols located near the symbol __global_pointer$.
2019-02-17 18:55:42 -08:00
Travis Geiselbrecht
1fbb67228d [platform][pc] get working on legacy 386 PC
-Add support for x86 legacy mode, designed for 386+ instead of pentium+
-Fixup uart driver to support com2
-Stub out PCI driver properly
-Fixup IDE driver to detect legacy disks
2018-12-30 21:08:58 -08:00
Travis Geiselbrecht
7bbf6d5831 [nit] fix extraneous trailing ; in CDECLS lines 2018-12-16 16:49:40 -08:00
Travis Geiselbrecht
8cf28bbdcf [arch][riscv] Initial port to a riscv32 sifive target
Currently targets qemu's sifive_e machine, which is a split flash/ram
machine, much like the Sifive HiFive1. Untested as of yet on a real
HiFive1.

Basic support including interrupts and architectural timers in place.
2018-12-16 16:44:23 -08:00
Travis Geiselbrecht
5d43aa25eb [arch][rules] create ARCH_LDFLAGS and clean up all the arch rules files to consistently use ARCH_* vars 2018-11-30 22:00:45 -08:00
Travis Geiselbrecht
18d501fdcb [arch][arm] fix start.S to make sure r12 has 0 in it 2018-10-13 11:15:54 -07:00
Antonio Nino Diaz
2680c377ec [arch][arm] Fix execution of TLBIALL instructions
After a TLBI instruction the right thing to do is to execute DSB
followed by ISB. DSB ensures that the TLBI is seen by all observers of
the system and ISB ensures that the DSB has finished before continuing.

Also, the value in <Rt> is ignored for a TLBIALL. It isn't needed to
load 0 to r12 and then use r12 in the instruction. In order not to cause
confusion it is better to not load anything to r12.

Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-19 10:57:58 -07:00
Antonio Nino Diaz
6792c9e143 [arch][arm64] Fix barriers in startup code
After a TLBI instruction the right thing to do is to execute DSB
followed by ISB. DSB ensures that the TLBI is seen by all observers of
the system and ISB ensures that the DSB has finished before continuing.

Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
2018-09-12 13:12:26 -07:00
Travis Geiselbrecht
5dea3e1933 [warnings] fix a few warnings introduced with newer version of gcc
Most of the warnings are new, such as needing to mark fallthroughs on
cases explicitly. A few are based on signed vs unsigned comparisons.

Disable one warning that was annoying about comparing null to arguments
marked nonnull.
2018-03-15 14:10:12 -07:00
Travis Geiselbrecht
1d63a772a9 [arch][arm64] rename a register alias from index to idx
index apparently collides with a new assembler builtin in a newer
binutils/gcc version.
2018-03-15 13:44:22 -07:00
Zhong,Fangjian
b23fcc2e76 [arch][x86] Update x86 mapping mechanism
LK supports 4K page table only when update mapping.
At boot stage, 2M page used for kernel area space. And this mapping will
be updated when allocating region if region size is smaller than 2M,
this 2M page should be updated to 2M page directory, and then update 4K
pages resides in this 2M directory.
2018-01-24 12:19:49 +08:00
Zhong,Fangjian
4b4e68bb29 [arch][x86] update x86 TSS and IDT
1. Update TSS selector description.
2. Enlarge TSS selector up to SMP_MAX_CPUS.
3. Enlarge interrupt numbers support to 0xFF in arch x86-64.

Signed-off-by: Zhong,Fangjian <fangjian.zhong@intel.com>
2017-11-08 08:29:23 +08:00
Zhong,Fangjian
ffe4be84b1 [arch][x86] bug fix in TSS descriptor base address
In 64-bit mode, the TSS descriptor is expanded to 16 bytes.
Currently, high 32-bit of TSS base address is set to be zero.
Updte descriptor structure definition, add high 32-bit high adress
and reserved bit.

Signed-off-by: Zhong,Fangjian <fangjian.zhong@intel.com>
2017-10-23 00:20:04 -07:00
Ashok Kumar Sekar
f781ba7494 [arch][arm64] change CACHE_LINE to 64 for cortex a53,57 and 72
Signed-off-by: Ashok Kumar Sekar <ashokkumar.sekar@gmail.com>
2017-06-05 10:41:45 -07:00
M1cha
8c5a570500 [arch][arm] disable alignment aborts
just in case they are enabled by default.
2017-02-06 18:54:11 -08:00
Travis Geiselbrecht
1332d188cb [make][compiler] add -fno-common
This removes the COMMON section merging logic, which actually uncovered
a few duplicately declared symbols across compilation units.
2016-11-17 14:44:21 -08:00
Pierre Carru
a77295ae63 [arch][arm] stackusage python3 compatibility 2016-11-01 21:52:31 -04:00
Eric Holland
e724ff9707 [aarch64] Fix stack pointer misalignment (#159)
sp can become misaligned from 16 byte boundry because context frame
is not a multiple of 16 bytes.
2016-09-06 12:21:34 -07:00
Travis Geiselbrecht
f2c90720f3 [merge] Merge remote-tracking branch 'pr/rpi3' 2016-08-25 17:36:50 -07:00
klemens
d0b90c2d68 [spelling] spelling-fixes. (not external/) 2016-08-25 17:30:34 -07:00
Gurjant Kalsi
173046ecca [squash] Use x4 as early scratch register in case args are passed in x0-x3 (changes as per code review). 2016-08-25 15:51:34 -07:00
Gurjant Kalsi
2072cfe8f1 [arm64] Backport changes from magenta 2016-08-25 15:50:52 -07:00
Gurjant Kalsi
5c6554165e [squash] Fix typo in IPI code 2016-08-23 15:58:32 -07:00
Gurjant Kalsi
c6e2c28c86 [bcm28xx][arm64] Fix some type warnings. 2016-08-23 15:15:43 -07:00
Gurjant Kalsi
c5b427333a [bcm28xx][arm64][ipi] Fix IPI on non-GIC based BCM28xx 2016-08-23 12:56:40 -07:00
Eric Holland
5e5e2ac50c [rpi3][bcm28xx][smp] fixes to bring up all cores 2016-08-23 12:28:42 -07:00
Gurjant Kalsi
100133dc38 [BCM28xx] Roll BCM2836 and BCM2837 into a single platform. Have both RPi2 and RPi3 use the new BCM28XX platform. 2016-08-23 12:28:28 -07:00
Eric Holland
1164bc17bc [rpi3]64bit platform support 2016-08-23 12:28:13 -07:00
Eric Holland
c3c48e6bb1 [arm64][mmu] fix asid shift in tlbi 2016-08-02 22:07:29 -07:00
Erik Gilling
6c82940c32 [stm32f0xx] Import new CMSIS from STM32Cube_FW_F0_V1.5.0. 2016-06-06 20:55:43 -07:00
Gurjant Kalsi
5007eb75e8 [arch][arm][arm-m] Implement arch_in_int_handler for ARM-M V7 CPUs 2016-06-01 17:43:27 -07:00
Eric Holland
648684f63d [arm-m][fpu] Fix m0 SP load 2016-03-29 17:52:09 -04:00