[U-Boot] [PATCH] Make getenv_IPaddr() global

Dirk Behme dirk.behme at googlemail.com
Thu Dec 31 06:31:52 CET 2009


On 30.12.2009 22:31, Ben Warren wrote:
> Hi Dirk,
>
> On Wed, Dec 30, 2009 at 6:36 AM, Dirk Behme<dirk.behme at googlemail.com>wrote:
>
>> There are boards out there that do not have network support in
>> U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This
>> makes it desirable to be able to port network configuration (like
>> the IP address) to the Linux kernel.
>>
>> We should not make the passing of the IP configuration to Linux
>> dependent on U-Boot features / settings.
>>
>> For this, make getenv_IPaddr() global. This fixes build error
>>
>> u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr'
>>
>> on various architectures.
>>
>> Signed-off-by: Dirk Behme<dirk.behme at googlemail.com>
>>
>> ---
>>
>> This makes other patches trying to fix this issue obsolete. E.g.
>>
>> http://lists.denx.de/pipermail/u-boot/2009-December/065809.html
>> http://lists.denx.de/pipermail/u-boot/2009-December/065810.html
>> http://lists.denx.de/pipermail/u-boot/2009-December/065822.html
>>
>> See
>>
>> http://lists.denx.de/pipermail/u-boot/2009-December/065833.html
>> http://lists.denx.de/pipermail/u-boot/2009-December/065847.html
>> http://lists.denx.de/pipermail/u-boot/2009-December/065848.html
>>
>> for further details.
>>
>>   lib_generic/Makefile    |    1
>>   lib_generic/net_utils.c |   57
>> ++++++++++++++++++++++++++++++++++++++++++++++++
>>   net/net.c               |   26 ---------------------
>>   3 files changed, 58 insertions(+), 26 deletions(-)
>>
>> Index: u-boot-main/lib_generic/Makefile
>> ===================================================================
>> --- u-boot-main.orig/lib_generic/Makefile
>> +++ u-boot-main/lib_generic/Makefile
>> @@ -41,6 +41,7 @@ COBJS-y += gunzip.o
>>   COBJS-y += lmb.o
>>   COBJS-y += ldiv.o
>>   COBJS-$(CONFIG_MD5) += md5.o
>> +COBJS-y += net_utils.o
>>   COBJS-y += sha1.o
>>   COBJS-$(CONFIG_SHA256) += sha256.o
>>   COBJS-y += string.o
>> Index: u-boot-main/lib_generic/net_utils.c
>> ===================================================================
>> --- /dev/null
>> +++ u-boot-main/lib_generic/net_utils.c
>>
>
> I agree that this function should be generic, but it's more of an
> environment function than a networking one.  Why not put this somewhere like
> common/env_common.c or create a new file called common/env_net.c?

Because Wolfgang proposed lib_generic/net_utils.c

http://lists.denx.de/pipermail/u-boot/2009-December/065848.html

I don't care where to put it, please discuss this with Wolfgang ;)

Best regards

Dirk




More information about the U-Boot mailing list