mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
dm: sandbox: pci: Add PCI support for sandbox
Add the required header information, device tree nodes and I/O accessor functions to support PCI on sandbox. All devices are emulated by drivers which can be added as required for testing or development. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
ff3e077bd2
commit
9569c40668
9 changed files with 284 additions and 7 deletions
|
@ -27,4 +27,52 @@ int cleanup_before_linux(void);
|
|||
/* drivers/video/sandbox_sdl.c */
|
||||
int sandbox_lcd_sdl_early_init(void);
|
||||
|
||||
/**
|
||||
* pci_map_physmem() - map a PCI device into memory
|
||||
*
|
||||
* This is used on sandbox to map a device into memory so that it can be
|
||||
* used with normal memory access. After this call, some part of the device's
|
||||
* internal structure becomes visible.
|
||||
*
|
||||
* This function is normally called from sandbox's map_sysmem() automatically.
|
||||
*
|
||||
* @paddr: Physical memory address, normally corresponding to a PCI BAR
|
||||
* @lenp: On entry, the size of the area to map, On exit it is updated
|
||||
* to the size actually mapped, which may be less if the device
|
||||
* has less space
|
||||
* @devp: Returns the device which mapped into this space
|
||||
* @ptrp: Returns a pointer to the mapped address. The device's space
|
||||
* can be accessed as @lenp bytes starting here
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int pci_map_physmem(phys_addr_t paddr, unsigned long *lenp,
|
||||
struct udevice **devp, void **ptrp);
|
||||
|
||||
/**
|
||||
* pci_unmap_physmem() - undo a memory mapping
|
||||
*
|
||||
* This must be called after pci_map_physmem() to undo the mapping.
|
||||
*
|
||||
* @paddr: Physical memory address, as passed to pci_map_physmem()
|
||||
* @len: Size of area mapped, as returned by pci_map_physmem()
|
||||
* @dev: Device to unmap, as returned by pci_map_physmem()
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int pci_unmap_physmem(const void *addr, unsigned long len,
|
||||
struct udevice *dev);
|
||||
|
||||
/**
|
||||
* sandbox_set_enable_pci_map() - Enable / disable PCI address mapping
|
||||
*
|
||||
* Since address mapping involves calling every driver, provide a way to
|
||||
* enable and disable this. It can be handled automatically by the emulator
|
||||
* uclass, which knows if any emulators are currently active.
|
||||
*
|
||||
* If this is disabled, pci_map_physmem() will not be called from
|
||||
* map_sysmem().
|
||||
*
|
||||
* @enable: 0 to disable, 1 to enable
|
||||
*/
|
||||
void sandbox_set_enable_pci_map(int enable);
|
||||
|
||||
#endif /* _U_BOOT_SANDBOX_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue