Commit Graph

268 Commits

Author SHA1 Message Date
Travis Geiselbrecht
1e50428091 [arch][riscv] remove the last of the RISCV_BOOT_HART mechanism
Now the harts are dynamically numbered, so don't need
this mechanism anymore.
2020-12-30 01:09:24 -08:00
Eric Holland
94675a7780 [nrf52][i2c] move i2c_init to target
Since the i2c driver is optional (not required for platform) the
i2c_init should be done during target initialization.  The flags
used to include the i2c driver should be in either target or project
files so it makes sense that the i2c_init should also be called from
target files.
2020-10-10 16:48:49 -04:00
Eric Holland
38dd509b27 [nrf][pca10040] fix platform incompatibilities
When the nrf52xxx platform was changed to use the Nordic nrfx
libraries the pca10040 target was broken due to differences in
how the platform handled initialization.
2020-10-10 16:12:07 -04:00
Eric Holland
d1bad2e683 [nrf][clock] use nrfx lib clock driver
Using Nordic's nrfx driver for the clock control peripheral since
it address a handful of errata and abstracts some differences
in the nrf52 family of parts.
2020-10-06 17:50:51 -04:00
Eric Holland
7068fb63cb [nrf52][gpio] use nrfx gpio library
Platform gpio driver now uses the nrfx library for gpio manipulation.
This allows utilization of second gpio bank present on some parts
and handling of errata.
2020-10-03 15:05:34 -04:00
Eric Holland
668be9d9fa [nrf52][i2c] Add nrfx i2c driver
Use twim(i2c) driver from nrfx library.  See comments and patterns in
target/nrf-pca10056 for info on how to properly utilize driver as it
requires some GLOBAL_DEFINES and gpio defines.
2020-09-28 09:07:27 -04:00
Eric Holland
b720536fe6 Nordic nrfx usb driver integration 2020-09-09 20:24:10 -04:00
Travis Geiselbrecht
4edb93adde [lib][console] rename some console command types to be prefixed with console_
Some of the structures, notably 'cmd', in the lib console stuff are a
little too generically named and have collided with some other code
so prefix the names a bit more cleanly with console_

The change is largely mechanical, and folks with out of tree code can
easily switch by renaming:
cmd -> console_cmd
cmd_args -> console_cmd_args
cmd_block -> console_cmd_block
console_cmd -> console_cmd_func

Apologies if this breaks you but it should be pretty easy to fix.
2020-07-25 15:59:58 -07:00
Travis Geiselbrecht
ca800ac932 [console] move the history buffer into static memory, remove console_init
No need to malloc this memory if it's always going to be initialized
anyway. Add history disabling switch to a few targets to make sure both
builds are tested.
2020-05-17 16:13:45 -07:00
Travis Geiselbrecht
dc1cfc0b33 [target][sifive-unleashed] get working on a physical sifive unleashed
Only tested with SBI and supervisor mode, but that's all I have now.

Add checked in copies of the device tree needed for a uboot uimage
needed to start it.
2020-03-28 20:33:04 -07:00
Travis Geiselbrecht
90dc9e50ef [platform][sifive-e] get the hifive1 hardware working again
Had rotted a bit. Had to reimplement a few tweaks.
Also generally #if out a lot of the SMP code when unused on riscv.
2020-01-18 18:39:07 -08:00
Elliot Berman
e50d7db612 [arch][riscv] Add support for running in supervisor mode
Add support for running LK in supervisor mode or machine mode.
- Macro-ify CSR access to use correct CSR # or use SBI call as req'd
- Add support to make SBI calls
- Split CLINT and lk timer abstraction so that RISC-V timer can use SBI
  as required.
- Add support for booting other harts as primary since hart0 on U540
  does not support S-mode. A map is used to get LK cpu number from
  hartid.
2020-01-16 23:06:28 -08:00
Elliot Berman
e137d70ccd [target][riscv] Add support for qemu-sifive-u virt machine
A copy/paste from sifive-unleashed but without PWM/LED.
2020-01-16 23:06:28 -08:00
Elliot Berman
acfe991c7f [arch][riscv] Expose RISC-V mp kernel start
Support mp lk start on RISC-V. Several changes throughout were required:
- Add signal in asm start to force secondary harts to wait for bss to be
  cleared.
- Use mhartid in arch_curr_cpu_num, PLIC, and CLINT
- Use tp register as thread pointer instead of global variable.
- Support sending IPIs between harts using CLINT
- Add spinlock implementation
2020-01-16 23:06:28 -08:00
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
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
Martin Foo
b66bd3e420 Add STM32F429I-DISCO1 support(default serial:USART1). 2019-06-19 18:18:52 -07:00
Travis Geiselbrecht
4148863969 [platform][qemu-virt] rename to qemu-virt-arm
Makes space for a new platform using the virt machine in qemu on another
architecture.
2019-03-30 19:46:30 -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
4c29a608e9 [platform][pc] fix up bios32 PCI support, get pci IDE working again
-Spiff up the device driver starting logic to allow for statically
started devices, instead of always automatic.
2018-12-31 16:47:32 -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
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
Macpaul Lin
bf27ebd7bb [target][mt6735] add mt6735 support
Add common target based on platform mt6735.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
2018-05-22 00:05:46 -07:00
Eric Holland
31b8d1d217 [nrf] Support for NRF52840 DK 2018-05-02 14:50:41 -07:00
Payam
6e05388579 [vim2] Initial support for Khadas VIM2 boards 2018-03-16 15:05:10 -07:00
Erik Gilling
cc60328989 [cdcserial] Refactor driver to support multiple channels. 2018-01-22 23:33:35 -08:00
Erik Gilling
0c97b7f6a1 [nucleo-f072rb] Enable i2c and add i2c_rb command. 2017-10-27 14:51:15 -07:00
Erik Gilling
e84ad6e5c1 [nucleo-f072rb] Add usb support. 2017-10-20 17:11:47 -07:00
Erik Gilling
82b3c2e0d1 [stm32f0xx] Properly initialize clocks in platform_early_init().
This got broken when moving to the new STM32F0xx_HAL_Driver.
2017-10-20 17:10:55 -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
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
Gurjant Kalsi
acbee6a974 [dartuino][ndebug] Fix Dartuino Build, NDebug no longer present in tree.
Removed references to NDebug from the Dartuino Build since it is no longer maintained in the LK tree.
2016-07-15 14:58:49 -07:00
Minglun Tsai
919a925eca [platform][mediatek] support mediatek platform: mt6797 (#137)
Basic mt6797 platform S/W for lk.
2016-06-21 09:53:03 -07:00
Eric Holland
6388cde233 [nrf52] Platform and sample target support for Nordic NRF52 (cortex-M4) 2016-06-16 16:31:53 -07:00
Gurjant Kalsi
a2d9629dad [dartuino][spifs] Add a better error message when QSPI is not formatted on dartuino 2016-05-10 22:15:17 -07:00
cstout
0f0b4959ad Stub display_present
R=gkalsi@google.com

Review URL: https://codereview.chromium.org/1951403002 .
2016-05-05 12:54:06 -07:00
Gurjant Kalsi
8d466f9441 [mtldr] Add udev rules, use new vid/pid, separate bootloader usb from main system usb. 2016-04-25 13:00:46 -07:00
Gurjant Kalsi
05c646a39a [ndebug] Setup NDebug endpoints and create a bidirectional serial pipe over USB. 2016-04-18 12:07:34 -07:00
Gurjant Kalsi
5a98fbd3b9 [dartuino] Move LCD defines to target level makefile 2016-04-05 13:31:41 -07:00
Gurjant Kalsi
d508cb4911 [dartuino] Add sensorbus back to dartuino deps 2016-04-05 13:01:13 -07:00
Gurjant Kalsi
44e74f0486 [dartuino][bootloader] Merge bootloader branch into master. 2016-03-28 12:05:20 -07:00