diff mbox series

[v1,31/43] x86: apl: Hide the p2sb on exit from U-Boot

Message ID 20200614215726.v1.31.I68d05c644cec1ef05b0845010253943c44385616@changeid
State Accepted
Commit 62fba44d6d331d8faa3389cd84c24212a2d69cf3
Headers show
Series x86: Programmatic generation of ACPI tables (Part C) | expand

Commit Message

Simon Glass June 15, 2020, 3:57 a.m. UTC
This confuses Linux's PCI probing so needs to be hidden when booting
Linux. Add a remove() method to handle this.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

 arch/x86/cpu/intel_common/p2sb.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Wolfgang Wallner June 23, 2020, 10:49 a.m. UTC | #1
Hi Simon,

> -----"Simon Glass" <sjg at chromium.org> schrieb: -----
> Betreff: [PATCH v1 31/43] x86: apl: Hide the p2sb on exit from U-Boot
> 
> This confuses Linux's PCI probing so needs to be hidden when booting
> Linux. Add a remove() method to handle this.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
>  arch/x86/cpu/intel_common/p2sb.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/arch/x86/cpu/intel_common/p2sb.c b/arch/x86/cpu/intel_common/p2sb.c
> index ebf8f62aea..361d4c90cb 100644
> --- a/arch/x86/cpu/intel_common/p2sb.c
> +++ b/arch/x86/cpu/intel_common/p2sb.c
> @@ -153,6 +153,17 @@ static int intel_p2sb_set_hide(struct udevice *dev, bool hide)
>  	return 0;
>  }
>  
> +static int p2sb_remove(struct udevice *dev)
> +{
> +	int ret;
> +
> +	ret = intel_p2sb_set_hide(dev, true);
> +	if (ret)
> +		return log_msg_ret("hide", ret);
> +
> +	return 0;
> +}
> +
>  static int p2sb_child_post_bind(struct udevice *dev)
>  {
>  #if !CONFIG_IS_ENABLED(OF_PLATDATA)
> @@ -183,9 +194,12 @@ U_BOOT_DRIVER(p2sb_drv) = {
>  	.id		= UCLASS_P2SB,
>  	.of_match	= p2sb_ids,
>  	.probe		= p2sb_probe,
> +	.remove		= p2sb_remove,
> +	.ops		= &p2sb_ops,

Nit: should this line be part of the previous patch?

>  	.ofdata_to_platdata = p2sb_ofdata_to_platdata,
>  	.platdata_auto_alloc_size = sizeof(struct p2sb_platdata),
>  	.per_child_platdata_auto_alloc_size =
>  		sizeof(struct p2sb_child_platdata),
>  	.child_post_bind = p2sb_child_post_bind,
> +	.flags		= DM_FLAG_OS_PREPARE,
>  };
> -- 
> 2.27.0.290.gba653c62da-goog

Reviewed-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>

Tested-by: Wolfgang Wallner <wolfgang.wallner at br-automation.com>
Tested on an Apollo Lake-based board.
Bin Meng June 30, 2020, 8:27 a.m. UTC | #2
On Mon, Jun 15, 2020 at 11:58 AM Simon Glass <sjg at chromium.org> wrote:
>
> This confuses Linux's PCI probing so needs to be hidden when booting
> Linux. Add a remove() method to handle this.
>
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
>
>  arch/x86/cpu/intel_common/p2sb.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn at gmail.com>
diff mbox series

Patch

diff --git a/arch/x86/cpu/intel_common/p2sb.c b/arch/x86/cpu/intel_common/p2sb.c
index ebf8f62aea..361d4c90cb 100644
--- a/arch/x86/cpu/intel_common/p2sb.c
+++ b/arch/x86/cpu/intel_common/p2sb.c
@@ -153,6 +153,17 @@  static int intel_p2sb_set_hide(struct udevice *dev, bool hide)
 	return 0;
 }
 
+static int p2sb_remove(struct udevice *dev)
+{
+	int ret;
+
+	ret = intel_p2sb_set_hide(dev, true);
+	if (ret)
+		return log_msg_ret("hide", ret);
+
+	return 0;
+}
+
 static int p2sb_child_post_bind(struct udevice *dev)
 {
 #if !CONFIG_IS_ENABLED(OF_PLATDATA)
@@ -183,9 +194,12 @@  U_BOOT_DRIVER(p2sb_drv) = {
 	.id		= UCLASS_P2SB,
 	.of_match	= p2sb_ids,
 	.probe		= p2sb_probe,
+	.remove		= p2sb_remove,
+	.ops		= &p2sb_ops,
 	.ofdata_to_platdata = p2sb_ofdata_to_platdata,
 	.platdata_auto_alloc_size = sizeof(struct p2sb_platdata),
 	.per_child_platdata_auto_alloc_size =
 		sizeof(struct p2sb_child_platdata),
 	.child_post_bind = p2sb_child_post_bind,
+	.flags		= DM_FLAG_OS_PREPARE,
 };