Re: [U-Boot] [PATCH] mx28: Show CPU frequency

2012-01-24 Thread Stefano Babic
On 23/01/2012 03:38, Fabio Estevam wrote:
 Showing CPU frequency during boot is useful information.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
  arch/arm/cpu/arm926ejs/mx28/mx28.c |3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/cpu/arm926ejs/mx28/mx28.c 
 b/arch/arm/cpu/arm926ejs/mx28/mx28.c
 index da90360..683777f 100644
 --- a/arch/arm/cpu/arm926ejs/mx28/mx28.c
 +++ b/arch/arm/cpu/arm926ejs/mx28/mx28.c
 @@ -169,7 +169,8 @@ int arch_cpu_init(void)
  #if defined(CONFIG_DISPLAY_CPUINFO)
  int print_cpuinfo(void)
  {
 - printf(Freescale i.MX28 family\n);
 + printf(Freescale i.MX28 family at %d MHz\n,
 + mxc_get_clock(MXC_ARM_CLK) / 100);
   return 0;
  }
  #endif

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mx28: fix i.MX28 spi driver

2012-01-24 Thread Stefano Babic
On 14/01/2012 13:25, Matthias Fuchs wrote:
 The generic spi flash driver (drivers/mtd/spi/spi_flash.c) uses the
 spi low level driver's spi_xfer() function with len=0 to deassert the
 SPI flash' chip select. But the i.MX28 spi driver rejects this call
 due to len=0.
 
 This patch implements an exception for len=0 with the SPI_XFER_END
 flag set. This results in an extra read with the chip select being
 deasserted afterwards. There seems to be no way to deassert the signal
 by hand.
 
 Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu
 ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

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


[U-Boot] u-boot script test

2012-01-24 Thread Sridhar Addagada
What is the behavior of test command when the variable is not present in the 
uboot env

set x
if test $x = 1; then echo Yes; else echo No; fi

in the above case I get Yes echoed back.

Is there any way to test the presence of a variable in uboot script?

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


[U-Boot] [PATCH v4] tools/env: add posibility to inject configuration

2012-01-24 Thread Andreas Bießmann
From: Andreas Bießmann biessm...@corscience.de

If one want to use fw_printenv/fw_setenv in special variants (eg compiled in
MTD parameters without configuration file) he need to change the sources.
This patch add the posibillity to change the behaviour of fw_printenv by
defining a specific configuration header at compile time.
Therefore no need to patch the sources for special environment which fits
better into automated build environments.

Signed-off-by: Andreas Bießmann biessm...@corscience.de
---
total: 0 errors, 0 warnings, 164 lines checked

NOTE: Ignored message types: COMPLEX_MACRO CONSIDER_KSTRTO MINMAX 
MULTISTATEMENT_MACRO_USE_DO_WHILE

0001-tools-env-add-posibility-to-inject-configuration.patch has no obvious 
style problems and is ready for submission.

changes since v1:
 - use ?= style in Makefile as suggested by Mike
 - remove c++ style comments in header

changes since v2:
 - place copied/generated fw_env_config.h in include/generated
 - adopt tools/env/Makefile to new placement of fw_env_config.h

changes since v3:
 - add (C) header
 - generate empty config.h for unconfigured U-Boot tree
 - rebase

 tools/env/Makefile   |   29 +++---
 tools/env/fw_env.h   |   32 +++-
 tools/env/fw_env_config.h.in |   66 ++
 3 files changed, 95 insertions(+), 32 deletions(-)
 create mode 100644 tools/env/fw_env_config.h.in

diff --git a/tools/env/Makefile b/tools/env/Makefile
index 28b73da..4a0b2b0 100644
--- a/tools/env/Makefile
+++ b/tools/env/Makefile
@@ -2,6 +2,9 @@
 # (C) Copyright 2002-2006
 # Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 #
+# (C) Copyright 2012
+# Andreas Bießmann, Corscience GmbHCo.KG, biessm...@corscience.de
+#
 # See file CREDITS for list of people who contributed to this
 # project.
 #
@@ -24,26 +27,42 @@
 include $(TOPDIR)/config.mk
 
 HOSTSRCS := $(SRCTREE)/lib/crc32.c  fw_env.c  fw_env_main.c
-HEADERS:= fw_env.h
+HEADERS  := fw_env.h $(OBJTREE)/include/generated/fw_env_config.h
+FW_ENV_CONFIG ?= fw_env_config.h.in
 
 # Compile for a hosted environment on the target
 HOSTCPPFLAGS  = -idirafter $(SRCTREE)/include \
-   -idirafter $(OBJTREE)/include2 \
-idirafter $(OBJTREE)/include \
+   -idirafter $(OBJTREE)/include/generated \
-DUSE_HOSTCC
 
 ifeq ($(MTD_VERSION),old)
 HOSTCPPFLAGS += -DMTD_OLD
 endif
 
-all:   $(obj)fw_printenv
+all: $(obj)fw_printenv
 
 # Some files complain if compiled with -pedantic, use HOSTCFLAGS_NOPED
-$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
+$(obj)fw_printenv: $(HOSTSRCS) $(HEADERS)
$(HOSTCC) $(HOSTCFLAGS_NOPED) $(HOSTLDFLAGS) -o $@ $(HOSTSRCS)
 
+$(OBJTREE)/include/generated/fw_env_config.h: $(FW_ENV_CONFIG)
+   @cp -f $ $@
+
+# add additional dependency for .depend
+$(obj).depend: $(OBJTREE)/include/generated/fw_env_config.h
+
+ifneq ($(OBJTREE)/include/config.mk,$(wildcard $(OBJTREE)/include/config.mk))
+# our U-Boot tree is not configured, generate fake config.h
+$(OBJTREE)/include/config.h:
+   @cat /dev/null  $@
+
+# add additional dependency for .depend
+$(obj).depend: $(OBJTREE)/include/config.h
+endif
+
 clean:
-   rm -f $(obj)fw_printenv
+   rm -f $(obj)fw_printenv $(obj)fw_env_config.h
 
 #
 
diff --git a/tools/env/fw_env.h b/tools/env/fw_env.h
index 2dcb373..c237154 100644
--- a/tools/env/fw_env.h
+++ b/tools/env/fw_env.h
@@ -20,34 +20,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+#ifndef _FW_ENV_H_
+#define _FW_ENV_H_
 
-/*
- * To build the utility with the run-time configuration
- * uncomment the next line.
- * See included fw_env.config sample file
- * for notes on configuration.
- */
-#define CONFIG_FILE /etc/fw_env.config
-
-#define HAVE_REDUND /* For systems with 2 env sectors */
-#define DEVICE1_NAME  /dev/mtd1
-#define DEVICE2_NAME  /dev/mtd2
-#define DEVICE1_OFFSET0x
-#define ENV1_SIZE 0x4000
-#define DEVICE1_ESIZE 0x4000
-#define DEVICE1_ENVSECTORS 2
-#define DEVICE2_OFFSET0x
-#define ENV2_SIZE 0x4000
-#define DEVICE2_ESIZE 0x4000
-#define DEVICE2_ENVSECTORS 2
-
-#define CONFIG_BAUDRATE115200
-#define CONFIG_BOOTDELAY   5   /* autoboot after 5 seconds */
-#define CONFIG_BOOTCOMMAND 
\
-   bootp;
\
-   setenv bootargs root=/dev/nfs nfsroot=${serverip}:${rootpath} 
\
-   ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off;
\
-   bootm
+#include fw_env_config.h
 
 extern int   fw_printenv(int argc, char *argv[]);
 extern char *fw_getenv  (char *name);
@@ -58,3 +34,5 @@ extern int fw_env_write(char *name, char *value);
 extern int fw_env_close(void);
 
 extern unsignedlong  crc32 

Re: [U-Boot] [PATCH] nand_util: correct YAFFS image write function

2012-01-24 Thread Lei Wen
On Sat, Jan 21, 2012 at 4:46 AM, Scott Wood scottw...@freescale.com wrote:
 On 01/20/2012 12:17 AM, Kassey Lee wrote:
 hi, Lei, Scott:
      I think this is correct,
      do you have some comments ?

 Looks right.

 -Scott


Also looks fine to me.
Acked-by: Lei Wen lei...@marvell.com

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


Re: [U-Boot] [PATCH] ARM: tegra: Define Tegra20 CAR binding

2012-01-24 Thread Peter De Schrijver
What about the peripheral resets which are also handled by CAR? Peripheral
clock nodes also offer assert and deassert methods for the reset signal
associated with them. Those methods are used when powergating domains for
example. Should we model this in the same binding?

Thanks,

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


Re: [U-Boot] u-boot script test

2012-01-24 Thread Wolfgang Denk
Dear Sridhar Addagada,

In message 1327396047.99588.yahoomail...@web120201.mail.ne1.yahoo.com you 
wrote:

 What is the behavior of test command when the variable is not present in the 
 uboot env

It should be the same as in any other bourne compatible shell.

 set x

Note that set for setenv may or may not work, depending on your
command selection.

 if test $x = 1; then echo Yes; else echo No; fi

This should provoke an error from the test command which misses an
argument.

 in the above case I get Yes echoed back.

That's a bug then.  Patches welcome...

 Is there any way to test the presence of a variable in uboot script?

This should be possible like in any other shell...



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
Alan Turing thought about criteria to settle the question of  whether
machines  can think, a question of which we now know that it is about
as relevant as the question of whether submarines can swim.
   -- Edsger Dijkstra
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] u-boot script test

2012-01-24 Thread Sridhar Addagada
For now i got around this problem with a negative test
set x

if test $x != 1 then echo No; else echo Yes; fi

with this if x is not present i get No, even in the case when x is present and 
set any other value (not 1)
when i do set x 1 and run the test again i get Yes

Thanks
Sridhar




 From: Wolfgang Denk w...@denx.de
To: Sridhar Addagada sridha...@yahoo.com 
Cc: u-boot@lists.denx.de u-boot@lists.denx.de 
Sent: Tuesday, January 24, 2012 4:13 PM
Subject: Re: [U-Boot] u-boot script test
 
Dear Sridhar Addagada,

In message 1327396047.99588.yahoomail...@web120201.mail.ne1.yahoo.com you 
wrote:

 What is the behavior of test command when the variable is not present in the 
 uboot env

It should be the same as in any other bourne compatible shell.

 set x

Note that set for setenv may or may not work, depending on your
command selection.

 if test $x = 1; then echo Yes; else echo No; fi

This should provoke an error from the test command which misses an
argument.

 in the above case I get Yes echoed back.

That's a bug then.  Patches welcome...

 Is there any way to test the presence of a variable in uboot script?

This should be possible like in any other shell...



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
Alan Turing thought about criteria to settle the question of  whether
machines  can think, a question of which we now know that it is about
as relevant as the question of whether submarines can swim.
                                                   -- Edsger Dijkstra___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] USBTTY for CONFIG_USB_GADGET

2012-01-24 Thread Stefano Babic
On 20/01/2012 23:20, Michael Schwartz wrote:
 Hi,
 
 
Hi Michael,

 
 Can new UDCs be written for CONFIG_USB_DEVICE or is that deprecated in
 favour of CONFIG_USB_GADGET?

I have not read any clear statement about this, but IMHO we should
consider CONFIG_USB_DEVICE obsolete and move to CONFIG_USB_GADGET.

  If that is the case and CONFIG_USB_DEVICE is
 deprecated, if I want to get USBTTY enabled for a currently unsupported UDC
 I would need to port USBTTY to CONFIG_USB_GADGET;

Yes, that is right - there is currently no support for the serial gadget.

 is there interest in that
 effort or is there some alternative?

This is very interesting !

There is a lot of boards using  CONFIG_USB_DEVICE. We cannot drop then
CONFIG_USB_DEVICE, but new boards must use the new interface.

Best regards,
Stefano Babic

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


[U-Boot] [PATCH] SMDK5250: Add ethernet support

2012-01-24 Thread Chander Kashyap
This patch enable support for SMC911X based ethernet device.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
 board/samsung/smdk5250/smdk5250.c |   89 +
 include/configs/smdk5250.h|   13 +-
 2 files changed, 100 insertions(+), 2 deletions(-)

diff --git a/board/samsung/smdk5250/smdk5250.c 
b/board/samsung/smdk5250/smdk5250.c
index 2684620..a1b1a48 100644
--- a/board/samsung/smdk5250/smdk5250.c
+++ b/board/samsung/smdk5250/smdk5250.c
@@ -31,10 +31,95 @@
 DECLARE_GLOBAL_DATA_PTR;
 struct exynos5_gpio_part1 *gpio1;
 
+static void smc9115_pre_init(void)
+{
+   u32 smc_bw_conf, smc_bc_conf;
+   int i;
+
+   /*
+* SROM:CS1 and EBI
+*
+* GPY0[0]  SROM_CSn[0]
+* GPY0[1]  SROM_CSn[1](2)
+* GPY0[2]  SROM_CSn[2]
+* GPY0[3]  SROM_CSn[3]
+* GPY0[4]  EBI_OEn(2)
+* GPY0[5]  EBI_EEn(2)
+*
+* GPY1[0]  EBI_BEn[0](2)
+* GPY1[1]  EBI_BEn[1](2)
+* GPY1[2]  SROM_WAIT(2)
+* GPY1[3]  EBI_DATA_RDn(2)
+*/
+   s5p_gpio_cfg_pin(gpio1-y0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
+   s5p_gpio_cfg_pin(gpio1-y0, 4, GPIO_FUNC(2));
+   s5p_gpio_cfg_pin(gpio1-y0, 5, GPIO_FUNC(2));
+
+   for (i = 0; i  4; i++)
+   s5p_gpio_cfg_pin(gpio1-y1, i, GPIO_FUNC(2));
+
+   /*
+* EBI: 8 Addrss Lines
+*
+* GPY3[0]  EBI_ADDR[0](2)
+* GPY3[1]  EBI_ADDR[1](2)
+* GPY3[2]  EBI_ADDR[2](2)
+* GPY3[3]  EBI_ADDR[3](2)
+* GPY3[4]  EBI_ADDR[4](2)
+* GPY3[5]  EBI_ADDR{5](2)
+* GPY3[6]  EBI_ADDR[6](2)
+* GPY3[7]  EBI_ADDR{7](2)
+*
+* EBI: 16 Data Lines
+*
+* GPY5[0]  EBI_DATA[0](2)
+* GPY5[1]  EBI_DATA[1](2)
+* GPY5[2]  EBI_DATA[2](2)
+* GPY5[3]  EBI_DATA[3](2)
+* GPY5[4]  EBI_DATA[4](2)
+* GPY5[5]  EBI_DATA{5](2)
+* GPY5[6]  EBI_DATA[6](2)
+* GPY5[7]  EBI_DATA{7](2)
+*
+* GPY6[0]  EBI_DATA[8](2)
+* GPY6[1]  EBI_DATA[9](2)
+* GPY6[2]  EBI_DATA[10](2)
+* GPY6[3]  EBI_DATA110](2)
+* GPY6[4]  EBI_DATA[12](2)
+* GPY6[5]  EBI_DATA{13](2)
+* GPY6[6]  EBI_DATA[14](2)
+* GPY6[7]  EBI_DATA{15](2)
+*/
+   for (i = 0; i  8; i++) {
+   s5p_gpio_cfg_pin(gpio1-y3, i, GPIO_FUNC(2));
+   s5p_gpio_set_pull(gpio1-y3, i, GPIO_PULL_UP);
+
+   s5p_gpio_cfg_pin(gpio1-y5, i, GPIO_FUNC(2));
+   s5p_gpio_set_pull(gpio1-y5, i, GPIO_PULL_UP);
+
+   s5p_gpio_cfg_pin(gpio1-y6, i, GPIO_FUNC(2));
+   s5p_gpio_set_pull(gpio1-y6, i, GPIO_PULL_UP);
+   }
+
+   /* Ethernet needs data bus width of 16 bits */
+   smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
+   | SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);
+
+   smc_bc_conf = SROMC_BC_TACS(0x01) | SROMC_BC_TCOS(0x01)
+   | SROMC_BC_TACC(0x06) | SROMC_BC_TCOH(0x01)
+   | SROMC_BC_TAH(0x0C)  | SROMC_BC_TACP(0x09)
+   | SROMC_BC_PMC(0x01);
+
+   /* Select and configure the SROMC bank */
+   s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
+}
+
 int board_init(void)
 {
gpio1 = (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 
+   smc9115_pre_init();
+
gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
return 0;
 }
@@ -79,6 +164,10 @@ void dram_init_banksize(void)
gd-bd-bi_dram[7].size = get_ram_size((long *)PHYS_SDRAM_8, \
PHYS_SDRAM_8_SIZE);
 }
+int board_eth_init(bd_t *bis)
+{
+   return smc911x_initialize(0, CONFIG_SMC911X_BASE);
+}
 
 #ifdef CONFIG_DISPLAY_BOARDINFO
 int checkboard(void)
diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
index 6f2ef4c..4ad4bd2 100644
--- a/include/configs/smdk5250.h
+++ b/include/configs/smdk5250.h
@@ -98,8 +98,7 @@
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_EXT2
 #define CONFIG_CMD_FAT
-#undef CONFIG_CMD_NET
-#undef CONFIG_CMD_NFS
+#define CONFIG_CMD_NET
 
 #define CONFIG_BOOTDELAY   3
 #define CONFIG_ZERO_BOOTDELAY_CHECK
@@ -196,6 +195,16 @@
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 0x100)
 #define MMC_MAX_CHANNEL5
 
+/* Ethernet Controllor Driver */
+#ifdef CONFIG_CMD_NET
+#define CONFIG_NET_MULTI
+#define CONFIG_SMC911X
+#define CONFIG_SMC911X_BASE0x500
+#define CONFIG_SMC911X_16_BIT
+#define CONFIG_ENV_SROM_BANK   1
+#define CONFIG_ETHADDR 00:40:5c:26:0a:5b
+#endif /*CONFIG_CMD_NET*/
+
 /* Enable devicetree support */
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.5.4

___

Re: [U-Boot] [PATCH V2 3/6] mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform

2012-01-24 Thread Stefano Babic
On 23/01/2012 17:46, Eric Nelson wrote:
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com 
 ---

Acked-by: Stefano Babic sba...@denx.de

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V2 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS

2012-01-24 Thread Stefano Babic
On 23/01/2012 17:46, Eric Nelson wrote:
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com 
 ---

Acked-by: Stefano Babic sba...@denx.de

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V2 5/6] mx6q: mx6qsabrelite: Provide default chip-select for serial flash

2012-01-24 Thread Stefano Babic
On 23/01/2012 17:46, Eric Nelson wrote:
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com 
 ---
  include/configs/mx6qsabrelite.h |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 

Acked-by: Stefano Babic sba...@denx.de

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH V2 1/6] mxc_spi: move machine specifics into CPU headers

2012-01-24 Thread Stefano Babic
On 23/01/2012 17:46, Eric Nelson wrote:
 Move (E)CSPI register declarations into the imx-regs.h files for each 
 supported CPU
 
 Introduce two new macros to control conditional setup
  MXC_CSPI - Used for processors with the Configurable Serial Peripheral 
 Interface (MX3x)
  MXC_ECSPI - For processors with Enhanced Configurable... (MX5x, MX6x)
 
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com 

Acked-by: Stefano Babic sba...@denx.de

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH V2 2/6] mx6q: Add support for ECSPI through mxc_spi driver

2012-01-24 Thread Stefano Babic
On 23/01/2012 17:46, Eric Nelson wrote:
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com 
 ---
  arch/arm/include/asm/arch-mx6/imx-regs.h |   44 
 ++
  1 files changed, 44 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
 b/arch/arm/include/asm/arch-mx6/imx-regs.h
 index 7650cb9..00040c4 100644
 --- a/arch/arm/include/asm/arch-mx6/imx-regs.h

Acked-by: Stefano Babic sba...@denx.de

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH/RFC] mx28: print bootmode with cpuinfo

2012-01-24 Thread Matthias Fuchs
On 23.01.2012 21:33, Fabio Estevam wrote:
 Hi Matthias,
 
 On 1/18/12, Matthias Fuchs matthias.fu...@esd.eu wrote:
 Hi,

 while playing around with the mx28evk and differnet bootmedia
 I found it helpful to see the current bootmode without
 running to the board and checking it's switches. Also
 some other CPU (e.g. 440 PowerPCs) print some kind of bootstrap
 configuration during startup.

 The patch probably needs some little cleanup. But the main issue might
 be the way how it passes the information from SPL to 2nd stage.
 I am note sure if those scratch registers are somehow holy :-)
 
 I tested your patch and it worked fine.
 
 What I really liked about it is that it fixed a real issue that I was seeing:
 after booting the kernel and issuing a rebootcommand, kernel did
 shutdown, reset the system, but then U-boot got stuck showing DRAM: 0
 bytes.
Hmm ...
 
 So maybe you could split this patch in two parts:
 
 - One patch that touches the HW_DIGCTRL_SCRATCH register (this part is
 what fixed the RAM size retrievel after a reboot in the kernel
And what is this part? I was not aware of this issue. What exactly part
of my patch fixes this issue?

And finally I am not sure if we should use the scratch registers for
passing the boot mode at all.

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


[U-Boot] [PATCH 00/14] Nokia RX-51 support

2012-01-24 Thread Pali Rohár
This patch series add support for new board Nokia RX-51 (aka N900).
Last two patches adding on screen bootmenu support.

This series supersedes the last sent version.

Pali Rohár (14):
  arm,omap3: Define save_boot_params in lowlevel_init.S for SPL only
  arm: Optionally use existing atags in bootm.c
  Add power bus message definitions in twl4030.h
  Fix function readline in main.c
  cfb_console: Fix function console_scrollup
  cfb_console: Add function console_clear and console_clear_line
  cfb_console: Add functions for moving with cursor
  cfb_console: Add support for some ANSI terminal escape codes
  New command clear: Clear the ANSI terminal
  New config variable CONFIG_MENUCMD
  New config variable CONFIG_PREMONITOR
  New board support: Nokia RX-51 aka N900
  New command bootmenu: ANSI terminal Boot Menu support
  RX-51: Add support for bootmenu

 README   |2 +
 arch/arm/cpu/armv7/omap3/lowlevel_init.S |4 +-
 arch/arm/lib/bootm.c |   39 +++-
 board/nokia/rx51/Makefile|   46 
 board/nokia/rx51/lowlevel_init.S |   79 ++
 board/nokia/rx51/rx51.c  |  381 ++
 board/nokia/rx51/rx51.h  |  378 +
 boards.cfg   |1 +
 common/Makefile  |2 +
 common/cmd_bootmenu.c|  366 
 common/cmd_clear.c   |   42 
 common/env_common.c  |3 +
 common/main.c|   89 ++-
 drivers/video/cfb_console.c  |  346 +--
 include/common.h |   20 ++
 include/config_cmd_all.h |2 +
 include/configs/nokia_rx51.h |  375 +
 include/twl4030.h|   98 
 18 files changed, 2233 insertions(+), 40 deletions(-)
 create mode 100644 board/nokia/rx51/Makefile
 create mode 100644 board/nokia/rx51/lowlevel_init.S
 create mode 100644 board/nokia/rx51/rx51.c
 create mode 100644 board/nokia/rx51/rx51.h
 create mode 100644 common/cmd_bootmenu.c
 create mode 100644 common/cmd_clear.c
 create mode 100644 include/configs/nokia_rx51.h

-- 
1.7.5.4

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


[U-Boot] [PATCH 01/14] arm, omap3: Define save_boot_params in lowlevel_init.S for SPL only

2012-01-24 Thread Pali Rohár
* Hide function save_boot_params if CONFIG_SPL_BUILD is not defined (function 
do nothing)

* Same behaviour as in file arch/arm/cpu/armv7/omap4/lowlevel_init.S
* This allow to implement board specified function save_boot_params in board 
code

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 arch/arm/cpu/armv7/omap3/lowlevel_init.S |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S 
b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 2f6930b..c42c5dd 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -35,15 +35,15 @@
 _TEXT_BASE:
.word   CONFIG_SYS_TEXT_BASE/* sdram load addr from config.mk */
 
+#ifdef CONFIG_SPL_BUILD
 .global save_boot_params
 save_boot_params:
-#ifdef CONFIG_SPL_BUILD
ldr r4, =omap3_boot_device
ldr r5, [r0, #0x4]
and r5, r5, #0xff
str r5, [r4]
-#endif
bx  lr
+#endif
 
 .global omap3_gp_romcode_call
 omap3_gp_romcode_call:
-- 
1.7.5.4

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


[U-Boot] [PATCH 03/14] Add power bus message definitions in twl4030.h

2012-01-24 Thread Pali Rohár
* Code copied from linux kernel 3.0.0 from file include/linux/i2c/twl.h

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 include/twl4030.h |   98 +
 1 files changed, 98 insertions(+), 0 deletions(-)

diff --git a/include/twl4030.h b/include/twl4030.h
index 9cd32ab..0c17f59 100644
--- a/include/twl4030.h
+++ b/include/twl4030.h
@@ -151,6 +151,103 @@
 #define TWL4030_PM_MASTER_SW_EVENTS_DEVSLP (1  1)
 #define TWL4030_PM_MASTER_SW_EVENTS_DEVOFF (1  0)
 
+/* Power bus message definitions */
+
+/* The TWL4030/5030 splits its power-management resources (the various
+ * regulators, clock and reset lines) into 3 processor groups - P1, P2 and
+ * P3. These groups can then be configured to transition between sleep, wait-on
+ * and active states by sending messages to the power bus.  See Section 5.4.2
+ * Power Resources of TWL4030 TRM
+ */
+
+/* Processor groups */
+#define DEV_GRP_NULL   0x0
+#define DEV_GRP_P1 0x1 /* P1: all OMAP devices */
+#define DEV_GRP_P2 0x2 /* P2: all Modem devices */
+#define DEV_GRP_P3 0x4 /* P3: all peripheral devices */
+
+/* Resource groups */
+#define RES_GRP_RES0x0 /* Reserved */
+#define RES_GRP_PP 0x1 /* Power providers */
+#define RES_GRP_RC 0x2 /* Reset and control */
+#define RES_GRP_PP_RC  0x3
+#define RES_GRP_PR 0x4 /* Power references */
+#define RES_GRP_PP_PR  0x5
+#define RES_GRP_RC_PR  0x6
+#define RES_GRP_ALL0x7 /* All resource groups */
+
+#define RES_TYPE2_R0   0x0
+
+#define RES_TYPE_ALL   0x7
+
+/* Resource states */
+#define RES_STATE_WRST 0xF
+#define RES_STATE_ACTIVE   0xE
+#define RES_STATE_SLEEP0x8
+#define RES_STATE_OFF  0x0
+
+/* Power resources */
+
+/* Power providers */
+#define RES_VAUX1   1
+#define RES_VAUX2   2
+#define RES_VAUX3   3
+#define RES_VAUX4   4
+#define RES_VMMC1   5
+#define RES_VMMC2   6
+#define RES_VPLL1   7
+#define RES_VPLL2   8
+#define RES_VSIM9
+#define RES_VDAC10
+#define RES_VINTANA111
+#define RES_VINTANA212
+#define RES_VINTDIG 13
+#define RES_VIO 14
+#define RES_VDD115
+#define RES_VDD216
+#define RES_VUSB_1V517
+#define RES_VUSB_1V818
+#define RES_VUSB_3V119
+#define RES_VUSBCP  20
+#define RES_REGEN   21
+/* Reset and control */
+#define RES_NRES_PWRON  22
+#define RES_CLKEN   23
+#define RES_SYSEN   24
+#define RES_HFCLKOUT25
+#define RES_32KCLKOUT   26
+#define RES_RESET   27
+/* Power Reference */
+#define RES_Main_Ref28
+
+#define TOTAL_RESOURCES28
+/*
+ * Power Bus Message Format ... these can be sent individually by Linux,
+ * but are usually part of downloaded scripts that are run when various
+ * power events are triggered.
+ *
+ *  Broadcast Message (16 Bits):
+ *DEV_GRP[15:13] MT[12]  RES_GRP[11:9]  RES_TYPE2[8:7] RES_TYPE[6:4]
+ *RES_STATE[3:0]
+ *
+ *  Singular Message (16 Bits):
+ *DEV_GRP[15:13] MT[12]  RES_ID[11:4]  RES_STATE[3:0]
+ */
+
+#define MSG_BROADCAST(devgrp, grp, type, type2, state) \
+   ((devgrp)  13 | 1  12 | (grp)  9 | (type2)  7 \
+   | (type)  4 | (state))
+
+#define MSG_SINGULAR(devgrp, id, state) \
+   ((devgrp)  13 | 0  12 | (id)  4 | (state))
+
+#define MSG_BROADCAST_ALL(devgrp, state) \
+   ((devgrp)  5 | (state))
+
+#define MSG_BROADCAST_REF MSG_BROADCAST_ALL
+#define MSG_BROADCAST_PROV MSG_BROADCAST_ALL
+#define MSG_BROADCAST__CLK_RST MSG_BROADCAST_ALL
+
 /* Power Managment Receiver */
 #define TWL4030_PM_RECEIVER_SC_CONFIG  0x5B
 #define TWL4030_PM_RECEIVER_SC_DETECT1 0x5C
@@ -311,6 +408,7 @@
 #define TWL4030_PM_RECEIVER_VDAC_VSEL_18   0x03
 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_30  0x02
 #define TWL4030_PM_RECEIVER_VMMC1_VSEL_32  0x03
+#define TWL4030_PM_RECEIVER_VSIM_VSEL_18   0x03
 
 /* Device Selection in PM Receiver Module */
 #define TWL4030_PM_RECEIVER_DEV_GRP_P1 0x20
-- 
1.7.5.4

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


[U-Boot] [PATCH 04/14] Fix function readline in main.c

2012-01-24 Thread Pali Rohár
 * Ignore ANSI escape codes for moving cursor, which are generated by keyboard

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 common/main.c |   51 +++
 1 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/common/main.c b/common/main.c
index e96c95a..e7b5516 100644
--- a/common/main.c
+++ b/common/main.c
@@ -958,6 +958,7 @@ int readline_into_buffer (const char *const prompt, char * 
buffer)
int n = 0;  /* buffer index */
int plen = 0;   /* prompt length*/
int col;/* output column cnt*/
+   int esc = 0;/* ansi escape char */
charc;
 
/* print prompt */
@@ -1024,7 +1025,57 @@ int readline_into_buffer (const char *const prompt, char 
* buffer)
p=delete_char(p_buf, p, col, n, plen);
continue;
 
+   case '\e':  /* ANSI escape char */
+   esc = 1;
+   continue;
+
default:
+
+   /*
+* Check for ANSI escape chars
+*/
+   if (esc == 0  c == '\e') {
+   esc = 1;
+   continue;
+   } else if (esc == 1) {
+   if (c == '[') {
+   esc = 2;
+   continue;
+   }
+   if (n  CONFIG_SYS_CBSIZE-2) {
+   ++n;
+   *p++ = '\e';
+   putc('\e');
+   }
+   esc = 0;
+   } else if (esc == 2 || esc == 3) {
+   if (esc == 2  c == '1') {
+   esc = 3;
+   continue;
+   }
+   /* Ignore ANSI escape sequences */
+   /* generated by keyboard */
+   /* \e [ 1 A-D and \e [ A-D */
+   if (c = 'A'  c = 'D') {
+   esc = 0;
+   continue;
+   }
+   if (esc == 2  n  CONFIG_SYS_CBSIZE-3) {
+   n += 2;
+   *p++ = '\e';
+   *p++ = '[';
+   puts(\e[);
+   } else if (esc == 3 
+   n  CONFIG_SYS_CBSIZE-4) {
+   n += 3;
+   *p++ = '\e';
+   *p++ = '[';
+   *p++ = '1';
+   puts(\e[1);
+   }
+   esc = 0;
+   }
+
/*
 * Must be a normal character then
 */
-- 
1.7.5.4

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


[U-Boot] [PATCH 02/14] arm: Optionally use existing atags in bootm.c

2012-01-24 Thread Pali Rohár
This patch adapts the bootm command so that it can use an existing atags command
set up by a previous bootloader. If the environment variable atagaddr is 
unset,
bootm behaves as normal. If atagaddr is set, bootm will use atags address from
environment variable and also append new boot args (if specified in u-boot). For
example, if a previous boot loader already set up the atags struct at 
0x8100:

setenv atagaddr 0x8100; bootm 0x80008000

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Added info to README file
   - Added local define CONFIG_SETUP_ANY_TAG
   - Fixed compile warning
   - Fixed commit message
   - Check if atagaddr is not NULL

 README   |2 ++
 arch/arm/lib/bootm.c |   39 ---
 2 files changed, 34 insertions(+), 7 deletions(-)

diff --git a/README b/README
index 9d713e8..8c3b98a 100644
--- a/README
+++ b/README
@@ -3584,6 +3584,8 @@ Some configuration options can be set using Environment 
Variables.
 
 List of environment variables (most likely not complete):
 
+  atagaddr - bootm will use ATAGs struct from specified address (arm only)
+
   baudrate - see CONFIG_BAUDRATE
 
   bootdelay- see CONFIG_BOOTDELAY
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index afa0093..8366dd5 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -93,6 +93,14 @@ static void announce_and_cleanup(void)
cleanup_before_linux();
 }
 
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+defined(CONFIG_CMDLINE_TAG) || \
+defined(CONFIG_INITRD_TAG) || \
+defined(CONFIG_SERIAL_TAG) || \
+defined(CONFIG_REVISION_TAG)
+#define CONFIG_SETUP_ANY_TAG
+#endif
+
 int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
 {
bd_t*bd = gd-bd;
@@ -125,12 +133,22 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
bootm_headers_t *images)
debug (## Transferring control to Linux (at address %08lx) ...\n,
   (ulong) kernel_entry);
 
-#if defined (CONFIG_SETUP_MEMORY_TAGS) || \
-defined (CONFIG_CMDLINE_TAG) || \
-defined (CONFIG_INITRD_TAG) || \
-defined (CONFIG_SERIAL_TAG) || \
-defined (CONFIG_REVISION_TAG)
-   setup_start_tag (bd);
+   s = getenv(atagaddr);
+   if (s)
+   bd-bi_boot_params = simple_strtoul(s, NULL, 16);
+
+   if (bd-bi_boot_params) {
+   printf(Using existing atags at %#lx\n, bd-bi_boot_params);
+
+   params = (struct tag *) bd-bi_boot_params;
+   while (params-hdr.size  0)
+   params = tag_next(params);
+   } else {
+#ifdef CONFIG_SETUP_ANY_TAG
+   setup_start_tag(bd);
+#endif
+   }
+
 #ifdef CONFIG_SERIAL_TAG
setup_serial_tag (params);
 #endif
@@ -147,8 +165,15 @@ int do_bootm_linux(int flag, int argc, char *argv[], 
bootm_headers_t *images)
if (images-rd_start  images-rd_end)
setup_initrd_tag (bd, images-rd_start, images-rd_end);
 #endif
-   setup_end_tag(bd);
+
+   if (s) {
+   if (params-hdr.size  0)
+   setup_end_tag(bd);
+   } else {
+#ifdef CONFIG_SETUP_ANY_TAG
+   setup_end_tag(bd);
 #endif
+   }
 
announce_and_cleanup();
 
-- 
1.7.5.4

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


[U-Boot] [PATCH 06/14] cfb_console: Add function console_clear and console_clear_line

2012-01-24 Thread Pali Rohár
 * console_clear - clear full console framebuffer output
 * console_clear_line - clear part of specified line (or full)

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |   64 +++
 1 files changed, 52 insertions(+), 12 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 9092399..b74d6d0 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -683,6 +683,57 @@ static void memcpyl(int *d, int *s, int c)
 }
 #endif
 
+static void console_clear(void)
+{
+#ifdef VIDEO_HW_RECTFILL
+   video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
+ 0,/* dest pos x */
+ video_logo_height,/* dest pos y */
+ VIDEO_VISIBLE_COLS,   /* frame width */
+ VIDEO_VISIBLE_ROWS,   /* frame height */
+ bgx   /* fill color */
+   );
+#else
+   memsetl(CONSOLE_ROW_FIRST, CONSOLE_SIZE, bgx);
+#endif
+}
+
+static void console_clear_line(int line, int begin, int end)
+{
+#ifdef VIDEO_HW_RECTFILL
+   video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
+ /* FIXME: correct? */
+ VIDEO_FONT_WIDTH * begin, /* dest pos x */
+ /* FIXME: correct? */
+ video_logo_height +
+ CONSOLE_ROW_SIZE * line,  /* dest pos y */
+ /* FIXME: correct? */
+ VIDEO_FONT_WIDTH * (end - begin), /* frame width */
+ VIDEO_FONT_HEIGHT,/* frame height */
+ bgx   /* fill color */
+   );
+#else
+   int i;
+   if (begin == 0  end == CONSOLE_COLS)
+   memsetl(CONSOLE_ROW_FIRST +
+   CONSOLE_ROW_SIZE * line,/* offset of row */
+   CONSOLE_ROW_SIZE  2,  /* length of row */
+   bgx /* fill color */
+   );
+   else
+   for (i = 0; i  VIDEO_FONT_HEIGHT; ++i)
+   memsetl(CONSOLE_ROW_FIRST +
+   CONSOLE_ROW_SIZE * line + /* offset of row */
+   VIDEO_FONT_WIDTH *
+   VIDEO_PIXEL_SIZE * begin + /* offset of col */
+   i * VIDEO_LINE_LEN, /* col offset of i line */
+   (VIDEO_FONT_WIDTH * VIDEO_PIXEL_SIZE *
+   (end - begin + 1))  2, /* length to end */
+   bgx /* fill color */
+   );
+#endif
+}
+
 static void console_scrollup(void)
 {
/* copy up rows ignoring the first one */
@@ -705,18 +756,7 @@ static void console_scrollup(void)
 #endif
 
/* clear the last one */
-#ifdef VIDEO_HW_RECTFILL
-   video_hw_rectfill(VIDEO_PIXEL_SIZE, /* bytes per pixel */
- 0,/* dest pos x */
- VIDEO_VISIBLE_ROWS
- - VIDEO_FONT_HEIGHT,  /* dest pos y */
- VIDEO_VISIBLE_COLS,   /* frame width */
- VIDEO_FONT_HEIGHT,/* frame height */
- CONSOLE_BG_COL/* fill color */
-   );
-#else
-   memsetl(CONSOLE_ROW_LAST, CONSOLE_ROW_SIZE  2, CONSOLE_BG_COL);
-#endif
+   console_clear_line(CONSOLE_ROWS-1, 0, CONSOLE_COLS);
 }
 
 static void console_back(void)
-- 
1.7.5.4

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


[U-Boot] [PATCH 05/14] cfb_console: Fix function console_scrollup

2012-01-24 Thread Pali Rohár
 * Use correct buffer size, do not damage screen output

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 904caf7..9092399 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -701,7 +701,7 @@ static void console_scrollup(void)
);
 #else
memcpyl(CONSOLE_ROW_FIRST, CONSOLE_ROW_SECOND,
-   CONSOLE_SCROLL_SIZE  2);
+   CONSOLE_SCROLL_SIZE);
 #endif
 
/* clear the last one */
-- 
1.7.5.4

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


[U-Boot] [PATCH 09/14] New command clear: Clear the ANSI terminal

2012-01-24 Thread Pali Rohár
 * Command can be enabled by CONFIG_CMD_CLEAR
 * Added some ANSI escape codes definitions in common.h

Signed-off-by: Pali Rohár pali.ro...@gmail.com
Cc: Marcel Mol mar...@mesa.nl
---
Changes since original version:
   - Renamed command clr to clear
   - Use puts instead printf
   - Move cursor to pos1,1
   - Merged parts of patch Add some ANSI escape codes definitions in common.h

 common/Makefile  |1 +
 common/cmd_clear.c   |   42 ++
 include/common.h |7 +++
 include/config_cmd_all.h |1 +
 4 files changed, 51 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_clear.c

diff --git a/common/Makefile b/common/Makefile
index 2d9ae8c..e1efd45 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -69,6 +69,7 @@ COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-$(CONFIG_CMD_CACHE) += cmd_cache.o
+COBJS-$(CONFIG_CMD_CLEAR) += cmd_clear.o
 COBJS-$(CONFIG_CMD_CONSOLE) += cmd_console.o
 COBJS-$(CONFIG_CMD_CPLBINFO) += cmd_cplbinfo.o
 COBJS-$(CONFIG_DATAFLASH_MMC_SELECT) += cmd_dataflash_mmc_mux.o
diff --git a/common/cmd_clear.c b/common/cmd_clear.c
new file mode 100644
index 000..597611e
--- /dev/null
+++ b/common/cmd_clear.c
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2011
+ * Marcel Mol, MESA Consulting, mar...@mesa.nl
+ *
+ * Copyright 2011
+ * Pali Rohár, pali.ro...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include command.h
+
+static int do_clear(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   puts(ANSI_CLEAR_CONSOLE);
+   printf(ANSI_CURSOR_POSITION, 1, 1);
+   return 0;
+}
+
+U_BOOT_CMD(
+   clear,CONFIG_SYS_MAXARGS, 1,  do_clear,
+   clear,
+   \n
+   - clear screen and move cursor to top of screen
+);
diff --git a/include/common.h b/include/common.h
index 3df1def..9c0449e 100644
--- a/include/common.h
+++ b/include/common.h
@@ -751,6 +751,13 @@ void   clear_ctrlc (void); /* clear the Control-C 
condition */
 intdisable_ctrlc (int);/* 1 to disable, 0 to enable Control-C detect */
 
 /*
+ * ANSI terminal
+ */
+
+#define ANSI_CURSOR_POSITION   \e[%d;%dH
+#define ANSI_CLEAR_CONSOLE \e[2J
+
+/*
  * STDIO based functions (can always be used)
  */
 /* serial stuff */
diff --git a/include/config_cmd_all.h b/include/config_cmd_all.h
index 9716f9c..3f25eba 100644
--- a/include/config_cmd_all.h
+++ b/include/config_cmd_all.h
@@ -23,6 +23,7 @@
 #define CONFIG_CMD_BSP /* Board Specific functions */
 #define CONFIG_CMD_CACHE   /* icache, dcache   */
 #define CONFIG_CMD_CDP /* Cisco Discovery Protocol */
+#define CONFIG_CMD_CLEAR   /* ANSI clear screen command*/
 #define CONFIG_CMD_CONSOLE /* coninfo  */
 #define CONFIG_CMD_DATE/* support for RTC, date/time...*/
 #define CONFIG_CMD_DHCP/* DHCP Support */
-- 
1.7.5.4

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


[U-Boot] [PATCH 08/14] cfb_console: Add support for some ANSI terminal escape codes

2012-01-24 Thread Pali Rohár
 * This patch add support for move cursor and reverse colors
   via ANSI espace codes in cfb_console driver
 * ANSI escape codes can be enabled/disabled via CONFIG_CFB_CONSOLE_ANSI

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |  216 ++-
 1 files changed, 215 insertions(+), 1 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index 3823eae..dc8d99b 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -377,6 +377,10 @@ static int console_row;/* cursor row */
 
 static u32 eorx, fgx, bgx; /* color pats */
 
+static char ansi_buf[10] = { 0, };
+static int ansi_buf_size;
+static int ansi_colors_need_revert;
+
 static const int video_font_draw_table8[] = {
0x, 0x00ff, 0xff00, 0x,
0x00ff, 0x00ff00ff, 0x0000, 0x00ff,
@@ -602,6 +606,14 @@ static void video_putchar(int xx, int yy, unsigned char c)
video_drawchars(xx, yy + video_logo_height, c, 1);
 }
 
+static void console_swap_colors(void)
+{
+   eorx = fgx;
+   fgx = bgx;
+   bgx = eorx;
+   eorx = fgx ^ bgx;
+}
+
 #if defined(CONFIG_CONSOLE_CURSOR) || defined(CONFIG_VIDEO_SW_CURSOR)
 static void video_set_cursor(void)
 {
@@ -845,7 +857,7 @@ static void console_cr(void)
console_col = 0;
 }
 
-void video_putc(const char c)
+static void parse_putc(const char c)
 {
static int nl = 1;
 
@@ -888,6 +900,208 @@ void video_putc(const char c)
CURSOR_SET;
 }
 
+void video_putc(const char c)
+{
+#ifdef CONFIG_CFB_CONSOLE_ANSI
+   int i;
+
+   if (c == 27) {
+   for (i = 0; i  ansi_buf_size; ++i)
+   parse_putc(ansi_buf[i]);
+   ansi_buf[0] = 27;
+   ansi_buf_size = 1;
+   return;
+   }
+
+   if (ansi_buf_size  0) {
+   /*
+   0 - ESC
+   1 - [
+   2 - num1
+   3 - ..
+   4 - ;
+   5 - num2
+   6 - ..
+   7 - cchar
+   */
+   int next = 0;
+
+   int flush = 0;
+   int fail = 0;
+
+   int num1 = 0;
+   int num2 = 0;
+   int cchar = 0;
+
+   ansi_buf[ansi_buf_size++] = c;
+
+   if (ansi_buf_size = sizeof(ansi_buf))
+   fail = 1;
+
+   for (i = 0; i  ansi_buf_size; ++i) {
+   if (fail)
+   break;
+
+   switch (next) {
+   case 0:
+   if (ansi_buf[i] == 27)
+   next = 1;
+   else
+   fail = 1;
+   break;
+
+   case 1:
+   if (ansi_buf[i] == '[')
+   next = 2;
+   else
+   fail = 1;
+   break;
+
+   case 2:
+   if (ansi_buf[i] = '0'  ansi_buf[i] = '9') {
+   num1 = ansi_buf[i]-'0';
+   next = 3;
+   } else {
+   --i;
+   num1 = 1;
+   next = 4;
+   }
+   break;
+
+   case 3:
+   if (ansi_buf[i] = '0'  ansi_buf[i] = '9') {
+   num1 *= 10;
+   num1 += ansi_buf[i]-'0';
+   } else {
+   --i;
+   next = 4;
+   }
+   break;
+
+   case 4:
+   if (ansi_buf[i] != ';') {
+   --i;
+   next = 7;
+   } else
+   next = 5;
+   break;
+
+   case 5:
+   if (ansi_buf[i] = '0'  ansi_buf[i] = '9') {
+   num2 = ansi_buf[i]-'0';
+   next = 6;
+   } else
+   fail = 1;
+   break;
+
+   case 6:
+   if (ansi_buf[i] = '0'  ansi_buf[i] = '9') {
+   num2 *= 10;
+   

[U-Boot] [PATCH 11/14] New config variable CONFIG_PREMONITOR

2012-01-24 Thread Pali Rohár
 * if defined run env premonitor before Main Loop for Monitor Processing

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - removed #ifdef CONFIG_PREMONITOR in main.c

 common/env_common.c |3 +++
 common/main.c   |4 
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/common/env_common.c b/common/env_common.c
index 71811c4..1c2360d 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -92,6 +92,9 @@ const uchar default_environment[] = {
 #ifdef CONFIG_PREBOOT
preboot=  CONFIG_PREBOOT  \0
 #endif
+#ifdef CONFIG_PREMONITOR
+   premonitor=   CONFIG_PREMONITOR   \0
+#endif
 #ifdef CONFIG_ROOTPATH
rootpath= CONFIG_ROOTPATH \0
 #endif
diff --git a/common/main.c b/common/main.c
index 503d6c4..e0c262c 100644
--- a/common/main.c
+++ b/common/main.c
@@ -427,6 +427,10 @@ void main_loop (void)
}
 #endif
 
+   s = getenv(premonitor);
+   if (s)
+   run_command2(s, 0);
+
/*
 * Main Loop for Monitor Command Processing
 */
-- 
1.7.5.4

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


[U-Boot] [PATCH 10/14] New config variable CONFIG_MENUCMD

2012-01-24 Thread Pali Rohár
 * If not defined CONFIG_MENUCMD do nothing

 * If CONFIG_MENUKEY is 0 and was pressed any key run env menu_cmd
 * If pressed key was CONFIG_MENUKEY run env menu_cmd
 * If CONFIG_MENUKEY is not defined run env menu_cmd always

 * CONFIG_MENUKEY working if defined CONFIG_MENUCMD and CONFIG_BOOTDELAY = 0

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 common/main.c |   34 +++---
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/common/main.c b/common/main.c
index e7b5516..503d6c4 100644
--- a/common/main.c
+++ b/common/main.c
@@ -82,6 +82,20 @@ int do_mdm_init = 0;
 extern void mdm_init(void); /* defined in board.c */
 #endif
 
+#if defined(CONFIG_MENUKEY)  !defined(CONFIG_MENUCMD)  \
+(!defined(CONFIG_BOOTDELAY) || CONFIG_BOOTDELAY  0)
+#error CONFIG_MENUKEY defined, but not CONFIG_MENUCMD or CONFIG_BOOTDELAY = 0
+#error define CONFIG_MENUCMD and CONFIG_BOOTDELAY too
+#endif
+
+#ifdef CONFIG_MENUCMD
+# ifdef CONFIG_MENUKEY
+static int menucmd;
+# else
+static int menucmd = 1;
+# endif
+#endif
+
 /***
  * Watch for 'delay' seconds for autoboot stop or autoboot delay string.
  * returns: 0 -  no key string, allow autoboot 1 - got key string, abort
@@ -201,10 +215,6 @@ int abortboot(int bootdelay)
 
 # else /* !defined(CONFIG_AUTOBOOT_KEYED) */
 
-#ifdef CONFIG_MENUKEY
-static int menukey = 0;
-#endif
-
 #ifndef CONFIG_MENU
 static inline
 #endif
@@ -241,8 +251,10 @@ int abortboot(int bootdelay)
if (tstc()) {   /* we got a key press   */
abort  = 1; /* don't auto boot  */
bootdelay = 0;  /* no more delay*/
-# ifdef CONFIG_MENUKEY
-   menukey = getc();
+# if defined(CONFIG_MENUCMD)  defined(CONFIG_MENUKEY)
+   if (CONFIG_MENUKEY == 0 ||
+   CONFIG_MENUKEY == getc())
+   menucmd = 1;
 # else
(void) getc();  /* consume input*/
 # endif
@@ -292,6 +304,7 @@ int run_command2(const char *cmd, int flag)
 
 void main_loop (void)
 {
+   char *s;
 #ifndef CONFIG_SYS_HUSH_PARSER
static char lastcommand[CONFIG_SYS_CBSIZE] = { 0, };
int len;
@@ -300,7 +313,6 @@ void main_loop (void)
 #endif
 
 #if defined(CONFIG_BOOTDELAY)  (CONFIG_BOOTDELAY = 0)
-   char *s;
int bootdelay;
 #endif
 #ifdef CONFIG_PREBOOT
@@ -405,15 +417,15 @@ void main_loop (void)
disable_ctrlc(prev);/* restore Control C checking */
 # endif
}
+#endif /* CONFIG_BOOTDELAY */
 
-# ifdef CONFIG_MENUKEY
-   if (menukey == CONFIG_MENUKEY) {
+#ifdef CONFIG_MENUCMD
+   if (menucmd == 1) {
s = getenv(menucmd);
if (s)
run_command2(s, 0);
}
-#endif /* CONFIG_MENUKEY */
-#endif /* CONFIG_BOOTDELAY */
+#endif
 
/*
 * Main Loop for Monitor Command Processing
-- 
1.7.5.4

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


[U-Boot] [PATCH 14/14] RX-51: Add support for bootmenu

2012-01-24 Thread Pali Rohár
 * default bootmenu entries:
   NOLO kernel, internal eMMC memory, external SD card, u-boot boot order

 * when keyboard slide is closed always boot NOLO kernel

 * when keyborad slide is open in CONFIG_PREBOOT try load bootmenu.scr from
   first FAT partition of internal eMMC memory (also known as MyDocs) which
   (should) overwrite default bootmenu entries

Signed-off-by: Pali Rohár pali.ro...@gmail.com
Acked-by: Tom Rini tr...@ti.com
---
Changes since original version:
   - Fixed name of env variables

 include/configs/nokia_rx51.h |   21 +
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/include/configs/nokia_rx51.h b/include/configs/nokia_rx51.h
index 9045535..8d6596b 100644
--- a/include/configs/nokia_rx51.h
+++ b/include/configs/nokia_rx51.h
@@ -137,6 +137,7 @@
 #define CONFIG_CMD_I2C /* I2C serial bus support */
 #define CONFIG_CMD_MMC /* MMC support */
 
+#define CONFIG_CMD_BOOTMENU/* ANSI terminal Boot Menu */
 #define CONFIG_CMD_CLEAR   /* ANSI terminal clear screen command */
 
 #ifdef ONENAND_SUPPORT
@@ -212,8 +213,6 @@ int rx51_kp_getc(void);
 #endif
 
 /* Environment information */
-#define CONFIG_BOOTDELAY   3
-
 #define CONFIG_EXTRA_ENV_SETTINGS \
mtdparts= MTDPARTS_DEFAULT \0 \
usbtty=cdc_acm\0 \
@@ -280,10 +279,22 @@ int rx51_kp_getc(void);
run trymmcallpartboot; \
fi\0 \
emmcboot=setenv mmcnum 1; run trymmcboot\0 \
-   sdboot=setenv mmcnum 0; run trymmcboot\0
+   sdboot=setenv mmcnum 0; run trymmcboot\0 \
+   menucmd=bootmenu\0 \
+   bootmenu_0=Internal flash=run noloboot\0 \
+   bootmenu_1=Internal eMMC=run immcboot\0 \
+   bootmenu_2=External SD card=run emmcboot\0 \
+   bootmenu_3=U-Boot boot order=boot\0 \
+   bootmenu_delay=3\0
 
 #define CONFIG_PREBOOT \
-   if test $slide_sw != open; then run noloboot; fi;
+   if test $slide_sw = open; then  \
+   setenv mmcnum 1; setenv mmcpart 1; setenv mmctype fat; \
+   setenv mmcscriptfile bootmenu.scr; \
+   run trymmcscriptboot; \
+   else  \
+   setenv bootmenu_delay 0; \
+   fi
 
 #define CONFIG_PREMONITOR \
echo Extra commands:; \
@@ -301,6 +312,8 @@ int rx51_kp_getc(void);
run noloboot; \
echo
 
+#define CONFIG_MENUCMD
+
 #define CONFIG_AUTO_COMPLETE
 
 /*
-- 
1.7.5.4

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


[U-Boot] [PATCH 07/14] cfb_console: Add functions for moving with cursor

2012-01-24 Thread Pali Rohár
 * console_cursor_fix - fix cursor position (check for out of screen)
 * console_cursor_up, console_cursor_down, console_cursor_left,
   console_cursor_right, console_cursor_set_position for change cursor position
 * console_newline - added param to specify count of creating new lines
 * console_previewsline - opposite of console_newline

Signed-off-by: Pali Rohár pali.ro...@gmail.com
---
Changes since original version:
   - Fixed commit message

 drivers/video/cfb_console.c |   64 +++
 1 files changed, 58 insertions(+), 6 deletions(-)

diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index b74d6d0..3823eae 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -773,9 +773,54 @@ static void console_back(void)
CURSOR_SET;
 }
 
-static void console_newline(void)
+static void console_cursor_fix(void)
 {
-   console_row++;
+   if (console_row  0)
+   console_row = 0;
+   if (console_row = CONSOLE_ROWS)
+   console_row = CONSOLE_ROWS-1;
+   if (console_col  0)
+   console_col = 0;
+   if (console_col = CONSOLE_COLS)
+   console_col = CONSOLE_COLS-1;
+}
+
+static void console_cursor_up(int n)
+{
+   console_row -= n;
+   console_cursor_fix();
+}
+
+static void console_cursor_down(int n)
+{
+   console_row += n;
+   console_cursor_fix();
+}
+
+static void console_cursor_left(int n)
+{
+   console_col -= n;
+   console_cursor_fix();
+}
+
+static void console_cursor_right(int n)
+{
+   console_col += n;
+   console_cursor_fix();
+}
+
+static void console_cursor_set_position(int row, int col)
+{
+   if (console_row != -1)
+   console_row = row;
+   if (console_col != -1)
+   console_col = col;
+   console_cursor_fix();
+}
+
+static void console_newline(int n)
+{
+   console_row += n;
console_col = 0;
 
/* Check if we need to scroll the terminal */
@@ -784,10 +829,17 @@ static void console_newline(void)
console_scrollup();
 
/* Decrement row number */
-   console_row--;
+   console_row = CONSOLE_ROWS-1;
}
 }
 
+static void console_previewsline(int n)
+{
+   /* FIXME: also scroll terminal ? */
+   console_row -= n;
+   console_cursor_fix();
+}
+
 static void console_cr(void)
 {
console_col = 0;
@@ -806,7 +858,7 @@ void video_putc(const char c)
 
case '\n':  /* next line */
if (console_col || (!console_col  nl))
-   console_newline();
+   console_newline(1);
nl = 1;
break;
 
@@ -815,7 +867,7 @@ void video_putc(const char c)
console_col = ~0x0007;
 
if (console_col = CONSOLE_COLS)
-   console_newline();
+   console_newline(1);
break;
 
case 8: /* backspace */
@@ -829,7 +881,7 @@ void video_putc(const char c)
 
/* check for newline */
if (console_col = CONSOLE_COLS) {
-   console_newline();
+   console_newline(1);
nl = 0;
}
}
-- 
1.7.5.4

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


Re: [U-Boot] [PATCH/RFC] mx28: print bootmode with cpuinfo

2012-01-24 Thread Fabio Estevam
On 1/24/12, Matthias Fuchs matthias.fu...@esd.eu wrote:

 - One patch that touches the HW_DIGCTRL_SCRATCH register (this part is
 what fixed the RAM size retrievel after a reboot in the kernel
 And what is this part? I was not aware of this issue. What exactly part
 of my patch fixes this issue?

I started removing all the pieces of your patch and then I noticed
that the part below was responsible for making the reboot command in
Linux to work:

  void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
const unsigned int iomux_size)
 {
+   uint32_t bm = readl(0x80018910)  0xf;
+   writel(bm, HW_DIGCTRL_SCRATCH0);
+   writel(bm, HW_DIGCTRL_SCRATCH1);
+
mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
mx28_power_init();
mx28_mem_init();

I also noticed that even if I replace these lines with a
early_delay(1) it also makes reboot to work fine.

It looks like we need something to be executed before the
mxs_iomux_setup_multiple_pads

The patch below works fine:

--- a/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
@@ -49,8 +49,8 @@ void early_delay(int delay)
 void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
const unsigned int iomux_size)
 {
-   mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
mx28_power_init();
+   mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
mx28_mem_init();
mx28_power_wait_pswitch();
 }

,though I don't have a good explanation for it right now.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V3 1/6] mxc_spi: move machine specifics into CPU headers

2012-01-24 Thread Eric Nelson
Move (E)CSPI register declarations into the imx-regs.h files for each supported 
CPU

Introduce two new macros to control conditional setup
 MXC_CSPI - Used for processors with the Configurable Serial Peripheral 
Interface (MX3x)
 MXC_ECSPI - For processors with Enhanced Configurable... (MX5x, MX6x)

Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
Acked-by: Stefano Babic sba...@denx.de
---
 arch/arm/include/asm/arch-mx31/imx-regs.h |   27 
 arch/arm/include/asm/arch-mx35/imx-regs.h |   25 
 arch/arm/include/asm/arch-mx5/imx-regs.h  |   30 +
 drivers/spi/mxc_spi.c |   93 ++---
 4 files changed, 88 insertions(+), 87 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx31/imx-regs.h 
b/arch/arm/include/asm/arch-mx31/imx-regs.h
index 6a517dd..70e3338 100644
--- a/arch/arm/include/asm/arch-mx31/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx31/imx-regs.h
@@ -890,4 +890,31 @@ struct esdc_regs {
 #define MXC_EHCI_IPPUE_DOWN(1  8)
 #define MXC_EHCI_IPPUE_UP  (1  9)
 
+/*
+ * CSPI register definitions
+ */
+#define MXC_CSPI
+#define MXC_CSPICTRL_EN(1  0)
+#define MXC_CSPICTRL_MODE  (1  1)
+#define MXC_CSPICTRL_XCH   (1  2)
+#define MXC_CSPICTRL_SMC   (1  3)
+#define MXC_CSPICTRL_POL   (1  4)
+#define MXC_CSPICTRL_PHA   (1  5)
+#define MXC_CSPICTRL_SSCTL (1  6)
+#define MXC_CSPICTRL_SSPOL (1  7)
+#define MXC_CSPICTRL_CHIPSELECT(x) (((x)  0x3)  24)
+#define MXC_CSPICTRL_BITCOUNT(x)   (((x)  0x1f)  8)
+#define MXC_CSPICTRL_DATARATE(x)   (((x)  0x7)  16)
+#define MXC_CSPICTRL_TC(1  8)
+#define MXC_CSPICTRL_RXOVF (1  6)
+#define MXC_CSPICTRL_MAXBITS   0x1f
+
+#define MXC_CSPIPERIOD_32KHZ   (1  15)
+#define MAX_SPI_BYTES  4
+
+#define MXC_SPI_BASE_ADDRESSES \
+   0x43fa4000, \
+   0x5001, \
+   0x53f84000,
+
 #endif /* __ASM_ARCH_MX31_IMX_REGS_H */
diff --git a/arch/arm/include/asm/arch-mx35/imx-regs.h 
b/arch/arm/include/asm/arch-mx35/imx-regs.h
index df74508..e570ad1 100644
--- a/arch/arm/include/asm/arch-mx35/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx35/imx-regs.h
@@ -179,6 +179,31 @@
 #define IPU_CONF_IC_EN (11)
 #define IPU_CONF_SCI_EN(10)
 
+/*
+ * CSPI register definitions
+ */
+#define MXC_CSPI
+#define MXC_CSPICTRL_EN(1  0)
+#define MXC_CSPICTRL_MODE  (1  1)
+#define MXC_CSPICTRL_XCH   (1  2)
+#define MXC_CSPICTRL_SMC   (1  3)
+#define MXC_CSPICTRL_POL   (1  4)
+#define MXC_CSPICTRL_PHA   (1  5)
+#define MXC_CSPICTRL_SSCTL (1  6)
+#define MXC_CSPICTRL_SSPOL (1  7)
+#define MXC_CSPICTRL_CHIPSELECT(x) (((x)  0x3)  12)
+#define MXC_CSPICTRL_BITCOUNT(x)   (((x)  0xfff)  20)
+#define MXC_CSPICTRL_DATARATE(x)   (((x)  0x7)  16)
+#define MXC_CSPICTRL_TC(1  7)
+#define MXC_CSPICTRL_RXOVF (1  6)
+#define MXC_CSPICTRL_MAXBITS   0xfff
+#define MXC_CSPIPERIOD_32KHZ   (1  15)
+#define MAX_SPI_BYTES  4
+
+#define MXC_SPI_BASE_ADDRESSES \
+   0x43fa4000, \
+   0x5001,
+
 #define GPIO_PORT_NUM  3
 #define GPIO_NUM_PIN   32
 
diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h 
b/arch/arm/include/asm/arch-mx5/imx-regs.h
index 0ee88d2..4fa6658 100644
--- a/arch/arm/include/asm/arch-mx5/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
@@ -223,6 +223,36 @@
 #define CS0_32M_CS1_32M_CS2_32M_CS3_32M3
 
 /*
+ * CSPI register definitions
+ */
+#define MXC_ECSPI
+#define MXC_CSPICTRL_EN(1  0)
+#define MXC_CSPICTRL_MODE  (1  1)
+#define MXC_CSPICTRL_XCH   (1  2)
+#define MXC_CSPICTRL_CHIPSELECT(x) (((x)  0x3)  12)
+#define MXC_CSPICTRL_BITCOUNT(x)   (((x)  0xfff)  20)
+#define MXC_CSPICTRL_PREDIV(x) (((x)  0xF)  12)
+#define MXC_CSPICTRL_POSTDIV(x)(((x)  0xF)  8)
+#define MXC_CSPICTRL_SELCHAN(x)(((x)  0x3)  18)
+#define MXC_CSPICTRL_MAXBITS   0xfff
+#define MXC_CSPICTRL_TC(1  7)
+#define MXC_CSPICTRL_RXOVF (1  6)
+#define MXC_CSPIPERIOD_32KHZ   (1  15)
+#define MAX_SPI_BYTES  32
+
+/* Bit position inside CTRL register to be associated with SS */
+#define MXC_CSPICTRL_CHAN  18
+
+/* Bit position inside CON register to be associated with SS */
+#define MXC_CSPICON_POL4
+#define MXC_CSPICON_PHA0
+#define MXC_CSPICON_SSPOL  12
+#define MXC_SPI_BASE_ADDRESSES \
+   CSPI1_BASE_ADDR, \
+   CSPI2_BASE_ADDR, \
+   CSPI3_BASE_ADDR,
+
+/*
  * Number of GPIO pins per port
  */
 #define GPIO_NUM_PIN32
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c
index 2fa7486..2e15318 100644
--- a/drivers/spi/mxc_spi.c
+++ b/drivers/spi/mxc_spi.c
@@ -33,93 +33,12 @@
 
 #error i.MX27 CSPI not supported due to drastic differences in register 
definitions \
 See linux mxc_spi driver from Freescale for details.
-
-#elif 

[U-Boot] [PATCH V3 2/6] mx6q: Add support for ECSPI through mxc_spi driver

2012-01-24 Thread Eric Nelson
Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
Acked-by: Stefano Babic sba...@denx.de
---
 arch/arm/include/asm/arch-mx6/imx-regs.h |   44 ++
 1 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-mx6/imx-regs.h 
b/arch/arm/include/asm/arch-mx6/imx-regs.h
index 7650cb9..00040c4 100644
--- a/arch/arm/include/asm/arch-mx6/imx-regs.h
+++ b/arch/arm/include/asm/arch-mx6/imx-regs.h
@@ -190,6 +190,50 @@ struct src {
u32 gpr10;
 };
 
+/* ECSPI registers */
+struct cspi_regs {
+   u32 rxdata;
+   u32 txdata;
+   u32 ctrl;
+   u32 cfg;
+   u32 intr;
+   u32 dma;
+   u32 stat;
+   u32 period;
+};
+
+/*
+ * CSPI register definitions
+ */
+#define MXC_ECSPI
+#define MXC_CSPICTRL_EN(1  0)
+#define MXC_CSPICTRL_MODE  (1  1)
+#define MXC_CSPICTRL_XCH   (1  2)
+#define MXC_CSPICTRL_CHIPSELECT(x) (((x)  0x3)  12)
+#define MXC_CSPICTRL_BITCOUNT(x)   (((x)  0xfff)  20)
+#define MXC_CSPICTRL_PREDIV(x) (((x)  0xF)  12)
+#define MXC_CSPICTRL_POSTDIV(x)(((x)  0xF)  8)
+#define MXC_CSPICTRL_SELCHAN(x)(((x)  0x3)  18)
+#define MXC_CSPICTRL_MAXBITS   0xfff
+#define MXC_CSPICTRL_TC(1  7)
+#define MXC_CSPICTRL_RXOVF (1  6)
+#define MXC_CSPIPERIOD_32KHZ   (1  15)
+#define MAX_SPI_BYTES  32
+
+/* Bit position inside CTRL register to be associated with SS */
+#define MXC_CSPICTRL_CHAN  18
+
+/* Bit position inside CON register to be associated with SS */
+#define MXC_CSPICON_POL4
+#define MXC_CSPICON_PHA0
+#define MXC_CSPICON_SSPOL  12
+#define MXC_SPI_BASE_ADDRESSES \
+   ECSPI1_BASE_ADDR, \
+   ECSPI2_BASE_ADDR, \
+   ECSPI3_BASE_ADDR, \
+   ECSPI4_BASE_ADDR, \
+   ECSPI5_BASE_ADDR
+
 struct iim_regs {
u32 ctrl;
u32 ctrl_set;
-- 
1.7.1

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


[U-Boot] [PATCH V3 0/6] mxc_spi refactoring (for mx6q and mx6qsabrelite)

2012-01-24 Thread Eric Nelson
This patch set refactors mxc_spi as described in 
http://lists.denx.de/pipermail/u-boot/2010-March/068791.html
and requested in 
http://lists.denx.de/pipermail/u-boot/2012-January/116023.html
in order to add support for the MX6Q in general and the mx6qsabrelite 
specifically.

Patch 1 simply moves the conditional parts of mxc_spi.c into the
respective CPU-specific imx-regs.h files.

Patch 2 adds general support for SPI to the i.MX6.

Patch 3 adds support to the mx6qsabrelite board

Patch 4 modifies the 'sf' command to allow a default chip-select
to be specified by board headers as is done on efika et al. This allows
a bare 'sf' probe command:
 U-Boot sf probe
instead of the more cumbersome usage when a GPIO is tacked onto
the chip-select. Otherwise, this command-line would be needed  
to specify GP3:19 on SabreLite:
 U-Boot sf probe 0x5300   

Patch 5 adds default chip-select values for mx6qsabrelite platform.

Patch 6 adds reference macros for use in storing the environment
in serial flash to match the use on Freescale's U-Boot release

This patch set has been compiled against the following configurations,
but only tested on mx6qsabrelite:
mx6qsabrelite
mx51evk
mx31pdk
mx35pdk

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


[U-Boot] [PATCH V3 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS

2012-01-24 Thread Eric Nelson
This patch allows a board configuration file to provide a default 
chip-select for serial flash so that first argument to the 'sf' command
is optional.

On boards that use the mxc_spi driver and a GPIO for chip select, this allows 
a much simpler command line:
U-Boot sf probe
instead of
U-Boot sf probe 0x5300

Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
Acked-by: Stefano Babic sba...@denx.de
---
 common/cmd_sf.c |   34 +++---
 1 files changed, 23 insertions(+), 11 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 7225656..4b32171 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -70,20 +70,28 @@ static int do_spi_flash_probe(int argc, char * const argv[])
char *endp;
struct spi_flash *new;
 
-   if (argc  2)
-   return -1;
-
-   cs = simple_strtoul(argv[1], endp, 0);
-   if (*argv[1] == 0 || (*endp != 0  *endp != ':'))
+#ifndef CONFIG_SPI_FLASH_CS
+   if (argc  2) {
+   printf(%s: missing arguments\n, __func__);
return -1;
-   if (*endp == ':') {
-   if (endp[1] == 0)
-   return -1;
+   }
+#else
+   cs = CONFIG_SPI_FLASH_CS ;
+#endif
 
-   bus = cs;
-   cs = simple_strtoul(endp + 1, endp, 0);
-   if (*endp != 0)
+   if (argc = 2) {
+   cs = simple_strtoul(argv[1], endp, 0);
+   if (*argv[1] == 0 || (*endp != 0  *endp != ':'))
return -1;
+   if (*endp == ':') {
+   if (endp[1] == 0)
+   return -1;
+
+   bus = cs;
+   cs = simple_strtoul(endp + 1, endp, 0);
+   if (*endp != 0)
+   return -1;
+   }
}
 
if (argc = 3) {
@@ -299,7 +307,11 @@ usage:
 U_BOOT_CMD(
sf, 5,  1,  do_spi_flash,
SPI flash sub-system,
+#ifndef CONFIG_SPI_FLASH_CS
probe [bus:]cs [hz] [mode] - init flash device on given SPI bus\n
+#else
+   probe [[bus:]cs] [hz] [mode]   - init flash device on given SPI bus\n
+#endif
 and chip select\n
sf read addr offset len- read `len' bytes starting at\n
 `offset' to memory at `addr'\n
-- 
1.7.1

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


[U-Boot] [PATCH V3 3/6] mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform

2012-01-24 Thread Eric Nelson
Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
Acked-by: Stefano Babic sba...@denx.de
---
 board/freescale/mx6qsabrelite/imximage.cfg|2 +-
 board/freescale/mx6qsabrelite/mx6qsabrelite.c |   25 +
 include/configs/mx6qsabrelite.h   |9 +
 3 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/board/freescale/mx6qsabrelite/imximage.cfg 
b/board/freescale/mx6qsabrelite/imximage.cfg
index b4ff010..fa40bff 100644
--- a/board/freescale/mx6qsabrelite/imximage.cfg
+++ b/board/freescale/mx6qsabrelite/imximage.cfg
@@ -156,7 +156,7 @@ DATA 4 0x021b0404 0x00011006
 
 # set the default clock gate to save power
 DATA 4 0x020c4068 0x00C03F3F
-DATA 4 0x020c406c 0x0030FC00
+DATA 4 0x020c406c 0x0030FC03
 DATA 4 0x020c4070 0x0FFFC000
 DATA 4 0x020c4074 0x3FF0
 DATA 4 0x020c4078 0x00FFF300
diff --git a/board/freescale/mx6qsabrelite/mx6qsabrelite.c 
b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
index a0b648f..2ba6b0c 100644
--- a/board/freescale/mx6qsabrelite/mx6qsabrelite.c
+++ b/board/freescale/mx6qsabrelite/mx6qsabrelite.c
@@ -46,6 +46,10 @@ DECLARE_GLOBAL_DATA_PTR;
PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED   | \
PAD_CTL_DSE_40ohm   | PAD_CTL_HYS)
 
+#define SPI_PAD_CTRL (PAD_CTL_HYS |\
+   PAD_CTL_PUS_100K_DOWN | PAD_CTL_SPEED_MED | \
+   PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
+
 int dram_init(void)
 {
gd-ram_size = get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);
@@ -193,6 +197,23 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_MXC_SPI
+iomux_v3_cfg_t ecspi1_pads[] = {
+   /* SS1 */
+   MX6Q_PAD_EIM_D19__GPIO_3_19   | MUX_PAD_CTRL(SPI_PAD_CTRL),
+   MX6Q_PAD_EIM_D17__ECSPI1_MISO | MUX_PAD_CTRL(SPI_PAD_CTRL),
+   MX6Q_PAD_EIM_D18__ECSPI1_MOSI | MUX_PAD_CTRL(SPI_PAD_CTRL),
+   MX6Q_PAD_EIM_D16__ECSPI1_SCLK | MUX_PAD_CTRL(SPI_PAD_CTRL),
+};
+
+void setup_spi(void)
+{
+   gpio_direction_output(IMX_GPIO_NR(3, 19), 1);
+   imx_iomux_v3_setup_multiple_pads(ecspi1_pads,
+ARRAY_SIZE(ecspi1_pads));
+}
+#endif
+
 #define MII_1000BASET_CTRL 0x9
 #define MII_EXTENDED_CTRL  0xb
 #define MII_EXTENDED_DATAW 0xc
@@ -250,6 +271,10 @@ int board_early_init_f(void)
 {
setup_iomux_uart();
 
+#ifdef CONFIG_MXC_SPI
+   setup_spi();
+#endif
+
return 0;
 }
 
diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index 034fc40..8dd6e39 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -44,6 +44,15 @@
 #define CONFIG_MXC_UART
 #define CONFIG_MXC_UART_BASE   UART2_BASE
 
+#define CONFIG_CMD_SF
+#ifdef CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SST
+#define CONFIG_MXC_SPI
+#define CONFIG_SF_DEFAULT_SPEED 2500
+#define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
+#endif
+
 /* MMC Configs */
 #define CONFIG_FSL_ESDHC
 #define CONFIG_FSL_USDHC
-- 
1.7.1

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


[U-Boot] [PATCH V3 5/6] mx6q: mx6qsabrelite: Provide default chip-select for serial flash

2012-01-24 Thread Eric Nelson
Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
Acked-by: Stefano Babic sba...@denx.de
---
 include/configs/mx6qsabrelite.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index 8dd6e39..e34f108 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -46,6 +46,7 @@
 
 #define CONFIG_CMD_SF
 #ifdef CONFIG_CMD_SF
+#define CONFIG_SPI_FLASH_CS 0x5300
 #define CONFIG_SPI_FLASH
 #define CONFIG_SPI_FLASH_SST
 #define CONFIG_MXC_SPI
-- 
1.7.1

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


[U-Boot] [PATCH V3 6/6] mx6q: mx6qsabrelite: Conditionally define macros for environment in serial flash

2012-01-24 Thread Eric Nelson
The default settings store the persistent environment on SD card
and not serial flash (SPI NOR).

To use SPI NOR to save the environment instead of SD card, edit
include/configs/mx6qsabrelite.h and

- undefine CONFIG_ENV_IS_IN_MMC
- define   CONFIG_ENV_IS_IN_SPI_FLASH

The SPI driver can take as chip select the controller's chip selects 
as well as an external GPIO. The LSB byte has the value of the internal
chip select, the highest (thought as 16-bit value) contains the GPIO
number. 

The GPIO used on Sabre Lite is GP3:19 == 83.

Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
Acked-by: Dirk Behme dirk.be...@de.bosch.com 
---
 include/configs/mx6qsabrelite.h |   12 +++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/include/configs/mx6qsabrelite.h b/include/configs/mx6qsabrelite.h
index e34f108..024a94c 100644
--- a/include/configs/mx6qsabrelite.h
+++ b/include/configs/mx6qsabrelite.h
@@ -174,10 +174,20 @@
 /* FLASH and environment organization */
 #define CONFIG_SYS_NO_FLASH
 
-#define CONFIG_ENV_OFFSET  (6 * 64 * 1024)
 #define CONFIG_ENV_SIZE(8 * 1024)
+
 #define CONFIG_ENV_IS_IN_MMC
+/* #define CONFIG_ENV_IS_IN_SPI_FLASH */
+
+#if defined(CONFIG_ENV_IS_IN_MMC)
+#define CONFIG_ENV_OFFSET  (6 * 64 * 1024)
 #define CONFIG_SYS_MMC_ENV_DEV 0
+#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
+#define CONFIG_ENV_OFFSET  (768 * 1024)
+#define CONFIG_ENV_SECT_SIZE   (8 * 1024)
+#define CONFIG_ENV_SPI_CS  0x5300
+#define CONFIG_ENV_SPI_MODESPI_MODE_0
+#endif
 
 #define CONFIG_OF_LIBFDT
 
-- 
1.7.1

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


Re: [U-Boot] [PATCH] SMDK5250: Add ethernet support

2012-01-24 Thread Simon Glass
Hi Chander,

On Tue, Jan 24, 2012 at 5:03 AM, Chander Kashyap
chander.kash...@linaro.org wrote:
 This patch enable support for SMC911X based ethernet device.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  board/samsung/smdk5250/smdk5250.c |   89 
 +
  include/configs/smdk5250.h        |   13 +-
  2 files changed, 100 insertions(+), 2 deletions(-)

 diff --git a/board/samsung/smdk5250/smdk5250.c 
 b/board/samsung/smdk5250/smdk5250.c
 index 2684620..a1b1a48 100644
 --- a/board/samsung/smdk5250/smdk5250.c
 +++ b/board/samsung/smdk5250/smdk5250.c
 @@ -31,10 +31,95 @@
  DECLARE_GLOBAL_DATA_PTR;
  struct exynos5_gpio_part1 *gpio1;

 +static void smc9115_pre_init(void)

Is there a common place where this function could go, so that other
boards based on this SOC could use it also? Perhaps a
board/samsun/exynos5 common directory?

 +{
 +       u32 smc_bw_conf, smc_bc_conf;
 +       int i;
 +
 +       /*
 +        * SROM:CS1 and EBI
 +        *
 +        * GPY0[0]      SROM_CSn[0]
 +        * GPY0[1]      SROM_CSn[1](2)
 +        * GPY0[2]      SROM_CSn[2]
 +        * GPY0[3]      SROM_CSn[3]
 +        * GPY0[4]      EBI_OEn(2)
 +        * GPY0[5]      EBI_EEn(2)
 +        *
 +        * GPY1[0]      EBI_BEn[0](2)
 +        * GPY1[1]      EBI_BEn[1](2)
 +        * GPY1[2]      SROM_WAIT(2)
 +        * GPY1[3]      EBI_DATA_RDn(2)
 +        */
 +       s5p_gpio_cfg_pin(gpio1-y0, CONFIG_ENV_SROM_BANK, GPIO_FUNC(2));
 +       s5p_gpio_cfg_pin(gpio1-y0, 4, GPIO_FUNC(2));
 +       s5p_gpio_cfg_pin(gpio1-y0, 5, GPIO_FUNC(2));
 +
 +       for (i = 0; i  4; i++)
 +               s5p_gpio_cfg_pin(gpio1-y1, i, GPIO_FUNC(2));
 +
 +       /*
 +        * EBI: 8 Addrss Lines
 +        *
 +        * GPY3[0]      EBI_ADDR[0](2)
 +        * GPY3[1]      EBI_ADDR[1](2)
 +        * GPY3[2]      EBI_ADDR[2](2)
 +        * GPY3[3]      EBI_ADDR[3](2)
 +        * GPY3[4]      EBI_ADDR[4](2)
 +        * GPY3[5]      EBI_ADDR{5](2)
 +        * GPY3[6]      EBI_ADDR[6](2)
 +        * GPY3[7]      EBI_ADDR{7](2)
 +        *
 +        * EBI: 16 Data Lines
 +        *
 +        * GPY5[0]      EBI_DATA[0](2)
 +        * GPY5[1]      EBI_DATA[1](2)
 +        * GPY5[2]      EBI_DATA[2](2)
 +        * GPY5[3]      EBI_DATA[3](2)
 +        * GPY5[4]      EBI_DATA[4](2)
 +        * GPY5[5]      EBI_DATA{5](2)
 +        * GPY5[6]      EBI_DATA[6](2)
 +        * GPY5[7]      EBI_DATA{7](2)
 +        *
 +        * GPY6[0]      EBI_DATA[8](2)
 +        * GPY6[1]      EBI_DATA[9](2)
 +        * GPY6[2]      EBI_DATA[10](2)
 +        * GPY6[3]      EBI_DATA110](2)
 +        * GPY6[4]      EBI_DATA[12](2)
 +        * GPY6[5]      EBI_DATA{13](2)
 +        * GPY6[6]      EBI_DATA[14](2)
 +        * GPY6[7]      EBI_DATA{15](2)
 +        */
 +       for (i = 0; i  8; i++) {
 +               s5p_gpio_cfg_pin(gpio1-y3, i, GPIO_FUNC(2));
 +               s5p_gpio_set_pull(gpio1-y3, i, GPIO_PULL_UP);
 +
 +               s5p_gpio_cfg_pin(gpio1-y5, i, GPIO_FUNC(2));
 +               s5p_gpio_set_pull(gpio1-y5, i, GPIO_PULL_UP);
 +
 +               s5p_gpio_cfg_pin(gpio1-y6, i, GPIO_FUNC(2));
 +               s5p_gpio_set_pull(gpio1-y6, i, GPIO_PULL_UP);
 +       }
 +
 +       /* Ethernet needs data bus width of 16 bits */
 +       smc_bw_conf = SROMC_DATA16_WIDTH(CONFIG_ENV_SROM_BANK)
 +                       | SROMC_BYTE_ENABLE(CONFIG_ENV_SROM_BANK);
 +
 +       smc_bc_conf = SROMC_BC_TACS(0x01) | SROMC_BC_TCOS(0x01)
 +                       | SROMC_BC_TACC(0x06) | SROMC_BC_TCOH(0x01)
 +                       | SROMC_BC_TAH(0x0C)  | SROMC_BC_TACP(0x09)
 +                       | SROMC_BC_PMC(0x01);
 +
 +       /* Select and configure the SROMC bank */
 +       s5p_config_sromc(CONFIG_ENV_SROM_BANK, smc_bw_conf, smc_bc_conf);
 +}
 +
  int board_init(void)
  {
        gpio1 = (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();

 +       smc9115_pre_init();

Could this be done once later, in board_eth_init(), to avoid init of a
device which might not be used?

 +
        gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
        return 0;
  }
 @@ -79,6 +164,10 @@ void dram_init_banksize(void)
        gd-bd-bi_dram[7].size = get_ram_size((long *)PHYS_SDRAM_8, \
                                                        PHYS_SDRAM_8_SIZE);
  }
 +int board_eth_init(bd_t *bis)
 +{
 +       return smc911x_initialize(0, CONFIG_SMC911X_BASE);
 +}

  #ifdef CONFIG_DISPLAY_BOARDINFO
  int checkboard(void)
 diff --git a/include/configs/smdk5250.h b/include/configs/smdk5250.h
 index 6f2ef4c..4ad4bd2 100644
 --- a/include/configs/smdk5250.h
 +++ b/include/configs/smdk5250.h
 @@ -98,8 +98,7 @@
  #define CONFIG_CMD_MMC
  #define CONFIG_CMD_EXT2
  #define CONFIG_CMD_FAT
 -#undef CONFIG_CMD_NET
 -#undef CONFIG_CMD_NFS
 +#define CONFIG_CMD_NET

  #define CONFIG_BOOTDELAY               3
  #define CONFIG_ZERO_BOOTDELAY_CHECK
 @@ -196,6 +195,16 @@
  #define CONFIG_SYS_INIT_SP_ADDR        (CONFIG_SYS_LOAD_ADDR - 0x100)

[U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Fabio Estevam
When running Linux on a mx28evk and issuing a 'reboot'command the following 
behaviour is observed:

root@freescale /$ reboot
starting pid 329, tty '': '/etc/rc.d/rcS stop'  
root@freescale /$ Stopping inetd:   
Terminated  
Unmounting filesystems  
umount: tmpfs busy - remounted read-only
chown: /home/user/.rhosts: Read-only file system
chown: /home/user: Read-only file system
chown: /home/user: Read-only file system
cat: can't open '/proc/devices': No such file or directory  
The system is going down NOW!   
Sent SIGTERM to all processes   
Sent SIGKILL to all processes   
Requesting system reboot
[   24.24] Restarting system.   
  
U-Boot 2011.12-06887-g586ab2f-dirty (Jan 24 2012 - 12:58:50)

Freescale i.MX28 family 
DRAM:  0

, and then U-boot hangs.

Calling mx28_power_init() prior to mxs_iomux_setup_multiple_pads() fixes the 
problem and
make U-boot to re-start succesfully.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
This patch fixes the reboot issue, but I am not able to provide a good 
explanation for it, so
I am marking it as RFC.

 arch/arm/cpu/arm926ejs/mx28/spl_boot.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_boot.c 
b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
index dfb8309..0e57252 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
@@ -49,8 +49,8 @@ void early_delay(int delay)
 void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
const unsigned int iomux_size)
 {
-   mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
mx28_power_init();
+   mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
mx28_mem_init();
mx28_power_wait_pswitch();
 }
-- 
1.7.1


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


Re: [U-Boot] [PATCH V3 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS

2012-01-24 Thread Fabio Estevam
On 1/24/12, Eric Nelson eric.nel...@boundarydevices.com wrote:
 This patch allows a board configuration file to provide a default
 chip-select for serial flash so that first argument to the 'sf' command
 is optional.

 On boards that use the mxc_spi driver and a GPIO for chip select, this
 allows
 a much simpler command line:
   U-Boot sf probe
 instead of
   U-Boot sf probe 0x5300

 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 Acked-by: Dirk Behme dirk.be...@de.bosch.com
 Acked-by: Stefano Babic sba...@denx.de

Acked-by: Fabio Estevam fabio.este...@freescale.com
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] bootelf command for Pandaboard

2012-01-24 Thread Boban Petrovic
I have specific need to boot my Pandaboard with an elf image. I noticed
that in u-boot-2011.12 bootelf command is disabled by default in
omap4_panda_config. I am wondering if there is a reason for not having
bootelf command for Pandaboard. Thanks.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] bootelf command for Pandaboard

2012-01-24 Thread Wolfgang Denk
Dear Boban Petrovic,

In message caemuqn3xbjo7o9u-gsodqrcwftjtis2t3ky_vs2qjecnehw...@mail.gmail.com 
you wrote:

 I have specific need to boot my Pandaboard with an elf image. I noticed
 that in u-boot-2011.12 bootelf command is disabled by default in
 omap4_panda_config. I am wondering if there is a reason for not having
 bootelf command for Pandaboard. Thanks.

If you enable all features and commands available in U-Boot you will
end up with a huge image whih consists mostly of unused, unneeded
stuff.

If you have requirements for more exotic configurations it's trivial
to enable these in your local copy of the config file.

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
Only a fool fights in a burning house.
-- Kank the Klingon, Day of the Dove, stardate unknown
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] non SPL boot on beagleboard-xm

2012-01-24 Thread Peter Meerwald
Hello,

I can boot u-boot built from git commit 
b609009801b8a00644926f49b7d0d0cc0d3d8797 successfully, but it fails with 
git commit ee08a8260a3a7f6ef2001cfa3e7b6137b485f40a:

Texas Instruments X-Loader 1.5.1 (Jan 24 2012 - 14:51:45)
Beagle xM
Reading boot sector
Loading u-boot.bin from mmc

for commit ee08a8260a3a7f6ef2001cfa3e7b6137b485f40a I am disabling (or so 
I hope) SPL by setting
#define CONFIG_SPL - #undef CONFIG_SPL
in include/configs/omap3_beagle.h

is SPL mandatory?
CONFIG_SPL does not work for me to disable it

note: using MLO/SPL with current u-boot works fine

thanks, p.

-- 

Peter Meerwald
+43-664-218 (mobile)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] USB: reevaluate iomux stdin on USB kbd detect

2012-01-24 Thread Allen Martin
  If CONSOLE_MUX is enabled, reevaluate console stdin when USB keyboard
  device is detected.
 
  Signed-off-by: Allen Martin amar...@nvidia.com
 
 ping, anyone have any comments/feedback?
 

Hi, anyone want to give this patch some love so USB keyboard can work on EHCI 
again?

-Allen

nvpublic

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


Re: [U-Boot] [PATCH] USB: move keyboard polling into kbd driver

2012-01-24 Thread Allen Martin
  This moves keyboard polling logic from USB HCD drivers into USB
  keyboard driver.  Remove usb_event_poll() as keyboard polling was
  the only user of this API.  With this patch USB keyboard works with
  EHCI controllers again.  Tested on a tegra2 seaboard.
 
  Signed-off-by: Allen Martin amar...@nvidia.com
 
 ping, anyone have any comments/feedback?
 

Hi, anyone want to give this patch some love so USB keyboard can work on EHCI 
again?

-Allen

nvpublic


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


Re: [U-Boot] non SPL boot on beagleboard-xm

2012-01-24 Thread Tom Rini
On Tue, Jan 24, 2012 at 10:02 AM, Peter Meerwald pme...@pmeerw.net wrote:
 Hello,

 I can boot u-boot built from git commit
 b609009801b8a00644926f49b7d0d0cc0d3d8797 successfully, but it fails with
 git commit ee08a8260a3a7f6ef2001cfa3e7b6137b485f40a:

The current implementation (after poking some of the other
beagleboard.org folks) requires SPL.  It's not a hard requirement of
supporting SPL that other loaders not be supported, we just didn't aim
for compatibility.

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


Re: [U-Boot] [PATCH V3 4/6] sf command: allow default chip select through CONFIG_SPI_FLASH_CS

2012-01-24 Thread Mike Frysinger
On Tuesday 24 January 2012 11:18:22 Eric Nelson wrote:
 This patch allows a board configuration file to provide a default
 chip-select for serial flash so that first argument to the 'sf' command
 is optional.
 
 On boards that use the mxc_spi driver and a GPIO for chip select, this
 allows a much simpler command line:
   U-Boot sf probe
 instead of
   U-Boot sf probe 0x5300

NAK (to this version of the patch): missing README update, and other issues 
below

 --- a/common/cmd_sf.c
 +++ b/common/cmd_sf.c

 +#ifndef CONFIG_SPI_FLASH_CS
 + if (argc  2) {
 + printf(%s: missing arguments\n, __func__);
   return -1;

return cmd_usage(cmdtp);

 - if (*endp == ':') {
 - if (endp[1] == 0)
 - return -1;
 + }
 +#else
 + cs = CONFIG_SPI_FLASH_CS ;
 +#endif

you're setting the default CS, not locking it in.  so a better config knob name 
would be something like:
CONFIG_SF_DEFAULT_CS
this matches the existing CONFIG_SF_XXX defines

also, you have a spurious space before the semicolon there

  U_BOOT_CMD(
   sf, 5,  1,  do_spi_flash,
   SPI flash sub-system,
 +#ifndef CONFIG_SPI_FLASH_CS
   probe [bus:]cs [hz] [mode] - init flash device on given SPI bus\n
 +#else
 + probe [[bus:]cs] [hz] [mode]   - init flash device on given SPI bus\n
 +#endif
and chip select\n
   sf read addr offset len- read `len' bytes starting at\n
`offset' to memory at `addr'\n

this is ugly.  i'd rather just omit it and not worry about the syntax being 
perfect.
-mike


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


Re: [U-Boot] [PATCH] SMDK5250: Add ethernet support

2012-01-24 Thread Mike Frysinger
On Tuesday 24 January 2012 08:03:20 Chander Kashyap wrote:
 --- a/include/configs/smdk5250.h
 +++ b/include/configs/smdk5250.h

 +#define CONFIG_NET_MULTI

dead define - delete

 +#define CONFIG_ETHADDR   00:40:5c:26:0a:5b

as Simon said, delete this too
-mike


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


Re: [U-Boot] [PATCH 00/14] Nokia RX-51 support

2012-01-24 Thread Graeme Russ
Wolfgang,

On 01/25/2012 01:27 AM, Pali Rohár wrote:
 This patch series add support for new board Nokia RX-51 (aka N900).
 Last two patches adding on screen bootmenu support.
 
 This series supersedes the last sent version.

Just to let you know, I went through this submission off-list with Pali
sorting out the revisions etc and in the end it all got too complicated, so
I suggested it should be submitted again from scratch (although it does
have rudimentary change logs from the previously posted version)

Regards,

Graeme



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


[U-Boot] [PATCH v5 1/3] PXA: PXA27x Matrix keypad driver

2012-01-24 Thread Vasily Khoruzhick
From: Marek Vasut marek.va...@gmail.com

Signed-off-by: Marek Vasut marek.va...@gmail.com
Signed-off-by: Vasily Khoruzhick anars...@gmail.com
---
v2: use struct-based access to regs, minor cleanup
v3: fix multiple keypresses handling, minor cleanup
v4: another minor cleanup
v5: fix indentation issues in scan_keys(), remove udelay,
increase PXA_KEYPAD_TIMEOUT (due to removed udelay)

 arch/arm/include/asm/arch-pxa/pxa-regs.h|   52 -
 arch/arm/include/asm/arch-pxa/regs-keypad.h |   84 
 drivers/input/Makefile  |2 +
 drivers/input/pxa27x-mkp.c  |  292 +++
 4 files changed, 378 insertions(+), 52 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/regs-keypad.h
 create mode 100644 drivers/input/pxa27x-mkp.c

diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h 
b/arch/arm/include/asm/arch-pxa/pxa-regs.h
index b81b42c..d562658 100644
--- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
+++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
@@ -2567,58 +2567,6 @@ typedef void (*ExcpHndlr) (void) ;
 #define OVL2C1_O2EN(131) /* Enable bit for Overlay 2 */
 #define CCR_CEN(131) /* Enable bit for Cursor */
 
-/* Keypad controller */
-
-#define KPC0x4150 /* Keypad Interface Control register */
-#define KPDK   0x4158 /* Keypad Interface Direct Key register */
-#define KPREC  0x41500010 /* Keypad Intefcace Rotary Encoder register 
*/
-#define KPMK   0x41500018 /* Keypad Intefcace Matrix Key register */
-#define KPAS   0x41500020 /* Keypad Interface Automatic Scan register 
*/
-#define KPASMKP0   0x41500028 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 0 */
-#define KPASMKP1   0x41500030 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 1 */
-#define KPASMKP2   0x41500038 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 2 */
-#define KPASMKP3   0x41500040 /* Keypad Interface Automatic Scan Multiple 
Key Presser register 3 */
-#define KPKDI  0x41500048 /* Keypad Interface Key Debounce Interval 
register */
-
-#define KPC_AS (0x1  30)  /* Automatic Scan bit */
-#define KPC_ASACT  (0x1  29)  /* Automatic Scan on Activity */
-#define KPC_MI (0x1  22)  /* Matrix interrupt bit */
-#define KPC_IMKP   (0x1  21)  /* Ignore Multiple Key Press */
-#define KPC_MS7(0x1  20)  /* Matrix scan line 7 */
-#define KPC_MS6(0x1  19)  /* Matrix scan line 6 */
-#define KPC_MS5(0x1  18)  /* Matrix scan line 5 */
-#define KPC_MS4(0x1  17)  /* Matrix scan line 4 */
-#define KPC_MS3(0x1  16)  /* Matrix scan line 3 */
-#define KPC_MS2(0x1  15)  /* Matrix scan line 2 */
-#define KPC_MS1(0x1  14)  /* Matrix scan line 1 */
-#define KPC_MS0(0x1  13)  /* Matrix scan line 0 */
-#define KPC_ME (0x1  12)  /* Matrix Keypad Enable */
-#define KPC_MIE(0x1  11)  /* Matrix Interrupt Enable */
-#define KPC_DK_DEB_SEL (0x1   9)  /* Direct Key Debounce select */
-#define KPC_DI (0x1   5)  /* Direct key interrupt bit */
-#define KPC_DEE0   (0x1   2)  /* Rotary Encoder 0 Enable */
-#define KPC_DE (0x1   1)  /* Direct Keypad Enable */
-#define KPC_DIE(0x1   0)  /* Direct Keypad interrupt Enable 
*/
-
-#define KPDK_DKP   (0x1  31)
-#define KPDK_DK7   (0x1   7)
-#define KPDK_DK6   (0x1   6)
-#define KPDK_DK5   (0x1   5)
-#define KPDK_DK4   (0x1   4)
-#define KPDK_DK3   (0x1   3)
-#define KPDK_DK2   (0x1   2)
-#define KPDK_DK1   (0x1   1)
-#define KPDK_DK0   (0x1   0)
-
-#define KPREC_OF1  (0x1  31)
-#define kPREC_UF1  (0x1  30)
-#define KPREC_OF0  (0x1  15)
-#define KPREC_UF0  (0x1  14)
-
-#define KPMK_MKP   (0x1  31)
-#define KPAS_SO(0x1  31)
-#define KPASMKPx_SO(0x1  31)
-
 #define GPIO113_BIT(1  17)/* GPIO113 in GPSR, GPCR, bit 17 */
 #define PSLR   0x40F00034
 #define PSTR   0x40F00038  /* Power Manager Standby Configuration Reg 
*/
diff --git a/arch/arm/include/asm/arch-pxa/regs-keypad.h 
b/arch/arm/include/asm/arch-pxa/regs-keypad.h
new file mode 100644
index 000..1909417
--- /dev/null
+++ b/arch/arm/include/asm/arch-pxa/regs-keypad.h
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2012 Vasily Khoruzhick anars...@gmail.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License 

[U-Boot] [PATCH v5 2/3] zipitz2: enable pxa27x_mkp driver

2012-01-24 Thread Vasily Khoruzhick
Signed-off-by: Vasily Khoruzhick anars...@gmail.com
---
v2: remove usbtty stuff from EXTRA_ENV_SETTINGS
v3: shift+backspace should produce backspace code
v4: no change
v5: prettify CONFIG_PXA27X_MKP_KEYMAP

 include/configs/zipitz2.h |   82 ++---
 1 files changed, 77 insertions(+), 5 deletions(-)

diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index 26204af..615f9bc 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -80,6 +80,12 @@
 #defineCONFIG_CMD_MMC
 #defineCONFIG_CMD_SPI
 
+#defineCONFIG_EXTRA_ENV_SETTINGS   
\
+   stdout=lcd\0  \
+   stdin=pxa27x-mkp\0\
+   stderr=lcd\0  \
+   
+#defineCONFIG_KEYBOARD
 /*
  * MMC Card Configuration
  */
@@ -206,15 +212,81 @@ unsigned char zipitz2_spi_read(void);
 #define CONFIG_SYS_FLASH_PROTECTION
 
 /*
+ * Matrix keypad
+ */
+#ifdef CONFIG_KEYBOARD
+#defineCONFIG_PXA27X_MKP
+
+#defineCONFIG_PXA27X_MKP_MKP_COLS  7
+#defineCONFIG_PXA27X_MKP_MKP_ROWS  6
+
+#defineCONFIG_PXA27X_MKP_DEBOUNCE  30
+#defineCONFIG_PXA27X_MKP_DELAY 3
+
+#defineCONFIG_PXA27X_MKP_MOD_SHIFT {5, 3}
+#defineCONFIG_PXA27X_MKP_MOD_ALT   {5, 2}
+#defineCONFIG_PXA27X_MKP_MOD_CTRL  {5, 4}
+
+#defineCONFIG_PXA27X_MKP_KEYMAP\
+   { 1, 1, 'q', 'Q', '1', 0xff },  \
+   { 2, 1, 'i', 'I', '8', 0xff },  \
+   { 3, 1, 'g', 'G', '\', 0xff }, \
+   { 4, 1, 'x', 'X', '/', 0xff },  \
+   { 5, 1, '\r', 0xff, 0xff, 0xff },   \
+   { 6, 1, '-', 0xff, 0xff, 0xff },\
+   \
+   { 1, 2, 'w', 'W', '2', 0xff },  \
+   { 2, 2, 'o', 'O', '9', 0xff },  \
+   { 3, 2, 'h', 'H', '\'', 0xff }, \
+   { 4, 2, 'c', 'C', '+', 0xff },  \
+   \
+   { 1, 3, 'e', 'E', '3', 0xff },  \
+   { 2, 3, 'p', 'P', '0', 0xff },  \
+   { 3, 3, 'j', 'J', '[', 0xff },  \
+   { 4, 3, 'v', 'V', '*', 0xff },  \
+   \
+   { 0, 4, '\e', 0xff, '|', 0xff },\
+   { 1, 4, 'r', 'R', '4', 0xff },  \
+   { 2, 4, 'a', 'A', '$', 0xff },  \
+   { 3, 4, 'k', 'K', ']', 0xff },  \
+   { 4, 4, 'b', 'B', '=', 0xff },  \
+   \
+   { 0, 5, '\t', 0xff, 0xff, 0xff },   \
+   { 1, 5, 't', 'T', '5', 0xff },  \
+   { 2, 5, 's', 'S', '#', 0xff },  \
+   { 3, 5, 'l', 'L', '-', 0xff },  \
+   { 4, 5, 'n', 'N', '_', 0xff },  \
+   { 5, 5, ' ', 0xff, 0xff, 0xff },\
+   \
+   { 1, 6, 'y', 'Y', '6', 0xff },  \
+   { 2, 6, 'd', 'D', '', 0xff },  \
+   { 3, 6, '\b', '\b', '\\', 0xff },   \
+   { 4, 6, 'm', 'M', '?', 0xff },  \
+   { 5, 6, ',', '(', '', '{' },   \
+   \
+   { 1, 7, 'u', 'U', '7', 0xff },  \
+   { 2, 7, 'f', 'F', '@', 0xff },  \
+   { 3, 7, 'z', 'Z', '!', 0xff },  \
+   { 4, 7, ';', '~', ':', 0xff },  \
+   { 5, 7, '.', ')', '', '}' },   \
+   \
+   { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }
+
+#defineCONFIG_SYS_CONSOLE_ENV_OVERWRITE
+#defineCONFIG_SYS_CONSOLE_IS_IN_ENV
+
+#endif
+
+/*
  * GPIO settings
  */
 #define CONFIG_SYS_GAFR0_L_VAL 0x02000140
-#define CONFIG_SYS_GAFR0_U_VAL 0x59188000
-#define CONFIG_SYS_GAFR1_L_VAL 0x6392
+#define CONFIG_SYS_GAFR0_U_VAL 0x59188005
+#define CONFIG_SYS_GAFR1_L_VAL 0x639420a2
 #define CONFIG_SYS_GAFR1_U_VAL 0xaaa03950
 #define CONFIG_SYS_GAFR2_L_VAL 0x0aaa
 #define CONFIG_SYS_GAFR2_U_VAL 0x29000308
-#define CONFIG_SYS_GAFR3_L_VAL 0x5400
+#define CONFIG_SYS_GAFR3_L_VAL 0x56aa9500
 #define CONFIG_SYS_GAFR3_U_VAL 0x00d5
 #define CONFIG_SYS_GPCR0_VAL   0x
 #define CONFIG_SYS_GPCR1_VAL   0x0020
@@ -222,7 +294,7 @@ unsigned char zipitz2_spi_read(void);
 #define CONFIG_SYS_GPCR3_VAL   0x
 #define CONFIG_SYS_GPDR0_VAL   0xdafcee00
 #define CONFIG_SYS_GPDR1_VAL   0xffa3aaab
-#define CONFIG_SYS_GPDR2_VAL   0x8fe9
+#define CONFIG_SYS_GPDR2_VAL   0x8fe1
 #define CONFIG_SYS_GPDR3_VAL   0x001b1f8a
 #define CONFIG_SYS_GPSR0_VAL   0x06080400
 #define CONFIG_SYS_GPSR1_VAL   0x007f
@@ -234,7 +306,7 @@ unsigned char zipitz2_spi_read(void);
 /*
  * Clock settings
  */
-#define CONFIG_SYS_CKEN0x00511220
+#define CONFIG_SYS_CKEN

[U-Boot] [PATCH v5 3/3] zipitz2: use pxa_mmc_gen as MMC driver

2012-01-24 Thread Vasily Khoruzhick
Signed-off-by: Vasily Khoruzhick anars...@gmail.com
---
v2: mmcinfo is necessary to scan card for partitions
v3: replace mmcinfo with mmc rescan
v4: mmc rescan does not take extra argument in recent u-boot,
so remove it.
v5: remove spaces from CONFIG_BOOTCOMMAND

 board/zipitz2/zipitz2.c   |8 
 include/configs/zipitz2.h |6 --
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/board/zipitz2/zipitz2.c b/board/zipitz2/zipitz2.c
index b093c2f..4075fb6 100644
--- a/board/zipitz2/zipitz2.c
+++ b/board/zipitz2/zipitz2.c
@@ -79,6 +79,14 @@ void dram_init_banksize(void)
gd-bd-bi_dram[0].size = PHYS_SDRAM_1_SIZE;
 }
 
+#ifdef CONFIG_CMD_MMC
+int board_mmc_init(bd_t *bis)
+{
+   pxa_mmc_register(0);
+   return 0;
+}
+#endif
+
 #ifdef CONFIG_CMD_SPI
 
 struct {
diff --git a/include/configs/zipitz2.h b/include/configs/zipitz2.h
index 615f9bc..6dae630 100644
--- a/include/configs/zipitz2.h
+++ b/include/configs/zipitz2.h
@@ -45,7 +45,8 @@
 #defineCONFIG_ARCH_CPU_INIT
 
 #defineCONFIG_BOOTCOMMAND  
\
-   if mmc init  fatload mmc 0 0xa000 uboot.script ; then   \
+   if mmc rescan  ext2load mmc 0 0xa000 boot/uboot.script ;\
+   then  \
source 0xa000;\
else  \
bootm 0x6;\
@@ -91,7 +92,8 @@
  */
 #ifdef CONFIG_CMD_MMC
 #defineCONFIG_MMC
-#defineCONFIG_PXA_MMC
+#defineCONFIG_GENERIC_MMC
+#defineCONFIG_PXA_MMC_GENERIC
 #defineCONFIG_SYS_MMC_BASE 0xF000
 #defineCONFIG_CMD_FAT
 #define CONFIG_CMD_EXT2
-- 
1.7.8.4

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


Re: [U-Boot] [PATCH v2 2/8] sandbox: config: Enable fdt and snprintf() options

2012-01-24 Thread Mike Frysinger
On Monday 23 January 2012 00:30:32 Simon Glass wrote:
 On Fri, Jan 20, 2012 at 10:54 AM, Mike Frysinger wrote:
  On Tuesday 10 January 2012 19:45:46 Simon Glass wrote:
  +#define CONFIG_LMB
  
  do we need this ?
 
 Without it I think bootm fails to build with FDT enabled.

looks like CONFIG_OF_LIBFDT hard depends on CONFIG_LMB, and a lot of lmb stuff 
leaks when it isn't defined.  i think i'll send a patch to tighten up the lmb.h 
header when that define isn't available.
-mike


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


Re: [U-Boot] [PATCH v2 3/8] sandbox: gpio: Add basic driver for simulating GPIOs

2012-01-24 Thread Mike Frysinger
On Monday 23 January 2012 01:20:16 Simon Glass wrote:
 On Fri, Jan 20, 2012 at 10:59 AM, Mike Frysinger wrote:
  On Tuesday 10 January 2012 19:45:47 Simon Glass wrote:
  --- /dev/null
  +++ b/arch/sandbox/include/asm/gpio.h
  
  +int sandbox_gpio_get_value(int gp);
  
  why bother with parallel sandbox gpio API ?  why can't we just implement
  the gpio API directly and throw away sandbox_gpio_xxx ?  then we can
  also stub out sandbox/include/asm/gpio.h ...
 
 Because the current state of the GPIOs needs to be stored somewhere.
 Test code which wants a GPIO to appear to be high to U-Boot can call
 sandbox_gpio_set_value() and that value will be recorded and provided
 to future gpio_get_value() calls.
 
 Without this virtualisation, the driver would have no purpose.

i'm not seeing it.  why does external code need to reach into the guts at all 
when we have a gpio API for them to use ?

  also, missing gpio_status() define to gpio_info()
 
 I see gpio_info() there at the bottom - gpio_status() is optional I
 think. Do we need to bring this in?

gpio_info is pointless without gpio_status.  honestly, i don't even know why 
that symbol exists at all ... the public API is gpio_status().  might as well 
just call it that.

  +/* read GPIO IN value of port 'gp' */
  +int gpio_get_value(int gp)
  ...
  + if (get_gpio_flag(gp, GPIOF_OUTPUT))
  ...
  +int gpio_set_value(int gp, int value)
  ...
  + if (get_gpio_flag(gp, GPIOF_OUTPUT)) {
  
  drop valid gpio checking in these funcs ... only the request func should
  do this
 
 What if someone passes in garbage value? Don't we want to catch this?

normally, no.  in the sandbox world, i guess we do, but there should be 
verbose dump messages ... perhaps an assert() ?
-mike


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


Re: [U-Boot] [PATCH v2 8/8] sandbox: Add basic command line parsing

2012-01-24 Thread Mike Frysinger
On Monday 23 January 2012 01:30:52 Simon Glass wrote:
 On Fri, Jan 20, 2012 at 11:05 AM, Mike Frysinger wrote:
  i'm not sure how useful -c is since we can already do:
   ./u-boot some command
  
  each to their own i guess ...
 
 I had trouble getting that to work properly, ending up with a runaway
 process. Probably we don't handle EOF correctly since we just loop
 forever.

yes, it does do that by (current) design :)

 I do think this argument is useful and it (and help) provide a
 reasonable excuse for a command line parser.

np
-mike


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


Re: [U-Boot] [PATCH v3 7/8] sandbox: Add flags for open() call

2012-01-24 Thread Mike Frysinger
On Monday 23 January 2012 01:48:52 Simon Glass wrote:
 This provides a way for callers to create files for writing. We define
 flags which mirror the POSIX values.

there are no POSIX values, just names.  the way the defines get interpreted is 
left up to implementations.

 @@ -19,11 +24,7 @@
   * MA 02111-1307 USA
   */
 
 -/*
 - * Operating System Interface
 - *
 - * This provides access to useful OS routines from the sandbox
 architecture - */
 +struct sandbox_state;

looks like unrelated stuff got squished into here

 +#define OS_O_RDONLY  0
 +#define OS_O_WRONLY  1
 +#define  OS_O_RDWR   2
 +#define OS_O_CREAT   0100

seems to be whitespace mismatch between #define and the actual define.  some 
use tabs and some spaces ?
-mike


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


Re: [U-Boot] [PATCH] ARM: tegra: Define Tegra20 CAR binding

2012-01-24 Thread Stephen Warren
Peter De Schrijver wrote at Tuesday, January 24, 2012 2:53 AM:
 What about the peripheral resets which are also handled by CAR? Peripheral
 clock nodes also offer assert and deassert methods for the reset signal
 associated with them. Those methods are used when powergating domains for
 example. Should we model this in the same binding?

In most cases, I think the resets are handled purely within clock enable
and disable, so there's no need to explicitly manage them or represent
them in the device tree. Do you agree here?

I recall that you mentioned some power-management code might need to
manage reset separately though. Can you explain why a module would be
reset separately from disabling the clocks though?

If we do need this, I think we can just add a property to the node of
each device that needs such explicit management. Something like:

tegra_car: clock@60006000 {
compatible = nvidia,tegra20-car;

};

foo@70007000 {
compatible = nvidia,tegra20-foo;
regs = ...;
nvidia,car-reset-id = tegra_car 30;
};

And the driver for foo can ignore cell 0, and extract the cell 1 and
pass the value to tegra_periph_reset_assert().

I'd expect to put the CAR phandle into the property in case we ever get
a more generalized reset subsystem, and need more general code to
interpret the property. I did the same for the Tegra APB DMA controller
client binding where clients need to know the DMA select value.

Does that all seem reasonable?

-- 
nvpublic

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


Re: [U-Boot] [PATCH] ARM: tegra: Define Tegra20 CAR binding

2012-01-24 Thread Colin Cross
On Tue, Jan 24, 2012 at 2:08 PM, Stephen Warren swar...@nvidia.com wrote:
 Peter De Schrijver wrote at Tuesday, January 24, 2012 2:53 AM:
 What about the peripheral resets which are also handled by CAR? Peripheral
 clock nodes also offer assert and deassert methods for the reset signal
 associated with them. Those methods are used when powergating domains for
 example. Should we model this in the same binding?

 In most cases, I think the resets are handled purely within clock enable
 and disable, so there's no need to explicitly manage them or represent
 them in the device tree. Do you agree here?

clk_enable could force a deasserted reset, but clk_disable cannot
imply asserting reset.  The clocks need to be turned off for power
management without resetting the registers.

 I recall that you mentioned some power-management code might need to
 manage reset separately though. Can you explain why a module would be
 reset separately from disabling the clocks though?

The TRM lists a very specific sequence of clocks, resets, clamps, and
power for power domain gating.  Other than that, I think the only use
for directly calling reset that ended up in the Android Tegra2 tree
was for error recovery on HW blocks that could get locked up, probably
I2C.

 If we do need this, I think we can just add a property to the node of
 each device that needs such explicit management. Something like:

 tegra_car: clock@60006000 {
    compatible = nvidia,tegra20-car;
    
 };

 foo@70007000 {
    compatible = nvidia,tegra20-foo;
    regs = ...;
    nvidia,car-reset-id = tegra_car 30;
 };

 And the driver for foo can ignore cell 0, and extract the cell 1 and
 pass the value to tegra_periph_reset_assert().

 I'd expect to put the CAR phandle into the property in case we ever get
 a more generalized reset subsystem, and need more general code to
 interpret the property. I did the same for the Tegra APB DMA controller
 client binding where clients need to know the DMA select value.

 Does that all seem reasonable?

 --
 nvpublic

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


Re: [U-Boot] [PATCH] ARM: tegra: Define Tegra20 CAR binding

2012-01-24 Thread Stephen Warren
Colin Cross wrote at Tuesday, January 24, 2012 3:33 PM:
 On Tue, Jan 24, 2012 at 2:08 PM, Stephen Warren swar...@nvidia.com wrote:
  Peter De Schrijver wrote at Tuesday, January 24, 2012 2:53 AM:
  What about the peripheral resets which are also handled by CAR? Peripheral
  clock nodes also offer assert and deassert methods for the reset signal
  associated with them. Those methods are used when powergating domains for
  example. Should we model this in the same binding?
 
  In most cases, I think the resets are handled purely within clock enable
  and disable, so there's no need to explicitly manage them or represent
  them in the device tree. Do you agree here?
 
 clk_enable could force a deasserted reset, but clk_disable cannot
 imply asserting reset.  The clocks need to be turned off for power
 management without resetting the registers.

Yes, I just spoke to someone off-list, and he said the same thing. He
went on to say that therefore even the reset removal with clk_enable
was questionable, and that drivers should explicitly manage reset
removal themselves. Does that seem a reasonable stance? It'd certainly
take away the somewhat asymmetric nature of reset removal just magically
working when you first enable the clocks. We'd presumably then want a
common reset infra-structure and binding to match that change?

(I know that'd make Simon happy, since then we'd be able to represent
the reset IDs directly everywhere, unrelated to the clock IDs, and
hence he could just use the reset IDs directly in the U-Boot code he's
writing and ignore the non 1:1 mapping between clock and reset IDs)

  I recall that you mentioned some power-management code might need to
  manage reset separately though. Can you explain why a module would be
  reset separately from disabling the clocks though?
 
 The TRM lists a very specific sequence of clocks, resets, clamps, and
 power for power domain gating.  Other than that, I think the only use
 for directly calling reset that ended up in the Android Tegra2 tree
 was for error recovery on HW blocks that could get locked up, probably
 I2C.

OK, those reasons make sense.

-- 
nvpublic

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


Re: [U-Boot] [PATCH v3 5/8] sandbox: Add concept of sandbox state

2012-01-24 Thread Mike Frysinger
On Monday 23 January 2012 01:48:50 Simon Glass wrote:
 --- a/arch/sandbox/cpu/start.c
 +++ b/arch/sandbox/cpu/start.c
 
  int main(int argc, char *argv[])
  {
 + struct sandbox_state *state = NULL;
 + int err;
 +
 + err = state_init();
 + if (!err) {
 + state = state_get_current();
 + assert(state);
 + }

i guess a lot of this checking/plumbing only makes sense in the context of 
future work where the state represents a lot more stuff

 --- /dev/null
 +++ b/arch/sandbox/cpu/state.c

 +struct sandbox_state main_state;
 +struct sandbox_state *state; /* Pointer to current state record */

static

 +int state_is_processor_reset(void)
 +{
 + return 1;
 +}

if the cpu is in reset, then u-boot is dead ...

 +struct sandbox_state *state_get_current(void)
 +{
 + assert(state);
 + return state;
 +}

you assert() here and in main() ... i think we can get rid of the one in the 
main() func

 --- /dev/null
 +++ b/arch/sandbox/include/asm/arch-sandbox/state.h

needs ifdef protection against multiple inclusion

 +/* The complete state of the test system */
 +struct sandbox_state {
 + const char *cmd;/* Command to execute */
 + enum exit_type_id exit_type;/* How we exited U-Boot */
 +};

the argc/argv given to main() should be in here
-mike


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


Re: [U-Boot] [PATCH v2 3/8] sandbox: gpio: Add basic driver for simulating GPIOs

2012-01-24 Thread Mike Frysinger
On Tuesday 24 January 2012 16:35:00 Mike Frysinger wrote:
 On Monday 23 January 2012 01:20:16 Simon Glass wrote:
  On Fri, Jan 20, 2012 at 10:59 AM, Mike Frysinger wrote:
   On Tuesday 10 January 2012 19:45:47 Simon Glass wrote:
   --- /dev/null
   +++ b/arch/sandbox/include/asm/gpio.h
   
   +int sandbox_gpio_get_value(int gp);
   
   why bother with parallel sandbox gpio API ?  why can't we just
   implement the gpio API directly and throw away sandbox_gpio_xxx ? 
   then we can also stub out sandbox/include/asm/gpio.h ...
  
  Because the current state of the GPIOs needs to be stored somewhere.
  Test code which wants a GPIO to appear to be high to U-Boot can call
  sandbox_gpio_set_value() and that value will be recorded and provided
  to future gpio_get_value() calls.
  
  Without this virtualisation, the driver would have no purpose.
 
 i'm not seeing it.  why does external code need to reach into the guts at
 all when we have a gpio API for them to use ?

ok, you clarified it for me, so now we just need some comments in asm/gpio.h 
explaining the expected users of the internal API
-mike


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


Re: [U-Boot] [PATCH v4 0/20] tegra: Add fdt definitions and USB driver

2012-01-24 Thread Simon Glass
Hi,

On Wed, Jan 11, 2012 at 8:32 PM, Simon Glass s...@chromium.org wrote:
 This series brings in the Linux kernel fdt file and provides a working
 USB driver for Tegra2 Seaboard.

 (I have done this in one series since otherwise most of the fdt additions
 will just look like dead code.)

 The driver requires CONFIG_OF_CONTROL and a device tree to operate.

 Some enhancements to fdtdec are required to make this easier, and these
 are included in the series also. I have had to bring in basic GPIO
 support due to the request to put the USB VBUS into the fdt.

 Since the kernel recently got a very minimal USB binding, I have started
 with that and extended it where appropriate.

 Tegra likes to have cache-aligned buffers. I have dropped the patch which
 implements this since we will solve this problem by making callers align
 their buffers (as we did with MMC).

 Changes in v2:
 - Use okay instead of ok for fdt node status
 - Remove 0x from fdt aliases
 - Rename params to timing
 - Store entire fdt config in port list, not just register pointer
 - Remove non-fdt operation of USB, since it is not needed
 - Decode USB VBUS GPIO from the fdt
 - Decode phy type differently (to match new kernel fdt)
 - Rename tegra20-usb to tegra20-ehcui (to match new kernel fdt)
 - Improve debug() printouts in case of failure to init USB
 - Add setting of pinmux for USB VBUS GPIO
 - Remove unneeded CONFIG_TEGRA_USBx defines

 Changes in v3:
 - Remove okay from nodes since this is the default anyway
 - Fix device tree indenting with tabs instead of spaces
 - Disable USB2 which is not used on Seaboard
 - Remove usbparams properties from fdt and moved them to C code
 - Drop Tegra USB alignment patch as we will deal with this another way

 Changes in v4:
 - Add staging area for device tree bindings used in U-Boot
 - Add clock bindings for Tegra2x
 - Add fdtdec function to return peripheral ID
 - Use updated fdtdec alias functiona to get USB aliases
 - Use peripheral clock node to obtain peripheral ID

There are quite a number of comments for v5 due to the fdt binding
changes. So I am sending the entire series again to avoid confusion.
It is now down to only 18 patches though, so some light showing
through.

Regards,
Simon


 Simon Glass (20):
  fdt: Tidy up a few fdtdec problems
  fdt: Add functions to access phandles, arrays and bools
  fdt: Add basic support for decoding GPIO definitions
  arm: fdt: Ensure that an embedded fdt is word-aligned
  arm: fdt: Add skeleton device tree file from kernel
  tegra: fdt: Add Tegra2x device tree file from kernel
  tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel
  fdt: Add staging area for device tree binding documentation
  fdt: Add tegra-usb bindings file from linux
  tegra: fdt: Add additional USB binding
  tegra: fdt: Add clock bindings
  tegra: usb: fdt: Add additional device tree definitions for USB ports
  tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard
  usb: Add support for txfifo threshold
  fdt: Add function to return peripheral/clock ID
  tegra: usb: Add support for Tegra USB peripheral
  tegra: usb: Add USB support to nvidia boards
  tegra: usb: Add common USB defines for tegra2 boards
  tegra: usb: Enable USB on Seaboard
  tegra: fdt: Enable FDT support for Seaboard

  README                                         |    3 +
  arch/arm/cpu/armv7/tegra2/Makefile             |    4 +-
  arch/arm/cpu/armv7/tegra2/config.mk            |    2 +
  arch/arm/cpu/armv7/tegra2/usb.c                |  426 
 
  arch/arm/cpu/armv7/u-boot.lds                  |    5 +
  arch/arm/dts/skeleton.dtsi                     |   13 +
  arch/arm/dts/tegra20.dtsi                      |  199 +++
  arch/arm/include/asm/arch-tegra2/tegra2.h      |    2 +
  arch/arm/include/asm/arch-tegra2/usb.h         |  255 ++
  board/nvidia/common/board.c                    |    8 +
  board/nvidia/dts/tegra2-seaboard.dts           |   47 +++
  doc/device-tree-bindings/README                |   19 +
  doc/device-tree-bindings/clock/tegra-periphclk |   51 +++
  doc/device-tree-bindings/usb/tegra-usb.txt     |   17 +
  drivers/usb/host/Makefile                      |    1 +
  drivers/usb/host/ehci-hcd.c                    |    7 +
  drivers/usb/host/ehci-tegra.c                  |   63 
  drivers/usb/host/ehci.h                        |    6 +-
  dts/Makefile                                   |    2 +-
  include/configs/seaboard.h                     |   12 +
  include/configs/tegra2-common.h                |   14 +
  include/fdtdec.h                               |  121 +++-
  lib/fdtdec.c                                   |  181 ++-
  23 files changed, 1445 insertions(+), 13 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/tegra2/usb.c
  create mode 100644 arch/arm/dts/skeleton.dtsi
  create mode 100644 arch/arm/dts/tegra20.dtsi
  create mode 100644 arch/arm/include/asm/arch-tegra2/usb.h
  create mode 100644 

Re: [U-Boot] [PATCH v4 03/20] fdt: Add basic support for decoding GPIO definitions

2012-01-24 Thread Simon Glass
Hi Stephen,

On Mon, Jan 23, 2012 at 10:18 AM, Stephen Warren swar...@nvidia.com wrote:
 On 01/21/2012 10:08 AM, Simon Glass wrote:
 Hi Stephen,

 On Wed, Jan 18, 2012 at 2:17 PM, Stephen Warren swar...@nvidia.com wrote:
 On 01/11/2012 09:32 PM, Simon Glass wrote:
 This adds some support into fdtdec for reading GPIO definitions from
 the fdt. ...
 ...
 diff --git a/include/fdtdec.h b/include/fdtdec.h
 ...
 +/* GPIOs are numbered from 0 */
 +enum {
 +     FDT_GPIO_NONE = -1U,    /* an invalid GPIO used to end our list */

 Is this due to the way U-Boot works right now, or something defined by
 this patch? It's been pointed out that the kernel's choice to use -1 as
 invalid GPIO rather than 0 was a mistake, since that prevents GPIO
 fields being easily added to platform data structures, since you then
 have to go and initialize every new instance to -1, rather than relying
 on BSS initializing it to 0. I assume this is just the way U-Boot works,
 so solving this is outside the scope of this patch.

 It is nothing to do with U-Boot itself - we can choose any number.

 Surely the value you choose for DT parsing has to align with the value
 that U-Boot's GPIO API chooses, so you can't just choose any number.

No, in the fdt we just leave out the gpio if it is not required. The
FDT_GPIO_NONE is purely internal to U-Boot.


 What is Linux using now / planning to use?

 Linux uses -1 right now, but should really have used 0. I don't think
 there's an actual plan to change this now, since the numbering scheme is
 entrenched.

 What Linux does isn't relevant; the numbering scheme I'm talking about
 is the internal numbering scheme within U-Boot or Linux, which are
 independent from each-other and the values in the device tree.

 So that said, I was wondering if U-Boot's GPIO support (covering both
 non-DT and DT cases) was new enough that it could use 0 to represent
 invalid GPIO rather than -1, and hence FDT_GPIO_NONE be 0 not -1. It
 probably isn't though; I guess U-Boot's GPIO numbering scheme is also
 already entrenched?

Yes it starts at zero. I'm not sure how to even begin such a
discussion on the list :-)

Regards,
Simon


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


Re: [U-Boot] [PATCH v4 03/20] fdt: Add basic support for decoding GPIO definitions

2012-01-24 Thread Stephen Warren
Simon Glass wrote at Tuesday, January 24, 2012 4:12 PM:
 On Mon, Jan 23, 2012 at 10:18 AM, Stephen Warren swar...@nvidia.com wrote:
  On 01/21/2012 10:08 AM, Simon Glass wrote:
  Hi Stephen,
 
  On Wed, Jan 18, 2012 at 2:17 PM, Stephen Warren swar...@nvidia.com wrote:
  On 01/11/2012 09:32 PM, Simon Glass wrote:
  This adds some support into fdtdec for reading GPIO definitions from
  the fdt. ...
  ...
  diff --git a/include/fdtdec.h b/include/fdtdec.h
  ...
  +/* GPIOs are numbered from 0 */
  +enum {
  +     FDT_GPIO_NONE = -1U,    /* an invalid GPIO used to end our list */
 
  Is this due to the way U-Boot works right now, or something defined by
  this patch? It's been pointed out that the kernel's choice to use -1 as
  invalid GPIO rather than 0 was a mistake, since that prevents GPIO
  fields being easily added to platform data structures, since you then
  have to go and initialize every new instance to -1, rather than relying
  on BSS initializing it to 0. I assume this is just the way U-Boot works,
  so solving this is outside the scope of this patch.
 
  It is nothing to do with U-Boot itself - we can choose any number.
 
  Surely the value you choose for DT parsing has to align with the value
  that U-Boot's GPIO API chooses, so you can't just choose any number.
 
 No, in the fdt we just leave out the gpio if it is not required. The
 FDT_GPIO_NONE is purely internal to U-Boot.

That's consistent with what I said; I'm talking about the value that a
missing DT property translates into within U-Boot.

-- 
nvpublic

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


Re: [U-Boot] [PATCH v4 03/20] fdt: Add basic support for decoding GPIO definitions

2012-01-24 Thread Simon Glass
Hi Stephen,

On Tue, Jan 24, 2012 at 3:14 PM, Stephen Warren swar...@nvidia.com wrote:
 Simon Glass wrote at Tuesday, January 24, 2012 4:12 PM:
 On Mon, Jan 23, 2012 at 10:18 AM, Stephen Warren swar...@nvidia.com wrote:
  On 01/21/2012 10:08 AM, Simon Glass wrote:
  Hi Stephen,
 
  On Wed, Jan 18, 2012 at 2:17 PM, Stephen Warren swar...@nvidia.com 
  wrote:
  On 01/11/2012 09:32 PM, Simon Glass wrote:
  This adds some support into fdtdec for reading GPIO definitions from
  the fdt. ...
  ...
  diff --git a/include/fdtdec.h b/include/fdtdec.h
  ...
  +/* GPIOs are numbered from 0 */
  +enum {
  +     FDT_GPIO_NONE = -1U,    /* an invalid GPIO used to end our list */
 
  Is this due to the way U-Boot works right now, or something defined by
  this patch? It's been pointed out that the kernel's choice to use -1 as
  invalid GPIO rather than 0 was a mistake, since that prevents GPIO
  fields being easily added to platform data structures, since you then
  have to go and initialize every new instance to -1, rather than relying
  on BSS initializing it to 0. I assume this is just the way U-Boot works,
  so solving this is outside the scope of this patch.
 
  It is nothing to do with U-Boot itself - we can choose any number.
 
  Surely the value you choose for DT parsing has to align with the value
  that U-Boot's GPIO API chooses, so you can't just choose any number.

 No, in the fdt we just leave out the gpio if it is not required. The
 FDT_GPIO_NONE is purely internal to U-Boot.

 That's consistent with what I said; I'm talking about the value that a
 missing DT property translates into within U-Boot.

OK I see. I'm not proposing to change U-Boot convention now (if in
fact it has one). At least FDT_GPIO_NONE is a constant that people
need to check against (but they should use fdt_gpio_isvalid()
instead). We can adjust this in the future if U-Boot people want to.

Regards,
Simon

 --
 nvpublic

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


[U-Boot] [PATCH v5 03/18] arm: fdt: Add skeleton device tree file from kernel

2012-01-24 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/dts/skeleton.dtsi |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/skeleton.dtsi

diff --git a/arch/arm/dts/skeleton.dtsi b/arch/arm/dts/skeleton.dtsi
new file mode 100644
index 000..b41d241
--- /dev/null
+++ b/arch/arm/dts/skeleton.dtsi
@@ -0,0 +1,13 @@
+/*
+ * Skeleton device tree; the bare minimum needed to boot; just include and
+ * add a compatible value.  The bootloader will typically populate the memory
+ * node.
+ */
+
+/ {
+   #address-cells = 1;
+   #size-cells = 1;
+   chosen { };
+   aliases { };
+   memory { device_type = memory; reg = 0 0; };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 12/18] usb: Add support for txfifo threshold

2012-01-24 Thread Simon Glass
CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning
field in the EHCI controller on reset.

Signed-off-by: Simon Glass s...@chromium.org
Acked-by: Remy Bohmer li...@bohmer.net
---

 README  |3 +++
 drivers/usb/host/ehci-hcd.c |7 +++
 drivers/usb/host/ehci.h |6 +-
 3 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/README b/README
index 9d713e8..7adf7c7 100644
--- a/README
+++ b/README
@@ -1135,6 +1135,9 @@ The following options need to be configured:
May be defined to allow interrupt polling
instead of using asynchronous interrupts
 
+   CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
+   txfilltuning field in the EHCI controller on reset.
+
 - USB Device:
Define the below if you wish to use the USB console.
Once firmware is rebuilt from a serial console issue the
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 3f7bc2c..d893b2a 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -259,6 +259,13 @@ static int ehci_reset(void)
 #endif
ehci_writel(reg_ptr, tmp);
}
+
+#ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
+   cmd = ehci_readl(hcor-or_txfilltuning);
+   cmd = ~TXFIFO_THRESH(0x3f);
+   cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
+   ehci_writel(hcor-or_txfilltuning, cmd);
+#endif
 out:
return ret;
 }
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
index 3d0ad0c..cc00ce4 100644
--- a/drivers/usb/host/ehci.h
+++ b/drivers/usb/host/ehci.h
@@ -80,7 +80,11 @@ struct ehci_hcor {
uint32_t or_ctrldssegment;
uint32_t or_periodiclistbase;
uint32_t or_asynclistaddr;
-   uint32_t _reserved_[9];
+   uint32_t _reserved_0_;
+   uint32_t or_burstsize;
+   uint32_t or_txfilltuning;
+#define TXFIFO_THRESH(p)   ((p  0x3f)  16)
+   uint32_t _reserved_1_[6];
uint32_t or_configflag;
 #define FLAG_CF(1  0)/* true:  we'll support high 
speed */
uint32_t or_portsc[CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS];
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 05/18] tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel

2012-01-24 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

Signed-off-by: Simon Glass s...@chromium.org
---

 board/nvidia/dts/tegra2-seaboard.dts |   36 ++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 board/nvidia/dts/tegra2-seaboard.dts

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
new file mode 100644
index 000..dde5d03
--- /dev/null
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -0,0 +1,36 @@
+/dts-v1/;
+
+/memreserve/ 0x1c00 0x0400;
+/include/ ARCH_CPU_DTS
+
+/ {
+   model = NVIDIA Seaboard;
+   compatible = nvidia,seaboard, nvidia,tegra20;
+
+   chosen {
+   bootargs = vmalloc=192M video=tegrafb console=ttyS0,115200n8 
root=/dev/mmcblk1p3 rw rootwait;
+   };
+
+   memory {
+   device_type = memory;
+   reg =  0x 0x4000 ;
+   };
+
+   serial@70006300 {
+   clock-frequency =  21600 ;
+   };
+
+   sdhci@c8000400 {
+   cd-gpios = gpio 69 0; /* gpio PI5 */
+   wp-gpios = gpio 57 0; /* gpio PH1 */
+   power-gpios = gpio 70 0; /* gpio PI6 */
+   };
+
+   sdhci@c8000600 {
+   support-8bit;
+   };
+
+   usb@c500 {
+   nvidia,vbus-gpio = gpio 24 0; /* PD0 */
+   };
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 01/18] fdt: Add basic support for decoding GPIO definitions

2012-01-24 Thread Simon Glass
This adds some support into fdtdec for reading GPIO definitions from
the fdt. We permit up to FDT_GPIO_MAX GPIOs in the system. Each GPIO
is of the form:

gpio-function-name = phandle gpio_num flags;

where:

phandle is a pointer to the GPIO node
gpio_num is the number of the GPIO (0 to 223)
flags is a flag, as follows:

   bitmeaning
   0  0=polarity normal, 1=active low (inverted)

An example is:

enable-propounder-gpios = gpio 43 0;

which means that GPIO 43 is used to enable the propounder (setting the
GPIO high), or that you can detect that the propounder is enabled by
checking if the GPIO is high (the fdt does not indicate input/output).

Two main functions are provided:

fdtdec_decode_gpio() reads a GPIO property from an fdt node and decodes it
into a structure.

fdtdec_setup_gpio() sets up the GPIO by calling gpio_request for you.

Both functions can cope with the property being missing, which is taken to
mean that that GPIO function is not available or is not needed.

[For reference, from Stephen Warren swar...@nvidia.com. It may be that
we add this extra complexity later if needed:

The correct way to parse such a GPIO property in general is:

* Read the first cell.
* Find the node referenced by the phandle (the controller).
* Ensure property gpio-controller is present in the controller node.
* Read property #gpio-cells from the controller node.
* Extract #gpio-cells from the original property.
* Keep processing more cells from the original property; there may be
multiple GPIOs listed.

According to the binding documentation in the Linux kernel, Samsung
Exynos4 doesn't use this format, and while all other chips do have a
flags cell, about 50% of the controllers indicate the cell is unused.
]

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v5:
- Fixed endian bug in fdtdec_decode_gpios()
- Make sure GPIO name is NULL if incorrectly decoded

 include/fdtdec.h |   45 ++
 lib/fdtdec.c |   79 ++
 2 files changed, 124 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 047f603..6c0a2d1 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -61,6 +61,23 @@ enum fdt_compat_id {
COMPAT_COUNT,
 };
 
+/* GPIOs are numbered from 0 */
+enum {
+   FDT_GPIO_NONE = -1U,/* an invalid GPIO used to end our list */
+
+   FDT_GPIO_ACTIVE_LOW = 1  0,   /* input is active low (else high) */
+};
+
+/* This is the state of a GPIO pin as defined by the fdt */
+struct fdt_gpio_state {
+   const char *name;   /* name of the fdt property defining this */
+   uint gpio;  /* GPIO number, or FDT_GPIO_NONE if none */
+   u8 flags;   /* FDT_GPIO_... flags */
+};
+
+/* This tells us whether a fdt_gpio_state record is valid or not */
+#define fdt_gpio_isvalid(x) ((x)-gpio != FDT_GPIO_NONE)
+
 /**
  * Find the next numbered alias for a peripheral. This is used to enumerate
  * all the peripherals of a certain type.
@@ -227,3 +244,31 @@ int fdtdec_get_int_array(const void *blob, int node, const 
char *prop_name,
  * @return 1 if the properly is present; 0 if it isn't present
  */
 int fdtdec_get_bool(const void *blob, int node, const char *prop_name);
+
+/**
+ * Decode a single GPIOs from an FDT.
+ *
+ * If the property is not found, then the GPIO structure will still be
+ * initialised, with gpio set to FDT_GPIO_NONE. This makes it easy to
+ * provide optional GPIOs.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_nameNode property name
+ * @param gpio gpio elements to fill from FDT
+ * @return 0 if ok, -FDT_ERR_NOTFOUND if the property is missing.
+ */
+int fdtdec_decode_gpio(const void *blob, int node, const char *prop_name,
+   struct fdt_gpio_state *gpio);
+
+/**
+ * Set up a GPIO pin according to the provided gpio information. At present 
this
+ * just requests the GPIO.
+ *
+ * If the gpio is FDT_GPIO_NONE, no action is taken. This makes it easy to
+ * deal with optional GPIOs.
+ *
+ * @param gpio GPIO info to use for set up
+ * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
+ */
+int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 977528b..c748cac 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -24,6 +24,9 @@
 #include libfdt.h
 #include fdtdec.h
 
+/* we need the generic GPIO interface here */
+#include asm-generic/gpio.h
+
 DECLARE_GLOBAL_DATA_PTR;
 
 /*
@@ -336,3 +339,79 @@ int fdtdec_get_bool(const void *blob, int node, const char 
*prop_name)
cell = fdt_getprop(blob, node, prop_name, len);
return cell != NULL;
 }
+
+/**
+ * Decode a list of GPIOs from an FDT. This creates a list of GPIOs with no
+ * terminating item.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @param prop_nameNode property name
+ * @param gpio 

[U-Boot] [PATCH v5 08/18] tegra: fdt: Add additional USB binding

2012-01-24 Thread Simon Glass
This adds a property to indicate a port which can switch between host and device
mode.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v5:
- Add dr_mode property to control host/device/otg mode
- Add nvidia,has-legacy-mode property per review comments

 doc/device-tree-bindings/usb/tegra-usb.txt |   12 
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt 
b/doc/device-tree-bindings/usb/tegra-usb.txt
index 035d63d..b7174a3 100644
--- a/doc/device-tree-bindings/usb/tegra-usb.txt
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -11,3 +11,15 @@ Required properties :
  - phy_type : Should be one of ulpi or utmi.
  - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
activated for the bus to be powered.
+
+Optional properties:
+  - dr_mode : dual role mode. Indicates the working mode for
+   nvidia,tegra20-ehci compatible controllers.  Can be host, peripheral,
+   or otg.  Default to host if not defined for backward compatibility.
+  host means this is a host controller
+  peripheral means it is device controller
+  otg means it can operate as either (on the go)
+  - nvidia,has-legacy-mode : boolean indicates whether this controller can
+operate in legacy mode (as APX 2500 / 2600). In legacy mode some
+registers are accessed through the APB_MISC base address instead of
+the USB controller.
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 02/18] arm: fdt: Ensure that an embedded fdt is word-aligned

2012-01-24 Thread Simon Glass
By putting the fdt blob into a distinctive area we can ensure that it appears
at the start of the data section and is word-aligned.

Note: It does not seem to be possible to get objcopy to honour its
--section-alignment flag, which would otherwise provide an easier fix
for this problem.

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/u-boot.lds |5 +
 dts/Makefile  |2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds
index 40ecf78..793e51b 100644
--- a/arch/arm/cpu/armv7/u-boot.lds
+++ b/arch/arm/cpu/armv7/u-boot.lds
@@ -43,6 +43,11 @@ SECTIONS
 
. = ALIGN(4);
.data : {
+   /*
+* Sadly objcopy seems to ignore --section-alignment.
+* Put any embedded device tree first so it is aligned.
+*/
+   *(.dts.data)
*(.data)
}
 
diff --git a/dts/Makefile b/dts/Makefile
index 5792afd..83547d4 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -79,7 +79,7 @@ $(obj)dt.o: $(DT_BIN)
\
cd $(dir ${DT_BIN})  \
$(OBJCOPY) -I binary -O $${oformat} -B $${oarch} \
-   $(notdir ${DT_BIN}) $@
+   --prefix-sections=.dts $(notdir ${DT_BIN}) $@
rm $(DT_BIN)
 
 OBJS-$(CONFIG_OF_EMBED):= dt.o
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 04/18] tegra: fdt: Add Tegra2x device tree file from kernel

2012-01-24 Thread Simon Glass
This was taken from commit b48c54e2 at:
git://git.kernel.org/pub/scm/linux/kernel/git/olof/tegra.git

config.mk is updated to provide this file to boards through the
built-in mechanism:

/include/ ARCH_CPU_DTS

Signed-off-by: Simon Glass s...@chromium.org
---

 arch/arm/cpu/armv7/tegra2/config.mk |2 +
 arch/arm/dts/tegra20.dtsi   |  168 +++
 2 files changed, 170 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/dts/tegra20.dtsi

diff --git a/arch/arm/cpu/armv7/tegra2/config.mk 
b/arch/arm/cpu/armv7/tegra2/config.mk
index 2303dba..fe9ef5b 100644
--- a/arch/arm/cpu/armv7/tegra2/config.mk
+++ b/arch/arm/cpu/armv7/tegra2/config.mk
@@ -31,3 +31,5 @@ CFLAGS_arch/arm/lib/board.o += -march=armv4t
 endif
 
 USE_PRIVATE_LIBGCC = yes
+
+CONFIG_ARCH_DEVICE_TREE := tegra20
diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
new file mode 100644
index 000..a9a98ea
--- /dev/null
+++ b/arch/arm/dts/tegra20.dtsi
@@ -0,0 +1,168 @@
+/include/ skeleton.dtsi
+
+/ {
+   compatible = nvidia,tegra20;
+   interrupt-parent = intc;
+
+   intc: interrupt-controller@50041000 {
+   compatible = nvidia,tegra20-gic;
+   interrupt-controller;
+   #interrupt-cells = 1;
+   reg =  0x50041000 0x1000 ,
+  0x50040100 0x0100 ;
+   };
+
+   i2c@7000c000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2c;
+   reg = 0x7000C000 0x100;
+   interrupts =  70 ;
+   };
+
+   i2c@7000c400 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2c;
+   reg = 0x7000C400 0x100;
+   interrupts =  116 ;
+   };
+
+   i2c@7000c500 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2c;
+   reg = 0x7000C500 0x100;
+   interrupts =  124 ;
+   };
+
+   i2c@7000d000 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2c;
+   reg = 0x7000D000 0x200;
+   interrupts =  85 ;
+   };
+
+   i2s@70002800 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2s;
+   reg = 0x70002800 0x200;
+   interrupts =  45 ;
+   dma-channel =  2 ;
+   };
+
+   i2s@70002a00 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-i2s;
+   reg = 0x70002a00 0x200;
+   interrupts =  35 ;
+   dma-channel =  1 ;
+   };
+
+   das@7c00 {
+   #address-cells = 1;
+   #size-cells = 0;
+   compatible = nvidia,tegra20-das;
+   reg = 0x7c00 0x80;
+   };
+
+   gpio: gpio@6000d000 {
+   compatible = nvidia,tegra20-gpio;
+   reg =  0x6000d000 0x1000 ;
+   interrupts =  64 65 66 67 87 119 121 ;
+   #gpio-cells = 2;
+   gpio-controller;
+   };
+
+   pinmux: pinmux@7000 {
+   compatible = nvidia,tegra20-pinmux;
+   reg =  0x7014 0x10/* Tri-state registers */
+   0x7080 0x20/* Mux registers */
+   0x70a0 0x14/* Pull-up/down registers */
+   0x7868 0xa8 ; /* Pad control registers */
+   };
+
+   serial@70006000 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006000 0x40;
+   reg-shift = 2;
+   interrupts =  68 ;
+   };
+
+   serial@70006040 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006040 0x40;
+   reg-shift = 2;
+   interrupts =  69 ;
+   };
+
+   serial@70006200 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006200 0x100;
+   reg-shift = 2;
+   interrupts =  78 ;
+   };
+
+   serial@70006300 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006300 0x100;
+   reg-shift = 2;
+   interrupts =  122 ;
+   };
+
+   serial@70006400 {
+   compatible = nvidia,tegra20-uart;
+   reg = 0x70006400 0x100;
+   reg-shift = 2;
+   interrupts =  123 ;
+   };
+
+   sdhci@c800 {
+   compatible = nvidia,tegra20-sdhci;
+   reg = 0xc800 0x200;
+   interrupts =  46 ;
+   };
+
+   sdhci@c8000200 {
+   compatible = nvidia,tegra20-sdhci;
+   reg = 0xc8000200 0x200;
+   interrupts =  47 ;
+   };
+
+   sdhci@c8000400 {
+   compatible = 

[U-Boot] [PATCH v5 17/18] tegra: usb: Enable USB on Seaboard

2012-01-24 Thread Simon Glass
Seaboard has a top port which is USB host or device, and a side port which
is host only.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Remove unneeded CONFIG_TEGRA_USBx defines

 include/configs/seaboard.h |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index 261f952..b6d9f7a 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -72,4 +72,11 @@
 
 #define CONFIG_ENV_SECT_SIZECONFIG_ENV_SIZE
 #define CONFIG_ENV_OFFSET   (CONFIG_SPI_FLASH_SIZE - CONFIG_ENV_SECT_SIZE)
+
+/* USB Host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
 #endif /* __CONFIG_H */
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 13/18] fdt: Add function to return peripheral/clock ID

2012-01-24 Thread Simon Glass
A common requirement is to find the clock ID for a peripheral. This is the
second cell of the 'clocks' property (the first being the phandle itself).

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add fdtdec function to return peripheral ID

 include/fdtdec.h |   13 +
 lib/fdtdec.c |   13 +
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 6c0a2d1..f3115a6 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -272,3 +272,16 @@ int fdtdec_decode_gpio(const void *blob, int node, const 
char *prop_name,
  * @return 0 if all ok or gpio was FDT_GPIO_NONE; -1 on error
  */
 int fdtdec_setup_gpio(struct fdt_gpio_state *gpio);
+
+/**
+ * Decode a peripheral ID from a device tree node. This may be a temporary
+ * function depending on what happens with clocks in the Linux fdt.
+ *
+ * This works by looking up the peripheral's 'clocks' node and reading out
+ * the second cell, which is the clock number / peripheral ID.
+ *
+ * @param blob FDT blob to use
+ * @param node Node to look at
+ * @return
+ */
+int fdtdec_decode_periph_id(const void *blob, int node);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index c748cac..f999ed0 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -415,3 +415,16 @@ int fdtdec_setup_gpio(struct fdt_gpio_state *gpio)
return -1;
return 0;
 }
+
+int fdtdec_decode_periph_id(const void *blob, int node)
+{
+   u32 cell[2];
+   int err;
+
+   err = fdtdec_get_int_array(blob, node, clocks, cell,
+  ARRAY_SIZE(cell));
+   if (err)
+   return -1;
+
+   return cell[1];
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 10/18] tegra: usb: fdt: Add additional device tree definitions for USB ports

2012-01-24 Thread Simon Glass
This adds clock references to the USB part of the device tree for U-Boot.

The USB timing information may vary between boards sometimes, but for
now we hard-code it in C. This is because all current T2x boards use
the same values, we will deal with T3x later and we first need to agree
on the format for this timing information in the fdt and may in fact
decide that it has no place there.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v5:
- Add dr_mode property to control host/device/otg mode
- Add nvidia,has-legacy-mode property per review comments
- Change device tree comment style from // to /* */

 arch/arm/dts/tegra20.dtsi |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index ec75747..b2e3a40 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -176,6 +176,9 @@
reg = 0xc500 0x4000;
interrupts =  52 ;
phy_type = utmi;
+   clocks = periph_clk 22;  /* PERIPH_ID_USBD */
+   dr_mode = otg;
+   nvidia,has-legacy-mode;
};
 
usb@c5004000 {
@@ -183,6 +186,8 @@
reg = 0xc5004000 0x4000;
interrupts =  53 ;
phy_type = ulpi;
+   clocks = periph_clk 58;  /* PERIPH_ID_USB2 */
+   dr_mode = host;
};
 
usb@c5008000 {
@@ -190,6 +195,8 @@
reg = 0xc5008000 0x4000;
interrupts =  129 ;
phy_type = utmi;
+   clocks = periph_clk 59;  /* PERIPH_ID_USB3 */
+   dr_mode = otg;
};
 
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 06/18] fdt: Add staging area for device tree binding documentation

2012-01-24 Thread Simon Glass
Add a directory to hold device tree binding files, to permit easy review
of this material in U-Boot patches.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add staging area for device tree bindings used in U-Boot

Changes in v5:
- Update README to indicate that we will commit fdt documentation to U-Boot

 doc/device-tree-bindings/README |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/README

diff --git a/doc/device-tree-bindings/README b/doc/device-tree-bindings/README
new file mode 100644
index 000..2ea3439
--- /dev/null
+++ b/doc/device-tree-bindings/README
@@ -0,0 +1,17 @@
+Device Tree Bindings Staging Area
+=
+
+This directory contains device tree bindings for U-Boot.
+
+These follow along with Linux kernel bindings, with a few additions. By
+adding the files here, U-Boot patches can clearly show thees additions.
+This makes it easier for device tree people to review these additions in
+patches sent to the U-Boot mailing list.
+
+The intent IS to commit these files to U-Boot. Hopefully at some point
+the files will be stored in another repo (shared with Linux) which is
+brought in as needed. Changes here are intended to mirror changes in the
+Linux Documentation/devicetree/bindings/ directory.
+
+s...@chromium.org
+17-Jan-12
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 09/18] tegra: fdt: Add clock bindings

2012-01-24 Thread Simon Glass
This adds a basic binding for the oscillator and peripheral clocks. The
second cell is the clock number, defined as the bit number within the clock
enable register if the peripheral clock.

This uses the RFC clock bindings from Grant Likely so may change later:

https://lkml.org/lkml/2011/12/12/498

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v4:
- Add clock bindings for Tegra2x

 arch/arm/dts/tegra20.dtsi  |   27 
 doc/device-tree-bindings/clock/tegra-periphclk |   51 
 2 files changed, 78 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/clock/tegra-periphclk

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index a9a98ea..ec75747 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -4,6 +4,33 @@
compatible = nvidia,tegra20;
interrupt-parent = intc;
 
+   clocks = osc_clk;
+   clock-names = osc_clk;
+   clock-ranges;
+
+   clocks {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   /* The frequency of this clock is board-specific */
+   osc_clk: oscclk {
+   compatible = fixed-clock;
+   #clock-cells = 0;
+   };
+
+   /*
+* This node provides clocks to all peripherals. We don't
+* enumerate the clock names for now since there are no
+* users of this information.
+*/
+   periph_clk: periphclk {
+   compatible = tegra,periphclk;
+   #clock-cells = 1;
+   clocks = osc_clk;
+   reg = 0x60006000 400;
+   };
+   };
+
intc: interrupt-controller@50041000 {
compatible = nvidia,tegra20-gic;
interrupt-controller;
diff --git a/doc/device-tree-bindings/clock/tegra-periphclk 
b/doc/device-tree-bindings/clock/tegra-periphclk
new file mode 100644
index 000..8d21e4d
--- /dev/null
+++ b/doc/device-tree-bindings/clock/tegra-periphclk
@@ -0,0 +1,51 @@
+Clock controllers
+
+(there isn't yet a binding in Linux, so this describes what is in U-Boot)
+
+The device node for a clock controller is as described in the document
+Open Firmware Recommended Practice : Universal Serial Bus with the
+following modifications and additions :
+
+This is based on Grant Likely's proposed patch for clock bindings.
+
+Required properties :
+ - compatible : Should be tegra,periphclk for peripheral clock controller
+ - clocks : Should contain a single phandle pointing to the oscillator clock
+
+Peripherals which refer to a clock should have a property called clocks with
+two cells: phandle of the peripheral clock and the clock ID number (which
+is the bit number in the peripheral clock controller enable register numbered
+from 0).
+
+Example:
+
+clocks {
+   #address-cells = 1;
+   #size-cells = 1;
+
+   /* The frequency of this clock is board-specific */
+   osc_clk: oscclk {
+   compatible = fixed-clock;
+   #clock-cells = 0;
+   };
+
+   /*
+* This node provides clocks to all peripherals. We don't
+* enumerate the clock names for now since there are no
+* users of this information.
+*/
+   periph_clk: periphclk {
+   compatible = tegra,periphclk;
+   #clock-cells = 1;
+   clocks = osc_clk;
+   reg = 0x60006000 400;
+   };
+};
+
+usb@c5004000 {
+   compatible = nvidia,tegra20-ehci, usb-ehci;
+   reg = 0xc5004000 0x4000;
+   interrupts =  53 ;
+   phy_type = ulpi;
+   clocks = periph_clk 58;  // PERIPH_ID_USB2
+};
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 16/18] tegra: usb: Add common USB defines for tegra2 boards

2012-01-24 Thread Simon Glass
All Tegra2 boards should include tegra2-common. This adds the required
USB config to that file.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v5:
- Add CONFIG_EHCI_DCACHE which is needed for dcache operation
- Drop unused CONFIG_USB_EHCI_DATA_ALIGN option

 include/configs/tegra2-common.h |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index e6f385f..266d0e5 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -84,6 +84,16 @@
 #define CONFIG_SYS_BAUDRATE_TABLE  {4800, 9600, 19200, 38400, 57600,\
115200}
 
+/*
+ * This parameter affects a TXFILLTUNING field that controls how much data is
+ * sent to the latency fifo before it is sent to the wire. Without this
+ * parameter, the default (2) causes occasional Data Buffer Errors in OUT
+ * packets depending on the buffer address and size.
+ */
+#define CONFIG_USB_EHCI_TXFIFO_THRESH  10
+#define CONFIG_EHCI_IS_TDI
+#define CONFIG_EHCI_DCACHE
+
 /* include default commands */
 #include config_cmd_default.h
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 18/18] tegra: fdt: Enable FDT support for Seaboard

2012-01-24 Thread Simon Glass
This switches Seaboard over to use FDT for run-time config instead of
CONFIG options. USB is the only user at present.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v3:
- Drop Tegra USB alignment patch as we will deal with this another way

 include/configs/seaboard.h |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/include/configs/seaboard.h b/include/configs/seaboard.h
index b6d9f7a..1dc775a 100644
--- a/include/configs/seaboard.h
+++ b/include/configs/seaboard.h
@@ -27,6 +27,11 @@
 #include asm/sizes.h
 #include tegra2-common.h
 
+/* Enable fdt support for Seaboard. Flash the image in u-boot-dtb.bin */
+#define CONFIG_DEFAULT_DEVICE_TREE tegra2-seaboard
+#define CONFIG_OF_CONTROL
+#define CONFIG_OF_SEPARATE
+
 /* High-level configuration options */
 #define TEGRA2_SYSMEM  mem=384M@0M nvmem=128M@384M mem=512M@512M
 #define V_PROMPT   Tegra2 (SeaBoard) # 
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 15/18] tegra: usb: Add USB support to nvidia boards

2012-01-24 Thread Simon Glass
This adds basic USB support for port 0. The other port is not supported
yet.

Tegra2 (SeaBoard) # usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 5 USB Device(s) found
   scanning bus for storage devices... 1 Storage Device(s) found
Tegra2 (SeaBoard) # ext2load usb 0:3 1000 /boot/vmlinuz
Loading file /boot/vmlinuz from usb device 0:3 (ROOT-A)
2932976 bytes read

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Add setting of pinmux for USB VBUS GPIO

Changes in v5:
- Put pinmux setting into a board-specific function

 board/nvidia/common/board.c  |   12 
 board/nvidia/common/board.h  |6 ++
 board/nvidia/seaboard/seaboard.c |6 ++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index e8253a0..72d8630 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -33,6 +33,7 @@
 #include asm/arch/pinmux.h
 #include asm/arch/uart.h
 #include spi.h
+#include asm/arch/usb.h
 #include board.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -50,6 +51,12 @@ int timer_init(void)
return 0;
 }
 
+void __pin_mux_usb(void)
+{
+}
+
+void pin_mux_usb(void) __attribute__((weak, alias(__pin_mux_usb)));
+
 /*
  * Routine: board_init
  * Description: Early hardware init.
@@ -69,6 +76,11 @@ int board_init(void)
/* boot param addr */
gd-bd-bi_boot_params = (NV_PA_SDRAM_BASE + 0x100);
 
+#ifdef CONFIG_USB_EHCI_TEGRA
+   pin_mux_usb();
+   board_usb_init(gd-fdt_blob);
+#endif
+
return 0;
 }
 
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index a638af2..09fb158 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -27,4 +27,10 @@
 void gpio_config_uart(void);
 void gpio_early_init_uart(void);
 
+/*
+ * Set up any pin muxing needed for USB (for now, since fdt doesn't support
+ * it). Boards can overwrite the default fucction which does nothing.
+ */
+void pin_mux_usb(void);
+
 #endif /* BOARD_H */
diff --git a/board/nvidia/seaboard/seaboard.c b/board/nvidia/seaboard/seaboard.c
index 9ab6825..94efb1e 100644
--- a/board/nvidia/seaboard/seaboard.c
+++ b/board/nvidia/seaboard/seaboard.c
@@ -90,3 +90,9 @@ int board_mmc_init(bd_t *bd)
return 0;
 }
 #endif
+
+void pin_mux_usb(void)
+{
+   /* For USB's GPIO PD0. For now, since we have no pinmux in fdt */
+   pinmux_tristate_disable(PINGRP_SLXK);
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 11/18] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard

2012-01-24 Thread Simon Glass
We set up two USB ports, one of which can be host or device.
For some reason the kernel version does enable both ports.

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Remove 0x from fdt aliases
- Use okay instead of ok for fdt node status

Changes in v3:
- Disable USB2 which is not used on Seaboard
- Fix device tree indenting with tabs instead of spaces
- Remove okay from nodes since this is the default anyway

Changes in v5:
- Remove support-host-mode property

 board/nvidia/dts/tegra2-seaboard.dts |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
index dde5d03..f53690f 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -11,6 +11,12 @@
bootargs = vmalloc=192M video=tegrafb console=ttyS0,115200n8 
root=/dev/mmcblk1p3 rw rootwait;
};
 
+   aliases {
+   /* This defines the order of our USB ports */
+   usb0 = /usb@c5008000;
+   usb1 = /usb@c500;
+   };
+
memory {
device_type = memory;
reg =  0x 0x4000 ;
@@ -33,4 +39,8 @@
usb@c500 {
nvidia,vbus-gpio = gpio 24 0; /* PD0 */
};
+
+   usb@c5004000 {
+   status = disabled;
+   };
 };
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 07/18] fdt: Add tegra-usb bindings file from linux

2012-01-24 Thread Simon Glass
This file is taken from the Linux mailing list.

Signed-off-by: Simon Glass s...@chromium.org
---

 doc/device-tree-bindings/usb/tegra-usb.txt |   13 +
 1 files changed, 13 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/usb/tegra-usb.txt

diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt 
b/doc/device-tree-bindings/usb/tegra-usb.txt
new file mode 100644
index 000..035d63d
--- /dev/null
+++ b/doc/device-tree-bindings/usb/tegra-usb.txt
@@ -0,0 +1,13 @@
+Tegra SOC USB controllers
+
+The device node for a USB controller that is part of a Tegra
+SOC is as described in the document Open Firmware Recommended
+Practice : Universal Serial Bus with the following modifications
+and additions :
+
+Required properties :
+ - compatible : Should be nvidia,tegra20-ehci for USB controllers
+   used in host mode.
+ - phy_type : Should be one of ulpi or utmi.
+ - nvidia,vbus-gpio : If present, specifies a gpio that needs to be
+   activated for the bus to be powered.
-- 
1.7.7.3

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


[U-Boot] [PATCH v5 14/18] tegra: usb: Add support for Tegra USB peripheral

2012-01-24 Thread Simon Glass
This adds basic support for the Tegra2 USB controller. Board files should
call board_usb_init() to set things up.

Configuration is performed through the FDT, with aliases used to set the
order of the ports, like this fragment:

aliases {
/* This defines the order of our USB ports */
usb0 = /usb@0xc5008000;
usb1 = /usb@0xc500;
};

drivers/usb/host files ONLY: Acked-by: Remy Bohmer li...@bohmer.net
Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v2:
- Decode USB VBUS GPIO from the fdt
- Decode phy type differently (to match new kernel fdt)
- Improve debug() printouts in case of failure to init USB
- Remove non-fdt operation of USB, since it is not needed
- Rename params to timing
- Rename tegra20-usb to tegra20-ehcui (to match new kernel fdt)
- Store entire fdt config in port list, not just register pointer

Changes in v3:
- Remove usbparams properties from fdt and moved them to C code

Changes in v4:
- Use peripheral clock node to obtain peripheral ID
- Use updated fdtdec alias functiona to get USB aliases

Changes in v5:
- Add additional debugging to report active USB ports
- Allow any port to operate in otg mode
- Correct PTS_MASK value to be unsigned
- Implement new device tree properties
- Remove checking of peripheral ID and try to use only device tree
- Report error if phy clock does not start up

 arch/arm/cpu/armv7/tegra2/Makefile|4 +-
 arch/arm/cpu/armv7/tegra2/usb.c   |  460 +
 arch/arm/include/asm/arch-tegra2/tegra2.h |2 +
 arch/arm/include/asm/arch-tegra2/usb.h|  252 
 drivers/usb/host/Makefile |1 +
 drivers/usb/host/ehci-tegra.c |   62 
 include/fdtdec.h  |1 +
 lib/fdtdec.c  |1 +
 8 files changed, 782 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/tegra2/usb.c
 create mode 100644 arch/arm/include/asm/arch-tegra2/usb.h
 create mode 100644 drivers/usb/host/ehci-tegra.c

diff --git a/arch/arm/cpu/armv7/tegra2/Makefile 
b/arch/arm/cpu/armv7/tegra2/Makefile
index f668a81..e9ac6c9 100644
--- a/arch/arm/cpu/armv7/tegra2/Makefile
+++ b/arch/arm/cpu/armv7/tegra2/Makefile
@@ -33,8 +33,10 @@ include $(TOPDIR)/config.mk
 LIB=  $(obj)lib$(SOC).o
 
 SOBJS  := lowlevel_init.o
-COBJS  := ap20.o board.o clock.o funcmux.o pinmux.o sys_info.o timer.o
+COBJS-y:= ap20.o board.o clock.o funcmux.o pinmux.o sys_info.o timer.o
+COBJS-$(CONFIG_USB_EHCI_TEGRA) += usb.o
 
+COBJS  := $(COBJS-y)
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
 
diff --git a/arch/arm/cpu/armv7/tegra2/usb.c b/arch/arm/cpu/armv7/tegra2/usb.c
new file mode 100644
index 000..3527b8e
--- /dev/null
+++ b/arch/arm/cpu/armv7/tegra2/usb.c
@@ -0,0 +1,460 @@
+/*
+ * Copyright (c) 2011 The Chromium OS Authors.
+ * (C) Copyright 2010,2011 NVIDIA Corporation www.nvidia.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/io.h
+#include asm-generic/gpio.h
+#include asm/arch/tegra2.h
+#include asm/arch/clk_rst.h
+#include asm/arch/clock.h
+#include asm/arch/gpio.h
+#include asm/arch/pinmux.h
+#include asm/arch/sys_proto.h
+#include asm/arch/uart.h
+#include asm/arch/usb.h
+#include libfdt.h
+#include fdtdec.h
+
+enum {
+   USB_PORTS_MAX   = 4,/* Maximum ports we allow */
+};
+
+/* Parameters we need for USB */
+enum {
+   PARAM_DIVN, /* PLL FEEDBACK DIVIDer */
+   PARAM_DIVM, /* PLL INPUT DIVIDER */
+   PARAM_DIVP, /* POST DIVIDER (2^N) */
+   PARAM_CPCON,/* BASE PLLC CHARGE Pump setup ctrl */
+   PARAM_LFCON,/* BASE PLLC LOOP FILter setup ctrl */
+   PARAM_ENABLE_DELAY_COUNT,   /* PLL-U Enable Delay Count */
+   PARAM_STABLE_COUNT, /* PLL-U STABLE count */
+   PARAM_ACTIVE_DELAY_COUNT,   /* PLL-U Active delay count */
+   PARAM_XTAL_FREQ_COUNT,  /* PLL-U XTAL frequency count */
+   PARAM_DEBOUNCE_A_TIME,  /* 10MS DELAY for BIAS_DEBOUNCE_A */
+   

Re: [U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Marek Vasut
 When running Linux on a mx28evk and issuing a 'reboot'command the following
 behaviour is observed:
 
 root@freescale /$ reboot
 starting pid 329, tty '': '/etc/rc.d/rcS stop'
 root@freescale /$ Stopping inetd:
 Terminated
 Unmounting filesystems
 umount: tmpfs busy - remounted read-only
 chown: /home/user/.rhosts: Read-only file system
 chown: /home/user: Read-only file system
 chown: /home/user: Read-only file system
 cat: can't open '/proc/devices': No such file or directory
 The system is going down NOW!
 Sent SIGTERM to all processes
 Sent SIGKILL to all processes
 Requesting system reboot
 [   24.24] Restarting system.
 
 U-Boot 2011.12-06887-g586ab2f-dirty (Jan 24 2012 - 12:58:50)
 
 Freescale i.MX28 family
 DRAM:  0
 
 , and then U-boot hangs.
 
 Calling mx28_power_init() prior to mxs_iomux_setup_multiple_pads() fixes
 the problem and make U-boot to re-start succesfully.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---
 This patch fixes the reboot issue, but I am not able to provide a good
 explanation for it, so I am marking it as RFC.
 
  arch/arm/cpu/arm926ejs/mx28/spl_boot.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
 b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c index dfb8309..0e57252 100644
 --- a/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
 +++ b/arch/arm/cpu/arm926ejs/mx28/spl_boot.c
 @@ -49,8 +49,8 @@ void early_delay(int delay)
  void mx28_common_spl_init(const iomux_cfg_t *iomux_setup,
   const unsigned int iomux_size)
  {
 - mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
   mx28_power_init();
 + mxs_iomux_setup_multiple_pads(iomux_setup, iomux_size);
   mx28_mem_init();
   mx28_power_wait_pswitch();
  }

Can you explain why this patch fixes anything ? It's hard to understand why 
doing this would fix it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/3] PXA: PXA27x Matrix keypad driver

2012-01-24 Thread Marek Vasut
 From: Marek Vasut marek.va...@gmail.com
 
 Signed-off-by: Marek Vasut marek.va...@gmail.com
 Signed-off-by: Vasily Khoruzhick anars...@gmail.com
 ---
 v2: use struct-based access to regs, minor cleanup
 v3: fix multiple keypresses handling, minor cleanup
 v4: another minor cleanup
 v5: fix indentation issues in scan_keys(), remove udelay,
 increase PXA_KEYPAD_TIMEOUT (due to removed udelay)
 
  arch/arm/include/asm/arch-pxa/pxa-regs.h|   52 -
  arch/arm/include/asm/arch-pxa/regs-keypad.h |   84 
  drivers/input/Makefile  |2 +
  drivers/input/pxa27x-mkp.c  |  292
 +++ 4 files changed, 378 insertions(+), 52
 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-pxa/regs-keypad.h
  create mode 100644 drivers/input/pxa27x-mkp.c
 
 diff --git a/arch/arm/include/asm/arch-pxa/pxa-regs.h
 b/arch/arm/include/asm/arch-pxa/pxa-regs.h index b81b42c..d562658 100644
 --- a/arch/arm/include/asm/arch-pxa/pxa-regs.h
 +++ b/arch/arm/include/asm/arch-pxa/pxa-regs.h
 @@ -2567,58 +2567,6 @@ typedef void   (*ExcpHndlr) (void) ;
  #define OVL2C1_O2EN  (131) /* Enable bit for Overlay 2 */
  #define CCR_CEN  (131) /* Enable bit for Cursor */
 
 -/* Keypad controller */
 -
 -#define KPC  0x4150 /* Keypad Interface Control register */
 -#define KPDK 0x4158 /* Keypad Interface Direct Key register */
 -#define KPREC0x41500010 /* Keypad Intefcace Rotary Encoder 
register */
 -#define KPMK 0x41500018 /* Keypad Intefcace Matrix Key register */
 -#define KPAS 0x41500020 /* Keypad Interface Automatic Scan register 
*/
 -#define KPASMKP0 0x41500028 /* Keypad Interface Automatic Scan Multiple
 Key Presser register 0 */ -#define KPASMKP1   0x41500030 /* Keypad Interface
 Automatic Scan Multiple Key Presser register 1 */ -#define
 KPASMKP2  0x41500038 /* Keypad Interface Automatic Scan Multiple Key
 Presser register 2 */ -#define KPASMKP3   0x41500040 /* Keypad Interface
 Automatic Scan Multiple Key Presser register 3 */ -#define
 KPKDI 0x41500048 /* Keypad Interface Key Debounce Interval register 
 */ 
-
 -#define KPC_AS   (0x1  30)  /* Automatic Scan bit */
 -#define KPC_ASACT(0x1  29)  /* Automatic Scan on Activity */
 -#define KPC_MI   (0x1  22)  /* Matrix interrupt bit */
 -#define KPC_IMKP (0x1  21)  /* Ignore Multiple Key Press */
 -#define KPC_MS7  (0x1  20)  /* Matrix scan line 7 */
 -#define KPC_MS6  (0x1  19)  /* Matrix scan line 6 */
 -#define KPC_MS5  (0x1  18)  /* Matrix scan line 5 */
 -#define KPC_MS4  (0x1  17)  /* Matrix scan line 4 */
 -#define KPC_MS3  (0x1  16)  /* Matrix scan line 3 */
 -#define KPC_MS2  (0x1  15)  /* Matrix scan line 2 */
 -#define KPC_MS1  (0x1  14)  /* Matrix scan line 1 */
 -#define KPC_MS0  (0x1  13)  /* Matrix scan line 0 */
 -#define KPC_ME   (0x1  12)  /* Matrix Keypad Enable */
 -#define KPC_MIE  (0x1  11)  /* Matrix Interrupt Enable */
 -#define KPC_DK_DEB_SEL   (0x1   9)  /* Direct Key Debounce select */
 -#define KPC_DI   (0x1   5)  /* Direct key interrupt bit */
 -#define KPC_DEE0 (0x1   2)  /* Rotary Encoder 0 Enable */
 -#define KPC_DE   (0x1   1)  /* Direct Keypad Enable */
 -#define KPC_DIE  (0x1   0)  /* Direct Keypad interrupt Enable 
*/
 -
 -#define KPDK_DKP (0x1  31)
 -#define KPDK_DK7 (0x1   7)
 -#define KPDK_DK6 (0x1   6)
 -#define KPDK_DK5 (0x1   5)
 -#define KPDK_DK4 (0x1   4)
 -#define KPDK_DK3 (0x1   3)
 -#define KPDK_DK2 (0x1   2)
 -#define KPDK_DK1 (0x1   1)
 -#define KPDK_DK0 (0x1   0)
 -
 -#define KPREC_OF1(0x1  31)
 -#define kPREC_UF1(0x1  30)
 -#define KPREC_OF0(0x1  15)
 -#define KPREC_UF0(0x1  14)
 -
 -#define KPMK_MKP (0x1  31)
 -#define KPAS_SO  (0x1  31)
 -#define KPASMKPx_SO  (0x1  31)
 -
  #define GPIO113_BIT  (1  17)/* GPIO113 in GPSR, GPCR, bit 17 */
  #define PSLR 0x40F00034
  #define PSTR 0x40F00038  /* Power Manager Standby Configuration Reg 
*/
 diff --git a/arch/arm/include/asm/arch-pxa/regs-keypad.h
 b/arch/arm/include/asm/arch-pxa/regs-keypad.h new file mode 100644
 index 000..1909417
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-pxa/regs-keypad.h
 @@ -0,0 +1,84 @@
 +/*
 + * Copyright (C) 2012 Vasily Khoruzhick anars...@gmail.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR 

Re: [U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Fabio Estevam
On Tue, Jan 24, 2012 at 9:48 PM, Marek Vasut marek.va...@gmail.com wrote:

 Can you explain why this patch fixes anything ? It's hard to understand why
 doing this would fix it.

Yes, I agree and that's why I marked it as RFC and please also see my
comments below the --- line.

I don't understand the reason for the fix as well. Matthias' patch for
adding the boot mode information in mx28 magically fixed the reboot
issue and playing with his patch I realized that any instruction prior
to mxs_iomux_setup_multiple_pads fixes the reboot problem.

Regards,

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


Re: [U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Marek Vasut
 On Tue, Jan 24, 2012 at 9:48 PM, Marek Vasut marek.va...@gmail.com wrote:
  Can you explain why this patch fixes anything ? It's hard to understand
  why doing this would fix it.
 
 Yes, I agree and that's why I marked it as RFC and please also see my
 comments below the --- line.
 
 I don't understand the reason for the fix as well. Matthias' patch for
 adding the boot mode information in mx28 magically fixed the reboot
 issue and playing with his patch I realized that any instruction prior
 to mxs_iomux_setup_multiple_pads fixes the reboot problem.

Now that IS CREEPY. You mean like ... just anything ? Or does the code executed 
before need to be exactly long or longer than something ?

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


Re: [U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Fabio Estevam
On Tue, Jan 24, 2012 at 11:25 PM, Marek Vasut marek.va...@gmail.com wrote:

 Now that IS CREEPY. You mean like ... just anything ? Or does the code 
 executed
 before need to be exactly long or longer than something ?

Yes, my tests show that anything prior to
mxs_iomux_setup_multiple_pads makes reboot to work.

I added more details here: http://marc.info/?l=u-bootm=132741813307150w=2

That´s a very strange behaviour.

Regards,

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


Re: [U-Boot] [RFC] mx28: Fix reboot from the kernel

2012-01-24 Thread Marek Vasut
 On Tue, Jan 24, 2012 at 11:25 PM, Marek Vasut marek.va...@gmail.com wrote:
  Now that IS CREEPY. You mean like ... just anything ? Or does the code
  executed before need to be exactly long or longer than something ?
 
 Yes, my tests show that anything prior to
 mxs_iomux_setup_multiple_pads makes reboot to work.

Your @G jabber is botched, can you try pushing through on the other side? :-(
 
 I added more details here: http://marc.info/?l=u-bootm=132741813307150w=2
 
 That´s a very strange behaviour.

Let's hope UPS works on time as the weather forecast in Back to the Future II, 
if that's the case, I'd be able to test myself on thursday :-)

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


Re: [U-Boot] [PATCH 1/2] S5P: support generic watchdog timer

2012-01-24 Thread Minkyu Kang
On 18 January 2012 16:21, Minkyu Kang mk7.k...@samsung.com wrote:
 This patch adds support the generic watchdog timer for s5pc1xx and exynos4

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: HeungJun, Kim riverful@samsung.com
 ---
  arch/arm/cpu/armv7/s5p-common/Makefile       |    1 +
  arch/arm/cpu/armv7/s5p-common/wdt.c          |   59 
 ++
  arch/arm/include/asm/arch-exynos/watchdog.h  |    6 ++-
  arch/arm/include/asm/arch-s5pc1xx/cpu.h      |    1 +
  arch/arm/include/asm/arch-s5pc1xx/watchdog.h |   58 +
  5 files changed, 124 insertions(+), 1 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/s5p-common/wdt.c
  create mode 100644 arch/arm/include/asm/arch-s5pc1xx/watchdog.h


applied to u-boot-samsung.

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


Re: [U-Boot] [PATCH 2/2] TRATS: use the generic watchdog timer

2012-01-24 Thread Minkyu Kang
On 18 January 2012 16:21, Minkyu Kang mk7.k...@samsung.com wrote:
 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: HeungJun, Kim riverful@samsung.com
 ---
  board/samsung/trats/trats.c |   11 +--
  1 files changed, 1 insertions(+), 10 deletions(-)


applied to u-boot-samsung.

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


Re: [U-Boot] [PATCH] ORIGEN: remove duplicated MACH_TYPE define

2012-01-24 Thread Minkyu Kang
On 18 January 2012 17:42, Minkyu Kang mk7.k...@samsung.com wrote:
 Since MACH_TYPE_ORIGEN is updated on mach-types,
 remove the MACH_TYPE_ORIGEN on config file.

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Cc: Chander Kashyap chander.kash...@linaro.org
 ---
  include/configs/origen.h |    2 --
  1 files changed, 0 insertions(+), 2 deletions(-)


applied to u-boot-samsung.

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


Re: [U-Boot] [PATCH v4 3/4] EXYNOS: Add SMDK5250 board support

2012-01-24 Thread Chander Kashyap
Hi,
There are some changes in previous patch set.

 diff --git a/board/samsung/smdk5250/smdk5250.c 
 b/board/samsung/smdk5250/smdk5250.c
 new file mode 100644
 index 000..2684620
 --- /dev/null
 +++ b/board/samsung/smdk5250/smdk5250.c
 @@ -0,0 +1,152 @@
 +/*
 + * Copyright (C) 2011 Samsung Electronics
 + *
 + * See file CREDITS for list of people who contributed to this
 + * project.
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#include common.h
 +#include asm/io.h
 +#include netdev.h
 +#include asm/arch/cpu.h
 +#include asm/arch/gpio.h
 +#include asm/arch/mmc.h
 +#include asm/arch/sromc.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +struct exynos5_gpio_part1 *gpio1;
 +
 +int board_init(void)
 +{
 +       gpio1 = (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 +
 +       gd-bd-bi_boot_params = (PHYS_SDRAM_1 + 0x100UL);
 +       return 0;
 +}
 +
 +int dram_init(void)
 +{
 +       gd-ram_size    = get_ram_size((long *)PHYS_SDRAM_1, 
 PHYS_SDRAM_1_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_2, 
 PHYS_SDRAM_2_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_3, 
 PHYS_SDRAM_3_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_4, 
 PHYS_SDRAM_4_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_5, 
 PHYS_SDRAM_7_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_6, 
 PHYS_SDRAM_7_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_7, 
 PHYS_SDRAM_7_SIZE)
 +                       + get_ram_size((long *)PHYS_SDRAM_8, 
 PHYS_SDRAM_8_SIZE);
 +       return 0;
 +}
 +
 +void dram_init_banksize(void)
 +{
 +       gd-bd-bi_dram[0].start = PHYS_SDRAM_1;
 +       gd-bd-bi_dram[0].size = get_ram_size((long *)PHYS_SDRAM_1, \
 +                                                       PHYS_SDRAM_1_SIZE);
 +       gd-bd-bi_dram[1].start = PHYS_SDRAM_2;
 +       gd-bd-bi_dram[1].size = get_ram_size((long *)PHYS_SDRAM_2, \
 +                                                       PHYS_SDRAM_2_SIZE);
 +       gd-bd-bi_dram[2].start = PHYS_SDRAM_3;
 +       gd-bd-bi_dram[2].size = get_ram_size((long *)PHYS_SDRAM_3, \
 +                                                       PHYS_SDRAM_3_SIZE);
 +       gd-bd-bi_dram[3].start = PHYS_SDRAM_4;
 +       gd-bd-bi_dram[3].size = get_ram_size((long *)PHYS_SDRAM_4, \
 +                                                       PHYS_SDRAM_4_SIZE);
 +       gd-bd-bi_dram[4].start = PHYS_SDRAM_5;
 +       gd-bd-bi_dram[4].size = get_ram_size((long *)PHYS_SDRAM_5, \
 +                                                       PHYS_SDRAM_5_SIZE);
 +       gd-bd-bi_dram[5].start = PHYS_SDRAM_6;
 +       gd-bd-bi_dram[5].size = get_ram_size((long *)PHYS_SDRAM_6, \
 +                                                       PHYS_SDRAM_6_SIZE);
 +       gd-bd-bi_dram[6].start = PHYS_SDRAM_7;
 +       gd-bd-bi_dram[6].size = get_ram_size((long *)PHYS_SDRAM_7, \
 +                                                       PHYS_SDRAM_7_SIZE);
 +       gd-bd-bi_dram[7].start = PHYS_SDRAM_8;
 +       gd-bd-bi_dram[7].size = get_ram_size((long *)PHYS_SDRAM_8, \
 +                                                       PHYS_SDRAM_8_SIZE);
 +}
 +
 +#ifdef CONFIG_DISPLAY_BOARDINFO
 +int checkboard(void)
 +{
 +       printf(\nBoard: SMDK5250\n);
 +
 +       return 0;
 +}
 +#endif
 +
 +#ifdef CONFIG_GENERIC_MMC
 +int board_mmc_init(bd_t *bis)
 +{
 +       int i, err;
 +
 +       /*
 +        * MMC2 SD card GPIO:
 +        *
 +        * GPC2[0]      SD_2_CLK(2)
 +        * GPC2[1]      SD_2_CMD(2)
 +        * GPC2[2]      SD_2_CDn
 +        * GPC2[3:6]    SD_2_DATA[0:3](2)
 +        */
 +       for (i = 0; i  7; i++) {
 +               /* GPC2[0:6] special function 2 */
 +               s5p_gpio_cfg_pin(gpio1-c2, i, GPIO_FUNC(0x2));
 +
 +               /* GPK2[0:6] drv 4x */
 +               s5p_gpio_set_drv(gpio1-c2, i, GPIO_DRV_4X);
 +
 +               /* GPK2[0:1] pull disable */
 +               if (i == 0 || i == 1) {
 +                       s5p_gpio_set_pull(gpio1-c2, i, GPIO_PULL_NONE);
 +                       continue;
 +               }
 +
 +               /* GPK2[2:6] pull up */
 +               s5p_gpio_set_pull(gpio1-c2, i, GPIO_PULL_UP);
 +       }
 +
 +       err = s5p_mmc_init(2, 4);
 +       return err;
 +}
 +#endif

[U-Boot] [PATCH v5 4/4] EXYNOS: SMDK5250: Add MMC SPL support

2012-01-24 Thread Chander Kashyap
This patch adds support for MMC SPL booting.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
Changes for v2:
- None
Changes for v3:
- None
Changes for v4:
- None
Changes for v5:
- None

 board/samsung/smdk5250/Makefile   |   16 
 board/samsung/smdk5250/mmc_boot.c |   58 
 board/samsung/smdk5250/tools/mkexynos_image.c |  117 +
 include/configs/smdk5250.h|6 +-
 4 files changed, 196 insertions(+), 1 deletions(-)
 create mode 100644 board/samsung/smdk5250/mmc_boot.c
 create mode 100644 board/samsung/smdk5250/tools/mkexynos_image.c

diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
index d9c2774..908ce5b 100644
--- a/board/samsung/smdk5250/Makefile
+++ b/board/samsung/smdk5250/Makefile
@@ -29,18 +29,34 @@ SOBJS   := lowlevel_init.o
 COBJS  := clock_init.o
 COBJS  += dmc_init.o
 COBJS  += tzpc_init.o
+
+ifndef CONFIG_SPL_BUILD
 COBJS  += smdk5250.o
+endif
+
+ifdef CONFIG_SPL_BUILD
+COBJS  += mmc_boot.o
+endif
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
 
 ALL:=   $(obj).depend $(LIB)
 
+ifdef CONFIG_SPL_BUILD
+ALL+= $(OBJTREE)/tools/mk$(BOARD)spl
+endif
+
 all:   $(ALL)
 
 $(LIB):$(OBJS)
$(call cmd_link_o_target, $(OBJS))
 
+ifdef CONFIG_SPL_BUILD
+$(OBJTREE)/tools/mk$(BOARD)spl:tools/mkexynos_image.c
+   $(HOSTCC) tools/mkexynos_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+endif
+
 #
 
 # defines $(obj).depend target
diff --git a/board/samsung/smdk5250/mmc_boot.c 
b/board/samsung/smdk5250/mmc_boot.c
new file mode 100644
index 000..669c1a3
--- /dev/null
+++ b/board/samsung/smdk5250/mmc_boot.c
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#includecommon.h
+#includeconfig.h
+
+/*
+* Copy U-boot from mmc to RAM:
+* COPY_BL2_FNPTR_ADDR: Address in iRAM, which Contains
+* Pointer to API (Data transfer from mmc to ram)
+*/
+void copy_uboot_to_ram(void)
+{
+   u32 (*copy_bl2)(u32, u32, u32) = (void *) *(u32 *)COPY_BL2_FNPTR_ADDR;
+
+   copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT, CONFIG_SYS_TEXT_BASE);
+}
+
+void board_init_f(unsigned long bootflag)
+{
+   __attribute__((noreturn)) void (*uboot)(void);
+   copy_uboot_to_ram();
+
+   /* Jump to U-Boot image */
+   uboot = (void *)CONFIG_SYS_TEXT_BASE;
+   (*uboot)();
+   /* Never returns Here */
+}
+
+/* Place Holders */
+void board_init_r(gd_t *id, ulong dest_addr)
+{
+   /* Function attribute is no-return */
+   /* This Function never executes */
+   while (1)
+   ;
+}
+
+void save_boot_params(u32 r0, u32 r1, u32 r2, u32 r3) {}
diff --git a/board/samsung/smdk5250/tools/mkexynos_image.c 
b/board/samsung/smdk5250/tools/mkexynos_image.c
new file mode 100644
index 000..e2b7805
--- /dev/null
+++ b/board/samsung/smdk5250/tools/mkexynos_image.c
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include stdio.h
+#include stdlib.h
+#include unistd.h
+#include fcntl.h
+#include errno.h
+#include string.h
+#include sys/stat.h
+
+#define CHECKSUM_OFFSET(14*1024-4)
+#define BUFSIZE(16*1024)
+#define FILE_PERM 

[U-Boot] [PATCH v5 0/4] Add SMDK5250 board support

2012-01-24 Thread Chander Kashyap
This patchset add support for Samsung's SMDK5250 board based on
EXYNOS5250 based SoC. It also adds support for MMC SPL booting.

The porting is done by Samsung engineers at HQ in System LSI Team.
I am contributing in upstreaming the code for the board.

Based upon discussions following patches are dropped in this version:
Exynos: Add CONFIG_EXYNOS4 Macro to EXYNOS4 based boards
Exynos: Clock.c: Replace exynos4 prefix with exynos

SMDK5250: enable device tree support is squashed with
EXYNOS: Add SMDK5250 board support

Chander Kashyap (4):
  Exynos: Clock.c: Use CONFIG_SYS_CLK_FREQ macro
  ARM: EXYNOS: Add support for Exynos5 based SoCs
  EXYNOS: Add SMDK5250 board support
  EXYNOS: SMDK5250: Add MMC SPL support

 MAINTAINERS   |1 +
 arch/arm/cpu/armv7/exynos/clock.c |  214 ++-
 arch/arm/include/asm/arch-exynos/clock.h  |  326 
 arch/arm/include/asm/arch-exynos/cpu.h|   35 ++-
 arch/arm/include/asm/arch-exynos/dmc.h|  146 +++
 arch/arm/include/asm/arch-exynos/gpio.h   |   99 +-
 arch/arm/include/asm/arch-exynos/tzpc.h   |   52 +++
 board/samsung/smdk5250/Makefile   |   67 
 board/samsung/smdk5250/clock_init.c   |  202 ++
 board/samsung/smdk5250/dmc_init.c |  508 +
 board/samsung/smdk5250/lowlevel_init.S|   96 +
 board/samsung/smdk5250/mmc_boot.c |   58 +++
 board/samsung/smdk5250/setup.h|  353 +
 board/samsung/smdk5250/smdk5250.c |  150 
 board/samsung/smdk5250/tools/mkexynos_image.c |  117 ++
 board/samsung/smdk5250/tzpc_init.c|   48 +++
 boards.cfg|1 +
 include/configs/s5pc210_universal.h   |1 +
 include/configs/smdk5250.h|  202 ++
 include/configs/trats.h   |1 +
 20 files changed, 2660 insertions(+), 17 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/dmc.h
 create mode 100644 arch/arm/include/asm/arch-exynos/tzpc.h
 create mode 100644 board/samsung/smdk5250/Makefile
 create mode 100644 board/samsung/smdk5250/clock_init.c
 create mode 100644 board/samsung/smdk5250/dmc_init.c
 create mode 100644 board/samsung/smdk5250/lowlevel_init.S
 create mode 100644 board/samsung/smdk5250/mmc_boot.c
 create mode 100644 board/samsung/smdk5250/setup.h
 create mode 100644 board/samsung/smdk5250/smdk5250.c
 create mode 100644 board/samsung/smdk5250/tools/mkexynos_image.c
 create mode 100644 board/samsung/smdk5250/tzpc_init.c
 create mode 100644 include/configs/smdk5250.h

-- 
1.7.5.4

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


[U-Boot] [PATCH v5 2/4] ARM: EXYNOS: Add support for Exynos5 based SoCs

2012-01-24 Thread Chander Kashyap
Samsung's ARM Cortex-A15 based SoCs are known as Exynos5 series of
SoCs. This patch adds the support for Exynos5.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
Changes for v2:
- This patch was part of EXYNOS: Add SMDK5250 board support
- Now it is seprated as SoC support.
Changes for v3:
- Populated complete exynos5 gpio structures
Changes for v4:
- Added dmc.h and tzpc.h header files
- Renamed EXYNOS5_PHY*_CTRL_BASE to EXYNOS5_DMC_PHY*_BASE
Changes for v5:
- None

 arch/arm/cpu/armv7/exynos/clock.c|  208 +++-
 arch/arm/include/asm/arch-exynos/clock.h |  326 ++
 arch/arm/include/asm/arch-exynos/cpu.h   |   35 +++-
 arch/arm/include/asm/arch-exynos/dmc.h   |  146 +
 arch/arm/include/asm/arch-exynos/gpio.h  |   99 +-
 arch/arm/include/asm/arch-exynos/tzpc.h  |   52 +
 6 files changed, 854 insertions(+), 12 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/dmc.h
 create mode 100644 arch/arm/include/asm/arch-exynos/tzpc.h

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 4d92c53..2f7048b 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -92,6 +92,72 @@ static unsigned long exynos4_get_pll_clk(int pllreg)
return fout;
 }
 
+/* exynos5: return pll clock frequency */
+static unsigned long exynos5_get_pll_clk(int pllreg)
+{
+   struct exynos5_clock *clk =
+   (struct exynos5_clock *)samsung_get_base_clock();
+   unsigned long r, m, p, s, k = 0, mask, fout;
+   unsigned int freq;
+
+   switch (pllreg) {
+   case APLL:
+   r = readl(clk-apll_con0);
+   break;
+   case MPLL:
+   r = readl(clk-mpll_con0);
+   break;
+   case EPLL:
+   r = readl(clk-epll_con0);
+   k = readl(clk-epll_con1);
+   break;
+   case VPLL:
+   r = readl(clk-vpll_con0);
+   k = readl(clk-vpll_con1);
+   break;
+   default:
+   printf(Unsupported PLL (%d)\n, pllreg);
+   return 0;
+   }
+
+   /*
+* APLL_CON: MIDV [25:16]
+* MPLL_CON: MIDV [25:16]
+* EPLL_CON: MIDV [24:16]
+* VPLL_CON: MIDV [24:16]
+*/
+   if (pllreg == APLL || pllreg == MPLL)
+   mask = 0x3ff;
+   else
+   mask = 0x1ff;
+
+   m = (r  16)  mask;
+
+   /* PDIV [13:8] */
+   p = (r  8)  0x3f;
+   /* SDIV [2:0] */
+   s = r  0x7;
+
+   freq = CONFIG_SYS_CLK_FREQ;
+
+   if (pllreg == EPLL) {
+   k = k  0x;
+   /* FOUT = (MDIV + K / 65536) * FIN / (PDIV * 2^SDIV) */
+   fout = (m + k / 65536) * (freq / (p * (1  s)));
+   } else if (pllreg == VPLL) {
+   k = k  0xfff;
+   /* FOUT = (MDIV + K / 1024) * FIN / (PDIV * 2^SDIV) */
+   fout = (m + k / 1024) * (freq / (p * (1  s)));
+   } else {
+   if (s  1)
+   s = 1;
+   /* FOUT = MDIV * FIN / (PDIV * 2^(SDIV - 1)) */
+   fout = m * (freq / (p * (1  (s - 1;
+   }
+
+   return fout;
+}
+
 /* exynos4: return ARM clock frequency */
 static unsigned long exynos4_get_arm_clk(void)
 {
@@ -114,6 +180,28 @@ static unsigned long exynos4_get_arm_clk(void)
return armclk;
 }
 
+/* exynos5: return ARM clock frequency */
+static unsigned long exynos5_get_arm_clk(void)
+{
+   struct exynos5_clock *clk =
+   (struct exynos5_clock *)samsung_get_base_clock();
+   unsigned long div;
+   unsigned long armclk;
+   unsigned int arm_ratio;
+   unsigned int arm2_ratio;
+
+   div = readl(clk-div_cpu0);
+
+   /* ARM_RATIO: [2:0], ARM2_RATIO: [30:28] */
+   arm_ratio = (div  0)  0x7;
+   arm2_ratio = (div  28)  0x7;
+
+   armclk = get_pll_clk(APLL) / (arm_ratio + 1);
+   armclk /= (arm2_ratio + 1);
+
+   return armclk;
+}
+
 /* exynos4: return pwm clock frequency */
 static unsigned long exynos4_get_pwm_clk(void)
 {
@@ -157,6 +245,27 @@ static unsigned long exynos4_get_pwm_clk(void)
return pclk;
 }
 
+/* exynos5: return pwm clock frequency */
+static unsigned long exynos5_get_pwm_clk(void)
+{
+   struct exynos5_clock *clk =
+   (struct exynos5_clock *)samsung_get_base_clock();
+   unsigned long pclk, sclk;
+   unsigned int ratio;
+
+   /*
+* CLK_DIV_PERIC3
+* PWM_RATIO [3:0]
+*/
+   ratio = readl(clk-div_peric3);
+   ratio = ratio  0xf;
+   sclk = get_pll_clk(MPLL);
+
+   pclk = sclk / (ratio + 1);
+
+   return pclk;
+}
+
 /* exynos4: return uart clock frequency */
 static unsigned long exynos4_get_uart_clk(int dev_index)
 {
@@ -204,6 +313,53 @@ static unsigned long exynos4_get_uart_clk(int dev_index)
return uclk;
 }
 
+/* 

[U-Boot] [PATCH v5 1/4] Exynos: Clock.c: Use CONFIG_SYS_CLK_FREQ macro

2012-01-24 Thread Chander Kashyap
CONFIG_SYS_CLK_FREQ_C210 macro giving notion of S5PC2XX (Exynos4)
architecture. Replace CONFIG_SYS_CLK_FREQ_C210 with CONFIG_SYS_CLK_FREQ
to make it generic for exynos architecture.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
Changes for v2:
- None
Changes for v3:
- None
Changes for V4:
- Added CONFIG_SYS_CLK_FREQ to trats.h
Changes for v5:
- None

 arch/arm/cpu/armv7/exynos/clock.c   |6 +-
 include/configs/s5pc210_universal.h |1 +
 include/configs/trats.h |1 +
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
b/arch/arm/cpu/armv7/exynos/clock.c
index 0c199cd..4d92c53 100644
--- a/arch/arm/cpu/armv7/exynos/clock.c
+++ b/arch/arm/cpu/armv7/exynos/clock.c
@@ -26,10 +26,6 @@
 #include asm/arch/clock.h
 #include asm/arch/clk.h
 
-#ifndef CONFIG_SYS_CLK_FREQ_C210
-#define CONFIG_SYS_CLK_FREQ_C210   2400
-#endif
-
 /* exynos4: return pll clock frequency */
 static unsigned long exynos4_get_pll_clk(int pllreg)
 {
@@ -76,7 +72,7 @@ static unsigned long exynos4_get_pll_clk(int pllreg)
/* SDIV [2:0] */
s = r  0x7;
 
-   freq = CONFIG_SYS_CLK_FREQ_C210;
+   freq = CONFIG_SYS_CLK_FREQ;
 
if (pllreg == EPLL) {
k = k  0x;
diff --git a/include/configs/s5pc210_universal.h 
b/include/configs/s5pc210_universal.h
index be000cb..8286680 100644
--- a/include/configs/s5pc210_universal.h
+++ b/include/configs/s5pc210_universal.h
@@ -49,6 +49,7 @@
 
 /* input clock of PLL: Universal has 24MHz input clock at EXYNOS4210 */
 #define CONFIG_SYS_CLK_FREQ_C210   2400
+#define CONFIG_SYS_CLK_FREQCONFIG_SYS_CLK_FREQ_C210
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
diff --git a/include/configs/trats.h b/include/configs/trats.h
index acb3241..10f11d9 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -49,6 +49,7 @@
 
 /* input clock of PLL: TRATS has 24MHz input clock at EXYNOS4210 */
 #define CONFIG_SYS_CLK_FREQ_C210   2400
+#define CONFIG_SYS_CLK_FREQCONFIG_SYS_CLK_FREQ_C210
 
 #define CONFIG_SETUP_MEMORY_TAGS
 #define CONFIG_CMDLINE_TAG
-- 
1.7.5.4

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


[U-Boot] [PATCH v5 3/4] EXYNOS: Add SMDK5250 board support

2012-01-24 Thread Chander Kashyap
SMDK5250 board is based on Samsungs EXYNOS5250 SoC.

Signed-off-by: Chander Kashyap chander.kash...@linaro.org
---
Changes for v2:
- This patch is bifurcated into borad support and SoC support
- Fixed typo: s/EEYNOS/EXYNOS
- Squashed patch SMDK5250: enable device tree support in this.
Changes for v3:
- None
Changes for v4:
- Converted assembly routines for clock, memory, uart and tzpc
- init to c functions
- Moved uart init to smdk5250.c
Changes for v5:
- Remove initof gpio1
- Fixed gpio configuration for uart

 MAINTAINERS|1 +
 board/samsung/smdk5250/Makefile|   51 
 board/samsung/smdk5250/clock_init.c|  202 +
 board/samsung/smdk5250/dmc_init.c  |  508 
 board/samsung/smdk5250/lowlevel_init.S |   96 ++
 board/samsung/smdk5250/setup.h |  353 ++
 board/samsung/smdk5250/smdk5250.c  |  150 ++
 board/samsung/smdk5250/tzpc_init.c |   48 +++
 boards.cfg |1 +
 include/configs/smdk5250.h |  198 +
 10 files changed, 1608 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/smdk5250/Makefile
 create mode 100644 board/samsung/smdk5250/clock_init.c
 create mode 100644 board/samsung/smdk5250/dmc_init.c
 create mode 100644 board/samsung/smdk5250/lowlevel_init.S
 create mode 100644 board/samsung/smdk5250/setup.h
 create mode 100644 board/samsung/smdk5250/smdk5250.c
 create mode 100644 board/samsung/smdk5250/tzpc_init.c
 create mode 100644 include/configs/smdk5250.h

diff --git a/MAINTAINERS b/MAINTAINERS
index acbd7f1..c03ebb4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -713,6 +713,7 @@ Chander Kashyap k.chan...@samsung.com
 
origen  ARM ARMV7 (EXYNOS4210 SoC)
SMDKV310ARM ARMV7 (EXYNOS4210 SoC)
+   SMDK5250ARM ARMV7 (EXYNOS5250 SoC)
 
 Heungjun Kim riverful@samsung.com
 
diff --git a/board/samsung/smdk5250/Makefile b/board/samsung/smdk5250/Makefile
new file mode 100644
index 000..d9c2774
--- /dev/null
+++ b/board/samsung/smdk5250/Makefile
@@ -0,0 +1,51 @@
+#
+# Copyright (C) 2011 Samsung Electronics
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+SOBJS  := lowlevel_init.o
+
+COBJS  := clock_init.o
+COBJS  += dmc_init.o
+COBJS  += tzpc_init.o
+COBJS  += smdk5250.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+ALL:=   $(obj).depend $(LIB)
+
+all:   $(ALL)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/samsung/smdk5250/clock_init.c 
b/board/samsung/smdk5250/clock_init.c
new file mode 100644
index 000..2b53a47
--- /dev/null
+++ b/board/samsung/smdk5250/clock_init.c
@@ -0,0 +1,202 @@
+/*
+ * Clock setup for SMDK5250 board based on EXYNOS5
+ *
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include config.h
+#include version.h
+#include asm/io.h
+#include asm/arch/clock.h
+#include asm/arch/cpu.h
+#include asm/arch/gpio.h
+#include 

Re: [U-Boot] [PATCH v5 0/4] Add SMDK5250 board support

2012-01-24 Thread Chander Kashyap
Hi,
Please ignore this patch set i will resend it.

On 25 January 2012 10:12, Chander Kashyap chander.kash...@linaro.org wrote:
 This patchset add support for Samsung's SMDK5250 board based on
 EXYNOS5250 based SoC. It also adds support for MMC SPL booting.

 The porting is done by Samsung engineers at HQ in System LSI Team.
 I am contributing in upstreaming the code for the board.

 Based upon discussions following patches are dropped in this version:
 Exynos: Add CONFIG_EXYNOS4 Macro to EXYNOS4 based boards
 Exynos: Clock.c: Replace exynos4 prefix with exynos

 SMDK5250: enable device tree support is squashed with
 EXYNOS: Add SMDK5250 board support

 Chander Kashyap (4):
  Exynos: Clock.c: Use CONFIG_SYS_CLK_FREQ macro
  ARM: EXYNOS: Add support for Exynos5 based SoCs
  EXYNOS: Add SMDK5250 board support
  EXYNOS: SMDK5250: Add MMC SPL support

  MAINTAINERS                                   |    1 +
  arch/arm/cpu/armv7/exynos/clock.c             |  214 ++-
  arch/arm/include/asm/arch-exynos/clock.h      |  326 
  arch/arm/include/asm/arch-exynos/cpu.h        |   35 ++-
  arch/arm/include/asm/arch-exynos/dmc.h        |  146 +++
  arch/arm/include/asm/arch-exynos/gpio.h       |   99 +-
  arch/arm/include/asm/arch-exynos/tzpc.h       |   52 +++
  board/samsung/smdk5250/Makefile               |   67 
  board/samsung/smdk5250/clock_init.c           |  202 ++
  board/samsung/smdk5250/dmc_init.c             |  508 
 +
  board/samsung/smdk5250/lowlevel_init.S        |   96 +
  board/samsung/smdk5250/mmc_boot.c             |   58 +++
  board/samsung/smdk5250/setup.h                |  353 +
  board/samsung/smdk5250/smdk5250.c             |  150 
  board/samsung/smdk5250/tools/mkexynos_image.c |  117 ++
  board/samsung/smdk5250/tzpc_init.c            |   48 +++
  boards.cfg                                    |    1 +
  include/configs/s5pc210_universal.h           |    1 +
  include/configs/smdk5250.h                    |  202 ++
  include/configs/trats.h                       |    1 +
  20 files changed, 2660 insertions(+), 17 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/dmc.h
  create mode 100644 arch/arm/include/asm/arch-exynos/tzpc.h
  create mode 100644 board/samsung/smdk5250/Makefile
  create mode 100644 board/samsung/smdk5250/clock_init.c
  create mode 100644 board/samsung/smdk5250/dmc_init.c
  create mode 100644 board/samsung/smdk5250/lowlevel_init.S
  create mode 100644 board/samsung/smdk5250/mmc_boot.c
  create mode 100644 board/samsung/smdk5250/setup.h
  create mode 100644 board/samsung/smdk5250/smdk5250.c
  create mode 100644 board/samsung/smdk5250/tools/mkexynos_image.c
  create mode 100644 board/samsung/smdk5250/tzpc_init.c
  create mode 100644 include/configs/smdk5250.h

 --
 1.7.5.4




-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6 0/4] Add SMDK5250 board support

2012-01-24 Thread Chander Kashyap
This patchset add support for Samsung's SMDK5250 board based on
EXYNOS5250 based SoC. It also adds support for MMC SPL booting.

The porting is done by Samsung engineers at HQ in System LSI Team.
I am contributing in upstreaming the code for the board.

Based upon discussions following patches are dropped in this version:
Exynos: Add CONFIG_EXYNOS4 Macro to EXYNOS4 based boards
Exynos: Clock.c: Replace exynos4 prefix with exynos

SMDK5250: enable device tree support is squashed with
EXYNOS: Add SMDK5250 board support

Chander Kashyap (4):
  Exynos: Clock.c: Use CONFIG_SYS_CLK_FREQ macro
  ARM: EXYNOS: Add support for Exynos5 based SoCs
  EXYNOS: Add SMDK5250 board support
  EXYNOS: SMDK5250: Add MMC SPL support

 MAINTAINERS   |1 +
 arch/arm/cpu/armv7/exynos/clock.c |  214 ++-
 arch/arm/include/asm/arch-exynos/clock.h  |  326 
 arch/arm/include/asm/arch-exynos/cpu.h|   35 ++-
 arch/arm/include/asm/arch-exynos/dmc.h|  146 +++
 arch/arm/include/asm/arch-exynos/gpio.h   |   99 +-
 arch/arm/include/asm/arch-exynos/tzpc.h   |   52 +++
 board/samsung/smdk5250/Makefile   |   67 
 board/samsung/smdk5250/clock_init.c   |  202 ++
 board/samsung/smdk5250/dmc_init.c |  508 +
 board/samsung/smdk5250/lowlevel_init.S|   96 +
 board/samsung/smdk5250/mmc_boot.c |   58 +++
 board/samsung/smdk5250/setup.h|  353 +
 board/samsung/smdk5250/smdk5250.c |  152 
 board/samsung/smdk5250/tools/mkexynos_image.c |  117 ++
 board/samsung/smdk5250/tzpc_init.c|   48 +++
 boards.cfg|1 +
 include/configs/s5pc210_universal.h   |1 +
 include/configs/smdk5250.h|  202 ++
 include/configs/trats.h   |1 +
 20 files changed, 2662 insertions(+), 17 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/dmc.h
 create mode 100644 arch/arm/include/asm/arch-exynos/tzpc.h
 create mode 100644 board/samsung/smdk5250/Makefile
 create mode 100644 board/samsung/smdk5250/clock_init.c
 create mode 100644 board/samsung/smdk5250/dmc_init.c
 create mode 100644 board/samsung/smdk5250/lowlevel_init.S
 create mode 100644 board/samsung/smdk5250/mmc_boot.c
 create mode 100644 board/samsung/smdk5250/setup.h
 create mode 100644 board/samsung/smdk5250/smdk5250.c
 create mode 100644 board/samsung/smdk5250/tools/mkexynos_image.c
 create mode 100644 board/samsung/smdk5250/tzpc_init.c
 create mode 100644 include/configs/smdk5250.h

-- 
1.7.5.4

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


  1   2   >