U-Boot Firetux board support
Subsystems (4)
PATCH 1/1 U-Boot Firetux board support
Hi U-Boot mailling list,
This patchset adds a new ARM board with the NXP PNX8181 cpu to u-boot. The PNX8181 is an ARM926ej with an internal DSP and a baseband processor (used for DECT). The chip also features dual ethernet, digital to analog interface, spi, i2c and other SOC peripherals.
The patch is against u-boot commit 055b12f2ffd7c34eea7e983a0588b24f2e69e0e3 (Date: Sun Oct 19 21:54:30 2008 +0200) but should apply to newer commits as well, because the code is mostly seperated.
If you have any comments please email to me.
Is is possible to include that patch in the new version of u-boot?
Regards
J?rgen Sch?w
--
Dipl.-Ing. J?rgen Sch?w, emlix GmbH, http://www.emlix.com, mailto:js at emlix.com Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G?ttingen, Germany Gesch?ftsf?hrung: Dr. Uwe Kracke, Dr. Cord Seele, Ust-IdNr.: DE 205 198 055 Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160
emlix - your embedded linux partner
-----
Diffstat:
MAKEALL | 1 + Makefile | 7 + board/firetux/Makefile | 62 +++ board/firetux/config.mk | 45 ++ board/firetux/ethernet.c | 970 +++++++++++++++++++++++++++++++++++++++++ board/firetux/ethernet.h | 234 ++++++++++ board/firetux/firetux.c | 554 +++++++++++++++++++++++ board/firetux/firetux.h | 118 +++++ board/firetux/lowlevel_init.S | 413 ++++++++++++++++++ board/firetux/memsetup.S | 366 ++++++++++++++++ board/firetux/nand.c | 74 ++++ board/firetux/relocate.S | 246 +++++++++++ board/firetux/u-boot.lds | 57 +++ drivers/i2c/Makefile | 1 + drivers/i2c/pnx8181_i2c.c | 302 +++++++++++++ include/configs/firetux.h | 455 +++++++++++++++++++ net/bootp.c | 11 + net/eth.c | 7 + 18 files changed, 3923 insertions(+), 0 deletions(-)
MAKEALL +1 -0
@@ -480,6 +480,7 @@ LIST_ARM9=" \ cp926ejs \ cp946es \ cp966 \ + firetux \ lpd7a400 \ mx1ads \ mx1fs2 \
Makefile +7 -0
@@ -2683,6 +2683,13 @@ voiceblue_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm925t voiceblue ######################################################################### +## NXP PNX8181 "firetux" +######################################################################### + +firetux_config:unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs firetux # manufacturer SOC + +######################################################################### ## S3C44B0 Systems #########################################################################
board/firetux/Makefile new file +62 -0
62 lines not on this page · raw message
board/firetux/config.mk new file +45 -0
45 lines not on this page · raw message
board/firetux/ethernet.c new file +970 -0
970 lines not on this page · raw message
board/firetux/ethernet.h new file +234 -0
234 lines not on this page · raw message
board/firetux/firetux.c new file +558 -0
558 lines not on this page · raw message
board/firetux/firetux.h new file +118 -0
118 lines not on this page · raw message
board/firetux/lowlevel_init.S new file +412 -0
412 lines not on this page · raw message
board/firetux/memsetup.S new file +366 -0
366 lines not on this page · raw message
board/firetux/nand.c new file +74 -0
74 lines not on this page · raw message
board/firetux/relocate.S new file +246 -0
141 lines not on this page · raw message
board/firetux/u-boot.lds new file +57 -0
57 lines not on this page · raw message
drivers/i2c/pnx8181_i2c.c new file +302 -0
302 lines not on this page · raw message
include/configs/firetux.h new file +457 -0
457 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.denx.de/pipermail/u-boot/attachments/20081031/e5ea7138/attachment-0001.pgp
Part of the diff is not shown here. View the raw message.
PATCH 1/1 U-Boot Firetux board support
Quoted 11 lines · Juergen Schoew
board/firetux/firetux.c new file +11
-0+#ifdef CONFIG_CMD_NAND +void firetux_nandflash_init (void ) +{ +/* Hardware configuration */ +/* setup GPIOB18 / FMP40 to GPIO input with internal pullup */ +/* clear bits */ + *(vu_long *)(PNX8181_SCON_BASE +PNX8181_SYSMUX3 ) &= ~(0x30 ); +/* set FPM40 to GPIOb18 */ + *(vu_long *)(PNX8181_SCON_BASE +PNX8181_SYSMUX3 ) |=0x10 ; +/* set to input */ + *(vu_long *)PNX8181_GPIOB_DIRECTION &= ~(1 <<18 );
board/firetux/firetux.c line 190
Quoted 10 lines
board/firetux/firetux.c new file +10
-0+/* set pull up */ + *(vu_long *)(PNX8181_SCON_BASE +PNX8181_SYSPAD2 ) &= ~(3 <<20 ); + +/* setup access timing for CS0 */ +/* 16bit */ + *(vu_long *)(PNX8181_REG_EBI1_CS0 +PNX8181_EBI_MAIN_OFF ) =0x0001 ; + *(vu_long *)(PNX8181_REG_EBI1_CS0 +PNX8181_EBI_READ_OFF ) =0x1FFFF ; + *(vu_long *)(PNX8181_REG_EBI1_CS0 +PNX8181_EBI_WRITE_OFF ) =0x1FFFF ; + *(vu_long *)(PNX8181_REG_EBI1_CS0 +PNX8181_EBI_BURST_OFF ) =0x0CF8 ; +}
writel() rather than direct access.
Quoted 9 lines
board/firetux/nand.c new file +9
-0+static void firetux_nand_hwcontrol (struct mtd_info *mtd,int dat, +unsigned int ctrl) +{ +struct nand_chip *chip = mtd->priv; +unsigned long IO_ADDR_W = (ulong )chip->IO_ADDR_W; + +if (ctrl &NAND_CLE ) +IO_ADDR_W +=CONFIG_SYS_NAND_CLE_ADDR ; +
board/firetux/nand.c line 53
Quoted 10 lines
board/firetux/nand.c new file +10
-0+if (ctrl &NAND_ALE ) +IO_ADDR_W +=CONFIG_SYS_NAND_ALE_ADDR ; + +if (dat !=NAND_CMD_NONE ) { +if (chip->options &NAND_BUSWIDTH_16 ) +writew ((unsigned short )dat,IO_ADDR_W ); +else +writeb ((unsigned char )dat,IO_ADDR_W ); + } +}
writew/writeb take pointers, not integer addresses.
board/firetux/nand.c line 59
Quoted 4 lines
board/firetux/nand.c new file +4
-0+static int firetux_nand_readybusy (struct mtd_info *mtd) +{ +return (int )((readl (CONFIG_SYS_NAND_RB_PORT ) >>18 ) &1 ); +}
Unnecessary cast. Pass a pointer to readl().
board/firetux/nand.c line 69
Quoted 8 lines
board/firetux/nand.c new file +8
-0+int board_nand_init (struct nand_chip *nand) +{ + nand->cmd_ctrl = firetux_nand_hwcontrol; + nand->dev_ready = firetux_nand_readybusy; + nand->chip_delay =20 ; + nand->ecc.mode =NAND_ECC_SOFT ; + nand->options =NAND_USE_FLASH_BBT |NAND_BBT_CREATE |NAND_BBT_WRITE + |NAND_BBT_VERSION ;
You cannot pass BBT options as chip options. Of the above, only NAND_USE_FLASH_BBT is a chip option.
Is there any reason you don't use nand_spl?
-Scott
PATCH 1/1 U-Boot Firetux board support
Hi,
I'm impressed you have been very fast with the comments. I've seen the comments from Peter Tyson and Jean-Christophe PLAGNIOL-VILLARD as well and it seem I have a lot to change.
Quoted 5 lines · Scott Wood
Quoted 2 lines · Juergen Schoew
(quoted diff) +1
-0+ *(vu_long *)(PNX8181_REG_EBI1_CS0 + PNX8181_EBI_BURST_OFF) =
0x0CF8; +}
writel()rather than direct access.
OK, good comment, will rework.
Quoted 7 lines
board/firetux/nand.c line 51
Quoted 5 lines
board/firetux/nand.c new file +5
-0+unsigned long IO_ADDR_W = (ulong )chip->IO_ADDR_W; +if (chip->options &NAND_BUSWIDTH_16 ) +writew ((unsigned short )dat,IO_ADDR_W ); +else +writeb ((unsigned char )dat,IO_ADDR_W );writew/writeb take pointers, not integer addresses.
Will change.
Quoted 6 lines
board/firetux/nand.c line 59
Quoted 4 lines
board/firetux/nand.c new file +4
-0+static int firetux_nand_readybusy (struct mtd_info *mtd) +{ +return (int )((readl (CONFIG_SYS_NAND_RB_PORT ) >>18 ) &1 ); +}Unnecessary cast. Pass a pointer to
readl().
OK.
Quoted 4 lines
Quoted 4 lines
board/firetux/nand.c new file +4
-0+int board_nand_init (struct nand_chip *nand) +{ + nand->cmd_ctrl = firetux_nand_hwcontrol; + nand->dev_ready = firetux_nand_readybusy;
Quoted 8 lines
board/firetux/nand.c line 69
Quoted 5 lines
board/firetux/nand.c new file +3
-0+ nand->chip_delay =20 ; + nand->ecc.mode =NAND_ECC_SOFT ; + nand->options = NAND_USE_FLASH_BBT | NAND_BBT_CREATE |
NAND_BBT_WRITEboard/firetux/nand.c new file +1
-0+ | NAND_BBT_VERSION ;You cannot pass BBT options as chip options. Of the above, only
NAND_USE_FLASH_BBTis a chip option.
You are right. I missed that. I have a 256MByte NAND flash on the board and tried to reduce the boot time. It seem I have mixed something here.
Quoted 1 line
Is there any reason you don't use
nand_spl?
Hmm, I'm not sure to understand you correct. nand_spl is a new method to bootstrap the system. From doc/README.nand-boot-ppc440:
b) SPL (Secondary Program Loader)
---------------------------------
Will load special U-Boot version (NUB) from NAND and execute it. This SPL has to fit into 4kByte. It sets up the CPU and configures the SDRAM controller and the NAND controller so that the special U-Boot image can be loaded from NAND to SDRAM.
This special image is build in the directory "nand_spl".
This seems to be similair to the Steppingstone bootloader from Samsung. This SPL is already in the eeprom of the system and will be (hopefully) integrated in the cpu rom mask for the next revision.
If I see it correct, I have to define the whole parameterset for the NAND chip in the configfile rather than let the mtd layer detect it. So I do not see any reason to use SPL. But maybe you can point me to the right direction.
Regards
J?rgen Sch?w
Signature · 13 lines
Dipl.-Ing. J?rgen Sch?w, emlix GmbH, http://www.emlix.com, mailto:js at emlix.com Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G?ttingen, Germany Gesch?ftsf?hrung: Dr. Uwe Kracke, Dr. Cord Seele, Ust-IdNr.: DE 205 198 055 Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160 emlix - your embedded linux partner -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20081103/ccf78d08/attachment.pgp
PATCH 1/1 U-Boot Firetux board support
Quoted 7 lines · J?rgen Sch?w
This seems to be similair to the Steppingstone bootloader from Samsung. This SPL is already in the eeprom of the system and will be (hopefully) integrated in the cpu rom mask for the next revision.
If I see it correct, I have to define the whole parameterset for the NAND chip in the configfile rather than let the mtd layer detect it. So I do not see any reason to use SPL. But maybe you can point me to the right direction.
OK, a loader in ROM seems like a valid reason to not use nand_spl. :-)
-Scott
PATCH 1/1 U-Boot Firetux board support
In reply to Juergen SchoewHi J?rgen,
Quoted 1 line
If you have any comments please email to me.
You should add an entry to the MAINTAINERS file for the Firetux.
Best,
Peter
PATCH 1/1 U-Boot Firetux board support
Hi Peter,
Quoted 5 lines · Peter Tyser
Hi J?rgen,
Quoted 1 line
If you have any comments please email to me.
You should add an entry to the
MAINTAINERSfile for the Firetux.
OK, will be in the next cycle.
Regards
J?rgen Sch?w
Signature · 13 lines
Dipl.-Ing. J?rgen Sch?w, emlix GmbH, http://www.emlix.com, mailto:js at emlix.com Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G?ttingen, Germany Gesch?ftsf?hrung: Dr. Uwe Kracke, Dr. Cord Seele, Ust-IdNr.: DE 205 198 055 Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160 emlix - your embedded linux partner -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20081103/621a2263/attachment.pgp
PATCH 1/1 U-Boot Firetux board support
In reply to Juergen SchoewQuoted 7 lines · Juergen Schoew
Hi U-Boot mailling list,
This patchset adds a new ARM board with the NXP PNX8181 cpu to u-boot. The PNX8181 is an ARM926ej with an internal DSP and a baseband processor (used for DECT). The chip also features dual ethernet, digital to analog interface, spi, i2c and other SOC peripherals.
PATCH 1/1 U-Boot Firetux board support
Hi,
thanks all for the comments. I will try to fix these.
Quoted 34 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines · Juergen Schoew
Hi U-Boot mailling list,
This patchset adds a new ARM board with the NXP PNX8181 cpu to u-boot. The PNX8181 is an ARM926ej with an internal DSP and a baseband processor (used for DECT). The chip also features dual ethernet, digital to analog interface, spi, i2c and other SOC peripherals.
From here
Quoted 13 lines
The patch is against u-boot commit
055b12f2ffd7c34eea7e983a0588b24f2e69e0e3(Date: Sun Oct 19 21:54:30 2008 +0200) but should apply to newer commits as well, because the code is mostly seperated.If you have any comments please email to me.
Is is possible to include that patch in the new version of u-boot?
Regards
J?rgen Sch?w
Quoted 8 lines
--
Dipl.-Ing. J?rgen Sch?w, emlix GmbH, http://www.emlix.com,
mailto:js at emlix.com Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G?ttingen, Germany Gesch?ftsf?hrung: Dr. Uwe Kracke, Dr. Cord Seele, Ust-IdNr.: DE 205 198 055 Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160emlix - your embedded linux partner
to here is supposed to be after ---
Quoted 2 lines
-----
Quoted 7 lines
Quoted 6 lines
Signed-off-by J?rgen Sch?w <[email protected]>Signed-off-by Sebastian Hess <[email protected]>Signed-off-by Matthias Mwenzel <[email protected]>Signed-off-by Dirk H?rner <[email protected]>Signed-off-by Andreas Wei?el <[email protected]>and sob before
OK. I hope to remember when posting the next cycle.
Quoted 2 lines
first a question
who build this board?
These boards have been build by NXP Semiconductors GmbH, Nuremberg, Germany and are now build by DSPG Technologies GmbH, Nuremberg, Germany.
Quoted 12 lines
Quoted 11 lines
+++ b/Makefile
Makefile +5
-0@@ -2683,6 +2683,13 @@ voiceblue_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm925t voiceblue ######################################################################### +## NXP PNX8181 "firetux" +######################################################################### + +firetux_config:unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs firetux # manufacturerSOC
^^^^^^^^^^^^^^^^^^
Quoted 1 line
please remove
OK
Quoted 6 lines
board/firetux/Makefile line 38
Quoted 5 lines
+++ b/board/firetux/Makefile
board/firetux/Makefile new file +4
-0+ +#ifdef CONFIG_CMD_NAND +COBJS += nand.o +#endifplease use COBJS-$(CONFIG_CMD_NAND)
Correct.
Quoted 8 lines
board/firetux/config.mk line 38
Quoted 7 lines
+++
b/board/firetux/config.mkboard/firetux/config.mk new file +6
-0+ +# SDRAM +TEXT_BASE = 0x20780000 +# mobile pSRAM +#TEXT_BASE = 0x90700000 +could you use a condition
Yes will change.
Quoted 9 lines
board/firetux/ethernet.c
Quoted 8 lines
board/firetux/config.mk new file +7
-0+PLATFORM_CPPFLAGS += -fPIC -fPIE -fno-jump-tables # -msingle-pic-base + +ifneq ($(OBJTREE),$(SRCTREE)) +# We are building u-boot in a separate directory, use generated +# .lds script from OBJTREE directory. +LDSCRIPT := $(OBJTREE)/board/$(BOARDDIR)/u-boot.lds +endifboard/firetux/ethernet.c +0
-0please move to
drivers/net/
I'm not sure how many SOC will use this IP-Core for ethernet. I think it will not be too much, but I can move it to drivers/net/.
Should I remove all board specific routines and leave them in the board/firetux/ directory? (Just to make this driver hardware not depending on a special board?) What do you suggest?
Quoted 8 lines
board/firetux/ethernet.c line 38
Quoted 7 lines
new file mode 100644
index 0000000..866d578board/firetux/ethernet.c new file +3
-0+ +extern unsigned int boardrevision; +uint16_t ETN1_MADR_PHY_ADDR ,ETN2_MADR_PHY_ADDR ;please do not use uppercase for var name
Will rework.
Quoted 7 lines
board/firetux/ethernet.c line 45
Quoted 6 lines
board/firetux/ethernet.c new file +6
-0+int firetux_miiphy_initialize (bd_t *bis); +int mii_discover_phy (void ); +int mii_negotiate_phy (void ); + +#define ALIGN8 static __attribute__ ((aligned(8))) +#define ALIGN4 static __attribute__ ((aligned(4)))why static? it should be strange to assume it's static when we read the code
Because these structures are private to the driver.
Quoted 1 line
please use tab instead of space
Opps, I thought that I found all.
Quoted 10 lines
Quoted 10 lines
board/firetux/ethernet.c new file +10
-0+/* which interface to be currently work on */ +/* default can be set by environment variable ethact */ +static int firetux_eth =0 ; + +/* in the code we use the following descriptors which are either */ +/* set to the etn1 or the etn2 descriptors, depending on ethact */ +ALIGN8 rx_descriptor_t *etn_rxdescriptor = etn1_rxdescriptor; +ALIGN8 rx_status_t *etn_rxstatus = etn1_rxstatus; +ALIGN8 tx_descriptor_t *etn_txdescriptor = etn1_txdescriptor; +ALIGN8 tx_status_t *etn_txstatus = etn1_txstatus;
Quoted 8 lines
board/firetux/ethernet.c line 85
Quoted 4 lines
board/firetux/ethernet.c new file +4
-0+ +/* also the base address is switched for etn1 and etn2, */ +/* except for the MII registers etn1_m* which are only available */ +/* on etn1 */ please use this style of comment
/*
*
*/
Will change.
Quoted 7 lines
board/firetux/ethernet.c line 89
Quoted 4 lines
board/firetux/ethernet.c new file +4
-0+uint32_t etn_base =ETN1 ; +/* we first try Vega Platform III-a settings */ +uint16_t firetux_phy_addr =0x0100 ; +is it not better to do all of this init in an init function?
and why not use a struct to save all parameter?
Good point.
Quoted 10 lines
board/firetux/ethernet.c line 98
Quoted 9 lines
board/firetux/ethernet.c new file +9
-0+ +static void firetux_set_ethact (int act,int hardwarerevision) +{ +switch (hardwarerevision) { +/* EZ_MCP, Vega_pnx8181_basestation Platform III-a */ +case 1 : +case 2 : +ETN1_MADR_PHY_ADDR =0x00000100 ; +ETN2_MADR_PHY_ADDR =0x00000200 ;please use macro instead
OK.
Quoted 20 lines
Quoted 20 lines
board/firetux/ethernet.c new file +20
-0+ETN1_MADR_PHY_ADDR =0x00001E00 ; +ETN2_MADR_PHY_ADDR =0x00001D00 ; +break ; + } +if (act) { + etn_rxdescriptor = etn2_rxdescriptor; + etn_rxstatus = etn2_rxstatus; + etn_txdescriptor = etn2_txdescriptor; + etn_txstatus = etn2_txstatus; + etn_base =ETN2 ; + firetux_phy_addr = (uint16_t )ETN2_MADR_PHY_ADDR ; + }else { + etn_rxdescriptor = etn1_rxdescriptor; + etn_rxstatus = etn1_rxstatus; + etn_txdescriptor = etn1_txdescriptor; + etn_txstatus = etn1_txstatus; + etn_base =ETN1 ; + firetux_phy_addr = (uint16_t )ETN1_MADR_PHY_ADDR ; + } +}
Quoted 8 lines
board/firetux/ethernet.c line 130
Quoted 7 lines
board/firetux/ethernet.c new file +7
-0+ +static void firetux_reset_phy (int hardwareversion) +{ +switch (hardwareversion) { +case 1 : +case 2 : +case 3 :please use readx and writex
OK.
Quoted 14 lines
it will be better to create a gpiolib support
board/firetux/ethernet.c
Quoted 12 lines
board/firetux/ethernet.c new file +3
-0+/* set GPIOa12 direction to output */ + *(vu_long *)(PNX8181_GPIOA_DR) = (((*(vu_long *) + (PNX8181_GPIOA_DR)) & 0xffffefff) |
0x00001000);board/firetux/ethernet.c new file +6
-0+/* ETH_RESET_N */ + *(vu_long *)(PNX8181_GPIOA_OR ) = ((*(vu_long *) + (PNX8181_GPIOA_OR )) &0xffffefff ); +udelay (256000 ); + *(vu_long *)(PNX8181_GPIOA_OR) = (((*(vu_long *) + (PNX8181_GPIOA_OR)) & 0xffffefff) |
0x00001000);board/firetux/ethernet.c new file +1
-0+udelay (100000 );why 100ms of delay?
You are correct. It must be at least 100us. But we had at the beginning much trouble with the phy and a long external reset had helped a lot to make this thing stable.
Quoted 6 lines
board/firetux/ethernet.c
Quoted 5 lines
board/firetux/ethernet.c new file +3
-0+/* ETH_RESET_N */ + *(vu_long *) (PNX8181_GPIOA_OR) = ((*(vu_long *) + (PNX8181_GPIOA_OR)) &
0xfffffff7);board/firetux/ethernet.c new file +1
-0+udelay (256000 );why 256ms of delay?
Same as above. Will lower it.
Quoted 5 lines
board/firetux/ethernet.c
Quoted 4 lines
board/firetux/ethernet.c new file +2
-0+ *(vu_long *) (PNX8181_GPIOA_OR) = (((*(vu_long *) + (PNX8181_GPIOA_OR)) & 0xfffffff7) |
0x00000008);board/firetux/ethernet.c new file +1
-0+udelay (100000 );why 100ms of delay?
Same as above. Will lower it.
Quoted 2 lines
board/firetux/ethernet.c line 175
Quoted 1 line
board/firetux/ethernet.c new file +1
-0+ *(vu_long *)CGU_PER2CON = (15 <<9 ) | (62 <<3 ) |3 ;please ad space between "<<"
Will fix.
Quoted 15 lines
Quoted 15 lines
board/firetux/ethernet.c new file +3
-0+static int firetux_eth_init_rxdescriptor (void ) +{ + *(vu_long *) (etn_base +ETN_RXDESCRIPTOR ) = (vu_long)
etn_rxdescriptor;board/firetux/ethernet.c new file +1
-0+ *(vu_long *) (etn_base +ETN_RXSTATUS ) = (vu_long)
etn_rxstatus;board/firetux/ethernet.c new file +4
-1+ *(vu_long *) (etn_base +ETN_RXCONSUMEINDEX ) =0x00000000 ; + *(vu_long *) (etn_base +ETN_RXDESCRIPTORNUMBER ) = +ETN_RX_DESCRIPTOR_NUMBER - 1; + +/* allocate rx-buffers, but only once, we're called multiple times! */
board/firetux/ethernet.c new file +3
-0+static void *rxbuf =0 ; +if (!rxbuf) + rxbuf = malloc(MAX_ETH_FRAME_SIZE *
Quoted 8 lines
board/firetux/ethernet.c line 205
Quoted 7 lines
ETN_RX_DESCRIPTOR_NUMBER);board/firetux/ethernet.c new file +6
-0+if (!rxbuf) { +puts ("ERROR: couldn't allocate rx buffers!\n" ); +return -1 ; + } + +int i;please declare var at begining
OK.
Quoted 2 lines
Quoted 1 line
+static void
PHY_write(uint16_t a, uint16_t d)please no uppercase in function name
OK.
Quoted 7 lines
Quoted 6 lines
board/firetux/ethernet.c new file +2
-0+#ifdef ET_DEBUG + printf("### PHY_write(%2.d, 0x%4.4x) success after %dcycles "
board/firetux/ethernet.c new file +2
-0+ "[eth=%d, phy_addr=%x]\n", a, d, i, firetux_eth, +
firetux_phy_addr);please use
debug()
OK.
Quoted 8 lines
Quoted 8 lines
board/firetux/ethernet.c new file +8
-0+static uint16_t PHY_read (uint16_t a) +{ +uint32_t status; +int i =0 ; + + a &=0x001f ;/* 5 bit PHY register address */ + *(vu_long *) (ETN1 +ETN_MADR ) = firetux_phy_addr | a; + *(vu_long *) (ETN1 +ETN_MCMD ) =0x00000001 ;
Quoted 8 lines
board/firetux/ethernet.c line 273
Quoted 7 lines
board/firetux/ethernet.c new file +7
-0+ +/* poll for done */ +while ((status = ((*(vu_long *) + (ETN1 +ETN_MIND ))) &0x7 ) && i <1000000 ) + i++; + +uint16_t d = *(vu_long *) (ETN1 +ETN_MRDD );please declare var at the beggening
OK.
Quoted 1 line
Their is too much fix to do to.
Puh. Well, that is absolutely coorect.
Quoted 1 line
Please fix first.
OK.
Signature · 13 lines
Dipl.-Ing. J?rgen Sch?w, emlix GmbH, http://www.emlix.com, mailto:js at emlix.com Fon +49 551 30664-0, Fax -11, Bahnhofsallee 1b, 37081 G?ttingen, Germany Gesch?ftsf?hrung: Dr. Uwe Kracke, Dr. Cord Seele, Ust-IdNr.: DE 205 198 055 Sitz der Gesellschaft: G?ttingen, Amtsgericht G?ttingen HR B 3160 emlix - your embedded linux partner -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: not available Url : http://lists.denx.de/pipermail/u-boot/attachments/20081103/b32960e2/attachment-0001.pgp