Re: [U-Boot] [PATCH v3 4/4] arm: ls102xa: Enable Driver Model SPI for ls1021atwr

2015-06-25 Thread Jagan Teki
On 26 June 2015 at 08:43, Wang Haikun  wrote:
> On 6/25/2015 9:24 PM, Jagan Teki wrote:
>> On 19 June 2015 at 13:44, Jagan Teki  wrote:
>>> On 19 June 2015 at 13:20, Wang Haikun  wrote:
 On 6/19/2015 3:34 PM, Jagan Teki wrote:
> On 18 June 2015 at 12:24, Jagan Teki  wrote:
>> On 18 June 2015 at 07:50, Wang Haikun  wrote:
>>> On 6/17/2015 8:30 PM, Simon Glass wrote:
 Hi,

 On 17 June 2015 at 03:36, Bin Meng  wrote:
> Hi Haikun,
>
> On Mon, May 18, 2015 at 9:25 PM, Haikun Wang 
>  wrote:
>> From: Haikun Wang 
>>
>> Enable Driver Model SPI for ls1021atwr board.
>> DSPI and QSPI only be enabled when boot from QSPI.
>> DSPI and QSPI are compatible under Driver Model SPI.
>>
>> Signed-off-by: Haikun Wang 
>> Change-Id: I6342807da7725ae8b678952117c8758c75a61d3d
>
> Where is this commit id? I couldn't see it on "git log"
 Hi Jagan,

 It is not a git commit ID, it is a code review task ID of gerrit in fact.
 I'm sorry again for forgetting remove it when submit patch.

 Best regards,
 Wang Haikun
>
>> Reviewed-on: http://git.am.freescale.net:8181/33447>
>>> Best regards,
>>> Wang Haikun

>
> Is this URL Freescale internal? I cannot access it.
>

 Looks like it. BTW patman will remove these Gerrit tags automatically.
>>> Yes, it is our internal URL.
>>> I forget to remove it.
>>> It couldn't be better if it will be removed automatically.
>>
>> I will remove if something not remove automatically.
>>
>> Anyone have any comments on these patch-set, I'm planning to take these.
>>
>> https://patchwork.ozlabs.org/patch/473391/
>> https://patchwork.ozlabs.org/patch/473392/
>>
>> https://patchwork.ozlabs.org/patch/473393/
>> https://patchwork.ozlabs.org/patch/473394/
>> Few CONFIG_DM_* were missing in these two patches, did these patches
>> have any dependencies with other series, please look at and let me know.
>
> I found that macro IS_ENABLED(CONFIG_XXX) is only work with configure
> option in Kconfig, and DM core code use IS_ENABLED(), so configure
> option in head file can't work, so remove CONFIG_OF_CONTROL
> CONFIG_OF_SEPARATE CONFIG_DM CONFIG_DM_SPI in the head file.

Please send the patch for this fix, found build errors by picking these patches.

thanks!
-- 
Jagan | openedev.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] corrupted tags in git://git.denx.de/u-boot ?

2015-06-25 Thread Wolfgang Denk
Dear Tom,
dear Igor,

In message <20150625132731.GC28577@bill-the-cat> you wrote:
> 
> > > It seems that the check for termination with '\n' in tag headers
> > > started to be a requirement from git version 2.2.0?
...
> > So apparently the tags  LABEL_2006_03_12_0025, LABEL_2006_04_18_1106,
> > and LABEL_2006_05_19_1133 are affected.
...
> > IIUC it should be a harmless thing to just recreate the same tags
> > (referring to the same commits)?  Or can anybody see any problems tha
> > might be caused by such a tag re-creation?  I mean, it is not like a
> > rebase of the repository or something like that?  Right?
> 
> Lets take it up on the git list and ask for help/advice?

Well, the summary of the comments on the git list is like this:

I am inclined to say that these messages are that recent Git
barking at a non-errors, and hopefully there is nothing other
than ignoring them you have to do until it gets fixed.

See [1] for more details.

At the moment I tend to just wait for the results of the ongoing
discussion,  It appears to me that we might need no changes to the
existing repo.

[1] http://thread.gmane.org/gmane.comp.version-control.git/272689/focus=272704

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What is mind?  No matter.  What is matter?  Never mind.
  -- Thomas Hewitt Key, 1799-1875
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 32/54] mmc: Calculate dwmmc FIFO threshold size if not provided

2015-06-25 Thread Jaehoon Chung
Hi, Simon.

On 06/26/2015 04:26 AM, Simon Glass wrote:
> Hi Jaehoon,
> 
> On 24 June 2015 at 19:58, Jaehoon Chung  wrote:
>>
>> Hi, Simon.
>>
>> On 06/24/2015 06:38 AM, Simon Glass wrote:
>>> We can calculate this. Add code to do this if it is not provided.
>>
>> Did you consider the kernel side?
> 
> Can you please be more specific?

I didn't check now for fifoth value.
But as i know (in my experiment), if it's not defined fifoth_val into kernel dt 
file,
fifoth value is calculated with value of reading register.

Well, i think your patch is right.
(It needs to calculate the exactly fifoth_val.)

The below case should be problem.

1. Calculate and set the fifoth value at bootloader.
fifoth register = 0x203f0040
2. If fifoth_val doesn't set into dt-file(kernel), on kernel side re-calculate 
fifoth value.
Should be fifo_size = 3f, since fifoth register's value is 0x203f0040.
and fifoth register should be set to 0x201e001f.(just example.)

So i will try to find more generic solution for this problem.
If i missed something, let me know, plz. :)

Actually, this case is complicated case.

Best Regards,
Jaehoon Chung

> 
> Regards,1
> Simon
> 
>>
>> Best Regards,
>> Jaehoon Chung
>>
>>>
>>> Signed-off-by: Simon Glass 
>>> ---
>>>
>>> Changes in v3: None
>>> Changes in v2: None
>>>
>>>  drivers/mmc/dw_mmc.c | 10 --
>>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
>>> index a034c3f..cce2a5d 100644
>>> --- a/drivers/mmc/dw_mmc.c
>>> +++ b/drivers/mmc/dw_mmc.c
>>> @@ -355,9 +355,15 @@ static int dwmci_init(struct mmc *mmc)
>>>   dwmci_writel(host, DWMCI_IDINTEN, 0);
>>>   dwmci_writel(host, DWMCI_BMOD, 1);
>>>
>>> - if (host->fifoth_val) {
>>> - dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
>>> + if (!host->fifoth_val) {
>>> + uint32_t fifo_size;
>>> +
>>> + fifo_size = dwmci_readl(host, DWMCI_FIFOTH);
>>> + fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 
>>> 1;
>>> + host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) |
>>> + TX_WMARK(fifo_size / 2);
>>>   }
>>> + dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
>>>
>>>   dwmci_writel(host, DWMCI_CLKENA, 0);
>>>   dwmci_writel(host, DWMCI_CLKSRC, 0);
>>>
>>
> 

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


[U-Boot] [Resend: U-Boot PATCH] keystone2: config: update default mtd

2015-06-25 Thread Michael Scherban
Because of a difference in the ordering of MTDs, the current bootarg is
pointing to a MTD without a root filesystem. This updates the default
MTD to point to the correct one that contains the filesystem.

Signed-off-by: Michael Scherban 
---
 include/configs/k2e_evm.h  |2 +-
 include/configs/k2hk_evm.h |2 +-
 include/configs/k2l_evm.h  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/k2e_evm.h b/include/configs/k2e_evm.h
index d83e07e..69b0254 100644
--- a/include/configs/k2e_evm.h
+++ b/include/configs/k2e_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c14\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,2048\0"   \
"name_fdt=uImage-k2e-evm.dtb\0" \
"name_mon=skern-k2e-evm.bin\0"  \
"name_ubi=k2e-evm-ubifs.ubi\0"  \
diff --git a/include/configs/k2hk_evm.h b/include/configs/k2hk_evm.h
index ffddf13..43c474c 100644
--- a/include/configs/k2hk_evm.h
+++ b/include/configs/k2hk_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c5f\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,2048\0"   \
"name_fdt=uImage-k2hk-evm.dtb\0"\
"name_mon=skern-k2hk-evm.bin\0" \
"name_ubi=k2hk-evm-ubifs.ubi\0" \
diff --git a/include/configs/k2l_evm.h b/include/configs/k2l_evm.h
index 805164a..b4f2eec 100644
--- a/include/configs/k2l_evm.h
+++ b/include/configs/k2l_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c14\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,4096\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,4096\0"   \
"name_fdt=uImage-k2l-evm.dtb\0" \
"name_mon=skern-k2l-evm.bin\0"  \
"name_ubi=k2l-evm-ubifs.ubi\0"  \
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH v3 4/4] arm: ls102xa: Enable Driver Model SPI for ls1021atwr

2015-06-25 Thread Wang Haikun
On 6/25/2015 9:24 PM, Jagan Teki wrote:
> On 19 June 2015 at 13:44, Jagan Teki  wrote:
>> On 19 June 2015 at 13:20, Wang Haikun  wrote:
>>> On 6/19/2015 3:34 PM, Jagan Teki wrote:
 On 18 June 2015 at 12:24, Jagan Teki  wrote:
> On 18 June 2015 at 07:50, Wang Haikun  wrote:
>> On 6/17/2015 8:30 PM, Simon Glass wrote:
>>> Hi,
>>>
>>> On 17 June 2015 at 03:36, Bin Meng  wrote:
 Hi Haikun,

 On Mon, May 18, 2015 at 9:25 PM, Haikun Wang 
  wrote:
> From: Haikun Wang 
>
> Enable Driver Model SPI for ls1021atwr board.
> DSPI and QSPI only be enabled when boot from QSPI.
> DSPI and QSPI are compatible under Driver Model SPI.
>
> Signed-off-by: Haikun Wang 
> Change-Id: I6342807da7725ae8b678952117c8758c75a61d3d

 Where is this commit id? I couldn't see it on "git log"
>>> Hi Jagan,
>>>
>>> It is not a git commit ID, it is a code review task ID of gerrit in fact.
>>> I'm sorry again for forgetting remove it when submit patch.
>>>
>>> Best regards,
>>> Wang Haikun

> Reviewed-on: http://git.am.freescale.net:8181/33447>
>> Best regards,
>> Wang Haikun
>>>

 Is this URL Freescale internal? I cannot access it.

>>>
>>> Looks like it. BTW patman will remove these Gerrit tags automatically.
>> Yes, it is our internal URL.
>> I forget to remove it.
>> It couldn't be better if it will be removed automatically.
>
> I will remove if something not remove automatically.
>
> Anyone have any comments on these patch-set, I'm planning to take these.
>
> https://patchwork.ozlabs.org/patch/473391/
> https://patchwork.ozlabs.org/patch/473392/
>
> https://patchwork.ozlabs.org/patch/473393/
> https://patchwork.ozlabs.org/patch/473394/
> Few CONFIG_DM_* were missing in these two patches, did these patches
> have any dependencies with other series, please look at and let me know.

I found that macro IS_ENABLED(CONFIG_XXX) is only work with configure 
option in Kconfig, and DM core code use IS_ENABLED(), so configure 
option in head file can't work, so remove CONFIG_OF_CONTROL 
CONFIG_OF_SEPARATE CONFIG_DM CONFIG_DM_SPI in the head file.
>
> thanks!
>

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


Re: [U-Boot] [PATCH] keystone2: config: update default mtd

2015-06-25 Thread Tom Rini
On Thu, Jun 25, 2015 at 03:18:29PM -0500, Michael Scherban wrote:

> Because of a difference in the ordering of MTDs, the current bootarg is
> pointing to a MTD without a root filesystem. This updates the default MTD to
> point to the correct one that contains the filesystem.
> 
> Signed-off-by: Michael Scherban 

This is indeed an annoying problem.  The best fix is what we changed
am335x/am43xx to which is passing the name of the partition (from
MTDPARTS).

-- 
Tom


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


Re: [U-Boot] corrupted tags in git://git.denx.de/u-boot ?

2015-06-25 Thread Joe Hershberger
Hi Igor,

On Tue, Jun 23, 2015 at 7:13 AM, Igor Grinberg  wrote:
> Hi guys,
>
> While running git fsck --full, I've noticed the following:
> ---cut-
> $ git fsck --full
> Checking object directories: 100% (256/256), done.
> error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
> error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
> error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
> Checking objects: 100% (356677/356677), done.
> Checking connectivity: 356680, done.
> ---cut-
>
> So, I did git describe on those:
> ---cut-
> $ git describe 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee 
> c7071e6d645a8e13adb0d4cea2caad27213fa62f 
> eb394f56db3e05d00891d6dc36a00df0025cf255
> LABEL_2006_04_18_1106
> LABEL_2006_05_19_1133
> LABEL_2006_03_12_0025
> ---cut-
>
> Having no apparent need of those tags, I just git tag -d them and git gc:
> ---cut-
> $ git tag -d LABEL_2006_03_12_0025 LABEL_2006_04_18_1106 LABEL_2006_05_19_1133
> Deleted tag 'LABEL_2006_03_12_0025' (was eb394f5)
> Deleted tag 'LABEL_2006_04_18_1106' (was 9bf86ba)
> Deleted tag 'LABEL_2006_05_19_1133' (was c7071e6)
> $ git gc --prune=now
> Counting objects: 356677, done.
> Delta compression using up to 8 threads.
> Compressing objects: 100% (64947/64947), done.
> Writing objects: 100% (356677/356677), done.
> Total 356677 (delta 285384), reused 356677 (delta 285384)
> Checking connectivity: 356677, done.
> ---cut-
>
> After the above git fsck --full got much happier:
> ---cut-
> $ git fsck --full
> Checking object directories: 100% (256/256), done.
> Checking objects: 100% (356677/356677), done.
> Checking connectivity: 356677, done.
> ---cut-
>
> Now, next time I git remote update, I get them back:
> ---cut-
> $ git remote update
> Fetching origin
> remote: Counting objects: 3, done.
> remote: Compressing objects: 100% (3/3), done.
> remote: Total 3 (delta 0), reused 3 (delta 0)
> Unpacking objects: 100% (3/3), done.
> From git://git.denx.de/u-boot
>  * [new tag] LABEL_2006_03_12_0025 -> LABEL_2006_03_12_0025
>  * [new tag] LABEL_2006_04_18_1106 -> LABEL_2006_04_18_1106
>  * [new tag] LABEL_2006_05_19_1133 -> LABEL_2006_05_19_1133
> ---cut-
>
> and once again git fsck --full complains:
> ---cut-
> $ git fsck --full
> Checking object directories: 100% (256/256), done.
> error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
> error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
> error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
> Checking objects: 100% (356677/356677), done.
> Checking connectivity: 356680, done.
> ---cut-
>
> Is it only me suffering from some kind of corruption on remote update
> or do we all have the same problem and I'm the first to notice (or just
> missed a thread about this)?

I don't see this either.

Have you tried a fresh clone?

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


Re: [U-Boot] [PATCH 14/14][v2] driver/ldpaa_eth:Avoid infinite loop in QBMAN buf release

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:03 AM, Prabhakar Kushwaha
 wrote:
> Change infinite loop mechanism to timer based polling.
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Sending as it is for patchset
>
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 13 +++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c 
> b/drivers/net/ldpaa_eth/ldpaa_eth.c
> index 839e78a..fe8f189 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.c
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
> @@ -31,6 +31,8 @@ static void ldpaa_eth_rx(struct ldpaa_eth_priv *priv,
> uint32_t fd_length;
> struct ldpaa_fas *fas;
> uint32_t status, err;
> +   u32 timeo = (CONFIG_SYS_HZ * 2) / 1000;
> +   u32 time_start;
> struct qbman_release_desc releasedesc;
> struct qbman_swp *swp = dflt_dpio->sw_portal;
>
> @@ -65,10 +67,15 @@ error:
> flush_dcache_range(fd_addr, fd_addr + LDPAA_ETH_RX_BUFFER_SIZE);
> qbman_release_desc_clear(&releasedesc);
> qbman_release_desc_set_bpid(&releasedesc, dflt_dpbp->dpbp_attr.bpid);
> +   time_start = get_timer(0);
> do {
> /* Release buffer into the QBMAN */
> err = qbman_swp_release(swp, &releasedesc, &fd_addr, 1);
> -   } while (err == -EBUSY);
> +   } while (get_timer(time_start) < timeo && err == -EBUSY);
> +
> +   if (get_timer(time_start) >= timeo)

Can't you just check the value of err here instead of calling this
function again? That would also eliminate the race condition.

> +   printf("Rx frame: QBMAN buffer release fails\n");
> +
> return;
>  }
>
> @@ -195,11 +202,13 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, 
> void *buf, int len)
>  error:
> qbman_release_desc_clear(&releasedesc);
> qbman_release_desc_set_bpid(&releasedesc, dflt_dpbp->dpbp_attr.bpid);
> +   time_start = get_timer(0);
> do {
> /* Release buffer into the QBMAN */
> err = qbman_swp_release(swp, &releasedesc, &buffer_start, 1);
> -   } while (err == -EBUSY);
> +   } while (get_timer(time_start) < timeo && err == -EBUSY);

It looks like you are addressing the infinite loop you added in a
previous patch. Instead of making it tag along with this patch, you
should squash the _tx side into that original patch.

>
> +   printf("TX data: QBMAN buffer release fails\n");

This message seems wrong. The release didn't necessarily fail. Only
the qbman_swp_dqrr_next() definitely failed here.

> return err;
>  }
>
> --
> 1.9.1
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 13/14][v2] driver/ldpaa_eth: Avoid TX conf frames

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:03 AM, Prabhakar Kushwaha
 wrote:
> Polling of TX conf frames is not a mandatory option.
> Packets can be transferred via WRIOP without TX conf frame.
>
> Configure ldpaa_eth driver to use TX path without confirmation frame
>
> Signed-off-by: Prabhakar Kushwaha 
> ---

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


Re: [U-Boot] [PATCH 12/14][v2] driver/ldpaa_eth: Add timeout handling DQRR entry read

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:03 AM, Prabhakar Kushwaha
 wrote:
> Volatile command does not return frame immidiately, need to wait till a frame
> is available in DQRR. Ideally it should be a blocking call.
>
> Add timeout handling for DQRR frame instead of retry counter.
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Sending as it is for patchset
>
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 36 ++--
>  1 file changed, 22 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c 
> b/drivers/net/ldpaa_eth/ldpaa_eth.c
> index 2716f6c..adb964c 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.c
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
> @@ -77,7 +77,9 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device *dev)
> struct ldpaa_eth_priv *priv = (struct ldpaa_eth_priv *)dev->priv;
> const struct ldpaa_dq *dq;
> const struct dpaa_fd *fd;
> -   int i = 5, err = 0, status, loop = 20;
> +   int i = 5, err = 0, status;
> +   u32 timeo = (CONFIG_SYS_HZ * 2) / 1000;
> +   u32 time_start;
> static struct qbman_pull_desc pulldesc;
> struct qbman_swp *swp = dflt_dpio->sw_portal;
>
> @@ -92,13 +94,11 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device 
> *dev)
> continue;
> }
>
> -   do {
> -   loop--;
> -   dq = qbman_swp_dqrr_next(swp);
> +   time_start = get_timer(0);
>
> -   if (!loop)
> -   break;
> -   } while (!dq);
> +do {
> +   dq = qbman_swp_dqrr_next(swp);
> +   } while (get_timer(time_start) < timeo && !dq);
>
> if (dq) {
> /* Check for valid frame. If not sent a consume
> @@ -121,6 +121,10 @@ static int ldpaa_eth_pull_dequeue_rx(struct eth_device 
> *dev)
> ldpaa_eth_rx(priv, fd);
> qbman_swp_dqrr_consume(swp, dq);
> break;
> +   } else {
> +   err = -1;

Use -EBUSY instead?

> +   debug("No DQRR entries\n");
> +   break;
> }
> }
>
> @@ -167,7 +171,9 @@ static int ldpaa_eth_pull_dequeue_tx_conf(struct 
> ldpaa_eth_priv *priv)
> const struct ldpaa_dq *dq;
> const struct dpaa_fd *fd;
> int err = 0;
> -   int i = 5, status, loop = 20;
> +   int i = 5, status;
> +   u32 timeo = (CONFIG_SYS_HZ * 10) / 1000;
> +   u32 time_start;
> static struct qbman_pull_desc pulldesc;
> struct qbman_swp *swp = dflt_dpio->sw_portal;
>
> @@ -182,13 +188,11 @@ static int ldpaa_eth_pull_dequeue_tx_conf(struct 
> ldpaa_eth_priv *priv)
> continue;
> }
>
> -   do {
> -   loop--;
> -   dq = qbman_swp_dqrr_next(swp);
> +   time_start = get_timer(0);
>
> -   if (!loop)
> -   break;
> -   } while (!dq);
> +do {
> +   dq = qbman_swp_dqrr_next(swp);
> +   } while (get_timer(time_start) < timeo && !dq);
>
> if (dq) {
> /* Check for valid frame. If not sent a consume
> @@ -209,6 +213,10 @@ static int ldpaa_eth_pull_dequeue_tx_conf(struct 
> ldpaa_eth_priv *priv)
> ldpaa_eth_tx_conf(priv, fd);
> qbman_swp_dqrr_consume(swp, dq);
> break;
> +   } else {
> +   err = -1;

Use -EBUSY instead?

> +   debug("No DQRR entries\n");
> +   break;
> }
> }
>
> --
> 1.9.1
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 11/14][v2] driver/ldpaa_eth: Retry enqueue if portal was busy

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:03 AM, Prabhakar Kushwaha
 wrote:
> Do not immediately return if the enqueue function returns -EBUSY; re-try
> mulitple times.
>
> if timeout occures, release the buffer.
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Sending as it is for patchset
>
>  drivers/net/ldpaa_eth/ldpaa_eth.c | 26 --
>  1 file changed, 24 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ldpaa_eth/ldpaa_eth.c 
> b/drivers/net/ldpaa_eth/ldpaa_eth.c
> index 5636511..2716f6c 100644
> --- a/drivers/net/ldpaa_eth/ldpaa_eth.c
> +++ b/drivers/net/ldpaa_eth/ldpaa_eth.c
> @@ -221,8 +221,11 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void 
> *buf, int len)
> struct dpaa_fd fd;
> u64 buffer_start;
> int data_offset, err;
> +   u32 timeo = (CONFIG_SYS_HZ * 10) / 1000;
> +   u32 time_start;
> struct qbman_swp *swp = dflt_dpio->sw_portal;
> struct qbman_eq_desc ed;
> +   struct qbman_release_desc releasedesc;
>
> /* Setup the FD fields */
> memset(&fd, 0, sizeof(fd));
> @@ -258,9 +261,18 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void 
> *buf, int len)
> qbman_eq_desc_clear(&ed);
> qbman_eq_desc_set_no_orp(&ed, 0);
> qbman_eq_desc_set_qd(&ed, priv->tx_qdid, priv->tx_flow_id, 0);
> -   err = qbman_swp_enqueue(swp, &ed, (const struct qbman_fd *)(&fd));
> +
> +   time_start = get_timer(0);
> +
> +   while (get_timer(time_start) < timeo) {
> +   err = qbman_swp_enqueue(swp, &ed,
> +   (const struct qbman_fd *)(&fd));
> +   if (err != -EBUSY)
> +   break;
> +   }
> +
> if (err < 0)
> -   printf("error enqueueing Tx frame\n");
> +   goto error;
>
> mdelay(1);
>
> @@ -269,6 +281,16 @@ static int ldpaa_eth_tx(struct eth_device *net_dev, void 
> *buf, int len)
> printf("error Tx Conf frame\n");
>
> return err;
> +
> +error:
> +   qbman_release_desc_clear(&releasedesc);
> +   qbman_release_desc_set_bpid(&releasedesc, dflt_dpbp->dpbp_attr.bpid);
> +   do {
> +   /* Release buffer into the QBMAN */
> +   err = qbman_swp_release(swp, &releasedesc, &buffer_start, 1);
> +   } while (err == -EBUSY);

Are you sure it's 100% safe to have this infinite loop here? Is there
a guarantee that qbman_swp_release() will stop returning -EBUSY?

> +
> +   return err;
>  }
>
>  static int ldpaa_eth_open(struct eth_device *net_dev, bd_t *bd)
> --
> 1.9.1
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 07/14][v2] drivers: fsl-mc: Return error for major version mismatch

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:03 AM, Prabhakar Kushwaha
 wrote:
> Management complex major version should match to the firmware present in 
> flash.
>
> Return error during mismatch of major version.
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
> Changes for v2: Sending as it is for patchset
>
>  drivers/net/fsl-mc/mc.c | 7 ++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
> index 2094595..c4406c6 100644
> --- a/drivers/net/fsl-mc/mc.c
> +++ b/drivers/net/fsl-mc/mc.c
> @@ -518,9 +518,14 @@ int mc_init(void)
> goto out;
> }
>
> -   if (MC_VER_MAJOR != mc_ver_info.major)
> +   if (MC_VER_MAJOR != mc_ver_info.major) {
> printf("fsl-mc: ERROR: Firmware major version mismatch 
> (found: %d, expected: %d)\n",
>mc_ver_info.major, MC_VER_MAJOR);
> +   printf("fsl-mc: Update the Management Complex firmware\n");
> +
> +   error = 1;

Please use:
+   error = -ENODEV;

> +   goto out;
> +   }
>
> if (MC_VER_MINOR != mc_ver_info.minor)
> printf("fsl-mc: WARNING: Firmware minor version mismatch 
> (found: %d, expected: %d)\n",
> --
> 1.9.1
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 01/14][v2] armv8/ls2085a: define CONFIG_PCI

2015-06-25 Thread Joe Hershberger
Hi Prabhakar,

On Thu, Jun 11, 2015 at 4:02 AM, Prabhakar Kushwaha
 wrote:
> LS2085A has 4 PCIe controller. Enable CONFIG_PCI to init PCIe
>
> Signed-off-by: Prabhakar Kushwaha 
> ---
>  include/configs/ls2085a_common.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/configs/ls2085a_common.h 
> b/include/configs/ls2085a_common.h
> index cf51909..45306c1 100644
> --- a/include/configs/ls2085a_common.h
> +++ b/include/configs/ls2085a_common.h
> @@ -189,6 +189,7 @@ unsigned long long get_qixis_addr(void);
>  #endif
>
>  /* PCIe */
> +#define CONFIG_PCI

Please add this to your _defconfig files instead.

>  #define CONFIG_PCIE1   /* PCIE controler 1 */
>  #define CONFIG_PCIE2   /* PCIE controler 2 */
>  #define CONFIG_PCIE3   /* PCIE controler 3 */
> --
> 1.9.1
>
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 50/54] mkimage: Set up a file size parameter and keep it updated

2015-06-25 Thread Joe Hershberger
Hi Simon,

On Tue, Jun 23, 2015 at 4:39 PM, Simon Glass  wrote:
> Some functions called by mkimage would like to know the output file size.
> Initially this is the same as the input file size, but it may be affected by
> adding headers, etc.
>
> Add this information to the image parameters.
>
> Signed-off-by: Simon Glass 
> ---

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


Re: [U-Boot] [PATCH 10/11 v2] drivers/net/vsc9953: Add commands for VLAN ingress filtering

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The command:
> ethsw [port ] ingress filtering
>  { [help] | show | enable | disable }
>   - enable/disable VLAN ingress filtering on port
>
> can be used to enable/disable/show VLAN ingress filtering on a port.
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 137 
> ++
>  1 file changed, 137 insertions(+)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 3129b03..d5520d9 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -1555,6 +1555,33 @@ static int vsc9953_vlan_learning_get(enum 
> vlan_learning_mode *lrn_mode)
> return 0;
>  }
>
> +/* Enable/disable VLAN ingress filtering on a VSC9953 port */
> +static void vsc9953_port_ingress_filtering_set(int port_no, int enabled)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   if (enabled)
> +   setbits_le32(&l2ana_reg->ana.vlan_mask, 1 << port_no);
> +   else
> +   clrbits_le32(&l2ana_reg->ana.vlan_mask, 1 << port_no);
> +}
> +
> +/* Show VLAN ingress filtering on a VSC9953 port */
> +static void vsc9953_port_ingress_filtering_get(int port_no, int *enabled)

Why not just return the enabled status instead of a pointer?

> +{
> +   u32 val;
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   val = in_le32(&l2ana_reg->ana.vlan_mask);
> +   *enabled = !!(val & (1 << port_no));
> +}
> +
>  enum egress_vlan_tag {
> EGR_TAG_CLASS = 0,
> EGR_TAG_PVID,
> @@ -1626,6 +1653,8 @@ enum keyword_id {
> id_classified,
> id_shared,
> id_private,
> +   id_ingress,
> +   id_filtering,
> id_count,   /* keep last */
>  };
>
> @@ -2031,6 +2060,68 @@ static int vsc9953_port_untag_set_key_func(struct 
> command_def *parsed_cmd)
> return 0;
>  }
>
> +#define VSC9953_PORT_INGR_FLTR_HELP "ethsw [port ] ingress 
> filtering" \
> +" { [help] | show | enable | disable } " \
> +"- enable/disable VLAN ingress filtering on port"
> +
> +static int vsc9953_ingr_fltr_help_key_func(struct command_def *parsed_cmd)
> +{
> +   printf(VSC9953_PORT_INGR_FLTR_HELP"\n");
> +
> +   return 0;

Please use:
+   return CMD_RET_SUCCESS;

> +}
> +
> +static int vsc9953_ingr_fltr_show_key_func(struct command_def *parsed_cmd)
> +{
> +   int i, enabled;

Use one space and put each variable on a separate line.

> +
> +   printf("%7s\t%18s\n", "Port", "Ingress filtering");
> +   if (parsed_cmd->port != VSC9953_CMD_PORT_ALL) {
> +   vsc9953_port_ingress_filtering_get(parsed_cmd->port, 
> &enabled);
> +   printf("%7d\t%18s\n", parsed_cmd->port, enabled ? "enable" :
> + "disable");
> +   } else {
> +   for (i = 0; i < VSC9953_MAX_PORTS; i++) {
> +   vsc9953_port_ingress_filtering_get(i, &enabled);
> +   printf("%7d\t%18s\n", parsed_cmd->port, enabled ?
> +   "enable" :
> +   "disable");
> +   }
> +   }
> +
> +   return 0;

Please use:
+   return CMD_RET_SUCCESS;

> +}
> +
> +static int vsc9953_ingr_fltr_set_key_func(struct command_def *parsed_cmd)
> +{
> +   int i, enable;

Use one space and put each variable on a separate line.

> +
> +   /* keywords for enabling/disabling ingress filtering
> +* are the last in the array
> +*/
> +   if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] ==
> +   id_enable)
> +   enable = 1;
> +   else if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] 
> ==
> +id_disable)
> +   enable = 0;
> +   else
> +   return -1;

Please use:
+  return CMD_RET_USAGE;

> +
> +   if (parsed_cmd->port != VSC9953_CMD_PORT_ALL) {
> +   if (!VSC9953_PORT_CHECK(parsed_cmd->port)) {
> +   printf("Invalid port number: %d\n", parsed_cmd->port);
> +   return -1;

Please use:
+ return CMD_RET_USAGE;

> +   }
> +   vsc9953_port_ingress_filtering_set(parsed_cmd->port, enable);
> +   } else {
> +   for (i = 0; i < VSC9953_MAX_PORTS; i++)
> +   vsc9953_port_ingress_filtering_set(i, enable);
> +   }
> +
> +

Re: [U-Boot] [PATCH 09/11 v2] drivers/net/vsc9953: Add command for shared/private VLAN learning

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The command:
> ethsw vlan fdb { [help] | show | shared | private }
>  - make VLAN learning shared or private"
>
> configures the FDB to share the FDB entries learned on multiple VLANs
> or to keep them separated. By default, the FBD uses private VLAN
> learning.
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 155 
> ++
>  include/vsc9953.h |   3 +
>  2 files changed, 158 insertions(+)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index b78a941..3129b03 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -1503,6 +1503,58 @@ static void vsc9953_mac_table_flush(int port, int vid)
> vsc9953_mac_table_age(port, vid);
>  }
>
> +/* VSC9953 VLAN learning modes */
> +enum vlan_learning_mode {
> +   SHARED_VLAN_LEARNING,
> +   PRIVATE_VLAN_LEARNING,
> +};
> +
> +/* Set VLAN learning mode for VSC9953 */
> +static void vsc9953_vlan_learning_set(enum vlan_learning_mode lrn_mode)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;

Use a single space.

> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   switch (lrn_mode) {
> +   case SHARED_VLAN_LEARNING:
> +   setbits_le32(&l2ana_reg->ana.agen_ctrl,
> +CONFIG_VSC9953_FID_MASK_ALL);
> +   break;
> +   case PRIVATE_VLAN_LEARNING:
> +   clrbits_le32(&l2ana_reg->ana.agen_ctrl,
> +CONFIG_VSC9953_FID_MASK_ALL);
> +   break;
> +   default:
> +   printf("Unknown VLAN learn mode\n");
> +   }
> +}
> +
> +/* Get VLAN learning mode for VSC9953 */
> +static int vsc9953_vlan_learning_get(enum vlan_learning_mode *lrn_mode)
> +{
> +   u32 val;
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   val = in_le32(&l2ana_reg->ana.agen_ctrl);
> +
> +   if (!(val & CONFIG_VSC9953_FID_MASK_ALL)) {
> +   *lrn_mode = PRIVATE_VLAN_LEARNING;
> +   } else if ((val & CONFIG_VSC9953_FID_MASK_ALL) ==
> +   CONFIG_VSC9953_FID_MASK_ALL) {
> +   *lrn_mode = SHARED_VLAN_LEARNING;
> +   } else {
> +   printf("Unknown VLAN learning mode\n");
> +   return -EINVAL;

Please use:
+   return CMD_RET_FAILURE;

> +   }
> +
> +   return 0;

Please use:
+   return CMD_RET_SUCCESS;

> +}
> +
>  enum egress_vlan_tag {
> EGR_TAG_CLASS = 0,
> EGR_TAG_PVID,
> @@ -1572,6 +1624,8 @@ enum keyword_id {
> id_egress,
> id_tag,
> id_classified,
> +   id_shared,
> +   id_private,
> id_count,   /* keep last */
>  };
>
> @@ -1868,6 +1922,61 @@ static int vsc9953_vlan_set_key_func(struct 
> command_def *parsed_cmd)
> return 0;
>  }
>
> +#define VSC9953_VLAN_FDB_HELP "ethsw vlan fdb " \
> +"{ [help] | show | shared | private } " \
> +"- make VLAN learning shared or private"
> +
> +static int vsc9953_vlan_learn_help_key_func(struct command_def *parsed_cmd)
> +{
> +   printf(VSC9953_VLAN_FDB_HELP"\n");
> +
> +   return 0;

Please use:
+   return CMD_RET_SUCCESS;

> +}
> +
> +static int vsc9953_vlan_learn_show_key_func(struct command_def *parsed_cmd)
> +{
> +   int rc;
> +   enum vlan_learning_mode mode;
> +
> +   rc = vsc9953_vlan_learning_get(&mode);
> +   if (rc)
> +   goto __out_return;
> +
> +   switch (mode) {
> +   case SHARED_VLAN_LEARNING:
> +   printf("VLAN learning mode: shared\n");
> +   break;
> +   case PRIVATE_VLAN_LEARNING:
> +   printf("VLAN learning mode: private\n");
> +   break;
> +   default:
> +   printf("Unknown VLAN learning mode\n");
> +   rc = -EINVAL;

Please use:
+  rc =CMD_RET_FAILURE;

> +   }
> +
> +__out_return:
> +   return rc;
> +}
> +
> +static int vsc9953_vlan_learn_set_key_func(struct command_def *parsed_cmd)
> +{
> +   enum vlan_learning_mode mode;
> +
> +   /* keywords for shared/private are the last in the array */
> +   if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] ==
> +   id_shared)
> +   mode = SHARED_VLAN_LEARNING;
> +   else if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] 
> ==
> +id_private)
> +   mode = PRIVATE_VLAN_LEARNING;
> +   else
> +   return -1;

Please use:
+   return CMD_RET_USAGE;

> +
> +   vsc9953_vlan_learning_set(mode);
> 

Re: [U-Boot] [PATCH 08/11 v2] drivers/net/vsc9953: Add VLAN commands for VSC9953

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The new added commands can be used to configure VLANs for a port
> on both ingress and egress.
>
> The new commands are:
> ethsw [port ] pvid { [help] | show |  }
>  - set/show PVID (ingress and egress VLAN tagging) for a port;
> ethsw [port ] vlan { [help] | show | add  | del  }
>  - add a VLAN to a port (VLAN members);
> ethsw [port ] untagged { [help] | show | all | none | pvid }
>  - set egress tagging mod for a port"
> ethsw [port ] egress tag { [help] | show | pvid | classified }
>  - Configure VID source for egress tag. Tag's VID could be the
>frame's classified VID or the PVID of the port
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 678 
> +-
>  include/vsc9953.h |   3 +
>  2 files changed, 680 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index ef7b50c..b78a941 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -270,6 +270,31 @@ static void vsc9953_port_vlan_pvid_set(int port_no, int 
> pvid)
> field_set(pvid, 
> CONFIG_VSC9953_PORT_VLAN_CFG_VID_MASK));
>  }
>
> +#ifdef CONFIG_VSC9953_CMD

Why does this need to be defined outside of the #ifdef already at the
bottom of the file?

> +/* Set PVID for a VSC9953 port */
> +static int vsc9953_port_vlan_pvid_get(int port_nr, int *pvid)
> +{
> +   u32 val;

Use a single space.

> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   /* Administrative down */
> +   if ((!vsc9953_l2sw.port[port_nr].enabled)) {

Why do you have double "((" and "))"?

> +   printf("Port %d is administrative down\n", port_nr);
> +   return -1;
> +   }
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   /* Get ingress PVID */
> +   val = in_le32(&l2ana_reg->port[port_nr].vlan_cfg);
> +   *pvid = field_get(val & CONFIG_VSC9953_VLAN_CFG_VID_MASK,
> + CONFIG_VSC9953_VLAN_CFG_VID_MASK);
> +
> +   return 0;
> +}
> +#endif
> +
>  static void vsc9953_port_all_vlan_pvid_set(int pvid)
>  {
> int i;
> @@ -407,6 +432,75 @@ static void vsc9953_port_vlan_egr_untag_set(int port_no,
> }
>  }
>
> +#ifdef CONFIG_VSC9953_CMD

Why does this need to be defined outside of the #ifdef already at the
bottom of the file?

> +/* Get egress tagging configuration for a VSC9953 port */
> +static int vsc9953_port_vlan_egr_untag_get(int port_no,
> +  enum egress_untag_mode *mode)
> +{
> +   u32 val;
> +   struct vsc9953_rew_reg  *l2rew_reg;
> +
> +   /* Administrative down */
> +   if ((!vsc9953_l2sw.port[port_no].enabled)) {

Why do you have double "((" and "))"?

> +   printf("Port %d is administrative down\n", port_no);
> +   return -1;
> +   }
> +
> +   l2rew_reg = (struct vsc9953_rew_reg *)(VSC9953_OFFSET +
> +   VSC9953_REW_OFFSET);
> +
> +   val = in_le32(&l2rew_reg->port[port_no].port_tag_cfg);
> +
> +   switch (val & CONFIG_VSC9953_TAG_CFG_MASK) {
> +   case CONFIG_VSC9953_TAG_CFG_NONE:
> +   *mode = EGRESS_UNTAG_ALL;
> +   return 0;
> +   case CONFIG_VSC9953_TAG_CFG_ALL_PVID_ZERO:
> +   *mode = EGRESS_UNTAG_PVID_AND_ZERO;
> +   return 0;
> +   case CONFIG_VSC9953_TAG_CFG_ALL_ZERO:
> +   *mode = EGRESS_UNTAG_ZERO;
> +   return 0;
> +   case CONFIG_VSC9953_TAG_CFG_ALL:
> +   *mode = EGRESS_UNTAG_NONE;
> +   return 0;
> +   default:
> +   printf("Unknown egress tagging configuration for port %d\n",
> +  port_no);
> +   return -1;
> +   }
> +}
> +
> +/* Shiw egress tagging configuration for a VSC9953 port */

Shiw -> Show

> +static void vsc9953_port_vlan_egr_untag_show(int port_no)
> +{
> +   enum egress_untag_mode mode;
> +
> +   if (vsc9953_port_vlan_egr_untag_get(port_no, &mode)) {
> +   printf("%7d\t%17s\n", port_no, "-");
> +   return;
> +   }
> +
> +   printf("%7d\t", port_no);
> +   switch (mode) {
> +   case EGRESS_UNTAG_ALL:
> +   printf("%17s\n", "none");
> +   break;
> +   case EGRESS_UNTAG_NONE:
> +   printf("%17s\n", "all");
> +   break;
> +   case EGRESS_UNTAG_PVID_AND_ZERO:
> +   printf("%17s\n", "all but PVID and 0");
> +   break;
> +   case EGRESS_UNTAG_ZERO:
> +   printf("%17s\n", "all but 0");
> +   break;
> +   default:
> +   printf("%17s\n", "-");
> +   }
> +}
> +#endif
> +

Re: [U-Boot] [PATCH 07/11 v2] drivers/net/vsc9953: Add commands to manipulate the FDB for VSC9953

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The new command:
> ethsw [port ] [vlan ] fdb
> { [help] | show | flush | { add | del }  }
>
> Can be used to add and delete FDB entries. Also, the command can be used
> to show entries from the FDB tables. When used with [port ]
> and [vlan ], only the matching the FDB entries can be seen or
> flushed.
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 635 
> +-
>  include/vsc9953.h |  28 +++
>  2 files changed, 662 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 1936c4a..ef7b50c 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -12,6 +12,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  static struct vsc9953_info vsc9953_l2sw = {
> .port[0] = VSC9953_PORT_INFO_INITIALIZER(0),
> @@ -579,6 +580,7 @@ void vsc9953_init(bd_t *bis)
>
>  #define VSC9953_MAX_CMD_PARAMS 20
>  #define VSC9953_CMD_PORT_ALL   -1
> +#define VSC9953_CMD_VLAN_ALL   -1
>
>  /* Enable/disable status of a VSC9953 port */
>  static void vsc9953_port_status_set(int port_no, u8 enabled)
> @@ -952,6 +954,365 @@ static void vsc9953_port_statistics_clear(int port_no)
>  CONFIG_VSC9953_STAT_CLEAR_DR);
>  }
>
> +/* wait for FDB to become available */
> +static int vsc9953_mac_table_poll_idle(void)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +   u32 timeout;

Use a single space.

> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   timeout = 5;
> +   while (((in_le32(&l2ana_reg->ana_tables.mac_access) &
> +   CONFIG_VSC9953_MAC_CMD_MASK) !=
> +CONFIG_VSC9953_MAC_CMD_IDLE) && --timeout)
> +   udelay(1);
> +
> +   return !!timeout;

Maybe return -EBUSY like suggested in previous patch.

> +}
> +
> +/* enum describing available commands for the MAC table */
> +enum mac_table_cmd {
> +   MAC_TABLE_READ_DIRECT,
> +   MAC_TABLE_READ_INDIRECT,
> +   MAC_TABLE_WRITE,
> +   MAC_TABLE_LEARN,
> +   MAC_TABLE_FORGET,
> +   MAC_TABLE_GET_NEXT,
> +   MAC_TABLE_AGE,
> +};
> +
> +/* Issues a command to the FDB table */
> +static int vsc9953_mac_table_cmd(enum mac_table_cmd cmd)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;

Use a single space.

> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   switch (cmd) {
> +   case MAC_TABLE_READ_DIRECT:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK |
> +   CONFIG_VSC9953_MAC_CMD_VALID,
> +   CONFIG_VSC9953_MAC_CMD_READ);
> +   break;
> +   case MAC_TABLE_READ_INDIRECT:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK,
> +   CONFIG_VSC9953_MAC_CMD_READ |
> +   CONFIG_VSC9953_MAC_CMD_VALID);
> +   break;
> +   case MAC_TABLE_WRITE:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_MASK,
> +   CONFIG_VSC9953_MAC_CMD_WRITE |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_LOCKED);
> +   break;
> +   case MAC_TABLE_LEARN:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_MASK,
> +   CONFIG_VSC9953_MAC_CMD_LEARN |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_LOCKED |
> +   CONFIG_VSC9953_MAC_CMD_VALID);
> +   break;
> +   case MAC_TABLE_FORGET:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_MASK,
> +   CONFIG_VSC9953_MAC_CMD_FORGET);
> +   break;
> +   case MAC_TABLE_GET_NEXT:
> +   clrsetbits_le32(&l2ana_reg->ana_tables.mac_access,
> +   CONFIG_VSC9953_MAC_CMD_MASK |
> +   CONFIG_VSC9953_MAC_ENTRYTYPE_MASK,
> +   CONFIG_VSC9953_MAC_CMD_NEXT);
> +   break;
> +   case MAC_TABLE_AGE:
> +   clrsetbits_le32(&l2ana_reg->ana_t

Re: [U-Boot] [PATCH 06/11 v2] drivers/net/vsc9953: Add commands to enable/disable HW learning

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The command:
> ethsw [port ] learning { [help] | show | auto | disable }
>
> can be used to enable/disable HW learning on a port.
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 188 
> ++
>  include/vsc9953.h |   6 ++
>  2 files changed, 194 insertions(+)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 62ab0eb..1936c4a 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -672,6 +672,73 @@ static void vsc9953_port_config_show(int port_no)
> printf("%8s\n", duplex == DUPLEX_FULL ? "full" : "half");
>  }
>
> +enum port_learn_mode {
> +   PORT_LEARN_NONE,
> +   PORT_LEARN_AUTO
> +};
> +
> +/* Set learning configuration for a VSC9953 port */
> +static void vsc9953_port_learn_mode_set(int port_no, enum port_learn_mode 
> mode)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   /* Administrative down */
> +   if (!vsc9953_l2sw.port[port_no].enabled) {
> +   printf("Port %d is administrative down\n", port_no);
> +   return;
> +   }
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   switch (mode) {
> +   case PORT_LEARN_NONE:
> +   clrbits_le32(&l2ana_reg->port[port_no].port_cfg,
> +CONFIG_VSC9953_PORT_CFG_LEARN_DROP |
> +CONFIG_VSC9953_PORT_CFG_LEARN_CPU |
> +CONFIG_VSC9953_PORT_CFG_LEARN_AUTO |
> +CONFIG_VSC9953_PORT_CFG_LEARN_ENA);
> +   break;
> +   case PORT_LEARN_AUTO:
> +   clrsetbits_le32(&l2ana_reg->port[port_no].port_cfg,
> +   CONFIG_VSC9953_PORT_CFG_LEARN_DROP |
> +   CONFIG_VSC9953_PORT_CFG_LEARN_CPU,
> +   CONFIG_VSC9953_PORT_CFG_LEARN_ENA |
> +   CONFIG_VSC9953_PORT_CFG_LEARN_AUTO);
> +   break;
> +   default:
> +   printf("Unknown learn mode for port %d\n", port_no);
> +   }
> +}
> +
> +/* Get learning configuration for a VSC9953 port */
> +static int vsc9953_port_learn_mode_get(int port_no, enum port_learn_mode 
> *mode)
> +{
> +   u32 val;
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   /* Administrative down */
> +   if (!vsc9953_l2sw.port[port_no].enabled) {
> +   printf("Port %d is administrative down\n", port_no);
> +   return -1;
> +   }
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   /* For now we only support HW learning (auto) and no learning */
> +   val = in_le32(&l2ana_reg->port[port_no].port_cfg);
> +   if ((val & (CONFIG_VSC9953_PORT_CFG_LEARN_ENA |
> +  CONFIG_VSC9953_PORT_CFG_LEARN_AUTO)) ==
> +   (CONFIG_VSC9953_PORT_CFG_LEARN_ENA |
> +CONFIG_VSC9953_PORT_CFG_LEARN_AUTO))
> +   *mode = PORT_LEARN_AUTO;
> +   else
> +   *mode = PORT_LEARN_NONE;
> +
> +   return 0;
> +}
> +
>  /* Show VSC9953 ports' statistics */
>  static void vsc9953_port_statistics_show(int port_no)
>  {
> @@ -895,6 +962,8 @@ enum keyword_id {
> id_disable,
> id_statistics,
> id_clear,
> +   id_learning,
> +   id_auto,
> id_count,   /* keep last */
>  };
>
> @@ -1002,6 +1071,84 @@ static int vsc9953_port_stats_clear_key_func(struct 
> command_def *parsed_cmd)
> return 0;
>  }
>
> +#define VSC9953_LEARN_HELP "ethsw [port ] learning " \
> +"{ [help] | show | auto | disable } " \
> +"- enable/disable/show learning configuration on a port"
> +
> +static int vsc9953_learn_help_key_func(struct command_def *parsed_cmd)
> +{
> +   printf(VSC9953_LEARN_HELP"\n");
> +
> +   return 0;

Please use:
+   return CMD_RET_SUCCESS;

> +}
> +
> +static int vsc9953_learn_show_key_func(struct command_def *parsed_cmd)
> +{
> +   int i;
> +   enum port_learn_modemode;
> +
> +   if (parsed_cmd->port != VSC9953_CMD_PORT_ALL) {
> +   if (vsc9953_port_learn_mode_get(parsed_cmd->port, &mode))
> +   return -1;

Please use:
+   return CMD_RET_FAILURE;

> +   printf("%7s %11s\n", "Port", "Learn mode");
> +   switch (mode) {
> +   case PORT_LEARN_NONE:
> +   printf("%7d %11s\n", parsed_cmd->port, "disable");
> +   break;
> +   case PORT_LEARN_AUTO:
> +   printf("%7d %11s\n", parsed_cmd->port, "auto");
> +  

Re: [U-Boot] [PATCH v3 05/25] mkimage: Allow the original file size to be recorded

2015-06-25 Thread Joe Hershberger
Hi Simon,

On Tue, Jun 23, 2015 at 6:28 PM, Simon Glass  wrote:
> Allow the image handler to store the original input file size so that it
> can reference it later.
>
> Signed-off-by: Simon Glass 
> ---
>
> Changes in v3: None
> Changes in v2: None
>
>  tools/imagetool.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/imagetool.h b/tools/imagetool.h
> index 99bbf2f..23c7d30 100644
> --- a/tools/imagetool.h
> +++ b/tools/imagetool.h
> @@ -60,6 +60,7 @@ struct image_tool_params {
> const char *comment;/* Comment to add to signature node */
> int require_keys;   /* 1 to mark signing keys as 'required' */
> int file_size;  /* Total size of output file */
> +   int orig_file_size; /* Pad size for file */

It looks like you forgot to change the comment.

>  };
>
>  /*
> --
> 2.4.3.573.g4eafbef
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 04/25] mkimage: Allow padding to any length

2015-06-25 Thread Joe Hershberger
Hi Simon,

On Tue, Jun 23, 2015 at 6:28 PM, Simon Glass  wrote:
> At present there is an arbitrary limit of 4KB for padding. Rockchip needs
> more than that, so remove this restriction.
>
> Signed-off-by: Simon Glass 
> ---

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


Re: [U-Boot] [PATCH 05/11 v2] drivers/net/vsc9953: Add command to show/clear port counters

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The new added command:
> ethsw [port ] statistics { [help] | [clear] }
>
> will print counters like the number of Rx/Tx frames,
> number of Rx/Tx bytes, number of Rx/Tx unicast frames, etc.
>
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 280 
> ++
>  include/vsc9953.h | 116 -
>  2 files changed, 393 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 4df751a..62ab0eb 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -672,6 +672,219 @@ static void vsc9953_port_config_show(int port_no)
> printf("%8s\n", duplex == DUPLEX_FULL ? "full" : "half");
>  }
>
> +/* Show VSC9953 ports' statistics */
> +static void vsc9953_port_statistics_show(int port_no)
> +{
> +   u32 rx_val, tx_val;
> +   struct vsc9953_system_reg   *l2sys_reg;

Use a single space. Place each variable on its own line.

> +
> +   /* Administrative down */
> +   if (!vsc9953_l2sw.port[port_no].enabled) {
> +   printf("Port %d is administrative down\n", port_no);
> +   return;
> +   }
> +
> +   l2sys_reg = (struct vsc9953_system_reg *)(VSC9953_OFFSET +
> +   VSC9953_SYS_OFFSET);
> +
> +   printf("Statistics for L2 Switch port %d:\n", port_no);
> +
> +   /* Set counter view for our port */
> +   out_le32(&l2sys_reg->sys.stat_cfg, port_no);
> +
> +#define VSC9953_STATS_PRINTF "%-15s %10u"
> +
> +   /* Get number of Rx and Tx frames */
> +   rx_val = in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_short) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_frag) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_jabber) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_long) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_64) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_65_127) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_128_255) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_256_511) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_512_1023) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_1024_1526) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_sz_jumbo);
> +   tx_val = in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_64) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_65_127) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_128_255) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_256_511) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_512_1023) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_1024_1526) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_jumbo);
> +   printf(VSC9953_STATS_PRINTF"\t\t"VSC9953_STATS_PRINTF"\n",
> +  "Rx frames:", rx_val, "Tx frames:", tx_val);
> +
> +   /* Get number of Rx and Tx bytes */
> +   rx_val = in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_oct);
> +   tx_val = in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_oct);
> +   printf(VSC9953_STATS_PRINTF"\t\t"VSC9953_STATS_PRINTF"\n",
> +  "Rx bytes:", rx_val, "Tx bytes:", tx_val);
> +
> +   /* Get number of Rx frames received ok and Tx frames sent ok */
> +   rx_val = in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_0) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_1) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_2) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_3) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_4) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_5) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_6) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_yellow_prio_7) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_0) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_1) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_2) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_3) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_4) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_5) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_6) +
> +in_le32(&l2sys_reg->stat.rx_cntrs.c_rx_green_prio_7);
> +   tx_val = in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_64) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_65_127) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_128_255) +
> +in_le32(&l2sys_reg->stat.tx_cntrs.c_tx_sz_256_511) +
> + 

Re: [U-Boot] [PATCH 04/11 v2] drivers/net/vsc9953: Refractor the parser for VSC9953 commands

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> In order to support multiple commands to configure the VSC9953
> L2 Switch, the parser needs to be changed to be more flexible and
> to support more complex commands. This patch adds a parser that
> searches for defined keywords in the command and calls the proper
> function when a match is found. Also, the parser allows for
> optional keywords, such as "port", to apply the command on a port
> or on all ports. The already defined commands are also changed a
> bit to:
> ethsw [port ] { enable | disable | show }
>
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 381 
> --
>  1 file changed, 310 insertions(+), 71 deletions(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 9dec683..4df751a 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -10,6 +10,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>
>  static struct vsc9953_info vsc9953_l2sw = {
> @@ -575,6 +576,10 @@ void vsc9953_init(bd_t *bis)
>  }
>
>  #ifdef CONFIG_VSC9953_CMD

I'd like to see this moved to its own file in common... maybe
"common/cmd_ethsw.c". I'd also like to see this #define change to
something like "CONFIG_CMD_ETHSW".

These changes don't necessarily need to be part of this series, since
it already got in as is, but if you feel motivated, I would recommend
you add a patch before this one that moves it.

> +
> +#define VSC9953_MAX_CMD_PARAMS 20
> +#define VSC9953_CMD_PORT_ALL   -1
> +
>  /* Enable/disable status of a VSC9953 port */
>  static void vsc9953_port_status_set(int port_no, u8 enabled)
>  {
> @@ -595,15 +600,6 @@ static void vsc9953_port_status_set(int port_no, u8 
> enabled)
>  CONFIG_VSC9953_PORT_ENA);
>  }
>
> -/* Set all VSC9953 ports' status */
> -static void vsc9953_port_all_status_set(u8 enabled)
> -{
> -   int i;
> -
> -   for (i = 0; i < VSC9953_MAX_PORTS; i++)
> -   vsc9953_port_status_set(i, enabled);
> -}
> -
>  /* Start autonegotiation for a VSC9953 PHY */
>  static void vsc9953_phy_autoneg(int port_no)
>  {
> @@ -615,15 +611,6 @@ static void vsc9953_phy_autoneg(int port_no)
> printf("Failed to start PHY for port %d\n", port_no);
>  }
>
> -/* Start autonegotiation for all VSC9953 PHYs */
> -static void vsc9953_phy_all_autoneg(void)
> -{
> -   int i;
> -
> -   for (i = 0; i < VSC9953_MAX_PORTS; i++)
> -   vsc9953_phy_autoneg(i);
> -}
> -
>  /* Print a VSC9953 port's configuration */
>  static void vsc9953_port_config_show(int port_no)
>  {
> @@ -685,75 +672,327 @@ static void vsc9953_port_config_show(int port_no)
> printf("%8s\n", duplex == DUPLEX_FULL ? "full" : "half");
>  }
>
> -/* Print VSC9953 ports' configuration */
> -static void vsc9953_port_all_config_show(void)
> -{
> -   int i;
> +/* IDs used to track keywords in a command */
> +enum keyword_id {
> +   id_key_end = -1,
> +   id_help,
> +   id_show,
> +   id_port,
> +   id_enable,
> +   id_disable,
> +   id_count,   /* keep last */
> +};
>
> -   for (i = 0; i < VSC9953_MAX_PORTS; i++)
> -   vsc9953_port_config_show(i);
> -}
> +enum keyword_opt_id {
> +   id_port_no = id_count + 1,
> +   id_count_all,   /* keep last */
> +};
>
> -/* function to interpret commands starting with "ethsw " */
> -static int do_ethsw(cmd_tbl_t *cmdtp, int flag, int argc, char * const 
> argv[])
> +struct command_def {
> +   int cmd_to_keywords[VSC9953_MAX_CMD_PARAMS];
> +   int cmd_keywords_nr;
> +   int port;
> +   int err;

Remove this. Just use a return value.

> +   int (*cmd_function)(struct command_def *parsed_cmd);
> +};
> +
> +#define VSC9953_PORT_CONF_HELP "[port ] { enable | disable | show } 
> " \
> +"- enable/disable a port; show shows a port's configuration"

Probably better to define this down by the use.

> +
> +static int vsc9953_port_status_key_func(struct command_def *parsed_cmd)
>  {
> -   u8 enable;
> -   u32 port;
> +   int i;
> +   u8  enabled;

Use a single space.

>
> -   if (argc < 4)
> +   /* Last keyword should tell us if we should enable/disable the port */
> +   if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] ==
> +   id_enable)
> +   enabled = 1;
> +   else if (parsed_cmd->cmd_to_keywords[parsed_cmd->cmd_keywords_nr - 1] 
> ==
> +id_disable)
> +   enabled = 0;
> +   else {
> +   parsed_cmd->err = 1;

Remove this.

> return -1;

Please use "return CMD_RET_USAGE;" from include/command.h.

> +   }
>
> -   if (strcmp(argv[1], "port"))
> -   return -1;
> +   if (parsed_cmd->port != VSC9953_CMD_PORT_AL

Re: [U-Boot] [PATCH 03/11 v2] drivers/net/vsc9953: Add default configuration for VSC9953 L2 Switch

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> At startup, the default configuration should be:
>  - enable HW learning on all ports (HW default);
>  - all ports are VLAN aware;
>  - all ports are members of VLAN 1;
>  - all ports have Port-based VLAN 1;
>  - on all ports, the switch is allowed to remove
>maximum one VLAN tag,
>  - on egress, the switch should add a VLAN tag if the
>frame is classified to a different VLAN than the port's
>Port-based VLAN;
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 266 
> +-
>  include/vsc9953.h |  61 +++-
>  2 files changed, 325 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 720ae47..9dec683 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -1,5 +1,5 @@
>  /*
> - *  Copyright 2014 Freescale Semiconductor, Inc.
> + *  Copyright 2014-2015 Freescale Semiconductor, Inc.

This change should be moved to the last patch.

>   *
>   *  SPDX-License-Identifier:  GPL-2.0+
>   *



> diff --git a/include/vsc9953.h b/include/vsc9953.h
> index 2b88c5c..bf81623 100644
> --- a/include/vsc9953.h
> +++ b/include/vsc9953.h
> @@ -7,7 +7,7 @@
>   *  terms of the GNU Public License, Version 2, incorporated
>   *  herein by reference.
>   *
> - * Copyright 2013  Freescale Semiconductor, Inc.
> + * Copyright 2013, 2015 Freescale Semiconductor, Inc.

This change should be moved to the last patch.

>   *
>   */
>



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


Re: [U-Boot] [PATCH v2] Initial support for ACPI Tables for qemu-x86 target.

2015-06-25 Thread Saket Sinha
Hi Bin,


>>> +
>>> +static int acpi_create_madt_lapic(struct acpi_madt_lapic *lapic, u8 cpu, 
>>> u8 apic)
>>> +{
>>> +lapic->type = 0; /* Local APIC structure */
>>> +lapic->length = sizeof(struct acpi_madt_lapic);
>>> +lapic->flags = (1 << 0); /* Processor/LAPIC enabled */
>>> +lapic->processor_id = cpu;
>>> +lapic->apic_id = apic;
>>> +
>>> +return lapic->length;
>>> +}
>>> +
>>> +static unsigned long acpi_create_madt_lapics(unsigned long current)
>>> +{
>>> +   struct udevice *dev;
>>> +
>>> +for (uclass_find_first_device(UCLASS_CPU, &dev);
>>> + dev;
>>> + uclass_find_next_device(&dev)) {
>>> +struct cpu_platdata *plat = dev_get_parent_platdata(dev);
>>> +
>>> +   current += acpi_create_madt_lapic((struct acpi_madt_lapic 
>>> *)current, plat->cpu_id, plat->cpu_id);
>>
>> The processor id (2nd parameter) is not equal to lapic id. Per the
>> ACPI spec, it should match the ProcessorID in the ASL file, format
>> below.
>>
>> Processor (ProcessorName, ProcessorID, PBlockAddress, PblockLength) 
>> {ObjectList}
>>
>
> Thanks for bringing this to my notice.
> In my boot up logs, I am getting "ACPI: No LAPIC entries present".
> This might be the reason for that.
>


As per our previous discussion, I reported an error in bringing up
u-boot for qemu -
"  Cannot find uclass for id 10: please add the UCLASS_DRIVER()
declaration for  this UCLASS_... id"
You told me that this is because QEMU has not been converted to use dm
cpu driver.

If this issue is resolved, and thus UCLASS_CPU would be available for
qemu, the patch below  would fix the lapic error.

diff --git a/arch/x86/cpu/qemu/acpi_table.c b/arch/x86/cpu/qemu/acpi_table.c
index cefd5f4..f055646 100644
--- a/arch/x86/cpu/qemu/acpi_table.c
+++ b/arch/x86/cpu/qemu/acpi_table.c
@@ -98,13 +98,15 @@ static int acpi_create_madt_lapic(struct
acpi_madt_lapic *lapic, u8 cpu, u8 apic
 static unsigned long acpi_create_madt_lapics(unsigned long current)
 {
struct udevice *dev;
+   int index = 0;

 for (uclass_find_first_device(UCLASS_CPU, &dev);
  dev;
  uclass_find_next_device(&dev)) {
 struct cpu_platdata *plat = dev_get_parent_platdata(dev);

-   current += acpi_create_madt_lapic((struct
acpi_madt_lapic *)current, plat->cpu_id, plat->cpu_id);
+   current += acpi_create_madt_lapic((struct
acpi_madt_lapic *)current, index, plat->cpu_id);
+   index++;
}
 return current;
 }


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


Re: [U-Boot] [PATCH 4/7] arm: Make new baltos board not break on savedefconfig

2015-06-25 Thread Yegor Yefremov
On Thu, Jun 25, 2015 at 5:42 PM, Joe Hershberger
 wrote:
> Hi Yegor,
>
> On Wed, Jun 24, 2015 at 2:33 AM, Yegor Yefremov
>  wrote:
>> On Wed, Jun 24, 2015 at 8:55 AM, Yegor Yefremov
>>  wrote:
>>> Hi Joe,
>>>
>>> On Wed, Jun 24, 2015 at 5:26 AM, Joe Hershberger
>>>  wrote:
 Hi Tom,

 On Tue, Jun 23, 2015 at 9:23 AM, Tom Rini  wrote:
> On Mon, Jun 22, 2015 at 04:15:27PM -0500, Joe Hershberger wrote:
>
>> This config defined a CONS_INDEX as a config but did not define it in
>> any Kconfig, so savedefconfig will delete that entry. Use
>> CONFIG_SYS_EXTRA_OPTIONS for now until that is added to Kconfig.
>>
>> Signed-off-by: Joe Hershberger 
>> ---
>>
>>  configs/am335x_baltos_defconfig | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/configs/am335x_baltos_defconfig 
>> b/configs/am335x_baltos_defconfig
>> index 679b04f..030cb51 100644
>> --- a/configs/am335x_baltos_defconfig
>> +++ b/configs/am335x_baltos_defconfig
>> @@ -1,7 +1,6 @@
>>  CONFIG_SPL=y
>>  CONFIG_SPL_STACK_R=y
>>  CONFIG_SPL_STACK_R_ADDR=0x8200
>> -CONFIG_SYS_EXTRA_OPTIONS="NAND"
>> -CONFIG_CONS_INDEX=1
>> +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,NAND"
>>  CONFIG_ARM=y
>>  CONFIG_TARGET_AM335X_BALTOS=y
>
> No, something else is wrong.  board/vscom/baltos/Kconfig has CONS_INDEX
> (like the other am335x boards and yes this needs moving to a better
> place).

 Any thoughts on what's wrong, then? I'm at FTF this week and won't be
 debugging it until next week. There was an issue with this board,
 caused by savedefconfig, which is why I even noticed this board exists
 now. Maybe whoever added it (Yegor Yefremov) didn't try safedefconfig
 against the board?

 If nothing else, at least this makes it consistent with all other
 boards that specify CONS_INDEX. At least they don't break.
>>>
>>> I'll take a look at this.
>>
>> I've pulled the latest master
>> (325849ff3d4adeebb8f8f9bc5db950724df9bc21) and tried:
>>
>> make am35x_baltos_defconfig
>> make savedefconfg
>> make
>>
>> and aside from CONS_INDEX disappearing I see no problems. And "make
>> menuconfig" still shows CONS_INDEX = 1.
>>
>> Should I submit following patch, so that Baltos has the same config as BBB?
>
> That shouldn't really be necessary since this series already
> effectively does this. It is good practice in the future, though.

You're right. I think, I forgot about savedefconfig, because Builroot
still doesn't have U-Boot's Kconfig support.

I've sent a patch, that provides properly created defconfig together
with CMD_NET activated.

>> diff --git a/configs/am335x_baltos_defconfig 
>> b/configs/am335x_baltos_defconfig
>> index 679b04f..1d287a8 100644
>> --- a/configs/am335x_baltos_defconfig
>> +++ b/configs/am335x_baltos_defconfig
>> @@ -1,7 +1,6 @@
>> +CONFIG_ARM=y
>> +CONFIG_TARGET_AM335X_BALTOS=y
>>  CONFIG_SPL=y
>>  CONFIG_SPL_STACK_R=y
>>  CONFIG_SPL_STACK_R_ADDR=0x8200
>>  CONFIG_SYS_EXTRA_OPTIONS="NAND"
>> -CONFIG_CONS_INDEX=1
>> -CONFIG_ARM=y
>> -CONFIG_TARGET_AM335X_BALTOS=y
>
> Cheers,
> -Joe
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] ?????? sunxi:Updated A31 & A31-mele i7 support

2015-06-25 Thread ??????????????
Ah Yes.I fixed it:





--  --
??: "ijc";;
: 2015??6??25??(??) 7:57
??: "??"; 
: "u-boot"; "hdegoede"; 
: Re: sunxi:Updated A31 & A31-mele i7 support



On Thu, 2015-06-25 at 18:20 +0800, ?? wrote:
> I fixed SUNXI_MMCSLOT support and update the mele i7 mod-emmc support~

As I requested in the earlier private mail, please make multiple changes
using multiple patches, not all wedged into one.

> Eh..I don't know what the sign-off is~

The first hit on google for "u-boot signed-off" for me was
http://www.denx.de/wiki/U-Boot/DevelopmentProcess and the second was
http://www.denx.de/wiki/U-Boot/Patches

Ian.

0001-sunxi-Added-NAND-Flash-defines-and-MMC2-IO-defines-f.patch
Description: Binary data


0002-sunxi-Added-Mele-i7-eMMC-MOD-DTS.patch
Description: Binary data


0003-sunxi-Added-difference-MMC-SLOT-for-booting.patch
Description: Binary data
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] sunxi:Updated A31 & A31-mele i7 support

2015-06-25 Thread ??????????????
I fixed SUNXI_MMCSLOT support and update the mele i7 mod-emmc support~

Eh..I don't know what the sign-off is~

ZhiYuan Wan

0001-sunxi-Updated-A31-device-tree-Added-SUNXI_MMC_SLOT-s.patch
Description: Binary data
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] keystone2: config: update default mtd

2015-06-25 Thread Michael Scherban
Because of a difference in the ordering of MTDs, the current bootarg is
pointing to a MTD without a root filesystem. This updates the default MTD to
point to the correct one that contains the filesystem.

Signed-off-by: Michael Scherban 
---
 include/configs/k2e_evm.h  |2 +-
 include/configs/k2hk_evm.h |2 +-
 include/configs/k2l_evm.h  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/k2e_evm.h b/include/configs/k2e_evm.h
index d83e07e..69b0254 100644
--- a/include/configs/k2e_evm.h
+++ b/include/configs/k2e_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c14\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,2048\0"   \
"name_fdt=uImage-k2e-evm.dtb\0" \
"name_mon=skern-k2e-evm.bin\0"  \
"name_ubi=k2e-evm-ubifs.ubi\0"  \
diff --git a/include/configs/k2hk_evm.h b/include/configs/k2hk_evm.h
index ffddf13..43c474c 100644
--- a/include/configs/k2hk_evm.h
+++ b/include/configs/k2hk_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c5f\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,2048\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,2048\0"   \
"name_fdt=uImage-k2hk-evm.dtb\0"\
"name_mon=skern-k2hk-evm.bin\0" \
"name_ubi=k2hk-evm-ubifs.ubi\0" \
diff --git a/include/configs/k2l_evm.h b/include/configs/k2l_evm.h
index 805164a..b4f2eec 100644
--- a/include/configs/k2l_evm.h
+++ b/include/configs/k2l_evm.h
@@ -20,7 +20,7 @@
 #define CONFIG_EXTRA_ENV_KS2_BOARD_SETTINGS\
"addr_mon=0x0c14\0" \
"args_ubi=setenv bootargs ${bootargs} rootfstype=ubifs "\
-   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=2,4096\0"   \
+   "root=ubi0:rootfs rootflags=sync rw ubi.mtd=4,4096\0"   \
"name_fdt=uImage-k2l-evm.dtb\0" \
"name_mon=skern-k2l-evm.bin\0"  \
"name_ubi=k2l-evm-ubifs.ubi\0"  \
-- 
1.7.0.4

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


Re: [U-Boot] [PATCH v3 32/54] mmc: Calculate dwmmc FIFO threshold size if not provided

2015-06-25 Thread Simon Glass
Hi Jaehoon,

On 24 June 2015 at 19:58, Jaehoon Chung  wrote:
>
> Hi, Simon.
>
> On 06/24/2015 06:38 AM, Simon Glass wrote:
> > We can calculate this. Add code to do this if it is not provided.
>
> Did you consider the kernel side?

Can you please be more specific?

Regards,
Simon

>
> Best Regards,
> Jaehoon Chung
>
> >
> > Signed-off-by: Simon Glass 
> > ---
> >
> > Changes in v3: None
> > Changes in v2: None
> >
> >  drivers/mmc/dw_mmc.c | 10 --
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> > index a034c3f..cce2a5d 100644
> > --- a/drivers/mmc/dw_mmc.c
> > +++ b/drivers/mmc/dw_mmc.c
> > @@ -355,9 +355,15 @@ static int dwmci_init(struct mmc *mmc)
> >   dwmci_writel(host, DWMCI_IDINTEN, 0);
> >   dwmci_writel(host, DWMCI_BMOD, 1);
> >
> > - if (host->fifoth_val) {
> > - dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
> > + if (!host->fifoth_val) {
> > + uint32_t fifo_size;
> > +
> > + fifo_size = dwmci_readl(host, DWMCI_FIFOTH);
> > + fifo_size = ((fifo_size & RX_WMARK_MASK) >> RX_WMARK_SHIFT) + 
> > 1;
> > + host->fifoth_val = MSIZE(0x2) | RX_WMARK(fifo_size / 2 - 1) |
> > + TX_WMARK(fifo_size / 2);
> >   }
> > + dwmci_writel(host, DWMCI_FIFOTH, host->fifoth_val);
> >
> >   dwmci_writel(host, DWMCI_CLKENA, 0);
> >   dwmci_writel(host, DWMCI_CLKSRC, 0);
> >
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 03/11 v2] drivers/net/vsc9953: Add default configuration for VSC9953 L2 Switch

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> At startup, the default configuration should be:
>  - enable HW learning on all ports (HW default);
>  - all ports are VLAN aware;
>  - all ports are members of VLAN 1;
>  - all ports have Port-based VLAN 1;
>  - on all ports, the switch is allowed to remove
>maximum one VLAN tag,
>  - on egress, the switch should add a VLAN tag if the
>frame is classified to a different VLAN than the port's
>Port-based VLAN;
>
> Signed-off-by: Johnson Leung 
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 266 
> +-
>  include/vsc9953.h |  61 +++-
>  2 files changed, 325 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index 720ae47..9dec683 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -1,5 +1,5 @@
>  /*
> - *  Copyright 2014 Freescale Semiconductor, Inc.
> + *  Copyright 2014-2015 Freescale Semiconductor, Inc.
>   *
>   *  SPDX-License-Identifier:  GPL-2.0+
>   *
> @@ -176,6 +176,268 @@ static int vsc9953_port_init(int port_no)
> return 0;
>  }
>
> +static int vsc9953_vlan_table_poll_idle(void)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +   int timeout;
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   timeout = 5;
> +   while (((in_le32(&l2ana_reg->ana_tables.vlan_access) &
> +   CONFIG_VSC9953_VLAN_CMD_MASK) !=
> +   CONFIG_VSC9953_VLAN_CMD_IDLE) && --timeout)
> +   udelay(1);
> +
> +   return !!timeout;

Maybe this:

+   return timeout ? 0 : -EBUSY;

> +}
> +
> +/* vlan table set/clear all membership of vid */
> +static void vsc9953_vlan_table_membership_all_set(int vid, int set)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +
> +   l2ana_reg = (struct vsc9953_analyzer *)(VSC9953_OFFSET +
> +   VSC9953_ANA_OFFSET);
> +
> +   if (!vsc9953_vlan_table_poll_idle()) {

If you accept the above, you need to change these to:
+   if (vsc9953_vlan_table_poll_idle() < 0) {

or

+   if (vsc9953_vlan_table_poll_idle() == -EBUSY) {

> +   debug("VLAN table timeout\n");
> +   return;
> +   }
> +
> +   /* read current vlan configuration */
> +   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_tidx,
> +   CONFIG_VSC9953_ANA_TBL_VID_MASK,
> +   field_set(vid, CONFIG_VSC9953_ANA_TBL_VID_MASK));
> +
> +   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_access,
> +   CONFIG_VSC9953_VLAN_CMD_MASK,
> +   field_set(CONFIG_VSC9953_VLAN_CMD_READ,
> + CONFIG_VSC9953_VLAN_CMD_MASK));
> +
> +   if (!vsc9953_vlan_table_poll_idle()) {

Here too.

> +   debug("VLAN table timeout\n");
> +   return;
> +   }
> +
> +   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_tidx,
> +   CONFIG_VSC9953_ANA_TBL_VID_MASK,
> +   field_set(vid, CONFIG_VSC9953_ANA_TBL_VID_MASK));
> +

> +   if (!set)
> +   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_access,
> +   CONFIG_VSC9953_VLAN_PORT_MASK |
> +   CONFIG_VSC9953_VLAN_CMD_MASK,
> +   field_set(CONFIG_VSC9953_VLAN_CMD_WRITE,
> + CONFIG_VSC9953_VLAN_CMD_MASK));
> +   else
> +   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_access,
> +   CONFIG_VSC9953_VLAN_PORT_MASK |
> +   CONFIG_VSC9953_VLAN_CMD_MASK,
> +   field_set(CONFIG_VSC9953_VLAN_CMD_WRITE,
> + CONFIG_VSC9953_VLAN_CMD_MASK) |
> +   CONFIG_VSC9953_VLAN_PORT_MASK);

It seems this could if statement could all be simplified as:
+   clrsetbits_le32(&l2ana_reg->ana_tables.vlan_access,
+   CONFIG_VSC9953_VLAN_PORT_MASK |
+   CONFIG_VSC9953_VLAN_CMD_MASK,
+   field_set(CONFIG_VSC9953_VLAN_CMD_WRITE,
+ CONFIG_VSC9953_VLAN_CMD_MASK) |
+   (set ? CONFIG_VSC9953_VLAN_PORT_MASK : 0));

It may also help to rename the parameter from "set" to something like
"set_member".

> +}
> +
> +/* Set PVID for a VSC9953 port */
> +static void vsc9953_port_vlan_pvid_set(int port_no, int pvid)
> +{
> +   struct vsc9953_analyzer *l2ana_reg;
> +   struct vsc9953_rew_reg  *l2rew_reg;
> +
> +   /* Administrative down */
> +   if ((!vsc9953_l2sw.port[port_no].enabled)) {

Why do you have double "((" and "))"?


[U-Boot] [PATCH v2 6/7] dm: x86: minnowmax: Move PCI to use driver model

2015-06-25 Thread Simon Glass
Adjust minnowmax to use driver model for PCI. This requires adding a device
tree node to specify the ranges, removing the board-specific PCI code and
ensuring that the host bridge is configured.

Reviewed-by: Bin Meng 
Signed-off-by: Simon Glass 
---

Changes in v2: None

 arch/x86/cpu/baytrail/Makefile |  1 -
 arch/x86/cpu/baytrail/pci.c| 46 --
 arch/x86/dts/minnowmax.dts | 10 +
 configs/minnowmax_defconfig|  1 +
 include/configs/minnowmax.h|  1 +
 5 files changed, 12 insertions(+), 47 deletions(-)
 delete mode 100644 arch/x86/cpu/baytrail/pci.c

diff --git a/arch/x86/cpu/baytrail/Makefile b/arch/x86/cpu/baytrail/Makefile
index c78b644..5be5491 100644
--- a/arch/x86/cpu/baytrail/Makefile
+++ b/arch/x86/cpu/baytrail/Makefile
@@ -7,5 +7,4 @@
 obj-y += cpu.o
 obj-y += early_uart.o
 obj-y += fsp_configs.o
-obj-y += pci.o
 obj-y += valleyview.o
diff --git a/arch/x86/cpu/baytrail/pci.c b/arch/x86/cpu/baytrail/pci.c
deleted file mode 100644
index 48409de..000
--- a/arch/x86/cpu/baytrail/pci.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (C) 2014, Bin Meng 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-void board_pci_setup_hose(struct pci_controller *hose)
-{
-   hose->first_busno = 0;
-   hose->last_busno = 0;
-
-   /* PCI memory space */
-   pci_set_region(hose->regions + 0,
-  CONFIG_PCI_MEM_BUS,
-  CONFIG_PCI_MEM_PHYS,
-  CONFIG_PCI_MEM_SIZE,
-  PCI_REGION_MEM);
-
-   /* PCI IO space */
-   pci_set_region(hose->regions + 1,
-  CONFIG_PCI_IO_BUS,
-  CONFIG_PCI_IO_PHYS,
-  CONFIG_PCI_IO_SIZE,
-  PCI_REGION_IO);
-
-   pci_set_region(hose->regions + 2,
-  CONFIG_PCI_PREF_BUS,
-  CONFIG_PCI_PREF_PHYS,
-  CONFIG_PCI_PREF_SIZE,
-  PCI_REGION_PREFETCH);
-
-   pci_set_region(hose->regions + 3,
-  0,
-  0,
-  gd->ram_size < 0x8000 ? gd->ram_size : 0x8000,
-  PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
-
-   hose->region_count = 4;
-}
diff --git a/arch/x86/dts/minnowmax.dts b/arch/x86/dts/minnowmax.dts
index bd21bfb..0e59b18 100644
--- a/arch/x86/dts/minnowmax.dts
+++ b/arch/x86/dts/minnowmax.dts
@@ -111,6 +111,16 @@
 
};
 
+   pci {
+   compatible = "intel,pci-baytrail", "pci-x86";
+   #address-cells = <3>;
+   #size-cells = <2>;
+   u-boot,dm-pre-reloc;
+   ranges = <0x0200 0x0 0xd000 0xd000 0 0x1000
+   0x4200 0x0 0xc000 0xc000 0 0x1000
+   0x0100 0x0 0x2000 0x2000 0 0xe000>;
+   };
+
spi {
#address-cells = <1>;
#size-cells = <0>;
diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig
index 744aca3..ff2bfda 100644
--- a/configs/minnowmax_defconfig
+++ b/configs/minnowmax_defconfig
@@ -12,3 +12,4 @@ CONFIG_CMD_CPU=y
 CONFIG_CMD_NET=y
 CONFIG_OF_CONTROL=y
 CONFIG_CPU=y
+CONFIG_DM_PCI=y
diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h
index d4d28a7..41653ba 100644
--- a/include/configs/minnowmax.h
+++ b/include/configs/minnowmax.h
@@ -32,6 +32,7 @@
 #define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS
 #define CONFIG_PCI_IO_SIZE 0xe000
 
+#define CONFIG_PCI_CONFIG_HOST_BRIDGE
 #define CONFIG_SYS_EARLY_PCI_INIT
 #define CONFIG_PCI_PNP
 #define CONFIG_RTL8169
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 7/7] dm: x86: baytrail: Correct PCI region 3 when driver model is used

2015-06-25 Thread Simon Glass
Commit afbbd413a fixed this for non-driver-model. Make sure that the driver
model code handles this also.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Only limit the PCI system memory region on x86 machines

 arch/x86/cpu/cpu.c| 1 +
 common/board_f.c  | 4 
 drivers/pci/pci-uclass.c  | 8 ++--
 include/asm-generic/global_data.h | 1 +
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/arch/x86/cpu/cpu.c b/arch/x86/cpu/cpu.c
index d108ee5..936b6ee 100644
--- a/arch/x86/cpu/cpu.c
+++ b/arch/x86/cpu/cpu.c
@@ -351,6 +351,7 @@ int x86_cpu_init_f(void)
 
gd->arch.has_mtrr = has_mtrr();
}
+   gd->pci_ram_top = 0x8000U;
 
return 0;
 }
diff --git a/common/board_f.c b/common/board_f.c
index 21be26f..cb85382 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -350,6 +350,10 @@ static int setup_dest_addr(void)
debug("Reserving MP boot page to %08lx\n", gd->relocaddr);
}
 #endif
+#ifdef CONFIG_PCI
+   gd->pci_ram_top = gd->ram_top;
+#endif
+
return 0;
 }
 
diff --git a/drivers/pci/pci-uclass.c b/drivers/pci/pci-uclass.c
index edec93f..5b91fe3 100644
--- a/drivers/pci/pci-uclass.c
+++ b/drivers/pci/pci-uclass.c
@@ -444,6 +444,7 @@ static int decode_regions(struct pci_controller *hose, 
const void *blob,
 {
int pci_addr_cells, addr_cells, size_cells;
int cells_per_record;
+   phys_addr_t addr;
const u32 *prop;
int len;
int i;
@@ -494,8 +495,11 @@ static int decode_regions(struct pci_controller *hose, 
const void *blob,
}
 
/* Add a region for our local memory */
-   pci_set_region(hose->regions + hose->region_count++, 0, 0,
-  gd->ram_size, PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
+   addr = gd->ram_size;
+   if (gd->pci_ram_top && gd->pci_ram_top < addr)
+   addr = gd->pci_ram_top;
+   pci_set_region(hose->regions + hose->region_count++, 0, 0, addr,
+  PCI_REGION_MEM | PCI_REGION_SYS_MEMORY);
 
return 0;
 }
diff --git a/include/asm-generic/global_data.h 
b/include/asm-generic/global_data.h
index 6747619..db0550b 100644
--- a/include/asm-generic/global_data.h
+++ b/include/asm-generic/global_data.h
@@ -93,6 +93,7 @@ typedef struct global_data {
 #endif
 #ifdef CONFIG_PCI
struct pci_controller *hose;/* PCI hose for early use */
+   phys_addr_t pci_ram_top;/* top of region accessible to PCI */
 #endif
 #ifdef CONFIG_PCI_BOOTDELAY
int pcidelay_done;
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 5/7] x86: pci: Tidy up the generic x86 PCI driver

2015-06-25 Thread Simon Glass
This driver should use the x86 PCI configuration functions. Also adjust its
compatible string to something generic (i.e. without a vendor name).

Signed-off-by: Simon Glass 
---

Changes in v2:
- Rename the ops and ids arrays for consistency
- Drop the coreboot PCI driver which is no-longer needed

 arch/x86/cpu/coreboot/pci.c | 21 -
 drivers/pci/pci_x86.c   | 13 -
 2 files changed, 8 insertions(+), 26 deletions(-)

diff --git a/arch/x86/cpu/coreboot/pci.c b/arch/x86/cpu/coreboot/pci.c
index 67eb14c..af9f391 100644
--- a/arch/x86/cpu/coreboot/pci.c
+++ b/arch/x86/cpu/coreboot/pci.c
@@ -11,30 +11,9 @@
 
 #include 
 #include 
-#include 
 #include 
-#include 
 #include 
 
-DECLARE_GLOBAL_DATA_PTR;
-
-static const struct dm_pci_ops pci_x86_ops = {
-   .read_config= pci_x86_read_config,
-   .write_config   = pci_x86_write_config,
-};
-
-static const struct udevice_id pci_x86_ids[] = {
-   { .compatible = "pci-x86" },
-   { }
-};
-
-U_BOOT_DRIVER(pci_x86_drv) = {
-   .name   = "pci_x86",
-   .id = UCLASS_PCI,
-   .of_match   = pci_x86_ids,
-   .ops= &pci_x86_ops,
-};
-
 static const struct udevice_id generic_pch_ids[] = {
{ .compatible = "intel,pch" },
{ }
diff --git a/drivers/pci/pci_x86.c b/drivers/pci/pci_x86.c
index 901bdca..89e8c11 100644
--- a/drivers/pci/pci_x86.c
+++ b/drivers/pci/pci_x86.c
@@ -7,18 +7,21 @@
 #include 
 #include 
 #include 
+#include 
 
-static const struct dm_pci_ops x86_pci_ops = {
+static const struct dm_pci_ops pci_x86_ops = {
+   .read_config= pci_x86_read_config,
+   .write_config   = pci_x86_write_config,
 };
 
-static const struct udevice_id x86_pci_ids[] = {
-   { .compatible = "x86,pci" },
+static const struct udevice_id pci_x86_ids[] = {
+   { .compatible = "pci-x86" },
{ }
 };
 
 U_BOOT_DRIVER(pci_x86) = {
.name   = "pci_x86",
.id = UCLASS_PCI,
-   .of_match = x86_pci_ids,
-   .ops= &x86_pci_ops,
+   .of_match = pci_x86_ids,
+   .ops= &pci_x86_ops,
 };
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 4/7] x86: Add ROM image description for minnowmax

2015-06-25 Thread Simon Glass
The layout of the ROM is a bit hard to discover by reading the code. Add
a table to make it easier.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Fix typos in README.x86

 doc/README.x86 | 17 +
 1 file changed, 17 insertions(+)

diff --git a/doc/README.x86 b/doc/README.x86
index 49d6e83..e58ca19 100644
--- a/doc/README.x86
+++ b/doc/README.x86
@@ -160,6 +160,23 @@ Now you can build U-Boot and obtain u-boot.rom
 $ make minnowmax_defconfig
 $ make all
 
+The ROM image is broken up into these parts:
+
+Offset   Description Controlling config
+
+00   descriptor.bin  Hard-coded to 0 in ifdtool
+001000   me.bin  Set by the descriptor
+50   
+70   u-boot-dtb.bin  CONFIG_SYS_TEXT_BASE
+79   vga.bin CONFIG_X86_OPTION_ROM_ADDR
+7c   fsp.bin CONFIG_FSP_ADDR
+7f8000(depends on size of fsp.bin)
+7fe000   Environment CONFIG_ENV_OFFSET
+7ff800   U-Boot 16-bit boot  CONFIG_SYS_X86_START16
+
+Overall ROM image size is controlled by CONFIG_ROM_SIZE.
+
+
 Intel Galileo instructions:
 
 Only one binary blob is needed for Remote Management Unit (RMU) within Intel
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 3/7] dm: spi: Enable environment for minnowmax

2015-06-25 Thread Simon Glass
Enable a SPI environment and store it in a suitable place.

Signed-off-by: Simon Glass 
Reviewed-by: Bin Meng 
Reviewed-by: Jagan Teki 
---

Changes in v2: None

 include/configs/minnowmax.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/include/configs/minnowmax.h b/include/configs/minnowmax.h
index 547765d..d4d28a7 100644
--- a/include/configs/minnowmax.h
+++ b/include/configs/minnowmax.h
@@ -65,8 +65,7 @@
 /* Avoid a warning in the Realtek Ethernet driver */
 #define CONFIG_SYS_CACHELINE_SIZE 16
 
-/* Environment in SPI flash is unsupported for now */
-#undef CONFIG_ENV_IS_IN_SPI_FLASH
-#define CONFIG_ENV_IS_NOWHERE
+#define CONFIG_ENV_SECT_SIZE   0x1000
+#define CONFIG_ENV_OFFSET  0x007fe000
 
 #endif /* __CONFIG_H */
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 2/7] dm: spi: Correct BIOS protection logic for ICH9

2015-06-25 Thread Simon Glass
The logic is incorrect and currently has no effect. Fix it so that we can
write to SPI flash, since by default it is write-protected.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Use ich_read/write() for BIOS protection update

 drivers/spi/ich.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 66a5cba..f68e07b 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -40,6 +40,7 @@ struct ich_spi_priv {
int status;
int control;
int bbar;
+   int bcr;
uint32_t *pr;   /* only for ich9 */
int speed;  /* pointer to speed control */
ulong max_speed;/* Maximum bus speed in MHz */
@@ -239,6 +240,7 @@ static int ich_init_controller(struct ich_spi_platdata 
*plat,
ctlr->speed = ctlr->control + 2;
ctlr->bbar = offsetof(struct ich9_spi_regs, bbar);
ctlr->preop = offsetof(struct ich9_spi_regs, preop);
+   ctlr->bcr = offsetof(struct ich9_spi_regs, bcr);
ctlr->pr = &ich9_spi->pr[0];
ctlr->base = ich9_spi;
} else {
@@ -688,13 +690,10 @@ static int ich_spi_probe(struct udevice *bus)
 * v9, deassert SMM BIOS Write Protect Disable.
 */
if (plat->use_sbase) {
-   struct ich9_spi_regs *ich9_spi;
-
-   ich9_spi = priv->base;
-   bios_cntl = ich_readb(priv, ich9_spi->bcr);
+   bios_cntl = ich_readb(priv, priv->bcr);
bios_cntl &= ~(1 << 5); /* clear Enable InSMM_STS (EISS) */
bios_cntl |= 1; /* Write Protect Disable (WPD) */
-   ich_writeb(priv, bios_cntl, ich9_spi->bcr);
+   ich_writeb(priv, priv->bcr, bios_cntl);
} else {
pci_read_config_byte(plat->dev, 0xdc, &bios_cntl);
if (plat->ich_version == 9)
-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 0/7] dm: x86: PCI/SPI fixes for minnowboard MAX

2015-06-25 Thread Simon Glass
The SPI flash starts off protected on baytrail. The code which is supposed to
fix this is broken. This series fixes that, enables the SPI environment and
adds documentation.

Also when driver model is enabled for PCI some bugs appear. This series fixes
those and enables driver model for PCI on minnowboard MAX.

Changes in v2:
- Continue to use writew for ICH7
- Use ich_read/write() for BIOS protection update
- Fix typos in README.x86
- Rename the ops and ids arrays for consistency
- Drop the coreboot PCI driver which is no-longer needed
- Only limit the PCI system memory region on x86 machines

Simon Glass (7):
  dm: spi: Correct status register access width
  dm: spi: Correct BIOS protection logic for ICH9
  dm: spi: Enable environment for minnowmax
  x86: Add ROM image description for minnowmax
  x86: pci: Tidy up the generic x86 PCI driver
  dm: x86: minnowmax: Move PCI to use driver model
  dm: x86: baytrail: Correct PCI region 3 when driver model is used

 arch/x86/cpu/baytrail/Makefile|  1 -
 arch/x86/cpu/baytrail/pci.c   | 46 ---
 arch/x86/cpu/coreboot/pci.c   | 21 --
 arch/x86/cpu/cpu.c|  1 +
 arch/x86/dts/minnowmax.dts| 10 +
 common/board_f.c  |  4 
 configs/minnowmax_defconfig   |  1 +
 doc/README.x86| 17 +++
 drivers/pci/pci-uclass.c  |  8 +--
 drivers/pci/pci_x86.c | 13 ++-
 drivers/spi/ich.c | 15 -
 include/asm-generic/global_data.h |  1 +
 include/configs/minnowmax.h   |  6 ++---
 13 files changed, 60 insertions(+), 84 deletions(-)
 delete mode 100644 arch/x86/cpu/baytrail/pci.c

-- 
2.4.3.573.g4eafbef

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


[U-Boot] [PATCH v2 1/7] dm: spi: Correct status register access width

2015-06-25 Thread Simon Glass
The status register on ICH9 is a single byte, so use byte access when
writing to it, to avoid updating the control register also.

Signed-off-by: Simon Glass 
---

Changes in v2:
- Continue to use writew for ICH7

 drivers/spi/ich.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 6b6cfbf..66a5cba 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -411,6 +411,7 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int 
bitlen,
const void *dout, void *din, unsigned long flags)
 {
struct udevice *bus = dev_get_parent(dev);
+   struct ich_spi_platdata *plat = dev_get_platdata(bus);
struct ich_spi_priv *ctlr = dev_get_priv(bus);
uint16_t control;
int16_t opcode_index;
@@ -477,7 +478,10 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int 
bitlen,
if (ret < 0)
return ret;
 
-   ich_writew(ctlr, SPIS_CDS | SPIS_FCERR, ctlr->status);
+   if (plat->ich_version == 7)
+   ich_writew(ctlr, SPIS_CDS | SPIS_FCERR, ctlr->status);
+   else
+   ich_writeb(ctlr, SPIS_CDS | SPIS_FCERR, ctlr->status);
 
spi_setup_type(trans, using_cmd ? bytes : 0);
opcode_index = spi_setup_opcode(ctlr, trans);
-- 
2.4.3.573.g4eafbef

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


Re: [U-Boot] [PATCH 01/11 v2] drivers/net/vsc9953: Cleanup patch

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Thu, Jun 25, 2015 at 11:35 AM, Codrin Constantin Ciubotariu
 wrote:
> Hi Joe,
>
>> >
>> > /* alloc eth device */
>> > dev = (struct eth_device *)calloc(1, sizeof(struct eth_device));
>> > if (!dev)
>> > -   return 1;
>> > +   return -1;
>>
>> Is it reasonable to use values from asm/errno.h here and elsewhere in
>> the driver? This seems like it should return -ENODEV instead of
>> -EPERM.
>
> Yes, I should use values from errno.h . -ENOMEM seems more appropriate to me. 
> What do you think?

Yes, sorry. I didn't look at the line above! :/

>> > +   enabled = !!(vsc9953_l2sw.port[port_no].enabled &
>> > +val & CONFIG_VSC9953_PORT_ENA);
>>
>> This is incorrect... Should be:
>>
>> +   enabled = vsc9953_l2sw.port[port_no].enabled &&
>> +(val & CONFIG_VSC9953_PORT_ENA);
>
> Ok.
>
>> > diff --git a/include/vsc9953.h b/include/vsc9953.h
>> > index 3d11b87..920402f 100644
>> > --- a/include/vsc9953.h
>> > +++ b/include/vsc9953.h
>> > @@ -33,29 +33,60 @@
>> >  #define T1040_SWITCH_GMII_DEV_OFFSET   0x01
>> >  #define VSC9953_PHY_REGS_OFFST 0xAC
>> >
>> > +/* Macros for vsc9953_chip_regs.soft_rst register */
>> >  #define CONFIG_VSC9953_SOFT_SWC_RST_ENA0x0001
>>
>> All of there that are register constants should not have "CONFIG_"
>> prepended to them. That should only be for constants that configure
>> something, eventually only from Kconfig.  Please add another patch
>> before this one that removes that.
>
> Ok, I will add another patch before this one.
>
>> > +/* Macros for vsc9953_sys_pause_cfg.pause_cfg register */
>> >  #define CONFIG_VSC9953_PAUSE_CFG   0x001e
>> > +
>> > +/* Macros for vsc9953_sys_pause_cfg.pause_cfg register */
>> > +#define CONFIG_VSC9953_PAUSE_CFG   0x001e
>
>> This adds a duplicate of the define above it.
>
> I will remove one of them.
>
>> >
>> > +/* Macros for vsc9953_vcap_core_cfg.vcap_mv_cfg register */
>> >  #defineCONFIG_VSC9953_VCAP_MV_CFG  0x
>> >  #defineCONFIG_VSC9953_VCAP_UPDATE_CTRL 0x0104
>>
>> May as well get rid of the tabs here after the defines.
>
> Ok.
>
> Thank you for your review. I will make v3.

Sure thing. I'll try to get through the rest of them today.

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


Re: [U-Boot] [PATCH 01/11 v2] drivers/net/vsc9953: Cleanup patch

2015-06-25 Thread Codrin Constantin Ciubotariu
Hi Joe,

> >
> > /* alloc eth device */
> > dev = (struct eth_device *)calloc(1, sizeof(struct eth_device));
> > if (!dev)
> > -   return 1;
> > +   return -1;
> 
> Is it reasonable to use values from asm/errno.h here and elsewhere in
> the driver? This seems like it should return -ENODEV instead of
> -EPERM.

Yes, I should use values from errno.h . -ENOMEM seems more appropriate to me. 
What do you think?

> > +   enabled = !!(vsc9953_l2sw.port[port_no].enabled &
> > +val & CONFIG_VSC9953_PORT_ENA);
> 
> This is incorrect... Should be:
> 
> +   enabled = vsc9953_l2sw.port[port_no].enabled &&
> +(val & CONFIG_VSC9953_PORT_ENA);

Ok.

> > diff --git a/include/vsc9953.h b/include/vsc9953.h
> > index 3d11b87..920402f 100644
> > --- a/include/vsc9953.h
> > +++ b/include/vsc9953.h
> > @@ -33,29 +33,60 @@
> >  #define T1040_SWITCH_GMII_DEV_OFFSET   0x01
> >  #define VSC9953_PHY_REGS_OFFST 0xAC
> >
> > +/* Macros for vsc9953_chip_regs.soft_rst register */
> >  #define CONFIG_VSC9953_SOFT_SWC_RST_ENA0x0001
> 
> All of there that are register constants should not have "CONFIG_"
> prepended to them. That should only be for constants that configure
> something, eventually only from Kconfig.  Please add another patch
> before this one that removes that.

Ok, I will add another patch before this one.

> > +/* Macros for vsc9953_sys_pause_cfg.pause_cfg register */
> >  #define CONFIG_VSC9953_PAUSE_CFG   0x001e
> > +
> > +/* Macros for vsc9953_sys_pause_cfg.pause_cfg register */
> > +#define CONFIG_VSC9953_PAUSE_CFG   0x001e

> This adds a duplicate of the define above it.

I will remove one of them.

> >
> > +/* Macros for vsc9953_vcap_core_cfg.vcap_mv_cfg register */
> >  #defineCONFIG_VSC9953_VCAP_MV_CFG  0x
> >  #defineCONFIG_VSC9953_VCAP_UPDATE_CTRL 0x0104
> 
> May as well get rid of the tabs here after the defines.

Ok.

Thank you for your review. I will make v3.

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


Re: [U-Boot] [PATCH 02/11 v2] drivers/net/vsc9953: Fix missing reserved register

2015-06-25 Thread Codrin Constantin Ciubotariu
Hi Joe,

> > The VSC9953 DS reserves a register between vlan_mask and anag_efil
> > registers.
> >
> > Signed-off-by: Johnson Leung 
> > ---
> 
> Where is your Signed-off-by: ?  Please either update the "Author" in the 
> commit
> to Johnson Leung or add your Signed-off-by.
> 
> -Joe

Johnson found the issue, but I made a separate patch for it. I will add my 
signature in v3.

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


Re: [U-Boot] [PATCH 7/7] Move defaults from config_cmd_default.h to Kconfig

2015-06-25 Thread Joe Hershberger
Hi Tom,

On Thu, Jun 25, 2015 at 11:15 AM, Tom Rini  wrote:
> On Tue, Jun 23, 2015 at 10:36:20PM -0500, Joe Hershberger wrote:
>> Hi Tom,
>>
>> On Tue, Jun 23, 2015 at 9:33 AM, Tom Rini  wrote:
>> > On Mon, Jun 22, 2015 at 04:15:30PM -0500, Joe Hershberger wrote:
>> >
>> >> This sets the default commands Kconfig to match
>> >> include/config_cmd_default.h commands in the common/Kconfig and removes
>> >> them from include/configs.
>> > [snip]
>> >> diff --git a/common/Kconfig b/common/Kconfig
>> >> index cb14592..2976cd7 100644
>> >> --- a/common/Kconfig
>> >> +++ b/common/Kconfig
>> > [snip]
>> >>  config CMD_IMLS
>> >>   bool "imls"
>> >> + default y
>> >>   help
>> >> List all images found in flash
>> > [snip]
>> >>
>> >>  config CMD_FLASH
>> >>   bool "flinfo, erase, protect"
>> >> + default y
>> >>   help
>> >> NOR flash support.
>> >>   flinfo - print FLASH memory information
>> >
>> > Today we only set these when !SYS_NO_FLASH so we need to Kconfig that
>> > first.
>>
>> While that's true, the moveconfig tool will de-select that option
>> based on SYS_NO_FLASH having been set for that board. While that may
>> not be ideal as far as reacting to an end-user changing that default
>> setting for a given board, the defconfig itself should be consistent
>> with the former default behavior. Also, once SYS_NO_FLASH is moved,
>> such defconfig entries will be removed automatically by savedefconfig.
>> I was trying to limit the number of changes included in this already
>> sizable undertaking.
>>
>> If you feel it's important to include moving this change at the same
>> time, then I can add a patch at the end of the series to include this
>> move.
>>
>> >> @@ -352,6 +371,7 @@ menu "Network commands"
>> >>  config CMD_NET
>> >>   bool "bootp, tftpboot"
>> >>  select NET
>> >> + default y
>> >>   help
>> >> Network commands.
>> >> bootp - boot image via network using BOOTP/TFTP protocol
>> >> @@ -379,6 +399,7 @@ config CMD_DHCP
>> >>
>> >>  config CMD_NFS
>> >>   bool "nfs"
>> >> + default y
>> >>   help
>> >> Boot image via network using NFS protocol.
>> >
>> > I think we now have the smarts available to us to do this only if we
>> > have NET set, so "depends NET", yes?
>>
>> Sure. It could also be a follow-on, though, right? I'm just a bit
>> hesitant to redo all of this, since it really takes a long time to
>> validate (and still may not be perfect).
>
> Sorry for the delay.  Yeah, OK, we can do these as follow-ups but lets
> not wait too long.

OK... I'll start on them now... They won't be nearly as big as all this.

Does this mean you'll take v1 as is?

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


Re: [U-Boot] [PATCH 02/11 v2] drivers/net/vsc9953: Fix missing reserved register

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> The VSC9953 DS reserves a register between vlan_mask and anag_efil
> registers.
>
> Signed-off-by: Johnson Leung 
> ---

Where is your Signed-off-by: ?  Please either update the "Author" in
the commit to Johnson Leung or add your Signed-off-by.

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


Re: [U-Boot] [PATCH 4/7] arm: Make new baltos board not break on savedefconfig

2015-06-25 Thread Tom Rini
On Thu, Jun 25, 2015 at 10:48:09AM -0500, Joe Hershberger wrote:
> Hi Tom,
> 
> On Wed, Jun 24, 2015 at 2:33 AM, Yegor Yefremov
>  wrote:
> > On Wed, Jun 24, 2015 at 8:55 AM, Yegor Yefremov
> >  wrote:
> >> Hi Joe,
> >>
> >> On Wed, Jun 24, 2015 at 5:26 AM, Joe Hershberger
> >>  wrote:
> >>> Hi Tom,
> >>>
> >>> On Tue, Jun 23, 2015 at 9:23 AM, Tom Rini  wrote:
>  On Mon, Jun 22, 2015 at 04:15:27PM -0500, Joe Hershberger wrote:
> 
> > This config defined a CONS_INDEX as a config but did not define it in
> > any Kconfig, so savedefconfig will delete that entry. Use
> > CONFIG_SYS_EXTRA_OPTIONS for now until that is added to Kconfig.
> >
> > Signed-off-by: Joe Hershberger 
> > ---
> >
> >  configs/am335x_baltos_defconfig | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/configs/am335x_baltos_defconfig 
> > b/configs/am335x_baltos_defconfig
> > index 679b04f..030cb51 100644
> > --- a/configs/am335x_baltos_defconfig
> > +++ b/configs/am335x_baltos_defconfig
> > @@ -1,7 +1,6 @@
> >  CONFIG_SPL=y
> >  CONFIG_SPL_STACK_R=y
> >  CONFIG_SPL_STACK_R_ADDR=0x8200
> > -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> > -CONFIG_CONS_INDEX=1
> > +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,NAND"
> >  CONFIG_ARM=y
> >  CONFIG_TARGET_AM335X_BALTOS=y
> 
>  No, something else is wrong.  board/vscom/baltos/Kconfig has CONS_INDEX
>  (like the other am335x boards and yes this needs moving to a better
>  place).
> >>>
> >>> Any thoughts on what's wrong, then? I'm at FTF this week and won't be
> >>> debugging it until next week. There was an issue with this board,
> >>> caused by savedefconfig, which is why I even noticed this board exists
> >>> now. Maybe whoever added it (Yegor Yefremov) didn't try safedefconfig
> >>> against the board?
> >>>
> >>> If nothing else, at least this makes it consistent with all other
> >>> boards that specify CONS_INDEX. At least they don't break.
> >>
> >> I'll take a look at this.
> >
> > I've pulled the latest master
> > (325849ff3d4adeebb8f8f9bc5db950724df9bc21) and tried:
> >
> > make am35x_baltos_defconfig
> > make savedefconfg
> > make
> >
> > and aside from CONS_INDEX disappearing I see no problems. And "make
> > menuconfig" still shows CONS_INDEX = 1.
> 
> It seems this is another case of being bitten by the default value. It
> seems I can either move the definition from its current location in
> board/vscom/baltos/Kconfig to the root Kconfig or maybe the
> common/Kconfig and make the default be 0 (which will bring back the
> entry) and move other boards out of CONFIG_SYS_EXTRA_OPTIONS... or I
> can add to this patch deleting the definition in
> board/vscom/baltos/Kconfig and wait until later to move it properly
> for all boards.

I guess I don't see why we need to do anything right now.  It's not
broken currently (nor are the other am335x boards).  It needs to be
moved out of the board Kconfigs but that can happen as a follow-up.

-- 
Tom


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


Re: [U-Boot] [PATCH 7/7] Move defaults from config_cmd_default.h to Kconfig

2015-06-25 Thread Tom Rini
On Tue, Jun 23, 2015 at 10:36:20PM -0500, Joe Hershberger wrote:
> Hi Tom,
> 
> On Tue, Jun 23, 2015 at 9:33 AM, Tom Rini  wrote:
> > On Mon, Jun 22, 2015 at 04:15:30PM -0500, Joe Hershberger wrote:
> >
> >> This sets the default commands Kconfig to match
> >> include/config_cmd_default.h commands in the common/Kconfig and removes
> >> them from include/configs.
> > [snip]
> >> diff --git a/common/Kconfig b/common/Kconfig
> >> index cb14592..2976cd7 100644
> >> --- a/common/Kconfig
> >> +++ b/common/Kconfig
> > [snip]
> >>  config CMD_IMLS
> >>   bool "imls"
> >> + default y
> >>   help
> >> List all images found in flash
> > [snip]
> >>
> >>  config CMD_FLASH
> >>   bool "flinfo, erase, protect"
> >> + default y
> >>   help
> >> NOR flash support.
> >>   flinfo - print FLASH memory information
> >
> > Today we only set these when !SYS_NO_FLASH so we need to Kconfig that
> > first.
> 
> While that's true, the moveconfig tool will de-select that option
> based on SYS_NO_FLASH having been set for that board. While that may
> not be ideal as far as reacting to an end-user changing that default
> setting for a given board, the defconfig itself should be consistent
> with the former default behavior. Also, once SYS_NO_FLASH is moved,
> such defconfig entries will be removed automatically by savedefconfig.
> I was trying to limit the number of changes included in this already
> sizable undertaking.
> 
> If you feel it's important to include moving this change at the same
> time, then I can add a patch at the end of the series to include this
> move.
> 
> >> @@ -352,6 +371,7 @@ menu "Network commands"
> >>  config CMD_NET
> >>   bool "bootp, tftpboot"
> >>  select NET
> >> + default y
> >>   help
> >> Network commands.
> >> bootp - boot image via network using BOOTP/TFTP protocol
> >> @@ -379,6 +399,7 @@ config CMD_DHCP
> >>
> >>  config CMD_NFS
> >>   bool "nfs"
> >> + default y
> >>   help
> >> Boot image via network using NFS protocol.
> >
> > I think we now have the smarts available to us to do this only if we
> > have NET set, so "depends NET", yes?
> 
> Sure. It could also be a follow-on, though, right? I'm just a bit
> hesitant to redo all of this, since it really takes a long time to
> validate (and still may not be perfect).

Sorry for the delay.  Yeah, OK, we can do these as follow-ups but lets
not wait too long.

-- 
Tom


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


Re: [U-Boot] [PATCH 01/11 v2] drivers/net/vsc9953: Cleanup patch

2015-06-25 Thread Joe Hershberger
Hi Codrin,

On Tue, Jun 23, 2015 at 11:48 AM, Codrin Ciubotariu
 wrote:
> This patch groups some macros defined for registers and
> replaces some magic numbers from vsc9953 with macros. Also,
> "port" and "port_nr" keywords are replaced with "port_no".
>
> Also, in some places, this patch replaces in_le32 and out_le32
> with clrbits_le32 and setbits_le32 to reduce the number of code
> lines and to assure that only intended bits of a register are
> changed.
>
> Signed-off-by: Codrin Ciubotariu 
> ---
> Changes for v2:
> - removed Change-id field;
>
>  drivers/net/vsc9953.c | 100 
> +-
>  include/vsc9953.h |  47 
>  2 files changed, 88 insertions(+), 59 deletions(-)
>
> diff --git a/drivers/net/vsc9953.c b/drivers/net/vsc9953.c
> index fed7358..720ae47 100644
> --- a/drivers/net/vsc9953.c
> +++ b/drivers/net/vsc9953.c
> @@ -25,44 +25,44 @@ static struct vsc9953_info vsc9953_l2sw = {
> .port[9] = VSC9953_PORT_INFO_INITIALIZER(9),
>  };
>
> -void vsc9953_port_info_set_mdio(int port, struct mii_dev *bus)
> +void vsc9953_port_info_set_mdio(int port_no, struct mii_dev *bus)
>  {
> -   if (!VSC9953_PORT_CHECK(port))
> +   if (!VSC9953_PORT_CHECK(port_no))
> return;
>
> -   vsc9953_l2sw.port[port].bus = bus;
> +   vsc9953_l2sw.port[port_no].bus = bus;
>  }
>
> -void vsc9953_port_info_set_phy_address(int port, int address)
> +void vsc9953_port_info_set_phy_address(int port_no, int address)
>  {
> -   if (!VSC9953_PORT_CHECK(port))
> +   if (!VSC9953_PORT_CHECK(port_no))
> return;
>
> -   vsc9953_l2sw.port[port].phyaddr = address;
> +   vsc9953_l2sw.port[port_no].phyaddr = address;
>  }
>
> -void vsc9953_port_info_set_phy_int(int port, phy_interface_t phy_int)
> +void vsc9953_port_info_set_phy_int(int port_no, phy_interface_t phy_int)
>  {
> -   if (!VSC9953_PORT_CHECK(port))
> +   if (!VSC9953_PORT_CHECK(port_no))
> return;
>
> -   vsc9953_l2sw.port[port].enet_if = phy_int;
> +   vsc9953_l2sw.port[port_no].enet_if = phy_int;
>  }
>
> -void vsc9953_port_enable(int port)
> +void vsc9953_port_enable(int port_no)
>  {
> -   if (!VSC9953_PORT_CHECK(port))
> +   if (!VSC9953_PORT_CHECK(port_no))
> return;
>
> -   vsc9953_l2sw.port[port].enabled = 1;
> +   vsc9953_l2sw.port[port_no].enabled = 1;
>  }
>
> -void vsc9953_port_disable(int port)
> +void vsc9953_port_disable(int port_no)
>  {
> -   if (!VSC9953_PORT_CHECK(port))
> +   if (!VSC9953_PORT_CHECK(port_no))
> return;
>
> -   vsc9953_l2sw.port[port].enabled = 0;
> +   vsc9953_l2sw.port[port_no].enabled = 0;
>  }
>
>  static void vsc9953_mdio_write(struct vsc9953_mii_mng *phyregs, int 
> port_addr,
> @@ -148,21 +148,21 @@ static int init_phy(struct eth_device *dev)
> return 0;
>  }
>
> -static int vsc9953_port_init(int port)
> +static int vsc9953_port_init(int port_no)
>  {
> struct eth_device   *dev;
>
> /* Internal ports never have a PHY */
> -   if (VSC9953_INTERNAL_PORT_CHECK(port))
> +   if (VSC9953_INTERNAL_PORT_CHECK(port_no))
> return 0;
>
> /* alloc eth device */
> dev = (struct eth_device *)calloc(1, sizeof(struct eth_device));
> if (!dev)
> -   return 1;
> +   return -1;

Is it reasonable to use values from asm/errno.h here and elsewhere in
the driver? This seems like it should return -ENODEV instead of
-EPERM.

> -   sprintf(dev->name, "SW@PORT%d", port);
> -   dev->priv = &vsc9953_l2sw.port[port];
> +   sprintf(dev->name, "SW@PORT%d", port_no);
> +   dev->priv = &vsc9953_l2sw.port[port_no];
> dev->init = NULL;
> dev->halt = NULL;
> dev->send = NULL;
> @@ -170,7 +170,7 @@ static int vsc9953_port_init(int port)
>
> if (init_phy(dev)) {
> free(dev);
> -   return 1;
> +   return -1;
> }
>
> return 0;
> @@ -255,8 +255,8 @@ void vsc9953_init(bd_t *bis)
> out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_hdx_cfg, 
> hdx_cfg);
> out_le32(&l2sys_reg->sys.front_port_mode[i],
>  CONFIG_VSC9953_FRONT_PORT_MODE);
> -   out_le32(&l2qsys_reg->sys.switch_port_mode[i],
> -CONFIG_VSC9953_PORT_ENA);
> +   setbits_le32(&l2qsys_reg->sys.switch_port_mode[i],
> +CONFIG_VSC9953_PORT_ENA);
> out_le32(&l2dev_gmii_reg->mac_cfg_status.mac_maxlen_cfg,
>  CONFIG_VSC9953_MAC_MAX_LEN);
> out_le32(&l2sys_reg->pause_cfg.pause_cfg[i],
> @@ -312,25 +312,23 @@ void vsc9953_init(bd_t *bis)
>
>  #ifdef CONFIG_VSC9953_CMD
>  /* Enable/disable status of a VSC9953 port */
> -static void vsc9953_port_status_set(int port_nr, u8 enabled)
> +static void vsc995

Re: [U-Boot] [PATCH 7/7] Move defaults from config_cmd_default.h to Kconfig

2015-06-25 Thread Joe Hershberger
Hi Tom,

On Tue, Jun 23, 2015 at 10:36 PM, Joe Hershberger
 wrote:
> Hi Tom,
>
> On Tue, Jun 23, 2015 at 9:33 AM, Tom Rini  wrote:
>> On Mon, Jun 22, 2015 at 04:15:30PM -0500, Joe Hershberger wrote:
>>
>>> This sets the default commands Kconfig to match
>>> include/config_cmd_default.h commands in the common/Kconfig and removes
>>> them from include/configs.
>> [snip]
>>> diff --git a/common/Kconfig b/common/Kconfig
>>> index cb14592..2976cd7 100644
>>> --- a/common/Kconfig
>>> +++ b/common/Kconfig
>> [snip]
>>>  config CMD_IMLS
>>>   bool "imls"
>>> + default y
>>>   help
>>> List all images found in flash
>> [snip]
>>>
>>>  config CMD_FLASH
>>>   bool "flinfo, erase, protect"
>>> + default y
>>>   help
>>> NOR flash support.
>>>   flinfo - print FLASH memory information
>>
>> Today we only set these when !SYS_NO_FLASH so we need to Kconfig that
>> first.
>
> While that's true, the moveconfig tool will de-select that option
> based on SYS_NO_FLASH having been set for that board. While that may
> not be ideal as far as reacting to an end-user changing that default
> setting for a given board, the defconfig itself should be consistent
> with the former default behavior. Also, once SYS_NO_FLASH is moved,
> such defconfig entries will be removed automatically by savedefconfig.
> I was trying to limit the number of changes included in this already
> sizable undertaking.
>
> If you feel it's important to include moving this change at the same
> time, then I can add a patch at the end of the series to include this
> move.
>
>>> @@ -352,6 +371,7 @@ menu "Network commands"
>>>  config CMD_NET
>>>   bool "bootp, tftpboot"
>>>  select NET
>>> + default y
>>>   help
>>> Network commands.
>>> bootp - boot image via network using BOOTP/TFTP protocol
>>> @@ -379,6 +399,7 @@ config CMD_DHCP
>>>
>>>  config CMD_NFS
>>>   bool "nfs"
>>> + default y
>>>   help
>>> Boot image via network using NFS protocol.
>>
>> I think we now have the smarts available to us to do this only if we
>> have NET set, so "depends NET", yes?
>
> Sure. It could also be a follow-on, though, right? I'm just a bit
> hesitant to redo all of this, since it really takes a long time to
> validate (and still may not be perfect).
>
> I need a new build machine. :/

So what do you need me to do here?

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


Re: [U-Boot] [PATCH 4/7] arm: Make new baltos board not break on savedefconfig

2015-06-25 Thread Joe Hershberger
Hi Tom,

On Wed, Jun 24, 2015 at 2:33 AM, Yegor Yefremov
 wrote:
> On Wed, Jun 24, 2015 at 8:55 AM, Yegor Yefremov
>  wrote:
>> Hi Joe,
>>
>> On Wed, Jun 24, 2015 at 5:26 AM, Joe Hershberger
>>  wrote:
>>> Hi Tom,
>>>
>>> On Tue, Jun 23, 2015 at 9:23 AM, Tom Rini  wrote:
 On Mon, Jun 22, 2015 at 04:15:27PM -0500, Joe Hershberger wrote:

> This config defined a CONS_INDEX as a config but did not define it in
> any Kconfig, so savedefconfig will delete that entry. Use
> CONFIG_SYS_EXTRA_OPTIONS for now until that is added to Kconfig.
>
> Signed-off-by: Joe Hershberger 
> ---
>
>  configs/am335x_baltos_defconfig | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/configs/am335x_baltos_defconfig 
> b/configs/am335x_baltos_defconfig
> index 679b04f..030cb51 100644
> --- a/configs/am335x_baltos_defconfig
> +++ b/configs/am335x_baltos_defconfig
> @@ -1,7 +1,6 @@
>  CONFIG_SPL=y
>  CONFIG_SPL_STACK_R=y
>  CONFIG_SPL_STACK_R_ADDR=0x8200
> -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> -CONFIG_CONS_INDEX=1
> +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,NAND"
>  CONFIG_ARM=y
>  CONFIG_TARGET_AM335X_BALTOS=y

 No, something else is wrong.  board/vscom/baltos/Kconfig has CONS_INDEX
 (like the other am335x boards and yes this needs moving to a better
 place).
>>>
>>> Any thoughts on what's wrong, then? I'm at FTF this week and won't be
>>> debugging it until next week. There was an issue with this board,
>>> caused by savedefconfig, which is why I even noticed this board exists
>>> now. Maybe whoever added it (Yegor Yefremov) didn't try safedefconfig
>>> against the board?
>>>
>>> If nothing else, at least this makes it consistent with all other
>>> boards that specify CONS_INDEX. At least they don't break.
>>
>> I'll take a look at this.
>
> I've pulled the latest master
> (325849ff3d4adeebb8f8f9bc5db950724df9bc21) and tried:
>
> make am35x_baltos_defconfig
> make savedefconfg
> make
>
> and aside from CONS_INDEX disappearing I see no problems. And "make
> menuconfig" still shows CONS_INDEX = 1.

It seems this is another case of being bitten by the default value. It
seems I can either move the definition from its current location in
board/vscom/baltos/Kconfig to the root Kconfig or maybe the
common/Kconfig and make the default be 0 (which will bring back the
entry) and move other boards out of CONFIG_SYS_EXTRA_OPTIONS... or I
can add to this patch deleting the definition in
board/vscom/baltos/Kconfig and wait until later to move it properly
for all boards.

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


Re: [U-Boot] [PATCH 4/7] arm: Make new baltos board not break on savedefconfig

2015-06-25 Thread Joe Hershberger
Hi Yegor,

On Wed, Jun 24, 2015 at 2:33 AM, Yegor Yefremov
 wrote:
> On Wed, Jun 24, 2015 at 8:55 AM, Yegor Yefremov
>  wrote:
>> Hi Joe,
>>
>> On Wed, Jun 24, 2015 at 5:26 AM, Joe Hershberger
>>  wrote:
>>> Hi Tom,
>>>
>>> On Tue, Jun 23, 2015 at 9:23 AM, Tom Rini  wrote:
 On Mon, Jun 22, 2015 at 04:15:27PM -0500, Joe Hershberger wrote:

> This config defined a CONS_INDEX as a config but did not define it in
> any Kconfig, so savedefconfig will delete that entry. Use
> CONFIG_SYS_EXTRA_OPTIONS for now until that is added to Kconfig.
>
> Signed-off-by: Joe Hershberger 
> ---
>
>  configs/am335x_baltos_defconfig | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/configs/am335x_baltos_defconfig 
> b/configs/am335x_baltos_defconfig
> index 679b04f..030cb51 100644
> --- a/configs/am335x_baltos_defconfig
> +++ b/configs/am335x_baltos_defconfig
> @@ -1,7 +1,6 @@
>  CONFIG_SPL=y
>  CONFIG_SPL_STACK_R=y
>  CONFIG_SPL_STACK_R_ADDR=0x8200
> -CONFIG_SYS_EXTRA_OPTIONS="NAND"
> -CONFIG_CONS_INDEX=1
> +CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=1,NAND"
>  CONFIG_ARM=y
>  CONFIG_TARGET_AM335X_BALTOS=y

 No, something else is wrong.  board/vscom/baltos/Kconfig has CONS_INDEX
 (like the other am335x boards and yes this needs moving to a better
 place).
>>>
>>> Any thoughts on what's wrong, then? I'm at FTF this week and won't be
>>> debugging it until next week. There was an issue with this board,
>>> caused by savedefconfig, which is why I even noticed this board exists
>>> now. Maybe whoever added it (Yegor Yefremov) didn't try safedefconfig
>>> against the board?
>>>
>>> If nothing else, at least this makes it consistent with all other
>>> boards that specify CONS_INDEX. At least they don't break.
>>
>> I'll take a look at this.
>
> I've pulled the latest master
> (325849ff3d4adeebb8f8f9bc5db950724df9bc21) and tried:
>
> make am35x_baltos_defconfig
> make savedefconfg
> make
>
> and aside from CONS_INDEX disappearing I see no problems. And "make
> menuconfig" still shows CONS_INDEX = 1.
>
> Should I submit following patch, so that Baltos has the same config as BBB?

That shouldn't really be necessary since this series already
effectively does this. It is good practice in the future, though.

> diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
> index 679b04f..1d287a8 100644
> --- a/configs/am335x_baltos_defconfig
> +++ b/configs/am335x_baltos_defconfig
> @@ -1,7 +1,6 @@
> +CONFIG_ARM=y
> +CONFIG_TARGET_AM335X_BALTOS=y
>  CONFIG_SPL=y
>  CONFIG_SPL_STACK_R=y
>  CONFIG_SPL_STACK_R_ADDR=0x8200
>  CONFIG_SYS_EXTRA_OPTIONS="NAND"
> -CONFIG_CONS_INDEX=1
> -CONFIG_ARM=y
> -CONFIG_TARGET_AM335X_BALTOS=y

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


Re: [U-Boot] [PATCH 6/6] ARM64: HiKey: hi6220: Add u-boot support for the 96boards CE HiKey board.

2015-06-25 Thread Peter Griffin
Hi Rob,

On 12 May 2015 at 19:29, Rob Herring  wrote:

> On Tue, May 12, 2015 at 8:25 AM, Peter Griffin 
> wrote:
> > HiKey is the first 96boards consumer edition compliant board. It
> features a hi6220
> > SoC which has eight ARM A53 cpu's.
>

Thanks for reviewing the patches. Also sorry for the long lag in replying
to you. I have been
a bit busy on other activities recently.



>  arch/arm/Kconfig|   5 +
>  board/96boards/hikey64/Kconfig  |  12 ++
>  board/96boards/hikey64/Makefile |   8 +
>  board/96boards/hikey64/hikey.c  | 439


This is more likely to have common parts with other HiSi boards than
> other 96boards compliant boards.
>

OK, I've renamed the directory hisilicon in v2 which seems to match with how
other semi vendors have done it e.g. ti, samsung and broadcom


> >  configs/hikey_aemv8a_defconfig  |   5 +
> >  include/configs/hikey_aemv8a.h  | 187 +
>
> aemv8a seems to be leftover from VExpress. Just hikey should be enough.
>

Yes your right, I've removed it in v2

>
> >  6 files changed, 656 insertions(+)
> >  create mode 100644 board/96boards/hikey64/Kconfig
> >  create mode 100644 board/96boards/hikey64/Makefile
> >  create mode 100644 board/96boards/hikey64/hikey.c
> >  create mode 100644 configs/hikey_aemv8a_defconfig
> >  create mode 100644 include/configs/hikey_aemv8a.h
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > index 7ed0e20..0b6de5d 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -656,6 +656,10 @@ config TARGET_LS2085A_SIMU
> > select ARM64
> > select ARMV8_MULTIENTRY
> >
> > +config TARGET_96BOARDS_HIKEY
> > +   bool "Support HiKey 96boards Consumer Edition Platform"
> > +   select ARM64
> > +
> >  config TARGET_LS1021AQDS
> > bool "Support ls1021aqds"
> > select CPU_V7
> > @@ -787,6 +791,7 @@ source "board/armadeus/apf27/Kconfig"
> >  source "board/armltd/integrator/Kconfig"
> >  source "board/armltd/vexpress/Kconfig"
> >  source "board/armltd/vexpress64/Kconfig"
> > +source "board/96boards/hikey64/Kconfig"
> >  source "board/bachmann/ot1200/Kconfig"
> >  source "board/balloon3/Kconfig"
> >  source "board/barco/platinum/Kconfig"
> > diff --git a/board/96boards/hikey64/Kconfig
> b/board/96boards/hikey64/Kconfig
> > new file mode 100644
> > index 000..eb1709b
> > --- /dev/null
> > +++ b/board/96boards/hikey64/Kconfig
> > @@ -0,0 +1,12 @@
> > +if TARGET_96BOARDS_HIKEY
> > +
> > +config SYS_BOARD
> > +   default "hikey64"
> > +
> > +config SYS_VENDOR
> > +   default "96boards"
>
> 96boards doesn't really make boards. This should be CircuitCo or HiSilicon.
>

Renamed to be HiSilicon in v2


>
> > +
> > +config SYS_CONFIG_NAME
> > +   default "hikey_aemv8a"
> > +
> > +endif
> > diff --git a/board/96boards/hikey64/Makefile
> b/board/96boards/hikey64/Makefile
> > new file mode 100644
> > index 000..d4ec8c7
>




> > +#endif
> > +
> > +DECLARE_GLOBAL_DATA_PTR;
> > +
> > +#if defined(CONFIG_SHOW_BOOT_PROGRESS)
> > +void show_boot_progress(int progress)
> > +{
> > +   printf("Boot reached stage %d\n", progress);
>
> Nothing h/w specific here. I'd remove or make this be the default
> (weak) implementation.
>

I've removed it in v2


>
> > +}
> > +#endif
> > +
> > +static inline void delay(ulong loops)
>
> udelay/mdelay does not work for you?
>

This was left over from vexpress. I will remove in v2 (after double checking
that udelay and mdelay are indeed working properly).

> +{
> +   __asm__ volatile ("1:\n"
> +   "subs %0, %1, #1\n"
> +   "bne 1b" : "=r" (loops) : "0" (loops));
> +}
> +
> +
> +#define EYE_PATTERN0x70533483
> +
> +static void init_usb_and_picophy(void)
> +{
> +   unsigned int data;
> +
> +   /* enable USB clock */
> +   writel(PERI_CLK0_USBOTG, PERI_SC_PERIPH_CLK0_EN);
> +   do {
> +   data = readl(PERI_SC_PERIPH_CLK0_STAT);
> +   } while ((data & PERI_CLK0_USBOTG) == 0);
> +
> +   /* take usb IPs out of reset */
> +   writel(PERI_RST0_USBOTG_BUS | PERI_RST0_POR_PICOPHY |
> +   PERI_RST0_USBOTG | PERI_RST0_USBOTG_32K,
> +   PERI_SC_PERIPH_RST0_DIS);
> +   do {
> +   data = readl(PERI_SC_PERIPH_RST0_STAT);
> +   data &= PERI_RST0_USBOTG_BUS | PERI_RST0_POR_PICOPHY |
> +   PERI_RST0_USBOTG | PERI_RST0_USBOTG_32K;
> +   } while (data);
> +
> +   /*CTRL 5*/
> +   data = readl(PERI_SC_PERIPH_CTRL5);
> +   data &= ~PERI_CTRL5_PICOPHY_BC_MODE;
> +   data |= PERI_CTRL5_USBOTG_RES_SEL | PERI_CTRL5_PICOPHY_ACAENB;
> +   data |= 0x300;
> +   writel(data, PERI_SC_PERIPH_CTRL5);
> +
> +   /*CTRL 4*/
> +
> +   /* configure USB PHY */
> +   data = readl(PERI_SC_PERIPH_CTRL4);
> +
> +   /* make PHY out of low power mode */
> +   data &= ~PERI_CTRL4_PICO_SIDDQ;
> +   data &= ~PERI_CTRL4_PICO_OGDISABLE;
> +   data |= PERI_CTR

Re: [U-Boot] [PATCH 07/11] x86: pci: Tidy up the generic x86 PCI driver

2015-06-25 Thread Simon Glass
Hi Bin,

On 24 June 2015 at 09:15, Simon Glass  wrote:
> Hi Bin,
>
> On 23 June 2015 at 21:59, Bin Meng  wrote:
>> Hi Simon,
>>
>> On Wed, Jun 24, 2015 at 11:54 AM, Simon Glass  wrote:
>>> Hi Bin,
>>>
>>> On 23 June 2015 at 21:46, Bin Meng  wrote:
 Hi Simon,

 On Wed, Jun 24, 2015 at 11:18 AM, Simon Glass  wrote:
> Hi Bin,
>
> On 7 June 2015 at 20:15, Bin Meng  wrote:
>> Hi Simon,
>>
>> On Sun, Jun 7, 2015 at 10:50 PM, Simon Glass  wrote:
>>> This driver should use the x86 PCI configuration functions. Also adjust 
>>> its
>>> compatible string to something generic (i.e. without a vendor name).
>>>
>>> Signed-off-by: Simon Glass 
>>> ---
>>>
>>>  drivers/pci/pci_x86.c | 5 -
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/pci/pci_x86.c b/drivers/pci/pci_x86.c
>>> index 901bdca..9f842c3 100644
>>> --- a/drivers/pci/pci_x86.c
>>> +++ b/drivers/pci/pci_x86.c
>>> @@ -7,12 +7,15 @@
>>>  #include 
>>>  #include 
>>>  #include 
>>> +#include 
>>>
>>>  static const struct dm_pci_ops x86_pci_ops = {
>>
>> To keep the consistent naming to match the driver name, can we rename
>> this to pci_x86_ops?
>
> OK
>
>>
>>> +   .read_config= pci_x86_read_config,
>>> +   .write_config   = pci_x86_write_config,
>>
>> Can we move pci_x86_read_config() and pci_x86_write_config() from
>> arch/x86/cpu/pci.c to this file to make it a complete driver file?
>> Also create a new header file pci_x86.h to declare these two so that
>> it can be used by ivybridge.
>
> I can certainly drop the ivybridge duplication. But I don't think it
> is right to call directly into a driver in drivers/...
>
> We should use driver model for this if we want to do it properly. I
> would like to continue the work to move x86 fully to driver model.
>
> In the meantime I think that directly called functions should be in 
> arch/x86.
>

 Sorry I don't get it. I mean moving the implementation of
 pci_x86_read_config() and pci_x86_write_config() to
 drivers/pci/pci_x86.c. Do you have some concern about this?

 [snip]
>>>
>>> Yes it is still used by arch/x86/cpu/coreboot/pci.c - and as I say I
>>> don't like the 'call directly into driver' idea. If we could remove
>>> the coreboot case then it would be fine.
>>
>> Why not we drop this coreboot pci driver (arch/x86/cpu/coreboot/pci.c)
>> and use the new one (drivers/pci/pci_x86.c) directly?
>
> Yes let's do that. I can't see any reason not to.

I think the problem is that cpu/ivybridge/pci.c has its own driver and
wants to call the pci_x86_read/write_config() functions. So they
really need to be in a generic area. I was thinking about coreboot
yesterday, but the problem is ivybridge.

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


[U-Boot] [PATCH] Baltos: enable CMD_NET in defconfig

2015-06-25 Thread yegorslists
From: Yegor Yefremov 

Signed-off-by: Yegor Yefremov 
---
 configs/am335x_baltos_defconfig |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/am335x_baltos_defconfig b/configs/am335x_baltos_defconfig
index 679b04f..4d2f075 100644
--- a/configs/am335x_baltos_defconfig
+++ b/configs/am335x_baltos_defconfig
@@ -1,7 +1,7 @@
+CONFIG_ARM=y
+CONFIG_TARGET_AM335X_BALTOS=y
+CONFIG_CMD_NET=y
 CONFIG_SPL=y
 CONFIG_SPL_STACK_R=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
 CONFIG_SYS_EXTRA_OPTIONS="NAND"
-CONFIG_CONS_INDEX=1
-CONFIG_ARM=y
-CONFIG_TARGET_AM335X_BALTOS=y
-- 
1.7.7

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


Re: [U-Boot] corrupted tags in git://git.denx.de/u-boot ?

2015-06-25 Thread Tom Rini
On Thu, Jun 25, 2015 at 03:22:21PM +0200, Wolfgang Denk wrote:
> Dear Igor,
> 
> In message <558979e4.9030...@compulab.co.il> you wrote:
> > 
> > > In other words, I cannot reproduce your issue here.
> > 
> > May be it has something to do with my git version?
> > $ git --version
> > git version 2.3.6
> 
> I did my tests with:
> 
> -> git --version
> git version 2.1.0
> 
> [This is what Fedora 21 uses.]
> 
> 
> In Fedora 22 I get
> 
> -> git --version
> git version 2.4.2
> 
> which then shows:
> 
> -> git fsck --full
> Checking object directories: 100% (256/256), done.
> error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
> error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
> error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
> Checking objects: 100% (328644/328644), done.
> Checking connectivity: 325719, done.
> 
> 
> > $ git fsck --full
> > Checking object directories: 100% (256/256), done.
> > error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
> > error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
> > error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
> > Checking objects: 100% (325719/325719), done.
> > Checking connectivity: 325719, done.
> 
> Confirmed.
> 
> > It seems that the check for termination with '\n' in tag headers
> > started to be a requirement from git version 2.2.0?
> 
> I think you are right.  The fact that v2.1.0 does not show anything
> but v2.3.6 and v2.4.2 do also supports your analysis.
> 
> > This [1] seems to be the patch that triggers the message I see.
> > 
> > [1] 
> > https://github.com/git/git/commit/4d0d89755e82c40df88cf94d84031978f8eac827
> 
> Yes, I agree.
> 
> So apparently the tags  LABEL_2006_03_12_0025, LABEL_2006_04_18_1106,
> and LABEL_2006_05_19_1133 are affected.
> 
> IIUC it should be a harmless thing to just recreate the same tags
> (referring to the same commits)?  Or can anybody see any problems tha
> might be caused by such a tag re-creation?  I mean, it is not like a
> rebase of the repository or something like that?  Right?

Lets take it up on the git list and ask for help/advice?

-- 
Tom


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


Re: [U-Boot] Pull request: u-boot-spi/master

2015-06-25 Thread Jagan Teki
On 25 June 2015 at 17:06, Tom Rini  wrote:
> On Thu, Jun 25, 2015 at 11:01:44AM +0530, Jagan Teki wrote:
>> On 25 June 2015 at 05:01, Tom Rini  wrote:
>> > On Tue, Jun 23, 2015 at 08:47:25PM +0530, Jagan Teki wrote:
>> >
>> >> Hi Tom,
>> >>
>> >> Please pull this request, few importent feature list on spi-flash front
>> >> like data flash and spi flash MTD supports.
>> >>
>> >> thanks!
>> >> Jagan.
>> >>
>> >> The following changes since commit 
>> >> c6265f7f3410b5e5763181cdd123a3f6fcd9fd58:
>> >>
>> >>   CPCI4052: Remove CONFIG_SYS_LONGHELP (2015-06-18 16:19:00 -0400)
>> >>
>> >> are available in the git repository at:
>> >>
>> >>   git://git.denx.de/u-boot-spi.git master
>> >>
>> >> for you to fetch changes up to 1070bf38a5c92c8d1a77b26380988957890ba6de:
>> >>
>> >>   mtd, spi: Check if flash pointer is used (2015-06-23 01:13:23 +0530)
>> >>
>> >
>> > This introduces build problems on ls1021atwr_qspi and ls1021aqds_qspi.
>>
>> Don't know what it causes, I applied manually all 8 patches on master
>> and I couldn't
>> see any issues.
>
> Same for both:
>arm:  +   ls1021atwr_qspi
> +(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c: In function 
> 'spi_flash_std_probe':
> +(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c:480:54: error: dereferencing 
> pointer to i
> ncomplete type
> +(ls1021atwr_qspi)   debug("%s: slave=%p, cs=%d\n", __func__, slave, 
> plat->cs);
> +(ls1021atwr_qspi)   ^
> +(ls1021atwr_qspi) include/common.h:109:26: note: in definition of macro 
> 'debug_cond'
> +(ls1021atwr_qspi) printf(pr_fmt(fmt), ##args); \
> +(ls1021atwr_qspi)   ^
> +(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c:480:2: note: in expansion of 
> macro 'debug
> '
> +(ls1021atwr_qspi)   ^
> +(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c: In function 'spi_flash_free':
> +(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:47:29: error: 'struct 
> spi_slave' has no member named 'dev'
> +(ls1021atwr_qspi)   spi_flash_remove(flash->spi->dev);
> +(ls1021atwr_qspi)  ^
> +(ls1021atwr_qspi)   ret = spi_get_bus_and_cs(busnum, cs, max_hz, spi_mode,
> +(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:66:15: error: 'struct 
> spi_slave' has no member named 'dev'
> +(ls1021atwr_qspi)   *devp = slave->dev;
> +(ls1021atwr_qspi)^
> +(ls1021atwr_qspi) make[2]: *** [drivers/mtd/spi/sf_probe.o] Error 1
> +(ls1021atwr_qspi) make[2]: *** [drivers/mtd/spi/sf-uclass.o] Error 1
> +(ls1021atwr_qspi) make[1]: *** [drivers/mtd/spi] Error 2
> +(ls1021atwr_qspi)   ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
> +(ls1021atwr_qspi) make: *** [sub-make] Error 2
> w+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c: In function 
> 'spi_flash_probe_bus_cs':
> w+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:61:2: warning: implicit 
> declaration of function 'spi_get_bus_and_cs' [-Wimplicit-function-declaration]
> w+(ls1021atwr_qspi) common/cmd_sf.c: In function 'do_spi_flash_probe':
> w+(ls1021atwr_qspi) common/cmd_sf.c:123:2: warning: implicit declaration of 
> function 'spi_find_bus_and_cs' [-Wimplicit-function-declaration]
>
> Because CONFIG_DM is not set, and before the SPI patches this is fine but
> now it's causing this failure.

Looks like some other dependencies about CONFIG_DM, let me look at it.
and will come back.

thanks!
-- 
Jagan | openedev.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 4/4] arm: ls102xa: Enable Driver Model SPI for ls1021atwr

2015-06-25 Thread Jagan Teki
On 19 June 2015 at 13:44, Jagan Teki  wrote:
> On 19 June 2015 at 13:20, Wang Haikun  wrote:
>> On 6/19/2015 3:34 PM, Jagan Teki wrote:
>>> On 18 June 2015 at 12:24, Jagan Teki  wrote:
 On 18 June 2015 at 07:50, Wang Haikun  wrote:
> On 6/17/2015 8:30 PM, Simon Glass wrote:
>> Hi,
>>
>> On 17 June 2015 at 03:36, Bin Meng  wrote:
>>> Hi Haikun,
>>>
>>> On Mon, May 18, 2015 at 9:25 PM, Haikun Wang 
>>>  wrote:
 From: Haikun Wang 

 Enable Driver Model SPI for ls1021atwr board.
 DSPI and QSPI only be enabled when boot from QSPI.
 DSPI and QSPI are compatible under Driver Model SPI.

 Signed-off-by: Haikun Wang 
 Change-Id: I6342807da7725ae8b678952117c8758c75a61d3d
>>>
>>> Where is this commit id? I couldn't see it on "git log"
>> Hi Jagan,
>>
>> It is not a git commit ID, it is a code review task ID of gerrit in fact.
>> I'm sorry again for forgetting remove it when submit patch.
>>
>> Best regards,
>> Wang Haikun
>>>
 Reviewed-on: http://git.am.freescale.net:8181/33447>
> Best regards,
> Wang Haikun
>>
>>>
>>> Is this URL Freescale internal? I cannot access it.
>>>
>>
>> Looks like it. BTW patman will remove these Gerrit tags automatically.
> Yes, it is our internal URL.
> I forget to remove it.
> It couldn't be better if it will be removed automatically.

 I will remove if something not remove automatically.

 Anyone have any comments on these patch-set, I'm planning to take these.

 https://patchwork.ozlabs.org/patch/473391/
 https://patchwork.ozlabs.org/patch/473392/

 https://patchwork.ozlabs.org/patch/473393/
 https://patchwork.ozlabs.org/patch/473394/
Few CONFIG_DM_* were missing in these two patches, did these patches
have any dependencies with other series, please look at and let me know.

thanks!
-- 
Jagan | openedev.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] corrupted tags in git://git.denx.de/u-boot ?

2015-06-25 Thread Wolfgang Denk
Dear Igor,

In message <558979e4.9030...@compulab.co.il> you wrote:
> 
> > In other words, I cannot reproduce your issue here.
> 
> May be it has something to do with my git version?
> $ git --version
> git version 2.3.6

I did my tests with:

-> git --version
git version 2.1.0

[This is what Fedora 21 uses.]


In Fedora 22 I get

-> git --version
git version 2.4.2

which then shows:

-> git fsck --full
Checking object directories: 100% (256/256), done.
error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
Checking objects: 100% (328644/328644), done.
Checking connectivity: 325719, done.


> $ git fsck --full
> Checking object directories: 100% (256/256), done.
> error in tag eb394f56db3e05d00891d6dc36a00df0025cf255: unterminated header
> error in tag 9bf86baaa3b35b25baa2d664e2f7f6cafad689ee: unterminated header
> error in tag c7071e6d645a8e13adb0d4cea2caad27213fa62f: unterminated header
> Checking objects: 100% (325719/325719), done.
> Checking connectivity: 325719, done.

Confirmed.

> It seems that the check for termination with '\n' in tag headers
> started to be a requirement from git version 2.2.0?

I think you are right.  The fact that v2.1.0 does not show anything
but v2.3.6 and v2.4.2 do also supports your analysis.

> This [1] seems to be the patch that triggers the message I see.
> 
> [1] https://github.com/git/git/commit/4d0d89755e82c40df88cf94d84031978f8eac827

Yes, I agree.

So apparently the tags  LABEL_2006_03_12_0025, LABEL_2006_04_18_1106,
and LABEL_2006_05_19_1133 are affected.

IIUC it should be a harmless thing to just recreate the same tags
(referring to the same commits)?  Or can anybody see any problems tha
might be caused by such a tag re-creation?  I mean, it is not like a
rebase of the repository or something like that?  Right?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
C++ was an interesting and valuable experiment, but we've learned its
lessons and it's time to move on.
- Peter Curran in 
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] sunxi:Updated A31 & A31-mele i7 support

2015-06-25 Thread Ian Campbell
On Thu, 2015-06-25 at 18:20 +0800, 加特技的肖特基 wrote:
> I fixed SUNXI_MMCSLOT support and update the mele i7 mod-emmc support~

As I requested in the earlier private mail, please make multiple changes
using multiple patches, not all wedged into one.

> Eh..I don't know what the sign-off is~

The first hit on google for "u-boot signed-off" for me was
http://www.denx.de/wiki/U-Boot/DevelopmentProcess and the second was
http://www.denx.de/wiki/U-Boot/Patches

Ian.


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


Re: [U-Boot] Pull request: u-boot-spi/master

2015-06-25 Thread Tom Rini
On Thu, Jun 25, 2015 at 11:01:44AM +0530, Jagan Teki wrote:
> On 25 June 2015 at 05:01, Tom Rini  wrote:
> > On Tue, Jun 23, 2015 at 08:47:25PM +0530, Jagan Teki wrote:
> >
> >> Hi Tom,
> >>
> >> Please pull this request, few importent feature list on spi-flash front
> >> like data flash and spi flash MTD supports.
> >>
> >> thanks!
> >> Jagan.
> >>
> >> The following changes since commit 
> >> c6265f7f3410b5e5763181cdd123a3f6fcd9fd58:
> >>
> >>   CPCI4052: Remove CONFIG_SYS_LONGHELP (2015-06-18 16:19:00 -0400)
> >>
> >> are available in the git repository at:
> >>
> >>   git://git.denx.de/u-boot-spi.git master
> >>
> >> for you to fetch changes up to 1070bf38a5c92c8d1a77b26380988957890ba6de:
> >>
> >>   mtd, spi: Check if flash pointer is used (2015-06-23 01:13:23 +0530)
> >>
> >
> > This introduces build problems on ls1021atwr_qspi and ls1021aqds_qspi.
> 
> Don't know what it causes, I applied manually all 8 patches on master
> and I couldn't
> see any issues.

Same for both:
   arm:  +   ls1021atwr_qspi
+(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c: In function 
'spi_flash_std_probe':
+(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c:480:54: error: dereferencing 
pointer to i
ncomplete type
+(ls1021atwr_qspi)   debug("%s: slave=%p, cs=%d\n", __func__, slave, plat->cs);
+(ls1021atwr_qspi)   ^
+(ls1021atwr_qspi) include/common.h:109:26: note: in definition of macro 
'debug_cond'
+(ls1021atwr_qspi) printf(pr_fmt(fmt), ##args); \
+(ls1021atwr_qspi)   ^
+(ls1021atwr_qspi) drivers/mtd/spi/sf_probe.c:480:2: note: in expansion of 
macro 'debug
'
+(ls1021atwr_qspi)   ^
+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c: In function 'spi_flash_free':
+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:47:29: error: 'struct spi_slave' 
has no member named 'dev'
+(ls1021atwr_qspi)   spi_flash_remove(flash->spi->dev);
+(ls1021atwr_qspi)  ^
+(ls1021atwr_qspi)   ret = spi_get_bus_and_cs(busnum, cs, max_hz, spi_mode,
+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:66:15: error: 'struct spi_slave' 
has no member named 'dev'
+(ls1021atwr_qspi)   *devp = slave->dev;
+(ls1021atwr_qspi)^
+(ls1021atwr_qspi) make[2]: *** [drivers/mtd/spi/sf_probe.o] Error 1
+(ls1021atwr_qspi) make[2]: *** [drivers/mtd/spi/sf-uclass.o] Error 1
+(ls1021atwr_qspi) make[1]: *** [drivers/mtd/spi] Error 2
+(ls1021atwr_qspi)   ret = spi_find_bus_and_cs(bus, cs, &bus_dev, &new);
+(ls1021atwr_qspi) make: *** [sub-make] Error 2
w+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c: In function 
'spi_flash_probe_bus_cs':
w+(ls1021atwr_qspi) drivers/mtd/spi/sf-uclass.c:61:2: warning: implicit 
declaration of function 'spi_get_bus_and_cs' [-Wimplicit-function-declaration]
w+(ls1021atwr_qspi) common/cmd_sf.c: In function 'do_spi_flash_probe':
w+(ls1021atwr_qspi) common/cmd_sf.c:123:2: warning: implicit declaration of 
function 'spi_find_bus_and_cs' [-Wimplicit-function-declaration]

Because CONFIG_DM is not set, and before the SPI patches this is fine but
now it's causing this failure.

-- 
Tom


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


[U-Boot] [PATCH] tools/imximage: set DCD pointer to NULL when its length is 0

2015-06-25 Thread Baruch Siach
When dcd_len is 0 the Write Data command that the set_dcd_rst_v2() routine
generates is empty. This causes HAB to complain that the command is invalid.

- HAB Event 1 -
event data:
0xdb 0x00 0x0c 0x41 0x33 0x06 0xc0 0x00
0xcc 0x00 0x04 0x04

To fix this set the DCD pointer in the IVT to NULL in this case. The DCD header
itself is still needed for detect_imximage_version() to determine the image
version.

Signed-off-by: Baruch Siach 
---
 tools/imximage.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/imximage.c b/tools/imximage.c
index 6f469ae6336c..7b91d09699ad 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -250,7 +250,11 @@ static void set_imx_hdr_v2(struct imx_header *imxhdr, 
uint32_t dcd_len,
hdr_base = entry_point - imximage_init_loadsize +
flash_offset;
fhdr_v2->self = hdr_base;
-   fhdr_v2->dcd_ptr = hdr_base + offsetof(imx_header_v2_t, dcd_table);
+   if (dcd_len > 0)
+   fhdr_v2->dcd_ptr = hdr_base
+   + offsetof(imx_header_v2_t, dcd_table);
+   else
+   fhdr_v2->dcd_ptr = 0;
fhdr_v2->boot_data_ptr = hdr_base
+ offsetof(imx_header_v2_t, boot_data);
hdr_v2->boot_data.start = entry_point - imximage_init_loadsize;
-- 
2.1.4

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


[U-Boot] [u-boot][PATCH 2/2] ARM: beagle_x15: prevent DCAN1 _wait_target_disable failure in kernel

2015-06-25 Thread Roger Quadros
If board is booted with transitions happening on DCAN1 pins then
the following warning is seen in the kernel at boot when the
hwmod layer initializes.

"omap_hwmod: dcan1: _wait_target_disable failed"

This is because DCAN1 module's SWAKEUP mechanism is broken
and it fails to correctly turn OFF if it sees a transition on the
DCAN1 pins. Suggested workaround is to keep DCAN1 pins in safe mode
while enabling/disabling DCAN1 module.

The hwmod layer enables and disables all modules at boot
and we have no opportunity to put the DCAN1 pins in safe mode
at that point.

DCAN1 is not used by u-boot so it doesn't matter to it if these
pins are in safe mode. The kernel driver correctly configures
the right mode when DCAN1 is active.

Signed-off-by: Roger Quadros 
---
 board/ti/beagle_x15/mux_data.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/ti/beagle_x15/mux_data.h b/board/ti/beagle_x15/mux_data.h
index 09d3650..da2610c 100644
--- a/board/ti/beagle_x15/mux_data.h
+++ b/board/ti/beagle_x15/mux_data.h
@@ -244,8 +244,8 @@ const struct pad_conf_entry core_padconf_array_essential[] 
= {
{SPI2_D1, (M14 | PIN_INPUT_PULLDOWN)},  /* spi2_d1.gpio7_15 */
{SPI2_D0, (M14 | PIN_INPUT_PULLUP)},/* spi2_d0.gpio7_16 */
{SPI2_CS0, (M14 | PIN_INPUT_PULLUP | SLEWCONTROL)}, /* 
spi2_cs0.gpio7_17 */
-   {DCAN1_TX, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},  /* 
dcan1_tx.dcan1_tx */
-   {DCAN1_RX, (M0 | PIN_INPUT_PULLUP | SLEWCONTROL)},  /* 
dcan1_rx.dcan1_rx */
+   {DCAN1_TX, (M15 | PULLUP)}, /* dcan1_tx.safe for dcan1_tx */
+   {DCAN1_RX, (M15 | PULLUP)}, /* dcan1_rx.safe for dcan1_rx */
{UART1_RXD, (M0 | PIN_INPUT_SLEW)}, /* uart1_rxd.uart1_rxd */
{UART1_TXD, (M0 | PIN_INPUT_SLEW)}, /* uart1_txd.uart1_txd */
{UART1_CTSN, (M15 | PIN_INPUT_PULLDOWN)},   /* uart1_ctsn.Driveroff 
*/
-- 
2.1.4

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