mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 16:52:14 +02:00
p2sb: Add a method to hide the bus
The P2SB bus needs to be hidden in some cases so that it does not get auto-configured by Linux. Add a method for this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com> Tested-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
This commit is contained in:
@@ -18,6 +18,16 @@
|
|||||||
|
|
||||||
#define PCR_COMMON_IOSF_1_0 1
|
#define PCR_COMMON_IOSF_1_0 1
|
||||||
|
|
||||||
|
int p2sb_set_hide(struct udevice *dev, bool hide)
|
||||||
|
{
|
||||||
|
struct p2sb_ops *ops = p2sb_get_ops(dev);
|
||||||
|
|
||||||
|
if (!ops->set_hide)
|
||||||
|
return -ENOSYS;
|
||||||
|
|
||||||
|
return ops->set_hide(dev, hide);
|
||||||
|
}
|
||||||
|
|
||||||
void *pcr_reg_address(struct udevice *dev, uint offset)
|
void *pcr_reg_address(struct udevice *dev, uint offset)
|
||||||
{
|
{
|
||||||
struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
|
struct p2sb_child_platdata *pplat = dev_get_parent_platdata(dev);
|
||||||
|
@@ -31,13 +31,36 @@ struct p2sb_uc_priv {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct p2sb_ops - Operations for the P2SB (none at present)
|
* struct p2sb_ops - Operations for the P2SB
|
||||||
*/
|
*/
|
||||||
struct p2sb_ops {
|
struct p2sb_ops {
|
||||||
|
/**
|
||||||
|
* set_hide() - Set/clear the 'hide' bit on the p2sb
|
||||||
|
*
|
||||||
|
* This device can be hidden from the PCI bus if needed. This method
|
||||||
|
* can be called before the p2sb is probed.
|
||||||
|
*
|
||||||
|
* @dev: P2SB device
|
||||||
|
* @hide: true to hide the device, false to show it
|
||||||
|
* @return 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int (*set_hide)(struct udevice *dev, bool hide);
|
||||||
};
|
};
|
||||||
|
|
||||||
#define p2sb_get_ops(dev) ((struct p2sb_ops *)(dev)->driver->ops)
|
#define p2sb_get_ops(dev) ((struct p2sb_ops *)(dev)->driver->ops)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* p2sb_set_hide() - Set/clear the 'hide' bit on the p2sb
|
||||||
|
*
|
||||||
|
* This device can be hidden from the PCI bus if needed. This method
|
||||||
|
* can be called before the p2sb is probed.
|
||||||
|
*
|
||||||
|
* @dev: P2SB device
|
||||||
|
* @hide: true to hide the device, false to show it
|
||||||
|
* @return 0 if OK, -ve on error
|
||||||
|
*/
|
||||||
|
int p2sb_set_hide(struct udevice *dev, bool hide);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pcr_read32/16/8() - Read from a PCR device
|
* pcr_read32/16/8() - Read from a PCR device
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user