Re: [PATCH] ARM: Do not build hyp.S for AArch64

2018-11-14 Thread Sascha Hauer
On Wed, Nov 14, 2018 at 07:00:24PM -0800, Andrey Smirnov wrote:
> This file is only meant for ARMv7 and trying to build it on ARMv8
> results in a build break.
> 
> Fixes: baa1aec03 ("ARM: allow secure monitor code to be built without PSCI")
> Signed-off-by: Andrey Smirnov 
> ---
> 
> I feel like this should really be gated by CONFIG_CPU32v7 since I
> think the code in question is ARMv7-only, but I am not
> sure. Comments/advise are wellcome.

Please rebase. Current master has

obj-pbl-$(CONFIG_CPU_32v7) += hyp.o

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] ARM: socfpga: achilles: enable watchdog1

2018-11-14 Thread Enrico Jorns
This one is required for guarding the boot procedure

Signed-off-by: Enrico Jorns 
---
 arch/arm/dts/socfpga_arria10_achilles.dts | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/socfpga_arria10_achilles.dts 
b/arch/arm/dts/socfpga_arria10_achilles.dts
index 176e06df12..e94a321999 100644
--- a/arch/arm/dts/socfpga_arria10_achilles.dts
+++ b/arch/arm/dts/socfpga_arria10_achilles.dts
@@ -242,3 +242,7 @@
reg-io-width = <4>;
status = "okay";
 };
+
+ {
+   status = "okay";
+};
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] ARM: Do not build hyp.S for AArch64

2018-11-14 Thread Andrey Smirnov
This file is only meant for ARMv7 and trying to build it on ARMv8
results in a build break.

Fixes: baa1aec03 ("ARM: allow secure monitor code to be built without PSCI")
Signed-off-by: Andrey Smirnov 
---

I feel like this should really be gated by CONFIG_CPU32v7 since I
think the code in question is ARMv7-only, but I am not
sure. Comments/advise are wellcome.

Thanks,
Andrey Smirnov

 arch/arm/cpu/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
index 45de2728d..390fa4437 100644
--- a/arch/arm/cpu/Makefile
+++ b/arch/arm/cpu/Makefile
@@ -4,7 +4,7 @@ obj-$(CONFIG_ARM_EXCEPTIONS) += exceptions$(S64).o 
interrupts$(S64).o
 obj-$(CONFIG_MMU) += mmu$(S64).o
 lwl-y += lowlevel$(S64).o
 obj-pbl-$(CONFIG_MMU) += mmu-early$(S64).o
-obj-pbl-y += hyp.o
+obj-pbl-$(if $(S64),,y) += hyp.o
 AFLAGS_hyp.o :=-Wa,-march=armv7-a -Wa,-mcpu=all
 AFLAGS_pbl-hyp.o :=-Wa,-march=armv7-a -Wa,-mcpu=all
 
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] net: macb: dma_sync_* receive buffers

2018-11-14 Thread Ladislav Michl
Receive buffers are properly synchronized only if Cadence is
GEM. Fix it for MACB as well.

Fixes: 86dc5259e25d (net: macb: no need for coherent memory for receive buffer)
Signed-off-by: Ladislav Michl 
---
 Hi Sascha,

 I'm unsure this is proper fix, but works for me (as well as
 reverting 86dc5259e25d)

 drivers/net/macb.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1c5752d10..2bd5b62a4 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -216,9 +216,11 @@ static int macb_recv(struct eth_device *edev)
dev_dbg(macb->dev, "%s\n", __func__);
 
for (;;) {
+   barrier();
if (!(macb->rx_ring[rx_tail].addr & MACB_BIT(RX_USED)))
return -1;
 
+   barrier();
status = macb->rx_ring[rx_tail].ctrl;
if (status & MACB_BIT(RX_SOF)) {
if (rx_tail != macb->rx_tail)
@@ -229,6 +231,8 @@ static int macb_recv(struct eth_device *edev)
if (status & MACB_BIT(RX_EOF)) {
buffer = macb->rx_buffer + macb->rx_buffer_size * 
macb->rx_tail;
length = MACB_BFEXT(RX_FRMLEN, status);
+   dma_sync_single_for_cpu((unsigned long)buffer, length,
+   DMA_FROM_DEVICE);
if (wrapped) {
unsigned int headlen, taillen;
 
@@ -237,12 +241,17 @@ static int macb_recv(struct eth_device *edev)
taillen = length - headlen;
memcpy((void *)NetRxPackets[0],
   buffer, headlen);
+   dma_sync_single_for_cpu((unsigned 
long)macb->rx_buffer,
+   taillen, 
DMA_FROM_DEVICE);
memcpy((void *)NetRxPackets[0] + headlen,
   macb->rx_buffer, taillen);
buffer = (void *)NetRxPackets[0];
}
 
net_receive(edev, buffer, length);
+   dma_sync_single_for_device((unsigned long)buffer, 
length,
+  DMA_FROM_DEVICE);
+   barrier();
if (++rx_tail >= macb->rx_ring_size)
rx_tail = 0;
reclaim_rx_buffers(macb, rx_tail);
@@ -252,7 +261,6 @@ static int macb_recv(struct eth_device *edev)
rx_tail = 0;
}
}
-   barrier();
}
 
return 0;
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] nand: denali: remove undefined GFP_DMA flag

2018-11-14 Thread Andrey Smirnov
On Wed, Nov 14, 2018 at 7:15 AM Enrico Jorns  wrote:
>
> This was a remnant from porting kernel code to barebox.
> While being uncritical so far, this will now cause a compiler error
> since kzalloc is not a define but a static inline function.
>
> As the kzalloc() 'mode' argument was ignored before and still will be,
> it is safe to remove the parameter.
>
> Signed-off-by: Enrico Jorns 
> ---
>  drivers/mtd/nand/nand_denali.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
> index 8b09b3722f..ef3395864c 100644
> --- a/drivers/mtd/nand/nand_denali.c
> +++ b/drivers/mtd/nand/nand_denali.c
> @@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
> }
>
> /* allocate a temporary buffer for nand_scan_ident() */
> -   denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
> +   denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
> if (!denali->buf.buf)
> return -ENOMEM;

Just as a suggestion, maybe just replace this call with xzalloc,
getting rid of meaningless GFP_KERNEL as well, and dropping the OOM
check below?

Thanks,
Andrey Smirnov

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] of: Add .of suffix to device names from devicetree

2018-11-14 Thread Andrey Smirnov
On Wed, Nov 14, 2018 at 12:52 AM Sascha Hauer  wrote:
>
> Previous implementation used to add a number to the device names
> for devices registered from the device tree which did not have a 'reg'
> property, thus a device node named "state" resulted in a device name
> "state.". Current implementation skips that number and we get a
> device named "state". This conflicts with our barebox state
> implementation which tries to register a device named "state" itself.
> We could rename the state device nodes of all our device trees, but it
> causes less trouble to rename the devices.
>

State implementation will register a device named the same as alias
pointing to corresponding node, so the problem only arises if DT has
both a state node named "foo" and an alias to it named "foo" as well.
It seems that the whole alias/standalone device creation code in
common/state/state.c was written precisely because original DT naming
scheme was not producing "fixed/stable" names, so changing then naming
scheme from matching what Linux does in order to fit some assumptions
in state code and unfortunate DT naming, while the easiest solution,
seems a bit backwards.

Can we fix this using an early internal DT fixup that would rename
problematic node and maybe even print a warning urging users to rename
their state nodes?

Thanks,
Andrey Smirnov

> This adds a ".of" suffix to the device names for devices registered from
> the device tree which also has the nice effect that they now can easily
> be recognized.
>
> Fixes: 7e497d48acbd11 ("of: Port latest of_device_make_bus_id() 
> implementation")
>
> Signed-off-by: Sascha Hauer 
> Cc: Andrey Smirnov 
> Cc: Jan Lübbe 
> ---
>  drivers/of/platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 17052f4199..ef8969ca8b 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -61,14 +61,14 @@ static void of_device_make_bus_id(struct device_d *dev)
>  */
> reg = of_get_property(node, "reg", NULL);
> if (reg && (addr = of_translate_address(node, reg)) != 
> OF_BAD_ADDR) {
> -   dev_set_name(dev, dev->name ? "%llx.%s:%s" : 
> "%llx.%s",
> +   dev_set_name(dev, dev->name ? "%llx.%s:%s" : 
> "%llx.%s.of",
>  (unsigned long long)addr, node->name,
>  dev->name);
> return;
> }
>
> /* format arguments only used if dev_name() resolves to NULL 
> */
> -   dev_set_name(dev, dev->name ? "%s:%s" : "%s",
> +   dev_set_name(dev, dev->name ? "%s:%s" : "%s.of",
>  kbasename(node->full_name), dev->name);
> node = node->parent;
> }
> --
> 2.19.1
>

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] nand: denali: remove undefined GFP_DMA flag

2018-11-14 Thread Enrico Jorns
This was a remnant from porting kernel code to barebox.
While being uncritical so far, this will now cause a compiler error
since kzalloc is not a define but a static inline function.

As the kzalloc() 'mode' argument was ignored before and still will be,
it is safe to remove the parameter.

Signed-off-by: Enrico Jorns 
---
 drivers/mtd/nand/nand_denali.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_denali.c b/drivers/mtd/nand/nand_denali.c
index 8b09b3722f..ef3395864c 100644
--- a/drivers/mtd/nand/nand_denali.c
+++ b/drivers/mtd/nand/nand_denali.c
@@ -1387,7 +1387,7 @@ int denali_init(struct denali_nand_info *denali)
}
 
/* allocate a temporary buffer for nand_scan_ident() */
-   denali->buf.buf = kzalloc(PAGE_SIZE, GFP_DMA | GFP_KERNEL);
+   denali->buf.buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
if (!denali->buf.buf)
return -ENOMEM;
 
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] arm: mach-omap: xload: Enable network interface

2018-11-14 Thread Teresa Remmet
Since f0624a701513 ("net: Do not route traffic to interfaces that are not up")
interfaces need to be "up" before used. To make enthernet boot work again
enable the interface after dhcp is set up.

Signed-off-by: Teresa Remmet 
---
 arch/arm/mach-omap/xload.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-omap/xload.c b/arch/arm/mach-omap/xload.c
index bb58825dcf9c..47aa8275b9ee 100644
--- a/arch/arm/mach-omap/xload.c
+++ b/arch/arm/mach-omap/xload.c
@@ -257,6 +257,8 @@ static void *am33xx_net_boot(void)
 
dhcp_set_result(edev, dhcp_res);
 
+   edev->ifup = true;
+
/*
 * Older tftp server don't send the file size.
 * Then tftpfs needs temporary place to store the file.
-- 
2.7.4


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: Cannot update barebox 2018.04.0 anymore

2018-11-14 Thread Sascha Hauer
Hi Mihaita,

On Wed, Nov 14, 2018 at 11:38:49AM +0100, Mihaita Ivascu wrote:
> Hello,
> 
> I have updated my barebox image on a imx6ul board and since then I
> cannot update it again.
> I think I might have left something out in the barebox config last
> time but I do not know what.
> I try to do the following:
> 
> barebox_update -y -t /mnt/disk0.0/barebox.bin
> ocotp0.permanent_write_enable=1
> mw -l -d /dev/imx-ocotp 0x14 x0093
> mw -l -d /dev/imx-ocotp 0x18 0x0010
> mw -l 0x20D8004 0x0093
> mw -l -d /dev/imx-ocotp 0x14 0x0093
> mw -l -d /dev/imx-ocotp 0x18 0x0010
> md 0x20D8004+4
> 
> and the output is:
> 
>   Image Metadata:
>   build: #1 Fri Nov 9 03:15:37 PST 2018
>   release: 2018.04.0
>   parameter: memsize=512
> imx-bbu-nand-fcb: imx_bbu_nand_update: No FCB device!

I remember there was a problem, but I can't find any commit pointing to
it at the moment. Are just just interested in coming over this
situation? If yes you can bootm the new barebox image and update from
that one.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] of: Add .of suffix to device names from devicetree

2018-11-14 Thread Jan Lübbe
On Wed, 2018-11-14 at 09:52 +0100, Sascha Hauer wrote:
> Previous implementation used to add a number to the device names
> for devices registered from the device tree which did not have a 'reg'
> property, thus a device node named "state" resulted in a device name
> "state.". Current implementation skips that number and we get a
> device named "state". This conflicts with our barebox state
> implementation which tries to register a device named "state" itself.
> We could rename the state device nodes of all our device trees, but it
> causes less trouble to rename the devices.
> 
> This adds a ".of" suffix to the device names for devices registered from
> the device tree which also has the nice effect that they now can easily
> be recognized.
> 
> Fixes: 7e497d48acbd11 ("of: Port latest of_device_make_bus_id()
> implementation")

This looks like it should the fix the problem I saw in my integration
test.

Thanks,
Jan
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] ubiformat: print messages after checking a block is not bad

2018-11-14 Thread Sascha Hauer
ubiformat prints its "flashing eraseblock x" and "formatting eraseblock
x" messages before having checked that a block is actually good. This
is misleading, so first check if a block is good and only if it is
print a message.

Signed-off-by: Sascha Hauer 
---
 common/ubiformat.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/common/ubiformat.c b/common/ubiformat.c
index 9fe1c7c501..0811525bd2 100644
--- a/common/ubiformat.c
+++ b/common/ubiformat.c
@@ -235,6 +235,9 @@ static int flash_image(struct ubiformat_args *args, struct 
mtd_info *mtd,
int err, new_len;
long long ec;
 
+   if (si->ec[eb] == EB_BAD)
+   continue;
+
if (!args->quiet && !args->verbose) {
if (is_timeout(lastprint, 300 * MSECOND) ||
eb == eb_cnt - 1) {
@@ -244,9 +247,6 @@ static int flash_image(struct ubiformat_args *args, struct 
mtd_info *mtd,
}
}
 
-   if (si->ec[eb] == EB_BAD)
-   continue;
-
if (args->verbose) {
normsg_cont("eraseblock %d: erase", eb);
}
@@ -357,6 +357,9 @@ static int format(struct ubiformat_args *args, struct 
mtd_info *mtd,
for (eb = start_eb; eb < eb_cnt; eb++) {
long long ec;
 
+   if (si->ec[eb] == EB_BAD)
+   continue;
+
if (!args->quiet && !args->verbose) {
if (is_timeout(lastprint, 300 * MSECOND) ||
eb == eb_cnt - 1) {
@@ -366,9 +369,6 @@ static int format(struct ubiformat_args *args, struct 
mtd_info *mtd,
}
}
 
-   if (si->ec[eb] == EB_BAD)
-   continue;
-
if (args->override_ec)
ec = args->ec;
else if (si->ec[eb] <= EC_MAX)
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] mtd: nand: fix nand_lock/unlock() function

2018-11-14 Thread Marc Kleine-Budde
From: White Ding 

Do nand reset before write protect check.

If we want to check the WP# low or high through STATUS READ and check bit 7,
we must reset the device, other operation (eg.erase/program a locked block) can
also clear the bit 7 of status register.

As we know the status register can be refreshed, if we do some operation to 
trigger it,
for example if we do erase/program operation to one block that is locked, then 
READ STATUS,
the bit 7 of READ STATUS will be 0 indicate the device in write protect, then 
if we do
erase/program operation to another block that is unlocked, the bit 7 of READ 
STATUS will
be 1 indicate the device is not write protect.
Suppose we checked the bit 7 of READ STATUS is 0 then judge the WP# is low 
(write protect),
but in this case the WP# maybe high if we do erase/program operation to a 
locked block,
so we must reset the device if we want to check the WP# low or high through 
STATUS READ and
check bit 7.

Signed-off-by: White Ding 
Signed-off-by: Brian Norris 
[Cherry-picked from linux: 57d3a9a89a06 mtd: nand: fix nand_lock/unlock() 
function]
Signed-off-by: Marc Kleine-Budde 
---
 drivers/mtd/nand/nand_base.c | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ccf96150429a..128802fa5c20 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -852,6 +852,15 @@ int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t 
len)
 
chip->select_chip(mtd, chipnr);
 
+   /*
+* Reset the chip.
+* If we want to check the WP through READ STATUS and check the bit 7
+* we must reset the chip
+* some operation can also clear the bit 7 of status register
+* eg. erase/program a locked block
+*/
+   chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
+
/* Check, if it is write protected */
if (nand_check_wp(mtd)) {
pr_debug("%s: device is write protected!\n",
@@ -902,6 +911,15 @@ int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t 
len)
 
chip->select_chip(mtd, chipnr);
 
+   /*
+* Reset the chip.
+* If we want to check the WP through READ STATUS and check the bit 7
+* we must reset the chip
+* some operation can also clear the bit 7 of status register
+* eg. erase/program a locked block
+*/
+   chip->cmdfunc(mtd, NAND_CMD_RESET, -1, -1);
+
/* Check, if it is write protected */
if (nand_check_wp(mtd)) {
pr_debug("%s: device is write protected!\n",
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Cannot update barebox 2018.04.0 anymore

2018-11-14 Thread Mihaita Ivascu
Hello,

I have updated my barebox image on a imx6ul board and since then I
cannot update it again.
I think I might have left something out in the barebox config last
time but I do not know what.
I try to do the following:

barebox_update -y -t /mnt/disk0.0/barebox.bin
ocotp0.permanent_write_enable=1
mw -l -d /dev/imx-ocotp 0x14 x0093
mw -l -d /dev/imx-ocotp 0x18 0x0010
mw -l 0x20D8004 0x0093
mw -l -d /dev/imx-ocotp 0x14 0x0093
mw -l -d /dev/imx-ocotp 0x18 0x0010
md 0x20D8004+4

and the output is:

  Image Metadata:
  build: #1 Fri Nov 9 03:15:37 PST 2018
  release: 2018.04.0
  parameter: memsize=512
imx-bbu-nand-fcb: imx_bbu_nand_update: No FCB device!
barebox_update: No such device
ocotp0: reloading shadow registers...
ocotp0: reloading shadow registers...
020d8004: 0093   
barebox@Phytec phyCORE-i.MX6 Ultra Lite SOM:/ ls /dev/
cs0 disk0
disk0.0 eeprom0
fullimx-ocotp
mdio0-phy01 mem
nand0   nand0.bb
nand0.nand-env  nand0.nand-env.bb
nand0.nand-factory  nand0.nand-factory.bb
nand0.nand-fit1 nand0.nand-fit1.bb
nand0.nand-fit2 nand0.nand-fit2.bb
nand0.nand-fsbl-uboot   nand0.nand-fsbl-uboot.bb
nand0.nand-makernand0.nand-maker.bb
nand0.oob   nand0.raw
netconsole-1null
prngram0
serial0-1   zero
barebox@Phytec phyCORE-i.MX6 Ultra Lite SOM:/

  What could the reason for the bolded error messages?

Thanks,
  Mihaita

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH 1/2] video: ipuv3: use closest fractional divider

2018-11-14 Thread Sascha Hauer
On Mon, Nov 12, 2018 at 05:22:56PM +0100, Lucas Stach wrote:
> Currently the divider is always rounded down, which may lead to a
> rather big overshoot of the display clock. Try to match the clock
> better by rounding to closest.
> 
> Signed-off-by: Lucas Stach 
> ---
>  drivers/video/imx-ipu-v3/ipu-di.c | 5 +
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/video/imx-ipu-v3/ipu-di.c 
> b/drivers/video/imx-ipu-v3/ipu-di.c
> index b6e64fe16a85..5751c678b28e 100644
> --- a/drivers/video/imx-ipu-v3/ipu-di.c
> +++ b/drivers/video/imx-ipu-v3/ipu-di.c
> @@ -140,10 +140,7 @@ static int ipu_di_clk_calc_div(unsigned long inrate, 
> unsigned long outrate)
>   int div;
>  
>   tmp *= 16;
> -
> - do_div(tmp, outrate);
> -
> - div = tmp;
> + div = DIV_ROUND_CLOSEST(tmp, outrate);
>  
>   if (div < 0x10)
>   div = 0x10;
> -- 
> 2.19.1
> 
> 
> ___
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] ARM: i.MX5 clock: add clock provider support

2018-11-14 Thread Sascha Hauer
On Mon, Nov 12, 2018 at 05:20:28PM +0100, Lucas Stach wrote:
> Am Freitag, den 24.08.2018, 14:38 +0200 schrieb Michael Grzeschik:
> > Currently it is impossible to get clks with clk_get(, "name");
> > on the mx5 platform. Change that by adding clk-imx5 as clk_provider.
> 
> It seems this patch has been forgotten. As Sascha didn't apply the
> patch reworking the while MX51 clock stuff to the kernel
> implementation, I think it would be good to at least pull this patch
> in.

Just did that.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 1/2] ARM: stack unwind: Print messages with pr_warning

2018-11-14 Thread Sascha Hauer
print stack traces with pr_err() rather than printf() to make sure they appear
in the logs.

Signed-off-by: Sascha Hauer 
---
 arch/arm/lib32/unwind.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/lib32/unwind.c b/arch/arm/lib32/unwind.c
index fd4b0b22cb..02fae3c253 100644
--- a/arch/arm/lib32/unwind.c
+++ b/arch/arm/lib32/unwind.c
@@ -62,9 +62,9 @@ static void dump_backtrace_entry(unsigned long where, 
unsigned long from,
 unsigned long frame)
 {
 #ifdef CONFIG_KALLSYMS
-   printk("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void *)where, 
from, (void *)from);
+   pr_warning("[<%08lx>] (%pS) from [<%08lx>] (%pS)\n", where, (void 
*)where, from, (void *)from);
 #else
-   printk("Function entered at [<%08lx>] from [<%08lx>]\n", where, from);
+   pr_warning("Function entered at [<%08lx>] from [<%08lx>]\n", where, 
from);
 #endif
 }
 
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH 2/2] driver: Print message with pr_err

2018-11-14 Thread Sascha Hauer
print "already registered" message with pr_err() rather than printf() to
make sure it also appears in the logs.

Signed-off-by: Sascha Hauer 
---
 drivers/base/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 4acc4cfa1e..1fd890542e 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -177,7 +177,7 @@ int register_device(struct device_d *new_device)
new_device->id = get_free_deviceid(new_device->name);
} else {
if (get_device_by_name_id(new_device->name, new_device->id)) {
-   eprintf("register_device: already registered %s\n",
+   pr_err("register_device: already registered %s\n",
dev_name(new_device));
return -EINVAL;
}
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


[PATCH] of: Add .of suffix to device names from devicetree

2018-11-14 Thread Sascha Hauer
Previous implementation used to add a number to the device names
for devices registered from the device tree which did not have a 'reg'
property, thus a device node named "state" resulted in a device name
"state.". Current implementation skips that number and we get a
device named "state". This conflicts with our barebox state
implementation which tries to register a device named "state" itself.
We could rename the state device nodes of all our device trees, but it
causes less trouble to rename the devices.

This adds a ".of" suffix to the device names for devices registered from
the device tree which also has the nice effect that they now can easily
be recognized.

Fixes: 7e497d48acbd11 ("of: Port latest of_device_make_bus_id() implementation")

Signed-off-by: Sascha Hauer 
Cc: Andrey Smirnov 
Cc: Jan Lübbe 
---
 drivers/of/platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 17052f4199..ef8969ca8b 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -61,14 +61,14 @@ static void of_device_make_bus_id(struct device_d *dev)
 */
reg = of_get_property(node, "reg", NULL);
if (reg && (addr = of_translate_address(node, reg)) != 
OF_BAD_ADDR) {
-   dev_set_name(dev, dev->name ? "%llx.%s:%s" : "%llx.%s",
+   dev_set_name(dev, dev->name ? "%llx.%s:%s" : 
"%llx.%s.of",
 (unsigned long long)addr, node->name,
 dev->name);
return;
}
 
/* format arguments only used if dev_name() resolves to NULL */
-   dev_set_name(dev, dev->name ? "%s:%s" : "%s",
+   dev_set_name(dev, dev->name ? "%s:%s" : "%s.of",
 kbasename(node->full_name), dev->name);
node = node->parent;
}
-- 
2.19.1


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox