[U-Boot] Pull request - fpga

2013-08-11 Thread Michal Simek
Hi Tom,

please pull these two patches to your tree.
Both patches targets Zynq fpga code.

Thanks,
Michal


The following changes since commit a78dac79ede7fbb4c9e816abc879655540c3f076:

  nds32: fix the missing COBJS-y change (2013-08-09 01:51:24 +0800)

are available in the git repository at:

  git://www.denx.de/git/u-boot-microblaze.git fpga

for you to fetch changes up to 5f93227ce02d9cafa11704c807a80dcbde129f8c:

  fpga: zynqpl: Clear loopback mode during device init (2013-08-12 08:52:01 
+0200)


Michal Simek (1):
  fpga: zynqpl: Add support for zc7100 device.

Soren Brinkmann (1):
  fpga: zynqpl: Clear loopback mode during device init

 board/xilinx/zynq/board.c | 4 
 drivers/fpga/zynqpl.c | 6 +-
 include/zynqpl.h  | 5 +
 3 files changed, 14 insertions(+), 1 deletion(-)

-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Microblaze cpu - http://www.monstr.eu/fdt/
Maintainer of Linux kernel - Xilinx Zynq ARM architecture
Microblaze U-BOOT custodian and responsible for u-boot arm zynq platform




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


Re: [U-Boot] [PATCH] edid: rename struct member to fix two EDID_* macros

2013-08-11 Thread Christian Gmeiner
2013/8/7 Christian Gmeiner :
> Without this change EDID_DETAILED_TIMING_VSYNC_OFFSET
> and EDID_DETAILED_TIMING_VSYNC_PULSE_WIDTH macros can
> not be used (compile error).
> The fix is quite trivial: rename struct member to the
> expected name.
>
> Signed-off-by: Christian Gmeiner 
> ---
>  include/edid.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/edid.h b/include/edid.h
> index f153091..480a773 100644
> --- a/include/edid.h
> +++ b/include/edid.h
> @@ -54,7 +54,7 @@ struct edid_detailed_timing {
>  (_x).vertical_blanking)
> unsigned char hsync_offset;
> unsigned char hsync_pulse_width;
> -   unsigned char sync_offset_pulse_width;
> +   unsigned char vsync_offset_pulse_width;
> unsigned char hsync_vsync_offset_pulse_width_hi;
>  #define EDID_DETAILED_TIMING_HSYNC_OFFSET(_x) \
> ((GET_BITS((_x).hsync_vsync_offset_pulse_width_hi, 7, 6) << 8) + \
> --
> 1.7.10.4
>

ping
--
Christian Gmeiner, MSc
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] ARM: use r9 for gd

2013-08-11 Thread Wolfgang Denk
Dear Jeroen Hofstee,

In message <1376254719-15594-4-git-send-email-jer...@myspectrum.nl> you wrote:
> To be more EABI compliant and as a preparation for building
> with clang, use the platform-specific r9 register for gd
> instead of r8.
> 
> note: The FIQ is not updated since it is not used in u-boot,
> and under discussion for the time being.
> 
> The following checkpatch warning is ignoredL
> WARNING: Use of volatile is usually wrong: see
> Documentation/volatile-considered-harmful.txt
> 
> Signed-off-by: Jeroen Hofstee 
> ---
>  arch/arm/config.mk |  2 +-
>  arch/arm/include/asm/global_data.h |  2 +-
>  arch/arm/lib/crt0.S| 16 
>  3 files changed, 10 insertions(+), 10 deletions(-)

IIRC, r9 is used as GOT pointer ?

In any case, please also update the README section of register usage
on ARM.

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
To be awake is to be alive.- Henry David Thoreau, in "Walden"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8

2013-08-11 Thread Albert ARIBAUD
Hi Benoît,

On Mon, 12 Aug 2013 00:08:59 +0200 (CEST), Benoît Thébaudeau
 wrote:

> Dear Jeroen Hofstee,
> 
> On Sunday, August 11, 2013 10:58:36 PM, Jeroen Hofstee wrote:
> > To be EABI compliant (r9 is a platform specific register) and as
> > a prepration for building u-boot with clang/llvm (with does / will
> > support r9 as reserved register), store the pointer to gd in r9.
> 
> If r9 is reserved, I understand that its current usage may conflict with 
> clang's
> but why would gd have to be stored in r9 for clang? Moreover, if r9 is 
> reserved
> for clang (reserved for what?), why can it be used for gd?

Actually, you have to think about this the other way around:

1. In LLVM/clang, r9 can be reserved, i.e., LLVM/clang can be told to
not touch it at all, because it is the AAPCS platform register.

2. Because r9 is the AAPCS platform register, it is the natural choice
for GD.

> I'm also wondering if r9 as initialized by relocate.S is not sometimes used by
> GCC to handle position-independent code within generated code, i.e. like the
> static base feature described for r9 as a possible usage in the ARM EABI AAPCS
> document (5.1.1). If this is the case, changing r9 to gd would break GCC code 
> at
> runtime.

This would be useful when your code gets moved around several times
during its lifetime, which is not a requirement in U-Boot. We get
perfectly working U-Boot relocation without a base register.

> Best regards,
> Benoît

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


Re: [U-Boot] [RFC][PATCH v2] ARM: mxs: Added application UART driver

2013-08-11 Thread Marek Vasut
Dear Andreas Wass,

> The driver is ported from a driver that was implemented
> using u-boot 2009.

What driver? Anyway, this doesn't go here. If it's ported from LTIB, stick it 
into the file header in each file (see the other files , like the register 
definitions or so) for details.

> The driver makes it possible to use a regular application UART as
> the U-Boot output console for MXS CPUs.
> 
> Signed-off-by: Andreas Wass 
> Cc: Fabio Estevam 
> Cc: Marek Vasut 
> ---
>  Changes for v2:
>- Added comment that regs-uartapp.h is pulled from LTIB
>- BM_ prefixes removed and _MASK suffixes added instead
>- BP_ prefixes removed and _OFFSET suffixes added instead
>- BF_ defines removed altogether
>- CONFIG_MXS_AUART_CLK renamed to MXS_AUART_CLK and guarding ifndef
> removed - Added comments describing what is set and unset during init of
> driver - Added newline that was accidently removed from serial.c

Nitpicks follow.

>  arch/arm/include/asm/arch-mxs/regs-uartapp.h | 236
> +++ drivers/serial/Makefile  |
>   1 +
>  drivers/serial/mxs_auart.c   | 139 
>  drivers/serial/serial.c  |   2 +
>  4 files changed, 378 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-mxs/regs-uartapp.h
>  create mode 100644 drivers/serial/mxs_auart.c
> 
> diff --git a/arch/arm/include/asm/arch-mxs/regs-uartapp.h
> b/arch/arm/include/asm/arch-mxs/regs-uartapp.h new file mode 100644
> index 000..60a0812
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
> @@ -0,0 +1,236 @@
> +/*
> + * Freescale MXS UARTAPP Register Definitions
> + *
> + * Copyright (C) 2013 Andreas Wass 
> + *
> + * Based on code from LTIB:
> + * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +
> +#ifndef __ARCH_ARM___MXS_UARTAPP_H
> +#define __ARCH_ARM___MXS_UARTAPP_H
> +
> +#include 
> +
> +#ifndef __ASSEMBLY__
> +struct mxs_uartapp_regs {
> + mxs_reg_32(hw_uartapp_ctrl0)
> + mxs_reg_32(hw_uartapp_ctrl1)
> + mxs_reg_32(hw_uartapp_ctrl2)
> + mxs_reg_32(hw_uartapp_linectrl)
> + mxs_reg_32(hw_uartapp_linectrl2)
> + mxs_reg_32(hw_uartapp_intr)
> + mxs_reg_32(hw_uartapp_data)
> + mxs_reg_32(hw_uartapp_stat)
> + mxs_reg_32(hw_uartapp_debug)
> + mxs_reg_32(hw_uartapp_version)
> + mxs_reg_32(hw_uartapp_autobaud)
> +};
> +#endif
> +
> +
> +#define UARTAPP_CTRL0_SFTRST_MASK(1 << 31)
> +#define UARTAPP_CTRL0_CLKGATE_MASK   (1 << 30)
> +#define UARTAPP_CTRL0_RUN_MASK   (1 << 29)
> +#define UARTAPP_CTRL0_RX_SOURCE_MASK (1 << 28)
> +#define UARTAPP_CTRL0_RXTO_ENABLE_MASK   (1 << 27)
> +#define UARTAPP_CTRL0_RXTIMEOUT_OFFSET   (1 << 4)
> +#define UARTAPP_CTRL0_RXTIMEOUT_MASK 0x07FF
> +#define UARTAPP_CTRL0_XFER_COUNT_OFFSET  0
> +#define UARTAPP_CTRL0_XFER_COUNT_MASK0x
> +
> +#define UARTAPP_CTRL1_RSVD2_OFFSET   29
> +#define UARTAPP_CTRL1_RSVD2_MASK 0xE000
> +
> +#define UARTAPP_CTRL1_RUN_MASK   (1 << 28)
> +#define UARTAPP_CTRL1_RSVD1_OFFSET   16
> +#define UARTAPP_CTRL1_RSVD1_MASK 0x0FFF
> +
> +#define UARTAPP_CTRL1_XFER_COUNT_OFFSET  0
> +#define UARTAPP_CTRL1_XFER_COUNT_MASK0x
> +
> +#define UARTAPP_CTRL2_INVERT_RTS_MASK(1 << 31)
> +#define UARTAPP_CTRL2_INVERT_CTS_MASK(1 << 30)
> +#define UARTAPP_CTRL2_INVERT_TX_MASK (1 << 29)
> +#define UARTAPP_CTRL2_INVERT_RX_MASK (1 << 28)
> +#define UARTAPP_CTRL2_RTS_SEMAPHORE_MASK (1 << 27)
> +#define UARTAPP_CTRL2_DMAONERR_MASK  (1 << 26)
> +#define UARTAPP_CTRL2_TXDMAE_MASK(1 << 25)
> +#define UARTAPP_CTRL2_RXDMAE_MASK(1 << 24)
> +#define UARTAPP_CTRL2_RSVD2_MASK (1 << 23)
> +#define UARTAPP_CTRL2_RXIFLSEL_OFFSET20
> +#define UARTAPP_CTRL2_RXIFLSEL_MASK  0x0070
> +
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__NOT_EMPTY 0x0
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_QUARTER   0x1
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_HALF  0x2
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__THREE_QUARTERS0x3
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__SEVEN_EIGHTHS 0x4
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID5  0x5
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID6  0x6
> +#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID7  0x7

BV ... this needs fixing. It's usually defined as (val << something)

[...]

> diff --git a/drive

Re: [U-Boot] [PATCH v2 05/12] spi: add Faraday FTSPI010 SPI controller support

2013-08-11 Thread Kuo-Jung Su
>
> Please see the comments on below patch
> http://patchwork.ozlabs.org/patch/265683/
>
> --

Got it, thanks


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


Re: [U-Boot] [PATCH] powerpc/eeprom: update MAX_NUM_PORTS to fix program failure

2013-08-11 Thread Timur Tabi
On Thu, Aug 8, 2013 at 5:14 AM, Shengzhou Liu
 wrote:
> On some boards, the size of EEPROM is 128 Bytes instead of 256.
> so we set default MAX_NUM_PORTS to 9 rather than previous 23 to
> avoid the programming failure, we can define MAX_NUM_PORTS in
> board-specific header file to overwrite the default value.

NACK.

If the EEPROM is 128 bytes, then you have a non-conformant EEPROM.
And using the #ifdef to determine this is definitely the wrong way.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8

2013-08-11 Thread Benoît Thébaudeau
Dear Jeroen Hofstee,

On Sunday, August 11, 2013 10:58:36 PM, Jeroen Hofstee wrote:
> To be EABI compliant (r9 is a platform specific register) and as
> a prepration for building u-boot with clang/llvm (with does / will
> support r9 as reserved register), store the pointer to gd in r9.

If r9 is reserved, I understand that its current usage may conflict with clang's
but why would gd have to be stored in r9 for clang? Moreover, if r9 is reserved
for clang (reserved for what?), why can it be used for gd?

I'm also wondering if r9 as initialized by relocate.S is not sometimes used by
GCC to handle position-independent code within generated code, i.e. like the
static base feature described for r9 as a possible usage in the ARM EABI AAPCS
document (5.1.1). If this is the case, changing r9 to gd would break GCC code at
runtime.

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


[U-Boot] [RFC][PATCH v2] ARM: mxs: Added application UART driver

2013-08-11 Thread Andreas Wass
The driver is ported from a driver that was implemented
using u-boot 2009.

The driver makes it possible to use a regular application UART as
the U-Boot output console for MXS CPUs.

Signed-off-by: Andreas Wass 
Cc: Fabio Estevam 
Cc: Marek Vasut 
---
 Changes for v2:
   - Added comment that regs-uartapp.h is pulled from LTIB
   - BM_ prefixes removed and _MASK suffixes added instead
   - BP_ prefixes removed and _OFFSET suffixes added instead
   - BF_ defines removed altogether
   - CONFIG_MXS_AUART_CLK renamed to MXS_AUART_CLK and guarding ifndef removed
   - Added comments describing what is set and unset during init of driver
   - Added newline that was accidently removed from serial.c

 arch/arm/include/asm/arch-mxs/regs-uartapp.h | 236 +++
 drivers/serial/Makefile  |   1 +
 drivers/serial/mxs_auart.c   | 139 
 drivers/serial/serial.c  |   2 +
 4 files changed, 378 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-mxs/regs-uartapp.h
 create mode 100644 drivers/serial/mxs_auart.c

diff --git a/arch/arm/include/asm/arch-mxs/regs-uartapp.h 
b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
new file mode 100644
index 000..60a0812
--- /dev/null
+++ b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
@@ -0,0 +1,236 @@
+/*
+ * Freescale MXS UARTAPP Register Definitions
+ *
+ * Copyright (C) 2013 Andreas Wass 
+ *
+ * Based on code from LTIB:
+ * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ARCH_ARM___MXS_UARTAPP_H
+#define __ARCH_ARM___MXS_UARTAPP_H
+
+#include 
+
+#ifndef __ASSEMBLY__
+struct mxs_uartapp_regs {
+   mxs_reg_32(hw_uartapp_ctrl0)
+   mxs_reg_32(hw_uartapp_ctrl1)
+   mxs_reg_32(hw_uartapp_ctrl2)
+   mxs_reg_32(hw_uartapp_linectrl)
+   mxs_reg_32(hw_uartapp_linectrl2)
+   mxs_reg_32(hw_uartapp_intr)
+   mxs_reg_32(hw_uartapp_data)
+   mxs_reg_32(hw_uartapp_stat)
+   mxs_reg_32(hw_uartapp_debug)
+   mxs_reg_32(hw_uartapp_version)
+   mxs_reg_32(hw_uartapp_autobaud)
+};
+#endif
+
+
+#define UARTAPP_CTRL0_SFTRST_MASK  (1 << 31)
+#define UARTAPP_CTRL0_CLKGATE_MASK (1 << 30)
+#define UARTAPP_CTRL0_RUN_MASK (1 << 29)
+#define UARTAPP_CTRL0_RX_SOURCE_MASK   (1 << 28)
+#define UARTAPP_CTRL0_RXTO_ENABLE_MASK (1 << 27)
+#define UARTAPP_CTRL0_RXTIMEOUT_OFFSET (1 << 4)
+#define UARTAPP_CTRL0_RXTIMEOUT_MASK   0x07FF
+#define UARTAPP_CTRL0_XFER_COUNT_OFFSET0
+#define UARTAPP_CTRL0_XFER_COUNT_MASK  0x
+
+#define UARTAPP_CTRL1_RSVD2_OFFSET 29
+#define UARTAPP_CTRL1_RSVD2_MASK   0xE000
+
+#define UARTAPP_CTRL1_RUN_MASK (1 << 28)
+#define UARTAPP_CTRL1_RSVD1_OFFSET 16
+#define UARTAPP_CTRL1_RSVD1_MASK   0x0FFF
+
+#define UARTAPP_CTRL1_XFER_COUNT_OFFSET0
+#define UARTAPP_CTRL1_XFER_COUNT_MASK  0x
+
+#define UARTAPP_CTRL2_INVERT_RTS_MASK  (1 << 31)
+#define UARTAPP_CTRL2_INVERT_CTS_MASK  (1 << 30)
+#define UARTAPP_CTRL2_INVERT_TX_MASK   (1 << 29)
+#define UARTAPP_CTRL2_INVERT_RX_MASK   (1 << 28)
+#define UARTAPP_CTRL2_RTS_SEMAPHORE_MASK   (1 << 27)
+#define UARTAPP_CTRL2_DMAONERR_MASK(1 << 26)
+#define UARTAPP_CTRL2_TXDMAE_MASK  (1 << 25)
+#define UARTAPP_CTRL2_RXDMAE_MASK  (1 << 24)
+#define UARTAPP_CTRL2_RSVD2_MASK   (1 << 23)
+#define UARTAPP_CTRL2_RXIFLSEL_OFFSET  20
+#define UARTAPP_CTRL2_RXIFLSEL_MASK0x0070
+
+#define BV_UARTAPP_CTRL2_RXIFLSEL__NOT_EMPTY   0x0
+#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_QUARTER 0x1
+#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_HALF0x2
+#define BV_UARTAPP_CTRL2_RXIFLSEL__THREE_QUARTERS  0x3
+#define BV_UARTAPP_CTRL2_RXIFLSEL__SEVEN_EIGHTHS   0x4
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID50x5
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID60x6
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID70x7
+#define UARTAPP_CTRL2_RSVD3_MASK   (1 << 19)
+#define UARTAPP_CTRL2_TXIFLSEL_OFFSET  16
+#define UARTAPP_CTRL2_TXIFLSEL_MASK0x0007
+#define BV_UARTAPP_CTRL2_TXIFLSEL__EMPTY   0x0
+#define BV_UARTAPP_CTRL2_TXIFLSEL__ONE_QUARTER 0x1
+#define BV_UARTAPP_CTRL2_TXIFLSEL__ONE_HALF0x2
+#define BV_UARTAPP_CTRL2_TXIFLSEL__THREE_QUARTERS  0x3
+#define BV_UARTAPP_CTRL2_TXIFLSEL__SEVEN_EIGHTHS   0x4
+#define BV_

[U-Boot] [PATCH 3/3] ARM: use r9 for gd

2013-08-11 Thread Jeroen Hofstee
To be more EABI compliant and as a preparation for building
with clang, use the platform-specific r9 register for gd
instead of r8.

note: The FIQ is not updated since it is not used in u-boot,
and under discussion for the time being.

The following checkpatch warning is ignoredL
WARNING: Use of volatile is usually wrong: see
Documentation/volatile-considered-harmful.txt

Signed-off-by: Jeroen Hofstee 
---
 arch/arm/config.mk |  2 +-
 arch/arm/include/asm/global_data.h |  2 +-
 arch/arm/lib/crt0.S| 16 
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 5e382ab..5f6e032 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -99,4 +99,4 @@ ifneq ($(CONFIG_SPL_BUILD),y)
 ALL-y  += checkarmreloc
 endif
 
-OPTION_FIXED_GD=$(call cc-option, -ffixed-r8)
+OPTION_FIXED_GD=$(call cc-option, -ffixed-r9)
diff --git a/arch/arm/include/asm/global_data.h 
b/arch/arm/include/asm/global_data.h
index 79a9597..e126436 100644
--- a/arch/arm/include/asm/global_data.h
+++ b/arch/arm/include/asm/global_data.h
@@ -47,6 +47,6 @@ struct arch_global_data {
 
 #include 
 
-#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
+#define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r9")
 
 #endif /* __ASM_GBL_DATA_H */
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index 960d12e..ac54b93 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -69,7 +69,7 @@ ENTRY(_main)
bic sp, sp, #7  /* 8-byte alignment for ABI compliance */
sub sp, #GD_SIZE/* allocate one GD above SP */
bic sp, sp, #7  /* 8-byte alignment for ABI compliance */
-   mov r8, sp  /* GD is above SP */
+   mov r9, sp  /* GD is above SP */
mov r0, #0
bl  board_init_f
 
@@ -81,15 +81,15 @@ ENTRY(_main)
  * 'here' but relocated.
  */
 
-   ldr sp, [r8, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */
+   ldr sp, [r9, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */
bic sp, sp, #7  /* 8-byte alignment for ABI compliance */
-   ldr r8, [r8, #GD_BD]/* r8 = gd->bd */
-   sub r8, r8, #GD_SIZE/* new GD is below bd */
+   ldr r9, [r9, #GD_BD]/* r9 = gd->bd */
+   sub r9, r9, #GD_SIZE/* new GD is below bd */
 
adr lr, here
-   ldr r0, [r8, #GD_RELOC_OFF] /* r0 = gd->reloc_off */
+   ldr r0, [r9, #GD_RELOC_OFF] /* r0 = gd->reloc_off */
add lr, lr, r0
-   ldr r0, [r8, #GD_RELOCADDR] /* r0 = gd->relocaddr */
+   ldr r0, [r9, #GD_RELOCADDR] /* r0 = gd->relocaddr */
b   relocate_code
 here:
 
@@ -111,8 +111,8 @@ clbss_l:cmp r0, r1  /* while not at end of 
BSS */
bl red_led_on
 
/* call board_init_r(gd_t *id, ulong dest_addr) */
-   mov r0, r8  /* gd_t */
-   ldr r1, [r8, #GD_RELOCADDR] /* dest_addr */
+   mov r0, r9  /* gd_t */
+   ldr r1, [r9, #GD_RELOCADDR] /* dest_addr */
/* call board_init_r */
ldr pc, =board_init_r   /* this is auto-relocated! */
 
-- 
1.8.1.2

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


[U-Boot] [PATCH 1/3] ARM: make reserving the gd register a make variable

2013-08-11 Thread Jeroen Hofstee
Currently all ARM targets spell out that r8 needs to be a reserved
register, while using a common crt0.s. Move this to a common make
variable so it is not repeated (and can be easily changed)

Signed-off-by: Jeroen Hofstee 
---
 arch/arm/config.mk   | 2 ++
 arch/arm/cpu/arm1136/config.mk   | 2 +-
 arch/arm/cpu/arm1176/config.mk   | 2 +-
 arch/arm/cpu/arm720t/config.mk   | 2 +-
 arch/arm/cpu/arm920t/config.mk   | 2 +-
 arch/arm/cpu/arm925t/config.mk   | 2 +-
 arch/arm/cpu/arm926ejs/config.mk | 2 +-
 arch/arm/cpu/arm946es/config.mk  | 2 +-
 arch/arm/cpu/arm_intcm/config.mk | 2 +-
 arch/arm/cpu/armv7/config.mk | 2 +-
 arch/arm/cpu/armv7/rmobile/config.mk | 2 +-
 arch/arm/cpu/ixp/config.mk   | 2 +-
 arch/arm/cpu/pxa/config.mk   | 2 +-
 arch/arm/cpu/s3c44b0/config.mk   | 2 +-
 arch/arm/cpu/sa1100/config.mk| 2 +-
 15 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 540a119..5e382ab 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -98,3 +98,5 @@ endif
 ifneq ($(CONFIG_SPL_BUILD),y)
 ALL-y  += checkarmreloc
 endif
+
+OPTION_FIXED_GD=$(call cc-option, -ffixed-r8)
diff --git a/arch/arm/cpu/arm1136/config.mk b/arch/arm/cpu/arm1136/config.mk
index 1ef6061..daca1bd 100644
--- a/arch/arm/cpu/arm1136/config.mk
+++ b/arch/arm/cpu/arm1136/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5
diff --git a/arch/arm/cpu/arm1176/config.mk b/arch/arm/cpu/arm1176/config.mk
index 917da03..163778a 100644
--- a/arch/arm/cpu/arm1176/config.mk
+++ b/arch/arm/cpu/arm1176/config.mk
@@ -4,7 +4,7 @@
 #
 # SPDX-License-Identifier: GPL-2.0+
 #
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 # Make ARMv5 to allow more compilers to work, even though its v6.
 PLATFORM_CPPFLAGS += -march=armv5t
diff --git a/arch/arm/cpu/arm720t/config.mk b/arch/arm/cpu/arm720t/config.mk
index 56b6280..f1fb6a8 100644
--- a/arch/arm/cpu/arm720t/config.mk
+++ b/arch/arm/cpu/arm720t/config.mk
@@ -6,7 +6,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS +=  -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS +=  -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4 -mtune=arm7tdmi
 # =
diff --git a/arch/arm/cpu/arm920t/config.mk b/arch/arm/cpu/arm920t/config.mk
index 58fd756..a6b2c6f 100644
--- a/arch/arm/cpu/arm920t/config.mk
+++ b/arch/arm/cpu/arm920t/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
 # =
diff --git a/arch/arm/cpu/arm925t/config.mk b/arch/arm/cpu/arm925t/config.mk
index 58fd756..a6b2c6f 100644
--- a/arch/arm/cpu/arm925t/config.mk
+++ b/arch/arm/cpu/arm925t/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv4
 # =
diff --git a/arch/arm/cpu/arm926ejs/config.mk b/arch/arm/cpu/arm926ejs/config.mk
index 917ff7e..a29634d 100644
--- a/arch/arm/cpu/arm926ejs/config.mk
+++ b/arch/arm/cpu/arm926ejs/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS += -march=armv5te
 # =
diff --git a/arch/arm/cpu/arm946es/config.mk b/arch/arm/cpu/arm946es/config.mk
index 1e41c11..7465da1 100644
--- a/arch/arm/cpu/arm946es/config.mk
+++ b/arch/arm/cpu/arm946es/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPPFLAGS +=  -march=armv4
 # =
diff --git a/arch/arm/cpu/arm_intcm/config.mk b/arch/arm/cpu/arm_intcm/config.mk
index 1e41c11..7465da1 100644
--- a/arch/arm/cpu/arm_intcm/config.mk
+++ b/arch/arm/cpu/arm_intcm/config.mk
@@ -5,7 +5,7 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
 
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
+PLATFORM_RELFLAGS += -fno-common $(OPTION_FIXED_GD) -msoft-float
 
 PLATFORM_CPP

[U-Boot] [PATCH 2/3] ARM,relocate: do not use r9

2013-08-11 Thread Jeroen Hofstee
r9 is a platform-specific register in ARM EABI and not per
definition a general purpose register. Do not use it while
relocating so it can be used for gd.

Signed-off-by: Jeroen Hofstee 
---
 arch/arm/lib/relocate.S | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/lib/relocate.S b/arch/arm/lib/relocate.S
index ab90430..a62a556 100644
--- a/arch/arm/lib/relocate.S
+++ b/arch/arm/lib/relocate.S
@@ -22,7 +22,7 @@
 
 ENTRY(relocate_code)
ldr r1, =__image_copy_start /* r1 <- SRC &__image_copy_start */
-   subsr9, r0, r1  /* r9 <- relocation offset */
+   subsr4, r0, r1  /* r4 <- relocation offset */
beq relocate_done   /* skip relocation */
ldr r2, =__image_copy_end   /* r2 <- SRC &__image_copy_end */
 
@@ -44,9 +44,9 @@ fixloop:
bne fixnext
 
/* relative fix: increase location by offset */
-   add r0, r0, r9
+   add r0, r0, r4
ldr r1, [r0]
-   add r1, r1, r9
+   add r1, r1, r4
str r1, [r0]
 fixnext:
cmp r2, r3
-- 
1.8.1.2

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


[U-Boot] [PATCH 0/3] ARM: use r9 for gd instead of r8

2013-08-11 Thread Jeroen Hofstee
To be EABI compliant (r9 is a platform specific register) and as
a prepration for building u-boot with clang/llvm (with does / will
support r9 as reserved register), store the pointer to gd in r9.

Jeroen Hofstee (3):
  ARM: make reserving the gd register a make variable
  ARM,relocate: do not use r9
  ARM: use r9 for gd

 arch/arm/config.mk   |  2 ++
 arch/arm/cpu/arm1136/config.mk   |  2 +-
 arch/arm/cpu/arm1176/config.mk   |  2 +-
 arch/arm/cpu/arm720t/config.mk   |  2 +-
 arch/arm/cpu/arm920t/config.mk   |  2 +-
 arch/arm/cpu/arm925t/config.mk   |  2 +-
 arch/arm/cpu/arm926ejs/config.mk |  2 +-
 arch/arm/cpu/arm946es/config.mk  |  2 +-
 arch/arm/cpu/arm_intcm/config.mk |  2 +-
 arch/arm/cpu/armv7/config.mk |  2 +-
 arch/arm/cpu/armv7/rmobile/config.mk |  2 +-
 arch/arm/cpu/ixp/config.mk   |  2 +-
 arch/arm/cpu/pxa/config.mk   |  2 +-
 arch/arm/cpu/s3c44b0/config.mk   |  2 +-
 arch/arm/cpu/sa1100/config.mk|  2 +-
 arch/arm/include/asm/global_data.h   |  2 +-
 arch/arm/lib/crt0.S  | 16 
 arch/arm/lib/relocate.S  |  6 +++---
 18 files changed, 28 insertions(+), 26 deletions(-)

-- 
1.8.1.2

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


[U-Boot] [PATCH v3 8/8] MIPS: bootm: drop obsolete Qemu specific bootm implementation

2013-08-11 Thread Daniel Schwierzeck
The Qemu specific bootm implementation was intended for a special
Qemu target in Linux kernel. But this target has been dropped in
v2.6.25-rc1 by commit 302922e5f6901eb6f29c58539631f71b3d9746b8

Author: Ralf Baechle 
Date:   Tue Jan 29 10:15:02 2008 +

[MIPS] Qemu: Remove platform.

The Qemu platform was originally implemented to have an easily supportable
platform until Qemu reaches a state where it emulates a real world system.
Since the latest release Qemu is capable of emulating the MIPSsim and
Malta platforms, so this goal has been reached.  The Qemu plaform is also
rather underfeatured so less useful than a Malta emulation.

Thus the special bootm implementation is obsolete by now and can be
dropped. The Qemu support in U-Boot is going to be replaced by MIPS Malta
board support.

Signed-off-by: Gabor Juhos 
Signed-off-by: Daniel Schwierzeck 

---
Changes in v3: None
Changes in v2: None

 arch/mips/lib/Makefile  |  4 ---
 arch/mips/lib/bootm_qemu_mips.c | 62 -
 2 files changed, 66 deletions(-)
 delete mode 100644 arch/mips/lib/bootm_qemu_mips.c

diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile
index e9f82f7..f91406c 100644
--- a/arch/mips/lib/Makefile
+++ b/arch/mips/lib/Makefile
@@ -19,11 +19,7 @@ LGOBJS   := $(addprefix $(obj),$(GLSOBJS))
 SOBJS-y+=
 
 COBJS-y+= board.o
-ifeq ($(CONFIG_QEMU_MIPS),y)
-COBJS-$(CONFIG_CMD_BOOTM) += bootm_qemu_mips.o
-else
 COBJS-$(CONFIG_CMD_BOOTM) += bootm.o
-endif
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/arch/mips/lib/bootm_qemu_mips.c b/arch/mips/lib/bootm_qemu_mips.c
deleted file mode 100644
index 910ab73..000
--- a/arch/mips/lib/bootm_qemu_mips.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * (C) Copyright 2008
- * Jean-Christophe PLAGNIOL-VILLARD 
- *
- * SPDX-License-Identifier:GPL-2.0+
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-DECLARE_GLOBAL_DATA_PTR;
-
-int do_bootm_linux(int flag, int argc, char * const argv[],
-   bootm_headers_t *images)
-{
-   void (*theKernel) (int, char **, char **, int *);
-   char *bootargs = getenv("bootargs");
-   char *start;
-   uint len;
-
-   /* find kernel entry point */
-   theKernel = (void (*)(int, char **, char **, int *))images->ep;
-
-   bootstage_mark(BOOTSTAGE_ID_RUN_OS);
-
-   debug("## Transferring control to Linux (at address %08lx) ...\n",
-   (ulong) theKernel);
-
-   gd->bd->bi_boot_params = gd->bd->bi_memstart + (16 << 20) - 256;
-   debug("%-12s= 0x%08lX\n", "boot_params", (ulong)gd->bd->bi_boot_params);
-
-   /* set Magic */
-   *(int32_t *)(gd->bd->bi_boot_params - 4) = 0x12345678;
-   /* set ram_size */
-   *(int32_t *)(gd->bd->bi_boot_params - 8) = gd->ram_size;
-
-   start = (char *)gd->bd->bi_boot_params;
-
-   len = strlen(bootargs);
-
-   strncpy(start, bootargs, len + 1);
-
-   start += len;
-
-   len = images->rd_end - images->rd_start;
-   if (len > 0) {
-   start += sprintf(start, " rd_start=0x%08X rd_size=0x%0X",
-   (uint) UNCACHED_SDRAM(images->rd_start),
-   (uint) len);
-   }
-
-   /* we assume that the kernel is in place */
-   printf("\nStarting kernel ...\n\n");
-
-   theKernel(0, NULL, NULL, 0);
-
-   /* does not return */
-   return 1;
-}
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 2/8] MIPS: bootm: optimize kernel entry call

2013-08-11 Thread Daniel Schwierzeck
Fix signature of kernel entry function. Mark the kernel entry
with __noreturn for better code optimisation.

Signed-off-by: Daniel Schwierzeck 
---
Changes in v3: None
Changes in v2: None

 arch/mips/lib/bootm.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index e7aa11a..692f7dc 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -69,20 +69,17 @@ static void boot_prep_linux(bootm_headers_t *images)
 
 static void boot_jump_linux(bootm_headers_t *images)
 {
-   void (*theKernel) (int, char **, char **, int *);
+   typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong);
+   kernel_entry_t kernel = (kernel_entry_t) images->ep;
 
-   /* find kernel entry point */
-   theKernel = (void (*)(int, char **, char **, int *))images->ep;
-
-   debug("## Transferring control to Linux (at address %08lx) ...\n",
-   (ulong) theKernel);
+   debug("## Transferring control to Linux (at address %p) ...\n", kernel);
 
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 
/* we assume that the kernel is in place */
printf("\nStarting kernel ...\n\n");
 
-   theKernel(linux_argc, linux_argv, linux_env, 0);
+   kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, 0);
 }
 
 int do_bootm_linux(int flag, int argc, char * const argv[],
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 7/8] MIPS: bootm: add YAMON style Linux preparation/jump code for Qemu Malta

2013-08-11 Thread Daniel Schwierzeck
Signed-off-by: Gabor Juhos 
Signed-off-by: Daniel Schwierzeck 
---
Changes in v3: None
Changes in v2: None

 arch/mips/lib/bootm.c | 22 --
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 27e0b1b..66340ea 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -17,6 +17,12 @@ DECLARE_GLOBAL_DATA_PTR;
 #defineLINUX_MAX_ENVS  256
 #defineLINUX_MAX_ARGS  256
 
+#if defined(CONFIG_QEMU_MALTA)
+#define mips_boot_qemu_malta   1
+#else
+#define mips_boot_qemu_malta   0
+#endif
+
 static int linux_argc;
 static char **linux_argv;
 static char *linux_argp;
@@ -133,7 +139,12 @@ static void linux_env_set(const char *env_name, const char 
*env_val)
strcpy(linux_env_p, env_name);
linux_env_p += strlen(env_name);
 
-   *linux_env_p++ = '=';
+   if (mips_boot_qemu_malta) {
+   linux_env_p++;
+   linux_env[++linux_env_idx] = linux_env_p;
+   } else {
+   *linux_env_p++ = '=';
+   }
 
strcpy(linux_env_p, env_val);
linux_env_p += strlen(env_val);
@@ -184,21 +195,28 @@ static void boot_prep_linux(bootm_headers_t *images)
cp = getenv("eth1addr");
if (cp)
linux_env_set("eth1addr", cp);
+
+   if (mips_boot_qemu_malta)
+   linux_env_set("modetty0", "38400n8r");
 }
 
 static void boot_jump_linux(bootm_headers_t *images)
 {
typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong);
kernel_entry_t kernel = (kernel_entry_t) images->ep;
+   ulong linux_extra = 0;
 
debug("## Transferring control to Linux (at address %p) ...\n", kernel);
 
bootstage_mark(BOOTSTAGE_ID_RUN_OS);
 
+   if (mips_boot_qemu_malta)
+   linux_extra = gd->ram_size;
+
/* we assume that the kernel is in place */
printf("\nStarting kernel ...\n\n");
 
-   kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, 0);
+   kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, linux_extra);
 }
 
 int do_bootm_linux(int flag, int argc, char * const argv[],
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 1/8] MIPS: bootm: fix checkpatch.pl warnings

2013-08-11 Thread Daniel Schwierzeck
Signed-off-by: Daniel Schwierzeck 

---
Changes in v3: None
Changes in v2:
- fix multi-line comment

 arch/mips/lib/bootm.c | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index ade9af4..e7aa11a 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -41,7 +41,7 @@ static void boot_prep_linux(bootm_headers_t *images)
 #else
sprintf(env_buf, "%lu", (ulong)(gd->ram_size >> 20));
debug("## Giving linux memsize in MB, %lu\n",
-   (ulong)(gd->ram_size >> 20));
+ (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
linux_env_set("memsize", env_buf);
@@ -114,9 +114,9 @@ static void linux_params_init(ulong start, char *line)
char *next, *quote, *argp;
 
linux_argc = 1;
-   linux_argv = (char **) start;
+   linux_argv = (char **)start;
linux_argv[0] = 0;
-   argp = (char *) (linux_argv + LINUX_MAX_ARGS);
+   argp = (char *)(linux_argv + LINUX_MAX_ARGS);
 
next = line;
 
@@ -125,7 +125,8 @@ static void linux_params_init(ulong start, char *line)
next = strchr(line, ' ');
 
while (next && quote && quote < next) {
-   /* we found a left quote before the next blank
+   /*
+* we found a left quote before the next blank
 * now we have to find the matching right quote
 */
next = strchr(quote + 1, '"');
@@ -151,9 +152,9 @@ static void linux_params_init(ulong start, char *line)
line = next;
}
 
-   linux_env = (char **) (((ulong) argp + 15) & ~15);
+   linux_env = (char **)(((ulong) argp + 15) & ~15);
linux_env[0] = 0;
-   linux_env_p = (char *) (linux_env + LINUX_MAX_ENVS);
+   linux_env_p = (char *)(linux_env + LINUX_MAX_ENVS);
linux_env_idx = 0;
 }
 
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 6/8] MIPS: bootm: add support for generic relocation of init ramdisks

2013-08-11 Thread Daniel Schwierzeck
All linux kernels after v2.6 require a page-aligned location of
an external init ramdisk. Enable CONFIG_SYS_BOOT_RAMDISK_HIGH to
support this with the generic U-Boot relocation code.

Signed-off-by: Daniel Schwierzeck 
---
Changes in v3: None
Changes in v2: None

 arch/mips/include/asm/config.h | 1 +
 arch/mips/lib/bootm.c  | 8 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h
index 6eb1cee..3a891ba 100644
--- a/arch/mips/include/asm/config.h
+++ b/arch/mips/include/asm/config.h
@@ -8,5 +8,6 @@
 #define _ASM_CONFIG_H_
 
 #define CONFIG_LMB
+#define CONFIG_SYS_BOOT_RAMDISK_HIGH
 
 #endif
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 257390b..27e0b1b 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -147,6 +147,7 @@ static void boot_prep_linux(bootm_headers_t *images)
 {
char env_buf[12];
const char *cp;
+   ulong rd_start, rd_size;
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
sprintf(env_buf, "%lu", (ulong)gd->ram_size);
@@ -157,14 +158,17 @@ static void boot_prep_linux(bootm_headers_t *images)
  (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
+   rd_start = UNCACHED_SDRAM(images->initrd_start);
+   rd_size = images->initrd_end - images->initrd_start;
+
linux_env_init();
 
linux_env_set("memsize", env_buf);
 
-   sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start));
+   sprintf(env_buf, "0x%08lX", rd_start);
linux_env_set("initrd_start", env_buf);
 
-   sprintf(env_buf, "0x%X", (uint) (images->rd_end - images->rd_start));
+   sprintf(env_buf, "0x%lX", rd_size);
linux_env_set("initrd_size", env_buf);
 
sprintf(env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart));
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 5/8] MIPS: bootm: refactor initialisation of kernel environment

2013-08-11 Thread Daniel Schwierzeck
Move initialisation of Linux environment to separate functions.

Signed-off-by: Daniel Schwierzeck 

---
Changes in v3:
- removed boot_prep_linux_legacy due to dropped patches

Changes in v2: None

 arch/mips/lib/bootm.c | 62 ---
 1 file changed, 29 insertions(+), 33 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index ba9fd68..257390b 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -25,9 +25,6 @@ static char **linux_env;
 static char *linux_env_p;
 static int linux_env_idx;
 
-static void linux_params_init(void);
-static void linux_env_set(char *env_name, char *env_val);
-
 static ulong arch_get_sp(void)
 {
ulong ret;
@@ -120,12 +117,36 @@ static void boot_cmdline_linux(bootm_headers_t *images)
linux_cmdline_dump();
 }
 
+static void linux_env_init(void)
+{
+   linux_env = (char **)(((ulong) linux_argp + 15) & ~15);
+   linux_env[0] = 0;
+   linux_env_p = (char *)(linux_env + LINUX_MAX_ENVS);
+   linux_env_idx = 0;
+}
+
+static void linux_env_set(const char *env_name, const char *env_val)
+{
+   if (linux_env_idx < LINUX_MAX_ENVS - 1) {
+   linux_env[linux_env_idx] = linux_env_p;
+
+   strcpy(linux_env_p, env_name);
+   linux_env_p += strlen(env_name);
+
+   *linux_env_p++ = '=';
+
+   strcpy(linux_env_p, env_val);
+   linux_env_p += strlen(env_val);
+
+   linux_env_p++;
+   linux_env[++linux_env_idx] = 0;
+   }
+}
+
 static void boot_prep_linux(bootm_headers_t *images)
 {
char env_buf[12];
-   char *cp;
-
-   linux_params_init();
+   const char *cp;
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
sprintf(env_buf, "%lu", (ulong)gd->ram_size);
@@ -136,6 +157,8 @@ static void boot_prep_linux(bootm_headers_t *images)
  (ulong)(gd->ram_size >> 20));
 #endif /* CONFIG_MEMSIZE_IN_BYTES */
 
+   linux_env_init();
+
linux_env_set("memsize", env_buf);
 
sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start));
@@ -203,30 +226,3 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
/* does not return */
return 1;
 }
-
-static void linux_params_init(void)
-{
-   linux_env = (char **)(((ulong) linux_argp + 15) & ~15);
-   linux_env[0] = 0;
-   linux_env_p = (char *)(linux_env + LINUX_MAX_ENVS);
-   linux_env_idx = 0;
-}
-
-static void linux_env_set(char *env_name, char *env_val)
-{
-   if (linux_env_idx < LINUX_MAX_ENVS - 1) {
-   linux_env[linux_env_idx] = linux_env_p;
-
-   strcpy(linux_env_p, env_name);
-   linux_env_p += strlen(env_name);
-
-   strcpy(linux_env_p, "=");
-   linux_env_p += 1;
-
-   strcpy(linux_env_p, env_val);
-   linux_env_p += strlen(env_val);
-
-   linux_env_p++;
-   linux_env[++linux_env_idx] = 0;
-   }
-}
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 3/8] MIPS: bootm: add support for LMB

2013-08-11 Thread Daniel Schwierzeck
This is required for init ramdisk relocation and device tree
support.

Signed-off-by: Gabor Juhos 
Signed-off-by: Daniel Schwierzeck 
---
Changes in v3: None
Changes in v2: None

 arch/mips/include/asm/config.h |  2 ++
 arch/mips/lib/bootm.c  | 21 +
 2 files changed, 23 insertions(+)

diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h
index cd29734..6eb1cee 100644
--- a/arch/mips/include/asm/config.h
+++ b/arch/mips/include/asm/config.h
@@ -7,4 +7,6 @@
 #ifndef _ASM_CONFIG_H_
 #define _ASM_CONFIG_H_
 
+#define CONFIG_LMB
+
 #endif
diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 692f7dc..59ed632 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -27,6 +27,27 @@ static int linux_env_idx;
 static void linux_params_init(ulong start, char *commandline);
 static void linux_env_set(char *env_name, char *env_val);
 
+static ulong arch_get_sp(void)
+{
+   ulong ret;
+
+   __asm__ __volatile__("move %0, $sp" : "=r"(ret) : );
+
+   return ret;
+}
+
+void arch_lmb_reserve(struct lmb *lmb)
+{
+   ulong sp;
+
+   sp = arch_get_sp();
+   debug("## Current stack ends at 0x%08lx\n", sp);
+
+   /* adjust sp by 4K to be safe */
+   sp -= 4096;
+   lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp);
+}
+
 static void boot_prep_linux(bootm_headers_t *images)
 {
char *commandline = getenv("bootargs");
-- 
1.8.1.2

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


[U-Boot] [PATCH v3 0/8] MIPS: bootm updates

2013-08-11 Thread Daniel Schwierzeck
- refactoring and optimization of bootm command
- add support for logical memory blocks (LMB)
- make external init ramdisks working again with recent kernels
- add support for bootm subcommand 'cmdline'
- prepare bootm for upcoming device tree support
- add bootm support for newly added MIPS Malta Qemu
- drop obsolete bootm support of MIPS Qemu

Changes in v3:
- rebased to current master
- drop patches 6, 8 and 9, which need further discussion and review
- removed boot_prep_linux_legacy due to dropped patches

Changes in v2:
- fix multi-line comment
- use debug() macro

Daniel Schwierzeck (8):
  MIPS: bootm: fix checkpatch.pl warnings
  MIPS: bootm: optimize kernel entry call
  MIPS: bootm: add support for LMB
  MIPS: bootm: refactor initialisation of kernel cmdline
  MIPS: bootm: refactor initialisation of kernel environment
  MIPS: bootm: add support for generic relocation of init ramdisks
  MIPS: bootm: add YAMON style Linux preparation/jump code for Qemu
Malta
  MIPS: bootm: drop obsolete Qemu specific bootm implementation

 arch/mips/include/asm/config.h  |   3 +
 arch/mips/lib/Makefile  |   4 -
 arch/mips/lib/bootm.c   | 241 ++--
 arch/mips/lib/bootm_qemu_mips.c |  62 ---
 4 files changed, 160 insertions(+), 150 deletions(-)
 delete mode 100644 arch/mips/lib/bootm_qemu_mips.c

-- 
1.8.1.2

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


[U-Boot] [PATCH v3 4/8] MIPS: bootm: refactor initialisation of kernel cmdline

2013-08-11 Thread Daniel Schwierzeck
Move initialisation of Linux command line to separate functions.
Also add support for bootm subcommand 'cmdline'.

Signed-off-by: Daniel Schwierzeck 

---
Changes in v3: None
Changes in v2:
- use debug() macro

 arch/mips/lib/bootm.c | 130 --
 1 file changed, 83 insertions(+), 47 deletions(-)

diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c
index 59ed632..ba9fd68 100644
--- a/arch/mips/lib/bootm.c
+++ b/arch/mips/lib/bootm.c
@@ -19,12 +19,13 @@ DECLARE_GLOBAL_DATA_PTR;
 
 static int linux_argc;
 static char **linux_argv;
+static char *linux_argp;
 
 static char **linux_env;
 static char *linux_env_p;
 static int linux_env_idx;
 
-static void linux_params_init(ulong start, char *commandline);
+static void linux_params_init(void);
 static void linux_env_set(char *env_name, char *env_val);
 
 static ulong arch_get_sp(void)
@@ -48,13 +49,83 @@ void arch_lmb_reserve(struct lmb *lmb)
lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp);
 }
 
+static void linux_cmdline_init(void)
+{
+   linux_argc = 1;
+   linux_argv = (char **)UNCACHED_SDRAM(gd->bd->bi_boot_params);
+   linux_argv[0] = 0;
+   linux_argp = (char *)(linux_argv + LINUX_MAX_ARGS);
+}
+
+static void linux_cmdline_set(const char *value, size_t len)
+{
+   linux_argv[linux_argc] = linux_argp;
+   memcpy(linux_argp, value, len);
+   linux_argp[len] = 0;
+
+   linux_argp += len + 1;
+   linux_argc++;
+}
+
+static void linux_cmdline_dump(void)
+{
+   int i;
+
+   debug("## cmdline argv at 0x%p, argp at 0x%p\n",
+ linux_argv, linux_argp);
+
+   for (i = 1; i < linux_argc; i++)
+   debug("   arg %03d: %s\n", i, linux_argv[i]);
+}
+
+static void boot_cmdline_linux(bootm_headers_t *images)
+{
+   const char *bootargs, *next, *quote;
+
+   linux_cmdline_init();
+
+   bootargs = getenv("bootargs");
+   if (!bootargs)
+   return;
+
+   next = bootargs;
+
+   while (bootargs && *bootargs && linux_argc < LINUX_MAX_ARGS) {
+   quote = strchr(bootargs, '"');
+   next = strchr(bootargs, ' ');
+
+   while (next && quote && quote < next) {
+   /*
+* we found a left quote before the next blank
+* now we have to find the matching right quote
+*/
+   next = strchr(quote + 1, '"');
+   if (next) {
+   quote = strchr(next + 1, '"');
+   next = strchr(next + 1, ' ');
+   }
+   }
+
+   if (!next)
+   next = bootargs + strlen(bootargs);
+
+   linux_cmdline_set(bootargs, next - bootargs);
+
+   if (*next)
+   next++;
+
+   bootargs = next;
+   }
+
+   linux_cmdline_dump();
+}
+
 static void boot_prep_linux(bootm_headers_t *images)
 {
-   char *commandline = getenv("bootargs");
char env_buf[12];
char *cp;
 
-   linux_params_init(UNCACHED_SDRAM(gd->bd->bi_boot_params), commandline);
+   linux_params_init();
 
 #ifdef CONFIG_MEMSIZE_IN_BYTES
sprintf(env_buf, "%lu", (ulong)gd->ram_size);
@@ -107,9 +178,14 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
bootm_headers_t *images)
 {
/* No need for those on MIPS */
-   if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE)
+   if (flag & BOOTM_STATE_OS_BD_T)
return -1;
 
+   if (flag & BOOTM_STATE_OS_CMDLINE) {
+   boot_cmdline_linux(images);
+   return 0;
+   }
+
if (flag & BOOTM_STATE_OS_PREP) {
boot_prep_linux(images);
return 0;
@@ -120,6 +196,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
return 0;
}
 
+   boot_cmdline_linux(images);
boot_prep_linux(images);
boot_jump_linux(images);
 
@@ -127,50 +204,9 @@ int do_bootm_linux(int flag, int argc, char * const argv[],
return 1;
 }
 
-static void linux_params_init(ulong start, char *line)
+static void linux_params_init(void)
 {
-   char *next, *quote, *argp;
-
-   linux_argc = 1;
-   linux_argv = (char **)start;
-   linux_argv[0] = 0;
-   argp = (char *)(linux_argv + LINUX_MAX_ARGS);
-
-   next = line;
-
-   while (line && *line && linux_argc < LINUX_MAX_ARGS) {
-   quote = strchr(line, '"');
-   next = strchr(line, ' ');
-
-   while (next && quote && quote < next) {
-   /*
-* we found a left quote before the next blank
-* now we have to find the matching right quote
-*/
-   next = strchr(quote + 1, '"');
-   if 

Re: [U-Boot] [RFC][PATCH] ARM: mxs: Added application UART driver

2013-08-11 Thread Marek Vasut
Dear Andreas Wass,

> The driver is ported from a driver that was implemented
> using u-boot 2009.
> 
> The driver makes it possible to use a regular application UART as
> the U-Boot output console for MXS CPUs.
> 
> Signed-off-by: Andreas Wass 
> Cc: Fabio Estevam 
> Cc: Marek Vasut 
> ---
>  arch/arm/include/asm/arch-mxs/regs-uartapp.h | 321
> +++ drivers/serial/Makefile  |
>   1 +
>  drivers/serial/mxs_auart.c   | 118 ++
>  drivers/serial/serial.c  |   3 +-
>  4 files changed, 442 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/include/asm/arch-mxs/regs-uartapp.h
>  create mode 100644 drivers/serial/mxs_auart.c
> 
> diff --git a/arch/arm/include/asm/arch-mxs/regs-uartapp.h
> b/arch/arm/include/asm/arch-mxs/regs-uartapp.h new file mode 100644
> index 000..5e871b6
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
> @@ -0,0 +1,321 @@
> +/*
> + * Freescale MXS UARTAPP Register Definitions
> + *
> + * Copyright (C) 2013 Andreas Wass 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */

This is pulled from LTIB, right? Make sure to add proper comment about it (see 
the rest of the drivers).

> +#ifndef __ARCH_ARM___MXS_UARTAPP_H
> +#define __ARCH_ARM___MXS_UARTAPP_H
> +
> +#include 
> +
> +#ifndef __ASSEMBLY__
> +struct mxs_uartapp_regs {
> + mxs_reg_32(hw_uartapp_ctrl0)
> + mxs_reg_32(hw_uartapp_ctrl1)
> + mxs_reg_32(hw_uartapp_ctrl2)
> + mxs_reg_32(hw_uartapp_linectrl)
> + mxs_reg_32(hw_uartapp_linectrl2)
> + mxs_reg_32(hw_uartapp_intr)
> + mxs_reg_32(hw_uartapp_data)
> + mxs_reg_32(hw_uartapp_stat)
> + mxs_reg_32(hw_uartapp_debug)
> + mxs_reg_32(hw_uartapp_version)
> + mxs_reg_32(hw_uartapp_autobaud)
> +};
> +#endif
> +
> +
> +#define BM_UARTAPP_CTRL0_SFTRST  (1 << 31)
> +#define BM_UARTAPP_CTRL0_CLKGATE (1 << 30)
> +#define BM_UARTAPP_CTRL0_RUN (1 << 29)
> +#define BM_UARTAPP_CTRL0_RX_SOURCE   (1 << 28)
> +#define BM_UARTAPP_CTRL0_RXTO_ENABLE (1 << 27)
> +#define BP_UARTAPP_CTRL0_RXTIMEOUT   (1 << 4)
> +#define BM_UARTAPP_CTRL0_RXTIMEOUT   0x07FF
> +#define BF_UARTAPP_CTRL0_RXTIMEOUT(v)  \
> + (((v) << 16) & BM_UARTAPP_CTRL0_RXTIMEOUT)
> +#define BP_UARTAPP_CTRL0_XFER_COUNT  0
> +#define BM_UARTAPP_CTRL0_XFER_COUNT  0x
> +#define BF_UARTAPP_CTRL0_XFER_COUNT(v)  \
> + (((v) << BP_UARTAPP_CTRL0_XFER_COUNT) & \
> +  BM_UARTAPP_CTRL0_XFER_COUNT)

Can you rework it so the register/mask/offset definition pattern matches the 
rest of the files with registers?

- Drop the leading "B[A-Z]_"
- Add _MASK suffix to 'mask' vars (transfor the BM_ vars)
- The BF_ vars are not needed at all
- Add _OFFSET suffix to 'offset' vars (transform the BP_ vars)

It should be a simple 'sed' job.

[...]


> diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
> index 697f2bb..4c45bfa 100644
> --- a/drivers/serial/Makefile
> +++ b/drivers/serial/Makefile
> @@ -38,6 +38,7 @@ COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
>  COBJS-$(CONFIG_ZYNQ_SERIAL) += serial_zynq.o
>  COBJS-$(CONFIG_BFIN_SERIAL) += serial_bfin.o
>  COBJS-$(CONFIG_FSL_LPUART) += serial_lpuart.o
> +COBJS-$(CONFIG_MXS_AUART) += mxs_auart.o
> 
>  ifndef CONFIG_SPL_BUILD
>  COBJS-$(CONFIG_USB_TTY) += usbtty.o
> diff --git a/drivers/serial/mxs_auart.c b/drivers/serial/mxs_auart.c
> new file mode 100644
> index 000..a99dccf
> --- /dev/null
> +++ b/drivers/serial/mxs_auart.c
> @@ -0,0 +1,118 @@
> +/*
> + * Driver to use an application UART as console output for Freescale
> + * MXS devices.
> + *
> + * Copyright (C) 2013 Andreas Wass 
> + *
> + * SPDX-License-Identifier:  GPL-2.0+
> + */
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#ifndef CONFIG_MXS_AUART_BASE
> +#error "CONFIG_MXS_AUART_BASE must be set to the base UART to use"
> +#endif
> +
> +#ifndef CONFIG_MXS_AUART_CLK
> +/* At least the i.MX28 always uses a 24MHz clock for AUART */
> +#define CONFIG_MXS_AUART_CLK 2400
> +#endif

Just drop the leading CONFIG_ here and remove the ifdef, the AUART is always 
supplied from XTAL , so we dont need a config for this.

> +static struct mxs_uartapp_regs *get_uartapp_registers(void)
> +{
> + return (struct mxs_uartapp_regs*)CONFIG_MXS_AUART_BASE;
> +}
> +
> +/*
> + * Set baud rate. The settings are always 8n1
> + */
> +void mxs_auart_setbrg(void)
> +{
> + u32 div;
> + u32 linectrl = 0;
> + struct mxs_uartapp_regs *regs = get_uartapp_registers();
> +
> + div = (CONFIG_MXS_AUART_CLK * 32) / CONFIG_BAUDRATE;
> + linectrl |= BF_UARTAPP_LINECTRL_BAUD_DIVFRAC(div & 0x3F);
> + linectrl |= BF_UARTAPP_LINECTRL_BAUD_DIVINT(div >> 6);
> + linectrl |= BF_UARTAPP_LINECTRL_WLEN(3);
> + linectrl |= BM_U

[U-Boot] [RFC][PATCH] ARM: mxs: Added application UART driver

2013-08-11 Thread Andreas Wass
The driver is ported from a driver that was implemented
using u-boot 2009.

The driver makes it possible to use a regular application UART as
the U-Boot output console for MXS CPUs.

Signed-off-by: Andreas Wass 
Cc: Fabio Estevam 
Cc: Marek Vasut 
---
 arch/arm/include/asm/arch-mxs/regs-uartapp.h | 321 +++
 drivers/serial/Makefile  |   1 +
 drivers/serial/mxs_auart.c   | 118 ++
 drivers/serial/serial.c  |   3 +-
 4 files changed, 442 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/include/asm/arch-mxs/regs-uartapp.h
 create mode 100644 drivers/serial/mxs_auart.c

diff --git a/arch/arm/include/asm/arch-mxs/regs-uartapp.h 
b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
new file mode 100644
index 000..5e871b6
--- /dev/null
+++ b/arch/arm/include/asm/arch-mxs/regs-uartapp.h
@@ -0,0 +1,321 @@
+/*
+ * Freescale MXS UARTAPP Register Definitions
+ *
+ * Copyright (C) 2013 Andreas Wass 
+ *
+ * SPDX-License-Identifier:GPL-2.0+
+ */
+
+#ifndef __ARCH_ARM___MXS_UARTAPP_H
+#define __ARCH_ARM___MXS_UARTAPP_H
+
+#include 
+
+#ifndef __ASSEMBLY__
+struct mxs_uartapp_regs {
+   mxs_reg_32(hw_uartapp_ctrl0)
+   mxs_reg_32(hw_uartapp_ctrl1)
+   mxs_reg_32(hw_uartapp_ctrl2)
+   mxs_reg_32(hw_uartapp_linectrl)
+   mxs_reg_32(hw_uartapp_linectrl2)
+   mxs_reg_32(hw_uartapp_intr)
+   mxs_reg_32(hw_uartapp_data)
+   mxs_reg_32(hw_uartapp_stat)
+   mxs_reg_32(hw_uartapp_debug)
+   mxs_reg_32(hw_uartapp_version)
+   mxs_reg_32(hw_uartapp_autobaud)
+};
+#endif
+
+
+#define BM_UARTAPP_CTRL0_SFTRST(1 << 31)
+#define BM_UARTAPP_CTRL0_CLKGATE   (1 << 30)
+#define BM_UARTAPP_CTRL0_RUN   (1 << 29)
+#define BM_UARTAPP_CTRL0_RX_SOURCE (1 << 28)
+#define BM_UARTAPP_CTRL0_RXTO_ENABLE   (1 << 27)
+#define BP_UARTAPP_CTRL0_RXTIMEOUT (1 << 4)
+#define BM_UARTAPP_CTRL0_RXTIMEOUT 0x07FF
+#define BF_UARTAPP_CTRL0_RXTIMEOUT(v)  \
+   (((v) << 16) & BM_UARTAPP_CTRL0_RXTIMEOUT)
+#define BP_UARTAPP_CTRL0_XFER_COUNT0
+#define BM_UARTAPP_CTRL0_XFER_COUNT0x
+#define BF_UARTAPP_CTRL0_XFER_COUNT(v)  \
+   (((v) << BP_UARTAPP_CTRL0_XFER_COUNT) & \
+BM_UARTAPP_CTRL0_XFER_COUNT)
+
+#define BP_UARTAPP_CTRL1_RSVD2 29
+#define BM_UARTAPP_CTRL1_RSVD2 0xE000
+#define BF_UARTAPP_CTRL1_RSVD2(v) \
+   (((v) << BP_UARTAPP_CTRL1_RSVD2) & \
+BM_UARTAPP_CTRL1_RSVD2)
+
+#define BM_UARTAPP_CTRL1_RUN   (1 << 28)
+#define BP_UARTAPP_CTRL1_RSVD1 16
+#define BM_UARTAPP_CTRL1_RSVD1 0x0FFF
+#define BF_UARTAPP_CTRL1_RSVD1(v)  \
+   (((v) << BP_UARTAPP_CTRL1_RSVD1) & \
+BM_UARTAPP_CTRL1_RSVD1)
+
+#define BP_UARTAPP_CTRL1_XFER_COUNT0
+#define BM_UARTAPP_CTRL1_XFER_COUNT0x
+#define BF_UARTAPP_CTRL1_XFER_COUNT(v)  \
+   (((v) << BP_UARTAPP_CTRL1_XFER_COUNT) & \
+BM_UARTAPP_CTRL1_XFER_COUNT)
+
+#define BM_UARTAPP_CTRL2_INVERT_RTS(1 << 31)
+#define BM_UARTAPP_CTRL2_INVERT_CTS(1 << 30)
+#define BM_UARTAPP_CTRL2_INVERT_TX (1 << 29)
+#define BM_UARTAPP_CTRL2_INVERT_RX (1 << 28)
+#define BM_UARTAPP_CTRL2_RTS_SEMAPHORE (1 << 27)
+#define BM_UARTAPP_CTRL2_DMAONERR  (1 << 26)
+#define BM_UARTAPP_CTRL2_TXDMAE(1 << 25)
+#define BM_UARTAPP_CTRL2_RXDMAE(1 << 24)
+#define BM_UARTAPP_CTRL2_RSVD2 (1 << 23)
+#define BP_UARTAPP_CTRL2_RXIFLSEL  20
+#define BM_UARTAPP_CTRL2_RXIFLSEL  0x0070
+#define BF_UARTAPP_CTRL2_RXIFLSEL(v)  \
+   (((v) << BP_UARTAPP_CTRL2_RXIFLSEL) & \
+BM_UARTAPP_CTRL2_RXIFLSEL)
+
+#define BV_UARTAPP_CTRL2_RXIFLSEL__NOT_EMPTY   0x0
+#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_QUARTER 0x1
+#define BV_UARTAPP_CTRL2_RXIFLSEL__ONE_HALF0x2
+#define BV_UARTAPP_CTRL2_RXIFLSEL__THREE_QUARTERS  0x3
+#define BV_UARTAPP_CTRL2_RXIFLSEL__SEVEN_EIGHTHS   0x4
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID50x5
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID60x6
+#define BV_UARTAPP_CTRL2_RXIFLSEL__INVALID70x7
+#define BM_UARTAPP_CTRL2_RSVD3 (1 << 19)
+#define BP_UARTAPP_CTRL2_TXIFLSEL  16
+#define BM_UARTAPP_CTRL2_TXIFLSEL  0x0007
+#define BF_UARTAPP_CTRL2_TXIFLSEL(v)  \
+   (((v) << BP_UARTAPP_CTRL2_TXIFLSEL) & \
+BM_UARTAPP_CTRL2_TXIFLSEL)
+#define BV_UARTAPP_CTRL2_TXIFLSEL__EMPTY   0x0
+#define BV_UARTAPP_CTRL2_TXIFLSEL

Re: [U-Boot] [PATCH] i.MX: Add documentation on how to use SPI NOR on MX28evk

2013-08-11 Thread Otavio Salvador
On Sun, Aug 11, 2013 at 10:49 AM, Mårten Wikman  wrote:
> This adds necessary information on how to use U-boot on SPI NOR on MX28evk
>
> Signed-off-by: Marten Wikman 

Marten,

The patch looks right and complete; I'd just split it in two patches:

- add the new target
- add documentation

>From your commit log it is not clear you're adding the new target.

-- 
Otavio Salvador O.S. Systems
http://www.ossystems.com.brhttp://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854Mobile: +1 (347) 903-9750
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] Add NanoBone board support

2013-08-11 Thread Tom Rini
On Sun, Aug 11, 2013 at 09:31:00AM +0100, Mark Jackson wrote:

> On 22/04/13 13:46, Mark Jackson wrote:
> > NanoBone Specification:
> > ---
> > CPU:
> >   TI AM335x
> > 
> > Memory:
> >   256MB DDR3
> >   64MB NOR flash
> >   256MB NAND flash
> >   128KB FRAM
> > 
> > Ethernet:
> >   2 x 10/100 connected to SMSC LAN8710 PHY
> > 
> > USB:
> >   1 x USB2.0 Type A
> > 
> > I2C:
> >   2Kbit EEPROM (Microchip 24AA02)
> >   RTC (Maxim DS1338)
> >   GPIO Expander (Microchip MCP23017)
> > 
> > Expansion connector:
> >   6 x UART
> >   1 x MMC/SD
> >   1 x USB2.0
> > 
> > Signed-off-by: Mark Jackson 
> > ---
> > Changes in v2:
> > - Tweaked after comments from Tom Rini
> > 
> >  MAINTAINERS |4 +
> >  board/newflow/nanobone/Makefile |   46 ++
> >  board/newflow/nanobone/board.c  |  304
> > +++
> >  board/newflow/nanobone/board.h  |   24 
> >  board/newflow/nanobone/mux.c|  203 ++
> >  boards.cfg  |1 +
> >  include/configs/nanobone.h  |  285 
> >  7 files changed, 867 insertions(+)
> >  create mode 100644 board/newflow/nanobone/Makefile
> >  create mode 100644 board/newflow/nanobone/board.c
> >  create mode 100644 board/newflow/nanobone/board.h
> >  create mode 100644 board/newflow/nanobone/mux.c
> >  create mode 100644 include/configs/nanobone.h
> 
> Any chance this board can be added ?

I guess the email asking for you to re-send got lost, the copy in
patchwork appears to be whitespace corrupted.  Since you need to re-send
anyhow (sorry) please update to use the SPDX tags now, thanks.

-- 
Tom


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


Re: [U-Boot] [PATCH v8 RESEND 2/2] console: usb: kbd: To improve TFTP booting performance

2013-08-11 Thread Marek Vasut
Dear Jim Lin,

> TFTP booting is slow when a USB keyboard is installed and
> stdin has usbkbd added.
> This fix is to change Ctrl-C polling for USB keyboard to every second
> when NET transfer is running.
> 
> Signed-off-by: Jim Lin 
> ---
> Changes in v2:
>  1. Change configuration name from CONFIG_CTRLC_POLL_MS to
> CONFIG_CTRLC_POLL_S. 2. New code will be executed only when
> CONFIG_CTRLC_POLL_S is defined in configuration header file.
>  3. Add description in README.console.
> Changes in v3:
>  1. Move changes to common/usb_kbd.c and doc/README.usb
>  2. Rename config setting to CONFIG_USBKB_TESTC_PERIOD.
>  3. Remove slow response on USB-keyboard input when TFTP boot is not
> running. Changes in v4:
>  1. Remove changes in doc/README.usb, common/usb_kbd.c and
> CONFIG_USBKB_TESTC_PERIOD
>  2. Modify net/net.c
> Changes in v5:
>  1. Change variable name to ctrlc_t_start.
>  2. Use two calls of get_timer(0) to get time gap.
> Changes in v6:
>  1. In common/usb_kbd.c, check net_busy_flag to determine whether we poll
> USB keyboard status.
>  2. In include/usb.h, add external variable declaration net_busy_flag
> Changes in v7:
>  1. In common/usb_kbd.c and include/usb.h, add #ifdef CONFIG_CMD_NET.
>  2. In common/usb_kbd.c, modify code to get correct time gap.
> Changes in v8:
>  1. Add __maybe_unused for variable kbd_testc_tms.
> 
>  common/usb_kbd.c |   13 +
>  include/usb.h|2 +-
>  2 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/common/usb_kbd.c b/common/usb_kbd.c
> index 3174b5e..4e7b304 100644
> --- a/common/usb_kbd.c
> +++ b/common/usb_kbd.c
> @@ -121,6 +121,9 @@ struct usb_kbd_pdata {
>   uint8_t flags;
>  };
> 
> +/* The period of time between two calls of usb_kbd_testc(). */
> +static unsigned long __maybe_unused kbd_testc_tms;
> +
>  /* Generic keyboard event polling. */
>  void usb_kbd_generic_poll(void)
>  {
> @@ -366,6 +369,16 @@ static int usb_kbd_testc(void)
>   struct usb_device *usb_kbd_dev;
>   struct usb_kbd_pdata *data;
> 
> +#ifdef CONFIG_CMD_NET
> + /*
> +  * If net_busy_flag is 1, NET transfer is running,
> +  * then we check key-pressed every second (first check may be
> +  * less than 1 second) to improve TFTP booting performance.
> +  */
> + if (net_busy_flag && (get_timer(kbd_testc_tms) < CONFIG_SYS_HZ))
> + return 0;
> + kbd_testc_tms = get_timer(0);
> +#endif
>   dev = stdio_get_by_name(DEVNAME);
>   usb_kbd_dev = (struct usb_device *)dev->priv;
>   data = usb_kbd_dev->privptr;
> diff --git a/include/usb.h b/include/usb.h
> index d7b082d..5c95bf5 100644
> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -206,7 +206,7 @@ int usb_host_eth_scan(int mode);
> 
>  int drv_usb_kbd_init(void);
>  int usb_kbd_deregister(void);
> -
> +extern int __maybe_unused net_busy_flag;

I wonder what would happen if you declared it here as

static int __maybe_unused

Would it have some side-effects?

>  #endif
>  /* routines */
>  int usb_init(void); /* initialize the USB Controller */

Othewise,

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


Re: [U-Boot] [RFC 06/10] icpdas lp8x4x: new USB hardware init interface

2013-08-11 Thread Marek Vasut
Dear Mateusz Zalega,

> This commit changes name of an existing initialization function to
> board_usb_init(), so that such functions could be reached by every
> USB driver and command (ie. do_dfu()).
> 
> Signed-off-by: Mateusz Zalega 
> Signed-off-by: Kyungmin Park 
> Cc: Marek Vasut 
> ---
>  board/icpdas/lp8x4x/lp8x4x.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Saw 03-06, OK.

> diff --git a/board/icpdas/lp8x4x/lp8x4x.c b/board/icpdas/lp8x4x/lp8x4x.c
> index 1b68ef3..54f8bba 100644
> --- a/board/icpdas/lp8x4x/lp8x4x.c
> +++ b/board/icpdas/lp8x4x/lp8x4x.c
> @@ -15,6 +15,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
> 
>  DECLARE_GLOBAL_DATA_PTR;
> 
> @@ -58,7 +59,7 @@ int board_mmc_init(bd_t *bis)
>  #endif
> 
>  #ifdef   CONFIG_CMD_USB
> -int usb_board_init(void)
> +int board_usb_init(enum board_usb_init_type what_to_init)
>  {
>   writel((UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
>   ~(UHCHR_SSEP0 | UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSE),
> @@ -89,7 +90,7 @@ int usb_board_init(void)
>   return 0;
>  }
> 
> -void usb_board_init_fail(void)
> +void board_usb_init_fail(void)
>  {
>   return;
>  }

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] omap1510inn: arm925t: remove support

2013-08-11 Thread Tom Rini
On Sun, Aug 11, 2013 at 03:28:41PM +0200, Albert ARIBAUD wrote:

> omap1510inn is orphan and has been for years now.
> Reove it and, as it was the only arm925t target,
> also remove arm925t support.
> 
> Signed-off-by: Albert ARIBAUD 

Acked-by: Tom Rini 

-- 
Tom


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


Re: [U-Boot] [RFC 01/10] New board-specific USB initialization interface

2013-08-11 Thread Marek Vasut
Dear Mateusz Zalega,

> This commit unifies board-specific USB initialization implementations
> under one symbol (usb_board_init), declaration of which is available in
> usb.h.
> 
> Signed-off-by: Mateusz Zalega 
> Signed-off-by: Kyungmin Park 
> Reviewed-by: Lukasz Majewski 
> Cc: Marek Vasut 
> ---
>  common/cmd_dfu.c  |  5 ++---
>  common/cmd_usb_mass_storage.c |  3 ++-
>  common/usb.c  |  5 +
>  drivers/usb/host/ehci-omap.c  |  8 +---
>  drivers/usb/host/ehci-tegra.c |  2 +-
>  drivers/usb/host/ohci-hcd.c   |  4 ++--
>  drivers/usb/host/ohci.h   | 12 +---
>  include/g_dnl.h   |  2 --
>  include/usb.h | 17 -
>  include/usb_mass_storage.h| 12 +---
>  10 files changed, 39 insertions(+), 31 deletions(-)

[...]

> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -165,10 +165,25 @@ int submit_int_msg(struct usb_device *dev, unsigned
> long pipe, void *buffer,
> 
>  extern void udc_disconnect(void);
> 
> -#else
> +#elif !defined(CONFIG_USB_GADGET)
>  #error USB Lowlevel not defined
>  #endif
> 
> +/* You can initialize platform's USB host, device or both
> + * capabilities by passing this enum as an argument to
> + * board_usb_init().
> + */

The comment style is wrong, please fix. Did the patchset pass checkpatch ?

/*
 * multi
 * line
 * comment
 */

> +enum board_usb_init_type {
> + USB_INIT_ALL,
> + USB_INIT_HOST,
> + USB_INIT_DEVICE
> +};
> +
> +/* board-specific hardware initialization, called by
> + * usb drivers and u-boot commands
> + */
> +int board_usb_init(enum board_usb_init_type what_to_init);
> +
>  #ifdef CONFIG_USB_STORAGE
> 
>  #define USB_MAX_STOR_DEV 5
> diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
> index 35cdcc3..de31b0e 100644
> --- a/include/usb_mass_storage.h
> +++ b/include/usb_mass_storage.h
> @@ -30,13 +30,11 @@ struct ums_board_info {
>   struct ums_device ums_dev;
>  };
> 
> -extern void board_usb_init(void);
> -
> -extern int fsg_init(struct ums_board_info *);
> -extern void fsg_cleanup(void);
> -extern struct ums_board_info *board_ums_init(unsigned int,
> +int fsg_init(struct ums_board_info *);
> +void fsg_cleanup(void);
> +struct ums_board_info *board_ums_init(unsigned int,
>unsigned int, unsigned int);
> -extern int usb_gadget_handle_interrupts(void);
> -extern int fsg_main_thread(void *);
> +int usb_gadget_handle_interrupts(void);
> +int fsg_main_thread(void *);
> 
>  #endif /* __USB_MASS_STORAGE_H__ */

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


Re: [U-Boot] omap1510inn/arm925t: maintain or remove?

2013-08-11 Thread Marek Vasut
Dear Wolfgang Denk,

> Dear Albert,
> 
> In message <20130810084118.2d6c9804@lilith> you wrote:
> > Board omap1510inn is marked orphaned.
> 
> ...
> 
> > Should I try and clean this within my start.S commonalization effort
> > (first submission tonight, BTW) and move the signature generation
> > in ./Makefile as a new image rule, or should I simply remove omap1510inn
> > as well as the whole arm295t support?
> > 
> > My own vote goes for removing; anyone wishing to resurrect the board
> > can do it from some commit before removal.
> 
> My vote goes for removal, too.  This is stuff which has long reached
> EOL.

I have one OMAP1510 board running U-Boot 1.1.3 (Palm Tungsten|T), but I dont 
think I will ever touch it again, so my vote goes for removal too.

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


[U-Boot] [PATCH] spi: mxs: Configure chipselect after block reset

2013-08-11 Thread Marek Vasut
The chipselect must be written into the CTRL0 register after the SSP
block is reset, otherwise the block will always use ChipSelect #0.

Signed-off-by: Marek Vasut 
Cc: Fabio Estevam 
Cc: Jagannadha Sutradharudu Teki 
Cc: Otavio Salvador 
Cc: Stefano Babic 
---
 drivers/spi/mxs_spi.c |   10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 3cf7142..a31d19f 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -57,7 +57,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
 {
struct mxs_spi_slave *mxs_slave;
struct mxs_ssp_regs *ssp_regs;
-   int reg;
 
if (!spi_cs_is_valid(bus, cs)) {
printf("mxs_spi: invalid bus %d / chip select %d\n", bus, cs);
@@ -76,11 +75,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned 
int cs,
mxs_slave->regs = mxs_ssp_regs_by_bus(bus);
ssp_regs = mxs_slave->regs;
 
-   reg = readl(&ssp_regs->hw_ssp_ctrl0);
-   reg &= ~(MXS_SSP_CHIPSELECT_MASK);
-   reg |= cs << MXS_SSP_CHIPSELECT_SHIFT;
-
-   writel(reg, &ssp_regs->hw_ssp_ctrl0);
return &mxs_slave->slave;
 
 err_init:
@@ -102,7 +96,9 @@ int spi_claim_bus(struct spi_slave *slave)
 
mxs_reset_block(&ssp_regs->hw_ssp_ctrl0_reg);
 
-   writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0);
+   writel((slave->cs << MXS_SSP_CHIPSELECT_SHIFT) |
+  SSP_CTRL0_BUS_WIDTH_ONE_BIT,
+  &ssp_regs->hw_ssp_ctrl0);
 
reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS;
reg |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH 07/11] video: Encapsulate font in video_font_data.h

2013-08-11 Thread Marek Vasut
Dear Anatolij Gustschin,

> Hi,
> 
> On Tue, 30 Jul 2013 23:37:57 +0200
> 
> Marek Vasut  wrote:
> > This patch moves all the font configuration values into video_font_data.h
> > so they are all in the right place with the font. The video_font.h now
> > only includes video_font_data.h and will allow us to select and include
> > different font once more fonts are added.
> 
> this patch adds a warning:
> 
> Configuring for mcc200 board...
>text  data bss dec hex filename
>  202480 19924  286272  508676   7c304 ./u-boot
> /home/ag/u-boot/u-boot-video/include/video_font_data.h:16:22: warning:
> 'video_fontdata' defined but not used [-Wunused-variable]
> 
> and commit d3983ee85 did this video_font.h split. Any idea how we
> should handle it?

Dang. What about adding __maybe_ununsed for the video_fontdata ?

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


[U-Boot] [PATCH 1/1] ARM: igep00x0.h: Enable raw initrd support

2013-08-11 Thread Javier Martinez Canillas
Now that IGEP base boards default environment use
the bootz command to boot a zImage instead of a
uImage, it makes sense to add support to supply a
raw initrd image to the kernel if needed.

Signed-off-by: Javier Martinez Canillas 
---
 include/configs/igep00x0.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/igep00x0.h b/include/configs/igep00x0.h
index 13d58a4..ed8c927 100644
--- a/include/configs/igep00x0.h
+++ b/include/configs/igep00x0.h
@@ -44,6 +44,7 @@
 
 #define CONFIG_OF_LIBFDT
 #define CONFIG_CMD_BOOTZ
+#define CONFIG_SUPPORT_RAW_INITRD
 
 /*
  * NS16550 Configuration
-- 
1.7.7.6

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


[U-Boot] [PATCH v6] NET: mvgbe: avoid unused variable warning when used without phylib support

2013-08-11 Thread Sascha Silbe
Avoid a recently introduced unused variable warning for boards that
use mvgbe but not phylib.

Signed-off-by: Sascha Silbe 
---
 v5->v6: Split out from CuBox support patch series.

 drivers/net/mvgbe.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c
index 6c901d1..0cd06b6 100644
--- a/drivers/net/mvgbe.c
+++ b/drivers/net/mvgbe.c
@@ -420,8 +420,9 @@ static int mvgbe_init(struct eth_device *dev)
 {
struct mvgbe_device *dmvgbe = to_mvgbe(dev);
struct mvgbe_registers *regs = dmvgbe->regs;
-#if (defined (CONFIG_MII) || defined (CONFIG_CMD_MII)) \
-&& defined (CONFIG_SYS_FAULT_ECHO_LINK_DOWN)
+#if (defined(CONFIG_MII) || defined(CONFIG_CMD_MII)) &&  \
+   !defined(CONFIG_PHYLIB) &&   \
+   defined(CONFIG_SYS_FAULT_ECHO_LINK_DOWN)
int i;
 #endif
/* setup RX rings */
-- 
1.8.3.2

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


[U-Boot] [PATCH] kirkwood: use 64bit integer for IDE LBA sector numbers

2013-08-11 Thread Sascha Silbe
Many recent hard disks are larger than 2TiB. They still use a logical
sector size of 512, so 32-bit sector numbers are insufficient (and
even with 4K logical sector size we'd exceed the limit once there are
16TiB drives).

Signed-off-by: Sascha Silbe 
---
 arch/arm/include/asm/arch-kirkwood/config.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/include/asm/arch-kirkwood/config.h 
b/arch/arm/include/asm/arch-kirkwood/config.h
index 197703b..d7129e2 100644
--- a/arch/arm/include/asm/arch-kirkwood/config.h
+++ b/arch/arm/include/asm/arch-kirkwood/config.h
@@ -117,6 +117,7 @@
 #define CONFIG_SYS_ATA_STRIDE  4
 /* Controller supports 48-bits LBA addressing */
 #define CONFIG_LBA48
+#define CONFIG_SYS_64BIT_LBA
 /* CONFIG_CMD_IDE requires some #defines for ATA registers */
 #define CONFIG_SYS_IDE_MAXBUS  2
 #define CONFIG_SYS_IDE_MAXDEVICE   2
-- 
1.8.3.2

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


[U-Boot] [PATCH] i.MX: Add documentation on how to use SPI NOR on MX28evk

2013-08-11 Thread Mårten Wikman
This adds necessary information on how to use U-boot on SPI NOR on MX28evk

Signed-off-by: Marten Wikman 
---
 board/freescale/mx28evk/README | 26 ++
 boards.cfg |  1 +
 doc/README.mxs | 25 +
 3 files changed, 48 insertions(+), 4 deletions(-)

diff --git a/board/freescale/mx28evk/README b/board/freescale/mx28evk/README
index 524f3fc..37e5d55 100644
--- a/board/freescale/mx28evk/README
+++ b/board/freescale/mx28evk/README
@@ -23,11 +23,19 @@ To boot MX28EVK from an SD card, set the boot mode
DIP switches as:
* VDD 5V: To the left (off)
* Hold Button: Down (off)

+
+To boot MX28EVK from SPI NOR flash, set the boot mode DIP switches as:
+   * Boot Mode Select: 0 0 1 0 (Boot from SSP2)
+   * JTAG PSWITCH RESET: To the right (reset disabled)
+   * Battery Source: Down
+   * Wall 5V: Up
+   * VDD 5V: To the left (off)
+   * Hold Button: Down (off)

 Environment Storage
 ---

-There are two targets for mx28evk:
+There are three targets for mx28evk:

 "make mx28evk_config"  - store enviroment variables into MMC

@@ -35,12 +43,22 @@ or

 "make mx28evk_nand_config" - store enviroment variables into NAND flash

+or
+"make mx28evk_spi_config"  - store enviroment variables into SPI NOR flash
+
 Choose the target accordingly.

 Note: The mx28evk board does not come with a NAND flash populated from the
 factory. It comes with an empty slot (U23), which allows the insertion of a
-48-pin TSOP flash device.
-
-Follow the instructions from doc/README.mxs to generate a bootable SD card.
+48-pin TSOP flash device. SPI NOR flash is neither populated from the factory.
+It is possible to solder a SOIC memory on U49 or use a DIP8 on J89.
+To get SPI communication to work R320, R321,R322 and C178 has to be populated.
+Look in the schematics for component values.

+Follow the instructions from doc/README.mxs to generate a bootable SD card.
 Insert the SD card in slot 0, power up the board and U-boot will boot.
+
+Follow the instructions from  doc/README.mxs to generate a bootable SPI NOR
+memory.
+Make sure boot mode switches are correct, press POWER and U-boot will boot.
+
diff --git a/boards.cfg b/boards.cfg
index 944ed4c..b9ee7bd 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -203,6 +203,7 @@ mx23evk  arm arm926ejs
  mx23evk freesca
 m28evk   arm arm926ejs   m28evk
   denx   mxs   m28evk
 mx28evk  arm arm926ejs   mx28evk
   freescale  mxs   mx28evk:ENV_IS_IN_MMC
 mx28evk_nand arm arm926ejs   mx28evk
   freescale  mxs   mx28evk:ENV_IS_IN_NAND
+mx28evk_spi  arm arm926ejs   mx28evk
   freescale  mxs   mx28evk:ENV_IS_IN_SPI_FLASH
 sc_sps_1 arm arm926ejs   sc_sps_1
   schulercontrol mxs
 nhk8815  arm arm926ejs   nhk8815
   st nomadik
 nhk8815_onenand  arm arm926ejs   nhk8815
   st nomadik   nhk8815:BOOT_ONENAND
diff --git a/doc/README.mxs b/doc/README.mxs
index 5d9e72f..8f03711 100644
--- a/doc/README.mxs
+++ b/doc/README.mxs
@@ -23,6 +23,7 @@ Contents
 2) Compiling U-Boot for a MXS based board
 3) Installation of U-Boot for a MXS based board to SD card
 4) Installation of U-Boot into NAND flash on a MX28 based board
+5) Installation of U-boot into SPI NOR flash on a MX28 based board

 1) Prerequisites
 
@@ -234,3 +235,27 @@ There are two possibilities when preparing an
image writable to NAND flash.
   In case the user needs to boot a firmware image bigger than 1Mb, the
   user has to adjust the "update_nand_firmware_maxsz" variable for the
   update scripts to work properly.
+
+   
+   
+5) Installation of U-Boot to SPI NOR flash on a MX28 based board
+---
+
+To boot a MX28 based board from SPI NOR, set the boot mode DIP
switches according
+to MX28 manual section 12.2.1 (Table 12-2), SSP2
+
+The file u-boot.sb can be directly written to SPI NOR from U-boot prompt.
+
+Load u-boot to RAM, this can be done in several ways and one way is
to use tftp:
+   => tftp u-boot.sb 0x4200
+
+Activate correct SPI NOR flash with:
+   => sf probe 2:0
+
+First the blocks where U-boot should be written to needs to be erased:
+   => sf erase 0x0 0x8
+   
+Write u-boot.sb to SPI NOR with:
+   => sf write 0x4200 0 0x8
+   
+Last step is to power up board and U-boot should start.
-- 
1.8.3.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE

2013-08-11 Thread Wolfgang Denk
Dear Bo Shen,

In message <1376230503-25331-1-git-send-email-voice.s...@gmail.com> you wrote:
> when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define
> CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid
> compile error if not define CONFIG_ENV_SIZE

I don;t understand the rationale for this patch.  In which way is the
environment seize for the CONFIG_ENV_IS_NOWHERE case different from
any other cases?  For these, we do not define a default either, so why
should we handle this case differently?

In any cse, the needed environment seize if a pretty board specific
thing, and I think it makes sense to let the user define it.

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
Anyone who isn't confused here doesn't really know what's going on.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] OpenRD: relocate environment to 640kB

2013-08-11 Thread Sascha Silbe
Hi Albert,

Albert ARIBAUD  writes:
> On Mon, 15 Jul 2013 08:19:57 -0400, Tom Rini  wrote:
>> On Mon, Jul 15, 2013 at 11:23:54AM +0200, Sascha Silbe wrote:

>>> With v2013.07-rc3, we are now at 376344B (~ 96% of 384KiB) for
>>> openrd_ultimate when built on Debian Wheezy using
>>> gcc-4.7-arm-linux-gnueabi from Emdebian.
[...]
>> Yes, you can try using CONFIG_BOARD_SIZE_LIMIT, which is missing from
>> the README, but does have a few examples (git grep around).  A patch to
>> document it, and then a patch to enable for openrd would be much
>> appreciated.  Thanks!

> Sascha, does this mean the env relocate patch here is dropped in favor
> of a CONFIG_BOARD_SIZE_LIMIT check at build time?

Given that we're already very close to the limit, we'll likely need the
environment relocation patch sooner or later anyway. I'd prefer it to go
in now as part of the regular release cycle, rather than as a hot-fix
whenever it finally spills over. That also reduces the risk of builds
failing only with particular toolchain versions.

Sascha


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


Re: [U-Boot] [RESEND PATCH v2 00/20] sf: Add common probe support

2013-08-11 Thread Sascha Silbe
Hello Jagan,

Jagan Teki  writes:

> Please find the test branch for this patch series, here.
> http://git.denx.de/?p=u-boot/u-boot-spi.git;a=shortlog;h=refs/heads/master-test
>
> Request to test these changes on your boards.
> Let me know for any issues.

Thanks for setting up a branch for easier testing. I've rebased the
CuBox support patch series [1] on top of your branch and tested the
result. SPI flash support worked before on CuBox, but fails with your
branch.

At build time, the following warnings are issued (found using
DBGFLAGS="-g -Werror"):

make[1]: Entering directory `/lhome/sascha.silbe/src/u-boot/common'
arm-linux-gnueabi-gcc  -g -Werror -Os   -ffunction-sections -fdata-sections 
-fno-common -ffixed-r8 -msoft-float  -D__KERNEL__ 
-DCONFIG_SYS_TEXT_BASE=0x0060 -I/lhome/sascha.silbe/src/u-boot/include 
-fno-builtin -ffreestanding -nostdinc -isystem 
/usr/lib/gcc/arm-linux-gnueabi/4.7/include -pipe  -DCONFIG_ARM -D__ARM__ -marm 
-mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -Wall -Wstrict-prototypes 
-fno-stack-protector -Wno-format-nonliteral -Wno-format-security -fstack-usage  
   -o cmd_sf.o cmd_sf.c -c
In file included from cmd_sf.c:11:0:
/lhome/sascha.silbe/src/u-boot/include/spi_flash.h:37:12: error: 
‘spi_write_cmds_array’ defined but not used [-Werror=unused-variable]
/lhome/sascha.silbe/src/u-boot/include/spi_flash.h:56:12: error: 
‘spi_read_cmds_array’ defined but not used [-Werror=unused-variable]
cc1: all warnings being treated as errors
make[1]: *** [cmd_sf.o] Error 1


At run time, automatically reading the environment from SPI flash
fails. "sf probe" and "sf read" both appear to work, but "sf probe"
reports 64KiB page size and "sf read" only yields 0xff rather than the
U-Boot binary that's at the start of SPI flash:

=== Begin ===
U-Boot 2013.07-00163-g753bc19 (Aug 11 2013 - 12:13:01)SolidRun CuBox

SoC:   Dove 88AP510 (A1)
CPU:   Marvell Sheeva (rev 5)
DRAM:  2 GiB
MMC:   Dove SDHCI0: 0
*** Warning - spi_flash_probe() failed, using default environment

In:serial
Out:   serial
Err:   serial
Net:   egiga0 Waiting for PHY auto negotiation to complete done
egiga0
Warning: failed to set MAC address

Hit any key to stop autoboot:  0 
CuBox> sf probe
SF: Detected W25Q32BV with page size 64 KiB, total 4 MiB
CuBox> sf read ${loadaddr} 0 0x2
SF: 131072 bytes @ 0x0 Read: OK
CuBox> md.b ${loadaddr}
0200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0210: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0220: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
0230: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
=== End ===


For comparison, this is what it looks like on top of current master:

=== Begin ===
U-Boot 2013.07-00123-gde877d3 (Aug 11 2013 - 13:39:44)SolidRun CuBox

SoC:   Dove 88AP510 (A1)
CPU:   Marvell Sheeva (rev 5)
DRAM:  2 GiB
MMC:   Dove SDHCI0: 0
SF: Detected W25Q32BV/W25Q32FV_SPI with page size 4 KiB, total 4 MiB
In:serial
Out:   serial
Err:   serial
Net:   egiga0 Waiting for PHY auto negotiation to complete... done
egiga0
Hit any key to stop autoboot:  0 
CuBox> sf probe
SF: Detected W25Q32BV/W25Q32FV_SPI with page size 4 KiB, total 4 MiB
CuBox> sf read ${loadaddr} 0 0x2  
SF: 131072 bytes @ 0x0 Read: OK
CuBox> md.b ${loadaddr}
0200: 5a 00 00 00 54 67 04 00 00 00 00 00 00 02 00 00Z...Tg..
0210: 00 00 60 00 00 00 60 00 00 00 00 00 00 00 01 dc..`...`.
0220: 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00@...
0230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
CuBox> 
=== End ===


Is there something that needs to be done differently now? Some
additional function to call in board setup code or defines to set in the
board configuration?

Sascha

[1] mid:1372195668-25496-1-git-send-email-t-ub...@infra-silbe.de
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/148412/focus=164287


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


[U-Boot] [PATCH 2/3] Makefile: check native boot image sizes against CONFIG_BOARD_SIZE_LIMIT

2013-08-11 Thread Sascha Silbe
The purpose of CONFIG_BOARD_SIZE_LIMIT is to make sure that U-Boot
fits into the space reserved for it in some permanent storage. This
includes any overhead incurred by native boot image formats, so check
the final image against the size limit, too.

Signed-off-by: Sascha Silbe 
---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index d545d30..3e05f9a 100644
--- a/Makefile
+++ b/Makefile
@@ -459,15 +459,18 @@ $(obj)u-boot.img: $(obj)u-boot.bin
 
 $(obj)u-boot.imx: $(obj)u-boot.bin depend
$(MAKE) -C $(SRCTREE)/arch/arm/imx-common $(OBJTREE)/u-boot.imx
+   $(BOARD_SIZE_CHECK)
 
 $(obj)u-boot.kwb:   $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_SYS_KWD_CONFIG) -T kwbimage \
-a $(CONFIG_SYS_TEXT_BASE) -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
+   $(BOARD_SIZE_CHECK)
 
 $(obj)u-boot.pbl:  $(obj)u-boot.bin
$(obj)tools/mkimage -n $(CONFIG_PBLRCW_CONFIG) \
-R $(CONFIG_PBLPBI_CONFIG) -T pblimage \
-d $< $@
+   $(BOARD_SIZE_CHECK)
 
 $(obj)u-boot.sha1: $(obj)u-boot.bin
$(obj)tools/ubsha1 $(obj)u-boot.bin
-- 
1.8.3.2

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


[U-Boot] [PATCH 1/3] README: document CONFIG_BOARD_SIZE_LIMIT

2013-08-11 Thread Sascha Silbe
CONFIG_BOARD_SIZE_LIMIT was introduced by f3a14d37 [Makefile: allow
boards to check file size limits] and is in use by several boards, but
never got documented.

Signed-off-by: Sascha Silbe 
---
 README | 5 +
 1 file changed, 5 insertions(+)

diff --git a/README b/README
index a5c3e8d..760c417 100644
--- a/README
+++ b/README
@@ -3843,6 +3843,11 @@ use the "saveenv" command to store a valid environment.
later, once stdio is running and output goes to the LCD, if
present.
 
+- CONFIG_BOARD_SIZE_LIMIT:
+   Maximum size of the U-Boot image. When defined, the
+   build system checks that the actual size does not
+   exceed it.
+
 Low Level (hardware related) configuration options:
 ---
 
-- 
1.8.3.2

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


[U-Boot] [PATCH 3/3] openrd: fail build if U-Boot would overlap with environment in flash

2013-08-11 Thread Sascha Silbe
Set CONFIG_BOARD_SIZE_LIMIT so we'll notice at build time if U-Boot
has grown so large that it would overlap with the environment area in
flash, rather than bricking the device at run-time on first saveenv.

Signed-off-by: Sascha Silbe 
---
 include/configs/openrd.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/include/configs/openrd.h b/include/configs/openrd.h
index 8fab6e6..b7526f8 100644
--- a/include/configs/openrd.h
+++ b/include/configs/openrd.h
@@ -76,6 +76,11 @@
 #define CONFIG_ENV_SIZE0x2 /* 128k */
 #define CONFIG_ENV_ADDR0x6
 #define CONFIG_ENV_OFFSET  0x6 /* env starts here */
+/*
+ * Environment is right behind U-Boot in flash. Make sure U-Boot
+ * doesn't grow into the environment area.
+ */
+#define CONFIG_BOARD_SIZE_LIMITCONFIG_ENV_OFFSET
 
 /*
  * Default environment variables
-- 
1.8.3.2

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


[U-Boot] [PATCH 0/3] openrd: Check U-Boot size at build time

2013-08-11 Thread Sascha Silbe
Tom Rini  writes:

> Yes, you can try using CONFIG_BOARD_SIZE_LIMIT, which is missing from
> the README, but does have a few examples (git grep around).  A patch to
> document it, and then a patch to enable for openrd would be much
> appreciated.  Thanks!

Thanks for the pointer. Here we go.

Sascha Silbe (3):
  README: document CONFIG_BOARD_SIZE_LIMIT
  Makefile: check native boot image sizes against
CONFIG_BOARD_SIZE_LIMIT
  openrd: fail build if U-Boot would overlap with environment in flash

 Makefile | 3 +++
 README   | 5 +
 include/configs/openrd.h | 5 +
 3 files changed, 13 insertions(+)

-- 
1.8.3.2

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


[U-Boot] [PATCH] arm: atmel: sama5d3: fix typo error for CONFIG_ENV_IS_NOWHERE

2013-08-11 Thread Bo Shen
fix typo error for CONFIG_ENV_IS_NOWHERE from CONIG_ENV_IS_NOWHERE

Signed-off-by: Bo Shen 

---
 include/configs/sama5d3xek.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/sama5d3xek.h b/include/configs/sama5d3xek.h
index 10697d6..87c9aba 100644
--- a/include/configs/sama5d3xek.h
+++ b/include/configs/sama5d3xek.h
@@ -195,7 +195,7 @@
"bootm 0x2200 - 0x2100"
 #define CONFIG_SYS_MMC_ENV_DEV 0
 #else
-#define CONIG_ENV_IS_NOWHERE
+#define CONFIG_ENV_IS_NOWHERE
 #endif
 
 #ifdef CONFIG_SYS_USE_MMC
-- 
1.7.10.4

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


[U-Boot] [RFC PATCH] env: add default env size for CONFIG_ENV_IS_NOWHERE

2013-08-11 Thread Bo Shen
when CONFIG_ENV_IS_NOWHERE is enabled, it is still need to define
CONFIG_ENV_SIZE. So, add a default size (1024 Bytes) to avoid
compile error if not define CONFIG_ENV_SIZE

Signed-off-by: Bo Shen 

---
The default value for CONFIG_ENV_SIZE (1024 Bytes) maybe not the
better choice, consider runtime decided, however failed.

This patch is only compile testing with CONFIG_ENV_IS_NOWHERE enable
---

 include/environment.h |6 ++
 1 file changed, 6 insertions(+)

diff --git a/include/environment.h b/include/environment.h
index 46a3554..52a7769 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -146,6 +146,12 @@ extern unsigned long nand_env_oob_offset;
 extern char *env_name_spec;
 #endif
 
+#ifdef CONFIG_ENV_IS_NOWHERE
+# ifndef CONFIG_ENV_SIZE
+# define CONFIG_ENV_SIZE 0x400
+# endif
+#endif
+
 #define ENV_SIZE (CONFIG_ENV_SIZE - ENV_HEADER_SIZE)
 
 typedef struct environment_s {
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH 1/3] spi: Add zynq qspi controller driver

2013-08-11 Thread Jagan Teki
Hi,

On Sun, Aug 11, 2013 at 3:42 PM,   wrote:
> Hi Jagan,
>
>> +
>> +/* Definitions of the flash commands - Flash insts in ascending order */
>> +#define ZYNQ_QSPI_FLASH_INST_WRSR0x01/* Write status register */
>> +#define ZYNQ_QSPI_FLASH_INST_PP  0x02/* Page program */
>> +#define ZYNQ_QSPI_FLASH_INST_WRDS0x04/* Write disable */
>> +#define ZYNQ_QSPI_FLASH_INST_RDSR1   0x05/* Read status register 1 */
>> +#define ZYNQ_QSPI_FLASH_INST_WREN0x06/* Write enable */
>> +#define ZYNQ_QSPI_FLASH_INST_AFR 0x0B/* Fast read data bytes */
>> +#define ZYNQ_QSPI_FLASH_INST_BE_4K   0x20/* Erase 4KiB block */
>> +#define ZYNQ_QSPI_FLASH_INST_RDSR2   0x35/* Read status register 2 */
>> +#define ZYNQ_QSPI_FLASH_INST_BE_32K  0x52/* Erase 32KiB block */
>> +#define ZYNQ_QSPI_FLASH_INST_RDID0x9F/* Read JEDEC ID */
>> +#define ZYNQ_QSPI_FLASH_INST_SE  0xD8/* Sector erase 
>> (usually 64KB)*/
>
> As I have written some time ago, I think it is a bad idea to parse the
> flash commands in the spi driver!
> The flash driver, who wants to write these commands and should know the 
> details,
> which parts of the message needs to be send as dual/quad transfer, should
> provide this information to the spi driver (probably as flags for spi_xfer())
>
> A first idea for the flags:
> - the X refers to different numbers, as required by the flash (depending on 
> the
> addressing mode (3/4 byte) or if the address is already sent as DUAL/QUAD)
> SPI_XFER_X_DUAL
> SPI_XFER_X_QUAD
>
> So having 0-5 for X should be enough to support all flashes
> -> 0 if the command is already in DUAL/QUAD mode
> -> 5 for command + 4byte address
> (I am not sure about dummy bytes on read)
>
> So for example:
> switch to dual transfer after first byte: SPI_XFER_1_DUAL
> switch to QUAD transfer after 4 bytes (e.g. 3byte address): SPI_XFER_4_QUAD
>
> Then only the flash driver needs to know these requirements, depending on
> manufacturer and chip type, and the spi driver just "reacts" on the flags.
> Otherwise this driver has to be extended each time a new command is added to
> the flash driver (as you did in some later patches!)
>

Thanks for your comments.
Yes, I agreed controller doesn't require to know about the flash instructions.
I am planning to remove these setup on next coming patch versions.

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


[U-Boot] [PATCH] omap1510inn: arm925t: remove support

2013-08-11 Thread Albert ARIBAUD
omap1510inn is orphan and has been for years now.
Reove it and, as it was the only arm925t target,
also remove arm925t support.

Signed-off-by: Albert ARIBAUD 
---
 MAINTAINERS  |   2 -
 MAKEALL  |   1 -
 README   |   1 -
 arch/arm/cpu/arm925t/Makefile|  34 ---
 arch/arm/cpu/arm925t/config.mk   |  17 --
 arch/arm/cpu/arm925t/cpu.c   |  50 
 arch/arm/cpu/arm925t/omap925.c   |  23 --
 arch/arm/cpu/arm925t/start.S | 382 ---
 arch/arm/cpu/arm925t/timer.c | 104 -
 board/ti/omap1510inn/Makefile|  29 ---
 board/ti/omap1510inn/config.mk   |  25 --
 board/ti/omap1510inn/lowlevel_init.S | 380 --
 board/ti/omap1510inn/omap1510innovator.c | 125 --
 boards.cfg   |   1 -
 include/arm925t.h|  11 -
 include/configs/omap1510inn.h| 166 --
 16 files changed, 1351 deletions(-)
 delete mode 100644 arch/arm/cpu/arm925t/Makefile
 delete mode 100644 arch/arm/cpu/arm925t/config.mk
 delete mode 100644 arch/arm/cpu/arm925t/cpu.c
 delete mode 100644 arch/arm/cpu/arm925t/omap925.c
 delete mode 100644 arch/arm/cpu/arm925t/start.S
 delete mode 100644 arch/arm/cpu/arm925t/timer.c
 delete mode 100644 board/ti/omap1510inn/Makefile
 delete mode 100644 board/ti/omap1510inn/config.mk
 delete mode 100644 board/ti/omap1510inn/lowlevel_init.S
 delete mode 100644 board/ti/omap1510inn/omap1510innovator.c
 delete mode 100644 include/arm925t.h
 delete mode 100644 include/configs/omap1510inn.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 081cf96..49da125 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1088,8 +1088,6 @@ Unknown / orphaned boards:
Board   CPU Last known maintainer / Comment
 .
 
-   omap1510inn ARM925T Kshitij Gupta 
-
lubbock xscale/pxa  Kyle Harris  / 
dead address
 
imx31_phycore_eet i.MX31  Guennadi Liakhovetski  
/ resigned
diff --git a/MAKEALL b/MAKEALL
index bed99de..da89752 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -353,7 +353,6 @@ LIST_ARM7="$(boards_by_cpu arm720t)"
 
 LIST_ARM9="$(boards_by_cpu arm920t)\
$(boards_by_cpu arm926ejs)  \
-   $(boards_by_cpu arm925t)\
$(boards_by_cpu arm946es)   \
 "
 
diff --git a/README b/README
index a5c3e8d..b9ed3df 100644
--- a/README
+++ b/README
@@ -139,7 +139,6 @@ Directory Hierarchy:
/at91   Files specific to Atmel AT91RM9200 CPU
/imxFiles specific to Freescale MC9328 i.MX CPUs
/s3c24x0Files specific to Samsung S3C24X0 CPUs
-  /arm925t Files specific to ARM 925 CPUs
   /arm926ejs   Files specific to ARM 926 CPUs
   /arm1136 Files specific to ARM 1136 CPUs
   /ixp Files specific to Intel XScale IXP CPUs
diff --git a/arch/arm/cpu/arm925t/Makefile b/arch/arm/cpu/arm925t/Makefile
deleted file mode 100644
index 40d2156..000
--- a/arch/arm/cpu/arm925t/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-#
-# (C) Copyright 2000-2006
-# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-include $(TOPDIR)/config.mk
-
-LIB= $(obj)lib$(CPU).o
-
-START  = start.o
-
-COBJS  += cpu.o
-COBJS  += omap925.o
-COBJS  += timer.o
-
-SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
-START  := $(addprefix $(obj),$(START))
-
-all:   $(obj).depend $(START) $(LIB)
-
-$(LIB):$(OBJS)
-   $(call cmd_link_o_target, $(OBJS))
-
-#
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#
diff --git a/arch/arm/cpu/arm925t/config.mk b/arch/arm/cpu/arm925t/config.mk
deleted file mode 100644
index 58fd756..000
--- a/arch/arm/cpu/arm925t/config.mk
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, 
-#
-# SPDX-License-Identifier: GPL-2.0+
-#
-
-PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
-
-PLATFORM_CPPFLAGS += -march=armv4
-# =
-#
-# Supply options according to compiler version
-#
-# =
-PF_RELFLAGS_SLB_AT := $(call cc-option,-mshort-load-bytes,$(call 
cc-option,-malignment-traps,))
-PLATFORM_RELFLAGS += $(PF_RELFLAGS_SLB_AT)
diff --git a/arch/arm/cpu/arm925t/cpu.c b/arch/arm/cpu/arm925t/cpu.c
deleted file mode 100644
index d0f8e1e..000
--- a/arch/arm/cpu/arm925t/cpu.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * (C) Copyright 200

Re: [U-Boot] [PATCH 1/3] spi: Add zynq qspi controller driver

2013-08-11 Thread thomas.langer
Hi Jagan,

> +
> +/* Definitions of the flash commands - Flash insts in ascending order */
> +#define ZYNQ_QSPI_FLASH_INST_WRSR0x01/* Write status register */
> +#define ZYNQ_QSPI_FLASH_INST_PP  0x02/* Page program */
> +#define ZYNQ_QSPI_FLASH_INST_WRDS0x04/* Write disable */
> +#define ZYNQ_QSPI_FLASH_INST_RDSR1   0x05/* Read status register 1 */
> +#define ZYNQ_QSPI_FLASH_INST_WREN0x06/* Write enable */
> +#define ZYNQ_QSPI_FLASH_INST_AFR 0x0B/* Fast read data bytes */
> +#define ZYNQ_QSPI_FLASH_INST_BE_4K   0x20/* Erase 4KiB block */
> +#define ZYNQ_QSPI_FLASH_INST_RDSR2   0x35/* Read status register 2 */
> +#define ZYNQ_QSPI_FLASH_INST_BE_32K  0x52/* Erase 32KiB block */
> +#define ZYNQ_QSPI_FLASH_INST_RDID0x9F/* Read JEDEC ID */
> +#define ZYNQ_QSPI_FLASH_INST_SE  0xD8/* Sector erase 
> (usually 64KB)*/

As I have written some time ago, I think it is a bad idea to parse the
flash commands in the spi driver!
The flash driver, who wants to write these commands and should know the details,
which parts of the message needs to be send as dual/quad transfer, should 
provide this information to the spi driver (probably as flags for spi_xfer())

A first idea for the flags:
- the X refers to different numbers, as required by the flash (depending on the
addressing mode (3/4 byte) or if the address is already sent as DUAL/QUAD)
SPI_XFER_X_DUAL
SPI_XFER_X_QUAD

So having 0-5 for X should be enough to support all flashes
-> 0 if the command is already in DUAL/QUAD mode
-> 5 for command + 4byte address
(I am not sure about dummy bytes on read)

So for example: 
switch to dual transfer after first byte: SPI_XFER_1_DUAL
switch to QUAD transfer after 4 bytes (e.g. 3byte address): SPI_XFER_4_QUAD

Then only the flash driver needs to know these requirements, depending on 
manufacturer and chip type, and the spi driver just "reacts" on the flags.
Otherwise this driver has to be extended each time a new command is added to 
the flash driver (as you did in some later patches!)

Best regards,
Thomas

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


Re: [U-Boot] [PATCH v2] Add NanoBone board support

2013-08-11 Thread Mark Jackson
On 22/04/13 13:46, Mark Jackson wrote:
> NanoBone Specification:
> ---
> CPU:
>   TI AM335x
> 
> Memory:
>   256MB DDR3
>   64MB NOR flash
>   256MB NAND flash
>   128KB FRAM
> 
> Ethernet:
>   2 x 10/100 connected to SMSC LAN8710 PHY
> 
> USB:
>   1 x USB2.0 Type A
> 
> I2C:
>   2Kbit EEPROM (Microchip 24AA02)
>   RTC (Maxim DS1338)
>   GPIO Expander (Microchip MCP23017)
> 
> Expansion connector:
>   6 x UART
>   1 x MMC/SD
>   1 x USB2.0
> 
> Signed-off-by: Mark Jackson 
> ---
> Changes in v2:
> - Tweaked after comments from Tom Rini
> 
>  MAINTAINERS |4 +
>  board/newflow/nanobone/Makefile |   46 ++
>  board/newflow/nanobone/board.c  |  304
> +++
>  board/newflow/nanobone/board.h  |   24 
>  board/newflow/nanobone/mux.c|  203 ++
>  boards.cfg  |1 +
>  include/configs/nanobone.h  |  285 
>  7 files changed, 867 insertions(+)
>  create mode 100644 board/newflow/nanobone/Makefile
>  create mode 100644 board/newflow/nanobone/board.c
>  create mode 100644 board/newflow/nanobone/board.h
>  create mode 100644 board/newflow/nanobone/mux.c
>  create mode 100644 include/configs/nanobone.h

Any chance this board can be added ?

Regards
Mark J.

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