Commit Graph

707 Commits

Author SHA1 Message Date
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
3aecdda231 [includes] replace header guards with #pragma once 2019-07-13 15:46:16 -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
3699e45942 [include][lib] move most of the dangling top level include/lib/.h files into their lib
Only remaining one is console.h which is a little funny and will need to
be dealt with separately.
2019-06-19 22:44:15 -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
Erik Gilling
dcfd291dd2 [stm32f0xx][i2c] Add ability to override TIMINGR. 2019-03-11 15:10:40 -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
Erik Gilling
7ca88d22b5 [stm32f0xx] Fix '072 vector table.
The STM32F072 and STM32F070 have different vector tables.  We can't
 #ifdef on the existance of the constans like PVD_IRQn because they
 are enum values.  Right now, since we only have two supported variants,
 we're switching on the variant.  This will likely not scale.
2019-01-24 13:30:21 -08:00
Erik Gilling
060c82214d [stm32f0xx] Fix i2c clocks for HSI48 source. 2019-01-22 20:00:38 -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
Eric Holland
be72298b9c [nrf][timer] fix bug in hires 2018-12-19 16:05:09 -05:00
Travis Geiselbrecht
f98cef7992 [warnings] fix warnings across the entire code base
Fix or squelch all warnings in all code covered by buildall.
2018-12-16 17:33:22 -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
Eric Holland
81f50225ac [nrf][timer] improve time keeping in RTC
Improve accuracy of current_time and current_time_highres.
2018-12-13 20:47:50 -08:00
Travis Geiselbrecht
17598a2845 [platform][mt6735] fix build 2018-05-26 22:23:34 -07:00
Macpaul Lin
27425305fc [platform][mediatek][common] change default gic controller
According to source release repository of AP7350 (MT6735).
        http://git.huayusoft.com/tomsu/AP7350_MDK-kernel
        https://github.com/alexgoussev/AP7350_MDK-kernel

The common gic controller driver could not adapted to platform mt6735.
Hence a compile option here is needed.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
2018-05-22 00:05:46 -07:00
Macpaul Lin
5bec0e8460 [platform][mediatek] add mt6735 initial support
Support MT6735 platform.
Most files are copied from platform MT6797 without any modification.
The register offsets (mt_reg_base.h) were cross-referenced from the following
source code releases.
	http://git.huayusoft.com/tomsu/AP7350_MDK-kernel
	https://github.com/alexgoussev/AP7350_MDK-kernel

ToDo:
	1. Porting other peripheral drivers.
	2. Check what files can be shared between platforms
	   then reduce file duplications.

Signed-off-by: Macpaul Lin <macpaul@gmail.com>
2018-05-22 00:05:46 -07:00
Eric Holland
69963facbe [nrf52][uart] Fix but in UART init 2018-05-20 14:53:02 -07:00
Todd Eisenberger
af47d547f9 [stm32f0xx] Fix UART3/4 interrupts
The IRQ handler was being misdefined, so the correct ISR was not being
invoked.
2018-05-08 22:46:53 -07:00
Eric Holland
31b8d1d217 [nrf] Support for NRF52840 DK 2018-05-02 14:50:41 -07:00
Todd Eisenberger
e007acc4dc [stm32f0xx] Add support for stm32f070xb
This cleans up handling of a lot of optional components
across f0xx models.
2018-04-17 10:52:14 -07:00
Payam
6e05388579 [vim2] Initial support for Khadas VIM2 boards 2018-03-16 15:05:10 -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
Erik Gilling
c77f8f94bd [stm32f0xx] Enable sysconfig clock before accessing it in exti driver. 2018-02-09 15:25:12 -08:00
Todd Eisenberger
cc827a9856 [stm32f0xx] Correct register access for EXTI controller
A bunch of the register access here didn't match STM's docs.  The old
code had a few bugs:

1) The EXTI4-15 handler would clear pending bits for interrupts 16-31.
2) GPIO interrupt configuration was very misindexed.
2018-01-28 15:30:49 -08:00
Erik Gilling
5da17066df [stm32f0xx] Add support for CONSOLE_HAS_INPUT_BUFFER. 2018-01-22 23:33:35 -08:00
Erik Gilling
8ae85bd301 [stm32f0xx] Add timer capture driver.
Right now only capture is supported with the timers.  As more modes
are supported, the lower level bits of the driver should be
refactored.
2018-01-04 10:28:14 -08:00
Erik Gilling
fe71f59302 [stm32f0xx] Add external interrupt driver. 2017-12-22 11:14:18 -08:00
Erik Gilling
eb1ca2ed0c [stm32f0xx] Fix i2c stop and repeated start handling.
We need to look at the TC status bit to know that a transaction has ended.
This has the added benefit of cleaning up REG and TX handling.
2017-11-07 15:15:52 -08:00
Erik Gilling
8ebceb1ab0 [stm32f0xx] Fix gpio_set(). 2017-11-06 21:27:35 -08:00
Erik Gilling
d89fd06507 [stm32f0xx] Add i2c driver. 2017-10-27 14:51:15 -07:00
Erik Gilling
a35b98ebdd [stm32f0xx] Support multi-packet setup transactions. 2017-10-20 17:11:47 -07:00
Erik Gilling
ab273b4920 [stm32f0xx] Implement usbc_ep0_recv() 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
Xi Wang
63fa995789 [platform][pc] fix memory map handling in multiboot
The starting address of mmap is off by 4 bytes.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
2017-07-29 21:34:26 -07:00
Xi Wang
9fa0924c88 [platform][pc] fix multiboot info constants
The values of several MB_INFO_* macros are incorrect.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
2017-07-29 21:34:26 -07:00
Eric Holland
b8f77ca483 [bcm][gfx] gfx driver for raspberry pi 2017-02-06 18:52:08 -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
Girts Folkmanis
58ee575dcb [stm32] share power.c across stm32 platforms.
Previously power.c was only implemented for f7, but the
same functionality exists in other stm32 devices, thanks
to CMSIS defines.

This refactors out f7's power.c to platform/stm32/ and adds
deps from f7 and f4.
2016-09-15 13:41:45 -07:00
John Grossman
0c782aa381 [spelling] signalling --> signaling (#162)
Switch from the UK spelling of signalling (also, signalled and
signaller) to the American spelling.
2016-09-07 15:29:56 -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
c6e2c28c86 [bcm28xx][arm64] Fix some type warnings. 2016-08-23 15:15:43 -07:00
Gurjant Kalsi
b6018454c0 [bcm28xx] Fix arm/arm64 exception iframe warning 2016-08-23 15:09:07 -07:00