HWMON driver for Broadcom STB DPFE
cover HWMON driver for Broadcom STB DPFE
From: Markus Mayer <[email protected]>
This series introduces a driver to interact with the Broadcom STB DDR PHY Front End (DPFE), specifically to communicate with the DCPU that is part of the DDR PHY and which is running its own firmware.
The DCPU provides information such as DRAM refresh rate, which can be used as indirect indicator for the DRAM temperature (the higher the refresh rate, the hotter the RAM).
Markus Mayer (2):
dt/bindings: Add bindings for Broadcom STB DRAM Sensors
hwmon: (brcmstb) Add driver for Broadcom STB DPFE
.../devicetree/bindings/hwmon/brcmstb-dpfe.txt | 68 ++ MAINTAINERS | 8 + drivers/hwmon/Kconfig | 13 + drivers/hwmon/Makefile | 1 + drivers/hwmon/brcmstb-dpfe.c | 689 +++++++++++++++++++++ 5 files changed, 779 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt create mode 100644 drivers/hwmon/brcmstb-dpfe.c
Signature · 1 line
2.7.4
PATCH 1/2 dt/bindings: Add bindings for Broadcom STB DRAM Sensors
From: Markus Mayer <[email protected]>
Provide bindings for the Broadcom STB DDR PHY Front End (DPFE).
--- .../devicetree/bindings/hwmon/brcmstb-dpfe.txt | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +68 -0
@@ -0,0 +1,68 @@ +DDR PHY Front End (DPFE) for Broadcom STB +========================================= + +DPFE and the DPFE firmware provide an interface for the host CPU to +communicate with the DCPU, which resides inside the DDR PHY. + +There are three memory regions for interacting with the DCPU. + +The DCPU Register Space +----------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-cpu, brcm,dpfe-cpu-v12.0.0.0 + or brcm,dpfe-cpu + - reg: must reference the start address and length of the DCPU register + space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_cpu0: dpfe-cpu at f1132000 { + compatible = "brcm,bcm7271-dpfe-cpu", + "brcm,dpfe-cpu-v12.0.0.0", + "brcm,dpfe-cpu"; + reg = <0xf1132000 0x180>; + cell-index = <0>; + }; + +The DCPU Data Memory Space +-------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-dmem, brcm,dpfe-dmem-v12.0.0.0 + or brcm,dpfe-dmem + - reg: must reference the start address and length of the DCPU DMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_dmem0: dpfe-dmem at f1134000 { + compatible = "brcm,bcm7271-dpfe-dmem", + "brcm,dpfe-dmem-v12.0.0.0", + "brcm,dpfe-dmem"; + reg = <0xf1134000 0x1000>; + cell-index = <0>; + }; + +The DCPU Instruction Memory Space +--------------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-imem, brcm,dpfe-imem-v12.0.0.0 + or brcm,dpfe-imem + - reg: must reference the start address and length of the DCPU IMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_imem0: dpfe-imem at f1138000 { + compatible = "brcm,bcm7271-dpfe-imem", + "brcm,dpfe-imem-v12.0.0.0", + "brcm,dpfe-imem"; + reg = <0xf1138000 0x4000>; + cell-index = <0>; + };
Signature · 1 line
2.7.4
PATCH 2/2 hwmon: (brcmstb) Add driver for Broadcom STB DPFE
In reply to Markus MayerFrom: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
--- MAINTAINERS | 8 + drivers/hwmon/Kconfig | 13 + drivers/hwmon/Makefile | 1 + drivers/hwmon/brcmstb-dpfe.c | 689 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 711 insertions(+) create mode 100644 drivers/hwmon/brcmstb-dpfe.c
MAINTAINERS +8 -0
@@ -2825,6 +2825,14 @@ S: Maintained F: Documentation/devicetree/bindings/cpufreq/brcm,stb-avs-cpu-freq.txt F: drivers/cpufreq/brcmstb* +BROADCOM STB DPFE HWMON DRIVER +M: Markus Mayer <[email protected]> +M: bcm-kernel-feedback-list at broadcom.com +L: linux-hwmon at vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/hwmon/brcmstb* +F: drivers/hwmon/brcmstb* + BROADCOM SPECIFIC AMBA DRIVER (BCMA) M: Rafa? Mi?ecki <[email protected]> L: linux-wireless at vger.kernel.org
drivers/hwmon/Kconfig +13 -0
@@ -355,6 +355,19 @@ config SENSORS_ATXP1 This driver can also be built as a module. If so, the module will be called atxp1. +config SENSORS_BRCMSTB_DPFE + tristate "BRCMSTB DPFE driver" + depends on ARCH_BRCMSTB + default y + help + If you say yes here you get support for the Broadcom set-top box + DDR PHY Front End (DPFE) interface. + + The driver allows one to query the DRAM refresh rate, which in turn, + provides an indirect means for deriving the DRAM temperature. + + If in doubt, say N. + config SENSORS_DS620 tristate "Dallas Semiconductor DS620" depends on I2C
drivers/hwmon/Makefile +1 -0
@@ -12,6 +12,7 @@ obj-$(CONFIG_SENSORS_ATK0110) += asus_atk0110.o # Native drivers # asb100, then w83781d go first, as they can override other drivers' addresses. obj-$(CONFIG_SENSORS_ASB100) += asb100.o +obj-$(CONFIG_SENSORS_BRCMSTB_DPFE) += brcmstb-dpfe.o obj-$(CONFIG_SENSORS_W83627HF) += w83627hf.o obj-$(CONFIG_SENSORS_W83792D) += w83792d.o obj-$(CONFIG_SENSORS_W83793) += w83793.o
drivers/hwmon/brcmstb-dpfe.c new file +689 -0
689 lines not on this page · raw message
Signature · 1 line
2.7.4
Guenter Roeck
maintainerRe: [PATCH 2/2] hwmon: (brcmstb) Add driver for Broadcom STB DPFE
Hi Markus,
Quoted 10 lines · Markus Mayer
From: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
Signed-off-by Markus Mayer <[email protected]>---
[ ... ]
drivers/hwmon/brcmstb-dpfe.c line 602
Quoted 13 lines
drivers/hwmon/brcmstb-dpfe.c new file +13
-0+ +static SENSOR_DEVICE_ATTR(dpfe_info, 0444, show_info, NULL, 1000); +static SENSOR_DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh, + 1000); +static SENSOR_DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL, 1000); +static struct attribute *dpfe_attrs[] = { + &sensor_dev_attr_dpfe_info.dev_attr.attr, + &sensor_dev_attr_dpfe_refresh.dev_attr.attr, + &sensor_dev_attr_dpfe_vendor.dev_attr.attr, +NULL +}; +ATTRIBUTE_GROUPS (dpfe); +
There is not a single standard hwmon attribute. I don't know how to classify this driver, and where it should reside, but it is not a hwmon driver.
Thanks,
Guenter
Re: [PATCH 2/2] hwmon: (brcmstb) Add driver for Broadcom STB DPFE
Hey Guenter,
Quoted 24 lines · Guenter Roeck
Hi Markus,
Quoted 10 lines · Markus Mayer
From: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
Signed-off-by Markus Mayer <[email protected]>---
[ ... ]
Quoted 9 lines
drivers/hwmon/brcmstb-dpfe.c new file +9
-0+ +static SENSOR_DEVICE_ATTR(dpfe_info, 0444, show_info, NULL, 1000); +static SENSOR_DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh, + 1000); +static SENSOR_DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL, 1000); +static struct attribute *dpfe_attrs[] = { + &sensor_dev_attr_dpfe_info.dev_attr.attr, + &sensor_dev_attr_dpfe_refresh.dev_attr.attr, + &sensor_dev_attr_dpfe_vendor.dev_attr.attr,
Quoted 8 lines
drivers/hwmon/brcmstb-dpfe.c line 602
Quoted 4 lines
drivers/hwmon/brcmstb-dpfe.c new file +4
-0+ NULL +}; +ATTRIBUTE_GROUPS (dpfe); +There is not a single standard hwmon attribute. I don't know how to classify this driver, and where it should reside, but it is not a hwmon driver.
This is a driver that talks to an embedded CPU running firmware which is capable of giving various informations about the DRAM chip being populated, including a temperature trend (hotter or cooler). We thought initially we would be able to expose the actual temperature, but this in turn required a lot more knowledge about the DRAM chip that we wish we knew about. That is sort of where and why this driver was proposed for hwmon.
Which subsystem do you think would be best for this driver drivers/misc/ or drivers/soc/bcm/brcmstb/ maybe?
Signature · 1 line
Florian
Guenter Roeck
maintainerRe: [PATCH 2/2] hwmon: (brcmstb) Add driver for Broadcom STB DPFE
Hi Florian,
Quoted 44 lines · Florian Fainelli
Hey Guenter,
Quoted 24 lines · Guenter Roeck
Hi Markus,
Quoted 10 lines · Markus Mayer
From: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
Signed-off-by Markus Mayer <[email protected]>---
[ ... ]
Quoted 9 lines
drivers/hwmon/brcmstb-dpfe.c new file +9
-0+ +static SENSOR_DEVICE_ATTR(dpfe_info, 0444, show_info, NULL, 1000); +static SENSOR_DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh, + 1000); +static SENSOR_DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL, 1000); +static struct attribute *dpfe_attrs[] = { + &sensor_dev_attr_dpfe_info.dev_attr.attr, + &sensor_dev_attr_dpfe_refresh.dev_attr.attr, + &sensor_dev_attr_dpfe_vendor.dev_attr.attr,Quoted 8 lines
drivers/hwmon/brcmstb-dpfe.c line 602
Quoted 4 lines
drivers/hwmon/brcmstb-dpfe.c new file +4
-0+ NULL +}; +ATTRIBUTE_GROUPS (dpfe); +There is not a single standard hwmon attribute. I don't know how to classify this driver, and where it should reside, but it is not a hwmon driver.
This is a driver that talks to an embedded CPU running firmware which is capable of giving various informations about the DRAM chip being populated, including a temperature trend (hotter or cooler). We thought initially we would be able to expose the actual temperature, but this in turn required a lot more knowledge about the DRAM chip that we wish we knew about. That is sort of where and why this driver was proposed for hwmon.
Quoted 2 lines
Which subsystem do you think would be best for this driver
drivers/misc/ordrivers/soc/bcm/brcmstb/maybe?
Both should work. I would probably try misc first and let Greg tell me which way to go ;-).
Thanks,
Guenter
Re: [PATCH 2/2] hwmon: (brcmstb) Add driver for Broadcom STB DPFE
Quoted 47 lines · Guenter Roeck
Hi Florian,
Quoted 44 lines · Florian Fainelli
Hey Guenter,
Quoted 24 lines · Guenter Roeck
Hi Markus,
Quoted 10 lines · Markus Mayer
From: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
Signed-off-by Markus Mayer <[email protected]>---
[ ... ]
Quoted 9 lines
drivers/hwmon/brcmstb-dpfe.c new file +9
-0+ +static SENSOR_DEVICE_ATTR(dpfe_info, 0444, show_info, NULL, 1000); +static SENSOR_DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh, + 1000); +static SENSOR_DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL, 1000); +static struct attribute *dpfe_attrs[] = { + &sensor_dev_attr_dpfe_info.dev_attr.attr, + &sensor_dev_attr_dpfe_refresh.dev_attr.attr, + &sensor_dev_attr_dpfe_vendor.dev_attr.attr,Quoted 8 lines
drivers/hwmon/brcmstb-dpfe.c line 602
Quoted 4 lines
drivers/hwmon/brcmstb-dpfe.c new file +4
-0+ NULL +}; +ATTRIBUTE_GROUPS (dpfe); +There is not a single standard hwmon attribute. I don't know how to classify this driver, and where it should reside, but it is not a hwmon driver.
This is a driver that talks to an embedded CPU running firmware which is capable of giving various informations about the DRAM chip being populated, including a temperature trend (hotter or cooler). We thought initially we would be able to expose the actual temperature, but this in turn required a lot more knowledge about the DRAM chip that we wish we knew about. That is sort of where and why this driver was proposed for hwmon.
Quoted 5 lines
Quoted 2 lines
Which subsystem do you think would be best for this driver
drivers/misc/ordrivers/soc/bcm/brcmstb/maybe?Both should work. I would probably try misc first and let Greg tell me which way to go ;-).
Thanks for the tip. As Florian said, it was not the idea to submit a completely non-standard hwmon driver. I was sure I would be able to report at least some standard hwmon data also.
Regards,
-Markus
Re: [PATCH 2/2] hwmon: (brcmstb) Add driver for Broadcom STB DPFE
Quoted 51 lines · Markus Mayer
Quoted 50 lines · Guenter Roeck
Hi Florian,
Quoted 46 lines · Florian Fainelli
Hey Guenter,
Quoted 24 lines · Guenter Roeck
Hi Markus,
Quoted 10 lines · Markus Mayer
From: Markus Mayer <[email protected]>
This driver allows access to DRAM properties, such as the refresh rate, via the Broadcom STB DDR PHY Front End (DPFE). The refresh rate can be used as indirect indicator of the DRAM temperature.
The driver also allows setting of the sampling interval.
Signed-off-by Markus Mayer <[email protected]>---
[ ... ]
Quoted 9 lines
drivers/hwmon/brcmstb-dpfe.c new file +9
-0+ +static SENSOR_DEVICE_ATTR(dpfe_info, 0444, show_info, NULL, 1000); +static SENSOR_DEVICE_ATTR(dpfe_refresh, 0644, show_refresh, store_refresh, + 1000); +static SENSOR_DEVICE_ATTR(dpfe_vendor, 0444, show_vendor, NULL, 1000); +static struct attribute *dpfe_attrs[] = { + &sensor_dev_attr_dpfe_info.dev_attr.attr, + &sensor_dev_attr_dpfe_refresh.dev_attr.attr, + &sensor_dev_attr_dpfe_vendor.dev_attr.attr,Quoted 8 lines
drivers/hwmon/brcmstb-dpfe.c line 602
Quoted 4 lines
drivers/hwmon/brcmstb-dpfe.c new file +4
-0+ NULL +}; +ATTRIBUTE_GROUPS (dpfe); +There is not a single standard hwmon attribute. I don't know how to classify this driver, and where it should reside, but it is not a hwmon driver.
This is a driver that talks to an embedded CPU running firmware which is capable of giving various informations about the DRAM chip being populated, including a temperature trend (hotter or cooler). We thought initially we would be able to expose the actual temperature, but this in turn required a lot more knowledge about the DRAM chip that we wish we knew about. That is sort of where and why this driver was proposed for hwmon.
Which subsystem do you think would be best for this driver
drivers/misc/ordrivers/soc/bcm/brcmstb/maybe?
Quoted 6 lines
Quoted 2 lines
Both should work. I would probably try misc first and let Greg tell me which way to go ;-).
Thanks for the tip. As Florian said, it was not the idea to submit a completely non-standard hwmon driver. I was sure I would be able to report at least some standard hwmon data also.
Good thing with drivers/soc/bcm/brcmstb/ is that I can take such patches directly through ARM SoC pull requests, and since this is inherently Broadcom STB specific, that sounds like the most ideal location IMHO.
Signature · 1 line
Florian
Re: [PATCH 1/2] dt/bindings: Add bindings for Broadcom STB DRAM Sensors
In reply to Markus MayerHi Rob,
Quoted 3 lines · Markus Mayer
From: Markus Mayer <[email protected]>
Provide bindings for the Broadcom STB DDR PHY Front End (DPFE).
Would you be able to have a look at this binding? The driver won't be upstreamed as hwmon driver (as per Guenter's comments). I am currently converting the driver to a "soc" driver instead, but the proposed binding remains unchanged.
If you have comments or suggestions, I would like to incorporate them with the new series I will be sending out.
Thanks,
-Markus
Quoted 83 lines
Signed-off-by Markus Mayer <[email protected]>--- .../devicetree/bindings/hwmon/brcmstb-dpfe.txt | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txtDocumentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +68
-1@@ -0,0 +1,68 @@ +DDR PHY Front End (DPFE) for Broadcom STB +========================================= + +DPFE and the DPFE firmware provide an interface for the host CPU to +communicate with the DCPU, which resides inside the DDR PHY. + +There are three memory regions for interacting with the DCPU. + +The DCPU Register Space +----------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-cpu, brcm,dpfe-cpu-v12.0.0.0 + or brcm,dpfe-cpu + - reg: must reference the start address and length of the DCPU register + space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_cpu0: dpfe-cpu at f1132000 { + compatible = "brcm,bcm7271-dpfe-cpu", + "brcm,dpfe-cpu-v12.0.0.0", + "brcm,dpfe-cpu"; + reg = <0xf1132000 0x180>; + cell-index = <0>; + }; + +The DCPU Data Memory Space +-------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-dmem, brcm,dpfe-dmem-v12.0.0.0 + or brcm,dpfe-dmem + - reg: must reference the start address and length of the DCPU DMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_dmem0: dpfe-dmem at f1134000 { + compatible = "brcm,bcm7271-dpfe-dmem", + "brcm,dpfe-dmem-v12.0.0.0", + "brcm,dpfe-dmem"; + reg = <0xf1134000 0x1000>; + cell-index = <0>; + }; + +The DCPU Instruction Memory Space +--------------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-imem, brcm,dpfe-imem-v12.0.0.0 + or brcm,dpfe-imem + - reg: must reference the start address and length of the DCPU IMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_imem0: dpfe-imem at f1138000 { + compatible = "brcm,bcm7271-dpfe-imem", + "brcm,dpfe-imem-v12.0.0.0", + "brcm,dpfe-imem"; + reg = <0xf1138000 0x4000>; + cell-index = <0>; + }; --2.7.4
Re: [PATCH 1/2] dt/bindings: Add bindings for Broadcom STB DRAM Sensors
Quoted 7 lines · Markus Mayer
Hi Rob,
Quoted 3 lines · Markus Mayer
From: Markus Mayer <[email protected]>
Provide bindings for the Broadcom STB DDR PHY Front End (DPFE).
Quoted 7 lines
Would you be able to have a look at this binding? The driver won't be upstreamed as hwmon driver (as per Guenter's comments). I am currently converting the driver to a "soc" driver instead, but the proposed binding remains unchanged.
If you have comments or suggestions, I would like to incorporate them with the new series I will be sending out.
To explain a bit more what we are looking for: we had a internal discussions how to structure this binding and are looking for some guidance.
Should we create three different nodes for the three different memory areas (dpfe-cpu at ..., dpfe-dmem at ..., dpfe-imem at ...), each with a single "reg" property (which is the proposal below) or should this be one single property with 3 "reg" cells, i.e. something like this:
dpfe-cpu at f1132000 {
...
reg = <0xf1132000 0x180 /* register space */
0xf1134000 0x1000 /* data memory */
0xf1138000 0x4000>; /* instruction memory */
...
};Regards,
-Markus
Quoted 83 lines
Quoted 83 lines
Signed-off-by Markus Mayer <[email protected]>--- .../devicetree/bindings/hwmon/brcmstb-dpfe.txt | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txtDocumentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +68
-1@@ -0,0 +1,68 @@ +DDR PHY Front End (DPFE) for Broadcom STB +========================================= + +DPFE and the DPFE firmware provide an interface for the host CPU to +communicate with the DCPU, which resides inside the DDR PHY. + +There are three memory regions for interacting with the DCPU. + +The DCPU Register Space +----------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-cpu, brcm,dpfe-cpu-v12.0.0.0 + or brcm,dpfe-cpu + - reg: must reference the start address and length of the DCPU register + space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_cpu0: dpfe-cpu at f1132000 { + compatible = "brcm,bcm7271-dpfe-cpu", + "brcm,dpfe-cpu-v12.0.0.0", + "brcm,dpfe-cpu"; + reg = <0xf1132000 0x180>; + cell-index = <0>; + }; + +The DCPU Data Memory Space +-------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-dmem, brcm,dpfe-dmem-v12.0.0.0 + or brcm,dpfe-dmem + - reg: must reference the start address and length of the DCPU DMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_dmem0: dpfe-dmem at f1134000 { + compatible = "brcm,bcm7271-dpfe-dmem", + "brcm,dpfe-dmem-v12.0.0.0", + "brcm,dpfe-dmem"; + reg = <0xf1134000 0x1000>; + cell-index = <0>; + }; + +The DCPU Instruction Memory Space +--------------------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-imem, brcm,dpfe-imem-v12.0.0.0 + or brcm,dpfe-imem + - reg: must reference the start address and length of the DCPU IMEM space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set + +Example: + dpfe_imem0: dpfe-imem at f1138000 { + compatible = "brcm,bcm7271-dpfe-imem", + "brcm,dpfe-imem-v12.0.0.0", + "brcm,dpfe-imem"; + reg = <0xf1138000 0x4000>; + cell-index = <0>; + }; --2.7.4
Rob Herring
maintainerRe: [PATCH 1/2] dt/bindings: Add bindings for Broadcom STB DRAM Sensors
Quoted 16 lines · Markus Mayer
Quoted 7 lines · Markus Mayer
Hi Rob,
Quoted 3 lines · Markus Mayer
From: Markus Mayer <[email protected]>
Provide bindings for the Broadcom STB DDR PHY Front End (DPFE).
Quoted 7 lines
Would you be able to have a look at this binding? The driver won't be upstreamed as hwmon driver (as per Guenter's comments). I am currently converting the driver to a "soc" driver instead, but the proposed binding remains unchanged.
If you have comments or suggestions, I would like to incorporate them with the new series I will be sending out.
Quoted 8 lines
To explain a bit more what we are looking for: we had a internal discussions how to structure this binding and are looking for some guidance.
Should we create three different nodes for the three different memory areas (dpfe-cpu at ..., dpfe-dmem at ..., dpfe-imem at ...), each with a single "reg" property (which is the proposal below) or should this be one single property with 3 "reg" cells, i.e. something like this:
Either way could be okay. It is conceptually 1 thing or 3?
Quoted 30 lines
dpfe-cpu at f1132000 { ... reg = <0xf1132000 0x180 /* register space */ 0xf1134000 0x1000 /* data memory */ 0xf1138000 0x4000>; /* instruction memory */ ... };Regards,
-MarkusQuoted 18 lines
Quoted 18 lines
Signed-off-by Markus Mayer <[email protected]>--- .../devicetree/bindings/hwmon/brcmstb-dpfe.txt | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txtDocumentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +6
-0@@ -0,0 +1,68 @@ +DDR PHY Front End (DPFE) for Broadcom STB +========================================= + +DPFE and the DPFE firmware provide an interface for the host CPU to +communicate with the DCPU, which resides inside the DDR PHY. +
Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt line 14
Quoted 8 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +8
-0+There are three memory regions for interacting with the DCPU. + +The DCPU Register Space +----------------------- + +Required properties: + - compatible: must be one of brcm,bcm7271-dpfe-cpu, brcm,dpfe-cpu-v12.0.0.0 + or brcm,dpfe-cpu
3 compatibles is a bit excessive. You can always use brcm,bcm7271-dpfe-cpu as a fallback for other chips. I wouldn't expect a DDR phy to be around a long time without changes given process and DDR technology changes.
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt line 19
Quoted 5 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +5
-0+ - reg: must reference the start address and length of the DCPU register + space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not set
Don't use cell-index. It's not a valid property for FDT (only real OpenFirmware).
Rob
Re: [PATCH 1/2] dt/bindings: Add bindings for Broadcom STB DRAM Sensors
Quoted 8 lines · Rob Herring
Quoted 5 lines
Quoted 5 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt line 19
Quoted 5 lines
Documentation/devicetree/bindings/hwmon/brcmstb-dpfe.txt new file +5
-0+ - reg: must reference the start address and length of the DCPU register + space + +Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not setDon't use cell-index. It's not a valid property for FDT (only real OpenFirmware).
My bad, I was advising Markus to use this property since it was largely used throughout Documentation/devicetree/bindings/. What would be a more appropriate way to have the same information? Aliases?
Signature · 1 line
Florian
Re: [PATCH 1/2] dt/bindings: Add bindings for Broadcom STB DRAM Sensors
Hi Rob,
Quoted 10 lines · Florian Fainelli
Quoted 5 lines · Rob Herring
Quoted 2 lines
Quoted 2 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+Optional properties: + - cell-index: the index of the DPFE instance; will default to 0 if not setDon't use cell-index. It's not a valid property for FDT (only real OpenFirmware).
My bad, I was advising Markus to use this property since it was largely used throughout
Documentation/devicetree/bindings/. What would be a more appropriate way to have the same information? Aliases?
Hopefully this will be the last time we need to pester you about this. What should we be using instead of cell-index to identify multiple instances of a device?
To give you an idea of what the code looks like right now:
ret = of_property_read_u32(dev->of_node, "cell-index", &index); if (ret)
index = 0;
[...]dev_set_name(dpfe_dev, "dpfe%u", index);
ret = device_register(dpfe_dev);
Enumerating the devices like this is what we are after.
Thanks,
-Markus