From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:10
Hi!
Follow-up on the v2: https://patchwork.kernel.org/cover/11322801/ .
The main purpose of this series is to upstream the dts change and the binding
document, but I wanted to see how far I could probe the GPU, to check that the
binding is indeed correct. The rest of the patches are RFC/work-in-progress, but
I think some of them could already be picked up.
So this is tested on MT8183 with a chromeos-4.19 kernel, and a ton of
backports to get the latest panfrost driver (I should probably try on
linux-next at some point but this was the path of least resistance).
I tested it as a module as it's more challenging (originally probing would
work built-in, on boot, but not as a module, as I didn't have the power
domain changes, and all power domains are on by default during boot).
Probing logs looks like this, currently. They look sane.
[ 501.319728] panfrost 13040000.gpu: clock rate = 511999970
[ 501.320041] panfrost 13040000.gpu: Linked as a consumer to regulator.14
[ 501.320102] panfrost 13040000.gpu: Linked as a consumer to regulator.31
[ 501.320651] panfrost 13040000.gpu: Linked as a consumer to genpd:0:13040000.gpu
[ 501.320954] panfrost 13040000.gpu: Linked as a consumer to genpd:1:13040000.gpu
[ 501.321062] panfrost 13040000.gpu: Linked as a consumer to genpd:2:13040000.gpu
[ 501.321734] panfrost 13040000.gpu: mali-g72 id 0x6221 major 0x0 minor 0x3 status 0x0
[ 501.321741] panfrost 13040000.gpu: features: 00000000,13de77ff, issues: 00000000,00000400
[ 501.321747] panfrost 13040000.gpu: Features: L2:0x07120206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[ 501.321752] panfrost 13040000.gpu: shader_present=0x7 l2_present=0x1
[ 501.324951] [drm] Initialized panfrost 1.1.0 20180908 for 13040000.gpu on minor 2
Some more changes are still required to get devfreq working, and of course
I do not have a userspace driver to test this with.
Thanks!
Nicolas
v3 (see individual patches, too):
- Match a specific mediatek,mt8183-mali instead of the generic bifrost,
as this instance requires 2 special cases:
- 2 regulators
- 3 power domains
v2:
- Use sram instead of mali_sram as SRAM supply name.
- Rename mali@ to gpu@.
- Add dt-bindings changes
- Stacking patches after the device tree change that allow basic
probing (still incomplete and broken).
Nicolas Boichat (7):
dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183
arm64: dts: mt8183: Add node for the Mali GPU
drm/panfrost: Improve error reporting in panfrost_gpu_power_on
drm/panfrost: Add support for multiple regulators
drm/panfrost: Add support for multiple power domains
RFC: drm/panfrost: Add mt8183-mali compatible string
RFC: drm/panfrost: devfreq: Add support for 2 regulators
.../bindings/gpu/arm,mali-bifrost.yaml | 18 +++
arch/arm64/boot/dts/mediatek/mt8183-evb.dts | 7 +
arch/arm64/boot/dts/mediatek/mt8183.dtsi | 104 +++++++++++++++
drivers/gpu/drm/panfrost/panfrost_devfreq.c | 17 +++
drivers/gpu/drm/panfrost/panfrost_device.c | 120 +++++++++++++++---
drivers/gpu/drm/panfrost/panfrost_device.h | 25 +++-
drivers/gpu/drm/panfrost/panfrost_drv.c | 38 ++++--
drivers/gpu/drm/panfrost/panfrost_gpu.c | 11 +-
8 files changed, 310 insertions(+), 30 deletions(-)
--
2.25.0.rc1.283.g88dfdc4193-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:15
Define a compatible string for the Mali Bifrost GPU found in
Mediatek's MT8183 SoCs.
Signed-off-by: Nicolas Boichat <redacted>
Reviewed-by: Alyssa Rosenzweig <redacted>
---
v3:
- No change
.../bindings/gpu/arm,mali-bifrost.yaml | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -17,6 +17,7 @@ properties:items:-enum:-amlogic,meson-g12a-mali+-mediatek,mt8183-mali-realtek,rtd1619-mali-rockchip,px30-mali-const:arm,mali-bifrost# Mali Bifrost GPU model/revision is fully discoverable
@@ -62,6 +63,23 @@ allOf:minItems:2required:-resets+-if:+properties:+compatible:+contains:+const:mediatek,mt8183-mali+then:+properties:+sram-supply:true+power-domains:+description:+List of phandle and PM domain specifier as documented in+Documentation/devicetree/bindings/power/power_domain.txt+minItems:3+maxItems:3+required:+-sram-supply+-power-domainsexamples:-|
--
2.25.0.rc1.283.g88dfdc4193-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:22
It is useful to know which component cannot be powered on.
Signed-off-by: Nicolas Boichat <redacted>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <redacted>
---
Was useful when trying to probe Bifrost GPU, to understand what
issue we are facing.
v3:
- Rebased on https://patchwork.kernel.org/patch/11325689/
drivers/gpu/drm/panfrost/panfrost_gpu.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:26
Some GPUs, namely, the bifrost/g72 part on MT8183, have a second
regulator for their SRAM, let's add support for that.
We extend the framework in a generic manner so that we could
support more than 2 regulators, if required.
Signed-off-by: Nicolas Boichat <redacted>
---
v3:
- Make this more generic, by allowing any number of regulators
(in practice we fix the maximum number of regulators to 2, but
this could be increased easily).
- We only probe the second regulator if the device tree matching
data asks for it.
- I couldn't find a way to detect the number of regulators in the
device tree, if we wanted to refuse to probe the device if there
are too many regulators, which might be required for safety, see
the thread on v2 [1].
- The discussion also included the idea of a separate device tree
entry for a "soft PDC", or at least a separate driver. I'm not
sure to understand the full picture, and how different vendors
implement this, so I'm still integrating everything in the main
driver. I'd be happy to try to make mt8183 fit into such a
framework after it's created, but I don't think I'm best placed
to implement (and again, the main purpose of this was to test
if the binding is correct).
[1] https://patchwork.kernel.org/patch/11322839/
drivers/gpu/drm/panfrost/panfrost_device.c | 25 ++++++++++++-------
drivers/gpu/drm/panfrost/panfrost_device.h | 15 +++++++++++-
drivers/gpu/drm/panfrost/panfrost_drv.c | 28 +++++++++++++++-------
3 files changed, 50 insertions(+), 18 deletions(-)
@@ -87,18 +87,26 @@ static void panfrost_clk_fini(struct panfrost_device *pfdev)staticintpanfrost_regulator_init(structpanfrost_device*pfdev){-intret;+intret,i;-pfdev->regulator=devm_regulator_get(pfdev->dev,"mali");-if(IS_ERR(pfdev->regulator)){-ret=PTR_ERR(pfdev->regulator);-dev_err(pfdev->dev,"failed to get regulator: %d\n",ret);+BUG_ON(pfdev->comp->num_supplies>ARRAY_SIZE(pfdev->regulators));++for(i=0;i<pfdev->comp->num_supplies;i++){+pfdev->regulators[i].supply=pfdev->comp->supply_names[i];+}++ret=devm_regulator_bulk_get(pfdev->dev,+pfdev->comp->num_supplies,+pfdev->regulators);+if(ret<0){+dev_err(pfdev->dev,"failed to get regulators: %d\n",ret);returnret;}-ret=regulator_enable(pfdev->regulator);+ret=regulator_bulk_enable(pfdev->comp->num_supplies,+pfdev->regulators);if(ret<0){-dev_err(pfdev->dev,"failed to enable regulator: %d\n",ret);+dev_err(pfdev->dev,"failed to enable regulators: %d\n",ret);returnret;}
@@ -107,7 +115,8 @@ static int panfrost_regulator_init(struct panfrost_device *pfdev)staticvoidpanfrost_regulator_fini(structpanfrost_device*pfdev){-regulator_disable(pfdev->regulator);+regulator_bulk_disable(pfdev->comp->num_supplies,+pfdev->regulators);}intpanfrost_device_init(structpanfrost_device*pfdev)
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:29
When there is a single power domain per device, the core will
ensure the power domain is switched on (so it is technically
equivalent to having not power domain specified at all).
However, when there are multiple domains, as in MT8183 Bifrost
GPU, we need to handle them in driver code.
Signed-off-by: Nicolas Boichat <redacted>
---
The downstream driver we use on chromeos-4.19 currently uses 2
additional devices in device tree to accomodate for this [1], but
I believe this solution is cleaner.
[1] https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-4.19/drivers/gpu/arm/midgard/platform/mediatek/mali_kbase_runtime_pm.c#31
v3:
- Use the compatible matching data to specify the number of power
domains. Note that setting 0 or 1 in num_pm_domains is equivalent
as the core will handle these 2 cases in the exact same way
(automatically, without driver intervention), and there should
be no adverse consequence in this case (the concern is about
switching on only some power domains and not others).
drivers/gpu/drm/panfrost/panfrost_device.c | 95 ++++++++++++++++++++--
drivers/gpu/drm/panfrost/panfrost_device.h | 9 ++
drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
3 files changed, 97 insertions(+), 8 deletions(-)
@@ -119,6 +120,75 @@ static void panfrost_regulator_fini(struct panfrost_device *pfdev)pfdev->regulators);}+staticvoidpanfrost_pm_domain_fini(structpanfrost_device*pfdev)+{+inti;++for(i=0;i<ARRAY_SIZE(pfdev->pm_domain_devs);i++){+if(!pfdev->pm_domain_devs[i])+break;++if(pfdev->pm_domain_links[i])+device_link_del(pfdev->pm_domain_links[i]);++dev_pm_domain_detach(pfdev->pm_domain_devs[i],true);+}+}++staticintpanfrost_pm_domain_init(structpanfrost_device*pfdev)+{+interr;+inti,num_domains;++num_domains=of_count_phandle_with_args(pfdev->dev->of_node,+"power-domains",+"#power-domain-cells");++/*+*Singledomainishandledbythecore,and,ifonlyasinglepower+*thepowerdomainisrequested,thepropertyisoptional.+*/+if(num_domains<2&&pfdev->comp->num_pm_domains<2)+return0;++if(num_domains!=pfdev->comp->num_pm_domains){+dev_err(pfdev->dev,+"Incorrect number of power domains: %d provided, %d needed\n",+num_domains,pfdev->comp->num_pm_domains);+return-EINVAL;+}++BUG_ON(num_domains>ARRAY_SIZE(pfdev->pm_domain_devs));++for(i=0;i<num_domains;i++){+pfdev->pm_domain_devs[i]=+dev_pm_domain_attach_by_id(pfdev->dev,i);+if(IS_ERR(pfdev->pm_domain_devs[i])){+err=PTR_ERR(pfdev->pm_domain_devs[i]);+pfdev->pm_domain_devs[i]=NULL;+dev_err(pfdev->dev,+"failed to get pm-domain %d: %d\n",i,err);+gotoerr;+}++pfdev->pm_domain_links[i]=device_link_add(pfdev->dev,+pfdev->pm_domain_devs[i],DL_FLAG_PM_RUNTIME|+DL_FLAG_STATELESS|DL_FLAG_RPM_ACTIVE);+if(!pfdev->pm_domain_links[i]){+dev_err(pfdev->pm_domain_devs[i],+"adding device link failed!\n");+err=-ENODEV;+gotoerr;+}+}++return0;++err:+panfrost_pm_domain_fini(pfdev);+returnerr;+}+intpanfrost_device_init(structpanfrost_device*pfdev){interr;
@@ -149,37 +219,45 @@ int panfrost_device_init(struct panfrost_device *pfdev)gotoerr_out1;}+err=panfrost_pm_domain_init(pfdev);+if(err){+dev_err(pfdev->dev,"pm_domain init failed %d\n",err);+gotoerr_out2;+}+res=platform_get_resource(pfdev->pdev,IORESOURCE_MEM,0);pfdev->iomem=devm_ioremap_resource(pfdev->dev,res);if(IS_ERR(pfdev->iomem)){dev_err(pfdev->dev,"failed to ioremap iomem\n");err=PTR_ERR(pfdev->iomem);-gotoerr_out2;+gotoerr_out3;}err=panfrost_gpu_init(pfdev);if(err)-gotoerr_out2;+gotoerr_out3;err=panfrost_mmu_init(pfdev);if(err)-gotoerr_out3;+gotoerr_out4;err=panfrost_job_init(pfdev);if(err)-gotoerr_out4;+gotoerr_out5;err=panfrost_perfcnt_init(pfdev);if(err)-gotoerr_out5;+gotoerr_out6;return0;-err_out5:+err_out6:panfrost_job_fini(pfdev);-err_out4:+err_out5:panfrost_mmu_fini(pfdev);-err_out3:+err_out4:panfrost_gpu_fini(pfdev);+err_out3:+panfrost_pm_domain_fini(pfdev);err_out2:panfrost_reset_fini(pfdev);err_out1:
@@ -73,6 +79,9 @@ struct panfrost_device {structclk*bus_clock;structregulator_bulk_dataregulators[MAX_REGULATORS];structreset_control*rstc;+/* pm_domains for devices with more than one. */+structdevice*pm_domain_devs[MAX_PM_DOMAINS];+structdevice_link*pm_domain_links[MAX_PM_DOMAINS];structpanfrost_featuresfeatures;conststructpanfrost_compatible*comp;
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:31
For testing only, the driver doesn't really work yet, AFAICT.
Signed-off-by: Nicolas Boichat <redacted>
---
v3:
- Match mt8183-mali instead of bifrost, as we require special
handling for the 2 regulators and 3 power domains.
drivers/gpu/drm/panfrost/panfrost_drv.c | 9 +++++++++
1 file changed, 9 insertions(+)
From: Nicolas Boichat <hidden> Date: 2020-01-14 07:16:34
The Bifrost GPU on MT8183 uses 2 regulators (core and SRAM) for
devfreq, and provides OPP table with 2 sets of voltages.
TODO: This is incomplete as we'll need add support for setting
a pair of voltages as well.
Signed-off-by: Nicolas Boichat <redacted>
---
drivers/gpu/drm/panfrost/panfrost_devfreq.c | 17 +++++++++++++++++
drivers/gpu/drm/panfrost/panfrost_device.h | 1 +
2 files changed, 18 insertions(+)
@@ -79,6 +79,21 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev)structdevfreq*devfreq;structthermal_cooling_device*cooling;+/* If we have 2 regulator, we need an OPP table with 2 voltages. */+if(pfdev->comp->num_supplies>1){+pfdev->devfreq.dev_opp_table=+dev_pm_opp_set_regulators(dev,+pfdev->comp->supply_names,+pfdev->comp->num_supplies);+if(IS_ERR(pfdev->devfreq.dev_opp_table)){+ret=PTR_ERR(pfdev->devfreq.dev_opp_table);+pfdev->devfreq.dev_opp_table=NULL;+dev_err(dev,+"Failed to init devfreq opp table: %d\n",ret);+returnret;+}+}+ret=dev_pm_opp_of_add_table(dev);if(ret==-ENODEV)/* Optional, continue without devfreq */return0;
From: Mark Brown <broonie@kernel.org> Date: 2020-01-14 15:16:54
On Tue, Jan 14, 2020 at 03:15:59PM +0800, Nicolas Boichat wrote:
- I couldn't find a way to detect the number of regulators in the
device tree, if we wanted to refuse to probe the device if there
are too many regulators, which might be required for safety, see
the thread on v2 [1].
You'd need to enumerate all the properties of the device and look
for things matching *-supply.
Reviewed-by: Mark Brown <broonie@kernel.org>
From: Steven Price <steven.price@arm.com> Date: 2020-01-20 14:43:16
On 14/01/2020 07:15, Nicolas Boichat wrote:
Some GPUs, namely, the bifrost/g72 part on MT8183, have a second
regulator for their SRAM, let's add support for that.
We extend the framework in a generic manner so that we could
support more than 2 regulators, if required.
Signed-off-by: Nicolas Boichat <redacted>
---
v3:
- Make this more generic, by allowing any number of regulators
(in practice we fix the maximum number of regulators to 2, but
this could be increased easily).
- We only probe the second regulator if the device tree matching
data asks for it.
- I couldn't find a way to detect the number of regulators in the
device tree, if we wanted to refuse to probe the device if there
are too many regulators, which might be required for safety, see
the thread on v2 [1].
- The discussion also included the idea of a separate device tree
entry for a "soft PDC", or at least a separate driver. I'm not
sure to understand the full picture, and how different vendors
implement this, so I'm still integrating everything in the main
driver. I'd be happy to try to make mt8183 fit into such a
framework after it's created, but I don't think I'm best placed
to implement (and again, the main purpose of this was to test
if the binding is correct).
From discussions offline, I think I've come round to the view that
having a "soft PDC" in device tree isn't the right solution. Device tree
should be describing the hardware and that isn't actually a hardware
component.
I guess we'll have to wait to see how many devices have a similar
'quirk' and whether it's worth representing this is software in a more
generic manner, or if matching on compatible strings will be sufficient
for the devices that need multiple regulators.
One (minor) comment below, but otherwise LGTM.
@@ -87,18 +87,26 @@ static void panfrost_clk_fini(struct panfrost_device *pfdev)staticintpanfrost_regulator_init(structpanfrost_device*pfdev){-intret;+intret,i;-pfdev->regulator=devm_regulator_get(pfdev->dev,"mali");-if(IS_ERR(pfdev->regulator)){-ret=PTR_ERR(pfdev->regulator);-dev_err(pfdev->dev,"failed to get regulator: %d\n",ret);+BUG_ON(pfdev->comp->num_supplies>ARRAY_SIZE(pfdev->regulators));++for(i=0;i<pfdev->comp->num_supplies;i++){+pfdev->regulators[i].supply=pfdev->comp->supply_names[i];+}++ret=devm_regulator_bulk_get(pfdev->dev,+pfdev->comp->num_supplies,+pfdev->regulators);+if(ret<0){+dev_err(pfdev->dev,"failed to get regulators: %d\n",ret);returnret;}-ret=regulator_enable(pfdev->regulator);+ret=regulator_bulk_enable(pfdev->comp->num_supplies,+pfdev->regulators);if(ret<0){-dev_err(pfdev->dev,"failed to enable regulator: %d\n",ret);+dev_err(pfdev->dev,"failed to enable regulators: %d\n",ret);returnret;}
@@ -107,7 +115,8 @@ static int panfrost_regulator_init(struct panfrost_device *pfdev)staticvoidpanfrost_regulator_fini(structpanfrost_device*pfdev){-regulator_disable(pfdev->regulator);+regulator_bulk_disable(pfdev->comp->num_supplies,+pfdev->regulators);}intpanfrost_device_init(structpanfrost_device*pfdev)
From: Steven Price <steven.price@arm.com> Date: 2020-01-20 14:53:50
On 14/01/2020 07:16, Nicolas Boichat wrote:
quoted hunk
When there is a single power domain per device, the core will
ensure the power domain is switched on (so it is technically
equivalent to having not power domain specified at all).
However, when there are multiple domains, as in MT8183 Bifrost
GPU, we need to handle them in driver code.
Signed-off-by: Nicolas Boichat <redacted>
---
The downstream driver we use on chromeos-4.19 currently uses 2
additional devices in device tree to accomodate for this [1], but
I believe this solution is cleaner.
[1] https://chromium.googlesource.com/chromiumos/third_party/kernel/+/refs/heads/chromeos-4.19/drivers/gpu/arm/midgard/platform/mediatek/mali_kbase_runtime_pm.c#31
v3:
- Use the compatible matching data to specify the number of power
domains. Note that setting 0 or 1 in num_pm_domains is equivalent
as the core will handle these 2 cases in the exact same way
(automatically, without driver intervention), and there should
be no adverse consequence in this case (the concern is about
switching on only some power domains and not others).
drivers/gpu/drm/panfrost/panfrost_device.c | 95 ++++++++++++++++++++--
drivers/gpu/drm/panfrost/panfrost_device.h | 9 ++
drivers/gpu/drm/panfrost/panfrost_drv.c | 1 +
3 files changed, 97 insertions(+), 8 deletions(-)
@@ -119,6 +120,75 @@ static void panfrost_regulator_fini(struct panfrost_device *pfdev)pfdev->regulators);}+staticvoidpanfrost_pm_domain_fini(structpanfrost_device*pfdev)+{+inti;++for(i=0;i<ARRAY_SIZE(pfdev->pm_domain_devs);i++){+if(!pfdev->pm_domain_devs[i])+break;++if(pfdev->pm_domain_links[i])+device_link_del(pfdev->pm_domain_links[i]);++dev_pm_domain_detach(pfdev->pm_domain_devs[i],true);+}+}++staticintpanfrost_pm_domain_init(structpanfrost_device*pfdev)+{+interr;+inti,num_domains;++num_domains=of_count_phandle_with_args(pfdev->dev->of_node,+"power-domains",+"#power-domain-cells");++/*+*Singledomainishandledbythecore,and,ifonlyasinglepower+*thepowerdomainisrequested,thepropertyisoptional.+*/+if(num_domains<2&&pfdev->comp->num_pm_domains<2)+return0;++if(num_domains!=pfdev->comp->num_pm_domains){+dev_err(pfdev->dev,+"Incorrect number of power domains: %d provided, %d needed\n",+num_domains,pfdev->comp->num_pm_domains);+return-EINVAL;+}++BUG_ON(num_domains>ARRAY_SIZE(pfdev->pm_domain_devs));++for(i=0;i<num_domains;i++){+pfdev->pm_domain_devs[i]=+dev_pm_domain_attach_by_id(pfdev->dev,i);+if(IS_ERR(pfdev->pm_domain_devs[i])){+err=PTR_ERR(pfdev->pm_domain_devs[i]);+pfdev->pm_domain_devs[i]=NULL;+dev_err(pfdev->dev,+"failed to get pm-domain %d: %d\n",i,err);+gotoerr;+}++pfdev->pm_domain_links[i]=device_link_add(pfdev->dev,+pfdev->pm_domain_devs[i],DL_FLAG_PM_RUNTIME|+DL_FLAG_STATELESS|DL_FLAG_RPM_ACTIVE);+if(!pfdev->pm_domain_links[i]){+dev_err(pfdev->pm_domain_devs[i],+"adding device link failed!\n");+err=-ENODEV;+gotoerr;+}+}++return0;++err:+panfrost_pm_domain_fini(pfdev);+returnerr;+}+intpanfrost_device_init(structpanfrost_device*pfdev){interr;
@@ -73,6 +79,9 @@ struct panfrost_device {structclk*bus_clock;structregulator_bulk_dataregulators[MAX_REGULATORS];structreset_control*rstc;+/* pm_domains for devices with more than one. */+structdevice*pm_domain_devs[MAX_PM_DOMAINS];+structdevice_link*pm_domain_links[MAX_PM_DOMAINS];structpanfrost_featuresfeatures;conststructpanfrost_compatible*comp;
From: Mark Brown <broonie@kernel.org> Date: 2020-01-20 17:03:47
On Mon, Jan 20, 2020 at 02:43:10PM +0000, Steven Price wrote:
From discussions offline, I think I've come round to the view that
having a "soft PDC" in device tree isn't the right solution. Device tree
should be describing the hardware and that isn't actually a hardware
component.
You can use an implementation like that separately to it being in the
device tree, it is perfectly possible to instantiate devices that have
no representation at all in device tree based on other things that are
there like board or SoC information, or as subdevices of things that are
there.
From: Steven Price <steven.price@arm.com> Date: 2020-01-20 17:09:14
On 20/01/2020 17:03, Mark Brown wrote:
On Mon, Jan 20, 2020 at 02:43:10PM +0000, Steven Price wrote:
quoted
From discussions offline, I think I've come round to the view that
having a "soft PDC" in device tree isn't the right solution. Device tree
should be describing the hardware and that isn't actually a hardware
component.
You can use an implementation like that separately to it being in the
device tree, it is perfectly possible to instantiate devices that have
no representation at all in device tree based on other things that are
there like board or SoC information, or as subdevices of things that are
there.
Yes - and I may yet implement a "soft PDC" device if this turns out to
be more than a 'quirk' for a very small number of device. But like you
say - it doesn't need to be (and shouldn't be) in the actual device tree.
For now though I think the code Nicolas has written works well enough
and it's only really worth 'fixing' if we end up with too many 'quirky'
devices.
Steve
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
From: Nicolas Boichat <hidden> Date: 2020-01-21 04:37:27
On Tue, Jan 14, 2020 at 10:16 PM Mark Brown [off-list ref] wrote:
On Tue, Jan 14, 2020 at 03:15:59PM +0800, Nicolas Boichat wrote:
quoted
- I couldn't find a way to detect the number of regulators in the
device tree, if we wanted to refuse to probe the device if there
are too many regulators, which might be required for safety, see
the thread on v2 [1].
You'd need to enumerate all the properties of the device and look
for things matching *-supply.
I see ,-) I was hoping for something slightly cleaner, or maybe an
existing function in the core.
Steven: How strongly do you feel about this? If so I can add that
check in the next revision.
Also, just a heads-up, I'm out for the next 2 weeks, I'll send v4 after that.
From: Steven Price <steven.price@arm.com> Date: 2020-01-22 13:40:05
On 21/01/2020 04:37, Nicolas Boichat wrote:
On Tue, Jan 14, 2020 at 10:16 PM Mark Brown [off-list ref] wrote:
quoted
On Tue, Jan 14, 2020 at 03:15:59PM +0800, Nicolas Boichat wrote:
quoted
- I couldn't find a way to detect the number of regulators in the
device tree, if we wanted to refuse to probe the device if there
are too many regulators, which might be required for safety, see
the thread on v2 [1].
You'd need to enumerate all the properties of the device and look
for things matching *-supply.
I see ,-) I was hoping for something slightly cleaner, or maybe an
existing function in the core.
Steven: How strongly do you feel about this? If so I can add that
check in the next revision.
I'm not that strongly bothered about it - my only worry is that there
may be hardware out there that might be broken by not activating a
regulator. But I don't know how common this multi-regulator design is in
practise.
Thanks,
Steve
Also, just a heads-up, I'm out for the next 2 weeks, I'll send v4 after that.