Hector Martin
17abe8f94b
display: Report time spent modesetting
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-06-01 02:03:32 +09:00
Hector Martin
6a1a9bfc3c
utils: Expand vector_args from 4 to 5 arguments
...
This also expands the usual call/next stage functions to match.
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-03-09 20:55:34 +09:00
Sven Peter
2bbf994089
utils: add timeout_{calculate,expired}
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Sven Peter
21fec139bf
utils: add write64_lo_hi
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-26 15:38:40 +09:00
Hector Martin
2127de59c1
utils: Add is_heap()
...
This lets us mix iBoot-allocated and heap-allocated pointers and
distinguish them at cleanup time.
Signed-off-by: Hector Martin <marcan@marcan.st>
2022-01-17 04:10:24 +09:00
Sven Peter
65816f1bd8
asc: Add ASC mailbox driver
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2022-01-16 18:53:29 +09:00
Hector Martin
26f636dbbb
fb: Use 128-bitwise copies to speed up FB updates
...
This makes it almost as fast as it was before the switch to an
uncached framebuffer, as far as I can tell.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-17 19:23:44 +09:00
Janne Grunau
b6ec7abc2b
utils: replace sprintf with snprintf
...
Converts all current users.
Signed-off-by: Janne Grunau <j@jannau.net>
2021-11-12 23:48:32 +09:00
Janne Grunau
5064b93b2f
usb: dynamically allocate and register usb iodevs
...
Preparation for devices with more than 2 USB-C ports.
Signed-off-by: Janne Grunau <j@jannau.net>
2021-11-12 23:48:32 +09:00
Hector Martin
a383ef0b5a
iodev: Protect iodevs with spinlocks
...
This makes SMP IRQ reports less flaky
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-04 03:53:39 +09:00
Hector Martin
326ba6fb33
utils: Fix BIT() signedness
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-01 19:00:34 +09:00
Hector Martin
38fc7a0780
Configure early debug features by SoC type
...
To build a version with early UART support, set it in config.h
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-01 13:36:42 +09:00
Hector Martin
4fa0200053
main: Export chip_id as a global
...
Some things need to be chip-specific, as the ADT isn't generic enough.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-10-18 17:33:49 +09:00
Hector Martin
b1bc4023dc
smp: Use wfi and put idle CPUs in deep sleep
...
This allows a single active P-Core to boost to 3.2GHz.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-17 00:15:52 +09:00
Hector Martin
c690eb1c9d
utils: Make spinlocks reentrant
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 23:24:37 +09:00
Hector Martin
c317b73b8c
utils: Add a basic spinlock implementation
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 23:19:37 +09:00
Hector Martin
fa50bb6474
fb: Do not restore logo when using kboot
...
Also don't clear the whole screen, only the console section so the logo
is glitchless.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-08-31 14:10:52 +09:00
Hector Martin
77a36a7d34
utils,proxy: Add basic SIMD register fetch and mutation support
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-27 22:57:25 +09:00
Hector Martin
25f4500cea
utils.h: Do sysreg defines in a way that allows extracting the fields
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-25 19:51:08 +09:00
Hector Martin
03b70eed94
hv_vm: Move dprintf macro to utils.h, add more debugging
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-15 20:38:32 +09:00
Hector Martin
3e1ea2d503
memory: Add separate mappings for EL0 data access
...
This unborks stack and constant pool accesses from el0_call.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-13 17:36:02 +09:00
Sven Peter
b00c5e6522
utils.h: add msr_sync convenience macros
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-05-11 15:48:40 +09:00
Sven Peter
36efdd2ac3
allow cpu_regs.h to be included in .S files
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-05-11 15:48:40 +09:00
Hector Martin
0e987f031b
utils: Add flush_and_reboot() to do the iodev flush dance
...
Use this for exceptions, asserts, etc.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-05 03:21:48 +09:00
Hector Martin
68156fd806
utils.h: Add alignment and field macros
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-01 19:02:49 +09:00
Hector Martin
45a0054f63
Add build-time printf() argument checking and fix warnings
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-01 18:23:44 +09:00
Hector Martin
7dfe24ee2c
Rework kboot/chainload flow to shut down before calling the next stage
...
Next stage boots now exit back to main() after replying to the proxy
command, allowing shutdown functions to be called. Introduces a new
P_VECTOR proxy op, distinct from P_CALL. The Python side is reworked
to remain compatible with older versions that do not support this.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-17 18:12:59 +09:00
Sven Peter
17fdc79c13
utils.h: add mdelay
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-15 18:39:33 +09:00
Sven Peter
f80933a7d3
utils.h: add is_primary_core
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-14 18:11:37 +09:00
Sven Peter
1a04590ed3
utils.h: add min and max
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-14 18:11:37 +09:00
Sven Peter
95b1cb39fc
utils.h: add poll32
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-11 05:26:29 +09:00
Sven Peter
bf3830ee6d
utils.h: add dma_mb,dma_rmb,dma_wmb
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-11 05:26:29 +09:00
Hector Martin
35f2b2435e
kboot: reserve m1n1 in memory
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-03-15 02:26:13 +09:00
Hector Martin
b8349819fe
Implement calling code as EL1
...
This works by clearing HCR_EL2.TGE, and then doing essentially the same
thunk/return dance as for EL0 calls. However, since most EL1 exceptions
are not routed to EL2, we install hypercall vectors in EL1 to forward
them to EL2, and then short circuit the exception return to whatever
triggered the original exception.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-03-04 22:10:37 +09:00
Hector Martin
cf640de6db
utils.h: add BIT() macro
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-18 17:55:55 +09:00
Hector Martin
17aca31498
utils.h: move reg_{clr,set,mask} here from chickens.c
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-18 17:55:55 +09:00
Sven Peter
1ccf2e2af5
utils.h: add writeread{8,16,32,64}
...
These functions all perform a store direcly followed by a load.
This is useful to e.g. useful to find busy bits which might
already be cleared a few cycles after a write.
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-02-18 16:12:28 +09:00
Ariel Machado
476182e1f8
utils.h: Fix 'asm-operand-widths' warnings with clang
...
Signed-off-by: Ariel Machado <ariel@fe.up.pt>
2021-02-06 12:13:29 +09:00
Hector Martin
4167a18a64
utils: move sys_reg and is_ecore() to utils.h
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 22:00:00 +09:00
Hector Martin
891bc5592e
utils.h: fix msr/mrs macro expansion
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 01:37:09 +09:00
Hector Martin
b82c0072e7
utils.h: mark reboot() noreturn
...
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
Sven Peter
63fad7e3e2
utils.h: add panic() macro
...
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-01-28 23:20:15 +09:00
Hector Martin
65276fdd3f
utils.h: add memory clobbers
...
We mostly use read32/write32 and friends to poke hardware registers,
which might have side effects on RAM, so just make everything a memory
clobber to avoid potential issues.
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 16:06:12 +09:00
Hector Martin
344c84da17
clang-format everything
...
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
81aaf2ed35
Basic exceptions, irq, cache mgmt support
...
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-17 00:49:22 +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