Commit Graph
100 Commits
Author SHA1 Message Date
David Karoly 0f26acc83e arm: reuse generic PCI implementation
Change-Id: If69c7e3779dade16cfc8c0af2a0b963f1f646169
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5561
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: John Scipione <[email protected]>
2022-08-24 09:46:49 +00:00
David Karoly 226dd60a57 arm64: initialize PCI interrupts from FDT
see:
https://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf

Change-Id: I4158b022fd4404e3126f92ee844743e39a9b6646
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5560
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-08-24 09:41:35 +00:00
David Karoly 1ef08da5a0 arm64: discover PCI from FDT
see:
https://www.kernel.org/doc/Documentation/devicetree/bindings/pci/host-generic-pci.txt

Change-Id: I0c35de0c0e08ab04a00101cb3a60df283c685e7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5559
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: John Scipione <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-08-21 17:31:04 +00:00
David Karoly c633f83a45 kits/app: fix DBG in Looper
* adjust format string for thread id
* fix variable name loop vs looper

Change-Id: I3d1924d6ab98981b4b2a3f56689872e35e5bea77
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5562
Reviewed-by: waddlesplash <[email protected]>
2022-08-18 16:38:07 +00:00
David Karoly c6e6743261 PCI: refactor root node detection
Change-Id: Icc4ab0c3f7258914d798267e08c47977c0987c97
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5547
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-08-17 19:23:51 +00:00
David Karoly 079db739a6 virtio-mmio: discover devices from ACPI
https://www.kernel.org/doc/Documentation/arm64/arm-acpi.txt
https://wiki.linaro.org/LEG/ServerArchitecture/ACPI/LinaroRegistry

Change-Id: I330a497173c0a82b789a43720e3d86e1513a661b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5506
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-08-13 09:43:41 +00:00
David Karoly fe2b6d7706 arm: detect SoC timer from FDT for OMAP3 and PXA
Change-Id: Ib03a11f016cb937d748d2696a17158e17c86e317
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5522
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: David Karoly <[email protected]>
2022-08-09 18:15:55 +00:00
David Karoly 0404f954c1 boot/efi/dtb: dump PCI interrupt map
see:
https://www.kernel.org/doc/Documentation/devicetree/bindings/pci/host-generic-pci.txt
https://www.devicetree.org/open-firmware/practice/imap/imap0_9d.pdf

Change-Id: Iba53457384d6330f99ac0b3b6b2894da83471c48
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5537
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-08-09 13:35:42 +00:00
David Karoly f5aba47edd boot/efi/dtb: code cleanup for FDT dump
* conditional compile for dump_fdt() with #ifdef
* rename functions according to coding standard
* use dprintf() for printing

Change-Id: Ie486739d87f1cb9a005188a46a43f470b6000319
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5536
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-08-09 13:32:26 +00:00
David Karoly bdce546c9f kernel/arm: implement generic timer
Change-Id: I5edb7e36013d5e5d9d45ec3cf31014f99601a4c6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5519
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-08-04 11:20:55 +00:00
David Karoly 50913d9a6f boot/efi: fall back to legacy UART if EFI protocol is not available
Change-Id: I70ea16aa8842edcb22a3484cf908698c3c5026c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5509
Reviewed-by: Alex von Gluck IV <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-07-29 17:22:45 +00:00
David Karoly 6a1f97581f arm: move SPI interrupt offset calculation to FDT code
Most common values for interrupt-cells are 1 or 2.
- one cell: the single cell defines the index of the interrupt
  within the controller.
- two cells: the first cell defines the index of the interrupt
  within the controller, while the second cell is specifies
  interrupt flags like active-high/active-low, edge triggered
  or level-sensitive.

ARM Generic Interrupt Controller uses 3 cells:
- the 1st cell is the interrupt type: 0 for SPI, 1 for PPI
- the 2nd cell contains the interrupt number
- the 3rd cell contains interrupt flags, similarly to the 2-cell format

SPI interrupts are numbered from 0 in the device tree but
they start from 32 on the GIC so an offset should be applied.

On the other hand, ACPI tables contain interrupt numbers
as they are expected by the GIC so no offset should be applied
when interrupts are read from ACPI.

see:
https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
https://www.kernel.org/doc/Documentation/devicetree/bindings/interrupt-controller/arm%2Cgic.txt
https://developer.arm.com/documentation/198123/0301/Arm-CoreLink-GIC-fundamentals

Change-Id: Ia41371bd965347f89c17d62e391480d7b2083bae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5490
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-25 07:02:05 +00:00
David Karoly 91ee0332c3 move acpi headers from x86 to non-arch
Change-Id: Ida6186af7a40fb7d91b4da92c36d25db30dadb33
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5484
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-07-20 08:28:53 +00:00
David Karoly 1f26a521ac kernel/arm64/int: add missing header
Change-Id: I776271bb117f854783a6ae6bcdba591eafb27fa5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5481
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-07-18 09:08:18 +00:00
David Karoly 4561a1992f arm64: Wire up FDT
Change-Id: Ib6f60e6d703e9413eb4cef3ec77686cfd71f8e73
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5478
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-17 07:36:53 +00:00
David Karoly fbe8805dd6 kernel/arm/vm: convert TRACE to new syntax
Change-Id: Id9c078279320fdfa45b29a49f40bdcb9520ac21e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5454
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-16 10:34:25 +00:00
David Karoly 75c76bec99 kernel/arm64/vm: introduce TRACE
Change-Id: Ia1fa2383743bd054fec96ee6fb7471b423272810
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5453
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-15 17:26:53 +00:00
David Karoly 764c0853e8 kernel/arm/thread: convert TRACE to new syntax
Change-Id: Iaf2876b92c130196a671f274e5fc36f6cccf1d0e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5445
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-11 19:34:03 +00:00
David Karoly 2e0a9b9554 kernel/arm: use generic/user_memory.h
Change-Id: I890bdd7d6f64162416a1a80c7d8280618aaa8fb8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5429
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-04 16:43:39 +00:00
David Karoly 1b95b1e857 kernel/arm/int: convert TRACE to new syntax and hush
Change-Id: I8945ad621aee2bc1c8d8852bb1c220936e567d86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5430
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-07-04 07:00:03 +00:00
David Karoly fe3405c087 kernel/arm: ensure page dir is correctly aligned
Page directory physical address must be aligned on 16K and
it must be mapped to a contiguous physical region.

Change-Id: I6723023c9deaa1c4a1081cf5a984a1766241a532
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5423
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-07-01 18:39:30 +00:00
David Karoly 84360889a2 ldscripts: remove linker script for Raspberry Pi
This linker script was introduced in commit 5426ff9 in 2012
predating both the EFI and the raw u-boot ARM loader,
at that time it seems that it was intended to be used
as part of a 'raspberrypi_arm' boot platform which does
not exist anymore. So this is not needed anymore.

Change-Id: I530e922807fe6d80f74248f2dc7ed25cdc8bcb1c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5419
Reviewed-by: waddlesplash <[email protected]>
2022-06-28 17:10:40 +00:00
David Karoly 0d560e87ee kernel/lib: add missing musl include
This is needed to fix the build on arm as atomic_arch.h
relies on musl libc.h and features.h

Change-Id: I5bfa32b7b0fa1662cc9ee8cd8fa3037d8a5e2431
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5418
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-06-28 13:35:42 +00:00
David Karoly 83f755b5d8 kernel/arm: add memory barriers for page table ops
Introduce memory barriers according to ARMARM,
section G.5.3 TLB maintenance operations and barriers

Sequence for mapping memory in (both L1 and L2):
* DSB
* Invalidate i-cache (TODO)
* Insert new entry in page directory / page table
* DSB
* ISB

Sequence for mapping memory out:
* Remove page table entry
* DSB
* Invalidate TLB entry
* DSB
* ISB

Sequence for updating a page table entry:
* Update page table entry
* DSB
* Invalidate TLB entry
* Invalidate branch predictor (TODO)
* DSB
* ISB

Note: i-cache invalidation and branch predictor invalidation is
not implemented yet as this commit focuses on implementing memory
barriers.

Change-Id: I192fa80f6b43117236a4be6fa8c988afca90e015
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5241
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-04-28 19:57:49 +00:00
David Karoly 41ed7a1ed6 boot/efi/arm: use GICv2 driver for GIC-400
The GIC-400 is compliant with Version 2 of the ARM GIC Architecture Specification.

Untested.

see:
* ARM Generic Interrupt Controller Architecture Specification
* CoreLink GIC-400 Generic Interrupt Controller Technical Reference Manual

Change-Id: I4e062173c56dddcc579c04050ca62cb341b60959
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5240
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-25 20:49:48 +00:00
David Karoly dea541c4f4 docs/arm: update info for Raspberry Pi 2 & 3
Add some more details on peripherals.

Change-Id: I65e6ce5ff32cd8b40b95a707460a870f0f4d688e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5239
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-23 18:18:13 +00:00
David Karoly e5165df648 docs/arm: remove TODO item for soft-float
soft-float/hard-float mismatch issues are tackled by introducing
libgcc-boot, libgcc_eh-boot, libsupc++-boot libraries in the
gcc_bootstrap package

Change-Id: I4d3eff12c4c78804cd1dd32d6c1c5c8a9b5ad51a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5238
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-23 18:17:19 +00:00
David Karoly 745a40d78a kernel/arm: implement memory attributes
Set AP[2:0] and XN flags based on page attributes.
PXN is not implemented as it seems to be available only
in L1 descriptors on ARMv7.

Set TEX, B, C flags based on memoryType:
* B_MTR_UC is mapped to Strongly Ordered (TEX=0, B=0, C=0)
* B_MTR_WC is mapped to Shareable Device Memory (TEX=0, B=1, C=0)
* B_MTR_WT is mapped to Outer and Inner Write-Through, no Write-Allocate (TEX=0, B=0, C=1)
* B_MTR_WB is mapped to Outer and Inner Write-Back, no Write-Allocate (TEx=0, B=1, C=1)
* B_MTR_WP has no direct equivalent on the ARM so it's mapped as B_MTR_WB
* default is Write-Back

Implement ARMPagingMethod32Bit::AttributesToPageTableEntryFlags()
for mapping from page attributes to AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::PageTableEntryFlagsToAttributes()
for the reverse mapping used in Query() and QueryInterrupt()
i.e. recover page attributes from AP[2:0] and XN flags.

Implement ARMPagingMethod32Bit::MemoryTypeToPageTableEntryFlags()
fr mapping from memoryType to TEX, B, C flags.

Implement ARMVMTranslationMap32Bit::Protect() which used to be commented out.

Accessed and modified flags are not implemented yet, so no such
flags are returned from Query() and QueryInterrupt().

Also because of this, we just invalidate TLB on any call to Protect()
without checking whether the page has been accessed.

Change-Id: I027af5c02bd6218d9f92a58044aeb26373e1956b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5236
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-23 12:52:59 +00:00
David Karoly ba0c49863a docs/arm: add info on Raspberry Pi 4
Change-Id: Ic8cc47394c9e49f05e30b5ba54ff70557b1e2c47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5237
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-23 09:18:03 +00:00
David Karoly adc32659fb arm: enable enforcing memory access permissions
Bootloader:
* set permissions to kernel read/write, no user access
  for initially mapped memory areas
* set permissions to kernel read/write, no execute,
  no user access for UART

Kernel:
* physical memory mapper uses kernel read/write mapping
  with no-execute bit enabled
* all other pages are mapped as read/write/execute for
  kernel and user
* proper access permissions and memory types to be
  implemented later

Enforce memory access permissions by setting DACR to
client mode for domain #0, no access for other domains.

see ARM Architecture Reference Manual, section B3.7 Memory access control
and in particular the following subsections:
B3.7.1 Access permissions
B3.7.2 Execute-never restrictions on instruction fetching
B3.7.3 Domains, Short-descriptor format only

Change-Id: I8127b4c72dc516d013cb9751d80d6f3a9ec835e6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5233
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-22 12:20:01 +00:00
David Karoly 097f72e92c docs/arm: update info for Raspberry Pi 2
Change-Id: I968752c3eae56bee099f3cec5db7856dbe007592
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5232
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-22 10:50:59 +00:00
David Karoly f8a9b57cbd kernel/arm: move exception handler stacks to data segment
Exception handler stacks used to be defined in the text segment
which doesn't work very well once we enable memory access permissions
as the text segment is read-only.

Change-Id: I6b28bae09507f23293ede80034db81f5344de4c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5231
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-04-22 10:15:08 +00:00
David Karoly 9b592446a0 kernel/arm/paging: adjust page table entry flags
Map physical memory by default as Normal Memory,
Outer and Inner Write-Back, no Write-Allocate

This corresponds to the following flags:
TEX=0, B=1, C=1

AP flags are not filled in at this point
as access permissions are not enforced.

see also ARM Architecture Reference Manual, section B3.8.2,
Short-descriptor format memory region attributes, without TEX remap

Change-Id: I90bc95a8feb9f22583d41135f4cbd03489fd1b72
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5230
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-04-22 10:14:48 +00:00
David Karoly be7333a8d7 docs/arm: add info on Raspberry Pi 3
Change-Id: Iee7bd2f99dfc11930a97683c2cf30c51110d6726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5229
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-22 10:00:39 +00:00
David Karoly 2ba1112f62 docs/arm: remove TODO item for KDL hangman
It seems to be already implemented.

Welcome to Kernel Debugging Land...
Thread 14 "main2" running on CPU 0
frame            caller     <image>:function + offset
 0 801bc898 (+2145662824) 801b9734   <kernel_arm>  (nearest) + 0x00
kdebug> kdlhangman
word> ____
hangman> e
word> ___e
hangman> t
  ____
  |   |
  |   O
  |
  |
  |
word>

Change-Id: I40aa484a69a76482ddd8508d493b6c52c11558fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5228
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-22 09:46:30 +00:00
David Karoly 2b943e564a kernel/arm: hush memory type warnings
arch_vm_set_memory_type() seems to be x86-specific (cf. MTRR) and
on other architectures it's enough to respect memoryType argument
passed to Map() and Protect()

Change-Id: Ic898b0659c73552d705593dbc3f315dbf504013d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5217
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-04-20 15:52:59 +00:00
David Karoly ab78f824da boot/efi/arm: handle unaligned ranges in map_range_to_new_area()
Change-Id: Ia6c707bf8381b77aa8b256a007fb51f1c32e9e17
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5183
Reviewed-by: Jérôme Duval <[email protected]>
2022-04-20 13:38:23 +00:00
David Karoly 6886114066 boot/efi/arm: flush caches before jump to trampoline
Change-Id: Ia7af285f1c3b988828482ff0cd78a416cf51c2c2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5196
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-18 15:27:10 +00:00
David Karoly 9501bd1241 arm64: update linker script for kernel
Change-Id: Icf53d6ce1940dedebf218a6b68531aebf4c896b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5207
Reviewed-by: X512 <[email protected]>
Reviewed-by: <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-17 08:26:41 +00:00
David Karoly 3be705841c arm: remove config_manager_arch.c
config_manager_scan_hardcoded() is never invoked
and there's nothing else in config_manager_arch.c

Change-Id: Iddd0648efa15ffe4a1621b74dbdd1db16039bfe8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5206
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-04-13 20:30:22 +00:00
David Karoly c4b8af3b6f kernel/arm64: enable 8250 UART driver
Change-Id: If8195e5e1032a172b3365f8771c4d87a2f0657ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5191
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: <[email protected]>
2022-04-13 20:00:11 +00:00
David Karoly 21ac6f6b75 arm64: remove config_manager_arch.c
config_manager_scan_hardcoded() is never invoked
and there's nothing else in config_manager_arch.c

Change-Id: Id3ec90f670de3517cfc9c1d6710c0fa688e5d48b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5205
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-04-13 19:57:20 +00:00
David Karoly 4b1d94b435 debug_uart fixup for arm64
Change-Id: I872e822c48d0b4675064991ba890ce6d74d15118
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5186
Reviewed-by: <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-09 14:52:35 +00:00
David Karoly 2b5b228442 boot/efi: implement ranges property for simple-bus
see Devicetree Specification, section 2.3.8

Change-Id: I788bbaa67c8e8f9b57f138418eb1c3131bbe2010
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5188
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-04-09 14:51:47 +00:00
David Karoly ab3c8bea07 gensyscalls: alignment fixup for ARM
ARM ABI has different alignment requirements based on parameter size:
* parameters not larger than 4 bytes are aligned on 4 bytes
* parameters larger than 4 bytes are aligned on 8 bytes

see:
Procedure Call Standard for the Arm Architecture
sections 5.1, Fundamental Data Types
and 6.5, Parameter Passing

Therefore the following changes are introduced in gensyscalls tool:
* new optional define SYSCALL_LONG_PARAMETER_ALIGNMENT_TYPE is introduced
* it's defined only on ARM
* on other architectures it takes on the value of SYSCALL_PARAMETER_ALIGNMENT_TYPE as a default
* constants kLongParameterAlignmentType and kLongParameterAlignmentSize are introduced
* Syscall::AddParameter uses this value for aligning parameters larger than 4 bytes

Change-Id: I7e766e0ea9d07001643e813722b462b1f044921a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5112
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-08 15:30:06 +00:00
David Karoly 5e6e52cfd4 boot/efi/arm: enable caches before jump to kernel
Set bits 12 and 2 in SCTLR to enable i-cache and d-cache.
Set cacheability flags in TTBR0 to enable coherent page table walks.

Change-Id: I7f62255b9e49035524ecf87bed12a60dd405f3c8
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5178
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-05 10:49:46 +00:00
David Karoly fdaa57a70d boot/efi: handle /chosen/stdout-path
Change-Id: I08ebadf274448e1319cc8b0666beaf709382c00f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5143
Reviewed-by: Fredrik Holmqvist <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-04-05 10:49:19 +00:00
David Karoly c5d3ca339c runtime_loader: ignore PT_ARM_UNWIND sections
Change-Id: I966e366c73d495c3b3396f0dd4b44bafaf5c77c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5136
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-03-29 07:10:41 +00:00
David Karoly d232643ed8 boot/efi/arm: add debug logs for initial CPU state
Change-Id: I08df563ef6967f5f9734bbe11ac643c3b68f504f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5151
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-03-29 07:09:14 +00:00
David Karoly 7fdf6e8639 boot/efi/arm: switch serial output to legacy after exiting EFI boot servieces
Change-Id: If7ba007d24cc95ce0a43adc320932e3e1678c25b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5159
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-03-29 07:08:48 +00:00
David Karoly a3ef09d41e boot/efi/arm: implement PL2 to PL1 transition
Change-Id: Ib30a943f68430ecbe33d8c7fe88c67267f9deff9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5150
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-03-29 07:08:24 +00:00
David Karoly 5ba6ef84ef boot/efi: use 8250 driver for bcm2835 mini-UART
Change-Id: I1f42447e537ea7522ac299f028d530beb5067350
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5142
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-03-24 13:24:55 +00:00
David Karoly 9d65dbf1cb boot/efi: rework address-cells and size-cells handling
see Devicetree Specification,
section 2.3.5 #address-cells and #size-cells

The #address-cells and #size-cells properties may be used in any
device node that has children in the devicetree hierarchy and
describes how child device nodes should be addressed.

The #address-cells and #size-cells properties are not inherited from
ancestors in the devicetree. They shall be explicitly defined.

If missing, a client program should assume a default value of 2
for #address-cells, and a value of 1 for #size-cells.

Change-Id: Iafed49358540f8ac7aa673c3dc0191c9b580250b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5144
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-03-24 13:24:22 +00:00
David Karoly 6804f6c764 kernel/arm: implement entering userspace
Change-Id: Icf3945db979a8f4444856fc7157649f48b297c29
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5037
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-03-02 22:38:25 +00:00
David Karoly 289b735673 arm: fallback to icu-57.2 for haikuportscross
Change-Id: Iad87ab9675314d52cf1748afb1bd9017ec911178
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5036
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: X512 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-03-02 19:28:50 +00:00
David Karoly fdb459132e boot/efi/x86: implement SMP detection and bootup
* move common SMP initialization code to x86/arch_smp.cpp

* factor out arch-specific SMP initialization to
  arch_smp_32.cpp resp arch_smp_64.cpp

* implement smp_trampoline for x86 32-bit EFI loader

* rename SMP trampoline for x86_64 to long_smp_trampoline

* add new argument virtKernelArgs to arch_smp_boot_other_cpus
  as the kernel args are not identity mapped on 32-bit architectures

Change-Id: I30d0bb1fa9bfb08f6784a2af34eb83d6b64afa57
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4869
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-03-01 17:39:19 +00:00
David Karoly 4c6e7a4bca kernel/arm: implement prefetch abort handler
Change-Id: I39c330a44ad36ede41c7727017dd733d07288be9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4983
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-26 22:08:57 +00:00
David Karoly 883858e60b implement TLS for arm
Use the User Read-only Thread ID Register aka TPIDRURO to store
TLS pointer.

The User Read-only Thread ID Register is read-only in User mode,
and read/write in privileged modes.

see: ARMv7 Architecture Reference Manual,
section B3.12.46 CP15 c13 Software Thread ID registers

Change-Id: I7bff2fd66f41d7bf1a8a247151bcd02b32733c1b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4994
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-26 11:41:40 +00:00
David Karoly 1b895c8371 kernel/arm: implement syscall handler
Change-Id: I75f2fb7808f55a460835276ca66cce8a26e8403d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4980
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: X512 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-25 15:35:50 +00:00
David Karoly 0fea9fec6f Update gcc_bootstrap package for ARM
Change-Id: Ica8b714252925460c612f934cc2a7300a397ec47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4993
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-24 20:23:06 +00:00
David Karoly b22c6f6f29 kernel/arch/arm: swap TTBR on thread context switch
Change-Id: Ie85742d077866c10ba57b46848d5acaef932615e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4982
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
Reviewed-by: X512 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-24 16:49:58 +00:00
David Karoly f06e0279a5 implement glue for arm
Change-Id: I2752fb8b1c8843e8344a10295caf82e9603ed5e2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4973
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-24 16:39:15 +00:00
David Karoly 4ddef6e701 kernel/arm: detect read/write access in data abort handler
Use Data Fault Status Register's bit 11 to initialize isWrite.

see: ARMv7 Architecture Reference Manual,section B3.9.5
Distinguishing read and write accesses on Data Abort exceptions

Change-Id: I7da6702fc0e9579e5cb09cba3c5c89f004ec268a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4972
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-02-23 22:42:02 +00:00
David Karoly 24b174f4f9 runtimer_loader/arm: implement relocations
Change-Id: Ibda978e37d6dbdaf33ac054adbbda70768fe0d97
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4975
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-02-23 22:41:26 +00:00
David Karoly f98f9bccb8 libroot/arm: implement syscalls
Change-Id: Id9b37d29b802b7f469fb109054ec6446f93511b5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4979
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: X512 <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-02-23 22:40:31 +00:00
David Karoly acb424c8b7 boot/arm: move system_time and spin to platform
Add fake implementation for system_time()
Implement spin() using EFI boot services

Change-Id: Ib69b851780bd03624ce4e19d725dd319f6640601
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4964
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-19 15:35:21 +00:00
David Karoly 38d4a2edf7 virtio: add VIRTIO_FEATURE_ANY_LAYOUT in virtio.h
Change-Id: Ib8bc3639b4330dc1fb61ddbb6a3e8237cc6814ca
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4971
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
2022-02-18 21:27:47 +00:00
David Karoly a21676b669 runtime_loader: adjust MAX_PAGE_SIZE for ARM
gcc generates binaries with segments aligned on 0x10000
because this is the max page size defined in bfd

This change allows runtime_loader to load ARM binaries
without complaining for unreasonable amount of space
between segments.

Change-Id: Iec345980ca7ff72786173772a6deb40f5ca0b0ae
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4974
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-02-18 21:25:54 +00:00
David Karoly a18ff64517 boot/arm: remove unused arch_mmu.h
This file is used only by the u-boot raw bootloader and
it has identical content to platform/u-boot/mmu.h.

Therefore we can use mmu.h in the u-boot loader and remove
this header.

EFI platform has its own arch_mmu.h in
headers/private/kernel/boot/platform/efi

Change-Id: Ie77774fbcf4855f9bc643176c179670f6169b3b6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4929
Reviewed-by: Adrien Destugues <[email protected]>
2022-02-04 11:42:45 +00:00
David Karoly 478279116b boot/efi/arch: remove comments related to ConvertPointer
Change-Id: I1c0ebe04c180f3c50ac07c7d043a33d2c4563a18
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4924
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-02-02 16:36:14 +00:00
David Karoly 4f912a8b33 enable building EFI loader for x86
Change-Id: Ic7d2c3194b8555f7b6704131f5fc2bce3b139ee4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4918
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-31 14:22:57 +00:00
David Karoly a7b50febfa kernel/x86: use proper phys_addr_t field for storing ACPI root pointer
Change-Id: I475b7b3f9bd0711ecd037043e86559ab691a82a7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4881
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-31 14:15:46 +00:00
David Karoly bfd5d56283 boot/efi/mmu: fix sign extension issues
Conversion from pointer to phys_addr_t (i.e. uint64) results
in a sign extension on x86.

Therefore we first convert to addr_t and then convert from
addr_t to phys_addr_t.

Change-Id: Id9d9db03d9940a11ea3892841c271e12fad3975a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4872
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-31 14:14:12 +00:00
David Karoly 4ca2120531 boot/efi/x86: take care of PAE flags during MMU initialization
UEFI specification states that on IA-32 paging may or may not be
enabled during startup. If paging is enabled, PAE might be active.

During jump to kernel and early kernel initialiation we use paging
without PAE.

Therefore the following initialization sequence is introduced:
* disable paging
* disable PAE
* load page directory
* enable paging

Change-Id: Ife9a631b914dd5867f6673713e20e8abfce1ea44
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4919
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-30 13:39:43 +00:00
David Karoly 5e5299336b boot/efi/x86: implement MMU initialization and jump to kernel
Change-Id: Ie42c69f3851acae3a8184aa97ab2dd01c9485f46
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4850
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-28 15:31:07 +00:00
David Karoly 20c0887491 boot/efi/arm64: implement arch_convert_kernel_args()
Empty function for now as no arch-specific calls to
fix_address() needed on arm64.

Change-Id: Ifef100c132eac29a2b763e06bf1efd695b284851
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4894
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-01-28 15:28:03 +00:00
David Karoly 36e8ac9d41 boot/efi/x86: implement timer initialization
Change-Id: Ida16e63d2b8f87b90897892faf0e6db92b185d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4851
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-28 10:25:29 +00:00
David Karoly 367beefadc boot/x86: move HPET initialization to arch folder
Change-Id: Iac3f4923f132c4c3328fde5af1dad75af5b2efbd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4864
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-28 10:25:29 +00:00
David Karoly 8d743ebd60 docs/arm: remove TODO item for bootloader memory map handling
Change-Id: Iabcada696eb87500dbcdb03cf742607e0e525707
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4892
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-01-27 20:25:22 +00:00
David Karoly d283a8c58a kernel/arm: add range checking for early page tables
Change-Id: Ibbd367475482eb0cf839314014c8bf68612c5d6a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4891
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-27 16:29:48 +00:00
David Karoly 79ee00628f boot/efi/arm: don't add ranges below KERNEL_LOAD_BASE to virtual_allocated_ranges
Change-Id: I9dbb1c46bcfcdea6fe3e8287673557e54a29c008
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4889
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-27 16:28:45 +00:00
David Karoly a2d528242a boot/efi/arm: code cleanup
* Use TRACE() for logging
* Use B_PRI format strings
* Reformat local variables and function arguments to use camelCase
* Remove comment related to ConvertPointer
* Fix indentation for switch statements
* Remove variable sFirstPageTable as it's not really used

Change-Id: Iace275e5a3311f13a5018f497c3132e472a20848
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4885
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-27 14:11:27 +00:00
David Karoly f991c7ee03 boot/efi/dtb: fix signedness of dtb_get_interrupt_parent()
Change-Id: Ic3a28ff003cb82dc9166200594dbf3fc58e76b51
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4884
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-27 02:02:22 +00:00
David Karoly f06c2e7f5c docs/arm: remove TODO item for early page tables
Page directory and early page tables are allocated using
platform_allocate_region() and they don't need to be identity mapped
since commits 9103470bd and a7c69a4b1.

Change-Id: Ia7fcf1dd2fa34262e013f651139ad252a1ac9113
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4886
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-27 02:01:41 +00:00
David Karoly 8fea4985b5 bus_managers/fdt: implement interrupt-cells handling
Change-Id: Id0ff78ce51fb64065c2a6398115e3a3dd12693da
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4658
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-01-26 00:06:28 +00:00
David Karoly 9a573968a2 boot/efi/arm: use insert_address_range for virtual_ranges_to_keep
Change-Id: Iaf67838e8ef3d9a9494791945bd777b92315a948
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4877
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-25 11:39:14 +00:00
David Karoly cc69b20bb1 boot/efi/arm: move arch_enter_kernel to identity mapped region
First try to allocate a page below 2GB.

If it fails, try to allocate a physical page at the address
returned by get_next_virtual_address so that we get an address
that is available in both virtual and physical space.

Finally try to allocate any available page. At this point
it's highly likely that it will be above 0x88000000 so it can be
used for trampoline code.

Change-Id: I3100a3e09efcd938bc630a52dcce74dc5f24beb5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4878
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-23 08:50:46 +00:00
David Karoly b57ffe4006 kernel/arm/paging: zero out the bottom portion of the new pgdir
Change-Id: I899f288f451dd4c413403cd0e14a855f68355050
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4866
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-23 08:50:46 +00:00
David Karoly 933430df22 boot/efi/arm: remove identity mapping for EFI code and data segments
All the regions allocated via platform_allocate_region() are mapped to a
high virtual address so there's no need to do identity mapping for them
any more.

Copy kernel_args to a region allocated via platform_allocate_region() so it
will be mapped similarly.

Identity mapping is still needed for trampoline code for jumping to the kernel

Change-Id: I844a7a789b440a38521db49adc077bb77e658ddf
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4865
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-23 08:50:46 +00:00
David Karoly 01cb3ed58e boot/efi: add stubs for x86
Change-Id: I8d3dfa7cc07679a8b024df24f7cddb3a5bcec02c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4747
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-01-17 16:04:47 +00:00
David Karoly 31f5f4d339 boot/efi/arm: remove identity mapping of EFI runtime services
EFI runtime service memory areas are remapped to a high virtual address
allocated with get_next_virtual_address() to avoid any address space
collision.

They are also added to virtual_ranges_to_keep so that the kernel knows
that these ranges should be reserved.

Change-Id: I63e1a2450fceff3b2404154907a2cf59dd1b373b
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4863
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-01-13 22:43:32 +00:00
David Karoly a7c69a4b1f boot/efi/arm: remove identity mapping of initial page tables
Change-Id: I37cb756c32e05a585ff224c1e48d1a40c83e5e2e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4858
Reviewed-by: Adrien Destugues <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-01-13 22:43:32 +00:00
David Karoly 9103470bd3 kernel/arm: don't require identity mapping of initial page tables
Remove the dependency on identity mapping for the initial page tables
used in MapEarly / _EarlyQuery.

The initial page tables have to satisfy the following conditions instead:
* the inital page tables shall be allocated in the same region as the initial page directory
* this region shall be mapped contiguously
* the page tables shall be mapped at a higher address than the page directory

Change-Id: I34854ef93826aa48f5d90582b52905e553f3d275
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4857
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-13 22:43:32 +00:00
David Karoly dc3e1761e6 docs/arm: remove TODO item for serial port mapping
UART is mapped to kernel virtual address range since commit f5f10a9ec
so it does not overlap with user address range any more.

Change-Id: If8e18904fcddcbef1ccdc91e526d0e581f61e085
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4856
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
2022-01-12 12:21:11 +00:00
David Karoly 4ddb4993c8 kernel/x86: fix HPET ACPI table alignment
vendor_id shall come after the bitfields

Move hpet_address to separate struct definition so we can apply
the correct packed flags.

see also: https://wiki.osdev.org/HPET

Change-Id: Iced005846fedd4b895910e9b61137d5349db5b41
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4859
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
2022-01-12 12:20:25 +00:00
David Karoly ddb70de4d2 kernel/x86/hpet: fix build with TRACE enabled
Change-Id: I8b1d8f0e8ba7e800fe458135197080617be731bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4860
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Jérôme Duval <[email protected]>
2022-01-11 21:45:01 +00:00
David Karoly 6f62f45641 boot/efi/arm: initialize TTBCR when starting the kernel
Change-Id: I5ecaa0a91c8677f7d1ac6a512de6de8b2eaa597c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4852
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-01-08 17:58:29 +00:00
David Karoly 023a36024d boot/efi: introduce arch_dtb
Change-Id: Iff9e4198aca706097889faf51e9559fe551126ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4782
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Alex von Gluck IV <[email protected]>
2022-01-05 16:22:35 +00:00
David Karoly fbc211a255 efi: fix alignment for block device protocol
efi_block_io_media struct needs padding on x86.
uint64_t is aligned on 4 bytes in Haiku toolchain for 32-bit EFI loader.
But the EFI firmware expects it to be aligned on 8 bytes.

Same padding in u-boot:
https://github.com/u-boot/u-boot/blob/v2021.10/include/efi_api.h#L638

and in Illumos:
https://github.com/illumos/illumos-gate/commit/feff18a41e45afb02478e67d56fad5027334f115

Change-Id: I1b95cbe4cc1e7d96fde3ba52862a05f8a94aab79
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4840
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-01-04 17:56:41 +00:00
David Karoly 6117e0c29c boot/loader: relocate kernel to virtual address space on 32-bit architectures
Change-Id: Ic86ca6874f358df8755a0c691cccb155d145e06c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4675
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Fredrik Holmqvist <[email protected]>
2022-01-01 11:35:28 +00:00