[U-Boot-Users] Ethernet port

Hi all,
Can anyone say me whether U-Boot supports two Ethernet ports?
If so, how to set the IP and MAC address for the second one.
Regards,
Yasotha Balan R
DISCLAIMER: -----------------------------------------------------------------------------------------------------------------------
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.
-----------------------------------------------------------------------------------------------------------------------

On Tue Sep 18, 2007 at 05:11:44PM +0530, Yasothabalan Ramaswamy-TLS,Chennai wrote:
Can anyone say me whether U-Boot supports two Ethernet ports?
If your processor supports, u-boot supports :-)
If so, how to set the IP and MAC address for the second one.
Check the config file for the board you are referring. For eg, the ADS board i refer to have the following configurations for setting the ip and the mac respectively.
#define CONFIG_IPADDR 192.168.1.253
#define CONFIG_ETHADDR 00:E0:0C:00:00:FD

Thanks sughosh,
So we can set two Ethernet addresses.
How can I set two different IP addresses for these two ports? [Two different IPs Two different GATEWAYs Two different SERVERIPs]
Regards, Yasotha Balan R
-----Original Message----- From: urwithsughosh@gmail.com [mailto:urwithsughosh@gmail.com] Sent: Wednesday, September 19, 2007 2:49 AM To: Yasothabalan Ramaswamy-TLS,Chennai Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Ethernet port
On Tue Sep 18, 2007 at 05:11:44PM +0530, Yasothabalan Ramaswamy-TLS,Chennai wrote:
Can anyone say me whether U-Boot supports two Ethernet ports?
If your processor supports, u-boot supports :-)
If so, how to set the IP and MAC address for the second one.
Check the config file for the board you are referring. For eg, the ADS board i refer to have the following configurations for setting the ip and the mac respectively.
#define CONFIG_IPADDR 192.168.1.253
#define CONFIG_ETHADDR 00:E0:0C:00:00:FD

Hello,
On Tue Sep 18, 2007 at 05:49:44PM +0530, Yasothabalan Ramaswamy-TLS,Chennai wrote:
So we can set two Ethernet addresses.
Forgot to mention one thing in the previous mail though. It is not recommended to configure the mac addresses, using this method. If you flash the same u-boot image on multiple boards (which you most probably will), the ethernet controllers on all the boards will end up having the same mac addresses, which is something you don't want. You can configure the mac addresses through the environment settings, for each board. Check this,
http://www.nabble.com/Changing-ethaddr-tf4192505.html#a11927308
How can I set two different IP addresses for these two ports? [Two different IPs Two different GATEWAYs Two different SERVERIPs]
I'm not sure what you want to do, but AFAIK, you have a single ethernet controller which is active, set by the 'ethact' env variable. This is used to send/receive the traffic. So i'm not sure why you require multiple ip/gateways and serverip's to be set.

Thanks sughosh.
Here in my board I have two Ethernet ports; So now I have to set two different IP addresses for these ports.
As when the U-Boot prompt comes up we can set the IP address as,
=> set ipaddr 10.128.19.1 => set ethaddr aa:bb:cc:ee:ff:gg
So above setting is valid only for single Ethernet port.
My doubt how to set IP address for another Ethernet port or what is the method to do that?
Regards, Yasotha Balan R
-----Original Message----- From: urwithsughosh@gmail.com [mailto:urwithsughosh@gmail.com] Sent: Wednesday, September 19, 2007 4:19 AM To: Yasothabalan Ramaswamy-TLS,Chennai Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] Ethernet port
Hello,
On Tue Sep 18, 2007 at 05:49:44PM +0530, Yasothabalan Ramaswamy-TLS,Chennai wrote:
So we can set two Ethernet addresses.
Forgot to mention one thing in the previous mail though. It is not recommended to configure the mac addresses, using this method. If you flash the same u-boot image on multiple boards (which you most probably will), the ethernet controllers on all the boards will end up having the same mac addresses, which is something you don't want. You can configure the mac addresses through the environment settings, for each board. Check this,
http://www.nabble.com/Changing-ethaddr-tf4192505.html#a11927308
How can I set two different IP addresses for these two ports? [Two different IPs Two different GATEWAYs Two different SERVERIPs]
I'm not sure what you want to do, but AFAIK, you have a single ethernet controller which is active, set by the 'ethact' env variable. This is used to send/receive the traffic. So i'm not sure why you require multiple ip/gateways and serverip's to be set.

In message 20070918211917.GJ25557@GNU you wrote:
Check the config file for the board you are referring. For eg, the ADS board i refer to have the following configurations for setting the ip and the mac respectively.
#define CONFIG_IPADDR 192.168.1.253
#define CONFIG_ETHADDR 00:E0:0C:00:00:FD
It is a terrible bad idea to set the IP address and especially the MAC address of your board in the config file, as then all your boards will share the same address, which will cause only trouble.
DO NOT DO THIS!!!
Best regards,
Wolfgang Denk

tis 2007-09-18 klockan 21:09 +0200 skrev Wolfgang Denk:
In message 20070918211917.GJ25557@GNU you wrote:
Check the config file for the board you are referring. For eg, the ADS board i refer to have the following configurations for setting the ip and the mac respectively.
#define CONFIG_IPADDR 192.168.1.253
#define CONFIG_ETHADDR 00:E0:0C:00:00:FD
It is a terrible bad idea to set the IP address and especially the MAC address of your board in the config file, as then all your boards will share the same address, which will cause only trouble.
DO NOT DO THIS!!!
Unless you use this functionality to simplify factory programming of the device.
By having a compile time setup of ethaddr/ipaddr/serverip, you can easily connect to a production PC using a twisted cable.
The production PC is equipped with a secondary ethernet board which is configured as "serverip".
If this "feature" is used, it must be possible to reconfigure the ethaddr/ipaddr combination to something unique. You do not want to ship this to end customers. An autoscript at the production PC can do this as part of the production programming.
it is probably advisable to disallow booting the linux kernel if the ethaddr/ipaddr has not changed.
Best regards,
Wolfgang Denk

In message 1190149063.4516.9.camel@aeglos.sweden.atmel.com you wrote:
It is a terrible bad idea to set the IP address and especially the MAC address of your board in the config file, as then all your boards will share the same address, which will cause only trouble.
DO NOT DO THIS!!!
Unless you use this functionality to simplify factory programming of the device.
It's still a very stupid thing to do, as you buy your own convenience at the cost of your customers - it's they who will have the problems, not you, obviously. And it's trivial to set up a production envrionment where each and every board has it's own specific serial number, MAC address atf. in the U-Boot environment.
Don't tell me it could not be done, or would be too complicated. It's all there, just use it.
By having a compile time setup of ethaddr/ipaddr/serverip, you can easily connect to a production PC using a twisted cable.
It is NOT necessary to do this at compile time.
If this "feature" is used, it must be possible to reconfigure the ethaddr/ipaddr combination to something unique. You do not want to ship this to end customers.
Then you have to make ethaddr and serial# unprotected, which IMHO is a bad idea either. I don't want to have users messing around with the serial number. If you intend for such a setup, you should at least use the CONFIG_OVERWRITE_ETHADDR_ONCE feature.
An autoscript at the production PC can do this as part of the production programming.
There are much easier ways which don't require console access or booting the system. See "board/tqm8xx/load_sernum_ethaddr.c" for one example wher ethis information can be written by the same programming sequence that programs the U-Boot image - it just programs some small data block in a second step.
it is probably advisable to disallow booting the linux kernel if the ethaddr/ipaddr has not changed.
Too complicated, and not necessary.
Best regards,
Wolfgang Denk

ons 2007-09-19 klockan 00:11 +0200 skrev Wolfgang Denk:
In message 1190149063.4516.9.camel@aeglos.sweden.atmel.com you wrote:
It is a terrible bad idea to set the IP address and especially the MAC address of your board in the config file, as then all your boards will share the same address, which will cause only trouble.
DO NOT DO THIS!!!
Unless you use this functionality to simplify factory programming of the device.
It's still a very stupid thing to do, as you buy your own convenience at the cost of your customers.
You assume that the customers will see boards with this configuration. I see this feature should be used by contract manufactures which wants a simple environment.
The CEM will have test equipment containing preconfigured U-boot. The CPU BootROM will download this code to SDRAM and execute.
The production system will generate a customized autoscript for each board setting the ipaddr/ethaddr to a unique value.
The preconfigured bootcmd will download this autoscript, which will download at91bootstrap, generic u-boot, linux and root-fs and program into flash and at the end, set the environment variables.
No need for any serial communication.
- it's they who will have the problems,
not you, obviously. And it's trivial to set up a production envrionment where each and every board has it's own specific serial number, MAC address atf. in the U-Boot environment.
Add the requirement - no serial port, and you may understand.
Don't tell me it could not be done, or would be too complicated. It's all there, just use it.
By having a compile time setup of ethaddr/ipaddr/serverip, you can easily connect to a production PC using a twisted cable.
It is NOT necessary to do this at compile time.
If this "feature" is used, it must be possible to reconfigure the ethaddr/ipaddr combination to something unique. You do not want to ship this to end customers.
Then you have to make ethaddr and serial# unprotected, which IMHO is a bad idea either. I don't want to have users messing around with the serial number. If you intend for such a setup, you should at least use the CONFIG_OVERWRITE_ETHADDR_ONCE feature.
Yes, once the final data is there, it should not be changeable.
An autoscript at the production PC can do this as part of the production programming.
There are much easier ways which don't require console access or booting the system. See "board/tqm8xx/load_sernum_ethaddr.c" for one example wher ethis information can be written by the same programming sequence that programs the U-Boot image - it just programs some small data block in a second step.
A restriction is that at production time, all flash memories are clean. You CAN'T have a small configuration area in a clean flash... You CAN'T program that area into the flash using a serial port or JTAG, because there are no ports in the system.
The production system will force the CPU to boot from the BootROM, and then a temporary U-boot is loaded to SDRAM over the SPI bus. The temporary U-boot is stored on a memory card (SD/MMC/Dataflashcard) or fixed SPI memory in the test system.
Since the on-board flash memory will never be programmed with the compile time ipaddr/ethaddr, there is really no risk of duplication of addresses...
it is probably advisable to disallow booting the linux kernel if the ethaddr/ipaddr has not changed.
Too complicated, and not necessary.
Yes, comparing two strings is really rocket science.
Best regards,
Wolfgang Denk

Hello all,
Thanks Wolfgang Denk, Ben and Ulf Samuelsson.
In my Board I have two Ethernet ports. These two Ethernet ports must be given two different IP addresses. Through U-Boot code how can I set two different IP addresses for these ports?
Where exactly I have to modify in the U-Boot code to achieve this?
Regards, Yasotha Balan R
-----Original Message----- From: Ulf Samuelsson [mailto:ulf@atmel.com] Sent: Wednesday, September 19, 2007 4:23 AM To: Wolfgang Denk Cc: u-boot-users@lists.sourceforge.net; Yasothabalan Ramaswamy-TLS,Chennai Subject: Re: [U-Boot-Users] Ethernet port
ons 2007-09-19 klockan 00:11 +0200 skrev Wolfgang Denk:
In message 1190149063.4516.9.camel@aeglos.sweden.atmel.com you wrote:
It is a terrible bad idea to set the IP address and especially the MAC address of your board in the config file, as then all your boards will share the same address, which will cause only trouble.
DO NOT DO THIS!!!
Unless you use this functionality to simplify factory programming of the device.
It's still a very stupid thing to do, as you buy your own convenience at the cost of your customers.
You assume that the customers will see boards with this configuration. I see this feature should be used by contract manufactures which wants a simple environment.
The CEM will have test equipment containing preconfigured U-boot. The CPU BootROM will download this code to SDRAM and execute.
The production system will generate a customized autoscript for each board setting the ipaddr/ethaddr to a unique value.
The preconfigured bootcmd will download this autoscript, which will download at91bootstrap, generic u-boot, linux and root-fs and program into flash and at the end, set the environment variables.
No need for any serial communication.
- it's they who will have the problems,
not you, obviously. And it's trivial to set up a production envrionment where each and every board has it's own specific serial number, MAC address atf. in the U-Boot environment.
Add the requirement - no serial port, and you may understand.
Don't tell me it could not be done, or would be too complicated. It's all there, just use it.
By having a compile time setup of ethaddr/ipaddr/serverip, you can easily connect to a production PC using a twisted cable.
It is NOT necessary to do this at compile time.
If this "feature" is used, it must be possible to reconfigure the ethaddr/ipaddr combination to something unique. You do not want to ship this to end customers.
Then you have to make ethaddr and serial# unprotected, which IMHO is a bad idea either. I don't want to have users messing around with the serial number. If you intend for such a setup, you should at least use the CONFIG_OVERWRITE_ETHADDR_ONCE feature.
Yes, once the final data is there, it should not be changeable.
An autoscript at the production PC can do this as part of the production programming.
There are much easier ways which don't require console access or booting the system. See "board/tqm8xx/load_sernum_ethaddr.c" for one example wher ethis information can be written by the same programming sequence that programs the U-Boot image - it just programs some small data block in a second step.
A restriction is that at production time, all flash memories are clean. You CAN'T have a small configuration area in a clean flash... You CAN'T program that area into the flash using a serial port or JTAG, because there are no ports in the system.
The production system will force the CPU to boot from the BootROM, and then a temporary U-boot is loaded to SDRAM over the SPI bus. The temporary U-boot is stored on a memory card (SD/MMC/Dataflashcard) or fixed SPI memory in the test system.
Since the on-board flash memory will never be programmed with the compile time ipaddr/ethaddr, there is really no risk of duplication of addresses...
it is probably advisable to disallow booting the linux kernel if the ethaddr/ipaddr has not changed.
Too complicated, and not necessary.
Yes, comparing two strings is really rocket science.
Best regards,
Wolfgang Denk

Hi Yasotha,
In my Board I have two Ethernet ports. These two Ethernet ports must be given two different IP addresses. Through U-Boot code how can I set two different IP addresses for these ports?
Where exactly I have to modify in the U-Boot code to achieve this?
We do this already, so you don;t need to change common code. Inside U-Boot we only use one ethernet port at a time, so what we do is if we have multiple ethernet ports that we define the "active" device through the "ethact" U-Boot environment variable. Then the usual environment variables like ipaddr are used for the ethernet commands.
Ah and I nearly forgot, the MACs have to be set through "ethaddr" and "eth1addr" (,...)
For how to do this in the code you can look at the ocotea (4 ports) or sequoia (2 ports) code.
Best wishes Detlev

In message CE54F2377C0FB8439A290BF5A88BF13D066A1F78@CHN-HCLT-EVS01.HCLT.CORP.HCL.IN you wrote:
In my Board I have two Ethernet ports. These two Ethernet ports must be given two different IP addresses. Through U-Boot code how can I set two different IP addresses for these ports?
This has already been answered. Please read the postings on the list.
Where exactly I have to modify in the U-Boot code to achieve this?
You don't have to modify any code.
Best regards,
Wolfgang Denk

Hi, Ulf:
You have mentioned that you'll be fixing the tarball. Did you have a chance to do so and if yes where resulting tarball is located?
Thanks,
Leonid.
participants (6)
-
Detlev Zundel
-
Leonid
-
Ulf Samuelsson
-
urwithsughosh@gmail.com
-
Wolfgang Denk
-
Yasothabalan Ramaswamy-TLS,Chennai