Commit graph

27 commits

Author SHA1 Message Date
Hector Martin
af7ad9c064 Makefile: break up OBJECTS into lines for easier merging
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-14 18:11:37 +09:00
Sven Peter
8efff1b0ab dart: add code to setup the DART iommu
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-14 17:40:07 +09:00
Sven Peter
b31e1265ff pmgr: add functions to enable/disable clocks
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-11 05:26:29 +09:00
Sven Peter
d73276b0bc tunables: add initial version.
There are at least two types in the ADT related to USB,
but there's a decent chance that there are even more
required for other devices:

 * A simple tunable that applies to a whole device node
   and all its MMIO ranges specified in the "reg" property.
   This one seems to just be mask32.

 * A slightly more complex tunable that applies to a single
   MMIO range specified in the "reg" property. So far I've
   only seen 32 bit masks but the format looks like it should
   also support 8,16 and 64 bit masks.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-08 20:32:12 +09:00
Sven Peter
1134a4a649 ci: add clang-format check to the CI
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-08 20:30:41 +09:00
Hector Martin
cecf51f245 dts: Update with current kernel devicetree, improve build
Now uses the same devicetree source as the kernel, verbatim, with the
required subset of kernel dt includes.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-03-15 02:26:31 +09:00
Hector Martin
efa4452a47 Fix libc header dependencies
Turns out we had a bunch of silly dependencies on libc headers that are
not included with freestanding compilers. Fix all this and change the
CFLAGS to exclude libc headers and only include the built-in compiler
path.

Add our own versions of assert.h, errno.h, limits.h, and move malloc.h
and string.h together into a new path used as -isystem, so these headers
can be included using #include <>.

Remove a bunch of other dependencies in third-party code.

Add a strnlen function.

Disable building the libfdt overlay code for now, as it needs a strtoul
implementation. We can throw that in if/when we decide to use overlays.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-03-08 01:31:14 +09:00
Hector Martin
5dbc82a9ee payload: add support for booting in-line payloads
Usage:

$ cat m1n1.macho Image.gz apple-j274.dtb initramfs.gz \
    > m1n1-payload.macho

That's it.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-06 16:44:10 +09:00
Hector Martin
5fbb25942d Makefile: disable -Wmultichar
minlzma uses multi-character constants

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-06 16:44:10 +09:00
Hector Martin
2d5fb878f8 Makefile: build for armv8.2-a
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 22:00:00 +09:00
Hector Martin
74307af0df kboot: add proper kernel boot & DT manipulation code
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 01:37:09 +09:00
Hector Martin
d280157289 libfdt: actually add libfdt
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 01:37:09 +09:00
Hector Martin
986c6730e9 Add heapblock and dlmalloc for managing memory
heapblock is a simple `sbrk` style implementation, also useful as an
"endless" decompression buffer. dlmalloc is used on top as a malloc
implementation.

This also changes how the Python side manages its heap. We still use a
python-side malloc implementation (since this is faster), and we put the
Python heap at the m1n1 heap + 128MB, without allocating it.
Hopefully this should never step on anything m1n1 neads, and avoids
having to manage freeing across Python script calls.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 16:25:15 +09:00
Hector Martin
db902ce01f wdt: move WDT disable code to wdt.c & use ADT regs
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 23:48:35 +09:00
Sven Peter
2f84b33ba8 MMU: add cache operations by set/way
this embeds a slightly modified file taken from
arm-trusted-firmware.

Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-01-28 23:20:15 +09:00
Hector Martin
d762391a68 Add code to spin up secondary CPUs
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 16:06:12 +09:00
Ariel Machado
51bf5c870a adt: replaces int to u32 and size_t for unsigned values.
Makefile: increases compiler warnings

Signed-off-by: Ariel Machado <ariel@fe.up.pt>
2021-01-25 19:18:30 +09:00
Hector Martin
cc34ace39a startup: Implement setting CPU chicken bits for Icestorm
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-25 19:11:54 +09:00
Hector Martin
7419295d62 dts/apple-j274: add WIP Mac Mini devicetree
Also fix some Makefile brokenness

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-25 17:24:29 +09:00
Hector Martin
ee12d053a9 proxy: add XZ and GZ decompression functions and code
This embeds tinf and minlzma.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-23 22:42:23 +09:00
Ferdinand Bachmann
c6da21ceff Makefile: clang support
Signed-off-by: Ferdinand Bachmann <theferdi265@gmail.com>
2021-01-23 22:09:22 +09:00
Hector Martin
81aaf2ed35 Basic exceptions, irq, cache mgmt support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-17 00:49:22 +09:00
Shiz
73e79c5372 build: fix problem with arch-less data on older GNU binutils
Signed-off-by: Shiz <hi@shiz.me>
2021-01-16 11:29:48 +09:00
Hector Martin
5175c7a31b Chainloading, ADT support, misc fixes
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:04:12 +09:00
Hector Martin
ec8bb045f2 Reduce alignment to 16k, size optimization
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:04:12 +09:00
Hector Martin
152c96a34a Import UART proxy
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:04:12 +09:00
Hector Martin
8af9f1eb95 Initial commit
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:03:35 +09:00