All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding
@ 2021-01-14 17:53 Rafał Miłecki
  2021-01-14 17:53 ` [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support Rafał Miłecki
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Rafał Miłecki @ 2021-01-14 17:53 UTC (permalink / raw)
  To: Florian Fainelli, Rob Herring
  Cc: Philipp Zabel, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson,
	devicetree, bcm-kernel-feedback-list, linux-kernel,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

PMB can be also found on bcm63xx chipsets. It uses difference device
addresses so a new binding is required.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml b/Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml
index 40b08d83c80b..f8e7ddbd2705 100644
--- a/Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml
+++ b/Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml
@@ -16,6 +16,7 @@ properties:
   compatible:
     enum:
       - brcm,bcm4908-pmb
+      - brcm,bcm63138-pmb
 
   reg:
     description: register space of one or more buses
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support
  2021-01-14 17:53 [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rafał Miłecki
@ 2021-01-14 17:53 ` Rafał Miłecki
  2021-03-13 17:57   ` Florian Fainelli
  2021-01-25 21:48 ` [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rob Herring
  2021-03-13 17:57 ` Florian Fainelli
  2 siblings, 1 reply; 5+ messages in thread
From: Rafał Miłecki @ 2021-01-14 17:53 UTC (permalink / raw)
  To: Florian Fainelli, Rob Herring
  Cc: Philipp Zabel, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson,
	devicetree, bcm-kernel-feedback-list, linux-kernel,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

BCM63138 has SATA controller that needs to be powered up using PMB.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
Florian: this is based on your patches
ARM: dts: BCM63xx: enable SATA PHY and AHCI controller
reset: bcm63xx: Add Broadcom BCM63138 reset controller driver

I didn't test it as I don't own any bcm63xx devices.
---
 drivers/soc/bcm/bcm63xx/bcm-pmb.c | 30 ++++++++++++++++++++++++++++++
 include/dt-bindings/soc/bcm-pmb.h |  1 +
 2 files changed, 31 insertions(+)

diff --git a/drivers/soc/bcm/bcm63xx/bcm-pmb.c b/drivers/soc/bcm/bcm63xx/bcm-pmb.c
index c223023dc64f..774465c119be 100644
--- a/drivers/soc/bcm/bcm63xx/bcm-pmb.c
+++ b/drivers/soc/bcm/bcm63xx/bcm-pmb.c
@@ -209,6 +209,28 @@ static int bcm_pmb_power_on_device(struct bcm_pmb *pmb, int bus, u8 device)
 	return err;
 }
 
+static int bcm_pmb_power_on_sata(struct bcm_pmb *pmb, int bus, u8 device)
+{
+	int err;
+
+	err = bcm_pmb_power_on_zone(pmb, bus, device, 0);
+	if (err)
+		return err;
+
+	/* Does not apply to the BCM963158 */
+	err = bcm_pmb_bpcm_write(pmb, bus, device, BPCM_MISC_CONTROL, 0);
+	if (err)
+		return err;
+
+	err = bcm_pmb_bpcm_write(pmb, bus, device, BPCM_SR_CONTROL, 0xffffffff);
+	if (err)
+		return err;
+
+	err = bcm_pmb_bpcm_write(pmb, bus, device, BPCM_SR_CONTROL, 0);
+
+	return err;
+}
+
 static int bcm_pmb_power_on(struct generic_pm_domain *genpd)
 {
 	struct bcm_pmb_pm_domain *pd = container_of(genpd, struct bcm_pmb_pm_domain, genpd);
@@ -222,6 +244,8 @@ static int bcm_pmb_power_on(struct generic_pm_domain *genpd)
 		return bcm_pmb_power_on_zone(pmb, data->bus, data->device, 0);
 	case BCM_PMB_HOST_USB:
 		return bcm_pmb_power_on_device(pmb, data->bus, data->device);
+	case BCM_PMB_SATA:
+		return bcm_pmb_power_on_sata(pmb, data->bus, data->device);
 	default:
 		dev_err(pmb->dev, "unsupported device id: %d\n", data->id);
 		return -EINVAL;
@@ -317,8 +341,14 @@ static const struct bcm_pmb_pd_data bcm_pmb_bcm4908_data[] = {
 	{ },
 };
 
+static const struct bcm_pmb_pd_data bcm_pmb_bcm63138_data[] = {
+	{ .name = "sata", .id = BCM_PMB_SATA, .bus = 0, .device = 3, },
+	{ },
+};
+
 static const struct of_device_id bcm_pmb_of_match[] = {
 	{ .compatible = "brcm,bcm4908-pmb", .data = &bcm_pmb_bcm4908_data, },
+	{ .compatible = "brcm,bcm63138-pmb", .data = &bcm_pmb_bcm63138_data, },
 	{ },
 };
 
diff --git a/include/dt-bindings/soc/bcm-pmb.h b/include/dt-bindings/soc/bcm-pmb.h
index 744dc3af4d41..385884468007 100644
--- a/include/dt-bindings/soc/bcm-pmb.h
+++ b/include/dt-bindings/soc/bcm-pmb.h
@@ -7,5 +7,6 @@
 #define BCM_PMB_PCIE1				0x02
 #define BCM_PMB_PCIE2				0x03
 #define BCM_PMB_HOST_USB			0x04
+#define BCM_PMB_SATA				0x05
 
 #endif
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding
  2021-01-14 17:53 [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rafał Miłecki
  2021-01-14 17:53 ` [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support Rafał Miłecki
@ 2021-01-25 21:48 ` Rob Herring
  2021-03-13 17:57 ` Florian Fainelli
  2 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2021-01-25 21:48 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Philipp Zabel, linux-kernel, Kevin Hilman, Rob Herring,
	Rafał Miłecki, Ulf Hansson, Rafael J . Wysocki,
	Florian Fainelli, bcm-kernel-feedback-list, devicetree

On Thu, 14 Jan 2021 18:53:38 +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> PMB can be also found on bcm63xx chipsets. It uses difference device
> addresses so a new binding is required.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/power/brcm,bcm-pmb.yaml | 1 +
>  1 file changed, 1 insertion(+)
> 

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding
  2021-01-14 17:53 [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rafał Miłecki
  2021-01-14 17:53 ` [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support Rafał Miłecki
  2021-01-25 21:48 ` [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rob Herring
@ 2021-03-13 17:57 ` Florian Fainelli
  2 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2021-03-13 17:57 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, Rafał Miłecki, Rob Herring
  Cc: Philipp Zabel, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson,
	devicetree, linux-kernel, Rafał Miłecki

On Thu, 14 Jan 2021 18:53:38 +0100, Rafał Miłecki <zajec5@gmail.com> wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> PMB can be also found on bcm63xx chipsets. It uses difference device
> addresses so a new binding is required.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---

Applied to drivers/next, thanks!
--
Florian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support
  2021-01-14 17:53 ` [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support Rafał Miłecki
@ 2021-03-13 17:57   ` Florian Fainelli
  0 siblings, 0 replies; 5+ messages in thread
From: Florian Fainelli @ 2021-03-13 17:57 UTC (permalink / raw)
  To: bcm-kernel-feedback-list, Rafał Miłecki, Rob Herring
  Cc: Philipp Zabel, Rafael J . Wysocki, Kevin Hilman, Ulf Hansson,
	devicetree, linux-kernel, Rafał Miłecki

On Thu, 14 Jan 2021 18:53:39 +0100, Rafał Miłecki <zajec5@gmail.com> wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> BCM63138 has SATA controller that needs to be powered up using PMB.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---

Applied to drivers/next, thanks!
--
Florian

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-13 17:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 17:53 [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rafał Miłecki
2021-01-14 17:53 ` [PATCH Broadcom/stblinux 2/2] soc: bcm: bcm-pmb: add BCM63138 SATA support Rafał Miłecki
2021-03-13 17:57   ` Florian Fainelli
2021-01-25 21:48 ` [PATCH Broadcom/stblinux 1/2] dt-bindings: power: bcm-pmb: add BCM63138 binding Rob Herring
2021-03-13 17:57 ` Florian Fainelli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.