262888 Commits

Author SHA1 Message Date
martin
13376b1dc9 Make the debug version compilable with modern gcc.
Do debugging for system(3) calls only when DEBUG_SYSTEM is defined.
2018-11-02 18:07:33 +00:00
jmcneill
99199cfc78 Add support for multiple PCI segments. 2018-11-02 15:01:18 +00:00
maya
23daea6f61 Keep up with pci_intr_handle_t type change in printf. 2018-11-02 13:46:24 +00:00
maxv
905aba58c9 Add LIST_INIT for filehead. 2018-11-02 12:27:47 +00:00
maxv
038a8e9aad no, should be dst 2018-11-02 11:59:59 +00:00
maxv
7c827ea236 Don't overflow on the strings we read. Introduce db_read_string(), which
stops on '\0'. Probably this doesn't matter a lot because the read is
supposed to be safe, but let's not have bugs in the debugger.

Detected by kASan, via skrll@ on aarch64, by typing "ps/l" on DDB.
2018-11-02 08:59:59 +00:00
msaitoh
cf0d79d0d2 KNF a bit. No functional change. 2018-11-02 08:26:32 +00:00
skrll
642c61d6f3 Provide a kasan_md_unwind
OK maxv
2018-11-02 08:18:18 +00:00
msaitoh
b56422493e - Add missing wm_gate_hw_phy_config_ich8lan(false) in wm_phy_post_reset()
on PCH2. wm_gate_hw_phy_config_ich8lan(true) is called in wm_reset(), so
  wm_phy_post_reset(false) should be called after reset.
- On PCH2, set the phy config counter to 50msec after (PHY) reset.
2018-11-02 08:16:49 +00:00
msaitoh
95edfe2e12 After writing MDIC register, don't read quickly the same register but
do delay(50). Same as otehr OSes.
2018-11-02 08:09:21 +00:00
msaitoh
ecdc3acb8c Fix a PCH2 specific bug that wrong register value can be read when boot.
When a wrong value is read when boot, the read device ID was incorrect and
ukphy(3) is attached instead of ihphy(4). The bug might also result in
MDIC read/write error.

 How to reproduce:

  0) Boot Windows.
  1) Leave some minutes.
  2) Reboot to NetBSD.

 To fix this problem, adding extra 100us delay at the end of
wm_gmii_mdic_{read,write}reg() on PCH2. Same as FreeBSD and linux.

 Reported by David Brownlee a few days ago and also reported by jmcneill
a half year ago. Tested with my own Thinkpad X220.

XXX pullup-[78]
2018-11-02 08:04:42 +00:00
blymn
e3b169cf11 Remove obsolete clauses from copyright block. Original copyright was
mine so should be ok to do.
2018-11-02 04:17:39 +00:00
msaitoh
a247df1640 Add workaround for DMA hang problem which result in TX device timeout on
PCH_LPT with I218. Same as FreeBSD and Linux. This woraround is only for
device ID 0x155a, 0x15a2, 0x1559 and 0x15a3. I observed this problem on my
Shuttle DS57U's I218 port six times in two months.
2018-11-02 03:22:19 +00:00
jmcneill
52f8d5e713 Add a "mem" command to print the EFI memory map. 2018-11-02 01:22:39 +00:00
maxv
ed955d8181 Add kASan support for aarch64. Stack tracking needs more investigation
and will come in a separate commit.

Reviewed by ryo@ jmcneill@ skrll@.
2018-11-01 20:34:49 +00:00
christos
550b2e0609 Disable {send,recv}mmsg until we make our syscalls not have "sticky" errors. 2018-11-01 19:11:31 +00:00
skrll
d71785d000 Add GENERIC to big-endian KERNEL_SETS 2018-11-01 18:23:25 +00:00
skrll
16ef8eff9d Fix non-DIAGNOSTIC build 2018-11-01 16:14:54 +00:00
jmcneill
453e6ce9bc Support for "opp-microvolt" with more than one cell 2018-11-01 14:47:36 +00:00
martin
e6adeb2500 Add bwfm at pci 2018-11-01 13:11:11 +00:00
martin
11b42c22e2 Make this compilable with 32bit paddr_t. 2018-11-01 13:09:35 +00:00
skrll
76478902d7 Use the GENERIC kernel where possible in armv7.img and remove the old
kernels from the bulid for SUNXI and TEGRA.

While I'm here disable *_INSTALL kernel builds for boards supported by
armv7.img
2018-11-01 11:05:24 +00:00
jmcneill
32eec71f56 Fix previous 2018-11-01 10:48:48 +00:00
jmcneill
8e63a218ff Fix partial overlap logic. PR# port-evbarm/53693 2018-11-01 10:21:41 +00:00
mrg
d89d4475a3 compare matching TG1 bits.
aarch64 crash dump kvtop now less broken, but still not stable.
2018-11-01 05:37:11 +00:00
msaitoh
055f8b85fb Decode CSRT (Core System Resources Table). 2018-11-01 03:08:46 +00:00
jmcneill
f283cd5eac Add support for auto-selection of GPT root devices 2018-11-01 00:44:06 +00:00
jmcneill
92efcce76c Add GPT support. 2018-11-01 00:43:38 +00:00
jmcneill
be34f078ca No need to re-print the countdown timer if the number of seconds hasn't changed. 2018-10-31 23:49:34 +00:00
mrg
ca08a0c2e1 extend "smart status" command to "smart status [vendor]", and supply a
"Micron" (for Micron/Crucial) list with their documented values.

this allows the vendor-specific data to be used.

there appears to be no simple way to automatically determine the right
vendor to use -- identify data seems to be the only obvious way and
that data can be and is changed by OEMs.  (eg, a disk may be listed as
being "dell", but dell don't make disks.)  as such, no attempt is made
to automatically determine if a vendor list should be used.
2018-10-31 20:00:56 +00:00
maxv
9410d7cf18 Revert my kasan addition in this makefile, it looks like it causes
asan.h to be installed, while we don't want it to be.
2018-10-31 18:35:04 +00:00
jmcneill
469d7fa1bc Add MSI-X support. 2018-10-31 16:11:29 +00:00
jmcneill
3dd998f940 Add MSI-X support. 2018-10-31 15:43:19 +00:00
jmcneill
8537f7783f Add MSI-X support 2018-10-31 15:42:36 +00:00
jmcneill
1ddc0ea041 Add MSI-X support. 2018-10-31 15:42:17 +00:00
jmcneill
86955039b0 EFI runtime code section needs to be writable, otherwise we fail with a permission fault at shutdown on QEMU when writing to the RTC 2018-10-31 14:15:12 +00:00
jmcneill
77af45ad47 Implement parse_mi_bootargs for aarch64 2018-10-31 13:42:24 +00:00
jmcneill
97044f64fa Use PRIx64 to print uint64_t 2018-10-31 13:37:35 +00:00
jmcneill
77a6cf4b9b Setup mappings for EFI runtime mmio ranges. 2018-10-31 13:01:48 +00:00
jmcneill
1cd5b4302b Assign VAs for EFI runtime mmio ranges 2018-10-31 13:00:35 +00:00
jmcneill
33c6bbfd0f When building /memory, skip EFI runtime memory ranges 2018-10-31 12:59:43 +00:00
skrll
44c3537404 Tidyup VERBOSE_INIT_ARM output 2018-10-31 09:31:01 +00:00
skrll
1f664ade34 Fix VERBOSE_INIT_ARM build 2018-10-31 09:15:25 +00:00
jmcneill
a6043900cb No longer need to delete reserved memory ranges. 2018-10-31 09:13:32 +00:00
skrll
06d47151af Fix non-DIGNOSTIC builds 2018-10-31 08:41:47 +00:00
skrll
dcb7cd7c66 Turn off DIAGNOSTIC and DEBUG by default 2018-10-31 08:10:01 +00:00
ryo
3abdc6b2fd invalidate icache correctly.
l3pte_executable() should be used for only valid pte.
2018-10-31 06:36:19 +00:00
maxv
790d0b797c Move the MI parts of KASAN into kern/subr_asan.c. This file includes
machine/asan.h, which contains the MD functions. We use an include rather
than a plain C file, because we want GCC to optimize/inline some functions
into one single block.

The amd64 MD parts of KASAN are moved accordingly.

The naming convention we use is:

	kasan_*
		a generic kasan object, declared in subr_asan.c
	kasan_md_*
		an MD kasan object, declared in machine/asan.h, and used
		in subr_asan.c
	__md_*
		an MD object, declared in machine/asan.h, and not used
		outside

Overall this makes it easier to add KASAN support on more architectures.

Discussed with several people.
2018-10-31 06:26:25 +00:00
msaitoh
c893fecee0 - 82574 and newer's document says the status field has neither EC
(Excessive Collision) bit nor LC (Late Collision) bit (reserved).
  Refer "PCIe GbE Controller Open Source Software Developer's Manual",
  82574 datasheet and newer.

  XXX I saw the LC bit was set on I218 even though the media was full duplex,
  so the bit might be used for other meaning ...(I have no document).
- Use macro.
2018-10-31 06:04:48 +00:00
jmcneill
6867029f18 Fail gracefully when an attempt to allocate MSI vectors is made on a device
without MSI capabilities.
2018-10-30 23:59:47 +00:00