Commit Graph

180 Commits

Author SHA1 Message Date
skrll
094ec0db65 No need for PMAP_WRITE_BACK here (also aa32 pmap doesn't know about it) 2020-12-17 08:47:18 +00:00
skrll
69120ac14e Provide and use a sev() macro for the sev instruction.
While here use the correct barrier to ensure completion of memory accesses
before a couple of the sev() calls.
2020-12-03 07:45:51 +00:00
jmcneill
47fa0c3be8 Add support for message-based interrupts. 2020-11-25 21:02:35 +00:00
jmcneill
2deab200b0 Fix off-by-one when printing the range of SPIs in a GICv2m frame 2020-11-25 20:59:20 +00:00
skrll
62f6b38b9d Fix comment. Spotted by jmcneill@ 2020-11-25 19:50:06 +00:00
jmcneill
74b8c61e26 Improve detection of NS vs S views of priorities.
For PMR, write a 0 to bit7 and see if it sticks. This is only possible from
NS EL1 if we have a non-secure view of ICC_PMR_EL1.

For int priorities (GICD/GICR interfaces and LPIs), assume that the
GICD_CTLR.DS bit is telling us the truth.

RK3399 is special here when using the vendor bootloader, so keep the
auto-detection from the previous commit but limit the scope to only run
on RK3399 SOCs.
2020-11-24 23:31:55 +00:00
rin
0c6587f823 Fix build for some arm32 kernels; arm_simplefb_reconfig() is used
only when NPCI > 0 && defined(PCI_NETBSD_CONFIGURE).
2020-10-21 11:06:13 +00:00
jmcneill
36ef29e801 Instead of trying to prevent pciconf from reconfiguring the firmware's
framebuffer, instead allow MD code to register callbacks. If a resource is
changed, the driver can unmap the old resource and remap the new. Do this
with simplefb so the console doesn't explode when the VGA device is
(potentially) reconfigured at boot.
2020-10-20 23:03:30 +00:00
rin
9047c5ea12 Fix colors of 32-bpp raster console for evbarm/aarch64eb and armeb.
Most boards are configured to little-endian in initial, and switched
to big-endian after kernel is loaded. In this case, framebuffer seems
byte-swapped to CPU.

It is best to reconfigure framebuffer (as done recently for sunxi_mixer
by jmcneill), but in most cases, HW is incapable, or we just don't know
register bits to configure them.

Therefore, override "format" FDT property for "simple-framebuffer" to
let drivers know byte-order for 32-bpp framebuffer.

Then, make fdt/simplefb (genfb) and arm_simplefb (early console) detect
byte-swapped FB, and configure genfb(4) or rasops(4) layers accordingly.

Tested on Pine A64+ (arm_simplefb) and Cubietruck (both fdt/simplefb and
arm_simplefb).

Discussed with jmcneill. Thanks!!
2020-10-19 01:12:14 +00:00
jmcneill
212af7edad Support using EFI runtime services for RTC when booting in devicetree mode. 2020-10-10 15:34:05 +00:00
jmcneill
2824038d80 Support early FB console attachment when booting with a devicetree
(non-ACPI mode). Inform the pciconf code about the framebuffer to
prevent pciconf from changing resources out from under us when framebuffer
memory is in VRAM.
2020-10-10 15:25:30 +00:00
jmcneill
ab8eeec969 Read the linux,pci-probe-only property from the /chosen node, not the PCI host controller node 2020-10-10 09:58:16 +00:00
jmcneill
c30892ca9f Get rid of a4x bus_space tag from fdtbus_attach_args. The only consumer
of this was various com(4) glue so modify all of that to use the new
com_init_regs_stride instead.
2020-09-28 11:54:22 +00:00
jmcneill
f32ed43c96 If acpi_probe() falis, just panic now instead of failing mysteriously later. 2020-09-15 10:33:58 +00:00
thorpej
ca8ce3aeb1 Overhaul the interface to pci_configure_bus():
- Don't expose how PCI bus configuration resource management is implemented.
  Provide a new resource provider API:

  ==> pciconf_resource_init() -- Initialize a PCI configuration resources
      container.
  ==> pciconf_resource_add() -- Add a PCI configuration resource to the
      container (I/O, MEM, or prefetchable MEM).  Multiple resources of
      each type may be added.
  ==> pciconf_resource_fini() -- Tear down the PCI configurtation resources
      container once the bus has been configured.

  This is much easier to use than the previous method of providing an
  extent map for each kind of resource, and works better for e.g. ACPI
  platforms that provide potentially multiple PCI resources in tables
  provided by firmware.

- Re-implement PCI configuration resource management using vmem arenas,
  rather than extent maps.
2020-07-07 03:38:45 +00:00
jmcneill
7df551d1f1 Add support for installing modules that were loaded by the bootloader. 2020-06-21 17:25:03 +00:00
chs
69a3e9b705 replace EX_NOWAIT with EX_WAITOK in device attach methods.
remove checks for failures that can no longer occur.
2020-06-14 01:40:02 +00:00
jmcneill
7af73871cf If enable-method is missing, try psci 2020-06-10 19:29:48 +00:00
skrll
c02d4e447c Improve a comment 2020-02-21 13:15:54 +00:00
skrll
e12811766a Various updates and improvements to cpu start up on arm/aarch64
- start sharing more code around the AP startup messaging.
- call arm_cpu_topology_set early so that ci_core_id is available for
  drivers, e.g. bcm2835_intr.c
- both arm and aarch64 now have
  - a static cpu_info_store array
  - the same arm_cpu_{hatched,mbox}
2020-02-15 08:16:10 +00:00
jmcneill
74b8f33291 Match any node with device_type = "cpu" 2020-01-27 23:26:15 +00:00
skrll
5776f3ebc7 Wrap a long line 2020-01-25 18:21:37 +00:00
jmcneill
6f25f8641b Add support for Arm N1 SDP PCIe host controller.
The N1 SDP has a few bugs that we need to work around:
 - PCIe root port config space lives in a non-standard location.
 - Access to PCIe config space of devices that do not exist results in
   an sync SError. Firmware creates a "known devices" table at a fixed
   physical address that we use to filter PCI conf access to only known
   devices.

This change splits the Arm ACPI PCI quirks into separate files for each
host controller, and allows per-segment quirks to be applied.

These changes exposed some bugs in the MI ACPI layer related to
multi-segment support. The MI ACPI PCI code was using a shared PCI
chipset tag to access devices, and these accesses can happen before our
PCI host bridge drivers are attached! The global chipset tag is now gone,
and an MD callback can provide a custom tag on a per-segment basis.
2020-01-17 17:06:32 +00:00
mrg
b0829efdba provide some semblance of valid cpu topology for big.little systems.
while attaching cpus, if the FDT provides "capacity-dmips-mhz" track
the fastest set, and call cpu_topology_set() with slow=true for any
cpus that are not the fastest.

bug fix for cpu_topology_set(): actually set ci_is_slow for slow cpus.

with this change, and -current's recent scheduler changes, this means
that long running processes run on the faster cores.  on RK3399 based
systems, i am seeing 20-50% speed ups for many tasks.


XXX: all this can be made common with armv7 big.little.
2020-01-12 09:29:18 +00:00
skrll
58bc939070 Fix arm __HAVE_PREEMPTION build
__HAVE_PREEMPTION requires TPIDRPRW_IS_CURLWP and curcpu is defined as

#define	curcpu()	lwp_getcpu(_curlwp())
2020-01-07 10:20:07 +00:00
skrll
cebe7b6075 oops more KNF 2020-01-07 10:01:09 +00:00
skrll
f8a0ef89ff KNF 2020-01-07 09:57:10 +00:00
skrll
c50621f3aa arm_platform requires gtmr and psci. Should fix build failures. 2020-01-07 08:22:23 +00:00
skrll
d8f0d2b319 Fix DEVMAP build losage by reducing diffs between arm and aarch64
*sigh*
2020-01-06 08:29:08 +00:00
jmcneill
6080e166e9 Make the generic Arm platform available for arm32 as well. 2020-01-05 17:26:31 +00:00
jmcneill
bb20cf2b6c Use arm_fdt_cpu_bootstrap 2020-01-05 17:20:01 +00:00
jmcneill
4417f2e219 Add a generic Arm64 platform definition that is used as a fallback.
The generic platform assumes PSCI, a generic timer, pre-initialized UART
clocks, and adds a 4KB entry to the devmap for the console UART device.
2020-01-05 17:16:07 +00:00
jmcneill
3d25b0def2 Allow MD code to provide custom bus_dma tags on a per-node basis. On Arm
this is required to return non-coherent bus_dma tags for device nodes with
_CCA=0
2019-12-29 23:47:56 +00:00
jmcneill
059f233a4a Do not use Early Write Acknowledge for PCIe I/O and config space. 2019-12-28 17:19:43 +00:00
skrll
a4cf85ef47 Remove unnecessary cast and wrap a long line. 2019-11-24 11:10:12 +00:00
jmcneill
b2da2235c6 Match smsc,lan9115 and honour local-mac-address/mac-address properties 2019-11-03 12:06:32 +00:00
bad
11c39ba555 fix typos in comment in previous. 2019-11-01 13:22:08 +00:00
bad
f72c8a3ceb re-apply r1.26. but only #if !defined(AARCH64).
not necessary on armv8 and cache ops are not available that early there.
2019-11-01 12:44:54 +00:00
jmcneill
29224e5ead Increase aarch64 MAXCPUS to 256. 2019-10-19 18:04:26 +00:00
bad
64f68ffbad back out r1.26. it makes the pinebook fail to boot. 2019-10-17 21:52:26 +00:00
bad
3033929fb4 flush the dcache in cpu_enable_psci() before calling psci_cpu_on().
fixes the kernel hanging with multiple "mpstart" on (at least) NanoPi R1.

OK jmcneill@, skrll@

XXX pullup-9
2019-10-15 17:25:02 +00:00
skrll
3f3994cb0c Add a driver for the A5/A9 Private timer.
While here FDTise the Watchdog driver.
2019-08-10 17:03:59 +00:00
jmcneill
146d8d9cef Add support for WSDISPLAY_MULTICONS 2019-07-23 12:34:05 +00:00
hkenken
64d2f95e5c Fixed compile error. 2019-07-19 12:14:15 +00:00
jmcneill
8255efda83 If panel timings are missing, assume 800x600 2019-07-06 15:53:38 +00:00
jmcneill
8a273b316a Add support for multiple PMUs 2019-06-29 12:53:05 +00:00
jmcneill
5966f2f487 Use ARM_PCI_INTR_* definitions from pci_machdep.h instead of own copies 2019-06-23 22:06:03 +00:00
jmcneill
4ed488bfc3 Finish the job 2019-06-22 19:47:27 +00:00
jakllsch
088c49a92b Restore previous range of aa_dmat.
Should fix ahcisata_acpi on OverDrive 1000, which has no DRAM below 4GiB.
2019-06-22 17:57:10 +00:00
jmcneill
e85f76fe51 Provide a 64-bit dma tag and use a coherent tag unless CCA=0 2019-06-19 13:39:18 +00:00