Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2010 16:33:12 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        alancyang@gmail.com
Cc:        freebsd-mips@freebsd.org
Subject:   Re: Cavium port
Message-ID:  <20100121.163312.886429907199307448.imp@bsdimp.com>
In-Reply-To: <290865fd1001211445n1b469e11o2f37598c989dbaf7@mail.gmail.com>
References:  <290865fd1001051526i73dd96d7x18a7a842b903b61d@mail.gmail.com> <4B4433ED.10103@mahan.org> <290865fd1001211445n1b469e11o2f37598c989dbaf7@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <290865fd1001211445n1b469e11o2f37598c989dbaf7@mail.gmail.com>
            alan yang <alancyang@gmail.com> writes:
: I try to make rootfs on CF, with kernel that oeteon eval board u-boot
: fatload could load the kernel, and bootoctlinux could boot FreeBSD
: with root=CF device.  But it seems fatload needs msdos files system
: type that I don't know how to create it under FreeBSD.
: 
: Wonder could shed some light how to work around to make CF card with
: rootfs and kernel that would work.

I have a CF card that's 1GB in size.  It has two partitions on it.
One is a DOS FAT partition.  I put the kernels in here.  The other is
a big-endian UFS partition.  I use makefs to create an image of a
filesystem to use there.  The former partition is 100M, the latter is
900M.  Roughly speaking (since I haven't done this in a while):

setenv TARGET mips
setenv TARGET_BIG_ENDIAN t
make buildworld
make installworld DESTDIR=/staging/mips-be
make distib-dirs DESTDIR=/staging/mips-be
<create /etc/fstab, /etc/rc.conf, etc in staging area>
makefs -t ufs -B be -s 900m /staging/mips-be.img /staging/mips-be
<use fdisk to make slices, and disklabel to label but only once>
dd if=/staging/mips-be.img of=/dev/da0s2a

I then load the image off the CF.  I believe I have things hard-wired
in the kernel to being the CF card as root.

For a slightly older kernel than is checked in today.  Today's kernel
has some issues that I'm trying to track down...

U-Boot 1.1.1 (Development build) (Build time: Jan 26 2007 - 14:06:35)

EBT3000 board revision major:4, minor:0, serial #: 2006-4.0-xxxxx
OCTEON CN38XX-NSP revision: 1, Core clock: 500 MHz, DDR clock: 266 MHz (532 Mhz data rate)
DRAM:  2048 MB
Flash:  8 MB
IPD backpressure workaround verified, took 14 loops
Clearing DRAM........ done
BIST check passed.
Net:   octeth0, octeth1, octeth2, octeth3
 Bus 0 (CF Card): OK 

  ide 0: Model: SanDisk SDCFB-1024 Firm: Rev 0.00 Ser#: X0308 20050726142909
            Type: Removable Hard Disk
            Capacity: 977.4 MB = 0.9 GB (2001888 x 512)
Octeon ebt3000# fatload ide 0 a800000 kernel.imp
reading kernel.imp

4597756 bytes read
Octeon ebt3000# boot
Unknown command 'boot' - try 'help'
Octeon ebt3000# bootoctlinux a800000 numcores=1
argv[2]: numcores=1
ELF file is 32 bit
Skipping non LOAD program header (type 0x6)
Skipping non LOAD program header (type 0x3)
Skipping non LOAD program header (type 0x70000000)
Allocated memory for ELF segment: addr: 0x1000000, size 0x3ab060
Loading .text @ 0x81000000 (3203072 bytes)
Loading .MIPS.stubs @ 0x8130e000 (16 bytes)
Loading .rodata @ 0x81310000 (38304 bytes)
Loading .reginfo @ 0x813195a0 (24 bytes)
Loading .rodata.str1.4 @ 0x813195b8 (139791 bytes)
Loading set_sysctl_set @ 0x8133b7c8 (3748 bytes)
Loading set_sysinit_set @ 0x8133c66c (1736 bytes)
Loading set_sysuninit_set @ 0x8133cd34 (1020 bytes)
Loading .interp @ 0x8133d130 (13 bytes)
Loading .dynsym @ 0x8133d140 (88208 bytes)
Loading .dynstr @ 0x813529d0 (83312 bytes)
Loading .hash @ 0x81366f40 (38456 bytes)
Loading .rld_map @ 0x813928dc (4 bytes)
Clearing .bss @ 0x813928e0 (100224 bytes)
## Loading Linux kernel with entry point: 0x81000000 ...
Bootloader: Done loading app on coremask: 0x1

Platform Starting
Boot Descriptor Ver: 6 -> 1/2  CPU clock: 500MHz
  Dram: 2048 MB  Board Type: 2  Revision: 4/0
  Octeon Chip: 0  Rev 0/0  Mac Address 00.0F.B7.10.1B.32
config flags:0x8
 Initialized memory: 0x0x813928e0  to  0x813AC000
entry: mips_init()
cpu:0 Cvm mem-ctl is: 0x20046104
cpu:0 Cvm mem-ctl is: 0x200461C4
mips_rd_ebase 80001000
mips_rd_ebase 80000000
mips_rd_config 8000c48b
octeon_dram == 80000000
reduced to ram: 2048 MBReal memory bytes is 7ffff000
phys_avail[0] = 13ac000 phys_avail[1] = fffffff
realmem_bytes is now at 5ffff000
Next block of memory goes from 20000000 to 7ffff000

Code: _start 0x81000000  _end 0x813AB060
Total DRAM Size 0x80000000
Bank 0 = 0x 13AC000   ->  0x FFFFFFF
Bank 1 = 0x20000000   ->  0x7FFFF000

physmem: 0x6ec53  picache_stride    = 4096
  picache_loopcount = 8
  pdcache_stride    = 128
  pdcache_loopcount = 64
Va=0xc0002000 Ve=ffffc000
init kernel_segmap va >> = 768 nkpt:256
avail_start:0x14c0000 avail_end:0x7ffff000
KDB: debugger backends: ddb
KDB: current backend: ddb
hz=100 cyl_per_hz:500000 cyl_per_usec:500 freq:500000000 cyl_per_hz:5000000 cyl_per_sec:500000000
Doing mips rd cnt:576bcdd7
Shadow was c000000f
Shadow enabled not set to f
new cnt 579f6899
Copyright (c) 1992-2008 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 8.0-CURRENT #3: Fri Nov 28 22:15:29 MST 2008
    imp@paco-paco.bsdimp.com:/tmp/imp/objBE/mips/pe/imp/svn/head/sys/OCTEON_rrs
FreeBSD 8.0-CURRENT #3: Fri Nov 28 22:15:29 MST 2008
    imp@paco-paco.bsdimp.com:/tmp/imp/objBE/mips/pe/imp/svn/head/sys/OCTEON_rrs
real memory  = 1858416640 (1814860K bytes)
avail memory = 1812066304 (1728MB)
nexus0: <MIPS32 root nexus>
Compact flash found in bootbus region 3 (8 bit)
...
Timecounter "MIPS32" frequency 500000000 Hz quality 800
Timecounters tick every 10.000 msec
Trying to mount root from ufs:cf0s2a
WARNING: / was not properly dismounted
warning: no time-of-day clock registered, system time will not be set accurately
No suitable dump device was found.
Entropy harvesting: interrupts ethernet point_to_point kickstart.
/dev/cf0s2a: 10920 files, 262274 used, 555229 free (589 frags, 69330 blocks, 0.1% fragmentation)
...

login: root

# df
Filesystem  1K-blocks   Used  Avail Capacity  Mounted on
/dev/cf0s2a    817503 262284 514344    34%    /
devfs               1      1      0   100%    /dev
# cat /etc/fstab
/dev/ad0s2a / ufs rw 1 1
# 

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100121.163312.886429907199307448.imp>