summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'for-next/misc'Sascha Hauer2016-11-141-1/+1
|\ \
| * | gen-dtb-s: Put compressed dtb in different sectionSascha Hauer2016-10-241-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | For builtin dtbs all compiled dtbs matching section .dtb.rodata.* are collected in a single section. Since every dtb is compiled as uncompressed and also as compressed binary each dtb ends up twice in the section. Let's put the compressed variants in .dtbz.rodata.* sections rather than .dtb.rodata.*.z so they end up in the binary only once. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Tested-by: Daniel Krüger <daniel.krueger@systec-electronic.com>
* / scripts imx-image: add DCD NOP command supportAlexander Kurz2016-11-074-0/+41
|/ | | | | | | | The DCD NOP command is available for all flash header v2 devices (i.MX28, 50, 53, 6 and 7). Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/mvebu'Sascha Hauer2016-10-101-21/+80
|\
| * scripts: kwboot: set boot source to UART before sendingUwe Kleine-König2016-10-041-3/+11
| | | | | | | | | | | | | | | | Sending an image that specifies one of the alternative boot sources doesn't make sense. So change the boot source to UART on the fly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: kwboot: simplify kwboot_mmap_imageUwe Kleine-König2016-10-041-6/+4
| | | | | | | | | | | | | | | | There was only a single caller who passes prot=PROT_READ unconditionally. So drop this parameter and simplify accordingly. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: kwboot: shorten delay between two boot messagesUwe Kleine-König2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | Together with the previous changes that allow to handle the scenario where too many messages were sent, this greatly improves the probability to hit the time window during which the CPU accepts a boot message. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: kwboot: improve diagnostic outputUwe Kleine-König2016-10-041-3/+12
| | | | | | | | | | | | | | | | | | After entering uart boot mode the CPU prints some diagnostic messages. Showing them to the user helps her to notice when the message window was missed or there is an other problem. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: kwboot: flush input and output only onceUwe Kleine-König2016-10-041-8/+8
| | | | | | | | | | | | | | | | | | | | | | When flushing input before sending of a boot message the acknowledging reply for the previous message from the CPU might be discarded and so missed. So only flush once before sending boot messages in a loop. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: kwboot: try to resync on packet boundary after receiving a NAKUwe Kleine-König2016-10-041-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we sent the boot message too often the CPU might already have started to interpret this as an xmodem packet. As sender and receiver are not in sync it's impossible to transfer a packet successfully. So when we get a NAK send '\xff' bytes until the receiver reaches the packet boundary. When we send too many the SoC replies with a NAK for each byte and doesn't interpret it as the start of a new package (which must start with SOH == '\x01'). A slower alternative would be to wait for another NAK which is sent when reception of the already started packet times out. This was tested on an Armada XP based machine with bootrom version 1.20. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add comp_copy function for use with CONFIG_IMAGE_COMPRESSION_NONESascha Hauer2016-09-151-0/+8
|/ | | | | | | | | | The Makefile compression commands all append the size of the uncompressed image. With CONFIG_IMAGE_COMPRESSION_NONE simply 'shipped' is used which does not append the size. Add and use a special comp_copy function which adds the size. This helps us to get the uncompressed image size in the startup code later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/socfpga'Sascha Hauer2016-09-131-34/+110
|\
| * socfpga: Add support for V1 images to socfpga_mkimageTrent Piepho2016-08-181-34/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Altera's SocFPGA Arria10 SoC uses a new image format, different from the one used on CycloneV. The formats are similar, with the header matching up to the point where the version field is 1 instead of 0. At that point the header fields diverge. The CRC and checksum use is the same between the two. This patch extends socfpga_mkimage to support generating the new format with a version command line option. The default will be V0 for CycloneV. The new format is, IMHO, not as good as the previous one. It requires the start location be after the header, while the V0 format would allow the start location to be before or after. Barebox boot images are designed to start from offset 0, which is before the header. To avoid modifying the common barebox start code specifically for Arria10, I instead add a trampoline instruction after the V1 header to jump to the real start location, wherever it might be. Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/imx'Sascha Hauer2016-09-134-71/+129
|\ \
| * | scripts: imx: add support for i.MX50Alexander Kurz2016-09-123-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Add imximg support for i.MX50 processors which use the i.MX flash header v2 format. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: cleanup DCD v2 processingAlexander Kurz2016-09-052-47/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-Implement the DCD v2 processing. Processing for the DCD write command went into a separate function enabling the over-all DCD processing to handle check, nop and unlock commands as well. The trivial NOP command is supported right away. Further changes: put in some data consistancy checks and error handling, do structured member access and proper endianess handling and direct error messages to stderr. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: structured DCD v1 element accessAlexander Kurz2016-08-222-8/+17
| | | | | | | | | | | | | | | | | | | | | DCD v1 elements are encoded little endian. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: enable DCD 16-bit write for hdr v1Alexander Kurz2016-08-221-7/+2
| | | | | | | | | | | | | | | | | | | | | Do some cleanup which enables DCDv1 16 bit write access as side effect. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-image: DCD check command for v2 onlyAlexander Kurz2016-08-221-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DCD check command is currently implemented for imximg v2 only. This command may also be available for v1 as mentioned in IMX35RM as DCD-address-type "wait/read", but due to the lack of further details it will be not supported. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: do DCD only once, cleanupAlexander Kurz2016-08-221-9/+6
| |/ | | | | | | | | | | | | | | | | Only the first encountered DCD block should be processed, optional DCD processing may be switched off by command option. Clean up the corresponding logic. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / i.MX: scripts: Fix a bug in imx-imageAndrey Smirnov2016-09-051-1/+1
|/ | | | | | | | | | In order to clear a bitmask, "Set" bit has to be '0' and "Mask" bit '1'. Since "Set" is bit 4 and "Mask" is bit 3 this leaves us with a overal or-mask of 1 << 3. Orginal code was doing the inverse and setting bit #4 to '1' bit #3 to '0'. Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: socfpga_get_sequencer: convert potential CRLF to LFSteffen Trumtrar2016-08-181-0/+2
| | | | | | | | | | If u-boot was generated under a DOS system, the sequencer files will have CRLF linebreaks. The indent-tool has problems with this and as a result the code will not compile anymore. Fix up any CRLFs prior with the dos2unix tool. Signed-off-by: Steffen Trumtrar <s.trumtrar@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: split off topic-code into functionsAlexander Kurz2016-07-181-67/+92
| | | | | | | | | Improve code understandability: extract the "jump application" Serial Download Protocol access method and file-to-buffer reader functionality out of do_irom_download(). Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: structured protocol accessAlexander Kurz2016-07-181-67/+65
| | | | | | | | Do some cleanup and access the elements of Serial Download Protocol messages in endianess-portable manner using proper typed struct members. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: remove useless variableAlexander Kurz2016-07-181-3/+1
| | | | | | | Remove a variable raising complexity for no reason. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: remove useless codeAlexander Kurz2016-07-181-46/+3
| | | | | | | | | The configuration interface for struct usb_work is not implemented here leaving the options set on fixed settings or even uninitialized. Do some cleanup and remove those half-cooked dead code passages. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx-usb-loader: const function argsAlexander Kurz2016-07-181-12/+17
| | | | | Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: imx: const function argumentsAlexander Kurz2016-07-183-9/+11
| | | | | Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2016-07-112-4/+4
|\
| * Do not rm the path from pbl-y target张忠山2016-07-051-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whan add some obj in a subdir to lwl-y or pbl-y, like this: lwl-y += subdir/test.o other.o the make process failed: make[2]: *** No rule to make target 'arch/arm/boards/boardname/test.o', \ needed by 'arch/arm/boards/boardname/built-in-pbl.o'. Stop. Note, there are not the part "subdir" in the path of the test.o. this patch fix this Signed-off-by: 张忠山 <zzs213@126.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Add more files to .gitignoreAlexander Shiyan2016-07-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds more generated files to ignore list. ... shc@shc /home/git/barebox-github $ git status На ветке imx51 Неотслеживаемые файлы: (используйте «git add <файл>…», чтобы добавить в то, что будет включено в коммит) common/barebox_default_env common/barebox_default_env.h include/asm scripts/basic/docproc ничего не добавлено в коммит, но есть неотслеживаемые файлы (используйте "git add", чтобы отслеживать их) Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | ARM: i.MX: central SOC type definitionAlexander Kurz2016-07-043-8/+11
| | | | | | | | | | | | | | | | | | Move the definition of iMX CPU types to an individual file to allow on-purpose inclusion. Eliminate magic number CPU type encoding in the scripts/imx subdir using the new include file. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx-image: super_root_key command depends on header_version 1Alexander Kurz2016-07-041-1/+1
|/ | | | | | | | | The Super Root Key pointer exclusively exists in flash header version 1 which is used for i.MX25, i.MX35 and i.MX51 SOC as described in freescales AN4547 document. Simplify the code a little bit. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* socfpga: correct start vector when not using extra barebox headerTrent Piepho2016-05-231-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Merge branch 'for-next/misc'Sascha Hauer2016-05-091-0/+44
|\
| * scripts: Add big endian conversion macros to endian.hSascha Hauer2016-04-281-0/+44
| | | | | | | | | | | | Some programs need the big endian macros, add them to andian.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/include-cleanup'Sascha Hauer2016-05-091-0/+2
|\ \
| * | stdio: replace fprintf(stderr,...) with eprintfSascha Hauer2016-04-151-0/+2
| | | | | | | | | | | | | | | | | | | | | We have a shortcut for fprintf(stderr, so use it. This is done to be able to remove fprintf in the next step. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/imx'Sascha Hauer2016-05-095-18/+94
|\ \ \ | |/ / |/| |
| * | scripts: imx-usb-loader: support set_bits/clear_bitsSascha Hauer2016-04-281-6/+39
| | | | | | | | | | | | | | | | | | | | | Now that we can use set_bits/clear_bits in the DCD tables, add support for this in the imx-usb-loader aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx-usb-loader: make debug output more usefulSascha Hauer2016-04-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | - print write_memory message only in verbose mode, but in all cases when memory is written - print more information about the DCD section just executed Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | scripts: imx: support set_bits/clear_bitsSascha Hauer2016-04-285-9/+51
| |/ | | | | | | | | | | | | The i.MX SoCs support setting bits and clearing bits in their DCD table. This adds commands for these in the imx-image tool. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / scripts: imx-image: Fix image size in flash header for i.MX35Alexander Stein2016-04-141-3/+4
|/ | | | | | | | | | The i.MX35 needs additional 0x1000 byte. This quirk moved to the wrong location during refactoring of imx-image for v2016.03.0. Fixes: adade597593442 ""scripts: imx: Allow to create signed images") Signed-off-by: Daniel Krueger <daniel.krueger@systec-electronic.com> Signed-off-by: Alexander Stein <alexander.stein@systec-electronic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/imd'Sascha Hauer2016-04-082-1/+3
|\
| * imd: rename imd_search_validate to imd_getSascha Hauer2016-04-011-0/+1
| | | | | | | | | | | | | | The name is more suitable for what the function does. Also let the function return a pointer to the imd data found in the buffer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * scripts: Add scripts/include/ to include path for target programsSascha Hauer2016-04-011-1/+2
| | | | | | | | | | | | | | Programs compiled for the target need -I $(srctree)/scripts/include/ to be able to include for example linux/err.h. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | scripts: imx: imx-image: Fix image size for HABv3 imagesSascha Hauer2016-04-061-3/+4
|/ | | | | | | When the image contains CSF data we must add CSF_LEN to the image size pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: make __init__.py nonemptySascha Hauer2016-02-123-0/+3
| | | | | | Otherwise they get removed by make distclean. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/ratp'Sascha Hauer2016-02-0822-0/+5408
|\
| * host side for barebox remote controlJan Luebbe2016-01-189-0/+1535
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains the host tool for barebox remote control. It is written in Phython with its own implementation of the RATP protocol. Currently this is a very simple tool which needs more work, but the code can also be used as a library. Example output: console: '. ' console: '.. ' console: 'dev ' console: 'env ' console: 'mnt ' console: '\n' Result: BBPacketCommandReturn(exit_code=0) Signed-off-by: Jan Lübbe <j.luebbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Tested-by: Andrey Smirnov <andrew.smirnov@gmail.com>