Re: i.MX6Q SABRESD board and barebox

2014-06-13 Thread Andrey Smirnov
On Wed, Jun 11, 2014 at 10:42 PM, Sascha Hauer s.ha...@pengutronix.de wrote: Hi Andrey, On Wed, Jun 11, 2014 at 02:59:53PM -0700, Andrey Smirnov wrote: Hello everyone, I am trying to use barebox on a SabreSD board with i.MX6Q processor and seem to be running into problems. One odd thing

Re: i.MX6Q SABRESD board and barebox

2014-06-13 Thread Andrey Smirnov
Yeah, that's what I've been doing(I forgot to mention that I disabled relocatable image as well). I just wanted to double check that I wasn't missing anything obvious and that that setting was indeed incorrect. Thanks, Andrey On Fri, Jun 13, 2014 at 12:36 PM, Holger Schurig

[PATCH] partitions/efi: Fix off-by-one error in 'last_lba'

2014-11-10 Thread Andrey Smirnov
LBAs are numbered starting from zero so the last LBA # would be equal to total number of blocks minus one. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/partitions/efi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/partitions/efi.c b/common

[PATCH] ARM: i.MX6 Phytec phyFLEX: Fix imx6_bbu_nand_register_handler usage

2014-11-10 Thread Andrey Smirnov
imx6_bbu_nand_register_handler is not availible if CONFIG_BAREBOX_UPDATE_IMX6_NAND is not selected. Fix this by wrapping it's usage in preprocessor statements. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/board.c | 3 ++- 1 file changed, 2

[PATCH 1/2] i.MX6: phytec: Distil different startup functions

2014-12-02 Thread Andrey Smirnov
Distil different startup functions into a generic one, different behavioral aspects of which can be influenced by its parameters. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/lowlevel.c | 69 -- 1 file changed, 21

[PATCH 2/2] i.MX6: phytec: Distil common code pattern into a macro

2014-12-02 Thread Andrey Smirnov
Distil common code pattern for Phytec entry functions into a macro and use it instead. This way a new board derivateve that differs only in device tree file can be added with just one line. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/lowlevel.c

Re: [PATCH 1/2] i.MX6: phytec: Distil different startup functions

2014-12-03 Thread Andrey Smirnov
[Re-sending since Google Inbox converted my original mail to HTML] On Wed, Dec 3, 2014 at 1:03 AM, Sascha Hauer s.ha...@pengutronix.de wrote: On Tue, Dec 02, 2014 at 07:52:40AM -0800, Andrey Smirnov wrote: Distil different startup functions into a generic one, different behavioral aspects

[PATCH v2 2/2] i.MX6: phytec: Distil common code pattern into a macro

2014-12-03 Thread Andrey Smirnov
Distil common code pattern for Phytec entry functions into a macro and use it instead. This way a new board derivateve that differs only in device tree file can be added with just one line. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/lowlevel.c

[PATCH v2 1/2] i.MX6: phytec: Distil different startup functions

2014-12-03 Thread Andrey Smirnov
Distil different startup functions into a generic one, different behavioral aspects of which can be influenced by its parameters. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/lowlevel.c | 68 +++--- 1 file changed, 19

[PATCH] firmware: altera: Make nSTAT GPIO optional

2014-12-31 Thread Andrey Smirnov
By taking parts of the programming handshaking protocol on faith it is possible to make due with only two GPIO for programming Altera FPGAs. This is not a very advisable practice, but sometime unavoidable in GPIO constrained designs. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com

[PATCH] i.MX: SPI: Respect SPI_LSB_FIRST flag in mode settings

2014-12-31 Thread Andrey Smirnov
Add code to support SPI transfers that have data shifted out least significant bit first. This is useful in many cases, but specifically it is needed for drivers/firmware/altera_serial.c to work on i.MX platform. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/spi/imx_spi.c

[PATCH 2/3] i.MX6: phytec: Check environment path selection for errors

2015-01-15 Thread Andrey Smirnov
Add code to explicitly check for success of of_device_enable_path() when selecting which media is expected to contain barebox environment. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/board.c | 14 +++--- 1 file changed, 11 insertions

[PATCH 3/3] i.MX6: phytec: Allow multiple MMC devices to contain boot environment

2015-01-15 Thread Andrey Smirnov
Add code so that when booting from different SDHCI controllers barebox would correctly set up where to look for bootloader environment. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/phytec-phyflex-imx6/board.c | 10 +++--- arch/arm/dts/imx6qdl-phytec-pfla02.dtsi

[PATCH v2] i.MX: SPI: Respect SPI_LSB_FIRST flag in mode settings

2015-01-15 Thread Andrey Smirnov
Add code to support SPI transfers that have data shifted out least significant bit first. This is useful in many cases, but specifically it is needed for drivers/firmware/altera_serial.c to work on i.MX platform. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/spi/imx_spi.c

[RESEND][PATCH] firmware: altera: Make nSTAT GPIO optional

2015-02-17 Thread Andrey Smirnov
By taking parts of the programming handshaking protocol on faith it is possible to make due with only two GPIO for programming Altera FPGAs. This is not a very advisable practice, but sometime unavoidable in GPIO constrained designs. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com

Re: [RFC, PATCH] i.MX6: phytec: Do not hardcode default environment

2015-01-06 Thread Andrey Smirnov
Looking at it you should rather replace the compatible checks in phytec_pfla02_init with their baseboards, so instead of: if (!of_machine_is_compatible(phytec,imx6q-pfla02) !of_machine_is_compatible(phytec,imx6dl-pfla02)

Re: [PATCH] i.MX: SPI: Respect SPI_LSB_FIRST flag in mode settings

2015-01-06 Thread Andrey Smirnov
Better introduce a imx_xchg_single which does the necessary bit reversing and calls imx-xchg_single. This avoids duplicating the code for all three bits_per_word settings. I like this idea. Will do for the next version of the patch. Thanks, Andrey

Re: Booting Linux on Altera's socfpga

2015-04-20 Thread Andrey Smirnov
2. Boot into barebox 3. cp /boot/soc_system.rbf /dev/socfpga-fpga (This step initially didn't work for me, so I had to make a change to the firmware driver http://lists.infradead.org/pipermail/barebox/2015-April/023194.html) This is interesting, because all rbf's I generated myself worked

[PATCH v2 2/2] firmware: socfpga: Add necessary dependency to Kconfig

2015-04-20 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/firmware/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 15465fe..710b500 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig

[PATCH v2 1/2] firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()

2015-04-20 Thread Andrey Smirnov
Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length is not a multiple of 4 would cause an integer overflow which would result in infinite loop. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/firmware/socfpga.c | 24 +++- 1 file changed

[PATCH v3] firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()

2015-04-21 Thread Andrey Smirnov
Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length is not a multiple of 4 would cause an integer overflow which would result in infinite loop. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/firmware/socfpga.c | 16 +++- 1 file changed, 15

Re: [PATCH v2 1/2] firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()

2015-04-21 Thread Andrey Smirnov
On Tue, Apr 21, 2015 at 5:28 AM, Sascha Hauer s.ha...@pengutronix.de wrote: Hi Andrey, On Mon, Apr 20, 2015 at 05:37:43AM -0700, Andrey Smirnov wrote: Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length is not a multiple of 4 would cause an integer overflow which would

[PATCH v2 3/8] bootstrap_read_devfs(): Check for errors from devfs_add_partition()

2015-05-03 Thread Andrey Smirnov
Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- Changes since v1: - Fix a compile time error that snuck in during the time the diff was being split into multiple patches lib/bootstrap/devfs.c | 11

[PATCH v2 5/8] bootstrap_read_devfs(): Fix potential memory leak

2015-05-03 Thread Andrey Smirnov
In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com

[PATCH v2 1/8] imx-image: Correctly fill image size in prepended header

2015-05-03 Thread Andrey Smirnov
If called with '-b' option 'imx-image' tool prepends barebox header to the image, but the tool does not fill the data at image size offset correctly. Fix that. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- This patch supercedes the one sent earlier titled: [PATCH 1/8] Makefile.lib

[PATCH v2 7/8] bootstrap_read_devfs(): Remove all partitions upon function completion

2015-05-03 Thread Andrey Smirnov
Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- Changes since

[PATCH 4/8] bootstrap_read_devfs(): Close file after we are done with it

2015-05-03 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index de274a0..4176819 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -120,6 +120,8 @@ void

[PATCH 2/8] bootstrap: Fix potential memory leak in 'read_image_head'

2015-05-03 Thread Andrey Smirnov
Original version of 'read_image_head' would not free the memory allocated for barebox header in cases of any failure. Fix this by adding a dedicated resourse de-allocation code path. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 8 ++-- 1 file changed, 6

[PATCH 7/8] bootstrap_read_devfs(): Remove all partitions upon function completion

2015-05-03 Thread Andrey Smirnov
Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap

[PATCH 3/8] bootstrap_read_devfs(): Check for errors from devfs_add_partition()

2015-05-03 Thread Andrey Smirnov
Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index

[PATCH 6/8] bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()

2015-05-03 Thread Andrey Smirnov
Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index f7f91d6

[PATCH 8/8] bootstrap: Warn if image size in BB header is zero

2015-05-03 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index d7b5185..d071eb3 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -58,8

[PATCH 5/8] bootstrap_read_devfs(): Fix potential memory leak

2015-05-03 Thread Andrey Smirnov
In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com

[PATCH 1/8] Makefile.lib: Fix i.MX image size after generation

2015-05-03 Thread Andrey Smirnov
If called with '-b' option 'imx-image' tool prepends barebox header to the image, but the tool does not fill the data at image size offset correctly. Call 'fix_size', right after 'imx-image' to fix that. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- scripts/Makefile.lib | 3 ++- 1

Re: [PATCH 1/8] Makefile.lib: Fix i.MX image size after generation

2015-05-03 Thread Andrey Smirnov
On Sun, May 3, 2015 at 1:28 PM, Marc Kleine-Budde m...@pengutronix.de wrote: On 05/03/2015 10:13 PM, Andrey Smirnov wrote: If called with '-b' option 'imx-image' tool prepends barebox header to the image, but the tool does not fill the data at image size offset correctly. Call 'fix_size

Re: [PATCH 7/8] i.MX: serial: Distil common clock ungating code

2015-05-04 Thread Andrey Smirnov
Please add a imx6_ namespace to this function. The calling code always knows that it is running on imx6, so you can use IMX6_CCM_BASE_ADDR directly rather than using soc##_. The function above is imx6 specific anyway since only this SoC has the gate registers on 0x68..0x80. What about i.MX51?

[PATCH 6/8] i.MX: serial: Convert i.MX51 and i.MX6 to use 'setup_uart_ll'

2015-05-02 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- Two boards -- 'guf-santaro' and 'eltec-hipercam' -- were not converted to use this function because they enable low-level UART regardless of the value of CONFIG_DEGUG_LL and so converting them to 'setup_uart_ll' would change the behaviour

[PATCH 1/8] i.MX: Move UART definitions into a separate file

2015-05-02 Thread Andrey Smirnov
Move UART definitions into a separate file to avoid redefinition in mach/debug_ll.h and magical constants in low level UART initialization code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/debug_ll.h | 9 +-- arch/arm/mach-imx/include/mach/serial.h

[PATCH 3/8] i.MX: serial: Add baud rate calculation convenience functions

2015-05-02 Thread Andrey Smirnov
Add two functions to calculate values for UBMR and UBIR registers. This way both early serial initalization code and serial_imx.c can use them and not duplicate the code. Singed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/serial.h | 9 + drivers

[PATCH 7/8] i.MX: serial: Distil common clock ungating code

2015-05-02 Thread Andrey Smirnov
Move all of the common clock ungating code in early UART initialization into a dedicated subroutine that can be shared by all of the users. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/freescale-mx6sx-sabresdb/lowlevel.c | 9 + arch/arm/boards/karo-tx6x

[PATCH 5/8] i.MX: serial: Add setup_uart_ll function

2015-05-02 Thread Andrey Smirnov
a slight difference in behaviour by dropping the initialization of ONEMS and UESC registers since those do not seem to be needed for early UART functionality Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/debug_ll.h | 34 +++ 1

[PATCH 4/8] i.MX51: babbage: Implement CONFIG_DEBUG_LL

2015-05-02 Thread Andrey Smirnov
Implement bits of configuraion needed to configure early debug output support. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/freescale-mx51-babbage/lowlevel.c | 58 +++ arch/arm/mach-imx/include/mach/clock-imx51_53.h | 5 +- 2 files changed, 61

[PATCH 2/8] i.MX: serial: Add constants for UART clock divisor

2015-05-02 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/serial.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/mach-imx/include/mach/serial.h b/arch/arm/mach-imx/include/mach/serial.h index b999c58..3890fd5 100644 --- a/arch/arm/mach-imx

[PATCH v3 01/18] i.MX: Move UART definitions into a separate file

2015-05-06 Thread Andrey Smirnov
Move UART definitions into a separate file to avoid redefinition in mach/debug_ll.h and magical constants in low level UART initialization code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/debug_ll.h | 10 +-- drivers/serial/serial_imx.c

[PATCH v3 09/18] Makefile.lib: Make 'check_file_size' more flexible

2015-05-06 Thread Andrey Smirnov
Make 'check_file_size' more flexible by not hardcoding the file whose size is going to be checked to '$@'. This way it is possible to use this subroutine to check the size of files other than the target of the rule. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- Makefile

[PATCH v3 14/18] bootstrap_read_devfs(): Close file after we are done with it

2015-05-06 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index 0c47cd2..5693431 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -120,6 +120,8 @@ void

[PATCH v3 04/18] i.MX: serial: Add UART init functions for DEBUG_LL

2015-05-06 Thread Andrey Smirnov
: Please note that 'imx*_uart_setup_ll' functions do add a slight difference in behaviour by dropping the initialization of ONEMS and UESC registers since those do not seem to be needed for early UART functionality Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include

[PATCH v3 15/18] bootstrap_read_devfs(): Fix potential memory leak

2015-05-06 Thread Andrey Smirnov
In case of a failure in one of the cdev_* functions original version of bootstrap_read_devfs would not release memory allocated for barebox header or memory allocated for the image. This commit fixes this by adding resource deallocation code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com

[PATCH v3 13/18] bootstrap_read_devfs(): Check for errors from devfs_add_partition()

2015-05-06 Thread Andrey Smirnov
Check for errors returned by devfs_add_partition() and bail if there are any. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index

[PATCH v3 18/18] bootstrap: Warn if image size in BB header is zero

2015-05-06 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index b6edec7..5a64477 100644 --- a/lib/bootstrap/devfs.c +++ b/lib/bootstrap/devfs.c @@ -58,8

[PATCH v3 03/18] i.MX: serial: Add baud rate calculation convenience functions

2015-05-06 Thread Andrey Smirnov
Add two functions to calculate values for UBMR and UBIR registers. This way both early serial initalization code and serial_imx.c can use them and not duplicate the code. Singed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/serial/serial_imx.c | 4 ++-- include/serial/imx-uart.h

[PATCH v3 17/18] bootstrap_read_devfs(): Remove all partitions upon function completion

2015-05-06 Thread Andrey Smirnov
Bootstrap_read_devfs does not remove the devices it creates during the course of its execution which might be considered as a resource leak. Remedy that by adding the code to remove those devices upon function completion. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap

[PATCH v3 02/18] i.MX: serial: Add constants for UART clock divisor

2015-05-06 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- include/serial/imx-uart.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/serial/imx-uart.h b/include/serial/imx-uart.h index e40843d..0a01788 100644 --- a/include/serial/imx-uart.h +++ b/include/serial/imx-uart.h

[PATCH v3 07/18] i.MX51: babbage: Implement CONFIG_DEBUG_LL

2015-05-06 Thread Andrey Smirnov
Implement bits of configuraion needed to configure early debug output support. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/freescale-mx51-babbage/lowlevel.c | 42 +++ arch/arm/mach-imx/include/mach/clock-imx51_53.h | 5 +-- 2 files changed

[PATCH v3 00/18] i.MX serial cleanup, bootstrap code fixes, boot via IRAM

2015-05-06 Thread Andrey Smirnov
was creating :) Andrey Smirnov (18): i.MX: Move UART definitions into a separate file i.MX: serial: Add constants for UART clock divisor i.MX: serial: Add baud rate calculation convenience functions i.MX: serial: Add UART init functions for DEBUG_LL i.MX: serial: Convert PUTC_LL to use

[PATCH v3 06/18] i.MX: serial: Convert i.MX51 and i.MX6 to use 'imx*_uart_setup_ll'

2015-05-06 Thread Andrey Smirnov
NOTE: Boards 'karo-tx25' and 'tqma53' can benefit from this refactoring as well, but they were not converted because of the lack of i.MX25 or i.MX53 based hardware to test on. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/boards/eltec-hipercam/lowlevel.c | 18

[PATCH v3 05/18] i.MX: serial: Convert PUTC_LL to use IOMEM

2015-05-06 Thread Andrey Smirnov
Convert PUTC_LL to use IOMEM instead of explicit casting to 'void *', since the former seem to be more appropriate to the situation. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/mach-imx/include/mach/debug_ll.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH v3 12/18] bootstrap: Fix potential memory leak in 'read_image_head'

2015-05-06 Thread Andrey Smirnov
Original version of 'read_image_head' would not free the memory allocated for barebox header in cases of any failure. Fix this by adding a dedicated resourse de-allocation code path. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 8 ++-- 1 file changed, 6

[PATCH v3 08/18] i.MX: serial: Distil common clock ungating code

2015-05-06 Thread Andrey Smirnov
Move all of the common clock ungating code in early UART initialization into a dedicated subroutine that can be shared by all of the users. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- .../arm/boards/freescale-mx6sx-sabresdb/lowlevel.c | 9 + arch/arm/boards/guf-santaro

[PATCH v3 11/18] imx-image: Correctly fill image size in prepended header

2015-05-06 Thread Andrey Smirnov
If called with '-b' option 'imx-image' tool prepends barebox header to the image, but the tool does not fill the data at image size offset correctly. Fix that. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- scripts/imx/Makefile| 2 ++ scripts/imx/imx-image.c | 11 ++- 2

[PATCH v3 16/18] bootstrap_read_devfs(): Check for errors from dev_add_bb_dev()

2015-05-06 Thread Andrey Smirnov
Check for errors returned by dev_add_bb_dev() and bail if there are any. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/bootstrap/devfs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c index 576f151

[PATCH v3 10/18] i.MX: Add provisions to boot from IRAM

2015-05-06 Thread Andrey Smirnov
DRAM. But the presense of the intermediate IRAM-only stage allows to add provisions to test the area of DRAM that Barebox would be using to facilitate various testing scenarious. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- Documentation/boards/imx.rst | 27

[PATCH 03/10] common/memtest.c: Refactor mem_test() into three surbroutines

2015-05-13 Thread Andrey Smirnov
Original mem_test() was rather long an contained code to perform two distinct operations. This patch moves that code into two separate subroutines and converts mem_test into a high level interface that calls the subroutines. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common

[PATCH 06/10] common: pbl: Allow boards to override hang()

2015-05-13 Thread Andrey Smirnov
Add provisions such that board code can re-define the behaviour of hang() to implement a behaviour better suited for a particular hardware platform. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/startup.c | 15 ++- include/common.h | 22 ++ pbl

[PATCH 10/10] ARM: pbl: Add an option to validate DRAM

2015-05-13 Thread Andrey Smirnov
Add an option to perform DRAM region validation before using it. The framework allows individual boards to set up a memory validaion hook that would be called prior to Barebox using that region of memory. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/cpu/start.c

[PATCH 09/10] pbl: Implement ctrlc() using getc_ll()

2015-05-13 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- pbl/console.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pbl/console.c b/pbl/console.c index a9859ad..e34633f 100644 --- a/pbl/console.c +++ b/pbl/console.c @@ -30,12 +30,19 @@ int pr_print(int level

[PATCH 02/10] common/memtest.c: Do not omit offset of 0 from tests

2015-05-13 Thread Andrey Smirnov
/software-based-memory-testing.html and the code in barebox is based on that code. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/memtest.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/common/memtest.c b/common/memtest.c index 3b0bcb7..9eda788

[PATCH 04/10] common/memtest.c: Distil common error reporting code

2015-05-13 Thread Andrey Smirnov
Move all of the common code for error message output into a new function mem_test_report_failure() and convert the rest of the code to use it. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/memtest.c | 53 - 1 file changed

[PATCH 05/10] serial: i.MX: Write settings to a correct register

2015-05-13 Thread Andrey Smirnov
Fix what looks like a copy and past error, where settings for USR1 register were being written to USR2. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/serial/serial_imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/serial/serial_imx.c b

[PATCH 01/10] common/memtest.c: Fix incorrect array boundary check

2015-05-13 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/memtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/memtest.c b/common/memtest.c index 25a97d8..3b0bcb7 100644 --- a/common/memtest.c +++ b/common/memtest.c @@ -91,8 +91,7 @@ int mem_test

[PATCH 07/10] debug_ll: i.MX: Add support for input to DEBUG_LL

2015-05-13 Thread Andrey Smirnov
Add input support to DEBUG_LL infrastructure and implement it for i.MX Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- arch/arm/Kconfig | 1 + arch/arm/mach-imx/include/mach/debug_ll.h | 26 ++ common/Kconfig

[PATCH] spi: i.MX: Respect the value of 'cs_change'

2015-04-13 Thread Andrey Smirnov
Add the code to correctly handle 'cs_change' field in 'struct spi_transfer'(base on the similar code from altera_spi.c) Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/spi/imx_spi.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git

[PATCH] firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()

2015-04-13 Thread Andrey Smirnov
Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length is not a multiple of 4 would cause an integer overflow which would result in infinite loop. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/firmware/socfpga.c | 26 ++ 1 file changed

[PATCH] firmware: socfpga: Add necessary dependency to Kconfig

2015-04-13 Thread Andrey Smirnov
--- drivers/firmware/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig index 15465fe..710b500 100644 --- a/drivers/firmware/Kconfig +++ b/drivers/firmware/Kconfig @@ -13,5 +13,5 @@ config FIRMWARE_ALTERA_SERIAL config

Booting Linux on Altera's socfpga

2015-04-13 Thread Andrey Smirnov
experience booting Linux using barebox on aforementioned board I'd greatly appreciate to hear about how you did it. Thank you, Andrey Smirnov ___ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox

Re: [PATCH] firmware: socfpga: Fix a bug in fpgamgr_program_write_buf()

2015-04-14 Thread Andrey Smirnov
On Tue, Apr 14, 2015 at 11:46 AM, Sascha Hauer s.ha...@pengutronix.de wrote: Hi Andrey, On Mon, Apr 13, 2015 at 05:11:50AM -0700, Andrey Smirnov wrote: Fix a bug in fpgamgr_program_write_buf() where .rbf file whose length is not a multiple of 4 would cause an integer overflow which would

Re: [PATCH 10/10] ARM: pbl: Add an option to validate DRAM

2015-06-01 Thread Andrey Smirnov
How about testing only a small fragment of DRAM, say 8MB, in your lowlevel board code and calling barebox_arm_entry() with the membase/memsize you previously tested? This way you can make sure that barebox only uses tested memory without having to test all memory before calling

Re: [PATCH 10/10] ARM: pbl: Add an option to validate DRAM

2015-05-24 Thread Andrey Smirnov
Also, testing all of the memory in PBL code brings up the question of what is the point of 'memtest' command? If the only comprehensive way The memtest command enable/disable caches and running the memtest function. The memtest function is moslty the same like it was when I touched the

Re: [PATCH 06/10] common: pbl: Allow boards to override hang()

2015-05-23 Thread Andrey Smirnov
On Thu, May 14, 2015 at 10:25 PM, Sascha Hauer s.ha...@pengutronix.de wrote: Hi Andrey, On Wed, May 13, 2015 at 07:54:23PM -0700, Andrey Smirnov wrote: Add provisions such that board code can re-define the behaviour of hang() to implement a behaviour better suited for a particular hardware

Re: [PATCH 01/10] common/memtest.c: Fix incorrect array boundary check

2015-05-23 Thread Andrey Smirnov
On Thu, May 14, 2015 at 10:33 PM, Sascha Hauer s.ha...@pengutronix.de wrote: On Wed, May 13, 2015 at 07:54:18PM -0700, Andrey Smirnov wrote: Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- common/memtest.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) I have applied

Re: [PATCH 10/10] ARM: pbl: Add an option to validate DRAM

2015-05-23 Thread Andrey Smirnov
On Tue, May 19, 2015 at 12:06 AM, Sascha Hauer s.ha...@pengutronix.de wrote: Hi Andrey, On Wed, May 13, 2015 at 07:54:27PM -0700, Andrey Smirnov wrote: Add an option to perform DRAM region validation before using it. The framework allows individual boards to set up a memory validaion hook

Re: [PATCH v2] i2c-imx: Add missing preporcessor directives

2015-08-15 Thread Andrey Smirnov
On Sat, Aug 15, 2015 at 1:53 PM, Sam Ravnborg s...@ravnborg.org wrote: Hi Andrey. On Sat, Aug 15, 2015 at 09:44:31AM -0700, Andrey Smirnov wrote: On non-PowerPC platforms call to i2c_fsl_set_clk() will try to obtain I2C clock freqency from i2c_fsl-clk, however that field would

[PATCH] i2c-imx: Fix memory leak in i2c_fsl_probe()

2015-08-14 Thread Andrey Smirnov
All points of failure in the code of i2c_fsl_probe() happen after the allocation of i2c_fsl, so all of them have to perform necessary cleanup setups in case of failure. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/i2c/busses/i2c-imx.c | 12 1 file changed, 8

[PATCH v2] lib: libfile: Do not ignore errors in close()

2015-08-14 Thread Andrey Smirnov
for success. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- lib/libfile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libfile.c b/lib/libfile.c index ba03700..a27460c 100644 --- a/lib/libfile.c +++ b/lib/libfile.c @@ -262,7 +262,7 @@ int copy_file(const

[PATCH] i2c-imx: Add missing preporcessor directives

2015-08-14 Thread Andrey Smirnov
if CONFIG_COMMON_CLK is not set. Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/i2c/busses/i2c-imx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 4cd03e1..4abb710 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b

Re: [PATCH] i2c-imx: Add missing preporcessor directives

2015-08-15 Thread Andrey Smirnov
This driver is only built for ARCH_IMX (which select COMMON_CLK) or two PowerPC variants. See following snip from Kconfig: config I2C_IMX bool MPC85xx/MPC5200/i.MX I2C Master driver depends on (ARCH_IMX !ARCH_IMX1) || ARCH_MPC85XX || ARCH_MPC5200 How did you hit this

[PATCH v2] i2c-imx: Add missing preporcessor directives

2015-08-15 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov andrew.smir...@gmail.com --- drivers/i2c/busses/i2c-imx.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 4cd03e1..84c6e16 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c

Re: [PATCH] lib: libfile: Do not ignore errors in close()

2015-07-20 Thread Andrey Smirnov
free(rw_buf); if (srcfd 0) - close(srcfd); + err1 = close(srcfd); if (dstfd 0) - close(dstfd); + err2 = close(dstfd); I agree that an error on closing the destination is an error for copy_file, but is an error on closing

[PATCH v2] ARM: Add support for semihosting

2015-10-28 Thread Andrey Smirnov
Add semihosting API implementation and implement a filesystem driver to access debugging host filesystem using it. Tested on Freescale SabreSD board (i.MX6Q) using OpenOCD Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- New in version 2: - Added documntation for host side

[PATCH v2 2/2] arm/cpu: Avoid multiple definitions of barebox_arm_entry

2015-10-28 Thread Andrey Smirnov
All versions of barebox_arm_entry (in uncompress.c, start.c and start-pbl.c) appear to be doing exacty the same thing. So move the definition into a separate file and use IS_ENABLED macro to avoid re-definition. Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- Changes si

[PATCH v2 1/2] arm/cpu/start.c: Distil some common code in __start().

2015-10-28 Thread Andrey Smirnov
(board data vs. device tree) Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- Changes since v1: - Unified barebox_boarddata and barebox_boot_dtb into barebox_private_data which allowed to simplify distilled code and avoid using double star pointers ar

[PATCH v2] i2c: Add support for DesignWare controllers

2015-11-08 Thread Andrey Smirnov
Add a driver for DesignWare I2C controller IP block found on several SoCs including Altera SoC products Tested using Terrasic SoCKit board and GPIO expander board with I2C EEPROM on it Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- New in version 2: - kzalloc() re

[PATCH] fs: smhfs: Fix return value of truncate()

2015-11-08 Thread Andrey Smirnov
grow the file size when writing) automatically Unfortunately this was missed in original commit that introduced semihosting Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- fs/smhfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smhfs.c b/fs/smhfs.c

[PATCH] i2c-imx: Use xzalloc instead of kzalloc

2015-11-08 Thread Andrey Smirnov
Driver's private data structure is allocated with kzalloc without any code to check for kzalloc's possible failure. Fix that by replaceing kzalloc with xzalloc. Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion

[PATCH] i2c: Add support for DesignWare controllers

2015-10-31 Thread Andrey Smirnov
Add a driver for DesignWare I2C controller IP block found on several SoCs including Altera SoC products Tested using Terrasic SoCKit board and GPIO expander board with I2C EEPROM on it Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- drivers/i2c/busses/Kconfig

[PATCH] memtest: Fix reference to non-existing function

2015-10-31 Thread Andrey Smirnov
It looks like commit c674e2d5847069ff34fb05e012ff1464cc0a6b37 replaced mem_test_moving_inversions() with mem_test_moving_inversions_pattern() but did not include the code of the latter function. Revert that portion of the change in order to fix the build Signed-off-by: Andrey Smirnov <andrew.s

[PATCH v3 2/2] arm/cpu: Avoid multiple definitions of barebox_arm_entry

2015-10-30 Thread Andrey Smirnov
All versions of barebox_arm_entry (in uncompress.c, start.c and start-pbl.c) appear to be doing exacty the same thing. So move the definition into a separate file and use IS_ENABLED macro to avoid re-definition. Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- Changes si

Re: [PATCH v2 1/2] arm/cpu/start.c: Distil some common code in __start().

2015-10-30 Thread Andrey Smirnov
> > Previously we knew that the pointer barebox_arm_machine() works on is a > machine type entry and we knew that the pointer returned from > barebox_arm_boot_dtb() is a dtb. With this patch both are share the same > pointer so we would have to check if the result returned from >

[PATCH] ARM: Add support for semihosting

2015-10-18 Thread Andrey Smirnov
Add semihosting API implementation and implement a filesystem driver to access debugging host filesystem using it. Tested on Freescale SabreSD board (i.MX6Q) using OpenOCD Signed-off-by: Andrey Smirnov <andrew.smir...@gmail.com> --- Documentation/filesystems/smhfs.rst | 20 ar

Re: [PATCH] ARM: Add support for semihosting

2015-10-19 Thread Andrey Smirnov
>> +.. _filesystems_smhfs: >> + >> +File I/O over ARM semihosting support >> += >> + >> +barebox can communicate with debug programms attached via SWD/JTAG by > ^ programs? > Oops, yes, thank you. Will fix.

  1   2   3   4   5   6   7   8   9   10   >