* [PATCH v3 09/13] dt-bindings: add binding for rk3228 power domains
From: Elaine Zhang @ 2018-05-23 6:51 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
Add binding documentation for the power domains
found on Rockchip RK3228 SoCs.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
index 9a3f5fd36a80..affe36dcfa17 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
+++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
@@ -7,6 +7,7 @@ Required properties for power domain controller:
- compatible: Should be one of the following.
"rockchip,rk3036-power-controller" - for RK3036 SoCs.
"rockchip,rk3128-power-controller" - for RK3128 SoCs.
+ "rockchip,rk3228-power-controller" - for RK3228 SoCs.
"rockchip,rk3288-power-controller" - for RK3288 SoCs.
"rockchip,rk3328-power-controller" - for RK3328 SoCs.
"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -21,6 +22,7 @@ Required properties for power domain sub nodes:
- reg: index of the power domain, should use macros in:
"include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain.
"include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain.
+ "include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain.
@@ -99,6 +101,7 @@ power domain to use.
The index should use macros in:
"include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain.
"include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain.
+ "include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain.
--
1.9.1
^ permalink raw reply related
* [PATCH v3 08/13] dt-bindings: power: add RK3228 SoCs header for power-domain
From: Elaine Zhang @ 2018-05-23 6:51 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
According to a description from TRM, add all the power domains.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
include/dt-bindings/power/rk3228-power.h | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 include/dt-bindings/power/rk3228-power.h
diff --git a/include/dt-bindings/power/rk3228-power.h b/include/dt-bindings/power/rk3228-power.h
new file mode 100644
index 000000000000..6a8dc1bf76ce
--- /dev/null
+++ b/include/dt-bindings/power/rk3228-power.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DT_BINDINGS_POWER_RK3228_POWER_H__
+#define __DT_BINDINGS_POWER_RK3228_POWER_H__
+
+/**
+ * RK3228 idle id Summary.
+ */
+
+#define RK3228_PD_CORE 0
+#define RK3228_PD_MSCH 1
+#define RK3228_PD_BUS 2
+#define RK3228_PD_SYS 3
+#define RK3228_PD_VIO 4
+#define RK3228_PD_VOP 5
+#define RK3228_PD_VPU 6
+#define RK3228_PD_RKVDEC 7
+#define RK3228_PD_GPU 8
+#define RK3228_PD_PERI 9
+#define RK3228_PD_GMAC 10
+
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH v3 07/13] soc: rockchip: power-domain: add power domain support for rk3128
From: Elaine Zhang @ 2018-05-23 6:51 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
This driver is modified to support RK3128 SoC.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
drivers/soc/rockchip/pm_domains.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 01d4ba26a054..99a2dd8a7801 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -19,6 +19,7 @@
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <dt-bindings/power/rk3036-power.h>
+#include <dt-bindings/power/rk3128-power.h>
#include <dt-bindings/power/rk3288-power.h>
#include <dt-bindings/power/rk3328-power.h>
#include <dt-bindings/power/rk3366-power.h>
@@ -720,6 +721,14 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
[RK3036_PD_SYS] = DOMAIN_RK3036(8, 22, 29, false),
};
+static const struct rockchip_domain_info rk3128_pm_domains[] = {
+ [RK3128_PD_CORE] = DOMAIN_RK3288(0, 0, 4, false),
+ [RK3128_PD_MSCH] = DOMAIN_RK3288(-1, -1, 6, true),
+ [RK3128_PD_VIO] = DOMAIN_RK3288(3, 3, 2, false),
+ [RK3128_PD_VIDEO] = DOMAIN_RK3288(2, 2, 1, false),
+ [RK3128_PD_GPU] = DOMAIN_RK3288(1, 1, 3, false),
+};
+
static const struct rockchip_domain_info rk3288_pm_domains[] = {
[RK3288_PD_VIO] = DOMAIN_RK3288(7, 7, 4, false),
[RK3288_PD_HEVC] = DOMAIN_RK3288(14, 10, 9, false),
@@ -796,6 +805,17 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
.domain_info = rk3036_pm_domains,
};
+static const struct rockchip_pmu_info rk3128_pmu = {
+ .pwr_offset = 0x04,
+ .status_offset = 0x08,
+ .req_offset = 0x0c,
+ .idle_offset = 0x10,
+ .ack_offset = 0x10,
+
+ .num_domains = ARRAY_SIZE(rk3128_pm_domains),
+ .domain_info = rk3128_pm_domains,
+};
+
static const struct rockchip_pmu_info rk3288_pmu = {
.pwr_offset = 0x08,
.status_offset = 0x0c,
@@ -875,6 +895,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
.data = (void *)&rk3036_pmu,
},
{
+ .compatible = "rockchip,rk3128-power-controller",
+ .data = (void *)&rk3128_pmu,
+ },
+ {
.compatible = "rockchip,rk3288-power-controller",
.data = (void *)&rk3288_pmu,
},
--
1.9.1
^ permalink raw reply related
* [PATCH v3 06/13] dt-bindings: add binding for rk3128 power domains
From: Elaine Zhang @ 2018-05-23 6:50 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
Add binding documentation for the power domains
found on Rockchip RK3128 SoCs.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
index 79924ee9ae86..9a3f5fd36a80 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
+++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
@@ -6,6 +6,7 @@ powered up/down by software based on different application scenes to save power.
Required properties for power domain controller:
- compatible: Should be one of the following.
"rockchip,rk3036-power-controller" - for RK3036 SoCs.
+ "rockchip,rk3128-power-controller" - for RK3128 SoCs.
"rockchip,rk3288-power-controller" - for RK3288 SoCs.
"rockchip,rk3328-power-controller" - for RK3328 SoCs.
"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -19,6 +20,7 @@ Required properties for power domain controller:
Required properties for power domain sub nodes:
- reg: index of the power domain, should use macros in:
"include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain.
+ "include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain.
@@ -96,6 +98,7 @@ containing a phandle to the power device node and an index specifying which
power domain to use.
The index should use macros in:
"include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain.
+ "include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain.
--
1.9.1
^ permalink raw reply related
* [PATCH v3 05/13] dt-bindings: power: add RK3128 SoCs header for power-domain
From: Elaine Zhang @ 2018-05-23 6:50 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
According to a description from TRM, add all the power domains.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
include/dt-bindings/power/rk3128-power.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 include/dt-bindings/power/rk3128-power.h
diff --git a/include/dt-bindings/power/rk3128-power.h b/include/dt-bindings/power/rk3128-power.h
new file mode 100644
index 000000000000..c051dc3108db
--- /dev/null
+++ b/include/dt-bindings/power/rk3128-power.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DT_BINDINGS_POWER_RK3128_POWER_H__
+#define __DT_BINDINGS_POWER_RK3128_POWER_H__
+
+/* VD_CORE */
+#define RK3128_PD_CORE 0
+
+/* VD_LOGIC */
+#define RK3128_PD_VIO 1
+#define RK3128_PD_VIDEO 2
+#define RK3128_PD_GPU 3
+#define RK3128_PD_MSCH 4
+
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH v3 04/13] soc: rockchip: power-domain: Fix wrong value when power up pd
From: Elaine Zhang @ 2018-05-23 6:48 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao, Finley Xiao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
From: Finley Xiao <finley.xiao@rock-chips.com>
Solve the pd could only ever turn off but never turn them on again,
If the pd registers have the writemask bits.
Fix up the code error for commit:
commit 79bb17ce8edb3141339b5882e372d0ec7346217c
Author: Elaine Zhang <zhangqing@rock-chips.com>
Date: Fri Dec 23 11:47:52 2016 +0800
soc: rockchip: power-domain: Support domain control in hiword-registers
New Rockchips SoCs may have their power-domain control in registers
using a writemask-based access scheme (upper 16bit being the write
mask). So add a DOMAIN_M type and handle this case accordingly.
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
drivers/soc/rockchip/pm_domains.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index ebd7c41898c0..01d4ba26a054 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -264,7 +264,7 @@ static void rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
return;
else if (pd->info->pwr_w_mask)
regmap_write(pmu->regmap, pmu->info->pwr_offset,
- on ? pd->info->pwr_mask :
+ on ? pd->info->pwr_w_mask :
(pd->info->pwr_mask | pd->info->pwr_w_mask));
else
regmap_update_bits(pmu->regmap, pmu->info->pwr_offset,
--
1.9.1
^ permalink raw reply related
* [PATCH v3 03/13] Soc: rockchip: power-domain: add power domain support for rk3036
From: Elaine Zhang @ 2018-05-23 6:48 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
From: Caesar Wang <wxt@rock-chips.com>
This driver is modified to support RK3036 SoC.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
drivers/soc/rockchip/pm_domains.c | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/drivers/soc/rockchip/pm_domains.c b/drivers/soc/rockchip/pm_domains.c
index 53efc386b1ad..ebd7c41898c0 100644
--- a/drivers/soc/rockchip/pm_domains.c
+++ b/drivers/soc/rockchip/pm_domains.c
@@ -18,6 +18,7 @@
#include <linux/clk.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
+#include <dt-bindings/power/rk3036-power.h>
#include <dt-bindings/power/rk3288-power.h>
#include <dt-bindings/power/rk3328-power.h>
#include <dt-bindings/power/rk3366-power.h>
@@ -102,6 +103,14 @@ struct rockchip_pmu {
.ack_mask = (ack >= 0) ? BIT(ack) : 0, \
.active_wakeup = wakeup, \
}
+#define DOMAIN_RK3036(req, ack, idle, wakeup) \
+{ \
+ .req_mask = (req >= 0) ? BIT(req) : 0, \
+ .req_w_mask = (req >= 0) ? BIT(req + 16) : 0, \
+ .ack_mask = (ack >= 0) ? BIT(ack) : 0, \
+ .idle_mask = (idle >= 0) ? BIT(idle) : 0, \
+ .active_wakeup = wakeup, \
+}
#define DOMAIN_RK3288(pwr, status, req, wakeup) \
DOMAIN(pwr, status, req, req, (req) + 16, wakeup)
@@ -701,6 +710,16 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
return error;
}
+static const struct rockchip_domain_info rk3036_pm_domains[] = {
+ [RK3036_PD_MSCH] = DOMAIN_RK3036(14, 23, 30, true),
+ [RK3036_PD_CORE] = DOMAIN_RK3036(13, 17, 24, false),
+ [RK3036_PD_PERI] = DOMAIN_RK3036(12, 18, 25, false),
+ [RK3036_PD_VIO] = DOMAIN_RK3036(11, 19, 26, false),
+ [RK3036_PD_VPU] = DOMAIN_RK3036(10, 20, 27, false),
+ [RK3036_PD_GPU] = DOMAIN_RK3036(9, 21, 28, false),
+ [RK3036_PD_SYS] = DOMAIN_RK3036(8, 22, 29, false),
+};
+
static const struct rockchip_domain_info rk3288_pm_domains[] = {
[RK3288_PD_VIO] = DOMAIN_RK3288(7, 7, 4, false),
[RK3288_PD_HEVC] = DOMAIN_RK3288(14, 10, 9, false),
@@ -768,6 +787,15 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
[RK3399_PD_SDIOAUDIO] = DOMAIN_RK3399(31, 31, 29, true),
};
+static const struct rockchip_pmu_info rk3036_pmu = {
+ .req_offset = 0x148,
+ .idle_offset = 0x14c,
+ .ack_offset = 0x14c,
+
+ .num_domains = ARRAY_SIZE(rk3036_pm_domains),
+ .domain_info = rk3036_pm_domains,
+};
+
static const struct rockchip_pmu_info rk3288_pmu = {
.pwr_offset = 0x08,
.status_offset = 0x0c,
@@ -843,6 +871,10 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
static const struct of_device_id rockchip_pm_domain_dt_match[] = {
{
+ .compatible = "rockchip,rk3036-power-controller",
+ .data = (void *)&rk3036_pmu,
+ },
+ {
.compatible = "rockchip,rk3288-power-controller",
.data = (void *)&rk3288_pmu,
},
--
1.9.1
^ permalink raw reply related
* [PATCH v3 02/13] dt-bindings: add binding for rk3036 power domains
From: Elaine Zhang @ 2018-05-23 6:48 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
From: Caesar Wang <wxt@rock-chips.com>
Add binding documentation for the power domains
found on Rockchip RK3036 SoCs.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Documentation/devicetree/bindings/soc/rockchip/power_domain.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
index 301d2a9bc1b8..79924ee9ae86 100644
--- a/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
+++ b/Documentation/devicetree/bindings/soc/rockchip/power_domain.txt
@@ -5,6 +5,7 @@ powered up/down by software based on different application scenes to save power.
Required properties for power domain controller:
- compatible: Should be one of the following.
+ "rockchip,rk3036-power-controller" - for RK3036 SoCs.
"rockchip,rk3288-power-controller" - for RK3288 SoCs.
"rockchip,rk3328-power-controller" - for RK3328 SoCs.
"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -17,6 +18,7 @@ Required properties for power domain controller:
Required properties for power domain sub nodes:
- reg: index of the power domain, should use macros in:
+ "include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain.
@@ -93,6 +95,7 @@ Node of a device using power domains must have a power-domains property,
containing a phandle to the power device node and an index specifying which
power domain to use.
The index should use macros in:
+ "include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain.
"include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
"include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain.
"include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain.
--
1.9.1
^ permalink raw reply related
* [PATCH v3 01/13] dt-bindings: power: add RK3036 SoCs header for power-domain
From: Elaine Zhang @ 2018-05-23 6:48 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
In-Reply-To: <1527058129-10260-1-git-send-email-zhangqing@rock-chips.com>
From: Caesar Wang <wxt@rock-chips.com>
According to a description from TRM, add all the power domains.
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
include/dt-bindings/power/rk3036-power.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 include/dt-bindings/power/rk3036-power.h
diff --git a/include/dt-bindings/power/rk3036-power.h b/include/dt-bindings/power/rk3036-power.h
new file mode 100644
index 000000000000..0bc6b5d5075e
--- /dev/null
+++ b/include/dt-bindings/power/rk3036-power.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef __DT_BINDINGS_POWER_RK3036_POWER_H__
+#define __DT_BINDINGS_POWER_RK3036_POWER_H__
+
+#define RK3036_PD_MSCH 0
+#define RK3036_PD_CORE 1
+#define RK3036_PD_PERI 2
+#define RK3036_PD_VIO 3
+#define RK3036_PD_VPU 4
+#define RK3036_PD_GPU 5
+#define RK3036_PD_SYS 6
+
+#endif
--
1.9.1
^ permalink raw reply related
* [PATCH v3 00/13] add power domain support for Rockchip Socs
From: Elaine Zhang @ 2018-05-23 6:48 UTC (permalink / raw)
To: heiko, robh+dt, mark.rutland
Cc: devicetree, rjw, khilman, ulf.hansson, linux-pm, linux-arm-kernel,
linux-rockchip, linux-kernel, wxt, xxx, xf, huangtao,
Elaine Zhang
add power domain support for RK3036/RK3128/RK3228/PX30 Soc.
fix up the wrong value when set power domain up.
Change in V2:
Fix up the commit message description and Assign author.
Change in V3:
[PATCH 01/13]: The Copyright description use SPDX tag instead.
[PATCH 05/13]: The Copyright description use SPDX tag instead.
[PATCH 08/13]: The Copyright description use SPDX tag instead.
[PATCH 11/13]: The Copyright description use SPDX tag instead.
Caesar Wang (3):
dt-bindings: power: add RK3036 SoCs header for power-domain
dt-bindings: add binding for rk3036 power domains
Soc: rockchip: power-domain: add power domain support for rk3036
Elaine Zhang (6):
dt-bindings: power: add RK3128 SoCs header for power-domain
dt-bindings: add binding for rk3128 power domains
soc: rockchip: power-domain: add power domain support for rk3128
dt-bindings: power: add RK3228 SoCs header for power-domain
dt-bindings: add binding for rk3228 power domains
soc: rockchip: power-domain: add power domain support for rk3228
Finley Xiao (4):
soc: rockchip: power-domain: Fix wrong value when power up pd
dt-bindings: power: add PX30 SoCs header for power-domain
dt-bindings: add binding for px30 power domains
soc: rockchip: power-domain: add power domain support for px30
.../bindings/soc/rockchip/power_domain.txt | 12 +++
drivers/soc/rockchip/pm_domains.c | 116 ++++++++++++++++++++-
include/dt-bindings/power/px30-power.h | 27 +++++
include/dt-bindings/power/rk3036-power.h | 13 +++
include/dt-bindings/power/rk3128-power.h | 14 +++
include/dt-bindings/power/rk3228-power.h | 21 ++++
6 files changed, 202 insertions(+), 1 deletion(-)
create mode 100644 include/dt-bindings/power/px30-power.h
create mode 100644 include/dt-bindings/power/rk3036-power.h
create mode 100644 include/dt-bindings/power/rk3128-power.h
create mode 100644 include/dt-bindings/power/rk3228-power.h
--
1.9.1
^ permalink raw reply
* Re: [PATCH v6 2/6] dt-bindings: Add the rzn1-clocks.h file
From: M P @ 2018-05-23 6:44 UTC (permalink / raw)
To: geert
Cc: michel.pollet, linux-renesas-soc, horms, Phil Edworthy,
buserror+upstream, magnus.damm, robh+dt, mark.rutland, mturquette,
sboyd, geert+renesas, devicetree, linux-kernel, linux-clk
In-Reply-To: <CAMuHMdW-HUBRF4rLdfzixcyMUBg7+4XU+-3zayePoyeQiBZ8ZA@mail.gmail.com>
On Tue, 22 May 2018 at 19:44, Geert Uytterhoeven <geert@linux-m68k.org>
wrote:
> Hi Michel,
> On Tue, May 22, 2018 at 12:01 PM, Michel Pollet
> <michel.pollet@bp.renesas.com> wrote:
> > This adds the constants necessary to use the renesas,rzn1-clocks driver.
> >
> > Signed-off-by: Michel Pollet <michel.pollet@bp.renesas.com>
> Thanks for your patch!
> > ---
> > include/dt-bindings/clock/rzn1-clocks.h | 187
++++++++++++++++++++++++++++++++
> > 1 file changed, 187 insertions(+)
> > create mode 100644 include/dt-bindings/clock/rzn1-clocks.h
> >
> > diff --git a/include/dt-bindings/clock/rzn1-clocks.h
b/include/dt-bindings/clock/rzn1-clocks.h
> > new file mode 100644
> > index 0000000..8a73db2
> > --- /dev/null
> > +++ b/include/dt-bindings/clock/rzn1-clocks.h
> Given this is part of the DT ABI, and there exist multiple different RZ/N1
> SoCs (and there are probably planned more), I wouldn't call this header
> file "rzn1-clocks.h", but e.g. "r9a06g032-clocks.h".
Actually, no, there already are two r906g03X devices that will work
perfectly fine with this driver. We had that discussion before, and you
insist and me removing mentions of the rzn1 everywhere, however, this
applies to *two* devices already, and I'm supposed to upstream support for
them. I can't rename r9g06g032 because it is *inexact* that's why it's
called rzn1. So unless you let me call it r9a06g0xx-clocks.h (which i know
you won't as per multiple previous discussions) this can't be called
r9a06g032 because it won't be fit for my purpose when I try to bring back
the RZ/N1S into the picture. There are minor difference to clocking,
I don't know if Renesas plans to release any more rzn1's in this series,
but my little finger tells me this isn't the case. But regardless of what
we plan, Marketing will screw it up.
Cheers,
Michel
> > @@ -0,0 +1,187 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +/*
> > + * RZ/N1 clock IDs
> > + *
> > + * Copyright (C) 2018 Renesas Electronics Europe Limited
> > + *
> > + * Michel Pollet <michel.pollet@bp.renesas.com>, <buserror@gmail.com>
> > + * Derived from zx-reboot.c
> > + */
> > +
> > +#ifndef __DT_BINDINGS_RZN1_CLOCK_H__
> > +#define __DT_BINDINGS_RZN1_CLOCK_H__
> > +
> > +#define RZN1_CLKOUT 0
> Similar for the RZN1 prefix.
> I'll look at the actual list of clocks later...
> Gr{oetje,eeting}s,
> Geert
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 --
geert@linux-m68k.org
> In personal conversations with technical people, I call myself a hacker.
But
> when I'm talking to journalists I just say "programmer" or something like
that.
> -- Linus Torvalds
^ permalink raw reply
* Re: [SPAM]Re: [PATCH v2 4/7] Bluetooth: Add new quirk for non-persistent setup settings
From: Sean Wang @ 2018-05-23 6:37 UTC (permalink / raw)
To: Marcel Holtmann
Cc: Mark Rutland, devicetree, Johan Hedberg,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, BlueZ development,
Rob Herring, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-arm-kernel
In-Reply-To: <1526976323.18877.47.camel@mtkswgap22>
[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]
On Tue, 2018-05-22 at 16:05 +0800, Sean Wang wrote:
> On Tue, 2018-05-22 at 09:21 +0200, Marcel Holtmann wrote:
> > Hi Sean,
> >
>
> [ ... ]
>
> > > - if (hci_dev_test_flag(hdev, HCI_SETUP)) {
> > > + if (hci_dev_test_flag(hdev, HCI_SETUP) ||
> > > + test_bit(HCI_QUIRK_NON_PERSISTENT_SETUP, &hdev->quirks)) {
> > > hci_sock_dev_event(hdev, HCI_DEV_SETUP);
> >
> > I am not 100% sure that we want to send the HCI_DEV_SETUP event also multiple times. That is a userspace change that I would need to think about. We need to check create_monitor_event() and see what the btmon trace for this looks like. Can you send me a btmon -w trace.log when this change is active.
> >
> > Regards
> >
> > Marcel
> >
>
> Sure, I'll send you the trace.log with the change is active.
>
> Sean
>
Hi, Marcel
Attached trace.log was captured when I inputted commands power on and
then off in bluetoothctl.
Sean
>
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: trace.log --]
[-- Type: text/x-log; name="trace.log"; charset="UTF-8", Size: 6573 bytes --]
btsnoop\0\0\0\0\x01\0\0\aÑ\0\0\0$\0\0\0$ÿÿ\0\f\0\0\0\0\0âJ|Linux version 4.16.0-rc1+ (aarch64)\0\0\0\0!\0\0\0!ÿÿ\0\f\0\0\0\0\0âJ|Bluetooth subsystem version 2.22\0\0\0\0\x10\0\0\0\x10\0\0\0\0\0\0\0\0\0âJ|¡\0\x03\x01"vF\0\0hci0\0\0\0\0\0\0\0\x1e\0\0\0\x1eÿÿ\0\x0e\0\0\0\0\0âJ|¥\x01\0\0\0\x02\0\x01\x0e\0\x01\0\0\0\x10bluetoothd\0\0\0\0\0\0\0\0\0\x1e\0\0\0\x1eÿÿ\0\x0e\0\0\0\0\0âJ|ø\x02\0\0\0\x02\0\x01\x0e\0\x01\0\0\0\x10btmon\0\0\0\0\0\0\0\0\0\0\0\0\0\0\a\0\0\0\a\0\0\0\x10\0\0\0\0\0âJïq\x03\x01\0\0\0\x05\0\x01\0\0\0\0\0\0\0\0\0\0\0\b\0\0\0\0\0âJò1^[\0\0\0\b\0\0\0\b\0\0\0
\0\0\0\0\0âJò1&\x01"vF\0\0F\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò%ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò\bä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòþä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòéä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÕä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò¢¸ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò¦ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòªzä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò®Vä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò²6ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò¶\x15ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò¹öä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò½Öä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÁ¶ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÅä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÉyä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÍUä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÑ6ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÕ\x17ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòØ÷ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÜ×ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòà·ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòää\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòètä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòìTä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòð5ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòô\x15ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJò÷öä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòû×ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJòÿºä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x03ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\aä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\vhä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x0fJä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x13,ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x17\x12ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x1aòä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\x1eÕä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó"·ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó&ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó*ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó.bä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó2Dä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó6*ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó:\rä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó=ïä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóAÑä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóE·ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóIä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóM|ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóQ^ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóUEä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóY)ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó]\vä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó`îä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJódÕä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóh·ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJólä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóp{ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJótbä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóxFä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó|)ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó\vä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóñä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóÓä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóµä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó}ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóaä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóCä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó%ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó£\rä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó¦ïä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóªÒä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó®´ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJó²ä\x05\x02\x01\x01\0\0\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóµ:ä\x05\x02\x01\x01\0\0\0\0\0\b\0\0\0\b\0\0\0\x02\0\0\0\0\0âJóµ]oü\x05\x01\a\x01\0\x04\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJóµØä\x05\x02\a\x01\0\0\0\0\0 \0\0\0 \0\0\0\x02\0\0\0\0\0âJ\x12©Ïoü\x06\x01\x06\x02\0\0\x01\0\0\0\a\0\0\0\a\0\0\0\x03\0\0\0\0\0âJ\x13Ü\0ä\x05\x02\x06\x01\0\0\0\0\0\x03\0\0\0\x03\0\0\0\x02\0\0\0\0\0âJ1lþ\x03\f\0\0\0\0\x06\0\0\0\x06\0\0\0\x03\0\0\0\0\0âJ1\x7f#\x0e\x04\x01\x03\f\0\0\0\0\x03\0\0\0\x03\0\0\0\x02\0\0\0\0\0âJ1\x7fM\x03\x10\0\0\0\0\x0e\0\0\0\x0e\0\0\0\x03\0\0\0\0\0âJ1\x7fí\x0e\f\x01\x03\x10\0¿>þÛÿ{\0\0\0\x03\0\0\0\x03\0\0\0\x02\0\0\0\0\0âJ1\x03\x01\x10\0\0\0\0\v\0\0\0\v\0\0\0\x03\0\0\0\0\0âJ1\x13ÿ )\x19 \x17 H\a\x11\0\0\0\0\x0e\0\0\0\x0e\0\0\0\x03\0\0\0\0\0âJ1\x0e\f\x01\x01\x10\0\b\a\x11\bF\0\x19 \0\0\0\x03\0\0\0\x03\0\0\0\x02\0\0\0\0\0âJ1 \x10\0\0\0\0\f\0\0\0\f\0\0\0\x03\0\0\0\0\0âJ1+\x0e
\x01 \x10\0\x01"vF\0\0\0\0\0\x03\0\0\0\x03\0\0\0\x02\0\0\0\0\0âJ1q\x05\x10\0\0\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\0âJ{<\x01\0\0\0\x01\0\x05\0\0Ð
\0\0\0\0\0
\0\0\0
\0\0\0\x11\0\0\0\0\0âJ{L\x02\0\0\0\x06\0Ð
\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0âJ{i
[-- Attachment #3: Type: text/plain, Size: 200 bytes --]
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek
^ permalink raw reply
* Re: [PATCH v6 4/5] arm64: dts: sdm845: Add serial console support
From: Rajendra Nayak @ 2018-05-23 6:30 UTC (permalink / raw)
To: Karthikeyan Ramasubramanian, corbet, andy.gross, david.brown,
robh+dt, mark.rutland, wsa
Cc: linux-doc, linux-arm-msm, devicetree, linux-i2c, evgreen,
acourbot, swboyd, dianders, bjorn.andersson
In-Reply-To: <1522429700-13083-5-git-send-email-kramasub@codeaurora.org>
On 03/30/2018 10:38 PM, Karthikeyan Ramasubramanian wrote:
> From: Rajendra Nayak <rnayak@codeaurora.org>
>
> Add the qup uart node and geni se instance needed to
> support the serial console on the MTP.
>
> Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
> Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
> ---
Andy, is it possible to pull this one in for 4.18?
Sorry, I only realized we somehow missed this after looking at your pull request.
This is the only patch that prevents linux-next from booting up my sdm845 MTP
to a minimal console shell.
Thanks,
Rajendra
> arch/arm64/boot/dts/qcom/sdm845-mtp.dts | 41 +++++++++++++++++++++++++++++++++
> arch/arm64/boot/dts/qcom/sdm845.dtsi | 39 +++++++++++++++++++++++++++++++
> 2 files changed, 80 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> index 979ab49..17b2fb0 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> +++ b/arch/arm64/boot/dts/qcom/sdm845-mtp.dts
> @@ -12,4 +12,45 @@
> / {
> model = "Qualcomm Technologies, Inc. SDM845 MTP";
> compatible = "qcom,sdm845-mtp";
> +
> + aliases {
> + serial0 = &uart2;
> + };
> +
> + chosen {
> + stdout-path = "serial0:115200n8";
> + };
> +};
> +
> +&soc {
> + geniqup@ac0000 {
> + status = "okay";
> +
> + serial@a84000 {
> + status = "okay";
> + };
> + };
> +
> + pinctrl@3400000 {
> + qup-uart2-default {
> + pinconf_tx {
> + pins = "gpio4";
> + drive-strength = <2>;
> + bias-disable;
> + };
> +
> + pinconf_rx {
> + pins = "gpio5";
> + drive-strength = <2>;
> + bias-pull-up;
> + };
> + };
> +
> + qup-uart2-sleep {
> + pinconf {
> + pins = "gpio4", "gpio5";
> + bias-pull-down;
> + };
> + };
> + };
> };
> diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> index 32f8561..71801b9 100644
> --- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
> @@ -6,6 +6,7 @@
> */
>
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> +#include <dt-bindings/clock/qcom,gcc-sdm845.h>
>
> / {
> interrupt-parent = <&intc>;
> @@ -194,6 +195,20 @@
> #gpio-cells = <2>;
> interrupt-controller;
> #interrupt-cells = <2>;
> +
> + qup_uart2_default: qup-uart2-default {
> + pinmux {
> + function = "qup9";
> + pins = "gpio4", "gpio5";
> + };
> + };
> +
> + qup_uart2_sleep: qup-uart2-sleep {
> + pinmux {
> + function = "gpio";
> + pins = "gpio4", "gpio5";
> + };
> + };
> };
>
> timer@17c90000 {
> @@ -272,5 +287,29 @@
> #interrupt-cells = <4>;
> cell-index = <0>;
> };
> +
> + geniqup@ac0000 {
> + compatible = "qcom,geni-se-qup";
> + reg = <0xac0000 0x6000>;
> + clock-names = "m-ahb", "s-ahb";
> + clocks = <&gcc GCC_QUPV3_WRAP_1_M_AHB_CLK>,
> + <&gcc GCC_QUPV3_WRAP_1_S_AHB_CLK>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> + status = "disabled";
> +
> + uart2: serial@a84000 {
> + compatible = "qcom,geni-debug-uart";
> + reg = <0xa84000 0x4000>;
> + clock-names = "se";
> + clocks = <&gcc GCC_QUPV3_WRAP1_S1_CLK>;
> + pinctrl-names = "default", "sleep";
> + pinctrl-0 = <&qup_uart2_default>;
> + pinctrl-1 = <&qup_uart2_sleep>;
> + interrupts = <GIC_SPI 354 IRQ_TYPE_LEVEL_HIGH>;
> + status = "disabled";
> + };
> + };
> };
> };
>
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply
* Re: [PATCH] remoteproc: Add APSS based Qualcomm ADSP PIL driver for SDM845
From: Bjorn Andersson @ 2018-05-23 6:26 UTC (permalink / raw)
To: Rohit kumar
Cc: ohad, robh+dt, mark.rutland, linux-remoteproc, devicetree,
linux-kernel, bgoswami, sbpata, asishb, rkarra,
RajendraBabu Medisetti, Krishnamurthy Renu
In-Reply-To: <1526194908-19027-1-git-send-email-rohitkr@codeaurora.org>
On Sun 13 May 00:01 PDT 2018, Rohit kumar wrote:
> This adds Qualcomm ADSP PIL driver support for SDM845 with ADSP bootup
> and shutdown operation handled from Application Processor SubSystem(APSS).
>
> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
> Signed-off-by: RajendraBabu Medisetti <rajendrabm@codeaurora.org>
> Signed-off-by: Krishnamurthy Renu <krishnamurthy.renu@codeaurora.org>
> ---
> .../devicetree/bindings/remoteproc/qcom,adsp.txt | 1 +
> drivers/remoteproc/Makefile | 3 +-
> drivers/remoteproc/qcom_adsp_pil.c | 122 ++++-----
> drivers/remoteproc/qcom_adsp_pil.h | 86 ++++++
> drivers/remoteproc/qcom_adsp_pil_sdm845.c | 304 +++++++++++++++++++++
> 5 files changed, 454 insertions(+), 62 deletions(-)
> create mode 100644 drivers/remoteproc/qcom_adsp_pil.h
> create mode 100644 drivers/remoteproc/qcom_adsp_pil_sdm845.c
>
> diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> index 728e419..a9fe033 100644
> --- a/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> +++ b/Documentation/devicetree/bindings/remoteproc/qcom,adsp.txt
> @@ -10,6 +10,7 @@ on the Qualcomm ADSP Hexagon core.
> "qcom,msm8974-adsp-pil"
> "qcom,msm8996-adsp-pil"
> "qcom,msm8996-slpi-pil"
> + "qcom,sdm845-apss-adsp-pil"
Afaict there's nothing in this binding that ties this to the apss, so I
don't think we should base the compatible on this. The differentiation
is PAS vs non-PAS; so let's start naming the PAS variants
"qcom,platform-subsystem-pas" and the non-PAS
"qcom,platform-subsystem-pil" instead.
I.e. please make this "qcom,sdm845-adsp-pil".
More importantly, any resources such as clocks or reset lines should
come from DT and as such you need to extend the binding quite a bit -
which I suggest you do by introducing a new binding document.
>
> - interrupts-extended:
> Usage: required
> diff --git a/drivers/remoteproc/Makefile b/drivers/remoteproc/Makefile
> index 02627ed..759831b 100644
> --- a/drivers/remoteproc/Makefile
> +++ b/drivers/remoteproc/Makefile
> @@ -14,7 +14,8 @@ obj-$(CONFIG_OMAP_REMOTEPROC) += omap_remoteproc.o
> obj-$(CONFIG_WKUP_M3_RPROC) += wkup_m3_rproc.o
> obj-$(CONFIG_DA8XX_REMOTEPROC) += da8xx_remoteproc.o
> obj-$(CONFIG_KEYSTONE_REMOTEPROC) += keystone_remoteproc.o
> -obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp_pil.o
> +obj-$(CONFIG_QCOM_ADSP_PIL) += qcom_adsp.o
> +qcom_adsp-objs += qcom_adsp_pil.o qcom_adsp_pil_sdm845.o
> obj-$(CONFIG_QCOM_RPROC_COMMON) += qcom_common.o
> obj-$(CONFIG_QCOM_Q6V5_PIL) += qcom_q6v5_pil.o
> obj-$(CONFIG_QCOM_SYSMON) += qcom_sysmon.o
> diff --git a/drivers/remoteproc/qcom_adsp_pil.c b/drivers/remoteproc/qcom_adsp_pil.c
I get the feeling that the main reason for modifying this file is its
name, not that it reduces the complexity of the final solution. I
definitely think it's cleaner to have some structural duplication and
keep this driver handling the various PAS based remoteprocs.
Please see the RFC series I posted reducing the duplication between the
various "Q6V5 drivers".
[..]
> diff --git a/drivers/remoteproc/qcom_adsp_pil.h b/drivers/remoteproc/qcom_adsp_pil.h
[..]
> +static inline void update_bits(void *reg, u32 mask_val, u32 set_val, u32 shift)
> +{
> + u32 reg_val = 0;
> +
> + reg_val = ((readl(reg)) & ~mask_val) | ((set_val << shift) & mask_val);
> + writel(reg_val, reg);
> +}
> +
> +static inline unsigned int read_bit(void *reg, u32 mask, int shift)
> +{
> + return ((readl(reg) & mask) >> shift);
> +}
I don't like these helper functions, their prototype is nonstandard and
makes it really hard to read all the calling code.
I would prefer if you just inline the operations directly, to make it
clearer what's going on in each case - if not then at least follow the
prototype of e.g. regmap_udpate_bits(), which people might be used to.
> +
> +#endif
> diff --git a/drivers/remoteproc/qcom_adsp_pil_sdm845.c b/drivers/remoteproc/qcom_adsp_pil_sdm845.c
> new file mode 100644
> index 0000000..7518385
> --- /dev/null
> +++ b/drivers/remoteproc/qcom_adsp_pil_sdm845.c
> @@ -0,0 +1,304 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * Qualcomm APSS Based ADSP bootup/shutdown ops for SDM845.
> + * Copyright (c) 2018, The Linux Foundation. All rights reserved.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +
> +#include "qcom_adsp_pil.h"
> +
> +/* set values */
> +#define CLK_ENABLE 0x1
> +#define CLK_DISABLE 0x0
Just write 0 and 1 in the code, it saves future readers the trouble of
having to remember if these are special in any way.
> +/* time out value */
> +#define ACK_TIMEOUT 200000
This is currently given in the rather awkward unit of 5uS. As it's input
to what should have been a call to readl_poll_timeout() please express
it in micro seconds.
> +/* mask values */
> +#define CLK_MASK GENMASK(4, 0)
> +#define EVB_MASK GENMASK(27, 4)
> +#define SPIN_CLKOFF_MASK BIT(31)
> +#define AUDIO_SYNC_RESET_MASK BIT(2)
> +#define CLK_ENABLE_MASK BIT(0)
> +#define HAL_CLK_MASK BIT(1)
> +/* GCC register offsets */
> +#define GCC_BASE 0x00147000
This doesn't belong here, expose the resource from the gcc driver using
existing frameworks.
> +#define SWAY_CBCR_OFFSET 0x00000008
> +/*LPASS register base address and offsets*/
> +#define LPASS_BASE 0x17000000
This should be in the lpass clock driver.
> +#define AON_CBCR_OFFSET 0x00014098
> +#define CMD_RCGR_OFFSET 0x00014000
> +#define CFG_RCGR_OFFSET 0x00014004
> +#define AHBS_AON_CBCR_OFFSET 0x00033000
> +#define AHBM_AON_CBCR_OFFSET 0x00026000
> +/*QDSP6SS register base address and offsets*/
> +#define QDSP6SS_BASE 0x17300000
This should come from the reg property in DT.
> +#define RST_EVB_OFFSET 0x00000010
> +#define SLEEP_CBCR_OFFSET 0x0000003C
> +#define XO_CBCR_OFFSET 0x00000038
> +#define CORE_CBCR_OFFSET 0x00000020
> +#define CORE_START_OFFSET 0x00000400
> +#define BOOT_CMD_OFFSET 0x00000404
> +#define BOOT_STATUS_OFFSET 0x00000408
> +#define RET_CFG_OFFSET 0x0000001C
> +/*TCSR register base address and offsets*/
> +#define TCSR_BASE 0x01F62000
Look at how we deal with TCSR in the MSS driver instead.
> +#define TCSR_LPASS_MASTER_IDLE_OFFSET 0x00000008
> +#define TCSR_LPASS_HALTACK_OFFSET 0x00000004
> +#define TCSR_LPASS_PWR_ON_OFFSET 0x00000010
> +#define TCSR_LPASS_HALTREQ_OFFSET 0X00000000
> +
> +#define RPMH_PDC_SYNC_RESET_ADDR 0x0B2E0100
> +#define AOSS_CC_LPASS_RESTART_ADDR 0x0C2D0000
Please expose these from an appropriate driver using appropriate
frameworks.
> +
> +struct sdm845_reg {
> + void __iomem *gcc_base;
> + void __iomem *lpass_base;
> + void __iomem *qdsp6ss_base;
> + void __iomem *tcsr_base;
> + void __iomem *pdc_sync;
> + void __iomem *cc_lpass;
I expect to see only qdsp6ss_base remain here.
> +};
> +
> +static int sdm845_map_registers(struct qcom_adsp *adsp,
> + struct platform_device *pdev)
> +{
> + struct sdm845_reg *reg;
> +
> + adsp->priv_reg = devm_kzalloc(&pdev->dev, sizeof(struct sdm845_reg),
> + GFP_KERNEL);
> + if (!adsp->priv_reg)
> + return -ENOMEM;
> +
> + reg = adsp->priv_reg;
> +
> + reg->gcc_base = devm_ioremap(adsp->dev, GCC_BASE, 0xc);
> + if (!reg->gcc_base) {
> + dev_err(adsp->dev, "%s: failed to map GCC base registers\n",
> + __func__);
> + return -ENOMEM;
> + }
> +
> + reg->lpass_base = devm_ioremap(adsp->dev, LPASS_BASE, 0x8E004);
> + if (!reg->lpass_base) {
> + dev_err(adsp->dev, "%s: failed to map LPASS base registers\n",
> + __func__);
> + return -ENOMEM;
> + }
> + reg->qdsp6ss_base = devm_ioremap(adsp->dev, QDSP6SS_BASE, 0x40c);
> + if (!reg->qdsp6ss_base) {
> + dev_err(adsp->dev, "%s: failed to map QDSP6SS base registers\n",
> + __func__);
> + return -ENOMEM;
> + }
> + reg->tcsr_base = devm_ioremap(adsp->dev, TCSR_BASE, 0x14);
> + if (!reg->tcsr_base) {
> + dev_err(adsp->dev, "%s: failed to map TCSR base registers\n",
> + __func__);
> + return -ENOMEM;
> + }
> + reg->pdc_sync = devm_ioremap(adsp->dev, RPMH_PDC_SYNC_RESET_ADDR, 0x4);
> + if (!reg->pdc_sync) {
> + dev_err(adsp->dev, "%s: failed to map RPMH_PDC_SYNC_RESET register\n",
> + __func__);
> + return -ENOMEM;
> + }
> + reg->cc_lpass = devm_ioremap(adsp->dev, AOSS_CC_LPASS_RESTART_ADDR,
> + 0x4);
> + if (!reg->cc_lpass) {
> + dev_err(adsp->dev, "%s:failed to map AOSS_CC_LPASS_RESTART register\n",
> + __func__);
> + return -ENOMEM;
> + }
> +
> + return 0;
> +}
> +
> +static int clk_enable_spin(void *reg, int read_shift, int write_shift)
This should be in the appropriate clock drivers.
> +{
> + u32 maxDelay = 500;
> + u32 val;
> +
> + update_bits(reg, CLK_ENABLE_MASK, CLK_ENABLE, write_shift);
> + val = readl(reg);
> + if (!(readl(reg) & HAL_CLK_MASK)) {
> + /*
> + * wait for disabling of HW signal CLK_OFF to confirm that
> + * clock is actually ON.
> + */
> + while (maxDelay-- && read_bit(reg, SPIN_CLKOFF_MASK,
> + read_shift))
> + udelay(1);
> + }
> + if (!maxDelay) {
> + pr_err("%s: fail to update register = %p\n", __func__, reg);
> + return -ETIMEDOUT;
> + }
> + return 0;
> +}
> +
> +static int sdm845_adsp_clk_enable(struct qcom_adsp *adsp)
> +{
> + u32 ret;
> + u32 maxDelay = 100;
> + struct sdm845_reg *reg = adsp->priv_reg;
> +
> + /* Enable SWAY clock */
> + ret = clk_enable_spin(reg->gcc_base + SWAY_CBCR_OFFSET, CLK_MASK, 0x0);
> + if (ret)
> + return ret;
> +
> + /* Enable LPASS AHB AON Bus */
> + ret = clk_enable_spin(reg->lpass_base + AON_CBCR_OFFSET, CLK_MASK, 0x0);
> + if (ret)
> + return ret;
> +
> + /* Set the AON clock root to be sourced by XO */
> + writel(CLK_DISABLE, reg->lpass_base + CFG_RCGR_OFFSET);
> + writel(CLK_ENABLE, reg->lpass_base + CMD_RCGR_OFFSET);
> +
> + while (read_bit((reg->lpass_base + CMD_RCGR_OFFSET), CLK_ENABLE, 0)
> + && maxDelay--)
> + udelay(2);
> +
> + if (!maxDelay) {
> + pr_err("%s: fail to enable CMD_RCGR clock\n", __func__);
> + return -ETIMEDOUT;
> + }
> +
> + /* Enable the QDSP6SS AHBM and AHBS clocks */
> + ret = clk_enable_spin(reg->lpass_base + AHBS_AON_CBCR_OFFSET,
> + CLK_MASK, 0x0);
> + if (ret)
> + return ret;
> + ret = clk_enable_spin(reg->lpass_base + AHBM_AON_CBCR_OFFSET,
> + CLK_MASK, 0x0);
> + if (ret)
> + return ret;
Above should be calls to the clock framework.
> +
> + /* Turn on the XO clock, required to boot FSM */
> + update_bits(reg->qdsp6ss_base + XO_CBCR_OFFSET, CLK_ENABLE_MASK,
> + CLK_ENABLE, 0x0);
> +
> + /* Enable the QDSP6SS sleep clock for the QDSP6 watchdog enablement */
> + update_bits(reg->qdsp6ss_base + SLEEP_CBCR_OFFSET,
> + CLK_ENABLE_MASK, CLK_ENABLE, 0x0);
> +
> + /* Configure QDSP6 core CBC to enable clock */
> + update_bits(reg->qdsp6ss_base + CORE_CBCR_OFFSET, CLK_ENABLE_MASK,
> + CLK_ENABLE, 0x0);
> + return 0;
> +}
> +
> +static int sdm845_adsp_reset(struct qcom_adsp *adsp)
> +{
> + u32 timeout = ACK_TIMEOUT;
> + struct sdm845_reg *reg = adsp->priv_reg;
> +
> + /* De-assert QDSP6 stop core. QDSP6 will execute after out of reset */
> + update_bits(reg->qdsp6ss_base + CORE_START_OFFSET,
> + CLK_ENABLE_MASK, CLK_ENABLE, 0x0);
> + /* Trigger boot FSM to start QDSP6 */
> + writel(CLK_ENABLE, reg->qdsp6ss_base + BOOT_CMD_OFFSET);
> +
> + /* Wait for core to come out of reset */
> + while ((!(readl(reg->qdsp6ss_base +
> + BOOT_STATUS_OFFSET))) && (timeout-- > 0))
> + udelay(5);
Use readl_poll_timeout() from linux/iopoll.h
> +
> + if (!timeout)
> + return -ETIMEDOUT;
> +
> + return 0;
> +}
> +
> +static int sdm845_bringup(struct qcom_adsp *adsp)
This is called "start" in other places, please use existing naming
convention to make your code feel familiar to people reading other
drivers.
> +{
> + u32 ret;
ret is exclusively used to store data of the type "int".
> + struct sdm845_reg *reg = adsp->priv_reg;
> +
> + ret = sdm845_adsp_clk_enable(adsp);
> + if (ret) {
> + dev_err(adsp->dev, "%s: sdm845_adsp_clk_enable failed\n",
> + __func__);
> + return ret;
> + }
> + /* Program boot address */
> + update_bits(reg->qdsp6ss_base + RST_EVB_OFFSET,
> + EVB_MASK, (adsp->mem_phys) >> 8, 0x4);
In the WCSS PIL driver this is:
writel(rproc->bootaddr >> 4, wcss->reg_base + QDSP6SS_RST_EVB);
Which I think is the same as you're doing here, although you're shifting
8 bits right and then 4 (base 16) to the left.
> +
> + /* Wait for addresses to be programmed before starting adsp */
That's not what mb() does, it just ensures that any read and writes
coming after this point isn't reordered with any operations before it.
And as sdm845_adsp_reset() used writel() there is already a wmb() there,
so you can drop this one.
> + mb();
> + ret = sdm845_adsp_reset(adsp);
> + if (ret)
> + dev_err(adsp->dev, "%s: De-assert QDSP6 out of reset failed\n",
> + __func__);
This string is unique in the kernel, so you don't need __func__.
> + return ret;
> +}
> +
> +static int sdm845_bringdown(struct qcom_adsp *adsp)
> +{
> + u32 acktimeout = ACK_TIMEOUT;
> + u32 temp;
We know this is a temporary variable, name it "val" as we do in the
other functions.
> + struct sdm845_reg *reg = adsp->priv_reg;
> +
> + /* Reset the retention logic */
> + update_bits(reg->qdsp6ss_base + RET_CFG_OFFSET,
> + CLK_ENABLE_MASK, CLK_ENABLE, 0x0);
> + /* Disable the slave way clock to LPASS */
> + update_bits(reg->gcc_base + SWAY_CBCR_OFFSET,
> + CLK_ENABLE_MASK, CLK_DISABLE, 0x0);
> +
> + /* QDSP6 master port needs to be explicitly halted */
> + temp = read_bit(reg->tcsr_base + TCSR_LPASS_PWR_ON_OFFSET,
> + CLK_ENABLE, 0x0);
> + temp = temp && !read_bit(reg->tcsr_base + TCSR_LPASS_MASTER_IDLE_OFFSET,
> + CLK_ENABLE, 0x0);
> + if (temp) {
> + writel(CLK_ENABLE, reg->tcsr_base + TCSR_LPASS_HALTREQ_OFFSET);
CLK_ENABLE happens to have the right value, but the value you write is
"request halt" not "enable clock".
> + /* Wait for halt ACK from QDSP6 */
> + while ((read_bit(reg->tcsr_base + TCSR_LPASS_HALTACK_OFFSET,
> + CLK_DISABLE, 0x0) == 0) && (acktimeout-- > 0))
> + udelay(5);
> +
> + if (acktimeout) {
> + if (read_bit(reg->tcsr_base +
> + TCSR_LPASS_MASTER_IDLE_OFFSET,
> + CLK_ENABLE, 0x0) != 1)
> + dev_warn(adsp->dev,
> + "%s: failed to receive %s\n",
> + __func__, "TCSR MASTER ACK");
> + } else {
> + dev_err(adsp->dev, "%s: failed to receive halt ack\n",
> + __func__);
> + return -ETIMEDOUT;
> + }
> + }
Take a look at q6v5proc_halt_axi_port() in qcom_q6v5_pil.c instead of
this thing.
> +
> + /* Assert the LPASS PDC Reset */
> + update_bits(reg->pdc_sync, AUDIO_SYNC_RESET_MASK,
> + CLK_ENABLE, 0x2);
Use https://patchwork.kernel.org/patch/10415991/
reset_control_assert();
> + /* Place the LPASS processor into reset */
> + writel(CLK_ENABLE, reg->cc_lpass);
> + /* wait after asserting subsystem restart from AOSS */
> + udelay(200);
> +
> + /* Clear the halt request for the AXIM and AHBM for Q6 */
> + writel(CLK_DISABLE, reg->tcsr_base + TCSR_LPASS_HALTREQ_OFFSET);
Disable the clock that is the halt request register?
> +
> + /* De-assert the LPASS PDC Reset */
> + update_bits(reg->pdc_sync, AUDIO_SYNC_RESET_MASK,
> + CLK_DISABLE, 0x2);
reset_control_deassert();
> + /* Remove the LPASS reset */
> + writel(CLK_DISABLE, reg->cc_lpass);
> + /* wait after de-asserting subsystem restart from AOSS */
> + udelay(200);
> +
> + return 0;
> +}
Regards,
Bjorn
^ permalink raw reply
* Re: [PATCH 6/9] ARM: dts: wheat: Drop MTD partitioning from DT
From: Geert Uytterhoeven @ 2018-05-23 6:25 UTC (permalink / raw)
To: Marek Vasut
Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
Geert Uytterhoeven, Wolfram Sang, Richard Weinberger,
Linux-Renesas, Boris Brezillon, Laurent Pinchart, Simon Horman,
Linux ARM, Marek Vasut
In-Reply-To: <fc1cfd7e-db27-9277-dbed-cc2274c614a6@gmail.com>
Hi Marek,
On Wed, May 23, 2018 at 12:01 AM, Marek Vasut <marek.vasut@gmail.com> wrote:
> On 05/22/2018 04:43 PM, Geert Uytterhoeven wrote:
>> On Tue, May 22, 2018 at 2:02 PM, Marek Vasut <marek.vasut@gmail.com> wrote:
>>> Drop the MTD partitioning from DT, since it does not describe HW
>>> and to give way to a more flexible kernel command line partition
>>> passing.
>>>
>>> To retain the original partitioning, assure you have enabled
>>> CONFIG_MTD_CMDLINE_PARTS in your kernel config and add the
>>> following to your kernel command line:
>>>
>>> mtdparts=spi0.0:256k@0(loader),4096k(user),-(flash)
>>
>> I think the "@0" can be dropped, as it's optional?
>> 4m?
>
> My take on this is that the loader is actually at offset 0x0 of the MTD
> device and we explicitly state that in the mtdparts to anchor the first
> partition within the MTD device and all the other partitions are at
> offset +(sum of the sizes of all partitions listed before the current
> one) relative to that first partition.
Where is this explicitly states for the first partition?
> Removing the @0 feels fragile at best and it seems to depend on the
> current behavior of the code.
Better, it also depends on the documented behavior:
Documentation/admin-guide/kernel-parameters.txt refers to
drivers/mtd/cmdlinepart.c, which states:
* <offset> := standard linux memsize
* if omitted the part will immediately follow the previous part
* or 0 if the first part
None of the examples listed there or under the MTD_CMDLINE_PARTS Kconfig
help text, or in a defconfig bundled with the kernel, use @0 for the first
partition.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* [PATCH net-next v3 7/7] net: dsa: qca8k: Remove redundant parentheses
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
Fix warning reported by checkpatch.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- none
Changes in v2:
- Fix typo in subject.
- Add "Reviewed-by" tags from Andrew and Florian.
drivers/net/dsa/qca8k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index c834893..c0da402 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -513,7 +513,7 @@ qca8k_port_set_status(struct qca8k_priv *priv, int port, int enable)
pr_debug("qca: port %i set status %i\n", port, enable);
/* Port 0 and 6 have no internal PHY */
- if ((port > 0) && (port < 6))
+ if (port > 0 && port < 6)
mask |= QCA8K_PORT_STATUS_LINK_AUTO;
if (enable)
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 6/7] net: dsa: qca8k: Replace GPL boilerplate by SPDX
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
Replace the GPLv2 license boilerplate with the SPDX license identifier.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- none
Changes in v2:
- Add commit message.
- Add "Reviewed-by" tags from Andrew and Florian.
drivers/net/dsa/qca8k.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 7eba987..c834893 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -1,17 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2009 Felix Fietkau <nbd@nbd.name>
* Copyright (C) 2011-2012 Gabor Juhos <juhosg@openwrt.org>
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
* Copyright (c) 2016 John Crispin <john@phrozen.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 and
- * only version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
*/
#define DEBUG
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 5/7] net: dsa: qca8k: Allow overwriting CPU port setting
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
Implement adjust_link function that allows to overwrite default CPU port
setting using fixed-link device tree subnode.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- none
Changes in v2:
- Add "Reviewed-by" tags from Andrew and Florian.
drivers/net/dsa/qca8k.c | 43 +++++++++++++++++++++++++++++++++++++++++++
drivers/net/dsa/qca8k.h | 1 +
2 files changed, 44 insertions(+)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 14a108b38..7eba987 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -636,6 +636,47 @@ qca8k_setup(struct dsa_switch *ds)
return 0;
}
+static void
+qca8k_adjust_link(struct dsa_switch *ds, int port, struct phy_device *phy)
+{
+ struct qca8k_priv *priv = ds->priv;
+ u32 reg;
+
+ /* Force fixed-link setting for CPU port, skip others. */
+ if (!phy_is_pseudo_fixed_link(phy))
+ return;
+
+ /* Set port speed */
+ switch (phy->speed) {
+ case 10:
+ reg = QCA8K_PORT_STATUS_SPEED_10;
+ break;
+ case 100:
+ reg = QCA8K_PORT_STATUS_SPEED_100;
+ break;
+ case 1000:
+ reg = QCA8K_PORT_STATUS_SPEED_1000;
+ break;
+ default:
+ dev_dbg(priv->dev, "port%d link speed %dMbps not supported.\n",
+ port, phy->speed);
+ return;
+ }
+
+ /* Set duplex mode */
+ if (phy->duplex == DUPLEX_FULL)
+ reg |= QCA8K_PORT_STATUS_DUPLEX;
+
+ /* Force flow control */
+ if (dsa_is_cpu_port(ds, port))
+ reg |= QCA8K_PORT_STATUS_RXFLOW | QCA8K_PORT_STATUS_TXFLOW;
+
+ /* Force link down before changing MAC options */
+ qca8k_port_set_status(priv, port, 0);
+ qca8k_write(priv, QCA8K_REG_PORT_STATUS(port), reg);
+ qca8k_port_set_status(priv, port, 1);
+}
+
static int
qca8k_phy_read(struct dsa_switch *ds, int phy, int regnum)
{
@@ -909,6 +950,7 @@ qca8k_get_tag_protocol(struct dsa_switch *ds, int port)
static const struct dsa_switch_ops qca8k_switch_ops = {
.get_tag_protocol = qca8k_get_tag_protocol,
.setup = qca8k_setup,
+ .adjust_link = qca8k_adjust_link,
.get_strings = qca8k_get_strings,
.phy_read = qca8k_phy_read,
.phy_write = qca8k_phy_write,
@@ -942,6 +984,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
return -ENOMEM;
priv->bus = mdiodev->bus;
+ priv->dev = &mdiodev->dev;
/* read the switches ID register */
id = qca8k_read(priv, QCA8K_REG_MASK_CTRL);
diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
index 5bda165..613fe5c5 100644
--- a/drivers/net/dsa/qca8k.h
+++ b/drivers/net/dsa/qca8k.h
@@ -167,6 +167,7 @@ struct qca8k_priv {
struct ar8xxx_port_status port_sts[QCA8K_NUM_PORTS];
struct dsa_switch *ds;
struct mutex reg_mutex;
+ struct device *dev;
};
struct qca8k_mib_desc {
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 4/7] net: dsa: qca8k: Force CPU port to its highest bandwidth
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
By default autonegotiation is enabled to configure MAC on all ports.
For the CPU port autonegotiation can not be used so we need to set
some sensible defaults manually.
This patch forces the default setting of the CPU port to 1000Mbps/full
duplex which is the chip maximum capability.
Also correct size of the bit field used to configure link speed.
Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family")
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- none
Changes in v2:
- Add "Fixes" tag as pointed out by Florian.
- Add "Reviewed-by" tags from Andrew and Florian.
drivers/net/dsa/qca8k.c | 6 +++++-
drivers/net/dsa/qca8k.h | 6 ++++--
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 0d224f3..14a108b38 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -537,6 +537,7 @@ qca8k_setup(struct dsa_switch *ds)
{
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
int ret, i, phy_mode = -1;
+ u32 mask;
pr_debug("qca: setup\n");
@@ -564,7 +565,10 @@ qca8k_setup(struct dsa_switch *ds)
if (ret < 0)
return ret;
- /* Enable CPU Port */
+ /* Enable CPU Port, force it to maximum bandwidth and full-duplex */
+ mask = QCA8K_PORT_STATUS_SPEED_1000 | QCA8K_PORT_STATUS_TXFLOW |
+ QCA8K_PORT_STATUS_RXFLOW | QCA8K_PORT_STATUS_DUPLEX;
+ qca8k_write(priv, QCA8K_REG_PORT_STATUS(QCA8K_CPU_PORT), mask);
qca8k_reg_set(priv, QCA8K_REG_GLOBAL_FW_CTRL0,
QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN);
qca8k_port_set_status(priv, QCA8K_CPU_PORT, 1);
diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h
index 1cf8a92..5bda165 100644
--- a/drivers/net/dsa/qca8k.h
+++ b/drivers/net/dsa/qca8k.h
@@ -51,8 +51,10 @@
#define QCA8K_GOL_MAC_ADDR0 0x60
#define QCA8K_GOL_MAC_ADDR1 0x64
#define QCA8K_REG_PORT_STATUS(_i) (0x07c + (_i) * 4)
-#define QCA8K_PORT_STATUS_SPEED GENMASK(2, 0)
-#define QCA8K_PORT_STATUS_SPEED_S 0
+#define QCA8K_PORT_STATUS_SPEED GENMASK(1, 0)
+#define QCA8K_PORT_STATUS_SPEED_10 0
+#define QCA8K_PORT_STATUS_SPEED_100 0x1
+#define QCA8K_PORT_STATUS_SPEED_1000 0x2
#define QCA8K_PORT_STATUS_TXMAC BIT(2)
#define QCA8K_PORT_STATUS_RXMAC BIT(3)
#define QCA8K_PORT_STATUS_TXFLOW BIT(4)
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 3/7] net: dsa: qca8k: Enable RXMAC when bringing up a port
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
When a port is brought up/down do not enable/disable only the TXMAC
but the RXMAC as well. This is essential for the CPU port to work.
Fixes: 6b93fb46480a ("net-next: dsa: add new driver for qca8xxx family")
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
---
Changes in v3:
- none
Changes in v2:
- Add "Fixes" tag as pointed out by Florian.
- Add "Reviewed-by" tags from Andrew and Florian.
drivers/net/dsa/qca8k.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 6a3ffb2..0d224f3 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -516,7 +516,7 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode)
static void
qca8k_port_set_status(struct qca8k_priv *priv, int port, int enable)
{
- u32 mask = QCA8K_PORT_STATUS_TXMAC;
+ u32 mask = QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC;
pr_debug("qca: port %i set status %i\n", port, enable);
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 2/7] net: dsa: qca8k: Add support for QCA8334 switch
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
Add support for the four-port variant of the Qualcomm QCA833x switch.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v3:
- Add "Reviewed-by" tag from Andrew
Changes in v2:
- Add commit message
drivers/net/dsa/qca8k.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c
index 3684e56..6a3ffb2 100644
--- a/drivers/net/dsa/qca8k.c
+++ b/drivers/net/dsa/qca8k.c
@@ -1010,6 +1010,7 @@ static SIMPLE_DEV_PM_OPS(qca8k_pm_ops,
qca8k_suspend, qca8k_resume);
static const struct of_device_id qca8k_of_match[] = {
+ { .compatible = "qca,qca8334" },
{ .compatible = "qca,qca8337" },
{ /* sentinel */ },
};
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 1/7] net: dsa: qca8k: Add QCA8334 binding documentation
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
In-Reply-To: <1527056424-14528-1-git-send-email-michal.vokac@ysoft.com>
Add support for the four-port variant of the Qualcomm QCA833x switch.
The CPU port default link settings can be reconfigured using
a fixed-link sub-node.
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---
Changes in v3:
- Correct fixed-link node documentation term: s/property/node.
- Add "Reviewed-by" tag from Rob and Andrew.
Changes in v2:
- Add commit message and document fixed-link binding.
.../devicetree/bindings/net/dsa/qca8k.txt | 23 +++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.txt b/Documentation/devicetree/bindings/net/dsa/qca8k.txt
index 9c67ee4..bbcb255 100644
--- a/Documentation/devicetree/bindings/net/dsa/qca8k.txt
+++ b/Documentation/devicetree/bindings/net/dsa/qca8k.txt
@@ -2,7 +2,10 @@
Required properties:
-- compatible: should be "qca,qca8337"
+- compatible: should be one of:
+ "qca,qca8334"
+ "qca,qca8337"
+
- #size-cells: must be 0
- #address-cells: must be 1
@@ -14,6 +17,20 @@ port and PHY id, each subnode describing a port needs to have a valid phandle
referencing the internal PHY connected to it. The CPU port of this switch is
always port 0.
+A CPU port node has the following optional node:
+
+- fixed-link : Fixed-link subnode describing a link to a non-MDIO
+ managed entity. See
+ Documentation/devicetree/bindings/net/fixed-link.txt
+ for details.
+
+For QCA8K the 'fixed-link' sub-node supports only the following properties:
+
+- 'speed' (integer, mandatory), to indicate the link speed. Accepted
+ values are 10, 100 and 1000
+- 'full-duplex' (boolean, optional), to indicate that full duplex is
+ used. When absent, half duplex is assumed.
+
Example:
@@ -53,6 +70,10 @@ Example:
label = "cpu";
ethernet = <&gmac1>;
phy-mode = "rgmii";
+ fixed-link {
+ speed = 1000;
+ full-duplex;
+ };
};
port@1 {
--
2.7.4
^ permalink raw reply related
* [PATCH net-next v3 0/7] Add support for QCA8334 switch
From: Michal Vokáč @ 2018-05-23 6:20 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, devicetree, f.fainelli, vivien.didelot, andrew,
mark.rutland, robh+dt, davem, michal.vokac
This series basically adds support for a QCA8334 ethernet switch to the
qca8k driver. It is a four-port variant of the already supported seven
port QCA8337. Register map is the same for the whole familly and all chips
have the same device ID.
Major part of this series enhances the CPU port setting. Currently the CPU
port is not set to any sensible defaults compatible with the xGMII
interface. This series forces the CPU port to its maximum bandwidth and
also allows to adjust the new defaults using fixed-link device tree
sub-node.
Alongside these changes I fixed two checkpatch warnings regarding SPDX and
redundant parentheses.
Changes in v3:
- Rebased on latest net-next/master.
- Corrected fixed-link documentation.
Michal Vokáč (7):
net: dsa: qca8k: Add QCA8334 binding documentation
net: dsa: qca8k: Add support for QCA8334 switch
net: dsa: qca8k: Enable RXMAC when bringing up a port
net: dsa: qca8k: Force CPU port to its highest bandwidth
net: dsa: qca8k: Allow overwriting CPU port setting
net: dsa: qca8k: Replace GPL boilerplate by SPDX
net: dsa: qca8k: Remove redundant parentheses
.../devicetree/bindings/net/dsa/qca8k.txt | 23 +++++++-
drivers/net/dsa/qca8k.c | 64 ++++++++++++++++++----
drivers/net/dsa/qca8k.h | 7 ++-
3 files changed, 79 insertions(+), 15 deletions(-)
--
2.7.4
^ permalink raw reply
* Re: [PATCH v3] arm64: allwinner: a64: Add Amarula A64-Relic initial support
From: Jagan Teki @ 2018-05-23 6:14 UTC (permalink / raw)
To: Maxime Ripard
Cc: Chen-Yu Tsai, Michael Trimarchi, Icenowy Zheng, devicetree,
linux-arm-kernel, linux-kernel, linux-sunxi
In-Reply-To: <20180522143044.pgwawojiwnk2lzxb@flea>
On Tue, May 22, 2018 at 8:00 PM, Maxime Ripard
<maxime.ripard-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> wrote:
> On Tue, May 22, 2018 at 06:52:28PM +0530, Jagan Teki wrote:
>> Amarula A64-Relic is Allwinner A64 based IoT device, which support
>> - Allwinner A64 Cortex-A53
>> - Mali-400MP2 GPU
>> - AXP803 PMIC
>> - 1GB DDR3 RAM
>> - 8GB eMMC
>> - AP6330 Wifi/BLE
>> - MIPI-DSI
>> - CSI: OV5640 sensor
>> - USB OTG
>
> You claim that this is doing OTG...
>
> [..]
>
>> +&usb_otg {
>> + dr_mode = "peripheral";
>> + status = "okay";
>> +};
>
> ... and yet you're setting it as peripheral...
Though it claims OTG, board doesn't have any USB ports to operate(not
even Mini-AB) the only way to use the board as peripheral to transfer
images from host.
^ permalink raw reply
* Re: [RFC 12/13] ARM: dts: ti: add dra71-evm FIT description file
From: Tero Kristo @ 2018-05-23 5:55 UTC (permalink / raw)
To: Rob Herring
Cc: mark.rutland, devicetree, trini, Tony Lindgren,
Russell King - ARM Linux, frowand.list, wmills,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <20180522200100.GA23937@rob-hp-laptop>
On 22/05/18 23:01, Rob Herring wrote:
> On Mon, May 21, 2018 at 09:57:54AM +0300, Tero Kristo wrote:
>> On 17/04/18 17:49, Tony Lindgren wrote:
>>> * Tero Kristo <t-kristo@ti.com> [180417 09:36]:
>>>> In typical setup, you can boot a large number of different configs via:
>>>>
>>>> bootm 0x82000000#dra71-evm#nand#lcd-auo-g101evn01.0
>>>>
>>>> ... assuming the configs were named like that, and assuming they would be
>>>> compatible with each other. The am57xx-evm example provided is better, as
>>>> you can chain the different cameras to the available evm configs.
>>>
>>> Why not just do it in the bootloader to put together the dtb?
>>>
>>> Then for external devices, you could just pass info on the
>>> kernel cmdline with lcd=foo camera=bar if they cannot be
>>> detected over I2C.
>>
>> (Added Linux ARM list to CC, this was not part of the original delivery.)
>>
>> Ok trying to resurrect this thread a bit. Is there any kind of consensus how
>> things like this should be handled? Should we add the DT overlay files to
>> kernel tree or not?
>
> IMO, yes.
>
>> Should we add any kind of build infra to kernel tree, and at what level
>> would this be? Just DT overlay file building support, and drop the FIT build
>> support as was proposed in this RFC series or...?
>
> I think I mentioned this already, but I expect that this is going to
> cause a number of conversions of dtsi + dtsi -> dtb into base dts and
> overlay(s) dts files. In doing so, we still need to be able to build the
> original, full dtb.
So you mean like breaking apart the existing .dts files? Are there any
plans to get that done (I know the android folks talk about this but I
don't like their idea.) If we do the split, how are we going to
determine which dts + overlay files are required to get a specific DTB
done? I actually wrote a tool for this purpose which parses the FIT
image configurations and generates plain dtb files out of the info there
if needed, but assuming FIT is abandoned then what...?
>
>> U-boot can obviously parse the base DTB + overlay DTB:s into a single DTB,
>> but this is somewhat clumsy approach and is relatively error prone to get it
>> right.
>
> Why? How is the kernel better?
I am mostly speaking about runtime applying of the overlays. If done
build time, it is obviously on same level. If you apply the base DTS +
overlays from u-boot prompt, it is not too much fun, and if there are
any failures it just won't work, but don't really tell you why not.
>
>> Building the FIT image post kernel build would also be possible, but who
>> would be doing this, is there any need to get this done in generic manner or
>> shall we just add SoC vendor specific tools for this?
>
> I'll tell you up front, I'm not a fan of FIT image (nor uImage,
> Android boot image, $bootloader image). If you want a collection of
> files and some configuration data, use a filesystem and a text file.
Ok, thanks for your frank comments. I believe based on this feedback
I'll try to modify this series into bare minimal overlay support to
kernel, and have the post processing done elsewhere (either u-boot build
or possibly completely separate tool.)
-Tero
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox