Ethernet doesn't work in u-boot

Forum about Parallella boot process, linux kernel, distros, SD-cards, etc.

Ethernet doesn't work in u-boot

Postby wheelmanstudio » Tue Feb 24, 2015 1:31 pm

I have a problem with u-boot compilation for parallella. I've just downloaded your repo and haven't edited parallella.h config yet. I've compiled it using the following commands:
Code: Select all
mkdir ~/git;
cd ~/git;
git init;
git clone https://github.com/parallella/parallella-uboot.git;
cd parallella-uboot;
sudo apt-get install gcc-arm-none-eabi
cd ~/git/parallella-uboot
export ARCH=arm
export CROSS_COMPILE=arm-none-eabi-
make parallella_config
make -j 3


And i've got the following error:
Code: Select all
drivers/net/phy/libphy.o: In function `miiphy_reset':
/home/vlad/git/parallella-uboot/drivers/net/phy/phy.c:677: multiple definition of `miiphy_reset'
common/libcommon.o:/home/vlad/git/parallella-uboot/common/miiphyutil.c:406: first defined here


When I add
Code: Select all
#define CONFIG_PHYLIB
to parallella.h the problem disappears and i can see u-boot binary file in parallella-uboot.

When i try to load u-boot via JTAG:
Code: Select all
U-Boot 2012.10-00003-g792c31c-dirty (Feb 24 2015 - 19:09:23)

I2C:   ready
DRAM:  992 MiB
WARNING: Caches not enabled
MMC:   SDHCI: 0
SF: Detected N25Q128 with page size 64 KiB, total 16 MiB
In:    serial
Out:   serial
Err:   serial
Net:   zynq_gem
Hit any key to stop autoboot:  0
Trying to set up GEM link...
Phy ID: 01410E90
Resetting PHY...

PHY reset complete.
Waiting for PHY to complete auto-negotiation...
Link is now at 1000Mbps!
Using zynq_gem device
TFTP from server 10.10.10.1; our IP address is 10.10.10.159
Filename 'parallella/044f8b000000/bootscript'.
Load address: 0x10000
Loading: data abort
pc : [<3df9d554>]      lr : [<3df8d76c>]
sp : 3db53bd0  ip : 00000fff    fp : 3db54a10
r10: 3db54a80  r9 : 00000002    r8 : 3db53f68
r7 : 00000fff  r6 : 3dfec83c    r5 : 3dfb8a19  r4 : 000005e9
r3 : 0000ffff  r2 : 00000fff    r1 : 0000005e  r0 : 00000fff
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


The same picture is after ping command:
Code: Select all
zynq-uboot> ping 10.10.10.1
Using zynq_gem device
data abort
pc : [<3df9d554>]      lr : [<3df8d76c>]
sp : 3db53de8  ip : 00000fff    fp : 3db550b8
r10: 3db550e8  r9 : 00000003    r8 : 3db53f68
r7 : 00000fff  r6 : 3dfec83c    r5 : 3dfb8a19  r4 : 000005e9
r3 : 0000ffff  r2 : 00000fff    r1 : 0000003c  r0 : 00000fff
Flags: Nzcv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

resetting ...


Precompiled u-boot from https://github.com/parallella/parallell ... I/firmware works well, but it doesn't have DHCP feature.

What can i do to make my parallella work properly? I need to include DHCP feature in u-boot. That's why i decided to compile u-boot.
wheelmanstudio
 
Posts: 3
Joined: Mon Feb 23, 2015 9:09 am

Re: Ethernet doesn't work in u-boot

Postby wheelmanstudio » Thu Mar 05, 2015 5:10 pm

Can someone help me with it ?
wheelmanstudio
 
Posts: 3
Joined: Mon Feb 23, 2015 9:09 am

Re: Ethernet doesn't work in u-boot

Postby aolofsson » Wed Apr 08, 2015 12:18 pm

Sorry for the slow reply. I have filed an issue here pointing to your post. We are about to update the u-boot repo.

https://github.com/parallella/parallella-uboot/issues/3
User avatar
aolofsson
 
Posts: 1005
Joined: Tue Dec 11, 2012 6:59 pm
Location: Lexington, Massachusetts,USA

Re: Ethernet doesn't work in u-boot

Postby wheelmanstudio » Mon May 11, 2015 12:06 pm

Thank you!

---------------------------------
Vladislav Blagodatskikh
wheelmanstudio
 
Posts: 3
Joined: Mon Feb 23, 2015 9:09 am

Re: Ethernet doesn't work in u-boot

Postby Robert » Tue Jan 19, 2016 7:26 am

Hi,

just came across this after (hopefully) having fixed it myself: tftpboot was not working for me with similar behavior (data abort). Reason was that the "data_buffer" defined in zynq_gem_wrap.c was put at an unaligned address by the compiler. Since there were no precautions in the source code to ensure alignment, this may or may not happen, depending on the compiler being used. Here is my diff:

diff --git a/drivers/net/zynq_gem_wrap.c b/drivers/net/zynq_gem_wrap.c
index 177e74a..429ddca 100644
--- a/drivers/net/zynq_gem_wrap.c
+++ b/drivers/net/zynq_gem_wrap.c
@@ -52,13 +52,13 @@ static void Xgmac_set_eth_advertise(XEmacPss *EmacPssInstancePtr,
#ifdef BRAM_BUFFERS
static XEmacPss_Bd RxBdSpace[RXBD_CNT] __attribute__ ((section (".bram_buffers")));
static XEmacPss_Bd TxBdSpace[TXBD_CNT] __attribute__ ((section (".bram_buffers")));
-static char RxBuffers[RXBD_CNT * XEMACPSS_RX_BUF_SIZE] __attribute__ ((section (".bram_buffers")));
-static uchar data_buffer[XEMACPSS_RX_BUF_SIZE] __attribute__ ((section (".bram_buffers")));
+static u32 RxBuffers[RXBD_CNT * XEMACPSS_RX_BUF_SIZE/sizeof(u32)] __attribute__ ((section (".bram_buffers")));
+static u32 data_buffer[XEMACPSS_RX_BUF_SIZE/sizeof(u32)] __attribute__ ((section (".bram_buffers")));
#else
static XEmacPss_Bd RxBdSpace[RXBD_CNT];
static XEmacPss_Bd TxBdSpace[TXBD_CNT];
-static char RxBuffers[RXBD_CNT * XEMACPSS_RX_BUF_SIZE];
-static uchar data_buffer[XEMACPSS_RX_BUF_SIZE];
+static u32 RxBuffers[RXBD_CNT * XEMACPSS_RX_BUF_SIZE/sizeof(u32)];
+static u32 data_buffer[XEMACPSS_RX_BUF_SIZE/sizeof(u32)];
#endif

static struct {
@@ -620,7 +620,7 @@ int zynq_gem_initialize_old(bd_t *bis)
*/
int Xgmac_process_rx(XEmacPss * EmacPssInstancePtr)
{
- uchar *buffer = data_buffer;
+ uchar *buffer = (uchar*)&data_buffer[0];
u32 rx_status, hwbuf;
int frame_len;
u32 *bd_addr;


This should fix it regardless of compiler version. Please consider applying this patch.

Cheers

Robert
Robert
 
Posts: 1
Joined: Tue Jan 19, 2016 7:13 am


Return to Linux/U-Boot

Who is online

Users browsing this forum: No registered users and 1 guest