2012-11-22

Setup FreeBSD to Efika MX (draft)

It's just my vision. So anyone who have better idea, please notify me about it and we will correct that document. Then I will reuse it to make "official" guide.

1. Invert all 4 swiches
smarttop - 4x DIP switch inside small window on bottom side (for debug board)
smartbook - 4x DIP switch under keyboard (remove/install keyboard with care)
2. Insert SD card (will prepare image for card when make sdhci works)
3. Power on device
it will do:
1. 1st uboot init mmc/SD subsystem
2. Find boot script on 1st FAT partition
3. Run script
4. Script load/run 2nd uboot
5. 2nd uboot init USB, SD, PATA
6. load/run ubldr
7. ubldr find UFS and load/run kernel
4. There must be customized bsdinstall, which must help to:
1. make FAT/EXTFS partition on PATA SSD
2. Install bootscript/uboot(second)/ubldr
3. Make his regular job to install distribution to UFS partition

(huh, enough for first time)

2012-11-13

Efika MX boot

<pre>
 U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)

CPU:   Freescale i.MX51 family 3.0V at 800 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: Efika MX Smartbook [POR]
PMIC ID: 0x000045d0 [Rev: 2.0a]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x1000 bytes] -> ram 0xafd006e8
SUCCESS

In:    serial
Out:   serial
Err:   serial
Boot Source: SPI NOR FLASH BOOT
Hit any key to stop autoboot:  0
JEDEC ID: 0xbf:0x25:0x4a
4096 KiB SST25VF032B - 4MB at 0:1 is now current device
Reading SPI NOR flash 0x100000 [0x50000 bytes] -> ram 0x97800000
.SUCCESS

## Starting application at 0x97800000 ...
                                         �
U-Boot 2012.04.01-g7862ffd-dirty (Aug 16 2012 - 16:53:57)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: Efika MX, rev1.3
DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0
SF: Detected SST25VF032B with page size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Efika> run bsd
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 4 USB Device(s) found
       scanning bus for storage devices... 1 Storage Device(s) found
       scanning bus for ethernet devices... 1 Ethernet Device(s) found
Waiting for Ethernet connection... done.
Using asx0 device
TFTP from server 192.168.10.90; our IP address is 192.168.10.87
Filename 'efika_mx/kernel.uboot'.
Load address: 0x91000000
Loading: T #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #######################################
done
Bytes transferred = 5337304 (5170d8 hex)
## Booting kernel from Legacy Image at 91000000 ...
   Image Name:   FreeBSD kernel
   Created:      2012-11-13  15:39:05 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    5337240 Bytes = 5.1 MiB
   Load Address: 90100000
   Entry Point:  90100100
   Verifying Checksum ... OK
   Loading Kernel Image ... OK
OK

Starting kernel ...

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 #229 r242977:242979: Tue Nov 13 17:38:46 EET 2012
    ray@terran.dlink.ua:/usr/obj/arm.armv6/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/sys/EFIKA_MX arm
Preloaded elf kernel "kernel" at 0xc05342d0.
CPU: Cortex A8-r2 rev 5 (Cortex-A core)
 Supported features: ARM_ISA THUMB2 JAZELLE THUMBEE ARMv4 Security_Ext
 WB disabled EABT branch prediction enabled
LoUU:2 LoC:2 LoUIS:1
Cache level 1:
 32KB/64B 4-way data cache WT WB Read-Alloc
 32KB/64B 4-way instruction cache Read-Alloc
Cache level 2:
 256KB/64B 8-way unified cache WT WB Read-Alloc Write-Alloc
real memory  = 536870912 (512 MB)
Physical memory chunk(s):
0x90000000 - 0x900fffff, 1048576 bytes (256 pages)
0x905eb000 - 0xaf629fff, 520351744 bytes (127039 pages)
avail memory = 519168000 (495 MB)
random device not loaded; using insecure entropy
wlan: <802.11 Link Layer>
null: <null device, zero device>
openfirm: <Open Firmware control device>
random: <entropy source, Software, Yarrow>
mem: <memory>
nfslock: pseudo-device
fdtbus0: <FDT main bus>
simplebus0: <Flattened device tree simple bus> on fdtbus0
tzic0: <TrustZone Interrupt Controller> mem 0xcffc7000-0xcffcafff on simplebus0
simplebus1: <Flattened device tree simple bus> on fdtbus0
simplebus2: <Flattened device tree simple bus> on simplebus1
imxccm0: <Freescale Clock Control Module> mem 0xe3fd4000-0xe3fd7fff,0xcffcb000-0xcffcefff,0xcffcf000-0xcffd2fff,0xcffd3000-0xcffd6fff irq 71,72 on simplebus2
imxccm0: PLL1=800MHz, PLL2=665MHz, PLL3=216MHz
imxccm0: CPU clock=800000000, UART clock=66500000
imxccm0: mainbus clock=665000000, ahb clock=133000000 ipg clock=66500000 perclk=2000000
simplebus3: <Flattened device tree simple bus> on simplebus2
ehci0: <Freescale integrated USB controller> mem 0xe3f80000-0xe3f83fff irq 14,16,17,18 on simplebus2
ehci0: [GIANT-LOCKED]
usbus0: EHCI version 1.0
usbus0 on ehci0
ehci0: usbpf: Attached
imx_gpt0: <Freescale i.MXxxx GPT timer> mem 0xe3fa0000-0xe3fa3fff irq 39 on simplebus2
imx_gpt0: Run on 66500KHz clock.
Event timer "i.MXxxx GPT Eventtimer" frequency 66500000 Hz quality 1000
Timecounter "i.MX GPT Timecouter" frequency 66500000 Hz quality 1000
clock: hz=100 stathz = 0
imx_gpt0: timer clock frequency 66500000
uart0: <imx_uart> mem 0xe3fbc000-0xe3fbffff irq 31 on simplebus2
uart0: fast interrupt
uart0: console (115200,n,8,1)
simplebus4: <Flattened device tree simple bus> on simplebus1
atapci0: <Freescale Integrated PATA Controller> mem 0xcffef000-0xcfff2fff irq 70 on simplebus4
ata2: <ATA channel> at channel 0 on atapci0
imx_gpt0: switch DELAY to use H/W counter
Timecounters tick every 10.000 msec
lo0: bpf attached
usbus0: 480Mbps High Speed USB v2.0
ata2: reset tp1 mask=01 ostat0=d0 ostat1=00
ata2: stat0=0x50 err=0x01 lsb=0x00 msb=0x00
ata2: reset tp2 stat0=50 stat1=00 devices=0x1
ugen0.1: <Freescale> at usbus0
uhub0: <Freescale EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
ada0 at ata2 bus 0 scbus0 target 0 lun 0
ada0: <SanDisk pSSD-P2 8GB SSD 5.20> ATA-8 device
ada0: Serial Number CFZ071510001526
ada0: 16.700MB/s transfers (PIO4, PIO 512bytes)
ada0: 7641MB (15649200 512 byte sectors: 16H 63S/T 15525C)
ada0: Previously was known as ad4
pass0 at ata2 bus 0 scbus0 target 0 lun 0
pass0: <SanDisk pSSD-P2 8GB SSD 5.20> ATA-8 device
pass0: Serial Number CFZ071510001526
pass0: 16.700MB/s transfers (PIO4, PIO 512bytes)
GEOM: new disk ada0
Root mount waiting for: usbus0
uhub0: 1 port with 1 removable, self powered
Root mount waiting for: usbus0
ugen0.2: <vendor 0x1a40> at usbus0
uhub1: <vendor 0x1a40 USB 2.0 Hub MTT, class 9/0, rev 2.00/1.00, addr 2> on usbus0
uhub1: MTT enabled
Root mount waiting for: usbus0
uhub1: 4 ports with 4 removable, self powered
Root mount waiting for: usbus0
ugen0.3: <Kingston> at usbus0
umass0: <Kingston DT 101 II, class 0/0, rev 2.00/1.10, addr 3> on usbus0
umass0:1:0:-1: Attached to scbus1
(probe0:umass-sim0:0:0:0): Down reving Protocol Version from 2 to 0?
pass1 at umass-sim0 bus 0 scbus1 target 0 lun 0
pass1: <Kingston DT 101 II PMAP> Removable Direct Access SCSI-0 device
pass1: Serial Number 0019E00149F7B9B1E000010C
pass1: 40.000MB/s transfers
da0 at umass-sim0 bus 0 scbus1 target 0 lun 0
da0: <Kingston DT 101 II PMAP> Removable Direct Access SCSI-0 device
da0: Serial Number 0019E00149F7B9B1E000010C
da0: 40.000MB/s transfers
da0: 3827MB (7837696 512 byte sectors: 255H 63S/T 487C)
GEOM: new disk da0
Root mount waiting for: usbus0
ugen0.4: <vendor 0x2001> at usbus0
axe0: <vendor 0x2001 product 0x3c05, rev 2.00/0.01, addr 4> on usbus0
axe0: PHYADDR 0xe0:0x03

Loader variables:

Manual root filesystem specification:
  <fstype>:<device> [options]
      Mount <device> using filesystem <fstype>
      and with the specified (optional) option list.

    eg. ufs:/dev/da0s1a
        zfs:tank
        cd9660:/dev/acd0 ro
          (which is equivalent to: mount -t cd9660 -o ro /dev/acd0 /)

  ?               List valid disk boot devices
  .               Yield 1 second (for background tasks)
  <empty line>    Abort manual input

mountroot> ufs:/dev/da0s1a ro
Trying to mount root from ufs:/dev/da0s1a [ro]...
warning: no time-of-day clock registered, system time will not be set accurately
start_init: trying /sbin/init
miibus0: <MII bus> on axe0
rlphy0: <IP101 10/100 PHY> PHY 3 on miibus0
rlphy0: OUI 0x0009c3, model 0x0005, rev. 4
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ue0: <USB Ethernet> on axe0
ue0: bpf attached
ue0: Ethernet address: 00:80:c8:3b:cf:91
Setting hostuuid: 0d74d9c5-da2f-11e1-b9b6-8a3af74f1c98.
Setting hostid: 0x1a7a9414.
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_pointsha256: /kernel: No such file or directory
 kickstart.
Starting file system checks:
/dev/da0s1a: FILE SYSTEM CLEAN; SKIPPING CHECKS
/dev/da0s1a: clean, 1456070 free (2750 frags, 181665 blocks, 0.1% fragmentation)
Mounting local file systems:.
Writing entropy file:.
Setting hostname: efikamx.
ue0: link state changed to DOWN
Starting Network: lo0 ue0.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 00:80:c8:3b:cf:91
        inet 192.168.10.87 netmask 0xffffff00 broadcast 192.168.10.255
        media: Ethernet autoselect (none)
        status: no carrier
Starting devd.
ue0: link state changed to UP
Generating host.conf.
eval: cannot create /etc/host.conf: Read-only file system
eval: cannot create /etc/host.conf: Read-only file system
eval: cannot create /etc/host.conf: Read-only file system
Creating and/or trimming log files.
Starting syslogd.
realpath: /dev/dumpdev: No such file or directory
/etc/rc: WARNING: Dump device does not exist.  Savecore not run.
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
Clearing /tmp (X related).
Updating motd: /etc/motd is not writable, update failed.
Starting cron.
Starting inetd.
Starting background file system checks in 60 seconds.

Tue Nov 13 09:11:33 UTC 2012

FreeBSD/arm (efikamx) (ttyu0)

login: root
Nov 13 09:11:35 efikamx login: ROOT LOGIN (root) ON ttyu0
FreeBSD ?.?.?  (UNKNOWN)

Welcome to FreeBSD!

Before seeking technical support, please use the following resources:

o  Security advisories and updated errata information for all releases are
   at http://www.FreeBSD.org/releases/ - always consult the ERRATA section
   for your release first as it's updated frequently.

o  The Handbook and FAQ documents are at http://www.FreeBSD.org/ and,
   along with the mailing lists, can be searched by going to
   http://www.FreeBSD.org/search/.  If the doc package has been installed
   (or fetched via pkg install lang-freebsd-doc, where lang is the
   2-letter language code, e.g. en), they are also available formatted
   in /usr/local/share/doc/freebsd.

If you still have a question or problem, please take the output of
`uname -a', along with any relevant error messages, and email it
as a question to the questions@FreeBSD.org mailing list.  If you are
unfamiliar with FreeBSD's directory layout, please refer to the hier(7)
manual page.  If you are not familiar with manual pages, type `man man'.

Edit /etc/motd to change this login announcement.

root@efikamx:~ # ps -ax
PID TT  STAT    TIME COMMAND
  0  -  DLs  0:00.00 [kernel]
  1  -  SLs  0:02.82 /sbin/init --
  2  -  DL   0:00.00 [xpt_thrd]
  3  -  DL   0:00.00 [pagedaemon]
  4  -  DL   0:00.00 [vmdaemon]
  5  -  DL   0:00.00 [pagezero]
  6  -  DL   0:00.00 [bufdaemon]
  7  -  DL   0:00.00 [syncer]
  8  -  DL   0:00.00 [vnlru]
  9  -  DL   0:00.00 [softdepflush]
 10  -  RL   0:16.45 [idle]
 11  -  WL   0:00.23 [intr]
 12  -  DL   0:00.13 [geom]
 13  -  DL   0:00.00 [yarrow]
 14  -  DL   0:00.34 [usb]
 15  -  DL   0:00.00 [schedcpu]
276  -  Ss   0:00.00 /sbin/devd
354  -  Ss   0:00.04 /usr/sbin/syslogd -s
449  -  Ss   0:00.03 /usr/sbin/cron -s
465  -  Ss   0:00.00 /usr/sbin/inetd -wW -C 60
481 u0- S    0:00.00 sh /etc/rc autoboot
482 u0- S    0:00.01 logger -p daemon.notice -t fsck
484 u0- S    0:00.00 sleep 60
485 u0  Ss   0:00.06 login [pam] (login)
486 u0  R    0:00.08 -csh (csh)
488 u0  R+   0:00.01 ps -ax
root@efikamx:~ # ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=600003<RXCSUM,TXCSUM,RXCSUM_IPV6,TXCSUM_IPV6>
        inet 127.0.0.1 netmask 0xff000000
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=80008<VLAN_MTU,LINKSTATE>
        ether 00:80:c8:3b:cf:91
        inet 192.168.10.87 netmask 0xffffff00 broadcast 192.168.10.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
root@efikamx:~ # uname -a
FreeBSD efikamx 10.0-CURRENT FreeBSD 10.0-CURRENT #229 r242977:242979: Tue Nov 13 17:38:46 EET 2012     ray@terran.dlink.ua:/usr/obj/arm.armv6/usr/home/ray/work/FreeBSD/Projects/Efika_MX/src/efika_mx/sys/EFIKA_MX  arm
root@efikamx:~ # KDB: enter: Break to debugger
[ thread pid 10 tid 100002 ]
Stopped at      kdb_enter+0x48: ldrb    r15, [r15, r15, ror r15]!
db> c

root@efikamx:~ # reboot
Nov 13 09:11:52 efikamx reboot: rebooted by root
Nov 13 09:11:52 efikamx syslogd: exiting on signal 15
Waiting (max 60 seconds) for system process `vnlru' to stop...done
Waiting (max 60 seconds) for system process `bufdaemon' to stop...done
Waiting (max 60 seconds) for system process `syncer' to stop...
Syncing disks, vnodes remaining...0 0 done
All buffers synced.
Uptime: 47s
Rebooting...
�eset ...

U-Boot 2009.01.2.0.6-efikasb (Nov 02 2010 - 09:58:13)

CPU:   Freescale i.MX51 family 3.0V at 800 MHz
mx51 pll1: 800MHz
mx51 pll2: 665MHz
mx51 pll3: 216MHz
ipg clock     : 66500000Hz
ipg per clock : 665000000Hz
uart clock    : 66500000Hz
cspi clock    : 54000000Hz
Board: Efika MX Smartbook [POR]
PMIC ID: 0x000045d0 [Rev: 2.0a]
DRAM:  512 MB
JEDEC ID: 0xbf:0x25:0x4a
Reading SPI NOR flash 0x40000 [0x1000 bytes] -> ram 0xafd006e8
SUCCESS

In:    serial
Out:   serial
Err:   serial
Boot Source: SPI NOR FLASH BOOT
Hit any key to stop autoboot:  0
JEDEC ID: 0xbf:0x25:0x4a
4096 KiB SST25VF032B - 4MB at 0:1 is now current device
Reading SPI NOR flash 0x100000 [0x50000 bytes] -> ram 0x97800000
.SUCCESS

## Starting application at 0x97800000 ...
                                         �
U-Boot 2012.04.01-g7862ffd-dirty (Aug 16 2012 - 16:53:57)

CPU:   Freescale i.MX51 rev3.0 at 800 MHz
Reset cause: POR
Board: Efika MX, rev1.3
DRAM:  512 MiB
WARNING: Caches not enabled
MMC:   FSL_SDHC: 0
SF: Detected SST25VF032B with page size 4 KiB, total 4 MiB
In:    serial
Out:   serial
Err:   serial
Net:   CPU Net Initialization Failed
No ethernet found.
Efika>

</pre>

Поиск по этому блогу

Readers