Re: [U-Boot] [RFC] common/lcd: use lcd_setcolreg() in bitmap_plot

2012-10-28 Thread Nikita Kiryanov

Hi Andreas,

I think this change can also be applied to lcd_display_bitmap(), and
then configuration_get_cmap() can be eliminated.

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


[U-Boot] [PATCH] OMAP3: igep0020: Add pad config for WIFI/BT GPIOs

2012-10-28 Thread Anders Hedlund
This adds support for WIFI/BT GPIOs which were previously missing.

Signed-off-by: Anders Hedlund 
Cc: Enric Balletbo i Serra 
Cc: Jonas Zetterberg 
---
 board/isee/igep0020/igep0020.h |6 ++
 1 file changed, 6 insertions(+)

diff --git a/board/isee/igep0020/igep0020.h b/board/isee/igep0020/igep0020.h
index 3335ecc..283b75e 100644
--- a/board/isee/igep0020/igep0020.h
+++ b/board/isee/igep0020/igep0020.h
@@ -132,6 +132,12 @@ static void setup_net_chip(void);
MUX_VAL(CP(MMC1_DAT1),  (IEN  | PTU | EN  | M0)) /* MMC1_DAT1 */\
MUX_VAL(CP(MMC1_DAT2),  (IEN  | PTU | EN  | M0)) /* MMC1_DAT2 */\
MUX_VAL(CP(MMC1_DAT3),  (IEN  | PTU | EN  | M0)) /* MMC1_DAT3 */\
+   MUX_VAL(CP(CAM_HS), (IDIS | PTU | DIS | M4)) /* GPIO_94 */\
+   MUX_VAL(CP(CAM_VS), (IDIS | PTU | DIS | M4)) /* GPIO_95 */\
+   MUX_VAL(CP(MMC2_DAT4),  (IDIS | PTU | DIS | M4)) /* GPIO_136 */\
+   MUX_VAL(CP(MMC2_DAT5),  (IDIS | PTU | DIS | M4)) /* GPIO_137 */\
+   MUX_VAL(CP(MMC2_DAT6),  (IDIS | PTU | DIS | M4)) /* GPIO_138 */\
+   MUX_VAL(CP(MMC2_DAT7),  (IDIS | PTU | DIS | M4)) /* GPIO_139 */\
MUX_VAL(CP(UART3_TX_IRTX),  (IDIS | PTD | DIS | M0)) /* UART3_TX */\
MUX_VAL(CP(UART3_RX_IRRX),  (IEN  | PTD | DIS | M0)) /* UART3_RX */\
MUX_VAL(CP(I2C1_SCL),   (IEN  | PTU | EN  | M0)) /* I2C1_SCL */\
-- 
1.7.10.4

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


Re: [U-Boot] ping failed; host 192.168.1.101 is not alive

2012-10-28 Thread akdas75

hi Anatolij
I tried  your suggestion 
I generate a macid from uboot/tools/gen_eth_addr.
Still the ping says "host not alive"

I have attached the uboot log
and also the wireshark snapshot on the host

host : 192.168.1.101
development board : 192.168.1.100

Ajoy
http://old.nabble.com/file/p34610904/uboot_log_1.txt uboot_log_1.txt 
http://old.nabble.com/file/p34610904/snap_wireshark_host.JPG
snap_wireshark_host.JPG 

akdas75 wrote:
> 
> Hi http://old.nabble.com/file/p34608548/uboot-log.rtf uboot-log.rtf 
> 
> I am using beagle board C4 with zippy expansion board.
> I am able to do NFS at the kernel level.
> I want to o tftp at the u-boot level.
> my beagle board is connected to the host via  cross ethernet cable.
> the phy chip is enc28j60. 
> when i ping  the host it says host not alive.
> 
> i have attached the env variables
> 
> please help
> 
> 

-- 
View this message in context: 
http://old.nabble.com/ping-failed--host-192.168.1.101-is-not-alive-tp34608548p34610904.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


[U-Boot] x86: Anyone willing to take over the reigns

2012-10-28 Thread Graeme Russ
Hi All,

I think it's finally time I admitted that I simply have too much on my
plate and need to give a few things up. Work and family life have got to
the point where I can only manage to grab a quick hour here and there at my
desk at home and I simply do not have enough time (or energy) to keep
maintaining the x86 repo.

It's been really good to see the Chromium guys giving U-Boot x86 some much
needed love, but it has highlighted to me just how much work it has been
(and will be) to keep up. To give you an idea, I haven't sync'd my local
repo (much less built U-Boot) in over a month now. My bandwidth is down to
making a few passing comments on very specific patches.

Does anyone feel up to the task of taking on the x86 repo? If not, I'm sure
that it could revert to the old days of being directly managed as
'miscellaneous'

Regards,

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


Re: [U-Boot] [PATCH V3 1/1] mx31/mx35/mx51/mx53/mx6: add watchdog

2012-10-28 Thread Stefano Babic
On 23/10/2012 03:19, Troy Kisky wrote:
> Use a common watchdog driver for all these cpus.
> 
> Signed-off-by: Troy Kisky 
> 
> ---
> v2:   add README.watchdog
>   include mx31/mx35 watchdogs
>   move to drivers/watchdog
> 
> v3:   change drivers/watchdog/Makefile to list relevant soc's
> Please test on a mx31 and mx35 board.
> qong and mx31pdk would be best!!
> ---
>  arch/arm/cpu/arm1136/mx31/timer.c |   39 -
>  arch/arm/cpu/arm1136/mx35/generic.c   |6 ---
>  arch/arm/imx-common/cpu.c |5 ---
>  arch/arm/include/asm/arch-mx31/clock.h|2 -
>  arch/arm/include/asm/arch-mx31/imx-regs.h |   13 +-
>  arch/arm/include/asm/arch-mx35/imx-regs.h |   11 +
>  arch/arm/include/asm/arch-mx5/imx-regs.h  |   10 -
>  board/davedenx/qong/qong.c|9 +---
>  board/freescale/mx31pdk/mx31pdk.c |9 +---
>  board/hale/tt01/tt01.c|2 +-
>  doc/README.watchdog   |   29 +
>  drivers/watchdog/Makefile |3 ++
>  drivers/watchdog/imx_watchdog.c   |   66 
> +
>  include/configs/mx31pdk.h |1 +
>  include/configs/qong.h|1 +
>  include/watchdog.h|1 +
>  16 files changed, 106 insertions(+), 101 deletions(-)
>  create mode 100644 doc/README.watchdog
>  create mode 100644 drivers/watchdog/imx_watchdog.c
> 


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 v3 1/6] mx25pdk: Include CONFIG_MX25

2012-10-28 Thread Stefano Babic
On 23/10/2012 18:34, Fabio Estevam wrote:
> It is necessary to include CONFIG_MX25 as several i.mx drivers handle the SoC
> differences based on the this config option.
> 
> Signed-off-by: Fabio Estevam 
> ---
> Changes since v2:
> - No changes
> Changes since v1:
> - No changes
>  include/configs/mx25pdk.h |1 +
>  1 file changed, 1 insertion(+)
> 

Applied (whole series) 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 2/5] mx25pdk: Allow booting a zImage kernel

2012-10-28 Thread Stefano Babic
On 24/10/2012 21:44, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Allow booting a zImage kernel.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx25pdk.h |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/configs/mx25pdk.h b/include/configs/mx25pdk.h
> index bd000a7..1dddf50 100644
> --- a/include/configs/mx25pdk.h
> +++ b/include/configs/mx25pdk.h
> @@ -83,6 +83,7 @@
>  
>  /* U-Boot commands */
>  #include 
> +#define CONFIG_CMD_BOOTZ
>  #define CONFIG_CMD_CACHE
>  
>  /* Ethernet */
> 
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 3/5] mx51evk: Allow booting a zImage kernel

2012-10-28 Thread Stefano Babic
On 24/10/2012 21:44, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Allow booting a zImage kernel.
> 
> Signed-off-by: Fabio Estevam 
> ---

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 4/5] mx35pdk: Allow booting a zImage kernel

2012-10-28 Thread Stefano Babic
On 24/10/2012 21:44, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Allow booting a zImage kernel.
> 
> Signed-off-by: Fabio Estevam 
> ---

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 5/5] mx6qsabre_common: Allow booting a zImage kernel

2012-10-28 Thread Stefano Babic
On 24/10/2012 21:44, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Allow booting a zImage kernel.
> 
> Signed-off-by: Fabio Estevam 
> ---

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 1/5] mx53loco: Allow booting a zImage kernel

2012-10-28 Thread Stefano Babic
On 24/10/2012 21:44, Fabio Estevam wrote:
> From: Fabio Estevam 
> 
> Allow booting a zImage kernel.
> 
> Signed-off-by: Fabio Estevam 
> ---
>  include/configs/mx53loco.h |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
> index 0658dd3..25672c0 100644
> --- a/include/configs/mx53loco.h
> +++ b/include/configs/mx53loco.h
> @@ -103,6 +103,7 @@
>  
>  /* Command definition */
>  #include 
> +#define CONFIG_CMD_BOOTZ
>  
>  #undef CONFIG_CMD_IMLS
>  
> 

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 V3 5/5] ARM: tegra: don't request GPIO from Seaboard's SPL

2012-10-28 Thread Albert ARIBAUD
Hi Stephen,

On Sat, 27 Oct 2012 20:09:20 -0600, Stephen Warren
 wrote:

> On 10/27/2012 03:15 AM, Albert ARIBAUD wrote:
> > Hi Stephen,
> > 
> > On Mon, 22 Oct 2012 10:19:36 -0600, Stephen Warren
> >  wrote:
> > 
> >> From: Stephen Warren 
> >>
> >> Seaboard has a GPIO that switches an external mux between Tegra's debug
> >> UART and SPI flash. This is initialized from the SPL so that SPL debug
> >> output can be seen. Simplify the code that does this, and don't actually
> >> request the GPIO in the SPL; just program it. This saves ~4.5K from the
> >> size of the SPL, mostly BSS due to the large gpio_names[] table that is
> >> no longer required. This makes Seaboard's SPL fit within the current max
> >> size.
> > 
> > Is it possible to reorder the patch series so that Seaboard (and
> > Ventana?) builds do not break temporarily between patch 2 and this
> > patch?
> 
> It would be possibel, although I'd personally rather call out the issue
> explicitly with a build break; if the build succeeds, you end up using
> code that silently causes memory corruption. Of course, this issue has
> been around for a while, so perhaps hiding it for another couple extra
> commits wouldn't be a big deal. Plus, the build break proves the assert
> in the .lds file works:-) But it's not big deal either way; feel free to
> re-order the commits if you want.

No need: your points are valid.

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


Re: [U-Boot] [PATCH] common/spl: Mark arguments as unused

2012-10-28 Thread Vikram Narayanan

On 10/24/2012 10:41 PM, Scott Wood wrote:

On 10/23/2012 11:14:34 PM, Vikram Narayanan wrote:

On 10/24/2012 7:22 AM, Scott Wood wrote:

On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:

On 10/23/2012 9:15 PM, Tom Rini wrote:

On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:

On 10/23/2012 12:05 PM, Vikram Narayanan wrote:

As dummy{1,2} are not used anywhere, mark it with __maybe_unused

Signed-off-by: Vikram Narayanan
Cc: Stefan Roese
---
common/spl/spl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 0d829c0..62fd3bd 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
}
#endif

-void board_init_r(gd_t *dummy1, ulong dummy2)
+void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
ulong dummy2)
{
u32 boot_device;
debug(">>spl:board_init_r()\n");



Perhaps even __always_unused instead of __maybe_unused as these
variables are never used?


Also, what does this give us? Fixing a sparse warning?


Not a sparse warning. I noticed this while looking at the code.


If there's no warning, why do we need to ugly up the code with
__maybe_unused?


I'd rather call this a proper way of coding, than calling it ugly. But
perceptions differ.


If you want to push for a change to the official coding style, and
changing the warning options to go with it, go ahead (I'll argue against
it of course), but until and unless you succeed at that, this isn't the
way U-Boot code is written. I don't see a single instance of
__maybe_unused in an argument list, or a single instance of
__always_unused anywhere in U-Boot other than its definition.
Unnecessary clutter is harmful to readability.


It's not worth arguing over a single line of code that isn't going to 
cause any significant change. That would save us both some time.


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


Re: [U-Boot] [PATCH 1/2] mmc: add bcm2835 driver

2012-10-28 Thread Vikram Narayanan

On 10/28/2012 8:58 AM, Stephen Warren wrote:

On 10/26/2012 05:33 AM, Vikram Narayanan wrote:

Some nitpicks.

On 10/24/2012 10:20 AM, Stephen Warren wrote:



+static u8 bcm2835_sdhci_readb(struct sdhci_host *host, int reg)
+{
+u32 val = bcm2835_sdhci_raw_readl(host, (reg&   ~3));
+val = val>>   (reg<<   3&   0x18)&   0xff;
+
+return (u8)val;
+}


Can the above used magics be made as macros?


This code was taken directly from the downstream Linux kernel, so I
changed it as little as possible, to make comparisons easier. Still, if
people want I can certainly make it easier to understand the expression
a bit.


Seems reasonable.


I don't think the issue is the magic numbers so much as understanding
what the expression does; the magic are obvious then. It's simply
extracting byte n from from a u32. Would the following be more obvious:

byte_num = reg&  3;
byte_shift = bytenum * 8;
byte = (val>>  byte_shift)&  0xff;

... and similar for the other functions?


This looks better to me than the former. Thanks.

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


[U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Dimax
HI,
After power short u-boot fails to mount UBIFS and board stuck. Below is a
trace of u-boot

Marvell>> boot

UBI: mtd1 is detached from ubi0

Creating 1 MTD partitions on "nand0":

0x0050-0x2000 : "mtd=2"

UBI: attaching mtd1 to ubi0

UBI: physical eraseblock size:   131072 bytes (128 KiB)

UBI: logical eraseblock size:129024 bytes

UBI: smallest flash I/O unit:2048

UBI: sub-page size:  512

UBI: VID header offset:  512 (aligned 512)

UBI: data offset:2048

UBI: attached mtd1 to ubi0

UBI: MTD device name:"mtd=2"

UBI: MTD device size:507 MiB

UBI: number of good PEBs:4055

UBI: number of bad PEBs: 1

UBI: max. allowed volumes:   128

UBI: wear-leveling threshold:4096

UBI: number of internal volumes: 1

UBI: number of user volumes: 1

UBI: available PEBs: 0

UBI: total number of reserved PEBs: 4055

UBI: number of PEBs reserved for bad PEB handling: 40

UBI: max/mean erase counter: 1/0

UBIFS: recovery needed

Error reading superblock on volume 'ubi:rootfs'!

UBIFS not mounted, use ubifs mount to mount volume first!

UBIFS not mounted, use ubifs mount to mount volume first!

Wrong Image Format for bootm command

ERROR: can't get kernel image!
Marvell>>

To recover from this situation I boot from USB stick and simply mounts the
same UBIFS partition:

root@debian:~# mount -t ubifs ubi0:rootfs /mnt
[  306.205029] UBIFS: recovery needed
[  309.341987] UBIFS: recovery completed
[  309.345705] UBIFS: mounted UBI device 0, volume 0, name "rootfs"
[  309.351738] UBIFS: file system size:   515192832 bytes (503118 KiB, 491
MiB, 3993 LEBs)
[  309.359789] UBIFS: journal size:   25804800 bytes (25200 KiB, 24
MiB, 200 LEBs)
[  309.367495] UBIFS: media format:   w4/r0 (latest is w4/r0)
[  309.373352] UBIFS: default compressor: lzo
[  309.377479] UBIFS: reserved for root:  4952683 bytes (4836 KiB)

As you can see mount manage to recover partition.
Is where any way to make u-boot to recover UBIFS partition as well?
What else can I do to make my system stable and survive power shorts?

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


Re: [U-Boot] mips port

2012-10-28 Thread Dmytro Milinevskyy
Jerry, thanks for your answer.
So far nobody commented my remark regarding the address of
board_init_r after the relocation so I would like to raise it again.
Maybe it's my fault as I forgot to attach the patch. In the patch the
address is correctly computed which allows u-boot to run after
relocation.

thanks,
-- dmytro

On Tue, Oct 9, 2012 at 2:48 AM, Jerry Van Baren  wrote:
> On 10/06/2012 09:11 PM, Dmytro Milinevskyy wrote:
>> Hi,
>> I'm new to uboot mips port and first decided to try it with qemu.
>
> Welcome.  :-)
>
>> I've encountered some problems with UART, but I guess that's more qemu
>> issue(lsr reg is not updated when the line is available).
>>
>> Another issue I faced was code execution after the relocation is done. The
>> address of board_init_r is not computed correctly(it was relative to boot
>> ROM address space/bfc0).
>> Is it specific to qemu(I don't see the reference here though) or is it a
>> generic mips port issue? Attached patch allows me to proceed with the boot
>> in qemu.
>>
>> And last - why do we need relocation at all with u-boot? Performance
>> constraints?
>
> Generally, yes.  Flash is very often slower than RAM (often 8 bits width
> vs. 32 bits or more, generally doesn't support bursting, the processor
> cache may not work with it, etc.).
>
> A side benefit of running out of RAM is that it makes it much easier to
> write to flash... you don't have to worry about writing to the chip you
> are executing out of (when you erase/write flash, the chip returns a
> "programming in progress" status until it is done - that will crash your
> program if you are running out of that chip).
>
>> Thanks,
>> -- dmytro
>
> Best regards,
> gvb
>


0001-mips-qemu-correctly-compute-start-board_init_r-addre.patch
Description: Binary data
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] powerpc/mpc85xx: Temporary fix for spin table backward compatibility

2012-10-28 Thread York Sun
Once u-boot sets the spin table to cache-enabled memory, old kernel which
uses cache-inhibit mapping without coherence will not work properly. We
use this temporary fix until kernel has updated its spin table code.
For now this fix is activated by default. To disable this fix for new
kernel, set environmental variable "spin_table_compat=no". After kernel
has updated spin table code, this default shall be changed.

Signed-off-by: York Sun 
---
Change since v1:
 Use tab instead of space after mnemonic.
 Fix comments.
 Change variable "s" to "spin" to avoid a conflict.

 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   12 ++
 arch/powerpc/cpu/mpc85xx/release.S|   35 -
 arch/powerpc/include/asm/config_mpc85xx.h |6 +
 3 files changed, 52 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index 736293c..66e13cb 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -350,6 +350,10 @@ int cpu_init_r(void)
 #elif defined(CONFIG_SYS_FSL_QORIQ_CHASSIS2)
struct ccsr_cluster_l2 * l2cache = (void __iomem 
*)CONFIG_SYS_FSL_CLUSTER_1_L2;
 #endif
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+   extern int spin_table_compat;
+   const char *spin;
+#endif
 
 #if defined(CONFIG_SYS_P4080_ERRATUM_CPU22) || \
defined(CONFIG_SYS_FSL_ERRATUM_NMG_CPU_A011)
@@ -395,6 +399,14 @@ int cpu_init_r(void)
}
 #endif
 
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+   spin = getenv("spin_table_compat");
+   if (spin && (*spin == 'n'))
+   spin_table_compat = 0;
+   else
+   spin_table_compat = 1;
+#endif
+
puts ("L2:");
 
 #if defined(CONFIG_L2_CACHE)
diff --git a/arch/powerpc/cpu/mpc85xx/release.S 
b/arch/powerpc/cpu/mpc85xx/release.S
index 4ba44a9..1f76925 100644
--- a/arch/powerpc/cpu/mpc85xx/release.S
+++ b/arch/powerpc/cpu/mpc85xx/release.S
@@ -351,6 +351,13 @@ __secondary_reset_vector:
.align L1_CACHE_SHIFT
.global __second_half_boot_page
 __second_half_boot_page:
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+   lis r3,(spin_table_compat - __second_half_boot_page)@h
+   ori r3,r3,(spin_table_compat - __second_half_boot_page)@l
+   add r3,r3,r11 /* r11 has the address of __second_half_boot_page */
+   lwz r14,0(r3)
+#endif
+
 #define EPAPR_MAGIC0x45504150
 #define ENTRY_ADDR_UPPER   0
 #define ENTRY_ADDR_LOWER   4
@@ -383,7 +390,24 @@ __second_half_boot_page:
stw r8,ENTRY_ADDR_LOWER(r10)
 
/* spin waiting for addr */
-3: lwz r4,ENTRY_ADDR_LOWER(r10)
+3:
+/*
+ * To comply with ePAPR 1.1, the spin table has been moved to cache-enabled
+ * memory. Old OS may not work with this change. A patch is waiting to be
+ * accepted for Linux kernel. Other OS needs similar fix to spin table.
+ * For OSes with old spin table code, we can enable this temporary fix by
+ * setting environmental variable "spin_table_compat". For new OSes, set
+ * "spin_table_compat=no". After Linux is fixed, we can remove this macro
+ * and related code. For now, it is enabled by default.
+ */
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+   cmpwi   r14,0
+   beq 4f
+   dcbf0, r10
+   sync
+4:
+#endif
+   lwz r4,ENTRY_ADDR_LOWER(r10)
andi.   r11,r4,1
bne 3b
isync
@@ -460,5 +484,14 @@ __second_half_boot_page:
.globl __spin_table
 __spin_table:
.space CONFIG_MAX_CPUS*ENTRY_SIZE
+
+#ifdef CONFIG_PPC_SPINTABLE_COMPATIBLE
+   .align L1_CACHE_SHIFT
+   .global spin_table_compat
+spin_table_compat:
+   .long   1
+
+#endif
+
 __spin_table_end:
.space 4096 - (__spin_table_end - __spin_table)
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 03baaee..8611766 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -27,6 +27,12 @@
 #error "Do not define CONFIG_SYS_CCSRBAR_DEFAULT in the board header file."
 #endif
 
+/*
+ * This macro should be removed when we no longer care about backwards
+ * compatibility with older operating systems.
+ */
+#define CONFIG_PPC_SPINTABLE_COMPATIBLE
+
 #define FSL_DDR_VER_4_747
 
 /* Number of TLB CAM entries we have on FSL Book-E chips */
-- 
1.7.9.5


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


Re: [U-Boot] ping failed; host 192.168.1.101 is not alive

2012-10-28 Thread Wolfgang Denk
Dear akdas75,

In message <34610904.p...@talk.nabble.com> you wrote:
> 
> I generate a macid from uboot/tools/gen_eth_addr.
> Still the ping says "host not alive"
> 
> I have attached the uboot log
> and also the wireshark snapshot on the host
> 
> host : 192.168.1.101
> development board : 192.168.1.100

Your host sees a pereectly fine ARP request, which is proof that the
network is bsicly operational, but it never sees any ICMP message.  Is
there any change that your host is running a firewall which is
blocking such requests?

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
SW engineering is a race between programmers trying  to  make  better
idiot-proof programs and the universe producing greater idiots.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2012-10-28 Thread Wolfgang Denk
Dear tom,

the following changes since commit 5bb3505fa867ded03cbee83f7722ab5182930637:

  Merge branch 'master' of git://git.denx.de/u-boot-arm (2012-10-26 15:44:31 
-0700)

are available in the git repository at:


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

for you to fetch changes up to 28aa27b608bddf20a655e10c09412f93d2f83a5a:

  ESTEEM192E: adjust linker script to grown code size (2012-10-28 20:18:32 
+0100)


Wolfgang Denk (3):
  PPC: remove dead boards (AMX860, c2mon, ETX094, IAD210, LANTEC, SCM)
  TQM8xx: adjust linker script to grown code size
  ESTEEM192E: adjust linker script to grown code size

 MAINTAINERS  |   6 -
 README   |   4 +-
 arch/powerpc/cpu/mpc8xx/fec.c|   2 +-
 arch/powerpc/cpu/mpc8xx/scc.c|  16 +-
 board/c2mon/Makefile |  44 ---
 board/c2mon/c2mon.c  | 236 
 board/c2mon/flash.c  | 570 
 board/c2mon/pcmcia.c | 282 --
 board/c2mon/u-boot.lds   | 106 --
 board/c2mon/u-boot.lds.debug | 137 ---
 board/esteem192e/u-boot.lds  |   1 -
 board/etx094/Makefile|  44 ---
 board/etx094/etx094.c| 384 ---
 board/etx094/flash.c | 687 -
 board/etx094/u-boot.lds  | 107 --
 board/lantec/Makefile|  44 ---
 board/lantec/flash.c | 625 --
 board/lantec/lantec.c| 208 --
 board/lantec/u-boot.lds  | 107 --
 board/lantec/u-boot.lds.debug| 137 ---
 board/siemens/IAD210/IAD210.c| 299 ---
 board/siemens/IAD210/Makefile|  44 ---
 board/siemens/IAD210/atm.c   | 652 
 board/siemens/IAD210/atm.h   | 287 --
 board/siemens/IAD210/flash.c | 502 -
 board/siemens/IAD210/u-boot.lds  | 107 --
 board/siemens/SCM/Makefile   |  49 ---
 board/siemens/SCM/flash.c| 488 
 board/siemens/SCM/fpga_scm.c | 104 -
 board/siemens/SCM/scm.c  | 541 --
 board/siemens/SCM/scm.h  |  89 -
 board/siemens/common/README  |  27 --
 board/siemens/common/fpga.c  | 369 --
 board/siemens/common/fpga.h  |  53 ---
 board/tqc/tqm8xx/u-boot.lds  |   4 +-
 board/westel/amx860/Makefile |  44 ---
 board/westel/amx860/amx860.c |  93 -
 board/westel/amx860/flash.c  | 637 ---
 board/westel/amx860/u-boot.lds   | 107 --
 board/westel/amx860/u-boot.lds.debug | 138 ---
 boards.cfg   |   7 -
 doc/README.scrapyard |   6 +
 include/commproc.h   | 131 +--
 include/configs/AMX860.h | 299 ---
 include/configs/ETX094.h | 357 --
 include/configs/IAD210.h | 381 ---
 include/configs/LANTEC.h | 358 --
 include/configs/SCM.h| 710 ---
 include/configs/c2mon.h  | 417 
 include/pcmcia.h |   2 -
 include/status_led.h |  36 --
 post/cpu/mpc8xx/ether.c  |  45 +--
 52 files changed, 17 insertions(+), 3 deletions(-)
 delete mode 100644 board/c2mon/Makefile
 delete mode 100644 board/c2mon/c2mon.c
 delete mode 100644 board/c2mon/flash.c
 delete mode 100644 board/c2mon/pcmcia.c
 delete mode 100644 board/c2mon/u-boot.lds
 delete mode 100644 board/c2mon/u-boot.lds.debug
 delete mode 100644 board/etx094/Makefile
 delete mode 100644 board/etx094/etx094.c
 delete mode 100644 board/etx094/flash.c
 delete mode 100644 board/etx094/u-boot.lds
 delete mode 100644 board/lantec/Makefile
 delete mode 100644 board/lantec/flash.c
 delete mode 100644 board/lantec/lantec.c
 delete mode 100644 board/lantec/u-boot.lds
 delete mode 100644 board/lantec/u-boot.lds.debug
 delete mode 100644 board/siemens/IAD210/IAD210.c
 delete mode 100644 board/siemens/IAD210/Makefile
 delete mode 100644 board/siemens/IAD210/atm.c
 delete mode 100644 board/siemens/IAD210/atm.h
 delete mode 100644 board/siemens/IAD210/flash.c
 delete mode 100644 board/siemens/IAD210/u-boot.lds
 delete mode 100644 board/siemens/SCM/Makefile
 delete mode 100644 board/siemens/SCM/flash.c
 delete mode 100644 board/siemens/SCM/fpga_scm.c
 delete mode 100644 board/siemens/SCM/scm.c
 delete mode 100644 board/siemens/SCM/scm.h
 delete mode 100644 board/siemens/common/README
 delete mode 100644 board/siemens/common/fpga.c
 delete mode 100644 board/siemens/common/fpga.h
 delete mode 100644 board/wes

Re: [U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Marek Vasut
Dear Dimax,

> HI,
> After power short u-boot fails to mount UBIFS and board stuck. Below is a
> trace of u-boot
> 
> Marvell>> boot
> 
> UBI: mtd1 is detached from ubi0
> 
> Creating 1 MTD partitions on "nand0":
> 
> 0x0050-0x2000 : "mtd=2"
> 
> UBI: attaching mtd1 to ubi0
> 
> UBI: physical eraseblock size:   131072 bytes (128 KiB)
> 
> UBI: logical eraseblock size:129024 bytes
> 
> UBI: smallest flash I/O unit:2048
> 
> UBI: sub-page size:  512
[...]

1) Is this an upstream u-boot?
2) Can you NAND (driver) do subpage writes ?

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


[U-Boot] [PATCH v10] Add dmmalloc module for DM.

2012-10-28 Thread Tomas Hlavacek
Add pointer to the first early heap into GD structure.
Implement simple early_malloc and early_free functions.
Prepare for additional heaps and automated heap initialization.
Add temporary early_malloc_active function (to be replaced in future by
more coarse DM init flags).
Add DM specific malloc calls - dmmalloc, dmfree, dmrealloc and dmcalloc.

Signed-off-by: Tomas Hlavacek 
---
Changes in v10:
   - Change GD type to struct early_heap_header *.
   - Move dmmalloc, dmfree, ... function from .h to dmmalloc.c .
   - Rework early_malloc_active() to use new GD_FLG_HEAP_INIT flag.
   - Add early_heap_active() and GD_FLG_EARLY_HEAP_DONE flag.
   - Rework dmrealloc() and dmfree() to use new flags and support relocation.
   - Rename early_heap_dump() to early_malloc_heap_dump().
   - Add early_malloc_dump.
   - Drop conditional undef CONFIG_SYS_EARLY_MALLOC in dmmalloc.h.
   - Moved struct early_block_header and macros to dmmalloc.c.

Changes in v9:
   - Rework early_malloc to keep track of allocated block size.
   - Add early_free and dmfree functions.
   - Rework dmrealloc.

Changes in v8:
   - Add dmcalloc() implementation.
   - Add comments to function prototypes in dmmalloc.h.

Changes in v7:
   - Rework check of first heap in early_brk().

Changes in v6:
   - Move dmmalloc() and all dm* functions to dmmalloc.h.
   - Fix bool expression in early_malloc_active().

 arch/arm/include/asm/global_data.h|8 +
 arch/avr32/include/asm/global_data.h  |7 +
 arch/blackfin/include/asm/global_data.h   |6 +
 arch/m68k/include/asm/global_data.h   |8 +
 arch/microblaze/include/asm/global_data.h |8 +
 arch/mips/include/asm/global_data.h   |6 +
 arch/nds32/include/asm/global_data.h  |8 +
 arch/nios2/include/asm/global_data.h  |7 +
 arch/openrisc/include/asm/global_data.h   |8 +
 arch/powerpc/include/asm/global_data.h|6 +
 arch/sandbox/include/asm/global_data.h|7 +
 arch/sh/include/asm/global_data.h |7 +
 arch/sparc/include/asm/global_data.h  |6 +
 arch/x86/include/asm/global_data.h|8 +
 common/Makefile   |1 +
 common/dmmalloc.c |  297 +
 include/asm-generic/global_data_flags.h   |6 +-
 include/dmmalloc.h|  132 +
 18 files changed, 534 insertions(+), 2 deletions(-)
 create mode 100644 common/dmmalloc.c
 create mode 100644 include/dmmalloc.h

diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index 2b9af93..01075dc 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -23,6 +23,11 @@
 
 #ifndef__ASM_GBL_DATA_H
 #define __ASM_GBL_DATA_H
+
+#ifdef CONFIG_SYS_EARLY_MALLOC
+#include 
+#endif /* CONFIG_SYS_EARLY_MALLOC */
+
 /*
  * The following data structure is placed in some memory which is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -82,6 +87,9 @@ typedef   struct  global_data {
unsigned long   post_log_res; /* success of POST test */
unsigned long   post_init_f_time; /* When post_init_f started */
 #endif
+#ifdef CONFIG_SYS_EARLY_MALLOC
+   struct early_heap_header *early_heap;   /* heap for early_malloc */
+#endif
 } gd_t;
 
 #include 
diff --git a/arch/avr32/include/asm/global_data.h 
b/arch/avr32/include/asm/global_data.h
index bf661e2..ba9cf0e 100644
--- a/arch/avr32/include/asm/global_data.h
+++ b/arch/avr32/include/asm/global_data.h
@@ -22,6 +22,10 @@
 #ifndef __ASM_GLOBAL_DATA_H__
 #define __ASM_GLOBAL_DATA_H__
 
+#ifdef CONFIG_SYS_EARLY_MALLOC
+#include 
+#endif /* CONFIG_SYS_EARLY_MALLOC */
+
 /*
  * The following data structure is placed in some memory wich is
  * available very early after boot (like DPRAM on MPC8xx/MPC82xx, or
@@ -48,6 +52,9 @@ typedef   struct  global_data {
 #endif
void**jt;   /* jump table */
charenv_buf[32];/* buffer for getenv() before reloc. */
+#ifdef CONFIG_SYS_EARLY_MALLOC
+   struct early_heap_header *early_heap;   /* heap for early_malloc */
+#endif
 } gd_t;
 
 #include 
diff --git a/arch/blackfin/include/asm/global_data.h 
b/arch/blackfin/include/asm/global_data.h
index d91e5a4..daeb314 100644
--- a/arch/blackfin/include/asm/global_data.h
+++ b/arch/blackfin/include/asm/global_data.h
@@ -29,6 +29,9 @@
 #define __ASM_GBL_DATA_H
 
 #include 
+#ifdef CONFIG_SYS_EARLY_MALLOC
+#include 
+#endif /* CONFIG_SYS_EARLY_MALLOC */
 
 /*
  * The following data structure is placed in some memory wich is
@@ -57,6 +60,9 @@ typedef struct global_data {
 
void**jt;   /* jump table */
charenv_buf[32];/* buffer for getenv() before reloc. */
+#ifdef CONFIG_SYS_EARLY_MALLOC
+   struct early_heap_header *early_heap;   /* heap for early_malloc */
+#endif
 } gd_t;
 
 #include 
diff --git a/arch/m68k/include/asm/global_data.h 
b/arch/m68k/in

Re: [U-Boot] [U-Boot, 2/6] fdt: Limit printed hex in fdt print and list commands

2012-10-28 Thread Jerry Van Baren
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi Tom, Joe,

On 10/25/2012 04:59 PM, Tom Rini wrote:
> On Fri, Aug 17, 2012 at 10:34:36AM -, Joe Hershberger wrote:
> 
>> Prevent printing the entire image in a itb. It is most likely 
>> unhelpful to have the hex of the entire image scroll for minutes 
>> on your slow serial console.
>> 
>> Signed-off-by: Joe Hershberger 
> 
> This causes: $ uboot-build.sh sandboxTesting sandbox on 
> -4-gf0a29d4 Thu Oct 25 13:59:03 MST 2012 Configuring for 
> sandbox board... textdata bss dec hex filename 
> 1402456332   28472  175049   2abc9 sandbox/u-boot cmd_fdt.c:
> In function 'print_data': cmd_fdt.c:679:32: warning: cast from
> pointer to integer of different size [-Wpointer-to-int-cast] 
> cmd_fdt.c:691:32: warning: cast from pointer to integer of 
> different size [-Wpointer-to-int-cast]

Sorry, I should have caught that and the 3/6 warning. :-(

I'm tied up with a flight test through Friday (Nov 2) which has been
consuming all my available time.  Joe, can you look at fixing the
warnings?

Thanks,
gvb

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

iQEcBAEBAgAGBQJQjdPPAAoJEGOcKeGailWqeSMH/itjpDTCi/dNf3wdDHImpTev
r9A7Ygk01eLhPWlLX5sV9+GziO1x1s8Z9mRbpdIBz4NeA5vaB79wS3D2/S06dxh8
DeSlk3U8eo4tNiI9OysDDp5IyxNXEmje4KkOD8snLIeYKV3/1RDPQYzsLrzlGVJ6
dFjPGNHmjLWzMi4kOSR34b6SIl1xPCUtBUgMfMTN6R8S5JLuJKSn/WUUcXtHpras
yKYfvs1ULkmMg4aEbKzCWFa/a/JJK+XlxU4XQX2Xd7HSISg0eIoOJSV5khTCG8gR
SVCkbF89+XO749a9xL3jyTEz1xMPqFO3KugbnyZGtsOm87VWyuZ/qzR4KdC2rJA=
=ox6g
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] s3c64xx: fix the compiler error and warning

2012-10-28 Thread Minkyu Kang
2012. 10. 26. 19:12 Marek Vasut  작성:

> Dear Jaehoon Chung,
>
>> From: Minkyu Kang 
>>
>> This patch is fixing the following errors
> [...]
>
> Acked-by: Marek Vasut 
>
> Best regards,
> Marek Vasut
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

applied to u-boot-samsung

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


Re: [U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Dimax
Hi.
1) Is this an upstream u-boot?

Marvell>> version

U-Boot 2011.12 (Jan 08 2012 - 21:53:47)
Marvell-Sheevaplug - eSATA - SD/MMC
gcc (Debian 4.6.2-9) 4.6.2
GNU ld (GNU Binutils for Debian) 2.22

I will try latest one today.

2) Can you NAND (driver) do subpage writes ?

How can I know it?

On Mon, Oct 29, 2012 at 12:54 AM, Marek Vasut  wrote:

> Dear Dimax,
>
> > HI,
> > After power short u-boot fails to mount UBIFS and board stuck. Below is a
> > trace of u-boot
> >
> > Marvell>> boot
> >
> > UBI: mtd1 is detached from ubi0
> >
> > Creating 1 MTD partitions on "nand0":
> >
> > 0x0050-0x2000 : "mtd=2"
> >
> > UBI: attaching mtd1 to ubi0
> >
> > UBI: physical eraseblock size:   131072 bytes (128 KiB)
> >
> > UBI: logical eraseblock size:129024 bytes
> >
> > UBI: smallest flash I/O unit:2048
> >
> > UBI: sub-page size:  512
> [...]
>
> 1) Is this an upstream u-boot?
> 2) Can you NAND (driver) do subpage writes ?
>
> Best regards,
> Marek Vasut
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 0/6 V8] EXYNOS5: Enable SPI support

2012-10-28 Thread Hatim Ali
This patch set adds SPI driver for EXYNOS5 and enables same.
This patch set is based on latest u-boot-samsung.git tree.

Changes in V2:
- Correted the Commit message.
Changes in V3:
- Removed SPI_SLAVE Flag.
- Corrected warning messages.
Changes in V4:
- Rebased on mainline u-boot.git
- Incorporated review comments for SPI driver.
Changes in V5:
- Rebased on u-boot-samsung.git
- Incorporated review comments by Simon Glass
Changes in V6:
- Incorporated review comments by Minkyu Kang
Changes in V7:
- Incorporated review comments by Minkyu Kang & Simon Glass
Changes in V8:
- Rebased on u-boot-samsung.git

Hatim Ali (2):
  EXYNOS: Add clock for SPI
  EXYNOS5: Enable SPI

Rajeshwari Shinde (4):
  EXYNOS5: Add pinmux support for SPI
  EXYNOS5: Add base address for SPI.
  SPI: Add SPI Driver for EXYNOS.
  EXYNOS5: Enable SPI booting.

 arch/arm/cpu/armv7/exynos/clock.c |  125 ++
 arch/arm/cpu/armv7/exynos/pinmux.c|   51 
 arch/arm/include/asm/arch-exynos/clk.h|1 +
 arch/arm/include/asm/arch-exynos/cpu.h|6 +
 arch/arm/include/asm/arch-exynos/periph.h |5 +
 arch/arm/include/asm/arch-exynos/spi.h|   78 ++
 board/samsung/smdk5250/Makefile   |2 +-
 board/samsung/smdk5250/mmc_boot.c |   58 -
 board/samsung/smdk5250/smdk5250.c |4 +
 board/samsung/smdk5250/spl_boot.c |   85 +++
 drivers/spi/Makefile  |1 +
 drivers/spi/exynos_spi.c  |  367 +
 include/configs/smdk5250.h|   27 ++-
 13 files changed, 750 insertions(+), 60 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/spi.h
 delete mode 100644 board/samsung/smdk5250/mmc_boot.c
 create mode 100644 board/samsung/smdk5250/spl_boot.c
 create mode 100644 drivers/spi/exynos_spi.c

-- 
1.7.2.3

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


[U-Boot] [PATCH 1/6 V8] EXYNOS5: Add pinmux support for SPI

2012-10-28 Thread Hatim Ali
From: Rajeshwari Shinde 

This patch adds pinmux support for SPI channels

Signed-off-by: Rajeshwari Shinde 
Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v4:
Fixed minor nits suggested by Simon Glass
Changes since v5:
No change
Changes since v6:
Incorporated review comments by Simon Glass & Minkyu Kang
Changes since v7:
Added Acked-by Simon Glass


diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
b/arch/arm/cpu/armv7/exynos/pinmux.c
index 5796d56..3ecbf7d 100644
--- a/arch/arm/cpu/armv7/exynos/pinmux.c
+++ b/arch/arm/cpu/armv7/exynos/pinmux.c
@@ -112,6 +112,7 @@ static int exynos5_mmc_config(int peripheral, int flags)
s5p_gpio_set_pull(bank, i, GPIO_PULL_UP);
s5p_gpio_set_drv(bank, i, GPIO_DRV_4X);
}
+
return 0;
 }
 
@@ -230,6 +231,49 @@ static void exynos5_i2c_config(int peripheral, int flags)
}
 }
 
+void exynos5_spi_config(int peripheral)
+{
+   int cfg = 0, pin = 0, i;
+   struct s5p_gpio_bank *bank = NULL;
+   struct exynos5_gpio_part1 *gpio1 =
+   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
+   struct exynos5_gpio_part2 *gpio2 =
+   (struct exynos5_gpio_part2 *) samsung_get_base_gpio_part2();
+
+   switch (peripheral) {
+   case PERIPH_ID_SPI0:
+   bank = &gpio1->a2;
+   cfg = GPIO_FUNC(0x2);
+   pin = 0;
+   break;
+   case PERIPH_ID_SPI1:
+   bank = &gpio1->a2;
+   cfg = GPIO_FUNC(0x2);
+   pin = 4;
+   break;
+   case PERIPH_ID_SPI2:
+   bank = &gpio1->b1;
+   cfg = GPIO_FUNC(0x5);
+   pin = 1;
+   break;
+   case PERIPH_ID_SPI3:
+   bank = &gpio2->f1;
+   cfg = GPIO_FUNC(0x2);
+   pin = 0;
+   break;
+   case PERIPH_ID_SPI4:
+   for (i = 0; i < 2; i++) {
+   s5p_gpio_cfg_pin(&gpio2->f0, i + 2, GPIO_FUNC(0x4));
+   s5p_gpio_cfg_pin(&gpio2->e0, i + 4, GPIO_FUNC(0x4));
+   }
+   break;
+   }
+   if (peripheral != PERIPH_ID_SPI4) {
+   for (i = pin; i < pin + 4; i++)
+   s5p_gpio_cfg_pin(bank, i, cfg);
+   }
+}
+
 static int exynos5_pinmux_config(int peripheral, int flags)
 {
switch (peripheral) {
@@ -257,6 +301,13 @@ static int exynos5_pinmux_config(int peripheral, int flags)
case PERIPH_ID_I2C7:
exynos5_i2c_config(peripheral, flags);
break;
+   case PERIPH_ID_SPI0:
+   case PERIPH_ID_SPI1:
+   case PERIPH_ID_SPI2:
+   case PERIPH_ID_SPI3:
+   case PERIPH_ID_SPI4:
+   exynos5_spi_config(peripheral);
+   break;
default:
debug("%s: invalid peripheral %d", __func__, peripheral);
return -1;
diff --git a/arch/arm/include/asm/arch-exynos/periph.h 
b/arch/arm/include/asm/arch-exynos/periph.h
index 082611c..4054fb6 100644
--- a/arch/arm/include/asm/arch-exynos/periph.h
+++ b/arch/arm/include/asm/arch-exynos/periph.h
@@ -44,6 +44,11 @@ enum periph_id {
PERIPH_ID_SDMMC3,
PERIPH_ID_SDMMC4,
PERIPH_ID_SROMC,
+   PERIPH_ID_SPI0,
+   PERIPH_ID_SPI1,
+   PERIPH_ID_SPI2,
+   PERIPH_ID_SPI3,
+   PERIPH_ID_SPI4,
PERIPH_ID_UART0,
PERIPH_ID_UART1,
PERIPH_ID_UART2,
-- 
1.7.2.3

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


[U-Boot] [PATCH 2/6 V8] EXYNOS: Add clock for SPI

2012-10-28 Thread Hatim Ali
Add api to calculate and set the clock for SPI channels

Signed-off-by: James Miller 
Signed-off-by: Simon Glass 
Signed-off-by: Rajeshwari Shinde 
Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v4:
Added Signed-off-by of James Miller
Changes since v5:
Incorporated review comments by Minkyu Kang
Changes since v6:
Based on the review by Minkyu Kang, moved the include periph.h define 
to 
clock.c file
Changes since v7:
Rebased on u-boot-samsung.git
Added Acked-by Simon Glass

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index a042423..ec14e96 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /* exynos: return pll clock frequency */
 static int exynos_get_pll_clk(int pllreg, unsigned int r, unsigned int k)
@@ -706,6 +707,122 @@ static unsigned long exynos5_get_i2c_clk(void)
return aclk_66;
 }
 
+/**
+ * Linearly searches for the most accurate main and fine stage clock scalars
+ * (divisors) for a specified target frequency and scalar bit sizes by checking
+ * all multiples of main_scalar_bits values. Will always return scalars up to 
or
+ * slower than target.
+ *
+ * @param main_scalar_bits Number of main scalar bits, must be > 0 and < 32
+ * @param fine_scalar_bits Number of fine scalar bits, must be > 0 and < 32
+ * @param input_freq   Clock frequency to be scaled in Hz
+ * @param target_freq  Desired clock frequency in Hz
+ * @param best_fine_scalar Pointer to store the fine stage divisor
+ *
+ * @return best_main_scalarMain scalar for desired frequency or -1 if none
+ * found
+ */
+static int clock_calc_best_scalar(unsigned int main_scaler_bits,
+   unsigned int fine_scalar_bits, unsigned int input_rate,
+   unsigned int target_rate, unsigned int *best_fine_scalar)
+{
+   int i;
+   int best_main_scalar = -1;
+   unsigned int best_error = target_rate;
+   const unsigned int cap = (1 << fine_scalar_bits) - 1;
+   const unsigned int loops = 1 << main_scaler_bits;
+
+   debug("Input Rate is %u, Target is %u, Cap is %u\n", input_rate,
+   target_rate, cap);
+
+   assert(best_fine_scalar != NULL);
+   assert(main_scaler_bits <= fine_scalar_bits);
+
+   *best_fine_scalar = 1;
+
+   if (input_rate == 0 || target_rate == 0)
+   return -1;
+
+   if (target_rate >= input_rate)
+   return 1;
+
+   for (i = 1; i <= loops; i++) {
+   const unsigned int effective_div = max(min(input_rate / i /
+   target_rate, cap), 1);
+   const unsigned int effective_rate = input_rate / i /
+   effective_div;
+   const int error = target_rate - effective_rate;
+
+   debug("%d|effdiv:%u, effrate:%u, error:%d\n", i, effective_div,
+   effective_rate, error);
+
+   if (error >= 0 && error <= best_error) {
+   best_error = error;
+   best_main_scalar = i;
+   *best_fine_scalar = effective_div;
+   }
+   }
+
+   return best_main_scalar;
+}
+
+static int exynos5_set_spi_clk(enum periph_id periph_id,
+   unsigned int rate)
+{
+   struct exynos5_clock *clk =
+   (struct exynos5_clock *)samsung_get_base_clock();
+   int main;
+   unsigned int fine;
+   unsigned shift, pre_shift;
+   unsigned mask = 0xff;
+   u32 *reg;
+
+   main = clock_calc_best_scalar(4, 8, 4, rate, &fine);
+   if (main < 0) {
+   debug("%s: Cannot set clock rate for periph %d",
+   __func__, periph_id);
+   return -1;
+   }
+   main = main - 1;
+   fine = fine - 1;
+
+   switch (periph_id) {
+   case PERIPH_ID_SPI0:
+   reg = &clk->div_peric1;
+   shift = 0;
+   pre_shift = 8;
+   break;
+   case PERIPH_ID_SPI1:
+   reg = &clk->div_peric1;
+   shift = 16;
+   pre_shift = 24;
+   break;
+   case PERIPH_ID_SPI2:
+   reg = &clk->div_peric2;
+   shift = 0;
+   pre_shift = 8;
+   break;
+   case PERIPH_ID_SPI3:
+   reg = &clk->sclk_div_isp;
+   shift = 0;
+   pre_shift = 4;
+   break;
+   case PERIPH_ID_SPI4:
+   reg = &clk->sclk_div_isp;
+   shift = 12;
+   pre_shift = 16;
+   break;
+   default:
+   debug("%s: Unsupported peripheral ID %d\n", __func__,
+ periph_id);
+   return -1;
+   }
+   clrsetbits_l

[U-Boot] [PATCH 3/6 V8] EXYNOS5: Add base address for SPI.

2012-10-28 Thread Hatim Ali
From: Rajeshwari Shinde 

Add base address definition for SPI device on Exynos.

Signed-off-by: Rajeshwari Shinde 
Acked-by: Simon Glass 
---
Changes since v4:
- Rebased on u-boot-samsung.git
- Added Acked-by Simon Glass
Changes since v5:
No Change
Changes since v6:
No Change
Changes since v7:
No Change

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index 2bde10c..b87e7da 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -51,12 +51,14 @@
 #define EXYNOS4_UART_BASE  0x1380
 #define EXYNOS4_I2C_BASE   0x1386
 #define EXYNOS4_ADC_BASE   0x1391
+#define EXYNOS4_SPI_BASE   0x1392
 #define EXYNOS4_PWMTIMER_BASE  0x139D
 #define EXYNOS4_MODEM_BASE 0x13A0
 #define EXYNOS4_USBPHY_CONTROL 0x10020704
 
 #define EXYNOS4_GPIO_PART4_BASEDEVICE_NOT_AVAILABLE
 #define EXYNOS4_DP_BASEDEVICE_NOT_AVAILABLE
+#define EXYNOS4_SPI_ISP_BASE   DEVICE_NOT_AVAILABLE
 
 /* EXYNOS5 */
 #define EXYNOS5_I2C_SPACING0x1
@@ -81,7 +83,9 @@
 #define EXYNOS5_SROMC_BASE 0x1225
 #define EXYNOS5_UART_BASE  0x12C0
 #define EXYNOS5_I2C_BASE   0x12C6
+#define EXYNOS5_SPI_BASE   0x12D2
 #define EXYNOS5_PWMTIMER_BASE  0x12DD
+#define EXYNOS5_SPI_ISP_BASE   0x131A
 #define EXYNOS5_GPIO_PART2_BASE0x1340
 #define EXYNOS5_FIMD_BASE  0x1440
 #define EXYNOS5_DP_BASE0x145B
@@ -182,6 +186,8 @@ SAMSUNG_BASE(usb_ehci, USB_HOST_EHCI_BASE)
 SAMSUNG_BASE(usb_otg, USBOTG_BASE)
 SAMSUNG_BASE(watchdog, WATCHDOG_BASE)
 SAMSUNG_BASE(power, POWER_BASE)
+SAMSUNG_BASE(spi, SPI_BASE)
+SAMSUNG_BASE(spi_isp, SPI_ISP_BASE)
 #endif
 
 #endif /* _EXYNOS4_CPU_H */
-- 
1.7.2.3

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


[U-Boot] [PATCH 4/6 V8] SPI: Add SPI Driver for EXYNOS.

2012-10-28 Thread Hatim Ali
From: Rajeshwari Shinde 

This patch adds SPI driver for EXYNOS.

Signed-off-by: Simon Glass 
Signed-off-by: Padmavathi Venna 
Signed-off-by: Gabe Black 
Signed-off-by: Rajeshwari Shinde 
Signed-off-by: Hatim Ali 
Acked-by: Mike Frysinger 
Acked-by: Simon Glass 
Tested-by: jy0922.s...@samsung.com
---
Changes since V4:
- Changed SPI bus frequency to 10 Mhz
Changes since V5:
- Incorporated changes by Minkyu Kang
Changes since V6:
- No Change
Changes since V7:
- Incorporated minor nit as suggested by Simon Glass (added blank line)
- Added Acked-by Simon Glass

diff --git a/arch/arm/include/asm/arch-exynos/spi.h 
b/arch/arm/include/asm/arch-exynos/spi.h
new file mode 100644
index 000..7cab1e9
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/spi.h
@@ -0,0 +1,78 @@
+/*
+ * (C) Copyright 2012 SAMSUNG Electronics
+ * Padmavathi Venna 
+ *
+ * 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
+ */
+
+#ifndef __ASM_ARCH_EXYNOS_COMMON_SPI_H_
+#define __ASM_ARCH_EXYNOS_COMMON_SPI_H_
+
+#ifndef __ASSEMBLY__
+
+/* SPI peripheral register map; padded to 64KB */
+struct exynos_spi {
+   unsigned intch_cfg; /* 0x00 */
+   unsigned char   reserved0[4];
+   unsigned intmode_cfg;   /* 0x08 */
+   unsigned intcs_reg; /* 0x0c */
+   unsigned char   reserved1[4];
+   unsigned intspi_sts;/* 0x14 */
+   unsigned inttx_data;/* 0x18 */
+   unsigned intrx_data;/* 0x1c */
+   unsigned intpkt_cnt;/* 0x20 */
+   unsigned char   reserved2[4];
+   unsigned char   reserved3[4];
+   unsigned intfb_clk; /* 0x2c */
+   unsigned char   padding[0xffd0];
+};
+
+#define EXYNOS_SPI_MAX_FREQ5000
+
+#define SPI_TIMEOUT_MS 10
+
+/* SPI_CHCFG */
+#define SPI_CH_HS_EN   (1 << 6)
+#define SPI_CH_RST (1 << 5)
+#define SPI_SLAVE_MODE (1 << 4)
+#define SPI_CH_CPOL_L  (1 << 3)
+#define SPI_CH_CPHA_B  (1 << 2)
+#define SPI_RX_CH_ON   (1 << 1)
+#define SPI_TX_CH_ON   (1 << 0)
+
+/* SPI_MODECFG */
+#define SPI_MODE_CH_WIDTH_WORD (0x2 << 29)
+#define SPI_MODE_BUS_WIDTH_WORD(0x2 << 17)
+
+/* SPI_CSREG */
+#define SPI_SLAVE_SIG_INACT(1 << 0)
+
+/* SPI_STS */
+#define SPI_ST_TX_DONE (1 << 25)
+#define SPI_FIFO_LVL_MASK  0x1ff
+#define SPI_TX_LVL_OFFSET  6
+#define SPI_RX_LVL_OFFSET  15
+
+/* Feedback Delay */
+#define SPI_CLK_BYPASS (0 << 0)
+#define SPI_FB_DELAY_90(1 << 0)
+#define SPI_FB_DELAY_180   (2 << 0)
+#define SPI_FB_DELAY_270   (3 << 0)
+
+/* Packet Count */
+#define SPI_PACKET_CNT_EN  (1 << 16)
+
+#endif /* __ASSEMBLY__ */
+#endif
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index f0b82c6..824d357 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -34,6 +34,7 @@ COBJS-$(CONFIG_BFIN_SPI) += bfin_spi.o
 COBJS-$(CONFIG_CF_SPI) += cf_spi.o
 COBJS-$(CONFIG_CF_QSPI) += cf_qspi.o
 COBJS-$(CONFIG_DAVINCI_SPI) += davinci_spi.o
+COBJS-$(CONFIG_EXYNOS_SPI) += exynos_spi.o
 COBJS-$(CONFIG_KIRKWOOD_SPI) += kirkwood_spi.o
 COBJS-$(CONFIG_MPC52XX_SPI) += mpc52xx_spi.o
 COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
diff --git a/drivers/spi/exynos_spi.c b/drivers/spi/exynos_spi.c
new file mode 100644
index 000..3e6c18f
--- /dev/null
+++ b/drivers/spi/exynos_spi.c
@@ -0,0 +1,367 @@
+/*
+ * (C) Copyright 2012 SAMSUNG Electronics
+ * Padmavathi Venna 
+ *
+ * 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  021

[U-Boot] [PATCH 5/6 V8] EXYNOS5: Enable SPI

2012-10-28 Thread Hatim Ali
This patch enables SPI driver for EXYNOS5.

Signed-off-by: Rajeshwari Shinde 
Signed-off-by: Hatim Ali 
Acked-by: Simon Glass 
---
Changes since v4:
- Rebased on u-boot-samsung.git
Changes since v5:
No change
Changes since v6:
Removed unused define from the config file
Changes since v7:
- Rebased on u-boot-samsung.git
- Added Acked by Simon Glass

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 18dd5d2..4c50342 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -67,6 +68,9 @@ int board_init(void)
 #if defined(CONFIG_PMIC)
pmic_init();
 #endif
+#ifdef CONFIG_EXYNOS_SPI
+   spi_init();
+#endif
return 0;
 }
 
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 89f442b..4069500 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -163,7 +163,6 @@
 #undef CONFIG_CMD_IMLS
 #define CONFIG_IDENT_STRING" for SMDK5250"
 
-#define CONFIG_ENV_IS_IN_MMC
 #define CONFIG_SYS_MMC_ENV_DEV 0
 
 #define CONFIG_SECURE_BL1_ONLY
@@ -209,6 +208,27 @@
 #define CONFIG_PMIC_I2C
 #define CONFIG_PMIC_MAX77686
 
+/* SPI */
+#define CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_SPI_FLASH
+
+#ifdef CONFIG_SPI_FLASH
+#define CONFIG_EXYNOS_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH_WINBOND
+#define CONFIG_SF_DEFAULT_MODE SPI_MODE_0
+#define CONFIG_SF_DEFAULT_SPEED5000
+#define EXYNOS5_SPI_NUM_CONTROLLERS5
+#endif
+
+#ifdef CONFIG_ENV_IS_IN_SPI_FLASH
+#define CONFIG_ENV_SPI_MODESPI_MODE_0
+#define CONFIG_ENV_SECT_SIZE   CONFIG_ENV_SIZE
+#define CONFIG_ENV_SPI_BUS 1
+#define CONFIG_ENV_SPI_MAX_HZ  5000
+#endif
+
 /* Ethernet Controllor Driver */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_SMC911X
-- 
1.7.2.3

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


[U-Boot] [PATCH 6/6 V8] EXYNOS5: Enable SPI booting.

2012-10-28 Thread Hatim Ali
From: Rajeshwari Shinde 

This patch enables SPI Booting for EXYNOS5

Signed-off-by: Rajeshwari Shinde 
---
Changes since v4:
No Change
Changes since v5:
No Change
Changes since v6:
No Change
Changes since v7:
No Change

diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
index 1474fa8..47c6a5a 100644
--- a/board/samsung/smdk5250/Makefile
+++ b/board/samsung/smdk5250/Makefile
@@ -36,7 +36,7 @@ COBJS += smdk5250.o
 endif
 
 ifdef CONFIG_SPL_BUILD
-COBJS  += mmc_boot.o
+COBJS  += spl_boot.o
 endif
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/samsung/smdk5250/mmc_boot.c 
b/board/samsung/smdk5250/mmc_boot.c
deleted file mode 100644
index 449a919..000
--- a/board/samsung/smdk5250/mmc_boot.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics
- *
- * 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
-
-/*
-* Copy U-boot from mmc to RAM:
-* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
-* Pointer to API (Data transfer from mmc to ram)
-*/
-void copy_uboot_to_ram(void)
-{
-   u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
-
-   copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
-}
-
-void board_init_f(unsigned long bootflag)
-{
-   __attribute__((noreturn)) void (*uboot)(void);
-   copy_uboot_to_ram();
-
-   /* Jump to U-Boot image */
-   uboot = (void *)CONFIG_SYS_TEXT_BASE;
-   (*uboot)();
-   /* Never returns Here */
-}
-
-/* Place Holders */
-void board_init_r(gd_t *id, ulong dest_addr)
-{
-   /* Function attribute is no-return */
-   /* This Function never executes */
-   while (1)
-   ;
-}
-
-void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
diff --git a/board/samsung/smdk5250/spl_boot.c 
b/board/samsung/smdk5250/spl_boot.c
new file mode 100644
index 000..d8f3c1e
--- /dev/null
+++ b/board/samsung/smdk5250/spl_boot.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * 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
+
+enum boot_mode {
+   BOOT_MODE_MMC = 4,
+   BOOT_MODE_SERIAL = 20,
+   /* Boot based on Operating Mode pin settings */
+   BOOT_MODE_OM = 32,
+   BOOT_MODE_USB,  /* Boot using USB download */
+};
+
+   typedef u32 (*spi_copy_func_t)(u32 offset, u32 nblock, u32 dst);
+
+/*
+* Copy U-boot from mmc to RAM:
+* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
+* Pointer to API (Data transfer from mmc to ram)
+*/
+void copy_uboot_to_ram(void)
+{
+   spi_copy_func_t spi_copy;
+   enum boot_mode bootmode;
+   u32 (*copy_bl2)(u32, u32, u32);
+
+   bootmode = readl(EXYNOS5_POWER_BASE) & OM_STAT;
+
+   switch (bootmode) {
+   case BOOT_MODE_SERIAL:
+   spi_copy = *(spi_copy_func_t *)EXYNOS_COPY_SPI_FNPTR_ADDR;
+   spi_copy(SPI_FLASH_UBOOT_POS, CONFIG_BL2_SIZE,
+   CONFIG_SYS_TEXT_BASE);
+   break;
+   case BOOT_MODE_MMC:
+   copy_bl2 = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+   copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
+   CONFIG_SYS_TEXT_BASE);
+   break;
+   default:
+   break;
+   }
+}
+
+void board_init_f(unsigned long bootflag)
+{
+   __attribute__((noreturn)) void (*uboot)(void);
+

Re: [U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Dimax
Tried latest available version for SheevaPlug:

Marvell>> version
U-Boot 2012.04.01 (Jun 01 2012 - 02:27:06)
Marvell-Sheevaplug - eSATA - SD/MMC
gcc (Debian 4.6.3-5) 4.6.3
GNU ld (GNU Binutils for Debian) 2.22

Same result.
Do you know if u-boot has a functionality to recover ubifs partitions?



On Mon, Oct 29, 2012 at 7:25 AM, Dimax  wrote:

> Hi.
>
> 1) Is this an upstream u-boot?
>
> Marvell>> version
>
> U-Boot 2011.12 (Jan 08 2012 - 21:53:47)
> Marvell-Sheevaplug - eSATA - SD/MMC
> gcc (Debian 4.6.2-9) 4.6.2
> GNU ld (GNU Binutils for Debian) 2.22
>
> I will try latest one today.
>
>
> 2) Can you NAND (driver) do subpage writes ?
>
> How can I know it?
>
>
> On Mon, Oct 29, 2012 at 12:54 AM, Marek Vasut  wrote:
>
>> Dear Dimax,
>>
>> > HI,
>> > After power short u-boot fails to mount UBIFS and board stuck. Below is
>> a
>> > trace of u-boot
>> >
>> > Marvell>> boot
>> >
>> > UBI: mtd1 is detached from ubi0
>> >
>> > Creating 1 MTD partitions on "nand0":
>> >
>> > 0x0050-0x2000 : "mtd=2"
>> >
>> > UBI: attaching mtd1 to ubi0
>> >
>> > UBI: physical eraseblock size:   131072 bytes (128 KiB)
>> >
>> > UBI: logical eraseblock size:129024 bytes
>> >
>> > UBI: smallest flash I/O unit:2048
>> >
>> > UBI: sub-page size:  512
>> [...]
>>
>> 1) Is this an upstream u-boot?
>> 2) Can you NAND (driver) do subpage writes ?
>>
>> Best regards,
>> Marek Vasut
>>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Andreas Bießmann
Dear Dimax,

On 29.10.12 07:38, Dimax wrote:
> Tried latest available version for SheevaPlug:
> 
> Marvell>> version
> U-Boot 2012.04.01 (Jun 01 2012 - 02:27:06)
> Marvell-Sheevaplug - eSATA - SD/MMC
> gcc (Debian 4.6.3-5) 4.6.3
> GNU ld (GNU Binutils for Debian) 2.22
> 
> Same result.
> Do you know if u-boot has a functionality to recover ubifs partitions?

It should work. AFAIR there is a problem when the malloc arena is to
small. I do currently not know if [1] made it into mainline.
However, can you please check if expanding the CONFIG_SYS_MALLOC_LEN
fixes your problem?

Best regards

Andreas Bießmann

[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/124769
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] UBIFS fails on SheevaPlug

2012-10-28 Thread Dimax
HI,
So you say I have to rebuild u-boot with expanded CONFIG_SYS_MALLOC_LEN.
So far I have used rebuild images from:
http://people.debian.org/~tbm/u-boot/2011.12-3/sheevaplug/u-boot.kwb

I see following files in the parrent directory:

[image: [   ]] u-boot_2012.04.01-2.debian.tar.gz
[image:
[   ]] u-boot_2012.04.01-2_armel.deb
[image:
[   ]] u-boot_2012.04.01.orig.tar.bz2


Is it all I need to rebuild?
Are there any general instructions?


On Mon, Oct 29, 2012 at 8:48 AM, Andreas Bießmann <
andreas.de...@googlemail.com> wrote:

> Dear Dimax,
>
> On 29.10.12 07:38, Dimax wrote:
> > Tried latest available version for SheevaPlug:
> >
> > Marvell>> version
> > U-Boot 2012.04.01 (Jun 01 2012 - 02:27:06)
> > Marvell-Sheevaplug - eSATA - SD/MMC
> > gcc (Debian 4.6.3-5) 4.6.3
> > GNU ld (GNU Binutils for Debian) 2.22
> >
> > Same result.
> > Do you know if u-boot has a functionality to recover ubifs partitions?
>
> It should work. AFAIR there is a problem when the malloc arena is to
> small. I do currently not know if [1] made it into mainline.
> However, can you please check if expanding the CONFIG_SYS_MALLOC_LEN
> fixes your problem?
>
> Best regards
>
> Andreas Bießmann
>
> [1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/124769
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot