2011年12月21日 星期三

gcc-4.5.2 regression test

1) Compile zlib-1.2.3
(x86)
./configure --prefix=/home/user/mingfeng_wu/installed/zlib
make clean
make
make install

(ARM)
./configure --prefix=/home/user/mingfeng_wu/installed/arm-uc-zlib

# !!!Modify Makefile manually
# -CC=gcc
# +CROSS=/home/user/mingfeng_wu/installed/crosstool-4.5.2/bin/arm-unknown-linux-uclibcgnueabi-
# +CC=$(CROSS)gcc
# -LDSHARED=gcc
# -CPP=gcc -E
# +LDSHARED=$(CROSS)gcc
# +CPP=$(CROSS)gcc -E
# -AR=ar rc
# +AR=$(CROSS)ar rc
# -RANLIB=ranlib
# +RANLIB=$(CROSS)ranlib

make clean
make
make install

2) Compile openssl-1.0.0d
(x86)
./Configure --prefix=/home/user/mingfeng_wu/installed/openssl os/compiler:gcc

make clean
make
make install

(ARM)
./Configure --prefix=/home/user/mingfeng_wu/installed/arm-uc-openssl os/compiler:arm-unknown-linux-uclibcgnueabi-gcc

make clean
make
make install

3) Compile openssh-5.9p1

Modify sshd_config with "Subsystem       sftp    /usr/local/libexec/sftp-server"

(x86)
./configure --prefix=/home/user/mingfeng_wu/installed/openssh \
            --with-libs \
            --with-zlib=/home/user/mingfeng_wu/installed/zlib \
            --with-ssl-dir=/home/user/mingfeng_wu/installed/openssl \
            --disable-etc-default-login \
            CC=gcc \
            AR=ar \
            RANLIB=ranlib

make clean
make
make install

(ARM)
./configure --host=arm-unknown-linux-uclibcgnueabi \
            --with-libs \
            --with-zlib=/home/user/mingfeng_wu/installed/arm-uc-zlib \
            --with-ssl-dir=/home/user/mingfeng_wu/installed/arm-uc-openssl \
            --disable-etc-default-login \
       CC=arm-unknown-linux-uclibcgnueabi-gcc \
       AR=arm-unknown-linux-uclibcgnueabi-ar \
       RANLIB=arm-unknown-linux-uclibcgnueabi-ranlib

make clean
make

/home/user/mingfeng/installed/crosstool-4.5.2/bin/arm-linux-strip scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan sftp-server ssh-key
sign sshd

4) readme.ssh-transparent-login
1. Generate on your LOCAL machine a keypair with:

# ssh-keygen -t rsa (dont type in any password, just keep hitting enter) .

This will generate public/private rsa key pair in the directory of /root/.ssh:

/root/.ssh/id_rsa            (private key)

/root/.ssh/id_rsa.pub        (public key)

2. Make sure your private key resides under /root/.ssh on your LOCAL machine.

3. Also transfer the PRIVATE key to the machine which you want to automatically

login to. Put it under the directory /usr/local/etc.

4. Transfer the PUBLIC key to the machine which you want to automatically login to.

  Under the directory /root/.ssh (create it if necessary) concatenate your public key

with the file authorized_keys (create file if needed) .

5. Make sure the authorized_keys on the REMOTE machine is not read or modifiable by

group or others by doing chmod 700 /root/.ssh/authorized_keys.

6. Make sure the /root/.ssh directory on the REMOTE machine is not read or modifiable

by group or others by doing chmod 700 /root/.ssh

7. You may need to enable empty password authentication (need root access) on the

REMOTE machine in the config file sshd_config. Make "Permitemptypasswords yes".

You also need to modify "Protocol 2,1" to "Protocol 2" and modify "HostKey

/etc/ssh/ssh_host_rsa_key" to "/usr/local/etc/id_rsa". Please refer to the attached.

8. Restart /usr/local/sbin/sshd daemon on REMOTE, and you can automatically login with

ssh/sftp without password on LOCAL.

5) gcc-4.5.2-no-mtune-sshscp.exp
# Board definition file for board "myboard_sshscp"
# How to compile C programs for this board
set_board_info compiler /home/user/mingfeng_wu/installed/crosstool-4.5.2/bin/arm-unknown-linux-uclibcgnueabi-gcc
set_board_info cflags ""

# Network address of board
set_board_info hostname 172.18.116.241

# How to log into this board via ssh and copy files via scp.
# Ideally, you'll set it up to not need a password to log in via ssh
# (see e.g. http://www-csli.stanford.edu/semlab/muri/system/howto/ssh.html).
set_board_info username root

#set_board_info shell_prompt    "[root@platform]#"
# For DejaGnu 1.4.3 and above; DejaGnu 1.4.2.x (Debian 3.0) ignores these settings!
set_board_info rsh_prog /usr/bin/ssh
set_board_info rcp_prog /usr/bin/scp

6) test_installed.remote
#! /bin/sh

# (C) 1998, 2000, 2002, 2003, 2007 Free Software Foundation
# Originally by Alexandre Oliva <oliva@dcc.unicamp.br>

# This script is Free Software, and it can be copied, distributed and
# modified as defined in the GNU General Public License.  A copy of
# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html

# This scripts assumes it lives in the contrib directory of the GCC
# source tree, so it will find the testsuite tree from its location.
# If you move it elsewhere, or want to use another testsuite tree, you
# can override the defaults with --srcdir=/some/dir/GCC or
# --testsuite=/some/dir/GCC/gcc/testsuite.  If you specify
# --testsuite, --srcdir will be ignored; otherwise, `/gcc/testsuite'
# will be appended to the srcdir.

# You may specify where the binaries to be tested should be picked up
# from.  If you specify --prefix=/some/dir, gcc, g++ and gfortran will be
# looked for at /some/dir/bin.  Each one may be overridden by
# specifying --with-gcc=/pathname/to/gcc, --with-g++=/pathname/to/g++
# and --with-gfortran=/pathname/to/gfortran.  If you specify --without-gcc,
# --without-g++ or --without-gfortran, the test for the specified program
# will be skipped.  By default, gcc, g++ and gfortran will be searched in
# the PATH.

# An additional argument may specify --tmpdir=/some/dir; by default,
# temporaries will be stored in the current directory, where the log
# files will be stored.

# The script will interpret arguments until it finds one it does not
# understand.  The remaining ones will be passed to `runtest'.  A
# double-dash can be used to explicitly separate the arguments to
# `test_installed' from the ones to `runtest'.

# This script should be run in an empty directory; it will refuse to
# run if it finds a file named site.exp in the current directory.


if test -f site.exp; then
    echo site.exp already exists >&2
    exit 1
fi

while true; do
  case "$1" in
  --with-testsuite=*) testsuite=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --srcdir=*) srcdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;

  --prefix=*) prefix=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-gcc=*) GCC_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-g++=*) GXX_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --with-gfortran=*) GFORTRAN_UNDER_TEST=`echo "$1" | sed 's/[^=]*=//'`; shift;;
  --without-gcc) GCC_UNDER_TEST=no; shift;;
  --without-g++) GXX_UNDER_TEST=no; shift;;
  --without-gfortran) GFORTRAN_UNDER_TEST=no; shift;;
  --without-objc) OBJC_UNDER_TEST=no; shift;;

  --tmpdir=*) tmpdir=`echo "$1" | sed 's/[^=]*=//'`; shift;;

  --help) cat <<\EOF
Runs the testsuite for an installed version of gcc/g++/gfortran/objc
Copyright (C) 1998  Free Software Foundation
by Alexandre Oliva <oliva@dcc.unicamp.br>

Supported arguments:

--help                        prints this page

--with-testsuite=/some/dir/gcc/testsuite   specify the testsuite directory
--srcdir=/some/dir            same as --with-testsuite=/some/dir/gcc/testsuite
                              [deduced from shell-script pathname]

--prefix=/some/dir            use gcc, g++ and gfortran from /some/dir/bin [PATH]
--with-gcc=/some/dir/bin/gcc  use specified gcc program [gcc]
--with-g++=/some/dir/bin/g++  use specified g++ program [g++]
--with-gfortran=/some/dir/bin/gfortran  use specified gfortran program [gfortran]
--without-gcc                 do not run gcc testsuite
--without-g++                 do not run g++ testsuite
--without-gfortran            do not run gfortran testsuite
--without-objc                do not run objc testsuite

--tmpdir=/some/dir            create temporaries and leave failed programs
                              at specified directory [.]

--   end of argument list; following arguments are passed to runtest
EOF
    exit
  ;;

  --) shift; break;;
  *) break;;
  esac
done

if test x"${testsuite+set}" != x"set" && test x"${srcdir+set}" != x"set"; then
  file=$0
  while [ -h $file ]; do
    file=`ls -l $file | sed s/'.* -> '//`
  done
  srcdir=`CDPATH=. && cd \`echo "$file" | sed 's,/*[^/]*$,,;s,^$,.,'\`/.. >/dev/null && ${PWDCMD-pwd}`
fi

CROSS_COMPILE=arm-unknown-linux-uclibcgnueabi-

cat >site.exp <<EOF
lappend boards_dir "/root/toolchain/gcc-test"
lappend boards_dir "/usr/share/dejagnu"
set rootme "."
set tmpdir "${tmpdir-`${PWDCMD-pwd}`}"
set srcdir "${testsuite-${srcdir}/gcc/testsuite}"
set CFLAGS ""
set CXXFLAGS ""
set HOSTCC "cc"
set HOSTCFLAGS ""
set GCC_UNDER_TEST "${GCC_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gcc}"
set GXX_UNDER_TEST "${GXX_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}g++}"
set GFORTRAN_UNDER_TEST "${GFORTRAN_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gfortran}"
set OBJC_UNDER_TEST "${OBJC_UNDER_TEST-${prefix}${prefix+/bin/}${CROSS_COMPILE}gcc}"
set target_triplet arm-unknown-linux-uclibcgnueabi
set target_alias arm-none-linux-uclibcgnueabi
EOF

test x"${GCC_UNDER_TEST}" = x"no" || runtest --tool gcc ${1+"$@"}
test x"${GXX_UNDER_TEST}" = x"no" || runtest --tool g++ ${1+"$@"}
test x"${GFORTRAN_UNDER_TEST}" = x"no" || runtest --tool gfortran ${1+"$@"}
test x"${OBJC_UNDER_TEST}" = x"no" || runtest --tool objc ${1+"$@"}

exit 0

7) run-gcc-4.5.2-sshscp.sh
#!/bin/bash

# increase stack size to 64MB to prevent limits-exprparen.c from segmentation fault
ulimit -s 65536
DATE=`date +%Y%m%d`

GCC=/home/user/mingfeng_wu/installed/crosstool-4.5.2

REGRESSION=/home/user/mingfeng_wu/work/GCC
rm -rf $REGRESSION/gcc-regression-test-${DATE}
mkdir -p $REGRESSION/gcc-regression-test-${DATE}
cd $REGRESSION/gcc-regression-test-${DATE}

DEJAGNULIBS="/usr/share/dejagnu" sh $REGRESSION/gcc-4.5.2/contrib/test_installed.remote --srcdir=$REGRESSION/gcc-4.5.2 --without-gfortran --without-objc --wi
th-gcc=${GCC}/bin/arm-unknown-linux-uclibcgnueabi-gcc --with-g++=${GCC}/bin/arm-unknown-linux-uclibcgnueabi-g++ --target_board=gcc-4.5.2-no-mtune-sshscp


8) For arm-unknown-linux-uclibcgnueabi-* toolchain to run gcc regression test
[mingfeng, 2011-11-07]

In host-Linux (not embedded Linux):
1. Do ssh/sftp transparent login. Please see "readme.ssh-transparent-login".
2. Copy "gcc-4.5.2-sshscp.exp" to /usr/share/dejagnu.
3. Copy "test_installed.remote" to gcc-4.5.2/contrib/.
4. Run script file "run-gcc-4.5.2-sshscp.sh"
5. Generate log
   $ cd gcc-regression-test-20111107
   $ ../gcc-4.5.2/contrib/test_summary > gcc-4.5.2-test_summary.log

2011年12月13日 星期二

OProfile in Linux

### Build Oprofile ###

1) Get source package

http://oprofile.sourceforge.net/download/
oprofile-0.9.7.tar.gz

http://www.gnu.org/s/libiconv/#downloading
libiconv-1.13.1.tar.gz

http://www.gnu.org/s/gettext/#downloading
gettext-0.18.1.1.tar.gz

http://www.gnu.org/software/binutils/
binutils-2.22.tar.bz2

http://freecode.com/projects/popt
popt-1.14.tar.gz

# Note that we should build (and application would check) dynamic link library

2) Build libiconv-1.13.1

tar zxvf libiconv-1.13.1.tar.gz
mkdir build_libiconv
cd build_libiconv
../libiconv-1.13.1/configure --host=arm-unknown-linux-uclibcgnueabi --enable-shared --with-gnu-ld --prefix=/home/user/mingfeng_wu/installed/arm-uc-libiconv
make all install

3) Build gettext-0.18.1.1

tar zxvf gettext-0.18.1.1.tar.gz
cd gettext-0.18.1.1
patch -p1 < ../oprofile/gettext-spawn.patch
cd ..
mkdir build_gettext
cd build_gettext
../gettext-0.18.1.1/configure --host=arm-unknown-linux-uclibcgnueabi --enable-shared --with-gnu-ld --prefix=/home/user/mingfeng_wu/installed/arm-uc-gettext --with-libiconv-prefix=/home/user/mingfeng_wu/installed/arm-uc-libiconv
make
make install

4) Copy the libiconv.so library to GCC toolchain library (or certain path in LD_LIBRARY_PATH)
cp /home/user/mingfeng_wu/installed/arm-uc-libiconv/lib/libiconv.so.2.5.0 /home/user/mingfeng_wu/installed/crosstool-4.5.2/arm-unknown-linux-uclibcgnueabi/sysroot/lib/libiconv.so.2

5) Build binutils-2.22

tar xvjf /home/user/mingfeng_wu/src/GCC/binutils-2.22.tar.bz2
mkdir build_binutils
cd build_binutils
# need to --enable-shared, oprofile use libbfd.so
../binutils-2.22/configure --host=arm-unknown-linux-uclibcgnueabi --enable-shared --with-gnu-ld --enable-install-libbfd --prefix=/home/user/mingfeng_wu/installed/arm-uc-binutils
make
make install

6) Build popt-1.14

tar zxvf popt-1.14.tar.gz
cd popt-1.14
patch -p0 < popt_fix_va_copy.patch
mkdir build_popt
cd build_popt

ac_cv_va_copy=C99 ../popt-1.14/configure --host=arm-unknown-linux-uclibcgnueabi --enable-shared --disable-nls --with-gnu-ld --with-libiconv-prefix=/home/user/mingfeng_wu/installed/arm-uc-libiconv --prefix=/home/user/mingfeng_wu/installed/arm-uc-popt
make all install

7) Build oprofile

tar xvjf oprofile-0.9.7.tar.gz
cd oprofile-0.9.7
patch -p1 < ../oprofile/oprofile_remove_linux24_support.patch
cd ..
mkdir build_oprofile
cd build_oprofile
../oprofile-0.9.7/configure --host=arm-unknown-linux-uclibcgnueabi --with-binutils=/home/user/mingfeng_wu/installed/arm-uc-binutils --enable-dependency-tracking --enable-pch --enable-gcov --with-gnu-ld --with-kernel-support --with-linux=/home/user/mingfeng_wu/work/trunk/kernel/linux-2.6.35.12 --prefix=/home/user/mingfeng_wu/installed/arm-uc-oprofile --with-extra-libs=/home/user/mingfeng_wu/installed/arm-uc-popt/lib:/home/user/mingfeng_wu/installed/arm-uc-zlib/lib:/home/user/mingfeng_wu/installed/arm-uc-libiconv/lib:/home/user/mingfeng_wu/installed/arm-uc-gettext/lib:/home/user/mingfeng_wu/installed/arm-uc-binutils/lib --with-extra-includes=/home/user/mingfeng_wu/installed/arm-uc-binutils/include:/home/user/mingfeng_wu/installed/arm-uc-libiconv/include:/home/user/mingfeng_wu/installed/arm-uc-gettext/include:/home/user/mingfeng_wu/src/binutils-2.22/include:/home/user/mingfeng_wu/installed/arm-uc-popt/include
make
make install

### Build stage OK now, the following gives the patch ###
1) gettext-spawn.patch

--- a/gettext-tools/gnulib-lib/spawn.in.h    2010-11-18 19:49:42.424350565 +0300
+++ b/gettext-tools/gnulib-lib/spawn.in.h    2010-11-18 19:49:10.392349526 +0300
@@ -37,6 +37,10 @@
 # include <signal.h>
 #endif

+#ifdef __UCLIBC__
+# include <sched.h>
+#endif
+
 #include <sys/types.h>

 #ifndef __THROW


2) oprofile_remove_linux24_support.patch

diff -uNr oprofile-0.9.7/daemon.orig/Makefile.am oprofile-0.9.7/daemon/Makefile.am
--- oprofile-0.9.7/daemon.orig/Makefile.am    2011-12-12 09:56:12.513861000 +0800
+++ oprofile-0.9.7/daemon/Makefile.am    2011-12-12 09:57:06.264055000 +0800
@@ -1,4 +1,4 @@
-SUBDIRS = liblegacy .
+SUBDIRS = .

 oprofiled_SOURCES = \
     init.c \
@@ -49,7 +49,6 @@
 bin_PROGRAMS = oprofiled

 oprofiled_LDADD = \
-    liblegacy/liblegacy.a \
     ../libabi/libabi.a \
     ../libdb/libodb.a \
     ../libop/libop.a \
diff -uNr oprofile-0.9.7/daemon.orig/Makefile.in oprofile-0.9.7/daemon/Makefile.in
--- oprofile-0.9.7/daemon.orig/Makefile.in    2011-12-12 09:56:12.402971000 +0800
+++ oprofile-0.9.7/daemon/Makefile.in    2011-12-12 09:57:29.143153000 +0800
@@ -70,7 +70,7 @@
     opd_extended.$(OBJEXT) opd_ibs.$(OBJEXT) \
     opd_ibs_trans.$(OBJEXT)
 oprofiled_OBJECTS = $(am_oprofiled_OBJECTS)
-oprofiled_DEPENDENCIES = liblegacy/liblegacy.a ../libabi/libabi.a \
+oprofiled_DEPENDENCIES = ../libabi/libabi.a \
     ../libdb/libodb.a ../libop/libop.a ../libutil/libutil.a
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
 depcomp = $(SHELL) $(top_srcdir)/depcomp
@@ -285,7 +285,7 @@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 topdir = @topdir@
-SUBDIRS = liblegacy .
+SUBDIRS = .
 oprofiled_SOURCES = \
     init.c \
     oprofiled.c \
@@ -331,7 +331,6 @@
 # -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23
 AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer
 oprofiled_LDADD = \
-    liblegacy/liblegacy.a \
     ../libabi/libabi.a \
     ../libdb/libodb.a \
     ../libop/libop.a \
diff -uNr oprofile-0.9.7/daemon.orig/oprofiled.c oprofile-0.9.7/daemon/oprofiled.c
--- oprofile-0.9.7/daemon.orig/oprofiled.c    2011-12-12 09:56:12.388988000 +0800
+++ oprofile-0.9.7/daemon/oprofiled.c    2011-12-12 09:58:06.699559000 +0800
@@ -77,7 +77,6 @@
 static char * ext_feature;
 static int showvers;
 static struct oprofiled_ops * opd_ops;
-extern struct oprofiled_ops opd_24_ops;
 extern struct oprofiled_ops opd_26_ops;

 #define OPD_IMAGE_FILTER_HASH_SIZE 32
@@ -477,9 +476,6 @@
 static struct oprofiled_ops * get_ops(void)
 {
     switch (op_get_interface()) {
-        case OP_INTERFACE_24:
-            printf("Using 2.4 OProfile kernel interface.\n");
-            return &opd_24_ops;
         case OP_INTERFACE_26:
             printf("Using 2.6+ OProfile kernel interface.\n");
             return &opd_26_ops;


3) popt_fix_va_copy.patch

--- configure.ac.orig    2011-12-08 17:16:11.092076000 +0800
+++ configure.ac    2011-12-08 17:16:17.376785000 +0800
@@ -43,7 +43,6 @@

 AC_ISC_POSIX
 AM_C_PROTOTYPES
-AC_CHECK_VA_COPY

 AC_CHECK_HEADERS(float.h glob.h langinfo.h libintl.h mcheck.h unistd.h)


### Below shows how to run OProfile on target system ###

# In host Linux

1) Modify .config file of Linux kernel. Add:

CONFIG_PROFILING=y
CONFIG_OPROFILE=y
CONFIG_HAVE_OPROFILE=y

and add  "oprofile.timer=1" to CMDLINE, like the following:

CONFIG_CMDLINE="mem=64M console=ttyS0,115200 init=/init oprofile.timer=1"

# In target platform
1) Create the mtab file to /etc/mtab with the following contents

nodev /dev/oprofile oprofilefs rw 0 0

cp /mnt/arm-uc-oprofile/mtab /etc

1) Set binary and library path

export PATH=/mnt/arm-uc-oprofile/bin:$PATH
export LD_LIBRARY_PATH=/mnt/arm-uc-oprofile/lib:$LD_LIBRARY_PATH

2) Setup /dev/oprofile/*

mv /etc/mtab /etc/mtab1
/mnt/arm-uc-oprofile/bin/opcontrol --init
mv /etc/mtab1 /etc/mtab
/mnt/arm-uc-oprofile/bin/opcontrol --init

3) Set up path to Linux kernel image

/mnt/arm-uc-oprofile/bin/opcontrol --vmlinux=/mnt/trunk_ST58200/kernel/linux-2.6.35.12/vmlinux

4) Start profiling

/mnt/arm-uc-oprofile/bin/opcontrol --start

5) Do any thing you want to profile

6) Stop profiling

/mnt/arm-uc-oprofile/bin/opcontrol --stop

7) Read report
/mnt/arm-uc-oprofile/bin/opreport -l

2011年5月25日 星期三

Build WLAN driver and Android Filesystem

1) Patch

Because there are too many warnings when building WLAN drivers. So I turn off the -Werror command line option in the EXTRA_CFLAGS, like

EXTRA_CFLAGS += -fsigned-char
#EXTRA_CFLAGS += -fsigned-char -Werror

Modified files:
1. /opt/L27.12.1-P2/mydroid/hardware/ti/wlan/wl1283/stad/build/linux/common.inc
2. /opt/L27.12.1-P2/mydroid/hardware/ti/wlan/

2) Script used to build WLAN drivers and Android Filesystem

#!/bin/bash
MYDROID=/opt/L27.12.1-P2/mydroid

mkdir -p logs
export KERNEL_DIR=/opt/L27.12.1-P2/kernel/android-2.6.35

# Build 127x station driver
cd $MYDROID/hardware/ti/wlan/wl1283/platforms/os/linux
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TNETW=1273

# Build 127x softAp driver
cd $MYDROID/hardware/ti/wlan/wl1283_softAP/platforms/os/linux
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- TNETW=1273

cd $MYDROID
cp -Rfp device/ti/pandaboard/buildspec.mk.default buildspec.mk
#(required for rebuild only)
make clean
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- -j4 2>&1 |tee $MYDROID/logs/android_make.out

3) Finally, build errors

host StaticLib: libunz (out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/libunz.a)
echo out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/adler32.o out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/crc32.o out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/zutil.o out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/inflate.o out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/inftrees.o out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/inffast.o | xargs ar crsP  out/host/linux-x86/obj/STATIC_LIBRARIES/libunz_intermediates/libunz.a
host SharedLib: libfst (out/host/linux-x86/obj/lib/libfst.so)
host StaticLib: libtinyxml (out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/libtinyxml.a)
echo out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/tinyxml.o out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/tinyxmlparser.o out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/tinyxmlerror.o out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/tinystr.o | xargs ar crsP  out/host/linux-x86/obj/STATIC_LIBRARIES/libtinyxml_intermediates/libtinyxml.a
host Executable: adb (out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb)
/usr/bin/ld: skipping incompatible /usr/lib/libncurses.so when searching for -lncurses
/usr/bin/ld: skipping incompatible /usr/lib/libncurses.a when searching for -lncurses
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/adb_intermediates/adb] Error 1
make: *** Waiting for unfinished jobs....
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/aidl_intermediates/aidl] Error 1
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libESR_Portable.so] Error 1
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libfst.so] Error 1
mingfeng@mingfeng-desktop:/opt/L27.12.1-P2/mydroid$

Build linux kernel (android-2.6.35)

1) Script used to build android-2.6.35

#!/bin/bash
# build kernel image
mkdir -p ./logs

#"mkimage" is located in your u-boot/tools/ directory.
export PATH=/opt/L27.12.1-P2/u-boot/tools:$PATH

#(required for rebuild only)
make ARCH=arm distclean
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- CFLAGS="-march=armv7-a+sec" panda_defconfig
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage 2>&1 |tee ./logs/kernel_make.out

# build kernel modules
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- modules 2>&1 |tee ./logs/kernel_modules.out


2) Error

  CC      security/smc/omap4/scxlnx_device_mshield.o
In file included from security/smc/omap4/scxlnx_util.h:29:0,
                 from security/smc/omap4/scxlnx_device_mshield.c:38:
include/linux/pagemap.h: In function 'fault_in_pages_readable':
include/linux/pagemap.h:415:16: warning: variable 'c' set but not used [-Wunused-but-set-variable]
  AS      security/smc/omap4/bridge_pub2sec.o
security/smc/omap4/bridge_pub2sec.S: Assembler messages:
security/smc/omap4/bridge_pub2sec.S:95: Error: selected processor does not support ARM mode `smc #0'
make[3]: *** [security/smc/omap4/bridge_pub2sec.o] Error 1
make[2]: *** [security/smc/omap4] Error 2
make[1]: *** [security/smc] Error 2
make: *** [security] Error 2
mingfeng@mingfeng-desktop:/opt/L27.12.1-P2/kernel/android-2.6.35$


3) Patch

--- security/smc/omap4/bridge_pub2sec.S.orig    2011-05-25 20:24:21.649675315 +0800
+++ security/smc/omap4/bridge_pub2sec.S 2011-05-25 20:26:39.429877396 +0800
@@ -74,6 +74,7 @@
        b       label_smc

 label_smc:
+       .arch_extension sec
        INVALIDATE_BTB
        dsb
        dmb



4) Audio fixes for kernel
cd ${YOUR_PATH}/L27.12.1-P2/kernel/android-2.6.35
git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/01/13001/2 && git cherry-pick FETCH_HEAD
git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/02/13002/2 && git cherry-pick FETCH_HEAD


5) EHCI fixes for kernel
cd ${YOUR_PATH}/L27.12.1-P2/kernel/android-2.6.35
git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/17/13617/1 && git cherry-pick FETCH_HEAD


6) WLAN patches
Apply the following patches to enable wlan
cd ${YOUR_PATH}/L27.12.1-P2/kernel/android-2.6.35
git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/02/12002/2 && git cherry-pick FETCH_HEAD
git fetch http://review.omapzoom.org/p/kernel/omap refs/changes/03/12003/1 && git cherry-pick FETCH_HEAD



7) patch for panda_defconfig

diff --git a/arch/arm/configs/panda_defconfig b/arch/arm/configs/panda_defconfig
index 2adf851..9d574e1 100644
--- a/arch/arm/configs/panda_defconfig
+++ b/arch/arm/configs/panda_defconfig
@@ -290,7 +290,6 @@ CONFIG_OMAP_DM_TIMER=y
 # CONFIG_OMAP_PM_NONE is not set
 # CONFIG_OMAP_PM_NOOP is not set
 CONFIG_OMAP_PM=y
-CONFIG_OMAP_HDMI_AUDIO_WA=y

 #
 # OMAP Board Type
@@ -808,6 +807,7 @@ CONFIG_KERNEL_DEBUGGER_CORE=y
 # CONFIG_SENSORS_TSL2550 is not set
 # CONFIG_SENSORS_BH1780 is not set
 # CONFIG_SENSORS_AK8975 is not set
+# CONFIG_TWL6040_VIB is not set
 # CONFIG_CDC_TCXO is not set
 # CONFIG_DS1682 is not set
 # CONFIG_TI_DAC7512 is not set
@@ -830,7 +830,7 @@ CONFIG_UID_STAT=y
 #
 # Texas Instruments shared transport line discipline
 #
-CONFIG_TI_ST=m
+CONFIG_TI_ST=y
 CONFIG_HAVE_IDE=y
 # CONFIG_IDE is not set

@@ -888,7 +888,8 @@ CONFIG_KS8851=y
 # CONFIG_USB_KAWETH is not set
 # CONFIG_USB_PEGASUS is not set
 # CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
+CONFIG_USB_USBNET=y
+CONFIG_USB_NET_SMSC95XX=y
 # CONFIG_USB_HSO is not set
 # CONFIG_USB_IPHETH is not set
 # CONFIG_WAN is not set
@@ -1275,7 +1276,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # CONFIG_SSB is not set
 CONFIG_MFD_SUPPORT=y
-# CONFIG_MFD_CORE is not set
+CONFIG_MFD_CORE=y
 # CONFIG_MFD_88PM860X is not set
 # CONFIG_MFD_SM501 is not set
 # CONFIG_MFD_ASIC3 is not set
@@ -1291,7 +1292,7 @@ CONFIG_TWL4030_CORE=y
 CONFIG_TWL6030_PWM=y
 CONFIG_TWL6030_POWEROFF=y
 CONFIG_TWL6030_GPADC=y
-# CONFIG_TWL6040_CODEC is not set
+CONFIG_TWL6040_CODEC=y
 # CONFIG_MFD_TMIO is not set
 # CONFIG_MFD_T7L66XB is not set
 # CONFIG_MFD_TC6387XB is not set
@@ -1368,7 +1369,6 @@ CONFIG_VIDEO_HELPER_CHIPS_AUTO=y
 CONFIG_VIDEO_IR_I2C=y
 # CONFIG_VIDEO_VIVI is not set
 CONFIG_VIDEO_OMAP2_VOUT=y
-CONFIG_VIDEO_OMAP_GFX=m
 # CONFIG_VIDEO_SAA5246A is not set
 # CONFIG_VIDEO_SAA5249 is not set
 # CONFIG_SOC_CAMERA is not set
@@ -1553,7 +1553,49 @@ CONFIG_LOGO=y
 CONFIG_LOGO_LINUX_MONO=y
 CONFIG_LOGO_LINUX_VGA16=y
 CONFIG_LOGO_LINUX_CLUT224=y
-# CONFIG_SOUND is not set
+CONFIG_SOUND=y
+# CONFIG_SOUND_OSS_CORE is not set
+CONFIG_SND=y
+CONFIG_SND_TIMER=y
+CONFIG_SND_PCM=y
+CONFIG_SND_JACK=y
+# CONFIG_SND_SEQUENCER is not set
+# CONFIG_SND_MIXER_OSS is not set
+# CONFIG_SND_PCM_OSS is not set
+# CONFIG_SND_HRTIMER is not set
+CONFIG_SND_DYNAMIC_MINORS=y
+CONFIG_SND_SUPPORT_OLD_API=y
+CONFIG_SND_VERBOSE_PROCFS=y
+# CONFIG_SND_VERBOSE_PRINTK is not set
+# CONFIG_SND_DEBUG is not set
+# CONFIG_SND_RAWMIDI_SEQ is not set
+# CONFIG_SND_OPL3_LIB_SEQ is not set
+# CONFIG_SND_OPL4_LIB_SEQ is not set
+# CONFIG_SND_SBAWE_SEQ is not set
+# CONFIG_SND_EMU10K1_SEQ is not set
+CONFIG_SND_DRIVERS=y
+# CONFIG_SND_DUMMY is not set
+# CONFIG_SND_MTPAV is not set
+# CONFIG_SND_SERIAL_U16550 is not set
+# CONFIG_SND_MPU401 is not set
+CONFIG_SND_ARM=y
+CONFIG_SND_SPI=y
+CONFIG_SND_USB=y
+# CONFIG_SND_USB_AUDIO is not set
+# CONFIG_SND_USB_UA101 is not set
+# CONFIG_SND_USB_CAIAQ is not set
+CONFIG_SND_SOC=y
+CONFIG_SND_OMAP_SOC=y
+CONFIG_SND_OMAP_SOC_ABE_DSP=y
+CONFIG_SND_OMAP_SOC_MCBSP=y
+CONFIG_SND_OMAP_SOC_MCPDM=y
+CONFIG_SND_OMAP_SOC_ABE=y
+CONFIG_SND_OMAP_SOC_VXREC=y
+CONFIG_SND_OMAP_SOC_OMAP4_PANDA=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+# CONFIG_SND_SOC_ALL_CODECS is not set
+CONFIG_SND_SOC_TWL6040=y
+# CONFIG_SOUND_PRIME is not set
 CONFIG_HID_SUPPORT=y
 CONFIG_HID=y
 # CONFIG_HIDRAW is not set
@@ -1633,7 +1675,8 @@ CONFIG_USB_OTG=y
 # USB Host Controller Drivers
 #
 # CONFIG_USB_C67X00_HCD is not set
-# CONFIG_USB_EHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
 # CONFIG_USB_OXU210HP_HCD is not set
 # CONFIG_USB_ISP116X_HCD is not set
 # CONFIG_USB_ISP1760_HCD is not set

Build x-loader

1) Script used to build x-loader

#!/bin/bash
mkdir -p ./logs
make distclean  
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- CFLAGS="-Wa,-march=armv7-a+sec" omap4430panda_config
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- ift 2>&1 | tee ./logs/x-loader_make.out


2) Error

arm-none-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -c -o smc.o /opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S
/opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S: Assembler messages:
/opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S:40: Error: selected processor does not support ARM mode `smc #0'
make[1]: *** [smc.o] Error 1
make[1]: Leaving directory `/opt/L27.12.1-P2/x-loader/cpu/omap4'
make: *** [cpu/omap4/libomap4.a] Error 2
mingfeng@mingfeng-desktop:/opt/L27.12.1-P2/x-loader$

3) Patches

--- x-loader/cpu/omap4/smc.S.orig       2011-05-25 20:06:00.188059813 +0800
+++ x-loader/cpu/omap4/smc.S    2011-05-25 20:04:02.757887581 +0800
@@ -29,6 +29,7 @@
  * @arg: Argument passed to ROM api (input in r1 will move to r0) 
  */  
 .globl omap_smc_rom
+.arch_extension sec
 omap_smc_rom:
        push {r4-r11,lr}
        mov     r12,    r0

4) Build successfully

mingfeng@mingfeng-desktop:/opt/L27.12.1-P2/x-loader$ ls -la
總計 288
drwxr-xr-x 13 mingfeng mingfeng  4096 2011-05-25 20:09 .
drwxr-xr-x  6 mingfeng mingfeng  4096 2011-05-25 20:12 ..
-rw-r--r--  1 mingfeng mingfeng   908 2011-05-17 23:43 arm_config.mk
drwxr-xr-x 10 mingfeng mingfeng  4096 2011-05-17 23:43 board
-rwxr-xr-x  1 mingfeng mingfeng   242 2011-05-25 20:09 build.sh
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-25 20:08 common
-rw-r--r--  1 mingfeng mingfeng  5260 2011-05-17 23:43 config.mk
drwxr-xr-x  6 mingfeng mingfeng  4096 2011-05-17 23:43 cpu
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-25 20:08 disk
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-25 20:08 drivers
drwxr-xr-x  3 mingfeng mingfeng  4096 2011-05-17 23:43 fs
drwxr-xr-x  8 mingfeng mingfeng  4096 2011-05-17 23:43 .git
-rw-r--r--  1 mingfeng mingfeng   520 2011-05-17 23:43 .gitignore
drwxr-xr-x  5 mingfeng mingfeng  4096 2011-05-25 20:08 include
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-25 20:08 lib
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-18 22:17 logs
-rw-r--r--  1 mingfeng mingfeng  7529 2011-05-17 23:43 Makefile
-rwxr-xr-x  1 mingfeng mingfeng  1122 2011-05-17 23:43 mkconfig
-rw-r--r--  1 mingfeng mingfeng 21920 2011-05-25 20:08 MLO
-rw-r--r--  1 mingfeng mingfeng  3935 2011-05-17 23:43 README
drwxr-xr-x  2 mingfeng mingfeng  4096 2011-05-17 23:43 scripts
-rwxr-xr-x  1 mingfeng mingfeng  9642 2011-05-25 20:08 signGP
-rw-r--r--  1 mingfeng mingfeng  3279 2011-05-25 20:08 System.map
-rwxr-xr-x  1 mingfeng mingfeng 93779 2011-05-25 20:08 x-load
-rwxr-xr-x  1 mingfeng mingfeng 21400 2011-05-25 20:08 x-load.bin
-rw-r--r--  1 mingfeng mingfeng 21920 2011-05-25 20:08 x-load.bin.ift
-rw-r--r--  1 mingfeng mingfeng 29031 2011-05-25 20:08 x-load.map
mingfeng@mingfeng-desktop:/opt/L27.12.1-P2/x-loader$

2011年5月18日 星期三

Building u-boot and x-loader

Pre-requisite packages for build Android Filesystem (Note this is with reference to uBuntu 8.04)
If you are behind firewall, you will have to set-up firewall using the instructions in Support Tools
For higher versions of U-buntu please refer to Host PC COnfiguration
The following commands will install the correct packages to your server:
sudo apt-get install git-core flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev build-essential libstdc++5 tofrodos
sudo apt-get install x-dev (*** no files existing ***)
sudo apt-get install libx11-dev
sudo apt-get install libncurses5-dev
sudo apt-get install sun-java5-jdk (*** no files existing ***)

If you do not have sudo rights to your machine, contact your System Administrator for assistance. Google has issued that “sun-java6-jdk” has become unsupported: “because of incompatibilities with @Override” To uninstall “sun-java6-jdk” please type:
sudo apt-get remove sun-java6-jdk
“Intrepid (8.10) users may need a newer version of libreadline:
sudo apt-get install lib32readline5-dev” 
1) script used to build u-boot:
#!/bin/bash
make distclean
mkdir -p ./logs
make ARCH=arm omap4430panda_config
make 2>&1 |tee ./logs/u-boot_make.out
2) script used to build x-loader:
#!/bin/bash
mkdir -p ./logs
make distclean  
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- omap4430panda_config
make CROSS_COMPILE=arm-none-linux-gnueabi- ift 2>&1 |tee ./logs/x-loader_make.out
Finally, I built u-boot successfully, but there is an error when I
built the x-loader.
find . -type f \
                \( -name 'core' -o -name '*.bak' -o -name '*~' \
                -o -name '*.o'  -o -name '*.a'  \) -print \
                | xargs rm -f
find . -type f \
                \( -name .depend -o -name '*.srec' -o -name '*.bin' \) \
                -print \
                | xargs rm -f
rm -f cpu/omap4/start.o *.bak tags TAGS
rm -fr *.*~
rm -f x-load x-load.map x-load.bin System.map x-load.bin.ift signGP MLO
rm -f include/asm/proc include/asm/arch
rm -f include/config.h include/config.mk
rm -f include/config.h include/config.mk
Configuring for omap4430panda board...
echo "/* Generarated file. Do not edit */" >./include/config.h
echo "#include <configs/omap4430panda.h>" >>./include/config.h
MPU at 1GHz revision..
arm-none-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -c -o cpu/omap4/start.o /opt/L27.12.1-P2/x-loader/cpu/omap4/start.S
make -C `dirname board/omap4430panda/libomap4430panda.a`
make[1]: Entering directory `/opt/L27.12.1-P2/x-loader/board/omap4430panda'
arm-none-linux-gnueabi-gcc -M -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu  omap4430panda.c | \
                        sed -e "s/\:/\\\:/g"|sed -e "s/\\\: /\: /g"> .depend
make[1]: Leaving directory `/opt/L27.12.1-P2/x-loader/board/omap4430panda'
make[1]: Entering directory `/opt/L27.12.1-P2/x-loader/board/omap4430panda'
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o omap4430panda.o omap4430panda.c
arm-none-linux-gnueabi-ar crv libomap4430panda.a omap4430panda.o
a - omap4430panda.o
make[1]: Leaving directory `/opt/L27.12.1-P2/x-loader/board/omap4430panda'
make -C `dirname cpu/omap4/libomap4.a`
make[1]: Entering directory `/opt/L27.12.1-P2/x-loader/cpu/omap4'
arm-none-linux-gnueabi-gcc -M -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu platform.S smc.S cpu.c mmc.c sys_info.c clock.c sdram.c syslib.c sdram_elpida.c | \
                        sed -e "s/\:/\\\:/g"|sed -e "s/\\\: /\: /g"> .depend
make[1]: Leaving directory `/opt/L27.12.1-P2/x-loader/cpu/omap4'
make[1]: Entering directory `/opt/L27.12.1-P2/x-loader/cpu/omap4'
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o cpu.o cpu.c
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o mmc.o mmc.c
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o sys_info.o sys_info.c
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o clock.o clock.c
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o sdram.o sdram.c
sdram.c: In function 'emif_config':
sdram.c:116:26: warning: variable 'rev' set but not used [-Wunused-but-set-variable]
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o syslib.o syslib.c
arm-none-linux-gnueabi-gcc -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -Wall -Wstrict-prototypes -c -o sdram_elpida.o sdram_elpida.c
arm-none-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -c -o platform.o /opt/L27.12.1-P2/x-loader/cpu/omap4/platform.S
arm-none-linux-gnueabi-gcc -Wa,-gstabs -D__ASSEMBLY__ -g  -Os   -fno-strict-aliasing  -fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ -DTEXT_BASE=0x40304350 -I/opt/L27.12.1-P2/x-loader/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/build/arm-none-linux-gnueabi-4.6.0/lib/gcc/arm-none-linux-gnueabi/4.6.0/include -pipe  -DCONFIG_ARM -D__ARM__ -march=armv7-a -mabi=apcs-gnu -c -o smc.o /opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S
/opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S: Assembler messages:
/opt/L27.12.1-P2/x-loader/cpu/omap4/smc.S:39: Error: selected processor does not support ARM mode `smc #0'
 

2011年5月17日 星期二

Download Android/Linux kernel/U-Boot/X-loader source

Downloading Release Software

[Reference] http://www.omappedia.org/wiki/PandaBoard_L27.12.1-P2_Release_Notes

Installing repo

For detail information regarding repo visit: Using Repo and Git
Other reference links on Git can be found in Techincal References page
Download repo to environment
$ cd $YOUR_PATH/L27.12.1-P2/mydroid
$ curl http://android.git.kernel.org/repo > ./repo
$ chmod a+x repo

Download Android source

cd $YOUR_PATH/L27.12.1-P2/
cd $MYDROID
repo init -u git://git.omapzoom.org/platform/omapmanifest.git -b 27.x -m RLS27.12.1-P2_Gingerbread.xml
repo sync
Adding Mouse and Keyboard support
cd $MYDROID/frameworks/base
 git remote add rowboat git://gitorious.org/rowboat/frameworks-base.git
 git fetch rowboat
 git cherry-pick 17128d44ab04c5b7cb2911e8b1c9f837aa9b36a5
 git cherry-pick 174cb50436065dc092114d69fb40d5a7712e3ca0
Update PandaBoard device directory Update pandaboard device directory -- TODO: clean up and remove Blaze items
cd $MYDROID/device/ti/pandaboard
git fetch http://review.omapzoom.org/p/device/ti/pandaboard refs/changes/89/13489/1 && git cherry-pick FETCH_HEAD

Kernel & Driver Source

To clone kernel source from scratch do:
cd $YOUR_PATH/L27.12-P2/
git clone git://git.omapzoom.org/kernel/omap.git kernel/android-2.6.35
cd kernel/android-2.6.35
git checkout ec895072ad0b686d2c130e5d80a3076a03042033
If you already have kernel source cloned then just update it (and add a remote if it is the first time):
cd $YOUR_PATH/L27.12-P2/kernel/android-2.6.35
git fetch origin
git checkout ec895072ad0b686d2c130e5d80a3076a03042033

U-Boot Source

cd $YOUR_PATH/L27.12-P2/
git clone git://git.omapzoom.org/repo/u-boot.git u-boot
cd u-boot
git checkout 601ff71c8d46b5e90e13613974a16d10f2006bb3

X-loader Source

cd $YOUR_PATH/L27.12-P2/
git clone git://git.omapzoom.org/repo/x-loader.git x-loader
cd x-loader
git checkout c8855fa6b85bd44073bd1b25dbffa99f02cbeeed

2011年5月15日 星期日

Android Version Control with Repo and Git

Reference:
http://source.android.com/source/version-control.html

1) Download repo:
$ curl http://android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ set path to ~/bin/repo
 
2) Basic Workflow
The basic pattern of interacting with the repositories is as follows:
  1. Use repo start to start a new topic branch.
  2. Edit the files.
  3. Use git add to stage changes.
  4. Use git commit to commit changes.
  5. Use repo upload to upload changes to the review server.
 

GCC-4.6.0 build script for arm-none-eabi

#!/bin/bash
GCC_SRC=gcc-4.6.0
#HOST=i686-pc-linux-gnu
HOST=x86_64-linux-gnu
TARGET=arm-none-eabi
PREFIX=/opt/build/arm-none-eabi-${GCC_SRC}
DEFAULT_CPU=cortex-a9

cd /opt
mkdir -p build_binutils
cd build_binutils
../binutils-2.21/configure --build=${HOST} --host=${HOST} --target=${TARGET} --with-sysroot=${PREFIX}/${TARGET} --disable-nls --enable-install-libbfd --enable-interwork --with-v4bx-interworking --enable-lto --enable-multilib --enable-shared --enable-gmp --enable-mpfr --prefix=${PREFIX}
make all install

cd /opt
mkdir -p build_gcc
cd build_gcc

#mkdir -p mpfr
#cp ../${GCC_SRC}/gmp/gmp-impl.h mpfr/
#cp ../${GCC_SRC}/gmp/longlong.h mpfr/

../${GCC_SRC}/configure --build=${HOST} --host=${HOST} --target=${TARGET} --with-pkgversion='M.F. C/C++ Compiler Release 20110423' --disable-libssp --disable-nls --disable-libgomp --disable-threads --disable-tls --enable-lto --enable-multilib --enable-gmp --enable-mpfr --enable-cloog --enable-ppl --with-v4bx-interworking --enable-languages=c,c++ --enable-long-long --enable-c99 --enable-shared --with-float=hard --enable-cxx-flags=-mhard-float --with-cpu=${DEFAULT_CPU} --with-newlib --with-ld=${PREFIX}/bin/${TARGET}-ld --prefix=${PREFIX}
make all install

rm -rf build_binutils
rm -rf build_gcc

2011年5月14日 星期六

GCC-4.6.0 arm-none-linux-gnueabi build script for both little and big endian static toolchain

1) gcc-4.6.0 with arm-none-linux-gnueabi
2) support both -mlittle-endian and -mbig-endian
3) default -mhard-float and multilib for cortex-a9
4) static-build gcc/g++

The patches to gcc-4.6.0:

diff -uNr src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/linux-eabi.h gcc-4.6.0/gcc/config/arm/linux-eabi.h
--- src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/linux-eabi.h 2011-01-12 22:29:14.000000000 +0800
+++ gcc-4.6.0/gcc/config/arm/linux-eabi.h       2011-05-11 23:29:29.012044669 +0800
@@ -101,3 +101,6 @@
    is used.  */ 
 #undef  CLEAR_INSN_CACHE
 #define CLEAR_INSN_CACHE(BEG, END) not_used
+
+#undef SYSROOT_SUFFIX_SPEC
+#define SYSROOT_SUFFIX_SPEC "%{mbig-endian:/be}"
diff -uNr src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/linux-elf.h gcc-4.6.0/gcc/config/arm/linux-elf.h
--- src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/linux-elf.h  2011-01-15 02:42:32.000000000 +0800
+++ gcc-4.6.0/gcc/config/arm/linux-elf.h        2011-05-14 20:06:44.188276102 +0800
@@ -51,7 +51,7 @@

 #undef  MULTILIB_DEFAULTS
 #define MULTILIB_DEFAULTS \
-       { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
+       { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" }

 /* Now we define the strings used to build the spec file.  */ 
 #undef  LIB_SPEC
diff -uNr src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-arm-elf gcc-4.6.0/gcc/config/arm/t-arm-elf
--- src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-arm-elf    2011-01-04 04:52:22.000000000 +0800
+++ gcc-4.6.0/gcc/config/arm/t-arm-elf  2011-05-14 21:50:58.517726008 +0800
@@ -36,6 +36,10 @@
 MULTILIB_EXCEPTIONS  =  
 MULTILIB_MATCHES     =  

+MULTILIB_OPTIONS     += mcpu=cortex-a9
+MULTILIB_DIRNAMES    += cortex-a9
+MULTILIB_EXCEPTIONS  +=
+
 #MULTILIB_OPTIONS     += mcpu=fa526/mcpu=fa626/mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
 #MULTILIB_DIRNAMES    += fa526 fa626 fa606te fa626te fmp626 fa726te
 #MULTILIB_EXCEPTIONS  += *mthumb*/*mcpu=fa526 *mthumb*/*mcpu=fa626
@@ -67,6 +71,10 @@
 # MULTILIB_DIRNAMES    += le be
 # MULTILIB_MATCHES     += mbig-endian=mbe mlittle-endian=mle
 #
+MULTILIB_OPTIONS     += mbig-endian
+MULTILIB_DIRNAMES    += be
+MULTILIB_MATCHES     += mbig-endian=mbe
+#
 # MULTILIB_OPTIONS    += mhard-float/msoft-float
 # MULTILIB_DIRNAMES   += fpu soft
 # MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
diff -uNr src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-linux gcc-4.6.0/gcc/config/arm/t-linux
--- src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-linux      2009-04-22 03:03:23.000000000 +0800
+++ gcc-4.6.0/gcc/config/arm/t-linux    2011-05-11 23:34:24.503749908 +0800
@@ -28,6 +28,9 @@
 # MULTILIB_OPTIONS = mhard-float/msoft-float
 # MULTILIB_DIRNAMES = hard-float soft-float

+MULTILIB_OPTIONS += mbig-endian
+MULTILIB_DIRNAMES += be
+
 # EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o


 # LIBGCC = stmp-multilib
diff -uNr src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-linux-eabi gcc-4.6.0/gcc/config/arm/t-linux-eabi
--- src/gcc-4.6.0/gcc-4.6.0/gcc/config/arm/t-linux-eabi 2011-01-04 04:52:22.000000000 +0800
+++ gcc-4.6.0/gcc/config/arm/t-linux-eabi       2011-05-14 21:50:19.527668816 +0800
@@ -21,8 +21,22 @@

 # We do not build a Thumb multilib for Linux because the definition of
 # CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
-MULTILIB_OPTIONS       =
-MULTILIB_DIRNAMES      =
+MULTILIB_OPTIONS     = marm
+MULTILIB_DIRNAMES    = arm
+MULTILIB_EXCEPTIONS  =
+MULTILIB_MATCHES     =
+
+MULTILIB_OPTIONS     += mcpu=cortex-a9
+MULTILIB_DIRNAMES    += cortex-a9
+MULTILIB_EXCEPTIONS  +=
+
+MULTILIB_OPTIONS     += mbig-endian
+MULTILIB_DIRNAMES    += be
+MULTILIB_MATCHES     += mbig-endian=mbe
+
+#MULTILIB_OPTIONS    += mfloat-abi=hard
+#MULTILIB_DIRNAMES   += fpu
+#MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*

 #MULTILIB_OPTIONS     += mcpu=fa606te/mcpu=fa626te/mcpu=fmp626/mcpu=fa726te
 #MULTILIB_DIRNAMES    += fa606te fa626te fmp626 fa726te

The build script for arm-none-linux-gnueabi:

[1-build-binutils.sh]
#!/bin/bash
cd ${BUILDPATH}
mkdir -v binutils-build
cd binutils-build
AR=ar AS=as ${BINUTILS_SRC}/configure --build=${HOST} --host=${HOST} --target=${TARGET} --prefix=${PREFIX} --with-lib-path=${PREFIX}/${TARGET}/lib:${PREFIX}/${TARGET}/lib/be --with-sysroot=${PREFIX}/${TARGET} --disable-nls --enable-shared --enable-install-libbfd --enable-interwork --with-v4bx-interworking --enable-multilib
make configure-host
make LDFLAGS="-static"
make install

[3-build-headers.sh]
#!/bin/bash
echo "Prepare Linux kernel headers"

cd ${LINUX_HEADER_SRC}
make ARCH=arm CROSS_COMPILE=${TARGET}- INSTALL_HDR_PATH=${PREFIX}/${TARGET} headers_install

[4-build-gcc.sh]
#!/bin/bash
if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
    mkdir -p ${BOOTSTRAP_PREFIX}/${TARGET}/bin
    for tool in ar as ld strip ranlib; do
        rm -f ${BOOTSTRAP_PREFIX}/${TARGET}/bin/${tool} || true
        ln -s ${PREFIX}/bin/${TARGET}-${tool} ${BOOTSTRAP_PREFIX}/${TARGET}/bin/${tool}
    done
fi

echo "Build bootstrap gcc"

cd ${BUILDPATH}
mkdir -v gcc-build
cd gcc-build

#mkdir -p mpfr
#cp ${GCC_SRC}/gmp/gmp-impl.h ./mpfr
#cp ${GCC_SRC}/gmp/longlong.h ./mpfr

# http://comments.gmane.org/gmane.linux.lfs.devel/10631
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47836
# need --disable-shared --disable-lto --disable-libquadmath --without-target-libiberty --without-target-zlib
${GCC_SRC}/configure --build=${HOST} --host=${HOST} --target=${TARGET} --prefix=${BOOTSTRAP_PREFIX} --with-local-prefix=${BOOTSTRAP_PREFIX}/${TARGET} --without-target-libiberty --without-target-zlib --disable-libquadmath --disable-lto --disable-libstdcxx-pch --disable-libffi --enable-multilib --disable-nls --disable-libgomp --disable-libmudflap --disable-libssp --enable-gold --enable-ld --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --disable-shared --disable-threads --without-headers --disable-decimal-float --enable-mpfr --enable-gmp --without-cloog --without-ppl --with-float=hard --with-v4bx-interworking --with-gnu-as --with-gnu-ld --with-cpu=${DEFAULT_CPU} --with-libelf=${LIBELF_PREFIX} --with-mpc=${MPC_PREFIX}
make
make install

[5-build-glibc.sh]
#!/bin/bash
if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
    ln -s ${PREFIX}/${TARGET}/include ${BOOTSTRAP_PREFIX}/${TARGET}/include
fi

cd ${BUILDPATH}
mkdir -v glibc-build
cd glibc-build
cat > config.cache << EOF
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_arm_tls=yes
libc_cv_gnu89_inline=yes
EOF

# http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.awk/2009-03/msg00088.html
# glibc-2.13 may have [^/], replace it with [^\/] in gen-sorted.awk
# need to install gawk
BUILD_CC="gcc" CC="${TARGET}-gcc" AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" ${GLIBC_SRC}/configure --prefix=/usr --build=${HOST} --host=${TARGET} --target=${TARGET} --without-cvs --disable-profile --disable-debug --without-gd --with-fp --disable-libunwind-exceptions --cache-file=config.cache --enable-kernel=2.6.38 --with-binutils=${PREFIX}/bin --enable-add-ons=ports,nptl --with-tls --with-__thread --with-arch=${DEFAULT_ARCH} --enable-multilib --enable-sim --enable-shared --enable-multi-arch --with-v4bx-interworking --with-headers=${PREFIX}/${TARGET}/include
make V=1 LD=${TARGET}-ld RANLIB=${TARGET}-ranlib all
make install_root=${PREFIX}/${TARGET} prefix= install

# modify libc.so  libpthread.so
# GROUP ( /lib/libc.so.6 /lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) ) ---> GROUP ( libc.so.6 libc_nonshared.a  AS_NEEDED ( ld-linux.so.2 ) )


cd ${BUILDPATH}
rm -rf glibc-build
mkdir -v glibc-build
cd glibc-build
cat > config.cache << EOF
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_arm_tls=yes
libc_cv_gnu89_inline=yes
libc_cv_slibdir=${PREFIX}/${TARGET}/lib/be
EOF

# http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.awk/2009-03/msg00088.html
# glibc-2.13 may have [^/], replace it with [^\/] in gen-sorted.awk
# need to install gawk
BUILD_CC="gcc" CC="${TARGET}-gcc -mbig-endian -Wl,-EB" AR="${TARGET}-ar" AS="${TARGET}-as -mbig-endian" RANLIB="${TARGET}-ranlib" LD="${TARGET}-ld" ${GLIBC_SRC}/configure --prefix=${PREFIX}/${TARGET} --build=${HOST} --host=${TARGET} --target=${TARGET} --libdir=${PREFIX}/${TARGET}/lib/be --without-cvs --disable-profile --disable-debug --without-gd --with-fp --disable-libunwind-exceptions --cache-file=config.cache --enable-kernel=2.6.38 --with-binutils=${PREFIX}/bin --enable-add-ons=ports,nptl --with-tls --with-__thread --with-arch=${DEFAULT_ARCH} --enable-multilib --enable-sim --enable-shared --enable-multi-arch --with-v4bx-interworking --with-headers=${PREFIX}/${TARGET}/include
make V=1
make install

# modify libc.so  libpthread.so
# GROUP ( /lib/libc.so.6 /lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) ) ---> GROUP ( libc.so.6 libc_nonshared.a  AS_NEEDED ( ld-linux.so.2 ) )

# From crosstool 0.43
# Fix problems in linker scripts.
#
# 1. Remove absolute paths
# Any file in a list of known suspects that isn't a symlink is assumed to be a linker script.
# FIXME: test -h is not portable
# FIXME: probably need to check more files than just these three...
# Need to use sed instead of just assuming we know what's in libc.so because otherwise alpha breaks
#
# 2. Remove lines containing BUG per http://sources.redhat.com/ml/bug-glibc/2003-05/msg00055.html,
# needed to fix gcc-3.2.3/glibc-2.3.2 targeting arm
#
# To make "strip *.so.*" not fail (ptxdist does this), rename to .so_orig rather than .so.orig
for file in libc.so libpthread.so libgcc_s.so; do
    for lib in lib lib/be lib64 usr/lib usr/lib64; do
      if test -f ${PREFIX}/${TARGET}/$lib/$file && test ! -h ${PREFIX}/${TARGET}/$lib/$file; then
        mv ${PREFIX}/${TARGET}/$lib/$file ${PREFIX}/${TARGET}/$lib/${file}_orig
        sed 's,/opt/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/lib/be/,,g;s,/usr/lib/,,g;s,/usr/lib64/,,g;s,/lib/,,g;s,/lib64/,,g;s,${PREFIX}/${TARGET}/lib/be,,g;/BUG in libc.scripts.output-format.sed/d' < ${PREFIX}/${TARGET}/$lib/${file}_orig > ${PREFIX}/${TARGET}/$lib/$file
        rm -f ${PREFIX}/${TARGET}/$lib/${file}_orig
      fi
    done
done


# link for other multilib options that uses mbig-endian, or they would link to default
# target library that is mlittle-endian

cd ${PREFIX}/${TARGET}/lib; mkdir -p cortex-a9; cd cortex-a9; ln -s ../be be

[6-build-gcc-final.sh]
#!/bin/bash
cd ${BUILDPATH}
mkdir -v gcc-build-final
cd gcc-build-final

#mkdir -p mpfr
#cp ${GCC_SRC}/gmp/gmp-impl.h ./mpfr
#cp ${GCC_SRC}/gmp/longlong.h ./mpfr

AR=ar ${GCC_SRC}/configure --prefix=${PREFIX} --build=${HOST} --host=${HOST} --target=${TARGET} --with-cpu=${DEFAULT_CPU} --with-pkgversion='M.F. C/C++ Compiler Release 20110423' --disable-nls --disable-libssp --disable-libgomp --enable-gold --enable-ld --enable-threads=posix --disable-tls --enable-symvers=gnu --enable-c99 --enable-long-long --enable-multilib --enable-languages=c,c++ --enable-__cxa_atexit --with-float=hard --enable-cxx-flags=-mhard-float --enable-shared --enable-gmp --enable-mpfr --enable-cloog --enable-ppl --with-v4bx-interworking --with-headers=${PREFIX}/${TARGET}/include --with-libelf=${LIBELF_PREFIX} --with-mpc=${MPC_PREFIX}

make AS_FOR_TARGET="${TARGET}-as" LD_FOR_TARGET="${TARGET}-ld" LDFLAGS="-L${PREFIX}/${TARGET}/lib -L${PREFIX}/${TARGET}/lib/be -static" all
make install

rm -f ${PREFIX}/bin/${TARGET}-gccbug
strip ${PREFIX}/bin/*
strip ${PREFIX}/${TARGET}/bin/ar
strip ${PREFIX}/${TARGET}/bin/as
strip ${PREFIX}/${TARGET}/bin/c++
strip ${PREFIX}/${TARGET}/bin/g++
strip ${PREFIX}/${TARGET}/bin/gcc
strip ${PREFIX}/${TARGET}/bin/ld
strip ${PREFIX}/${TARGET}/bin/nm
strip ${PREFIX}/${TARGET}/bin/objcopy
strip ${PREFIX}/${TARGET}/bin/objdump
strip ${PREFIX}/${TARGET}/bin/ranlib
strip ${PREFIX}/${TARGET}/bin/strip
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/cc1
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/cc1plus
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/collect2

[build-all.sh]
#!/bin/bash
set -ex

#HOST=i686-pc-linux-gnu
HOST=x86_64-linux-gnu
TARGET=arm-none-linux-gnueabi
DEFAULT_ARCH=armv7
DEFAULT_CPU=cortex-a9

# Specify the source path of each package
BINUTILS_SRC=/opt/binutils-2.21
GCC_VER=4.6.0
GCC_SRC=/opt/gcc-${GCC_VER}
GLIBC_SRC=/opt/src/glibc-2.13
LINUX_HEADER_SRC=/opt/linux-2.6.38

LOCAL_DIR=${PWD}
BUILDPATH=${LOCAL_DIR}/build
PREFIX=/opt/build/${TARGET}-${GCC_VER}
BOOTSTRAP_PREFIX=${BUILDPATH}/${TARGET}-${GCC_VER}
#MPFR_PREFIX=${PREFIX}/libmpfr
#GMP_PREFIX=${PREFIX}/libgmp
MPFR_PREFIX=/usr
GMP_PREFIX=/usr
MPC_PREFIX=/usr
LIBELF_PREFIX=/usr

unset LD_LIBRARY_PATH
unset LIBRARY_PATH
unset LD_RUN_PATH

if [ -e ${GCC_SRC}/newlib ]; then
  mv ${GCC_SRC}/newlib ${GCC_SRC}/newlib.orig
fi

mkdir -v ${BUILDPATH}
source ${LOCAL_DIR}/1-build-binutils.sh
##source ${LOCAL_DIR}/2-build-gmp-mpfr.sh
source ${LOCAL_DIR}/3-build-headers.sh
if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
    export PATH=${BOOTSTRAP_PREFIX}/bin:${PATH}
fi
export PATH=${PREFIX}/bin:${PATH}
export LD_LIBRARY_PATH=${GMP_PREFIX}/lib:${MPFR_PREFIX}/lib
source ${LOCAL_DIR}/4-build-gcc.sh
source ${LOCAL_DIR}/5-build-glibc.sh
source ${LOCAL_DIR}/6-build-gcc-final.sh

if [ -e ${GCC_SRC}/newlib.orig ]; then
  mv ${GCC_SRC}/newlib.orig ${GCC_SRC}/newlib
fi

2011年5月4日 星期三

GCC-4.6.0 little-endian build script for arm-none-linux-gnueabi

For ARM's cortex-a9, build arm-none-linux-gnueabi little-endian toolchain

Source package:
binutils-2.21
gcc-4.6.0
glibc-2.13

With hardware vfp.

[1-build-binutils.sh]
#!/bin/bash
cd ${BUILDPATH}
mkdir -v binutils-build
cd binutils-build
AR=ar AS=as ${BINUTILS_SRC}/configure --build=${HOST} --host=${HOST} --target=${TARGET} --prefix=${PREFIX} --with-sysroot=${PREFIX}/${TARGET} --disable-nls --enable-shared --enable-install-libbfd --enable-interwork --with-v4bx-interworking --enable-multilib
make configure-host
make LDFLAGS="-static"
make install

[2-build-gmp-mpfr.sh]
#!/bin/bash
mkdir -v ${BUILDPATH}/gmp-build
cd ${BUILDPATH}/gmp-build
${GMP_SRC}/configure --prefix=${GMP_PREFIX} --enable-cxx --enable-mpbsd
make
make install

mkdir -v ${BUILDPATH}/mpfr-build
cd ${BUILDPATH}/mpfr-build
LDFLAGS="-Wl,-rpath,${PREFIX}/lib" ${MPFR_SRC}/configure --prefix=${MPFR_PREFIX} --enable-shared --with-gmp=${GMP_PREFIX}
make
make check
make install

[3-build-headers.sh]
#!/bin/bash
echo "Prepare Linux kernel headers"

cd ${LINUX_HEADER_SRC}
make ARCH=arm CROSS_COMPILE=${TARGET}- INSTALL_HDR_PATH=${PREFIX}/${TARGET} headers_install

[4-build-gcc.sh]
#!/bin/bash
if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
    mkdir -p ${BOOTSTRAP_PREFIX}/${TARGET}/bin
    for tool in ar as ld strip ranlib; do
        rm -f ${BOOTSTRAP_PREFIX}/${TARGET}/bin/${tool} || true
        ln -s ${PREFIX}/bin/${TARGET}-${tool} ${BOOTSTRAP_PREFIX}/${TARGET}/bin/${tool}
    done
fi

echo "Build bootstrap gcc"

cd ${BUILDPATH}
mkdir -v gcc-build
cd gcc-build

#mkdir -p mpfr
#cp ${GCC_SRC}/gmp/gmp-impl.h ./mpfr
#cp ${GCC_SRC}/gmp/longlong.h ./mpfr

# http://comments.gmane.org/gmane.linux.lfs.devel/10631
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47836
# need --disable-shared --disable-lto --disable-libquadmath --without-target-libiberty --without-target-zlib
${GCC_SRC}/configure --build=${HOST} --host=${HOST} --target=${TARGET} --prefix=${BOOTSTRAP_PREFIX} --with-local-prefix=${BOOTSTRAP_PREFIX}/${TARGET} --without-target-libiberty --without-target-zlib --disable-libquadmath --disable-lto --disable-libstdcxx-pch --disable-libffi --disable-multilib --disable-nls --disable-libgomp --disable-libmudflap --disable-libssp --enable-gold --enable-ld --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --disable-shared --disable-threads --without-headers --disable-decimal-float --enable-mpfr --enable-gmp --without-cloog --without-ppl --with-float=hard --with-v4bx-interworking --with-gnu-as --with-gnu-ld --with-cpu=${DEFAULT_CPU} --with-libelf=${LIBELF_PREFIX} --with-mpc=${MPC_PREFIX}
make
make install

[5-build-glibc.sh]
#!/bin/bash
#if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
#    ln -s ${PREFIX}/${TARGET}/include ${BOOTSTRAP_PREFIX}/${TARGET}/include
#fi

cd ${BUILDPATH}
mkdir -v glibc-build
cd glibc-build
cat > config.cache << EOF
libc_cv_forced_unwind=yes
libc_cv_c_cleanup=yes
libc_cv_arm_tls=yes
libc_cv_gnu89_inline=yes
EOF

# http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.awk/2009-03/msg00088.html
# glibc-2.13 may have [^/], replace it with [^\/] in gen-sorted.awk
# need to install gawk
BUILD_CC="gcc" CC="${TARGET}-gcc" AR="${TARGET}-ar" RANLIB="${TARGET}-ranlib" ${GLIBC_SRC}/configure --prefix=/usr --build=${HOST} --host=${TARGET} --target=${TARGET} --without-cvs --disable-profile --disable-debug --without-gd --with-fp --disable-libunwind-exceptions --cache-file=config.cache --enable-kernel=2.6.38 --with-binutils=${PREFIX}/bin --enable-add-ons=ports,nptl --with-tls --with-__thread --with-arch=${DEFAULT_ARCH} --enable-multilib --enable-sim --enable-shared --enable-multi-arch --with-v4bx-interworking --with-headers=${PREFIX}/${TARGET}/include
make V=1 LD=${TARGET}-ld RANLIB=${TARGET}-ranlib all
make install_root=${PREFIX}/${TARGET} prefix= install

# modify libc.so  libpthread.so
# GROUP ( /lib/libc.so.6 /lib/libc_nonshared.a  AS_NEEDED ( /lib/ld-linux.so.2 ) ) ---> GROUP ( libc.so.6 libc_nonshared.a  AS_NEEDED ( ld-linux.so.2 ) )

[6-build-gcc-final.sh]
#!/bin/bash
cd ${BUILDPATH}
mkdir -v gcc-build-final
cd gcc-build-final

#mkdir -p mpfr
#cp ${GCC_SRC}/gmp/gmp-impl.h ./mpfr
#cp ${GCC_SRC}/gmp/longlong.h ./mpfr

#add --with-newlib
AR=ar LDFLAGS="-Wl,-rpath,${PREFIX}/${TARGET}/lib" ${GCC_SRC}/configure --prefix=${PREFIX} --build=${HOST} --host=${HOST} --target=${TARGET} --with-cpu=${DEFAULT_CPU} --with-pkgversion='M.F. C/C++ Compiler Release 20110423' --disable-nls --disable-libssp --disable-libgomp --enable-gold --enable-ld --enable-threads=posix --disable-tls --enable-symvers=gnu --enable-c99 --enable-long-long --enable-multilib --enable-languages=c,c++ --enable-__cxa_atexit --with-float=hard --enable-cxx-flags=-mhard-float --enable-shared --enable-gmp --enable-mpfr --enable-cloog --enable-ppl --with-v4bx-interworking --with-headers=${PREFIX}/${TARGET}/include --with-libelf=${LIBELF_PREFIX} --with-mpc=${MPC_PREFIX}
make AS_FOR_TARGET="${TARGET}-as" LD_FOR_TARGET="${TARGET}-ld" LDFLAGS="-static" all
make install

rm -f ${PREFIX}/bin/${TARGET}-gccbug
strip ${PREFIX}/bin/*
strip ${PREFIX}/${TARGET}/bin/ar
strip ${PREFIX}/${TARGET}/bin/as
strip ${PREFIX}/${TARGET}/bin/c++
strip ${PREFIX}/${TARGET}/bin/g++
strip ${PREFIX}/${TARGET}/bin/gcc
strip ${PREFIX}/${TARGET}/bin/ld
strip ${PREFIX}/${TARGET}/bin/nm
strip ${PREFIX}/${TARGET}/bin/objcopy
strip ${PREFIX}/${TARGET}/bin/objdump
strip ${PREFIX}/${TARGET}/bin/ranlib
strip ${PREFIX}/${TARGET}/bin/strip
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/cc1
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/cc1plus
strip ${PREFIX}/libexec/gcc/${TARGET}/${GCC_VER}/collect2

[build-all.sh]
#!/bin/bash
set -ex

#HOST=i686-pc-linux-gnu
HOST=x86_64-linux-gnu
TARGET=arm-none-linux-gnueabi
DEFAULT_ARCH=armv7
DEFAULT_CPU=cortex-a9

# Specify the source path of each package
BINUTILS_SRC=/opt/binutils-2.21
GCC_VER=4.6.0
GCC_SRC=/opt/gcc-${GCC_VER}
GLIBC_SRC=/opt/src/glibc-2.13
LINUX_HEADER_SRC=/opt/linux-2.6.38

LOCAL_DIR=${PWD}
BUILDPATH=${LOCAL_DIR}/build
PREFIX=/opt/build/${TARGET}-${GCC_VER}
BOOTSTRAP_PREFIX=${BUILDPATH}/${TARGET}-${GCC_VER}
MPFR_PREFIX=/usr
GMP_PREFIX=/usr
MPC_PREFIX=/usr
LIBELF_PREFIX=/usr

unset LD_LIBRARY_PATH
unset LIBRARY_PATH
unset LD_RUN_PATH

if [ -e ${GCC_SRC}/newlib ]; then
  mv ${GCC_SRC}/newlib ${GCC_SRC}/newlib.orig
fi

mkdir -v ${BUILDPATH}
source ${LOCAL_DIR}/1-build-binutils.sh
#source ${LOCAL_DIR}/2-build-gmp-mpfr.sh
source ${LOCAL_DIR}/3-build-headers.sh
if test x"${BOOTSTRAP_PREFIX}" != x"${PREFIX}"; then
    export PATH=${BOOTSTRAP_PREFIX}/bin:${PATH}
fi
export PATH=${PREFIX}/bin:${PATH}
export LD_LIBRARY_PATH=${GMP_PREFIX}/lib:${MPFR_PREFIX}/lib
source ${LOCAL_DIR}/4-build-gcc.sh
source ${LOCAL_DIR}/5-build-glibc.sh
source ${LOCAL_DIR}/6-build-gcc-final.sh

if [ -e ${GCC_SRC}/newlib.orig ]; then
  mv ${GCC_SRC}/newlib.orig ${GCC_SRC}/newlib
fi

2011年4月30日 星期六

gcc-4.6.0 for arm-none-linux-gnueabi (bootstrap gcc)

Build bootstrap gcc:
need --disable-shared --disable-lto --disable-libquadmath --without-target-libiberty --without-target-zlib

If enabling these features, target may want to link crti.o ... (that is generated by later glibc)

configure:3055: /opt/build_arm-none-linux-gnueabi-gcc/build/gcc-build/./gcc/xgcc -B/opt/build_arm-none-linux-gnueabi-gcc/build/gcc-build/./gcc/ -B/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ -B/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/lib/ -isystem /opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/include -isystem /opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/sys-include    -o conftest -g -O2   conftest.c  >&5
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find crt1.o: No such file or directory
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find crti.o: No such file or directory
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find crtbegin.o: No such file or directory
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find -lgcc
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find -lc
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find -lgcc
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find crtend.o: No such file or directory
/opt/build_arm-none-linux-gnueabi-gcc/build/arm-none-linux-gnueabi-4.6.0/arm-none-linux-gnueabi/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status



Referenced:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47836

With upcoming 4.6 building of target-libiberty and target-zlib is enabled (at
most platforms) per default.
It should be possible to disable this behavior e.g. with switches like:
--without-target-libiberty
--without-target-zlib

Previous versions did not try to build these libraries for cross compilers.


Index: configure.ac
===================================================================
--- configure.ac        (revision 170359)
+++ configure.ac        (working copy)
@@ -262,6 +262,16 @@ skipdirs=
 # Noconfigdirs are removed loudly.
 noconfigdirs=""

+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
Index: configure
===================================================================
--- configure   (revision 170359)
+++ configure   (working copy)
@@ -2801,6 +2801,16 @@ skipdirs=
 # Noconfigdirs are removed loudly.
 noconfigdirs=""

+# Make sure we don't let target-libiberty be added if we didn't want it.
+if test x$with_target_libiberty = xno ; then
+  noconfigdirs="$noconfigdirs target-libiberty"
+fi
+
+# Make sure we don't let target-zlib be added if we didn't want it.
+if test x$with_target_zlib = xno ; then
+  noconfigdirs="$noconfigdirs target-zlib"
+fi
+
 use_gnu_ld=
 # Make sure we don't let GNU ld be added if we didn't want it.
 if test x$with_gnu_ld = xno ; then
 

2011年4月25日 星期一

Android boots up successfully

Android binary:

http://omappedia.org/wiki/Android:_Working_with_pre-built_binaries


SD card layout:

mingfeng@mingfeng-desktop:/media$ sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 8031 MB, 8031043584 bytes
255 heads, 63 sectors/track, 976 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

所用裝置 Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1           9       72261    c  W95 FAT32 (LBA)
/dev/sdb2              10         976     7767427+  83  Linux


Mount:

mingfeng@mingfeng-desktop:/media$ mount
...
/dev/sdb1 on /media/boot type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush)
/dev/sdb2 on /media/filesystem type ext3 (rw,nosuid,nodev,uhelper=udisks)


Files: (xloader: MLO)

mingfeng@mingfeng-desktop:/media$ ls boot/
MLO  u-boot.bin  uImage

mingfeng@mingfeng-desktop:/media$ ls filesystem/
acct  bt_drv.ko  cache  config  d  data  debug  default.prop  dev  etc  fm_drv.ko  gps_drv.ko  init  init.goldfish.rc  init.omap4sdp.rc  init.rc  lost+found  makemyfs.sh  mnt  proc  sbin  sdcard  st_drv.ko  sys  system  tmp
mingfeng@mingfeng-desktop:/media$



Bootup log:

歡迎使用 minicom 2.4

選項: I18n
編譯於 Jun  3 2010, 13:48:00.
Port /dev/ttyUSB0

按 CTRL-A Z 說明特殊鍵

Texas Instruments X-Loader 1.41 (Aug 31 2010 - 18:03:49)                                                                    
mmc read: Invalid size
Starting OS Bootloader from MMC/SD1 ...


U-Boot 1.1.4-gcebe815a-dirty (Sep 24 2010 - 15:03:03)

Load address: 0x80e80000
DRAM:  512 MB
Flash:  0 kB
*** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   KS8851SNL
Hit any key to stop autoboot:  0
mmc read: Invalid size

2874648 bytes read
## Booting image at 80300000 ...
   Image Name:   Linux-2.6.35-g7604125
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    2874584 Bytes =  2.7 MB
   Load Address: 80008000
   Entry Point:  80008000
   Verifying Checksum ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.
Linux version 2.6.35-g7604125 (geetha@geetha-ubuntu) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #4 SMP PREEMPT Mon Jan 10 15:42:30 CST 2011
CPU: ARMv7 Processor [411fc092] revision 2 (ARMv7), cr=10c53c7f
CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
Machine: OMAP4430 Panda Board
Memory policy: ECC disabled, Data cache writealloc
***********************
OMAP4430 ES2.0 type(GP)
id-code  (4b95c02f)
Die-id   (13780024-00000001-0A3B951B-0600C)
Prod-id  (0001B95C-000400F0)
***********************
SRAM: Mapped pa 0x40300000 to va 0xfe400000 size: 0x100000
FIXME: omap44xx_sram_init not implementednicom 2.4    |   VT102         離線                                                                                                                                                                 Reserving 33554432 bytes SDRAM for VRAM
PERCPU: Embedded 6 pages/cpu @c2a3d000 s3936 r8192 d12448 u65536
pcpu-alloc: s3936 r8192 d12448 u65536 alloc=16*4096
pcpu-alloc: [0] 0 [0] 1
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 117602
Kernel command line: root=/dev/mmcblk0p2 rw rootdelay=3 mem=463M console=ttyO2,115200n8 init=/init
PID hash table entries: 2048 (order: 1, 8192 bytes)
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 463MB = 463MB total
Memory: 430448k/430448k available, 43664k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xffc00000 - 0xffe00000   (   2 MB)
    vmalloc : 0xdd000000 - 0xf8000000   ( 432 MB)
    lowmem  : 0xc0000000 - 0xdcf00000   ( 463 MB)
    pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    modules : 0xbf000000 - 0xbfe00000   (  14 MB)
      .init : 0xc0008000 - 0xc003e000   ( 216 kB)
      .text : 0xc003e000 - 0xc05a0000   (5512 kB)
      .data : 0xc05a0000 - 0xc05edbc0   ( 311 kB)
SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
Hierarchical RCU implementation.
        RCU-based detection of stalled CPUs is disabled.
        Verbose stalled-CPUs detection is disabled.
NR_IRQS:388
omap_hwmod: sys_32k_ck: missing clockdomain for sys_32k_ck.
omap_hwmod: l3_div_ck: missing clockdomain for l3_div_ck.
omap_hwmod: dpll_mpu_m2_ck: missing clockdomain for dpll_mpu_m2_ck.
omap_hwmod: mailbox: resetting
omap_hwmod: omap-mcpdm-dai: cannot be enabled (3)
omap_hwmod: mcspi1: resetting
omap_hwmod: mcspi2: resetting
omap_hwmod: mcspi3: resetting
omap_hwmod: mcspi4: resetting
omap_hwmod: mmc1: resetting
omap_hwmod: mmc2: resetting
omap_hwmod: mmc3: resetting
omap_hwmod: mmc4: resetting
omap_hwmod: mmc5: resetting
omap_hwmod: timer3: resetting
omap_hwmod: timer4: resetting
omap_hwmod: timer5: resetting
omap_hwmod: timer6: resetting
omap_hwmod: timer7: resetting
omap_hwmod: timer8: resetting
omap_hwmod: timer9: resetting
omap_hwmod: timer11: resetting
GPMC revision 6.0
 dmtimer.0: omap_dm_timer_probe:[id=0]
 dmtimer.0:  registered
 dmtimer.1: omap_dm_timer_probe:[id=1]
 dmtimer.1:  registered
 dmtimer.9: omap_dm_timer_probe:[id=9]
 dmtimer.9:  registered
OMAP clockevent source: GPTIMER1 at 32768 Hz
Console: colour dummy device 80x30
Calibrating delay loop... 2013.49 BogoMIPS (lpj=7864320)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
Calibrating local timer... 491.14MHz.
L310 cache controller enabled
l2x0: 16 ways, CACHE_ID 0x410000c4, AUX_CTRL 0x0e470000
CPU1: Booted secondary processor
Brought up 2 CPUs
SMP: Total of 2 processors activated (3976.57 BogoMIPS).
devtmpfs: initialized
regulator: core version 0.5
NET: Registered protocol family 16
OMAP GPIO hardware version 0.1
PandaBoard Revision: 003
res->start = 49022000
res->start = 49024000
res->start = 49026000
res->start = 48096000
OMAP DMA hardware revision 0.0
dma dma.0: System DMA registered
HSI: device registered
bio: create slab <bio-0> at 0
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
i2c_omap i2c_omap.1: bus 1 rev4.0 at 400 kHz
Skipping twl internal clock init and using bootloader value (unknown osc rate)
twl6030: PIH (irq 39) chaining IRQs 368..387
twl6030_usb twl6030_usb: Initialized TWL6030 USB module
regulator: VMMC: 1200 <--> 3000 mV at 3000 mV normal standby
regulator: VPP: 1800 <--> 2500 mV at 1900 mV normal standby
regulator: VANA: 2100 mV normal standby
regulator: VCXIO: 1800 mV normal standby
regulator: VDAC: 1800 mV normal standby
regulator: VUSB: 3300 mV normal standby
regulator: VAUX2_6030: 1200 <--> 2800 mV at 1800 mV normal standby
regulator: VAUX3_6030: 1000 <--> 3000 mV at 1200 mV normal standby
Advanced Linux Sound Architecture Driver Version 1.0.23.
Sangoma WANPIPE Router v1.1 (c) 1995-2000 Sangoma Technologies Inc.
Bluetooth: Core ver 2.15
NET: Registered protocol family 31
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Switching to clocksource timer-32k
musb_hdrc: version 6.0, musb-dma, host, debug=0
musb_hdrc musb_hdrc: MUSB HDRC host driver
musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: MUSB HDRC host driver
usb usb1: Manufacturer: Linux 2.6.35-g7604125 musb-hcd
usb usb1: SerialNumber: musb_hdrc
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
musb_hdrc musb_hdrc: USB Host mode controller at fc0ab000 using DMA, IRQ 124
NET: Registered protocol family 2
IP route cache hash table entries: 4096 (order: 2, 16384 bytes)
TCP established hash table entries: 16384 (order: 5, 131072 bytes)
TCP bind hash table entries: 16384 (order: 5, 196608 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
TCP reno registered
UDP hash table entries: 256 (order: 1, 8192 bytes)
UDP-Lite hash table entries: 256 (order: 1, 8192 bytes)
NET: Registered protocol family 1
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
ipu-power ipu0: Test of writing to the device message log,done from ipu_pm_init
ipu-power initialized ipu, major: 251, minor: 0
sdp4430_wifi_init: start
omap-iommu omap-iommu.0: ducati registered
omap-iommu omap-iommu.1: tesla registered
iovmm-omap initialized ducati, major: 250, base-minor: 0
iovmm-omap initialized tesla, major: 250, base-minor: 1
dmtimer dmtimer.0: omap_dm_timer_probe:[id=0]
dmtimer dmtimer.0: omap2_dm_timer_enable: pm_runtime_get_sync FAILED
dmtimer dmtimer.1: omap_dm_timer_probe:[id=1]
dmtimer dmtimer.9: omap_dm_timer_probe:[id=9]
dmtimer dmtimer.2: omap_dm_timer_probe:[id=2]
dmtimer dmtimer.2:  registered
dmtimer dmtimer.3: omap_dm_timer_probe:[id=3]
dmtimer dmtimer.3:  registered
dmtimer dmtimer.4: omap_dm_timer_probe:[id=4]
dmtimer dmtimer.4:  registered
dmtimer dmtimer.5: omap_dm_timer_probe:[id=5]
dmtimer dmtimer.5:  registered
dmtimer dmtimer.6: omap_dm_timer_probe:[id=6]
dmtimer dmtimer.6:  registered
dmtimer dmtimer.7: omap_dm_timer_probe:[id=7]
dmtimer dmtimer.7:  registered
dmtimer dmtimer.8: omap_dm_timer_probe:[id=8]
dmtimer dmtimer.8:  registered
dmtimer dmtimer.10: omap_dm_timer_probe:[id=10]
dmtimer dmtimer.10:  registered
omap-remoteproc omap-remoteproc.0: omap_rproc_probe: adding rproc tesla
omap-remoteproc omap-remoteproc.0: omap-rproc initialized tesla, major: 249, base-minor: 0
omap-remoteproc omap-remoteproc.1: omap_rproc_probe: adding rproc ducati-proc0
omap-remoteproc omap-remoteproc.1: omap-rproc initialized ducati-proc0, major: 249, base-minor: 1
omap-remoteproc omap-remoteproc.2: omap_rproc_probe: adding rproc ducati-proc1
omap-remoteproc omap-remoteproc.2: omap-rproc initialized ducati-proc1, major: 249, base-minor: 2
ashmem: initialized
VFS: Disk quotas dquot_6.5.2
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
msgmni has been set to 840
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
OMAP DSS rev 4.0
OMAP DISPC rev 4.0
OMAP DSI rev 3.0
OMAP DSI2 rev 3.0
Enter hdmi_init()
OMAP HDMI W1 rev 2.0
init_display
ENTER hdmi_panel_probe()
hdmi_panel_probe x_res= 1280 y_res = 800
Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
omap-hsuart.0: ttyO0 at MMIO 0x4806a000 (irq = 104) is a OMAP UART0
omap-hsuart.1: ttyO1 at MMIO 0x4806c000 (irq = 105) is a OMAP UART1
omap-hsuart.2: ttyO2 at MMIO 0x48020000 (irq = 106) is a OMAP UART2
console [ttyO2] enabled
omap-hsuart.3: ttyO3 at MMIO 0x4806e000 (irq = 102) is a OMAP UART3
brd: module loaded
loop: module loaded
usbcore: registered new interface driver smsc95xx
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-omap ehci-omap: OMAP-EHCI Host Controller
ehci-omap ehci-omap: new USB bus registered, assigned bus number 2
ehci-omap ehci-omap: irq 109, io mem 0x4a064c00
ehci-omap ehci-omap: USB 2.0 started, EHCI 1.00
usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb2: Product: OMAP-EHCI Host Controller
usb usb2: Manufacturer: Linux 2.6.35-g7604125 ehci_hcd
usb usb2: SerialNumber: ehci-omap
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 3 ports detected
using rtc device, twl_rtc, for alarms
twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
twl_rtc twl_rtc: Power up reset detected.
twl_rtc twl_rtc: Enabling TWL-RTC.
i2c /dev entries driver
IR NEC protocol handler initialized
IR RC5(x) protocol handler initialized
IR RC6 protocol handler initialized
IR JVC protocol handler initialized
IR Sony protocol handler initialized
Linux video capture interface: v2.00
OMAP Watchdog Timer Rev 0x00: initial timeout 60 sec
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
logger: created 64K log 'log_main'
logger: created 256K log 'log_events'
logger: created 64K log 'log_radio'
logger: created 64K log 'log_system'
proc4430_drv_initializeModule
omap-devicehandler omap-devicehandler.0: omap_devh_probe: adding devh Tesla
omap-devh initialized Tesla, major: 240, base-minor: 0
omap-devicehandler omap-devicehandler.1: omap_devh_probe: adding devh SysM3
omap-devh initialized SysM3, major: 240, base-minor: 1
omap-devicehandler omap-devicehandler.2: omap_devh_probe: adding devh AppM3
omap-devh initialized AppM3, major: 240, base-minor: 2
SDP4430 SoC init
asoc: null-codec-dai <-> MultiMedia1 mapping ok
asoc: null-codec-dai <-> MultiMedia2 mapping ok
mmc0: host does not support reading read-only switch. assuming write-enable.
mmc0: new high speed SDHC card at address b368
mmcblk0: mmc0:b368 NCard 7.47 GiB
asoc: null-codec-dai <-> Voice mapping ok
asoc: null-codec-dai <-> Tones mapping ok
asoc: null-codec-dai <-> Vibra mapping ok
 mmcblk0:
asoc: null-codec-dai <-> MODEM mapping ok
asoc: null-codec-dai <-> MultiMedia1 LP mapping ok
asoc: HDMI <-> hdmi-dai mapping ok
asoc: FM Digital <-> omap-mcbsp-dai.1 mapping ok
 p1 p2
asoc: twl6040-dl1 <-> mcpdm-dl mapping ok
asoc: dmic-hifi <-> omap-dmic-dai.0 mapping ok
asoc: twl6040-dl1 <-> mcpdm-dl1 mapping ok
asoc: twl6040-ul <-> mcpdm-ul1 mapping ok
asoc: twl6040-dl2 <-> mcpdm-dl2 mapping ok
asoc: twl6040-vib <-> mcpdm-vib mapping ok
asoc: Bluetooth <-> omap-mcbsp-dai.0 mapping ok
asoc: FM Digital <-> omap-mcbsp-dai.1 mapping ok
asoc: MODEM <-> omap-mcbsp-dai.1 mapping ok
asoc: dmic-hifi <-> omap-dmic-dai.0 mapping ok
asoc: dmic-hifi <-> omap-dmic-dai.1 mapping ok
asoc: dmic-hifi <-> omap-dmic-dai.2 mapping ok
input: SDP4430 Headset Jack as /devices/platform/soc-audio/sound/card0/input0
ALSA device list:
  #0: TI OMAP4 SDP4430 Board
Netfilter messages via NETLINK v0.30.
nf_conntrack version 0.5.0 (6725 buckets, 26900 max)
CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
ctnetlink v0.93: registering with nfnetlink.
xt_time: kernel timezone is -0000
ip_tables: (C) 2000-2006 Netfilter Core Team
arp_tables: (C) 2002 David S. Miller
TCP cubic registered
Initializing XFRM netlink socket
usb 2-1: new high speed USB device using ehci-omap and address 2
NET: Registered protocol family 10
lo: Disabled Privacy Extensions
Mobile IPv6
IPv6 over IPv4 tunneling driver
sit0: Disabled Privacy Extensions
ip6tnl0: Disabled Privacy Extensions
NET: Registered protocol family 17
NET: Registered protocol family 15
Bluetooth: L2CAP ver 2.14
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO (Voice Link) ver 0.6
Bluetooth: SCO socket layer initialized
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
Bluetooth: HIDP (Human Interface Emulation) ver 1.2
ThumbEE CPU extension supported.
omap_hwmod: Initialize debugfs support
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 1
Console: switching to colour frame buffer device 160x50
omapdss HDMI: hot plug event 1
omapdss HDMI: error sending hot plug event 1 (-2)
regulator_init_complete: incomplete constraints, leaving VAUX3_6030 on
usb 2-1: New USB device found, idVendor=0424, idProduct=9514
usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
regulator_init_complete: incomplete constraints, leaving VAUX2_6030 on
regulator_init_complete: incomplete constraints, leaving VUSB on
hub 2-1:1.0: USB hub found
regulator_init_complete: incomplete constraints, leaving VDAC on
hub 2-1:1.0: 5 ports detected
regulator_init_complete: incomplete constraints, leaving VCXIO on
regulator_init_complete: incomplete constraints, leaving VANA on
regulator_init_complete: incomplete constraints, leaving VPP on
twl_rtc twl_rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
omap_vout omap_vout: : registered and initialized video device 0
omap_vout omap_vout: : registered and initialized video device 1
omap_vout omap_vout: : registered and initialized video device 2
omap_wb: registered and initialized wb device 3 [v4l2]
Waiting 3sec before mounting root device...
usb 2-1.1: new high speed USB device using ehci-omap and address 3
usb 2-1.1: New USB device found, idVendor=0424, idProduct=ec00
usb 2-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
smsc95xx v1.0.4
smsc95xx 2-1.1:1.0: usb0: register 'smsc95xx' at usb-ehci-omap-1.1, smsc95xx USB 2.0 Ethernet, 56:34:90:46:a9:75
EXT3-fs: barriers not enabled
kjournald starting.  Commit interval 5 seconds
EXT3-fs (mmcblk0p2): using internal journal
EXT3-fs (mmcblk0p2): mounted filesystem with writeback data mode
VFS: Mounted root (ext3 filesystem) on device 179:2.
devtmpfs: mounted
Freeing init memory: 216K
init: cannot open '/initlogo.rle'
init: cannot find '/system/bin/pvrsrvinit', disabling 'pvrsrvinit'
init: cannot find '/system/bin/playmp3', disabling 'bootsound'
init: cannot find '/system/etc/install-recovery.sh', disabling 'flash_recovery'
sh: can't access tty; job control turned off
# st_drv: module is from the staging directory, the quality is unknown, you have been warned.
bt_drv: module is from the staging directory, the quality is unknown, you have been warned.
init: untracked pid 1182 exited
fm_drv: version magic '2.6.35.7-00057-g41bac15-dirty SMP preempt mod_unload ARMv7 ' should be '2.6.35-g7604125 SMP preempt mod_unload ARMv7 '
gps_drv: version magic '2.6.35.7-00057-g41bac15-dirty SMP preempt mod_unload ARMv7 ' should be '2.6.35-g7604125 SMP preempt mod_unload ARMv7 '
asoc: can't open interface mcpdm-dl1
asoc: can't open interface MultiMedia1
warning: `zygote' uses 32-bit capabilities (legacy support in use)
binder: release 1310:1310 transaction 1549 out, still active
binder: 1217:1354 transaction failed 29189, size 4-0
binder: send failed reply for transaction 1549, target dead
usb 2-1.3: new low speed USB device using ehci-omap and address 4
usb 2-1.3: New USB device found, idVendor=15d9, idProduct=0a4c
usb 2-1.3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
usb 2-1.3: Product:  USB OPTICAL MOUSE
input:  USB OPTICAL MOUSE as /devices/platform/ehci-omap/usb2/2-1/2-1.3/2-1.3:1.0/input/input1
generic-usb 0003:15D9:0A4C.0001: input: USB HID v1.11 Mouse [ USB OPTICAL MOUSE] on usb-ehci-omap-1.3/input0
usb 2-1.3: USB disconnect, address 4
mmc0: card b368 removed
mmcblk0: retrying using single block read
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status 0x0
mmcblk0: error -110 transferring data, sector 14644425, nr 8, card status 0x0
end_request: I/O error, dev mmcblk0, sector 14644425
end_request: I/O error, dev mmcblk0, sector 14644426
EXT3-fs error (device mmcblk0p2): ext3_find_entry: reading directory #445281 offset 0
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status 0x0
mmcblk0: error -110 transferring data, sector 144585, nr 8, card status 0x0
mmcblk0: error -110 requesting status
end_request: I/O error, dev mmcblk0, sector 144585
Buffer I/O error on device mmcblk0p2, logical block 0
lost page write due to I/O error on mmcblk0p2
mmcblk0: error -110 sending status comand
mmcblk0: error -110 sending read/write command, response 0x0, card status 0x0
mmcblk0: error -110 transferring data, sector 2256, nr 1, card status 0x0
end_request: I/O error, dev mmcblk0, sector 2256
FAT: Directory bread(block 2256) failed