Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Wolfgang Denk wrote: Dear Stephan Linz, In message 1325956366.18981.47.camel@keto you wrote: I'll provide the same way for the Xilinx LL_TEMAC driver as for the Xilinx AXI-EMAC driver. I prepare the microblaze-generic board code to support all potential Ethernet drivers but leave out the specific usage. You are right when you say that there is no code that refere to the new driver code -- there are also no configuration for this. And yes we adapt/change the xparameters.h out of mainline tree to enable the driver code -- but I think, that is not really a out of tree port. But what would be the best implementation for unspecified targets here? The question is actually a very simple one here: is there any board configuration in mainline that will actually compile and link against this driver? If yes, then everything is fine. If not, we would not even know if there were gross syntax errors in that code, and we would never notce when changes to other parts break compatibility with it. This is why I will not add any code that is not used in mainline - out-of-tree users don't help a bit. OK. Stephan, please send v8 with suggested changes with all patches or link to patches which are necessary to use. Please also define fake address XILINX_LLTEMAC_BASEADDR in xparameters.h to be compiled. The same we will do for axi emac driver. Stephan if you like I can add that changes to my custodian git tree and do final testing before we ask Wolfgang to merge. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Am Donnerstag, den 12.01.2012, 11:53 +0100 schrieb Michal Simek: Wolfgang Denk wrote: Dear Stephan Linz, But what would be the best implementation for unspecified targets here? The question is actually a very simple one here: is there any board configuration in mainline that will actually compile and link against this driver? If yes, then everything is fine. If not, we would not even know if there were gross syntax errors in that code, and we would never notce when changes to other parts break compatibility with it. This is why I will not add any code that is not used in mainline - out-of-tree users don't help a bit. OK. Stephan, please send v8 with suggested changes with all patches or link to patches which are necessary to use. Please also define fake address XILINX_LLTEMAC_BASEADDR in xparameters.h to be compiled. The same we will do for axi emac driver. Stephan if you like I can add that changes to my custodian git tree and do final testing before we ask Wolfgang to merge. I can release the v8 patch next week. I will do some tests on weekend before I post the results here on list. The next release will be prepared to support more than one TEMAC cores (LL_TEMAC0 nad LL_TEMAC1). So I need a little bit more time to test -- Best regards, Stephan Linz __ MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start OpenDCC: http://www.li-pro.net/opendcc.phtml PC/M: http://www.li-pro.net/pcm.phtml Sourceforge: http://sourceforge.net/users/slz Gitorious: https://gitorious.org/~slz ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Stephan Linz wrote: Am Donnerstag, den 05.01.2012, 20:19 +0100 schrieb Wolfgang Denk: Dear Stephan Linz, In message 1325783490.7827.45.camel@keto you wrote: Michals latest Microblaze platform patches will enable this driver for board/xilinx/microblaze-generic and we know about a success story on a propietary Virtex5 FX board (ppc440) -- tested by Ricardo Ribalda. -- snip -- So I'll rework the driver and present a new v8 patch as soon as possible. OK. Please submit it only if it comes with code that references the driver. Hi Wolfgang, I understand your opinions to stick together all the different code fragments. Unfortunately, this driver will be used by systems with synthesized hardware (FPGA SoftCPU systems). The target board (hardware around the FPGA) will be fixed but the content (CPU, controller, busses, interfacess, addresses, ...) will be variable and not fixed. That's why we use a so named microblaze-generic board configuration controlled by the header xparameters.h in board directory. The default content of xparameters.h is really only basic and enables not nearly half of all possibilities. For example the default configuration in xparameters.h will enable the Xilinx EMAC-Lite driver (with XILINX_EMACLITE_BASEADDR) but do nothing to enable the Xilinx AXI-EMAC driver (with XILINX_AXIEMAC_BASEADDR) -- it makes no sense to enable both at the same time. Every fpga system is different that's why I have created microblaze-generic board and BSP generator to generate xparameters.h and config.mk for specific configurations. Make no sense to create new board for every configuration. The same arguments is valid for xilinx ppc405/ppc440 systems where I am still don't like that there are avnet boards and maybe others. I'll provide the same way for the Xilinx LL_TEMAC driver as for the Xilinx AXI-EMAC driver. I prepare the microblaze-generic board code to support all potential Ethernet drivers but leave out the specific usage. You are right when you say that there is no code that refere to the new driver code -- there are also no configuration for this. And yes we adapt/change the xparameters.h out of mainline tree to enable the driver code -- but I think, that is not really a out of tree port. But what would be the best implementation for unspecified targets here? @Michal: Is there anybody who use the current default configuration from microblaze-generic/xparameters.h on a real FPGA system design? If not we could expand xparameters.h with a fantasy configuration to enable all potential drivers used on a Microblaze system. So we have a reference to driver code and can test the rebuild again and again with a simple 'make microblaze-generic'. What do you mean? It is the same situation as is for axi-emac and even emaclite. xparamters.h/config.mk are for any old platform which none uses it. IMHO Stephan suggestion could work - enable all drivers in xparameters.h and enable code compilation. I can also extend my testing system to compile u-boot with ll_temac and test it on qemu every day. Thanks, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Dear Stephan Linz, In message 1325956366.18981.47.camel@keto you wrote: I'll provide the same way for the Xilinx LL_TEMAC driver as for the Xilinx AXI-EMAC driver. I prepare the microblaze-generic board code to support all potential Ethernet drivers but leave out the specific usage. You are right when you say that there is no code that refere to the new driver code -- there are also no configuration for this. And yes we adapt/change the xparameters.h out of mainline tree to enable the driver code -- but I think, that is not really a out of tree port. But what would be the best implementation for unspecified targets here? The question is actually a very simple one here: is there any board configuration in mainline that will actually compile and link against this driver? If yes, then everything is fine. If not, we would not even know if there were gross syntax errors in that code, and we would never notce when changes to other parts break compatibility with it. This is why I will not add any code that is not used in mainline - out-of-tree users don't help a bit. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de The human mind ordinarily operates at only ten percent of its capaci- ty - the rest is overhead for the operating system. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Am Donnerstag, den 05.01.2012, 20:19 +0100 schrieb Wolfgang Denk: Dear Stephan Linz, In message 1325783490.7827.45.camel@keto you wrote: Michals latest Microblaze platform patches will enable this driver for board/xilinx/microblaze-generic and we know about a success story on a propietary Virtex5 FX board (ppc440) -- tested by Ricardo Ribalda. -- snip -- So I'll rework the driver and present a new v8 patch as soon as possible. OK. Please submit it only if it comes with code that references the driver. Hi Wolfgang, I understand your opinions to stick together all the different code fragments. Unfortunately, this driver will be used by systems with synthesized hardware (FPGA SoftCPU systems). The target board (hardware around the FPGA) will be fixed but the content (CPU, controller, busses, interfacess, addresses, ...) will be variable and not fixed. That's why we use a so named microblaze-generic board configuration controlled by the header xparameters.h in board directory. The default content of xparameters.h is really only basic and enables not nearly half of all possibilities. For example the default configuration in xparameters.h will enable the Xilinx EMAC-Lite driver (with XILINX_EMACLITE_BASEADDR) but do nothing to enable the Xilinx AXI-EMAC driver (with XILINX_AXIEMAC_BASEADDR) -- it makes no sense to enable both at the same time. I'll provide the same way for the Xilinx LL_TEMAC driver as for the Xilinx AXI-EMAC driver. I prepare the microblaze-generic board code to support all potential Ethernet drivers but leave out the specific usage. You are right when you say that there is no code that refere to the new driver code -- there are also no configuration for this. And yes we adapt/change the xparameters.h out of mainline tree to enable the driver code -- but I think, that is not really a out of tree port. But what would be the best implementation for unspecified targets here? @Michal: Is there anybody who use the current default configuration from microblaze-generic/xparameters.h on a real FPGA system design? If not we could expand xparameters.h with a fantasy configuration to enable all potential drivers used on a Microblaze system. So we have a reference to driver code and can test the rebuild again and again with a simple 'make microblaze-generic'. What do you mean? -- Best regards, Stephan Linz __ MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start OpenDCC: http://www.li-pro.net/opendcc.phtml PC/M: http://www.li-pro.net/pcm.phtml Sourceforge: http://sourceforge.net/users/slz Gitorious: https://gitorious.org/~slz ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Dear Michal Simek, In message 4ef2f20b.6050...@monstr.eu you wrote: Are there going to be any users for this code? Sure. This driver lies out of mainline code for quite some times. ll_temac is IP core which is used by Microblaze and xilinx ppc. There are two options for network IP. The first is emaclite driver which is in the mainline and high speed and especially 1Gb/s LAN ll_temac driver. Then let's add it when the first board gets submitted that uses it. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de Nobody trips over mountains. It is the small pebble that causes you to stumble. Pass all the pebbles in your path and you will find you have crossed the mountain. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Am Donnerstag, den 05.01.2012, 17:10 +0100 schrieb Wolfgang Denk: Dear Michal Simek, In message 4ef2f20b.6050...@monstr.eu you wrote: Are there going to be any users for this code? Sure. This driver lies out of mainline code for quite some times. ll_temac is IP core which is used by Microblaze and xilinx ppc. There are two options for network IP. The first is emaclite driver which is in the mainline and high speed and especially 1Gb/s LAN ll_temac driver. Then let's add it when the first board gets submitted that uses it. Michals latest Microblaze platform patches will enable this driver for board/xilinx/microblaze-generic and we know about a success story on a propietary Virtex5 FX board (ppc440) -- tested by Ricardo Ribalda. So it could be save to add the driver together with Michals platform patches. It works fine to me on different ML605 (Virtex 6) and SP3ADSP1800 (Spartan 3) Microblaze systems but ... Last week, I received hints from Andy Fleming to improve the PHYLIB handling and avoid deprecated code. So I'll rework the driver and present a new v8 patch as soon as possible. -- Best regards, Stephan Linz __ MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start OpenDCC: http://www.li-pro.net/opendcc.phtml PC/M: http://www.li-pro.net/pcm.phtml Sourceforge: http://sourceforge.net/users/slz Gitorious: https://gitorious.org/~slz ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Dear Stephan Linz, In message 1325783490.7827.45.camel@keto you wrote: Michals latest Microblaze platform patches will enable this driver for board/xilinx/microblaze-generic and we know about a success story on a propietary Virtex5 FX board (ppc440) -- tested by Ricardo Ribalda. So it could be save to add the driver together with Michals platform patches. It works fine to me on different ML605 (Virtex 6) and SP3ADSP1800 (Spartan 3) Microblaze systems but ... Frankly, I don't care at all about reports that it is working for this or that out of tree port. As long as there is no code in mainline that will use the driver and thus profide a way to test if it's actually compile clean, I will not add it. Last week, I received hints from Andy Fleming to improve the PHYLIB handling and avoid deprecated code. So I'll rework the driver and present a new v8 patch as soon as possible. OK. Please submit it only if it comes with code that references the driver. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de History tends to exaggerate. -- Col. Green, The Savage Curtain, stardate 5906.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
On Thu, Dec 1, 2011 at 2:39 PM, Stephan Linz l...@li-pro.net wrote: +static int phywrite(struct eth_device *dev, u8 phy_addr, + u8 reg_addr, u16 phy_data) +{ + struct temac_reg *regs = (struct temac_reg *)dev-iobase; + + out_be32(regs-lsw, (phy_data LSW_REGDAT_MASK)); + out_be32(regs-ctl, CTL_WEN | TEMAC_MIIMWD); + + out_be32(regs-lsw, + ((phy_addr LSW_PHYAD_POS) LSW_PHYAD_MASK) | + (reg_addr LSW_REGAD_MASK)); + out_be32(regs-ctl, CTL_WEN | TEMAC_MIIMAI); + + if (check_status(regs, RSE_MIIM_WR)) + return 1; + + return 0; +} + +/* + * Indirect MII PHY read via ll_temac. + * + * http://www.xilinx.com/support/documentation/ip_documentation/xps_ll_temac.pdf + * page 67, Using the MII Management to Access PHY Registers + */ +static int phyread(struct eth_device *dev, u8 phy_addr, + u8 reg_addr, u16 *value) phywrite() and phyread() are very generic function names that nearly override the PHY Lib's phy_read() and phy_write(). I also notice that these functions don't appear to implement the PHY Lib read/write interface. + +/* setting sub-controller and ll_temac to proper setting */ +static int setup_ctrl(struct eth_device *dev) +{ + struct ll_temac *ll_temac = dev-priv; + + if (ll_temac-ctrlreset) { + + if (ll_temac-ctrlreset(dev)) + return 0; + + } Minor nit - this could be: if (ll_temac-ctrlreset ll_temac-ctrlreset(dev)) return 0; Certainly it needs neither the 2 empty lines, nor the braces. + + if (ll_temac-ctrlinit) { + + if (ll_temac-ctrlinit(dev)) + return 0; + + } Same here. +static int ll_temac_miiphy_read(const char *devname, unsigned char addr, + unsigned char reg, unsigned short *value) +{ + int ret; + struct eth_device *dev = eth_get_dev(); + + ret = phyread(dev, addr, reg, value); + debug(%s 0x%x, 0x%x, 0x%x\n, __func__, addr, reg, *value); + return ret; +} + +static int ll_temac_miiphy_write(const char *devname, unsigned char addr, + unsigned char reg, unsigned short value) +{ + struct eth_device *dev = eth_get_dev(); + + debug(%s 0x%x, 0x%x, 0x%x\n, __func__, addr, reg, value); + return phywrite(dev, addr, reg, value); +} Please don't implement these functions. They are deprecated. This way of doing things will cause problems if eth_get_dev() doesn't return the ethernet interface you want, and makes it very difficult to do MDIO via something that's not an ethernet interface (Like gpio pins). + +/* + * bis: board information + * base_addr: LL TEMAC register bank + * ctrl_addr: LL TEMAC sub-controller register bank (FIFO or SDMA) + * mode: driver mode bit flags (see xilinx_ll_temac.h) + */ +int xilinx_ll_temac_initialize(bd_t *bis, unsigned long base_addr, + int mode, unsigned long ctrl_addr) +{ + struct eth_device *dev; + struct ll_temac *ll_temac; + + dev = calloc(1, sizeof(*dev)); + if (dev == NULL) + return -1; + + dev-priv = calloc(1, sizeof(struct ll_temac)); + if (dev-priv == NULL) { + free(dev); + return -1; + } + + ll_temac = dev-priv; + + sprintf(dev-name, Xlltem.%lx, base_addr); + + dev-iobase = base_addr; + ll_temac-ctrladdr = ctrl_addr; + ll_temac-rx_bp = rx_buffer; + ll_temac-tx_bp = tx_buffer; + ll_temac-rx_dp = rx_descr; + ll_temac-tx_dp = tx_descr; + ll_temac-phyaddr = CONFIG_PHY_ADDR; + + dev-init = ll_temac_init; + dev-halt = ll_temac_halt; + dev-write_hwaddr = ll_temac_addr_setup; + + if (mode M_SDMA) { +#if defined(CONFIG_XILINX_440) || defined(CONFIG_XILINX_405) + if (mode M_DCR) { + ll_temac_collect_xldcr_sdma_reg_addr(dev); + ll_temac-in32 = ll_temac_xldcr_in32; + ll_temac-out32 = ll_temac_xldcr_out32; + } else +#endif + { + ll_temac_collect_xlplb_sdma_reg_addr(dev); + ll_temac-in32 = ll_temac_xlplb_in32; + ll_temac-out32 = ll_temac_xlplb_out32; + } + ll_temac-ctrlinit = ll_temac_init_sdma; + ll_temac-ctrlhalt = ll_temac_halt_sdma; + ll_temac-ctrlreset = ll_temac_reset_sdma; + dev-recv = ll_temac_recv_sdma; + dev-send = ll_temac_send_sdma; + } else { + ll_temac-in32 = NULL; + ll_temac-out32 = NULL; + ll_temac-ctrlinit = NULL; +
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Wolfgang Denk wrote: Dear Stephan Linz, In message 1322771978-22008-2-git-send-email-l...@li-pro.net you wrote: Xilinx LocalLink Tri-Mode Ether MAC driver can be used by Xilinx Microblaze or Xilinx ppc405/440 in SDMA and FIFO mode. DCR or XPS bus can be used. The driver uses and requires MII and PHYLIB. CP: 4 warnings: 'Use of volatile is usually wrong' I won't fix this, because it depends on the network driver subsystem. Signed-off-by: Stephan Linz l...@li-pro.net Are there going to be any users for this code? Sure. This driver lies out of mainline code for quite some times. ll_temac is IP core which is used by Microblaze and xilinx ppc. There are two options for network IP. The first is emaclite driver which is in the mainline and high speed and especially 1Gb/s LAN ll_temac driver. Regards, Michal -- Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Am Dienstag, den 20.12.2011, 23:56 +0100 schrieb Wolfgang Denk: Dear Stephan Linz, Hello Wolfgang, In message 1322771978-22008-2-git-send-email-l...@li-pro.net you wrote: Xilinx LocalLink Tri-Mode Ether MAC driver can be used by Xilinx Microblaze or Xilinx ppc405/440 in SDMA and FIFO mode. DCR or XPS bus can be used. The driver uses and requires MII and PHYLIB. CP: 4 warnings: 'Use of volatile is usually wrong' I won't fix this, because it depends on the network driver subsystem. Signed-off-by: Stephan Linz l...@li-pro.net Are there going to be any users for this code? Yes, of course. There are three plattform patches by Michal Simek that still waiting to merge in together with the v7 ll_temac driver. This patches enable the ll_temac driver for the microblaze-generic plattform. See patchwork public bundle: http://patchwork.ozlabs.org/bundle/rexut/net-ll_temac/ I'll rebase all three patches and post it on this thread ... -- Best regards, Stephan Linz ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v7] net: ll_temac: Add LL TEMAC driver to u-boot
Dear Stephan Linz, In message 1322771978-22008-2-git-send-email-l...@li-pro.net you wrote: Xilinx LocalLink Tri-Mode Ether MAC driver can be used by Xilinx Microblaze or Xilinx ppc405/440 in SDMA and FIFO mode. DCR or XPS bus can be used. The driver uses and requires MII and PHYLIB. CP: 4 warnings: 'Use of volatile is usually wrong' I won't fix this, because it depends on the network driver subsystem. Signed-off-by: Stephan Linz l...@li-pro.net Are there going to be any users for this code? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de panic: kernel trap (ignored) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot