[U-Boot-Users] Design Recommendation and Help with Issues

I am running U-Boot version U-Boot 1.3.1-rc1 on my board that has a Broadcom network switch. My goal is to initialize this switch at the bootloader level and be able to tftpboot a Linux kernel from one of the ethernet ports of this switch.
As _I_ understand, there are two ways to initialize the switch from u-boot.
First ===== Theory: Link the switch driver software with the u-boot.bin and flash it on the board. Switch driver's entry point would be called somewhere in u-boot to initialize it. Size of the u-boot.bin will increase and the u-boot partition on the NOR flash will need to be updated to accommodate the new binary size.
Practice: After I linked the driver software with the u-boot.bin, the board didn't boot any further after u-boot got relocated to RAM with this following message: "Now running in RAM - U-Boot at: 0ff6d000"
I did the following to link switch driver library (MDK_BLIBS) with u-boot in Makefile:
$(obj)u-boot: ......... --start-group $(__LIBS) $(MDK_BLIBS)--end-group $(PLATFORM_LIBS) \ .........
Switch library is compiled with same TEXT_BASE and other flags as that of u-boot.
Second ====== Theory: Build the network switch driver as a u-boot application, flash it on a free partition on the NOR and after u-boot has booted, it will somehow do the following to initialize the network switch.
cp.b 0xfff90000 0x40000 0x5bfac go 0x00040418
Practice: The above two commands worked to initialize the switch. I still need to understand how to run these command automatically after the u-boot has booted.
Questions: 1.) Which design is recommended, first or the second? Second is easier for me to implement as I don't have to change the partition sizes but could easily be overlooking some obvious problems.
2.) If the first design is recommended, I would need to resolve the u-boot-not-booting issue when the binary is compiled with switch driver. Any suggestions where to look?
Thanks, Jatin

Jatin Sharma wrote:
I am running U-Boot version U-Boot 1.3.1-rc1 on my board that has a Broadcom network switch. My goal is to initialize this switch at the bootloader level and be able to tftpboot a Linux kernel from one of the ethernet ports of this switch.
As _I_ understand, there are two ways to initialize the switch from u-boot.
First
Theory: Link the switch driver software with the u-boot.bin and flash it on the board. Switch driver's entry point would be called somewhere in u-boot to initialize it. Size of the u-boot.bin will increase and the u-boot partition on the NOR flash will need to be updated to accommodate the new binary size.
Practice: After I linked the driver software with the u-boot.bin, the board didn't boot any further after u-boot got relocated to RAM with this following message: "Now running in RAM - U-Boot at: 0ff6d000"
I did the following to link switch driver library (MDK_BLIBS) with u-boot in Makefile:
$(obj)u-boot: ......... --start-group $(__LIBS) $(MDK_BLIBS)--end-group $(PLATFORM_LIBS) \ .........
Switch library is compiled with same TEXT_BASE and other flags as that of u-boot.
Second
Theory: Build the network switch driver as a u-boot application, flash it on a free partition on the NOR and after u-boot has booted, it will somehow do the following to initialize the network switch.
cp.b 0xfff90000 0x40000 0x5bfac go 0x00040418
Practice: The above two commands worked to initialize the switch. I still need to understand how to run these command automatically after the u-boot has booted.
Questions: 1.) Which design is recommended, first or the second? Second is easier for me to implement as I don't have to change the partition sizes but could easily be overlooking some obvious problems.
It would help to know which type of Broadcom switch it is you're using. A lot of them have a SPI-based control plane, in which case you can set up a simple port configuration without an elaborate driver.
regards, Ben

In message 587a08410808060856v4b7a1b25u69ea80ff1b867c6d@mail.gmail.com you wrote:
Theory: Link the switch driver software with the u-boot.bin and flash it on the board. Switch driver's entry point would be called somewhere in u-boot to initialize it. Size of the u-boot.bin will increase and the u-boot partition on the NOR flash will need to be updated to accommodate the new binary size.
You have the source code of the switch driver software? And it comes with a GPL compatible license?
Questions: 1.) Which design is recommended, first or the second? Second is easier for me to implement as I don't have to change the partition sizes but could easily be overlooking some obvious problems.
I would conside the switch driver code to be driver code like any othr, i. e. it should go into the drivers/ directory and then be linked with U-Boot like any other U-Boot code.
2.) If the first design is recommended, I would need to resolve the u-boot-not-booting issue when the binary is compiled with switch driver. Any suggestions where to look?
Don't play any tricks with modifying the linker command line. Just add your driver code like any other driver to the source tree and let the exsiting Makefiles do the rest.
Best regards,
Wolfgang Denk
participants (3)
-
Ben Warren
-
Jatin Sharma
-
Wolfgang Denk