Forum Discussion
Altera_Forum
Honored Contributor
14 years agoU-Boot v2 aka Barebox
Hello,
I'm inviting you to try this wonderfull bootloader named Barebox (here (http://barebox.org)). I added the nios2 arch to the project some times ago and now, we have some nios2 drivers availables: - altera uart, - jtag uart, - altera tse, - altera spi, Of course, others drivers are availables (nor, nand,...). I made a short tutorial/introduction to the usage of barebox with a neek board on my website: www.elec4fun.fr (http://www.elec4fun.fr) Enjoy :)16 Replies
- Altera_Forum
Honored Contributor
--- Quote Start --- Hello, I'm inviting you to try this wonderfull bootloader named Barebox (here (http://barebox.org)). I added the nios2 arch to the project some times ago and now, we have some nios2 drivers availables: - altera uart, - jtag uart, - altera tse, - altera spi, Of course, others drivers are availables (nor, nand,...). I made a short tutorial/introduction to the usage of barebox with a neek board on my website: www.elec4fun.fr (http://www.elec4fun.fr) Enjoy :) --- Quote End --- Thanks a lot, I will try this. - Altera_Forum
Honored Contributor
Hi,
I wake up this old introduction thread because I face some issue using barebox on a brand new Cyclone V DK dev board. I using Quartus 12.1 Web edition tools on a Centos 6.3 32bit linux workstation. I manage to compile barebox (version 2013.02) for this dev board, and download it on the board. Nios2 design include altera_tse IP, JTAG UART (and UART) and other IP (DDR3 ...). I can download barebox elf on the board, and start it It works ! I can see the prompt, and execute some commands. But few things are not working as expected. The most annoying is network. DevKit is connected to a Gigabit network with a working DHCP server. With default factory, board is working correctly, i.e. board update portal receive IP and is reachable over network. I enable altera_tse in barebox driver (via make menuconfig). At barebox prompt, command dhcp show a serie of Timeout. On the board, 1Gb LED is on, by I don't see any activity on RX and TX LED. If I set a static IP, ping command is also on timeout. First investigation shows something wrong on PHY init (or at least, no PHY init). Maybe this part is missing. On another hand, I try lwip library (thanks to BillA), and the basic example is working on the same design (i.e., DHCP, and basic http server running). Any suggestion would be greatly appreciate. Regards, Christophe - Altera_Forum
Honored Contributor
Hi,
I'm glad to hear you are giving barebox a try ! I took a look at the schematics of your board and it seems the PHY is at address 0. Did you change the PHY address while declaring the device in your board file ? Reading the driver code makes me think we should do something when the PHY is not detected (either auto-detect or at least print something). Franck. - Altera_Forum
Honored Contributor
Hi,
Thanks Franck for your response (and for your work on Barebox / Nios 2). I already change PHY address to 0 (or -1), else, I got an error about unknown PHY id. We have made some progress. According to the design, we have to use dedicated memory descriptor. So, I complete in generic.c (well, a copy for this file for the DK board) the description, (tse_mac) with a new entry. Now, I can see TX LED activity, but, unfortunatly, server don't seems to proceed the Frame (maybe the frame is wrong, and dropped). I enable trace in barebox altera_tse driver. I see several sgdma TX. First one has status 0xC, and following have 0x1C, until timeout. I'll try to dump packet, and check if it's correct. Edit : In MAC Registers about status, aAlignmentErrors increase (when server perform a broadcast ping). Packet dump shows something similare. To be Continue. Regards, Christophe - Altera_Forum
Honored Contributor
Hi,
Have you made some progress so far ? Franck. - Altera_Forum
Honored Contributor
Hi,
I solve this issue. As describe in my first, PHY Init is required now (or default register is not correct). I look inside TSE driver, and found some registers to set. I complete barebox TSE driver, and now, it's Ok. I also change uncache address base, since the default value don't match our design (or change with Cyclone V). Regards, Christophe - Altera_Forum
Honored Contributor
Hi,
Ok, great to hear. Thanks for the update. Franck. - Altera_Forum
Honored Contributor
Hi,
I wake-up agin this thread :) Our design change, and now include a mmu support (instead mpu). I update barebox config, add MMU support, but keep all previous settings. Unfortnatly, barebox don't start anymore ( no console print, even with log level and early printf). Other baremetal applications (MemTest...) from altera keep working, and linux manage to boot. I try to trace it with gdb (via jtag cable). It keeps looping on arch/nios2/cpu/start.S, between "EXCEPTION TRAMPOLINE" and "initd 0(R6)"
Any idea or suggestions ? Regards, Christophe/* EXCEPTION TRAMPOLINE -- the following gets copied * to the exception address (below), but is otherwise at the * default exception vector offset (0x0020). */ _except_start: movhi et, %hi(_exception) ori et, et, %lo(_exception) jmp et _except_end: /* INTERRUPTS -- for now, all interrupts masked and globally * disabled. */ wrctl ienable, r0 /* All disabled */ /* DCACHE INIT -- if dcache not implemented, initd behaves as * nop. */ movhi r4, %hi(DCACHE_LINE_SIZE) ori r4, r4, %lo(DCACHE_LINE_SIZE) movhi r5, %hi(DCACHE_SIZE) ori r5, r5, %lo(DCACHE_SIZE) mov r6, r0 1: initd 0(r6) <-- When reach here, jump to _except_start add r6, r6, r4 bltu r6, r5, 1b - Altera_Forum
Honored Contributor
Hi,
Look here: http://www.elec4fun.fr/2011-03-30-10-16-30/2011-03-31-13-08-45/startwithbarebox Update: sopc-create-header-files as a bug on newer quartus versions (http://www.alteraforum.com/forum/archive/index.php/t-34232.html). Please check your nios_sopc.h file. Franck. - Altera_Forum
Honored Contributor
Hi Franck,
Indeed, the second link is the issue identify. I just realize it by checking# define in nios_sopc.h. I see lastest barebox introduce device_tree support. I don't know if I can use it right now. Also, thanks for your website (elec4fun.fr), I use it as reference :cool: Regards, Christophe