Skip to content
Commit c1b1263b authored by Phil Sutter's avatar Phil Sutter Committed by Stefan Roese
Browse files

pci: Make auto-config code a little more robust



On my DS414, some PCI devices return odd values when probing BAR sizes.
An obvious case is all-ones response, the Linux driver
(drivers/pci/probe.c) catches those explicitly and a comment explains
that either bit 0 or bit 1 must be clear (depending on MEM or IO type).
Other BARs return e.g. 0xfff0000f or 0xfff00004 and thus manage to break
size calculation due to the "middle" zeroes. Mitigate that copying more
or less what Linux does and do a "find least bit set".

Signed-off-by: default avatarPhil Sutter <phil@nwl.cc>
Reviewed-by: default avatarStefan Roese <sr@denx.de>
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
parent 7d3c6c6e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment