U-Boot port on RISC-V 32-bit is available

897 views
Skip to first unread message

Padmarao Begari

unread,
Feb 14, 2017, 5:13:38 AM2/14/17
to RISC-V SW Dev
U-Boot port on RISC-V 32-bit  is available on github. 
                    

This repository contains the U-Boot port by Microsemi for RISC-V core on Smartfusion2 M2Sxxx devices. The Smartfusion2 M2S150 FPGA Advance Dev Kit is used for RISC-V U-Boot and the FPGA design available at RISCV-on-Microsemi-FPGA.


 Regards
Padmarao

Dave Williams

unread,
May 17, 2017, 11:43:27 PM5/17/17
to RISC-V SW Dev
Padmarao

Some comments on my experience porting U-Boot for more custom targets.   Last year, I ported U-Boot for Altera/Nios2 on
a modest size Cyclone FPGA.  Why do this?  I found all Altera related info on U-Boot did not work and discovered their
info was woefully out-of-date.  E.g. their guidance (app notes) had not been updated to U-Boots Kconfig kernal like build style.
So, I had some time and thought I should dig-in.  I git cloned U-Boot source from Denx.de.  Most of the changes went smoothly
but I did get hung up some on U-Boot's expectation of flash memory.  If I didn't define some flash - I had errors in compilation. 
And the Kconfig menus did not give me any options concerning flash.  My HW target had no flash in my Nios2 SOC design - I ran
from internal FPGA memory and some external DRAM.  But U-Boot just had to have flash memory defined. After scanning the code
base I concluded it wasn't going to be quick/easy to remove flash memory support.  So, it took some hacking to fool U-Boot into believing
it had flash (aka hacking) but I did get it to boot and it runs well.

U-boot has nice features for debugging hardware e.g. I used it on a different target for compliance testing on GbE phys.  But I was disappointed with the amount of effort required to port to a custom target.  And customization and open-standards is what I find attractive in RiscV.  BTW, this wasn't my own custom hardware but a Terasic Altera Cylcone Dev board.  But I don't think U-Boot should be this difficult.  A lot of vendors port it to their dev boards with kind of BSP (board-support-package) kind of approach.  But seems like you end up with some 'vendor lock'.  Where everything works great if only if you have their dev board.  So don't be too surprised if you find yourself wading thru some U-Boot assembler to port to your custom RiscV target.  And I seem to recall I'd have to modify Kconfig menus to add the flexibility I needed.  Maybe that is standard practice.  Or maybe my difficulty was only particular to Nios2 and U-Boot. But none-the-less, the Kconfig menu options were not general purpose for my needs. Like someone had just put in just enough effort to support one dev board.  

Just some feedback.

Dave W

Maxim Sloyko

unread,
May 18, 2017, 12:53:19 PM5/18/17
to Dave Williams, RISC-V SW Dev
Dave,

I think these issues would be better addressed on U-Boot mailing list u-b...@lists.denx.de
I'd be happy to help you there -- if this is still an issue -- while my own experience of adding support for a new board is still fresh.

On Wed, May 17, 2017 at 8:43 PM, Dave Williams <dave.will...@gmail.com> wrote:
Padmarao

Some comments on my experience porting U-Boot for more custom targets.   Last year, I ported U-Boot for Altera/Nios2 on
a modest size Cyclone FPGA.  Why do this?  I found all Altera related info on U-Boot did not work and discovered their
info was woefully out-of-date.  E.g. their guidance (app notes) had not been updated to U-Boots Kconfig kernal like build style.
So, I had some time and thought I should dig-in.  I git cloned U-Boot source from Denx.de.  Most of the changes went smoothly
but I did get hung up some on U-Boot's expectation of flash memory.  If I didn't define some flash - I had errors in compilation.

What kind of errors? I suspect this would be something related to env, which by default is assumed to be in flash IIRC.
 
 
And the Kconfig menus did not give me any options concerning flash.

Not everything is ported to Kconfig yet, this is an ongoing effort, so in general case you would need to have configs/your_board_defconfig and include/configs/your_board.h
Also you are better off editing both by hand, instead of running menuconfig.

The env configuration I mentioned above is not in Kconfig, so this is something you need to specify in include/configs/your_board.h
 
  My HW target had no flash in my Nios2 SOC design - I ran
from internal FPGA memory and some external DRAM.  But U-Boot just had to have flash memory defined. After scanning the code
base I concluded it wasn't going to be quick/easy to remove flash memory support.  So, it took some hacking to fool U-Boot into believing
it had flash (aka hacking) but I did get it to boot and it runs well.

U-boot has nice features for debugging hardware e.g. I used it on a different target for compliance testing on GbE phys.  But I was disappointed with the amount of effort required to port to a custom target.  And customization and open-standards is what I find attractive in RiscV.  BTW, this wasn't my own custom hardware but a Terasic Altera Cylcone Dev board.  But I don't think U-Boot should be this difficult.  A lot of vendors port it to their dev boards with kind of BSP (board-support-package) kind of approach.  But seems like you end up with some 'vendor lock'.  Where everything works great if only if you have their dev board.  So don't be too surprised if you find yourself wading thru some U-Boot assembler to port to your custom RiscV target.  And I seem to recall I'd have to modify Kconfig menus to add the flexibility I needed.  Maybe that is standard practice.  Or maybe my difficulty was only particular to Nios2 and U-Boot. But none-the-less, the Kconfig menu options were not general purpose for my needs.

Yes, as I said, moving CONFIG_ options from include config files to Kconfig is an ongoing effort.
 
Like someone had just put in just enough effort to support one dev board.  

Just some feedback.

Dave W

On Tuesday, February 14, 2017 at 3:13:38 AM UTC-7, Padmarao Begari wrote:
U-Boot port on RISC-V 32-bit  is available on github. 
                    

This repository contains the U-Boot port by Microsemi for RISC-V core on Smartfusion2 M2Sxxx devices. The Smartfusion2 M2S150 FPGA Advance Dev Kit is used for RISC-V U-Boot and the FPGA design available at RISCV-on-Microsemi-FPGA.


 Regards
Padmarao

--
You received this message because you are subscribed to the Google Groups "RISC-V SW Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+unsubscribe@groups.riscv.org.
To post to this group, send email to sw-...@groups.riscv.org.
Visit this group at https://groups.google.com/a/groups.riscv.org/group/sw-dev/.
To view this discussion on the web visit https://groups.google.com/a/groups.riscv.org/d/msgid/sw-dev/e6f0b6e7-73a4-41b8-a34c-07f002b9ddc7%40groups.riscv.org.



--
--
Maxim Sloyko

Dave Williams

unread,
May 19, 2017, 11:21:15 PM5/19/17
to Maxim Sloyko, RISC-V SW Dev
Maxim

Thanks for your reply.

However, the immediate need of U-Boot booting has been solved for some time now and I would need to refresh my understanding to continue work on refining the configuration.  I am not sure that is in my immediate future. As you suggested, I did not continue using menuconfig and made hand edits as you suggest.  I understand and support the rationale for moving to Kconfig - I just have little understanding and experience with it.  Hacking to just get it to work - that is not the same thing as developing a comprehensive understanding how U-Boot configuration works.  So if you have a link that helps in developing a more general understanding U-Boot configuration  - I am very interested. 

I agree, more specific questions on U-Boot configuration do not belong on this list.  My intention for contributing to this thread post, was more of a FYI comment of my general impressions and experiences of someone who has ported U-Boot to an unsupported board. 

When I get back to working U-Boot in the future, I will definitely post questions on u-b...@lists.denx.de.

Dave W  

To unsubscribe from this group and stop receiving emails from it, send an email to sw-dev+un...@groups.riscv.org.



--
--
Maxim Sloyko

Maxim Sloyko

unread,
May 22, 2017, 1:15:53 AM5/22/17
to Dave Williams, RISC-V SW Dev
Dave,

On Fri, May 19, 2017 at 8:21 PM, Dave Williams
<dave.will...@gmail.com> wrote:
> Maxim
>
> Thanks for your reply.
>
> However, the immediate need of U-Boot booting has been solved for some time
> now and I would need to refresh my understanding to continue work on
> refining the configuration. I am not sure that is in my immediate future.
> As you suggested, I did not continue using menuconfig and made hand edits as
> you suggest. I understand and support the rationale for moving to Kconfig -
> I just have little understanding and experience with it. Hacking to just
> get it to work - that is not the same thing as developing a comprehensive
> understanding how U-Boot configuration works. So if you have a link that
> helps in developing a more general understanding U-Boot configuration - I
> am very interested.
>
> I agree, more specific questions on U-Boot configuration do not belong on
> this list.

Just want to make clear that I absolutely did not mean to discourage
you from posting something like this here. I just meant to say that
you would find more relevant expertise in U-Boot list, if you really
want to solve the problem like this.
--
--
Maxim Sloyko
Reply all
Reply to author
Forward
0 new messages