Re: [PATCH 13/21] reset: imx7: Fix always writing bits as 0

2019-01-09 Thread Sascha Hauer
On Tue, Jan 08, 2019 at 11:12:02PM -0800, Andrey Smirnov wrote: > Port of a Linux commit 26fce0557fa639fb7bbc33e31a57cff7df25c3a0 > > Right now the only user of reset-imx7 is pci-imx6 and the > reset_control_assert and deassert calls on pciephy_reset don't toggle > the PCIEPHY_BTN and

Re: [PATCH 10/21] soc: imx: gpcv2: fix regulator deferred probe

2019-01-09 Thread Sascha Hauer
On Tue, Jan 08, 2019 at 11:11:59PM -0800, Andrey Smirnov wrote: > Port of a Linux commit 9e01e2d56db23485a75864b6aeee8e443f024ddb > > If a regulator requests a deferred probe, the power domain gets > initialized twice. This leads to a list double add (without > list debugging the kernel

[PATCH 20/21] PCI: Convert ->res_start() to return resource_size_t

2019-01-09 Thread Andrey Smirnov
On 64-bit machines int doesn't cover full address space, so convert .res_start to both accept resource_size_t as a parameter and return it as result. Signed-off-by: Andrey Smirnov --- arch/mips/mach-malta/pci.c | 3 ++- drivers/pci/pci-mvebu.c| 6 -- include/linux/pci.h| 2 +- 3

[PATCH 15/21] PCI: Drop "name" from struct pci_bus

2019-01-09 Thread Andrey Smirnov
This field is not used by Barebox. Remove it. No functional change intended. Signed-off-by: Andrey Smirnov --- include/linux/pci.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/pci.h b/include/linux/pci.h index d7a0e2babc..a519a9dc81 100644 --- a/include/linux/pci.h +++

[PATCH 16/21] PCI: Drop "ops" from struct pci_bus

2019-01-09 Thread Andrey Smirnov
Drop "ops" from struct pci_bus, since the same struct can be accessed via host->pci_ops. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 6 ++ drivers/pci/pci_iomap.c | 2 +- include/linux/pci.h | 2 -- 3 files changed, 3 insertions(+), 7

[PATCH 21/21] PCI: Consify pci_ops in struct pci_controller

2019-01-09 Thread Andrey Smirnov
Signed-off-by: Andrey Smirnov --- drivers/pci/pci-mvebu.c| 2 +- drivers/pci/pci-tegra.c| 2 +- drivers/pci/pcie-designware-host.c | 4 ++-- include/linux/pci.h| 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pci/pci-mvebu.c

[PATCH 19/21] PCI: Assume 1:1 mapping if .res_start callback is NULL

2019-01-09 Thread Andrey Smirnov
Save a bit of no-op boilerplate by converting pci_iomap() to treat absense of .res_start callback as an indicator that 1:1 mapping is being used. Signed-off-by: Andrey Smirnov --- drivers/pci/pci-tegra.c| 6 -- drivers/pci/pci_iomap.c| 6 +-

[PATCH 12/21] PCI: Make pci_scan_bus static

2019-01-09 Thread Andrey Smirnov
Pci_scan_bus is not used anyhwere outside pci.c. Mark in static to reflect that. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 4 +++- include/linux/pci.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/pci.c

[PATCH 18/21] PCI: Simplify alloc_pci_dev()

2019-01-09 Thread Andrey Smirnov
Use xzalloc() to allocate PCI device and drop OOM checking code. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 12f438d3ff..8a0d7fb03b 100644 --- a/drivers/pci/pci.c +++

[PATCH 17/21] PCI: Drop "rom_address" from struct pci_dev

2019-01-09 Thread Andrey Smirnov
This field is not being used in Barebox. Drop it. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 7 --- include/linux/pci.h | 1 - 2 files changed, 8 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c34b918453..12f438d3ff 100644 --- a/drivers/pci/pci.c +++

[PATCH 09/21] PCI: Store and reuse BAR offsets

2019-01-09 Thread Andrey Smirnov
Save and reuse BAR offsets in dedicated constants instead of repeating the same expression multiple times. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pci/pci.c

[PATCH 04/21] PCI: Convert prescan_setup_bridge() to use a loop

2019-01-09 Thread Andrey Smirnov
Simplify prescan_setup_bridge() by folding base setup code into a loop. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 37 ++--- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/pci/pci.c

[PATCH 11/21] PCI: Remove unused variables/code

2019-01-09 Thread Andrey Smirnov
Both host_head and host_tail are not used anywhere in the codebase and look like a leftover. Remove them. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index e1c059f2a9..9bfa54d054 100644 ---

[PATCH 02/21] PCI: Replace last_* variables with an array

2019-01-09 Thread Andrey Smirnov
A number of codepaths in pci.c perform almost exactly the same operations on variables with different names. In order to replace those paths with loops, replace last_mem, last_mem_perf, last_io, bus_index with a single last[] array indexed with PCI_BUS_RESOURCE_* constants. No functional change

[PATCH 07/21] PCI: Remove superfluous parens in setup_device()

2019-01-09 Thread Andrey Smirnov
Remove superfluous parens in setup_device(). No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 341af5212f..c9b6e840b2 100644 --- a/drivers/pci/pci.c

[PATCH 14/21] PCI: Drop "resources" from struct pci_bus

2019-01-09 Thread Andrey Smirnov
This field is not used by Barebox. Remove it. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 1 - include/linux/pci.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index c8521ddcd2..78c0daffcd 100644 ---

[PATCH 03/21] PCI: Consolidate limit/base settting code

2019-01-09 Thread Andrey Smirnov
Move limit/base settting code into a dedicated function order to avoid repeating address masking code. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 64 +++ 1 file changed, 48 insertions(+), 16 deletions(-) diff

[PATCH 10/21] PCI: Conver register_pci_controller() to use a loop

2019-01-09 Thread Andrey Smirnov
Conver register_pci_controller() to use a loop. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 17 +++-- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 3e249abe4f..e1c059f2a9 100644 ---

[PATCH 13/21] PCI: Drop "slots" from struct pci_bus

2019-01-09 Thread Andrey Smirnov
This field is not used by Barebox. Remove it. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 1 - include/linux/pci.h | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 23306be506..c8521ddcd2 100644 ---

[PATCH 08/21] PCI: Simplify resource setup code in setup_device()

2019-01-09 Thread Andrey Smirnov
Simplify resource setup code in setup_device() by factoring out all of the common code and moving it outside the if main if statement. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 98 +++ 1 file changed, 40

[PATCH 01/21] PCI: Switch to using %pa to print memory addresses

2019-01-09 Thread Andrey Smirnov
Switch to using %pa to print memory addresses in order to be able to support both 64 and 32 bit builds. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index

[PATCH 06/21] PCI: Replace magic number in setup_device()

2019-01-09 Thread Andrey Smirnov
User PCI_BASE_ADDRESS_SPACE_IO instead of explicit magic number. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index b5e13e5dbc..341af5212f 100644 ---

[PATCH 05/21] PCI: Convert postscan_setup_bridge() to use a loop

2019-01-09 Thread Andrey Smirnov
Simplify postscan_setup_bridge() by folding limit setting code into a loop. No functional change intended. Signed-off-by: Andrey Smirnov --- drivers/pci/pci.c | 26 +++--- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c

[PATCH 00/21] PCI improvements

2019-01-09 Thread Andrey Smirnov
Everyone: This series is a number of various small improvementes (or at least they seemed so to me) as well as a couple of small fixes for 64-bit builds. With exception of "PCI: Switch to using %pa to print memory addresses" and "Convert ->res_start() to return resource_size_t" none of the

Re: [RFC] ARM: zynq: fix "'IO_SPACE_LIMIT' redefined" warning

2019-01-09 Thread Sam Ravnborg
Hi Anthony. On Wed, Jan 09, 2019 at 11:27:54PM +0300, Antony Pavlov wrote: > The patch fixes the following compiler's warning: > > In file included from include/common.h:33:0, > from arch/arm/mach-zynq/zynq.c:18: > arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT"

[RFC] ARM: zynq: fix "'IO_SPACE_LIMIT' redefined" warning

2019-01-09 Thread Antony Pavlov
The patch fixes the following compiler's warning: In file included from include/common.h:33:0, from arch/arm/mach-zynq/zynq.c:18: arch/arm/include/asm/io.h:4:0: warning: "IO_SPACE_LIMIT" redefined #define IO_SPACE_LIMIT 0 In file included from arch/arm/mach-zynq/zynq.c:17:0:

[PATCH 0/3] drivers: fix "no previous prototype" warnings

2019-01-09 Thread Antony Pavlov
Antony Pavlov (3): w1: fix "no previous prototype for 'w1_found'" warning serial: amba-pl011: fix "no previous prototype for 'pl011_init_port'" warning net: ks8851_mll: fix "no previous prototype for 'ks_enable_qmu'" warning drivers/net/ks8851_mll.c| 2 +- drivers/serial/amba-pl011.c |

[PATCH 2/3] serial: amba-pl011: fix "no previous prototype for 'pl011_init_port'" warning

2019-01-09 Thread Antony Pavlov
The patch fixes the following compiler's warning: drivers/serial/amba-pl011.c:151:5: warning: no previous prototype for ‘pl011_init_port’ [-Wmissing-prototypes] int pl011_init_port (struct console_device *cdev) ^~~ Signed-off-by: Antony Pavlov --- drivers/serial/amba-pl011.c

[PATCH 1/3] w1: fix "no previous prototype for 'w1_found'" warning

2019-01-09 Thread Antony Pavlov
The patch fixes the following compiler's warning: drivers/w1/w1.c:459:6: warning: no previous prototype for ‘w1_found’ [-Wmissing-prototypes] void w1_found(struct w1_bus *bus, u64 rn) ^~~~ Signed-off-by: Antony Pavlov --- drivers/w1/w1.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 3/3] net: ks8851_mll: fix "no previous prototype for 'ks_enable_qmu'" warning

2019-01-09 Thread Antony Pavlov
The patch fixes the following compiler's warning: drivers/net/ks8851_mll.c:438:6: warning: no previous prototype for ‘ks_enable_qmu’ [-Wmissing-prototypes] void ks_enable_qmu(struct ks_net *ks) ^ Signed-off-by: Antony Pavlov --- drivers/net/ks8851_mll.c | 2 +- 1 file

Re: [HELP] Barebox porting

2019-01-09 Thread Sascha Hauer
Hi, On Wed, Jan 09, 2019 at 03:40:37PM +0300, Серафим Долбилов wrote: > Hi, I'm trying to add my own custom board support to barebox. It's based on > i.MX6ULL CPU. > So, I have the following questions: > > * Why does the config parameter IMX_MULTI_BOARDS exist? Why such > boards as EUKREA

[HELP] Barebox porting

2019-01-09 Thread Серафим Долбилов
Hi, I'm trying to add my own custom board support to barebox. It's based on i.MX6ULL CPU. So, I have the following questions: * Why does the config parameter IMX_MULTI_BOARDS exist? Why such boards as EUKREA CPUIMX35 and i.MX53 SMD are isolated from the others? So, if I add custom board, which

[PATCH 3/5] usbgadget: dfu: remove useless break in the switch statement

2019-01-09 Thread Ladislav Michl
Signed-off-by: Ladislav Michl --- drivers/usb/gadget/dfu.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c index d7bf92cdf..c2b3d481a 100644 --- a/drivers/usb/gadget/dfu.c +++ b/drivers/usb/gadget/dfu.c @@ -489,7 +489,6 @@ static int

[PATCH] mtd: core: Fix erase area alignment for non power of 2 erasesize

2019-01-09 Thread Ladislav Michl
Devices as AT45DB161 DataFlash uses non power of two page size (528) while present alignment algorithm relies on erasesize being power of 2. Fix that by introducing helper functions rounding to any multiply. Note that logic is sligthly changed to be consistent as ending address is moved forward to