mirror of
git://projects.qi-hardware.com/xburst-tools.git
synced 2024-11-25 18:05:00 +02:00
some cleanup. cleanup Makefile and README
This commit is contained in:
parent
0a66ef5e52
commit
f90fa84e89
140
Makefile
140
Makefile
@ -1,8 +1,7 @@
|
|||||||
|
# "PanGu Makefile" - for setting up the PanGu development environment
|
||||||
# "PI Makefile" - for setting up the PI development environment
|
|
||||||
#
|
#
|
||||||
# (C) Copyright 2009 PI.
|
# Copyright 2009 (C) Qi Hardware inc.,
|
||||||
# Author: xiangfu liu <xiangfu@openmoko.org>
|
# Author: Xiangfu Liu <xiangfu@qi-hardware.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -18,138 +17,26 @@
|
|||||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||||
# Boston, MA 02110-1301, USA
|
# Boston, MA 02110-1301, USA
|
||||||
|
|
||||||
BINUTILS_VER=binutils-2.17
|
|
||||||
GCC_VER=gcc-4.1.2
|
|
||||||
GLIBC_VER=glibc-2.6.1
|
|
||||||
GLIBC_PORTS_VER=glibc-ports-2.6.1
|
|
||||||
KERNEL_HEADERS_VER=linux-headers-2.6.24.3
|
|
||||||
|
|
||||||
TOOLCHAIN_PATH=toolchain
|
|
||||||
DL_PATH=$(TOOLCHAIN_PATH)/dl
|
|
||||||
INSTALL_PATH=install
|
|
||||||
PATCHES_PATH=$(TOOLCHAIN_PATH)/patches
|
|
||||||
GLIBC_PATCHES_PATH=$(PATCHES_PATH)/glibc
|
|
||||||
|
|
||||||
BINUTILS_PACKAGE=$(BINUTILS_VER).tar.bz2
|
|
||||||
BINUTILS_URL= \
|
|
||||||
ftp://ftp.gnu.org/gnu/binutils/$(BINUTILS_PACKAGE)
|
|
||||||
GCC_PACKAGE=$(GCC_VER).tar.bz2
|
|
||||||
GCC_URL=ftp://ftp.gnu.org/gnu/gcc/$(GCC_VER)/$(GCC_PACKAGE)
|
|
||||||
GLIBC_PACKAGE=$(GLIBC_VER).tar.bz2
|
|
||||||
GLIBC_URL=ftp://ftp.gnu.org/gnu/glibc/$(GLIBC_PACKAGE)
|
|
||||||
GLIBC_PORTS_PACKAGE=$(GLIBC_PORTS_VER).tar.bz2
|
|
||||||
GLIBC_PORTS_URL=ftp://ftp.gnu.org/gnu/glibc/$(GLIBC_PORTS_PACKAGE)
|
|
||||||
KERNEL_HEADERS_PACKAGE=$(KERNEL_HEADERS_VER).tar.bz2
|
|
||||||
KERNEL_HEADERS_URL=
|
|
||||||
|
|
||||||
# for the device stage
|
# for the device stage
|
||||||
FLASH_TOOL_PATH = ./usbboot
|
FLASH_TOOL_PATH = ./usbboot
|
||||||
FLASH_TOOL_BIN_PATH = $(FLASH_TOOL_PATH)/bin
|
|
||||||
STAGE1_PATH = $(FLASH_TOOL_PATH)/xburst_stage1
|
STAGE1_PATH = $(FLASH_TOOL_PATH)/xburst_stage1
|
||||||
STAGE2_PATH = $(FLASH_TOOL_PATH)/xburst_stage2
|
STAGE2_PATH = $(FLASH_TOOL_PATH)/xburst_stage2
|
||||||
CROSS_COMPILE ?= mipsel-openwrt-linux-
|
CROSS_COMPILE ?= mipsel-openwrt-linux-
|
||||||
|
|
||||||
CFLAGS="-O2"
|
CFLAGS="-O2"
|
||||||
|
|
||||||
export PATH:=$(PWD)/install/bin:$(PATH)
|
|
||||||
|
|
||||||
# this glibc version does not build with gcc 4.3 - hence this special compat parameter
|
|
||||||
GCC_VERSION=$(shell [ "`gcc --version | grep '4.3'`" ] && echo "43" )
|
|
||||||
ifeq ($(GCC_VERSION),43)
|
|
||||||
BUILD_CC="gcc -fgnu89-inline"
|
|
||||||
else
|
|
||||||
BUILD_CC="gcc"
|
|
||||||
endif
|
|
||||||
|
|
||||||
toolchain: binutils gcc glibc
|
|
||||||
|
|
||||||
### misc
|
|
||||||
|
|
||||||
$(DL_PATH):
|
|
||||||
mkdir -p $(DL_PATH)
|
|
||||||
|
|
||||||
$(INSTALL_PATH):
|
|
||||||
mkdir -p $(INSTALL_PATH)
|
|
||||||
|
|
||||||
%$(BINUTILS_PACKAGE): URL=$(BINUTILS_URL)
|
|
||||||
%$(GCC_PACKAGE): URL=$(GCC_URL)
|
|
||||||
%$(GLIBC_PACKAGE): URL=$(GLIBC_URL)
|
|
||||||
%$(GLIBC_PORTS_PACKAGE): URL=$(GLIBC_PORTS_URL)
|
|
||||||
|
|
||||||
.tar.bz2: $(DL_PATH) $(INSTALL_PATH)
|
|
||||||
wget -c -O $@ $(URL)
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
|
|
||||||
### toolchain stuff
|
|
||||||
binutils: $(DL_PATH)/$(BINUTILS_PACKAGE)
|
|
||||||
tar -xvjf $(DL_PATH)/$(BINUTILS_PACKAGE) -C $(TOOLCHAIN_PATH)
|
|
||||||
mkdir -p $(TOOLCHAIN_PATH)/$(BINUTILS_VER)/build
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(BINUTILS_VER)/build && \
|
|
||||||
../configure --target=mipsel-linux --prefix=$(PWD)/$(INSTALL_PATH) --disable-werror \
|
|
||||||
&& make CFLAGS=$(CFLAGS) && make install
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
gcc: $(DL_PATH)/$(GCC_PACKAGE)
|
|
||||||
tar -xvjf $(DL_PATH)/$(GCC_PACKAGE) -C $(TOOLCHAIN_PATH)
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(GCC_VER)/libiberty && \
|
|
||||||
cat strsignal.c | sed -e 's/#ifndef HAVE_PSIGNAL/#if 0/g' >junk.c && \
|
|
||||||
cp -f strsignal.c strsignal.c.fixed && mv -f junk.c strsignal.c
|
|
||||||
mkdir -p $(TOOLCHAIN_PATH)/$(GCC_VER)/build
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(GCC_VER)/build && \
|
|
||||||
../configure --target=mipsel-linux \
|
|
||||||
--host=i686-pc-linux-gnu --prefix=$(PWD)/$(INSTALL_PATH) \
|
|
||||||
--disable-shared --disable-threads --disable-multilib \
|
|
||||||
--enable-languages=c && make CFLAGS=$(CFLAGS) all-gcc && make install-gcc
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
glibc: $(DL_PATH)/$(GLIBC_PACKAGE) $(DL_PATH)/$(GLIBC_PORTS_PACKAGE) $(DL_PATH)/$(KERNEL_HEADERS_PACKAGE)
|
|
||||||
tar -xvjf $(DL_PATH)/$(KERNEL_HEADERS_PACKAGE) -C $(TOOLCHAIN_PATH)
|
|
||||||
tar -xvjf $(DL_PATH)/$(GLIBC_PACKAGE) -C $(TOOLCHAIN_PATH)
|
|
||||||
tar -xvjf $(DL_PATH)/$(GLIBC_PORTS_PACKAGE) -C $(TOOLCHAIN_PATH)/$(GLIBC_VER)
|
|
||||||
mv $(TOOLCHAIN_PATH)/$(GLIBC_VER)/$(GLIBC_PORTS_VER) $(TOOLCHAIN_PATH)/$(GLIBC_VER)/ports
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(GLIBC_VER) && \
|
|
||||||
patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-cross_hacks-1.patch && \
|
|
||||||
patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-libgcc_eh-1.patch && \
|
|
||||||
patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-localedef_segfault-1.patch && \
|
|
||||||
patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-mawk_fix-1.patch
|
|
||||||
# patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-alpha_ioperm_fix-1.patch && \
|
|
||||||
# patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-RTLD_SINGLE_THREAD_P-1.patch && \
|
|
||||||
# patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-sysdep_cancel-1.patch && \
|
|
||||||
# patch -Np1 -i $(PWD)/$(GLIBC_PATCHES_PATH)/glibc-2.6.1-hppa_nptl-1.patch
|
|
||||||
mkdir -p $(TOOLCHAIN_PATH)/$(GLIBC_VER)/build
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(GLIBC_VER)/build && \
|
|
||||||
echo "libc_cv_forced_unwind=yes" > config.cache && \
|
|
||||||
echo "libc_cv_c_cleanup=yes" >> config.cache && \
|
|
||||||
echo "libc_cv_mips_tls=yes" >> config.cache && \
|
|
||||||
BUILD_CC=$(BUILD_CC) CC="mipsel-linux-gcc" \
|
|
||||||
AR="mipsel-linux-ar" RANLIB="mipsel-linux-ranlib" \
|
|
||||||
../configure --prefix=$(PWD)/$(INSTALL_PATH) --libexecdir=$(PWD)/$(INSTALL_PATH)/libexec/glibc \
|
|
||||||
--host=mipsel-linux --build=i686-pc-linux-gnu \
|
|
||||||
--disable-profile --enable-add-ons --with-tls --enable-kernel=2.6.0 \
|
|
||||||
--with-__thread --with-binutils=$(PWD)/$(INSTALL_PATH)/bin \
|
|
||||||
--with-headers=$(PWD)/$(TOOLCHAIN_PATH)/$(KERNEL_HEADERS_VER) \
|
|
||||||
--cache-file=config.cache && \
|
|
||||||
make CFLAGS=$(CFLAGS) && make install
|
|
||||||
cp $(GLIBC_PATCHES_PATH)/SUPPORTED $(TOOLCHAIN_PATH)/$(GLIBC_VER)/localedata/
|
|
||||||
cd $(TOOLCHAIN_PATH)/$(GLIBC_VER)/build && \
|
|
||||||
make localedata/install-locales
|
|
||||||
touch $@
|
|
||||||
|
|
||||||
### u-boot
|
### u-boot
|
||||||
.PHONY: u-boot
|
.PHONY: u-boot
|
||||||
u-boot:
|
u-boot:
|
||||||
export PATH=/opt/mipseltools-gcc412-glibc261/bin:$PATH
|
git clone git://github.com/xiangfu/qi-u-boot.git u-boot
|
||||||
git clone git://github.com/xiangfu/pi-u-boot.git u-boot
|
|
||||||
cd u-boot && \
|
cd u-boot && \
|
||||||
make pi_config && \
|
make qi_lb60_config && \
|
||||||
make
|
make
|
||||||
|
|
||||||
### kernel
|
### kernel
|
||||||
.PHONY: kernel
|
.PHONY: kernel
|
||||||
kernel:
|
kernel:
|
||||||
export PATH=/opt/mipseltools-gcc412-glibc261/bin:$PATH
|
git clone git://github.com/xiangfu/qi-kernel.git kernel
|
||||||
git clone git://github.com/xiangfu/pi-kernel.git kernel
|
|
||||||
cd kernel && \
|
cd kernel && \
|
||||||
make pi_defconfig && \
|
make pi_defconfig && \
|
||||||
make uImage
|
make uImage
|
||||||
@ -157,13 +44,10 @@ kernel:
|
|||||||
### flash-boot
|
### flash-boot
|
||||||
.PHONY: usbboot
|
.PHONY: usbboot
|
||||||
usbboot: stage1 stage2
|
usbboot: stage1 stage2
|
||||||
mkdir -p $(FLASH_TOOL_BIN_PATH)
|
cd $(FLASH_TOOL_PATH)
|
||||||
cp $(FLASH_TOOL_PATH)/src/usbboot.cfg $(FLASH_TOOL_BIN_PATH)
|
|
||||||
cd $(FLASH_TOOL_PATH) && \
|
|
||||||
./autogen.sh && \
|
./autogen.sh && \
|
||||||
./configure && \
|
./configure && \
|
||||||
make
|
make
|
||||||
cp $(FLASH_TOOL_PATH)/src/usbboot $(FLASH_TOOL_BIN_PATH)
|
|
||||||
|
|
||||||
stage1:
|
stage1:
|
||||||
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
|
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE1_PATH)
|
||||||
@ -172,7 +56,7 @@ stage2:
|
|||||||
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
|
make CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
|
||||||
|
|
||||||
### clean up
|
### clean up
|
||||||
distclean: clean clean-usbboot clean-toolchain
|
distclean: clean clean-usbboot
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
@ -181,14 +65,6 @@ clean-usbboot:
|
|||||||
make clean CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
|
make clean CROSS_COMPILE=$(CROSS_COMPILE) -C $(STAGE2_PATH)
|
||||||
make clean -C $(FLASH_TOOL_PATH)
|
make clean -C $(FLASH_TOOL_PATH)
|
||||||
|
|
||||||
clean-toolchain: clean-glibc
|
|
||||||
rm -rf $(TOOLCHAIN_PATH)/$(BINUTILS_VER) binutils
|
|
||||||
rm -rf $(TOOLCHAIN_PATH)/$(GCC_VER) gcc
|
|
||||||
rm -rf $(INSTALL_PATH)
|
|
||||||
|
|
||||||
clean-glibc:
|
|
||||||
rm -rf $(TOOLCHAIN_PATH)/$(GLIBC_VER) glibc
|
|
||||||
|
|
||||||
help:
|
help:
|
||||||
@make --print-data-base --question | \
|
@make --print-data-base --question | \
|
||||||
awk '/^[^.%][-A-Za-z0-9_]*:/ \
|
awk '/^[^.%][-A-Za-z0-9_]*:/ \
|
||||||
|
67
README
67
README
@ -1,22 +1,28 @@
|
|||||||
=Cross toolchain=
|
=serial console=
|
||||||
you can get the cross toolchain at:
|
take off the cover of PCB, then you will send the "GND" and "TXD"
|
||||||
http://www.openmobilefree.net/other/file/mipseltools-gcc412-glibc261.tar.bz2
|
and th TP74 is the "RXD", you can get serial output from those pins
|
||||||
ftp://ftp.ingenic.cn/3sw/01linux/00toolchain/mipseltools-gcc412-glibc261.tar.bz2
|
you need a TTL <-> RS232 converter. here[1] is the serial PIN in the board.
|
||||||
ftp://ftp.ingenic.cn/3sw/01linux/00toolchain/jz-crosstools-src.tar.bz2
|
|
||||||
|
|
||||||
or you can build is from source:
|
=toolchain=
|
||||||
make toolchain
|
$ git clone git://github.com/lindnermarek/openwrt-x-burst.git[2]
|
||||||
|
$ git checkout --track -b x-burst origin/x-burst
|
||||||
|
$ make menuconfig
|
||||||
|
(select 'XBurst JZ47x0 [2.6]' in Target System
|
||||||
|
for configure the u-boot in setp: 4)
|
||||||
|
$ make
|
||||||
|
we will get toolchain under /PATH/TO/openwrt-x-burst/staging_dir/
|
||||||
|
toolchain-mipsel_gcc-4.1.2_uClibc-0.9.30.1/usr/bin
|
||||||
|
|
||||||
=Serial Console=
|
=xburst-tools (reflash tools)=
|
||||||
1. open the case
|
you can get source in git://github.com/xiangfu/xburst-tools.git[3]
|
||||||
|
|
||||||
2. take off the cover of PCB
|
=u-boot=
|
||||||
then you will send the "GND" and "TXD"
|
in openWRT menuconfig-->Target Images-->Build U-Boot bootloader -->
|
||||||
and th TP74 is the "RXD"
|
U-Boot target board (NEW) --> input 'qi_lb60'
|
||||||
you can get serial output from those pins
|
here[4] is the u-boot github URL
|
||||||
|
|
||||||
3. you need a "RS-232 <--> TTL" converter to
|
=kernel(2.6.24)=
|
||||||
get the correct output date
|
here[5] is the kernel GIT URL.
|
||||||
|
|
||||||
=CPU Jz4740=
|
=CPU Jz4740=
|
||||||
Jz4740 is a multimedia application processor targeted at mobile devices
|
Jz4740 is a multimedia application processor targeted at mobile devices
|
||||||
@ -26,18 +32,23 @@ high performance and a low power consumption solution for embedded devices.
|
|||||||
|
|
||||||
Boot up
|
Boot up
|
||||||
The Jz4740 can be set to boot from NOR or NAND.
|
The Jz4740 can be set to boot from NOR or NAND.
|
||||||
If booted from NAND, the CPU fetches the first page from NAND and uses the first 4 bytes on it to know how the NAND chip should be treated (16/8-bit bus, 2/3 row cycles).
|
If booted from NAND, the CPU fetches the first page from NAND and uses the
|
||||||
After that it copies the first 8kB from NAND and copies it to the I-Cache for execution.
|
first 4 bytes on it to know how the NAND chip should be treated (16/8-bit
|
||||||
|
bus, 2/3 row cycles). After that it copies the first 8kB from NAND and
|
||||||
|
copies it to the I-Cache for execution.
|
||||||
|
|
||||||
Ingenic Media Extension Instruction Set
|
Ingenic Media Extension Instruction Set
|
||||||
According to the MXU User Guide, the XBurst processor supports additional instructions called the Ingenic Media Extension Instruction Set (they call it an SIMD instruction set).
|
According to the MXU User Guide, the XBurst processor supports additional
|
||||||
|
instructions called the Ingenic Media Extension Instruction Set (they
|
||||||
|
call it an SIMD instruction set).
|
||||||
|
|
||||||
Excerpt from the PDF:
|
Excerpt from the PDF:
|
||||||
Processors (such as the Jz4740) have 60 extra SIMD commands used for the optimization of multimedia codecs such as MPEG4, H264, VC-1, RMVB, ... and other multimedia decoder algorithms that can be optimized using the MXU.
|
Processors (such as the Jz4740) have 60 extra SIMD commands used for the
|
||||||
|
optimization of multimedia codecs such as MPEG4, H264, VC-1, RMVB, ...
|
||||||
|
and other multimedia decoder algorithms that can be optimized using the MXU.
|
||||||
|
|
||||||
Image Processing Unit
|
Image Processing Unit
|
||||||
The Jz4740 also has an IPU which has the following features:
|
The Jz4740 also has an IPU which has the following features:
|
||||||
|
|
||||||
* Video frame resize
|
* Video frame resize
|
||||||
* Color space conversion: 420/444/422 YUV to RGB convert
|
* Color space conversion: 420/444/422 YUV to RGB convert
|
||||||
|
|
||||||
@ -46,3 +57,19 @@ The Jz4740 also has an IPU which has the following features:
|
|||||||
2. edit the file under 'debian' folder (create by 'dh_make')
|
2. edit the file under 'debian' folder (create by 'dh_make')
|
||||||
3. run 'dpkg-buildpackage -rfakeroot' to create the deb package and source
|
3. run 'dpkg-buildpackage -rfakeroot' to create the deb package and source
|
||||||
package
|
package
|
||||||
|
|
||||||
|
----
|
||||||
|
[1] http://www.openmobilefree.net/?p=61
|
||||||
|
[2] here is the web site
|
||||||
|
http://github.com/lindnermarek/openwrt-x-burst/commits/x-burst
|
||||||
|
now we put the code in github.com
|
||||||
|
[3] in folder 'usbboot', here is the tar package and Debian package.
|
||||||
|
http://cloud.github.com/downloads/xiangfu/xburst-tools/xburst-tools_0.0_200906.tar.gz
|
||||||
|
http://cloud.github.com/downloads/xiangfu/xburst-tools/xburst-tools_0.0_200906-1_i386.deb
|
||||||
|
[4] http://github.com/xiangfu/qi-u-boot/tree
|
||||||
|
this git repos have two branch [master] [pi]
|
||||||
|
[master] is the v2009.06
|
||||||
|
[pi] is 1.1.6 old version.(will detele laster)
|
||||||
|
[5] git://github.com/xiangfu/qi-kernel.git
|
||||||
|
only one master branch in kernel git. so you can just
|
||||||
|
'git clone' and 'make uImage' to get the kernel image
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
|
|
||||||
OWRT_SVN_PATH = openwrt-trunk
|
|
||||||
|
|
||||||
owrt_checkout:
|
|
||||||
svn co -r r15323 svn://svn.openwrt.org/openwrt/trunk $(OWRT_SVN_PATH)
|
|
||||||
cd $(OWRT_SVN_PATH) && patch -p0 < ../openwrt-jz47x0-r15323.diff
|
|
||||||
touch $@
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user