13 Feb, 2020
1 commit
-
Currently the size of pci_addr_t and pci_size_t depends on
CONFIG_SYS_PCI_64BIT. For qemu_arm64_defconfig with 4 GiB RAM this leads
to an errorpci_hose_phys_to_bus: invalid physical address
which is due to the truncation of the bus address in _dm_pci_phys_to_bus.
Defining CONFIG_SYS_PCI_64BIT is not a solution as this results in an error
PCI: Failed autoconfig bar 10
So let's use unsigned long for pci_addr_t and pci_size_t if
CONFIG_SYS_PCI_64BIT is not defined.Considering that 32bit U-Boot is used to launch some 64bit x86 systems we
cannot do without CONFIG_SYS_PCI_64BIT requiring u64 as type.Signed-off-by: Heinrich Schuchardt
Reviewed-by: Simon Glass
06 Feb, 2020
2 commits
-
Tidy up a few places where const * should be used.
Signed-off-by: Simon Glass
-
At present this method uses a non-const udevice pointer, but the call
should not modify the device. Use a const pointer.Signed-off-by: Simon Glass
15 Dec, 2019
2 commits
-
Early in boot it is necessary to decode the PCI device/function values for
particular peripherals in the device tree or of-platdata. This is needed
in TPL where CONFIG_PCI is not defined.To handle this, move pci_get_devfn() into a file that is built even when
CONFIG_PCI is not defined.Also add a function for use by of-platdata, to convert a reg property to
a pci_dev_t.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
At present PCI auto-configuration happens in U-Boot both before and after
relocation. This is a waste of time and may mess up static addresses used
in board_init_f(). Adjust the code to supporting doing auto-configuration
once, after relocation, under control of a device-tree property.This is needed for Apollo Lake for debugging the silicon-init code. Once
the UART is moved to a different MMIO address the debug UART does not work
and any debug output in Apollo Lake's arch_fsp_init_r() causes a hang.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
11 Oct, 2019
1 commit
-
Add a field to the PCI emulator per-device data which records which device
is being emulated. This is useful when the emulator needs to check the
device for something.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng
[bmeng: rebase the patch against u-boot-x86/master to get it applied cleanly]
Signed-off-by: Bin Meng
08 Oct, 2019
3 commits
-
Fix these spelling errors the header file and documentation.
Fix a small typo in the PCI documentation.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
This function is useful in PCI emulators. More it into the header file to
avoid duplicating it in other drivers.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
This method is not used anymore since the bus/device/function of PCI
devices can be obtained from their (parent's per-child) platform data.
Drop it.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
11 Jul, 2019
3 commits
-
Adds dm_pci_flr API that issues a Function Level reset on a PCI-e function,
if FLR is supported.Signed-off-by: Alex Marginean
Reviewed-by: Bin Meng -
Makes dm_pci_map_bar API available for integrated PCI devices that
support Enhanced Allocation instead of the original PCI BAR mechanism.Signed-off-by: Alex Marginean
Reviewed-by: Bin Meng -
The comment now indicates that the input argument bar is a register offset,
not a BAR index.
It also mentions which BARs are supported for type 0/1 and that the
function can return 0 on error.Signed-off-by: Alex Marginean
Reviewed-by: Bin Meng
08 May, 2019
1 commit
-
This reverts commit aec4298ccb337106fd0115b91d846a022fdf301d.
Unfortunately this has a dramatic impact on the pre-relocation memory
used on x86 platforms (increasing it by 2KB) since it increases the
overhead for each PCI device from 220 bytes to 412 bytes.The offending line is in UCLASS_DRIVER(pci):
.per_device_auto_alloc_size = sizeof(struct pci_controller),
This means that all PCI devices have the controller struct associated
with them. The solution is to move the regions[] member out of the array,
makes its size dynamic, or split UCLASS_PCI into controllers and
non-controllers, as the comment suggests.For now, revert the commit to get things running again.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
25 Apr, 2019
1 commit
-
Various minor sandbox iumprovements
Fixes for tracing with sandbox
Refactoring for boot_get_fdt()
24 Apr, 2019
2 commits
-
PCI_MSI_FLAGS_MASKBIT was missing from include file,
add it.Signed-off-by: Ramon Fried
Reviewed-by: Simon Glass -
If a platform defines CONFIG_NR_DRAM_BANKS, each DRAM bank will be added
as a PCI region. The number of MAX_PCI_REGIONS therefore needs to scale
with the number of DRAM banks, otherwise we will end up with too little
space in the hose->regions array to store all system memory regions.Signed-off-by: Thierry Reding
Reviewed-by: Simon Glass
23 Mar, 2019
1 commit
-
This patch adds a comment to the header with the PCI_foo macros related
to DEVFN to explain the difference in U-Boot vs Linux.Signed-off-by: Stefan Roese
Cc: Simon Glass
Cc: Bin Meng
Reviewed-by: Simon Glass
20 Feb, 2019
2 commits
-
This is platdata, not private data, so the comment is currently incorrect.
Fix it to avoid confusion.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
This function is not used outside this file so make it static.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
05 Feb, 2019
1 commit
-
This function will be used by the Marvell Armada XP/38x PCIe driver,
which is moved to DM right now. So let's extract the functionality
from pci_uclass_child_post_bind() to make it available.Signed-off-by: Stefan Roese
Reviewed-by: Simon Glass
Reviewed-by: Bin Meng
15 Nov, 2018
1 commit
-
This introduces two new APIs dm_pci_find_next_capability() and
dm_pci_find_next_ext_capability() to get PCI capability address
and PCI express extended capability address for a given PCI device
starting from a given offset.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
08 Aug, 2018
4 commits
-
This introduces two new APIs dm_pci_find_capability() and
dm_pci_find_ext_capability() to get PCI capability address and
PCI express extended capability address for a given PCI device.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass -
Currently we don't have a complete list of capability and extended
capability ids. This adds them.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass -
At present all emulated sandbox pci devices must be present in the
device tree in order to be used. The real world pci uclass driver
supports pci device driver matching, and we should add such support
on sandbox too.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass -
These macros should not be put in the generic pci.h header file.
Since they are not referenced anywhere, remove them completely.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
27 May, 2018
2 commits
-
Add a doc comment for pciauto_region_allocate().
Signed-off-by: Tuomas Tynkkynen
Reviewed-by: Simon Glass -
Currently, if we happen to allocate an address requiring 64 bits to a
device only supporting 32-bit BARs, the address eventually gets silently
truncated to 32 bits. Avoid this by adding a new flag to
pciauto_region_allocate() to bail out in such situations.Signed-off-by: Tuomas Tynkkynen
Reviewed-by: Simon Glass
07 May, 2018
1 commit
-
When U-Boot started using SPDX tags we were among the early adopters and
there weren't a lot of other examples to borrow from. So we picked the
area of the file that usually had a full license text and replaced it
with an appropriate SPDX-License-Identifier: entry. Since then, the
Linux Kernel has adopted SPDX tags and they place it as the very first
line in a file (except where shebangs are used, then it's second line)
and with slightly different comment styles than us.In part due to community overlap, in part due to better tag visibility
and in part for other minor reasons, switch over to that style.This commit changes all instances where we have a single declared
license in the tag as both the before and after are identical in tag
contents. There's also a few places where I found we did not have a tag
and have introduced one.Signed-off-by: Tom Rini
20 Mar, 2018
1 commit
-
ppc4xx support was removed some time ago. Lets remove the now unused
"pci_fb" variable from "struct pci_controller" as well.Signed-off-by: Stefan Roese
Cc: Bin Meng
Cc: Simon Glass
06 Oct, 2017
1 commit
-
This sort of pattern for implementing memory-mapped PCI config space
accesses appears in U-Boot twice already, and a third user is coming up.
So add helper functions to avoid code duplication, similar to how Linux
has pci_generic_config_write and pci_generic_config_read.Signed-off-by: Tuomas Tynkkynen
Reviewed-by: Bin Meng
31 May, 2017
1 commit
-
There is no dedicated reset signal wired up for the MX6QDL thus if the
bootloader enables the link we need some special handling to get the core
back into a state where it is safe to touch it for configuration.While there has been some special handling in the Linux kernel to do this,
it was removed in 4.11 thus we need to do it properly in the bootloader
and therefore without this if you enable PCI in the bootloader you will hang
while booting the 4.11 kernel.This puts the PCIe controller back into a safe state for the kernel driver
before launching the kernel.Signed-off-by: Tim Harvey
Reviewed-by: Fabio Estevam
Tested-by: Peter Senna Tschudin
22 Mar, 2016
1 commit
-
Put pci_get_hose_head() prototype in header so it is available to
external users, allowing them to find and iterate over all pci
controllers.Signed-off-by: Stuart Yoder
Reviewed-by: York Sun
17 Mar, 2016
2 commits
-
Two comments are missing a parameter and there is an extra blank line. Also
two of the region access macros are misnamed. Correct these problems.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
It is common to read a config register value, clear and set some bits, then
write back the updated value. Add functions to do this in one step, for
convenience.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
05 Feb, 2016
1 commit
-
When CONFIG_DM_PCI_COMPAT is not on, there is only a forward declaration
for pci_write_config32(). Add other missing ones.Signed-off-by: Bin Meng
Reviewed-by: Simon Glass
24 Jan, 2016
1 commit
-
Add a driver-model version of the pci_write_bar32 function so that this is
supported in the new API.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
13 Jan, 2016
4 commits
-
We should use the new address mapping functions unless we are in
compatibility mode. Disable the old functions by default.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
At present the PCI address map functions use the old API. Add new functions
for this so that drivers can be converted.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
Add a driver-model function for reading the PCI BAR from a device.
Signed-off-by: Simon Glass
Reviewed-by: Bin Meng -
Add a function which scans the driver model device information rather
than scanning the PCI bus again.Signed-off-by: Simon Glass
Reviewed-by: Bin Meng
Tested-by: Bin Meng