Re: [PATCH v4] Terasic DE0-Nano-SoC: add support

2016-02-02 Thread Trent Piepho
On Mon, 2016-02-01 at 11:08 -0800, Andrey Smirnov wrote: > On Mon, Feb 1, 2016 at 8:09 AM, Tim Sander wrote: > > + > > + if (IS_ENABLED(CONFIG_PHYLIB)) > > + phy_register_fixup_for_uid(PHY_ID_KSZ9021, > > MICREL_PHY_ID_MASK, phy_fixup); > > I don't

Re: [PATCH v2 8/8] miitool: Add code to register a PHY

2016-02-02 Thread Andrey Smirnov
On Mon, Feb 1, 2016 at 1:35 AM, Sascha Hauer wrote: > Hi Andrey, > > On Sun, Jan 31, 2016 at 07:10:13PM -0800, Andrey Smirnov wrote: >> This commit changes the behaviour of the 'miitool'. Now in order to show >> PHY's link information 'miitool' should be invoked as such:

Re: [RFC 1/2] misc: Add MAC address mapper "driver"

2016-02-02 Thread Andrey Smirnov
> > I wonder if the correct way to do this wouldn't be nvmem, see > Documentation/devicetree/bindings/nvmem/nvmem.txt in the Kernel. > This would mandate a binding like: > > ocotp { > mac1: mac@88 { > reg = <0x88 0x6>; > }; >

Re: [PATCH v4] Terasic DE0-Nano-SoC: add support

2016-02-02 Thread Andrey Smirnov
On Tue, Feb 2, 2016 at 3:30 PM, Trent Piepho wrote: > On Mon, 2016-02-01 at 11:08 -0800, Andrey Smirnov wrote: >> On Mon, Feb 1, 2016 at 8:09 AM, Tim Sander wrote: > >> > + >> > + if (IS_ENABLED(CONFIG_PHYLIB)) >> > +

Re: scripts/remote: make clean leftovers

2016-02-02 Thread Sascha Hauer
On Tue, Jan 26, 2016 at 11:49:09AM +0100, Jan Lübbe wrote: > On Di, 2016-01-26 at 11:04 +0100, Yegor Yefremov wrote: > > After performing make distclean I've discovered following files being > > removed: > > > > Changes not staged for commit: > > (use "git add/rm ..." to update what will be

Re: [PATCH v4] Terasic DE0-Nano-SoC: add support

2016-02-02 Thread Sascha Hauer
On Mon, Feb 01, 2016 at 11:08:10AM -0800, Andrey Smirnov wrote: > On Mon, Feb 1, 2016 at 8:09 AM, Tim Sander wrote: > > v4: use the amended patch not the old one, doh. Sorry for the noise. > > > > +static inline void ledon(int led) > > +{ > > + u32 val; > > + > > +

[PATCH 32/34] images: imx: Add targets for signed images and signed usb images

2016-02-02 Thread Sascha Hauer
Add .simximg target for signed images and .usimximg for signed images suitable for USB upload Signed-off-by: Sascha Hauer --- images/Makefile | 3 ++- images/Makefile.imx | 6 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/images/Makefile

[PATCH 28/34] scripts: imx-usb-loader: Use dcd len to invalidate dcd data

2016-02-02 Thread Sascha Hauer
We invalidate the dcd data in the uploaded image since we already processed it manually. To do so we have set the dcd pointer to 0. Doing it this way prevents the ROM from executing the HAB code in debug mode. Use the dcd length instead to invalidate the dcd data. Signed-off-by: Sascha Hauer

[PATCH 15/34] scripts: imx-image: Add context struct to config parsers

2016-02-02 Thread Sascha Hauer
This adds a context struct to the config parser. This is a first step to make the config parser usable from both imx-image and imx-usb-loader which will be needed later. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 66

[PATCH 12/34] scripts: imx-usb-loader: fully read images into memory

2016-02-02 Thread Sascha Hauer
imx-usb-loader tries to safe memory by reading the image in chunks. This is unnecessarily complicated. The images are small, so fully read them into memory and store them in a single buffer. This makes handling them a lot easier. Signed-off-by: Sascha Hauer ---

[PATCH 14/34] scripts: imx: Consolidate flash headers in imx tools

2016-02-02 Thread Sascha Hauer
Both imx-image and imx-usb-loader use their own variants of the i.MX flash header definitions. Consolidate them to avoid code duplication. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 49 ++-- scripts/imx/imx-usb-loader.c | 89

[PATCH 33/34] scripts: imx-usb-loader: Do not zero out boot_data_ptr

2016-02-02 Thread Sascha Hauer
This shouldn't be necessary. So far it didn't hurt either, but now this invalidates the signature of the image, so keep the image unmodified. Signed-off-by: Sascha Hauer --- scripts/imx/imx-usb-loader.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[PATCH 19/34] scripts: imx: make libusb variables global

2016-02-02 Thread Sascha Hauer
No need to pass the libusb context through from function to function. Make them globally visible. Signed-off-by: Sascha Hauer --- scripts/imx/imx-usb-loader.c | 172 --- 1 file changed, 81 insertions(+), 91 deletions(-) diff --git

[PATCH 03/34] scripts: Add scripts/include to host compiler includes

2016-02-02 Thread Sascha Hauer
So that host tools can use the kernel includes. Signed-off-by: Sascha Hauer --- scripts/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/Makefile b/scripts/Makefile index a3f6222..aeedcac 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -20,6

[PATCH 09/34] scripts: imx-usb-loader: Make readonly arguments const

2016-02-02 Thread Sascha Hauer
The buffers passed to dump_long and dump_bytes are not (and shouldn't be) modified. Make the arguments const. Signed-off-by: Sascha Hauer --- scripts/imx/imx-usb-loader.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git

[PATCH 08/34] hab: Add HABv3 status report function

2016-02-02 Thread Sascha Hauer
Status reporting for HABv3 is different from HABv4. Add a status report function for HABv3. Signed-off-by: Sascha Hauer --- drivers/hab/Makefile | 1 + drivers/hab/habv3.c | 78 include/hab.h| 9 ++ 3

[PATCH v2] i.MX HABv4 rework and HABv3 support

2016-02-02 Thread Sascha Hauer
This series reworks the i.MX HABv4 support and adds support for HABv3 as found on i.MX25, i.MX35 and i.MX51. HABv4 support was implemented using a relatively complicated makefile in images/Makefile.imxhabv4. Since the makefiles in images/ are complicated enough already this is changed in this

[PATCH 17/34] scripts: imx-image: move check to context data

2016-02-02 Thread Sascha Hauer
Move the config parsers check function to context data to make it possible to pass in a different version of this function later. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 29 ++--- 1 file changed, 22 insertions(+), 7 deletions(-)

[PATCH 22/34] scripts: imx-image: move more variables to context data

2016-02-02 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 17 - scripts/imx/imx.h | 3 +++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/scripts/imx/imx-image.c b/scripts/imx/imx-image.c index 090d5c4..731b5de 100644 ---

[PATCH 13/34] scripts: imx-usb-loader: Move load_file up

2016-02-02 Thread Sascha Hauer
To avoid forward declaration in a later patch. Signed-off-by: Sascha Hauer --- scripts/imx/imx-usb-loader.c | 172 +-- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/scripts/imx/imx-usb-loader.c

[PATCH 23/34] scripts: imx-image: pass config data to add_header_*

2016-02-02 Thread Sascha Hauer
Now that we have a config data struct we can pass it to add_header_* to reduce the argument count. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/imx/imx-image.c

[PATCH 26/34] scripts: imx: Allow to create signed images

2016-02-02 Thread Sascha Hauer
This patch allows to call CST directly from imx-image to create signed images. CST is called whenever the config file contains the hab commands which means a CSF is generated. Calling CST requires some quirks. First of all CST returns successfully whenever a CSF exists, no matter is the CSF

[PATCH 02/34] scripts/include: Add ARRAY_SIZE

2016-02-02 Thread Sascha Hauer
ARRAY_SIZE is another define commonly used in tools. Add it to the kernel includes. Signed-off-by: Sascha Hauer --- scripts/include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/include/linux/kernel.h b/scripts/include/linux/kernel.h index

[PATCH 16/34] scripts: imx-image: move write_mem to context data

2016-02-02 Thread Sascha Hauer
Move the config parsers write_mem function to context data to make it possible to pass in a different version of this function later. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-)

[PATCH 34/34] imx: hab: Make hab status functions SoC specific

2016-02-02 Thread Sascha Hauer
The HABv4 functions need access a part of the ROM which is located in the zero page. This must be done early, before the MMU has been configured and the zero page has been set to faulting. The HAB functions currently use cpu_is_imxxy(). At the stage where HAB is called the i.MX CPU type variable

[PATCH 31/34] Make: i.MX: Allow to pass config file to cmd_imx_image

2016-02-02 Thread Sascha Hauer
Pass the config file to cmd_imx_image as arguments to make it more flexible. Also add the possibility for another arg containing additional options. Signed-off-by: Sascha Hauer --- images/Makefile.imx | 4 ++-- scripts/Makefile.lib | 4 ++-- 2 files changed, 4

[PATCH 05/34] scripts: mxs: Use Kernel includes

2016-02-02 Thread Sascha Hauer
Use the common definition of ARRAY_SIZE and roundup. Signed-off-by: Sascha Hauer --- scripts/mxsimage.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scripts/mxsimage.c b/scripts/mxsimage.c index 0a5f6a0..2b1a5f3 100644 --- a/scripts/mxsimage.c

[PATCH 24/34] scripts: imx-image: Support adding a Super Root Key to the image

2016-02-02 Thread Sascha Hauer
Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/Kconfig | 7 +++ scripts/imx/Makefile | 4 ++ scripts/imx/imx-image.c | 130 ++ scripts/imx/imx.h | 1 + 4 files changed, 142 insertions(+) diff --git

Re: [PATCH 6/6] net: phy: micrel: errata for KSZ9031

2016-02-02 Thread Philipp Zabel
Am Dienstag, den 02.02.2016, 12:17 +0100 schrieb Philipp Zabel: > The KSZ9031 erratum #2 stats: > The 125MHz reference clock (CLK125_NDO pin) output > has duty cycle variation when the KSZ9031 links up in > 1000Base-T Slave mode, resulting in wide variation on > the falling clock

[PATCH 10/34] scripts: imx-usb-loader: Move definitions up

2016-02-02 Thread Sascha Hauer
The macros are needed earlier in a later patch. Signed-off-by: Sascha Hauer --- scripts/imx/imx-usb-loader.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c index f42ab67..5a94cf1

[PATCH 11/34] scripts: imx-image: Allow dcd offset 0x0

2016-02-02 Thread Sascha Hauer
0 is a valid offset for the dcd, so do not use this value to detect an unset dcd offset. Use 0x instead. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/imx/imx-image.c

[PATCH 04/34] scripts: imx: Use Kernel includes

2016-02-02 Thread Sascha Hauer
Use the common definition of ARRAY_SIZE and offsetof. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 6 +- scripts/imx/imx-usb-loader.c | 6 +- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/scripts/imx/imx-image.c

[PATCH 25/34] scripts: imx: Create CSF files from imx config file

2016-02-02 Thread Sascha Hauer
This is the first step to support creating signed images directly with the imx-image tool. i.MX images must be signed using the Freescale CST tool. CST needs informations already present in the imx-image tool, so it's convenient to call CST directly from imx-image. CST takes CSF files (Command

[PATCH 01/34] scripts: Add common header files for tools

2016-02-02 Thread Sascha Hauer
This imports the tools/include dir from the Kernel as of 4.5-rc1 to barebox. The Kernel has many useful defines and helpers which are often duplicated in the different tools. Let's create a copy of them in a common place for all tools. Some files have been skipped for now as I currently see no

[PATCH 06/34] ARM: i.MX: Add HABv3 Kconfig variables

2016-02-02 Thread Sascha Hauer
For signing i.MX images with HABv3 we need several certificates. Add their pathes to Kconfig variables to make them available to the build system. Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/Kconfig | 22 ++ 1 file changed, 22 insertions(+)

[PATCH 27/34] scripts: imx: Generate signed images with imx-image

2016-02-02 Thread Sascha Hauer
The imx-image tool can now generate signed images itself, so we can switch to this mechanism: - Move the CSF templates to header files which can be included by the flash config files - remove images/Makefile.imxhabv4 which is no longer necessary. Signed-off-by: Sascha Hauer

[PATCH 07/34] imx: hab: rename driver dir to hab/

2016-02-02 Thread Sascha Hauer
There's not only HABv4 but also HABv3. No need to put the corresponding code in separate directories, so rename the habv4 directory to hab. Signed-off-by: Sascha Hauer --- arch/arm/mach-imx/Kconfig | 5 + drivers/Makefile | 2 +- drivers/hab/Makefile |

[PATCH 30/34] scripts: imx-image: Allow to create HAB signed images suitable for USB upload

2016-02-02 Thread Sascha Hauer
For USB upload we must execute the DCD table manually and invalidate the DCD table in the uploaded image afterwards to prevent the ROM from executing the DCD data again. Doing this changes the image and thus also invalidates the signature. To make HAB signed images suitable for USB upload possible

[PATCH 21/34] scripts: imx: Drop double check

2016-02-02 Thread Sascha Hauer
We have the same "if (*line == '\0')" check twice. Remove one of them. Signed-off-by: Sascha Hauer --- scripts/imx/imx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/scripts/imx/imx.c b/scripts/imx/imx.c index 53f2bd1..0e260c4 100644 --- a/scripts/imx/imx.c +++

[PATCH 20/34] scripts: imx-usb-loader: Add -s and -i options

2016-02-02 Thread Sascha Hauer
Normally imx-usb-loader interprets and executes the DCD table from an uploaded image and invalidates the DCD before uploading the image itself to prevent the i.MX ROM code from executing it again. With HAB signed images this is not possible since invalidating the DCD table modifies the image which

[PATCH 29/34] scripts: imx-image: Factor out a read_file function

2016-02-02 Thread Sascha Hauer
The same code will be used a second time in a followup patch, so factor out a common function. Signed-off-by: Sascha Hauer --- scripts/imx/imx-image.c | 46 ++ 1 file changed, 30 insertions(+), 16 deletions(-) diff --git

[RFC] nfs: forward filesystem options to the kernel command line

2016-02-02 Thread Juergen Borleis
Using NFS in conjunction with boot spec and the feature to let barebox auto generate a kernel command line must keep the options the NFS filesystem was mounted in barebox. This patch extends the kernel command line parameter on demand if something different than the defaults were used. The

[PATCH 3/6] net: phy: micrel: Be more const correct

2016-02-02 Thread Philipp Zabel
Based on kernel commit 3c9a9f7fb0ee ("net/phy: micrel: Be more const correct") by Jaeden Amero : In a few places in this driver, we weren't using const where we could have. Use const more. In addition, change the arrays of strings in ksz9031_config_init() to be

[PATCH 2/6] net: phy: micrel: use BIT macro

2016-02-02 Thread Philipp Zabel
Based on kernel commit 00aee095000c ("net: phy: micrel: use BIT macro") by Johan Hovold . Signed-off-by: Philipp Zabel --- drivers/net/phy/micrel.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 6/6] net: phy: micrel: errata for KSZ9031

2016-02-02 Thread Philipp Zabel
The KSZ9031 erratum #2 stats: The 125MHz reference clock (CLK125_NDO pin) output has duty cycle variation when the KSZ9031 links up in 1000Base-T Slave mode, resulting in wide variation on the falling clock edge. The recommended workaround is to either only use the rising edge of

[PATCH 5/6] net: phy: micrel: Add workaround for bad autoneg

2016-02-02 Thread Philipp Zabel
Based on kernel commit d2fd719bcb0e ("net/phy: micrel: Add workaround for bad autoneg") by Nathan Sullivan : Very rarely, the KSZ9031 will appear to complete autonegotiation, but will drop all traffic afterwards. When this happens, the idle error count will

[PATCH 1/6] net: phy: micrel: Staticise ksz8873mll_read_status()

2016-02-02 Thread Philipp Zabel
Based on kernel commit 32d73b144eac ("net: phy: micrel: Staticise ksz8873mll_read_status()") by Jingoo Han : ksz8873mll_read_status() is used only in this file. Fix the following sparse warning: drivers/net/phy/micrel.c:147:5: warning: symbol

[PATCH 4/6] net: phy: micrel: Center FLP timing at 16ms

2016-02-02 Thread Philipp Zabel
Based on kernel commit 6270e1ae804a ("net/phy: micrel: Center FLP timing at 16ms") by Jaeden Amero : Signed-off-by: Philipp Zabel --- drivers/net/phy/micrel.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git

Re: [PATCH v2 8/8] miitool: Add code to register a PHY

2016-02-02 Thread Sascha Hauer
On Tue, Feb 02, 2016 at 04:41:46PM -0800, Andrey Smirnov wrote: > On Mon, Feb 1, 2016 at 1:35 AM, Sascha Hauer wrote: > > Hi Andrey, > > > > On Sun, Jan 31, 2016 at 07:10:13PM -0800, Andrey Smirnov wrote: > >> This commit changes the behaviour of the 'miitool'. Now in

Re: [PATCH v2 7/8] mdio_bus: Change PHY's naming scheme

2016-02-02 Thread Sascha Hauer
On Sun, Jan 31, 2016 at 07:10:12PM -0800, Andrey Smirnov wrote: > Change the way PHY devices are named upon creation. This commit replaces > sequentialy numbered "/dev/phy%d" with "/dev/mdio%d-phy%02x". This way > it is significanlty easier to identify which PHY in real-life (e.g. on a >

Re: [PATCH 1/6] net: phy: micrel: Staticise ksz8873mll_read_status()

2016-02-02 Thread Sascha Hauer
On Tue, Feb 02, 2016 at 12:17:30PM +0100, Philipp Zabel wrote: > Based on kernel commit 32d73b144eac ("net: phy: micrel: Staticise > ksz8873mll_read_status()") by Jingoo Han : > > ksz8873mll_read_status() is used only in this file. > Fix the following sparse warning:

Re: [RFC 1/2] misc: Add MAC address mapper "driver"

2016-02-02 Thread Andrey Smirnov
On Mon, Feb 1, 2016 at 11:18 AM, Trent Piepho wrote: > On Mon, 2016-02-01 at 11:10 +0100, Sascha Hauer wrote: >> On Sun, Jan 31, 2016 at 09:57:13PM -0800, Andrey Smirnov wrote: >> > Add Barebox specific device tree provisions to allow specifying MAC >> > addresses for

[PATCH v2] nfs: forward filesystem options to the kernel command line

2016-02-02 Thread Juergen Borleis
Using NFS in conjunction with boot spec and the feature to let barebox auto generate a kernel command line must keep the options the NFS filesystem was mounted in barebox. This patch extends the kernel command line parameter on demand if something different than the defaults are used. The

Re: [PATCH v3] Terasic DE0-Nano-SoC: add support

2016-02-02 Thread Tim Sander
On Monday 01 February 2016 19:31:53 Trent Piepho wrote: > On Mon, 2016-02-01 at 15:07 +0100, Tim Sander wrote: > > > v3: forgot to amend my changes in v2. > > > > + > > +static int socfpga_console_init(void) > > +{ > > + if (!of_machine_is_compatible("altr,socfpga-cyclone5")) > > +

Re: [PATCH v3] Terasic DE0-Nano-SoC: add support

2016-02-02 Thread Sascha Hauer
Hi Tim, On Tue, Feb 02, 2016 at 02:48:49PM +0100, Tim Sander wrote: > On Monday 01 February 2016 19:31:53 Trent Piepho wrote: > > On Mon, 2016-02-01 at 15:07 +0100, Tim Sander wrote: > > > > > v3: forgot to amend my changes in v2. > > > > > > + > > > +static int socfpga_console_init(void) > > >