Re: [U-Boot] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure

2013-05-12 Thread Albert ARIBAUD
Hi Marek,

On Fri, 10 May 2013 14:36:00 +0200, Marek Vasut  wrote:

> Hello Masahiro-san,

> > By the way, I also had this unalignment access problem for my board.
> > Before finding your patch, I was thinking another way to fix this problem.
> > 
> > My idea is to just use 'get_unaligned' and 'put_unaligned' functions
> > instead of introducing special macros.
> > With this way, we don't need to change the fields of struct cfi_qry.
> 
> I think we should make sure to use natural alignment as much as possible, 
> really. I'm keeping Albert in CC because this is his turf.

Marek, you invoked me; next time be careful what you wish for. :)

My rules (not 'of thumb', as they also apply to ARM) regarding
alignment are as follows (yes, it's a more general answer than your
question called for, but the last rules are more directly related):

0) Never assume that U-Boot can use native unaligned accesses. Yes,
ARMv7+ can do native unaligned accesses with almost no performance
cost, but U-Boot runs on all sorts of targets (not only ARM), some
allowing unaligned access but with a penalty, and some unable to
perform unaligned access at all. We always run the risk that some code
in U-Boot ends up running on target which will die horribly on some
unaligned access, so to avoid this we must assume and enforce strict
alignment, even for architectures which do not require it, such as
ARMv7+.

1) As per rule 0, always enable alignment check -- again, even on
targets which could do without it. This allows catching any unaligned
access, be they accidental (bad pointer arithmetic) or by design
(misaligned field in an otherwise aligned struct).

2) Despite rules 0 and 1, always enable native unaligned accesses (IOW,
always use option -munaligned-accesses). That is because without this
option (or more precisely, when -mno-unaligned-accesses is in effect),
the ARM compiler may silently detect misaligned accesses and fix them
using smaller aligned accesses, thus hiding a potential alignment
issue until it bites on some later and unrelated target run.

3) always size fields in a structure to their natural size, i.e., if a
field is 16-bits, make it u16 or s16.

4) always align fields in a structure to their natural boundaries,
i.e., if a field is 16-bits, align it to an even address.

5) if a field absolutely has to be unaligned because of hardware or
standard, then a) document that! and b) access it with explicit
unaligned access macros.

So in essence, I am opposed to changing fields from 16-bit to 2 x 8-bit
just 'because unaligned'. Either fix the fields' alignment, if at all
possible; and if not, then apply rule 5: document the issue and fix it
using explicit unaligned access macros.

> Best regards,
> Marek Vasut

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


Re: [U-Boot] [Patch v2 1/4] USB: ohci-at91: support sama5d3x devices

2013-05-12 Thread Bo Shen

Hi Andreas,

On 5/12/2013 19:28, Andreas Bießmann wrote:

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add OHCI support for sama5d3x devices


can you please rebase this patch and send again?


OK, I will do it at next version.



Signed-off-by: Bo Shen 
---
change in v2:
   - change #if defined to #ifdef for sama5d3
---
  drivers/usb/host/ohci-at91.c |   14 --
  1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index efd711d..086cd0f 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -42,7 +42,7 @@ int usb_cpu_init(void)
  while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
  ;
  #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45)
|| \
-defined(CONFIG_AT91SAM9X5)
+defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
  /* Enable UPLL */
  writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
  &pmc->uckr);
@@ -54,7 +54,12 @@ int usb_cpu_init(void)
  #endif

  /* Enable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);


Please reorder the patches so that pmc->pcer1 is declared before used.


Ok, thanks for figure out this. I will do it at next version.


Best regards

Andreas Bießmann


Best Regards,
Bo Shen

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


Re: [U-Boot] [Patch v2 4/4] ARM: atmel: add sama5d3xek support

2013-05-12 Thread Bo Shen

Hi Andreas,

On 5/12/2013 19:35, Andreas Bießmann wrote:

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add sama5d3xek support with following feature
   - boot from NAND flash, PMECC support, 4bit ECC @ 512 bytes sector
   - boot from SPI flash support
   - boot from SD card support
   - LCD support
   - EMAC support
   - USB support (OHCI)


no obvious objections here, please just change order order or split the
register definition changes out of this one.


OK, I will split the register definition changes out for this one.


Best regards

Andreas Bießmann


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


[U-Boot] [PATCH] mmc: fix env in mmc with redundant compile error

2013-05-12 Thread Bo Shen
The commit d196bd8 (env_mmc: add support for redundant environment)
introduce the following compile error when enable reduandant
environment support with MMC
---8<---
env_mmc.c:149: error: 'env_t' has no member named 'flags'
env_mmc.c:248: error: 'env_t' has no member named 'flags'
env_mmc.c:248: error: 'env_t' has no member named 'flags'
env_mmc.c:250: error: 'env_t' has no member named 'flags'
env_mmc.c:250: error: 'env_t' has no member named 'flags'
env_mmc.c:252: error: 'env_t' has no member named 'flags'
env_mmc.c:252: error: 'env_t' has no member named 'flags'
env_mmc.c:254: error: 'env_t' has no member named 'flags'
env_mmc.c:254: error: 'env_t' has no member named 'flags'
env_mmc.c:267: error: 'env_t' has no member named 'flags'
make[1]: *** [env_mmc.o] Error 1
--->8---

Add this patch to fix it

Signed-off-by: Bo Shen 
---
 include/environment.h |6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/environment.h b/include/environment.h
index 4c6a37b..460ccb4 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -75,6 +75,12 @@
 # endif
 #endif /* CONFIG_ENV_IS_IN_FLASH */
 
+#if defined(CONFIG_ENV_IS_IN_MMC)
+# ifdef CONFIG_ENV_OFFSET_REDUND
+#  define CONFIG_SYS_REDUNDAND_ENVIRONMENT
+# endif
+#endif
+
 #if defined(CONFIG_ENV_IS_IN_NAND)
 # if defined(CONFIG_ENV_OFFSET_OOB)
 #  ifdef CONFIG_ENV_OFFSET_REDUND
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v1 1/3] blackfin: Enable early print via the generic serial API.

2013-05-12 Thread Sonic Zhang
Hi Mike,

On Mon, May 13, 2013 at 12:42 PM, Mike Frysinger  wrote:
> On Monday 13 May 2013 00:20:15 Sonic Zhang wrote:
>> Remove blackfin specific implementation of the generic serial API when
>> early print macro is defined.
>>
>> In BFIN_BOOT_BYPASS mode, don't call generic serial_puts, because
>> early print in bypass mode is running before code binary is relocated
>> to the link address.
>
> the link address of the function doesn't matter.  all Blackfin func calls are
> pcrel based, not absolute address calls.  i specifically crafted all of this
> early serial code so that this does work regardless of the address where the
> code happens to be executing.
>

When you developed the bfin serial driver, the generic serial API
serial_puts() is implemented in bfin serial driver directly. No such
link address issue.

void serial_putc(const char c)
 {
   uart_putc(UART_BASE, c);
 }

void serial_puts(const char *s)
 {
   while (*s)
   serial_putc(*s++);
 }

While in latest generic serial.c, serial_puts() calls uart_puts()
function in bfin serial via a pointer to the default serial_device
structure, which contains the link address in DRAM, other than a
relative jump.

void serial_puts(const char *s)
{
get_current()->puts(s);
}

This has nothing to do with the patch " blackfin: Correct early serial
mess output in BYPASS boot mode.".

07f572c8 <_get_current>:
 7f572c8:   67 01   [--SP] = RETS;
 7f572ca:   58 a0   R0 = [P3 + 0x4];
 7f572cc:   a6 6f   SP += -0xc; /* (-12) */
 7f572ce:   00 48   CC = !BITTST (R0, 0x0); /* bit  0 */
 7f572d0:   08 18   IF CC JUMP 0x7f572e0 <_get_current+0x18>;
 7f572d2:   4a e1 f8 07 P2.H = 0x7f8;   /* (2040)
 P2=0x7f8e77c <_serial_devices> */
 7f572d6:   0a e1 80 e7 P2.L = 0xe780;  /* (-6272)
 P2=0x7f8e780 <_serial_current> */
 7f572da:   10 91   R0 = [P2];
 7f572dc:   00 0c   CC = R0 == 0x0;
 7f572de:   0b 14   IF !CC JUMP 0x7f572f4 <_get_current+0x2c> (BP);
> 7f572e0:   00 e3 02 02 CALL 0x7f576e4 <_default_serial_console>;
> 7f572e4:   00 0c   CC = R0 == 0x0;
 7f572e6:   07 14   IF !CC JUMP 0x7f572f4 <_get_current+0x2c> (BP);
 7f572e8:   40 e1 f7 07 R0.H = 0x7f7;   /* (2039)
 R0=0x7f7e764(133687140) */
 7f572ec:   00 e1 cc 03 R0.L = 0x3cc;   /* (972)
 R0=0x7f703cc(133628876) */
 7f572f0:   00 e3 8e 3e CALL 0x7f5f00c <_panic>;
 7f572f4:   66 6c   SP += 0xc;  /* ( 12) */
 7f572f6:   27 01   RETS = [SP++];
 7f572f8:   10 00   RTS;
...

07f572fc <_serial_puts>:
 7f572fc:   78 05   [--SP] = (R7:7);
 7f572fe:   67 01   [--SP] = RETS;
 7f57300:   38 30   R7 = R0;
 7f57302:   a6 6f   SP += -0xc; /* (-12) */
 7f57304:   ff e3 e2 ff CALL 0x7f572c8 <_get_current>;
> 7f57308:   10 32   P2 = R0;
 7f5730a:   66 6c   SP += 0xc;  /* ( 12) */
 7f5730c:   27 01   RETS = [SP++];
 7f5730e:   07 30   R0 = R7;
 7f57310:   38 05   (R7:7) = [SP++];
 7f57312:   92 ae   P2 = [P2 + 0x28];
> 7f57314:   52 00   JUMP (P2);



Regards,

Sonic

> what doesn't work is if you try to use the early serial console with
> CONFIG_SYS_BFIN_UART (which allows all the serial devices to be selected on
> the fly).  but the header file specifically handles that:
> #ifndef CONFIG_DEBUG_EARLY_SERIAL
> # define CONFIG_SYS_BFIN_UART
> #endif
>
> i guess the problem is that this commit is wrong:
>
> commit 820edc18b5aefa8c82d420f6cba3e13b5631f9b8
> Author: Sonic Zhang 
> Date:   Fri Nov 30 17:39:32 2012 +0800
>
> blackfin: Correct early serial mess output in BYPASS boot mode.
>
> it shouldn't be messing with the addresses there
> -mike
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support

2013-05-12 Thread Heiko Schocher
Hello Simon,

Am 11.05.2013 23:33, schrieb Simon Glass:
> Hi Heiko,
> 
> On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher  wrote:
>> Signed-off-by: Heiko Schocher 
>> Signed-off-by: Simon Glass 
>> Cc: Henrik Nordström 
>>
>> ---
>> - changes for v2:
>>   add comment from Henrik Nordström 
>>   remove wrong line in README
>>   - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1
>> - changes for v3:
>>   - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define
>>   - fix Codingstyle issues
>>   - adapt README
>> ---
>>  README  |  74 -
>>  arch/arm/lib/board.c|   7 ++-
>>  arch/blackfin/lib/board.c   |   7 +++
>>  arch/m68k/lib/board.c   |  17 +-
>>  arch/mips/lib/board.c   |   7 +++
>>  arch/nds32/lib/board.c  |  10 +++-
>>  arch/powerpc/cpu/mpc8xx/video.c |   4 ++
>>  arch/powerpc/lib/board.c|  12 +++-
>>  common/cmd_date.c   |   9 +++
>>  common/cmd_dtt.c|   9 +++
>>  common/cmd_i2c.c| 120 
>> ++--
>>  common/env_eeprom.c |  14 +
>>  common/stdio.c  |  13 -
>>  include/i2c.h   |   9 ---
>>  14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-)
>>
> 
> ...
>> diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
>> index 4380794..d59f10d 100644
> 
>> @@ -1508,16 +1543,21 @@ static int do_i2c_nm(cmd_tbl_t * cmdtp, int flag, 
>> int argc, char * const argv[])
>>   */
>>  static int do_i2c_reset(cmd_tbl_t * cmdtp, int flag, int argc, char * const 
>> argv[])
>>  {
>> +#if defined(CONFIG_SYS_I2C)
>> +   i2c_init(I2C_ADAP->speed, I2C_ADAP->slaveaddr);
>> +#else
>> i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
>> +#endif
>> return 0;
>>  }
>>
>>  static cmd_tbl_t cmd_i2c_sub[] = {
>> -#if defined(CONFIG_I2C_MUX)
>> -   U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_add_bus, "", ""),
>> +#if defined(CONFIG_SYS_I2C)
>> +   U_BOOT_CMD_MKENT(bus, 1, 1, do_i2c_show_bus, "", ""),
>>  #endif  /* CONFIG_I2C_MUX */
>> U_BOOT_CMD_MKENT(crc32, 3, 1, do_i2c_crc, "", ""),
>> -#if defined(CONFIG_I2C_MULTI_BUS)
>> +#if defined(CONFIG_SYS_I2C) || \
>> +   defined(CONFIG_I2C_MULTI_BUS)
>> U_BOOT_CMD_MKENT(dev, 1, 1, do_i2c_bus_num, "", ""),
> 
> If you are changing the condition here you should change the condition
> on the help also.

Fixed.

>>  #endif  /* CONFIG_I2C_MULTI_BUS */
>>  #if defined(CONFIG_I2C_EDID)
>> @@ -1576,11 +1616,11 @@ static int do_i2c(cmd_tbl_t * cmdtp, int flag, int 
>> argc, char * const argv[])
>>  /***/
>>  #ifdef CONFIG_SYS_LONGHELP
>>  static char i2c_help_text[] =
>> -#if defined(CONFIG_I2C_MUX)
>> -   "bus [muxtype:muxaddr:muxchannel] - add a new bus reached over 
>> muxes\ni2c "
>> +#if defined(CONFIG_SYS_I2C)
>> +   "bus [muxtype:muxaddr:muxchannel] - show I2C bus info\n"
>>  #endif  /* CONFIG_I2C_MUX */
>> "crc32 chip address[.0, .1, .2] count - compute CRC32 checksum\n"
>> -#if defined(CONFIG_I2C_MULTI_BUS)
>> +#if defined(CONFIG_SYS_I2C)
>> "i2c dev [dev] - show or set current I2C bus\n"
>>  #endif  /* CONFIG_I2C_MULTI_BUS */
>>  #if defined(CONFIG_I2C_EDID)
>> diff --git a/common/env_eeprom.c b/common/env_eeprom.c
>> index 45c935b..fbd459a 100644
> 
> I tested this on snow and it seems to disable every bus except bus 0.
> I will see if I can take a look.

Bad news ... did you tried it with debug traces enabled?

> Hopefully one of the Nvidia guys can test on seaboard as I don't have
> mind with me right now.
> 
> SMDK5250 # i2c dev 4
> Invalid bus 4

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] EXYNOS: Export timer_get_us() to get microsecond timer

2013-05-12 Thread Rajeshwari Birje
Hi Simon,

Thank you for review comments,

On Sat, May 11, 2013 at 8:38 PM, Simon Glass  wrote:
> On Fri, Mar 22, 2013 at 6:45 PM, Simon Glass  wrote:
>> Hi Rajeshwari,
>>
>> On Fri, Mar 22, 2013 at 5:28 AM, Rajeshwari Shinde
>>  wrote:
>>> This function, if implemented by the board, provides a microsecond
>>> timer. The granularity may be larger than 1us if hardware does not
>>> support this.
>>>
>>> Signed-off-by: Simon Glass 
>>> Signed-off-by: Rajeshwari Shinde 
>>> ---
>>>  include/common.h |8 
>>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/common.h b/include/common.h
>>> index 4ad17ea..0c21edc 100644
>>> --- a/include/common.h
>>> +++ b/include/common.h
>>> @@ -558,6 +558,14 @@ void ddr_enable_ecc(unsigned int dram_size);
>>>  #endif
>>>  #endif
>>>
>>> +#if defined CONFIG_EXYNOS5
>>
>> I don't think we need the #ifdef. If some boards don't have then that is OK.
>
> Further to this, I suppose we can always remove the #ifdef when other
> boards define the function. So:
Will remove the #ifdef and resend the patch soon.
>
> Acked-by: Simon Glass 
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] Exynos5: cpufreq: Implement frequency scaling for exynos5

2013-05-12 Thread Simon Glass
Hi Akshay,

On Sun, May 12, 2013 at 11:15 PM, Akshay Saraswat  wrote:
> Hi Simon,
>
>>Hi Akshay,
>>
>>On Wed, Apr 3, 2013 at 12:27 AM, Akshay Saraswat  wrote:
>>> Exynos5 currently runs at full speed i.e. 1.7 GHz everytime.
>>> Scaling down the clock speed in certain situations, may help in
>>> reducing the ARM temperature and power consumption.
>>>
>>> Signed-off-by: Akshay Saraswat 
>>> ---
>>>  arch/arm/include/asm/arch-exynos/cpufreq.h |  54 ++
>>>  drivers/power/Makefile |   1 +
>>>  drivers/power/exynos-cpufreq.c | 282 
>>> +
>>>  3 files changed, 337 insertions(+)
>>>  create mode 100644 arch/arm/include/asm/arch-exynos/cpufreq.h
>>>  create mode 100644 drivers/power/exynos-cpufreq.c
>>
>>There may be a couple of style nits here I think (do you use patman or
>>checkpatch?) but otherwise:
>>
>>Acked-by: Simon Glass 
>>
>
> Yes, I did use tools/checkpach from u-boot-samsung to verify style errors
> in these patches, I didn't get any. It shows 0 errors and 0 warnings for
> all 4 patches. No wonder, there could be few things which checkpatch might
> not have caught. Please let me know the errors, I'll rectify them.

Sorry I can't see what I noticed last time, it looks good!

> And also, I am pushing one more revision for PMIC set-voltage patch
> with function comment. Please review it.

OK, will do.

I am hoping to collect up all the outstanding patches and put them
somewhere for testing.

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


[U-Boot] [PATCH 4/4 v2] Exynos5: config: enable cpu freq

2013-05-12 Thread Akshay Saraswat
This patch enables cpu freq support for exynos5 by adding
config for it.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 
---
Changes since v1:
- Added "Acked-by: Simon Glass".

 include/configs/exynos5250-dt.h |3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/configs/exynos5250-dt.h b/include/configs/exynos5250-dt.h
index 4514e7a..2321614 100644
--- a/include/configs/exynos5250-dt.h
+++ b/include/configs/exynos5250-dt.h
@@ -128,6 +128,9 @@
 #define CONFIG_CMD_DTT
 #define CONFIG_TMU_CMD_DTT
 
+/* CPU Frequency Scaling */
+#define CONFIG_EXYNOS_CPUFREQ
+
 /* USB */
 #define CONFIG_CMD_USB
 #define CONFIG_USB_EHCI
-- 
1.7.10.4

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


[U-Boot] [PATCH 3/4 v2] smdk5250: enable support for tmu throttling

2013-05-12 Thread Akshay Saraswat
Adding tmu throttling support to smdk5250.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 
---
Changes since v1:
- Added "Acked-by: Simon Glass".

 board/samsung/smdk5250/smdk5250.c |   19 +++
 1 file changed, 19 insertions(+)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 8b09e1d..301dcf8 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -38,6 +38,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -58,6 +60,15 @@ static void boot_temp_check(void)
break;
case TMU_STATUS_WARNING:
puts("EXYNOS_TMU: WARNING! Temperature very high\n");
+#ifdef CONFIG_EXYNOS_CPUFREQ
+   exynos_set_frequency(CPU_FREQ_L400);
+#endif
+   break;
+   case TMU_STATUS_NORMAL:
+#ifdef CONFIG_EXYNOS_CPUFREQ
+   if (get_pll_clk(APLL) != 17)
+   exynos_set_frequency(CPU_FREQ_L1700);
+#endif
break;
/*
 * TMU_STATUS_INIT means something is wrong with temperature sensing
@@ -110,6 +121,13 @@ int board_init(void)
boot_temp_check();
 #endif
 
+#if defined CONFIG_EXYNOS_CPUFREQ
+   if (exynos_cpufreq_init()) {
+   debug("%s: Failed to init CPU frequency scaling\n", __func__);
+   return -1;
+   }
+#endif
+
 #ifdef CONFIG_EXYNOS_SPI
spi_init();
 #endif
@@ -119,6 +137,7 @@ int board_init(void)
 #ifdef CONFIG_SOUND_MAX98095
board_enable_audio_codec();
 #endif
+
return 0;
 }
 
-- 
1.7.10.4

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


[U-Boot] [PATCH 2/4 v2] Exynos5: cpufreq: Implement frequency scaling for exynos5

2013-05-12 Thread Akshay Saraswat
Exynos5 currently runs at full speed i.e. 1.7 GHz everytime.
Scaling down the clock speed in certain situations, may help in
reducing the ARM temperature and power consumption.

Signed-off-by: Akshay Saraswat 
Acked-by: Simon Glass 
---
Changes since v1:
- Added "Acked-by: Simon Glass".

 arch/arm/include/asm/arch-exynos/cpufreq.h |   54 ++
 drivers/power/Makefile |1 +
 drivers/power/exynos-cpufreq.c |  282 
 3 files changed, 337 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-exynos/cpufreq.h
 create mode 100644 drivers/power/exynos-cpufreq.c

diff --git a/arch/arm/include/asm/arch-exynos/cpufreq.h 
b/arch/arm/include/asm/arch-exynos/cpufreq.h
new file mode 100644
index 000..173e804
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/cpufreq.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * EXYNOS - CPU frequency scaling support
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+/* Define various levels of ARM frequency */
+enum cpufreq_level {
+   CPU_FREQ_L200,  /* 200 MHz */
+   CPU_FREQ_L300,  /* 300 MHz */
+   CPU_FREQ_L400,  /* 400 MHz */
+   CPU_FREQ_L500,  /* 500 MHz */
+   CPU_FREQ_L600,  /* 600 MHz */
+   CPU_FREQ_L700,  /* 700 MHz */
+   CPU_FREQ_L800,  /* 800 MHz */
+   CPU_FREQ_L900,  /* 900 MHz */
+   CPU_FREQ_L1000, /* 1000 MHz */
+   CPU_FREQ_L1100, /* 1100 MHz */
+   CPU_FREQ_L1200, /* 1200 MHz */
+   CPU_FREQ_L1300, /* 1300 MHz */
+   CPU_FREQ_L1400, /* 1400 MHz */
+   CPU_FREQ_L1500, /* 1500 MHz */
+   CPU_FREQ_L1600, /* 1600 MHz */
+   CPU_FREQ_L1700, /* 1700 MHz */
+   CPU_FREQ_LCOUNT,
+};
+
+/*
+ * Initialize ARM frequency scaling
+ *
+ * @param blob  FDT blob
+ * @return int value, 0 for success
+ */
+int exynos_cpufreq_init(void);
+
+/*
+ * Switch ARM frequency to new level
+ *
+ * @param new_freq_level   enum cpufreq_level, states new frequency
+ * @return int value, 0 for success
+ */
+int exynos_set_frequency(enum cpufreq_level new_freq_level);
diff --git a/drivers/power/Makefile b/drivers/power/Makefile
index 1dac16a..4589d9b 100644
--- a/drivers/power/Makefile
+++ b/drivers/power/Makefile
@@ -31,6 +31,7 @@ COBJS-$(CONFIG_TPS6586X_POWER)+= tps6586x.o
 COBJS-$(CONFIG_TWL4030_POWER)  += twl4030.o
 COBJS-$(CONFIG_TWL6030_POWER)  += twl6030.o
 COBJS-$(CONFIG_TWL6035_POWER)  += twl6035.o
+COBJS-$(CONFIG_EXYNOS_CPUFREQ) += exynos-cpufreq.o
 
 COBJS-$(CONFIG_POWER) += power_core.o
 COBJS-$(CONFIG_DIALOG_POWER) += power_dialog.o
diff --git a/drivers/power/exynos-cpufreq.c b/drivers/power/exynos-cpufreq.c
new file mode 100644
index 000..f473167
--- /dev/null
+++ b/drivers/power/exynos-cpufreq.c
@@ -0,0 +1,282 @@
+/*
+ * Copyright (c) 2012 Samsung Electronics Co., Ltd.
+ *  http://www.samsung.com
+ *
+ * EXYNOS - CPU frequency scaling support
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/* APLL CON0 */
+#define CON0_LOCK_BIT_MASK (0x1 << 29)
+#define MDIV_MASK(x)   (x << 16)
+#define PDIV_MASK(x)   (x << 8)
+#define SDIV_MASK(x)   (x << 0)
+#define APLL_PMS_MASK   ~(MDIV_MASK(0x3ff) \
+   | PDIV_MASK(0x3f) | SDIV_MASK(0x7))
+
+/* MUX_STAT CPU select */
+#define MUX_CPU_NONE   (0x7 << 16)
+#define MUX_CPU_MOUT_APLL  (0x1 << 16)
+
+/* CLK_DIV_CPU0_VAL */
+#define DIV_CPU0_RSVD  ~((0x7 << 28)   \
+   | (0x7 << 24)   \
+   | (0x7 << 20)   \
+   | (0x7 << 16)   \
+   | (0x7 << 12)   \
+   | (0x7 << 8)\
+   | (0x7 << 4)\
+   | (0x7))
+
+/* CLK_DIV_CPU1 */
+#define DIV_CPU1_RSVD  

[U-Boot] [PATCH 1/4 v2] PMIC: max77686: add pmic_set_voltage api for max77686

2013-05-12 Thread Akshay Saraswat
This patch adds pmic_set_voltage api in max77686.
As the name suggests, this api is required for switching
voltage from one level to another. Unit for the new
voltage value should be microvolts.

Signed-off-by: Akshay Saraswat 
---
Changes since v1:
- Added comment for the set voltage API.

 drivers/power/pmic/pmic_max77686.c |   66 
 include/power/max77686_pmic.h  |   12 +++
 include/power/pmic.h   |1 +
 3 files changed, 79 insertions(+)

diff --git a/drivers/power/pmic/pmic_max77686.c 
b/drivers/power/pmic/pmic_max77686.c
index 7fcb4c0..9e1bfdb 100644
--- a/drivers/power/pmic/pmic_max77686.c
+++ b/drivers/power/pmic/pmic_max77686.c
@@ -77,3 +77,69 @@ int pmic_init(unsigned char bus)
 
return 0;
 }
+/*
+ * Change voltage in BUCK2 to the new value given.
+ *
+ * @param new_voltage  new volatge value (unit - microvolts)
+ * @return int value, 0 for success
+ */
+int pmic_set_voltage(u32 new_voltage)
+{
+   struct pmic *p;
+   u32 read_data, volt_level, ret;
+
+   p = pmic_get("MAX77686_PMIC");
+   if (!p)
+   return -ENODEV;
+
+   /* Read BUCK2 DVS1 value */
+   ret = pmic_reg_read(p, MAX77686_REG_PMIC_BUCK2DVS1, &read_data);
+   if (ret != 0) {
+   debug("CPUFREQ: max77686 BUCK2 DVS1 register read failed.\n");
+   return -1;
+   }
+
+   /* Calculate voltage level */
+   volt_level = new_voltage - MAX77686_BUCK2_VOL_MIN * 1000;
+
+   if (volt_level < 0) {
+   debug("CPUFREQ: Not a valid voltage level to set\n");
+   return -1;
+   }
+
+   volt_level /= MAX77686_BUCK2_VOL_DIV;
+
+   /* Update voltage level in BUCK2 DVS1 register value */
+   clrsetbits_8(&read_data,
+MAX77686_BUCK2_VOL_BITMASK << MAX77686_BUCK2_VOL_BITPOS,
+volt_level << MAX77686_BUCK2_VOL_BITPOS);
+
+   /* Write new value in BUCK2 DVS1 */
+   ret = pmic_reg_write(p, MAX77686_REG_PMIC_BUCK2DVS1, read_data);
+   if (ret != 0) {
+   debug("CPUFREQ: max77686 BUCK2 DVS1 register write failed.\n");
+   return -1;
+   }
+
+   /* Set ENABLE BUCK2 register bits */
+   read_data = 0;
+   ret = pmic_reg_read(p, MAX77686_BUCK2_VOL_ENADDR, &read_data);
+   if (ret != 0) {
+   debug("CPUFREQ: max77686 BUCK2 enable address read failed.\n");
+   return -1;
+   }
+
+   clrsetbits_8(&read_data,
+(MAX77686_BUCK2_VOL_ENBITMASK
+<< MAX77686_BUCK2_VOL_ENBITPOS),
+(MAX77686_BUCK2_VOL_ENBITON
+<< MAX77686_BUCK2_VOL_ENBITPOS));
+
+   ret = pmic_reg_write(p, MAX77686_BUCK2_VOL_ENADDR, read_data);
+   if (ret != 0) {
+   debug("CPUFREQ: max77686 BUCK2 enable address write failed.\n");
+   return -1;
+   }
+
+   return 0;
+}
diff --git a/include/power/max77686_pmic.h b/include/power/max77686_pmic.h
index fdc7ca9..2780f17 100644
--- a/include/power/max77686_pmic.h
+++ b/include/power/max77686_pmic.h
@@ -175,6 +175,18 @@ enum {
 #define MAX77686_LD05CTRL1_1_8V0x14
 /* LDO10 1.8 volt value */
 #define MAX77686_LD10CTRL1_1_8V0x14
+
+/* BUCK2 voltage parameter values */
+#define MAX77686_BUCK2_VOL_BITPOS  0x0
+#define MAX77686_BUCK2_VOL_BITMASK 0xff
+#define MAX77686_BUCK2_VOL_ENBITPOS0x4
+#define MAX77686_BUCK2_VOL_ENBITMASK   0x3
+#define MAX77686_BUCK2_VOL_ENADDR  0x12
+#define MAX77686_BUCK2_VOL_ENBITON 0x1
+#define MAX77686_BUCK2_VOL_ENBITOFF0x0
+#define MAX77686_BUCK2_VOL_MIN 925
+#define MAX77686_BUCK2_VOL_DIV 12500
+
 /*
  * MAX77686_REG_PMIC_32KHZ set to 32KH CP
  * output is activated
diff --git a/include/power/pmic.h b/include/power/pmic.h
index 1ecfc05..02f6f11 100644
--- a/include/power/pmic.h
+++ b/include/power/pmic.h
@@ -99,6 +99,7 @@ int pmic_probe(struct pmic *p);
 int pmic_reg_read(struct pmic *p, u32 reg, u32 *val);
 int pmic_reg_write(struct pmic *p, u32 reg, u32 val);
 int pmic_set_output(struct pmic *p, u32 reg, int ldo, int on);
+int pmic_set_voltage(u32 new_voltage);
 
 #define pmic_i2c_addr (p->hw.i2c.addr)
 #define pmic_i2c_tx_num (p->hw.i2c.tx_num)
-- 
1.7.10.4

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


[U-Boot] [PATCH 0/4 v2] Exynos5: Add cpu freq and tmu throttling

2013-05-12 Thread Akshay Saraswat
This patch set adds cpu frequency scaling and tmu throttling
for exynos5.

Changes since v1:
- Patch-1: Added comment for the set voltage API.
- Patch-2: Added "Acked-by: Simon Glass".
- Patch-3: Added "Acked-by: Simon Glass".
- Patch-4: Added "Acked-by: Simon Glass".

Akshay Saraswat (4):
  PMIC: max77686: add pmic_set_voltage api for max77686
  Exynos5: cpufreq: Implement frequency scaling for exynos5
  smdk5250: enable support for tmu throttling
  Exynos5: config: enable cpu freq

 arch/arm/include/asm/arch-exynos/cpufreq.h |   54 ++
 board/samsung/smdk5250/smdk5250.c  |   19 ++
 drivers/power/Makefile |1 +
 drivers/power/exynos-cpufreq.c |  282 
 drivers/power/pmic/pmic_max77686.c |   66 +++
 include/configs/exynos5250-dt.h|3 +
 include/power/max77686_pmic.h  |   12 ++
 include/power/pmic.h   |1 +
 8 files changed, 438 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-exynos/cpufreq.h
 create mode 100644 drivers/power/exynos-cpufreq.c

-- 
1.7.10.4

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


[U-Boot] Exynos5: cpufreq: Implement frequency scaling for exynos5

2013-05-12 Thread Akshay Saraswat
Hi Simon,

>Hi Akshay,
>
>On Wed, Apr 3, 2013 at 12:27 AM, Akshay Saraswat  wrote:
>> Exynos5 currently runs at full speed i.e. 1.7 GHz everytime.
>> Scaling down the clock speed in certain situations, may help in
>> reducing the ARM temperature and power consumption.
>>
>> Signed-off-by: Akshay Saraswat 
>> ---
>>  arch/arm/include/asm/arch-exynos/cpufreq.h |  54 ++
>>  drivers/power/Makefile |   1 +
>>  drivers/power/exynos-cpufreq.c | 282 
>> +
>>  3 files changed, 337 insertions(+)
>>  create mode 100644 arch/arm/include/asm/arch-exynos/cpufreq.h
>>  create mode 100644 drivers/power/exynos-cpufreq.c
>
>There may be a couple of style nits here I think (do you use patman or
>checkpatch?) but otherwise:
>
>Acked-by: Simon Glass 
>

Yes, I did use tools/checkpach from u-boot-samsung to verify style errors
in these patches, I didn't get any. It shows 0 errors and 0 warnings for
all 4 patches. No wonder, there could be few things which checkpatch might
not have caught. Please let me know the errors, I'll rectify them.
And also, I am pushing one more revision for PMIC set-voltage patch
with function comment. Please review it.

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


Re: [U-Boot] [PATCH v3 2/9] i2c: common changes for multibus/multiadapter support

2013-05-12 Thread Heiko Schocher
Hello Simon,

Am 11.05.2013 23:17, schrieb Simon Glass:
> Hi Heiko,
> 
> On Sat, May 4, 2013 at 6:01 AM, Heiko Schocher  wrote:
>> Signed-off-by: Heiko Schocher 
>> Signed-off-by: Simon Glass 
>> Cc: Henrik Nordström 
>>
>> ---
>> - changes for v2:
>>   add comment from Henrik Nordström 
>>   remove wrong line in README
>>   - rebase against current mainline 178d0cc1a4c73c3341afbeb2a93b172de8c96bd1
>> - changes for v3:
>>   - adapt to the new introduced U_BOOT_I2C_ADAP_COMPLETE define
>>   - fix Codingstyle issues
>>   - adapt README
>> ---
>>  README  |  74 -
>>  arch/arm/lib/board.c|   7 ++-
>>  arch/blackfin/lib/board.c   |   7 +++
>>  arch/m68k/lib/board.c   |  17 +-
>>  arch/mips/lib/board.c   |   7 +++
>>  arch/nds32/lib/board.c  |  10 +++-
>>  arch/powerpc/cpu/mpc8xx/video.c |   4 ++
>>  arch/powerpc/lib/board.c|  12 +++-
>>  common/cmd_date.c   |   9 +++
>>  common/cmd_dtt.c|   9 +++
>>  common/cmd_i2c.c| 120 
>> ++--
>>  common/env_eeprom.c |  14 +
>>  common/stdio.c  |  13 -
>>  include/i2c.h   |   9 ---
>>  14 Dateien geändert, 251 Zeilen hinzugefügt(+), 61 Zeilen entfernt(-)
> 
> Very happy to see this again.
> 
> Do you also need to change common/board_f.c or common/board_r.c?

Uh.. yes, you are right, fix this!

Thanks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v1 1/3] blackfin: Enable early print via the generic serial API.

2013-05-12 Thread Mike Frysinger
On Monday 13 May 2013 00:20:15 Sonic Zhang wrote:
> Remove blackfin specific implementation of the generic serial API when
> early print macro is defined.
> 
> In BFIN_BOOT_BYPASS mode, don't call generic serial_puts, because
> early print in bypass mode is running before code binary is relocated
> to the link address.

the link address of the function doesn't matter.  all Blackfin func calls are 
pcrel based, not absolute address calls.  i specifically crafted all of this 
early serial code so that this does work regardless of the address where the 
code happens to be executing.

what doesn't work is if you try to use the early serial console with 
CONFIG_SYS_BFIN_UART (which allows all the serial devices to be selected on 
the fly).  but the header file specifically handles that:
#ifndef CONFIG_DEBUG_EARLY_SERIAL
# define CONFIG_SYS_BFIN_UART
#endif

i guess the problem is that this commit is wrong:

commit 820edc18b5aefa8c82d420f6cba3e13b5631f9b8
Author: Sonic Zhang 
Date:   Fri Nov 30 17:39:32 2012 +0800

blackfin: Correct early serial mess output in BYPASS boot mode.

it shouldn't be messing with the addresses there
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v1 1/3] blackfin: Enable early print via the generic serial API.

2013-05-12 Thread Sonic Zhang
From: Sonic Zhang 

Remove blackfin specific implementation of the generic serial API when
early print macro is defined.

In BFIN_BOOT_BYPASS mode, don't call generic serial_puts, because
early print in bypass mode is running before code binary is relocated
to the link address.

Signed-off-by: Sonic Zhang 
---
 arch/blackfin/cpu/serial.c|   71 
 arch/blackfin/cpu/serial.h|   10 +++---
 include/configs/bfin_adi_common.h |3 --
 3 files changed, 29 insertions(+), 55 deletions(-)

diff --git a/arch/blackfin/cpu/serial.c b/arch/blackfin/cpu/serial.c
index 36d2a5c..89290d6 100644
--- a/arch/blackfin/cpu/serial.c
+++ b/arch/blackfin/cpu/serial.c
@@ -197,13 +197,16 @@ static void uart_loop(uint32_t uart_base, int state)
 
 static inline void __serial_set_baud(uint32_t uart_base, uint32_t baud)
 {
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+   serial_early_set_baud(uart_base, baud);
+#else
uint16_t divisor = (get_uart_clk() + (baud * 8)) / (baud * 16)
- ANOMALY_05000230;
 
/* Program the divisor to get the baud rate we want */
serial_set_divisor(uart_base, divisor);
+#endif
 }
-#ifdef CONFIG_SYS_BFIN_UART
 
 static void uart_puts(uint32_t uart_base, const char *s)
 {
@@ -313,65 +316,39 @@ void bfin_serial_initialize(void)
 #endif
 }
 
-#else
-
-/* Symbol for our assembly to call. */
-void serial_set_baud(uint32_t baud)
-{
-   serial_early_set_baud(UART_BASE, baud);
-}
-
-/* Symbol for common u-boot code to call.
- * Setup the baudrate (brg: baudrate generator).
- */
-void serial_setbrg(void)
+#ifdef CONFIG_DEBUG_EARLY_SERIAL
+inline void uart_early_putc(uint32_t uart_base, const char c)
 {
-   serial_set_baud(gd->baudrate);
-}
-
-/* Symbol for our assembly to call. */
-void serial_initialize(void)
-{
-   serial_early_init(UART_BASE);
-}
-
-/* Symbol for common u-boot code to call. */
-int serial_init(void)
-{
-   serial_initialize();
-   serial_setbrg();
-   uart_lsr_clear(UART_BASE);
-   return 0;
-}
+   /* send a \r for compatibility */
+   if (c == '\n')
+   uart_early_putc(uart_base, '\r');
 
-int serial_tstc(void)
-{
-   return uart_tstc(UART_BASE);
-}
+   /* wait for the hardware fifo to clear up */
+   while (!(_lsr_read(pUART) & THRE))
+   continue;
 
-int serial_getc(void)
-{
-   return uart_getc(UART_BASE);
+   /* queue the character for transmission */
+   bfin_write(&pUART->thr, c);
+   SSYNC();
 }
 
-void serial_putc(const char c)
+void uart_early_puts(const char *s)
 {
-   uart_putc(UART_BASE, c);
+   while (*s)
+   uart_early_putc(UART_BASE, *s++);
 }
 
-void serial_puts(const char *s)
+/* Symbol for our assembly to call. */
+void _serial_early_set_baud(uint32_t baud)
 {
-   while (*s)
-   serial_putc(*s++);
+   serial_early_set_baud(UART_BASE, baud);
 }
 
-LOOP(
-void serial_loop(int state)
+/* Symbol for our assembly to call. */
+void _serial_early_init(void)
 {
-   uart_loop(UART_BASE, state);
+   serial_early_init(UART_BASE);
 }
-)
-
 #endif
 
 #endif
diff --git a/arch/blackfin/cpu/serial.h b/arch/blackfin/cpu/serial.h
index d67fd81..87a337d 100644
--- a/arch/blackfin/cpu/serial.h
+++ b/arch/blackfin/cpu/serial.h
@@ -78,16 +78,16 @@ static inline void serial_early_puts(const char *s)
 #else
 
 .macro serial_early_init
-#if defined(CONFIG_DEBUG_EARLY_SERIAL) && defined(BFIN_BOOT_BYPASS)
-   call _serial_initialize;
+#if defined(CONFIG_DEBUG_EARLY_SERIAL) && !defined(CONFIG_UART_MEM)
+   call __serial_early_init;
 #endif
 .endm
 
 .macro serial_early_set_baud
-#if defined(CONFIG_DEBUG_EARLY_SERIAL) && defined(BFIN_BOOT_BYPASS)
+#if defined(CONFIG_DEBUG_EARLY_SERIAL) && !defined(CONFIG_UART_MEM)
R0.L = LO(CONFIG_BAUDRATE);
R0.H = HI(CONFIG_BAUDRATE);
-   call _serial_set_baud;
+   call __serial_early_set_baud;
 #endif
 .endm
 
@@ -121,7 +121,7 @@ static inline void serial_early_puts(const char *s)
R0.L = 7b; \
R0.H = 7b; \
update_serial_early_string_addr \
-   call _serial_puts;
+   call _uart_early_puts;
 #else
 # define serial_early_puts(str)
 #endif
diff --git a/include/configs/bfin_adi_common.h 
b/include/configs/bfin_adi_common.h
index d3ae3a7..c986ba3 100644
--- a/include/configs/bfin_adi_common.h
+++ b/include/configs/bfin_adi_common.h
@@ -111,9 +111,6 @@
 #ifndef CONFIG_BAUDRATE
 # define CONFIG_BAUDRATE   57600
 #endif
-#ifndef CONFIG_DEBUG_EARLY_SERIAL
-# define CONFIG_SYS_BFIN_UART
-#endif
 
 /*
  * Debug Settings
-- 
1.7.0.4


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


[U-Boot] [PATCH v1 2/3] blackfin: Add memory virtual console to blackfin serial driver.

2013-05-12 Thread Sonic Zhang
From: Sonic Zhang 

Signed-off-by: Sonic Zhang 
---
 arch/blackfin/cpu/serial.c |   60 +++-
 1 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/arch/blackfin/cpu/serial.c b/arch/blackfin/cpu/serial.c
index 89290d6..c453a03 100644
--- a/arch/blackfin/cpu/serial.c
+++ b/arch/blackfin/cpu/serial.c
@@ -351,4 +351,62 @@ void _serial_early_init(void)
 }
 #endif
 
-#endif
+#elif defined(CONFIG_UART_MEM)
+
+char serial_logbuf[CONFIG_UART_MEM];
+char *serial_logbuf_head = serial_logbuf;
+
+int serial_mem_init(void)
+{
+   serial_logbuf_head = serial_logbuf;
+   return 0;
+}
+
+void serial_mem_setbrg(void)
+{
+}
+
+int serial_mem_tstc(void)
+{
+   return 0;
+}
+
+int serial_mem_getc(void)
+{
+   return 0;
+}
+
+void serial_mem_putc(const char c)
+{
+   *serial_logbuf_head = c;
+   if (++serial_logbuf_head == serial_logbuf + CONFIG_UART_MEM)
+   serial_logbuf_head = serial_logbuf;
+}
+
+void serial_mem_puts(const char *s)
+{
+   while (*s)
+   serial_putc(*s++);
+}
+
+struct serial_device bfin_serial_mem_device = {
+   .name   = "bfin_uart_mem",
+   .start  = serial_mem_init,
+   .setbrg = serial_mem_setbrg,
+   .getc   = serial_mem_getc,
+   .tstc   = serial_mem_tstc,
+   .putc   = serial_mem_putc,
+   .puts   = serial_mem_puts,
+};
+
+
+__weak struct serial_device *default_serial_console(void)
+{
+   return &bfin_serial_mem_device;
+}
+
+void bfin_serial_initialize(void)
+{
+   serial_register(&bfin_serial_mem_device);
+}
+#endif /* CONFIG_UART_MEM */
-- 
1.7.0.4


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


[U-Boot] [PATCH v1 3/3] blackfin: Uart divisor should be set after their values are generated.

2013-05-12 Thread Sonic Zhang
From: Sonic Zhang 

Signed-off-by: Sonic Zhang 
---
 arch/blackfin/cpu/initcode.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/cpu/initcode.c b/arch/blackfin/cpu/initcode.c
index 4b10b6c..8ef0b92 100644
--- a/arch/blackfin/cpu/initcode.c
+++ b/arch/blackfin/cpu/initcode.c
@@ -715,8 +715,8 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint 
divB, uint vcoB)
 * for dividing which means we'd generate a libgcc reference.
 */
unsigned int sdivR, vcoR;
-   unsigned int dividend = sdivB * divB * vcoR;
-   unsigned int divisor = vcoB * sdivR;
+   unsigned int dividend;
+   unsigned int divisor;
unsigned int quotient;
 
serial_putc('a');
@@ -729,6 +729,9 @@ update_serial_clocks(ADI_BOOT_DATA *bs, uint sdivB, uint 
divB, uint vcoB)
sdivR = bfin_read_PLL_DIV() & 0xf;
vcoR = (bfin_read_PLL_CTL() >> 9) & 0x3f;
 #endif
+
+   dividend = sdivB * divB * vcoR;
+   divisor = vcoB * sdivR;
quotient = early_division(dividend, divisor);
serial_early_put_div(quotient - ANOMALY_05000230);
serial_putc('c');
-- 
1.7.0.4


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


[U-Boot] Unable to receive DHCP packets (qemu-system-arm)

2013-05-12 Thread pietrushnic

Hi all,
I'm unable to receive DHCP packets using qemu-system-arm 1.4.91 with 
u-boot (commit: 2988eac). Problem occurs on Ubuntu 12.04 (I tried also 
Debian wheezy and there was no issue). I accidentally discover that 
adding '-net dump,file=/tmp/dump.pcap' cause that problem disapear, but 
want to dig it and find out what the root cause is.


I tried to debug issue from u-boot source code perspective and added 
verbose logging, but can't see anything strange enough:
- log with fail - qemu w/o additional dump command - 
https://gist.github.com/pietrushnic/5561859
- log with pass - qemu w/ addional dump param - 
https://gist.github.com/pietrushnic/5561866

Difference:
- smc_rcv status is always 0 , NetLoop timeouts for failed case
- on failed case u-boot receive some packets but not DHCP offer (I 
positively verified w/ tcpdump that server sent this packet)


I'm trying to narrow down this problem from both (qemu and u-boot) side. 
Is there anything else what I can do to confirm that this is not u-boot 
issue ?

Maybe someone heard about this kind of problem ?

My network configuration based on: http://toast.djw.org.uk/qemu.html
I'm using versatilepb_config compiled with arm-unknown-linux-gnueabi 
(created using crosstool-NG).


If provided information are insufficient, just let me know.

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


Re: [U-Boot] [PATCH 4/4 V4] CONFIG: EXYNOS5: Enable silent console

2013-05-12 Thread Rajeshwari Birje
Hi Simon,

Thank you for reviewing the patches.
Will soon send a patch to add the serial FDT nodes to snow as well.

Regards,
Rajeshwari Shinde.
On Sat, May 11, 2013 at 11:41 PM, Simon Glass  wrote:
> On Tue, Apr 2, 2013 at 12:46 AM, Rajeshwari Shinde
>  wrote:
>> This patch enables CONFIG_SILENT_CONSOLE for EXYNOS5.
>>
>> Signed-off-by: Rajeshwari Shinde 
>> Acked-by: Simon Glass 
>> ---
>> Changes in V2:
>> - None
>> Changes in V3:
>> - None
>> Changes in V4:
>> - None
>>  include/configs/exynos5250-dt.h |2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> Tested on snow, with a change to add the serial console info to the
> device tree. Console works correctly and silent mode can be selected
> from FDT as expected.
>
> Tested-by: Simon Glass 
>
> Rajeshwari, please could you send a patch to add the serial FDT nodes
> to snow also?
>
> Regards,
> Simon
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



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


[U-Boot] [PATCH] .gitignore: add GNU GLOBAL files

2013-05-12 Thread Masahiro Yamada
Signed-off-by: Masahiro Yamada 
---
 .gitignore |6 ++
 1 file changed, 6 insertions(+)

diff --git a/.gitignore b/.gitignore
index ed21203..4116448 100644
--- a/.gitignore
+++ b/.gitignore
@@ -79,5 +79,11 @@ cscope.*
 /ctags
 /etags
 
+# gnu global files
+GPATH
+GRTAGS
+GSYMS
+GTAGS
+
 # spl ais files
 /spl/*.ais
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH 1/3 V5] EXYNOS5: Add gpio pin numbering feature

2013-05-12 Thread Rajeshwari Birje
Hi Simon,

I applied the V5 patches on the latest u-boot-samsung tree and need
seem to compile fine.
Yes I will need to rebase them once the MMC patches get in, but will
wait for comments from Minkyu Kang as well
so that I can incorporate them and rebase the patch set once the MMC
patches get in.

Regards,
Rajeshwari Shinde.

On Sat, May 11, 2013 at 11:48 PM, Simon Glass  wrote:
> HI Rajeshwari,
>
> On Wed, Apr 3, 2013 at 5:54 AM, Rajeshwari Shinde
>  wrote:
>> This patch adds support for gpio pin numbering support on
>> EXYNOS5250
>> To have consistent 0..n-1 GPIO numbering the banks are divided
>> into different parts where ever they have holes in them.
>>
>> Signed-off-by: Leela Krishna Amudala 
>> Signed-off-by: Rajeshwari Shinde 
>> ---
>> Changes in V2:
>> - none.
>> Changes in V3:
>> - none.
>> Changes in V4:
>> - To have consistent 0..n-1 GPIO numbering the banks are divided
>> into different parts where ever they have holes in them.
>> - Combined previous patch 1 and 2 into single patch.
>> Changes in V5:
>> - Removed Exynos5 specific code in gpio driver api to
>> get bank.
>> - Added #define HAVE_GENERIC_GPIO in config file
>> to remove conditinal CPU check in gpio driver.
>
> With this series I am getting errors in exynos5-dt.c:
>
> 25: EXYNOS5: Add gpio pin numbering feature
>arm: +   snow
> +exynos5-dt.c: In function 'board_usb_vbus_init':
> +exynos5-dt.c:79: error: 'struct exynos5_gpio_part1' has no member named 'x2'
> +exynos5-dt.c: In function 'board_enable_audio_codec':
> +exynos5-dt.c:95: error: 'struct exynos5_gpio_part1' has no member named 'x1'
> +exynos5-dt.c:96: error: 'struct exynos5_gpio_part1' has no member named 'x1'
> +exynos5-dt.c: In function 'exynos_cfg_lcd_gpio':
> +exynos5-dt.c:412: error: 'struct exynos5_gpio_part1' has no member named 'x1'
> +exynos5-dt.c:413: error: 'struct exynos5_gpio_part1' has no member named 'x1'
> +exynos5-dt.c:416: error: 'struct exynos5_gpio_part1' has no member named 'x0'
>
>
> This is probably due to new support added, so I think you need to
> adjust your patch.
>
> Here is the sequence I am testing with (reverse order of application):
>
> 9529fd4 (HEAD, ws/snow, snow) EXYNOS5: GPIO: Enable GPIO Command for EXYNOS5
> 0f81b33 S5P: Rename GPIO definitions
> 0c6254b EXYNOS5: Add gpio pin numbering feature
> 5a35ef9 CONFIG: EXYNOS5: Enable silent console
> 6083f4f S5P: Serial: Add fdt support to driver
> 2f78e0f EXYNOS5: FDT: Add serial device node values
> 5b85902 EXYNOS5: FDT: Add compatible strings for Serial
> 6402856 exynos: dts: Use 50MHz SPI flash speed on snow
> 1a6900e EXYNOS: SPL: Add a custom spi copy function
> 27530a7 EXYNOS: SPI: Support word transfers
> 7f8ba96 EXYNOS: SPI: Minimise access to SPI FIFO level
> 149742a EXYNOS: SPI: Support a delay after deactivate
> f3d8caf EXYNOS: Export timer_get_us() to get microsecond timer
> 1aaa266 EXYNOS: SPI: Support SPI_PREAMBLE mode
> 2752d08 SPI: Add support for preamble bytes
> 279a5cb exynos: Enable mmc for snow
> a6280ba COMMON: MMC: Command to support EMMC booting and to resize
> EMMC boot partition
> 19425ea SMDK5250: Enable EMMC booting
> 5253ae0 MMC: APIs to support resize of EMMC boot partition
> 15bb05e SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT
> eeef540 EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted 
> results.
> a4d8bf2 EXYNOS5: DWMMC: Added FDT support for DWMMC
> 71b87c4 DWMMC: Initialise dwmci and resolve EMMC read write issues
> 97c6565 EXYNOS5: FDT: Add DWMMC device node data
> ec5fb8b FDT: Add compatible string for DWMMC
> e7c528b EXYNOS5: I2C: Add FDT and non-FDT support for I2C
>
> Regards,
> Simon
>
>
>>  arch/arm/cpu/armv7/exynos/pinmux.c  |  150 --
>>  arch/arm/include/asm/arch-exynos/cpu.h  |   10 +-
>>  arch/arm/include/asm/arch-exynos/gpio.h |  452 
>> +++
>>  board/samsung/smdk5250/smdk5250.c   |   24 +-
>>  drivers/gpio/s5p_gpio.c |   42 +++
>>  include/configs/exynos5250-dt.h |1 +
>>  6 files changed, 522 insertions(+), 157 deletions(-)
>>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot



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


Re: [U-Boot] Pull request: u-boot-blackfin

2013-05-12 Thread Sonic Zhang
Hi Tom,

On Sun, May 12, 2013 at 12:20 AM, Tom Rini  wrote:
> On Sat, May 11, 2013 at 11:27:41PM +0800, Sonic Zhang wrote:
>> Hi Tom,
>>
>> On Thu, May 9, 2013 at 8:09 PM, Tom Rini  wrote:
>> >
>> > Some number of these changes haven't been posted to the list for review
>> > yet.  I'm pretty sure.  I don't recall seeing the CONFIG_CMD_SOFTSWITCH
>> > stuff go past, and you didn't document that new flag in the top-level
>>
>> I just forward the former softswtich command patch to you which
>> include the definition of CONFIG_CMD_SOFTSWITCH. What else do you
>> think are missing?
>
> Well, please go over everything else and make sure it's showing up in
> patchwork.  I spotted one trivially so I don't know how many others
> might have been missed.

Yes, you are right. I forgot to send out 3 patches in the middle.

  blackfin: Enable early print via the generic serial API.
  blackfin: Add memory virtual console to blackfin serial driver.
  blackfin: Uart divisor should be set after their values are generated.

I will send out soon.


Thanks,

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


Re: [U-Boot] [PATCH 4/4] EXYNOS: Move files from board/samsung to arch/arm.

2013-05-12 Thread Rajeshwari Birje
Hi Simon,

Thank you for reviewing the patch set.
You need to apply the following patches for it to compile and work fine.

EXYNOS: Add API for power reset and exit wakeup
EXYNOS: LDS file move to common
EXYNOS4210: Configure GPIO for uart
EXYNOS: Move files from board/samsung to arch/arm.

>From the error it looks like "EXYNOS: Add API for power reset and exit
wakeup" patch is missing.

Regards,
Rajeshwari Shinde.


On Sun, May 12, 2013 at 12:09 AM, Simon Glass  wrote:
> Hi Rajeshwari,
>
> On Wed, Apr 24, 2013 at 11:57 PM, Rajeshwari Shinde
>  wrote:
>> This patch performs the following:
>>
>> 1) Convert the assembly code for memory and clock initialization to C code.
>> 2) Move the memory and clock init codes from board/samsung to arch/arm
>> 3) Creat a common lowlevel_init file across Exynos4 and Exynos5. Converted
>>the common lowlevel_init from assembly to C-code
>> 4) Made spl_boot.c and tzpc_init.c common for both exynos4 and exynos5.
>> 5) Enable CONFIG_SKIP_LOWLEVEL_INIT as stack pointer initialisation is 
>> already
>> done in _main.
>> 6) exynos-uboot-spl.lds made common across SMDKV310, Origen and SMDK5250.
>>
>> TEST: Tested SD-MMC boot on SMDK5250 and Origen.
>>   Tested USB and SPI boot on SMDK5250
>>   Compile tested for SMDKV310.
>>
>> Signed-off-by: Hatim Ali 
>> Signed-off-by: Rajeshwari Shinde 
>
> Congratulations on getting this patch together.
>
> It looks correct, but I had some problems getting it to build.
> Probably I am missing some other patch.
>
> Configuring for smdk5250 board...
> lowlevel_init.c: In function ‘do_lowlevel_init’:
> lowlevel_init.c:50:2: warning: implicit declaration of function
> ‘get_reset_status’ [-Wimplicit-function-declaration]
> spl_boot.c: In function ‘board_init_f’:
> spl_boot.c:141:3: warning: implicit declaration of function
> ‘power_exit_wakeup’ [-Wimplicit-function-declaration]
> arch/arm/cpu/armv7/exynos/libexynos.o: In function `board_init_f':
> /mnt/host/source/src/third_party/u-boot/files/arch/arm/cpu/armv7/exynos/spl_boot.c:141:
> undefined reference to `power_exit_wakeup'
> arch/arm/cpu/armv7/exynos/libexynos.o: In function `do_lowlevel_init':
> /mnt/host/source/src/third_party/u-boot/files/arch/arm/cpu/armv7/exynos/lowlevel_init.c:50:
> undefined reference to `get_reset_status'
> make[1]: *** [/mnt/host/source/src/third_party/u-boot/files/spl/u-boot-spl]
> Error 1
>
> I will send a separate email about the patch situation. Here are the
> patches I applied in reverse order - please let me know if I missed
> any.
>
> d3858f7 (HEAD, snow2) EXYNOS: Move files from board/samsung to arch/arm.
> e666035 hack: Remove TPM definitions from exysno5-dt.h so that next
> patch applies cleanly
> c9ec2d1 EXYNOS4210: Configure GPIO for uart
> cf6e500 EXYNOS: LDS file move to common
> a40665b EXYNOS: Add API for power reset and shutdown
>
>
> Regards,
> Simon
>
>> ---
>>  arch/arm/cpu/armv7/exynos/Makefile |   14 +-
>>  .../arm/cpu/armv7/exynos}/clock_init.h |0
>>  arch/arm/cpu/armv7/exynos/clock_init_exynos4.c |   63 +++
>>  .../arm/cpu/armv7/exynos/clock_init_exynos5.c  |   26 +-
>>  arch/arm/cpu/armv7/exynos/common_setup.h   |   44 ++
>>  .../arm/cpu/armv7/exynos}/dmc_common.c |7 +-
>>  .../arm/cpu/armv7/exynos}/dmc_init_ddr3.c  |   17 +-
>>  arch/arm/cpu/armv7/exynos/dmc_init_exynos4.c   |  294 
>>  .../arm/cpu/armv7/exynos/exynos4_setup.h   |   72 +++-
>>  .../arm/cpu/armv7/exynos/exynos5_setup.h   |   53 +--
>>  arch/arm/cpu/armv7/exynos/lowlevel_init.c  |   72 +++
>>  .../arm/cpu/armv7/exynos}/spl_boot.c   |   90 +++-
>>  .../arm/cpu/armv7/exynos}/tzpc_init.c  |   17 +-
>>  arch/arm/include/asm/arch-exynos/spl.h |1 +
>>  arch/arm/include/asm/arch-exynos/tzpc.h|   28 ++
>>  board/samsung/origen/Makefile  |7 -
>>  board/samsung/origen/lowlevel_init.S   |  397 -
>>  board/samsung/origen/mem_setup.S   |  421 --
>>  board/samsung/origen/mmc_boot.c|   58 ---
>>  board/samsung/smdk5250/Makefile|9 -
>>  board/samsung/smdk5250/lowlevel_init.S |2 +
>>  board/samsung/smdkv310/Makefile|   10 +-
>>  board/samsung/smdkv310/lowlevel_init.S |  470 
>> 
>>  board/samsung/smdkv310/mem_setup.S |  365 ---
>>  board/samsung/smdkv310/mmc_boot.c  |   60 ---
>>  include/configs/exynos5250-dt.h|   12 +-
>>  include/configs/origen.h   |9 +-
>>  include/configs/smdkv310.h |8 +-
>>  spl/Makefile   |4 +
>>  29 files changed, 728 insertions(+), 1902 deletions(-)
>>  rename {board/samsung/smdk5250 => arch/arm/cpu/armv7/exynos}/clock_init.h 
>> (100%)
>>  create 

Re: [U-Boot] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure

2013-05-12 Thread Marek Vasut
Hello Masahiro-san

> Hi, Marek Vasut
> 
> > Hello Masahiro-san,
> > 
> > > Dear Andrew Gabbasov,
> > 
> > This way of starting emails seems to be dangerously widely adopted ;-D
> 
> Thank you for your respond, but I could not understand what you mean.
> Do you mean that starting emails with "Dear" is something strange?

No no, don't worry, I was just laughing about it :-)

> Starting with "Hi" or "Hello" is more natural?
> I'm not very good at English, so I don't understand
> English nuances and customs.
> If there is something strange, please let me know. I'll appreciate it.
> (You called me with  "-san". You're right. I'm Japanese.)

Your english is better than my japaneese :-)

> > I think we should make sure to use natural alignment as much as possible,
> 
> I understand.
> 
> With all members of 'struct cfi_qry' having u8 type,
> I think '__attribute__((packed))' can be omitted.

Yes, no padding should happen now so it'd be ok to drop this ... unless we 
compile for 64-bit architecture. Tom?

> > really. I'm keeping Albert in CC because this is his turf.
> 
> Sorry for inconvenience in my previous mail, but it was not malicious.

No no, don't worry.

> I am new to this mailing list.
> (I subscribed this U-Boot mailing list at May, 8.)
> 
> At first, I subscribed as a digested user.
> When I tried to post a reply to this thread,
> I recognized digest mails are not useful for replying.
> I had no separated mails in my mail box and I could not simply reply
> with my mail agent.
> 
> In order to post to this thread, I filled 'In-Reply-To:', 'Reference:'
> fields etc by a unusual way.
> And I dropped 'CC:' field accidentally.
> 
> Thanks for adding CC again.

It found it's way to us so it's ok.

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


Re: [U-Boot] [PATCH v3] at91sam9x5ek: Pass serial and revision tags to Linux

2013-05-12 Thread Bo Shen

Hi Julius,

On 5/11/2013 13:01, Julius Hemanth P wrote:

If Bo doesn't have any code in pipeline as of now, then I shall start
working on it.


Now, I don't have code in pipeline, you can work this on it.
Thanks.

BTW, you can take the reference code on github: 
https://github.com/linux4sam/at91bootstrap/blob/master/driver/ds24xx.c. 
This also have Atmel new SoC sama5d3 series support.


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


Re: [U-Boot] [PATCH v6 1/4] usb: hub: make minimum power-on delay configurable

2013-05-12 Thread Marek Vasut
Dear Kuo-Jung Su,

> From: Kuo-Jung Su 
> 
> This patch makes the minimum power-on delay for USB HUB
> become configurable. The original design waits at least
> 100 msec here, but some EHCI controlers(e.g. Faraday EHCI)
> are known to require much longer delay interval.
> 
> Signed-off-by: Kuo-Jung Su 
> CC: Marek Vasut 

The rest of the patches are good, just 2/4 needs minor tweak.

I'd do it myself, but they don't apply to u-boot-usb/master , can you please 
adjust, rebase them and repost? Then I'll pick them.

Thanks!

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


Re: [U-Boot] [PATCH v6 2/4] usb: ehci: add weak-aliased functions to portsc & tdi

2013-05-12 Thread Marek Vasut
Dear Kuo-Jung Su,

> From: Kuo-Jung Su 
> 
> There is at least one non-EHCI compliant controller (i.e. Faraday EHCI)
> known to implement a non-standard TDI stuff.
> Futhermore, it not only leave reserved and CONFIGFLAG registers
> un-implemented but also has their address spaces removed.
> 
> And thus, we need weak-aliased functions to both TDI stuff
> and PORTSC registers for interface abstraction.
> 
> Signed-off-by: Kuo-Jung Su 
> CC: Marek Vasut 
> ---
> Changes for v6:
>- Simplify weak aliased function declaration
>- Drop redundant line feed
> 
> Changes for v5:
>- Split up from Faraday EHCI patch
> 
> Changes for v2 - v4:
>- See 'usb: ehci: add Faraday USB 2.0 EHCI support'
> 
>  drivers/usb/host/ehci-hcd.c |   91
> ++- 1 file changed, 55
> insertions(+), 36 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index c816878..ae3f2a4 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -117,10 +117,44 @@ static struct descriptor {
>  };
> 
>  #if defined(CONFIG_EHCI_IS_TDI)
> -#define ehci_is_TDI()(1)
> -#else
> -#define ehci_is_TDI()(0)
> +# define ehci_is_TDI()   (1)

btw you can remove those braces around (1) and (0) below. But I have one more 
question ...

[...]

> @@ -609,13 +644,10 @@ ehci_submit_root(struct usb_device *dev, unsigned
> long pipe, void *buffer, uint32_t *status_reg;
>   struct ehci_ctrl *ctrl = dev->controller;
> 
> - if (le16_to_cpu(req->index) > CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
> - printf("The request port(%d) is not configured\n",
> - le16_to_cpu(req->index) - 1);
> + status_reg = ehci_get_portsc_register(ctrl->hcor,
> + le16_to_cpu(req->index) - 1);
> + if (!status_reg)

What happens here if req->index is zero ?

Hint: the above code always does unsigned comparison ...

I think you should make the second argument of ehci_get_portsc_register() 
unsigned short too (as is req->index in struct devrequest).

>   return -1;
> - }
> - status_reg = (uint32_t *)&ctrl->hcor->or_portsc[
> - le16_to_cpu(req->index) - 1];
>   srclen = 0;
> 
>   debug("req=%u (%#x), type=%u (%#x), value=%u, index=%u\n",

[...]

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


Re: [U-Boot] [PATCH 1/2] buildman: Allow conflicting tags to avoid spurious errors

2013-05-12 Thread Simon Glass
On Mon, May 6, 2013 at 8:33 AM, Simon Glass  wrote:
> Hi Tom,
>
> On Fri, May 3, 2013 at 5:25 PM, Tom Rini  wrote:
>> On Thu, May 02, 2013 at 05:46:02PM -0700, Simon Glass wrote:
>>
>>> Conflicting tags can prevent buildman from building two series which exist
>>> one after the other in a branch. There is no reason not to allow this sort
>>> of workflow with buildman, so ignore conflicting tags in buildman.
>>>
>>> Signed-off-by: Simon Glass 
>>> ---
>>>  tools/buildman/control.py | 5 +
>>>  tools/patman/series.py| 4 +++-
>>>  2 files changed, 8 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/buildman/control.py b/tools/buildman/control.py
>>> index 8d7b9b5..1ce8b6f 100644
>>> --- a/tools/buildman/control.py
>>> +++ b/tools/buildman/control.py
>>> @@ -137,6 +137,11 @@ def DoBuildman(options, args):
>>>  upstream_commit = gitutil.GetUpstream(options.git_dir, options.branch)
>>>  series = patchstream.GetMetaDataForList(upstream_commit, 
>>> options.git_dir,
>>>  1)
>>> +# Conflicting tags are not a problem for buildman, since it does not 
>>> use
>>> +# then. For example, Series-version is not useful for buildman. On the
>>
>> s/then/them/
>>
>> Feel free to fix in-line and pull request.
>>
>> Reviewed-by: Tom Rini 
>
> OK, will do.

Fixed typo, and:

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


Re: [U-Boot] [RFC PATCH] patman: Do not hardcode python path

2013-05-12 Thread Simon Glass
On Mon, May 6, 2013 at 1:03 PM, Simon Glass  wrote:
> On Mon, May 6, 2013 at 8:14 AM, Tom Rini  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 05/06/2013 10:11 AM, Michal Simek wrote:
>>> Patman requires python 2.7.4 to run but it doesn't need to be
>>> placed in /usr/bin/python. Use env to ensure that the interpreter
>>> used is the first one on environment's $PATH on system with several
>>> versions of Python installed.
>>>
>>> Signed-off-by: Michal Simek  ---
>>> tools/patman/patman.py | 2 +- 1 file changed, 1 insertion(+), 1
>>> deletion(-)
>>>
>>> diff --git a/tools/patman/patman.py b/tools/patman/patman.py index
>>> a8061a9..7a317c5 100755 --- a/tools/patman/patman.py +++
>>> b/tools/patman/patman.py @@ -1,4 +1,4 @@ -#!/usr/bin/python
>>> +#!/usr/bin/env python # # Copyright (c) 2011 The Chromium OS
>>> Authors. #
>>
>> Reviewed-by: Tom Rini 
>
> Acked-by: Simon Glass 

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


Re: [U-Boot] ARM: cfi_flash: Fix unaligned accesses to cfi_qry structure

2013-05-12 Thread Masahiro Yamada
Hi, Marek Vasut

> Hello Masahiro-san,
> 
> > Dear Andrew Gabbasov,
> 
> This way of starting emails seems to be dangerously widely adopted ;-D

Thank you for your respond, but I could not understand what you mean.
Do you mean that starting emails with "Dear" is something strange?
Starting with "Hi" or "Hello" is more natural?
I'm not very good at English, so I don't understand
English nuances and customs.
If there is something strange, please let me know. I'll appreciate it.
(You called me with  "-san". You're right. I'm Japanese.)


> I think we should make sure to use natural alignment as much as possible, 

I understand.

With all members of 'struct cfi_qry' having u8 type,
I think '__attribute__((packed))' can be omitted.


> really. I'm keeping Albert in CC because this is his turf.

Sorry for inconvenience in my previous mail, but it was not malicious.

I am new to this mailing list.
(I subscribed this U-Boot mailing list at May, 8.)

At first, I subscribed as a digested user.
When I tried to post a reply to this thread,
I recognized digest mails are not useful for replying.
I had no separated mails in my mail box and I could not simply reply
with my mail agent.

In order to post to this thread, I filled 'In-Reply-To:', 'Reference:'
fields etc by a unusual way.
And I dropped 'CC:' field accidentally.

Thanks for adding CC again.

Best regards,
Masahiro


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


[U-Boot] [RFC PATCH 6/7] Enable Kconfig for U-Boot

2013-05-12 Thread Simon Glass
To use this, do

   make -f Makefile.kbuild

when building U-Boot, instead of just

   make

Signed-off-by: Simon Glass 
---
 .gitignore|  6 ++
 config.mk |  5 +
 init/Makefile | 21 +
 init/main.c   |  0
 rules.mk  | 25 +
 5 files changed, 57 insertions(+)
 create mode 100644 init/Makefile
 create mode 100644 init/main.c

diff --git a/.gitignore b/.gitignore
index ed21203..7e1bf99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,3 +81,9 @@ cscope.*
 
 # spl ais files
 /spl/*.ais
+
+# new things
+modules.order
+*.o.cmd
+.config
+*.cmd
diff --git a/config.mk b/config.mk
index ddf350e..f5a5756 100644
--- a/config.mk
+++ b/config.mk
@@ -21,6 +21,9 @@
 # MA 02111-1307 USA
 #
 
+# Skip this entire file if using Kconfig
+ifeq ($(KCONFIG_CONFIG),)
+
 #
 
 # Set shell to bash if possible, otherwise fall back to sh
@@ -362,3 +365,5 @@ cmd_link_o_target = $(if $(strip $1),\
  rm -f $@; $(AR) rcs $@ )
 
 #
+
+endif  # Kconfig skip
diff --git a/init/Makefile b/init/Makefile
new file mode 100644
index 000..0168bbc
--- /dev/null
+++ b/init/Makefile
@@ -0,0 +1,21 @@
+#
+# Makefile for the linux kernel.
+#
+
+obj-y  := main.o #version.o
+
+# dependencies on generated files need to be listed explicitly
+$(obj)/version.o: include/generated/compile.h
+
+# compile.h changes depending on hostname, generation number, etc,
+# so we regenerate it always.
+# mkcompile_h will make sure to only update the
+# actual file if its content has changed.
+
+   chk_compile.h = :
+ quiet_chk_compile.h = echo '  CHK $@'
+silent_chk_compile.h = :
+include/generated/compile.h: FORCE
+   @$($(quiet)chk_compile.h)
+   $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \
+   "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" "$(CC) 
$(KBUILD_CFLAGS)"
diff --git a/init/main.c b/init/main.c
new file mode 100644
index 000..e69de29
diff --git a/rules.mk b/rules.mk
index fa929f9..84c27c4 100644
--- a/rules.mk
+++ b/rules.mk
@@ -21,6 +21,9 @@
 # MA 02111-1307 USA
 #
 
+# For Kconfig we do something completely different
+ifeq ($(KCONFIG_CONFIG),)
+
 #
 
 _depend:   $(obj).depend
@@ -66,3 +69,25 @@ $(NOPEDOBJS): $(obj)%.o: %.c
$(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTCFLAGS_$(@F)) 
$(HOSTCFLAGS_$(BCURDIR)) -o $@ $< -c
 
 #
+
+else
+# Kconfig implementaiton
+
+# Pick up any object files that ended up in COBJS
+obj-y += $(COBJS)
+
+# Assembler files also
+obj-y += $(SOBJS)
+
+# File containing start of U-Boot
+obj-y += $(STARTOBJS)
+
+# ARM has some library files we want
+obj-y += $(GLSOBJS) $(GLCOBJS)
+
+# Mark those in COBJS- as missing (available but not to be linked)
+# Otherwise kbuild will fail to create an empty built-in.o in this
+# directory.
+obj- += $(COBJS-)
+
+endif
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH 1/7] Add some required Kconfig files

2013-05-12 Thread Simon Glass
We need a few of these just to get things started.

Signed-off-by: Simon Glass 
---
 Kconfig  | 11 +++
 arch/Kconfig |  0
 arch/arm/Kconfig |  0
 arch/sandbox/Kconfig |  8 
 arch/x86/Kconfig |  0
 5 files changed, 19 insertions(+)
 create mode 100644 Kconfig
 create mode 100644 arch/Kconfig
 create mode 100644 arch/arm/Kconfig
 create mode 100644 arch/sandbox/Kconfig
 create mode 100644 arch/x86/Kconfig

diff --git a/Kconfig b/Kconfig
new file mode 100644
index 000..8710334
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,11 @@
+#
+# For a description of the syntax of this configuration file,
+# see Linux's Documentation/kbuild/kconfig-language.txt file.
+#
+mainmenu "U-Boot/$ARCH $KERNELVERSION Configuration"
+
+config SRCARCH
+   string
+   option env="SRCARCH"
+
+source "arch/$SRCARCH/Kconfig"
diff --git a/arch/Kconfig b/arch/Kconfig
new file mode 100644
index 000..e69de29
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
new file mode 100644
index 000..e69de29
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
new file mode 100644
index 000..cb3c10d
--- /dev/null
+++ b/arch/sandbox/Kconfig
@@ -0,0 +1,8 @@
+
+config SANDBOX_BITS_PER_LONG
+   int "Number of bits in a long"
+   default 64
+   help
+ The length of a long integer in bits is normally 64, and
+ is controlled by this option. Only change this if you know
+ what you are doing.
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
new file mode 100644
index 000..e69de29
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH 3/7] Tidy up Makefiles to use COBJS consistently

2013-05-12 Thread Simon Glass
Some Makefiles doen't define COBJS, but just use COBJS-y directly. This
messes with our Kconfig script which uses COBJS to decide which objects
are needed.

Also, for directories where COBJS produces an empty list, COBJS- must be
defined and non-empty, otherwise Kconfig will not create the empty
built-in.o file and the link will fail. So adjust things such that
COBJS- is defined when needed.

Finally, Kconfig needs to know about subdirectories with the obj-y
variable, so add these as needed.

All of the above changes should have no effect on the existing U-Boot
build system.

Signed-off-by: Simon Glass 
---
 arch/arm/Makefile  | 20 +++
 arch/arm/cpu/Makefile  | 23 +
 arch/arm/cpu/armv7/Makefile| 11 +---
 arch/arm/cpu/armv7/s5p-common/Makefile |  3 ++-
 arch/arm/cpu/tegra-common/Makefile |  5 ++--
 arch/arm/cpu/tegra20-common/Makefile   |  5 ++--
 arch/arm/lib/Makefile  |  6 +++--
 arch/sandbox/Makefile  | 20 +++
 arch/sandbox/cpu/Makefile  |  2 ++
 arch/sandbox/lib/Makefile  |  4 +++
 arch/x86/Makefile  | 24 +
 doc/Makefile   | 20 +++
 drivers/Makefile   | 47 ++
 drivers/bios_emulator/Makefile |  4 +++
 drivers/bootcount/Makefile |  2 +-
 drivers/fpga/Makefile  |  2 +-
 drivers/gpio/Makefile  |  1 -
 drivers/mtd/Makefile   |  2 ++
 drivers/mtd/nand/Makefile  | 21 +++
 drivers/mtd/ubi/Makefile   | 10 +++-
 drivers/power/Makefile |  2 ++
 drivers/usb/Makefile   | 26 +++
 drivers/usb/gadget/Makefile|  4 +--
 drivers/usb/musb-new/Makefile  |  4 +++
 fs/Makefile|  4 +++
 fs/ext4/Makefile   |  5 ++--
 fs/fat/Makefile|  5 ++--
 fs/sandbox/Makefile|  5 ++--
 lib/Makefile   |  3 +++
 29 files changed, 251 insertions(+), 39 deletions(-)
 create mode 100644 arch/arm/Makefile
 create mode 100644 arch/arm/cpu/Makefile
 create mode 100644 arch/sandbox/Makefile
 create mode 100644 arch/x86/Makefile
 create mode 100644 doc/Makefile
 create mode 100644 drivers/Makefile
 create mode 100644 drivers/usb/Makefile

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
new file mode 100644
index 000..bb9b8fd
--- /dev/null
+++ b/arch/arm/Makefile
@@ -0,0 +1,20 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundatio; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+obj-y += cpu/ lib/
diff --git a/arch/arm/cpu/Makefile b/arch/arm/cpu/Makefile
new file mode 100644
index 000..2774a96
--- /dev/null
+++ b/arch/arm/cpu/Makefile
@@ -0,0 +1,23 @@
+#
+# (C) Copyright 2013 Google, Inc
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundatio; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+obj-y += $(CPU)/
+
+obj-$(CONFIG_TEGRA) += tegra-common/
+obj-$(CONFIG_TEGRA) += $(SOC)-common/
diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 7a8c2d0..734a662 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -25,7 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(CPU).o
 
-START  := start.o
+obj-y  += $(SOC)/
+ifeq ($(SOC),exynos)
+obj-y  += s5p-common/
+endif
+
+STARTOBJS  := start.o
 
 COBJS  += cache_v7.o
 
@@ -36,9 +41,9 @@ ifneq 
($(CONFIG_AM33XX)$(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX)$(CONFIG_TEGRA)$(CONF
 SOBJS  += lowlevel_init.o
 endif
 
-SRCS   := $(START:.o=.S) $(COBJ

[U-Boot] [RFC PATCH 5/7] Adjust Kconfig scripts for use by U-Boot

2013-05-12 Thread Simon Glass
This is an intial stab at changing Kconfig for U-Boot. So far it is missing
many things, notably SPL support and binary output. Also the output file is
vmlinux instead of u-boot.

Linux modules are not supported, but it is quite possible that some
enterprising soul will want to implement modules in U-Boot. For that reason
and to minimise conflicts with future Kbuild updates, modules support is
disabled rather than removed.

Signed-off-by: Simon Glass 
---
 Makefile.kbuild  | 37 +++--
 scripts/Makefile |  7 +--
 scripts/Makefile.build   |  1 +
 scripts/Makefile.lib | 10 ++
 scripts/kconfig/Makefile | 15 +--
 scripts/link-vmlinux.sh  | 13 +++--
 6 files changed, 59 insertions(+), 24 deletions(-)

diff --git a/Makefile.kbuild b/Makefile.kbuild
index 2547cca..dc241d4 100644
--- a/Makefile.kbuild
+++ b/Makefile.kbuild
@@ -2,7 +2,12 @@ VERSION = 2013
 PATCHLEVEL = 04
 SUBLEVEL =
 EXTRAVERSION =
-NAME = Unicycling Gorilla
+NAME = Uncular Umbrella
+ifneq "$(SUBLEVEL)" ""
+U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
+else
+U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL)$(EXTRAVERSION)
+endif
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
@@ -172,6 +177,9 @@ export SRCTREE TOPDIR OBJTREE
 # Export U-Boot variables
 export BOARD CPU SOC VENDOR
 
+TIMESTAMP_FILE = $(objtree)/include/generated/timestamp_autogenerated.h
+VERSION_FILE = $(objtree)/include/generated/version_autogenerated.h
+
 # SUBARCH tells the usermode build what the underlying arch is.  That is set
 # first, and if a usermode build is happening, the "ARCH=um" on the command
 # line overrides the setting of ARCH below.  If a native build is happening,
@@ -807,9 +815,6 @@ fs-y:= $(patsubst %/, %/built-in.o, $(fs-y))
 init-y := $(patsubst %/, %/built-in.o, $(init-y))
 net-y  := $(patsubst %/, %/built-in.o, $(net-y))
 spl-y  := $(patsubst %/, %/built-in.o, $(spl-y))
-# libs-y1  := $(patsubst %/, %/lib.a, $(libs-y))
-# libs-y2  := $(patsubst %/, %/built-in.o, $(libs-y))
-# libs-y   := $(libs-y1) $(libs-y2)
 
 libs-y := $(patsubst %/, %/built-in.o, $(libs-y))
 
@@ -875,7 +880,7 @@ PHONY += prepare archprepare prepare0 prepare1 prepare2 
prepare3
 # prepare3 is used to check if we are building in a separate output directory,
 # and if so do:
 # 1) Check that make has not been executed in the kernel src $(srctree)
-prepare3: include/config/kernel.release
+prepare3: include/config/kernel.release $(TIMESTAMP_FILE) $(VERSION_FILE)
 ifneq ($(KBUILD_SRC),)
@$(kecho) '  Using $(srctree) as source for kernel'
$(Q)if [ -f $(srctree)/.config -o -d $(srctree)/include/config ]; then \
@@ -906,6 +911,26 @@ prepare: prepare0
 # KERNELRELEASE can change from a few different places, meaning version.h
 # needs to be updated, so this check is forced on all builds
 
+$(VERSION_FILE):
+   @mkdir -p $(dir $(VERSION_FILE))
+   @( localvers='$(shell $(TOPDIR)/tools/setlocalversion 
$(TOPDIR))' ; \
+  printf '#define PLAIN_VERSION "%s%s"\n' \
+   "$(U_BOOT_VERSION)" "$${localvers}" ; \
+  printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
+   "$(U_BOOT_VERSION)" "$${localvers}" ; \
+   ) > $@.tmp
+   @( printf '#define CC_VERSION_STRING "%s"\n' \
+'$(shell $(CC) --version | head -n 1)' )>>  $@.tmp
+   @( printf '#define LD_VERSION_STRING "%s"\n' \
+'$(shell $(LD) -v | head -n 1)' )>>  $@.tmp
+   @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
+
+$(TIMESTAMP_FILE):
+   @mkdir -p $(dir $(TIMESTAMP_FILE))
+   @LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@.tmp
+   @LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@.tmp
+   @cmp -s $@ $@.tmp && rm -f $@.tmp || mv -f $@.tmp $@
+
 uts_len := 64
 define filechk_utsrelease.h
if [ `echo -n "$(KERNELRELEASE)" | wc -c ` -gt $(uts_len) ]; then \
@@ -1107,7 +1132,7 @@ clean: archclean vmlinuxclean
 #
 mrproper: rm-dirs  := $(wildcard $(MRPROPER_DIRS))
 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
-mrproper-dirs  := $(addprefix _mrproper_,Documentation/DocBook scripts)
+mrproper-dirs  := $(addprefix _mrproper_,scripts)
 
 PHONY += $(mrproper-dirs) mrproper archmrproper
 $(mrproper-dirs):
diff --git a/scripts/Makefile b/scripts/Makefile
index 01e7adb..aedf135 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -33,10 +33,5 @@ build_unifdef: scripts/unifdef FORCE
 build_docproc: scripts/docproc FORCE
@:
 
-subdir-$(CONFIG_MODVERSIONS) += genksyms
-subdir-y += mod
-subdir-$(CONFIG_SECURITY_SELINUX) += selinux
-subdir-$(CONFIG_DTC) += dtc
-
 # Let clean descend into subdirs
-subdir-+= basic kconfig package selinux
+subdir- 

[U-Boot] [RFC PATCH 2/7] arm: Allow start.o to come from any directory

2013-05-12 Thread Simon Glass
Instead of explicitly speciying the directory for start.o, use any. There
should be only one.

Signed-off-by: Simon Glass 
---
 arch/arm/cpu/u-boot.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index d9bbee3..49d47d1 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -34,7 +34,7 @@ SECTIONS
.text :
{
__image_copy_start = .;
-   CPUDIR/start.o (.text*)
+   */start.o (.text*)
*(.text*)
}
 
-- 
1.8.2.1

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


[U-Boot] [RFC PATCH 0/7] RFC: Add Kbuild system to U-Boot

2013-05-12 Thread Simon Glass
Kbuild in U-Boot has been talked about for a while and I know of at least
one functioning attempt and mentions of independent progress. But I don't
see any patches on the mailing list and various people have suggested that
nothing is far advanced yet, so I decided to take a look.

For this effort, the goals are:

- Use Kbuild to build U-Boot, even if the existing CONFIG structure remains
- Provide access to Kconfig infrastructure so we can migrate to it
- Change as little U-Boot code as possible, particularly Makefiles

While some people regard U-Boot's config file approach as primitive, it is
very flexible. In practice many Linux build systems use a 'defconfig' which
is much the same thing, just without the comments. However, Kbuild/Kconfig
does provide some advantages:

- 'make menuconfig' and friends, an easy way to browse/change configuration
- More obvious information about configuration dependencies
- Configuration help within the Kconfig files, rather than a separate README
- The build prints the full path of each file built. Apart from the resulting
clarity, this works nicely with IDEs/emacs which can open the correct
file/line for each warning/error
- Welcoming and familiar to those coming from Linux
- Some other things

With respect to a migration path to full use of Kconfig for U-Boot, if that
is desired, I suggest it can be done incrementally. The scheme in this
series allows existing Makefiles to be used with only minor modification
(to fix those which don't follow convention and add information about
subdirectories). I think it is feasible to keep the config files and Kconfig
running together for a time.

This series is a pretty early and raw attempt to get Kbuild running in
U-Boot. I am not entirely comfortable with posting it, but decided that
what was missing from previous efforts was posted patches, so here they
are. A close review is not needed right now, but thoughts on the approach
would be very valuable.

This series is missing all sorts of things, some of them critical (SPL,
actual binary output, correct filename for 'u-boot' output, out-of-tree
building). It will also pollute your tree with various files that you will
need to manually remove afterwards.

But it does produce some sort of output for three boards (sandbox, seaboard,
smdk5250).

To get a verbose build, try 'make V=1'. By default only the filenames and
warnings/errors are printed.

To try it:

make sandbox_config
make
size vmlinux
./vmlinux

You can use the existing build system with:

make -f Makefile.legacy sandbox_config
make -f Makefile.legacy
size u-boot
./u-boot

If you omit the final patch, you can keep the existing build system in
place and have the Kconfig one separate, in Makefile.kbuild, for use with
'make -f Makefile.kbuild'.

There is only one build option, and that isn't really an option, but to
see it:

make menuconfig

or (perhaps preceeded by 'sudo apt-get install libqt4-dev g++'):

make xconfig


Simon Glass (7):
  Add some required Kconfig files
  arm: Allow start.o to come from any directory
  Tidy up Makefiles to use COBJS consistently
  Add Kconfig scripts and related material
  Adjust Kconfig scripts for use by U-Boot
  Enable Kconfig for U-Boot
  Switch over to Kbuild

 .gitignore |6 +
 Kconfig|   11 +
 Makefile   | 2147 +++-
 Makefile.legacy|  900 ++
 arch/Kconfig   |0
 arch/arm/Kconfig   |0
 arch/arm/Makefile  |   20 +
 arch/arm/cpu/Makefile  |   23 +
 arch/arm/cpu/armv7/Makefile|   11 +-
 arch/arm/cpu/armv7/s5p-common/Makefile |3 +-
 arch/arm/cpu/tegra-common/Makefile |5 +-
 arch/arm/cpu/tegra20-common/Makefile   |5 +-
 arch/arm/cpu/u-boot.lds|2 +-
 arch/arm/lib/Makefile  |6 +-
 arch/sandbox/Kconfig   |8 +
 arch/sandbox/Makefile  |   20 +
 arch/sandbox/cpu/Makefile  |2 +
 arch/sandbox/lib/Makefile  |4 +
 arch/x86/Kconfig   |0
 arch/x86/Makefile  |   24 +
 config.mk  |5 +
 doc/Makefile   |   20 +
 drivers/Makefile   |   47 +
 drivers/bios_emulator/Makefile |4 +
 drivers/bootcount/Makefile |2 +-
 drivers/fpga/Makefile  |2 +-
 drivers/gpio/Makefile  |1 -
 drivers/mtd/Makefile   |2 +
 drivers/mtd/nand/Makefile  |   21 +-
 drivers/mtd/ubi/Makefile   |   10 +-
 drivers/power/Makefile |2 +
 drivers/usb/Makefile  

[U-Boot] [PATCH v6 4/4] usb: gadget: add Faraday FOTG210 USB gadget support

2013-05-12 Thread Kuo-Jung Su
From: Kuo-Jung Su 

The Faraday FOTG210 is an OTG chip which could operate
as either an EHCI Host or a USB Device at a time.

Signed-off-by: Kuo-Jung Su 
CC: Marek Vasut 
---
Changes for v6:
   - Nothing updates

Changes for v5:
   - Coding Style cleanup.
   - Drop postfix '__iomem' from struct fotg210_regs
   - Use permanent delay for hardware reset
   - Drop '#ifndef CONFIG_SYS_DCACHE_OFF'
   - Drop magic numbers

Changes for v4:
   - Use only macro constants and named bit/mask
   - Remove dcache_enable() from usb_gadget_register_driver()

Changes for v3:
   - Coding Style cleanup.
   - Drop bit fields from c struct.
   - Drop macros for wirtel()/readl(), call them directly.
   - Always insert a blank line between declarations and code.
   - Replace all the infinite wait loop with a timeout.
   - Add '__iomem' to all the declaration of HW register pointers.

Changes for v2:
   - Coding Style cleanup.
   - Use readl(), writel(), clrsetbits_le32() to replace REG() macros.
   - Use structure based hardware registers to replace the macro constants.
   - Replace BIT() with BIT_MASK().
   - echi-faraday: Remove debug codes.

 drivers/usb/gadget/Makefile   |1 +
 drivers/usb/gadget/fotg210.c  |  948 +
 drivers/usb/gadget/gadget_chips.h |8 +
 3 files changed, 957 insertions(+)
 create mode 100644 drivers/usb/gadget/fotg210.c

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index e545b6b..432cf17 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -35,6 +35,7 @@ endif
 # new USB gadget layer dependencies
 ifdef CONFIG_USB_GADGET
 COBJS-$(CONFIG_USB_GADGET_S3C_UDC_OTG) += s3c_udc_otg.o
+COBJS-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o
 COBJS-$(CONFIG_USBDOWNLOAD_GADGET) += g_dnl.o
 COBJS-$(CONFIG_DFU_FUNCTION) += f_dfu.o
 endif
diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
new file mode 100644
index 000..d003331
--- /dev/null
+++ b/drivers/usb/gadget/fotg210.c
@@ -0,0 +1,948 @@
+/*
+ * Faraday USB 2.0 OTG Controller
+ *
+ * (C) Copyright 2010 Faraday Technology
+ * Dante Su 
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#define CFG_NUM_ENDPOINTS  4
+#define CFG_EP0_MAX_PACKET_SIZE64
+#define CFG_EPX_MAX_PACKET_SIZE512
+
+#define CFG_CMD_TIMEOUT (CONFIG_SYS_HZ >> 2) /* 250 ms */
+
+struct fotg210_chip;
+
+struct fotg210_ep {
+   struct usb_ep ep;
+
+   uint maxpacket;
+   uint id;
+   uint stopped;
+
+   struct list_head  queue;
+   struct fotg210_chip  *chip;
+   const struct usb_endpoint_descriptor *desc;
+};
+
+struct fotg210_request {
+   struct usb_request req;
+   struct list_head   queue;
+   struct fotg210_ep *ep;
+};
+
+struct fotg210_chip {
+   struct usb_gadget gadget;
+   struct usb_gadget_driver *driver;
+   struct fotg210_regs  *regs;
+   uint8_t   irq;
+   uint16_t  addr;
+   int   pullup;
+   enum usb_device_state state;
+   struct fotg210_ep ep[1 + CFG_NUM_ENDPOINTS];
+};
+
+static struct usb_endpoint_descriptor ep0_desc = {
+   .bLength = sizeof(struct usb_endpoint_descriptor),
+   .bDescriptorType = USB_DT_ENDPOINT,
+   .bEndpointAddress = USB_DIR_IN,
+   .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
+};
+
+static inline int fifo_to_ep(struct fotg210_chip *chip, int id, int in)
+{
+   return (id < 0) ? 0 : ((id & 0x03) + 1);
+}
+
+static inline int ep_to_fifo(struct fotg210_chip *chip, int id)
+{
+   return (id <= 0) ? -1 : ((id - 1) & 0x03);
+}
+
+static inline int ep_reset(struct fotg210_chip *chip, uint8_t ep_addr)
+{
+   int ep = ep_addr & USB_ENDPOINT_NUMBER_MASK;
+   struct fotg210_regs *regs = chip->regs;
+
+   if (ep_addr & USB_DIR_IN) {
+   /* reset endpoint */
+   setbits_le32(®s->iep[ep - 1], IEP_RESET);
+   mdelay(1);
+   clrbits_le32(®s->iep[ep - 1], IEP_RESET);
+   /* clear endpoint stall */
+   clrbits_le32(®s->iep[ep - 1], IEP_STALL);
+   } else {
+   /* reset endpoint */
+   setbits_le32(®s->oep[ep - 1], OEP_RESET);
+   mdelay(1);
+   clrbits_le32(®s->oep[ep - 1], OEP_RESET);
+   /* clear endpoint stall */
+   clrbits_le32(®s->oep[ep - 1], OEP_STALL);
+   }
+
+   return 0;
+}
+
+static int fotg210_reset(struct fotg210_chip *chip)
+{
+   struct fotg210_regs *regs = chip->regs;
+   uint32_t i;
+
+   chip->state = USB_STATE_POWERED;
+
+   /* chip enable */
+   writel(DEVCTRL_EN, ®s->dev_ctrl);
+
+ 

[U-Boot] [PATCH v6 3/4] usb: ehci: add Faraday USB 2.0 EHCI support

2013-05-12 Thread Kuo-Jung Su
From: Kuo-Jung Su 

This patch adds support to both Faraday FUSBH200 and FOTG210,
the differences between Faraday EHCI and standard EHCI are
listed bellow:

1. The PORTSC starts at 0x30 instead of 0x44.
2. The CONFIGFLAG(0x40) is not only un-implemented, and
   also has its address space removed.
3. Faraday EHCI is a TDI design, but it doesn't
   compatible with the general TDI implementation
   found at both U-Boot and Linux.
4. The ISOC descriptors differ from standard EHCI in
   several ways. But since U-boot doesn't support ISOC,
   we don't have to worry about that.

Signed-off-by: Kuo-Jung Su 
CC: Marek Vasut 
---
Changes for v6:
   - Nothing updates

Changes for v5:
   - Break down EHCI changes as seperate changesets.
   - Fix the invalid multi-line comment style.

Changes for v4:
   - Use only macro constants and named bit/mask
   - Use weak-aliased functions for tdi implementation and
 also portsc registers to avoid poluting ehci.h with ifdefs

Changes for v3:
   - Coding Style cleanup.
   - Drop bit fields from c struct.
   - Drop macros for wirtel()/readl(), call them directly.
   - Always insert a blank line between declarations and code.
   - Replace all the infinite wait loop with a timeout.
   - Add '__iomem' to all the declaration of HW register pointers.

Changes for v2:
   - Coding Style cleanup.
   - Use readl(), writel(), clrsetbits_le32() to replace REG() macros.
   - Use structure based hardware registers to replace the macro constants.
   - Replace BIT() with BIT_MASK().
   - echi-faraday: Remove debug codes.

 common/usb_hub.c|7 +-
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-faraday.c |  146 
 drivers/usb/host/ehci-hcd.c |5 +
 include/usb/fotg210.h   |  364 +++
 include/usb/fusbh200.h  |   61 +++
 6 files changed, 583 insertions(+), 1 deletion(-)
 create mode 100644 drivers/usb/host/ehci-faraday.c
 create mode 100644 include/usb/fotg210.h
 create mode 100644 include/usb/fusbh200.h

diff --git a/common/usb_hub.c b/common/usb_hub.c
index f240d8c..25821a5 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -445,7 +445,11 @@ static int usb_hub_configure(struct usb_device *dev)
i + 1, portstatus);
usb_clear_port_feature(dev, i + 1,
USB_PORT_FEAT_C_ENABLE);
-
+   /*
+* The following hack causes a ghost device problem
+* to Faraday EHCI
+*/
+#ifndef CONFIG_USB_EHCI_FARADAY
/* EM interference sometimes causes bad shielded USB
 * devices to be shutdown by the hub, this hack enables
 * them again. Works at least with mouse driver */
@@ -457,6 +461,7 @@ static int usb_hub_configure(struct usb_device *dev)
"re-enabling...\n", i + 1);
usb_hub_port_connect_change(dev, i);
}
+#endif
}
if (portstatus & USB_PORT_STAT_SUSPEND) {
USB_HUB_PRINTF("port %d suspend change\n", i + 1);
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 87a5970..98f2a10 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -43,6 +43,7 @@ COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-mpc512x.o
 else
 COBJS-$(CONFIG_USB_EHCI_FSL) += ehci-fsl.o
 endif
+COBJS-$(CONFIG_USB_EHCI_FARADAY) += ehci-faraday.o
 COBJS-$(CONFIG_USB_EHCI_EXYNOS) += ehci-exynos.o
 COBJS-$(CONFIG_USB_EHCI_MXC) += ehci-mxc.o
 COBJS-$(CONFIG_USB_EHCI_MXS) += ehci-mxs.o
diff --git a/drivers/usb/host/ehci-faraday.c b/drivers/usb/host/ehci-faraday.c
new file mode 100644
index 000..1be9369
--- /dev/null
+++ b/drivers/usb/host/ehci-faraday.c
@@ -0,0 +1,146 @@
+/*
+ * Faraday USB 2.0 EHCI Controller
+ *
+ * (C) Copyright 2010 Faraday Technology
+ * Dante Su 
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "ehci.h"
+
+#ifndef CONFIG_USB_EHCI_BASE_LIST
+#define CONFIG_USB_EHCI_BASE_LIST  { CONFIG_USB_EHCI_BASE }
+#endif
+
+union ehci_faraday_regs {
+   struct fusbh200_regs usb;
+   struct fotg210_regs  otg;
+};
+
+static inline int ehci_is_fotg2xx(union ehci_faraday_regs *regs)
+{
+   return !readl(®s->usb.easstr);
+}
+
+/*
+ * Create the appropriate control structures to manage
+ * a new EHCI host controller.
+ */
+int ehci_hcd_init(int index, struct ehci_hccr **ret_hccr,
+   struct ehci_hcor **ret_hcor)
+{
+   struct ehci_hccr *hccr;
+   struct ehci_hcor *hcor;
+   union ehci_faraday_regs *regs;
+   uint32_t base_list[] = CONFIG_USB_EHCI_BASE_

[U-Boot] [PATCH v6 2/4] usb: ehci: add weak-aliased functions to portsc & tdi

2013-05-12 Thread Kuo-Jung Su
From: Kuo-Jung Su 

There is at least one non-EHCI compliant controller (i.e. Faraday EHCI)
known to implement a non-standard TDI stuff.
Futhermore, it not only leave reserved and CONFIGFLAG registers
un-implemented but also has their address spaces removed.

And thus, we need weak-aliased functions to both TDI stuff
and PORTSC registers for interface abstraction.

Signed-off-by: Kuo-Jung Su 
CC: Marek Vasut 
---
Changes for v6:
   - Simplify weak aliased function declaration
   - Drop redundant line feed

Changes for v5:
   - Split up from Faraday EHCI patch

Changes for v2 - v4:
   - See 'usb: ehci: add Faraday USB 2.0 EHCI support'

 drivers/usb/host/ehci-hcd.c |   91 ++-
 1 file changed, 55 insertions(+), 36 deletions(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index c816878..ae3f2a4 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -117,10 +117,44 @@ static struct descriptor {
 };

 #if defined(CONFIG_EHCI_IS_TDI)
-#define ehci_is_TDI()  (1)
-#else
-#define ehci_is_TDI()  (0)
+# define ehci_is_TDI() (1)
+
+/* put TDI/ARC silicon into EHCI mode */
+__weak void ehci_tdi_reset(struct ehci_hcor *hcor)
+{
+   uint32_t tmp, *reg_ptr;
+
+   reg_ptr = (uint32_t *)((uint8_t *) + USBMODE);
+   tmp = ehci_readl(reg_ptr);
+   tmp |= USBMODE_CM_HC;
+#if defined(CONFIG_EHCI_MMIO_BIG_ENDIAN)
+   tmp |= USBMODE_BE;
 #endif
+   ehci_writel(reg_ptr, tmp);
+}
+
+__weak int ehci_port_speed(struct ehci_hcor *hcor, unsigned int portsc)
+{
+   int ret = 0;
+
+   switch (PORTSC_PSPD(portsc)) {
+   case PORTSC_PSPD_FS:
+   break;
+   case PORTSC_PSPD_LS:
+   ret = USB_PORT_STAT_LOW_SPEED;
+   break;
+   case PORTSC_PSPD_HS:
+   default:
+   ret = USB_PORT_STAT_HIGH_SPEED;
+   break;
+   }
+
+   return ret;
+}
+
+#else  /* CONFIG_EHCI_IS_TDI */
+# define ehci_is_TDI() (0)
+#endif /* CONFIG_EHCI_IS_TDI */

 void __ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
 {
@@ -149,8 +183,6 @@ static int handshake(uint32_t *ptr, uint32_t mask, uint32_t 
done, int usec)
 static int ehci_reset(int index)
 {
uint32_t cmd;
-   uint32_t tmp;
-   uint32_t *reg_ptr;
int ret = 0;

cmd = ehci_readl(&ehcic[index].hcor->or_usbcmd);
@@ -163,15 +195,8 @@ static int ehci_reset(int index)
goto out;
}

-   if (ehci_is_TDI()) {
-   reg_ptr = (uint32_t *)((u8 *)ehcic[index].hcor + USBMODE);
-   tmp = ehci_readl(reg_ptr);
-   tmp |= USBMODE_CM_HC;
-#if defined(CONFIG_EHCI_MMIO_BIG_ENDIAN)
-   tmp |= USBMODE_BE;
-#endif
-   ehci_writel(reg_ptr, tmp);
-   }
+   if (ehci_is_TDI())
+   ehci_tdi_reset(ehcic[index].hcor);

 #ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
cmd = ehci_readl(&ehcic[index].hcor->or_txfilltuning);
@@ -597,6 +622,16 @@ static inline int min3(int a, int b, int c)
return a;
 }

+__weak uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port)
+{
+   if (port >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
+   printf("The request port(%d) is not configured\n", port);
+   return NULL;
+   }
+
+   return (uint32_t *)&hcor->or_portsc[port];
+}
+
 int
 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
 int length, struct devrequest *req)
@@ -609,13 +644,10 @@ ehci_submit_root(struct usb_device *dev, unsigned long 
pipe, void *buffer,
uint32_t *status_reg;
struct ehci_ctrl *ctrl = dev->controller;

-   if (le16_to_cpu(req->index) > CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
-   printf("The request port(%d) is not configured\n",
-   le16_to_cpu(req->index) - 1);
+   status_reg = ehci_get_portsc_register(ctrl->hcor,
+   le16_to_cpu(req->index) - 1);
+   if (!status_reg)
return -1;
-   }
-   status_reg = (uint32_t *)&ctrl->hcor->or_portsc[
-   le16_to_cpu(req->index) - 1];
srclen = 0;

debug("req=%u (%#x), type=%u (%#x), value=%u, index=%u\n",
@@ -709,23 +741,10 @@ ehci_submit_root(struct usb_device *dev, unsigned long 
pipe, void *buffer,
tmpbuf[0] |= USB_PORT_STAT_RESET;
if (reg & EHCI_PS_PP)
tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
-
-   if (ehci_is_TDI()) {
-   switch (PORTSC_PSPD(reg)) {
-   case PORTSC_PSPD_FS:
-   break;
-   case PORTSC_PSPD_LS:
-   tmpbuf[1] |= USB_PORT_STAT_LOW_SPEED >> 8;
-   break;
-   case PORTSC_PSPD_HS:
-   default:
-   tmpbuf[1] |= USB_PORT_STAT_

[U-Boot] [PATCH v6 1/4] usb: hub: make minimum power-on delay configurable

2013-05-12 Thread Kuo-Jung Su
From: Kuo-Jung Su 

This patch makes the minimum power-on delay for USB HUB
become configurable. The original design waits at least
100 msec here, but some EHCI controlers(e.g. Faraday EHCI)
are known to require much longer delay interval.

Signed-off-by: Kuo-Jung Su 
CC: Marek Vasut 
---
Changes for v6:
   - Simplify CONFIG_USB_HUB_MIN_POWER_ON_DELAY default value setup.

Changes for v5:
   - Split up from Faraday EHCI patch
   - Replace the Faraday EHCI ifdef for the long delay
 in usb_hub_configure() with the new configuration option:
 USB_HUB_MIN_POWER_ON_DELAY, which is used in usb_hub_power_on()
 to control the minimum usb hub power-on delay.

Changes for v2 - v4:
   - See 'usb: ehci: add Faraday USB 2.0 EHCI support'

 README   |3 +++
 common/usb_hub.c |8 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/README b/README
index 0d37d56..455163b 100644
--- a/README
+++ b/README
@@ -1244,6 +1244,9 @@ The following options need to be configured:
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
txfilltuning field in the EHCI controller on reset.

+   CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum
+   interval for usb hub power-on delay.(100msec by default)
+
 - USB Device:
Define the below if you wish to use the USB console.
Once firmware is rebuilt from a serial console issue the
diff --git a/common/usb_hub.c b/common/usb_hub.c
index b5eeb62..f240d8c 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -61,6 +61,10 @@
 #define USB_HUB_DEBUG  0
 #endif

+#ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY
+#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY  100
+#endif
+
 #define USB_PRINTF(fmt, args...)   debug_cond(USB_DEBUG, fmt, ##args)
 #define USB_HUB_PRINTF(fmt, args...)   debug_cond(USB_HUB_DEBUG, fmt, ##args)

@@ -120,8 +124,8 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
}

-   /* Wait at least 100 msec for power to become stable */
-   mdelay(max(pgood_delay, (unsigned)100));
+   /* Wait for power to become stable */
+   mdelay(max(pgood_delay, CONFIG_USB_HUB_MIN_POWER_ON_DELAY));
 }

 void usb_hub_reset(void)
--
1.7.9.5

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


[U-Boot] [PATCH v6 0/4] usb: add Faraday EHCI & Gadget support

2013-05-12 Thread Kuo-Jung Su
From: Kuo-Jung Su 

This patch adds support to both Faraday FUSBH200 and FOTG210,
the differences between Faraday EHCI and standard EHCI are
listed bellow:

1. The PORTSC starts at 0x30 instead of 0x44.
2. The CONFIGFLAG(0x40) is not only un-implemented, and
   also has its address removed.
3. Faraday EHCI is a TDI design, but it doesn't
   compatible with the general TDI implementation
   found at both U-Boot and Linux.
4. The ISOC descriptors differs from standard EHCI in
   several ways. But since U-boot doesn't support ISOC,
   we don't have to worry about that.

The Faraday FOTG210 is an OTG chip which could operate
as either an EHCI Host or a USB Device at a time.

Changes for v6:
   - usb_hub: Simplify CONFIG_USB_HUB_MIN_POWER_ON_DELAY
 default value setup.
   - ehci-hcd: Simplify weak aliased function declaration
   - ehci-hcd: Drop redundant line feed

Changes for v5:
   - Split up EHCI changeset
   - usb_hub: replace the Faraday EHCI ifdef for the long delay
 in usb_hub_configure() with the new configuration option:
 USB_HUB_MIN_POWER_ON_DELAY, which is used in usb_hub_power_on()
 to control the minimum usb hub power-on delay.
   - ehci-faraday: fix the invalid multi-line comment style.
   - gadget-fotg210: coding style cleanup.
   - gadget-fotg210: drop postfix '__iomem' from struct fotg210_regs
   - gadget-fotg210: use permanent delay for hardware reset
   - gadget-fotg210: drop '#ifndef CONFIG_SYS_DCACHE_OFF'
   - gadget-fotg210: drop magic numbers

Changes for v4:
   - Use only macro constants and named bit/mask
   - Use weak-aliased functions for tdi implementation and
 also portsc registers to avoid poluting ehci.h with ifdefs

Changes for v3:
   - Coding Style cleanup.
   - Drop bit fields from c struct.
   - Drop macros for wirtel()/readl(), call them directly.
   - Always insert a blank line between declarations and code.
   - Replace all the infinite wait loop with a timeout.
   - Add '__iomem' to all the declaration of HW register pointers.

Changes for v2:
   - Coding Style cleanup.
   - Use readl(), writel(), clrsetbits_le32() to replace REG() macros.
   - Use structure based hardware registers to replace the macro constants.
   - Replace BIT() with BIT_MASK().
   - echi-faraday: Remove debug codes.

Kuo-Jung Su (4):
  usb: hub: make minimum power-on delay configurable
  usb: ehci: add weak-aliased functions to portsc & tdi
  usb: ehci: add Faraday USB 2.0 EHCI support
  usb: gadget: add Faraday FOTG210 USB gadget support

 README|3 +
 common/usb_hub.c  |   15 +-
 drivers/usb/gadget/Makefile   |1 +
 drivers/usb/gadget/fotg210.c  |  948 +
 drivers/usb/gadget/gadget_chips.h |8 +
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ehci-faraday.c   |  146 ++
 drivers/usb/host/ehci-hcd.c   |   96 ++--
 include/usb/fotg210.h |  364 ++
 include/usb/fusbh200.h|   61 +++
 10 files changed, 1604 insertions(+), 39 deletions(-)
 create mode 100644 drivers/usb/gadget/fotg210.c
 create mode 100644 drivers/usb/host/ehci-faraday.c
 create mode 100644 include/usb/fotg210.h
 create mode 100644 include/usb/fusbh200.h

--
1.7.9.5

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


Re: [U-Boot] [PATCH v5 1/4] usb: hub: make minimum power-on delay configurable

2013-05-12 Thread Kuo-Jung Su
2013/5/10 Marek Vasut :
> Dear Kuo-Jung Su,
>
>> From: Kuo-Jung Su 
>>
>> This patch makes the minimum power-on delay for USB HUB
>> become configurable. The original design waits at least
>> 100 msec here, but some EHCI controlers(e.g. Faraday EHCI)
>> are known to require much longer delay interval.
>>
>> NOTE:
>> The minimal delay is still 100 msec, a small value defined
>> in CONFIG_USB_HUB_MIN_POWER_ON_DELAY would be automatically
>> justified in common/usb_hub.c.
>>
>> Signed-off-by: Kuo-Jung Su 
>> CC: Marek Vasut 
>> ---
>> Changes for v5:
>>- Split up from Faraday EHCI patch
>>- Replace the Faraday EHCI ifdef for the long delay
>>  in usb_hub_configure() with the new configuration option:
>>  USB_HUB_MIN_POWER_ON_DELAY, which is used in usb_hub_power_on()
>>  to control the minimum usb hub power-on delay.
>>
>> Changes for v2 - v4:
>>- See 'usb: ehci: add Faraday USB 2.0 EHCI support'
>>
>>  README   |3 +++
>>  common/usb_hub.c |8 +++-
>>  2 files changed, 10 insertions(+), 1 deletion(-)
>>
>> diff --git a/README b/README
>> index 0d37d56..c70a59b 100644
>> --- a/README
>> +++ b/README
>> @@ -1244,6 +1244,9 @@ The following options need to be configured:
>>   CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
>>   txfilltuning field in the EHCI controller on reset.
>>
>> + CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum
>> + interval for usb hub power-on delay.(minimum 100msec)
>> +
>>  - USB Device:
>>   Define the below if you wish to use the USB console.
>>   Once firmware is rebuilt from a serial console issue the
>> diff --git a/common/usb_hub.c b/common/usb_hub.c
>> index b5eeb62..0db3530 100644
>> --- a/common/usb_hub.c
>> +++ b/common/usb_hub.c
>> @@ -61,6 +61,12 @@
>>  #define USB_HUB_DEBUG0
>>  #endif
>>
>> +#if CONFIG_USB_HUB_MIN_POWER_ON_DELAY > 100
>> +# define USB_HUB_MIN_POWER_ON_DELAY  CONFIG_USB_HUB_MIN_POWER_ON_DELAY
>> +#else
>> +# define USB_HUB_MIN_POWER_ON_DELAY  100
>> +#endif
>
> Even better (and easier) solution here would be:
>
> ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY
> #define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 100
> #endif
>
> no ? ;-)
>

Yep, it looks better, I'll have it fixed.

>>  #define USB_PRINTF(fmt, args...) debug_cond(USB_DEBUG, fmt, ##args)
>>  #define USB_HUB_PRINTF(fmt, args...) debug_cond(USB_HUB_DEBUG, fmt,
>> ##args)
>>
>> @@ -121,7 +127,7 @@ static void usb_hub_power_on(struct usb_hub_device
>> *hub) }
>>
>>   /* Wait at least 100 msec for power to become stable */
>> - mdelay(max(pgood_delay, (unsigned)100));
>> + mdelay(max(pgood_delay, USB_HUB_MIN_POWER_ON_DELAY));
>>  }
>>
>>  void usb_hub_reset(void)
>> --
>> 1.7.9.5
>
> Best regards,
> Marek Vasut



--
Best wishes,
Kuo-Jung Su
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 2/4] usb: ehci: add weak-aliased functions to portsc & tdi

2013-05-12 Thread Kuo-Jung Su
2013/5/10 Marek Vasut :
> Dear Kuo-Jung Su,
>
>> From: Kuo-Jung Su 
>>
>> There is at least one non-EHCI compliant controller (i.e. Faraday EHCI)
>> known to implement a non-standard TDI stuff.
>> Futhermore, it not only leave reserved and CONFIGFLAG registers
>> un-implemented but also has their address spaces removed.
>>
>> And thus, we need weak-aliased functions to both TDI stuff
>> and PORTSC registers for interface abstraction.
>>
>> Signed-off-by: Kuo-Jung Su 
>> CC: Marek Vasut 
>> ---
>> Changes for v5:
>>- Split up from Faraday EHCI patch
>>
>> Changes for v2 - v4:
>>- See 'usb: ehci: add Faraday USB 2.0 EHCI support'
>>
>>  drivers/usb/host/ehci-hcd.c |  100
>> +++ 1 file changed, 64
>> insertions(+), 36 deletions(-)
>>
>> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
>> index c816878..b334173 100644
>> --- a/drivers/usb/host/ehci-hcd.c
>> +++ b/drivers/usb/host/ehci-hcd.c
>> @@ -117,10 +117,50 @@ static struct descriptor {
>>  };
>>
>>  #if defined(CONFIG_EHCI_IS_TDI)
>> -#define ehci_is_TDI()(1)
>> -#else
>> -#define ehci_is_TDI()(0)
>> +# define ehci_is_TDI()   (1)
>> +
>> +/* put TDI/ARC silicon into EHCI mode */
>> +void __ehci_tdi_reset(struct ehci_hcor *hcor)
>> +{
>> + uint32_t tmp, *reg_ptr;
>> +
>> + reg_ptr = (uint32_t *)((uint8_t *) + USBMODE);
>> + tmp = ehci_readl(reg_ptr);
>> + tmp |= USBMODE_CM_HC;
>> +#if defined(CONFIG_EHCI_MMIO_BIG_ENDIAN)
>> + tmp |= USBMODE_BE;
>>  #endif
>> + ehci_writel(reg_ptr, tmp);
>> +}
>> +
>> +void ehci_tdi_reset(struct ehci_hcor *hcor)
>> + __attribute__((weak, alias("__ehci_tdi_reset")));
>
> Just wrap this into simple
>
> __weak void ehci_tdi_reset(struct ehci_hcor *hcor)
> {
> ...body of __ehci_tdi_reset() above ...
> }
>
> it's the same thing as those two functions above, but without so much code ;-)
>
> if it doesn't work, include , same below.
>

Got it, thanks

>> +int __ehci_port_speed(struct ehci_hcor *hcor, unsigned int portsc)
>> +{
>> + int ret = 0;
>> +
>> + switch (PORTSC_PSPD(portsc)) {
>> + case PORTSC_PSPD_FS:
>> + break;
>> + case PORTSC_PSPD_LS:
>> + ret = USB_PORT_STAT_LOW_SPEED;
>> + break;
>> + case PORTSC_PSPD_HS:
>> + default:
>> + ret = USB_PORT_STAT_HIGH_SPEED;
>> + break;
>> + }
>> +
>> + return ret;
>> +}
>> +
>> +int ehci_port_speed(struct ehci_hcor *hcor, unsigned int portsc)
>> + __attribute__((weak, alias("__ehci_port_speed")));
>> +
>> +#else  /* CONFIG_EHCI_IS_TDI */
>> +# define ehci_is_TDI()   (0)
>> +#endif /* CONFIG_EHCI_IS_TDI */
>>
>>  void __ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
>>  {
>> @@ -149,8 +189,6 @@ static int handshake(uint32_t *ptr, uint32_t mask,
>> uint32_t done, int usec) static int ehci_reset(int index)
>>  {
>>   uint32_t cmd;
>> - uint32_t tmp;
>> - uint32_t *reg_ptr;
>>   int ret = 0;
>>
>>   cmd = ehci_readl(&ehcic[index].hcor->or_usbcmd);
>> @@ -163,15 +201,8 @@ static int ehci_reset(int index)
>>   goto out;
>>   }
>>
>> - if (ehci_is_TDI()) {
>> - reg_ptr = (uint32_t *)((u8 *)ehcic[index].hcor + USBMODE);
>> - tmp = ehci_readl(reg_ptr);
>> - tmp |= USBMODE_CM_HC;
>> -#if defined(CONFIG_EHCI_MMIO_BIG_ENDIAN)
>> - tmp |= USBMODE_BE;
>> -#endif
>> - ehci_writel(reg_ptr, tmp);
>> - }
>> + if (ehci_is_TDI())
>> + ehci_tdi_reset(ehcic[index].hcor);
>>
>>  #ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
>>   cmd = ehci_readl(&ehcic[index].hcor->or_txfilltuning);
>> @@ -597,6 +628,18 @@ static inline int min3(int a, int b, int c)
>>   return a;
>>  }
>>
>> +uint32_t *__ehci_get_portsc_register(struct ehci_hcor *hcor, int port)
>> +{
>> + if (port >= CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
>> + printf("The request port(%d) is not configured\n", port);
>> + return NULL;
>> + }
>> +
>> + return (uint32_t *)&hcor->or_portsc[port];
>> +}
>> +uint32_t *ehci_get_portsc_register(struct ehci_hcor *hcor, int port)
>> + __attribute__((weak, alias("__ehci_get_portsc_register")));
>> +
>>  int
>>  ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
>>int length, struct devrequest *req)
>> @@ -609,13 +652,10 @@ ehci_submit_root(struct usb_device *dev, unsigned
>> long pipe, void *buffer, uint32_t *status_reg;
>>   struct ehci_ctrl *ctrl = dev->controller;
>>
>> - if (le16_to_cpu(req->index) > CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
>> - printf("The request port(%d) is not configured\n",
>> - le16_to_cpu(req->index) - 1);
>> + status_reg = ehci_get_portsc_register(ctrl->hcor,
>> + le16_to_cpu(req->index) - 1);
>> + if (!status_reg)
>>   return -1;
>> - }
>> - status_reg = (uint32_t *)&ctrl->hcor->or_po

[U-Boot] [PATCH] wandboard: fix typo in README

2013-05-12 Thread Luka Perkov
Fix typo in wandboard README file.

Signed-off-by: Luka Perkov 
---
 board/wandboard/README | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/board/wandboard/README b/board/wandboard/README
index e0b0b33..ce83bbe 100644
--- a/board/wandboard/README
+++ b/board/wandboard/README
@@ -14,12 +14,12 @@ Building U-boot for Wandboard
 
 To build U-Boot for the Wandboard Dual Lite version:
 
-$ make wanboard_dl_config
+$ make wandboard_dl_config
 $ make
 
 To build U-Boot for the Wandboard Solo version:
 
-$ make wanboard_solo_config
+$ make wandboard_solo_config
 $ make
 
 Flashing U-boot into the SD card
-- 
1.8.2.2

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


Re: [U-Boot] [PATCH 6/6] am335x_evm: Add support to boot from NOR.

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 >> Why not use SPL when booting from NOR as well? You still want to 
 >> relocate into DDR.

 Tom> Frankly, I'm allergic to SPL for NOR.  It's the historical and well
 Tom> understood case, we're r/o until we move from flash to DDR.  And it is
 Tom> fast enough here at least that it doesn't seem like we'd gain on
 Tom> falcon mode like we do on other medium.

Ok. It would be good to mention this in the commit message.

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


Re: [U-Boot] [PATCH 6/6] am335x_evm: Add support to boot from NOR.

2013-05-12 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 05/12/2013 05:34 PM, Peter Korsgaard wrote:
>> "Tom" == Tom Rini  writes:
> 
> Tom> From: Steve Kipisz  Tom> NOR requires that 
> s_init be within the first 4KiB of the image so that Tom> we can 
> perform the rest of the required pinmuxing to talk with the rest 
> Tom> of NOR that we are found on.  When NOR_BOOT is set we save our
> Tom> environment in NOR at 512KiB and a redundant copy at 768KiB.
> 
> Why not use SPL when booting from NOR as well? You still want to 
> relocate into DDR.

Frankly, I'm allergic to SPL for NOR.  It's the historical and well
understood case, we're r/o until we move from flash to DDR.  And it is
fast enough here at least that it doesn't seem like we'd gain on
falcon mode like we do on other medium.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRkAy9AAoJENk4IS6UOR1WxigP/1S8n8bVGDSsBR89VR3ned+9
MXaIGwzm449ifV28VI0R8NrnEi/GLrcPBVBdaKkaJuHI/rsApX4hAmYxYIVT7JeK
mCPARP/ZxLoGWLqsfTMqfuoGcqzhBU0tOWHZ2WiGr/lf3ChMR4yw/O/HjD1R4Ew+
46EVMfgte5AQ11Xv47vdMrG8i15WbPDqotYA/gRUlz/bpBGSXkZpmFHyXzfH7NE2
3buO3V+Z76dLUMaWgetFg5gGtbJ6EVhC1oZKWgPym46h63HwMhhtl8APGS1goE+j
8ilKilQZEKQz9bh4t3jhQcCYqvG3YFY/xvjq10dviujVBD173dd4AI63S0PyN3gV
1m1nwdlkUZfGQqsQpq2fiJ2MgD78hKomsrszz6+Rqdy20bDTdWQXERjTUWnc2UGg
tcF2OzIe63W+RFgnY+9jkYsYnj+NofJYgeD2prFc5/mT5ObPeQKSUQ7c5ZMMjibo
aZ+XwknoBjv76YgPzdUZADkazqnbHiXf0ulPjpviOjSK9Gh+WhLArTQuwQkWjGEi
1CTlvJspb8UcxNycNl9sYdVVtRNO/80UM/vwjvwPHsrsdSUQuo0GVcuhq/YQxhw6
CnA2jUFLsODdROauLTdee5e1F2tZKtGSFWe6qy09C5kTWoc+9g3HN0ix+Q64JSVO
nN3t5RKPCLleQxV0V44E
=lkA1
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 6/6] am335x_evm: Add support to boot from NOR.

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 Tom> From: Steve Kipisz 
 Tom> NOR requires that s_init be within the first 4KiB of the image so that
 Tom> we can perform the rest of the required pinmuxing to talk with the rest
 Tom> of NOR that we are found on.  When NOR_BOOT is set we save our
 Tom> environment in NOR at 512KiB and a redundant copy at 768KiB.

Why not use SPL when booting from NOR as well? You still want to
relocate into DDR.


 Tom> Signed-off-by: Steve Kipisz 
 Tom> Signed-off-by: Tom Rini 
 Tom> ---
 Tom>  arch/arm/cpu/armv7/am33xx/emif4.c |6 +-
 Tom>  board/ti/am335x/Makefile  |2 +-
 Tom>  board/ti/am335x/board.c   |   31 ++-
 Tom>  board/ti/am335x/mux.c |6 +-
 Tom>  board/ti/am335x/u-boot.lds|  110 
+
 Tom>  boards.cfg|1 +
 Tom>  include/configs/am335x_evm.h  |   27 -
 Tom>  7 files changed, 174 insertions(+), 9 deletions(-)
 Tom>  create mode 100644 board/ti/am335x/u-boot.lds

 Tom> diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c 
b/arch/arm/cpu/armv7/am33xx/emif4.c
 Tom> index aa84e96..370230b 100644
 Tom> --- a/arch/arm/cpu/armv7/am33xx/emif4.c
 Tom> +++ b/arch/arm/cpu/armv7/am33xx/emif4.c
 Tom> @@ -43,9 +43,11 @@ void dram_init_banksize(void)
 Tom>  }
 
 
 Tom> -#ifdef CONFIG_SPL_BUILD
 Tom> +#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 Tom> +#ifdef CONFIG_TI81XX
 Tom>  static struct dmm_lisa_map_regs *hw_lisa_map_regs =
 Tom>   (struct dmm_lisa_map_regs *)DMM_BASE;
 Tom> +#endif
 Tom>  static struct vtp_reg *vtpreg[2] = {
 Tom>   (struct vtp_reg *)VTP0_CTRL_ADDR,
 Tom>   (struct vtp_reg *)VTP1_CTRL_ADDR};
 Tom> @@ -53,6 +55,7 @@ static struct vtp_reg *vtpreg[2] = {
 Tom>  static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR;
 Tom>  #endif
 
 Tom> +#ifdef CONFIG_TI81XX
 Tom>  void config_dmm(const struct dmm_lisa_map_regs *regs)
 Tom>  {
 Tom>   enable_dmm_clocks();
 Tom> @@ -67,6 +70,7 @@ void config_dmm(const struct dmm_lisa_map_regs *regs)
 Tom>   writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1);
 Tom>   writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0);
 Tom>  }
 Tom> +#endif
 
 Tom>  static void config_vtp(int nr)
 Tom>  {
 Tom> diff --git a/board/ti/am335x/Makefile b/board/ti/am335x/Makefile
 Tom> index 67a87a1..1795e3e 100644
 Tom> --- a/board/ti/am335x/Makefile
 Tom> +++ b/board/ti/am335x/Makefile
 Tom> @@ -18,7 +18,7 @@ include $(TOPDIR)/config.mk
 
 Tom>  LIB  = $(obj)lib$(BOARD).o
 
 Tom> -ifdef CONFIG_SPL_BUILD
 Tom> +ifeq ($(CONFIG_SPL_BUILD)$(CONFIG_NOR_BOOT),y)
 Tom>  COBJS:= mux.o
 Tom>  endif
 
 Tom> diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
 Tom> index 6f6b5d0..a0ad4bc 100644
 Tom> --- a/board/ti/am335x/board.c
 Tom> +++ b/board/ti/am335x/board.c
 Tom> @@ -38,7 +38,7 @@
 Tom>  DECLARE_GLOBAL_DATA_PTR;
 
 Tom>  static struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
 Tom> -#ifdef CONFIG_SPL_BUILD
 Tom> +#if defined(CONFIG_SPL_BUILD) || (CONFIG_NOR_BOOT)
 Tom>  static struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
 Tom>  #endif
 
 Tom> @@ -94,7 +94,7 @@ static int read_eeprom(struct am335x_baseboard_id 
*header)
 Tom>  }
 
 Tom>  /* UART Defines */
 Tom> -#ifdef CONFIG_SPL_BUILD
 Tom> +#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 Tom>  #define UART_RESET   (0x1 << 1)
 Tom>  #define UART_CLK_RUNNING_MASK0x1
 Tom>  #define UART_SMART_IDLE_EN   (0x1 << 0x3)
 Tom> @@ -273,6 +273,24 @@ void s_init(void)
 Tom>  {
 Tom>   __maybe_unused struct am335x_baseboard_id header;
 
 Tom> + /*
 Tom> +  * The ROM will only have set up sufficient pinmux to allow for the
 Tom> +  * first 4KiB NOR to be read, we must finish doing what we know of
 Tom> +  * the NOR mux in this space in order to continue.
 Tom> +  */
 Tom> +#ifdef CONFIG_NOR_BOOT
 Tom> + asm("stmfd  sp!, {r2 - r4}");
 Tom> + asm("movw   r4, #0x8A4");
 Tom> + asm("movw   r3, #0x44E1");
 Tom> + asm("orrr4, r4, r3, lsl #16");
 Tom> + asm("movr2, #9");
 Tom> + asm("movr3, #8");
 Tom> + asm("gpmc_mux:  str r2, [r4], #4");
 Tom> + asm("subs   r3, r3, #1");
 Tom> + asm("bnegpmc_mux");
 Tom> + asm("ldmfd  sp!, {r2 - r4}");
 Tom> +#endif
 Tom> +
 Tom>   /* WDT1 is already running when the bootloader gets control
 Tom>* Disable it to avoid "random" resets
 Tom>*/
 Tom> @@ -283,7 +301,7 @@ void s_init(void)
 Tom>   while (readl(&wdtimer->wdtwwps) != 0x0)
 Tom>   ;
 
 Tom> -#ifdef CONFIG_SPL_BUILD
 Tom> +#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_NOR_BOOT)
 Tom>   /* Setup the PLLs and the clocks for the peripherals */
 Tom>   pll_init();
 
 Tom> @@ -324,9 +342,16 @@ void s_init(void)
 Tom>   regVal |= UART_SMART_IDLE_EN;
 Tom>   writel(regVal, &uart_base->uartsyscfg);
 
 Tom> +#if defined(CONFIG_NOR_BOOT)
 Tom> + /* We want

Re: [U-Boot] [PATCH 5/6] am335x_evm:Add support for the NOR module on the memory cape

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

Space missing after ':' in subject.

 Tom> From: Steve Kipisz 
 Tom> This patch adds support for the NOR module that attaches
 Tom> to the memory cape for a Beaglebone board. This does not
 Tom> add booting support; only support so that you can boot from
 Tom> SD/MMC and see the NOR module so that it can be programmed.

 Tom> Signed-off-by: Steve Kipisz 
 Tom> [trini: Clean up config changes slightly]
 Tom> Signed-off-by: Tom Rini 
 Tom> ---
 Tom>  arch/arm/cpu/armv7/am33xx/mem.c|   30 +-
 Tom>  arch/arm/include/asm/arch-am33xx/mem.h |9 ++
 Tom>  board/ti/am335x/mux.c  |   53 

 Tom>  boards.cfg |1 +
 Tom>  include/configs/am335x_evm.h   |   28 +
 Tom>  5 files changed, 120 insertions(+), 1 deletion(-)

 Tom> diff --git a/arch/arm/cpu/armv7/am33xx/mem.c 
b/arch/arm/cpu/armv7/am33xx/mem.c
 Tom> index b86b0de..e46201a 100644
 Tom> --- a/arch/arm/cpu/armv7/am33xx/mem.c
 Tom> +++ b/arch/arm/cpu/armv7/am33xx/mem.c
 Tom> @@ -46,6 +46,19 @@ static const u32 gpmc_m_nand[GPMC_MAX_REG] = {
 Tom>  };
 Tom>  #endif
 
 Tom> +#if defined(CONFIG_CMD_FLASH)
 Tom> +static const u32 gpmc_nor[GPMC_MAX_REG] = {
 Tom> + STNOR_GPMC_CONFIG1,
 Tom> + STNOR_GPMC_CONFIG2,
 Tom> + STNOR_GPMC_CONFIG3,
 Tom> + STNOR_GPMC_CONFIG4,
 Tom> + STNOR_GPMC_CONFIG5,
 Tom> + STNOR_GPMC_CONFIG6,
 Tom> + STNOR_GPMC_CONFIG7
 Tom> +};

These values (and the gmpc_m_nand ones) are platform specific, right? It
would be nicer to have them in the board file than here, similar to how
I did for the ddr settings some time ago.


 Tom> +
 Tom> +#define GPMC_CS 0
 Tom> +#endif
 
 Tom>  void enable_gpmc_cs_config(const u32 *gpmc_config, struct gpmc_cs *cs, 
u32 base,
 Tom>   u32 size)
 Tom> @@ -75,16 +88,22 @@ void gpmc_init(void)
 Tom>   /* putting a blanket check on GPMC based on ZeBu for now */
 Tom>   gpmc_cfg = (struct gpmc *)GPMC_BASE;
 
 Tom> -#ifdef CONFIG_CMD_NAND
 Tom> +#if defined(CONFIG_CMD_NAND) || defined(CONFIG_NOR)
 Tom>   const u32 *gpmc_config = NULL;
 Tom>   u32 base = 0;
 Tom>   u32 size = 0;
 Tom>  #endif
 Tom>   /* global settings */
 Tom>   writel(0x0008, &gpmc_cfg->sysconfig);
 Tom> +#ifdef CONFIG_NOR
 Tom> + writel(0x, &gpmc_cfg->irqstatus);
 Tom> + writel(0x, &gpmc_cfg->irqenable);
 Tom> + writel(0x0A00, &gpmc_cfg->config);
 Tom> +#else
 Tom>   writel(0x0100, &gpmc_cfg->irqstatus);
 Tom>   writel(0x0100, &gpmc_cfg->irqenable);
 Tom>   writel(0x0012, &gpmc_cfg->config);
 Tom> +#endif

So now you cannot E.G. have a single binary working on both the nand
flash of the evm and beaglebone? That's not really nice.

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


Re: [U-Boot] [PATCH 2/6] am335x_evm: Add MTDPARTS info for SPI flash

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 Tom> Signed-off-by: Tom Rini 
 Tom> ---
 Tom>  include/configs/am335x_evm.h |7 +++
 Tom>  1 file changed, 7 insertions(+)

 Tom> diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
 Tom> index 945ec09..004a06a 100644
 Tom> --- a/include/configs/am335x_evm.h
 Tom> +++ b/include/configs/am335x_evm.h
 Tom> @@ -436,6 +436,13 @@
 Tom>  # define CONFIG_ENV_SPI_MAX_HZ   CONFIG_SF_DEFAULT_SPEED
 Tom>  # define CONFIG_ENV_OFFSET   (892 << 10) /* 892 KiB in */
 Tom>  # define CONFIG_ENV_SECT_SIZE(4 << 10) /* 4 KB sectors */
 Tom> +#define CONFIG_CMD_MTDPARTS
 Tom> +#define MTDIDS_DEFAULT   "nor0=physmap-flash.0"
 Tom> +#define MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:128k(SPL)," \

physmap for a spi flash? I would have expected to see m25p80?


 Tom> + "128k(SPL.backup1)," \
 Tom> + "128k(SPL.backup2)," \
 Tom> + "128k(SPL.backup3),384k(u-boot)," \
 Tom> + "4k(u-boot-env),3464k(kernel),-(rootfs)"
 Tom>  #endif /* SPI support */
 
 Tom>  /* Unsupported features */
 Tom> -- 
 Tom> 1.7.9.5

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


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


Re: [U-Boot] [PATCH 3/6] am335x_evm: Only set CONFIG_NAND when !CONFIG_SPI_BOOT

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 Tom> Due to hardware design, we can't have NAND present (as we know of NAND
 Tom> today) when booting from SPI, so disable NAND then as that simplifies
 Tom> logic.

Sorry, this description is not clear to me. I didn't check in detail,
but as far as I remember the default pins for spi0 don't conflict with
gmpc.

It's also not quite clear to me if you refer to SW support for NAND
flash or the hardware component when you say 'NAND' above.


 Tom> Signed-off-by: Tom Rini 
 Tom> ---
 Tom>  include/configs/am335x_evm.h |9 +++--
 Tom>  1 file changed, 7 insertions(+), 2 deletions(-)

 Tom> diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
 Tom> index 004a06a..90cc1f5 100644
 Tom> --- a/include/configs/am335x_evm.h
 Tom> +++ b/include/configs/am335x_evm.h
 Tom> @@ -230,7 +230,9 @@
 Tom>  /* USB Device Firmware Update support */
 Tom>  #define CONFIG_DFU_FUNCTION
 Tom>  #define CONFIG_DFU_MMC
 Tom> +#ifdef CONFIG_NAND
 Tom>  #define CONFIG_DFU_NAND
 Tom> +#endif
 Tom>  #define CONFIG_CMD_DFU
 Tom>  #define DFU_ALT_INFO_MMC \
 Tom>   "boot part 0 1;" \
 Tom> @@ -335,6 +337,7 @@
 Tom>  #define CONFIG_SPL_LDSCRIPT  
"$(CPUDIR)/am33xx/u-boot-spl.lds"
 
 Tom>  #define CONFIG_SPL_BOARD_INIT
 Tom> +#ifdef CONFIG_NAND
 Tom>  #define CONFIG_SPL_NAND_AM33XX_BCH
 Tom>  #define CONFIG_SPL_NAND_SUPPORT
 Tom>  #define CONFIG_SPL_NAND_BASE
 Tom> @@ -365,6 +368,7 @@
 Tom>  #define  CONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE
 
 Tom>  #define CONFIG_SYS_NAND_U_BOOT_OFFS  0x8
 Tom> +#endif
 
 Tom>  /*
 Tom>   * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
 Tom> @@ -466,7 +470,10 @@
 Tom>  #define CONFIG_PHY_ADDR  0
 Tom>  #define CONFIG_PHY_SMSC
 
 Tom> +#if !defined(CONFIG_SPI_BOOT)
 Tom>  #define CONFIG_NAND
 Tom> +#endif
 Tom> +
 Tom>  /* NAND support */
 Tom>  #ifdef CONFIG_NAND
 Tom>  #define CONFIG_CMD_NAND
 Tom> @@ -484,11 +491,9 @@
 Tom>   /* CS0 */
 Tom>  #define CONFIG_SYS_MAX_NAND_DEVICE   1   /* Max number 
of NAND
 Tom>  devices */
 Tom> -#if !defined(CONFIG_SPI_BOOT)
 Tom>  #define CONFIG_ENV_IS_IN_NAND
 Tom>  #define CONFIG_ENV_OFFSET0x26 /* environment starts 
here */
 Tom>  #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
 Tom>  #endif
 Tom> -#endif
 
 Tom>  #endif   /* ! __CONFIG_AM335X_EVM_H */
 Tom> -- 
 Tom> 1.7.9.5

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


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


Re: [U-Boot] [PATCH 1/6] am335x_evm: Drop useless CONFIG_ENV_IS_NOWHERE

2013-05-12 Thread Peter Korsgaard
> "Tom" == Tom Rini  writes:

 Tom> We always set a CONFIG_ENV_IS_...somewhere... so drop the initial define
 Tom> of NOWHERE.

 Tom> Signed-off-by: Tom Rini 

Reviewed-by: Peter Korsgaard 

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


Re: [U-Boot] [PATCH 2/2 v12] Introduced btrfs file-system with btrload command

2013-05-12 Thread Wolfgang Denk
Dear Adnan Ali,

In message <81c88340404a46b9a36590eded5e3...@codethink.co.uk> you wrote:
>
> >> > - Compare the code for crc32c_cal() in the patch with the 
> >> definition
> >> >of DO_CRC(x) in "lib/crc32.c" - to me, it appears to be the 
> >> same for
> >> >little endian code (it is redundant?), but different for big 
> >> endian
> >> >systems - which raises the question if this code has ever been
> >> >tested on a BE machine?
> >>  My code uses lib/crc32.c and i have only tested it on
> >>mx53loco manchine.
> >
> > I tend to believe thatit will not work on a big endian system, then.
>   Sorry I meant to say my code uses lib/crc32_c.c. The lib/crc32.c
>   is main line so you think main line code is not for big endian.
>   What can i say.

What exactly do you mean by "my code uses lib/crc32_c.c?  I was
referring to the crc32c_cal() funciton in your patch.  It is this
function where I think it will fail on BE systems.

> >> > - The code claims to be derived from "Linux kernel 
> >> crypto/crc32c.c";
> >> >but I cannot find such code in that file.
> >>I think yes but part of part from syslinux. I have also added
> >>  SHA1 of commit so don't know.
> >
> > Please provide an exact reference where this code is coming from.
> Just clone syslinux and code is in ~/syslinux/core/fs/btrfs/crc32c.h

The pelase fix the comment, and provide exact reference (commit ID
etc. as described at bullet # 4 at [1]) for that code.

[1] http://www.denx.de/wiki/view/U-Boot/Patches#Attributing_Code_Copyrights_Sign

> >> > - The implementation of crc32c_cal() suffers from a few other problems
> >> >(like not triggering the watchdog, which will cause problems on
> >> >systems that use one).
> >>I think that is true as its not using main line crc32 code.
> >
> > We probably should do that, then.
>To use that code probably i need to create static crc32 table.

Indeed.  This should also reduce boot time.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Real computer scientists don't comment their  code.  The  identifiers
are so long they can't afford the disk space.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, 2/2] arm: at91: add at91sam9g20ek_mmc_config, which can save environment in mmc card

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Signed-off-by: Josh Wu 
>
>---
>boards.cfg  |1 +
> include/configs/at91sam9260ek.h |   18 +-
> 2 files changed, 18 insertions(+), 1 deletion(-)

applied to u-boot-atmel/master, thanks!

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


[U-Boot] [PULL] please pull u-boot-atmel/master

2013-05-12 Thread Andreas Bießmann
Dear Albert Aribaud,

please pull the following changes from u-boot-atmel/master into
u-boot-arm/master.

The following changes since commit cac423a730d3506154744485af1bbc1cd3a1e6a8:

  Merge branch 'u-boot-ti/master' into 'u-boot-arm/master' (2013-05-11 22:24:28 
+0200)

are available in the git repository at:


  git://git.denx.de/u-boot-atmel.git master

for you to fetch changes up to d0a51373131c4ba565a2391d5ed78b87c406ce98:

  at91sam9260ek: move board id setup to config header (2013-05-12 16:49:14 
+0200)


Andreas Bießmann (1):
  at91sam9260ek: move board id setup to config header

Bo Shen (3):
  spi: atmel_spi: using ip version to check whether has wdrbt
  mmc: atmel_mci: using IP version for different setting
  mmc: atmel_mci: add mmc card support

Wu, Josh (4):
  arm: at91: add at91sam9n12 register definition
  arm: at91: add at91sam9n12ek board support
  arm: at91: enable mci support for at91sam9g20ek.
  arm: at91: add at91sam9g20ek_mmc_config, which can save environment in 
mmc card

 MAINTAINERS|3 +
 arch/arm/cpu/arm926ejs/at91/Makefile   |1 +
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c  |4 +
 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c  |  177 +++
 arch/arm/cpu/arm926ejs/at91/clock.c|4 +-
 arch/arm/include/asm/arch-at91/at91_common.h   |1 +
 arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |2 +-
 arch/arm/include/asm/arch-at91/at91sam9x5.h|   19 +-
 arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 +-
 arch/arm/include/asm/arch-at91/hardware.h  |2 +-
 board/atmel/at91sam9260ek/at91sam9260ek.c  |   22 +-
 board/atmel/at91sam9n12ek/Makefile |   52 +
 board/atmel/at91sam9n12ek/at91sam9n12ek.c  |  228 +++
 boards.cfg |4 +
 drivers/mmc/gen_atmel_mci.c|   47 +++-
 drivers/spi/atmel_spi.c|   15 +-
 drivers/spi/atmel_spi.h|2 +-
 include/atmel_mci.h|2 +
 include/configs/at91sam9260ek.h|   52 -
 include/configs/at91sam9n12ek.h|  232 
 20 files changed, 852 insertions(+), 34 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c
 create mode 100644 board/atmel/at91sam9n12ek/Makefile
 create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c
 create mode 100644 include/configs/at91sam9n12ek.h
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot,v2] at91sam9260ek: move board id setup to config header

2013-05-12 Thread Andreas Bießmann
Dear Andreas Bießmann,

Andreas Bießmann  writes:
>Signed-off-by: Andreas Bießmann 
>Acked-by: Bo Shen 
>
>---
>Changes in v2:
> * use only one ifdef for sam9G variants
>
> board/atmel/at91sam9260ek/at91sam9260ek.c |   12 
> include/configs/at91sam9260ek.h   |   18 ++
> 2 files changed, 18 insertions(+), 12 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,2/2] mmc: atmel_mci: add mmc card support

2013-05-12 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen  writes:
>add mmc card support with atmel mci driver
>
>Signed-off-by: Bo Shen 
>
>---
>drivers/mmc/gen_atmel_mci.c |5 -
> 1 file changed, 4 insertions(+), 1 deletion(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,1/2] mmc: atmel_mci: using IP version for different setting

2013-05-12 Thread Andreas Bießmann
Dear Bo Shen,

Bo Shen  writes:
>Using IP version for different setting
>  - Higher version supports 8bit mode
>  - Higher version bus width setting is different
>
>Signed-off-by: Bo Shen 
>
>---
>drivers/mmc/gen_atmel_mci.c |   42 ++
> include/atmel_mci.h |2 ++
> 2 files changed, 40 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,1/2] arm: at91: enable mci support for at91sam9g20ek.

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Signed-off-by: Josh Wu 
>
>---
>arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |4 
> board/atmel/at91sam9260ek/at91sam9260ek.c |   10 ++
> include/configs/at91sam9260ek.h   |   16 ++--
> 3 files changed, 28 insertions(+), 2 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,v4,3/3] arm: at91: add at91sam9n12ek board support

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Add support for following features:
>  - nand boot, with PMECC 2bit ECC for 512 bytes sector
>  - SPI flash boot
>  - SD card boot
>  - LCD support
>
>Signed-off-by: Josh Wu 
>[fix -Wimplicit-function-declaration for at91_lcd_hw_init()]
>Signed-off-by: Andreas Bießmann 
>---
> MAINTAINERS   |3 +
> arch/arm/cpu/arm926ejs/at91/Makefile  |1 +
> arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c |  177 
> arch/arm/cpu/arm926ejs/at91/clock.c   |4 +-
> arch/arm/include/asm/arch-at91/at91_common.h  |1 +
> board/atmel/at91sam9n12ek/Makefile|   52 +
> board/atmel/at91sam9n12ek/at91sam9n12ek.c |  228 
> boards.cfg|3 +
> include/configs/at91sam9n12ek.h   |  232 +
> 9 files changed, 699 insertions(+), 2 deletions(-)
> create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c
> create mode 100644 board/atmel/at91sam9n12ek/Makefile
> create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c
> create mode 100644 include/configs/at91sam9n12ek.h

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,v4,2/3] arm: at91: add at91sam9n12 register definition

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Since at91sam9n12 is a subset of at91sam9x5, so put all at91sam9n12
>definitions in at91sam9x5 head file.
>
>Signed-off-by: Josh Wu 
>
>---
>arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |2 +-
> arch/arm/include/asm/arch-at91/at91sam9x5.h|   19 ---
> arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 ++---
> arch/arm/include/asm/arch-at91/hardware.h  |2 +-
> 4 files changed, 32 insertions(+), 8 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot, v4, 1/3] spi: atmel_spi: using ip version to check whether has wdrbt

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>From: Bo Shen 
>
>Using IP version to check whether it has wdrbt bit in mode register
>
>Tested in at91sam9x5ek and at91sam9n12ek.
>
>Signed-off-by: Bo Shen 
>[fix warning about incompatible parameter]
>Signed-off-by: Josh Wu 
>
>---
>changes since v3:
>  - rebase on top of atmel master tree.
>
> drivers/spi/atmel_spi.c |   15 ---
> drivers/spi/atmel_spi.h |2 +-
> 2 files changed, 13 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,v4,3/3] arm: at91: add at91sam9n12ek board support

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Add support for following features:
>  - nand boot, with PMECC 2bit ECC for 512 bytes sector
>  - SPI flash boot
>  - SD card boot
>  - LCD support
>
>Signed-off-by: Josh Wu 
>[fix -Wimplicit-function-declaration for at91_lcd_hw_init()]
>Signed-off-by: Andreas Bießmann 
>---
> MAINTAINERS   |3 +
> arch/arm/cpu/arm926ejs/at91/Makefile  |1 +
> arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c |  177 
> arch/arm/cpu/arm926ejs/at91/clock.c   |4 +-
> arch/arm/include/asm/arch-at91/at91_common.h  |1 +
> board/atmel/at91sam9n12ek/Makefile|   52 +
> board/atmel/at91sam9n12ek/at91sam9n12ek.c |  228 
> boards.cfg|3 +
> include/configs/at91sam9n12ek.h   |  232 +
> 9 files changed, 699 insertions(+), 2 deletions(-)
> create mode 100644 arch/arm/cpu/arm926ejs/at91/at91sam9n12_devices.c
> create mode 100644 board/atmel/at91sam9n12ek/Makefile
> create mode 100644 board/atmel/at91sam9n12ek/at91sam9n12ek.c
> create mode 100644 include/configs/at91sam9n12ek.h

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot,v4,2/3] arm: at91: add at91sam9n12 register definition

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>Since at91sam9n12 is a subset of at91sam9x5, so put all at91sam9n12
>definitions in at91sam9x5 head file.
>
>Signed-off-by: Josh Wu 
>
>---
>arch/arm/include/asm/arch-at91/at91sam9_matrix.h   |2 +-
> arch/arm/include/asm/arch-at91/at91sam9x5.h|   19 ---
> arch/arm/include/asm/arch-at91/at91sam9x5_matrix.h |   17 ++---
> arch/arm/include/asm/arch-at91/hardware.h  |2 +-
> 4 files changed, 32 insertions(+), 8 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [U-Boot, v4, 1/3] spi: atmel_spi: using ip version to check whether has wdrbt

2013-05-12 Thread Andreas Bießmann
Dear Josh Wu,

Josh Wu  writes:
>From: Bo Shen 
>
>Using IP version to check whether it has wdrbt bit in mode register
>
>Tested in at91sam9x5ek and at91sam9n12ek.
>
>Signed-off-by: Bo Shen 
>[fix warning about incompatible parameter]
>Signed-off-by: Josh Wu 
>
>---
>changes since v3:
>  - rebase on top of atmel master tree.
>
> drivers/spi/atmel_spi.c |   15 ---
> drivers/spi/atmel_spi.h |2 +-
> 2 files changed, 13 insertions(+), 4 deletions(-)

applied to u-boot-atmel/master, thanks!

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


Re: [U-Boot] [PATCH 2/2 v12] Introduced btrfs file-system with btrload command

2013-05-12 Thread Adnan Ali

On 2013-05-09 22:43, Wolfgang Denk wrote:

Dear Adnan Ali,

In message <518bb8c7.3090...@codethink.co.uk> you wrote:


> - Why do we have to calculate the crc32c_table[] at runtime?  Our
>regular CRC code uses a pre-calculated table; we should do the 
same

>here.
This is part of the port. But pre-calculated table can be 
manually

created.


Not manually.  It should be done at compile time, suing basically the
same code.

> - Compare the code for crc32c_cal() in the patch with the 
definition
>of DO_CRC(x) in "lib/crc32.c" - to me, it appears to be the 
same for
>little endian code (it is redundant?), but different for big 
endian

>systems - which raises the question if this code has ever been
>tested on a BE machine?
 My code uses lib/crc32.c and i have only tested it on
   mx53loco manchine.


I tend to believe thatit will not work on a big endian system, then.

 Sorry I meant to say my code uses lib/crc32_c.c. The lib/crc32.c
 is main line so you think main line code is not for big endian.
 What can i say.


> - The code claims to be derived from "Linux kernel 
crypto/crc32c.c";

>but I cannot find such code in that file.
   I think yes but part of part from syslinux. I have also added
 SHA1 of commit so don't know.


Please provide an exact reference where this code is coming from.

   Just clone syslinux and code is in ~/syslinux/core/fs/btrfs/crc32c.h



> - The implementation of crc32c_cal() suffers from a few other 
problems

>(like not triggering the watchdog, which will cause problems on
>systems that use one).
   I think that is true as its not using main line crc32 code.


We probably should do that, then.

  To use that code probably i need to create static crc32 table.


Thanks.

Wolfgang Denk


--
Thanks

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


Re: [U-Boot] [Patch v2 3/3] ARM: at91sam9n12: add network support with ksz8851_16mll

2013-05-12 Thread Andreas Bießmann

Dear Bo Shen,

On 24.04.2013 04:46, Bo Shen wrote:

add network support with ksz8851_16mll on at91sam9n12ek board

Signed-off-by: Bo Shen 


Acked-by: Andreas Bießmann 


---
Change in v2
   No change
---
  board/atmel/at91sam9n12ek/at91sam9n12ek.c |   36 +
  include/configs/at91sam9n12ek.h   |4 
  2 files changed, 40 insertions(+)

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


Re: [U-Boot] [Patch v2 4/4] ARM: atmel: add sama5d3xek support

2013-05-12 Thread Andreas Bießmann

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add sama5d3xek support with following feature
   - boot from NAND flash, PMECC support, 4bit ECC @ 512 bytes sector
   - boot from SPI flash support
   - boot from SD card support
   - LCD support
   - EMAC support
   - USB support (OHCI)


no obvious objections here, please just change order order or split the 
register definition changes out of this one.


Best regards

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


Re: [U-Boot] [Patch v2 2/4] NET: macb: support sama5d3x devices

2013-05-12 Thread Andreas Bießmann

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add macb support for sama5d3x devices

Signed-off-by: Bo Shen 
---
change in v2:
   No change
---
  drivers/net/macb.c |6 --
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 8bacbda..9e7fbc6 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -469,7 +469,8 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
  #if   defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-   defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
+   defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5) || \
+   defined(CONFIG_SAMA5D3)


I would like to apply http://patchwork.ozlabs.org/patch/239064/ instead 
of this one.

Joe, do you have any objections?

Best regards

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


Re: [U-Boot] [Patch v2 3/4] SPI: atmel_spi: support sama5d3x devices

2013-05-12 Thread Andreas Bießmann

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add WDRBT bit support for sama5d3x devices

Signed-off-by: Bo Shen 
---
Change in v2:
   no change
---
  drivers/spi/atmel_spi.c |3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
index ce7d460..5e97225 100644
--- a/drivers/spi/atmel_spi.c
+++ b/drivers/spi/atmel_spi.c
@@ -92,7 +92,8 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
as->slave.cs = cs;
as->regs = regs;
as->mr = ATMEL_SPI_MR_MSTR | ATMEL_SPI_MR_MODFDIS
-#if defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9M10G45)
+#if defined(CONFIG_AT91SAM9X5) || defined(CONFIG_AT91SAM9M10G45) || \
+   defined(CONFIG_SAMA5D3)
| ATMEL_SPI_MR_WDRBT


I will apply http://patchwork.ozlabs.org/patch/237182/ today, please 
remove this patch from series.


Best regards

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


Re: [U-Boot] [Patch v2 1/4] USB: ohci-at91: support sama5d3x devices

2013-05-12 Thread Andreas Bießmann

Dear Bo Shen,

On 12.03.2013 07:15, Bo Shen wrote:

Add OHCI support for sama5d3x devices


can you please rebase this patch and send again?



Signed-off-by: Bo Shen 
---
change in v2:
   - change #if defined to #ifdef for sama5d3
---
  drivers/usb/host/ohci-at91.c |   14 --
  1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c
index efd711d..086cd0f 100644
--- a/drivers/usb/host/ohci-at91.c
+++ b/drivers/usb/host/ohci-at91.c
@@ -42,7 +42,7 @@ int usb_cpu_init(void)
while ((readl(&pmc->sr) & AT91_PMC_LOCKB) != AT91_PMC_LOCKB)
;
  #elif defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
-   defined(CONFIG_AT91SAM9X5)
+   defined(CONFIG_AT91SAM9X5) || defined(CONFIG_SAMA5D3)
/* Enable UPLL */
writel(readl(&pmc->uckr) | AT91_PMC_UPLLEN | AT91_PMC_BIASEN,
&pmc->uckr);
@@ -54,7 +54,12 @@ int usb_cpu_init(void)
  #endif

/* Enable USB host clock. */
+#ifdef CONFIG_SAMA5D3
+   writel(1 << (ATMEL_ID_UHP - 32), &pmc->pcer1);


Please reorder the patches so that pmc->pcer1 is declared before used.

Best regards

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


Re: [U-Boot] [PATCH 2/4] arm: make __image_copy_{start, end} compiler-generated

2013-05-12 Thread Albert ARIBAUD
On Sat, 11 May 2013 22:13:51 +0200, Albert ARIBAUD
 wrote:

> Hence, if an SPL script sort-of-hardcodes image start and end (or
> relocation symbols as some do), then I prefer to leave it alone for now
> and handle in the linker script factoring series later.

... but I do realize in some cases I removed __image_copy_end and in
others I didn't. I'll go over this again in V2 by following the
rule of least change -- not doing a change unless required by the
objective of the series, that is, factoring relocate code.

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