* [PATCH v2 2/7] arm: configs: omap_defconfig: Enable ti-sysc bus driver
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 3/7] arm: configs: am33xx_mlo_defconfig: " Teresa Remmet
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
arch/arm/configs/omap_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/configs/omap_defconfig b/arch/arm/configs/omap_defconfig
index 128027a6406b..8615283453d4 100644
--- a/arch/arm/configs/omap_defconfig
+++ b/arch/arm/configs/omap_defconfig
@@ -97,7 +97,6 @@ CONFIG_CMD_BOOTCHOOSER=y
CONFIG_NET=y
CONFIG_NET_NFS=y
CONFIG_NET_NETCONSOLE=y
-CONFIG_NET_RESOLV=y
CONFIG_OF_BAREBOX_DRIVERS=y
CONFIG_DRIVER_SERIAL_NS16550=y
CONFIG_DRIVER_SERIAL_NS16550_OMAP_EXTENSIONS=y
@@ -141,6 +140,7 @@ CONFIG_WATCHDOG_OMAP=y
CONFIG_GPIO_GENERIC_PLATFORM=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_BUS_OMAP_GPMC=y
+CONFIG_TI_SYSC=y
CONFIG_FS_EXT4=y
CONFIG_FS_TFTP=y
CONFIG_FS_NFS=y
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/7] arm: configs: am33xx_mlo_defconfig: Enable ti-sysc bus driver
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 2/7] arm: configs: omap_defconfig: Enable " Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 4/7] drivers: of: Add function to enable and register a device by alias Teresa Remmet
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
arch/arm/configs/am335x_mlo_defconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/configs/am335x_mlo_defconfig b/arch/arm/configs/am335x_mlo_defconfig
index 58034b6cea15..b58b71a85937 100644
--- a/arch/arm/configs/am335x_mlo_defconfig
+++ b/arch/arm/configs/am335x_mlo_defconfig
@@ -8,7 +8,6 @@ CONFIG_MACH_PHYTEC_SOM_AM335X=y
CONFIG_THUMB2_BAREBOX=y
# CONFIG_MEMINFO is not set
CONFIG_MMU=y
-CONFIG_TEXT_BASE=0x0
CONFIG_BAREBOX_MAX_PBLX_SIZE=0x1b400
CONFIG_MALLOC_SIZE=0x0
CONFIG_MALLOC_TLSF=y
@@ -38,6 +37,7 @@ CONFIG_MCI=y
CONFIG_MCI_OMAP_HSMMC=y
CONFIG_PINCTRL_SINGLE=y
CONFIG_BUS_OMAP_GPMC=y
+CONFIG_TI_SYSC=y
# CONFIG_FS_DEVFS is not set
CONFIG_FS_FAT=y
CONFIG_FS_FAT_LFN=y
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 4/7] drivers: of: Add function to enable and register a device by alias
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 2/7] arm: configs: omap_defconfig: Enable " Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 3/7] arm: configs: am33xx_mlo_defconfig: " Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 5/7] arm: mach-omap: am335x_generic: Enable nodes by alias where needed Teresa Remmet
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
In some cases node names are not unique and passing the full path is really long.
So make add a new device by passing the alias string possible.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
drivers/of/platform.c | 19 +++++++++++++++++++
include/of.h | 8 ++++++++
2 files changed, 27 insertions(+)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index ef8969ca8b19..d3795d799a13 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -207,6 +207,25 @@ struct device_d *of_device_enable_and_register_by_name(const char *name)
}
EXPORT_SYMBOL(of_device_enable_and_register_by_name);
+/**
+ * of_device_enable_and_register_by_alias - Enable and register device by alias
+ * @name: alias of the device node
+ *
+ * Returns pointer to created platform device, or NULL if a device was not
+ * registered. Unavailable devices will not get registered.
+ */
+struct device_d *of_device_enable_and_register_by_alias(const char *alias)
+{
+ struct device_node *node;
+
+ node = of_find_node_by_alias(NULL, alias);
+ if (!node)
+ return NULL;
+
+ return of_device_enable_and_register(node);
+}
+EXPORT_SYMBOL(of_device_enable_and_register_by_alias);
+
#ifdef CONFIG_ARM_AMBA
static struct device_d *of_amba_device_create(struct device_node *np)
{
diff --git a/include/of.h b/include/of.h
index 184acb474136..b5f54dd4e5b5 100644
--- a/include/of.h
+++ b/include/of.h
@@ -255,6 +255,8 @@ extern int of_platform_populate(struct device_node *root,
extern struct device_d *of_find_device_by_node(struct device_node *np);
extern struct device_d *of_device_enable_and_register(struct device_node *np);
extern struct device_d *of_device_enable_and_register_by_name(const char *name);
+extern struct device_d *of_device_enable_and_register_by_alias(
+ const char *alias);
struct cdev *of_parse_partition(struct cdev *cdev, struct device_node *node);
int of_parse_partitions(struct cdev *cdev, struct device_node *node);
@@ -670,6 +672,12 @@ static inline struct device_d *of_device_enable_and_register_by_name(
return NULL;
}
+static inline struct device_d *of_device_enable_and_register_by_alias(
+ const char *alias)
+{
+ return NULL;
+}
+
static inline int of_register_fixup(int (*fixup)(struct device_node *, void *),
void *context)
{
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 5/7] arm: mach-omap: am335x_generic: Enable nodes by alias where needed
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
` (2 preceding siblings ...)
2019-02-13 8:34 ` [PATCH v2 4/7] drivers: of: Add function to enable and register a device by alias Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 6/7] net: ethernet: cpsw: cpsw-phy-sel: Use phandle for phy sel Teresa Remmet
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
With the interconnet target module hierarchy the node names used to enable boot
devices are not unique any more. Find those nodes by alias now.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
arch/arm/mach-omap/am33xx_generic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap/am33xx_generic.c b/arch/arm/mach-omap/am33xx_generic.c
index fe3c4a8b175a..7577df761cb7 100644
--- a/arch/arm/mach-omap/am33xx_generic.c
+++ b/arch/arm/mach-omap/am33xx_generic.c
@@ -474,18 +474,18 @@ int am33xx_of_register_bootdevice(void)
switch (bootsource_get()) {
case BOOTSOURCE_MMC:
if (bootsource_get_instance() == 0)
- dev = of_device_enable_and_register_by_name("mmc@48060000");
+ dev = of_device_enable_and_register_by_alias("mmc0");
else
- dev = of_device_enable_and_register_by_name("mmc@481d8000");
+ dev = of_device_enable_and_register_by_alias("mmc1");
break;
case BOOTSOURCE_NAND:
dev = of_device_enable_and_register_by_name("gpmc@50000000");
break;
case BOOTSOURCE_SPI:
- dev = of_device_enable_and_register_by_name("spi@48030000");
+ dev = of_device_enable_and_register_by_alias("spi0");
break;
case BOOTSOURCE_NET:
- dev = of_device_enable_and_register_by_name("ethernet@4a100000");
+ dev = of_device_enable_and_register_by_alias("ethernet0");
break;
default:
/* Use nand fallback */
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 6/7] net: ethernet: cpsw: cpsw-phy-sel: Use phandle for phy sel
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
` (3 preceding siblings ...)
2019-02-13 8:34 ` [PATCH v2 5/7] arm: mach-omap: am335x_generic: Enable nodes by alias where needed Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 8:34 ` [PATCH v2 7/7] arm: dts: am335x-phytec: Use phy-handle instead of phy_id Teresa Remmet
2019-02-13 19:30 ` [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
With the usage of the interconnect target module hierarchy in device tree the
cpsw-phy-sel node moved to the system control module. An phandle has
been added instead to the device tree include.
Try to use the cpsw-phy-sel phandle first then fall back looking for the
cpsw-phy-sel child.
This patch is based on the upstream kernel patch:
18eb8aea7fb2 ("net: ethernet: cpsw-phy-sel: prefer phandle for phy sel")
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
drivers/net/cpsw.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 432004ec9ca8..65f71c6fce5a 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -1053,6 +1053,7 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
{
struct device_d *dev = priv->dev;
struct device_node *np = dev->device_node, *child;
+ struct device_node *physel;
int ret, i = 0;
ret = of_property_read_u32(np, "slaves", &priv->num_slaves);
@@ -1061,13 +1062,17 @@ static int cpsw_probe_dt(struct cpsw_priv *priv)
priv->slaves = xzalloc(sizeof(struct cpsw_slave) * priv->num_slaves);
- for_each_child_of_node(np, child) {
- if (of_device_is_compatible(child, "ti,am3352-cpsw-phy-sel")) {
- ret = cpsw_phy_sel_init(priv, child);
- if (ret)
- return ret;
- }
+ physel = of_parse_phandle(dev->device_node, "cpsw-phy-sel", 0);
+ if (!physel) {
+ physel = of_get_child_by_name(dev->device_node, "cpsw-phy-sel");
+ if (!physel)
+ dev_err(dev, "Phy mode node not found\n");
+ }
+ ret = cpsw_phy_sel_init(priv, physel);
+ if (ret)
+ return ret;
+ for_each_child_of_node(np, child) {
if (of_device_is_compatible(child, "ti,davinci_mdio")) {
ret = of_pinctrl_select_state_default(child);
if (ret)
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 7/7] arm: dts: am335x-phytec: Use phy-handle instead of phy_id
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
` (4 preceding siblings ...)
2019-02-13 8:34 ` [PATCH v2 6/7] net: ethernet: cpsw: cpsw-phy-sel: Use phandle for phy sel Teresa Remmet
@ 2019-02-13 8:34 ` Teresa Remmet
2019-02-13 19:30 ` [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Teresa Remmet @ 2019-02-13 8:34 UTC (permalink / raw)
To: barebox
Update am335x-phytec som device trees and use phy-handle instead of phy_id.
Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
---
arch/arm/dts/am335x-phytec-phycard-som.dtsi | 7 ++++++-
arch/arm/dts/am335x-phytec-phycore-som.dtsi | 7 ++++++-
arch/arm/dts/am335x-phytec-phyflex-som.dtsi | 12 ++++++++++--
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/arch/arm/dts/am335x-phytec-phycard-som.dtsi b/arch/arm/dts/am335x-phytec-phycard-som.dtsi
index 6a0442916bcb..2320ca18070f 100644
--- a/arch/arm/dts/am335x-phytec-phycard-som.dtsi
+++ b/arch/arm/dts/am335x-phytec-phycard-som.dtsi
@@ -122,6 +122,10 @@
pinctrl-names = "default";
pinctrl-0 = <&davinci_mdio_default>;
status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
};
&phy_sel {
@@ -129,8 +133,9 @@
};
&cpsw_emac0 {
- phy_id = <&davinci_mdio>, <0>;
+ phy-handle = <&phy0>;
phy-mode = "rmii";
+ dual_emac_res_vlan = <1>;
};
&mac {
diff --git a/arch/arm/dts/am335x-phytec-phycore-som.dtsi b/arch/arm/dts/am335x-phytec-phycore-som.dtsi
index cb2d30a15ccd..0601f5ab7ba5 100644
--- a/arch/arm/dts/am335x-phytec-phycore-som.dtsi
+++ b/arch/arm/dts/am335x-phytec-phycore-som.dtsi
@@ -244,6 +244,10 @@
pinctrl-names = "default";
pinctrl-0 = <&davinci_mdio_default>;
status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <0>;
+ };
};
&phy_sel {
@@ -251,8 +255,9 @@
};
&cpsw_emac0 {
- phy_id = <&davinci_mdio>, <0>;
+ phy-handle = <&phy0>;
phy-mode = "rmii";
+ dual_emac_res_vlan = <1>;
};
&mac {
diff --git a/arch/arm/dts/am335x-phytec-phyflex-som.dtsi b/arch/arm/dts/am335x-phytec-phyflex-som.dtsi
index 465d3fa16cd7..4d0a91398843 100644
--- a/arch/arm/dts/am335x-phytec-phyflex-som.dtsi
+++ b/arch/arm/dts/am335x-phytec-phyflex-som.dtsi
@@ -197,6 +197,14 @@
pinctrl-names = "default", "sleep";
pinctrl-0 = <&davinci_mdio_default>;
status = "okay";
+
+ phy0: ethernet-phy@0 {
+ reg = <1>;
+ };
+
+ phy1: ethernet-phy@1 {
+ reg = <2>;
+ };
};
&phy_sel {
@@ -204,7 +212,7 @@
};
&cpsw_emac0 {
- phy_id = <&davinci_mdio>, <1>;
+ phy-handle = <&phy0>;
phy-mode = "rgmii";
dual_emac_res_vlan = <1>;
@@ -221,7 +229,7 @@
};
&cpsw_emac1 {
- phy_id = <&davinci_mdio>, <2>;
+ phy-handle = <&phy1>;
phy-mode = "rmii";
dual_emac_res_vlan = <2>;
status = "disabled";
--
2.7.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver
2019-02-13 8:34 [PATCH v2 1/7] drivers: bus: Add ti-sysc bus driver Teresa Remmet
` (5 preceding siblings ...)
2019-02-13 8:34 ` [PATCH v2 7/7] arm: dts: am335x-phytec: Use phy-handle instead of phy_id Teresa Remmet
@ 2019-02-13 19:30 ` Sascha Hauer
6 siblings, 0 replies; 8+ messages in thread
From: Sascha Hauer @ 2019-02-13 19:30 UTC (permalink / raw)
To: Teresa Remmet; +Cc: barebox
On Wed, Feb 13, 2019 at 09:34:22AM +0100, Teresa Remmet wrote:
> Adds minimal support for the sysc interconnect target module found
> on many TI SoCs. With this device tree includes have been rearagned.
> We need the driver to probe the child devices of the bus.
>
> Signed-off-by: Teresa Remmet <t.remmet@phytec.de>
> ---
> Changes in v2:
> - set driver in Kconfig to default y
> - Use postcore_platform_driver() call
> - Use global of_default_bus_match_table() instead of local table
Applied to master, thanks
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 8+ messages in thread