Raspberry Pi questions

Ian Lepore freebsd at damnhippie.dyndns.org
Tue Dec 25 23:06:48 UTC 2012


On Tue, 2012-12-25 at 12:37 -0800, Oleksandr Tymoshenko wrote:
> On 2012-12-25, at 12:21 PM, Ian Lepore <freebsd at damnhippie.dyndns.org> wrote:
> 
> > I got my RPi running this morning, more or less.  I used the boot
> > partition from the latest image at http://www.peach.ne.jp/archives/rpi/
> > but I'm loading my own custom built kernel and world.  I have a few
> > questions...
> > 
> > Can I get ubldr to load a kernel using tftp, bootp, etc?  
> 
>     Yes. ubldr checks U-Boot devices (SD and net), then tries to locate
> FFS partition on SD card and if fails - falls back to NFS/bootp. You can fetch
> my image, boot partition there contains ubldr, FDT blob, config.txt and boot scripts:
> 
> http://people.freebsd.org/~gonzo/arm/rpi/freebsd-pi-r243778.img.gz

This is so close to working.  In u-boot I have an env var "usbethaddr"
which contains what seems to be the right address (it's an RPi
foundation oui).  But still when booting via ubldr it generates a random
address every time, apparently because smsc_fdt_find_mac() always
returns zeroes (I added a printf to the smsc driver).  If I hard-code
the right mac address in the smsc driver I get all the way to multiuser
mode.

Also, when ubldr launches it immediately begins to load the kernel from
sdcard before I can stop it.  I have to wait for that to finish and then
do "unload" then load the kernel from net0:.  Can I create a file that
contains different defaults or something?

The amount of ram reported by kernel startup is only 128mb.  u-boot says
384mb, that's not right either.


U-Boot 2013.01-rc1-g6709570-dirty (Nov 30 2012 - 19:09:28)

DRAM:  384 MiB
WARNING: Caches not enabled
MMC:   bcm2835_sdhci: 0
Using default environment

In:    serial
Out:   lcd
Err:   lcd
mbox: Timeout waiting for response
bcm2835: Could not set USB power state
Net:   Net Initialization Skipped
No ethernet found.
Hit any key to stop autoboot:  0 
U-Boot> usb start
(Re)start USB...
USB0:   Core Release: 2.80a
scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... Error condition at line 748:  ACK
1 Storage Device(s) found
       scanning usb for ethernet devices... 1 Ethernet Device(s) found
U-Boot> printenv
arch=arm
baudrate=115200
board=rpi_b
board_name=rpi_b
bootcmd=if mmc rescan ${mmcdev}; then if run loadbootenv; then run importbootenv; fi; if run loadbootscript; then run bootscript; fi; fi
bootdelay=3
bootenv=uEnv.txt
bootscript=echo Running bootscript from mmc${mmcdev} ...; source ${loadaddr}
cpu=arm1176
ethact=sms0
importbootenv=echo Importing environment from mmc ...; env import -t $loadaddr $filesize
loadaddr=0x00200000
loadbootenv=fatload mmc ${mmcdev} ${loadaddr} ${bootenv}
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr
mmcdev=0
soc=bcm2835
stderr=serial,lcd
stdin=serial
stdout=serial,lcd
usbethaddr=b8:27:eb:33:7c:02
vendor=raspberrypi

Environment size: 706/16380 bytes
U-Boot> boot
reading uEnv.txt
reading boot.scr
137 bytes read in 24411 ms (0 Bytes/s)
Running bootscript from mmc0 ...
## Executing script at 00200000
reading ubldr
242834 bytes read in 77687 ms (2.9 KiB/s)
## Starting application at 0x02000054 ...
Consoles: U-Boot console  
Compatible API signature found @17b662a8
Number of U-Boot devices: 3

FreeBSD/armv6 U-Boot loader, Revision 1.2
(root at bsdbox, Sun Dec  2 13:49:40 PST 2012)
DRAM:    384MB

Device: disk
-
/boot/kernel/kernel data=0x3f2038+0x1f620 syms=[0x4+0x7dd50+0x4+0x5fb94]
Hit [Enter] to boot immediately, or any other key for command prompt.


Type '?' for a list of commands, 'help' for more detailed help.
loader> unload
loader> load net0:/boot/kernel/kernel
Waiting for Ethernet connection... done.
Waiting for Ethernet connection... done.
net0:/boot/kernel/kernel data=0x38fcf8+0x20544 syms=[0x4+0x7e000+0x4+0x60b52]
loader> boot
fdt_start: 0x00468B50
Kernel entry at 0x100100...
Kernel args: (null)
KDB: debugger backends: ddb
KDB: current backend: ddb
Copyright (c) 1992-2012 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 10.0-CURRENT #32 r244563M: Tue Dec 25 15:46:23 MST 2012
    ilepore at revolution.hippie.lan:/local/build/staging/freebsd/rpi10/obj/arm.armv6/local/build/staging/freebsd/rpi10/src/sys/RPI-B-serial arm
CPU: ARM1176JZ-S rev 7 (ARM11J core)
 Supported features: ARM_ISA THUMB2 JAZELLE ARMv4 Security_Ext
 WB enabled LABT branch prediction enabled
  16KB/32B 4-way instruction cache
  16KB/32B 4-way write-back-locking-C data cache
real memory  = 134217728 (128 MB)
avail memory = 124751872 (118 MB)
random device not loaded; using insecure entropy
simplebus0: <Flattened device tree simple bus> mem 0xf2000000-0xf2ffffff on fdtbus0
intc0: <BCM2835 Interrupt Controller> mem 0xf200b200-0xf200b3ff on simplebus0
systimer0: <BCM2835 System Timer> mem 0xf2003000-0xf2003fff irq 8,9,10,11 on simplebus0
Event timer "BCM2835 Event Timer 3" frequency 1000000 Hz quality 1000
Timecounter "BCM2835 Timecounter" frequency 1000000 Hz quality 1000
sdhci_bcm0: <Broadcom 2708 SDHCI controller> mem 0xf2300000-0xf23000ff irq 70 on simplebus0
bcm_sdhci_attach(): SDHCI frequency: 50MHz
mmc0: <MMC/SD bus> on sdhci_bcm0
mbox0: <BCM2835 VideoCore Mailbox> mem 0xf200b880-0xf200b8bf irq 1 on simplebus0
mbox0: [GIANT-LOCKED]
bcmwd0: <BCM2708/2835 Watchdog> mem 0xf210001c-0xf2100027 on simplebus0
gpio0: <BCM2708/2835 GPIO controller> mem 0xf2200000-0xf22000af irq 57,59,58,60 on simplebus0
gpio0: read-only pins: 46,47,48,49,50,51,52,53.
gpio0: reserved pins: 48,49,50,51,52,53.
gpioc0: <GPIO controller> on gpio0
gpiobus0: <GPIO bus> on gpio0
uart0: <PrimeCell UART (PL011)> mem 0xf2201000-0xf2201fff irq 65 on simplebus0
uart0: console (115200,n,8,1)
dwcotg0: <DWC OTG 2.0 integrated USB controller> mem 0xf2980000-0xf299ffff irq 17 on simplebus0
usbus0 on dwcotg0
Timecounters tick every 10.000 msec
usbus0: 480Mbps High Speed USB v2.0
ugen0.1: <DWCOTG> at usbus0
uhub0: <DWCOTG OTG Root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
uhub0: 1 port with 1 removable, self powered
mmcsd0: 1886MB <SD SD02G 8.0 SN 32334986 MFG 05/2010 by 3 SD> at mmc0 25.0MHz/4bit/65535-block
bootpc_init: wired to interface 'ue0'
ugen0.2: <vendor 0x0424> at usbus0
uhub1: <vendor 0x0424 product 0x9512, class 9/0, rev 2.00/2.00, addr 2> on usbus0
uhub1: MTT enabled
uhub1: 3 ports with 2 removable, self powered
ugen0.3: <vendor 0x0424> at usbus0
smsc0: <vendor 0x0424 product 0xec00, rev 2.00/2.00, addr 3> on usbus0
getting fdt mac addr, err=0
smsc0: got mac address 00:00:00:00:00:00
smsc0: setting mac address to 06:f3:7e:bb:29:fc
smsc0: chip 0xec00, rev. 0002
miibus0: <MII bus> on smsc0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on smsc0
ue0: Ethernet address: 06:f3:7e:bb:29:fc
smsc0: setting mac address to 06:f3:7e:bb:29:fc
smsc0: chip 0xec00, rev. 0002
ue0: link state changed to DOWN
Sending DHCP Discover packet from interface ue0 (06:f3:7e:bb:29:fc)
ue0: link state changed to UP
ugen0.4: <SSI Computer corp> at usbus0
umass0: <MSC Bulk-Only Transfer> on usbus0
umass0:  SCSI over Bulk-Only; quirks = 0x4101
umass0:0:0:-1: Attached to scbus0
da0 at umass-sim0 bus 0 scbus0 target 0 lun 0
da0: <M4-CT128 M4SSD2 > Fixed Direct Access SCSI-2 device 
da0: 40.000MB/s transfers
da0: 122104MB (250069680 512 byte sectors: 255H 63S/T 15566C)
Received DHCP Offer packet on ue0 from 0.0.0.0 (accepted) (no root path)
Sending DHCP Request packet from interface ue0 (06:f3:7e:bb:29:fc)
Received DHCP Ack packet on ue0 from 0.0.0.0 (accepted) (no root path)
Received DHCP Ack packet on ue0 from 0.0.0.0 (accepted) (no root path)

-- Ian




More information about the freebsd-arm mailing list