ARM: davinci: da850: add ethernet driver DT support
Subsystems (6)
v3 cover ARM: davinci: da850: add ethernet driver DT support
From: "Lad, Prabhakar" <[email protected]>
This patch set enables Ethernet support through device tree model. This patch set enables mii interface only and is being tested to boot via rootfs. The rmii phy is present on the i2c gpio expander chip (UI board) for which yet support needs to be added, once the DT support for the chip is enabled, enabling rmii will be subsequnet patch.
Changes for v2:
1: Enabled mdio device.
2: Fixed clock lookup.
Changes for v3:
1: Fixed review comments pointed out by Sekhar.
Lad, Prabhakar (6):
ARM: davinci: da8xx: fix clock lookup for mdio device
ARM: davinci: da850: add DT node for mdio device
ARM: davinci: da850: add OF_DEV_AUXDATA entry for mdio.
ARM: davinci: da850: add DT node for eth0.
ARM: davinci: da850: add OF_DEV_AUXDATA entry for eth0.
ARM: davinci: da850: configure system configuration chip(CFGCHIP3)
for emac
arch/arm/boot/dts/da850-evm.dts | 11 +++++++ arch/arm/boot/dts/da850.dtsi | 43 ++++++++++++++++++++++++++ arch/arm/mach-davinci/board-da850-evm.c | 36 ++-------------------- arch/arm/mach-davinci/da830.c | 1 + arch/arm/mach-davinci/da850.c | 46 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/da8xx-dt.c | 20 ++++++++++++ arch/arm/mach-davinci/devices-da8xx.c | 8 ++--- arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 8 files changed, 126 insertions(+), 40 deletions(-)
Signature · 1 line
1.7.9.5
PATCH v3 1/6 ARM: davinci: da8xx: fix clock lookup for mdio device
From: "Lad, Prabhakar" <[email protected]>
This patch removes the clock alias for mdio device and adds a entry in clock lookup table, this entry can now be used by both DT and NON DT case.
---
changes for v2: None
Changes for v3:
a> added clock lookup entry for davinci_mdio in da830 file.
arch/arm/mach-davinci/da830.c | 1 + arch/arm/mach-davinci/da850.c | 1 + arch/arm/mach-davinci/devices-da8xx.c | 8 ++------ 3 files changed, 4 insertions(+), 6 deletions(-)
arch/arm/mach-davinci/da830.c +1 -0
@@ -417,6 +417,7 @@ static struct clk_lookup da830_clks[] = {CLK (NULL ,"aintc" , &aintc_clk),CLK (NULL ,"secu_mgr" , &secu_mgr_clk),CLK ("davinci_emac.1" ,NULL , &emac_clk), +CLK ("davinci_mdio.0" ,"fck" , &emac_clk),CLK (NULL ,"gpio" , &gpio_clk),CLK ("i2c_davinci.2" ,NULL , &i2c1_clk), CLK(NULL, "usb11", &usb11_clk),
arch/arm/mach-davinci/da850.c +1 -0
@@ -461,6 +461,7 @@ static struct clk_lookup da850_clks[] = {CLK (NULL ,"arm" , &arm_clk),CLK (NULL ,"rmii" , &rmii_clk),CLK ("davinci_emac.1" ,NULL , &emac_clk), +CLK ("davinci_mdio.0" ,"fck" , &emac_clk),CLK ("davinci-mcasp.0" ,NULL , &mcasp_clk),CLK ("da8xx_lcdc.0" ,"fck" , &lcdc_clk), CLK("da830-mmc.0", NULL, &mmcsd0_clk),
arch/arm/mach-davinci/devices-da8xx.c +2 -6
@@ -452,12 +452,8 @@ int __init da8xx_register_emac(void) ret =platform_device_register (&da8xx_mdio_device);if (ret <0 )return ret; - ret =platform_device_register (&da8xx_emac_device); -if (ret <0 ) -return ret; - ret =clk_add_alias (NULL ,dev_name (&da8xx_mdio_device.dev), -NULL , &da8xx_emac_device.dev); -return ret; + +return platform_device_register (&da8xx_emac_device); }static struct resource da830_mcasp1_resources[] = {
Signature · 1 line
1.7.9.5
Re: [PATCH v3 1/6] ARM: davinci: da8xx: fix clock lookup for mdio device
Hi Prabhakar,
Quoted 6 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch removes the clock alias for mdio device and adds a entry in clock lookup table, this entry can now be used by both DT and NON DT case.
Quoted 8 lines
Signed-off-by Lad, Prabhakar <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc linux-kernel at vger.kernel.orgCc davinci-linux-open-source at linux.davincidsp.comCc netdev at vger.kernel.orgCc devicetree-discuss at lists.ozlabs.orgCc Sekhar Nori <[email protected]>Cc Heiko Schocher <[email protected]>
This patch looks good, except you can do the same thing on all DaVinci devices not just on DA8XX. Apart from this patches 1-5 in this series look good. If you can spin this fix in short time I can queue 1-5 for v3.12 while we wait for you to fix 6/6
Thanks,
Sekhar
PATCH v3 2/6 ARM: davinci: da850: add DT node for mdio device
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
Add mdio device tree node information to da850 by providing register details and bus frequency of mdio.
---
Changes for v2: none
Changes for v3:
a> Added pin entries for mdio.
arch/arm/boot/dts/da850-evm.dts | 6 ++++++ arch/arm/boot/dts/da850.dtsi | 13 +++++++++++++ 2 files changed, 19 insertions(+)
arch/arm/boot/dts/da850-evm.dts +6 -0
@@ -90,6 +90,12 @@ }; }; }; + mdio: mdio at 1e24000 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + bus_freq = <2200000>; + }; }; nand_cs3 at 62000000 { status = "okay";
arch/arm/boot/dts/da850.dtsi +13 -0
@@ -125,6 +125,13 @@ 0x14 0x00000010 0x000000f0 >; }; + mdio_pins: pinmux_mdio_pins { + pinctrl-single,bits = < + /* MDIO_CLK, MDIO_D */ + 0x10 0x00000088 0x000000ff + >; + }; + }; serial0: serial at 1c42000 { compatible = "ns16550a";
@@ -216,6 +223,12 @@ interrupts = <56>; status = "disabled"; }; + mdio: mdio at 1e24000 { + compatible = "ti,davinci_mdio"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x224000 0x1000>; + }; }; nand_cs3 at 62000000 { compatible = "ti,davinci-nand";
Signature · 1 line
1.7.9.5
PATCH v3 3/6 ARM: davinci: da850: add OF_DEV_AUXDATA entry for mdio.
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
Add OF_DEV_AUXDATA for mdio driver in da850 board dt file to use mdio clock.
---
Changes for V2: none
Changes for V3: none
arch/arm/mach-davinci/da8xx-dt.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-davinci/da8xx-dt.c +1 -0
@@ -47,6 +47,7 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {OF_DEV_AUXDATA ("ti,da850-ecap" ,0x01f07000 ,"ecap" ,NULL ),OF_DEV_AUXDATA ("ti,da850-ecap" ,0x01f08000 ,"ecap" ,NULL ),OF_DEV_AUXDATA ("ti,da830-spi" ,0x01f0e000 ,"spi_davinci.1" ,NULL ), + OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL), {} };
Signature · 1 line
1.7.9.5
PATCH v3 4/6 ARM: davinci: da850: add DT node for eth0.
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
Add eth0 device tree node information and pinmux for mii to da850 by providing interrupt details and local mac address of eth0.
---
Changes for v2: None
Changes for v3:
a> Split the pinmux for mdio and mii.
arch/arm/boot/dts/da850-evm.dts | 5 +++++ arch/arm/boot/dts/da850.dtsi | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+)
arch/arm/boot/dts/da850-evm.dts +5 -0
@@ -96,6 +96,11 @@ pinctrl-0 = <&mdio_pins>; bus_freq = <2200000>; }; + eth0: emac at 1e20000 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&mii_pins>; + }; }; nand_cs3 at 62000000 { status = "okay";
arch/arm/boot/dts/da850.dtsi +30 -0
@@ -131,6 +131,22 @@ 0x10 0x00000088 0x000000ff >; }; + mii_pins: pinmux_mii_pins { + pinctrl-single,bits = < + /* + * MII_TXEN, MII_TXCLK, MII_COL + * MII_TXD_3, MII_TXD_2, MII_TXD_1 + * MII_TXD_0 + */ + 0x8 0x88888880 0xfffffff0 + /* + * MII_RXER, MII_CRS, MII_RXCLK + * MII_RXDV, MII_RXD_3, MII_RXD_2 + * MII_RXD_1, MII_RXD_0 + */ + 0xc 0x88888888 0xffffffff + >; + }; }; serial0: serial at 1c42000 {
@@ -229,6 +245,20 @@ #size-cells = <0>; reg = <0x224000 0x1000>; }; + eth0: emac at 1e20000 { + compatible = "ti,davinci-dm6467-emac"; + reg = <0x220000 0x4000>; + ti,davinci-ctrl-reg-offset = <0x3000>; + ti,davinci-ctrl-mod-reg-offset = <0x2000>; + ti,davinci-ctrl-ram-offset = <0>; + ti,davinci-ctrl-ram-size = <0x2000>; + local-mac-address = [ 00 00 00 00 00 00 ]; + interrupts = <33 + 34 + 35 + 36 + >; + }; }; nand_cs3 at 62000000 { compatible = "ti,davinci-nand";
Signature · 1 line
1.7.9.5
PATCH v3 5/6 ARM: davinci: da850: add OF_DEV_AUXDATA entry for eth0.
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
Add OF_DEV_AUXDATA for eth0 driver in da850 board dt file to use emac clock.
---
Changes for V2: none
Changes for V3: none
arch/arm/mach-davinci/da8xx-dt.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-davinci/da8xx-dt.c +3 -0
@@ -48,6 +48,9 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {OF_DEV_AUXDATA ("ti,da850-ecap" ,0x01f08000 ,"ecap" ,NULL ),OF_DEV_AUXDATA ("ti,da830-spi" ,0x01f0e000 ,"spi_davinci.1" ,NULL ),OF_DEV_AUXDATA ("ti,davinci_mdio" ,0x01e24000 ,"davinci_mdio.0" ,NULL ), +OF_DEV_AUXDATA ("ti,davinci-dm6467-emac" ,0x01e20000 ,"davinci_emac.1" , + NULL), + {} };
Signature · 1 line
1.7.9.5
PATCH v3 6/6 ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
In reply to Prabhakar LadFrom: "Lad, Prabhakar" <[email protected]>
This patch makes a common function for to configure emac and calls it appropriately in DT and non DT boot mode. The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN GPIO pin appropriately.
---
Changes for v2: none
Changes for v3:
a> added a common function in da850.c to configure
the CFGCHIP3 chip.
arch/arm/mach-davinci/board-da850-evm.c | 36 ++-------------------- arch/arm/mach-davinci/da850.c | 45 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/da8xx-dt.c | 16 ++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 4 files changed, 64 insertions(+), 34 deletions(-)
arch/arm/mach-davinci/board-da850-evm.c +2 -34
@@ -50,7 +50,6 @@#include <media/tvp514x.h> #include <media/adv7343.h> -#define DA850_EVM_PHY_ID "davinci_mdio-0:00"#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
@@ -60,8 +59,6 @@#define DA850_WLAN_EN GPIO_TO_PIN(6, 9)#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10) -#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) -static struct mtd_partition da850evm_spiflash_part[] = { [0 ] = { .name ="UBL" ,
@@ -1033,26 +1030,18 @@ static const short da850_evm_rmii_pins[] = {static int __init da850_evm_config_emac (void ) { -void __iomem *cfg_chip3_base; -int ret; -u32 val;struct davinci_soc_info *soc_info = &davinci_soc_info;u8 rmii_en = soc_info->emac_pdata->rmii_en; +int ret;if (!machine_is_davinci_da850_evm ())return 0 ; - cfg_chip3_base =DA8XX_SYSCFG0_VIRT (DA8XX_CFGCHIP3_REG ); - - val =__raw_readl (cfg_chip3_base); -if (rmii_en) { - val |=BIT (8 ); ret =davinci_cfg_reg_list (da850_evm_rmii_pins);pr_info ("EMAC: RMII PHY configured, MII PHY will not be" " functional\n" ); }else { - val &= ~BIT (8 ); ret =davinci_cfg_reg_list (da850_evm_mii_pins);pr_info ("EMAC: MII PHY configured, RMII PHY will not be" " functional\n" );
@@ -1062,28 +1051,7 @@ static int __init da850_evm_config_emac(void)pr_warn ("%s: CPGMAC/RMII mux setup failed: %d\n" , __func__, ret); -/* configure the CFGCHIP3 register for RMII or MII */ -__raw_writel (val, cfg_chip3_base); - - ret =davinci_cfg_reg (DA850_GPIO2_6 ); -if (ret) -pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); - - ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" ); -if (ret) { -pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); -return ret; - } - -/* Enable/Disable MII MDIO clock */ -gpio_direction_output (DA850_MII_MDIO_CLKEN_PIN , rmii_en); - - soc_info->emac_pdata->phy_id =DA850_EVM_PHY_ID ; - - ret =da8xx_register_emac (); -if (ret) -pr_warn ("%s: EMAC registration failed: %d\n" , __func__, ret); - +da850_config_emac (0 , rmii_en);return 0 ; }device_initcall (da850_evm_config_emac);
arch/arm/mach-davinci/da850.c +45 -0
51 lines not on this page · raw message
arch/arm/mach-davinci/da8xx-dt.c +16 -0
@@ -56,12 +56,28 @@ static struct of_dev_auxdata da850_auxdata_lookup[] __initdata = {#ifdef CONFIG_ARCH_DAVINCI_DA850 +static void __init da8xx_config_emac (void ) +{ +struct device_node *np; +u32 rmii_en =0 ; + + np =of_find_compatible_node (NULL ,NULL ,"ti,davinci-dm6467-emac" ); +if (!np) +return ; + +of_property_read_u32 (np,"ti,davinci-rmii-en" , &rmii_en); + +da850_config_emac (1 , rmii_en); +} + +static void __init da850_init_machine (void ) {of_platform_populate (NULL , of_default_bus_match_table, da850_auxdata_lookup,NULL );da8xx_uart_clk_enable (); +da8xx_config_emac (); } static const char *da850_boards_compat[] __initdata = {
arch/arm/mach-davinci/include/mach/da8xx.h +1 -0
@@ -109,6 +109,7 @@ int __init da850_register_vpif_capturevoid da8xx_restart (char mode,const char *cmd);void da8xx_rproc_reserve_cma (void );int da8xx_register_rproc (void ); +void da850_config_emac (u32 dt_mode,u32 rmii_enabled);extern struct platform_device da8xx_serial_device;extern struct emac_platform_data da8xx_emac_pdata;
Signature · 1 line
1.7.9.5
Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Quoted 135 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch makes a common function for to configure emac and calls it appropriately in DT and non DT boot mode. The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets
DA850_MII_MDIO_CLKEN_PINGPIO pin appropriately.Signed-off-by Lad, Prabhakar <[email protected]>Cc linux-arm-kernel at lists.infradead.orgCc linux-kernel at vger.kernel.orgCc davinci-linux-open-source at linux.davincidsp.comCc netdev at vger.kernel.orgCc devicetree-discuss at lists.ozlabs.orgCc Sekhar Nori <[email protected]>Cc Heiko Schocher <[email protected]>---
Changes for v2: none
Changes for v3:
a> added a common function inda850.cto configure
the CFGCHIP3 chip.arch/arm/mach-davinci/board-da850-evm.c | 36 ++-------------------- arch/arm/mach-davinci/da850.c | 45 ++++++++++++++++++++++++++++ arch/arm/mach-davinci/da8xx-dt.c | 16 ++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 4 files changed, 64 insertions(+), 34 deletions(-)arch/arm/mach-davinci/board-da850-evm.c +2
-34@@ -50,7 +50,6 @@#include <media/tvp514x.h> #include <media/adv7343.h> -#define DA850_EVM_PHY_ID "davinci_mdio-0:00"#define DA850_LCD_PWR_PIN GPIO_TO_PIN(2, 8)#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)@@ -60,8 +59,6 @@#define DA850_WLAN_EN GPIO_TO_PIN(6, 9)#define DA850_WLAN_IRQ GPIO_TO_PIN(6, 10) -#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) -static struct mtd_partition da850evm_spiflash_part[] = { [0 ] = { .name ="UBL" ,@@ -1033,26 +1030,18 @@ static const short da850_evm_rmii_pins[] = {static int __init da850_evm_config_emac (void ) { -void __iomem *cfg_chip3_base; -int ret; -u32 val;struct davinci_soc_info *soc_info = &davinci_soc_info;u8 rmii_en = soc_info->emac_pdata->rmii_en; +int ret;if (!machine_is_davinci_da850_evm ())return 0 ; - cfg_chip3_base =DA8XX_SYSCFG0_VIRT (DA8XX_CFGCHIP3_REG ); - - val =__raw_readl (cfg_chip3_base); -if (rmii_en) { - val |=BIT (8 ); ret =davinci_cfg_reg_list (da850_evm_rmii_pins);pr_info ("EMAC: RMII PHY configured, MII PHY will not be" " functional\n" ); }else { - val &= ~BIT (8 ); ret =davinci_cfg_reg_list (da850_evm_mii_pins);pr_info ("EMAC: MII PHY configured, RMII PHY will not be" " functional\n" );@@ -1062,28 +1051,7 @@ static int __init da850_evm_config_emac(void)pr_warn ("%s: CPGMAC/RMII mux setup failed: %d\n" , __func__, ret); -/* configure the CFGCHIP3 register for RMII or MII */ -__raw_writel (val, cfg_chip3_base); - - ret =davinci_cfg_reg (DA850_GPIO2_6 ); -if (ret) -pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); - - ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" ); -if (ret) { -pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); -return ret; - } - -/* Enable/Disable MII MDIO clock */ -gpio_direction_output (DA850_MII_MDIO_CLKEN_PIN , rmii_en); - - soc_info->emac_pdata->phy_id =DA850_EVM_PHY_ID ; - - ret =da8xx_register_emac (); -if (ret) -pr_warn ("%s: EMAC registration failed: %d\n" , __func__, ret); - +da850_config_emac (0 , rmii_en);return 0 ; }device_initcall (da850_evm_config_emac);arch/arm/mach-davinci/da850.c +20
-0@@ -1197,6 +1197,51 @@ no_ddrpll_mem:return ret; } +void __init da850_config_emac (u32 dt_mode,u32 rmii_enabled) +{ +#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) +#define DA850_EVM_PHY_ID "davinci_mdio-0:00" + +void __iomem *cfg_chip3_base; +int ret; +u32 val; + + cfg_chip3_base =DA8XX_SYSCFG0_VIRT (DA8XX_CFGCHIP3_REG ); + + val =readl (cfg_chip3_base); + +if (rmii_enabled) + val |=BIT (8 ); +else + val &= ~BIT (8 ); + +/* configure the CFGCHIP3 register for RMII or MII */ +writel (val, cfg_chip3_base);
arch/arm/mach-davinci/da850.c no_ddrpll_mem: · line 1229
Quoted 10 lines
arch/arm/mach-davinci/da850.c +10
-0+ + ret =davinci_cfg_reg (DA850_GPIO2_6 ); +if (ret) +pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); + + ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" ); +if (ret) { +pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); +return ; + }
You cannot do this in SoC specific code. All boards wont use a GPIO to choose between MII/RMII. You need to do this in a EVM specific manner. This just means you retain the GPIO part of code in board-da850-evm.c and for the DT case use a board specific GPIO node. See a similar example in arch/arm/boot/dts/ste-nomadik-s8815.dts and how the code uses it in arch/arm/mach-nomadik/cpu-8815.c.
Thanks,
Sekhar
Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Hi Sekhar,
Sorry for the delayed response I was on leave and now back again up and running.
Quoted 9 lines · Sekhar Nori
Quoted 8 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch makes a common function for to configure emac and calls it appropriately in DT and non DT boot mode. The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets
DA850_MII_MDIO_CLKEN_PINGPIO pin appropriately.
[Snip]
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-davinci/da850.c +13
-0+if (rmii_enabled) + val |=BIT (8 ); +else + val &= ~BIT (8 ); + +/* configure the CFGCHIP3 register for RMII or MII */ +writel (val, cfg_chip3_base); + + ret =davinci_cfg_reg (DA850_GPIO2_6 ); +if (ret) +pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); + + ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" );
Quoted 8 lines
arch/arm/mach-davinci/da850.c no_ddrpll_mem: · line 1229
Quoted 4 lines
arch/arm/mach-davinci/da850.c +4
-0+if (ret) { +pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); +return ; + }You cannot do this in SoC specific code. All boards wont use a GPIO to choose between MII/RMII. You need to do this in a EVM specific manner. This just means you retain the GPIO part of code in
board-da850-evm.c
OK
Quoted 2 lines
and for the DT case use a board specific GPIO node. See a similar example in
arch/arm/boot/dts/ste-nomadik-s8815.dtsand how the code uses
Alrite something similar to usb-s8815 node.
Quoted 2 lines
it in
arch/arm/mach-nomadik/cpu-8815.c.
But I don't see any code to access this node in this file, can you point me to right direction ?
Regards,
--Prabhakar Lad
Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Quoted 41 lines · Prabhakar Lad
Hi Sekhar,
Sorry for the delayed response I was on leave and now back again up and running.
Quoted 9 lines · Sekhar Nori
Quoted 8 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch makes a common function for to configure emac and calls it appropriately in DT and non DT boot mode. The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets
DA850_MII_MDIO_CLKEN_PINGPIO pin appropriately.[Snip]
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-davinci/da850.c +13
-0+if (rmii_enabled) + val |=BIT (8 ); +else + val &= ~BIT (8 ); + +/* configure the CFGCHIP3 register for RMII or MII */ +writel (val, cfg_chip3_base); + + ret =davinci_cfg_reg (DA850_GPIO2_6 ); +if (ret) +pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); + + ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" );Quoted 8 lines
arch/arm/mach-davinci/da850.c no_ddrpll_mem: · line 1229
Quoted 4 lines
arch/arm/mach-davinci/da850.c +4
-0+if (ret) { +pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); +return ; + }You cannot do this in SoC specific code. All boards wont use a GPIO to choose between MII/RMII. You need to do this in a EVM specific manner. This just means you retain the GPIO part of code in
board-da850-evm.cOK
Quoted 8 lines
Quoted 2 lines
and for the DT case use a board specific GPIO node. See a similar example in
arch/arm/boot/dts/ste-nomadik-s8815.dtsand how the code usesAlrite something similar to usb-s8815 node.
Quoted 2 lines
it in
arch/arm/mach-nomadik/cpu-8815.c.But I don't see any code to access this node in this file, can you point me to right direction ?
Look at cpu8815_eth_init() function in this file.
Thanks,
Sekhar
Re: [PATCH v3 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac
Quoted 44 lines · Sekhar Nori
Quoted 43 lines · Prabhakar Lad
Hi Sekhar,
Sorry for the delayed response I was on leave and now back again up and running.
Quoted 9 lines · Sekhar Nori
Quoted 8 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch makes a common function for to configure emac and calls it appropriately in DT and non DT boot mode. The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets
DA850_MII_MDIO_CLKEN_PINGPIO pin appropriately.[Snip]
Quoted 13 lines
Quoted 13 lines
arch/arm/mach-davinci/da850.c +13
-0+if (rmii_enabled) + val |=BIT (8 ); +else + val &= ~BIT (8 ); + +/* configure the CFGCHIP3 register for RMII or MII */ +writel (val, cfg_chip3_base); + + ret =davinci_cfg_reg (DA850_GPIO2_6 ); +if (ret) +pr_warn ("%s:GPIO(2,6) mux setup failed\n" , __func__); + + ret =gpio_request (DA850_MII_MDIO_CLKEN_PIN ,"mdio_clk_en" );Quoted 8 lines
arch/arm/mach-davinci/da850.c no_ddrpll_mem: · line 1229
Quoted 4 lines
arch/arm/mach-davinci/da850.c +4
-0+if (ret) { +pr_warn ("Cannot open GPIO %d\n" ,DA850_MII_MDIO_CLKEN_PIN ); +return ; + }You cannot do this in SoC specific code. All boards wont use a GPIO to choose between MII/RMII. You need to do this in a EVM specific manner. This just means you retain the GPIO part of code in
board-da850-evm.cOK
Quoted 2 lines
and for the DT case use a board specific GPIO node. See a similar example in
arch/arm/boot/dts/ste-nomadik-s8815.dtsand how the code uses
Quoted 9 lines
Quoted 6 lines
Alrite something similar to usb-s8815 node.
Quoted 2 lines
it in
arch/arm/mach-nomadik/cpu-8815.c.But I don't see any code to access this node in this file, can you point me to right direction ?
Look at
cpu8815_eth_init()function in this file.
Thanks, I was looking at some earlier version of code here [1], where this was missing.
[1] https://github.com/AndrewDB/rk3066-kernel/blob/master/arch/arm/mach-nomadik/cpu-8815.c
Regards,
--Prabhakar Lad
Hi Sekhar,
Quoted 15 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch set enables Ethernet support through device tree model. This patch set enables mii interface only and is being tested to boot via rootfs. The rmii phy is present on the i2c gpio expander chip (UI board) for which yet support needs to be added, once the DT support for the chip is enabled, enabling rmii will be subsequnet patch.
Changes for v2:
1: Enabled mdio device.
2: Fixed clock lookup.Changes for v3:
1: Fixed review comments pointed out by Sekhar.
Quoted 9 lines
Lad, Prabhakar (6):
ARM: davinci: da8xx: fix clock lookup for mdio device
ARM: davinci: da850: add DT node for mdio device
ARM: davinci: da850: addOF_DEV_AUXDATAentry for mdio.
ARM: davinci: da850: add DT node for eth0.
ARM: davinci: da850: addOF_DEV_AUXDATAentry for eth0.
ARM: davinci: da850: configure system configuration chip(CFGCHIP3)
for emac
gentle ping..
Regards,
--Prabhakar Lad
Quoted 28 lines · Prabhakar Lad
Hi Sekhar,
Quoted 15 lines · Prabhakar Lad
From: "Lad, Prabhakar" <[email protected]>
This patch set enables Ethernet support through device tree model. This patch set enables mii interface only and is being tested to boot via rootfs. The rmii phy is present on the i2c gpio expander chip (UI board) for which yet support needs to be added, once the DT support for the chip is enabled, enabling rmii will be subsequnet patch.
Changes for v2:
1: Enabled mdio device.
2: Fixed clock lookup.Changes for v3:
1: Fixed review comments pointed out by Sekhar.Quoted 9 lines
Lad, Prabhakar (6):
ARM: davinci: da8xx: fix clock lookup for mdio device
ARM: davinci: da850: add DT node for mdio device
ARM: davinci: da850: addOF_DEV_AUXDATAentry for mdio.
ARM: davinci: da850: add DT node for eth0.
ARM: davinci: da850: addOF_DEV_AUXDATAentry for eth0.
ARM: davinci: da850: configure system configuration chip(CFGCHIP3)
for emac
Quoted 1 line
gentle ping..
I haven't been able to get to reviewing patches meant for v3.12 yet. Most probably will happen next week.
Thanks,
Sekhar