LL TEMAC v10 refactored -- for evaluation only
Subsystems (2)
Hi Michal,
back to your requests and objections I've built up a new patch set for evaluation. Some of the changes relate to the Microblaze platform rather than the network driver.
1) U-Boot configuration variables vs. xparameters.h
----------------------------------------------------------------------
I've tried to find a compromise between the U-Boot coding and configuration style and your preference. But at least in the point of the many many CPP conditional directives I can not reduce the code. I can move the code only to another place. I need a converstion from the automaticaly generated content of xparameters.h to the U-Boot configuration space. Now you can find this conversion matrix in a new platform header, xconversions.h -- I've placed the header in board/xilinx/microblaze-generic/ I think, we can find a better place.
The conversion matrix avoids all the wrong configuration variables inside U-Boot code beginning with XILINX_ (and not CONFIG_) and we can expand the configuration to new software related options we never get from hardware (example special interface naming). This mechanism can also be used by other driver and platform code, for example arch/microblaze/cpu/cache.c and arch/microblaze/lib/bootm.c (use XILINX_USE_DCACHE instead of ex. CONFIG_XILINX_DCACHE), common/cmd_mfsl.c (use XILINX_FSL_NUMBER instead of ex. CONFIG_XILINX_FSL), serial_xuartlite.c (use XILINX_UARTLITE_BASEADDR, XILINX_UARTLITE_BASEADDR1, ...), and probably also in xilinx_emaclite.c and xilinx_axi_emac.c when we extand a multi-IP support as we have done for the LL TEMAC now. Sure we have to work on, but it's another case (I can make some patches if you want)
Another but not currently existing feasibility would be to generate a U-Boot conform xparameters.h, for example CONFIG_XILINX_LL_TEMAC0_BASE_ADDR instead of XILINX_LLTEMAC_BASEADDR. You and I, we have it in hand. We can change the Xilinx BSP in the near future. You in PataLinux and I in my own home-brewed BSP generator TPOS.
2) Standard initialization vs. multiple direct calls from platform
----------------------------------------------------------------------
Returning to the topic "standard" initialization. The last patch will show the differences bwetween your prefered way to do all in board init and my applicable standard initializition (a single call to the driver). Please look at it in the code and decide for yourself.
We need a forward-looking decision, what kind of initialization, we want to use. Do we want to copy and paste the standard initialization steps from ip core to ip core (board init) and from platform to platform (Microplace, PPC405, PPC440) or make a simple call to the driver?
My preferences is to call the driver from platform and let him run all the necessary steps, that I do not want knowing on platform side.
Signature · 8 lines
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
PATCH 1/8 net: ll_temac: Add LL TEMAC driver to u-boot
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.
--- drivers/net/Makefile | 2 + drivers/net/xilinx_ll_temac.c | 433 ++++++++++++++++++++++++++++++++++++ drivers/net/xilinx_ll_temac_fifo.c | 143 ++++++++++++ drivers/net/xilinx_ll_temac_mdio.c | 180 +++++++++++++++ drivers/net/xilinx_ll_temac_sdma.c | 370 ++++++++++++++++++++++++++++++ include/netdev.h | 1 + include/xilinx_ll_temac.h | 358 +++++++++++++++++++++++++++++ include/xilinx_ll_temac_fifo.h | 122 ++++++++++ include/xilinx_ll_temac_mdio.h | 53 +++++ include/xilinx_ll_temac_sdma.h | 281 +++++++++++++++++++++++ 10 files changed, 1943 insertions(+), 0 deletions(-) create mode 100644 drivers/net/xilinx_ll_temac.c create mode 100644 drivers/net/xilinx_ll_temac_fifo.c create mode 100644 drivers/net/xilinx_ll_temac_mdio.c create mode 100644 drivers/net/xilinx_ll_temac_sdma.c create mode 100644 include/xilinx_ll_temac.h create mode 100644 include/xilinx_ll_temac_fifo.h create mode 100644 include/xilinx_ll_temac_mdio.h create mode 100644 include/xilinx_ll_temac_sdma.h
drivers/net/Makefile +2 -0
@@ -77,6 +77,8 @@ COBJS-$(CONFIG_ULI526X) += uli526x.o COBJS-$(CONFIG_VSC7385_ENET) += vsc7385.o COBJS-$(CONFIG_XILINX_AXIEMAC) += xilinx_axi_emac.o COBJS-$(CONFIG_XILINX_EMACLITE) += xilinx_emaclite.o +COBJS-$(CONFIG_XILINX_LL_TEMAC) += xilinx_ll_temac.o xilinx_ll_temac_mdio.o \ + xilinx_ll_temac_fifo.o xilinx_ll_temac_sdma.o COBJS := $(sort $(COBJS-y)) SRCS := $(COBJS:.o=.c)
drivers/net/xilinx_ll_temac.c new file +433 -0
433 lines not on this page · raw message
drivers/net/xilinx_ll_temac_fifo.c new file +143 -0
143 lines not on this page · raw message
drivers/net/xilinx_ll_temac_mdio.c new file +180 -0
180 lines not on this page · raw message
drivers/net/xilinx_ll_temac_sdma.c new file +370 -0
370 lines not on this page · raw message
include/netdev.h +1 -0
@@ -102,6 +102,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, unsigned long dma_addr);int xilinx_emaclite_initialize (bd_t *bis,unsigned long base_addr,int txpp,int rxpp); +int xilinx_ll_temac_standard_init (bd_t *bis);/* Boards with PCI network controllers can call this from their board_eth_init() * function to initialize whatever's on board.
include/xilinx_ll_temac.h new file +358 -0
358 lines not on this page · raw message
include/xilinx_ll_temac_fifo.h new file +122 -0
122 lines not on this page · raw message
include/xilinx_ll_temac_mdio.h new file +53 -0
53 lines not on this page · raw message
include/xilinx_ll_temac_sdma.h new file +281 -0
281 lines not on this page · raw message
Signature · 1 line
1.7.0.4
PATCH 1/8 net: ll_temac: Add LL TEMAC driver to u-boot
Quoted 24 lines · Stephan Linz
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.
Reported-by Michal Simek <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- drivers/net/Makefile | 2 + drivers/net/xilinx_ll_temac.c | 433 ++++++++++++++++++++++++++++++++++++ drivers/net/xilinx_ll_temac_fifo.c | 143 ++++++++++++ drivers/net/xilinx_ll_temac_mdio.c | 180 +++++++++++++++ drivers/net/xilinx_ll_temac_sdma.c | 370 ++++++++++++++++++++++++++++++ include/netdev.h | 1 + include/xilinx_ll_temac.h | 358 +++++++++++++++++++++++++++++ include/xilinx_ll_temac_fifo.h | 122 ++++++++++ include/xilinx_ll_temac_mdio.h | 53 +++++ include/xilinx_ll_temac_sdma.h | 281 +++++++++++++++++++++++ 10 files changed, 1943 insertions(+), 0 deletions(-)
Quoted 8 lines
create mode 100644 drivers/net/xilinx_ll_temac.c create mode 100644 drivers/net/xilinx_ll_temac_fifo.c create mode 100644 drivers/net/xilinx_ll_temac_mdio.c create mode 100644 drivers/net/xilinx_ll_temac_sdma.c create mode 100644 include/xilinx_ll_temac.h create mode 100644 include/xilinx_ll_temac_fifo.h create mode 100644 include/xilinx_ll_temac_mdio.h create mode 100644 include/xilinx_ll_temac_sdma.h
I can't see the reason to add headers directly to include folder. It should be fine to have them in drivers/net/ folder.
Michal
Signature · 4 lines
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
PATCH 2/8 microblaze: Enable several ethernet driver compilation
In reply to Stephan LinzU-Boot's multipple network supports enables to use several ethernet drivers but microblaze-generic platform config file select only one driver.
--- include/configs/microblaze-generic.h | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)
include/configs/microblaze-generic.h +8 -4
@@ -65,11 +65,15 @@/* ethernet */ #undef CONFIG_SYS_ENET -#ifdef XILINX_EMACLITE_BASEADDR -# define CONFIG_XILINX_EMACLITE 1 +#if defined(XILINX_EMACLITE_BASEADDR ) +# define CONFIG_XILINX_EMACLITE 1# define CONFIG_SYS_ENET -#elif XILINX_LLTEMAC_BASEADDR -# define CONFIG_XILINX_LL_TEMAC 1 +#endif +#if defined(XILINX_LLTEMAC_BASEADDR ) || defined(XILINX_LLTEMAC_BASEADDR1 ) || \ + defined(XILINX_LLTEMAC_BASEADDR2 ) || defined(XILINX_LLTEMAC_BASEADDR3 ) || \ + defined(XILINX_LLTEMAC_BASEADDR4 ) || defined(XILINX_LLTEMAC_BASEADDR5 ) || \ + defined(XILINX_LLTEMAC_BASEADDR6 ) || defined(XILINX_LLTEMAC_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC 1# define CONFIG_SYS_ENET #endif #if defined(XILINX_AXIEMAC_BASEADDR )
Signature · 1 line
1.7.0.4
PATCH 2/8 microblaze: Enable several ethernet driver compilation
Quoted 21 lines · Stephan Linz
U-Boot's multipple network supports enables to use several ethernet drivers but microblaze-generic platform config file select only one driver.
Reported-by Michal Simek <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- include/configs/microblaze-generic.h | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)include/configs/microblaze-generic.h +1
-2@@ -65,11 +65,15 @@/* ethernet */ #undef CONFIG_SYS_ENET -#ifdef XILINX_EMACLITE_BASEADDR -# define CONFIG_XILINX_EMACLITE 1 +#if defined(XILINX_EMACLITE_BASEADDR )
include/configs/microblaze-generic.h line 76
Quoted 10 lines
include/configs/microblaze-generic.h +7
-2+# define CONFIG_XILINX_EMACLITE 1# define CONFIG_SYS_ENET -#elif XILINX_LLTEMAC_BASEADDR -# define CONFIG_XILINX_LL_TEMAC 1 +#endif +#if defined(XILINX_LLTEMAC_BASEADDR ) || defined(XILINX_LLTEMAC_BASEADDR1 ) || \ + defined(XILINX_LLTEMAC_BASEADDR2 ) || defined(XILINX_LLTEMAC_BASEADDR3 ) || \ + defined(XILINX_LLTEMAC_BASEADDR4 ) || defined(XILINX_LLTEMAC_BASEADDR5 ) || \ + defined(XILINX_LLTEMAC_BASEADDR6 ) || defined(XILINX_LLTEMAC_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC 1
Why to do it in this way? I believe that the first lltemac driver will have XILINX_LLTEMAC_BASEADDR and then others. But for all configurations if there is lltemac driver then will have anyone just BASEADDR.
Michal
Signature · 4 lines
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
PATCH 2/8 microblaze: Enable several ethernet driver compilation
Am Dienstag, den 31.01.2012, 10:00 +0100 schrieb Michal Simek:
Quoted 27 lines
Quoted 26 lines · Stephan Linz
U-Boot's multipple network supports enables to use several ethernet drivers but microblaze-generic platform config file select only one driver.
Reported-by Michal Simek <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- include/configs/microblaze-generic.h | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)include/configs/microblaze-generic.h +3
-4@@ -65,11 +65,15 @@/* ethernet */ #undef CONFIG_SYS_ENET -#ifdef XILINX_EMACLITE_BASEADDR -# define CONFIG_XILINX_EMACLITE 1 +#if defined(XILINX_EMACLITE_BASEADDR ) +# define CONFIG_XILINX_EMACLITE 1# define CONFIG_SYS_ENET -#elif XILINX_LLTEMAC_BASEADDR -# define CONFIG_XILINX_LL_TEMAC 1 +#endif
Quoted 8 lines
include/configs/microblaze-generic.h line 76
Quoted 5 lines
include/configs/microblaze-generic.h +5
-0+#if defined(XILINX_LLTEMAC_BASEADDR ) || defined(XILINX_LLTEMAC_BASEADDR1 ) || \ + defined(XILINX_LLTEMAC_BASEADDR2 ) || defined(XILINX_LLTEMAC_BASEADDR3 ) || \ + defined(XILINX_LLTEMAC_BASEADDR4 ) || defined(XILINX_LLTEMAC_BASEADDR5 ) || \ + defined(XILINX_LLTEMAC_BASEADDR6 ) || defined(XILINX_LLTEMAC_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC 1Why to do it in this way? I believe that the first lltemac driver will have
XILINX_LLTEMAC_BASEADDRand then others.
Right, but we need a definitive agreement that it is so (Xilinx BSP generator). Did we them? If yes I will drop this part and insert your original condition (test only XILINX_LLTEMAC_BASEADDR).
Quoted 1 line
But for all configurations if there is lltemac driver then will have anyone just BASEADDR.
yep
br,
Stephan
PATCH 2/8 microblaze: Enable several ethernet driver compilation
In reply to Stephan LinzQuoted 24 lines · Stephan Linz
U-Boot's multipple network supports enables to use several ethernet drivers but microblaze-generic platform config file select only one driver.
Reported-by Michal Simek <[email protected]>Signed-off-by Stephan Linz <[email protected]>--- include/configs/microblaze-generic.h | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-)include/configs/microblaze-generic.h +2
-3@@ -65,11 +65,15 @@/* ethernet */ #undef CONFIG_SYS_ENET -#ifdef XILINX_EMACLITE_BASEADDR -# define CONFIG_XILINX_EMACLITE 1 +#if defined(XILINX_EMACLITE_BASEADDR ) +# define CONFIG_XILINX_EMACLITE 1# define CONFIG_SYS_ENET -#elif XILINX_LLTEMAC_BASEADDR
include/configs/microblaze-generic.h line 79
Quoted 10 lines
include/configs/microblaze-generic.h +6
-1-# define CONFIG_XILINX_LL_TEMAC 1 +#endif +#if defined(XILINX_LLTEMAC_BASEADDR ) || defined(XILINX_LLTEMAC_BASEADDR1 ) || \ + defined(XILINX_LLTEMAC_BASEADDR2 ) || defined(XILINX_LLTEMAC_BASEADDR3 ) || \ + defined(XILINX_LLTEMAC_BASEADDR4 ) || defined(XILINX_LLTEMAC_BASEADDR5 ) || \ + defined(XILINX_LLTEMAC_BASEADDR6 ) || defined(XILINX_LLTEMAC_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC 1# define CONFIG_SYS_ENET #endif #if defined(XILINX_AXIEMAC_BASEADDR )
I don't agree with this. The whole reason is to enable ll_temac driver and I believe that all system with ll_temac will starts with XILINX_LLTEMAC_BASEADDR and then others.
Which means if XILINX_LLTEMAC_BASEADDR is there just enable the driver.
I just can't see the reason to start with BASEADDR1 or 2 or .... or 7.
Michal
Signature · 4 lines
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
PATCH 3/8 microblaze: Enable phylib and mii support
In reply to Stephan LinzFrom: Michal Simek <[email protected]>
Enable phylib and mii support for LLTEMAC or AXI EMAC ethernet drivers on Microblaze systems.
--- include/configs/microblaze-generic.h | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
include/configs/microblaze-generic.h +21 -0
@@ -342,4 +342,25 @@#define CONFIG_FIT 1#define CONFIG_OF_LIBFDT 1 +#if defined(CONFIG_XILINX_LL_TEMAC ) || defined(CONFIG_XILINX_AXIEMAC ) +# define CONFIG_MII 1 +# define CONFIG_CMD_MII 1 +# define CONFIG_PHY_GIGE 1 +# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1 +# define CONFIG_PHYLIB 1 +# define CONFIG_PHY_ATHEROS 1 +# define CONFIG_PHY_BROADCOM 1 +# define CONFIG_PHY_DAVICOM 1 +# define CONFIG_PHY_LXT 1 +# define CONFIG_PHY_MARVELL 1 +# define CONFIG_PHY_MICREL 1 +# define CONFIG_PHY_NATSEMI 1 +# define CONFIG_PHY_REALTEK 1 +# define CONFIG_PHY_VITESSE 1 +#else +# undef CONFIG_MII +# undef CONFIG_CMD_MII +# undef CONFIG_PHYLIB +#endif +#endif /* __CONFIG_H */
Signature · 1 line
1.7.0.4
PATCH 3/8 microblaze: Enable phylib and mii support
Quoted 31 lines · Stephan Linz
From: Michal Simek <[email protected]>
Enable phylib and mii support for LLTEMAC or AXI EMAC ethernet drivers on Microblaze systems.
Signed-off-by Michal Simek <[email protected]>Acked-by Stephan Linz <[email protected]>--- include/configs/microblaze-generic.h | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)include/configs/microblaze-generic.h +12
-0@@ -342,4 +342,25 @@#define CONFIG_FIT 1#define CONFIG_OF_LIBFDT 1 +#if defined(CONFIG_XILINX_LL_TEMAC ) || defined(CONFIG_XILINX_AXIEMAC ) +# define CONFIG_MII 1 +# define CONFIG_CMD_MII 1 +# define CONFIG_PHY_GIGE 1 +# define CONFIG_SYS_FAULT_ECHO_LINK_DOWN 1 +# define CONFIG_PHYLIB 1 +# define CONFIG_PHY_ATHEROS 1 +# define CONFIG_PHY_BROADCOM 1 +# define CONFIG_PHY_DAVICOM 1 +# define CONFIG_PHY_LXT 1 +# define CONFIG_PHY_MARVELL 1 +# define CONFIG_PHY_MICREL 1
include/configs/microblaze-generic.h line 366
Quoted 10 lines
include/configs/microblaze-generic.h +9
-0+# define CONFIG_PHY_NATSEMI 1 +# define CONFIG_PHY_REALTEK 1 +# define CONFIG_PHY_VITESSE 1 +#else +# undef CONFIG_MII +# undef CONFIG_CMD_MII +# undef CONFIG_PHYLIB +#endif +#endif /* __CONFIG_H */
This is OK and should be enable at least for AXIEMAC even if ll_temac won't go to mainline. Maybe make sense to do so without waiting for this patchset.
Michal
Signature · 4 lines
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
PATCH 4/8 microblaze: Enable TFTP put command
In reply to Stephan Linz--- include/configs/microblaze-generic.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
include/configs/microblaze-generic.h +1 -0
@@ -259,6 +259,7 @@#else # define CONFIG_CMD_PING # define CONFIG_CMD_DHCP +# define CONFIG_CMD_TFTPPUT #endif #if defined(CONFIG_SYSTEMACE )
Signature · 1 line
1.7.0.4
Michal Simek
AppliedPATCH 4/8 microblaze: Enable TFTP put command
Quoted 10 lines · Stephan Linz
Signed-off-by Stephan Linz <[email protected]>--- include/configs/microblaze-generic.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)include/configs/microblaze-generic.h +0
-0
include/configs/microblaze-generic.h line 265
Quoted 7 lines
include/configs/microblaze-generic.h +1
-0@@ -259,6 +259,7 @@#else # define CONFIG_CMD_PING # define CONFIG_CMD_DHCP +# define CONFIG_CMD_TFTPPUT #endif #if defined(CONFIG_SYSTEMACE )
Applied to master branch.
Michal
Signature · 4 lines
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
PATCH 5/8 microblaze: Xilinx BSP to U-Boot conversion matrix
In reply to Stephan LinzThis matrix converts values from the automaticaly generated header xparameters.h to U-Boot configuration values as needed.
--- board/xilinx/microblaze-generic/xconversions.h | 167 ++++++++++++++++++++++++ include/configs/microblaze-generic.h | 1 + 2 files changed, 168 insertions(+), 0 deletions(-) create mode 100644 board/xilinx/microblaze-generic/xconversions.h
board/xilinx/microblaze-generic/xconversions.h new file +167 -0
@@ -0,0 +1,167 @@ +/* +* This is the Xilinx BSP to U-Boot converstion matrix. You have +* to include this header immediately after xparameters.h in your +* board configuration header. All U-Boot configuration values +* have to become constant to avoid unexpected compilation failure. +* +* (C) Copyright 2012 Li-Pro.Net +* Stephan Linz <[email protected]> +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License as +* published by the Free Software Foundation; either version 2 of +* the License, or (at your option) any later version. +* +* 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. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, +* MA 02111-1307 USA +*/ + +#if (XILINX_LLTEMAC_SDMA_USE_DCR ==1 ) +# define XILINX_LLTEMAC_SDMA_BUSMODE LL_TEMAC_M_SDMA_DCR +#else +# define XILINX_LLTEMAC_SDMA_BUSMODE LL_TEMAC_M_SDMA_PLB +#endif + +/* default parameters for the 1st LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR ) +# define CONFIG_PHY_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC0_NAME NULL +# define CONFIG_XILINX_LL_TEMAC0_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC0_BASE_ADDR XILINX_LLTEMAC_BASEADDR +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR ) +# define CONFIG_XILINX_LL_TEMAC0_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR +# define CONFIG_XILINX_LL_TEMAC0_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR ) +# define CONFIG_XILINX_LL_TEMAC0_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR +# define CONFIG_XILINX_LL_TEMAC0_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC0" +# endif +#endif + +/* default parameters for the 2nd LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR1 ) +# define CONFIG_PHY1_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC1_NAME NULL +# define CONFIG_XILINX_LL_TEMAC1_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC1_BASE_ADDR XILINX_LLTEMAC_BASEADDR1 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR1 ) +# define CONFIG_XILINX_LL_TEMAC1_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR1 +# define CONFIG_XILINX_LL_TEMAC1_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 ) +# define CONFIG_XILINX_LL_TEMAC1_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 +# define CONFIG_XILINX_LL_TEMAC1_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC1" +# endif +#endif + +/* default parameters for the 3rd LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR2 ) +# define CONFIG_PHY2_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC2_NAME NULL +# define CONFIG_XILINX_LL_TEMAC2_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC2_BASE_ADDR XILINX_LLTEMAC_BASEADDR2 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR2 ) +# define CONFIG_XILINX_LL_TEMAC2_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR2 +# define CONFIG_XILINX_LL_TEMAC2_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 ) +# define CONFIG_XILINX_LL_TEMAC2_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 +# define CONFIG_XILINX_LL_TEMAC2_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC2" +# endif +#endif + +/* default parameters for the 4th LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR3 ) +# define CONFIG_PHY3_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC3_NAME NULL +# define CONFIG_XILINX_LL_TEMAC3_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC3_BASE_ADDR XILINX_LLTEMAC_BASEADDR3 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR3 ) +# define CONFIG_XILINX_LL_TEMAC3_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR3 +# define CONFIG_XILINX_LL_TEMAC3_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 ) +# define CONFIG_XILINX_LL_TEMAC3_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 +# define CONFIG_XILINX_LL_TEMAC3_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC3" +# endif +#endif + +/* default parameters for the 5th LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR4 ) +# define CONFIG_PHY4_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC4_NAME NULL +# define CONFIG_XILINX_LL_TEMAC4_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC4_BASE_ADDR XILINX_LLTEMAC_BASEADDR4 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR4 ) +# define CONFIG_XILINX_LL_TEMAC4_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR4 +# define CONFIG_XILINX_LL_TEMAC4_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR4 ) +# define CONFIG_XILINX_LL_TEMAC4_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR4 +# define CONFIG_XILINX_LL_TEMAC4_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC4" +# endif +#endif + +/* default parameters for the 6th LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR5 ) +# define CONFIG_PHY5_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC5_NAME NULL +# define CONFIG_XILINX_LL_TEMAC5_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC5_BASE_ADDR XILINX_LLTEMAC_BASEADDR5 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR5 ) +# define CONFIG_XILINX_LL_TEMAC5_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR5 +# define CONFIG_XILINX_LL_TEMAC5_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR5 ) +# define CONFIG_XILINX_LL_TEMAC5_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR5 +# define CONFIG_XILINX_LL_TEMAC5_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC5" +# endif +#endif + +/* default parameters for the 7th LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR6 ) +# define CONFIG_PHY6_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC6_NAME NULL +# define CONFIG_XILINX_LL_TEMAC6_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC6_BASE_ADDR XILINX_LLTEMAC_BASEADDR6 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR6 ) +# define CONFIG_XILINX_LL_TEMAC6_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR6 +# define CONFIG_XILINX_LL_TEMAC6_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR6 ) +# define CONFIG_XILINX_LL_TEMAC6_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR6 +# define CONFIG_XILINX_LL_TEMAC6_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC6" +# endif +#endif + +/* default parameters for the 8th LLTEMAC */ +#if defined(XILINX_LLTEMAC_BASEADDR7 ) +# define CONFIG_PHY7_ADDR -1 +# define CONFIG_XILINX_LL_TEMAC7_NAME NULL +# define CONFIG_XILINX_LL_TEMAC7_MII_NAME NULL +# define CONFIG_XILINX_LL_TEMAC7_BASE_ADDR XILINX_LLTEMAC_BASEADDR7 +# if defined(XILINX_LLTEMAC_FIFO_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC7_CTRL_ADDR XILINX_LLTEMAC_FIFO_BASEADDR7 +# define CONFIG_XILINX_LL_TEMAC7_CTRL_MODE LL_TEMAC_M_FIFO +# elif defined(XILINX_LLTEMAC_SDMA_CTRL_BASEADDR7 ) +# define CONFIG_XILINX_LL_TEMAC7_CTRL_ADDR XILINX_LLTEMAC_SDMA_CTRL_BASEADDR7 +# define CONFIG_XILINX_LL_TEMAC7_CTRL_MODE XILINX_LLTEMAC_SDMA_BUSMODE +# else +# error "missing sub-controller base address for LLTEMAC7" +# endif +#endif +
include/configs/microblaze-generic.h +1 -0
@@ -26,6 +26,7 @@#define __CONFIG_H#include "../board/xilinx/microblaze-generic/xparameters.h" +#include "../board/xilinx/microblaze-generic/xconversions.h" /* MicroBlaze CPU */ #define CONFIG_MICROBLAZE 1
Signature · 1 line
1.7.0.4
PATCH 6/8 microblaze: Add faked LL_TEMAC driver configuration
In reply to Stephan LinzExpand the specific configuration for the microblaze-generic board in xparameters.h with a faked setup to enable the LL_TEMAC driver.
Note: From now the microblaze-generic board is no longer a valid board configuration for a real piece of hardware. Rather than, we use the file config.mk and xparameters.h as a faked board configuration to force the compilation of all potential driver code for Microblaze systems.
--- board/xilinx/microblaze-generic/config.mk | 6 ++++-- board/xilinx/microblaze-generic/xparameters.h | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-)
board/xilinx/microblaze-generic/config.mk +4 -2
@@ -21,8 +21,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -# CAUTION: This file is automatically generated by libgen. -# Version: Xilinx EDK 6.3 EDK_Gmm.12.3 +# CAUTION: This file is a faked configuration !!! +# There is no real target for the microblaze-generic +# configuration. You have to replace this file with +# the generated file from your Xilinx design flow. # CONFIG_SYS_TEXT_BASE = 0x29000000
board/xilinx/microblaze-generic/xparameters.h +22 -2
@@ -21,8 +21,10 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * -* CAUTION: This file is automatically generated by libgen. -* Version: Xilinx EDK 8.2.02 EDK_Im_Sp2.4 +* CAUTION: This file is a faked configuration !!! +* There is no real target for the microblaze-generic +* configuration. You have to replace this file with +* the generated file from your Xilinx design flow. */ #define XILINX_BOARD_NAME microblaze-generic
@@ -69,3 +71,21 @@/* Ethernet controller is Ethernet_MAC */ #define XILINX_EMACLITE_BASEADDR 0x40C00000 + +/* Ethernet controller is Ethernet_MAC */ +#define XILINX_LLTEMAC_BASEADDR 0x44000000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR 0x42000180 +#define XILINX_LLTEMAC_BASEADDR1 0x44000040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 0x42000200 +#define XILINX_LLTEMAC_BASEADDR2 0x44100000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 0x42000280 +#define XILINX_LLTEMAC_BASEADDR3 0x44100040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 0x42000300 +#define XILINX_LLTEMAC_BASEADDR4 0x44200000 +#define XILINX_LLTEMAC_FIFO_BASEADDR4 0x42100000 +#define XILINX_LLTEMAC_BASEADDR5 0x44200040 +#define XILINX_LLTEMAC_FIFO_BASEADDR5 0x42110000 +#define XILINX_LLTEMAC_BASEADDR6 0x44300000 +#define XILINX_LLTEMAC_FIFO_BASEADDR6 0x42120000 +#define XILINX_LLTEMAC_BASEADDR7 0x44300040 +#define XILINX_LLTEMAC_FIFO_BASEADDR7 0x42130000
Signature · 1 line
1.7.0.4
PATCH 6/8 microblaze: Add faked LL_TEMAC driver configuration
Quoted 55 lines · Stephan Linz
Expand the specific configuration for the microblaze-generic board in
xparameters.hwith a faked setup to enable theLL_TEMACdriver.Note: From now the microblaze-generic board is no longer a valid board configuration for a real piece of hardware. Rather than, we use the file config.mk and
xparameters.has a faked board configuration to force the compilation of all potential driver code for Microblaze systems.Signed-off-by Stephan Linz <[email protected]>--- board/xilinx/microblaze-generic/config.mk | 6 ++++-- board/xilinx/microblaze-generic/xparameters.h | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-)board/xilinx/microblaze-generic/config.mk +4
-2@@ -21,8 +21,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -# CAUTION: This file is automatically generated by libgen. -# Version: Xilinx EDK 6.3 EDK_Gmm.12.3 +# CAUTION: This file is a faked configuration !!! +# There is no real target for the microblaze-generic +# configuration. You have to replace this file with +# the generated file from your Xilinx design flow. # CONFIG_SYS_TEXT_BASE = 0x29000000board/xilinx/microblaze-generic/xparameters.h +5
-2@@ -21,8 +21,10 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * -* CAUTION: This file is automatically generated by libgen. -* Version: Xilinx EDK 8.2.02 EDK_Im_Sp2.4 +* CAUTION: This file is a faked configuration !!! +* There is no real target for the microblaze-generic +* configuration. You have to replace this file with +* the generated file from your Xilinx design flow. */ #define XILINX_BOARD_NAME microblaze-generic@@ -69,3 +71,21 @@/* Ethernet controller is Ethernet_MAC */ #define XILINX_EMACLITE_BASEADDR 0x40C00000 +
board/xilinx/microblaze-generic/xparameters.h line 83
Quoted 10 lines
board/xilinx/microblaze-generic/xparameters.h +9
-0+/* Ethernet controller is Ethernet_MAC */ +#define XILINX_LLTEMAC_BASEADDR 0x44000000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR 0x42000180 +#define XILINX_LLTEMAC_BASEADDR1 0x44000040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 0x42000200 +#define XILINX_LLTEMAC_BASEADDR2 0x44100000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 0x42000280 +#define XILINX_LLTEMAC_BASEADDR3 0x44100040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 0x42000300
Do these two options test anything?
board/xilinx/microblaze-generic/xparameters.h line 91
Quoted 9 lines
board/xilinx/microblaze-generic/xparameters.h +8
-0+#define XILINX_LLTEMAC_BASEADDR4 0x44200000 +#define XILINX_LLTEMAC_FIFO_BASEADDR4 0x42100000 +#define XILINX_LLTEMAC_BASEADDR5 0x44200040 +#define XILINX_LLTEMAC_FIFO_BASEADDR5 0x42110000 +#define XILINX_LLTEMAC_BASEADDR6 0x44300000 +#define XILINX_LLTEMAC_FIFO_BASEADDR6 0x42120000 +#define XILINX_LLTEMAC_BASEADDR7 0x44300040 +#define XILINX_LLTEMAC_FIFO_BASEADDR7 0x42130000
The same here.
Michal
Signature · 4 lines
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
PATCH 6/8 microblaze: Add faked LL_TEMAC driver configuration
Am Dienstag, den 31.01.2012, 10:01 +0100 schrieb Michal Simek:
Quoted 62 lines
Quoted 60 lines · Stephan Linz
Expand the specific configuration for the microblaze-generic board in
xparameters.hwith a faked setup to enable theLL_TEMACdriver.Note: From now the microblaze-generic board is no longer a valid board configuration for a real piece of hardware. Rather than, we use the file config.mk and
xparameters.has a faked board configuration to force the compilation of all potential driver code for Microblaze systems.Signed-off-by Stephan Linz <[email protected]>--- board/xilinx/microblaze-generic/config.mk | 6 ++++-- board/xilinx/microblaze-generic/xparameters.h | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-)board/xilinx/microblaze-generic/config.mk +4
-2@@ -21,8 +21,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -# CAUTION: This file is automatically generated by libgen. -# Version: Xilinx EDK 6.3 EDK_Gmm.12.3 +# CAUTION: This file is a faked configuration !!! +# There is no real target for the microblaze-generic +# configuration. You have to replace this file with +# the generated file from your Xilinx design flow. # CONFIG_SYS_TEXT_BASE = 0x29000000board/xilinx/microblaze-generic/xparameters.h +10
-2@@ -21,8 +21,10 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * -* CAUTION: This file is automatically generated by libgen. -* Version: Xilinx EDK 8.2.02 EDK_Im_Sp2.4 +* CAUTION: This file is a faked configuration !!! +* There is no real target for the microblaze-generic +* configuration. You have to replace this file with +* the generated file from your Xilinx design flow. */ #define XILINX_BOARD_NAME microblaze-generic@@ -69,3 +71,21 @@/* Ethernet controller is Ethernet_MAC */ #define XILINX_EMACLITE_BASEADDR 0x40C00000 + +/* Ethernet controller is Ethernet_MAC */ +#define XILINX_LLTEMAC_BASEADDR 0x44000000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR 0x42000180 +#define XILINX_LLTEMAC_BASEADDR1 0x44000040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 0x42000200
Quoted 6 lines
board/xilinx/microblaze-generic/xparameters.h line 83
Quoted 4 lines
board/xilinx/microblaze-generic/xparameters.h +4
-0+#define XILINX_LLTEMAC_BASEADDR2 0x44100000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 0x42000280 +#define XILINX_LLTEMAC_BASEADDR3 0x44100040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 0x42000300Do these two options test anything?
This is a faked configuration to evaluate the preprocessor stage in xconversions.h and the ll_temac driver setup in xilinx_ll_temac_standard_init().
I do not known any FPGA design / board on which I could test it in real live. But I've run a simple test with BASEADDR1 set to same value of BASEADDR. So I could test faked memory access to a single TEMAC in hardware by two driver instance in software -- it works.
Quoted 6 lines
Quoted 5 lines
board/xilinx/microblaze-generic/xparameters.h +4
-0+#define XILINX_LLTEMAC_BASEADDR4 0x44200000 +#define XILINX_LLTEMAC_FIFO_BASEADDR4 0x42100000 +#define XILINX_LLTEMAC_BASEADDR5 0x44200040 +#define XILINX_LLTEMAC_FIFO_BASEADDR5 0x42110000
Quoted 6 lines
board/xilinx/microblaze-generic/xparameters.h line 91
Quoted 4 lines
board/xilinx/microblaze-generic/xparameters.h +4
-0+#define XILINX_LLTEMAC_BASEADDR6 0x44300000 +#define XILINX_LLTEMAC_FIFO_BASEADDR6 0x42120000 +#define XILINX_LLTEMAC_BASEADDR7 0x44300040 +#define XILINX_LLTEMAC_FIFO_BASEADDR7 0x42130000The same here.
The ll_temac driver supports up to eight TEMAC entities in hardware. That's why I've expand the faked Xilinx parameter list to eight.
br
Stephan
PATCH 6/8 microblaze: Add faked LL_TEMAC driver configuration
In reply to Stephan LinzQuoted 62 lines · Stephan Linz
Expand the specific configuration for the microblaze-generic board in
xparameters.hwith a faked setup to enable theLL_TEMACdriver.Note: From now the microblaze-generic board is no longer a valid board configuration for a real piece of hardware. Rather than, we use the file config.mk and
xparameters.has a faked board configuration to force the compilation of all potential driver code for Microblaze systems.Signed-off-by Stephan Linz <[email protected]>--- board/xilinx/microblaze-generic/config.mk | 6 ++++-- board/xilinx/microblaze-generic/xparameters.h | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-)board/xilinx/microblaze-generic/config.mk +4
-2@@ -21,8 +21,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -# CAUTION: This file is automatically generated by libgen. -# Version: Xilinx EDK 6.3 EDK_Gmm.12.3 +# CAUTION: This file is a faked configuration !!! +# There is no real target for the microblaze-generic +# configuration. You have to replace this file with +# the generated file from your Xilinx design flow. # CONFIG_SYS_TEXT_BASE = 0x29000000board/xilinx/microblaze-generic/xparameters.h +12
-2@@ -21,8 +21,10 @@* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * -* CAUTION: This file is automatically generated by libgen. -* Version: Xilinx EDK 8.2.02 EDK_Im_Sp2.4 +* CAUTION: This file is a faked configuration !!! +* There is no real target for the microblaze-generic +* configuration. You have to replace this file with +* the generated file from your Xilinx design flow. */ #define XILINX_BOARD_NAME microblaze-generic@@ -69,3 +71,21 @@/* Ethernet controller is Ethernet_MAC */ #define XILINX_EMACLITE_BASEADDR 0x40C00000 + +/* Ethernet controller is Ethernet_MAC */ +#define XILINX_LLTEMAC_BASEADDR 0x44000000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR 0x42000180 +#define XILINX_LLTEMAC_BASEADDR1 0x44000040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 0x42000200 +#define XILINX_LLTEMAC_BASEADDR2 0x44100000 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR2 0x42000280
board/xilinx/microblaze-generic/xparameters.h line 91
Quoted 10 lines
board/xilinx/microblaze-generic/xparameters.h +10
-0+#define XILINX_LLTEMAC_BASEADDR3 0x44100040 +#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR3 0x42000300 +#define XILINX_LLTEMAC_BASEADDR4 0x44200000 +#define XILINX_LLTEMAC_FIFO_BASEADDR4 0x42100000 +#define XILINX_LLTEMAC_BASEADDR5 0x44200040 +#define XILINX_LLTEMAC_FIFO_BASEADDR5 0x42110000 +#define XILINX_LLTEMAC_BASEADDR6 0x44300000 +#define XILINX_LLTEMAC_FIFO_BASEADDR6 0x42120000 +#define XILINX_LLTEMAC_BASEADDR7 0x44300040 +#define XILINX_LLTEMAC_FIFO_BASEADDR7 0x42130000
I can't see the reason to test 4 sdma cases and 4 fifo cases for fake system configuration. The same thing will work with one sdma and one fifo.
Michal
Signature · 4 lines
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
PATCH 7/8 microblaze: Wire up LL_TEMAC driver initialization
In reply to Stephan LinzInitialize ll_temac driver.
--- .../xilinx/microblaze-generic/microblaze-generic.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
board/xilinx/microblaze-generic/microblaze-generic.c +5 -0
@@ -90,5 +90,10 @@ int board_eth_init(bd_t *bis) ret |=xilinx_emaclite_initialize (bis,XILINX_EMACLITE_BASEADDR , txpp, rxpp);#endif + +#ifdef CONFIG_XILINX_LL_TEMAC + ret |=xilinx_ll_temac_standard_init (bis); +#endif +return ret; }
Signature · 1 line
1.7.0.4
PATCH 8/8 microblaze: ll_temac: export xilinx_ll_temac_eth_init() for evaluation
In reply to Stephan Linz--- .../xilinx/microblaze-generic/microblaze-generic.c | 57 ++++++++++++++++++++ drivers/net/xilinx_ll_temac.c | 2 +- include/xilinx_ll_temac.h | 3 + 3 files changed, 61 insertions(+), 1 deletions(-)
board/xilinx/microblaze-generic/microblaze-generic.c +57 -0
@@ -31,6 +31,10 @@#include <asm/microblaze_intc.h> #include <asm/asm.h> +#ifdef CONFIG_XILINX_LL_TEMAC +#include <xilinx_ll_temac.h> +#endif +int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {#ifdef CONFIG_SYS_GPIO_0
@@ -92,7 +96,60 @@ int board_eth_init(bd_t *bis)#endif #ifdef CONFIG_XILINX_LL_TEMAC +#if 1 +/* This should be the preferred way to initialize +* all the interfaces. */ ret |=xilinx_ll_temac_standard_init (bis); +#else +/************************************************************ +* NOTE: This part is for evaluation and will help achieve +* the right way to initialize all LL TEMAC ethernet +* interfaces. There can be more than this two i/f! +************************************************************/ +struct ll_temac_info devinf; + +# ifdef XILINX_LLTEMAC_BASEADDR +memset (&devinf,0 ,sizeof (devinf)); + devinf.phyaddr =-1 ; + devinf.base_addr =XILINX_LLTEMAC_BASEADDR ; +# ifdef XILINX_LLTEMAC_FIFO_BASEADDR + devinf.flags =LL_TEMAC_M_FIFO ; + devinf.ctrl_addr =XILINX_LLTEMAC_FIFO_BASEADDR ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR +# if XILINX_LLTEMAC_SDMA_USE_DCR ==1 + devinf.flags =LL_TEMAC_M_SDMA_DCR ; + devinf.ctrl_addr =XILINX_LLTEMAC_SDMA_CTRL_BASEADDR ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# else + devinf.flags =LL_TEMAC_M_SDMA_PLB ; + devinf.ctrl_addr =XILINX_LLTEMAC_SDMA_CTRL_BASEADDR ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# endif +# endif +# endif + +# ifdef XILINX_LLTEMAC_BASEADDR1 +memset (&devinf,0 ,sizeof (devinf)); + devinf.phyaddr =-1 ; + devinf.base_addr =XILINX_LLTEMAC_BASEADDR1 ; +# ifdef XILINX_LLTEMAC_FIFO_BASEADDR1 + devinf.flags =LL_TEMAC_M_FIFO ; + devinf.ctrl_addr =XILINX_LLTEMAC_FIFO_BASEADDR1 ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 +# if XILINX_LLTEMAC_SDMA_USE_DCR ==1 + devinf.flags =LL_TEMAC_M_SDMA_DCR ; + devinf.ctrl_addr =XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# else + devinf.flags =LL_TEMAC_M_SDMA_PLB ; + devinf.ctrl_addr =XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 ; + ret |=xilinx_ll_temac_eth_init (bis, &devinf); +# endif +# endif +# endif +#endif /* if 0 */ #endif return ret;
drivers/net/xilinx_ll_temac.c +1 -1
@@ -352,7 +352,7 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf)* Returns 1 if the ll_temac device and the mdio bus were initialized * otherwise returns 0 */ -static int xilinx_ll_temac_eth_init (bd_t *bis,struct ll_temac_info *devinf) +int xilinx_ll_temac_eth_init (bd_t *bis,struct ll_temac_info *devinf) {struct ll_temac_mdio_info mdioinf;int ret;
include/xilinx_ll_temac.h +3 -0
@@ -355,4 +355,7 @@ struct ll_temac_info {int xilinx_ll_temac_initialize (bd_t *bis,struct ll_temac_info *devinf); +/* FIXME: xilinx_ll_temac_eth_init() must be again private ? */ +int xilinx_ll_temac_eth_init (bd_t *bis,struct ll_temac_info *devinf); +#endif /* _XILINX_LL_TEMAC_ */
Signature · 1 line
1.7.0.4
PATCH 8/8 microblaze: ll_temac: export xilinx_ll_temac_eth_init() for evaluation
Quoted 23 lines · Stephan Linz
Signed-off-by Stephan Linz <[email protected]>--- .../xilinx/microblaze-generic/microblaze-generic.c | 57 ++++++++++++++++++++ drivers/net/xilinx_ll_temac.c | 2 +- include/xilinx_ll_temac.h | 3 + 3 files changed, 61 insertions(+), 1 deletions(-)board/xilinx/microblaze-generic/microblaze-generic.c +4
-0@@ -31,6 +31,10 @@#include <asm/microblaze_intc.h> #include <asm/asm.h> +#ifdef CONFIG_XILINX_LL_TEMAC +#include <xilinx_ll_temac.h> +#endif +int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {#ifdef CONFIG_SYS_GPIO_0
board/xilinx/microblaze-generic/microblaze-generic.c int board_eth_init(bd_t *bis) · line 102
Quoted 7 lines
board/xilinx/microblaze-generic/microblaze-generic.c +3
-0@@ -92,7 +96,60 @@ int board_eth_init(bd_t *bis)#endif #ifdef CONFIG_XILINX_LL_TEMAC +#if 1 +/* This should be the preferred way to initialize +* all the interfaces. */ ret |=xilinx_ll_temac_standard_init (bis);
if 1 is not the best for mainline because it means that below is dead code.
Michal
Signature · 4 lines
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
PATCH 8/8 microblaze: ll_temac: export xilinx_ll_temac_eth_init() for evaluation
Am Donnerstag, den 23.02.2012, 12:56 +0100 schrieb Michal Simek:
Quoted 26 lines
Quoted 25 lines · Stephan Linz
Signed-off-by Stephan Linz <[email protected]>--- .../xilinx/microblaze-generic/microblaze-generic.c | 57 ++++++++++++++++++++ drivers/net/xilinx_ll_temac.c | 2 +- include/xilinx_ll_temac.h | 3 + 3 files changed, 61 insertions(+), 1 deletions(-)board/xilinx/microblaze-generic/microblaze-generic.c +4
-0@@ -31,6 +31,10 @@#include <asm/microblaze_intc.h> #include <asm/asm.h> +#ifdef CONFIG_XILINX_LL_TEMAC +#include <xilinx_ll_temac.h> +#endif +int do_reset (cmd_tbl_t *cmdtp,int flag,int argc,char *const argv[]) {#ifdef CONFIG_SYS_GPIO_0 @@ -92,7 +96,60 @@ int board_eth_init(bd_t *bis)#endif
Quoted 7 lines
board/xilinx/microblaze-generic/microblaze-generic.c int board_eth_init(bd_t *bis) · line 102
Quoted 5 lines
board/xilinx/microblaze-generic/microblaze-generic.c +3
-0#ifdef CONFIG_XILINX_LL_TEMAC +#if 1 +/* This should be the preferred way to initialize +* all the interfaces. */ ret |=xilinx_ll_temac_standard_init (bis);if 1 is not the best for mainline because it means that below is dead code.
:) right -- This snippet was only intended for illustration of the differences
Stephan
Hi Stephan,
Quoted 6 lines · Stephan Linz
Hi Michal,
back to your requests and objections I've built up a new patch set for evaluation. Some of the changes relate to the Microblaze platform rather than the network driver.
Quoted 10 lines
1) U-Boot configuration variables vs.
xparameters.h
----------------------------------------------------------------------
I've tried to find a compromise between the U-Boot coding and configuration style and your preference. But at least in the point of the many many CPP conditional directives I can not reduce the code. I can move the code only to another place. I need a converstion from the automaticaly generated content ofxparameters.hto the U-Boot configuration space. Now you can find this conversion matrix in a new platform header,xconversions.h-- I've placed the header in board/xilinx/microblaze-generic/ I think, we can find a better place.
Sorry I don't like that idea in general. I think that make no sense to create infrastructure for several ll_temac driver in bootloader.
The same code in different location is the same solution which I won't like.
Quoted 14 lines
The conversion matrix avoids all the wrong configuration variables inside U-Boot code beginning with
XILINX_(and notCONFIG_) and we can expand the configuration to new software related options we never get from hardware (example special interface naming). This mechanism can also be used by other driver and platform code, for examplearch/microblaze/cpu/cache.candarch/microblaze/lib/bootm.c(useXILINX_USE_DCACHEinstead of ex.CONFIG_XILINX_DCACHE),common/cmd_mfsl.c(useXILINX_FSL_NUMBERinstead of ex.CONFIG_XILINX_FSL),serial_xuartlite.c(useXILINX_UARTLITE_BASEADDR,XILINX_UARTLITE_BASEADDR1, ...), and probably also inxilinx_emaclite.candxilinx_axi_emac.cwhen we extand a multi-IP support as we have done for the LL TEMAC now. Sure we have to work on, but it's another case (I can make some patches if you want)
I agree that we should use the same variable name if has to start with CONFIG_ prefix.
Based on my experience make more sense to move all functionality and configuration thing to BSP and keep them out of mainline code because none cares in community that we can change almost everything.
That's why u-boot uses xparamters.h, linux dts and 5 kernel parameters.
Creating any conversions out of BSPs is just wrong way and I won't agree with that. If you want to talk about renaming some variables I am ok to do so and I can also change my bsp to cover backward compatibility.
Pretty soon the same situation will be with u-boot for Xilinx Zynq arm platform where we will have to use the same style to be acceptable.
Quoted 5 lines
Another but not currently existing feasibility would be to generate a U-Boot conform
xparameters.h, for exampleCONFIG_XILINX_LL_TEMAC0_BASE_ADDRinstead ofXILINX_LLTEMAC_BASEADDR. You and I, we have it in hand. We can change the Xilinx BSP in the near future. You in PataLinux and I in my own home-brewed BSP generator TPOS.
As I wrote above. Suggest what we should change and we can do that.
Quoted 7 lines
2) Standard initialization vs. multiple direct calls from platform
----------------------------------------------------------------------
Returning to the topic "standard" initialization. The last patch will show the differences bwetween your prefered way to do all in board init and my applicable standard initializition (a single call to the driver). Please look at it in the code and decide for yourself.
IRC. I describe you how I would like to see that configuration. It should be the same as I use for axiemac and emaclite.
Quoted 8 lines
We need a forward-looking decision, what kind of initialization, we want to use. Do we want to copy and paste the standard initialization steps from ip core to ip core (board init) and from platform to platform (Microplace, PPC405, PPC440) or make a simple call to the driver?
My preferences is to call the driver from platform and let him run all the necessary steps, that I do not want knowing on platform side.
You have to know platform all the time.
I want to keep microblaze-generic platform as simple as possible.
If you are not OK with my preferred way you can of course create your new platform with conversion tables as you like.
In PetaLinux we uses separate platform because of configuration things which lie above of it.
Honestly if I look at patch v10 1/8 my eyes hurting me because the origin patch (v3 or so) had ~670 line of code and yours 1943 and do the same things.
From my point of view I am OK to keep this driver completely out of mainline because
it is based on plb which will be deprecated in near future.
I know that people will still use it for a long time but the question is if make sense to push to mainline.
I will definitely use v3 in PetaLinux and keep things simpler.
Future is axi driver is in the mainline.
Regards,
Michal
Signature · 4 lines
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
Am Donnerstag, den 23.02.2012, 13:22 +0100 schrieb Michal Simek:
Quoted 1 line
Hi Stephan,
Hi Michal,
I will take your comments seriously and ar working on a solution without a complex conversion matrix and a ll_temac standard initialization. Give me some time to do so ...
Stephan
Quoted 102 lines
Quoted 6 lines · Stephan Linz
Hi Michal,
back to your requests and objections I've built up a new patch set for evaluation. Some of the changes relate to the Microblaze platform rather than the network driver.
Quoted 10 lines
1) U-Boot configuration variables vs.
xparameters.h
----------------------------------------------------------------------
I've tried to find a compromise between the U-Boot coding and configuration style and your preference. But at least in the point of the many many CPP conditional directives I can not reduce the code. I can move the code only to another place. I need a converstion from the automaticaly generated content ofxparameters.hto the U-Boot configuration space. Now you can find this conversion matrix in a new platform header,xconversions.h-- I've placed the header in board/xilinx/microblaze-generic/ I think, we can find a better place.Sorry I don't like that idea in general. I think that make no sense to create infrastructure for several
ll_temacdriver in bootloader.The same code in different location is the same solution which I won't like.
Quoted 14 lines
The conversion matrix avoids all the wrong configuration variables inside U-Boot code beginning with
XILINX_(and notCONFIG_) and we can expand the configuration to new software related options we never get from hardware (example special interface naming). This mechanism can also be used by other driver and platform code, for examplearch/microblaze/cpu/cache.candarch/microblaze/lib/bootm.c(useXILINX_USE_DCACHEinstead of ex.CONFIG_XILINX_DCACHE),common/cmd_mfsl.c(useXILINX_FSL_NUMBERinstead of ex.CONFIG_XILINX_FSL),serial_xuartlite.c(useXILINX_UARTLITE_BASEADDR,XILINX_UARTLITE_BASEADDR1, ...), and probably also inxilinx_emaclite.candxilinx_axi_emac.cwhen we extand a multi-IP support as we have done for the LL TEMAC now. Sure we have to work on, but it's another case (I can make some patches if you want)I agree that we should use the same variable name if has to start with
CONFIG_prefix.
Based on my experience make more sense to move all functionality and configuration thing to BSP and keep them out of mainline code because none cares in community that we can change almost everything.
That's why u-boot usesxparamters.h, linux dts and 5 kernel parameters.Creating any conversions out of BSPs is just wrong way and I won't agree with that. If you want to talk about renaming some variables I am ok to do so and I can also change my bsp to cover backward compatibility.
Pretty soon the same situation will be with u-boot for Xilinx Zynq arm platform where we will have to use the same style to be acceptable.
Quoted 5 lines
Another but not currently existing feasibility would be to generate a U-Boot conform
xparameters.h, for exampleCONFIG_XILINX_LL_TEMAC0_BASE_ADDRinstead ofXILINX_LLTEMAC_BASEADDR. You and I, we have it in hand. We can change the Xilinx BSP in the near future. You in PataLinux and I in my own home-brewed BSP generator TPOS.As I wrote above. Suggest what we should change and we can do that.
Quoted 7 lines
2) Standard initialization vs. multiple direct calls from platform
----------------------------------------------------------------------
Returning to the topic "standard" initialization. The last patch will show the differences bwetween your prefered way to do all in board init and my applicable standard initializition (a single call to the driver). Please look at it in the code and decide for yourself.IRC. I describe you how I would like to see that configuration. It should be the same as I use for axiemac and emaclite.
Quoted 8 lines
We need a forward-looking decision, what kind of initialization, we want to use. Do we want to copy and paste the standard initialization steps from ip core to ip core (board init) and from platform to platform (Microplace, PPC405, PPC440) or make a simple call to the driver?
My preferences is to call the driver from platform and let him run all the necessary steps, that I do not want knowing on platform side.
You have to know platform all the time.
I want to keep microblaze-generic platform as simple as possible.If you are not OK with my preferred way you can of course create your new platform with conversion tables as you like.
In PetaLinux we uses separate platform because of configuration things which lie above of it.Honestly if I look at patch v10 1/8 my eyes hurting me because the origin patch (v3 or so) had ~670 line of code and yours 1943 and do the same things.
From my point of view I am OK to keep this driver completely out of mainline because
it is based on plb which will be deprecated in near future.
I know that people will still use it for a long time but the question is if make sense to push to mainline.
I will definitely use v3 in PetaLinux and keep things simpler.
Future is axi driver is in the mainline.Regards,
Michal
Signature · 8 lines
Viele Gr??e, 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