Git Product home page Git Product logo

sunxi-tools's Introduction

	Linux kernel release 3.x <http://kernel.org/>

These are the release notes for Linux version 3.  Read them carefully,
as they tell you what this is all about, explain how to install the
kernel, and what to do if something goes wrong. 

WHAT IS LINUX?

  Linux is a clone of the operating system Unix, written from scratch by
  Linus Torvalds with assistance from a loosely-knit team of hackers across
  the Net. It aims towards POSIX and Single UNIX Specification compliance.

  It has all the features you would expect in a modern fully-fledged Unix,
  including true multitasking, virtual memory, shared libraries, demand
  loading, shared copy-on-write executables, proper memory management,
  and multistack networking including IPv4 and IPv6.

  It is distributed under the GNU General Public License - see the
  accompanying COPYING file for more details. 

ON WHAT HARDWARE DOES IT RUN?

  Although originally developed first for 32-bit x86-based PCs (386 or higher),
  today Linux also runs on (at least) the Compaq Alpha AXP, Sun SPARC and
  UltraSPARC, Motorola 68000, PowerPC, PowerPC64, ARM, Hitachi SuperH, Cell,
  IBM S/390, MIPS, HP PA-RISC, Intel IA-64, DEC VAX, AMD x86-64, AXIS CRIS,
  Xtensa, Tilera TILE, AVR32 and Renesas M32R architectures.

  Linux is easily portable to most general-purpose 32- or 64-bit architectures
  as long as they have a paged memory management unit (PMMU) and a port of the
  GNU C compiler (gcc) (part of The GNU Compiler Collection, GCC). Linux has
  also been ported to a number of architectures without a PMMU, although
  functionality is then obviously somewhat limited.
  Linux has also been ported to itself. You can now run the kernel as a
  userspace application - this is called UserMode Linux (UML).

DOCUMENTATION:

 - There is a lot of documentation available both in electronic form on
   the Internet and in books, both Linux-specific and pertaining to
   general UNIX questions.  I'd recommend looking into the documentation
   subdirectories on any Linux FTP site for the LDP (Linux Documentation
   Project) books.  This README is not meant to be documentation on the
   system: there are much better sources available.

 - There are various README files in the Documentation/ subdirectory:
   these typically contain kernel-specific installation notes for some 
   drivers for example. See Documentation/00-INDEX for a list of what
   is contained in each file.  Please read the Changes file, as it
   contains information about the problems, which may result by upgrading
   your kernel.

 - The Documentation/DocBook/ subdirectory contains several guides for
   kernel developers and users.  These guides can be rendered in a
   number of formats:  PostScript (.ps), PDF, HTML, & man-pages, among others.
   After installation, "make psdocs", "make pdfdocs", "make htmldocs",
   or "make mandocs" will render the documentation in the requested format.

INSTALLING the kernel source:

 - If you install the full sources, put the kernel tarball in a
   directory where you have permissions (eg. your home directory) and
   unpack it:

		gzip -cd linux-3.X.tar.gz | tar xvf -

   or
		bzip2 -dc linux-3.X.tar.bz2 | tar xvf -


   Replace "XX" with the version number of the latest kernel.

   Do NOT use the /usr/src/linux area! This area has a (usually
   incomplete) set of kernel headers that are used by the library header
   files.  They should match the library, and not get messed up by
   whatever the kernel-du-jour happens to be.

 - You can also upgrade between 3.x releases by patching.  Patches are
   distributed in the traditional gzip and the newer bzip2 format.  To
   install by patching, get all the newer patch files, enter the
   top level directory of the kernel source (linux-3.x) and execute:

		gzip -cd ../patch-3.x.gz | patch -p1

   or
		bzip2 -dc ../patch-3.x.bz2 | patch -p1

   (repeat xx for all versions bigger than the version of your current
   source tree, _in_order_) and you should be ok.  You may want to remove
   the backup files (xxx~ or xxx.orig), and make sure that there are no
   failed patches (xxx# or xxx.rej). If there are, either you or me has
   made a mistake.

   Unlike patches for the 3.x kernels, patches for the 3.x.y kernels
   (also known as the -stable kernels) are not incremental but instead apply
   directly to the base 3.x kernel.  Please read
   Documentation/applying-patches.txt for more information.

   Alternatively, the script patch-kernel can be used to automate this
   process.  It determines the current kernel version and applies any
   patches found.

		linux/scripts/patch-kernel linux

   The first argument in the command above is the location of the
   kernel source.  Patches are applied from the current directory, but
   an alternative directory can be specified as the second argument.

 - If you are upgrading between releases using the stable series patches
   (for example, patch-3.x.y), note that these "dot-releases" are
   not incremental and must be applied to the 3.x base tree. For
   example, if your base kernel is 3.0 and you want to apply the
   3.0.3 patch, you do not and indeed must not first apply the
   3.0.1 and 3.0.2 patches. Similarly, if you are running kernel
   version 3.0.2 and want to jump to 3.0.3, you must first
   reverse the 3.0.2 patch (that is, patch -R) _before_ applying
   the 3.0.3 patch.
   You can read more on this in Documentation/applying-patches.txt

 - Make sure you have no stale .o files and dependencies lying around:

		cd linux
		make mrproper

   You should now have the sources correctly installed.

SOFTWARE REQUIREMENTS

   Compiling and running the 3.x kernels requires up-to-date
   versions of various software packages.  Consult
   Documentation/Changes for the minimum version numbers required
   and how to get updates for these packages.  Beware that using
   excessively old versions of these packages can cause indirect
   errors that are very difficult to track down, so don't assume that
   you can just update packages when obvious problems arise during
   build or operation.

BUILD directory for the kernel:

   When compiling the kernel all output files will per default be
   stored together with the kernel source code.
   Using the option "make O=output/dir" allow you to specify an alternate
   place for the output files (including .config).
   Example:
     kernel source code:	/usr/src/linux-3.N
     build directory:		/home/name/build/kernel

   To configure and build the kernel use:
   cd /usr/src/linux-3.N
   make O=/home/name/build/kernel menuconfig
   make O=/home/name/build/kernel
   sudo make O=/home/name/build/kernel modules_install install

   Please note: If the 'O=output/dir' option is used then it must be
   used for all invocations of make.

CONFIGURING the kernel:

   Do not skip this step even if you are only upgrading one minor
   version.  New configuration options are added in each release, and
   odd problems will turn up if the configuration files are not set up
   as expected.  If you want to carry your existing configuration to a
   new version with minimal work, use "make oldconfig", which will
   only ask you for the answers to new questions.

 - Alternate configuration commands are:
	"make config"      Plain text interface.
	"make menuconfig"  Text based color menus, radiolists & dialogs.
	"make nconfig"     Enhanced text based color menus.
	"make xconfig"     X windows (Qt) based configuration tool.
	"make gconfig"     X windows (Gtk) based configuration tool.
	"make oldconfig"   Default all questions based on the contents of
			   your existing ./.config file and asking about
			   new config symbols.
	"make silentoldconfig"
			   Like above, but avoids cluttering the screen
			   with questions already answered.
			   Additionally updates the dependencies.
	"make defconfig"   Create a ./.config file by using the default
			   symbol values from either arch/$ARCH/defconfig
			   or arch/$ARCH/configs/${PLATFORM}_defconfig,
			   depending on the architecture.
	"make ${PLATFORM}_defconfig"
			  Create a ./.config file by using the default
			  symbol values from
			  arch/$ARCH/configs/${PLATFORM}_defconfig.
			  Use "make help" to get a list of all available
			  platforms of your architecture.
	"make allyesconfig"
			   Create a ./.config file by setting symbol
			   values to 'y' as much as possible.
	"make allmodconfig"
			   Create a ./.config file by setting symbol
			   values to 'm' as much as possible.
	"make allnoconfig" Create a ./.config file by setting symbol
			   values to 'n' as much as possible.
	"make randconfig"  Create a ./.config file by setting symbol
			   values to random values.

   You can find more information on using the Linux kernel config tools
   in Documentation/kbuild/kconfig.txt.

	NOTES on "make config":
	- having unnecessary drivers will make the kernel bigger, and can
	  under some circumstances lead to problems: probing for a
	  nonexistent controller card may confuse your other controllers
	- compiling the kernel with "Processor type" set higher than 386
	  will result in a kernel that does NOT work on a 386.  The
	  kernel will detect this on bootup, and give up.
	- A kernel with math-emulation compiled in will still use the
	  coprocessor if one is present: the math emulation will just
	  never get used in that case.  The kernel will be slightly larger,
	  but will work on different machines regardless of whether they
	  have a math coprocessor or not. 
	- the "kernel hacking" configuration details usually result in a
	  bigger or slower kernel (or both), and can even make the kernel
	  less stable by configuring some routines to actively try to
	  break bad code to find kernel problems (kmalloc()).  Thus you
	  should probably answer 'n' to the questions for
          "development", "experimental", or "debugging" features.

COMPILING the kernel:

 - Make sure you have at least gcc 3.2 available.
   For more information, refer to Documentation/Changes.

   Please note that you can still run a.out user programs with this kernel.

 - Do a "make" to create a compressed kernel image. It is also
   possible to do "make install" if you have lilo installed to suit the
   kernel makefiles, but you may want to check your particular lilo setup first.

   To do the actual install you have to be root, but none of the normal
   build should require that. Don't take the name of root in vain.

 - If you configured any of the parts of the kernel as `modules', you
   will also have to do "make modules_install".

 - Verbose kernel compile/build output:

   Normally the kernel build system runs in a fairly quiet mode (but not
   totally silent).  However, sometimes you or other kernel developers need
   to see compile, link, or other commands exactly as they are executed.
   For this, use "verbose" build mode.  This is done by inserting
   "V=1" in the "make" command.  E.g.:

	make V=1 all

   To have the build system also tell the reason for the rebuild of each
   target, use "V=2".  The default is "V=0".

 - Keep a backup kernel handy in case something goes wrong.  This is 
   especially true for the development releases, since each new release
   contains new code which has not been debugged.  Make sure you keep a
   backup of the modules corresponding to that kernel, as well.  If you
   are installing a new kernel with the same version number as your
   working kernel, make a backup of your modules directory before you
   do a "make modules_install".
   Alternatively, before compiling, use the kernel config option
   "LOCALVERSION" to append a unique suffix to the regular kernel version.
   LOCALVERSION can be set in the "General Setup" menu.

 - In order to boot your new kernel, you'll need to copy the kernel
   image (e.g. .../linux/arch/i386/boot/bzImage after compilation)
   to the place where your regular bootable kernel is found. 

 - Booting a kernel directly from a floppy without the assistance of a
   bootloader such as LILO, is no longer supported.

   If you boot Linux from the hard drive, chances are you use LILO which
   uses the kernel image as specified in the file /etc/lilo.conf.  The
   kernel image file is usually /vmlinuz, /boot/vmlinuz, /bzImage or
   /boot/bzImage.  To use the new kernel, save a copy of the old image
   and copy the new image over the old one.  Then, you MUST RERUN LILO
   to update the loading map!! If you don't, you won't be able to boot
   the new kernel image.

   Reinstalling LILO is usually a matter of running /sbin/lilo. 
   You may wish to edit /etc/lilo.conf to specify an entry for your
   old kernel image (say, /vmlinux.old) in case the new one does not
   work.  See the LILO docs for more information. 

   After reinstalling LILO, you should be all set.  Shutdown the system,
   reboot, and enjoy!

   If you ever need to change the default root device, video mode,
   ramdisk size, etc.  in the kernel image, use the 'rdev' program (or
   alternatively the LILO boot options when appropriate).  No need to
   recompile the kernel to change these parameters. 

 - Reboot with the new kernel and enjoy. 

IF SOMETHING GOES WRONG:

 - If you have problems that seem to be due to kernel bugs, please check
   the file MAINTAINERS to see if there is a particular person associated
   with the part of the kernel that you are having trouble with. If there
   isn't anyone listed there, then the second best thing is to mail
   them to me ([email protected]), and possibly to any other
   relevant mailing-list or to the newsgroup.

 - In all bug-reports, *please* tell what kernel you are talking about,
   how to duplicate the problem, and what your setup is (use your common
   sense).  If the problem is new, tell me so, and if the problem is
   old, please try to tell me when you first noticed it.

 - If the bug results in a message like

	unable to handle kernel paging request at address C0000010
	Oops: 0002
	EIP:   0010:XXXXXXXX
	eax: xxxxxxxx   ebx: xxxxxxxx   ecx: xxxxxxxx   edx: xxxxxxxx
	esi: xxxxxxxx   edi: xxxxxxxx   ebp: xxxxxxxx
	ds: xxxx  es: xxxx  fs: xxxx  gs: xxxx
	Pid: xx, process nr: xx
	xx xx xx xx xx xx xx xx xx xx

   or similar kernel debugging information on your screen or in your
   system log, please duplicate it *exactly*.  The dump may look
   incomprehensible to you, but it does contain information that may
   help debugging the problem.  The text above the dump is also
   important: it tells something about why the kernel dumped code (in
   the above example it's due to a bad kernel pointer). More information
   on making sense of the dump is in Documentation/oops-tracing.txt

 - If you compiled the kernel with CONFIG_KALLSYMS you can send the dump
   as is, otherwise you will have to use the "ksymoops" program to make
   sense of the dump (but compiling with CONFIG_KALLSYMS is usually preferred).
   This utility can be downloaded from
   ftp://ftp.<country>.kernel.org/pub/linux/utils/kernel/ksymoops/ .
   Alternately you can do the dump lookup by hand:

 - In debugging dumps like the above, it helps enormously if you can
   look up what the EIP value means.  The hex value as such doesn't help
   me or anybody else very much: it will depend on your particular
   kernel setup.  What you should do is take the hex value from the EIP
   line (ignore the "0010:"), and look it up in the kernel namelist to
   see which kernel function contains the offending address.

   To find out the kernel function name, you'll need to find the system
   binary associated with the kernel that exhibited the symptom.  This is
   the file 'linux/vmlinux'.  To extract the namelist and match it against
   the EIP from the kernel crash, do:

		nm vmlinux | sort | less

   This will give you a list of kernel addresses sorted in ascending
   order, from which it is simple to find the function that contains the
   offending address.  Note that the address given by the kernel
   debugging messages will not necessarily match exactly with the
   function addresses (in fact, that is very unlikely), so you can't
   just 'grep' the list: the list will, however, give you the starting
   point of each kernel function, so by looking for the function that
   has a starting address lower than the one you are searching for but
   is followed by a function with a higher address you will find the one
   you want.  In fact, it may be a good idea to include a bit of
   "context" in your problem report, giving a few lines around the
   interesting one. 

   If you for some reason cannot do the above (you have a pre-compiled
   kernel image or similar), telling me as much about your setup as
   possible will help.  Please read the REPORTING-BUGS document for details.

 - Alternately, you can use gdb on a running kernel. (read-only; i.e. you
   cannot change values or set break points.) To do this, first compile the
   kernel with -g; edit arch/i386/Makefile appropriately, then do a "make
   clean". You'll also need to enable CONFIG_PROC_FS (via "make config").

   After you've rebooted with the new kernel, do "gdb vmlinux /proc/kcore".
   You can now use all the usual gdb commands. The command to look up the
   point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes
   with the EIP value.)

   gdb'ing a non-running kernel currently fails because gdb (wrongly)
   disregards the starting offset for which the kernel is compiled.

sunxi-tools's People

Contributors

amery avatar apritzel avatar chalesyu avatar efii avatar enjens avatar gediz avatar hno avatar hramrach avatar icenowy avatar ijc avatar jacmet avatar jankowskib avatar jemk avatar jhswartz avatar jwrdegoede avatar karlp avatar libv avatar mripard avatar n1tehawk avatar oliv3r avatar patrickhwood avatar paulkocialkowski avatar pf4public avatar plaes avatar projectgus avatar qianfan-zhao avatar rma-x avatar ssvb avatar vishnupatekar avatar wens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sunxi-tools's Issues

Does 'sunxi-fel spl' supports allwinner t3 soc?

Next is the log, the soc is T3.

$ sudo sunxi-fel -l 
[sudo] password for x: 
USB device 003:005   Allwinner R40     12c00002:84404700:78868500:381f014f
$ sudo sunxi-fel -v spl boot0_sdcard_sun8iw11p1.bin
[sudo] password for x: 
Stack pointers: sp_irq=0x00002000, sp=0x00005E08
MMU is not enabled by BROM
usb_bulk_send() ERROR -7: Operation timed out

Boot info not passed via Sunxi SPL

Currently in the process of getting mainline U-boot and kernel ready for the Topwise A721. When trying the FEL USBboot, I noticed that when uploading boot.scr using sunxi-fel, the fel_scriptaddr does not get set in the SPL header and bootcmd_fel fails.

The sunxi-fel tool fails with:

sunxi SPL version mismatch: found 0x02 > maximum supported 0x01
You need a more recent version of this (sunxi-tools) fel utility.

However when manually increasing SPL_MAX_VERSION in fel.c to 2 the tool works as it should and I get

Passing boot info via sunxi SPL: script address = 0x43100000, uEnv length = 0

and U-boot loads the script automatically.

What is the deal here? I assume increasing the SPL_MAX_VERSION is not an correct solution, but what is?

fexc.c:71: bad if test ?

fexc.c:71:30: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]

Source code is

    } else if (errno != EAGAIN ||
           errno != EINTR) {

Suggest swap || for &&

fexc-bin - product.: unknown type 34

I know about the status of sunxi-script_extractor #69 #84, but i try to get a script.bin from A33 tablet and does not understand the error.

$ adb shell /data/local/tmp/sunxi-script_extractor > script_extractor.out
$ sunxi-fexc -v -I bin -O fex script_extractor.out script.fex
sunxi-fexc: from bin:script_extractor.out to fex:script.fex
fexc-bin: script_extractor.out: version: 1.2
fexc-bin: script_extractor.out: size: 131360 (79 sections), header value: 41512
E: fexc-bin: script_extractor.out: product.: unknown type 34
$ hexdump -C script_extractor.out | head
00000000  4f 00 00 00 28 a2 00 00  01 00 00 00 02 00 00 00  |O...(...........|
00000010  70 72 6f 64 75 63 74 00  00 00 00 00 00 00 00 00  |product.........|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  02 00 00 00 1a 03 00 00  70 6c 61 74 66 6f 72 6d  |........platform|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  02 00 00 00 2e 03 00 00  |................|
00000060  74 61 72 67 65 74 00 00  00 00 00 00 00 00 00 00  |target..........|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000080  03 00 00 00 42 03 00 00  6b 65 79 5f 64 65 74 65  |....B...key_dete|
00000090  63 74 5f 65 6e 00 00 00  00 00 00 00 00 00 00 00  |ct_en...........|
$ sunxi-fexc -?
sunxi-fexc v1.4.2-48-gd9b1d7e

Other tries with sunxi-fel read 0x43000000 0x20000 script.bin had also no success.

Version data check in script_bin.c needs to be relaxed

Recently surfaced .bin files show that our current understanding of the script.bin header may be incomplete / wrong. These files have a version[0] of 49152 = 0xC000, which also coincides with their file length (which includes significant padding with 0xFF bytes at the end).

However, this value in the version data won't pass our current sanity checks, so those have to be reworked - see e.g. comment (4.) in linux-sunxi/sunxi-boards@4794ed1.

New version release

Hello there,

is there any plan to make a new release. The latest one doesn't support the SPI flash related action, I wanted to write an u-boot binary to the OrangePI Zero with H2+.
This function is working and available in the master branch.

Thanks

AllwinnerH6出错usb_bulk_send() ERROR -9: Pipe error

E:\Allwinner\sunxi-tools-1.4.2>sunxi-fel -p uboot u-boot-sunxi-with-spl.bin write 0xa000000
Warning: no 'soc_sram_info' data for your SoC (id=1728)
usb_bulk_send() ERROR -9: Pipe error

E:\Allwinner\sunxi-tools-1.4.2>sunxi-fel spl u-boot-sunxi-with-spl.bin write 0xa00000000
usb_bulk_send() ERROR -7: Operation timed out

900kB/s FEL transfer speed on A13

when fiddling with nolimbook i've got 570kB/s while using win7_64 laptop (using binaries provided) and 944kB/s while using linux on opipc (armbian, kernel 3.4.112+ (from armbian but my own config))

1.4.1 fails building fel with gcc 6.2.1 on Fedora

Lots of undefined errors

+ make -j4 'CFLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99'
./autoversion.sh: line 9: git: command not found
Unable to determine current version (using "v1.4.1" as fallback)
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99  -o sunxi-fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c 
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99  -o sunxi-bootinfo bootinfo.c 
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99 `pkg-config --cflags libusb-1.0`  -o sunxi-fel fel.c progress.c  `pkg-config --libs libusb-1.0`
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99 -c -o nand-part-main.o nand-part-main.c
fel.c: In function 'get_image_type':
fel.c:164:6: warning: implicit declaration of function 'be32toh' [-Wimplicit-function-declaration]
  if (be32toh(buf32[0]) != IH_MAGIC) /* signature mismatch */
      ^~~~~~~
fel.c: In function 'aw_send_usb_request':
fel.c:178:14: warning: implicit declaration of function 'htole16' [-Wimplicit-function-declaration]
   .request = htole16(type),
              ^~~~~~~
fel.c:179:13: warning: implicit declaration of function 'htole32' [-Wimplicit-function-declaration]
   .length = htole32(length),
             ^~~~~~~
fel.c: In function 'aw_fel_get_version':
fel.c:242:17: warning: implicit declaration of function 'le32toh' [-Wimplicit-function-declaration]
  buf->soc_id = (le32toh(buf->soc_id) >> 8) & 0xFFFF;
                 ^~~~~~~
fel.c:245:20: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration]
  buf->scratchpad = le16toh(buf->scratchpad);
                    ^~~~~~~
fel.c: In function 'aw_fel_write_and_execute_spl':
fel.c:1217:2: warning: implicit declaration of function 'usleep' [-Wimplicit-function-declaration]
  usleep(250000);
  ^~~~~~
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99 -c -o nand-part-a10.o nand-part.c -D A10
nand-part.c: In function 'writembrs':
nand-part.c:240:2: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
  read(0, &yn, 1);
  ^~~~~~~~~~~~~~~
nand-part.c:251:3: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
   write(fd,mbr,MBR_SIZE);
   ^~~~~~~~~~~~~~~~~~~~~~
cc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Iinclude -D_POSIX_C_SOURCE=200112L -std=c99 -c -o nand-part-a20.o nand-part.c -D A20
nand-part.c: In function 'writembrs':
nand-part.c:240:2: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
  read(0, &yn, 1);
  ^~~~~~~~~~~~~~~
nand-part.c:251:3: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
   write(fd,mbr,MBR_SIZE);
   ^~~~~~~~~~~~~~~~~~~~~~
cc  -o sunxi-nand-part nand-part-main.o nand-part-a10.o nand-part-a20.o 
ln -nsf sunxi-fexc bin2fex
ln -nsf sunxi-fexc fex2bin
/tmp/ccgEW415.o: In function `get_image_type':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:164: undefined reference to `be32toh'
/tmp/ccgEW415.o: In function `aw_send_usb_request':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:179: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:180: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:178: undefined reference to `htole16'
/tmp/ccgEW415.o: In function `aw_send_fel_request':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:223: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:224: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:225: undefined reference to `htole32'
/tmp/ccgEW415.o: In function `aw_fel_get_version':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:242: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:243: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:244: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:245: undefined reference to `le16toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:246: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:247: undefined reference to `le32toh'
/tmp/ccgEW415.o: In function `aw_fel_write_uboot_image':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1267: undefined reference to `be32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1268: undefined reference to `be32toh'
/tmp/ccgEW415.o: In function `aw_fel_writel_n':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:763: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:764: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:765: 
RPM build errors:
undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:766: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:767: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:768: more undefined references to `htole32' follow
/tmp/ccgEW415.o: In function `aw_read_arm_cp_reg':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:692: undefined reference to `le32toh'
/tmp/ccgEW415.o: In function `aw_write_arm_cp_reg':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:706: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:707: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:708: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:709: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:710: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:711: more undefined references to `htole32' follow
/tmp/ccgEW415.o: In function `aw_fel_readl_n':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:743: undefined reference to `le32toh'
/tmp/ccgEW415.o: In function `aw_enable_l2_cache':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:814: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:815: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:816: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:817: undefined reference to `htole32'
/tmp/ccgEW415.o: In function `aw_get_stackinfo':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:843: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:844: more undefined references to `htole32' follow
/tmp/ccgEW415.o: In function `aw_get_stackinfo':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:858: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:859: undefined reference to `le32toh'
/tmp/ccgEW415.o: In function `aw_backup_and_disable_mmu':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:942: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:943: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:944: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:945: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:946: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:948: more undefined references to `htole32' follow
/tmp/ccgEW415.o: In function `aw_backup_and_disable_mmu':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:996: undefined reference to `le32toh'
/tmp/ccgEW415.o: In function `aw_restore_and_enable_mmu':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1027: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1028: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1029: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1030: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1031: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1032: more undefined references to `htole32' follow
/tmp/ccgEW415.o: In function `aw_fel_write_and_execute_spl':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1102: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1103: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1112: undefined reference to `le32toh'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1207: undefined reference to `htole32'
/tmp/ccgEW415.o: In function `pass_fel_information':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1367: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1368: undefined reference to `htole32'
/tmp/ccgEW415.o: In function `aw_rmr_request':
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1436: undefined reference to `htole32'
/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1437: undefined reference to `htole32'
/tmp/ccgEW415.o:/builddir/build/BUILD/sunxi-tools-1.4.1/fel.c:1438: more undefined references to `htole32' follow
collect2: error: ld returned 1 exit status
make: *** [Makefile:119: sunxi-fel] Error 1

Support a "--sid" option for device selection

We have incorporated some support for multiple USB devices connected to the same host in our sunxi-fel utility, allowing to select a specific device via USB bus and device number (--dev option).

As proposed in #37, an even more user-friendly way might be to support selection based on some unique device identifier; for example the SID. This could be done by adding a corresponding --sid <pattern> option. The details of how to match pattern haven't been elaborated yet. (substring, regex, ...?)

Right now the fel.c code is not prepared well for this enhancement. Historically, we've always created / selected a libusb handle once in a preparatory step, and then kept using it for an entire sunxi-fel "session". This needs to be rethought if we want to query several devices "in turn" (involving individual FEL communication to retrieve the ID each time), until we find the one that the user actually requested.

See also: #38

Fix fel-copy.c, clarify its usage (or remove it completely)

fel-copy.c doesn't seem to be referenced/used anywhere. It looks like it's supposed to be ARM "scratch" code that could be uploaded and executed via FEL, to assist with arbitrary copy operations (of 32-bit words) within SoC memory.

However, the current implementation has notable problems, and doesn't match the "Parameters" description.

b starts pointing to CONFIG_BASE (0x2100); but with the post-increment logic applied as-is, it ends up pointing to 0x2108, which is also the "destination" where the subsequent loop will start copying data words to. For an actual destination address parameter (as per the description), at least one level of indirection is missing. ptr gets b's address, meaning that the source pointer a is taken from (and later stored back to) 0x2100, not 0x2104. Something similar goes for the loop count i, which is taken from 0x2104, not 0x2108.

Either clean up this mess, or get rid of it. A possible alternative would be to have the scratch code in fel.c and add a correspondig copy (or copyl) command to the sunxi-fel utility.

Remove the workaround code from fel-sdboot.c (and possibly uart0-helloworld)

The root cause of the problems that surfaced with these ARM binaries is that the U-Boot mksunxiboot utility writes a minimal header that is too small to avoid corruption of actual code by the BROM bootloader. See https://patchwork.ozlabs.org/patch/622173.

Once this is fixed (in upstream U-Boot), we should probably revert the NOP padding used in fel-sdboot.c to circumvent this. The uart0-helloworld-sdboot.sunxi under development currently also contains a workaround that won't be needed any more afterwards.

A33(A23) seem non supported in uart0 hello world ?

Hi,
I'm trying to boot A33 tablet with fel or sdcard ,
i have breakout sd adapter , can i use uart0 hello world mixing uart0 and SD?

And with fel is possible to load hello-world image to sram and execute(whiteout SD)?

Any details/documentation for nand-part ?

Hi,

I need to use nand-part, but there is no documentation and details of this tool. Could you explain me this tool?

Could you explain me this command ?
What means "linux" and "8000000" here ? Which units ? MB ? KB ? Sectors ?

nand-part /dev/nand 'linux 8000000'  

Thanks in advance,

Use sunxi-fel to boot multiple devices in parallel

Maybe I simply miss something (like the sunxi-fel's progress bar I've not noticed for a long time). We changed our build process to be able to do FEL/NFS boot and I wanted now attach up to 4 sunxi boards to my new build host to be able to test them in parallel.

I attached two and get:

root@armbian:~# sunxi-fel -v ver
AWUSBFEX soc=00001680(H3) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000

root@armbian:~# lsusb | grep Onda
Bus 008 Device 002: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode
Bus 003 Device 002: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode

Is there already the possibility to specify bus/device ID and is sunxi-fel prepared to be run in multiple instances at the same time?

What happened with the progress flag of feh?

I see people using feh with --progress flag (see chip flashing scripts for example). Those people point to this repo for feh tool but there seems to be no --progress support (anymore?). And the chip flashing tool is failing.

no output .bin produced

Hi there

I don't get a .bin as output file:

root@debian:/usr/local/src# git clone https://github.com/amery/sunxi-tools
Cloning into sunxi-tools...
remote: Counting objects: 387, done.
remote: Compressing objects: 100% (153/153), done.
remote: Total 387 (delta 256), reused 361 (delta 230)
Receiving objects: 100% (387/387), 83.09 KiB, done.
Resolving deltas: 100% (256/256), done.
root@debian:/usr/local/src# cd sunxi-tools/
root@debian:/usr/local/src/sunxi-tools# make
gcc -g -O2 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -o fexc fexc.c script.c script_bin.c script_fex.c
ln -s fexc bin2fex
ln -s fexc fex2bin
gcc -g -O2 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L pkg-config --cflags libusb-1.0 -o fel fel.c pkg-config --libs libusb-1.0
root@debian:/usr/local/src/sunxi-tools# ./fex2bin -v ../scriptbin/myscript.fex script.bin
./fex2bin: from fex:../scriptbin/myscript.fex to bin:script.bin
root@debian:/usr/local/src/sunxi-tools# ls *.bin
ls: cannot access *.bin: No such file or directory

LiveSuit crash

image size is 513661952.

Log is as below:

You are running on Ubuntu
Dev Plugin The Device Path is: /dev/aw_efex0
*** glibc detected *** /home/xugz/Bin/./LiveSuit/bin/LiveSuit: free(): invalid pointer: 0x00007fd3eb6d6dc0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x7eb96)[0x7fd3f0451b96]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x30fd5)[0x7fd3eb6c6fd5]
./luaBase.dll(+0x13c9c)[0x7fd3e989cc9c]
./luaBase.dll(+0x17d88)[0x7fd3e98a0d88]
./luaBase.dll(+0x133cb)[0x7fd3e989c3cb]
./luaBase.dll(+0x1368a)[0x7fd3e989c68a]
./luaBase.dll(+0x13bb8)[0x7fd3e989cbb8]
./luaBase.dll(lua_pushlstring+0x2d)[0x7fd3e989792d]
./luaBase.dll(l_BuffertoChars+0xa7)[0x7fd3e9890874]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x26c51)[0x7fd3eb6bcc51]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x30509)[0x7fd3eb6c6509]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x2711d)[0x7fd3eb6bd11d]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x267c7)[0x7fd3eb6bc7c7]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(+0x26842)[0x7fd3eb6bc842]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(lua_pcall+0x51)[0x7fd3eb6b9eb1]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(_ZN12LUA_TOOL_FEX13entry_fel2fesEP9lua_State17_tag_TOOL_FELPARA+0x18c)[0x7fd3eb6ac7a9]
/home/xugz/Bin/LiveSuit/bin/liveproc.plg(_Z14FelThreadEntryPv+0x108)[0x7fd3eb6b378a]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7e9a)[0x7fd3f0fabe9a]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fd3f04c6ccd]
======= Memory map: ========
00400000-00479000 r-xp 00000000 08:17 1179855 /home/xugz/Bin/LiveSuit/bin/LiveSuit
00678000-00679000 r--p 00078000 08:17 1179855 /home/xugz/Bin/LiveSuit/bin/LiveSuit
00679000-0067a000 rw-p 00079000 08:17 1179855 /home/xugz/Bin/LiveSuit/bin/LiveSuit
01db8000-02143000 rw-p 00000000 00:00 0 [heap]
7fd3dc000000-7fd3dc671000 rw-p 00000000 00:00 0
7fd3dc671000-7fd3e0000000 ---p 00000000 00:00 0
7fd3e4000000-7fd3e441e000 rw-p 00000000 00:00 0
7fd3e441e000-7fd3e8000000 ---p 00000000 00:00 0
7fd3e9667000-7fd3e9668000 rw-p 00000000 00:00 0
7fd3e9668000-7fd3e9687000 r-xp 00000000 08:17 1179850 /home/xugz/Bin/LiveSuit/bin/luadec.dll
7fd3e9687000-7fd3e9887000 ---p 0001f000 08:17 1179850 /home/xugz/Bin/LiveSuit/bin/luadec.dll
7fd3e9887000-7fd3e9888000 r--p 0001f000 08:17 1179850 /home/xugz/Bin/LiveSuit/bin/luadec.dll
7fd3e9888000-7fd3e9889000 rw-p 00020000 08:17 1179850 /home/xugz/Bin/LiveSuit/bin/luadec.dll
7fd3e9889000-7fd3e98b1000 r-xp 00000000 08:17 1179847 /home/xugz/Bin/LiveSuit/bin/luaBase.dll
7fd3e98b1000-7fd3e9ab1000 ---p 00028000 08:17 1179847 /home/xugz/Bin/LiveSuit/bin/luaBase.dll
7fd3e9ab1000-7fd3e9ab2000 r--p 00028000 08:17 1179847 /home/xugz/Bin/LiveSuit/bin/luaBase.dll
7fd3e9ab2000-7fd3e9ab3000 rw-p 00029000 08:17 1179847 /home/xugz/Bin/LiveSuit/bin/luaBase.dll
7fd3e9ab3000-7fd3e9ab4000 ---p 00000000 00:00 0
7fd3e9ab4000-7fd3ea2b4000 rw-p 00000000 00:00 0 [stack:10837]
7fd3ea2b4000-7fd3ea2b5000 ---p 00000000 00:00 0
7fd3ea2b5000-7fd3eaaf6000 rw-p 00000000 00:00 0
7fd3eab37000-7fd3eac72000 rw-s 00000000 00:04 14123011 /SYSV00000000 (deleted)
7fd3eac72000-7fd3eac73000 ---p 00000000 00:00 0
7fd3eac73000-7fd3eb473000 rw-p 00000000 00:00 0 [stack:10826]
7fd3eb473000-7fd3eb494000 r-xp 00000000 08:17 1179856 /home/xugz/Bin/LiveSuit/bin/luaeFex.dll
7fd3eb494000-7fd3eb694000 ---p 00021000 08:17 1179856 /home/xugz/Bin/LiveSuit/bin/luaeFex.dll
7fd3eb694000-7fd3eb695000 r--p 00021000 08:17 1179856 /home/xugz/Bin/LiveSuit/bin/luaeFex.dll
7fd3eb695000-7fd3eb696000 rw-p 00022000 08:17 1179856 /home/xugz/Bin/LiveSuit/bin/luaeFex.dll
7fd3eb696000-7fd3eb6e5000 r-xp 00000000 08:17 1179845 /home/xugz/Bin/LiveSuit/bin/liveproc.plg
7fd3eb6e5000-7fd3eb8e4000 ---p 0004f000 08:17 1179845 /home/xugz/Bin/LiveSuit/bin/liveproc.plg
7fd3eb8e4000-7fd3eb8e6000 r--p 0004e000 08:17 1179845 /home/xugz/Bin/LiveSuit/bin/liveproc.plg
7fd3eb8e6000-7fd3eb8e7000 rw-p 00050000 08:17 1179845 /home/xugz/Bin/LiveSuit/bin/liveproc.plg
7fd3eb8e7000-7fd3eb918000 rw-p 00000000 00:00 0
7fd3eb918000-7fd3ebe09000 r--p 00000000 08:17 2101084 /usr/share/fonts/truetype/wqy/wqy-microhei.ttc
7fd3ebe09000-7fd3ebe1d000 r-xp 00000000 08:17 1179848 /home/xugz/Bin/LiveSuit/bin/LangPlg.dll
7fd3ebe1d000-7fd3ec01c000 ---p 00014000 08:17 1179848 /home/xugz/Bin/LiveSuit/bin/LangPlg.dll
7fd3ec01c000-7fd3ec01d000 r--p 00013000 08:17 1179848 /home/xugz/Bin/LiveSuit/bin/LangPlg.dll
7fd3ec01d000-7fd3ec01e000 rw-p 00014000 08:17 1179848 /home/xugz/Bin/LiveSuit/bin/LangPlg.dll
7fd3ec01e000-7fd3ec027000 r-xp 00000000 08:17 1179843 /home/xugz/Bin/LiveSuit/bin/plgvector.dll
7fd3ec027000-7fd3ec226000 ---p 00009000 08:17 1179843 /home/xugz/Bin/LiveSuit/bin/plgvector.dll
7fd3ec226000-7fd3ec227000 r--p 00008000 08:17 1179843 /home/xugz/Bin/LiveSuit/bin/plgvector.dll
7fd3ec227000-7fd3ec228000 rw-p 00009000 08:17 1179843 /home/xugz/Bin/LiveSuit/bin/plgvector.dll
7fd3ec228000-7fd3ec236000 r-xp 00000000 08:17 1318582 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7fd3ec236000-7fd3ec435000 ---p 0000e000 08:17 1318582 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7fd3ec435000-7fd3ec436000 r--p 0000d000 08:17 1318582 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7fd3ec436000-7fd3ec437000 rw-p 0000e000 08:17 1318582 /usr/lib/x86_64-linux-gnu/libXi.so.6.1.0
7fd3ec437000-7fd3ec439000 r-xp 00000000 08:17 1318584 /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7fd3ec439000-7fd3ec638000 ---p 00002000 08:17 1318584 /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7fd3ec638000-7fd3ec639000 r--p 00001000 08:17 1318584 /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7fd3ec639000-7fd3ec63a000 rw-p 00002000 08:17 1318584 /usr/lib/x86_64-linux-gnu/libXinerama.so.1.0.0
7fd3ec63a000-7fd3ec643000 r-xp 00000000 08:17 1318570 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7fd3ec643000-7fd3ec842000 ---p 00009000 08:17 1318570 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7fd3ec842000-7fd3ec843000 r--p 00008000 08:17 1318570 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7fd3ec843000-7fd3ec844000 rw-p 00009000 08:17 1318570 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7fd3ec844000-7fd3ec849000 r-xp 00000000 08:17 1318578 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7fd3ec849000-7fd3eca48000 ---p 00005000 08:17 1318578 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7fd3eca48000-7fd3eca49000 r--p 00004000 08:17 1318578 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7fd3eca49000-7fd3eca4a000 rw-p 00005000 08:17 1318578 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7fd3eca4a000-7fd3eca51000 r-xp 00000000 08:17 1313753 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7fd3eca51000-7fd3ecc50000 ---p 00007000 08:17 1313753 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7fd3ecc50000-7fd3ecc51000 r--p 00006000 08:17 1313753 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7fd3ecc51000-7fd3ecc52000 rw-p 00007000 08:17 1313753 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7fd3ecc52000-7fd3ecc57000 r--s 00000000 08:17 1972412 /var/cache/fontconfig/b47c4e1ecd0709278f4910c18777a504-le64.cache-3
7fd3ecc57000-7fd3ecc5f000 r--s 00000000 08:17 1979395 /var/cache/fontconfig/52f7bdb7ce746bfd7eaa1985bd9cfa93-le64.cache-3
7fd3ecc5f000-7fd3ecc6f000 r--s 00000000 08:17 1972417 /var/cache/fontconfig/d52a8644073d54c13679302ca1180695-le64.cache-3
7fd3ecc6f000-7fd3ecc75000 r--s 00000000 08:17 1979394 /var/cache/fontconfig/3f7329c5293ffd510edef78f73874cfd-le64.cache-3
7fd3ecc75000-7fd3ecc78000 r--s 00000000 08:17 1972407 /var/cache/fontconfig/e13b20fdb08344e0e664864cc2ede53d-le64.cache-3
7fd3ecc78000-7fd3ecc7c000 r--s 00000000 08:17 1972400 /var/cache/fontconfig/7ef2298fde41cc6eeb7af42e48b7d293-le64.cache-3
7fd3ecc7c000-7fd3ecc7f000 r-xp 00000000 08:17 1714268 /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
7fd3ecc7f000-7fd3ece7e000 ---p 00003000 08:17 1714268 /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
7fd3ece7e000-7fd3ece7f000 r--p 00002000 08:17 1714268 /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
7fd3ece7f000-7fd3ece80000 rw-p 00003000 08:17 1714268 /usr/lib/x86_64-linux-gnu/gconv/UTF-16.so
7fd3ece80000-7fd3ed563000 r--p 00000000 08:17 1317705 /usr/lib/locale/locale-archive
7fd3ed563000-7fd3ed568000 r-xp 00000000 08:17 1318574 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd3ed568000-7fd3ed767000 ---p 00005000 08:17 1318574 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd3ed767000-7fd3ed768000 r--p 00004000 08:17 1318574 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd3ed768000-7fd3ed769000 rw-p 00005000 08:17 1318574 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7fd3ed769000-7fd3ed76b000 r-xp 00000000 08:17 1318563 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd3ed76b000-7fd3ed96a000 ---p 00002000 08:17 1318563 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd3ed96a000-7fd3ed96b000 r--p 00001000 08:17 1318563 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd3ed96b000-7fd3ed96c000 rw-p 00002000 08:17 1318563 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7fd3ed96c000-7fd3ed989000 r-xp 00000000 08:17 1319170 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd3ed989000-7fd3edb88000 ---p 0001d000 08:17 1319170 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd3edb88000-7fd3edb89000 r--p 0001c000 08:17 1319170 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd3edb89000-7fd3edb8a000 rw-p 0001d000 08:17 1319170 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7fd3edb8a000-7fd3edbb1000 r-xp 00000000 08:17 1576637 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fd3edbb1000-7fd3eddb1000 ---p 00027000 08:17 1576637 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fd3eddb1000-7fd3eddb3000 r--p 00027000 08:17 1576637 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fd3eddb3000-7fd3eddb4000 rw-p 00029000 08:17 1576637 /lib/x86_64-linux-gnu/libexpat.so.1.5.2
7fd3eddb4000-7fd3eddb8000 r-xp 00000000 08:17 1576726 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7fd3eddb8000-7fd3edfb7000 ---p 00004000 08:17 1576726 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7fd3edfb7000-7fd3edfb8000 r--p 00003000 08:17 1576726 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7fd3edfb8000-7fd3edfb9000 rw-p 00004000 08:17 1576726 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7fd3edfb9000-7fd3edfc0000 r-xp 00000000 08:17 1318756 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7fd3edfc0000-7fd3ee1bf000 ---p 00007000 08:17 1318756 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7fd3ee1bf000-7fd3ee1c0000 r--p 00006000 08:17 1318756 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7fd3ee1c0000-7fd3ee1c1000 rw-p 00007000 08:17 1318756 /usr/lib/x86_64-linux-gnu/libffi.so.6.0.0
7fd3ee1c1000-7fd3ee1c2000 rw-p 00000000 00:00 0
7fd3ee1c2000-7fd3ee1fe000 r-xp 00000000 08:17 1576692 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd3ee1fe000-7fd3ee3fd000 ---p 0003c000 08:17 1576692 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd3ee3fd000-7fd3ee3fe000 r--p 0003b000 08:17 1576692 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd3ee3fe000-7fd3ee3ff000 rw-p 0003c000 08:17 1576692 /lib/x86_64-linux-gnu/libpcre.so.3.12.1
7fd3ee3ff000-7fd3ee52e000 r-xp 00000000 08:17 1318561 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fd3ee52e000-7fd3ee72e000 ---p 0012f000 08:17 1318561 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fd3ee72e000-7fd3ee72f000 r--p 0012f000 08:17 1318561 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fd3ee72f000-7fd3ee733000 rw-p 00130000 08:17 1318561 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7fd3ee733000-7fd3ee743000 r-xp 00000000 08:17 1318576 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fd3ee743000-7fd3ee942000 ---p 00010000 08:17 1318576 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fd3ee942000-7fd3ee943000 r--p 0000f000 08:17 1318576 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fd3ee943000-7fd3ee944000 rw-p 00010000 08:17 1318576 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7fd3ee944000-7fd3ee978000 r-xp 00000000 08:17 1318758 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fd3ee978000-7fd3eeb78000 ---p 00034000 08:17 1318758 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fd3eeb78000-7fd3eeb79000 r--p 00034000 08:17 1318758 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fd3eeb79000-7fd3eeb7a000 rw-p 00035000 08:17 1318758 /usr/lib/x86_64-linux-gnu/libfontconfig.so.1.4.4
7fd3eeb7a000-7fd3eeb83000 r-xp 00000000 08:17 1318598 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fd3eeb83000-7fd3eed82000 ---p 00009000 08:17 1318598 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fd3eed82000-7fd3eed83000 r--p 00008000 08:17 1318598 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fd3eed83000-7fd3eed84000 rw-p 00009000 08:17 1318598 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7fd3eed84000-7fd3eed9a000 r-xp 00000000 08:17 1318516 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7fd3eed9a000-7fd3eef99000 ---p 00016000 08:17 1318516 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7fd3eef99000-7fd3eef9a000 r--p 00015000 08:17 1318516 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7fd3eef9a000-7fd3eef9b000 rw-p 00016000 08:17 1318516 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7fd3eef9b000-7fd3eef9e000 rw-p 00000000 00:00 0
7fd3eef9e000-7fd3eefa5000 r-xp 00000000 08:17 1318557 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7fd3eefa5000-7fd3ef1a4000 ---p 00007000 08:17 1318557 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7fd3ef1a4000-7fd3ef1a5000 r--p 00006000 08:17 1318557 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7fd3ef1a5000-7fd3ef1a6000 rw-p 00007000 08:17 1318557 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7fd3ef1a6000-7fd3ef1f3000 r-xp 00000000 08:17 1311190 /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.3200.4./LiveSuit/LiveSuit.sh: 行 28: 10825 已放弃 (核心已转储) $BinDir/$AppName "$@" > /dev/null

Thanks!

Doesn't compile on NetBSD 7

cc -std=c99 -Wall -Wextra -Wno-unused-result -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/ -I/usr/include/ -I/
usr/pkg/include/  `pkg-config --cflags libusb-1.0`  -o sunxi-fel fel.c progress.c soc_info.c fel_lib.c  `pkg-config --libs libusb-1.0
`
fel.c: In function 'get_image_type':
fel.c:70:2: warning: implicit declaration of function 'be32toh' [-Wimplicit-function-declaration]
  if (be32toh(buf32[0]) != IH_MAGIC) /* signature mismatch */
  ^
fel.c: In function 'aw_read_arm_cp_reg':
fel.c:235:3: warning: implicit declaration of function 'htole32' [-Wimplicit-function-declaration]
   htole32(opcode),     /* mrc  coproc, opc1, r0, crn, crm, opc2 */
   ^
fel.c:242:2: warning: implicit declaration of function 'le32toh' [-Wimplicit-function-declaration]
  return le32toh(val);
  ^
fel_lib.c: In function 'aw_send_usb_request':
fel_lib.c:142:3: warning: implicit declaration of function 'htole16' [-Wimplicit-function-declaration]
   .request = htole16(type),
   ^
fel_lib.c:143:3: warning: implicit declaration of function 'htole32' [-Wimplicit-function-declaration]
   .length = htole32(length),
   ^
fel_lib.c: In function 'aw_fel_get_version':
fel_lib.c:200:2: warning: implicit declaration of function 'le32toh' [-Wimplicit-function-declaration]
  buf->soc_id = (le32toh(buf->soc_id) >> 8) & 0xFFFF;
  ^
fel_lib.c:203:2: warning: implicit declaration of function 'le16toh' [-Wimplicit-function-declaration]
  buf->scratchpad = le16toh(buf->scratchpad);
  ^
/var/tmp//ccoHTHJa.o: In function `get_image_type':
fel.c:(.text+0x34): undefined reference to `be32toh'
/var/tmp//ccoHTHJa.o: In function `aw_read_arm_cp_reg':
fel.c:(.text+0x813): undefined reference to `htole32'
fel.c:(.text+0x825): undefined reference to `htole32'
fel.c:(.text+0x837): undefined reference to `htole32'
fel.c:(.text+0x899): undefined reference to `le32toh'
/var/tmp//ccoHTHJa.o: In function `aw_write_arm_cp_reg':
fel.c:(.text+0x904): undefined reference to `htole32'
fel.c:(.text+0x916): undefined reference to `htole32'
fel.c:(.text+0x928): undefined reference to `htole32'
fel.c:(.text+0x93a): undefined reference to `htole32'
fel.c:(.text+0x94c): undefined reference to `htole32'
/var/tmp//ccoHTHJa.o:fel.c:(.text+0x95e): more undefined references to `htole32' follow
/var/tmp//ccoHTHJa.o: In function `aw_get_stackinfo':
fel.c:(.text+0xc5b): undefined reference to `le32toh'
fel.c:(.text+0xc72): undefined reference to `le32toh'
/var/tmp//ccoHTHJa.o: In function `aw_backup_and_disable_mmu':
/var/tmp//ccoHTHJa.o: In function `aw_backup_and_disable_mmu':                                                               [0/1728]
fel.c:(.text+0xf45): undefined reference to `htole32'
fel.c:(.text+0xf57): undefined reference to `htole32'
fel.c:(.text+0xf69): undefined reference to `htole32'
fel.c:(.text+0xf7b): undefined reference to `htole32'
fel.c:(.text+0xf8d): undefined reference to `htole32'
fel.c:(.text+0x1148): undefined reference to `le32toh'
/var/tmp//ccoHTHJa.o: In function `aw_restore_and_enable_mmu':
fel.c:(.text+0x12b3): undefined reference to `htole32'
fel.c:(.text+0x12c5): undefined reference to `htole32'
fel.c:(.text+0x12d7): undefined reference to `htole32'
fel.c:(.text+0x12e9): undefined reference to `htole32'
fel.c:(.text+0x12fb): undefined reference to `htole32'
/var/tmp//ccoHTHJa.o:fel.c:(.text+0x130d): more undefined references to `htole32' follow
/var/tmp//ccoHTHJa.o: In function `aw_fel_write_and_execute_spl':
fel.c:(.text+0x1627): undefined reference to `le32toh'
fel.c:(.text+0x1647): undefined reference to `le32toh'
fel.c:(.text+0x16b8): undefined reference to `le32toh'
fel.c:(.text+0x1c05): undefined reference to `htole32'
/var/tmp//ccoHTHJa.o: In function `aw_fel_write_uboot_image':
fel.c:(.text+0x1e2f): undefined reference to `be32toh'
fel.c:(.text+0x1e48): undefined reference to `be32toh'
/var/tmp//ccoHTHJa.o: In function `pass_fel_information':
fel.c:(.text+0x20ba): undefined reference to `htole32'
fel.c:(.text+0x20cc): undefined reference to `htole32'
/var/tmp//ccoHTHJa.o: In function `aw_rmr_request':
fel.c:(.text+0x2158): undefined reference to `htole32'
fel.c:(.text+0x216a): undefined reference to `htole32'
fel.c:(.text+0x217c): undefined reference to `htole32'
/var/tmp//ccoHTHJa.o:fel.c:(.text+0x218e): more undefined references to `htole32' follow
/var/tmp//ccFieRE7.o: In function `aw_send_usb_request':
fel_lib.c:(.text+0x20a): undefined reference to `htole16'
/var/tmp//ccFieRE7.o: In function `aw_send_fel_request':
fel_lib.c:(.text+0x3a2): undefined reference to `htole32'
fel_lib.c:(.text+0x3b4): undefined reference to `htole32'
fel_lib.c:(.text+0x3c6): undefined reference to `htole32'
/var/tmp//ccFieRE7.o: In function `aw_fel_get_version':
fel_lib.c:(.text+0x46d): undefined reference to `le32toh'
fel_lib.c:(.text+0x48d): undefined reference to `le32toh'
fel_lib.c:(.text+0x4ad): undefined reference to `le32toh'
fel_lib.c:(.text+0x4ca): undefined reference to `le16toh'
fel_lib.c:(.text+0x4e6): undefined reference to `le32toh'
fel_lib.c:(.text+0x502): undefined reference to `le32toh'
/var/tmp//ccFieRE7.o: In function `aw_fel_readl_n':
fel_lib.c:(.text+0x6db): undefined reference to `htole32'
fel_lib.c:(.text+0x6ed): undefined reference to `htole32'
fel_lib.c:(.text+0x6ff): undefined reference to `htole32'
fel_lib.c:(.text+0x711): undefined reference to `htole32'
fel_lib.c:(.text+0x723): undefined reference to `htole32'
/var/tmp//ccFieRE7.o:fel_lib.c:(.text+0x735): more undefined references to `htole32' follow
/var/tmp//ccFieRE7.o: In function `aw_fel_readl_n':
fel_lib.c:(.text+0x8b2): undefined reference to `le32toh'
/var/tmp//ccFieRE7.o: In function `aw_fel_writel_n':
fel_lib.c:(.text+0x9e5): undefined reference to `htole32'
fel_lib.c:(.text+0x9fa): undefined reference to `htole32'
fel_lib.c:(.text+0xa0f): undefined reference to `htole32'
fel_lib.c:(.text+0xa24): undefined reference to `htole32'
fel_lib.c:(.text+0xa39): undefined reference to `htole32'
/var/tmp//ccFieRE7.o:fel_lib.c:(.text+0xa4e): more undefined references to `htole32' follow
Makefile:129: recipe for target 'sunxi-fel' failed
gmake: *** [sunxi-fel] Error 1

Support a "sid" command for sunxi-fel

Many Allwinner SoCs feature a series of efuses that can serve as a unique chip identifier. On most devices these can be read via register access, so in theory our FEL utility could easily retrieve them. We're particularly interested in the 128-bit "SID" key - see http://linux-sunxi.org/SID.

There are SoC-specific differences in how the SID can be accessed (e.g. individual register base addresses). The idea is to add a new "sid" command to our sunxi-fel utility, have it handle these differences internally and print out the resulting 128 bits, to provide a simple and uniform way for users to retrieve the SID.

Note: A shortcoming of the BROM FEL code won't allow simple retrieval of the hardware registers. Therefore currently aw_fel_read() can't retrieve the SID successfully. We first need to implement the proposed aw_fel_readl()/aw_fel_writel() functions before we can move forward on this issue.

See also: discussion of #37.

fel: relax SCTLR check

On a H2+ (Orange Pi Zero), if I enter fel mode by entering "go 0xFFFF0020" on u-boot cmd line, then sunxi-fel fails with this error:

"Unexpected SCTLR (00C5287A)"

This does not happen when I enter fel mode directly on power-on (no sd card for eg).

I've attempted to remove this check and sunxi-fel can work fine without it (tested uboot command successfully).

I suggest SCTLR check is relaxed.

Can't compile A31 script

Firstly I had trouble decompling bin file. I got following error

fexc-bin: /mnt/xp/script.bin: version: 0.1.2
fexc-bin: /mnt/xp/script.bin: size: 36532 (67 sections)
E: fexc-bin: /mnt/xp/script.bin: 3g_para.bb_vbat: unknown GPIO port type 12

So I made quick edit in script_fex.c, changed max GPIO port to 15 and file has decompiled correctly, but when I try compile file I get no output file nor error message. Here is fex file : http://pastebin.com/tauLh1Mf

nand-part not working on cubieboard2

I use kernel 3.3 for cb2 from here https://github.com/hramrach/linux-sunxi/commits/sunxi-3.3-cb2
This is my fork https://github.com/mmplayer/linux-sunxi/commits/sunxi-3.3-a20
The source link to libnand.a https://github.com/hramrach/linux-sunxi/tree/sunxi-3.3-cb2/modules/nand/lib

And i succesfully build the nand driver, but the problem is when i use nand-part from https://github.com/linux-sunxi/sunxi-tools latest version
The nand-part tool told me repartition is sucess, when i reboot, seems the driver didn't recognize the new partitions.

ls /dev/nand* will only show /dev/nand. There is no "/dev/nanda" "/dev/nandb" which is my expected.
I guess it's a compatiblity issue, since the sunxi-tool and nand driver works perfect on sunxi-3.4

And i tried to use a older version of nand-part, but without sucess.

Here is some logs on booting:

[ 11.523976] [NAND] nand driver version: 0x2 0x11
[ 11.533060] nand interrupt register ok
[ 11.541086] [NAND] use nand_good_block_ratio from default parameter
[ 11.551791] [NAND DMA] start dma*****************************************
[ 11.682399] get mbr error
[ 11.690199] storage_type=-1
[ 11.697520] boot from nand
[ 11.707578] nand: unknown partition table
[ 11.716591] benn: nand probe enter
[ 11.724930] [NAND]nand driver, ok.
[ 12.633708] [AXP]init charger->rest_vol = 100

There should be three partitions on the device tree, but i can only see /dev/nand

cubie@cubieboard2:$ sudo nand-part
check partition table copy 0: OK
check partition table copy 1: OK
check partition table copy 2: OK
check partition table copy 3: OK
partition 0: name = boot, partition start = 16, partition size = 2048
partition 1: name = a, partition start = 2064, partition size = 10
partition 2: name = b, partition start = 2074, partition size = 20
3 partitions
cubie@cubieboard2:
$ ls /dev/nand*
/dev/nand

Orange Pi 3 cannot boot into fel-mode

I am sorry but I cannot provide any logs because my Orange Pi 3 onboard emmc Android OS got corrupted when I tried to root it. My problem is that my Android OS installed on the EMMC of my Orange Pi 3 got corrupted. When I try to boot it into Android OS it only boots to the screen that says "Allwinner" in blue letters, then goes to a picture of mountains, then gets reboots and keeps doing the same thing over and over. It wont boot into an SD card OS, and I tried to connect the orange pi android os to my windows pc using usb otg, but it constantly loses connection when the reboot happens. I even tried flashing the "fel-sdboot.sunxi" file located (https://github.com/linux-sunxi/sunxi-tools/blob/master/bin/fel-sdboot.sunxi) on github. But when I inserted the sd card into the Orange Pi that is powered off, I turn it on and my computer wont recognize it. I also have a 64 bit linux pc on Debian. Please help, I have found nothing on the internet about "fel-mode on orange pi3". I am trying to install Android OS from the orangepi.org website: http://www.orangepi.org/downloadresources/OrangePi3/2019-01-23/orangepi3_0e7dae8bb1bf9678fda5754272.html If you need more information please reply and I well tell you anything I know.

awusb.c:218:13: error: implicit declaration of function ‘err’

Using ubuntu 12.04 and kernel 3.5

$ cat /var/lib/dkms/awdev/0.1/build/make.log
DKMS make.log for awdev-0.1 for kernel 3.5.0-21-generic (x86_64)
dc feb 27 23:19:06 CET 2013
make -C /lib/modules/3.5.0-21-generic/build SUBDIRS=/var/lib/dkms/awdev/0.1/build modules
make[1]: Entering directory /usr/src/linux-headers-3.5.0-21-generic' CC [M] /var/lib/dkms/awdev/0.1/build/awusb.o /var/lib/dkms/awdev/0.1/build/awusb.c: In function ‘ioctl_aw’: /var/lib/dkms/awdev/0.1/build/awusb.c:218:13: error: implicit declaration of function ‘err’ [-Werror=implicit-function-declaration] /var/lib/dkms/awdev/0.1/build/awusb.c:229:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] /var/lib/dkms/awdev/0.1/build/awusb.c:229:13: warning: unused variable ‘ii’ [-Wunused-variable] cc1: some warnings being treated as errors make[2]: *** [/var/lib/dkms/awdev/0.1/build/awusb.o] Error 1 make[1]: *** [_module_/var/lib/dkms/awdev/0.1/build] Error 2 make[1]: Leaving directory/usr/src/linux-headers-3.5.0-21-generic'
make: *** [default] Error 2

A31 KK fexc decompile error

The Kitkat roms I've been getting use config.fex on the root instead of script.bin in bootloader.fex. It is a binary file and seams to be about 95% the same as a file produced by fex2bin, but not the same.

Even with the newest fexc version I still get:
curt@Xubuntu-12:/media/Data/Storage/Ainol/Rom_works/test9$ ../sunxi-tools-master/fexc -q -I bin -O fex config.fex config.txt
fexc-bin: config.fex: version: 0.1.2
fexc-bin: config.fex: size: 43284 (77 sections)
fexc: script.c:176: script_null_entry_new: Assertion `name && *name' failed.
Aborted (core dumped)

Here's a link to the file! https://mega.co.nz/#!NJkynRoR!O85MmDpq2pDypDz_BTSch2bICt8J8Pl2s8VweB5GYM8

Can't access device in FEL-Mode

Hallo,

I'm trying to connect to an NanoPi in FEL-mode but sunxi-fel cant find the device.

lsusb:

Bus 001 Device 003: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode

sudo sunxi-fel ver

ERROR: Allwinner USB FEL device not found!

sudo sunxi-fel -l

libusb_open() ERROR -1: Input/Output Error

usb-devices (now Device is 16):

T: Bus=01 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 16 Spd=12 MxCh= 0
D: Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1f3a ProdID=efe8 Rev=02.b3
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=300mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)

Whenever I execute sunxi-fel the device seems to be reconnected:

[ 8092.357963] usb 1-1.2: USB disconnect, device number 16
[ 8104.842636] usb 1-1.2: new full-speed USB device number 17 using ehci-pci
[ 8104.936064] usb 1-1.2: New USB device found, idVendor=1f3a, idProduct=efe8
[ 8104.936073] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 8131.612467] usb 1-1.2: reset full-speed USB device number 17 using ehci-pci
[ 8131.706225] usb 1-1.2: USB disconnect, device number 17
[ 8131.776488] usb 1-1.2: new full-speed USB device number 18 using ehci-pci
[ 8131.869935] usb 1-1.2: New USB device found, idVendor=1f3a, idProduct=efe8
[ 8131.869942] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0

Maybe I messed something up in the installation process.
I'm really stuck at this point. Does anyone have a clue whats wrong in my case?

Thanks for your help,
Jimmy Pesto

Really bad compile bug :C

make
gcc -g -O0 -Wall -Wextra -std=c99 -D_POSIX_C_SOURCE=200112L -Iinclude/ -o fexc fexc.c script.c script_uboot.c script_bin.c script_fex.c
In file included from fexc.h:22:0,
from fexc.c:18:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory

include_next <stdint.h>

                      ^

compilation terminated.
script.c:20:20: fatal error: assert.h: No such file or directory
#include <assert.h>
^
compilation terminated.
In file included from script_uboot.c:19:0:
/usr/lib/gcc/x86_64-linux-gnu/4.8/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory

include_next <stdint.h>

                      ^

compilation terminated.
script_bin.c:20:19: fatal error: errno.h: No such file or directory
#include <errno.h>
^
compilation terminated.
script_fex.c:19:19: fatal error: ctype.h: No such file or directory
#include <ctype.h>
^
compilation terminated.
make: *** [fexc] Error 1

Well. I have no idea what to install. Already checked readme.
Distro= Linux mint

FEL mode times out on writing some images to BananaPi M2 Ultra

It seems that FEL mode times out on writing on BananaPi M2 Ultra (R40).

$ sudo sunxi-fel version
AWUSBFEX soc=00001701(R40) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000
$ sudo sunxi-fel -p spl sunxi 
usb_bulk_send() ERROR -7: Operation timed out
$ sudo sunxi-fel version
usb_bulk_send() ERROR -7: Operation timed out

I then disconnect and reconnect the USB cable (I had no external power supply connected so that cuts all the power to it and then provides it again).

$ sudo sunxi-fel version
AWUSBFEX soc=00001701(R40) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 
$ sudo sunxi-fel dump 0 1000000 > Q
$ ls -l Q
-rw-r--r-- 1 dannym users 1000000 Mar 19 17:13 Q
$ sudo sunxi-fel fill 0x47000000 1000 0x42
usb_bulk_send() ERROR -7: Operation timed out
$ sudo sunxi-fel clear 0x47000000 1000
usb_bulk_send() ERROR -7: Operation timed out

Do I have to press some button on the device? Because I didn't.

All this was done without a SD card in the device, so it's not interfering. I have a serial console attached and it doesn't log any messages either (which is good - so nothing is booting up when it shouldn't).

On the other hand, booting normally from the SD card works fine (booting to their Ubuntu port).

Please do a current release

Since the last release, a lot of changes have accumulated. Please evaluate if the current state has release quality and tag it.

Tnx.

"You need a more recent version of this (sunxi-tools) fel utility"

I have the latest git version of sunxi-tools from this very place:

./sunxi-fel -h

sunxi-fel v1.4.2-67-g7fe6024

But it gives this error:

./sunxi-fel uboot u-boot-sunxi-with-spl.bin write 0x43100000 my.env

sunxi SPL version mismatch: found 0x03 > maximum supported 0x02
You need a more recent version of this (sunxi-tools) fel utility.

u-boot version is the latest 2019.04

A similar but older error situation is shown at http://linux-sunxi.org/FEL/USBBoot#Booting_the_whole_system_over_USB_.28U-Boot_.2B_kernel_.2B_initramfs.29 :

sunxi SPL version mismatch: found 0x02 > maximum supported 0x01.
You need a more recent version of this (sunxi-tools) fel utility.

sunxi-tools 1.4 make fails when building meminfo

$ make TARGET_TOOLS=meminfo
...cc -g -O0 -Wall -Wextra  -std=c99 -D_POSIX_C_SOURCE=200112L -D_BSD_SOURCE -D_DEFAULT_SOURCE -Iinclude/    meminfo.c Makefile common.h version.h   -o meminfo
....Makefile: file not recognized: File format not recognized

That is because we add Makefile, common.h and version.h as dependencies to all the tools (which I think is good).

However, the entry for sunxi-meminfo says:

sunxi-meminfo: meminfo.c
        $(CROSS_COMPILE)gcc -g -O0 -Wall -static -o $@ $^

And $^ will pass the Makefile to the compiler - which will barf.

I'd pass $<

Same for sunxi-script_extractor and sunxi-fel and the generic sunxi-% rule.

sunxi pio library

It seems all the gpio code available around the internet re-implements what's necessary. It would be nice to have a library file for GPIO that other code could reuse. Would this project be the right place to provide this?

Force fastboot?

I'm trying to recover an A33 tablet (Logicom M BOT TAB 100) that's stuck with a broken recovery. It boots into TWRP which can't do anything (no touch screen or NAND support) whether holding buttons or not. The Android OS is still there, but I guess it's convinced it needs to boot into recovery mode on next boot and that flag is never getting cleared.

Because of that it's not even possible to enter fastboot mode to flash a working recovery, so it's essentially bricked. I am able to get into FEL mode and try to boot from SD card. (At least, if I put in SD card with bootloader on it, it boots to a blank screen instead of TWRP. I guess I haven't set it up properly, but it's doing something.)

Is there a way I can use FEL or u-boot to force the device to enter fastboot so that I can flash a working recovery image?

int main() without return in pio.c

got the following:

vendor/tvd/packages/sunxi-tools/pio.c: In function 'main':
vendor/tvd/packages/sunxi-tools/pio.c:430:1: error: control reaches end of non-void function [-Werror=return-type]
cc1: some warnings being treated as errors

declaring int main() should always include final return X

script-extractor on A33 fail

Semms that address offest is wrong
because bin2fex give a Malformed error.

script extractor generated file first bytes :


00000000  4f 00 00 00 74 a8 00 00  01 00 00 00 02 00 00 00  |O...t...........|
00000010  70 72 6f 64 75 63 74 00  00 00 00 00 00 00 00 00  |product.........|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000030  02 00 00 00 1a 03 00 00  70 6c 61 74 66 6f 72 6d  |........platform|
00000040  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  03 00 00 00 2e 03 00 00  |................|
00000060  74 61 72 67 65 74 00 00  00 00 00 00 00 00 00 00  |target..........|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000080  05 00 00 00 4c 03 00 00  6b 65 79 5f 64 65 74 65  |....L...key_dete|
00000090  63 74 5f 65 6e 00 00 00  00 00 00 00 00 00 00 00  |ct_en...........|
000000a0  00 00 00 00 00 00 00 00  01 00 00 00 7e 03 00 00  |............~...|
000000b0  70 6f 77 65 72 5f 73 70  6c 79 00 00 00 00 00 00  |power_sply......|
000000c0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000d0  07 00 00 00 88 03 00 00  63 61 72 64 5f 62 6f 6f  |........card_boo|
000000e0  74 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |t...............|
000000f0  00 00 00 00 00 00 00 00  03 00 00 00 ce 03 00 00  |................|
00000100  63 61 72 64 30 5f 62 6f  6f 74 5f 70 61 72 61 00  |card0_boot_para.|
00000110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000120  09 00 00 00 ec 03 00 00  63 61 72 64 32 5f 62 6f  |........card2_bo|
00000130  6f 74 5f 70 61 72 61 00  00 00 00 00 00 00 00 00  |ot_para.........|
00000140  00 00 00 00 00 00 00 00  0a 00 00 00 46 04 00 00  |............F...|
00000150  74 77 69 5f 70 61 72 61  00 00 00 00 00 00 00 00  |twi_para........|
00000160  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000170  03 00 00 00 aa 04 00 00  75 61 72 74 5f 70 61 72  |........uart_par|
00000180  61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |a...............|
00000190  00 00 00 00 00 00 00 00  03 00 00 00 c8 04 00 00  |................|
000001a0  66 6f 72 63 65 5f 75 61  72 74 5f 70 61 72 61 00  |force_uart_para.|
000001b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001c0  03 00 00 00 e6 04 00 00  6a 74 61 67 5f 70 61 72  |........jtag_par|
000001d0  61 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |a...............|
000001e0  00 00 00 00 00 00 00 00  05 00 00 00 04 05 00 00  |................|
000001f0  63 6c 6f 63 6b 00 00 00  00 00 00 00 00 00 00 00  |clock...........|
00000200  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000210  0f 00 00 00 36 05 00 00  70 6d 5f 70 61 72 61 00  |....6...pm_para.|
00000220  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000230  00 00 00 00 00 00 00 00  01 00 00 00 cc 05 00 00  |................|
00000240  64 72 61 6d 5f 70 61 72  61 00 00 00 00 00 00 00  |dram_para.......|
00000250  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000260  18 00 00 00 d6 05 00 00  70 6d 5f 70 61 72 61 00  |........pm_para.|
00000270  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000280  00 00 00 00 00 00 00 00  01 00 00 00 c6 06 00 00  |................|
00000290  77 61 6b 65 75 70 5f 73  72 63 5f 70 61 72 61 00  |wakeup_src_para.|
000002a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000002b0  07 00 00 00 d0 06 00 00  74 77 69 30 00 00 00 00  |........twi0....|


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.