Skip to contentSkip to conversation

Environmentvar. "ipaddr" - microblaze

U-Boot Horst Gall 3 participants 9 messages Mar 17, 2010 – Mar 23, 2010

lore
Share & tools
lore

Horst Gall

author
#0 lore raw

Hi Wolfgang,

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()"
otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Best regards
Horst Gall

#1 lore raw

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()"
otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

You should check this issues with the microblaze custodian listed on the web page[1]. Actually I put Michal on CC on this mail already.

Thanks
Detlev

[1] http://www.denx.de/wiki/U-Boot/Custodians

Signature · 6 lines
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#2 lore raw
Quoted 6 lines · Detlev Zundel

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()"
otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Horst: Give me step-by-step manual how to reach that fault.

Quoted 3 lines

You should check this issues with the microblaze custodian listed on the web page[1]. Actually I put Michal on CC on this mail already.

Thanks Detlev.

Thanks,
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
#3 lore raw

Hi Michal,

Quoted 9 lines
Quoted 6 lines · Detlev Zundel

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()" otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Horst: Give me step-by-step manual how to reach that fault.

As long as Horst doesn't answer, I belive he has his environment in SPI flash and was not able to change the "ipaddr" setting used by the network code.

Now all I can think of is that in lib_microblaze/board.c:144 the call returns the environmetn setting of the compiled in environment rather than the SPI flash saved settings. Thus without doing an explicit "setenv ipaddr" network will always use the compiled in ipaddr.

Does that make sense?

Cheers
Detlev

Signature · 5 lines
He thinks he's really smooth, but he's only C^1.
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#4 lore raw
Quoted 9 lines · Detlev Zundel

Hi Michal,

Quoted 7 lines
Quoted 6 lines · Detlev Zundel

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()" otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Quoted 5 lines
Quoted 1 line

Horst: Give me step-by-step manual how to reach that fault.

As long as Horst doesn't answer, I belive he has his environment in SPI flash and was not able to change the "ipaddr" setting used by the network code.

First off all I am looking forward on that spi driver.

Quoted 7 lines

Now all I can think of is that in lib_microblaze/board.c:144 the call returns the environmetn setting of the compiled in environment rather than the SPI flash saved settings. Thus without doing an explicit "setenv ipaddr" network will always use the compiled in ipaddr.

Does that make sense?

Anyway. I don't need to setup different IP address from command line.

The funny thing is that I have this change in my private repo I sync it with ppc some weeks/month ago.
I will have to invest some time to add all my changes to mainline.

If you want to add only this change, I am ok with it.

Michal

Quoted 4 lines

Cheers
Detlev

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
#5 lore raw

Hi Michal,

Quoted 10 lines
Quoted 9 lines · Detlev Zundel

Hi Michal,

Quoted 7 lines
Quoted 6 lines · Detlev Zundel

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()" otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Horst: Give me step-by-step manual how to reach that fault.

As long as Horst doesn't answer, I belive he has his environment in SPI flash and was not able to change the "ipaddr" setting used by the network code.

First off all I am looking forward on that spi driver.

As he noted in another mail, he used drivers/spi/soft_spi.c with a little fix successfully.

Quoted 8 lines
Quoted 6 lines

Now all I can think of is that in lib_microblaze/board.c:144 the call returns the environmetn setting of the compiled in environment rather than the SPI flash saved settings. Thus without doing an explicit "setenv ipaddr" network will always use the compiled in ipaddr.

Does that make sense?

Anyway. I don't need to setup different IP address from command line.

The environment is one of the most central features of U-Boot. If setting of "ipaddr" fails to make any impact on tftp transfers, then I consider it to be broken.

Quoted 5 lines

The funny thing is that I have this change in my private repo I sync it with ppc some weeks/month ago.
I will have to invest some time to add all my changes to mainline.

If you want to add only this change, I am ok with it.

Do you have a timeline on when you will post your changes here for review?

Cheers
Detlev

Signature · 8 lines
"It's amazing I won. I was running against peace, prosperity, and
incumbency."
  --  George H.W. Bush, 06/14/2001, talking to Swedish prime
      minister Goran Perrson, unaware that a live tv camera was still on
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
#6 lore raw
Quoted 26 lines · Detlev Zundel

Hi Michal,

Quoted 10 lines
Quoted 9 lines · Detlev Zundel

Hi Michal,

Quoted 7 lines
Quoted 6 lines · Detlev Zundel

Hi Horst,

Quoted 4 lines

in "lib_microblaze/board.c board_init()" the function "env_relocate()" should be called before "getenv_IPaddr()" otherwise there is no chance to save an ip-address in the environment (like in lib_ppc/board.c).

Quoted 5 lines
Quoted 4 lines
Quoted 1 line

Horst: Give me step-by-step manual how to reach that fault.

As long as Horst doesn't answer, I belive he has his environment in SPI flash and was not able to change the "ipaddr" setting used by the network code.

First off all I am looking forward on that spi driver.

As he noted in another mail, he used drivers/spi/soft_spi.c with a little fix successfully.

Quoted 5 lines
Quoted 5 lines

Now all I can think of is that in lib_microblaze/board.c:144 the call returns the environmetn setting of the compiled in environment rather than the SPI flash saved settings. Thus without doing an explicit "setenv ipaddr" network will always use the compiled in ipaddr.

Quoted 6 lines
Quoted 2 lines
Quoted 1 line

Does that make sense?

Anyway. I don't need to setup different IP address from command line.

The environment is one of the most central features of U-Boot. If setting of "ipaddr" fails to make any impact on tftp transfers, then I consider it to be broken.

I know. I meant that for my work is enough to use only one IP in config file and I don't need to change it on command line.

Quoted 9 lines
Quoted 6 lines

The funny thing is that I have this change in my private repo I sync it with ppc some weeks/month ago.
I will have to invest some time to add all my changes to mainline.

If you want to add only this change, I am ok with it.

Do you have a timeline on when you will post your changes here for review?

Not yet. I am busy around Linux stuff but I want to do it.

Ben: Are you busy? Do you have time to check ll_temac driver and emaclite changes?

Cheers,
Michal

Quoted 4 lines

Cheers
Detlev

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
author
#7 lore raw
In reply to Michal Simek
Quoted 1 line

Horst: Give me step-by-step manual how to reach that fault.

Hi Michal,

in 'include/configs/microblaze_generic.h' is ipaddr defined:

    #define CONFIG_IPADDR 192.168.0.3

Now run uboot:

    setenv ipaddr 192.168.0.1
    saveenv

Reboot the board

    printenv (tells ipaddr 192.168.0.1)
    bdinfo    (tells ipaddr 192.168.0.3)

    tftpboot also use ipaddr 192.168.0.3

On a ppc-based board bdinfo tells 192.168.0.1

So I found the difference in the order of the two functions in lib_microblaze/board.c board_init():

env_relocate() (ppc-order witch works)
getenv_IPaddr()

instead of:

getenv_IPaddr() (microblaze-order)
env_relocate()

Best regards
Horst

#8 lore raw
Quoted 25 lines · Horst Gall
Quoted 1 line

Horst: Give me step-by-step manual how to reach that fault.

Hi Michal,

in 'include/configs/microblaze_generic.h' is ipaddr defined:

   #define CONFIG_IPADDR 192.168.0.3

Now run uboot:

   setenv ipaddr 192.168.0.1
   saveenv

Reboot the board

   printenv (tells ipaddr 192.168.0.1)
   bdinfo    (tells ipaddr 192.168.0.3)

   tftpboot also use ipaddr 192.168.0.3

On a ppc-based board bdinfo tells 192.168.0.1

So I found the difference in the order of the two functions in lib_microblaze/board.c board_init():

Quoted 7 lines

env_relocate() (ppc-order witch works)
getenv_IPaddr()

instead of:

getenv_IPaddr() (microblaze-order)
env_relocate()

I got it. Dentlev described what is going on.
Please create proper patch and send it to mailing list with cc to me.

Thanks,
Michal

Quoted 5 lines

Best regards
Horst

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