Re: [U-Boot] [PATCH v2] axs10x: add support of generic ECHI USB 2.0 controller

2015-12-08 Thread Alexey Brodkin
Hi Alexey,

On Tue, 2015-12-01 at 20:23 +0100, Marek Vasut wrote:
> On Tuesday, December 01, 2015 at 08:08:10 PM, Alexey Brodkin wrote:
> > Hi Marek,
> 
> Hi!
> 
> > On Mon, 2015-11-30 at 19:06 +0100, Marek Vasut wrote:
> > > On Monday, November 30, 2015 at 06:53:25 PM, Alexey Brodkin wrote:
> > > > This commit adds support of USB 2.0 storage media on AXS10x boards.
> > > > 
> > > > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > > > Cc: Marek Vasut <ma...@denx.de>
> > > > Cc: Simon Glass <s...@chromium.org>
> > > > ---
> > > 
> > > Ad subject -- It's EHCI, not ECHI ;-)
> > 
> > Good catch!
> > 
> > > > diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
> > > > index 52d5e2f..a541d9d 100644
> > > > --- a/configs/axs101_defconfig
> > > > +++ b/configs/axs101_defconfig
> > > > @@ -8,6 +8,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
> > > > 
> > > >  CONFIG_SYS_PROMPT="AXS# "
> > > >  # CONFIG_CMD_IMLS is not set
> > > >  # CONFIG_CMD_FLASH is not set
> > > > 
> > > > +CONFIG_CMD_USB=y
> > > > 
> > > >  # CONFIG_CMD_SETEXPR is not set
> > > >  CONFIG_CMD_DHCP=y
> > > >  CONFIG_CMD_PING=y
> > > > 
> > > > @@ -19,4 +20,9 @@ CONFIG_CLK=y
> > > > 
> > > >  CONFIG_DM_ETH=y
> > > >  CONFIG_ETH_DESIGNWARE=y
> > > >  CONFIG_SYS_NS16550=y
> > > > 
> > > > +CONFIG_USB=y
> > > > +CONFIG_DM_USB=y
> > > > +CONFIG_USB_EHCI_HCD=y
> > > 
> > > You don't need EHCI_HCD in defconfig in case EHCI_GENERIC depends on it I
> > > think.
> > 
> > Yeah but remember in drivers/usb/host it's not a dependency but conditional
> > branch. That's why "savedefconfig" (but not me really) put EHCI_HCD here.
> 
> Right, got it.

Applied to U-Boot-ARC, thanks!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull ARC changes

2015-12-08 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 8356431bf8df6d47255d6a74ca9dce53d75265c7:

  Prepare v2016.01-rc2 (2015-12-07 14:23:45 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to 8555dd88cd1a7b5dd1e76c111fe635a92223b98b:

  axs10x: add support of generic EHCI USB 2.0 controller (2015-12-08 17:29:56 
+0300)


Alexey Brodkin (1):
  axs10x: add support of generic EHCI USB 2.0 controller

 arch/arc/dts/axs10x.dts  | 6 ++
 configs/axs101_defconfig | 6 ++
 configs/axs103_defconfig | 6 ++
 3 files changed, 18 insertions(+)

Regards,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v4] usb: add support for generic EHCI devices

2015-12-02 Thread Alexey Brodkin
From: Alexey Brodkin <alexey.brod...@synopsys.com>

This driver is meant to be used with any EHCI-compatible host
controller in case if there's no need for platform-specific
glue such as setup of controller or PHY's power mode via
GPIOs etc.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Cc: Stephen Warren <swar...@nvidia.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Marek Vasut <ma...@denx.de>
---

Changes compared to v3:
 * Added dependency on DM_USB
 * Changed U_BOOT_DRIVER name to unique "ehci_generic"
 * Switched "Reviewed-by" tags back to "Cc" because of quite significant
   changes compared to v1

Changes compared to v2:
 * Driver is disabled by default now
 * Use uintptr_t instead of uint32_t for "struct ehci_hcor"
   address calculation

Changes compared to v1:
 * Updated commit message with removal of Synopsys board mention
 * Cleaned-up ehci_usb_remove()

 drivers/usb/host/Kconfig|  8 +++
 drivers/usb/host/Makefile   |  1 +
 drivers/usb/host/ehci-generic.c | 50 +
 3 files changed, 59 insertions(+)
 create mode 100644 drivers/usb/host/ehci-generic.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2a2bffe..0096a2f 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -73,4 +73,12 @@ config USB_EHCI_UNIPHIER
---help---
  Enables support for the on-chip EHCI controller on UniPhier SoCs.
 
+config USB_EHCI_GENERIC
+   bool "Support for generic EHCI USB controller"
+   depends on OF_CONTROL
+   depends on DM_USB
+   default n
+   ---help---
+ Enables support for generic EHCI controller.
+
 endif
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index f70f38c..b9b4471 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ else
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 endif
 obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
+obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
 obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
new file mode 100644
index 000..1292caa
--- /dev/null
+++ b/drivers/usb/host/ehci-generic.c
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include "ehci.h"
+
+/*
+ * Even though here we don't explicitly use "struct ehci_ctrl"
+ * ehci_register() expects it to be the first thing that resides in
+ * device's private data.
+ */
+struct generic_ehci {
+   struct ehci_ctrl ctrl;
+};
+
+static int ehci_usb_probe(struct udevice *dev)
+{
+   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
+   struct ehci_hcor *hcor;
+
+   hcor = (struct ehci_hcor *)((uintptr_t)hccr +
+   HC_LENGTH(ehci_readl(>cr_capbase)));
+
+   return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
+}
+
+static int ehci_usb_remove(struct udevice *dev)
+{
+   return ehci_deregister(dev);
+}
+
+static const struct udevice_id ehci_usb_ids[] = {
+   { .compatible = "generic-ehci" },
+   { }
+};
+
+U_BOOT_DRIVER(ehci_generic) = {
+   .name   = "ehci_generic",
+   .id = UCLASS_USB,
+   .of_match = ehci_usb_ids,
+   .probe = ehci_usb_probe,
+   .remove = ehci_usb_remove,
+   .ops= _usb_ops,
+   .priv_auto_alloc_size = sizeof(struct generic_ehci),
+   .flags  = DM_FLAG_ALLOC_PRIV_DMA,
+};
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] usb: add support for generic EHCI devices

2015-12-01 Thread Alexey Brodkin
Hi Marek,

On Mon, 2015-11-30 at 19:21 +0100, Marek Vasut wrote:
> On Monday, November 30, 2015 at 07:13:30 PM, Alexey Brodkin wrote:
> > Hi Marek,

> > Please check drivers/usb/host/Kconfig.
> 
> The order there seems correct. But how is it possible that your driver
> triggered the build error on the ph1_sld8,ph1_sld3,ph1_ld4 boards ? I
> suspect because it was enabled by default, but didn't "select" the
> EHCI_HCD ?

Nope EHCI_HCD gets selected, but... ehci-generic uses CONFIG_DM_USB :)
And ehci_degister()/ehci_deregister() are only defined in EHCI_HCD
is CONFIG_DM_USB used.

So I need to add dependency on CONFIG_DM_USB for ehci_generic.

Looking for other examples of dependencies on CONFIG_DM_USB I was
surprised to see ehci-exynos, ehci-marvell, ehci-pci, ehci-sunxi and
ehci-tegra all are not yet added in Kconfig.

I.e. all those drivers are selected in headers (in include/configs/xxx.h).

> > > [...]
> > > 
> > > > +static const struct udevice_id ehci_usb_ids[] = {
> > > > +   { .compatible = "generic-ehci" },
> > > > +   { }
> > > > +};
> > > > +
> > > > +U_BOOT_DRIVER(usb_ehci) = {
> > > 
> > > The driver name should be ehci_generic, not usb_ehci, otherwise this will
> > > collide with other drivers who do the same mistake.
> > 
> > Ok but then some other drivers should be fixed as well, right?
> 
> Yes.

Ok, I'll fix it for ehci generic as well.

And v4 is about to float on mailing list :)

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] axs10x: add support of generic ECHI USB 2.0 controller

2015-12-01 Thread Alexey Brodkin
Hi Marek,

On Mon, 2015-11-30 at 19:06 +0100, Marek Vasut wrote:
> On Monday, November 30, 2015 at 06:53:25 PM, Alexey Brodkin wrote:
> > This commit adds support of USB 2.0 storage media on AXS10x boards.
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Cc: Marek Vasut <ma...@denx.de>
> > Cc: Simon Glass <s...@chromium.org>
> > ---
> 
> Ad subject -- It's EHCI, not ECHI ;-)

Good catch!

> 
> > diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
> > index 52d5e2f..a541d9d 100644
> > --- a/configs/axs101_defconfig
> > +++ b/configs/axs101_defconfig
> > @@ -8,6 +8,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
> >  CONFIG_SYS_PROMPT="AXS# "
> >  # CONFIG_CMD_IMLS is not set
> >  # CONFIG_CMD_FLASH is not set
> > +CONFIG_CMD_USB=y
> >  # CONFIG_CMD_SETEXPR is not set
> >  CONFIG_CMD_DHCP=y
> >  CONFIG_CMD_PING=y
> > @@ -19,4 +20,9 @@ CONFIG_CLK=y
> >  CONFIG_DM_ETH=y
> >  CONFIG_ETH_DESIGNWARE=y
> >  CONFIG_SYS_NS16550=y
> > +CONFIG_USB=y
> > +CONFIG_DM_USB=y
> > +CONFIG_USB_EHCI_HCD=y
> 
> You don't need EHCI_HCD in defconfig in case EHCI_GENERIC depends on it I 
> think.

Yeah but remember in drivers/usb/host it's not a dependency but conditional 
branch.
That's why "savedefconfig" (but not me really) put EHCI_HCD here.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] checkpatch.pl: Fix checkpatch.pl warnings with Perl 5.22

2015-11-30 Thread Alexey Brodkin
Hi Joe,

On Thu, 2015-09-03 at 15:46 -0500, Joe Hershberger wrote:
> Hi Moritz,
> 
> On Thu, Sep 3, 2015 at 2:25 PM, Moritz Fischer  
> wrote:
> > This patch fixes a bunch of deprecation warings that show up when using
> > checkpatch.pl with Perl 5.22.
> > 
> > Unescaped left brace in regex is deprecated, passed through in regex;
> > marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at
> > ./scripts/checkpatch.pl line 2829.
> > 
> > Unescaped left brace in regex is deprecated, passed through in regex;
> > marked by <-- HERE in m/\(.*\){ <-- HERE / at
> > ./scripts/checkpatch.pl line 3262.
> > 
> > Unescaped left brace in regex is deprecated, passed through in regex;
> > marked by <-- HERE in m/do{ <-- HERE / at
> > ./scripts/checkpatch.pl line 3263.
> > 
> > Unescaped left brace in regex is deprecated, passed through in regex;
> > marked by <-- HERE in m/^\({ <-- HERE / at
> > ./scripts/checkpatch.pl line 3636.
> > 
> > Unescaped left brace in regex is deprecated, passed through in regex;
> > marked by <-- HERE in m/(?^x:
> > 
> > Signed-off-by: Moritz Fischer 
> 
> Please submit this and have it accepted in the Linux tree. We will
> then pull it in here once it is accepted there.

Similar fix is already in Linus' master tree, see
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4e5d56bdf892e18832a6540b63ebf709966bce2a

Also note:
 [1] That commit from Linux tree won't apply cleanly on U-Boot
 due to a bit different context.
 [2] Even if manually tweaked it looks like it is incomplete:
 --->8---
 )\(.*\).*\s{ <-- HERE / at scripts/checkpatch.pl line 2828.
 --->8---

So with above in mind could you please apply that patch posted by
Moritz?

This fixes checkpatch in Fedora 23 - in current state it is way too noisy.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] axs10x: add support of generic ECHI USB 2.0 controller

2015-11-30 Thread Alexey Brodkin
This commit adds support of USB 2.0 storage media on AXS10x boards.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
---
 arch/arc/dts/axs10x.dts  | 6 ++
 configs/axs101_defconfig | 5 +
 configs/axs103_defconfig | 5 +
 3 files changed, 16 insertions(+)

diff --git a/arch/arc/dts/axs10x.dts b/arch/arc/dts/axs10x.dts
index 8fe1837..80e6d6b 100644
--- a/arch/arc/dts/axs10x.dts
+++ b/arch/arc/dts/axs10x.dts
@@ -42,4 +42,10 @@
clock-names = "stmmaceth";
max-speed = <100>;
};
+
+   ehci@0xe004 {
+   compatible = "generic-ehci";
+   reg = < 0xe004 0x100 >;
+   interrupts = < 8 >;
+   };
 };
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index 52d5e2f..b7d487b 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -8,6 +8,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -18,5 +19,9 @@ CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
 CONFIG_SYS_NS16550=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index a7f3c38..d25539e 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -7,6 +7,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -17,5 +18,9 @@ CONFIG_DM=y
 CONFIG_CLK=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_STORAGE=y
 CONFIG_SYS_NS16550=y
 CONFIG_USE_PRIVATE_LIBGCC=y
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PULL] u-boot-usb/master

2015-11-30 Thread Alexey Brodkin
Hi Tom,

On Mon, 2015-11-30 at 18:17 +0100, Marek Vasut wrote:
> On Monday, November 30, 2015 at 05:40:11 PM, Tom Rini wrote:
> > On Mon, Nov 30, 2015 at 01:33:56PM +0100, Marek Vasut wrote:
> > > T
> > +(ph1_sld8,ph1_sld3,ph1_ld4)
> > build/../drivers/usb/host/ehci-generic.c:33: undefined reference to
> > `ehci_deregister'

I'm wondering how may I reproduce this failure?

For me following (assuming ARC toolchain is in PATHs, see
http://www.denx.de/wiki/U-Boot/ARCNotes) works flawlessly:
-->8---
make axs101_defconfig && make
-->8---

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] checkpatch.pl: Fix checkpatch.pl warnings with Perl 5.22

2015-11-30 Thread Alexey Brodkin
Hi Tom,

On Mon, 2015-11-30 at 11:02 -0500, Tom Rini wrote:
> On Mon, Nov 30, 2015 at 03:57:12PM +0000, Alexey Brodkin wrote:
> > Hi Tom,
> > 
> > On Mon, 2015-11-30 at 10:56 -0500, Tom Rini wrote:
> > > On Mon, Nov 30, 2015 at 10:23:20AM +, Alexey Brodkin wrote:
> > > > Hi Joe,
> > > > 
> > > > On Thu, 2015-09-03 at 15:46 -0500, Joe Hershberger wrote:
> > > > > Hi Moritz,
> > > > > 
> > > > > On Thu, Sep 3, 2015 at 2:25 PM, Moritz Fischer 
> > > > > <moritz.fisc...@ettus.com> wrote:
> > > > > > This patch fixes a bunch of deprecation warings that show up when 
> > > > > > using
> > > > > > checkpatch.pl with Perl 5.22.
> > > > > > 
> > > > > > Unescaped left brace in regex is deprecated, passed through in 
> > > > > > regex;
> > > > > > marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at
> > > > > > ./scripts/checkpatch.pl line 2829.
> > > > > > 
> > > > > > Unescaped left brace in regex is deprecated, passed through in 
> > > > > > regex;
> > > > > > marked by <-- HERE in m/\(.*\){ <-- HERE / at
> > > > > > ./scripts/checkpatch.pl line 3262.
> > > > > > 
> > > > > > Unescaped left brace in regex is deprecated, passed through in 
> > > > > > regex;
> > > > > > marked by <-- HERE in m/do{ <-- HERE / at
> > > > > > ./scripts/checkpatch.pl line 3263.
> > > > > > 
> > > > > > Unescaped left brace in regex is deprecated, passed through in 
> > > > > > regex;
> > > > > > marked by <-- HERE in m/^\({ <-- HERE / at
> > > > > > ./scripts/checkpatch.pl line 3636.
> > > > > > 
> > > > > > Unescaped left brace in regex is deprecated, passed through in 
> > > > > > regex;
> > > > > > marked by <-- HERE in m/(?^x:
> > > > > > 
> > > > > > Signed-off-by: Moritz Fischer <moritz.fisc...@ettus.com>
> > > > > 
> > > > > Please submit this and have it accepted in the Linux tree. We will
> > > > > then pull it in here once it is accepted there.
> > > > 
> > > > Similar fix is already in Linus' master tree, see
> > > > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4e5d56bdf892e18832a6540b63ebf709966bce
> > > > 2a
> > > > 
> > > > Also note:
> > > >  [1] That commit from Linux tree won't apply cleanly on U-Boot
> > > >  due to a bit different context.
> > > >  [2] Even if manually tweaked it looks like it is incomplete:
> > > >  --->8---
> > > >  )\(.*\).*\s{ <-- HERE / at scripts/checkpatch.pl line 2828.
> > > >  --->8---
> > > > 
> > > > So with above in mind could you please apply that patch posted by
> > > > Moritz?
> > > > 
> > > > This fixes checkpatch in Fedora 23 - in current state it is way too 
> > > > noisy.
> > > 
> > > Maybe we just need to re-sync again?
> > > 
> > 
> > Do you mean to copy entire checkpatch.pl over from Linux to U-Boot?
> 
> Not quite blindly, we have an intentional change or two (I _think_ the
> change for __packed detection / warning was rejected upstream, memory is
> hazy) but by and large yes, it's just an import from the kernel anyhow.
> 

I'm fine with that but not sure if I may do it myself - at least I havent's 
tried it :)
Volunteers?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] checkpatch.pl: Fix checkpatch.pl warnings with Perl 5.22

2015-11-30 Thread Alexey Brodkin
Hi Tom,

On Mon, 2015-11-30 at 10:56 -0500, Tom Rini wrote:
> On Mon, Nov 30, 2015 at 10:23:20AM +0000, Alexey Brodkin wrote:
> > Hi Joe,
> > 
> > On Thu, 2015-09-03 at 15:46 -0500, Joe Hershberger wrote:
> > > Hi Moritz,
> > > 
> > > On Thu, Sep 3, 2015 at 2:25 PM, Moritz Fischer <moritz.fisc...@ettus.com> 
> > > wrote:
> > > > This patch fixes a bunch of deprecation warings that show up when using
> > > > checkpatch.pl with Perl 5.22.
> > > > 
> > > > Unescaped left brace in regex is deprecated, passed through in regex;
> > > > marked by <-- HERE in m/\#\s*define.*do\s{ <-- HERE / at
> > > > ./scripts/checkpatch.pl line 2829.
> > > > 
> > > > Unescaped left brace in regex is deprecated, passed through in regex;
> > > > marked by <-- HERE in m/\(.*\){ <-- HERE / at
> > > > ./scripts/checkpatch.pl line 3262.
> > > > 
> > > > Unescaped left brace in regex is deprecated, passed through in regex;
> > > > marked by <-- HERE in m/do{ <-- HERE / at
> > > > ./scripts/checkpatch.pl line 3263.
> > > > 
> > > > Unescaped left brace in regex is deprecated, passed through in regex;
> > > > marked by <-- HERE in m/^\({ <-- HERE / at
> > > > ./scripts/checkpatch.pl line 3636.
> > > > 
> > > > Unescaped left brace in regex is deprecated, passed through in regex;
> > > > marked by <-- HERE in m/(?^x:
> > > > 
> > > > Signed-off-by: Moritz Fischer <moritz.fisc...@ettus.com>
> > > 
> > > Please submit this and have it accepted in the Linux tree. We will
> > > then pull it in here once it is accepted there.
> > 
> > Similar fix is already in Linus' master tree, see
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=4e5d56bdf892e18832a6540b63ebf709966bce2a
> > 
> > Also note:
> >  [1] That commit from Linux tree won't apply cleanly on U-Boot
> >  due to a bit different context.
> >  [2] Even if manually tweaked it looks like it is incomplete:
> >  --->8---
> >  )\(.*\).*\s{ <-- HERE / at scripts/checkpatch.pl line 2828.
> >  --->8---
> > 
> > So with above in mind could you please apply that patch posted by
> > Moritz?
> > 
> > This fixes checkpatch in Fedora 23 - in current state it is way too noisy.
> 
> Maybe we just need to re-sync again?
> 

Do you mean to copy entire checkpatch.pl over from Linux to U-Boot?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] usb: add support for generic EHCI devices

2015-11-30 Thread Alexey Brodkin
From: Alexey Brodkin <alexey.brod...@synopsys.com>

This driver is meant to be used with any EHCI-compatible host
controller in case if there's no need for platform-specific
glue such as setup of controller or PHY's power mode via
GPIOs etc.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Reviewed-by: Marek Vasut <ma...@denx.de>
Cc: Stephen Warren <swar...@nvidia.com>
---

Changes compared to v2:
 * Driver is disabled by default now
 * Use uintptr_t instead of uint32_t for "struct ehci_hcor"
   address calculation

Changes compared to v1:
 * Updated commit message with removal of Synopsys board mention
 * Cleaned-up ehci_usb_remove()

 drivers/usb/host/Kconfig|  7 ++
 drivers/usb/host/Makefile   |  1 +
 drivers/usb/host/ehci-generic.c | 51 +
 3 files changed, 59 insertions(+)
 create mode 100644 drivers/usb/host/ehci-generic.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2a2bffe..6bb9caa 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
---help---
  Enables support for the on-chip EHCI controller on UniPhier SoCs.
 
+config USB_EHCI_GENERIC
+   bool "Support for generic EHCI USB controller"
+   depends on OF_CONTROL
+   default n
+   ---help---
+ Enables support for generic EHCI controller.
+
 endif
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index f70f38c..b9b4471 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ else
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 endif
 obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
+obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
 obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
new file mode 100644
index 000..22e1ad0
--- /dev/null
+++ b/drivers/usb/host/ehci-generic.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include "ehci.h"
+
+/*
+ * Even though here we don't explicitly use "struct ehci_ctrl"
+ * ehci_register() expects it to be the first thing that resides in
+ * device's private data.
+ */
+struct generic_ehci {
+   struct ehci_ctrl ctrl;
+};
+
+static int ehci_usb_probe(struct udevice *dev)
+{
+   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
+   struct ehci_hcor *hcor;
+
+   hcor = (struct ehci_hcor *)((uintptr_t)hccr +
+   HC_LENGTH(ehci_readl(>cr_capbase)));
+
+   return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
+}
+
+static int ehci_usb_remove(struct udevice *dev)
+{
+   return ehci_deregister(dev);
+}
+
+static const struct udevice_id ehci_usb_ids[] = {
+   { .compatible = "generic-ehci" },
+   { }
+};
+
+U_BOOT_DRIVER(usb_ehci) = {
+   .name   = "ehci_generic",
+   .id = UCLASS_USB,
+   .of_match = ehci_usb_ids,
+   .probe = ehci_usb_probe,
+   .remove = ehci_usb_remove,
+   .ops= _usb_ops,
+   .priv_auto_alloc_size = sizeof(struct generic_ehci),
+   .flags  = DM_FLAG_ALLOC_PRIV_DMA,
+};
+
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] usb: add support for generic EHCI devices

2015-11-30 Thread Alexey Brodkin
Hi Marek,

On Mon, 2015-11-30 at 19:05 +0100, Marek Vasut wrote:
> On Monday, November 30, 2015 at 06:47:45 PM, Alexey Brodkin wrote:
> > From: Alexey Brodkin <alexey.brod...@synopsys.com>

> > +config USB_EHCI_GENERIC
> > +   bool "Support for generic EHCI USB controller"
> > +   depends on OF_CONTROL
> > +   default n
> > +   ---help---
> > + Enables support for generic EHCI controller.
> 
> This should depend on EHCI_HCD somehow, no (since it's using ehci_deregister 
> and 
> friends) ?

This symbol is in "if USB_EHCI_HCD" so if USB_EHCI_HCD is not enabled
EHCI_GENERIC won't be visible and hence USB_EHCI_HCD in defconfig.

Otherwise we'll need to add USB_EHCI_HCD dependency for other EHCI drivers
such as USB_EHCI_MARVELL, USB_EHCI_MX6 and USB_EHCI_UNIPHIER.
Do we want to do it? :)

Please check drivers/usb/host/Kconfig.

> [...]
> 
> > +static const struct udevice_id ehci_usb_ids[] = {
> > +   { .compatible = "generic-ehci" },
> > +   { }
> > +};
> > +
> > +U_BOOT_DRIVER(usb_ehci) = {
> 
> The driver name should be ehci_generic, not usb_ehci, otherwise this will 
> collide with other drivers who do the same mistake.

Ok but then some other drivers should be fixed as well, right?
See:
--->8
git grep U_BOOT_DRIVER drivers/usb/host/
drivers/usb/host/dwc2.c:U_BOOT_DRIVER(usb_dwc2) = {
drivers/usb/host/ehci-exynos.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-generic.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-marvell.c:U_BOOT_DRIVER(ehci_mvebu) = {
drivers/usb/host/ehci-pci.c:U_BOOT_DRIVER(ehci_pci) = {
drivers/usb/host/ehci-sunxi.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-tegra.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ohci-sunxi.c:U_BOOT_DRIVER(usb_ohci) = {
drivers/usb/host/usb-sandbox.c:U_BOOT_DRIVER(usb_sandbox) = {
drivers/usb/host/usb-uclass.c:U_BOOT_DRIVER(usb_dev_generic_drv) = {
drivers/usb/host/xhci-exynos5.c:U_BOOT_DRIVER(usb_xhci) = {
--->8

I believe it all works because we don't enable 2 drivers at a time
[usually] :)

And in that light I don't see a point in having different names here.
Or you think there's a chance to have more than one USB controller enabled
simultaneously [and if it is possible at all with current implementation]?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PULL] u-boot-usb/master

2015-11-30 Thread Alexey Brodkin
Hi Tom, Marek,

On Mon, 2015-11-30 at 12:26 -0500, Tom Rini wrote:
> On Mon, Nov 30, 2015 at 05:23:15PM +0000, Alexey Brodkin wrote:
> > Hi Tom,
> > 
> > On Mon, 2015-11-30 at 18:17 +0100, Marek Vasut wrote:
> > > On Monday, November 30, 2015 at 05:40:11 PM, Tom Rini wrote:
> > > > On Mon, Nov 30, 2015 at 01:33:56PM +0100, Marek Vasut wrote:
> > > > > T
> > > > +(ph1_sld8,ph1_sld3,ph1_ld4)
> > > > build/../drivers/usb/host/ehci-generic.c:33: undefined reference to
> > > > `ehci_deregister'
> > 
> > I'm wondering how may I reproduce this failure?
> > 
> > For me following (assuming ARC toolchain is in PATHs, see
> > http://www.denx.de/wiki/U-Boot/ARCNotes) works flawlessly:
> > -->8---
> > make axs101_defconfig && make
> > -->8---
> 
> Build for ph1_sld8 or one of the other listed ARM boards :)

Obvious SNAFU - new driver enabled by default.
All other EHCI drivers are also enabled by default but limited by
either architecture or platforms.

v3 is on its way - I'm really sorry for that :(

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] usb: add support for generic EHCI devices

2015-11-30 Thread Alexey Brodkin
Hi Marek,

On Mon, 2015-11-30 at 20:47 +0300, Alexey Brodkin wrote:
> From: Alexey Brodkin <alexey.brod...@synopsys.com>
> 
> This driver is meant to be used with any EHCI-compatible host
> controller in case if there's no need for platform-specific
> glue such as setup of controller or PHY's power mode via
> GPIOs etc.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Reviewed-by: Marek Vasut <ma...@denx.de>
> Cc: Stephen Warren <swar...@nvidia.com>
> ---
> 
> Changes compared to v2:
>  * Driver is disabled by default now
>  * Use uintptr_t instead of uint32_t for "struct ehci_hcor"
>address calculation
> 
> Changes compared to v1:
>  * Updated commit message with removal of Synopsys board mention
>  * Cleaned-up ehci_usb_remove()

git doesn't Cc people from "Reviewed-by" tags, so adding you
and Simon here. Sorry for that noise.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] axs10x: add support of generic ECHI USB 2.0 controller

2015-11-30 Thread Alexey Brodkin
This commit adds support of USB 2.0 storage media on AXS10x boards.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Cc: Marek Vasut <ma...@denx.de>
Cc: Simon Glass <s...@chromium.org>
---

Changes compared to v1:
 * Explicitly enable CONFIG_USB_EHCI_GENERIC

 arch/arc/dts/axs10x.dts  | 6 ++
 configs/axs101_defconfig | 6 ++
 configs/axs103_defconfig | 6 ++
 3 files changed, 18 insertions(+)

diff --git a/arch/arc/dts/axs10x.dts b/arch/arc/dts/axs10x.dts
index 8fe1837..80e6d6b 100644
--- a/arch/arc/dts/axs10x.dts
+++ b/arch/arc/dts/axs10x.dts
@@ -42,4 +42,10 @@
clock-names = "stmmaceth";
max-speed = <100>;
};
+
+   ehci@0xe004 {
+   compatible = "generic-ehci";
+   reg = < 0xe004 0x100 >;
+   interrupts = < 8 >;
+   };
 };
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index 52d5e2f..a541d9d 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -8,6 +8,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -19,4 +20,9 @@ CONFIG_CLK=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SYS_NS16550=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index a7f3c38..3c65c83 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -7,6 +7,7 @@ CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
+CONFIG_CMD_USB=y
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_CMD_DHCP=y
 CONFIG_CMD_PING=y
@@ -18,4 +19,9 @@ CONFIG_CLK=y
 CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_SYS_NS16550=y
+CONFIG_USB=y
+CONFIG_DM_USB=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_STORAGE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] usb: add support for generic EHCI devices

2015-11-30 Thread Alexey Brodkin
Hi Marek,

On Fri, 2015-11-20 at 21:48 +0100, Marek Vasut wrote:
> On Wednesday, November 18, 2015 at 04:26:21 PM, Alexey Brodkin wrote:
> > This driver is meant to be used with any EHCI-compatible host
> > controller in case if there's no need for platform-specific
> > glue such as setup of controller or PHY's power mode via
> > GPIOs etc.
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Reviewed-by: Simon Glass <s...@chromium.org>
> > Reviewed-by: Marek Vasut <ma...@denx.de>
> > Cc: Stephen Warren <swar...@nvidia.com>
> > ---
> > 
> > Changes compared to v1:
> >  * Updated commit message with removal of Synopsys board mention
> >  * Cleaned-up ehci_usb_remove()
> 
> [...]
> 
> > +static int ehci_usb_probe(struct udevice *dev)
> > +{
> > +   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
> > +   struct ehci_hcor *hcor;
> > +
> > +   hcor = (struct ehci_hcor *)((uint32_t)hccr +
> 
> This should be uintptr_t for the sake of 64bit systems, no ?
> 
> > +   HC_LENGTH(ehci_readl(>cr_capbase)));
> > +
> > +   return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
> > +}
> 
> I can fix that nit when applying, so let me know what you think please.

Could you please do that fix and apply the patch?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common: board_f: Dont relocate FDT incase of CONFIG_OF_EMBED

2015-11-26 Thread Alexey Brodkin
Hi Michal,

On Thu, 2015-11-26 at 10:54 +0100, Michal Simek wrote:
> From: Siva Durga Prasad Paladugu <siva.durga.palad...@xilinx.com>
> 
> Done relocate fdt incase of CONFIG_OF EMBED as the fdt is

Probably it was meant to be something like:
--->8---
__Don't__ relocate fdt in__case of CONFIG_OF EMBED as the fdt is
--->8---

Otherwise,
Reviewed-by: Alexey Brodkin <abrod...@synopsys.com>

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] usb: add support for generic EHCI devices

2015-11-20 Thread Alexey Brodkin
Hi Marek,

On Fri, 2015-11-20 at 21:48 +0100, Marek Vasut wrote:
> On Wednesday, November 18, 2015 at 04:26:21 PM, Alexey Brodkin wrote:
> > This driver is meant to be used with any EHCI-compatible host
> > controller in case if there's no need for platform-specific
> > glue such as setup of controller or PHY's power mode via
> > GPIOs etc.
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Reviewed-by: Simon Glass <s...@chromium.org>
> > Reviewed-by: Marek Vasut <ma...@denx.de>
> > Cc: Stephen Warren <swar...@nvidia.com>
> > ---
> > 
> > Changes compared to v1:
> >  * Updated commit message with removal of Synopsys board mention
> >  * Cleaned-up ehci_usb_remove()
> 
> [...]
> 
> > +static int ehci_usb_probe(struct udevice *dev)
> > +{
> > +   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
> > +   struct ehci_hcor *hcor;
> > +
> > +   hcor = (struct ehci_hcor *)((uint32_t)hccr +
> 
> This should be uintptr_t for the sake of 64bit systems, no ?

Hm, that's a good point!
Indeed I was only thinking about 32-bit systems that I work with.
So please do that change.

What's interesting most of other USB drivers do use "uint32_t" so
there's a room for improvement it seems :)

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] usb: add support for generic EHCI devices

2015-11-20 Thread Alexey Brodkin
Hi Simon, Marek,

On Wed, 2015-11-18 at 18:26 +0300, Alexey Brodkin wrote:
> This driver is meant to be used with any EHCI-compatible host
> controller in case if there's no need for platform-specific
> glue such as setup of controller or PHY's power mode via
> GPIOs etc.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> Reviewed-by: Simon Glass <s...@chromium.org>
> Reviewed-by: Marek Vasut <ma...@denx.de>
> Cc: Stephen Warren <swar...@nvidia.com>
> ---
> 
> Changes compared to v1:
>  * Updated commit message with removal of Synopsys board mention
>  * Cleaned-up ehci_usb_remove()
> 
>  drivers/usb/host/Kconfig|  7 ++
>  drivers/usb/host/Makefile   |  1 +
>  drivers/usb/host/ehci-generic.c | 51 
> +
>  3 files changed, 59 insertions(+)
>  create mode 100644 drivers/usb/host/ehci-generic.c
> 
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 2a2bffe..a500578 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
>   ---help---
> Enables support for the on-chip EHCI controller on UniPhier SoCs.
>  
> +config USB_EHCI_GENERIC
> + bool "Support for generic EHCI USB controller"
> + depends on OF_CONTROL
> + default y
> + ---help---
> +   Enables support for generic EHCI controller.
> +
>  endif
> diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> index f70f38c..b9b4471 100644
> --- a/drivers/usb/host/Makefile
> +++ b/drivers/usb/host/Makefile
> @@ -32,6 +32,7 @@ else
>  obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
>  endif
>  obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
> +obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
>  obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
>  obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
>  obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
> diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
> new file mode 100644
> index 000..f0e2b85
> --- /dev/null
> +++ b/drivers/usb/host/ehci-generic.c
> @@ -0,0 +1,51 @@
> +/*
> + * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#include 
> +#include 
> +#include "ehci.h"
> +
> +/*
> + * Even though here we don't explicitly use "struct ehci_ctrl"
> + * ehci_register() expects it to be the first thing that resides in
> + * device's private data.
> + */
> +struct generic_ehci {
> + struct ehci_ctrl ctrl;
> +};
> +
> +static int ehci_usb_probe(struct udevice *dev)
> +{
> + struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
> + struct ehci_hcor *hcor;
> +
> + hcor = (struct ehci_hcor *)((uint32_t)hccr +
> + HC_LENGTH(ehci_readl(>cr_capbase)));
> +
> + return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
> +}
> +
> +static int ehci_usb_remove(struct udevice *dev)
> +{
> + return ehci_deregister(dev);
> +}
> +
> +static const struct udevice_id ehci_usb_ids[] = {
> + { .compatible = "generic-ehci" },
> + { }
> +};
> +
> +U_BOOT_DRIVER(usb_ehci) = {
> + .name   = "ehci_generic",
> + .id = UCLASS_USB,
> + .of_match = ehci_usb_ids,
> + .probe = ehci_usb_probe,
> + .remove = ehci_usb_remove,
> + .ops= _usb_ops,
> + .priv_auto_alloc_size = sizeof(struct generic_ehci),
> + .flags  = DM_FLAG_ALLOC_PRIV_DMA,
> +};
> +

Any comments on that one or there's a chance it could be applied?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] usb: add support for generic EHCI devices

2015-11-18 Thread Alexey Brodkin
This driver is meant to be used with any EHCI-compatible host
controller in case if there's no need for platform-specific
glue such as setup of controller or PHY's power mode via
GPIOs etc.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Reviewed-by: Simon Glass <s...@chromium.org>
Reviewed-by: Marek Vasut <ma...@denx.de>
Cc: Stephen Warren <swar...@nvidia.com>
---

Changes compared to v1:
 * Updated commit message with removal of Synopsys board mention
 * Cleaned-up ehci_usb_remove()

 drivers/usb/host/Kconfig|  7 ++
 drivers/usb/host/Makefile   |  1 +
 drivers/usb/host/ehci-generic.c | 51 +
 3 files changed, 59 insertions(+)
 create mode 100644 drivers/usb/host/ehci-generic.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2a2bffe..a500578 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
---help---
  Enables support for the on-chip EHCI controller on UniPhier SoCs.
 
+config USB_EHCI_GENERIC
+   bool "Support for generic EHCI USB controller"
+   depends on OF_CONTROL
+   default y
+   ---help---
+ Enables support for generic EHCI controller.
+
 endif
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index f70f38c..b9b4471 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ else
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 endif
 obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
+obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
 obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
new file mode 100644
index 000..f0e2b85
--- /dev/null
+++ b/drivers/usb/host/ehci-generic.c
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include "ehci.h"
+
+/*
+ * Even though here we don't explicitly use "struct ehci_ctrl"
+ * ehci_register() expects it to be the first thing that resides in
+ * device's private data.
+ */
+struct generic_ehci {
+   struct ehci_ctrl ctrl;
+};
+
+static int ehci_usb_probe(struct udevice *dev)
+{
+   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
+   struct ehci_hcor *hcor;
+
+   hcor = (struct ehci_hcor *)((uint32_t)hccr +
+   HC_LENGTH(ehci_readl(>cr_capbase)));
+
+   return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
+}
+
+static int ehci_usb_remove(struct udevice *dev)
+{
+   return ehci_deregister(dev);
+}
+
+static const struct udevice_id ehci_usb_ids[] = {
+   { .compatible = "generic-ehci" },
+   { }
+};
+
+U_BOOT_DRIVER(usb_ehci) = {
+   .name   = "ehci_generic",
+   .id = UCLASS_USB,
+   .of_match = ehci_usb_ids,
+   .probe = ehci_usb_probe,
+   .remove = ehci_usb_remove,
+   .ops= _usb_ops,
+   .priv_auto_alloc_size = sizeof(struct generic_ehci),
+   .flags  = DM_FLAG_ALLOC_PRIV_DMA,
+};
+
-- 
2.5.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-17 Thread Alexey Brodkin
Hi,

On Mon, 2015-11-16 at 16:15 -0700, Stephen Warren wrote:
> On 11/16/2015 03:15 PM, Alexey Brodkin wrote:
> > Hi Stephen,
> > 
> > On Mon, 2015-11-16 at 14:08 -0700, Simon Glass wrote:
> > > Hi,
> > > 
> > > On 16 November 2015 at 06:47, Alexey Brodkin
> > > <alexey.brod...@synopsys.com> wrote:

> > > > Hi Simon, Stephen,
> > > > 
> > > > On Fri, 2015-11-13 at 19:03 -0700, Simon Glass wrote:
> > > > > On 13 November 2015 at 11:23, Alexey Brodkin
> > > > > <alexey.brod...@synopsys.com> wrote:
> > > > > > Hi Simon,
> > > > > > 
> > > > > > On Fri, 2015-11-13 at 11:14 -0700, Simon Glass wrote:
> > > > > > > Hi Alexey,
> > > > > > > 
> > > > > > > On 12 November 2015 at 14:56, Alexey Brodkin
> > > > > > > <alexey.brod...@synopsys.com> wrote:
> > > > 
> > > > [snip]
> Yes, that seems fine; my suggestion was more for post-patch cleanup.

Applied, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board: axs10x switch serial port and Ethernet to driver model

2015-11-17 Thread Alexey Brodkin
Hi,

On Fri, 2015-11-13 at 19:04 -0700, Simon Glass wrote:
> On 13 November 2015 at 11:26, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > With this change Synopsys DesignWare SDP board is switched to driver
> > model for both serial port (serial_dw) and Ethernet (Designware GMAC).
> > 
> > This simplifies include/configs/axs101.h and allows for reuse of Linux's
> > Device Tree description.
> > 
> > For simplicity Linux's .dts files are not blindly copied but only very
> > few extracts of them are really used (those that are supported in U-Boot
> > at the moment).
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Cc: Masahiro Yamada <yamada.masah...@socionext.com>
> > Cc: Simon Glass <s...@chromium.org>
> > ---
> >  arch/arc/dts/Makefile  |  1 +
> >  arch/arc/dts/axs10x.dts| 45 
> > ++
> >  board/synopsys/axs101/axs101.c | 12 ---
> >  configs/axs101_defconfig   | 11 ++-
> >  configs/axs103_defconfig   | 11 ++-
> >  include/configs/axs101.h   | 31 ++---
> >  6 files changed, 72 insertions(+), 39 deletions(-)
> >  create mode 100644 arch/arc/dts/axs10x.dts
> 
> Reviewed-by: Simon Glass <s...@chromium.org>

Applied, thanks!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add empty asm/processor.h to satisfy compilation of USB code

2015-11-17 Thread Alexey Brodkin
Hi,

On Fri, 2015-11-13 at 00:57 +0300, Alexey Brodkin wrote:
> common/usb.c unconditionally includes 
> And now to allow USB support on ARC boards we have to have that header.
> 
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> ---
>  arch/arc/include/asm/processor.h | 12 
>  1 file changed, 12 insertions(+)
>  create mode 100644 arch/arc/include/asm/processor.h
> 
> diff --git a/arch/arc/include/asm/processor.h 
> b/arch/arc/include/asm/processor.h
> new file mode 100644
> index 000..6355423
> --- /dev/null
> +++ b/arch/arc/include/asm/processor.h
> @@ -0,0 +1,12 @@
> +/*
> + * Copyright (C) 2015 Synopsys, Inc. All rights reserved.
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef _ASM_ARC_PROCESSOR_H
> +#define _ASM_ARC_PROCESSOR_H
> +
> +/* This file is required by some generic code like USB etc */
> +
> +#endif /* _ASM_ARC_PROCESSOR_H */

Applied, thanks!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull ARC changes

2015-11-17 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 3d4825446e4258192e1f2302d691a8c0c82a0975:

  Prepare v2016.01-rc1 (2015-11-16 20:29:51 -0500)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to fb2dea60e8f355ae00d427db09112a90839c96ec:

  board: axs10x switch serial port and Ethernet to driver model (2015-11-18 
00:39:22 +0300)


Alexey Brodkin (3):
  arc: add stubs for map_physmem() and unmap_physmem()
  arc: add empty asm/processor.h to satisfy compilation of USB code
  board: axs10x switch serial port and Ethernet to driver model

 arch/arc/dts/Makefile|  1 +
 arch/arc/dts/axs10x.dts  | 45 
+
 arch/arc/include/asm/io.h| 24 
 arch/arc/include/asm/processor.h | 12 
 board/synopsys/axs101/axs101.c   | 12 
 configs/axs101_defconfig | 11 ++-
 configs/axs103_defconfig | 11 ++-
 include/configs/axs101.h | 31 ++-
 8 files changed, 108 insertions(+), 39 deletions(-)
 create mode 100644 arch/arc/dts/axs10x.dts
 create mode 100644 arch/arc/include/asm/processor.h

Regards,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] Fix board init code to use a valid C runtime environment

2015-11-16 Thread Alexey Brodkin
Hi Albert,

On Mon, 2015-11-16 at 14:34 +0100, Albert ARIBAUD wrote:
> Hello Alexey,
> 
> On Mon, 16 Nov 2015 13:12:15 +0000, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Hi Albert,

> > >  
> > > - /* Allocate and zero GD, update SP */
> > > - mov %r0, %sp
> > > - bl  board_init_f_mem
> > > -
> > > + /* Get reserved area size, update SP and FP */
> > > + bl  board_init_f_get_reserve_size
> > >   /* Update stack- and frame-pointers */
> > 
> > I think we don't need to mention SP/FP update in comments twice here.
> > I.e. either strip ", update SP and FP" from your introduced comment or
> > which I really like more remove following line with comment entirely:
> > -->8--
> > /* Update stack- and frame-pointers */
> > -->8--
> 
> Not sure where you see two SP+FP 'update' comments here; probably
> you're referring to the 'setup' comment on line 53 and the 'update'
> one on line 59. If that is what you meant, I tink these comments are
> different and deserve staying both...

Ok, that's what I have after your patch application:

-->8--
/* Setup stack- and frame-pointers */
mov %sp, CONFIG_SYS_INIT_SP_ADDR
mov %fp, %sp

/* Get reserved area size, update SP and FP */
bl  board_init_f_get_reserve_size
/* Update stack- and frame-pointers */  <-- that's already mentioned 2 
lines above
sub %sp, %sp, %r0
mov %fp, %sp
-->8--


> ... However, these comments also pretty much just paraphrase the code
> which follows them and thus serve little purpose; they could be
> reworded to show less of what is being done and more of why it is being
> done:
> 
> - the "Update stack- and frame-pointer" comment could be turned into
>   "Allocate reserved size on stack and adjust frame pointer
>   accordingly", and
> 
> - the "Setup stack- and frame-pointers" comment could be turned into
>   "Establish C runtime stack and frame".
> 
> Opinions?

Totally agree, care to implement it?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] Fix board init code to use a valid C runtime environment

2015-11-16 Thread Alexey Brodkin
Hi Albert,

On Mon, 2015-11-16 at 15:15 +0100, Albert ARIBAUD wrote:
> Hello Alexey,
> 
> On Mon, 16 Nov 2015 13:43:19 +0000, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Hi Albert,
> > 
> > On Mon, 2015-11-16 at 14:34 +0100, Albert ARIBAUD wrote:
> > > Hello Alexey,
> > > 
> > > On Mon, 16 Nov 2015 13:12:15 +, Alexey Brodkin
> > > <alexey.brod...@synopsys.com> wrote:
> > > > Hi Albert,
> > 
> > > > >  
> > > > > - /* Allocate and zero GD, update SP */
> > > > > - mov %r0, %sp
> > > > > - bl  board_init_f_mem
> > > > > -
> > > > > + /* Get reserved area size, update SP and FP */
> > > > > + bl  board_init_f_get_reserve_size
> > > > >   /* Update stack- and frame-pointers */
> > > > 
> > > > I think we don't need to mention SP/FP update in comments twice here.
> > > > I.e. either strip ", update SP and FP" from your introduced comment or
> > > > which I really like more remove following line with comment entirely:
> > > > -->8--
> > > > /* Update stack- and frame-pointers */
> > > > -->8--
> > > 
> > > Not sure where you see two SP+FP 'update' comments here; probably
> > > you're referring to the 'setup' comment on line 53 and the 'update'
> > > one on line 59. If that is what you meant, I tink these comments are
> > > different and deserve staying both...
> > 
> > Ok, that's what I have after your patch application:
> > 
> > -->8--
> > /* Setup stack- and frame-pointers */
> > mov %sp, CONFIG_SYS_INIT_SP_ADDR
> > mov %fp, %sp
> > 
> > /* Get reserved area size, update SP and FP */
> > bl  board_init_f_get_reserve_size
> > /* Update stack- and frame-pointers */  <-- that's already mentioned 2 
> > lines above
> > sub %sp, %sp, %r0
> > mov %fp, %sp
> > -->8--
> 
> My bad, I'd missed that one. I'll turn
> 
>   /* Get reserved area size, update SP and FP */
> 
> Into
> 
>   /* Get reserved area size */
> 
> > > ... However, these comments also pretty much just paraphrase the code
> > > which follows them and thus serve little purpose; they could be
> > > reworded to show less of what is being done and more of why it is being
> > > done:
> > > 
> > > - the "Update stack- and frame-pointer" comment could be turned into
> > >   "Allocate reserved size on stack and adjust frame pointer
> > >   accordingly", and
> > > 
> > > - the "Setup stack- and frame-pointers" comment could be turned into
> > >   "Establish C runtime stack and frame".
> > > 
> > > Opinions?
> > 
> > Totally agree, care to implement it?
> 
> That, and the removal of the repetition. v5 in approach.
> 
> > -Alexey
> 
> Amicalement,

Thanks for doing that!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4] Fix board init code to use a valid C runtime environment

2015-11-16 Thread Alexey Brodkin
Hi Albert,

On Sun, 2015-11-15 at 19:25 +0100, Albert ARIBAUD wrote:
> board_init_f_mem() alters the C runtime environment's
> stack it ls actually already using. This is not a valid
> C runtime environment.
> 
> Split board_init_f_mem into C functions which do not
> alter their own stack and therefore run in a valid C
> runtime environment.
> 
> Signed-off-by: Albert ARIBAUD <albert.u.b...@aribaud.net>
> ---
> Cc:ing custodians for all architectures which this
> patch affects.
> 
> This patch has been build-tested for all there
> architectures, and run-tested on ARM OpenRD Client.
> 
> For NIOS2, this patch contains all manual v1 and v2
> fixes by Thomas.
> 
> For x86, this patch contains all manual v2 fixes by Bin.
> 
> Changes in v4:
> - Add comments on reserving GD at the lowest location
> - Add comments on post-incrementing base for each "chunk"
> 
> Changes in v3:
> - Rebase after commit 9ac4fc82
> - Simplify malloc conditional as per commit 9ac4fc82
> - Fix NIOS2 return value register (r2, not r4)
> - Fix x86 subl argument inversion
> - Group allocations in a single function
> - Group initializations in a single function
> 
> Changes in v2:
> - Fix all checkpatch issues
> - Fix board_init_f_malloc prototype mismatch
> - Fix board_init_[f_]xxx typo in NIOS2
> - Fix aarch64 asm 'sub' syntax error
> 
>  arch/arc/lib/start.S|  12 +++--
>  arch/arm/lib/crt0.S |   6 ++-
>  arch/arm/lib/crt0_64.S  |   6 ++-
>  arch/microblaze/cpu/start.S |   4 +-
>  arch/nios2/cpu/start.S  |  13 +++--
>  arch/powerpc/cpu/ppc4xx/start.S |  10 ++--
>  arch/x86/cpu/start.S|   5 +-
>  arch/x86/lib/fsp/fsp_common.c   |   4 +-
>  common/init/board_init.c| 108 
> +++-
>  include/common.h|  33 +---
>  10 files changed, 144 insertions(+), 57 deletions(-)
> 
> diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S
> index 26a5934..2a99193 100644
> --- a/arch/arc/lib/start.S
> +++ b/arch/arc/lib/start.S
> @@ -54,14 +54,16 @@ ENTRY(_start)
>   mov %sp, CONFIG_SYS_INIT_SP_ADDR
>   mov %fp, %sp
>  
> - /* Allocate and zero GD, update SP */
> - mov %r0, %sp
> - bl  board_init_f_mem
> -
> + /* Get reserved area size, update SP and FP */
> + bl  board_init_f_get_reserve_size
>   /* Update stack- and frame-pointers */

I think we don't need to mention SP/FP update in comments twice here.
I.e. either strip ", update SP and FP" from your introduced comment or
which I really like more remove following line with comment entirely:
-->8--
/* Update stack- and frame-pointers */
-->8--

Not sure if this tiny nitpick worth respinning thought.

Otherwise build and run tested on free nSIM,
see "Running U-Boot on ARC in Free nSIM" section in
http://www.denx.de/wiki/U-Boot/ARCNotes if of any interest how to do it
yourself.

Feel free to add
-->8--
Acked-by: Alexey Brodkin <abrod...@synopsys.com>
-->8--

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-16 Thread Alexey Brodkin
Hi Simon, Stephen,

On Fri, 2015-11-13 at 19:03 -0700, Simon Glass wrote:
> On 13 November 2015 at 11:23, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Hi Simon,
> > 
> > On Fri, 2015-11-13 at 11:14 -0700, Simon Glass wrote:
> > > Hi Alexey,
> > > 
> > > On 12 November 2015 at 14:56, Alexey Brodkin
> > > <alexey.brod...@synopsys.com> wrote:

[snip]

> > > > Up until now there was no need in those stubs.
> > > > 
> > > > But since following commit compilation of U-Boot on ARC is broken:
> > > > >8--
> > > > commit 7861204c9af7fec1ea9b41541c272516235a6c93
> > > > Author: Stephen Warren <swar...@wwwdotorg.org>
> > > > Date:   Sat Oct 3 13:56:46 2015 -0600
> > > > 
> > > > itest: make memory access work under sandbox
> > > > 
> > > > itest accesses memory, and hence must map/unmap it. Without doing 
> > > > so, it
> > > > accesses invalid addresses and crashes.
> > > > 
> > > > Signed-off-by: Stephen Warren <swar...@wwwdotorg.org>
> > > > Reviewed-by: Simon Glass <s...@chromium.org>
> > > > >8--
> > > > 
> > > > That's because CMD_ITEST is enabled by default in common/Kconfig and now
> > > > map_physmem()/unmap_physmem() is used there.
> > > > 
> > > > So this patch adds missing stubs for ARC.
> > > > 
> > > > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > > > Cc: Stephen Warren <swar...@wwwdotorg.org>
> > > > Cc: Simon Glass <s...@chromium.org>
> > > > ---
> 
> Reviewed-by: Simon Glass <s...@chromium.org>

So should I move map_physmem()/unmap_physmem() in generic header and include
it in asm/io.h for every arch (as suggested by Stephen) or for starters I
may have stubs for ARC and once this patch is accepted do clean-up for
all arches at once?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: add support for generic EHCI devices

2015-11-16 Thread Alexey Brodkin
Hi Simon,

On Fri, 2015-11-13 at 19:05 -0700, Simon Glass wrote:
> Hi,
> 
> On 13 November 2015 at 11:10, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Similarly to Linux kernel it's nice to have generic driver for
> > EHCI-compatible host controllers.
> > 
> > This implementation is very minimalistic and doesn't have any
> > platform-specific glue code nor phy-related operations.
> > 
> > For example this allows usage of USB-storage devices with
> > Synopsys DesignWare AXS10x boards.
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Cc: Stephen Warren <swar...@nvidia.com>
> > Cc: Simon Glass <s...@chromium.org>
> > Cc: Marek Vasut <ma...@denx.de>
> > ---
> >  drivers/usb/host/Kconfig|  7 +
> >  drivers/usb/host/Makefile   |  1 +
> >  drivers/usb/host/ehci-generic.c | 57 
> > +
> >  3 files changed, 65 insertions(+)
> >  create mode 100644 drivers/usb/host/ehci-generic.c
> > 
> 
> Reviewed-by: Simon Glass <s...@chromium.org>
> 
> Please see nits below.
> 
> > diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> > index 2a2bffe..a500578 100644
> > --- a/drivers/usb/host/Kconfig
> > +++ b/drivers/usb/host/Kconfig
> > @@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
> > ---help---
> >   Enables support for the on-chip EHCI controller on UniPhier SoCs.
> > 
> > +config USB_EHCI_GENERIC
> > +   bool "Support for generic EHCI USB controller"
> > +   depends on OF_CONTROL
> > +   default y
> > +   ---help---
> > + Enables support for generic EHCI controller.
> 
> such as Synopsys ...
> what does 'generic' mean?
> Please add a few more details.

Well "generic" here really means generic.
I.e. every EHCI-compatible controller that requires
no platform glue like enabling/disabling power/phy via
GPIOs etc will work perfectly fine with this driver.

So I'm not really sure what I may put here in description
that makes more sense.

Any suggestions?

> > +
> >  endif
> > diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
> > index f70f38c..b9b4471 100644
> > --- a/drivers/usb/host/Makefile
> > +++ b/drivers/usb/host/Makefile
> > @@ -32,6 +32,7 @@ else
> >  obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
> >  endif
> >  obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
> > +obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
> >  obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
> >  obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
> >  obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
> > diff --git a/drivers/usb/host/ehci-generic.c 
> > b/drivers/usb/host/ehci-generic.c
> > new file mode 100644
> > index 000..c57ddef
> > --- /dev/null
> > +++ b/drivers/usb/host/ehci-generic.c
> > @@ -0,0 +1,57 @@
> > +/*
> > + * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
> > + *
> > + * SPDX-License-Identifier:GPL-2.0+
> > + */
> > +
> > +#include 
> > +#include 
> > +#include "ehci.h"
> > +
> > +/*
> > + * Even though here we don't explicitly use "struct ehci_ctrl"
> > + * ehci_register() expects it to be the first thing that resides in
> > + * device private data.
> 
> Yes it probably makes sense to have your own structure here rather
> than just using struct ehci_ctrl.

Not clear what do you mean.
See http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/usb/host/ehci-hcd.c#l1636
>8
 int ehci_register(struct udevice *dev, struct ehci_hccr *hccr,
   struct ehci_hcor *hcor, const struct ehci_ops *ops,
   uint tweaks, enum usb_init_type init)
 {
...
 struct ehci_ctrl *ctrl = dev_get_priv(dev);
>8

And dev_get_priv(), see 
http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/core/device.c#l378
>8
 void *dev_get_priv(struct udevice *dev)
 {
 if (!dev) {
 dm_warn("%s: null device\n", __func__);
 return NULL;
 }
 
 return dev->priv;
 }
>8

So "struct ehci_ctrl" must exist and be the first member of device's
private structure.

> > + */
> > +struct generic_ehci {
> > +   struct ehci_ctrl ctrl;
> > +};
> > +
> > +static int ehci_usb_probe(struct udevice *dev)
> > +{
> > +   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
> > +   str

Re: [U-Boot] [PATCH v5] Fix board init code to respect the C runtime environment

2015-11-16 Thread Alexey Brodkin
Hi Albert,

On Mon, 2015-11-16 at 17:22 +0100, Albert ARIBAUD wrote:
> board_init_f_mem() alters the C runtime environment's
> stack it is actually already using. This is not a valid
> behaviour within a C runtime environment.
> 
> Split board_init_f_mem into C functions which do not alter
> their own stack and always behave properly with respect to
> their C runtime environment.
> 
> Signed-off-by: Albert ARIBAUD 
> ---
> Cc:ing custodians for all architectures which this
> patch affects.
> 
> This patch has been build-tested for all there
> architectures, and run-tested on ARM OpenRD Client.
> 
> For NIOS2, this patch contains all manual v1 and v2
> fixes by Thomas.
> 
> For x86, this patch contains all manual v2 fixes by Bin.
> 
> Changes in v5:
> - Reword commit message (including summary/subject)
> - Reword comments in ARC code
> 
> Changes in v4:
> - Add comments on reserving GD at the lowest location
> - Add comments on post-incrementing base for each "chunk"
> 
> Changes in v3:
> - Rebase after commit 9ac4fc82
> - Simplify malloc conditional as per commit 9ac4fc82
> - Fix NIOS2 return value register (r2, not r4)
> - Fix x86 subl argument inversion
> - Group allocations in a single function
> - Group initializations in a single function
> 
> Changes in v2:
> - Fix all checkpatch issues
> - Fix board_init_f_malloc prototype mismatch
> - Fix board_init_[f_]xxx typo in NIOS2
> - Fix aarch64 asm 'sub' syntax error
> 
>  arch/arc/lib/start.S|  16 +++---
>  arch/arm/lib/crt0.S |   6 ++-
>  arch/arm/lib/crt0_64.S  |   6 ++-
>  arch/microblaze/cpu/start.S |   4 +-
>  arch/nios2/cpu/start.S  |  13 +++--
>  arch/powerpc/cpu/ppc4xx/start.S |  10 ++--
>  arch/x86/cpu/start.S|   5 +-
>  arch/x86/lib/fsp/fsp_common.c   |   4 +-
>  common/init/board_init.c| 108 
> +++-
>  include/common.h|  33 +---
>  10 files changed, 146 insertions(+), 59 deletions(-)

Looks good to me now, thanks!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-16 Thread Alexey Brodkin
Hi Stephen,

On Mon, 2015-11-16 at 14:08 -0700, Simon Glass wrote:
> Hi,
> 
> On 16 November 2015 at 06:47, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Hi Simon, Stephen,
> > 
> > On Fri, 2015-11-13 at 19:03 -0700, Simon Glass wrote:
> > > On 13 November 2015 at 11:23, Alexey Brodkin
> > > <alexey.brod...@synopsys.com> wrote:
> > > > Hi Simon,
> > > > 
> > > > On Fri, 2015-11-13 at 11:14 -0700, Simon Glass wrote:
> > > > > Hi Alexey,
> > > > > 
> > > > > On 12 November 2015 at 14:56, Alexey Brodkin
> > > > > <alexey.brod...@synopsys.com> wrote:
> > 
> > [snip]
> > 
> > > > > > Up until now there was no need in those stubs.
> > > > > > 
> > > > > > But since following commit compilation of U-Boot on ARC is broken:
> > > > > > >8--
> > > > > > commit 7861204c9af7fec1ea9b41541c272516235a6c93
> > > > > > Author: Stephen Warren <swar...@wwwdotorg.org>
> > > > > > Date:   Sat Oct 3 13:56:46 2015 -0600
> > > > > > 
> > > > > > itest: make memory access work under sandbox
> > > > > > 
> > > > > > itest accesses memory, and hence must map/unmap it. Without 
> > > > > > doing so, it
> > > > > > accesses invalid addresses and crashes.
> > > > > > 
> > > > > >     Signed-off-by: Stephen Warren <swar...@wwwdotorg.org>
> > > > > > Reviewed-by: Simon Glass <s...@chromium.org>
> > > > > > >8--
> > > > > > 
> > > > > > That's because CMD_ITEST is enabled by default in common/Kconfig 
> > > > > > and now
> > > > > > map_physmem()/unmap_physmem() is used there.
> > > > > > 
> > > > > > So this patch adds missing stubs for ARC.
> > > > > > 
> > > > > > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > > > > > Cc: Stephen Warren <swar...@wwwdotorg.org>
> > > > > > Cc: Simon Glass <s...@chromium.org>
> > > > > > ---
> > > 
> > > Reviewed-by: Simon Glass <s...@chromium.org>
> > 
> > So should I move map_physmem()/unmap_physmem() in generic header and include
> > it in asm/io.h for every arch (as suggested by Stephen) or for starters I
> > may have stubs for ARC and once this patch is accepted do clean-up for
> > all arches at once?
> 
> Either is fine with me. If you do a shared file it should be in
> include/asm-generic I think.

Please let me know if you're fine as well with local patch for ARC
for starters. This quick fix is really necessary because as of today
U-Boot for ARC couldn't be built at all from current master branch.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] usb: add support for generic EHCI devices

2015-11-13 Thread Alexey Brodkin
Similarly to Linux kernel it's nice to have generic driver for
EHCI-compatible host controllers.

This implementation is very minimalistic and doesn't have any
platform-specific glue code nor phy-related operations.

For example this allows usage of USB-storage devices with
Synopsys DesignWare AXS10x boards.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Cc: Stephen Warren <swar...@nvidia.com>
Cc: Simon Glass <s...@chromium.org>
Cc: Marek Vasut <ma...@denx.de>
---
 drivers/usb/host/Kconfig|  7 +
 drivers/usb/host/Makefile   |  1 +
 drivers/usb/host/ehci-generic.c | 57 +
 3 files changed, 65 insertions(+)
 create mode 100644 drivers/usb/host/ehci-generic.c

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index 2a2bffe..a500578 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
@@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
---help---
  Enables support for the on-chip EHCI controller on UniPhier SoCs.
 
+config USB_EHCI_GENERIC
+   bool "Support for generic EHCI USB controller"
+   depends on OF_CONTROL
+   default y
+   ---help---
+ Enables support for generic EHCI controller.
+
 endif
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index f70f38c..b9b4471 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -32,6 +32,7 @@ else
 obj-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 endif
 obj-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
+obj-$(CONFIG_USB_EHCI_GENERIC) += ehci-generic.o
 obj-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 obj-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 obj-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-generic.c b/drivers/usb/host/ehci-generic.c
new file mode 100644
index 000..c57ddef
--- /dev/null
+++ b/drivers/usb/host/ehci-generic.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2015 Alexey Brodkin <abrod...@synopsys.com>
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include 
+#include 
+#include "ehci.h"
+
+/*
+ * Even though here we don't explicitly use "struct ehci_ctrl"
+ * ehci_register() expects it to be the first thing that resides in
+ * device private data.
+ */
+struct generic_ehci {
+   struct ehci_ctrl ctrl;
+};
+
+static int ehci_usb_probe(struct udevice *dev)
+{
+   struct ehci_hccr *hccr = (struct ehci_hccr *)dev_get_addr(dev);
+   struct ehci_hcor *hcor;
+
+   hcor = (struct ehci_hcor *)((uint32_t)hccr +
+   HC_LENGTH(ehci_readl(>cr_capbase)));
+
+   return ehci_register(dev, hccr, hcor, NULL, 0, USB_INIT_HOST);
+}
+
+static int ehci_usb_remove(struct udevice *dev)
+{
+   int ret;
+
+   ret = ehci_deregister(dev);
+   if (ret)
+   return ret;
+
+   return 0;
+}
+
+static const struct udevice_id ehci_usb_ids[] = {
+   { .compatible = "generic-ehci" },
+   { }
+};
+
+U_BOOT_DRIVER(usb_ehci) = {
+   .name   = "ehci_generic",
+   .id = UCLASS_USB,
+   .of_match = ehci_usb_ids,
+   .probe = ehci_usb_probe,
+   .remove = ehci_usb_remove,
+   .ops= _usb_ops,
+   .priv_auto_alloc_size = sizeof(struct generic_ehci),
+   .flags  = DM_FLAG_ALLOC_PRIV_DMA,
+};
+
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: axs10x switch serial port and Ethernet to driver model

2015-11-13 Thread Alexey Brodkin
With this change Synopsys DesignWare SDP board is switched to driver
model for both serial port (serial_dw) and Ethernet (Designware GMAC).

This simplifies include/configs/axs101.h and allows for reuse of Linux's
Device Tree description.

For simplicity Linux's .dts files are not blindly copied but only very
few extracts of them are really used (those that are supported in U-Boot
at the moment).

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Cc: Masahiro Yamada <yamada.masah...@socionext.com>
Cc: Simon Glass <s...@chromium.org>
---
 arch/arc/dts/Makefile  |  1 +
 arch/arc/dts/axs10x.dts| 45 ++
 board/synopsys/axs101/axs101.c | 12 ---
 configs/axs101_defconfig   | 11 ++-
 configs/axs103_defconfig   | 11 ++-
 include/configs/axs101.h   | 31 ++---
 6 files changed, 72 insertions(+), 39 deletions(-)
 create mode 100644 arch/arc/dts/axs10x.dts

diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index d481fcd..d4772ec 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -2,6 +2,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
+dtb-$(CONFIG_TARGET_AXS101) +=  axs10x.dtb
 dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
 dtb-$(CONFIG_TARGET_TB100) +=  abilis_tb100.dtb
 
diff --git a/arch/arc/dts/axs10x.dts b/arch/arc/dts/axs10x.dts
new file mode 100644
index 000..8fe1837
--- /dev/null
+++ b/arch/arc/dts/axs10x.dts
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+/dts-v1/;
+
+#include "skeleton.dtsi"
+
+/ {
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   aliases {
+   console = 
+   };
+
+   clocks {
+   apbclk: apbclk {
+   compatible = "fixed-clock";
+   clock-frequency = <5000>;
+   #clock-cells = <0>;
+   };
+   };
+
+   uart0: serial0@e0022000 {
+   compatible = "snps,dw-apb-uart";
+   reg = <0xe0022000 0x1000>;
+   reg-shift = <2>;
+   reg-io-width = <4>;
+   };
+
+   ethernet@e0018000 {
+   #interrupt-cells = <1>;
+   compatible = "altr,socfpga-stmmac";
+   reg = < 0xe0018000 0x2000 >;
+   interrupts = < 25 >;
+   interrupt-names = "macirq";
+   phy-mode = "gmii";
+   snps,pbl = < 32 >;
+   clocks = <>;
+   clock-names = "stmmaceth";
+   max-speed = <100>;
+   };
+};
diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index aa446b9..84ee2bf 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -7,8 +7,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include "axs10x.h"
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -35,16 +33,6 @@ int board_mmc_init(bd_t *bis)
return 0;
 }
 
-int board_eth_init(bd_t *bis)
-{
-   if (designware_initialize(ARC_DWGMAC_BASE,
- PHY_INTERFACE_MODE_RGMII) >= 0)
-   return 1;
-
-   return 0;
-}
-
-
 #define AXS_MB_CREG0xE0011000
 
 int board_early_init_f(void)
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index fdb3149..8e5d2e5 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -1,12 +1,21 @@
 CONFIG_ARC=y
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_CLK_FREQ=75000
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_NETDEVICES=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_CLK=y
+CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index b3dbb8d..cbd63fe 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -1,11 +1,20 @@
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_CLK_FREQ=5000
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_DEFAULT_DEVICE_TREE="axs10x"
 CONFIG_SYS_PROMPT="AXS# "
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-CONFIG_NETDEVICES=y
+CONFIG_CMD_DHCP=y
+CONFIG_CMD_PING=y
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_DM=y
+CONFIG_CLK=y
+CONFIG_DM_ETH=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index 450291c..9

Re: [U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-13 Thread Alexey Brodkin
Hi Simon,

On Fri, 2015-11-13 at 11:14 -0700, Simon Glass wrote:
> Hi Alexey,
> 
> On 12 November 2015 at 14:56, Alexey Brodkin
> <alexey.brod...@synopsys.com> wrote:
> > Up until now there was no need in those stubs.
> > 
> > But since following commit compilation of U-Boot on ARC is broken:
> > >8--
> > commit 7861204c9af7fec1ea9b41541c272516235a6c93
> > Author: Stephen Warren <swar...@wwwdotorg.org>
> > Date:   Sat Oct 3 13:56:46 2015 -0600
> > 
> > itest: make memory access work under sandbox
> > 
> > itest accesses memory, and hence must map/unmap it. Without doing so, it
> > accesses invalid addresses and crashes.
> > 
> > Signed-off-by: Stephen Warren <swar...@wwwdotorg.org>
> > Reviewed-by: Simon Glass <s...@chromium.org>
> > >8--
> > 
> > That's because CMD_ITEST is enabled by default in common/Kconfig and now
> > map_physmem()/unmap_physmem() is used there.
> > 
> > So this patch adds missing stubs for ARC.
> > 
> > Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> > Cc: Stephen Warren <swar...@wwwdotorg.org>
> > Cc: Simon Glass <s...@chromium.org>
> > ---
> >  arch/arc/include/asm/io.h | 24 
> >  1 file changed, 24 insertions(+)
> > 
> > diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
> > index 24b7337..281682c 100644
> > --- a/arch/arc/include/asm/io.h
> > +++ b/arch/arc/include/asm/io.h
> > @@ -10,6 +10,30 @@
> >  #include 
> >  #include 
> > 
> > +/*
> > + * Given a physical address and a length, return a virtual address
> > + * that can be used to access the memory range with the caching
> > + * properties specified by "flags".
> > + */
> > +#define MAP_NOCACHE(0)
> > +#define MAP_WRCOMBINE  (0)
> > +#define MAP_WRBACK (0)
> > +#define MAP_WRTHROUGH  (0)
> > +
> > +static inline void *
> > +map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
> > +{
> > +   return (void *)((unsigned long)paddr);
> > +}
> > +
> > +/*
> > + * Take down a mapping set up by map_physmem().
> > + */
> > +static inline void unmap_physmem(void *vaddr, unsigned long flags)
> > +{
> > +
> > +}
> > +
> >  static inline void sync(void)
> >  {
> > /* Not yet implemented */
> > --
> > 2.4.3
> > 
> 
> What error does this solve?
-->8---
  CC  common/cmd_itest.o
common/cmd_itest.c: In function 'evalexp':
common/cmd_itest.c:61:3: warning: implicit
declaration of function 'map_physmem' [-Wimplicit-function-declaration]
   buf = map_physmem(addr, w, MAP_WRBACK);
   ^
com
mon/cmd_itest.c:61:30: error: 'MAP_WRBACK' undeclared (first use in this 
function)
   buf = map_physmem(addr, w,
MAP_WRBACK);
  ^
common/cmd_itest.c:61:30: note: each undeclared identifier is reported only
once for each function it appears in
common/cmd_itest.c:71:3: warning: implicit declaration of function 
'unmap_physmem' [
-Wimplicit-function-declaration]
   unmap_physmem(buf, w);
   ^
scripts/Makefile.build:277: recipe for target
'common/cmd_itest.o' failed
make[1]: *** [common/cmd_itest.o] Error 1
Makefile:1211: recipe for target 'common' failed
make
: *** [common] Error 2
-->8---

> Is CONFIG_ARCH_MAP_SYSMEM defined for arc?

No
-->8---
$ cat .config | grep 
CONFIG_ARCH_MAP_SYSMEM-->8---

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-13 Thread Alexey Brodkin
Hi Stephen,

On Thu, 2015-11-12 at 16:00 -0700, Stephen Warren wrote:
> On 11/12/2015 02:56 PM, Alexey Brodkin wrote:
> > Up until now there was no need in those stubs.
> > 
> > But since following commit compilation of U-Boot on ARC is broken:
> > commit 7861204c9af7fec1ea9b41541c272516235a6c93
> >  itest: make memory access work under sandbox
> > 
> ...
> > That's because CMD_ITEST is enabled by default in common/Kconfig and now
> > map_physmem()/unmap_physmem() is used there.
> > 
> > So this patch adds missing stubs for ARC.
> 
> This looks OK, but rather than cut/pasting this exact same code yet 
> another time, why not create e.g. include/io-base.h that contains this, 
> and share it amongst all architectures?

I did think about that.

But the problem is "asm/io.h" is included in lots of sources and
it's hard to tell a reason for that inclusion - if it's only because of
map_physmem() or other stuff that might exist in the same header.

For example lots of accessors are described in the same "asm/io.h" like
readl(), writeb() etc.

Frankly I'd prefer in that particular case to limit a change to my
architecture.

Still thoughts are welcome.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: add empty asm/processor.h to satisfy compilation of USB code

2015-11-12 Thread Alexey Brodkin
common/usb.c unconditionally includes 
And now to allow USB support on ARC boards we have to have that header.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
---
 arch/arc/include/asm/processor.h | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 arch/arc/include/asm/processor.h

diff --git a/arch/arc/include/asm/processor.h b/arch/arc/include/asm/processor.h
new file mode 100644
index 000..6355423
--- /dev/null
+++ b/arch/arc/include/asm/processor.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _ASM_ARC_PROCESSOR_H
+#define _ASM_ARC_PROCESSOR_H
+
+/* This file is required by some generic code like USB etc */
+
+#endif /* _ASM_ARC_PROCESSOR_H */
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: add stubs for map_physmem() and unmap_physmem()

2015-11-12 Thread Alexey Brodkin
Up until now there was no need in those stubs.

But since following commit compilation of U-Boot on ARC is broken:
>8--
commit 7861204c9af7fec1ea9b41541c272516235a6c93
Author: Stephen Warren <swar...@wwwdotorg.org>
Date:   Sat Oct 3 13:56:46 2015 -0600

itest: make memory access work under sandbox

itest accesses memory, and hence must map/unmap it. Without doing so, it
accesses invalid addresses and crashes.

Signed-off-by: Stephen Warren <swar...@wwwdotorg.org>
Reviewed-by: Simon Glass <s...@chromium.org>
>8--

That's because CMD_ITEST is enabled by default in common/Kconfig and now
map_physmem()/unmap_physmem() is used there.

So this patch adds missing stubs for ARC.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
Cc: Stephen Warren <swar...@wwwdotorg.org>
Cc: Simon Glass <s...@chromium.org>
---
 arch/arc/include/asm/io.h | 24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arc/include/asm/io.h b/arch/arc/include/asm/io.h
index 24b7337..281682c 100644
--- a/arch/arc/include/asm/io.h
+++ b/arch/arc/include/asm/io.h
@@ -10,6 +10,30 @@
 #include 
 #include 
 
+/*
+ * Given a physical address and a length, return a virtual address
+ * that can be used to access the memory range with the caching
+ * properties specified by "flags".
+ */
+#define MAP_NOCACHE(0)
+#define MAP_WRCOMBINE  (0)
+#define MAP_WRBACK (0)
+#define MAP_WRTHROUGH  (0)
+
+static inline void *
+map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
+{
+   return (void *)((unsigned long)paddr);
+}
+
+/*
+ * Take down a mapping set up by map_physmem().
+ */
+static inline void unmap_physmem(void *vaddr, unsigned long flags)
+{
+
+}
+
 static inline void sync(void)
 {
/* Not yet implemented */
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: axs10x - cap max SDIO clock value to bus/2

2015-10-07 Thread Alexey Brodkin
It turned out with some boards (FPGA firmwares?) and cards combos
current clock settings doesn't work as expected leading to strange
card freezes or corrupted data being read from the card.

Especially this was seen with Transcend 2Gb cards shipped as a part of
ARC SDP:
->8---
AXS# mmcinfo
Device: Synopsys Mobile storage
Manufacturer ID: 74
OEM: 4a60
Name: SDC
Tran Speed: 5000
Rd Block Len: 512
SD version 3.0
High Capacity: No
Capacity: 1.8 GiB
Bus Width: 4-bit
Erase Group Size: 512 Bytes
AXS# fatload mmc 0
** Unrecognized filesystem type **
->8---

With this change that problem is fixed.
Note "Tran Speed" above doesn't match clock value set in DW MMC.
It is max value for card's speed class.

Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
---
 board/synopsys/axs101/axs101.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index d4280f7..aa446b9 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -30,7 +30,7 @@ int board_mmc_init(bd_t *bis)
host->dev_index = 0;
host->bus_hz = 5000;
 
-   add_dwmci(host, host->bus_hz, 40);
+   add_dwmci(host, host->bus_hz / 2, 40);
 
return 0;
 }
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull ARC fixes

2015-10-07 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 996ec1dcc58a34b53891acde0ec5df9141b5fcc2:

  Merge branch 'master' of git://git.denx.de/u-boot-fdt (2015-10-03 10:48:06 
-0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to f6e27ba5b40a8861336f4e27a7b95cf60b0c8961:

  board: axs10x - cap max SDIO clock value to bus/2 (2015-10-07 18:16:13 +0300)


Alexey Brodkin (1):
  board: axs10x - cap max SDIO clock value to bus/2

 board/synopsys/axs101/axs101.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Regards,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds

2015-09-14 Thread Alexey Brodkin
On Fri, 2015-09-11 at 23:45 +0200, Lukasz Majewski wrote:
> Hi Alexey,

> > FWIW I faced similar problem even reading data.
> > At least on one of my boards reading of ~8Mb file
> > took ~1.7 seconds and so 1 second timeout was interrupting data
> > exchange.
> 
> Was it SD card or eMMC device?

It was external SD-card.

> > 
> > So indeed we need to have some dirty hack for upcoming release
> > like bumping timeout to something really huge but later we
> > need to fix that problem properly.
> > 
> > I though proper solution would be to set timeout depending of amount
> > of data to be exchanged... something like take slowest speed of SD/MMC
> > that is allowed by spec and calculate delay based on how much time it
> > might take for that slow device and for safety multiply it by say 2.
> 
> As fair as I remember, card provide this kind of information. We can
> try to investigate this possibility.

I'm pretty sure card may report a lot of info about itself.
And if we look at what people do in Linux kernel we may see calculations
of different timeouts in "drivers/mmc/core/core.c".

But keeping in mind we're not writing another OS kernel but we're just
dealing with bootloader I'd prefer to keep things simple and do check
only critical things like totally broken HW. I.e. something simple should
be enough for U-Boot.

> > 
> > Now from this thread I see that there're other reasons that might
> > affect length of at least write operation. In other words it could be
> > complicated unfortunately.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds

2015-09-14 Thread Alexey Brodkin
Hi Marek, Lukasz,

On Sun, 2015-09-13 at 16:00 +0200, Marek Vasut wrote:
> On Sunday, September 13, 2015 at 12:03:18 PM, Lukasz Majewski wrote:
> > Hi Marek,
> 
> Hi,
> 
> [...]

> 
> > > > > Still we need to fix regression first with virtually infinite
> > > > > timeout :) I would even thing that simple revert of Marek's patch
> > > > > may make sense for now.
> > > > 
> > > > +1 - unfortunately there were some other patches applied to this
> > > > particular patch. Simple revert might be a bit tricky here.
> > > 
> > > -1 - In case the card gets removed during the DMA transfer and the
> > > board doesn't have a watchdog, it will get stuck indefinitelly.
> > 
> > I'm just wondering here - why the indefinite loop was working
> > previously? Was anybody complaining (on the ML) about the problem of
> > removing the SD card when some operation is ongoing?
> 
> It worked for me for all the workloads I used. Noone was complaining.

The same story here - previous code with infinite loop was working for
my boards. And now I do see a problem with pretty simple scenario that
we do use in our products.

> > The problem with potential removal of SD card (after booting the board)
> > is with us for quite long time. Even with indefinite loop (without your
> > patch) we also could "hang" the board if the SD card was removed
> > during a transfer.
> 
> Which is why we should weed out the unbounded loops.
> 
> > > We
> > > absolutelly don't want this sort of behavior in U-Boot. I understand
> > > that this is the easiest way for everyone to achieve some sort of
> > > "working" solution, but it is definitelly not the correct one. While
> > > I do agree to increasing the timeout, I do not agree to unbounded
> > > loops, sorry.
> > 
> > We have agreed to not agree :-)
> 
> Yes :-)

The first thing I care is working U-Boot v2015.10 out of the box on my
boards. And so I may agree on any temporary solution. I see it as timeout
value either being infinite or obviously very high like 60 seconds.

60 seconds might sound stupid but my thought behind this is to make sure
even long transfers succeed. Imagine 100 Mb rootfs or update file downloaded
from slow SD-card.

> > > > > From both points of view for keeping history
> > > > > clean (compared to stacked fixes/workarounds) and from removal of
> > > > > regression root cause.
> > > > 
> > > > As I said before - +1 from me.
> > > 
> > > As I said before, -1 from me. Btw. did anything regress in here? To
> > > me, this seems like a newly discovered bug ...
> > 
> > Yes, this is a bug. We had similar problem with Samsung's SDHCI, before
> > we switched to dw_mmc. This issue is new at dw_mmc.
> > 
> > > > > It's not that I like to have infinite loops but given previous
> > > > > implementation worked fine for people in the previous U-Boot
> > > > > release.
> > > > 
> > > > Good justification
> > > 
> > > It is never a justified to return to a potentially problematic version
> > 
> > IMHO revering the change (before the release) is from the software
> > development point of view better solution than adding some
> > heuristic delta to timeout.
> > 
> > > for the sake of getting some sort of crappy hardware operational.
> > 
> > Unfortunately this "crappy hardware" is pervasive and we cannot do
> > anything about it.
> > 
> > To sum up (my point of view):
> > 1. The best would be to revert the patch - but if simple "git revert" is
> > not working then,

Well even if clean revert won't work we may do manual tweaks so that
functionally it is "revert". If of any interest I may come up with that
sort of patch.

> > 2. We should increase the timeout (with my patch) for v2015.10 release

If everybody is OK with that let's go do it. Because release is around the
corner and I don't want to explain each and every user how to fix their
new problem.

> Let's do this for the sake of crappy cards.
> 
> > 3. After release we can devise some kind of solution
> > 4. It is a good topic for U-boot's minisummit discussion at Dublin
> > 
> > Marek, Alexey, Tom, Pantelis what do you think?
> 
> I think yes.

What's important we need to make sure Tom is aware of this situation and
he won't cut a release until our fix is in place and all involved parties
reported their happiness.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] mmc: dw_mmc: Zap endless timeout

2015-09-11 Thread Alexey Brodkin
Hi Marek,

On Fri, 2015-09-11 at 13:49 +0200, Marek Vasut wrote:
> On Friday, September 11, 2015 at 09:59:32 AM, Alexey Brodkin wrote:
> > Hi Marek,
> 
> Hi!

> btw Is your mailer totally broken by any chance ?

Hm, I'm not sure what happened but as I may see here
https://patchwork.ozlabs.org/patch/516618/ my message looks good :)

> > It turned out that patch breaks functionality in some cases.
> > For me on every attempt to download something significant (at least I see
> > it on 5/7 Mb files) from SD I'm seeing timeout firing too early.
> > 
> > I added a bit of extra instrumentation to see where time is spent and why.
> 
> Check this patch:
> 
> [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds
> 
> https://patchwork.ozlabs.org/patch/511899/
> 
> Does it fix things for you ?

Well this might fix my particular test-case, but are you sure there's
no chance for this timeout to be not long enough?

And vice versa why wait 20 seconds if problem has happened on short
transfer? Really wait 20 seconds on boot of say TV-set just because
USB-drive is broken?

So I would say that we need to rely on amount of data to be transferred
instead of having any random number of seconds for all.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mmc: dw_mmc: Increase timeout to 20 seconds

2015-09-11 Thread Alexey Brodkin
Hi Marek, Lukasz,

> On Wednesday, September 09, 2015 at 09:01:30 AM, Lukasz Majewski wrote:
> > Hi,
> > 
> > > The commit: d9dbb97be0e4a550457aec5f11afefb446169c90
> > > "mmc: dw_mmc: Zap endless timeout" removed endless loop waiting for
> > > end of dw mmc transfer.
> > > 
> > > For some workloads - dfu test @ Odroid XU3 (sending 8MiB file) -
> > > and SD cards (e.g. MicroSD Kingston 4GiB, Adata 4GiB)
> > > the default timeout is to short.
> > > 
> > > The new value - 20 seconds - takes into account the situation when SD
> > > card triggers internal clean up. Such process may take more than 10
> > > seconds on some cards.
> > > 
> > > Signed-off-by: Lukasz Majewski 
> > > Cc: Marek Vasut 
> > > Cc: Pantelis Antoniou 
> > > Cc: Tom Rini 
> > 
> > Are there any more questions regarding this patch or is it ready for
> > submission as fix for v2015.10?
> 
> No comments, just apply this.
> 
> But this should really be fixed properly in the next MW.
> 
> Best regards,
> Marek Vasut

FWIW I faced similar problem even reading data.
At least on one of my boards reading of ~8Mb file
took ~1.7 seconds and so 1 second timeout was interrupting data
exchange.

So indeed we need to have some dirty hack for upcoming release
like bumping timeout to something really huge but later we
need to fix that problem properly.

I though proper solution would be to set timeout depending of amount
of data to be exchanged... something like take slowest speed of SD/MMC
that is allowed by spec and calculate delay based on how much time it
might take for that slow device and for safety multiply it by say 2.

Now from this thread I see that there're other reasons that might affect
length of at least write operation. In other words it could be
complicated unfortunately.

Still we need to fix regression first with virtually infinite timeout :)
I would even thing that simple revert of Marek's patch may make sense for
now. From both points of view for keeping history clean (compared to
stacked fixes/workarounds) and from removal of regression root cause.

It's not that I like to have infinite loops but given previous
implementation worked fine for people in the previous U-Boot release.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] mmc: dw_mmc: Zap endless timeout

2015-09-11 Thread Alexey Brodkin
Hi Marek,

On Mon, 2015-07-27 at 22:39 +0200, Marek Vasut wrote:
> Endless timeouts are bad, since if we get stuck in one, we have no
> way out. Zap this one by implementing proper timeout.
> 
> Signed-off-by: Marek Vasut 
> Cc: Dinh Nguyen 
> Cc: Pantelis Antoniou 
> Cc: Tom Rini 
> ---
>  drivers/mmc/dw_mmc.c | 19 +--
>  1 file changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 3fffa71..0f61f16 100644
> --- a/drivers/mmc/dw_mmc.c
> +++ b/drivers/mmc/dw_mmc.c
> @@ -211,14 +211,29 @@ static int dwmci_send_cmd(struct mmc *mmc, struct 
> mmc_cmd *cmd,
>   }
>  
>   if (data) {
> - do {
> + start = get_timer(0);
> + timeout = 1000;
> + for (;;) {
>   mask = dwmci_readl(host, DWMCI_RINTSTS);
> + /* Error during data transfer. */
>   if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) {
>   printf("%s: DATA ERROR!\n", __func__);
>   bounce_buffer_stop();
>   return -1;
>   }
> - } while (!(mask & DWMCI_INTMSK_DTO));
> +
> + /* Data arrived correctly. */
> + if (mask & DWMCI_INTMSK_DTO)
> + break;
> +
> + /* Check for timeout. */
> + if (get_timer(start) > timeout) {
> + printf("%s: Timeout waiting for data!\n",
> +__func__);
> + bounce_buffer_stop();
> + return TIMEOUT;
> + }
> + }
>  
>   dwmci_writel(host, DWMCI_RINTSTS, mask);
>  

It turned out that patch breaks functionality in some cases.
For me on every attempt to download something significant (at least I see it on
5/7 Mb files) from SD I'm seeing timeout firing too early.

I added a bit of extra instrumentation to see where time is spent and why.

So my diff is:
--->8
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 77b87e0..2da77a7 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -213,7 +213,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd 
*cmd,
 
if (data) {
start = get_timer(0);
-   timeout = 1000;
+   timeout = 1; // That's required to get to the end of the 
transfer
for (;;) {
mask = dwmci_readl(host, DWMCI_RINTSTS);
/* Error during data transfer. */
@@ -226,6 +226,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd 
*cmd,
/* Data arrived correctly. */
if (mask & DWMCI_INTMSK_DTO) {
ret = 0;
+   printf(" * time spent: %d, data size: %d, 
blocks: %d\n", (int)get_timer(start), data
->blocksize * data->blocks, data->blocks);
break;
}
--->8

And that's what I see then:
--->8
AXS# fatload mmc 0
 * time spent: 0, data size: 8, blocks: 1
 * time spent: 0, data size: 512, blocks: 1
 * time spent: 0, data size: 512, blocks: 1
 * time spent: 0, data size: 512, blocks: 1
reading uImage
 * time spent: 1, data size: 512, blocks: 1
 * time spent: 0, data size: 1024, blocks: 2
 * time spent: 1, data size: 3072, blocks: 6
 * time spent: 1, data size: 3072, blocks: 6
 * time spent: 1, data size: 3072, blocks: 6
 * time spent: 0, data size: 3072, blocks: 6
 * time spent: 0, data size: 3072, blocks: 6
 * time spent: 1599, data size: 13338112, blocks: 26051
 * time spent: 0, data size: 512, blocks: 1
13338188 bytes read in 1651 ms (7.7 MiB/s)
--->8

So you see real data transfer takes  ~1.7 seconds when getting 26k blocks.

In other words timeout check has to be a bit smarter, for example
taking into account number of blocks to be transferred.

Any thoughts?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] commit 620776d causes TFTP error: 'Unsupported option(s) requested' (8)

2015-09-10 Thread Alexey Brodkin
Hi Pavel,

On Tue, 2015-08-25 at 14:19 +0200, Pavel Machek wrote:
> On Tue 2015-08-25 14:13:17, Hannes Schmelzer wrote:
> > Hi,
> > 
> > i've same problem.
> > 
> > Running tftp-hpa on Linux Mint 17.
> > 
> > cat /etc/default/tftpd-hpa
> > # /etc/default/tftpd-hpa
> > RUN_DAEMON="yes"
> > TFTP_USERNAME="tftp"
> > TFTP_DIRECTORY="/tftpboot/tseries"
> > TFTP_ADDRESS="0.0.0.0:69"
> > TFTP_OPTIONS="-l -s"
> 
> Yes. Please try patch I mailed half an hour ago... it should fix
> that. (Actually here it is again, without changelog).
> 
> Sorry for the trouble,
>   Pavel

I'm wondering if there's a chance to fix that obvious regression
anytime soon?

We're approaching v2015.10 release and with today's master
all my boards fail on tftp load with mentioned:
>8---
# tftp
Speed: 100, full duplex
Using ethernet@f000a000 device
TFTP from server 10.225.15.67; our IP address is 10.225.15.11
Filename 'uImage'.
Load address: 0x8200
Loading: T T 
TFTP error: 'Unsupported option(s) requested' (8)
>8---

If there's no proper fix for now then we do need to revert
http://git.denx.de/?p=u-boot.git;a=commit;h=620776d734e4b126c407f636bda825a594a17723

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: make AXS101 default platform

2015-09-07 Thread Alexey Brodkin
On Mon, 2015-08-24 at 19:00 +0300, Alexey Brodkin wrote:
> This fixes building in automated flow that doesn't use defconfigs.
> 
> See discussion on that topic here:
>  http://patchwork.ozlabs.org/patch/502558/
> 
> See similar patches for other architectures/platforms  here:
>  [1] 
> http://git.denx.de/?p=u-boot.git;a=commit;h=ff560a13056a565a4e9ce1761bd04276a3cace88
>  [2] 
> http://git.denx.de/?p=u-boot.git;a=commit;h=589907e2c187ec69b351c38ccda36730d25ab5d6
> 
> And while at it add missing shell prompt to axs103.
> 
> Cc: Tom Rini <tr...@konsulko.com>
> Cc: Joe Hershberger <joe.hershber...@gmail.com>
> Cc: Masahiro Yamada <yamada.masah...@socionext.com>
> Signed-off-by: Alexey Brodkin <abrod...@synopsys.com>
> ---

Applied, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] please pull u-boot-arc master

2015-09-07 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 6015f8f1b6fc30de7b4839bd691058583ec7f521:

  doc: document the fdtdir PXE command (2015-09-03 16:59:07 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to a883f83e6d62fef1830b1634ccb72535c43696f7:

  arc: make AXS101 default platform (2015-09-07 13:38:24 +0300)


Alexey Brodkin (1):
  arc: make AXS101 default platform

 arch/arc/Kconfig | 2 +-
 configs/axs101_defconfig | 3 +--
 configs/axs103_defconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

Regards,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: make AXS101 default platform

2015-08-24 Thread Alexey Brodkin
Hi Tom,

On Mon, 2015-08-24 at 12:09 -0400, Tom Rini wrote:
 On Mon, Aug 24, 2015 at 07:00:12PM +0300, Alexey Brodkin wrote:
  This fixes building in automated flow that doesn't use defconfigs.
  
  See discussion on that topic here:
   http://patchwork.ozlabs.org/patch/502558/
  
  See similar patches for other architectures/platforms  here:
   [1] 
  http://git.denx.de/?p=u-boot.git;a=commit;h=ff560a13056a565a4e9ce1761bd04276a3cace88
   [2] 
  http://git.denx.de/?p=u-boot.git;a=commit;h=589907e2c187ec69b351c38ccda36730d25ab5d6
  
  And while at it add missing shell prompt to axs103.
  
  Cc: Tom Rini tr...@konsulko.com
  Cc: Joe Hershberger joe.hershber...@gmail.com
  Cc: Masahiro Yamada yamada.masah...@socionext.com
  Signed-off-by: Alexey Brodkin abrod...@synopsys.com
  ---
   arch/arc/Kconfig | 2 +-
   configs/axs101_defconfig | 3 +--
   configs/axs103_defconfig | 2 +-
   3 files changed, 3 insertions(+), 4 deletions(-)
  
  diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
  index 925e312..264c83d 100644
  --- a/arch/arc/Kconfig
  +++ b/arch/arc/Kconfig
  @@ -129,7 +129,7 @@ config ARC_CACHE_LINE_SHIFT
   
   choice
  prompt Target select
  -   optional
  +   default TARGET_AXS101
   
   config TARGET_TB100
  bool Support tb100
  diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
  index 9a6cef3..fdb3149 100644
  --- a/configs/axs101_defconfig
  +++ b/configs/axs101_defconfig
  @@ -1,13 +1,12 @@
   CONFIG_ARC=y
   CONFIG_SYS_DCACHE_OFF=y
   CONFIG_ARC_CACHE_LINE_SHIFT=5
  -CONFIG_TARGET_AXS101=y
   CONFIG_SYS_CLK_FREQ=75000
   CONFIG_SYS_TEXT_BASE=0x8100
  +CONFIG_SYS_PROMPT=AXS# 
   # CONFIG_CMD_IMLS is not set
   # CONFIG_CMD_FLASH is not set
   # CONFIG_CMD_SETEXPR is not set
   CONFIG_NETDEVICES=y
   CONFIG_ETH_DESIGNWARE=y
   CONFIG_USE_PRIVATE_LIBGCC=y
  -CONFIG_SYS_PROMPT=AXS# 
  diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
  index 8315b61..b3dbb8d 100644
  --- a/configs/axs103_defconfig
  +++ b/configs/axs103_defconfig
  @@ -1,8 +1,8 @@
   CONFIG_ARC=y
   CONFIG_ISA_ARCV2=y
  -CONFIG_TARGET_AXS101=y
   CONFIG_SYS_CLK_FREQ=5000
   CONFIG_SYS_TEXT_BASE=0x8100
  +CONFIG_SYS_PROMPT=AXS# 
   # CONFIG_CMD_IMLS is not set
   # CONFIG_CMD_FLASH is not set
   # CONFIG_CMD_SETEXPR is not set
 
 It all makes sense.  But.. should it be TARGET_ASX10X ?  Or is there (or
 might be..) future 10x devices that wouldn't be supported by the same
 code / config option?

Indeed we already have axs101 and axs103 as you see in U-Boot.
Moreover there's internal thing that stands in between - axs102.
And I'm going to do that naming clean-up when time permits but
let's say for today that legacy naming stuff is fine.

So yes I'll try to do that sometime soon.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: make AXS101 default platform

2015-08-24 Thread Alexey Brodkin
This fixes building in automated flow that doesn't use defconfigs.

See discussion on that topic here:
 http://patchwork.ozlabs.org/patch/502558/

See similar patches for other architectures/platforms  here:
 [1] 
http://git.denx.de/?p=u-boot.git;a=commit;h=ff560a13056a565a4e9ce1761bd04276a3cace88
 [2] 
http://git.denx.de/?p=u-boot.git;a=commit;h=589907e2c187ec69b351c38ccda36730d25ab5d6

And while at it add missing shell prompt to axs103.

Cc: Tom Rini tr...@konsulko.com
Cc: Joe Hershberger joe.hershber...@gmail.com
Cc: Masahiro Yamada yamada.masah...@socionext.com
Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig | 2 +-
 configs/axs101_defconfig | 3 +--
 configs/axs103_defconfig | 2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 925e312..264c83d 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -129,7 +129,7 @@ config ARC_CACHE_LINE_SHIFT
 
 choice
prompt Target select
-   optional
+   default TARGET_AXS101
 
 config TARGET_TB100
bool Support tb100
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index 9a6cef3..fdb3149 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -1,13 +1,12 @@
 CONFIG_ARC=y
 CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_TARGET_AXS101=y
 CONFIG_SYS_CLK_FREQ=75000
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_SYS_PROMPT=AXS# 
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
 CONFIG_NETDEVICES=y
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_USE_PRIVATE_LIBGCC=y
-CONFIG_SYS_PROMPT=AXS# 
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index 8315b61..b3dbb8d 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -1,8 +1,8 @@
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
-CONFIG_TARGET_AXS101=y
 CONFIG_SYS_CLK_FREQ=5000
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_SYS_PROMPT=AXS# 
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_SETEXPR is not set
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] arch: Make board selection choices optional

2015-07-29 Thread Alexey Brodkin
Hi Joe,

On Wed, 2015-05-13 at 10:11 +0900, Masahiro Yamada wrote:
 Hi Joe,
 
 2015-05-13 7:12 GMT+09:00 Tom Rini tr...@konsulko.com:
 
  diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
  index c044ad4..85fddd2 100644
  --- a/arch/arc/Kconfig
  +++ b/arch/arc/Kconfig
  @@ -132,6 +132,7 @@ config ARC_CACHE_LINE_SHIFT
  
   choice
  prompt Target select
  +   optional
  
   config TARGET_DUMMY
  bool Dummy target
 
 
 You do not need to add optional to the ARC board select
 because Alexey intentionally added TARGET_DUMMY
 to the top of the board select list.
 
 This is another solution to not lose any CONFIG_BOARD_
 by savedefconfig although I personally prefer this idea very much.

Looks like I discover an issue that happens with that change.
If one attempts to do something like:
--8--
yes  | make oldconfig on defconfig
--8--
(that trick is done by automated build frameworks like Buildroot that prefer to
not do xxx_defconfig explicitly, but modify that defconfig and later expand it
to a full-scale .config) target won't be set because on prompt you'll see
something like that:
--8--
Target select [N/y] (NEW)
--8--

See default answer here is No!
Which later on attempt to do a build causes:
--8--
$ make
scripts/kconfig/conf --silentoldconfig Kconfig
#
# configuration written to .config
#
  CHK include/config.h
  UPD include/config.h
  GEN include/autoconf.mk
In file included from ./include/common.h:18:0:
include/config.h:5:22: fatal error: configs/.h: No such file or directory
 #include configs/.h
  ^
compilation terminated.
scripts/Makefile.autoconf:72: recipe for target 'include/autoconf.mk' failed
make[1]: *** [include/autoconf.mk] Error 1
--8--

If optional is removed from choice - prompt Target select then
target is selected by default and build runs smoothly.

Any thoughts on how to fix it?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 1/2] arch: Make board selection choices optional

2015-07-29 Thread Alexey Brodkin
Hi Joe, Masahiro-san,

On Wed, 2015-07-29 at 20:25 +0300, Alexey Brodkin wrote:
 Hi Joe,
 
 On Wed, 2015-05-13 at 10:11 +0900, Masahiro Yamada wrote:
  Hi Joe,
  
  2015-05-13 7:12 GMT+09:00 Tom Rini tr...@konsulko.com:
  
   diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
   index c044ad4..85fddd2 100644
   --- a/arch/arc/Kconfig
   +++ b/arch/arc/Kconfig
   @@ -132,6 +132,7 @@ config ARC_CACHE_LINE_SHIFT
   
choice
   prompt Target select
   +   optional
   
config TARGET_DUMMY
   bool Dummy target
  
  
  You do not need to add optional to the ARC board select
  because Alexey intentionally added TARGET_DUMMY
  to the top of the board select list.
  
  This is another solution to not lose any CONFIG_BOARD_
  by savedefconfig although I personally prefer this idea very much.

It looks like I'm not the only one suffering from that change.
For UniPhier that issue was resolved by Masahiro with replacement of
optional with explicit default option.

And probably that's the way we'll need to go for all other affected
Kconfigs.

Still all proposals are more than welcome.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net/designware: revert MAC-address setup on init

2015-07-04 Thread Alexey Brodkin
Hi Joe,

On Wed, 2015-07-01 at 18:02 -0400, Tom Rini wrote:
 On Wed, Jul 01, 2015 at 10:26:21AM -0500, Joe Hershberger wrote:
  Hi Alexey,
  
  On Wed, Jul 1, 2015 at 9:25 AM, Alexey Brodkin
  alexey.brod...@synopsys.com wrote:
   Hi Tom, Joe,
   
   On Wed, 2015-07-01 at 22:22 +0800, Bin Meng wrote:
Hi Alexey,

On Wed, Jul 1, 2015 at 9:59 PM, Alexey Brodkin
alexey.brod...@synopsys.com wrote:
 http://git.denx.de/?p=u
 -boot.git;a=patch;h=f566c9949fbdce2e09a900c5343ca9986e5ba360
 broke DW GMAC operation if !DM_ETH because eth_write_hwaddr()
 doesn't
 exist if !DM_NET.
 
 As for DM_ETH case I'm still not sure if existing 
 implementation
 will
 fly.
 
 The point is as it is said in the comment on soft reset 
 that is
 triggered with setting DMAMAC_SRST in busmode register HW 
 address
 gets
 reset as well. And we inevitably need to set HW address 
 again.
 
 So probably better solution is to move mentioned soft-reset 
 from
 init (that is used on start of any network activity) to
 initialize
 (which is only executed once in board_r sequence). But 
 that's a
 bit of
 a different story and for now let's just get DW GMAC 
 functional
 again.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Joe Hershberger joe.hershber...@ni.com
 Cc: Michal Simek michal.si...@xilinx.com
 Cc: Tom Rini tr...@konsulko.com
 ---
  drivers/net/designware.c | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/drivers/net/designware.c 
 b/drivers/net/designware.c
 index ae51cf3..07281a6 100644
 --- a/drivers/net/designware.c
 +++ b/drivers/net/designware.c
 @@ -243,6 +243,10 @@ static int _dw_eth_init(struct 
 dw_eth_dev
 *priv, u8 *enetaddr)
 mdelay(100);
 };
 
 +   /* Soft reset above clears HW address registers.
 +* So we have to set it here once again */
 +   _dw_write_hwaddr(priv, enetaddr);
 +
 rx_descs_init(priv);
 tx_descs_init(priv);
 
 --

There is already a patch submitted. Please check
http://patchwork.ozlabs.org/patch/484214/
   
   Any chance for mentioned patch net: designware: Program MAC 
   address to
   hardware after soft reset to be applied?
   
   This really fixes GMAC operation and it would be nice to have 
   this fix
   in upcoming release.
  
  I think that sounds appropriate. Tom?
 
 Yes.  Of the handful of recent (in my mind anyhow) net patches, are 
 you
 going to do a PR for them or should I just grab things?

Any chance to see that patch upstream anytime soon?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] net/designware: revert MAC-address setup on init

2015-07-01 Thread Alexey Brodkin
http://git.denx.de/?p=u-boot.git;a=patch;h=f566c9949fbdce2e09a900c5343ca9986e5ba360
broke DW GMAC operation if !DM_ETH because eth_write_hwaddr() doesn't
exist if !DM_NET.

As for DM_ETH case I'm still not sure if existing implementation will
fly.

The point is as it is said in the comment on soft reset that is
triggered with setting DMAMAC_SRST in busmode register HW address gets
reset as well. And we inevitably need to set HW address again.

So probably better solution is to move mentioned soft-reset from
init (that is used on start of any network activity) to initialize
(which is only executed once in board_r sequence). But that's a bit of
a different story and for now let's just get DW GMAC functional again.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Joe Hershberger joe.hershber...@ni.com
Cc: Michal Simek michal.si...@xilinx.com
Cc: Tom Rini tr...@konsulko.com
---
 drivers/net/designware.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index ae51cf3..07281a6 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -243,6 +243,10 @@ static int _dw_eth_init(struct dw_eth_dev *priv, u8 
*enetaddr)
mdelay(100);
};
 
+   /* Soft reset above clears HW address registers.
+* So we have to set it here once again */
+   _dw_write_hwaddr(priv, enetaddr);
+
rx_descs_init(priv);
tx_descs_init(priv);
 
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board: axs103 - add mainteiner information

2015-07-01 Thread Alexey Brodkin
On Wed, 2015-07-01 at 17:00 +0300, Alexey Brodkin wrote:
 Looks like I forgot to add myself as a maintainer for AXS103 
 defconfig.
 Fixing this now.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 ---
  board/synopsys/axs101/MAINTAINERS | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/board/synopsys/axs101/MAINTAINERS 
 b/board/synopsys/axs101/MAINTAINERS
 index 481bbcc..79fff8e 100644
 --- a/board/synopsys/axs101/MAINTAINERS
 +++ b/board/synopsys/axs101/MAINTAINERS
 @@ -4,3 +4,4 @@ S:Maintained
  F:   board/synopsys/axs101/
  F:   include/configs/axs101.h
  F:   configs/axs101_defconfig
 +F:   configs/axs103_defconfig

Applied with typo fix in the subject, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Please pull changes for ARC

2015-07-01 Thread Alexey Brodkin
Hi Tom,

The following changes since commit
9c6b05cb724e18d1db3f9e1a75b2272572f06fbd:

  Prepare v2015.07-rc3 (2015-06-29 17:22:01 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to
af6da69f47314e0e8efa3711ffadbfda8d2334aa:

  board: axs103 - add maintainer information (2015-07-01 17:19:33
+0300)


Alexey Brodkin (3):
  arc: implement slave cores kick-start for Linux kernel
  arc: significant cache rework
  board: axs103 - add maintainer information

 arch/arc/include/asm/arcregs.h|   5 +-
 arch/arc/include/asm/cache.h  |   7 +-
 arch/arc/lib/bootm.c  |   6 ++
 arch/arc/lib/cache.c  | 375
+++

 arch/arc/lib/cpu.c|   2 +
 arch/arc/lib/init_helpers.c   |  10 +-
 arch/arc/lib/start.S  |  46 --
 board/synopsys/axs101/MAINTAINERS |   1 +
 board/synopsys/axs101/axs101.c|  30 ++
 9 files changed, 337 insertions(+), 145 deletions(-)

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: implement slave cores kick-start for Linux kernel

2015-07-01 Thread Alexey Brodkin
With new SMP-enabled CPUs with ARC HS38 cores and corresponding support
in Linux kernel it's required to add basic SMP support in U-Boot.

Currently we assume the one and only core starts execution after
power-on. So most of things in U-Boot is handled in UP mode.

But when U-Boot is used for loading and starting Linux kernel right
before jumping to kernel's entry point U-Boot:
 [1] Sets all slave cores to jump to the same address [kernel's entry
point]
 [2] Really starts all slav cores

In ARC's implemetation of SMP in Linux kernel all cores are supposed to
run the same start-up code. But only core with ID 0 (master core)
processes further while others are looping waiting for master core to
complete some initialization.

That means it's safe to un-pause slave cores and let them execute kernel
- they will wait for master anyway.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Vineet Gupta vgu...@synopsys.com
---
 arch/arc/lib/bootm.c   |  6 ++
 board/synopsys/axs101/axs101.c | 30 ++
 2 files changed, 36 insertions(+)

diff --git a/arch/arc/lib/bootm.c b/arch/arc/lib/bootm.c
index d185a50..04d9d9c 100644
--- a/arch/arc/lib/bootm.c
+++ b/arch/arc/lib/bootm.c
@@ -53,6 +53,9 @@ static void boot_prep_linux(bootm_headers_t *images)
hang();
 }
 
+__weak void smp_set_core_boot_addr(unsigned long addr, int corenr) {}
+__weak void smp_kick_all_cpus(void) {}
+
 /* Subcommand: GO */
 static void boot_jump_linux(bootm_headers_t *images, int flag)
 {
@@ -80,6 +83,9 @@ static void boot_jump_linux(bootm_headers_t *images, int flag)
r2 = (unsigned int)getenv(bootargs);
}
 
+   smp_set_core_boot_addr((unsigned long)kernel_entry, -1);
+   smp_kick_all_cpus();
+
if (!fake)
kernel_entry(r0, 0, r2);
 }
diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index 8c16410..d4280f7 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -56,3 +56,33 @@ int board_early_init_f(void)
 
return 0;
 }
+
+#ifdef CONFIG_ISA_ARCV2
+#define RESET_VECTOR_ADDR  0x0
+
+void smp_set_core_boot_addr(unsigned long addr, int corenr)
+{
+   /* All cores have reset vector pointing to 0 */
+   writel(addr, (void __iomem *)RESET_VECTOR_ADDR);
+
+   /* Make sure other cores see written value in memory */
+   flush_dcache_range(RESET_VECTOR_ADDR, RESET_VECTOR_ADDR + sizeof(int));
+}
+
+void smp_kick_all_cpus(void)
+{
+/* CPU start CREG */
+#define AXC003_CREG_CPU_START  0xF0001400
+
+/* Bits positions in CPU start CREG */
+#define BITS_START 0
+#define BITS_POLARITY  8
+#define BITS_CORE_SEL  9
+#define BITS_MULTICORE 12
+
+#define CMD(1  BITS_MULTICORE) | (1  BITS_CORE_SEL) | \
+   (1  BITS_POLARITY) | (1  BITS_START)
+
+   writel(CMD, (void __iomem *)AXC003_CREG_CPU_START);
+}
+#endif
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM status or maintainer info currently missing

2015-07-01 Thread Alexey Brodkin
Hi Albert,

On Wed, 2015-07-01 at 15:13 +0200, Albert ARIBAUD wrote:
 Hello all,
 
 I get the following when building current u-boot-arm/master with
 current u-boot/master:
 
 * WARNING: no status info for 'am43xx_evm_ethboot' 
 * WARNING: no maintainers for 'am43xx_evm_ethboot' 
   WARNING: no status info for 'cairo' 
   WARNING: no maintainers for 'cairo' 
   WARNING: no status info for 'axs103' 
   WARNING: no maintainers for 'axs103' 
   WARNING: no status info for 'socfpga_arria5' 
   WARNING: no maintainers for 'socfpga_arria5' 
   WARNING: no status info for 'at91sam9rlek_mmc' 
   WARNING: no maintainers for 'at91sam9rlek_mmc' 
   WARNING: no status info for 'odroid-xu3' 
   WARNING: no maintainers for 'odroid-xu3' 
 * WARNING: no status info for 'am335x_baltos' 
 * WARNING: no maintainers for 'am335x_baltos' 
 * WARNING: no status info for 'am43xx_evm_usbhost_boot' 
 * WARNING: no maintainers for 'am43xx_evm_usbhost_boot' 
   WARNING: no status info for 'at91sam9g20ek_2mmc' 
   WARNING: no maintainers for 'at91sam9g20ek_2mmc' 
   WARNING: no status info for 'db-88f6820-gp' 
   WARNING: no maintainers for 'db-88f6820-gp' 
 
 * means warning is new in mainline.
 
 In most cases, the board's MAINTAINERS file also lacks an 'F:' entry 
 for
 the board's defconfig -- or the board is lacking a MAINTAINERS file
 entirely.

I'l add an entry for axs103.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: axs103 - add mainteiner information

2015-07-01 Thread Alexey Brodkin
Looks like I forgot to add myself as a maintainer for AXS103 defconfig.
Fixing this now.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 board/synopsys/axs101/MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/board/synopsys/axs101/MAINTAINERS 
b/board/synopsys/axs101/MAINTAINERS
index 481bbcc..79fff8e 100644
--- a/board/synopsys/axs101/MAINTAINERS
+++ b/board/synopsys/axs101/MAINTAINERS
@@ -4,3 +4,4 @@ S:  Maintained
 F: board/synopsys/axs101/
 F: include/configs/axs101.h
 F: configs/axs101_defconfig
+F: configs/axs103_defconfig
-- 
2.4.3

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arc: significant cache rework

2015-07-01 Thread Alexey Brodkin
On Wed, 2015-07-01 at 17:15 +0300, Alexey Brodkin wrote:
 From: Alexey Brodkin alexey.brod...@synopsys.com
 
 [1] Align cache management functions to those in Linux kernel. I.e.:
 a) Use the same functions for all cache ops (D$ Inv/Flush)
 b) Split cache ops in 3 sub-functions: before, lineloop and
 after. That way we may re-use before and after functions for
 region and full cache ops.
 
  [2] Implement full-functional L2 (SLC) management. Before SLC was
 simply disabled early on boot. If SLC exists corresponding ops are 
 run on cache
 flush/invalidate.
 
  [3] Disable/enable corresponding caches early on boot. So if U-Boot 
 is
 configured to use caches they will be used at all times (this is 
 useful
 in particular for speed-up of relocation).
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 ---
 Compared to v1:
  * Remove explicit selection of L2CACHE on/off in Kconfig, check this 
 in runtime
and use L2 ops only when L2 is detected.
This allows run the same executable on HW with and without L2 
 cache.
 ---
  arch/arc/include/asm/arcregs.h |   5 +-
  arch/arc/include/asm/cache.h   |   7 +-
  arch/arc/lib/cache.c   | 375 ---
 --
  arch/arc/lib/cpu.c |   2 +
  arch/arc/lib/init_helpers.c|  10 +-
  arch/arc/lib/start.S   |  46 -
  6 files changed, 300 insertions(+), 145 deletions(-)

Applied, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: implement slave cores kick-start for Linux kernel

2015-07-01 Thread Alexey Brodkin
On Wed, 2015-07-01 at 17:03 +0300, Alexey Brodkin wrote:
 With new SMP-enabled CPUs with ARC HS38 cores and corresponding 
 support
 in Linux kernel it's required to add basic SMP support in U-Boot.
 
 Currently we assume the one and only core starts execution after
 power-on. So most of things in U-Boot is handled in UP mode.
 
 But when U-Boot is used for loading and starting Linux kernel right
 before jumping to kernel's entry point U-Boot:
  [1] Sets all slave cores to jump to the same address [kernel's entry
 point]
  [2] Really starts all slav cores
 
 In ARC's implemetation of SMP in Linux kernel all cores are supposed 
 to
 run the same start-up code. But only core with ID 0 (master core)
 processes further while others are looping waiting for master core to
 complete some initialization.
 
 That means it's safe to un-pause slave cores and let them execute 
 kernel
 - they will wait for master anyway.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Vineet Gupta vgu...@synopsys.com
 ---
  arch/arc/lib/bootm.c   |  6 ++
  board/synopsys/axs101/axs101.c | 30 ++
  2 files changed, 36 insertions(+)

Applied, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net/designware: revert MAC-address setup on init

2015-07-01 Thread Alexey Brodkin
Hi Tom, Joe,

On Wed, 2015-07-01 at 22:22 +0800, Bin Meng wrote:
 Hi Alexey,
 
 On Wed, Jul 1, 2015 at 9:59 PM, Alexey Brodkin
 alexey.brod...@synopsys.com wrote:
  http://git.denx.de/?p=u
  -boot.git;a=patch;h=f566c9949fbdce2e09a900c5343ca9986e5ba360
  broke DW GMAC operation if !DM_ETH because eth_write_hwaddr() 
  doesn't
  exist if !DM_NET.
  
  As for DM_ETH case I'm still not sure if existing implementation 
  will
  fly.
  
  The point is as it is said in the comment on soft reset that is
  triggered with setting DMAMAC_SRST in busmode register HW address 
  gets
  reset as well. And we inevitably need to set HW address again.
  
  So probably better solution is to move mentioned soft-reset from
  init (that is used on start of any network activity) to 
  initialize
  (which is only executed once in board_r sequence). But that's a 
  bit of
  a different story and for now let's just get DW GMAC functional 
  again.
  
  Signed-off-by: Alexey Brodkin abrod...@synopsys.com
  Cc: Joe Hershberger joe.hershber...@ni.com
  Cc: Michal Simek michal.si...@xilinx.com
  Cc: Tom Rini tr...@konsulko.com
  ---
   drivers/net/designware.c | 4 
   1 file changed, 4 insertions(+)
  
  diff --git a/drivers/net/designware.c b/drivers/net/designware.c
  index ae51cf3..07281a6 100644
  --- a/drivers/net/designware.c
  +++ b/drivers/net/designware.c
  @@ -243,6 +243,10 @@ static int _dw_eth_init(struct dw_eth_dev 
  *priv, u8 *enetaddr)
  mdelay(100);
  };
  
  +   /* Soft reset above clears HW address registers.
  +* So we have to set it here once again */
  +   _dw_write_hwaddr(priv, enetaddr);
  +
  rx_descs_init(priv);
  tx_descs_init(priv);
  
  --
 
 There is already a patch submitted. Please check
 http://patchwork.ozlabs.org/patch/484214/

Any chance for mentioned patch net: designware: Program MAC address to
hardware after soft reset to be applied?

This really fixes GMAC operation and it would be nice to have this fix
in upcoming release.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] arc: significant cache rework

2015-07-01 Thread Alexey Brodkin
From: Alexey Brodkin alexey.brod...@synopsys.com

[1] Align cache management functions to those in Linux kernel. I.e.:
a) Use the same functions for all cache ops (D$ Inv/Flush)
b) Split cache ops in 3 sub-functions: before, lineloop and
after. That way we may re-use before and after functions for
region and full cache ops.

 [2] Implement full-functional L2 (SLC) management. Before SLC was
simply disabled early on boot. If SLC exists corresponding ops are run on cache
flush/invalidate.

 [3] Disable/enable corresponding caches early on boot. So if U-Boot is
configured to use caches they will be used at all times (this is useful
in particular for speed-up of relocation).

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
Compared to v1:
 * Remove explicit selection of L2CACHE on/off in Kconfig, check this in runtime
   and use L2 ops only when L2 is detected.
   This allows run the same executable on HW with and without L2 cache.
---
 arch/arc/include/asm/arcregs.h |   5 +-
 arch/arc/include/asm/cache.h   |   7 +-
 arch/arc/lib/cache.c   | 375 -
 arch/arc/lib/cpu.c |   2 +
 arch/arc/lib/init_helpers.c|  10 +-
 arch/arc/lib/start.S   |  46 -
 6 files changed, 300 insertions(+), 145 deletions(-)

diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 0e11dcc..667f218 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -47,9 +47,12 @@
 #endif
 #define ARC_BCR_DC_BUILD   0x72
 #define ARC_BCR_SLC0xce
-#define ARC_AUX_SLC_CONTROL0x903
+#define ARC_AUX_SLC_CONFIG 0x901
+#define ARC_AUX_SLC_CTRL   0x903
 #define ARC_AUX_SLC_FLUSH  0x904
 #define ARC_AUX_SLC_INVALIDATE 0x905
+#define ARC_AUX_SLC_IVDL   0x910
+#define ARC_AUX_SLC_FLDL   0x912
 
 #ifndef __ASSEMBLY__
 /* Accessors for auxiliary registers */
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 0b3ebd9..432606a 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -29,12 +29,7 @@
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_ISA_ARCV2
-void slc_enable(void);
-void slc_disable(void);
-void slc_flush(void);
-void slc_invalidate(void);
-#endif
+void cache_init(void);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index e369e5a..ed8e8e7 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -5,9 +5,13 @@
  */
 
 #include config.h
+#include linux/compiler.h
+#include linux/kernel.h
 #include asm/arcregs.h
 #include asm/cache.h
 
+#define CACHE_LINE_MASK(~(CONFIG_SYS_CACHELINE_SIZE - 1))
+
 /* Bit values in IC_CTRL */
 #define IC_CTRL_CACHE_DISABLE  (1  0)
 
@@ -18,60 +22,186 @@
 #define CACHE_VER_NUM_MASK 0xF
 #define SLC_CTRL_SB(1  2)
 
+#define OP_INV 0x1
+#define OP_FLUSH   0x2
+#define OP_INV_IC  0x3
+
+#ifdef CONFIG_ISA_ARCV2
+/*
+ * By default that variable will fall into .bss section.
+ * But .bss section is not relocated and so it will be initilized before
+ * relocation but will be used after being zeroed.
+ */
+int slc_line_sz __section(.data);
+int slc_exists __section(.data);
+
+static unsigned int __before_slc_op(const int op)
+{
+   unsigned int reg = reg;
+
+   if (op == OP_INV) {
+   /*
+* IM is set by default and implies Flush-n-inv
+* Clear it here for vanilla inv
+*/
+   reg = read_aux_reg(ARC_AUX_SLC_CTRL);
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg  ~DC_CTRL_INV_MODE_FLUSH);
+   }
+
+   return reg;
+}
+
+static void __after_slc_op(const int op, unsigned int reg)
+{
+   if (op  OP_FLUSH)  /* flush / flush-n-inv both wait */
+   while (read_aux_reg(ARC_AUX_SLC_CTRL) 
+  DC_CTRL_FLUSH_STATUS)
+   ;
+
+   /* Switch back to default Invalidate mode */
+   if (op == OP_INV)
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg | DC_CTRL_INV_MODE_FLUSH);
+}
+
+static inline void __slc_line_loop(unsigned long paddr, unsigned long sz,
+  const int op)
+{
+   unsigned int aux_cmd;
+   int num_lines;
+
+#define SLC_LINE_MASK  (~(slc_line_sz - 1))
+
+   aux_cmd = op  OP_INV ? ARC_AUX_SLC_IVDL : ARC_AUX_SLC_FLDL;
+
+   sz += paddr  ~SLC_LINE_MASK;
+   paddr = SLC_LINE_MASK;
+
+   num_lines = DIV_ROUND_UP(sz, slc_line_sz);
+
+   while (num_lines--  0) {
+   write_aux_reg(aux_cmd, paddr);
+   paddr += slc_line_sz;
+   }
+}
+
+static inline void __slc_entire_op(const int cacheop)
+{
+   int aux;
+   unsigned int ctrl_reg = __before_slc_op(cacheop);
+
+   if (cacheop  OP_INV)   /* Inv or flush-n-inv use same cmd reg */
+   aux = ARC_AUX_SLC_INVALIDATE;
+   else
+   aux = ARC_AUX_SLC_FLUSH;
+
+   write_aux_reg(aux, 0x1

Re: [U-Boot] [PATCH] arc: gitignore: ignore ARC DTBs

2015-05-18 Thread Alexey Brodkin
Hello Masahiro-san,

On Thu, 2015-05-14 at 18:59 +0900, Masahiro Yamada wrote:
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---
 
  arch/arc/dts/.gitignore | 1 +
  1 file changed, 1 insertion(+)
  create mode 100644 arch/arc/dts/.gitignore
 
 diff --git a/arch/arc/dts/.gitignore b/arch/arc/dts/.gitignore
 new file mode 100644
 index 000..b60ed20
 --- /dev/null
 +++ b/arch/arc/dts/.gitignore
 @@ -0,0 +1 @@
 +*.dtb

Applied,
Thanks!

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: significant cache rework

2015-05-18 Thread Alexey Brodkin
 [1] Align cache management functions to those in Linux kernel. I.e.:
a) Use the same functions for all cache ops (D$ Inv/Flush)
b) Split cache ops in 3 sub-functions: before, lineloop and
after. That way we may re-use before and after functions for
region and full cache ops.

 [2] Implement full-functional L2 (SLC) management. Before SLC was
simply disabled early on boot. It's also possible to enable or disable
L2 cache from config utility.

 [3] Disable/enable corresponding caches early on boot. So if U-Boot is
configured to use caches they will be used at all times (this is useful
in partucular for speed-up of relocation).

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/Kconfig   |  10 ++
 arch/arc/include/asm/arcregs.h |   5 +-
 arch/arc/include/asm/cache.h   |   7 +-
 arch/arc/lib/cache.c   | 378 -
 arch/arc/lib/cpu.c |   2 +
 arch/arc/lib/init_helpers.c|  10 +-
 arch/arc/lib/start.S   |  50 +-
 7 files changed, 317 insertions(+), 145 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 67d28d3..a8f82b1 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -130,6 +130,16 @@ config ARC_CACHE_LINE_SHIFT
  So line lengths of 32, 64, 128 are specified by 5,6,7, respectively
  Linux only supports same line lengths for I and D caches.
 
+config SYS_L2CACHE_OFF
+   bool Do not use L2 cache (AKA System-Level Cache, SLC)
+   default n
+   depends on ISA_ARCV2
+   depends on !SYS_DCACHE_OFF
+   help
+ ARC cores based on ISAv2 may have L2 cache, also known as SLC
+ (System-Level Cache).
+ Select this option to disable usage of L2 cache completely.
+
 choice
prompt Target select
optional
diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 0e11dcc..667f218 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -47,9 +47,12 @@
 #endif
 #define ARC_BCR_DC_BUILD   0x72
 #define ARC_BCR_SLC0xce
-#define ARC_AUX_SLC_CONTROL0x903
+#define ARC_AUX_SLC_CONFIG 0x901
+#define ARC_AUX_SLC_CTRL   0x903
 #define ARC_AUX_SLC_FLUSH  0x904
 #define ARC_AUX_SLC_INVALIDATE 0x905
+#define ARC_AUX_SLC_IVDL   0x910
+#define ARC_AUX_SLC_FLDL   0x912
 
 #ifndef __ASSEMBLY__
 /* Accessors for auxiliary registers */
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 0b3ebd9..432606a 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -29,12 +29,7 @@
 
 #ifndef __ASSEMBLY__
 
-#ifdef CONFIG_ISA_ARCV2
-void slc_enable(void);
-void slc_disable(void);
-void slc_flush(void);
-void slc_invalidate(void);
-#endif
+void cache_init(void);
 
 #endif /* __ASSEMBLY__ */
 
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index e369e5a..3184803 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -5,9 +5,13 @@
  */
 
 #include config.h
+#include linux/compiler.h
+#include linux/kernel.h
 #include asm/arcregs.h
 #include asm/cache.h
 
+#define CACHE_LINE_MASK(~(CONFIG_SYS_CACHELINE_SIZE - 1))
+
 /* Bit values in IC_CTRL */
 #define IC_CTRL_CACHE_DISABLE  (1  0)
 
@@ -18,60 +22,193 @@
 #define CACHE_VER_NUM_MASK 0xF
 #define SLC_CTRL_SB(1  2)
 
+#define OP_INV 0x1
+#define OP_FLUSH   0x2
+#define OP_INV_IC  0x3
+
+#ifdef CONFIG_ISA_ARCV2
+/*
+ * By default that variable will fall into .bss section.
+ * But .bss section is not relocated and so it will be initilized before
+ * relocation but will be used after being zeroed.
+ */
+int slc_line_sz __section(.data);
+
+static inline int slc_exists(void)
+{
+   /* Check if System-Level Cahce is available */
+   if (read_aux_reg(ARC_BCR_SLC)  CACHE_VER_NUM_MASK)
+   return 1;
+   else
+   return 0;
+}
+
+#ifndef CONFIG_SYS_L2CACHE_OFF
+static unsigned int __before_slc_op(const int op)
+{
+   unsigned int reg = reg;
+
+   if (op == OP_INV) {
+   /*
+* IM is set by default and implies Flush-n-inv
+* Clear it here for vanilla inv
+*/
+   reg = read_aux_reg(ARC_AUX_SLC_CTRL);
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg  ~DC_CTRL_INV_MODE_FLUSH);
+   }
+
+   return reg;
+}
+
+static void __after_slc_op(const int op, unsigned int reg)
+{
+   if (op  OP_FLUSH)  /* flush / flush-n-inv both wait */
+   while (read_aux_reg(ARC_AUX_SLC_CTRL) 
+  DC_CTRL_FLUSH_STATUS)
+   ;
+
+   /* Switch back to default Invalidate mode */
+   if (op == OP_INV)
+   write_aux_reg(ARC_AUX_SLC_CTRL, reg | DC_CTRL_INV_MODE_FLUSH);
+}
+
+static inline void __slc_line_loop(unsigned long paddr, unsigned long sz,
+  const int op)
+{
+   unsigned int aux_cmd;
+   int num_lines

[U-Boot] please pull u-boot-arc master

2015-05-18 Thread Alexey Brodkin
Hi Tom,

The following changes since commit 3bfe3ce2a6e3b04da1d04dbc0520dcc26e17f98a:

  MAINTAINERS, git-mailrc: Update Jagan's name and e-mail (2015-05-16 07:34:26 
-0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to 0744c2f1ad082a4d9ac38084b8f3ac84cc012d05:

  arc: gitignore: ignore ARC DTBs (2015-05-18 12:06:36 +0300)


Masahiro Yamada (1):
  arc: gitignore: ignore ARC DTBs

 arch/arc/dts/.gitignore | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 arch/arc/dts/.gitignore

Regards,
Alexey


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] pritnf() in arch_cpu_init()

2015-05-18 Thread Alexey Brodkin
Hi Simon,

I was looking at how to output error message from very early init and
found IMHO senseless code in arch/x86/cpu/coreboot/coreboot.c:
8--
int arch_cpu_init(void)
{
int ret = get_coreboot_info(lib_sysinfo);
if (ret != 0) {
printf(Failed to parse coreboot tables.\n);
return ret;
}
8--

The problem here is arch_cpu_init() executed much earlier compared to
serial/console init, refer to init_sequence_f:
8--
line 764:   arch_cpu_init,
...
line 807:   serial_init,/* serial communications setup */
console_init_f, /* stage 1 init of console */
8--

So printf() output is only available in pre-console buffer if
CONFIG_PRE_CONSOLE_BUFFER is configured. Otherwise CPU will end up in
halt before anything gets printed to console.

I would propose to create a special very-early flavour of printf() which
is only built if pre-console buffer is configured. That way we:

 [1] By default get rid of printf() in early CPU init code that might as
well be used in SPL build (so there will be no extra dependency on
pritnf/console)

 [2] Save some space in memory footprint with removal of the string.

I'm pretty sure there're more places when printf() is used before
console gets initialized but let's first discuss it with this particular
example.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] arc: use more universal prefix for default CROSS_COMPILE

2015-05-13 Thread Alexey Brodkin
Hello Masahiro-san,

On Wed, 2015-05-13 at 18:49 +0900, Masahiro Yamada wrote:
 As doc/README.ARC says, pre-build ARC toolchains are available at
 the Synopsys GitHub page.
 
 The bin files are prefixed with arc(eb)-buildroot-linux- for earlier
 releases, but with arc(eb)-snps-linux- for the latest releases.
 
 The symbolic links prefixed with arc(eb)-linux- are also available
 for all the release, so those prefixes can be used as the default
 CROSS_COMPILE regardless of the toolchains version/variants.
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---
 
 Changes in v2:
   - Use arc(eb)-linux- rather than arc(eb)-linux-uclibc-

Applied!

Thanks,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: remove dummy target

2015-05-13 Thread Alexey Brodkin
TARGET_DUMMY was introduced to resolve the same problem as commit
arch: Make board selection choices optional
http://git.denx.de/?p=u-boot.git;a=commit;h=a26cd04920dc069fd6e91abb785426cf6c29f45f

Latter implementation is much cleaner and appropriate.

And anyways TARGET_DUMMY is no longer required.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Joe Hershberger joe.hershber...@ni.com
---
 arch/arc/Kconfig | 8 
 1 file changed, 8 deletions(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 85fddd2..67d28d3 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -134,14 +134,6 @@ choice
prompt Target select
optional
 
-config TARGET_DUMMY
-   bool Dummy target
-   help
- Please select one of real target boards below!
- This target is only meant to force makedefconfig to put
- TARGET_xxx in defconfig even this is the first target from the list
- below.
-
 config TARGET_TB100
bool Support tb100
 
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARC: change the default CROSS_COMPILE for ARC

2015-05-13 Thread Alexey Brodkin
Hello Masahiro-san,

On Mon, 2015-05-11 at 19:42 +0900, Masahiro Yamada wrote:
 As doc/README.ARC says, pre-build ARC toolchains are available at
 the Synopsys GitHub page.
 
 The bin files are prefixed with arc(eb)-buildroot-linux- for earlier
 releases, but with arc(eb)-snps-linux- for the latest releases
 (arc_gnu_2014.12_prebuilt_*).
 
 For all the releases, the symbolic link, arc(eb)-linux-* is also
 prepared for each bin file, so it can be used as the default
 CROSS_COMPILE regardless of the toolchains version.
 
 Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
 ---
 
  arch/arc/config.mk | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/arch/arc/config.mk b/arch/arc/config.mk
 index 04c034b..9aed147 100644
 --- a/arch/arc/config.mk
 +++ b/arch/arc/config.mk
 @@ -11,13 +11,13 @@ CONFIG_SYS_BIG_ENDIAN = 1
  endif
  
  ifdef CONFIG_SYS_LITTLE_ENDIAN
 -ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc-
 +ARC_CROSS_COMPILE := arc-linux-uclibc-
  PLATFORM_LDFLAGS += -EL
  PLATFORM_CPPFLAGS += -mlittle-endian
  endif
  
  ifdef CONFIG_SYS_BIG_ENDIAN
 -ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc-
 +ARC_CROSS_COMPILE := arceb-linux-uclibc-
  PLATFORM_LDFLAGS += -EB
  PLATFORM_CPPFLAGS += -mbig-endian
  endif

I would propose to use even simpler and more universal prefix which
could be used with both ARC pre-built toolchains, your own toolchain
built by Buildroot or even pre-built Buildroot toolchain
(http://autobuild.buildroot.org/toolchains/tarballs/br-arcle-hs38-full-2015.02.tar.bz2):
 [1] arc-linux- for little-endian
 [2] arceb-linux-

Care to re-send your patch or I may do that change myself?

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: remove dummy target

2015-05-13 Thread Alexey Brodkin
On Wed, 2015-05-13 at 13:50 +0300, Alexey Brodkin wrote:
 TARGET_DUMMY was introduced to resolve the same problem as commit
 arch: Make board selection choices optional
 http://git.denx.de/?p=u-boot.git;a=commit;h=a26cd04920dc069fd6e91abb785426cf6c29f45f
 
 Latter implementation is much cleaner and appropriate.
 
 And anyways TARGET_DUMMY is no longer required.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Joe Hershberger joe.hershber...@ni.com
 ---
  arch/arc/Kconfig | 8 
  1 file changed, 8 deletions(-)
 
 diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
 index 85fddd2..67d28d3 100644
 --- a/arch/arc/Kconfig
 +++ b/arch/arc/Kconfig
 @@ -134,14 +134,6 @@ choice
   prompt Target select
   optional
  
 -config TARGET_DUMMY
 - bool Dummy target
 - help
 -   Please select one of real target boards below!
 -   This target is only meant to force makedefconfig to put
 -   TARGET_xxx in defconfig even this is the first target from the list
 -   below.
 -
  config TARGET_TB100
   bool Support tb100
  

Applied,
Thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] please pull u-boot-arc master

2015-05-13 Thread Alexey Brodkin
Hi Tom,

The following changes since commit bd328eb38274ffaf04caaa8a6ecc09b7e19a650e:

  Clean all defconfigs with savedefconfig (2015-05-12 18:10:26 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to 4e31e5676f0158119783def2ab9851b6bc7e6648:

  arc: remove dummy target (2015-05-13 19:20:35 +0300)


Alexey Brodkin (1):
  arc: remove dummy target

Masahiro Yamada (1):
  arc: use more universal prefix for default CROSS_COMPILE

 arch/arc/Kconfig   | 8 
 arch/arc/config.mk | 4 ++--
 2 files changed, 2 insertions(+), 10 deletions(-)

Regards,
Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: axs10x - support v3 mother-board

2015-04-09 Thread Alexey Brodkin
There're 2 versions of motherboards that could be used in ARC SDP.
The only important difference for U-Boot is different NAND IC in use:
 [1] v2 board (we used to support up until now) sports MT29F4G08ABADAWP
while
 [2] v3 board sports MT29F4G16ABADAWP

They are almost the same except data bus width 8-bit in [1] and 16-bit
in [2]. And for proper support of 16-bit data bus we have to pass
NAND_BUSWIDTH_16 option to NAND driver core - which we do now knowing
board type we're running on.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 board/synopsys/axs101/axs101.c | 14 ++
 board/synopsys/axs101/axs10x.h | 16 
 board/synopsys/axs101/nand.c   |  7 +++
 include/configs/axs101.h   |  6 ++
 4 files changed, 43 insertions(+)
 create mode 100644 board/synopsys/axs101/axs10x.h

diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index 7742049..8c16410 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -9,6 +9,7 @@
 #include malloc.h
 #include netdev.h
 #include phy.h
+#include axs10x.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -42,3 +43,16 @@ int board_eth_init(bd_t *bis)
 
return 0;
 }
+
+
+#define AXS_MB_CREG0xE0011000
+
+int board_early_init_f(void)
+{
+   if (readl((void __iomem *)AXS_MB_CREG + 0x234)  (1  28))
+   gd-board_type = AXS_MB_V3;
+   else
+   gd-board_type = AXS_MB_V2;
+
+   return 0;
+}
diff --git a/board/synopsys/axs101/axs10x.h b/board/synopsys/axs101/axs10x.h
new file mode 100644
index 000..8e8c41f
--- /dev/null
+++ b/board/synopsys/axs101/axs10x.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _BOARD_SYNOPSYS_AXS10X_H
+#define _BOARD_SYNOPSYS_AXS10X_H
+
+enum {
+   AXS_MB_V2,
+   AXS_MB_V3
+};
+
+#endif /* _BOARD_SYNOPSYS_AXS10X_H */
+
diff --git a/board/synopsys/axs101/nand.c b/board/synopsys/axs101/nand.c
index ff35286..4be52e2 100644
--- a/board/synopsys/axs101/nand.c
+++ b/board/synopsys/axs101/nand.c
@@ -9,6 +9,9 @@
 #include malloc.h
 #include nand.h
 #include asm/io.h
+#include axs10x.h
+
+DECLARE_GLOBAL_DATA_PTR;
 
 #define BUS_WIDTH  8   /* AXI data bus width in bytes  */
 
@@ -232,5 +235,9 @@ int board_nand_init(struct nand_chip *nand)
nand-write_buf = axs101_nand_write_buf;
nand-read_buf = axs101_nand_read_buf;
 
+   /* MBv3 has NAND IC with 16-bit data bus */
+   if (gd-board_type == AXS_MB_V3)
+   nand-options |= NAND_BUSWIDTH_16;
+
return 0;
 }
diff --git a/include/configs/axs101.h b/include/configs/axs101.h
index 5fb8aca..8a7095c 100644
--- a/include/configs/axs101.h
+++ b/include/configs/axs101.h
@@ -34,6 +34,12 @@
 #define CONFIG_SYS_LOAD_ADDR   0x8200
 
 /*
+ * This board might be of different versions so handle it
+ */
+#define CONFIG_BOARD_TYPES
+#define CONFIG_BOARD_EARLY_INIT_F
+
+/*
  * NAND Flash configuration
  */
 #define CONFIG_SYS_NO_FLASH
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] sun9i target support in u-boot?

2015-04-06 Thread Alexey Brodkin
Hello Alexander,

On Sun, 2015-04-05 at 22:41 -0500, kallisti5 wrote:
 Good evening!
 
 I'm looking at a port of Haiku (haiku-os.org) to the A80 cubieboard4.
 I can't seem to figure out their u-boot from SD card process.
 
 Is there sun9i support in your branch / mainline?
 
 
 kallisti5@eris ~ :) $ cat allwinner-bless.sh
 #!/bin/bash
 
 wget 
 https://github.com/cubieboard/CC-A80-binaries/raw/master/bin/u-boot-spl.bin; 
 -O /tmp/boot0
 wget 
 https://github.com/cubieboard/CC-A80-binaries/raw/master/bin/u-boot-sun9iw1p1.bin;
  
 -O /tmp/boot1
 
 dd if=/tmp/boot0 of=$1 bs=1024 seek=8
 dd if=/tmp/boot1 of=$1 bs=1024 seek=19096

Unfortunately I have almost nothing to do with U-Boot on Cubieboards.
For more info please refer to http://linux-sunxi.org/U-Boot

If your problem still stays unsolved I would recommend you to continue
discussion on U-Boot mailing list (already CCed).

Also I'm adding in CC Hans de Goede who's one of maintainers of U-Boot
port for Sunxi.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] please pull u-boot-arc master

2015-04-03 Thread Alexey Brodkin
Dear Tom,

The following changes since commit
8a5c9ca4d0b8aa13a1bb321494d24f656a9a7d72:

  Prepare v2015.04-rc5 (2015-03-31 20:53:59 -0400)

are available in the git repository at:

  git://git.denx.de/u-boot-arc.git 

for you to fetch changes up to d5717e894497124fd44289a37f818ee301640c70:

  board: AXS10x - update SDIO clock value (2015-04-03 09:47:50 +0300)


Alexey Brodkin (12):
  serial/serial_arc: set registers address during compilation
  arc: cache - build invalidate_icache_all() and
invalidate_dcache_all() always
  arc: merge common start-up code between ARC and ARCv2
  arc: move low-level interrupt and exception handlers in a separate
file
  arc: clean-up init procedure
  arc: re-generate defconfigs
  arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA
  arc: minor fixes in Kconfig
  serial-arc: switch to DM
  board: Switch Abilis TB-100 board to Driver Model for serial port
  arc: add support for SLC (System Level Cache, AKA L2-cache)
  board: AXS10x - update SDIO clock value

 arch/Kconfig|   1 +
 arch/arc/Kconfig|  10 ++-
 arch/arc/cpu/arcv1/Makefile |   2 +-
 arch/arc/cpu/arcv1/ivt.S|  27 
 arch/arc/cpu/arcv1/start.S  | 254
--
 arch/arc/cpu/arcv2/Makefile |   2 +-
 arch/arc/cpu/arcv2/ivt.S|  27 
 arch/arc/cpu/arcv2/start.S  | 254
--
 arch/arc/dts/Makefile   |  12 
 arch/arc/dts/abilis_tb100.dts   |  24 +++
 arch/arc/dts/arcangel4.dts  |  24 +++
 arch/arc/dts/skeleton.dtsi  |  13 
 arch/arc/include/asm/arcregs.h  |   4 ++
 arch/arc/include/asm/cache.h|  11 
 arch/arc/include/asm/config.h   |   1 -
 arch/arc/include/asm/init_helpers.h |  12 
 arch/arc/include/asm/relocate.h |  16 +
 arch/arc/include/asm/u-boot-arc.h   |   3 +
 arch/arc/lib/Makefile   |   3 +
 arch/arc/lib/cache.c|  58 +++--
 arch/arc/lib/cpu.c  |  13 
 arch/arc/lib/init_helpers.c |  25 
 arch/arc/lib/ints_low.S | 151

 arch/arc/lib/relocate.c |  19 ++
 arch/arc/lib/start.S|  63 +++
 board/synopsys/axs101/axs101.c  |   4 +-
 common/board_f.c|   8 +--
 configs/arcangel4-be_defconfig  |   9 ++-
 configs/arcangel4_defconfig |   7 ++-
 configs/axs101_defconfig|   6 +-
 configs/axs103_defconfig|   4 +-
 configs/tb100_defconfig |   9 ++-
 drivers/serial/serial_arc.c | 103
--
 include/configs/tb100.h |   6 +-
 34 files changed, 602 insertions(+), 583 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 delete mode 100644 arch/arc/cpu/arcv1/start.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 create mode 100644 arch/arc/dts/Makefile
 create mode 100644 arch/arc/dts/abilis_tb100.dts
 create mode 100644 arch/arc/dts/arcangel4.dts
 create mode 100644 arch/arc/dts/skeleton.dtsi
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c
 create mode 100644 arch/arc/lib/ints_low.S
 create mode 100644 arch/arc/lib/start.S

Regards,
Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/7] arc: cache - build invalidate_icache_all() and invalidate_dcache_all() always

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Make both invalidate_icache_all() and invalidate_dcache_all() available
 even if U-Boot is configured with CONFIG_SYS_DCACHE_OFF and/or
 CONFIG_SYS_ICACHE_OFF.
 
 This is useful because configuration of U-Boot may not match actual
 hardware features. Real board may have cache(s) but for some reason we
 may want to run U-Boot with cache(s) disabled (for example if some
 peripherals work improperly with existing drivers if data cache is
 enabled). So board may start with cache(s) enabled (that's the case for
 ARC cores with built-in caches) but early in U-Boot we disable cache(s)
 and make sure all contents of data cache gets flushed in RAM.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] arc: move low-level interrupt and exception handlers in a separate file

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 This separation makes maintenance of code easier because those low-level
 interrupt- or exception handling routines are pretty static and usually
 require not much care while start-up code is a subject of modifications
 and enhancements.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/7] arc: merge common start-up code between ARC and ARCv2

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Even though ARCompact and ARCv2 are not binary compatible most of
 assembly instructions are used in both. With this change we'll get rid
 of duplicate code.
 
 Still IVTs are implemented differently so we're keeping them in separate
 files.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 ---

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/7] arc: clean-up init procedure

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Intention behind this work was elimination of as much assembly-written
 code as it is possible.
 
 In case of ARC we already have relocation fix-up implemented in C so why
 don't we use C for U-Boot copying, .bss zeroing etc.
 
 It turned out x86 uses pretty similar approach so we re-used parts of
 code in board_f.c initially implemented for x86.
 
 Now assembly usage during init is limited to stack- and frame-pointer
 setup before and after relocation.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Simon Glass s...@chromium.org

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/7] arc: re-generate defconfigs

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 Before that moment our defconfigs were manually modified with addition
 of new options. That means once anybody wants to add another option and
 re-genarate defconfig with make defconfig there will be lots of
 differences. So to make future modifications more clean we'll do bulk
 re-generation right away.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Masahiro Yamada yamada.masah...@socionext.com

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 7/7] arc: minor fixes in Kconfig

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
  [1] Fix misspeling in ARC_CACHE_LINE_SHIFT dependency, now cache-line
 lenth selection is correctly enabled if either I$ or D$ are enabled.
 
  [2] Add dummy entry to target list to make sure target type is always
 mentioned in defconfig. Otherwise defconfig for the first target in the
 list will not have target name and later on with addition of the new
 target on top of the list in Kconfig will lead to corrupted
 configuration expanded from defconfig.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/7] arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:08 +0300, Alexey Brodkin wrote:
 As discussed on mailing list we're drifting away from
 CONFIG_SYS_GENERIC_GLOBAL_DATA in favour to use of board_init_f_mem()
 for global data.
 
 So do this for ARC architecture.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: add support for SLC (System Level Cache, AKA L2-cache)

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:25 +0300, Alexey Brodkin wrote:
 ARCv2 cores may have built-in SLC (System Level Cache, AKA L2-cache).
 This change adds functions required for controlling SLC:
  * slc_enable/disable
  * slc_flush/invalidate
 
 For now we just disable SLC to escape DMA coherency issues until either:
  * SLC flush/invalidate is supported in DMA APIin U-Boot
  * hardware DMA coherency is implemented (that might be board specific
so probably we'll need to have a separate Kconfig option for
controlling SLC explicitly)
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] serial-arc: switch to DM

2015-04-03 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:18 +0300, Alexey Brodkin wrote:
 Now when all infrastructure in ARC is ready for it let's switch ARC UART
 to driver model.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Masahiro Yamada yamada.masah...@socionext.com
 Cc: Simon Glass s...@chromium.org

Applied, thanks.

-Alexey

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: AXS10x - update SDIO clock value

2015-04-02 Thread Alexey Brodkin
With the most recent board firmware correct SDIO clock is 50MHz as
opposed to 25 MHz before.

Also set max frequency of MMC data exchange equal to SDIO clock -
because there's no way to transfer data faster than interface clock.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 board/synopsys/axs101/axs101.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/synopsys/axs101/axs101.c b/board/synopsys/axs101/axs101.c
index d1271ff..7742049 100644
--- a/board/synopsys/axs101/axs101.c
+++ b/board/synopsys/axs101/axs101.c
@@ -27,9 +27,9 @@ int board_mmc_init(bd_t *bis)
host-ioaddr = (void *)ARC_DWMMC_BASE;
host-buswidth = 4;
host-dev_index = 0;
-   host-bus_hz = 2500;
+   host-bus_hz = 5000;
 
-   add_dwmci(host, 5200, 40);
+   add_dwmci(host, host-bus_hz, 40);
 
return 0;
 }
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arc: AXS101 - enable data cache

2015-04-02 Thread Alexey Brodkin
On Tue, 2015-03-31 at 13:20 +0300, Alexey Brodkin wrote:
 With recent changes in mother-board firmware DMA works properly with
 data cache enabled. So we enable data cache for the board in defconfig
 to gain significant improvement in performance.

Even though NAND controller seem to work fine now I discovered yet
unknown problem with class 10 SD cards. If data cache is enabled I see
error messages like Invalid FAT entry. Once data cache is disabled I
see very nice and clean reads:
---8---
AXS# fatload mmc 0 0x8300 uimage
reading uimage
7354948 bytes read in 315 ms (22.3 MiB/s)
---8---

So before enabling data cache on AXS101 I'll need to fix this issue with
SD-cards. Deferring this patch for now.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 0/7] ARC updates

2015-03-31 Thread Alexey Brodkin
This patchset is meant to prepare ARC for device model utilization.
The most important things done:

 [1] Separation of interrupt vectore tables from start.S
 [2] Merge of low-level start-up code (written in assembly) for ARCompat and
 ARCv2 architectures
 [3] Separation of interrupt and exception handling code in a separate source
 file (ints_low.S)
 [4] Major clean-up of start-up code and switch to heavy use of routines written
 in C (re-use implementations for x86 in board_f.c)

Changes in v2:
 * Always build invalidate_icache_all() and invalidate_dcache_all()
 * Unconditionally disable caches on early start, if required enable them later
   in init_cache_f_r()
 * Fixed typo in commit message

Alexey Brodkin (7):
  arc: cache - build invalidate_icache_all() and invalidate_dcache_all()
always
  arc: merge common start-up code between ARC and ARCv2
  arc: move low-level interrupt and exception handlers in a separate
file
  arc: clean-up init procedure
  arc: re-generate defconfigs
  arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA
  arc: minor fixes in Kconfig

 arch/arc/Kconfig|  10 +-
 arch/arc/cpu/arcv1/Makefile |   2 +-
 arch/arc/cpu/arcv1/ivt.S|  27 
 arch/arc/cpu/arcv1/start.S  | 254 
 arch/arc/cpu/arcv2/Makefile |   2 +-
 arch/arc/cpu/arcv2/ivt.S|  27 
 arch/arc/cpu/arcv2/start.S  | 254 
 arch/arc/include/asm/config.h   |   1 -
 arch/arc/include/asm/init_helpers.h |  12 ++
 arch/arc/include/asm/relocate.h |  16 +++
 arch/arc/include/asm/u-boot-arc.h   |   3 +
 arch/arc/lib/Makefile   |   3 +
 arch/arc/lib/cache.c|  12 +-
 arch/arc/lib/cpu.c  |  13 --
 arch/arc/lib/init_helpers.c |  25 
 arch/arc/lib/ints_low.S | 151 +
 arch/arc/lib/relocate.c |  19 +++
 arch/arc/lib/start.S|  59 +
 common/board_f.c|   8 +-
 configs/arcangel4-be_defconfig  |   4 +-
 configs/arcangel4_defconfig |   2 +-
 configs/axs101_defconfig|   6 +-
 configs/axs103_defconfig|   4 +-
 configs/tb100_defconfig |   4 +-
 24 files changed, 375 insertions(+), 543 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 delete mode 100644 arch/arc/cpu/arcv1/start.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c
 create mode 100644 arch/arc/lib/ints_low.S
 create mode 100644 arch/arc/lib/start.S

-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 1/7] arc: cache - build invalidate_icache_all() and invalidate_dcache_all() always

2015-03-31 Thread Alexey Brodkin
Make both invalidate_icache_all() and invalidate_dcache_all() available
even if U-Boot is configured with CONFIG_SYS_DCACHE_OFF and/or
CONFIG_SYS_ICACHE_OFF.

This is useful because configuration of U-Boot may not match actual
hardware features. Real board may have cache(s) but for some reason we
may want to run U-Boot with cache(s) disabled (for example if some
peripherals work improperly with existing drivers if data cache is
enabled). So board may start with cache(s) enabled (that's the case for
ARC cores with built-in caches) but early in U-Boot we disable cache(s)
and make sure all contents of data cache gets flushed in RAM.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
Changes in v2:
 * This patch was introduced in v2 only
---
 arch/arc/lib/cache.c | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index a227723..30f045a 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -49,10 +49,12 @@ void icache_disable(void)
 
 void invalidate_icache_all(void)
 {
-#ifndef CONFIG_SYS_ICACHE_OFF
+   /* If no cache in CPU exit immediately */
+   if (!(read_aux_reg(ARC_BCR_IC_BUILD)  CACHE_VER_NUM_MASK))
+   return;
+
/* Any write to IC_IVIC register triggers invalidation of entire I$ */
write_aux_reg(ARC_AUX_IC_IVIC, 1);
-#endif /* CONFIG_SYS_ICACHE_OFF */
 }
 
 int dcache_status(void)
@@ -156,10 +158,12 @@ void invalidate_dcache_range(unsigned long start, 
unsigned long end)
 
 void invalidate_dcache_all(void)
 {
-#ifndef CONFIG_SYS_DCACHE_OFF
+   /* If no cache in CPU exit immediately */
+   if (!(read_aux_reg(ARC_BCR_DC_BUILD)  CACHE_VER_NUM_MASK))
+   return;
+
/* Write 1 to DC_IVDC register triggers invalidation of entire D$ */
write_aux_reg(ARC_AUX_DC_IVDC, 1);
-#endif /* CONFIG_SYS_DCACHE_OFF */
 }
 
 void flush_cache(unsigned long start, unsigned long size)
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 3/7] arc: move low-level interrupt and exception handlers in a separate file

2015-03-31 Thread Alexey Brodkin
This separation makes maintenance of code easier because those low-level
interrupt- or exception handling routines are pretty static and usually
require not much care while start-up code is a subject of modifications
and enhancements.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
No changes in v2
---
 arch/arc/lib/Makefile|   1 +
 arch/arc/lib/{start.S = ints_low.S} |  92 +-
 arch/arc/lib/start.S | 144 ---
 3 files changed, 2 insertions(+), 235 deletions(-)
 copy arch/arc/lib/{start.S = ints_low.S} (50%)

diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index ad66ac2..b1f1fbe 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -19,6 +19,7 @@ obj-y += memset.o
 obj-y += reset.o
 obj-y += timer.o
 obj-y += start.o
+obj-y += ints_low.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 
diff --git a/arch/arc/lib/start.S b/arch/arc/lib/ints_low.S
similarity index 50%
copy from arch/arc/lib/start.S
copy to arch/arc/lib/ints_low.S
index 39eace3..161cf37 100644
--- a/arch/arc/lib/start.S
+++ b/arch/arc/lib/ints_low.S
@@ -1,13 +1,10 @@
 /*
- * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
  *
  * SPDX-License-Identifier:GPL-2.0+
  */
 
-#include asm-offsets.h
-#include config.h
 #include linux/linkage.h
-#include asm/arcregs.h
 
 /*
  * Note on the LD/ST addressing modes with address register write-back
@@ -89,27 +86,6 @@
 #endif
 .endm
 
-ENTRY(_start)
-   /* Setup interrupt vector base that matches __text_start */
-   sr  __ivt_start, [ARC_AUX_INTR_VEC_BASE]
-
-   /* Setup stack pointer */
-   mov %sp, CONFIG_SYS_INIT_SP_ADDR
-   mov %fp, %sp
-
-   /* Clear bss */
-   mov %r0, __bss_start
-   mov %r1, __bss_end
-
-clear_bss:
-   st.ab   0, [%r0, 4]
-   brlt%r0, %r1, clear_bss
-
-   /* Zero the one and only argument of board_init_f */
-   mov_s   %r0, 0
-   j   board_init_f
-ENDPROC(_start)
-
 ENTRY(memory_error)
SAVE_ALL_SYS
SAVE_EXCEPTION_SOURCE
@@ -173,69 +149,3 @@ ENTRY(EV_Extension)
mov %r0, %sp
j   do_extension
 ENDPROC(EV_Extension)
-
-/*
- * void relocate_code (addr_sp, gd, addr_moni)
- *
- * This function does not return, instead it continues in RAM
- * after relocating the monitor code.
- *
- * r0 = start_addr_sp
- * r1 = new__gd
- * r2 = relocaddr
- */
-ENTRY(relocate_code)
-   /*
-* r0-r12 might be clobbered by C functions
-* so we use r13-r16 for storage here
-*/
-   mov %r13, %r0   /* save addr_sp */
-   mov %r14, %r1   /* save addr of gd */
-   mov %r15, %r2   /* save addr of destination */
-
-   mov %r16, %r2   /* %r9 - relocation offset */
-   sub %r16, %r16, __image_copy_start
-
-/* Set up the stack */
-stack_setup:
-   mov %sp, %r13
-   mov %fp, %sp
-
-/* Check if monitor is loaded right in place for relocation */
-   mov %r0, __image_copy_start
-   cmp %r0, %r15   /* skip relocation if code loaded */
-   bz  do_board_init_r /* in target location already */
-
-/* Copy data (__image_copy_start - __image_copy_end) to new location */
-   mov %r1, %r15
-   mov %r2, __image_copy_end
-   sub %r2, %r2, %r0   /* r3 - amount of bytes to copy */
-   asr %r2, %r2, 2 /* r3 - amount of words to copy */
-   mov %lp_count, %r2
-   lp  copy_end
-   ld.ab   %r2,[%r0,4]
-   st.ab   %r2,[%r1,4]
-copy_end:
-
-/* Fix relocations related issues */
-   bl  do_elf_reloc_fixups
-#ifndef CONFIG_SYS_ICACHE_OFF
-   bl  invalidate_icache_all
-#endif
-#ifndef CONFIG_SYS_DCACHE_OFF
-   bl  flush_dcache_all
-#endif
-
-/* Update position of intterupt vector table */
-   lr  %r0, [ARC_AUX_INTR_VEC_BASE]/* Read current position */
-   add %r0, %r0, %r16  /* Update address */
-   sr  %r0, [ARC_AUX_INTR_VEC_BASE]/* Write new position */
-
-do_board_init_r:
-/* Prepare for exection of board_init_r in relocated monitor */
-   mov %r2, board_init_r   /* old address of board_init_r() */
-   add %r2, %r2, %r16  /* new address of board_init_r() */
-   mov %r0, %r14   /* 1-st parameter: gd_t */
-   mov %r1, %r15   /* 2-nd parameter: dest_addr */
-   j   [%r2]
-ENDPROC(relocate_code)
diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S
index 39eace3..3408f45 100644
--- a/arch/arc/lib/start.S
+++ b/arch/arc/lib/start.S
@@ -9,86 +9,6 @@
 #include linux/linkage.h
 #include asm/arcregs.h
 
-/*
- * Note on the LD/ST addressing modes with address register write-back
- *
- * LD.a same as LD.aw
- *
- * LD.areg1, [reg2, x]  = Pre Incr

[U-Boot] [PATCH v2 5/7] arc: re-generate defconfigs

2015-03-31 Thread Alexey Brodkin
Before that moment our defconfigs were manually modified with addition
of new options. That means once anybody wants to add another option and
re-genarate defconfig with make defconfig there will be lots of
differences. So to make future modifications more clean we'll do bulk
re-generation right away.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Masahiro Yamada yamada.masah...@socionext.com
---
Changes in v2:
 * Fixed typo, thanks to Masahiro-san
---
 configs/arcangel4-be_defconfig | 4 ++--
 configs/arcangel4_defconfig| 2 +-
 configs/axs101_defconfig   | 6 +++---
 configs/axs103_defconfig   | 4 ++--
 configs/tb100_defconfig| 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/configs/arcangel4-be_defconfig b/configs/arcangel4-be_defconfig
index 979f26e..990c74a 100644
--- a/configs/arcangel4-be_defconfig
+++ b/configs/arcangel4-be_defconfig
@@ -1,5 +1,5 @@
 CONFIG_ARC=y
-CONFIG_TARGET_ARCANGEL4=y
-CONFIG_SYS_CLK_FREQ=7000
 CONFIG_CPU_BIG_ENDIAN=y
+CONFIG_TARGET_ARCANGEL4=y
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_SYS_CLK_FREQ=7000
diff --git a/configs/arcangel4_defconfig b/configs/arcangel4_defconfig
index 797595f..fbc0ffe 100644
--- a/configs/arcangel4_defconfig
+++ b/configs/arcangel4_defconfig
@@ -1,4 +1,4 @@
 CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
-CONFIG_SYS_CLK_FREQ=7000
 CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_SYS_CLK_FREQ=7000
diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index 34ed963..e5e1d87 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -1,6 +1,6 @@
 CONFIG_ARC=y
+CONFIG_SYS_DCACHE_OFF=y
+CONFIG_ARC_CACHE_LINE_SHIFT=5
 CONFIG_TARGET_AXS101=y
+CONFIG_SYS_TEXT_BASE=0x8100
 CONFIG_SYS_CLK_FREQ=75000
-CONFIG_ARC_CACHE_LINE_SHIFT=5
-CONFIG_SYS_DCACHE_OFF=y
-CONFIG_SYS_TEXT_BASE=0x8100
\ No newline at end of file
diff --git a/configs/axs103_defconfig b/configs/axs103_defconfig
index c63dd4a..7d662ad 100644
--- a/configs/axs103_defconfig
+++ b/configs/axs103_defconfig
@@ -1,5 +1,5 @@
-CONFIG_SYS_TEXT_BASE=0x8100
-CONFIG_SYS_CLK_FREQ=5000
 CONFIG_ARC=y
 CONFIG_ISA_ARCV2=y
 CONFIG_TARGET_AXS101=y
+CONFIG_SYS_TEXT_BASE=0x8100
+CONFIG_SYS_CLK_FREQ=5000
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index b0e8c9f..c964272 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -1,5 +1,5 @@
 CONFIG_ARC=y
-CONFIG_TARGET_TB100=y
-CONFIG_SYS_CLK_FREQ=5
 CONFIG_ARC_CACHE_LINE_SHIFT=5
+CONFIG_TARGET_TB100=y
 CONFIG_SYS_TEXT_BASE=0x8400
+CONFIG_SYS_CLK_FREQ=5
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] arc: AXS101 - enable data cache

2015-03-31 Thread Alexey Brodkin
With recent changes in mother-board firmware DMA works properly with
data cache enabled. So we enable data cache for the board in defconfig
to gain significant improvement in performance.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 configs/axs101_defconfig | 1 -
 1 file changed, 1 deletion(-)

diff --git a/configs/axs101_defconfig b/configs/axs101_defconfig
index e5e1d87..f6ec1f1 100644
--- a/configs/axs101_defconfig
+++ b/configs/axs101_defconfig
@@ -1,5 +1,4 @@
 CONFIG_ARC=y
-CONFIG_SYS_DCACHE_OFF=y
 CONFIG_ARC_CACHE_LINE_SHIFT=5
 CONFIG_TARGET_AXS101=y
 CONFIG_SYS_TEXT_BASE=0x8100
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] board: Switch Abilis TB-100 board to Driver Model for serial port

2015-03-31 Thread Alexey Brodkin
Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Masahiro Yamada yamada.masah...@socionext.com
Cc: Simon Glass s...@chromium.org
---
 arch/arc/dts/Makefile |  1 +
 arch/arc/dts/abilis_tb100.dts | 24 
 configs/tb100_defconfig   |  5 +
 include/configs/tb100.h   |  6 +-
 4 files changed, 31 insertions(+), 5 deletions(-)
 create mode 100644 arch/arc/dts/abilis_tb100.dts

diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
index a155311..5bc6f44 100644
--- a/arch/arc/dts/Makefile
+++ b/arch/arc/dts/Makefile
@@ -1,4 +1,5 @@
 dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
+dtb-$(CONFIG_TARGET_TB100) +=  abilis_tb100.dtb
 
 targets += $(dtb-y)
 
diff --git a/arch/arc/dts/abilis_tb100.dts b/arch/arc/dts/abilis_tb100.dts
new file mode 100644
index 000..cf395c4
--- /dev/null
+++ b/arch/arc/dts/abilis_tb100.dts
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com)
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+/dts-v1/;
+
+#include skeleton.dtsi
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   console = uart0;
+   };
+
+   uart0: serial@ff10 {
+   compatible = snps,dw-apb-uart;
+   reg = 0xff10 0x1000;
+   reg-shift = 2;
+   reg-io-width = 4;
+   };
+};
diff --git a/configs/tb100_defconfig b/configs/tb100_defconfig
index c964272..59f09d9 100644
--- a/configs/tb100_defconfig
+++ b/configs/tb100_defconfig
@@ -1,5 +1,10 @@
 CONFIG_ARC=y
 CONFIG_ARC_CACHE_LINE_SHIFT=5
 CONFIG_TARGET_TB100=y
+CONFIG_DM=y
+CONFIG_DM_SERIAL=y
+CONFIG_DEFAULT_DEVICE_TREE=abilis_tb100
 CONFIG_SYS_TEXT_BASE=0x8400
 CONFIG_SYS_CLK_FREQ=5
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
diff --git a/include/configs/tb100.h b/include/configs/tb100.h
index 46df406..501449a 100644
--- a/include/configs/tb100.h
+++ b/include/configs/tb100.h
@@ -35,14 +35,10 @@
 /*
  * UART configuration
  */
-#define CONFIG_CONS_INDEX  1
+#define CONFIG_DW_SERIAL
 #define CONFIG_SYS_NS16550
 #define CONFIG_SYS_NS16550_SERIAL
-#define CONFIG_SYS_NS16550_REG_SIZE-4
 #define CONFIG_SYS_NS16550_CLK 1
-#define CONFIG_SYS_NS16550_COM10xFF10
-#define CONFIG_SYS_NS16550_MEM32
-
 #define CONFIG_BAUDRATE115200
 
 /*
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 2/7] arc: merge common start-up code between ARC and ARCv2

2015-03-31 Thread Alexey Brodkin
Even though ARCompact and ARCv2 are not binary compatible most of
assembly instructions are used in both. With this change we'll get rid
of duplicate code.

Still IVTs are implemented differently so we're keeping them in separate
files.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
No changes in v2
---
 arch/arc/cpu/arcv1/Makefile |   2 +-
 arch/arc/cpu/arcv1/ivt.S|  27 
 arch/arc/cpu/arcv2/Makefile |   2 +-
 arch/arc/cpu/arcv2/ivt.S|  27 
 arch/arc/cpu/arcv2/start.S  | 254 
 arch/arc/lib/Makefile   |   1 +
 arch/arc/{cpu/arcv1 = lib}/start.S |  63 -
 7 files changed, 82 insertions(+), 294 deletions(-)
 create mode 100644 arch/arc/cpu/arcv1/ivt.S
 create mode 100644 arch/arc/cpu/arcv2/ivt.S
 delete mode 100644 arch/arc/cpu/arcv2/start.S
 rename arch/arc/{cpu/arcv1 = lib}/start.S (82%)

diff --git a/arch/arc/cpu/arcv1/Makefile b/arch/arc/cpu/arcv1/Makefile
index 3704ebe..6d17ab2 100644
--- a/arch/arc/cpu/arcv1/Makefile
+++ b/arch/arc/cpu/arcv1/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-y += start.o
+obj-y += ivt.o
diff --git a/arch/arc/cpu/arcv1/ivt.S b/arch/arc/cpu/arcv1/ivt.S
new file mode 100644
index 000..7df47a2
--- /dev/null
+++ b/arch/arc/cpu/arcv1/ivt.S
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2013-2014 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+.section .ivt, ax,@progbits
+.align 4
+_ivt:
+   /* Critical system events */
+   j   _start  /* 0 - 0x000 */
+   j   memory_error/* 1 - 0x008 */
+   j   instruction_error   /* 2 - 0x010 */
+
+   /* Device interrupts */
+.rept  29
+   j   interrupt_handler   /* 3:31 - 0x018:0xF8 */
+.endr
+   /* Exceptions */
+   j   EV_MachineCheck /* 0x100, Fatal Machine check  (0x20) */
+   j   EV_TLBMissI /* 0x108, Intruction TLB miss  (0x21) */
+   j   EV_TLBMissD /* 0x110, Data TLB miss(0x22) */
+   j   EV_TLBProtV /* 0x118, Protection Violation (0x23)
+   or Misaligned Access  */
+   j   EV_PrivilegeV   /* 0x120, Privilege Violation  (0x24) */
+   j   EV_Trap /* 0x128, Trap exception   (0x25) */
+   j   EV_Extension/* 0x130, Extn Intruction Excp (0x26) */
diff --git a/arch/arc/cpu/arcv2/Makefile b/arch/arc/cpu/arcv2/Makefile
index cc69e5a..e338a0a 100644
--- a/arch/arc/cpu/arcv2/Makefile
+++ b/arch/arc/cpu/arcv2/Makefile
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-obj-y += start.o
+obj-y += ivt.o
diff --git a/arch/arc/cpu/arcv2/ivt.S b/arch/arc/cpu/arcv2/ivt.S
new file mode 100644
index 000..d110b5b
--- /dev/null
+++ b/arch/arc/cpu/arcv2/ivt.S
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+.section .ivt, a,@progbits
+.align 4
+   /* Critical system events */
+.word  _start  /* 0 - 0x000 */
+.word  memory_error/* 1 - 0x008 */
+.word  instruction_error   /* 2 - 0x010 */
+
+   /* Exceptions */
+.word  EV_MachineCheck /* 0x100, Fatal Machine check  (0x20) */
+.word  EV_TLBMissI /* 0x108, Intruction TLB miss  (0x21) */
+.word  EV_TLBMissD /* 0x110, Data TLB miss(0x22) */
+.word  EV_TLBProtV /* 0x118, Protection Violation (0x23)
+   or Misaligned Access  */
+.word  EV_PrivilegeV   /* 0x120, Privilege Violation  (0x24) */
+.word  EV_Trap /* 0x128, Trap exception   (0x25) */
+.word  EV_Extension/* 0x130, Extn Intruction Excp (0x26) */
+
+   /* Device interrupts */
+.rept  29
+   j   interrupt_handler   /* 3:31 - 0x018:0xF8 */
+.endr
diff --git a/arch/arc/cpu/arcv2/start.S b/arch/arc/cpu/arcv2/start.S
deleted file mode 100644
index 3ce6896..000
--- a/arch/arc/cpu/arcv2/start.S
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include asm-offsets.h
-#include config.h
-#include asm/arcregs.h
-
-/*
- * Note on the LD/ST addressing modes with address register write-back
- *
- * LD.a same as LD.aw
- *
- * LD.areg1, [reg2, x]  = Pre Incr
- *  Eff Addr for load = [reg2 + x]
- *
- * LD.ab   reg1, [reg2, x]  = Post Incr
- *  Eff Addr for load = [reg2]
- */
-
-.macro PUSH reg
-   st.a\reg, [%sp, -4]
-.endm
-
-.macro PUSHAX aux
-   lr  %r9, [\aux]
-   PUSH%r9
-.endm
-
-.macro  SAVE_R1_TO_R24
-   PUSH%r1
-   PUSH%r2
-   PUSH%r3
-   PUSH%r4
-   PUSH%r5
-   PUSH%r6
-   PUSH%r7
-   PUSH%r8
-   PUSH

[U-Boot] [PATCH v2 4/7] arc: clean-up init procedure

2015-03-31 Thread Alexey Brodkin
Intention behind this work was elimination of as much assembly-written
code as it is possible.

In case of ARC we already have relocation fix-up implemented in C so why
don't we use C for U-Boot copying, .bss zeroing etc.

It turned out x86 uses pretty similar approach so we re-used parts of
code in board_f.c initially implemented for x86.

Now assembly usage during init is limited to stack- and frame-pointer
setup before and after relocation.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Simon Glass s...@chromium.org
---
Changes in v2:
 * Unconditionally disable caches on early start
 * Only enable caches in init_cache_f_r() because all
   caches were disabled earlier
---
 arch/arc/include/asm/init_helpers.h | 12 ++
 arch/arc/include/asm/relocate.h | 16 
 arch/arc/include/asm/u-boot-arc.h   |  3 ++
 arch/arc/lib/Makefile   |  1 +
 arch/arc/lib/cpu.c  | 13 --
 arch/arc/lib/init_helpers.c | 25 +++
 arch/arc/lib/relocate.c | 19 +
 arch/arc/lib/start.S| 82 -
 common/board_f.c|  8 ++--
 9 files changed, 98 insertions(+), 81 deletions(-)
 create mode 100644 arch/arc/include/asm/init_helpers.h
 create mode 100644 arch/arc/include/asm/relocate.h
 create mode 100644 arch/arc/lib/init_helpers.c

diff --git a/arch/arc/include/asm/init_helpers.h 
b/arch/arc/include/asm/init_helpers.h
new file mode 100644
index 000..7607e19
--- /dev/null
+++ b/arch/arc/include/asm/init_helpers.h
@@ -0,0 +1,12 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _ASM_ARC_INIT_HELPERS_H
+#define _ASM_ARC_INIT_HELPERS_H
+
+int init_cache_f_r(void);
+
+#endif /* _ASM_ARC_INIT_HELPERS_H */
diff --git a/arch/arc/include/asm/relocate.h b/arch/arc/include/asm/relocate.h
new file mode 100644
index 000..4c5f923
--- /dev/null
+++ b/arch/arc/include/asm/relocate.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef _ASM_ARC_RELOCATE_H
+#define _ASM_ARC_RELOCATE_H
+
+#include common.h
+
+int copy_uboot_to_ram(void);
+int clear_bss(void);
+int do_elf_reloc_fixups(void);
+
+#endif /* _ASM_ARC_RELOCATE_H */
diff --git a/arch/arc/include/asm/u-boot-arc.h 
b/arch/arc/include/asm/u-boot-arc.h
index 0c0e8e6..a56ccf1 100644
--- a/arch/arc/include/asm/u-boot-arc.h
+++ b/arch/arc/include/asm/u-boot-arc.h
@@ -9,4 +9,7 @@
 
 int arch_early_init_r(void);
 
+void   board_init_f_r_trampoline(ulong) __attribute__ ((noreturn));
+void   board_init_f_r(void) __attribute__ ((noreturn));
+
 #endif /* __ASM_ARC_U_BOOT_ARC_H__ */
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index b1f1fbe..b887904 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -20,6 +20,7 @@ obj-y += reset.o
 obj-y += timer.o
 obj-y += start.o
 obj-y += ints_low.o
+obj-y += init_helpers.o
 
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
 
diff --git a/arch/arc/lib/cpu.c b/arch/arc/lib/cpu.c
index 50634b8..3c930bc 100644
--- a/arch/arc/lib/cpu.c
+++ b/arch/arc/lib/cpu.c
@@ -12,19 +12,6 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int arch_cpu_init(void)
 {
-#ifdef CONFIG_SYS_ICACHE_OFF
-   icache_disable();
-#else
-   icache_enable();
-   invalidate_icache_all();
-#endif
-
-   flush_dcache_all();
-#ifdef CONFIG_SYS_DCACHE_OFF
-   dcache_disable();
-#else
-   dcache_enable();
-#endif
timer_init();
 
 /* In simulation (ISS) CHIPID and ARCNUM are all ff */
diff --git a/arch/arc/lib/init_helpers.c b/arch/arc/lib/init_helpers.c
new file mode 100644
index 000..25690ee
--- /dev/null
+++ b/arch/arc/lib/init_helpers.c
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2013-2015 Synopsys, Inc. All rights reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#include common.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int init_cache_f_r(void)
+{
+#ifndef CONFIG_SYS_ICACHE_OFF
+   icache_enable();
+   /* Make sure no stale entries persist from before we disabled cache */
+   invalidate_icache_all();
+#endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+   dcache_enable();
+   /* Make sure no stale entries persist from before we disabled cache */
+   invalidate_dcache_all();
+#endif
+   return 0;
+}
diff --git a/arch/arc/lib/relocate.c b/arch/arc/lib/relocate.c
index 7797782..5c2c2d1 100644
--- a/arch/arc/lib/relocate.c
+++ b/arch/arc/lib/relocate.c
@@ -10,6 +10,25 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int copy_uboot_to_ram(void)
+{
+   size_t len = (size_t)__image_copy_end - (size_t)__image_copy_start;
+
+   memcpy((void *)gd-relocaddr, (void *)__image_copy_start, len);
+
+   return 0;
+}
+
+int clear_bss(void)
+{
+   ulong dst_addr = (ulong)__bss_start + gd-reloc_off;
+   size_t len = (size_t)__bss_end - (size_t)__bss_start;
+
+   memset((void *)dst_addr, 0x00, len);
+
+   return 0;
+}
+
 /*
  * Base

[U-Boot] [PATCH v2 6/7] arc: get rid of CONFIG_SYS_GENERIC_GLOBAL_DATA

2015-03-31 Thread Alexey Brodkin
As discussed on mailing list we're drifting away from
CONFIG_SYS_GENERIC_GLOBAL_DATA in favour to use of board_init_f_mem()
for global data.

So do this for ARC architecture.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
No changes in v2
---
 arch/arc/include/asm/config.h | 1 -
 arch/arc/lib/start.S  | 8 
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arc/include/asm/config.h b/arch/arc/include/asm/config.h
index 8936f5c..d2d7919 100644
--- a/arch/arc/include/asm/config.h
+++ b/arch/arc/include/asm/config.h
@@ -7,7 +7,6 @@
 #ifndef __ASM_ARC_CONFIG_H_
 #define __ASM_ARC_CONFIG_H_
 
-#define CONFIG_SYS_GENERIC_GLOBAL_DATA
 #define CONFIG_SYS_BOOT_RAMDISK_HIGH
 #define CONFIG_ARCH_EARLY_INIT_R
 
diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S
index 82045ae..48ee86e 100644
--- a/arch/arc/lib/start.S
+++ b/arch/arc/lib/start.S
@@ -22,6 +22,14 @@ ENTRY(_start)
bl  dcache_disable
bl  icache_disable
 
+   /* Allocate and zero GD, update SP */
+   mov %r0, %sp
+   bl  board_init_f_mem
+
+   /* Update stack- and frame-pointers */
+   mov %sp, %r0
+   mov %fp, %sp
+
/* Zero the one and only argument of board_init_f */
mov_s   %r0, 0
j   board_init_f
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2 7/7] arc: minor fixes in Kconfig

2015-03-31 Thread Alexey Brodkin
 [1] Fix misspeling in ARC_CACHE_LINE_SHIFT dependency, now cache-line
lenth selection is correctly enabled if either I$ or D$ are enabled.

 [2] Add dummy entry to target list to make sure target type is always
mentioned in defconfig. Otherwise defconfig for the first target in the
list will not have target name and later on with addition of the new
target on top of the list in Kconfig will lead to corrupted
configuration expanded from defconfig.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
No changes in v2
---
 arch/arc/Kconfig | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 24f5c02..c044ad4 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -123,7 +123,7 @@ config ARC_CACHE_LINE_SHIFT
int Cache Line Length (as power of 2)
range 5 7
default 6
-   depends on !SYS_DCACHE_OFF || !SYS_DCACHE_OFF
+   depends on !SYS_DCACHE_OFF || !SYS_ICACHE_OFF
help
  Starting with ARC700 4.9, Cache line length is configurable,
  This option specifies N, with Line-len = 2 power N
@@ -133,6 +133,14 @@ config ARC_CACHE_LINE_SHIFT
 choice
prompt Target select
 
+config TARGET_DUMMY
+   bool Dummy target
+   help
+ Please select one of real target boards below!
+ This target is only meant to force makedefconfig to put
+ TARGET_xxx in defconfig even this is the first target from the list
+ below.
+
 config TARGET_TB100
bool Support tb100
 
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] serial-arc: switch to DM

2015-03-31 Thread Alexey Brodkin
Now when all infrastructure in ARC is ready for it let's switch ARC UART
to driver model.

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
Cc: Masahiro Yamada yamada.masah...@socionext.com
Cc: Simon Glass s...@chromium.org
---
 arch/Kconfig   |   1 +
 arch/arc/dts/Makefile  |  11 +
 arch/arc/dts/arcangel4.dts |  24 ++
 arch/arc/dts/skeleton.dtsi |  13 ++
 configs/arcangel4-be_defconfig |   5 ++
 configs/arcangel4_defconfig|   5 ++
 drivers/serial/serial_arc.c| 102 -
 7 files changed, 129 insertions(+), 32 deletions(-)
 create mode 100644 arch/arc/dts/Makefile
 create mode 100644 arch/arc/dts/arcangel4.dts
 create mode 100644 arch/arc/dts/skeleton.dtsi

diff --git a/arch/Kconfig b/arch/Kconfig
index ca617e7..2ca5305 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -14,6 +14,7 @@ config ARC
select HAVE_PRIVATE_LIBGCC
select HAVE_GENERIC_BOARD
select SYS_GENERIC_BOARD
+   select SUPPORT_OF_CONTROL
 
 config ARM
bool ARM architecture
diff --git a/arch/arc/dts/Makefile b/arch/arc/dts/Makefile
new file mode 100644
index 000..a155311
--- /dev/null
+++ b/arch/arc/dts/Makefile
@@ -0,0 +1,11 @@
+dtb-$(CONFIG_TARGET_ARCANGEL4) +=  arcangel4.dtb
+
+targets += $(dtb-y)
+
+DTC_FLAGS += -R 4 -p 0x1000
+
+PHONY += dtbs
+dtbs: $(addprefix $(obj)/, $(dtb-y))
+   @:
+
+clean-files := *.dtb
diff --git a/arch/arc/dts/arcangel4.dts b/arch/arc/dts/arcangel4.dts
new file mode 100644
index 000..bfcb9d8
--- /dev/null
+++ b/arch/arc/dts/arcangel4.dts
@@ -0,0 +1,24 @@
+/*
+ * Copyright (C) 2015 Synopsys, Inc. (www.synopsys.com)
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+/dts-v1/;
+
+#include skeleton.dtsi
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   aliases {
+   console = arcuart0;
+   };
+
+   arcuart0: serial@0xc0fc1000 {
+   compatible = snps,arc-uart;
+   reg = 0xc0fc1000 0x100;
+   clock-frequency = 8000;
+   };
+
+};
diff --git a/arch/arc/dts/skeleton.dtsi b/arch/arc/dts/skeleton.dtsi
new file mode 100644
index 000..b41d241
--- /dev/null
+++ b/arch/arc/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value.  The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+   chosen { };
+   aliases { };
+   memory { device_type = memory; reg = 0 0; };
+};
diff --git a/configs/arcangel4-be_defconfig b/configs/arcangel4-be_defconfig
index 990c74a..36ea6be 100644
--- a/configs/arcangel4-be_defconfig
+++ b/configs/arcangel4-be_defconfig
@@ -1,5 +1,10 @@
 CONFIG_ARC=y
 CONFIG_CPU_BIG_ENDIAN=y
 CONFIG_TARGET_ARCANGEL4=y
+CONFIG_DM=y
+CONFIG_DM_SERIAL=y
+CONFIG_DEFAULT_DEVICE_TREE=arcangel4
 CONFIG_SYS_TEXT_BASE=0x8100
 CONFIG_SYS_CLK_FREQ=7000
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
diff --git a/configs/arcangel4_defconfig b/configs/arcangel4_defconfig
index fbc0ffe..75a91c8 100644
--- a/configs/arcangel4_defconfig
+++ b/configs/arcangel4_defconfig
@@ -1,4 +1,9 @@
 CONFIG_ARC=y
 CONFIG_TARGET_ARCANGEL4=y
+CONFIG_DM=y
+CONFIG_DM_SERIAL=y
+CONFIG_DEFAULT_DEVICE_TREE=arcangel4
 CONFIG_SYS_TEXT_BASE=0x8100
 CONFIG_SYS_CLK_FREQ=7000
+CONFIG_OF_CONTROL=y
+CONFIG_OF_EMBED=y
diff --git a/drivers/serial/serial_arc.c b/drivers/serial/serial_arc.c
index 0ee8ce5..54e596c 100644
--- a/drivers/serial/serial_arc.c
+++ b/drivers/serial/serial_arc.c
@@ -8,6 +8,7 @@
  */
 
 #include common.h
+#include dm.h
 #include serial.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -23,21 +24,23 @@ struct arc_serial_regs {
unsigned int baudh;
 };
 
+
+struct arc_serial_platdata {
+   struct arc_serial_regs *reg;
+   unsigned int uartclk;
+};
+
 /* Bit definitions of STATUS register */
 #define UART_RXEMPTY   (1  5)
 #define UART_OVERFLOW_ERR  (1  1)
 #define UART_TXEMPTY   (1  7)
 
-struct arc_serial_regs *regs = (struct arc_serial_regs *)CONFIG_ARC_UART_BASE;
-
-static void arc_serial_setbrg(void)
+static int arc_serial_setbrg(struct udevice *dev, int baudrate)
 {
-   int arc_console_baud;
+   struct arc_serial_platdata *plat = dev-platdata;
+   struct arc_serial_regs *const regs = plat-reg;
+   int arc_console_baud = gd-cpu_clk / (baudrate * 4) - 1;
 
-   if (!gd-baudrate)
-   gd-baudrate = CONFIG_BAUDRATE;
-
-   arc_console_baud = gd-cpu_clk / (gd-baudrate * 4) - 1;
writeb(arc_console_baud  0xff, regs-baudl);
 
 #ifdef CONFIG_ARC
@@ -56,33 +59,49 @@ static void arc_serial_setbrg(void)
 #else
writeb((arc_console_baud  0xff00)  8, regs-baudh);
 #endif
-}
 
-static int arc_serial_init(void)
-{
-   serial_setbrg();
return 0;
 }
 
-static void arc_serial_putc(const char c)
+static int arc_serial_putc(struct udevice *dev, const char c)
 {
+   struct

[U-Boot] [PATCH] arc: add support for SLC (System Level Cache, AKA L2-cache)

2015-03-31 Thread Alexey Brodkin
ARCv2 cores may have built-in SLC (System Level Cache, AKA L2-cache).
This change adds functions required for controlling SLC:
 * slc_enable/disable
 * slc_flush/invalidate

For now we just disable SLC to escape DMA coherency issues until either:
 * SLC flush/invalidate is supported in DMA APIin U-Boot
 * hardware DMA coherency is implemented (that might be board specific
   so probably we'll need to have a separate Kconfig option for
   controlling SLC explicitly)

Signed-off-by: Alexey Brodkin abrod...@synopsys.com
---
 arch/arc/include/asm/arcregs.h |  4 
 arch/arc/include/asm/cache.h   | 11 ++
 arch/arc/lib/cache.c   | 46 ++
 arch/arc/lib/start.S   |  4 
 4 files changed, 65 insertions(+)

diff --git a/arch/arc/include/asm/arcregs.h b/arch/arc/include/asm/arcregs.h
index 6a36a81..0e11dcc 100644
--- a/arch/arc/include/asm/arcregs.h
+++ b/arch/arc/include/asm/arcregs.h
@@ -46,6 +46,10 @@
 #define ARC_AUX_DC_PTAG0x5C
 #endif
 #define ARC_BCR_DC_BUILD   0x72
+#define ARC_BCR_SLC0xce
+#define ARC_AUX_SLC_CONTROL0x903
+#define ARC_AUX_SLC_FLUSH  0x904
+#define ARC_AUX_SLC_INVALIDATE 0x905
 
 #ifndef __ASSEMBLY__
 /* Accessors for auxiliary registers */
diff --git a/arch/arc/include/asm/cache.h b/arch/arc/include/asm/cache.h
index 8a77cd9..0b3ebd9 100644
--- a/arch/arc/include/asm/cache.h
+++ b/arch/arc/include/asm/cache.h
@@ -27,4 +27,15 @@
 #define CONFIG_ARC_MMU_VER 4
 #endif
 
+#ifndef __ASSEMBLY__
+
+#ifdef CONFIG_ISA_ARCV2
+void slc_enable(void);
+void slc_disable(void);
+void slc_flush(void);
+void slc_invalidate(void);
+#endif
+
+#endif /* __ASSEMBLY__ */
+
 #endif /* __ASM_ARC_CACHE_H */
diff --git a/arch/arc/lib/cache.c b/arch/arc/lib/cache.c
index 30f045a..e369e5a 100644
--- a/arch/arc/lib/cache.c
+++ b/arch/arc/lib/cache.c
@@ -16,6 +16,7 @@
 #define DC_CTRL_INV_MODE_FLUSH (1  6)
 #define DC_CTRL_FLUSH_STATUS   (1  8)
 #define CACHE_VER_NUM_MASK 0xF
+#define SLC_CTRL_SB(1  2)
 
 int icache_status(void)
 {
@@ -170,3 +171,48 @@ void flush_cache(unsigned long start, unsigned long size)
 {
flush_dcache_range(start, start + size);
 }
+
+#ifdef CONFIG_ISA_ARCV2
+void slc_enable(void)
+{
+   /* If SLC ver = 0, no SLC present in CPU */
+   if (!(read_aux_reg(ARC_BCR_SLC)  0xff))
+   return;
+
+   write_aux_reg(ARC_AUX_SLC_CONTROL,
+ read_aux_reg(ARC_AUX_SLC_CONTROL)  ~1);
+}
+
+void slc_disable(void)
+{
+   /* If SLC ver = 0, no SLC present in CPU */
+   if (!(read_aux_reg(ARC_BCR_SLC)  0xff))
+   return;
+
+   write_aux_reg(ARC_AUX_SLC_CONTROL,
+ read_aux_reg(ARC_AUX_SLC_CONTROL) | 1);
+}
+
+void slc_flush(void)
+{
+   /* If SLC ver = 0, no SLC present in CPU */
+   if (!(read_aux_reg(ARC_BCR_SLC)  0xff))
+   return;
+
+   write_aux_reg(ARC_AUX_SLC_FLUSH, 1);
+
+   /* Wait flush end */
+   while (read_aux_reg(ARC_AUX_SLC_CONTROL)  SLC_CTRL_SB)
+   ;
+}
+
+void slc_invalidate(void)
+{
+   /* If SLC ver = 0, no SLC present in CPU */
+   if (!(read_aux_reg(ARC_BCR_SLC)  0xff))
+   return;
+
+   write_aux_reg(ARC_AUX_SLC_INVALIDATE, 1);
+}
+
+#endif /* CONFIG_ISA_ARCV2 */
diff --git a/arch/arc/lib/start.S b/arch/arc/lib/start.S
index 48ee86e..e1ef19c 100644
--- a/arch/arc/lib/start.S
+++ b/arch/arc/lib/start.S
@@ -18,6 +18,10 @@ ENTRY(_start)
mov %fp, %sp
 
/* Unconditionally disable caches */
+#ifdef CONFIG_ISA_ARCV2
+   bl  slc_flush
+   bl  slc_disable
+#endif
bl  flush_dcache_all
bl  dcache_disable
bl  icache_disable
-- 
2.1.0

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] arc: re-generate defconfigs

2015-03-30 Thread Alexey Brodkin
Hello Masahiro-san,

On Sun, 2015-03-29 at 19:47 +0900, Masahiro Yamada wrote:
 Hi Alexey,
 
 2015-03-17 21:13 GMT+09:00 Alexey Brodkin alexey.brod...@synopsys.com:
  Before that moment our defconfigs were manually modified with addition
  of new options. That means once anybody wants to addd another option and
 
 I just noticed a typo.  s/addd/add/
 
 You need not to submit v2 for such a minor error.
 Please fix it when you apply this patch, if you remember.

Thanks for catching this typo.

I was going to send v2 respin of entire series due to important fixes
I've done recently and mentioned typo will be addressed there as well.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] common/board_f: move board_init_f_mem() from #else CONFIG_X86

2015-03-27 Thread Alexey Brodkin
Hi Simon, Tom,

On Tue, 2015-03-24 at 11:12 +0300, Alexey Brodkin wrote:
 Purpose of this change is to make it possible to re-use code currently
 used on X86 solely for other architectures. For example:
  * init_sequence_f_r
  * board_init_f_r
 
 Even though board_init_f_mem() has nothing to do with any particular
 architecture it won't work (at least in current implementation) for X86.
 
 This is because on X86 gd is an alias to function get_fs_gd_ptr(),
 thus we cannot assign anything to it.
 
 So this change separates selection of board_init_f_mem() from X86 while
 keeping it disabled for X86 still.
 
 Signed-off-by: Alexey Brodkin abrod...@synopsys.com
 Cc: Simon Glass s...@chromium.org
 Cc: Tom Rini tr...@konsulko.com

If there're no objections on this one could it be applied?

This patch is a pre-requisite for ARC-update series, in particular for
this patch - http://patchwork.ozlabs.org/patch/450963/

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 5/7] malloc_f: enable SYS_MALLOC_F by default if DM is on

2015-03-27 Thread Alexey Brodkin
Hello Masahiro-san,

On Mon, 2015-03-23 at 15:33 -0600, Simon Glass wrote:
 On 19 March 2015 at 04:42, Masahiro Yamada
 yamada.masah...@socionext.com wrote:
  This option has a bool type, not hex.
  Fix it and enable it if CONFIG_DM is on because Driver Model always
  requires malloc memory.  Devices are scanned twice, before/after
  relocation.  CONFIG_SYS_MALLOC_F should be enabled to use malloc
  memory before relocation.  As it is board-independent, handle it
  globally.
 
  Signed-off-by: Masahiro Yamada yamada.masah...@socionext.com
  Acked-by: Stephen Warren swar...@wwwdotorg.org
  ---
 
  Changes in v2:
- Fix a typo   s/not board-independent/board-independent/
 
 Reviewed-by: Simon Glass s...@chromium.org

I'm wondering if your series Some improvements related to build system
is going to be applied to u-boot master branch anytime soon?

I have pending update series for ARC where I'm enabling use of Device
Model. For this I need to use SYS_MALLOC_F (is required by
CONFIG_DM_SERIAL).

So I'm interested in your patch  [PATCH v3 5/7] malloc_f: enable
SYS_MALLOC_F by default if DM is on in particular. Without it I'll need
to add SYS_MALLOC_F in arch/arc/Kconfig.

-Alexey
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


<    1   2   3   4   5   6   7   8   >