All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] Environmentvar. "ipaddr" - microblaze
@ 2010-03-17 22:12 Horst Gall
  2010-03-18  9:38 ` Detlev Zundel
  0 siblings, 1 reply; 9+ messages in thread
From: Horst Gall @ 2010-03-17 22:12 UTC (permalink / raw)
  To: u-boot

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 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-17 22:12 [U-Boot] Environmentvar. "ipaddr" - microblaze Horst Gall
@ 2010-03-18  9:38 ` Detlev Zundel
  2010-03-22 13:20   ` Michal Simek
  0 siblings, 1 reply; 9+ messages in thread
From: Detlev Zundel @ 2010-03-18  9:38 UTC (permalink / raw)
  To: u-boot

Hi Horst,

> 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

-- 
"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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-18  9:38 ` Detlev Zundel
@ 2010-03-22 13:20   ` Michal Simek
  2010-03-22 16:40     ` Detlev Zundel
  2010-03-23 11:03     ` Horst Gall
  0 siblings, 2 replies; 9+ messages in thread
From: Michal Simek @ 2010-03-22 13:20 UTC (permalink / raw)
  To: u-boot

Detlev Zundel wrote:
> Hi Horst,
> 
>> 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.

> 
> 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



-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-22 13:20   ` Michal Simek
@ 2010-03-22 16:40     ` Detlev Zundel
  2010-03-22 17:24       ` Michal Simek
  2010-03-23 11:03     ` Horst Gall
  1 sibling, 1 reply; 9+ messages in thread
From: Detlev Zundel @ 2010-03-22 16:40 UTC (permalink / raw)
  To: u-boot

Hi Michal,

> Detlev Zundel wrote:
>> Hi Horst,
>>
>>> 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

-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-22 16:40     ` Detlev Zundel
@ 2010-03-22 17:24       ` Michal Simek
  2010-03-23  9:55         ` Detlev Zundel
  0 siblings, 1 reply; 9+ messages in thread
From: Michal Simek @ 2010-03-22 17:24 UTC (permalink / raw)
  To: u-boot

Detlev Zundel wrote:
> Hi Michal,
> 
>> Detlev Zundel wrote:
>>> Hi Horst,
>>>
>>>> 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.

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

> 
> 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


> 
> Cheers
>   Detlev
> 


-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-22 17:24       ` Michal Simek
@ 2010-03-23  9:55         ` Detlev Zundel
  2010-03-23 13:44           ` Michal Simek
  0 siblings, 1 reply; 9+ messages in thread
From: Detlev Zundel @ 2010-03-23  9:55 UTC (permalink / raw)
  To: u-boot

Hi Michal,

> Detlev Zundel wrote:
>> Hi Michal,
>>
>>> Detlev Zundel wrote:
>>>> Hi Horst,
>>>>
>>>>> 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.
>
> 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.

>> 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.

> 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

-- 
"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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-22 13:20   ` Michal Simek
  2010-03-22 16:40     ` Detlev Zundel
@ 2010-03-23 11:03     ` Horst Gall
  2010-03-23 13:41       ` Michal Simek
  1 sibling, 1 reply; 9+ messages in thread
From: Horst Gall @ 2010-03-23 11:03 UTC (permalink / raw)
  To: u-boot

> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-23 11:03     ` Horst Gall
@ 2010-03-23 13:41       ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2010-03-23 13:41 UTC (permalink / raw)
  To: u-boot

Horst Gall wrote:
>> 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()

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

> 
> 
> Best regards
> Horst
> 


-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [U-Boot] Environmentvar. "ipaddr" - microblaze
  2010-03-23  9:55         ` Detlev Zundel
@ 2010-03-23 13:44           ` Michal Simek
  0 siblings, 0 replies; 9+ messages in thread
From: Michal Simek @ 2010-03-23 13:44 UTC (permalink / raw)
  To: u-boot

Detlev Zundel wrote:
> Hi Michal,
> 
>> Detlev Zundel wrote:
>>> Hi Michal,
>>>
>>>> Detlev Zundel wrote:
>>>>> Hi Horst,
>>>>>
>>>>>> 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.
>> 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.
> 
>>> 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.

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.

> 
>> 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

> 
> Cheers
>   Detlev
> 


-- 
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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-23 13:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17 22:12 [U-Boot] Environmentvar. "ipaddr" - microblaze Horst Gall
2010-03-18  9:38 ` Detlev Zundel
2010-03-22 13:20   ` Michal Simek
2010-03-22 16:40     ` Detlev Zundel
2010-03-22 17:24       ` Michal Simek
2010-03-23  9:55         ` Detlev Zundel
2010-03-23 13:44           ` Michal Simek
2010-03-23 11:03     ` Horst Gall
2010-03-23 13:41       ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.