Re: [PATCH 2/3] libfile: open_and_lseek: enlarge small files enough to make lseek possible

2018-08-10 Thread Uwe Kleine-König
On Fri, Aug 10, 2018 at 08:22:47AM +0200, Sascha Hauer wrote: > On Thu, Aug 09, 2018 at 10:33:12AM +0200, Uwe Kleine-König wrote: > > This makes the following do the expected thing: > > > > barebox@barebox sandbox:/ ls -l lala > > -rwxrwxrwx 4 lala > > barebox@barebox sand

Re: [PATCH v2 2/3] phylib: add support for reset-gpios

2018-08-10 Thread Sam Ravnborg
On Fri, Aug 10, 2018 at 08:40:31AM +0200, Sascha Hauer wrote: > Hi Sam, > > Some comments inside. snip - many review good comments. Thanks! Will address all comments and submit a v3. Sam ___ barebox mailing list barebox@lists.infradead.org ht

Re: Help requested with Barebox on Globalscale Mirabox

2018-08-10 Thread Uwe Kleine-König
Hello Leigh, On Thu, Aug 09, 2018 at 04:14:48PM +0100, Leigh Brown wrote: > On 2018-08-06 19:36, Uwe Kleine-König wrote: > > Hello Leigh, > > > > On Tue, Jul 31, 2018 at 02:21:04PM +0100, Leigh Brown wrote: > > > Have I missed any steps? Any help would be greatly appreciated. > > > > Looks good

[PATCH 1/2] ARM: imx: add fusemap entries for i.MX6SDL silicon revision >=1.4

2018-08-10 Thread Bastian Stender
Signed-off-by: Bastian Stender --- arch/arm/mach-imx/include/mach/ocotp-fusemap.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/arch/arm/mach-imx/include/mach/ocotp-fusemap.h b/arch/arm/mach-imx/include/mach/ocotp-fusemap.h index 44b58ca6e8..aec50dbf8a 100644 --- a/arch/arm/mach-imx/

[PATCH 2/2] HAB: fuse recommended OCOTP_DIR_BT_DIS

2018-08-10 Thread Bastian Stender
This is now recommended for all systems. Especially for the HAB usecase disallowing alternative boot selection after WDOG reset is essential. Signed-off-by: Bastian Stender --- drivers/hab/hab.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/hab/hab.c b/drivers/hab/hab.c inde

[PATCH v2] HAB: fuse recommended OCOTP_DIR_BT_DIS

2018-08-10 Thread Bastian Stender
This is now recommended for all systems. Especially for the HAB usecase disallowing alternative boot selection after WDOG reset is essential. Signed-off-by: Bastian Stender --- Changes since v1: - removed accidentally added empty line --- drivers/hab/hab.c | 6 ++ 1 file changed, 6 inserti

[PATCH v2 12/14] ARM: MXS: mxs_power_status: use less magic values

2018-08-10 Thread Roland Hieber
... and in that process fix the erroneous usage of VDDA values when printing the stats for POWER_VDDDCTRL_DISABLE_FET and all of the *LINREG_OFFSET bitfields. Signed-off-by: Roland Hieber --- arch/arm/mach-mxs/power-init.c | 37 ++ 1 file changed, 20 insertions(+)

[PATCH v2 09/14] ARM: MXS: make power levels configurable in mx2*_power_init

2018-08-10 Thread Roland Hieber
Depending on the application, board code might want to configure different power levels and brownout thresholds. They can do so now with an additional struct mxs_power_ctrls* parameter to mx2*_power_init. Note that VDDMEM was not set up explicitely in mx28_power_init, but can now be configured. Ho

[PATCH v2 01/14] scripts: mxsimage: Allow unencrypted images

2018-08-10 Thread Roland Hieber
From: Sascha Hauer Normally MXS SoCs only allow to boot images which have been encrypted with a zero key. If the ENABLE_UNENCTRYPTED_BOOT fuse is blown then the SoC also allows to boot unencrypted images. Add an option to the mxsimage tool to generate such images. Signed-off-by: Sascha Hauer Si

[PATCH v2 02/14] images: MXS: allow generation of unencrypted bootstreams

2018-08-10 Thread Roland Hieber
mxsimage can now build unencrypted images with -u, so make use of it in the Makefile. To keep the existing rules simple, name the generated images *.mxsbsu instead of *.mxsbs. Signed-off-by: Roland Hieber --- images/Makefile.mxs | 8 1 file changed, 8 insertions(+) diff --git a/images/

[PATCH v2 05/14] ARM: i.MX28: Add memory size detection

2018-08-10 Thread Roland Hieber
From: Sascha Hauer We can detect the SDRAM automatically, no need to let the boards do it manually. This also fixes device tree based i.MX28 boards like the duckbill. These boards once had a /memory node in the device tree, but now that this was changed to /memory@4000 barebox didn't find it

[PATCH v2 06/14] ARM: i.MX23: Add memory size detection

2018-08-10 Thread Roland Hieber
From: Sascha Hauer No need for the boards to manually add memory, we can do this automatically by reading back the memory size from the SDRAM controller. Signed-off-by: Sascha Hauer Signed-off-by: Roland Hieber --- .../arm/boards/chumby_falconwing/falconwing.c | 8 - arch/arm/boards/free

[PATCH v2 00/14] MXS low-level improvements

2018-08-10 Thread Roland Hieber
While porting barebox onto a new old MX28 board, I had to extend the low-level code to set up SDRAM and PMIC. Most of those changes are probably also applicable to MX23 boards since the code paths are the same, and are only wrapped in mx28_*/mx23_*-specific wrapper functions. (Also, if anyone want

[PATCH v2 11/14] ARM: MXS: make VDDx brownout setup more understandable

2018-08-10 Thread Roland Hieber
Rename bo_int to prev_bo_enirq to make its purpose clearer, and throw in a few comments for easier understanding. Signed-off-by: Roland Hieber --- arch/arm/mach-mxs/power-init.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-mxs/power-init.c b/arch/a

[PATCH v2 08/14] ARM: MXS: allow starting from battery input without 4P2 source enabled

2018-08-10 Thread Roland Hieber
Some boards don't need the 4.2V power source at all, so allow them to keep it disabled for efficiency reasons. For backwards compatibility, don't disable the 4P2 power source on the existing boards which are supplied from battery input. The POWER_USE_5V code path however always enables it up as i

[PATCH v2 13/14] ARM: MXS: mxs_power_status: align output

2018-08-10 Thread Roland Hieber
Exemplary previous behaviour: vddio: 3100mV (BO -200mV), Linreg enabled, Linreg offset: -1, FET enabled vdda: 1800mV (BO -175mV), Linreg disabled, Linreg offset: -1, FET enabled vddd: 1200mV (BO -175mV), Linreg enabled, Linreg offset: -1, FET disabled vddmem: 1500mV (BO -25mV), Linreg

[PATCH v2 07/14] ARM: MXS: refactor mx2*_power_init source configuration

2018-08-10 Thread Roland Hieber
Having three ints as parameter suggests that we can use up to 2^3 power configurations for the system, but when we look at the code, the power setup is packaged in if {...} else if {...} else if {...} blocks, so setting more than one parameter to 1 is useless here. Refactor the parameters into an

[PATCH v2 10/14] ARM: MXS: fix VDDx brownout setup logic

2018-08-10 Thread Roland Hieber
The cfg->bo_irq and cfg->bo_enirq (i.e. VDDx_BO_IRQ and ENIRQ_VDDx_BO) flags are part of POWER_CTRL, so setting those flag in cfg->reg (i.e. POWER_VDDxCTRL) makes no sense. Fortunately, those bits are reserved in ENIRQ_VDDx_BO, so writing them did no harm, but also doesn't work as intended. Signed

[PATCH v2 03/14] ARM: MXS: i.MX28: allow setup of low-voltage SDRAM

2018-08-10 Thread Roland Hieber
The PINCTRL_*_DDR_MODE_* defines are now needed in global scope, so move them to the respective include header. Signed-off-by: Roland Hieber --- arch/arm/boards/duckbill/lowlevel.c | 3 ++- arch/arm/boards/freescale-mx28-evk/lowlevel.c | 3 ++- arch/arm/boards/karo-tx28/lowlevel.c

[PATCH v2 04/14] ARM: MXS: allow configuration of EMI clock prescaler

2018-08-10 Thread Roland Hieber
Allow to set not only the fractional divider, but also the prescaler for the EMI clock in mxs_mem_init_clock(), and rename the parameters accordingly to reflect the change. Port the existing board code to set up the EMI clock explicitely with the old values. Also fix the off-by-a-half error in the

[PATCH v2 14/14] Documentation: MXS: general update and improvements

2018-08-10 Thread Roland Hieber
Go more into detail about the relationship of the prepare stage and the bootloader image, and about the generated images. Also don't use mxs-usb-loader anymore since it has been removed. Fixes: 3ca576cc4a4236a2556ab17 "scripts: imx/mxs remove mxs-usb-loader" Signed-off-by: Roland Hieber --- Docu

[PATCH] ARM: i.MX: freescale-mx6sx-sabresdb: Make ar8031_phy_fixup static

2018-08-10 Thread Andrey Smirnov
Declare ar8031_phy_fixup as static since it is not being exported to any other users. --- arch/arm/boards/freescale-mx6sx-sabresdb/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boards/freescale-mx6sx-sabresdb/board.c b/arch/arm/boards/freescale-mx6sx-sabresd

[PATCH] ARM: lib64: Properly handle unaligned addresses in string functions

2018-08-10 Thread Andrey Smirnov
Together FEC driver and parts of IP stack might end up trying to memcpy() small chunks of memory from uncached (that is Device memory) addresses that are not properly aligned, leading to data abort. To prevent such cases, add code to guard unaligned accesses and redirect them to byte-wise implemen

[PATCH] i.MX: i2c: Fix build error in debug output code

2018-08-10 Thread Andrey Smirnov
Looks like that particular chunk of the code have not been built in a while and bitrotted. Change function parameters appropriately to avoid breaking the build. Signed-off-by: Andrey Smirnov --- drivers/i2c/busses/i2c-imx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/

[PATCH] i.MX: Select DRIVER_SPI_IMX_2_3 for i.MX8MQ

2018-08-10 Thread Andrey Smirnov
Select DRIVER_SPI_IMX_2_3 for i.MX8MQ since that is the variant that's being used Signed-off-by: Andrey Smirnov --- drivers/spi/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 84945744e..fed628c58 100644 --- a/drivers/sp

[PATCH] pinctrl: i.MX: Add code to parse "input-enable"

2018-08-10 Thread Andrey Smirnov
Add code to parse "input-enable" and intepret it as SION bit. This is needed for I2C configuration on i.MX8MQ EVK board. Signed-off-by: Andrey Smirnov --- drivers/pinctrl/imx-iomux-v3.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/imx-iomux-v3.c b/drivers/pinctrl/imx-io

[PATCH 6/6] ARM: i.MX8MQ: Save boot location during initialization

2018-08-10 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/imx8mq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/mach-imx/imx8mq.c b/arch/arm/mach-imx/imx8mq.c index 1d0bbcfdb..4d00da5f0 100644 --- a/arch/arm/mach-imx/imx8mq.c +++ b/arch/arm/mach-imx/imx8mq.c @@ -54,6 +54,8 @@ int imx8

[PATCH 3/6] ARM: i.MX: boot: Rework boot source detection for i.MX7 and i.MX8MQ

2018-08-10 Thread Andrey Smirnov
For both SoCs data found in SBMR registers reflects only the boot source that was selected via pins of fuses and not the final boot source that ended up being used by MaskROM code. Original i.MX7 boot source detection implementation worked around that fact by having a special code to correctly hand

[PATCH 2/6] ARM: i.MX: boot: Fix accidental comma

2018-08-10 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-imx/boot.c b/arch/arm/mach-imx/boot.c index ab25f75b2..45170ab10 100644 --- a/arch/arm/mach-imx/boot.c +++ b/arch/arm/mach-imx/boot.c @@ -512,7 +512,7 @@ vo

[PATCH 1/6] ARM: i.MX8M: Expose code to query cpu revision

2018-08-10 Thread Andrey Smirnov
CPU revision information is needed for boot source detection, so expose it as a small helper function and convert existing code to use it. Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/imx8mq.c | 57 +++-- arch/arm/mach-imx/include/mach/imx8mq.h | 38 ++

[PATCH 4/6] ARM: i.MX8MQ: Replace magic numbers with named constants

2018-08-10 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/imx8mq.c | 6 +++--- arch/arm/mach-imx/include/mach/imx8mq.h | 11 --- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-imx/imx8mq.c b/arch/arm/mach-imx/imx8mq.c index bc463ee75..95839f31d 10064

[PATCH 0/6] i.MX8MQ boot source, reset reason, etc.

2018-08-10 Thread Andrey Smirnov
Everyone: This series is a number of fixes and changes I made for boot source and reset reason detection on i.MX8MQ. Hopefully all of the changes are self-explanatory. Feedback is welcome! Thanks, Andrey Smirnov Andrey Smirnov (6): ARM: i.MX8M: Expose code to query cpu revision ARM: i.MX: b

[PATCH 5/6] ARM: i.MX8MQ: Add code to detect reset reason

2018-08-10 Thread Andrey Smirnov
Reset reason bits and their meaning seem to be identical between i.MX7 and i.MX8MQ. Share the definitions for the former and used it for the latter. Signed-off-by: Andrey Smirnov --- arch/arm/mach-imx/imx.c | 11 +++ arch/arm/mach-imx/imx7.c | 1

Re: [PATCH v2 06/14] ARM: i.MX23: Add memory size detection

2018-08-10 Thread Andrey Smirnov
On Fri, Aug 10, 2018 at 9:35 AM Roland Hieber wrote: > > From: Sascha Hauer > > No need for the boards to manually add memory, we can do this > automatically by reading back the memory size from the SDRAM > controller. > > Signed-off-by: Sascha Hauer > Signed-off-by: Roland Hieber > --- > .../

Re: [PATCH v2 07/14] ARM: MXS: refactor mx2*_power_init source configuration

2018-08-10 Thread Andrey Smirnov
On Fri, Aug 10, 2018 at 9:36 AM Roland Hieber wrote: > > Having three ints as parameter suggests that we can use up to 2^3 > power configurations for the system, but when we look at the code, the > power setup is packaged in if {...} else if {...} else if {...} blocks, > so setting more than one p