9
0
Fork 0
barebox/scripts
Trent Piepho 4763fac31c socfpga: correct start vector when not using extra barebox header
The barebox ARM image has a 0x50 byte header that consists of:
Bytes 0x00 - 0x0a:  Instruction(s) to jump to start of code
Bytes 0x20 - 0x2f:  Signature and some other data
The rest of header is basically padding.

On SocFPGA, the ROM bootloader expects the 2nd stage bootloader
(barebox) to have a 0x40 byte header with the following fields:
Bytes 0x40 - 0x4b:  Signature and some other data
Bytes 0x4c - 0x4f:  Instruction to jump to start of code

These two headers are compatible, as everything defined in the SocFPGA
header is at a location that is padding the barebox header.

socfpga_mkimage has two methods for creating a SocFPGA image.  One method
prepends an extra 512 byte header to the barebox image, which contains the
SoCFPGA header described above.  The start vector at 0x4c is hard coded to
jump to offset 512, where the barebox header's start vector will be.

socfpga_mkimage can also not prepend this additional header and instead
modify the barebox header to be SoCFPGA compatible.  But it only writes
bytes 0x40-0x4b and not the start vector at 0x4c, leaving that word as
padding.  And so this image will not boot when the ROM bootloader runs it.

This changes the SoCFPGA header creator to write a correct start vector for
both methods.  It will create a branch instruction at 0x4c that jumps to the
start of the barebox image, whether it be at offset 0 or offset 512 (or any
other location).

This makes SoCFPGA images without the extra header bootable.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2016-05-23 09:48:46 +02:00
..
basic docproc: drop unused utility 2015-11-13 07:56:02 +01:00
coccinelle/misc scripts: update socfpga_sequencer importer to Quartus 15.0 2015-05-15 07:12:53 +02:00
dtc scripts/dtc: Update to upstream version 1.4.1 2015-03-05 08:46:05 +01:00
imx Merge branch 'for-next/imx' 2016-05-09 08:49:42 +02:00
include scripts: Add big endian conversion macros to endian.h 2016-04-28 16:43:14 +02:00
kconfig kconfig/menu.c:590: fix warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized] 2015-01-13 08:47:30 +01:00
mod kbuild: Use Elfnn_Half as replacement for Elfnn_Section 2012-06-05 21:40:15 +02:00
omap4_usbboot OMAP4_USBboot: Change output text formatting 2014-03-24 07:48:38 +01:00
remote scripts: make __init__.py nonempty 2016-02-12 08:44:30 +01:00
serial scripts: make __init__.py nonempty 2016-02-12 08:44:30 +01:00
setupmbr Merge branch 'for-next/misc' 2014-07-04 17:27:06 +02:00
tegra scripts: tegra: add gitignore 2014-07-01 08:39:37 +02:00
.gitignore scripts: Add mxs-usb-loader to .gitignore 2015-06-18 07:59:40 +02:00
Kbuild.include Make: Fix if_changed when command contains backslashes 2012-09-16 22:10:22 +02:00
Makefile scripts: Add scripts/include/ to include path for target programs 2016-04-01 10:38:54 +02:00
Makefile.build kbuild: handle multi-objs dependency appropriately 2014-11-27 15:42:07 +01:00
Makefile.clean Makefile.clean: include Makefiles again 2012-08-03 17:17:03 +08:00
Makefile.host scripts/Makefile.host: Update to Linux-3.18-rc6 2014-11-27 15:42:07 +01:00
Makefile.lib Make: i.MX: Allow to pass config file to cmd_imx_image 2016-02-04 14:38:29 +01:00
Makefile.modpost rename U-Boot-v2 project to barebox 2009-12-15 10:18:30 +01:00
bareboxcrc32.c scripts: bareboxcrc32 as host and target userspacetool 2013-12-04 17:17:06 +01:00
bareboxenv.c saveenv: provide a zeroed/empty/ignore environment 2014-08-01 08:24:00 +02:00
bareboximd.c stdio: replace fprintf(stderr,...) with eprintf 2016-04-15 12:21:46 +02:00
bbremote host side for barebox remote control 2016-01-18 09:25:50 +01:00
bin2c.c Make generated variables static 2014-02-03 08:58:22 +01:00
canon-a1100-image ARM: add Canon A1100 ROM image generation 2014-08-01 15:40:41 +02:00
checkpatch.pl checkpatch: fix left brace warning 2015-10-27 16:45:42 +01:00
compiler.h scripts: bareboxcrc32 as host and target userspacetool 2013-12-04 17:17:06 +01:00
dfuboot.sh defaultenv: Add boot option for DFU 2014-02-28 08:14:14 +01:00
fix_size.c scripts: fix warning generated by glibc 2.20 2015-03-02 07:32:01 +01:00
gen-dtb-s ARM: Allow compressed dtb binaries 2015-10-27 10:02:28 +01:00
gen_netx_image.c netX: add more common permissions 2012-04-23 07:52:46 +02:00
genenv Fix spelling: pathes -> paths 2015-01-28 10:02:56 +01:00
kallsyms.c treewide: fix signedness mixups in printf format specifiers 2014-04-23 09:05:51 +02:00
kernel-install.c kernel-install: fix return value check for getline 2014-06-26 09:44:47 +02:00
kwbimage.c scripts/kwbimage: Make BINARY files relative to config file 2015-10-19 08:39:25 +02:00
kwboot.c kwboot: do a filetype check before sending the image 2016-01-26 08:00:15 +01:00
mailmapper scripts: add mailmapper, a tool to create/update mailmap file 2014-10-17 11:10:00 +02:00
mk-omap-image.c mk-omap-image: make some locally used functions static 2015-11-10 08:41:13 +01:00
mkcompile_h Makefile: fix build timestamps 2012-04-15 15:18:17 +02:00
mkimage.c Treewide: remove address of the Free Software Foundation 2012-09-17 10:57:41 +02:00
mkmakefile Add scripts/mkmakefile from Linux. This is necessary if you want to 2007-11-09 11:47:07 +01:00
mksysmap rename U-Boot-v2 project to barebox 2009-12-15 10:18:30 +01:00
mkublheader.c scripts: fix warning generated by glibc 2.20 2015-03-02 07:32:01 +01:00
mxs-usb-loader.c scripts: Add mxs-usb-loader tool 2015-01-05 11:30:59 +01:00
mxsboot.c scripts: Add mxsboot tool 2015-01-05 11:30:59 +01:00
mxsimage.c scripts: mxs: Use Kernel includes 2016-02-02 15:41:04 +01:00
netconsole add netconsole host script 2010-06-24 17:37:00 +02:00
omap3-usb-loader.c ARM: OMAP: Add omap3 USB loader tool 2015-07-02 08:20:48 +02:00
omap_signGP.c scripts/omap_signGP: Fix image size in GP header 2015-06-17 07:46:48 +02:00
s5p_cksum.c Treewide: remove address of the Free Software Foundation 2012-09-17 10:57:41 +02:00
setlocalversion Make: update setlocalversion from the kernel 2013-03-09 20:14:15 +01:00
socfpga_get_sequencer scripts: update socfpga_sequencer importer to Quartus 15.0 2015-05-15 07:12:53 +02:00
socfpga_import_preloader scripts: socfpga: statify sys_mgr_init_table 2015-03-06 07:43:10 +01:00
socfpga_mkimage.c socfpga: correct start vector when not using extra barebox header 2016-05-23 09:48:46 +02:00
socfpga_sequencer_defines_defaults scripts: update socfpga_sequencer importer to Quartus 15.0 2015-05-15 07:12:53 +02:00
tags.sh Makefile: move ctags and cscope support to a shell script 2012-12-03 11:01:44 +01:00
xz_wrap.sh Add xz decompression support 2014-11-04 12:18:55 +01:00
zynq_mkimage.c ARM: zynq: add zynq fsbl checksum script 2013-03-27 09:23:49 +01:00