Re: [U-Boot] Please pull u-boot-ti/master

2013-04-13 Thread Albert ARIBAUD
Hi Tom,

On Fri, 12 Apr 2013 16:47:07 -0400, Tom Rini  wrote:

> Hello,
> 
> The following changes since commit 90639feaa0d66a204f9d03a325ab14e2f97f6cbb:
> 
>   arm/km: add support for kmsuv31 board (2013-04-12 21:42:22 +0530)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-ti.git master
> 
> for you to fetch changes up to 46afd3eff3e53e29613c489af0c128203bb3c5b4:
> 
>   omap5_common.h: Switch to ext4 (2013-04-12 15:29:23 -0400)
> 
> 
> Tom Rini (2):
>   am335x: Really correct DDR timings on new BeagleBone part
>   omap5_common.h: Switch to ext4
> 
> man.hu...@arcor.de (1):
>   omap3: Display MHz instead of mHz on the console
> 
>  arch/arm/cpu/armv7/omap3/sys_info.c |4 ++--
>  arch/arm/include/asm/arch-am33xx/ddr_defs.h |   14 +++---
>  include/configs/omap5_common.h  |2 +-
>  3 files changed, 10 insertions(+), 10 deletions(-)
> 
> We have a real important fix (DDR timing, sigh), a pretty important fix
> (ext3 is bad for SD cards, use ext4) and a harmless print fixup since
> I'm in here.
> 

Applied to u-boot-arm/master, thanks!

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


[U-Boot] Transplant u-boot to Atheros AR9344

2013-04-13 Thread Rynn Chan
Hi All,

 

I have a TP-Link WDR4310, it is base Atheros AR9344 SoC, RAM size is 128MiB,
Flash size is 8MiB, I want transplant u-boot to it.

I can find CPU config file(MIPS32) in u-boot source tree, but I can't find
board config file, who can tell me, what board similar to it?

Thanks!

 

Rynn.

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


Re: [U-Boot] [PATCH 1/5] vybrid: add vybrid CPU support

2013-04-13 Thread wang alison
Hi, Fabio,


On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang  wrote:

> +static char *get_reset_cause(void)
> +{
> +   char *resetcause[32] = {"POR",
> +   "Cortex A5 WDOG Timer Reset",
> +   0,

You mix strings and an integer zero here. Shouldn't you replace the
'0' with "unknown" or "invalid" ?

[Alison] I will replace it with "unknown".

Thanks!

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


Re: [U-Boot] [PATCH 3/5] vybrid: add uart driver support

2013-04-13 Thread wang alison
Hi, Fabio,


On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang  wrote:
> This patch adds uart driver support for vybrid platform.
>
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---
>  drivers/serial/Makefile|   1 +
>  drivers/serial/serial.c|   2 +
>  drivers/serial/serial_vybrid.c | 129 
> +

Do we really need to add a new serial driver?

Can't we re-use the imx serial driver?

[Alison] I will investigate if we can re-use the imx serial driver.

Thanks!

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


Re: [U-Boot] [PATCH 5/5] vybrid: add ethernet driver support

2013-04-13 Thread wang alison
Hi, Fabio,

On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang  wrote:
> This patch adds ethernet driver support for vybrid platform.
>
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---
>  arch/arm/include/asm/fec.h| 302 
> ++
>  arch/arm/include/asm/u-boot.h |   3 +
>  drivers/net/mcffec.c  |  18 ++-
>  drivers/net/mcfmii.c  |   5 +-

Can't we use the mxc_fec driver here?

In the kernel we have only one FEC driver that is common to Coldfire,
imx and MPC.

[Alison] Agree, I will investigate it.

Thanks!

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


Re: [U-Boot] [PATCH 2/5] vybrid: add Freescale vybrid vf600 tower board support

2013-04-13 Thread wang alison
Hi, Fabio,


On Fri, Apr 12, 2013 at 3:53 AM, Alison Wang  wrote:
> This patch adds Freescale vybrid vf600 tower board support.
>
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---
>  board/freescale/vybrid/Makefile|  40 +++
>  board/freescale/vybrid/vybrid.c| 488 
> +

Vybrid is the SoC name and the board name is vf600, right?

Then you should add:

 board/freescale/vf600

[Alison] I will modify the name.

Also, please copy Stefano Babic in your future patches, as he is the
U-boot imx maintainer.
>  board/freescale/vybrid/vybridimage.cfg |  44 +++
>  boards.cfg |   2 +
>  include/configs/vybrid.h   | 284 +++
>  include/configs/vybrid_iram.h  | 284 +++
>  6 files changed, 1142 insertions(+)
>  create mode 100644 board/freescale/vybrid/Makefile  create mode
> 100644 board/freescale/vybrid/vybrid.c  create mode 100644
> board/freescale/vybrid/vybridimage.cfg
>  create mode 100644 include/configs/vybrid.h  create mode 100644
> include/configs/vybrid_iram.h

This patch should be the last of the series.

You add the board support here, but ethernet, serial, esdhc support
comes later in the patch series.

[Alison] Agree, I will reorganize the series.

Please add an entry to MAINTAINERS file.

[Alison] Ok, I will add.


> +#ifdef CONFIG_FSL_ESDHC
> +struct fsl_esdhc_cfg esdhc_cfg[2] = {
> +   {CONFIG_SYS_ESDHC1_BASE, 1},
> +   {ESDHC2_BASE_ADDR, 1},

CONFIG_ESDHC2_BASE_ADDR ?

[Alison] Yes, I will modify.

> +int dram_init(void)
> +{
> +   setup_iomux_ddr();
> +#ifdef CONFIG_SYS_UBOOT_IN_GPURAM

You introduced CONFIG_SYS_UBOOT_IN_GPURAM here and it would be nice to
add an entry into README explaining what it means.

[Alison] This macro is used in vybrid_iram configuration. It is not
necessary. I will remove it with vybrid_iram configuration.

> +   gd->ram_size = 0x8;
> +   ddr_ctrl_init();
> +#else
> +   gd->ram_size = ddr_ctrl_init(); #endif
> +   return 0;

Can't you use the standard method?

gd->ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);

[Alison] Agree, I will use the standard method.


> +#ifdef CONFIG_QUAD_SPI

CONFIG_QUAD_SPI does not exist in U-boot. Can't you re-use an existing
SPI config option?

[Alison] I will modify.

> +#ifdef CONFIG_FSL_ESDHC
> +int board_mmc_getcd(struct mmc *mmc)
> +{
> +   int ret;
> +
> +   __raw_writel(0x005031ef, IOMUXC_PAD_014);   /* clk */
> +   __raw_writel(0x005031ef, IOMUXC_PAD_015);   /* cmd */
> +   __raw_writel(0x005031ef, IOMUXC_PAD_016);   /* dat0 */
> +   __raw_writel(0x005031ef, IOMUXC_PAD_017);   /* dat1 */
> +   __raw_writel(0x005031ef, IOMUXC_PAD_018);   /* dat2 */
> +   __raw_writel(0x005031ef, IOMUXC_PAD_019);   /* dat3 */

This function should basically return the card detect status, please
setup the IOMUX in another place.

[Alison] Ok, I will rewrite these functions.

> +   ret = 1;
> +   return ret;

In this board you assume that the SD card is always present, right?

You could remove the 'ret' variable.

[Alison] Yes. I will remove it.

> diff --git a/board/freescale/vybrid/vybridimage.cfg
> b/board/freescale/vybrid/vybridimage.cfg
> new file mode 100644
> index 000..5da5659
> --- /dev/null
> +++ b/board/freescale/vybrid/vybridimage.cfg
> @@ -0,0 +1,44 @@
> +#
> +# Copyright 2012-2013 Freescale Semiconductor, Inc.
> +#
> +# 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 as #
> +published by the Free Software Foundation; 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. 51 Franklin Street Fifth Floor Boston, # MA
> +02110-1301 USA # # Refer docs/README.imxmage for more details about
> +how-to configure # and create imximage boot image # # The syntax is
> +taken as close as possible with the kwbimage
> +
> +IMAGE_VERSION  2
> +
> +# Boot Device : one of
> +# spi, sd (the board has no nand neither onenand)
> +
> +BOOT_FROM  sd
> +
> +# Device Configuration Data (DCD)
> +#
> +# Each entry must have the format:
> +# Addr-type   AddressValue
> +#
> +# where:
> +#  Addr-type register length (1,2 or 4 bytes)
> +#  Address   absolute address of the register
> +#  value value to be stored in the register
> +
> +# Setting IOMUXC

This file is suited

Re: [U-Boot] [PATCH v3] BUGFIX: arm: data abort in get_bad_stack_swi

2013-04-13 Thread Albert ARIBAUD
Hi Tetsuyuki,

On Fri,  5 Apr 2013 19:12:51 +0900, Tetsuyuki Kobayashi
 wrote:

> When swi instruction is executed, it is expected to get message
> "software interrupt" in console and dump registers and reboot, as
> do_software_interrupt() in arch/arm/lib/interrupts.c.
> But, actually it causes data abort accessing wrong address in 
> get_bad_stack_swi
> macro in arch/arm/cpu/v7/start.S.
> This patch fixes this problem.
> 
> The same mistake in arch/arm/cpu/{arm1136,arm1176,pxa}/start.S.
> 
> Signed-off-by: Tetsuyuki Kobayashi 
> ---
> Changes for v2:
> - added arch/arm/cpu/{arm1136,arm1176,pxa}/start.S
> Changes for v3:
> - restore lr register in all 4 files.
>   Only arm/arm/cpu/armv7/start.S is tested on KZM-A9-GT board.
> 
>  arch/arm/cpu/arm1136/start.S |3 ++-
>  arch/arm/cpu/arm1176/start.S |4 +++-
>  arch/arm/cpu/armv7/start.S   |3 ++-
>  arch/arm/cpu/pxa/start.S |3 ++-
>  4 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
> index eba2324..bccfdbf 100644
> --- a/arch/arm/cpu/arm1136/start.S
> +++ b/arch/arm/cpu/arm1136/start.S
> @@ -392,8 +392,9 @@ cpu_init_crit:
>   str r0, [r13]   @ save R0's value.
>   ldr r0, IRQ_STACK_START_IN  @ get data regions start
>   str lr, [r0]@ save caller lr in position 0 
> of saved stack
> - mrs r0, spsr@ get the spsr
> + mrs lr, spsr@ get the spsr
>   str lr, [r0, #4]@ save spsr in position 1 of 
> saved stack
> + ldr lr, [r0]@ restore lr
>   ldr r0, [r13]   @ restore r0
>   add r13, r13, #4@ pop stack entry
>   .endm
> diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
> index 3c291fb..694f79d 100644
> --- a/arch/arm/cpu/arm1176/start.S
> +++ b/arch/arm/cpu/arm1176/start.S
> @@ -480,9 +480,11 @@ phy_last_jump:
>   /* save caller lr in position 0 of saved stack */
>   str lr, [r0]
>   /* get the spsr */
> - mrs r0, spsr
> + mrs lr, spsr
>   /* save spsr in position 1 of saved stack */
>   str lr, [r0, #4]
> + /* restore lr */
> + ldr lr, [r0]
>   /* restore r0 */
>   ldr r0, [r13]
>   /* pop stack entry */
> diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
> index 36a4c3c..e5e157b 100644
> --- a/arch/arm/cpu/armv7/start.S
> +++ b/arch/arm/cpu/armv7/start.S
> @@ -465,9 +465,10 @@ ENDPROC(cpu_init_crit)
>   @ spots for abort stack
>   str lr, [r0]@ save caller lr in position 0
>   @ of saved stack
> - mrs r0, spsr@ get the spsr
> + mrs lr, spsr@ get the spsr
>   str lr, [r0, #4]@ save spsr in position 1 of
>   @ saved stack
> + ldr lr, [r0]@ restore lr
>   ldr r0, [r13]   @ restore r0
>   add r13, r13, #4@ pop stack entry
>   .endm
> diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
> index 456a783..9c525e8 100644
> --- a/arch/arm/cpu/pxa/start.S
> +++ b/arch/arm/cpu/pxa/start.S
> @@ -387,8 +387,9 @@ cpu_init_crit:
>   str r0, [r13]   @ save R0's value.
>   ldr r0, IRQ_STACK_START_IN  @ get data regions start
>   str lr, [r0]@ save caller lr in position 0 
> of saved stack
> - mrs r0, spsr@ get the spsr
> + mrs lr, spsr@ get the spsr
>   str lr, [r0, #4]@ save spsr in position 1 of 
> saved stack
> + ldr lr, [r0]@ restore lr
>   ldr r0, [r13]   @ restore r0
>   add r13, r13, #4@ pop stack entry
>   .endm

Applied to u-boot-arm/master, thanks!

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


Re: [U-Boot] [PATCH] Exynos5: Add support for USB download boot mode

2013-04-13 Thread Simon Glass
Hi,

On Tue, Feb 5, 2013 at 9:04 PM, Vivek Gautam  wrote:
> Hi Simon,
>
>
> On Tue, Feb 5, 2013 at 2:56 AM, Simon Glass  wrote:
>> Hi,
>>
>> On Mon, Jan 28, 2013 at 2:39 AM, Vivek Gautam  
>> wrote:
>>> Exynos5250 supports secondary USB device boot mode. If the iROM fails
>>> to download u-boot from the primary boot device (such as SD or eMMC),
>>> it will try to retrieve from the secondary boot device (such as USB).
>>>
>>> Signed-off-by: Naveen Krishna Ch 
>>> Signed-off-by: Simon Glass 
>>> Signed-off-by: Vivek Gautam 
>>
>> Acked-by: Simon Glass 
>>
>
> Thanks for reviewing.
>
>> But please see comment below.
>>
>>> ---
>>>
>>> NOTE:
>>>  - Based on 'master' branch of u-boot-samsung.
>>>  - Tested with smdk5250 for usb download mode.
>>>
>>>  board/samsung/smdk5250/spl_boot.c |   40 
>>> +++-
>>>  include/configs/exynos5250-dt.h   |5 
>>>  2 files changed, 43 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/board/samsung/smdk5250/spl_boot.c 
>>> b/board/samsung/smdk5250/spl_boot.c
>>> index d8f3c1e..c0bcf46 100644
>>> --- a/board/samsung/smdk5250/spl_boot.c
>>> +++ b/board/samsung/smdk5250/spl_boot.c
>>> @@ -32,6 +32,21 @@ enum boot_mode {
>>>  };
>>>
>>> typedef u32 (*spi_copy_func_t)(u32 offset, u32 nblock, u32 dst);
>>> +   typedef u32 (*usb_copy_func_t)(void);
>>> +
>>> +/*
>>> + * Set/clear program flow prediction and return the previous state.
>>> + */
>>> +static int config_branch_prediction(int set_cr_z)
>>> +{
>>> +   unsigned int cr;
>>> +
>>> +   /* System Control Register: 11th bit Z Branch prediction enable */
>>> +   cr = get_cr();
>>> +   set_cr(set_cr_z ? cr | CR_Z : cr & ~CR_Z);
>>> +
>>> +   return cr & CR_Z;
>>> +}
>>>
>>>  /*
>>>  * Copy U-boot from mmc to RAM:
>>> @@ -41,10 +56,20 @@ enum boot_mode {
>>>  void copy_uboot_to_ram(void)
>>>  {
>>> spi_copy_func_t spi_copy;
>>> -   enum boot_mode bootmode;
>>> +   usb_copy_func_t usb_copy;
>>> +
>>> +   int is_cr_z_set;
>>> +   unsigned int sec_boot_check;
>>> +   enum boot_mode bootmode = BOOT_MODE_OM;
>>> u32 (*copy_bl2)(u32, u32, u32);
>>>
>>> -   bootmode = readl(EXYNOS5_POWER_BASE) & OM_STAT;
>>> +   /* Read iRAM location to check for secondary USB boot mode */
>>> +   sec_boot_check = readl(EXYNOS_IRAM_SECONDARY_BASE);
>>> +   if (sec_boot_check == EXYNOS_USB_SECONDARY_BOOT)
>>> +   bootmode = BOOT_MODE_USB;
>>> +
>>> +   if (bootmode == BOOT_MODE_OM)
>>> +   bootmode = readl(EXYNOS5_POWER_BASE) & OM_STAT;
>>>
>>> switch (bootmode) {
>>> case BOOT_MODE_SERIAL:
>>> @@ -57,6 +82,17 @@ void copy_uboot_to_ram(void)
>>> copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
>>> CONFIG_SYS_TEXT_BASE);
>>> break;
>>> +   case BOOT_MODE_USB:
>>> +   /*
>>> +* iROM needs program flow prediction to be disabled
>>> +* before copy from USB device to RAM
>>> +*/
>>> +   is_cr_z_set = config_branch_prediction(0);
>>> +   usb_copy = *(usb_copy_func_t *)
>>> +   EXYNOS_COPY_USB_FNPTR_ADDR;
>>> +   usb_copy();
>>> +   config_branch_prediction(is_cr_z_set);
>>> +   break;
>>> default:
>>> break;
>>> }
>>> diff --git a/include/configs/exynos5250-dt.h 
>>> b/include/configs/exynos5250-dt.h
>>> index cabd2f2..6728b0e 100644
>>> --- a/include/configs/exynos5250-dt.h
>>> +++ b/include/configs/exynos5250-dt.h
>>> @@ -123,6 +123,11 @@
>>>  #define CONFIG_USB_EHCI_EXYNOS
>>>  #define CONFIG_USB_STORAGE
>>>
>>> +/* USB boot mode */
>>> +#define EXYNOS_COPY_USB_FNPTR_ADDR 0x02020070
>>> +#define EXYNOS_USB_SECONDARY_BOOT  0xfeed0002
>>> +#define EXYNOS_IRAM_SECONDARY_BASE 0x02020018
>>
>>
>> What happened to the function pointer table patch?
>>
> I think i missed that patch from Amar, :-(
> will remove these #defines and use the function pointer table instead.

I notice that this patch has not made it to mainline. It really should
be there since without it it is not possible to USB boot on snow,
which makes development awkward.

Can we get this applied in time for the release? The comment made
above can be dealt with later perhaps.

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


[U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow

2013-04-13 Thread Simon Glass
Snow is missing a TMU node, and with TMU support this is not allowed, so it
fails to boot. Add it.

Signed-off-by: Simon Glass 
---
 board/samsung/dts/exynos5250-snow.dts | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/board/samsung/dts/exynos5250-snow.dts 
b/board/samsung/dts/exynos5250-snow.dts
index 8b303bf..24658c1 100644
--- a/board/samsung/dts/exynos5250-snow.dts
+++ b/board/samsung/dts/exynos5250-snow.dts
@@ -55,4 +55,18 @@
compatible = "maxim,max77686_pmic";
};
};
+
+   tmu@1006 {
+   samsung,min-temp= <25>;
+   samsung,max-temp= <125>;
+   samsung,start-warning   = <95>;
+   samsung,start-tripping  = <105>;
+   samsung,hw-tripping = <110>;
+   samsung,efuse-min-value = <40>;
+   samsung,efuse-value = <55>;
+   samsung,efuse-max-value = <100>;
+   samsung,slope   = <274761730>;
+   samsung,dc-value= <25>;
+   };
+
 };
-- 
1.8.1.3

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


[U-Boot] [PATCH] Provide more useful debugging when an initcall fails

2013-04-13 Thread Simon Glass
The debug() which prints out the current call is not very useful, since if
it is called early enough (such as before the console is ready in the
pre-relocation board_init_f() sequence) it can hang the board.

It is more useful to print a message when a call fails, and in this case
the non-relocated symbol address provides a way for the offending function
to be located in System.map.

Adjust the initcall to provide this.

Signed-off-by: Simon Glass 
---
 lib/initcall.c | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/lib/initcall.c b/lib/initcall.c
index fc91bf6..ace285d 100644
--- a/lib/initcall.c
+++ b/lib/initcall.c
@@ -23,15 +23,20 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
+
 int initcall_run_list(init_fnc_t init_sequence[])
 {
init_fnc_t *init_fnc_ptr;
 
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
-   debug("initcall: %p\n", *init_fnc_ptr);
if ((*init_fnc_ptr)()) {
+   unsigned long reloc_ofs = 0;
+
+   if (gd->flags & GD_FLG_RELOC)
+   reloc_ofs = gd->reloc_off;
debug("initcall sequence %p failed at call %p\n",
- init_sequence, *init_fnc_ptr);
+ init_sequence, (char *)*init_fnc_ptr - reloc_ofs);
return -1;
}
}
-- 
1.8.1.3

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


[U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division

2013-04-13 Thread Simon Glass
The current code is causing errors like this on my toolchains:

/usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/binutils-bin/2.22/
ld.bfd.real: failed to merge target specific data of file /usr/lib/gcc/
armv7a-cros-linux-gnueabi/4.7.x-google/libgcc.a(_divdi3.o)

Use do_div() to avoid this.

Signed-off-by: Simon Glass 
---
 arch/arm/cpu/armv7/s5p-common/timer.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c 
b/arch/arm/cpu/armv7/s5p-common/timer.c
index 6a0fa58..4adfaae 100644
--- a/arch/arm/cpu/armv7/s5p-common/timer.c
+++ b/arch/arm/cpu/armv7/s5p-common/timer.c
@@ -24,6 +24,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -76,6 +77,8 @@ int timer_init(void)
  */
 unsigned long get_timer(unsigned long base)
 {
+   unsigned long long time_ms;
+
ulong now = timer_get_us_down();
 
/*
@@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
gd->arch.lastinc = now;
 
/* Divide by 1000 to convert from us to ms */
-   return gd->arch.timer_reset_value / 1000 - base;
+   time_ms = gd->arch.timer_reset_value;
+   do_div(time_ms, 1000);
+   return time_ms - base;
 }
 
 unsigned long timer_get_us(void)
-- 
1.8.1.3

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


Re: [U-Boot] freescale i.MX28 mxsboot NAND booting on mx28evk bad blocks

2013-04-13 Thread Marek Vasut
Dear Paul B. Henson,

> Let me just preface this reply with the disclaimer that I'm fairly new
> to embedded development, and it sounds like you know a lot more about
> what you're talking about than I do ;).

[...]

I'm not reading the thread as it -- again -- contains loads of baseless "is 
broken" and "doesn't work" accusations left and right, sorry. I am CCing Fabio.

The issue with the bad sectors is known. This is because the kobs-ng scans the 
NAND and fills the DBBT. This is not something that can be done off-line, so 
the 
mxsboot can never generate such a image per-se. It can on the other hand 
generate a bootable image. Note that the mxsboot is by default configured for 
2048+64 bps flashes.

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 6/8] mtd: nand: add driver for diskonchip g4 nand flash

2013-04-13 Thread Marek Vasut
Dear Scott Wood,

> On 04/12/2013 01:59:18 PM, Mike Dunn wrote:
> > This patch adds a driver for the diskonchip G4 nand flash device.  It
> > is based
> > on the driver from the linux kernel.
> > 
> > This also includes a separate SPL driver.  A separate SPL driver is
> > used because
> > the device operates in a different mode (reliable mode) when loading
> > a boot
> > image, and also because the storage format of the boot image is
> > different from
> > normal data (pages are stored redundantly).  The SPL driver basically
> > mimics how
> > a typical IPL reads data from the device.  The special operating mode
> > and
> > storage format are used to compensate for the fact that the IPL does
> > not contain
> > the BCH ecc decoding algorithm (due to size constraints).  Although
> > the u-boot
> > SPL *could* use ecc, it operates like an IPL for the sake of
> > simplicity and
> > uniformity, since the IPL and SPL share the task of loading the
> > u-boot image.
> > As a side benefit, the SPL driver is very small.
> > 
> > [port from linux kernel 3.4 commit
> > 570469f3bde7f71cc1ece07a18d54a05b6a8775d]
> > 
> > Signed-off-by: Mike Dunn 
> > ---
> > 
> > Changelog:
> >   v3: replace dbg macro with MTDDEBUG
> >   v2: remove commented-out code
> >  
> >  drivers/mtd/nand/Makefile|2 +
> >  drivers/mtd/nand/docg4.c | 1028
> > 
> > ++
> > 
> >  drivers/mtd/nand/docg4_spl.c |  222 +
> >  include/linux/mtd/docg4.h|  134 ++
> >  4 files changed, 1386 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/mtd/nand/docg4.c
> >  create mode 100644 drivers/mtd/nand/docg4_spl.c
> >  create mode 100644 include/linux/mtd/docg4.h
> 
> Acked-by: Scott Wood 

I'll pick them all if that's ok with you, Scott ?

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] mx6qsabre{sd, auto}: Fix environment as 'mmc rescan' takes no arguments

2013-04-13 Thread Stefano Babic
On 11/04/2013 04:55, Otavio Salvador wrote:
> Signed-off-by: Otavio Salvador 
> ---
>  include/configs/mx6qsabre_common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/configs/mx6qsabre_common.h 
> b/include/configs/mx6qsabre_common.h
> index dc113e1..5da748e 100644
> --- a/include/configs/mx6qsabre_common.h
> +++ b/include/configs/mx6qsabre_common.h
> @@ -158,7 +158,7 @@
>  
>  #define CONFIG_BOOTCOMMAND \
>   "mmc dev ${mmcdev};" \
> - "if mmc rescan ${mmcdev}; then " \
> + "if mmc rescan; then " \
>   "if run loadbootscript; then " \
>   "run bootscript; " \
>   "else " \
> 

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] spi: mxc_spi: Set master mode for all channels

2013-04-13 Thread Stefano Babic
On 10/04/2013 14:01, Fabio Estevam wrote:
> Hi Stefano,
> 
> On Wed, Apr 10, 2013 at 3:10 AM, Stefano Babic  wrote:
> 
>> I am afraid you are breaking MX3x / MX25 because you add
>> MXC_CSPICTRL_MODE_MASK only to MX5 / MX6.
> 
> It will not break other platforms because this code is protected with
> a "#ifdef MXC_ECSPI".
> 
> And MXC_ECSPI is only defined on mx5/mx6:
> 
> arch/arm/include/asm/arch-mx5/imx-regs.h:#define MXC_ECSPI
> arch/arm/include/asm/arch-mx6/imx-regs.h:#define MXC_ECSPI
> 
> ,so we are safe here.

Thanks, you're right.

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] freescale i.MX28 mxsboot NAND booting on mx28evk bad blocks

2013-04-13 Thread Trent Piepho
On Sat, Apr 13, 2013 at 7:42 AM, Marek Vasut  wrote:
> Dear Paul B. Henson,
>
>> Let me just preface this reply with the disclaimer that I'm fairly new
>> to embedded development, and it sounds like you know a lot more about
>> what you're talking about than I do ;).
>
> [...]
>
> I'm not reading the thread as it -- again -- contains loads of baseless "is
> broken" and "doesn't work" accusations left and right, sorry. I am CCing 
> Fabio.

So why did you respond?  Just to tell us you don't care if there are
bugs in mxsboot?

> The issue with the bad sectors is known. This is because the kobs-ng scans the
> NAND and fills the DBBT. This is not something that can be done off-line, so 
> the

You misunderstand, flashing with u-boot marks the sectors as bad.
It's not necessary to ever use kobs-ng to see the problem, so it can't
possibly be the cause.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] How do I use AM335x eth1 rather than eth0 ? [SOLVED]

2013-04-13 Thread Mark Jackson

On 12/04/13 11:56, Mark Jackson wrote:

We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet 
ports connected.

I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-

static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs  = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = 0,
},
{
.slave_reg_ofs  = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = 1,
},
};

... to ...

static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs  = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = 1,
},
{
.slave_reg_ofs  = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = 0,
},
};

... assuming that eth0 would now be ignored (as only 1 slave is configured).

But (eg) dhcp still only responds on eth0 !?!

What else do I have to change ?


After much experimenting, I've managed to get it to work.

Based on the original board.c file copied from the TI starter kit, I 
simply changed the slaves count to 2, and set CONFIG_PHY_ADDR to 1 in my 
board config file.


Simple.

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


Re: [U-Boot] How do I use AM335x eth1 rather than eth0 ? [SOLVED]

2013-04-13 Thread Mark Jackson

On 12/04/13 11:56, Mark Jackson wrote:

We have a dual Ethernet board (based on the BeagelBone) but with both Ethernet 
ports connected.

I'm wanting to use eth1 (rather than eth0), so in my board.c file, I changed:-

static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs  = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = 0,
},
{
.slave_reg_ofs  = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = 1,
},
};

... to ...

static struct cpsw_slave_data cpsw_slaves[] = {
{
.slave_reg_ofs  = 0x308,
.sliver_reg_ofs = 0xdc0,
.phy_id = 1,
},
{
.slave_reg_ofs  = 0x208,
.sliver_reg_ofs = 0xd80,
.phy_id = 0,
},
};

... assuming that eth0 would now be ignored (as only 1 slave is configured).

But (eg) dhcp still only responds on eth0 !?!

What else do I have to change ?


After much experimenting, I've managed to get it to work.

Based on the original board.c file copied from the TI starter kit, I 
simply changed the slaves count to 2, and set CONFIG_PHY_ADDR to 1 in my 
board config file.


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


Re: [U-Boot] [PATCH 2/5] vybrid: add Freescale vybrid vf600 tower board support

2013-04-13 Thread Fabio Estevam
On Sat, Apr 13, 2013 at 2:15 AM, Wang Huan-B18965  wrote:

> No hardcoded IP addresses/MAC addresses, please.
>
> [Alison] Agree. What is the general configuration way for these default 
> settings?

Just remove it from the config file.

For IP addresses, the user should manually set serverip/ipaddr, etc in
the U-boot prompt.

For MAC addresses usually we read it from fuses,

Regards,

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


Re: [U-Boot] freescale i.MX28 mxsboot NAND booting on mx28evk bad blocks

2013-04-13 Thread Marek Vasut
Dear Trent Piepho,

> On Sat, Apr 13, 2013 at 7:42 AM, Marek Vasut  wrote:
> > Dear Paul B. Henson,
> > 
> >> Let me just preface this reply with the disclaimer that I'm fairly new
> >> to embedded development, and it sounds like you know a lot more about
> >> what you're talking about than I do ;).
> > 
> > [...]
> > 
> > I'm not reading the thread as it -- again -- contains loads of baseless
> > "is broken" and "doesn't work" accusations left and right, sorry. I am
> > CCing Fabio.
> 
> So why did you respond?  Just to tell us you don't care if there are
> bugs in mxsboot?

To CC Fabio to let him handle this issue, we obviously cannot work together.

> > The issue with the bad sectors is known. This is because the kobs-ng
> > scans the NAND and fills the DBBT. This is not something that can be
> > done off-line, so the
> 
> You misunderstand, flashing with u-boot marks the sectors as bad.
> It's not necessary to ever use kobs-ng to see the problem, so it can't
> possibly be the cause.

Then blank DBBT is also a problem.

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 0/5] vybrid: Add vybrid CPU and vf600 tower board support

2013-04-13 Thread Stefano Babic
On 12/04/2013 08:53, Alison Wang wrote:
> This series contains the support for vybrid CPU and vf600 tower board.
> 
> The Vybrid devices are a family of Freescale's latest Dual Single
> Core offering with ARM Cortex A5 and CM4 based processors for
> Advanced Connected Radio, Entry Infotainment, and Cluster as well
> as high end industrial and general purpose applications.
> 
> 

Hi Alison,

because there is not yet documentation about this family on Freescale's
webiste, could you please mention something more about this processor ?

This helps to better understand where we can put support inside U-Boot.

More or less the following information are very valueable :

- Are there common part (peripheral, controller,..) with other
Freescale's processors ? I doubt there is no point of contact, at least
with i.MX6.

- Which peripheral are reused in this SOC ? I understand in your
patchset that ESDHC is reused, I think also FEC, I wonder that UART is not.

- Which image is produced ? I do not understand why you need a new type
if you reuse the same rule (mkimage for imx) we have.

Best regards,
Stefano Babic



-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/7] lib: import bitrev library from the linux kernel

2013-04-13 Thread Wolfgang Denk
Dear Mike Dunn,

In message <5167f7b4.3070...@newsguy.com> you wrote:
>
> In this case, it's a simple algorithm and only a couple trivial changes were
> made since it was first added to the kernel, so the error is probably
> inconsequential, but I'll resubmit, reporting the HEAD of the kernel I took it
> from if you like.

Please use the git commit ID of the exact kernel version which you
used to copy the code from, not any older nor any more recent version.

Thanks.

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
A good marriage would be between a blind wife and deaf husband.
   -- Michel de Montaigne
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] vybrid: add uart driver support

2013-04-13 Thread Stefano Babic
On 12/04/2013 08:53, Alison Wang wrote:
> This patch adds uart driver support for vybrid platform.
> 
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---

Hi Alison

> diff --git a/drivers/serial/serial_vybrid.c b/drivers/serial/serial_vybrid.c
> new file mode 100644
> index 000..4dd9b52
> --- /dev/null
> +++ b/drivers/serial/serial_vybrid.c
> @@ -0,0 +1,129 @@
> +/*
> + * Copyright 2012-2013 Freescale Semiconductor, 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 Foundation; 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
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#ifndef CONFIG_VYBRID_UART_BASE
> +#error "define CONFIG_VYBRID_UART_BASE to use the VYBRID UART driver"
> +#endif
> +
> +#define UART_CONSOLE \
> + (CONFIG_VYBRID_UART_BASE + (CONFIG_SYS_UART_PORT * 0x1000))
> +
> +#ifdef CONFIG_SERIAL_MULTI
> +#warning "Vybrid driver does not support MULTI serials."
> +#endif
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +static void vybrid_serial_setbrg(void)
> +{
> + u32 clk = vybrid_get_uartclk();
> + u16 sbr;
> +
> + if (!gd->baudrate)
> + gd->baudrate = CONFIG_BAUDRATE;
> +
> + sbr = (u16)(clk / (16 * gd->baudrate));
> + /* place adjustment later - n/32 BRFA */
> +
> + out_8((UART_CONSOLE + UBDH), (sbr >> 8));
> + out_8((UART_CONSOLE + UBDL), (sbr & 0xFF));
> +}
> +
> +static int vybrid_serial_getc(void)
> +{
> + while (!(in_8(UART_CONSOLE + US1) & US1_RDRF))
> + WATCHDOG_RESET();
> +

Generally : do not use BASE + offset as here. Use C structures, instead.
We have already ARM accessors (in8 is defined for powerpc). Use
functions in io.h

This driver is very simple, and it is similar to already implemented
drivers. Sure that we cannot reuse other code ?

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/5] vybrid: add eSDHC driver support

2013-04-13 Thread Stefano Babic
On 12/04/2013 08:53, Alison Wang wrote:
> This patch adds eSDHC driver support for vybrid platform.
> 
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---
>  drivers/mmc/fsl_esdhc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c
> index 35f879e..f258868 100644
> --- a/drivers/mmc/fsl_esdhc.c
> +++ b/drivers/mmc/fsl_esdhc.c
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright 2007, 2010-2011 Freescale Semiconductor, Inc
> + * Copyright 2007, 2010-2013 Freescale Semiconductor, Inc

I do not think you can change the Copyright line only for adding a line
of code.

> -#ifndef ARCH_MXC
> +#if !defined(ARCH_MXC) && !defined(CONFIG_VYBRID)
>   /* Enable cache snooping */
>   esdhc_write32(®s->scr, 0x0040);
>  #endif

I am also not sure if we need CONFIG_VYBRID (but then it should be
ARCH_VYBRID) or we can let flow these processors into the i.MX family.

Best regards,
Stefano Babic


-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/5] vybrid: add Freescale vybrid vf600 tower board support

2013-04-13 Thread Stefano Babic
On 12/04/2013 08:53, Alison Wang wrote:
> This patch adds Freescale vybrid vf600 tower board support.
> 
> Signed-off-by: TsiChung Liew 
> Signed-off-by: Jason Jin 
> Signed-off-by: Alison Wang 
> ---

Hi Alison.

>  board/freescale/vybrid/Makefile|  40 +++
>  board/freescale/vybrid/vybrid.c| 488 
> +
>  board/freescale/vybrid/vybridimage.cfg |  44 +++
>  boards.cfg |   2 +
>  include/configs/vybrid.h   | 284 +++
>  include/configs/vybrid_iram.h  | 284 +++
>  6 files changed, 1142 insertions(+)
>  create mode 100644 board/freescale/vybrid/Makefile
>  create mode 100644 board/freescale/vybrid/vybrid.c
>  create mode 100644 board/freescale/vybrid/vybridimage.cfg
>  create mode 100644 include/configs/vybrid.h
>  create mode 100644 include/configs/vybrid_iram.h
> 
> diff --git a/board/freescale/vybrid/Makefile b/board/freescale/vybrid/Makefile
> new file mode 100644
> index 000..0749b21
> --- /dev/null
> +++ b/board/freescale/vybrid/Makefile
> @@ -0,0 +1,40 @@
> +#
> +# Copyright 2012-2013 Freescale Semiconductor, 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 Foundation; 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
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB  = $(obj)lib$(BOARD).o
> +
> +COBJS:= $(BOARD).o
> +
> +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
> +OBJS := $(addprefix $(obj),$(COBJS))
> +SOBJS:= $(addprefix $(obj),$(SOBJS))
> +
> +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
> + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/board/freescale/vybrid/vybrid.c b/board/freescale/vybrid/vybrid.c
> new file mode 100644
> index 000..c2da1ff
> --- /dev/null
> +++ b/board/freescale/vybrid/vybrid.c
> @@ -0,0 +1,488 @@
> +/*
> + * Copyright 2012-2013 Freescale Semiconductor, Inc.
> + *
> + * 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 as
> + * published by the Free Software Foundation; 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
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define DDR_IOMUX0x0180
> +#define DDR_IOMUX1   0x00010180
> +
> +#define PHY_DQ_TIMING0x2613
> +#define PHY_DQS_TIMING   0x2615
> +#define PHY_CTRL 0x01210080
> +#define PHY_MASTER_CTRL  0x0001012a
> +#define PHY_SLAVE_CTRL   0x00012020
> +
> +#ifdef CONFIG_FSL_ESDHC
> +struct fsl_esdhc_cfg esdhc_cfg[2] = {
> + {CONFIG_SYS_ESDHC1_BASE, 1},
> + {ESDHC2_BASE_ADDR, 1},
> +};
> +#endif
> +
> +void setup_iomux_ddr(void)
> +{
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A15);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A14);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A13);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A12);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A11);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A10);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A9);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A8);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A7);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A6);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A5);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A4);
> + __raw_writel(DDR_IOMUX, IOMUXC_DDR_A3);
> + __raw_write

Re: [U-Boot] [PATCH] arm: imx: Change iomux functions to void type

2013-04-13 Thread Stefano Babic
On 11/04/2013 11:06, Stefan Roese wrote:
> They never return anything also than 0, so lets change the function
> to void instead.
> 
> Signed-off-by: Stefan Roese 
> ---
>  arch/arm/imx-common/iomux-v3.c | 18 +-
>  arch/arm/include/asm/imx-common/iomux-v3.h |  4 ++--
>  2 files changed, 7 insertions(+), 15 deletions(-)
> 
> diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
> index 08fad78..7fe5ce7 100644
> --- a/arch/arm/imx-common/iomux-v3.c
> +++ b/arch/arm/imx-common/iomux-v3.c
> @@ -30,7 +30,7 @@ static void *base = (void *)IOMUXC_BASE_ADDR;
>  /*
>   * configures a single pad in the iomuxer
>   */
> -int imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
> +void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
>  {
>   u32 mux_ctrl_ofs = (pad & MUX_CTRL_OFS_MASK) >> MUX_CTRL_OFS_SHIFT;
>   u32 mux_mode = (pad & MUX_MODE_MASK) >> MUX_MODE_SHIFT;
> @@ -50,22 +50,14 @@ int imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
>  
>   if (!(pad_ctrl & NO_PAD_CTRL) && pad_ctrl_ofs)
>   __raw_writel(pad_ctrl, base + pad_ctrl_ofs);
> -
> - return 0;
>  }
>  
> -int imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
> -  unsigned count)
> +void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
> +   unsigned count)
>  {
>   iomux_v3_cfg_t const *p = pad_list;
>   int i;
> - int ret;
>  
> - for (i = 0; i < count; i++) {
> - ret = imx_iomux_v3_setup_pad(*p);
> - if (ret)
> - return ret;
> - p++;
> - }
> - return 0;
> + for (i = 0; i < count; i++)
> + imx_iomux_v3_setup_pad(*p++);
>  }
> diff --git a/arch/arm/include/asm/imx-common/iomux-v3.h 
> b/arch/arm/include/asm/imx-common/iomux-v3.h
> index c34bb76..70bf3cd 100644
> --- a/arch/arm/include/asm/imx-common/iomux-v3.h
> +++ b/arch/arm/include/asm/imx-common/iomux-v3.h
> @@ -97,8 +97,8 @@ typedef u64 iomux_v3_cfg_t;
>  
>  #define MUX_CONFIG_SION  (0x1 << 4)
>  
> -int imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
> -int imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
> +void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad);
> +void imx_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t const *pad_list,
>unsigned count);
>  
>  #endif   /* __MACH_IOMUX_V3_H__*/
> 

Right, I will put it into -next branch.

Regards,
Stefano

-- 
=
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2] ARM: Fix __bss_start and __bss_end in linker scripts

2013-04-13 Thread Albert ARIBAUD
On Thu, 11 Apr 2013 17:43:21 +0200, Albert ARIBAUD
 wrote:

> Commit 3ebd1cbc introduced compiler-generated __bss_start
> and __bss_end__ and commit c23561e7 rewrote all __bss_end__
> as __bss_end. Their merge caused silent and harmless but
> potentially bug-inducing clashes between compiler- and linker-
> enerated __bss_end symbols.
> 
> Make __bss_end and __bss_start compiler-only, and create
> __bss_base and __bss_limit for linker-only use.
> 
> Signed-off-by: Albert ARIBAUD 
> Reported-by: Benoît Thébaudeau 
> ---
> Changes in v2:
> - remove HIDDEN(), not supported by binutils < 2.23
> 
>  arch/arm/cpu/ixp/u-boot.lds|   14 ++
>  arch/arm/cpu/u-boot.lds|   14 ++
>  board/actux1/u-boot.lds|   14 ++
>  board/actux2/u-boot.lds|   14 ++
>  board/actux3/u-boot.lds|   14 ++
>  board/dvlhost/u-boot.lds   |   14 ++
>  board/freescale/mx31ads/u-boot.lds |   14 ++
>  7 files changed, 70 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
> index 388a67f..553589c 100644
> --- a/arch/arm/cpu/ixp/u-boot.lds
> +++ b/arch/arm/cpu/ixp/u-boot.lds
> @@ -69,17 +69,23 @@ SECTIONS
>  
>   _end = .;
>  
> +/*
> + * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
> + * __bss_base and __bss_limit are for linker only (overlay ordering)
> + */
> +
>   .bss_start __rel_dyn_start (OVERLAY) : {
>   KEEP(*(.__bss_start));
> + __bss_base = .;
>   }
>  
> - .bss __bss_start (OVERLAY) : {
> + .bss __bss_base (OVERLAY) : {
>   *(.bss*)
>. = ALIGN(4);
> -  __bss_end = .;
> +  __bss_limit = .;
>   }
> - .bss_end __bss_end (OVERLAY) : {
> - KEEP(*(__bss_end));
> + .bss_end __bss_limit (OVERLAY) : {
> + KEEP(*(.__bss_end));
>   }
>  
>   /DISCARD/ : { *(.dynstr*) }
> diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> index 3a1083d..d5e42d3a 100644
> --- a/arch/arm/cpu/u-boot.lds
> +++ b/arch/arm/cpu/u-boot.lds
> @@ -81,18 +81,24 @@ SECTIONS
>   *(.mmutable)
>   }
>  
> +/*
> + * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
> + * __bss_base and __bss_limit are for linker only (overlay ordering)
> + */
> +
>   .bss_start __rel_dyn_start (OVERLAY) : {
>   KEEP(*(.__bss_start));
> + __bss_base = .;
>   }
>  
> - .bss __bss_start (OVERLAY) : {
> + .bss __bss_base (OVERLAY) : {
>   *(.bss*)
>. = ALIGN(4);
> -  __bss_end = .;
> +  __bss_limit = .;
>   }
>  
> - .bss_end __bss_end (OVERLAY) : {
> - KEEP(*(__bss_end));
> + .bss_end __bss_limit (OVERLAY) : {
> + KEEP(*(.__bss_end));
>   }
>  
>   /DISCARD/ : { *(.dynstr*) }
> diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds
> index 52fc9fc..ef4a25b 100644
> --- a/board/actux1/u-boot.lds
> +++ b/board/actux1/u-boot.lds
> @@ -77,17 +77,23 @@ SECTIONS
>  
>   _end = .;
>  
> +/*
> + * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
> + * __bss_base and __bss_limit are for linker only (overlay ordering)
> + */
> +
>   .bss_start __rel_dyn_start (OVERLAY) : {
>   KEEP(*(.__bss_start));
> + __bss_base = .;
>   }
>  
> - .bss __bss_start (OVERLAY) : {
> + .bss __bss_base (OVERLAY) : {
>   *(.bss*)
>. = ALIGN(4);
> -  __bss_end = .;
> +  __bss_limit = .;
>   }
> - .bss_end __bss_end (OVERLAY) : {
> - KEEP(*(__bss_end));
> + .bss_end __bss_limit (OVERLAY) : {
> + KEEP(*(.__bss_end));
>   }
>  
>   /DISCARD/ : { *(.dynstr*) }
> diff --git a/board/actux2/u-boot.lds b/board/actux2/u-boot.lds
> index cafd3d8..00ad8b7 100644
> --- a/board/actux2/u-boot.lds
> +++ b/board/actux2/u-boot.lds
> @@ -77,17 +77,23 @@ SECTIONS
>  
>   _end = .;
>  
> +/*
> + * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
> + * __bss_base and __bss_limit are for linker only (overlay ordering)
> + */
> +
>   .bss_start __rel_dyn_start (OVERLAY) : {
>   KEEP(*(.__bss_start));
> + __bss_base = .;
>   }
>  
> - .bss __bss_start (OVERLAY) : {
> + .bss __bss_base (OVERLAY) : {
>   *(.bss*)
>. = ALIGN(4);
> -  __bss_end = .;
> +  __bss_limit = .;
>   }
> - .bss_end __bss_end (OVERLAY) : {
> - KEEP(*(__bss_end));
> + .bss_end __bss_limit (OVERLAY) : {
> + KEEP(*(.__bss_end));
>   }
>  
>   /DISCARD/ : { *(.dynstr*) }
> diff --git a/board/actux3/u-boot.lds b/board/actux3/u-boot.lds
> index 168fe17..44b990e 100644
> --- a/board/actux3/u-boot.lds
> +++ b/board/actux3/u-boot.l