U-Boot for Raspberry Pi, step 7: cleanup

More progress on the subject: I cleaned up sources and pushed new version to github. Stephen Warren submitted patches for R-Pi support to U-Boot mailing list here and here. His version is much cleaner so I spent some time combining his patches with ported USB driver. So now target is called rpi_b and you should use “make rpi_b_config” instead of “make raspberry_pi_config” step when building U-Boot from sources. Pre-built binaries are available for download here.

June 17, 2012 · 1 min · 75 words · Oleksandr Tymoshenko

U-Boot for Raspberry Pi, step 6: It lives!

And finally it works! U-Boot 2012.04.01-00306-gecc6e3d-dirty (Jun 15 2012 - 19:05:09) DRAM: 128 MiB WARNING: Caches not enabled Using default environment In: serial Out: serial Err: serial Net: No ethernet found. Raspberry-Pi # usb start (Re)start USB... USB: Core Release: 2.80a scanning bus for devices... 3 USB Device(s) found scanning bus for ethernet devices... 1 Ethernet Device(s) found Raspberry-Pi # dhcp Waiting for Ethernet connection... done. BOOTP broadcast 1 *** Unhandled DHCP Option in OFFER/ACK: 28 *** Unhandled DHCP Option in OFFER/ACK: 28 DHCP client bound to address 192.168.10.21 Using sms0 device TFTP from server 192.168.10.1; our IP address is 192.168.10.21 Filename 'kernel.RPI'. Load address: 0x700000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ###################################################### done Bytes transferred = 4597674 (4627aa hex) Raspberry-Pi # ping 192.168.10.1 Waiting for Ethernet connection... done. Using sms0 device host 192.168.10.1 is alive Raspberry-Pi #

June 15, 2012 · 1 min · 137 words · Oleksandr Tymoshenko

U-Boot on Raspberry Pi, step 5: More USB stuff

OK. No visual progress, but short SitRep: I got control transfers working more stable and got bulk transfer somewhat working: U-Boot sends one packet and receives response, then all bulk transfers end up in STALL state. Investigating. BOOTP broadcast 1 ** smsc95xx_send(), len 342, buf 0x7e8db5e BULK -> <3,2> dev = 3 pipe = 2 buf = 07e8db5e size = 350 dir_out = 1 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 350, num_packets = 6, max = 64, buffer = 07e8db5e(07e8f490) Tx: len = 350, actual = 350, err = 0 ** smsc95xx_recv() BULK -> <3,1> dev = 3 pipe = 1 buf = 07fec698 size = 2048 dir_out = 0 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 2048, num_packets = 32, max = 64, buffer = 07fec698(07e8f490) Rx: len = 2048, actual = 368, err = 0 packet received packet received Receive from protocol 0x800 Got IP len=346, v=45 DHCPHandler: got packet: (src=67, dst=68, len=318) state: 3 Filtering pkt = 0 DHCPHandler: got DHCP packet: (src=67, dst=68, len=318) state: 3 DHCP: state=SELECTING bp_file: "kernel.RPI" TRANSITIONING TO REQUESTING STATE *** Unhandled DHCP Option in OFFER/ACK: 130 *** Unhandled DHCP Option in OFFER/ACK: 28 DhcpSendRequestPkt: Sending DHCPREQUEST Transmitting DHCPREQUEST packet: len = 342 ** smsc95xx_send(), len 342, buf 0x7e8dace BULK -> <3,2> dev = 3 pipe = 2 buf = 07e8dace size = 350 dir_out = 1 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 350, num_packets = 6, max = 64, buffer = 07e8dace(07e8f490) Channel halted Tx: len = 350, actual = 0, err = 0 BOOTP broadcast 2 ** smsc95xx_send(), len 342, buf 0x7e8db5e BULK -> <3,2> dev = 3 pipe = 2 buf = 07e8dace size = 350 dir_out = 1 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 350, num_packets = 6, max = 64, buffer = 07e8dace(07e8f490) Channel halted Tx: len = 350, actual = 0, err = 0 BOOTP broadcast 2 ** smsc95xx_send(), len 342, buf 0x7e8db5e BULK -> <3,2> dev = 3 pipe = 2 buf = 07e8db5e size = 350 dir_out = 1 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 350, num_packets = 6, max = 64, buffer = 07e8db5e(07e8f490) Channel halted Tx: len = 350, actual = 0, err = 0 ** smsc95xx_recv() BULK -> <3,1> dev = 3 pipe = 1 buf = 07fec698 size = 2048 dir_out = 0 max_hc_xfer_size = 65535, max_hc_pkt_count = 511 xfer_len = 2048, num_packets = 32, max = 64, buffer = 07fec698(07e8f490) HANG at line 533: 00000423

June 15, 2012 · 2 min · 415 words · Oleksandr Tymoshenko

U-Boot on Raspberry Pi, step 4: DWC OTG, Control transactions

After rather busy weekend I finally got control transaction support for DWC OTG controller working on Raspberry Pi. U-Boot DWC OTG driver is cut-down version of Linux driver that works in polling mode. Stability is not very good at the moment though. And make sure to use latest firmware files. It does matter. Next step - bulk transactions. Repo: https://github.com/gonzoua/u-boot-pi Raspberry-Pi # usb info 1: Hub, USB Revision 1.10 - DWC OTG RootHub - Class: Hub - PacketSize: 8 Configurations: 1 - Vendor: 0x0000 Product 0x0000 Version 0.0 Configuration: 1 - Interfaces: 1 Self Powered 0mA Interface: 0 - Alternate Setting 0, Endpoints: 1 - Class Hub - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms 2: Hub, USB Revision 2.0 - Class: Hub - PacketSize: 64 Configurations: 1 - Vendor: 0x0424 Product 0x9512 Version 2.0 Configuration: 1 - Interfaces: 1 Self Powered Remote Wakeup 2mA Interface: 0 - Alternate Setting 0, Endpoints: 1 - Class Hub - Endpoint 1 In Interrupt MaxPacket 1 Interval 255ms 3: Vendor specific, USB Revision 2.0 - Class: Vendor specific - PacketSize: 64 Configurations: 1 - Vendor: 0x0424 Product 0xec00 Version 2.0 Configuration: 1 - Interfaces: 1 Self Powered Remote Wakeup 2mA Interface: 0 - Alternate Setting 0, Endpoints: 3 - Class Vendor specific - Endpoint 1 In Bulk MaxPacket 64 - Endpoint 2 Out Bulk MaxPacket 64 - Endpoint 3 In Interrupt MaxPacket 16 Interval 1ms

June 12, 2012 · 2 min · 233 words · Oleksandr Tymoshenko

R-Pi Boot process

Just a note to myself to keep useful info. Bakul Shah in freebsd-arm quotes R-Pi forum, but I failed to find original. Stage 1 boot is in the on-chip ROM. Loads stage2 in the L2 cache! Stage 2 is bootcode.bin. Enables SDRAM and loads stage3 Stage 3 is loader.bin. Knows about elf format and load start.elf start.elf loads kernel.img (+ it is the main gpu code). It reads config.txt, cmdline.txt and bcm2835.dtb If the dtb file exists, it is loaded at 0x100 & kernel @ 0x8000 Else if disable_commandline_tags is set load kernel @ 0x0 Else if load kernel @ 0x8000 and put ATAGS at 0x100 See Issue 16 in https://github.com/raspberrypi/linux/issues kernel.img, is the first thing that runs on the ARM processor. And more information on config.txt here

June 4, 2012 · 1 min · 128 words · Oleksandr Tymoshenko

U-Boot for Raspberry Pi, step 3

Finally I received my female/male cables for inter-board connects (my soldering skill is close to zero) and got FTDI-based TTL/USB converter work. I had more luck with it then with my old trusty TTL/RS232 converter. No garbage in linux output, serial input works for u-boot. You can find content of boot partition of SD-card I use here. Fully functional serial port means that boot-over-serial should work and I do not need to move SD-card between R-Pi and card reader to get new version of u-boot running. So based on this post I managed to automate compile/run/fix cycle to some extent. Not C-Kermit expert here, so the script is lame but it does its work: ...

June 3, 2012 · 2 min · 285 words · Oleksandr Tymoshenko

U-Boot for Raspberry Pi, step 2

I had some issues with console output from U-Boot on my R-Pi but Alexander Rybalko submitted patch that seems to fix them. One more issue that needed to be resolved: mysterious hangs in relocate_code. Some digging revealed that system hangs once PC reaches address 0x100. Some more digging yielded that at this address is used by GPU part of loader to store arguments for kernel. So after tweaking .text offset for u-boot and generating proper image using this tool I finally got: ...

May 26, 2012 · 1 min · 209 words · Oleksandr Tymoshenko

FreeBSD on Raspberry Pi: baby steps

Thanks to Robert Watson I got my hands on brand new raspberry pi device (model B) and now trying to get FreeBSD running on it. That turned out to be non-trivial task. For one - there is no way to netboot the board. At least I failed to find it. It seems that initial Linux bring-up was done on evaluation modules with proper bootloader, JTAG support and whatnot and for public use limited boot loader was released. So instead porting FreeBSD on it I face the task of porting U-Boot. Which is not something entirely impossible. ...

May 21, 2012 · 2 min · 346 words · Oleksandr Tymoshenko

FreeBSD on ARM devices

Damjan Marion published nice how-to for getting FreeBSD running on BeagleBone. Using it I managed to get my PandaBoard ES running off SD card. The only modifications to this instructions are: Use PANDABOARD kernel config. Stock version is configured to use NFS so it should be modified to use SD card as root. MLO and u-boot.bin binaries are different. I used these. You’ll need boot.scr too. Performance is still affected by using write-through caches by default, but this issue should be fixed soon. ...

April 19, 2012 · 8 min · 1521 words · Oleksandr Tymoshenko

FreeBSD/MIPS & clang/LLVM

Now I know a little bit more about clang. I can’t say it’s quite useful for MIPS yet, but it’s nice to see some progress in this field. My findings might be inaccurate and any corrections are welcome. No proper cross-compilation so far. Clang team plans to do it “right way” but so far it’s just an item on their ToDo list: Universal driver. There are command-line options like -ccc-host-triple to get target assembler code, but names for assembler/linker are hardcoded to as/ld, which puts some restriction on building target toolchain UPD: -ccc-host-triple does the trick OK ...

January 18, 2010 · 2 min · 259 words · Oleksandr Tymoshenko