[U-Boot] [PATCH] ARM: dreamplug: Enable FDT support

2012-02-27 Thread Ian Campbell
I have tested booting both FDT and non-FDT based Linux kernels (based on
http://marc.info/?l=linux-arm-kernel&m=133002679716986 and
http://marc.info/?l=linux-arm-kernel&m=132328894303581 respectively).

Signed-off-by: Ian Campbell 
Cc: Jason 
Cc: Prafulla Wadaskar 
---
 include/configs/dreamplug.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/dreamplug.h b/include/configs/dreamplug.h
index 0f2f9a2..76f9eea 100644
--- a/include/configs/dreamplug.h
+++ b/include/configs/dreamplug.h
@@ -148,4 +148,6 @@
  */
 #define CONFIG_DISPLAY_CPUINFO
 
+#define CONFIG_OF_LIBFDT
+
 #endif /* _CONFIG_DREAMPLUG_H */
-- 
1.7.8.3

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


Re: [U-Boot] ARM: Update mach-types

2012-02-27 Thread Dirk Behme

On 27.02.2012 22:56, Troy Kisky wrote:

|ARM: Update mach-types
|
|This commit updates the mach-types based on the latest in Linus's head
|
|Signed-off-by: Marek Vasut 

Hi Marek,


Can I get you to do this again? I'd the symbol for
MACH_MX6Q_SABRELITE.


Just out of curiosity: Why do you need that?

It was my understanding that with recent U-Boot and Kernel on SabreLite 
DeviceTree is the way to go? And this doesn't need the mach-types any more?


Best regards

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


[U-Boot] [PATCH v3 4/4] board/adp-ag102: add configuration of adp-ag102

2012-02-27 Thread Macpaul Lin
From: Macpaul Lin 

board:
Add config file of board adp-ag102
Add adp-ag102 into boards.cfg
Add adp-ag102 into MAINTAINERS

doc:
add README of ag102

Signed-off-by: Macpaul Lin 
---
Changes for v2:
  - add pci and usb support to board setting adp-ag102.h
Changes for v3:
  - Fix patch because update of boards.cfg and MAINTAINERS

 MAINTAINERS |1 +
 boards.cfg  |1 +
 doc/README.ag102|   36 
 include/configs/adp-ag102.h |  375 +++
 4 files changed, 413 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.ag102
 create mode 100644 include/configs/adp-ag102.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 1e40af2..5b45978 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1199,6 +1199,7 @@ Macpaul Lin 
 
ADP-AG101   N1213 (AG101 SoC)
ADP-AG101P  N1213 (AG101P XC5 FPGA)
+   ADP-AG102   N1213f (AG102 SoC with FPU)
 
 #
 # OpenRISC Systems:#
diff --git a/boards.cfg b/boards.cfg
index 05ce1ae..38f0d34 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -376,6 +376,7 @@ incaip_150MHzmipsmips32  incaip 
 -
 qi_lb60  mipsxburst  qi_lb60 qi
 adp-ag101nds32   n1213   adp-ag101   
AndesTech  ag101
 adp-ag101p   nds32   n1213   adp-ag101p  
AndesTech  ag101
+adp-ag102nds32   n1213   adp-ag102   
AndesTech  ag102
 nios2-genericnios2   nios2   nios2-generic   altera
 PCI5441  nios2   nios2   pci5441 psyent
 PK1C20   nios2   nios2   pk1c20  psyent
diff --git a/doc/README.ag102 b/doc/README.ag102
new file mode 100644
index 000..7d142a7
--- /dev/null
+++ b/doc/README.ag102
@@ -0,0 +1,36 @@
+Andes Technology SoC AG102
+==
+
+AG102 is the second SoC produced by Andes Technology using N1213 CPU core
+with FPU and DDR contoller support.
+AG102 has integrated both AHB and APB bus and many periphals for application
+and product development.
+
+ADP-AG102
+=
+
+ADP-AG102 is the SoC with AG102 hardcore CPU.
+
+Configurations
+==
+
+CONFIG_MEM_REMAP:
+   Doing memory remap is essential for preparing some non-OS or RTOS
+   applications.
+
+CONFIG_SKIP_LOWLEVEL_INIT:
+   If you want to boot this system from SPI ROM and bypass e-bios (the
+   other boot loader on ROM). You should undefine CONFIG_SKIP_LOWLEVEL_INIT
+   in "include/configs/adp-ag102.h".
+
+Build and boot steps
+
+
+build:
+1. Prepare the toolchains and make sure the $PATH to toolchains is correct.
+2. Use `make adp-ag102` in u-boot root to build the image.
+
+Burn u-boot to SPI ROM:
+
+
+This section will be added later.
diff --git a/include/configs/adp-ag102.h b/include/configs/adp-ag102.h
new file mode 100644
index 000..a4628e4
--- /dev/null
+++ b/include/configs/adp-ag102.h
@@ -0,0 +1,375 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Macpaul Lin, Andes Technology Corporation 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#include 
+
+/*
+ * CPU and Board Configuration Options
+ */
+#define CONFIG_ADP_AG102
+
+#define CONFIG_USE_INTERRUPT
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+
+#ifndef CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_MEM_REMAP
+#endif
+
+#ifdef CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SYS_TEXT_BASE   0x0420
+#else
+#define CONFIG_SYS_TEXT_BASE   0x
+#endif
+
+/*
+ * Timer
+ */
+
+/*
+ * According to the discussion in u-boot mailing list before,
+ * CONFIG_SYS_HZ at 1000 is mandatory.
+ */
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SYS_CLK_FREQ(6600 * 2)
+#define VERSION_CLOCK  CONFIG_SYS_CLK_FREQ
+
+/*
+ * Use Externel CLOCK or PCLK
+ */
+#undef CONFIG_FTRTC010_EXTCLK
+
+#ifndef CONFIG_FTRTC010_EXTCLK
+#define CONFIG_FTRTC010_PCLK
+#endif
+
+#ifdef CONFIG_FTRTC010_EXTCL

[U-Boot] [PATCH v3 3/4] board/adp-ag102: add board specific files

2012-02-27 Thread Macpaul Lin
From: Macpaul Lin 

Add board specific files.

Signed-off-by: Macpaul Lin 
---
Changes for v2-v3:
  - No change.

 board/AndesTech/adp-ag102/Makefile|   43 +
 board/AndesTech/adp-ag102/adp-ag102.c |  107 +
 2 files changed, 150 insertions(+), 0 deletions(-)
 create mode 100644 board/AndesTech/adp-ag102/Makefile
 create mode 100644 board/AndesTech/adp-ag102/adp-ag102.c

diff --git a/board/AndesTech/adp-ag102/Makefile 
b/board/AndesTech/adp-ag102/Makefile
new file mode 100644
index 000..1cbf2d4
--- /dev/null
+++ b/board/AndesTech/adp-ag102/Makefile
@@ -0,0 +1,43 @@
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Macpaul Lin, Andes Technology Corporation 
+#
+# 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
+
+COBJS  := adp-ag102.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/AndesTech/adp-ag102/adp-ag102.c 
b/board/AndesTech/adp-ag102/adp-ag102.c
new file mode 100644
index 000..5a25632
--- /dev/null
+++ b/board/AndesTech/adp-ag102/adp-ag102.c
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation 
+ * Macpaul Lin, Andes Technology Corporation 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#ifdef CONFIG_FTSMC020
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Miscellaneous platform dependent initializations
+ */
+
+int board_init(void)
+{
+   /*
+* refer to BOOT_PARAMETER_PA_BASE within
+* "linux/arch/nds32/include/asm/misc_spec.h"
+*/
+   gd->bd->bi_arch_number = MACH_TYPE_ADPAG102;
+   gd->bd->bi_boot_params = PHYS_SDRAM_0 + 0x400;
+
+#if !defined(CONFIG_SYS_NO_FLASH)
+   ftsmc020_init();/* initialize Flash */
+#endif /* CONFIG_SYS_NO_FLASH */
+   return 0;
+}
+
+int dram_init(void)
+{
+   unsigned long sdram_base = PHYS_SDRAM_0;
+   unsigned long expected_size = PHYS_SDRAM_0_SIZE;
+   unsigned long actual_size;
+
+   actual_size = get_ram_size((void *)sdram_base, expected_size);
+
+   gd->ram_size = actual_size;
+
+   if (expected_size != actual_size) {
+   printf("Warning: Only %lu of %lu MiB SDRAM is working\n",
+   actual_size >> 20, expected_size >> 20);
+   }
+
+   return 0;
+}
+
+int board_eth_init(bd_t *bd)
+{
+   return ftgmac100_initialize(bd);
+}
+
+#if !defined(CONFIG_SYS_NO_FLASH)
+ulong board_flash_get_legacy(ulong base, int banknum, flash_info_t *info)
+{
+   if (banknum == 0) { /* non-CFI boot flash */
+   info->portwidth = FLASH_CFI_8BIT;
+   info->chipwidth = FLASH_CFI_BY8;
+   info->interface = FLASH_CFI_X8;
+   return 1;
+   } else {
+   return 0;
+   }
+}
+#endif /* CONFIG_SYS_NO_FLASH */
+
+#if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
+void pci_init_board(void)
+{
+   /* should be pci_ftpci100_init() */
+   extern void pci_ftpci_init();
+
+   pci_ftpci_init();
+}
+#endif
+
+#ifdef CO

[U-Boot] [PATCH v3 2/4] nds32/ag102: add ag102 soc support

2012-02-27 Thread Macpaul Lin
From: Macpaul Lin 

Add lowlevel ag102 soc support.

Signed-off-by: Macpaul Lin 
---
Changes for v2:
  - cpu.c:
   - 1. Remove unused variables.
   - 2. Replace while(1) in do_reset by hang().
   - 3. Clean up other coding styles.
  - timer.c: remove unneccessary static declaration
Changes for v3:
  - watchdog.S: add support macro in linkage.h

 arch/nds32/cpu/n1213/ag102/Makefile|   58 ++
 arch/nds32/cpu/n1213/ag102/cpu.c   |  195 ++
 arch/nds32/cpu/n1213/ag102/lowlevel_init.S |  297 
 arch/nds32/cpu/n1213/ag102/timer.c |  205 +++
 arch/nds32/cpu/n1213/ag102/watchdog.S  |   49 +
 5 files changed, 804 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag102/Makefile
 create mode 100644 arch/nds32/cpu/n1213/ag102/cpu.c
 create mode 100644 arch/nds32/cpu/n1213/ag102/lowlevel_init.S
 create mode 100644 arch/nds32/cpu/n1213/ag102/timer.c
 create mode 100644 arch/nds32/cpu/n1213/ag102/watchdog.S

diff --git a/arch/nds32/cpu/n1213/ag102/Makefile 
b/arch/nds32/cpu/n1213/ag102/Makefile
new file mode 100644
index 000..8716c4e
--- /dev/null
+++ b/arch/nds32/cpu/n1213/ag102/Makefile
@@ -0,0 +1,58 @@
+#
+# (C) Copyright 2009
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# Copyright (C) 2011 Andes Technology Corporation
+# Shawn Lin, Andes Technology Corporation 
+# Macpaul Lin, Andes Technology Corporation 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(SOC).o
+
+COBJS-y:= cpu.o timer.o
+
+ifndef CONFIG_SKIP_LOWLEVEL_INIT
+SOBJS  := lowlevel_init.o
+endif
+
+ifndef CONFIG_SKIP_TRUNOFF_WATCHDOG
+SOBJS  += watchdog.o
+endif
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/nds32/cpu/n1213/ag102/cpu.c b/arch/nds32/cpu/n1213/ag102/cpu.c
new file mode 100644
index 000..ed88b52
--- /dev/null
+++ b/arch/nds32/cpu/n1213/ag102/cpu.c
@@ -0,0 +1,195 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH 
+ * Marius Groeger 
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, 
+ *
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Shawn Lin, Andes Technology Corporation 
+ * Macpaul Lin, Andes Technology Corporation 
+ *
+ * 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
+ */
+
+/* CPU specific code */
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+/*
+ * cleanup_before_linux() is called just before we call linux
+ * it prepares the processor for linux
+ *
+ * we disable interrupt and caches.
+ */
+int cleanup_before_linux(void)
+{
+   disable_interrupts();
+
+#ifdef CONFIG_MMU
+   /* turn off I/D-cache */
+   icache_disable();
+   dcache_disable();
+
+   /* flush I/D-cache */
+   invalidate_icac();
+   invalidate_dcac();
+#endif
+
+   return 0;
+}
+
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+   disable_interrupts();
+
+   /*
+* reset to the base addr of andesboot.
+* currently no ROM loader at addr 0.
+ 

[U-Boot] [PATCH v3 1/4] nds32/ag102: add header support of ag102 soc

2012-02-27 Thread Macpaul Lin
From: Macpaul Lin 

Add device address offsets header of ag102 soc.
Add ag102 into mach-types.h.
Add asm-offsets.c for helping convert C headers into asm.

Signed-off-by: Macpaul Lin 
---
Changes for v2-v3:
  - No change.

 arch/nds32/cpu/n1213/ag102/asm-offsets.c  |   54 
 arch/nds32/include/asm/arch-ag102/ag102.h |   97 +
 arch/nds32/include/asm/mach-types.h   |   14 
 3 files changed, 165 insertions(+), 0 deletions(-)
 create mode 100644 arch/nds32/cpu/n1213/ag102/asm-offsets.c
 create mode 100644 arch/nds32/include/asm/arch-ag102/ag102.h

diff --git a/arch/nds32/cpu/n1213/ag102/asm-offsets.c 
b/arch/nds32/cpu/n1213/ag102/asm-offsets.c
new file mode 100644
index 000..4769a95
--- /dev/null
+++ b/arch/nds32/cpu/n1213/ag102/asm-offsets.c
@@ -0,0 +1,54 @@
+/*
+ * Adapted from Linux v2.6.36 kernel: arch/powerpc/kernel/asm-offsets.c
+ *
+ * Generate definitions needed by assembly language modules.
+ * This code generates raw asm output which is post-processed to extract
+ * and format the required data.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include 
+
+#include 
+
+int main(void)
+{
+#ifdef CONFIG_FTSMC020
+   OFFSET(FTSMC020_BANK0_CR,   ftsmc020, bank[0].cr);
+   OFFSET(FTSMC020_BANK0_TPR,  ftsmc020, bank[0].tpr);
+#endif
+   BLANK();
+#ifdef CONFIG_FTAHBC020S
+   OFFSET(FTAHBC020S_SLAVE_BSR_6,  ftahbc02s, s_bsr[6]);
+   OFFSET(FTAHBC020S_CR,   ftahbc02s, cr);
+#endif
+   BLANK();
+#ifdef CONFIG_ANDES_PCU
+   OFFSET(ANDES_PCU_PCS4,  andes_pcu, pcs4.parm);  /* 0x104 */
+#endif
+   BLANK();
+#ifdef CONFIG_DWCDDR21MCTL
+   OFFSET(DWCDDR21MCTL_CCR,dwcddr21mctl, ccr); /* 0x04 */
+   OFFSET(DWCDDR21MCTL_DCR,dwcddr21mctl, dcr); /* 0x04 */
+   OFFSET(DWCDDR21MCTL_IOCR,   dwcddr21mctl, iocr);/* 0x08 */
+   OFFSET(DWCDDR21MCTL_CSR,dwcddr21mctl, csr); /* 0x0c */
+   OFFSET(DWCDDR21MCTL_DRR,dwcddr21mctl, drr); /* 0x10 */
+   OFFSET(DWCDDR21MCTL_DLLCR0, dwcddr21mctl, dllcr[0]); /* 0x24 */
+   OFFSET(DWCDDR21MCTL_DLLCR1, dwcddr21mctl, dllcr[1]); /* 0x28 */
+   OFFSET(DWCDDR21MCTL_DLLCR2, dwcddr21mctl, dllcr[2]); /* 0x2c */
+   OFFSET(DWCDDR21MCTL_DLLCR3, dwcddr21mctl, dllcr[3]); /* 0x30 */
+   OFFSET(DWCDDR21MCTL_DLLCR4, dwcddr21mctl, dllcr[4]); /* 0x34 */
+   OFFSET(DWCDDR21MCTL_DLLCR5, dwcddr21mctl, dllcr[5]); /* 0x38 */
+   OFFSET(DWCDDR21MCTL_DLLCR6, dwcddr21mctl, dllcr[6]); /* 0x3c */
+   OFFSET(DWCDDR21MCTL_DLLCR7, dwcddr21mctl, dllcr[7]); /* 0x40 */
+   OFFSET(DWCDDR21MCTL_DLLCR8, dwcddr21mctl, dllcr[8]); /* 0x44 */
+   OFFSET(DWCDDR21MCTL_DLLCR9, dwcddr21mctl, dllcr[9]); /* 0x48 */
+   OFFSET(DWCDDR21MCTL_RSLR0,  dwcddr21mctl, rslr[0]); /* 0x4c */
+   OFFSET(DWCDDR21MCTL_RDGR0,  dwcddr21mctl, rdgr[0]); /* 0x5c */
+   OFFSET(DWCDDR21MCTL_DTAR,   dwcddr21mctl, dtar);/* 0xa4 */
+   OFFSET(DWCDDR21MCTL_MR, dwcddr21mctl, mr);  /* 0x1f0 */
+#endif
+   return 0;
+}
diff --git a/arch/nds32/include/asm/arch-ag102/ag102.h 
b/arch/nds32/include/asm/arch-ag102/ag102.h
new file mode 100644
index 000..a12a8c5
--- /dev/null
+++ b/arch/nds32/include/asm/arch-ag102/ag102.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2011 Andes Technology Corporation
+ * Macpaul Lin, Andes Technology Corporation 
+ *
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __AG102_H
+#define __AG102_H
+
+/*
+ * Hardware register bases
+ */
+
+/* PCI Controller */
+#define CONFIG_FTPCI100_BASE   0x9000
+/* LPC Controller */
+#define CONFIG_LPC_IO_BASE 0x9010
+/* LPC Controller */
+#define CONFIG_LPC_BASE0x9020
+
+/* NDS32 Data Local Memory 01 */
+#define CONFIG_NDS_DLM1_BASE   0x9030
+/* NDS32 Data Local Memory 02 */
+#define CONFIG_NDS_DLM2_BASE   0x9040
+
+/* Synopsys DWC DDR2/1 Controller */
+#define CONFIG_DWCDDR21MCTL_BASE   0x9050
+/* DMA Controller */
+#define CONFIG_FTDMAC020_BASE  0x9060
+/* FTIDE020_S IDE (ATA) Contr

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

2012-02-27 Thread Macpaul Lin
Dear Wolfgang,

Please pull the following change into u-boot/master, thanks!.

The following changes since commit 54e96680cb96fb7a4b8f43fd949c62054004d3e5:

  Merge branch 'master' of git://git.denx.de/u-boot-microblaze (2012-02-26
22:17:40 +0100)

are available in the git repository at:

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

Macpaul Lin (3):
  nds32: add linkage support
  nds32/ag101/watchdog.S: add linkage support
  nds32/board.c: add PCI prompt at boot up

 arch/nds32/cpu/n1213/ag101/watchdog.S |5 +++--
 arch/nds32/include/asm/linkage.h  |   28 
 arch/nds32/lib/board.c|1 +
 3 files changed, 32 insertions(+), 2 deletions(-)
 create mode 100644 arch/nds32/include/asm/linkage.h

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


Re: [U-Boot] [PATCH] nds32/board.c: add PCI prompt at boot up

2012-02-27 Thread Macpaul Lin
Hi Macpaul,

2011/11/29 Macpaul Lin 

> add PCI prompt at boot up for probing PCI device
>
> Signed-off-by: Macpaul Lin 
> ---
>  arch/nds32/lib/board.c |1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
> index 66e4537..074aabf 100644
> --- a/arch/nds32/lib/board.c
> +++ b/arch/nds32/lib/board.c
> @@ -365,6 +365,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
>env_relocate();
>
>  #if defined(CONFIG_CMD_PCI) || defined(CONFIG_PCI)
> +   puts("PCI:   ");
>nds32_pci_init();
>  #endif
>
> --
> 1.7.3.5
>
>
Applied to u-boot-nds32.git/master
Thanks!

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


Re: [U-Boot] [PATCH v2 2/2] nds32/ag101/watchdog.S: add linkage support

2012-02-27 Thread Macpaul Lin
Hi Macpaul

2011/12/1 Macpaul Lin 

> Add linkage support to watchdog.S.
>
> Signed-off-by: Macpaul Lin 
> ---
> Changes for v2:
>  - No change.
>
>  arch/nds32/cpu/n1213/ag101/watchdog.S |5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
>
>
Applied, thanks,


-- 
Best regards,
Macpaul Lin
___
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-02-27 Thread Allen Martin
> Subject: Re: [U-Boot] [PATCH] USB: reevaluate iomux stdin on USB kbd
> detect
> 
> > If CONSOLE_MUX is enabled, reevaluate console stdin when USB keyboard
> > device is detected.
> >
> > Signed-off-by: Allen Martin 
> > ---
> 
> Hi,
> 
> what's the status of this patch/patchset?
> 

Both this and the keyboard polling patch have been accepted into u-boot-usb.git:

$ git log -2 u-boot-usb/master
commit b27c7b2e19a6c211d0ddca5bb62685685a36498b
Author: Allen Martin 
Date:   Tue Dec 20 16:56:16 2011 -0800

USB: move keyboard polling into kbd driver

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 

commit ce9da24a92707f0e84da901eaaa896c17c8b5630
Author: Allen Martin 
Date:   Fri Dec 23 12:29:48 2011 -0800

USB: reevaluate iomux stdin on USB kbd detect

If CONSOLE_MUX is enabled, reevaluate console stdin when USB keyboard
device is detected.

Signed-off-by: Allen Martin 

---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] ARM: Update mach-types

2012-02-27 Thread Troy Kisky

On 2/27/2012 3:56 PM, Marek Vasut wrote:

|ARM: Update mach-types
|
|This commit updates the mach-types based on the latest in Linus's head
|
|Signed-off-by: Marek Vasut

Hi Marek,


Can I get you to do this again? I'd the symbol for
MACH_MX6Q_SABRELITE.


No, can you please submit the mach-types update yourself? Thank you!

I don't think I'm trusted to do that. I think that some machines may 
have been removed
from Linux that u-boot may want to keep. Since I only want to use the 
value in 1 place,

is it acceptable to just use the hex value instead?

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


Re: [U-Boot] [RFC} [PATCH] Feature removal due to lack of custodians

2012-02-27 Thread Mike Frysinger
On Saturday 25 February 2012 17:10:31 Wolfgang Denk wrote:
> +What:Network Support
> +When:v2012.09
> +Why: Lack of a custodian, and lack of time and/or sponsors.

i've been pondering whether to help out here for a month or two.  i know 
you're not entirely serious wrt removal, but i guess i can try being the net 
guy for now and see how it works out.  i've done enough grubbing in the 
drivers/net/ and net/ code at this point to understand it.  then it's "just" a 
matter of time.
-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] USB:host: Attribute packed removed from usb structures

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 15:53:29 Marek Vasut wrote:
> > On Monday 27 February 2012 08:14:26 Marek Vasut wrote:
> > > > On 2/25/2012 3:42 PM, Albert ARIBAUD wrote:
> > > > > Le 24/02/2012 12:58, Amit Virdi a écrit :
> > > > >> Packed attribute is forcing a bytewise write on device registers,
> > > > >> there by, resulting in a misbehavior on gcc-4.4.1.
> > > > >> Reverting the structures to non-packed
> > > > > 
> > > > > If (just asking, not asserting) the issue is caused by fields being
> > > > > u8 where u8 access is not possible, then should you not make the
> > > > > fields u16 / u32 according to access requirements?
> > > > 
> > > > The problem is not with the fields being of a different width. AFAIK,
> > > > the packed attribute changes the generated code to access even the
> > > > word field elements in a byte by byte manner
> > > > 
> > > > Infact, there is a discussion on lkml that I can point
> > > > https://lkml.org/lkml/2011/4/27/278
> > > > 
> > > > It seems that the discussion did not lead to a conclusion but it was
> > > > sensible (at least for ARM) to remove the packed attribute from this
> > > > structure
> > > 
> > > What does the USB spec say ? It might be a HW bug?
> > 
> > it isn't covered by the USB spec.  these are structs for hardware
> > registers in the EHCI usb host controller.
> 
> I see ... so replacing them with unions of accessors where it colides might
> work ?

i'm not entirely sure what you're asking, but i think you're pointing to the 
right answer: drivers/usb/host/ehci.h:ehci_{read,write}l() should *not* be 
casting/derferencing the pointers directly.  they should instead be using 
standard {read,write}l() funcs from asm/io.h.

Amit: can you post a new patch that does that instead ?  don't touch the 
packed attribute, but change ehci_readl() to use readl() and ehci_writel() to 
use writel() ?
-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 v6 0/20] tegra: Add fdt definitions and USB driver

2012-02-27 Thread Stephen Warren
On 02/27/2012 01:52 PM, Simon Glass wrote:
> This series brings in the Linux kernel fdt file and provides a working
> USB driver for Tegra2 Seaboard.

Aside from the issues I just pointed out, this series looks fine. I
didn't review most of the patches in detail though, just those related
to the DT binding.

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


Re: [U-Boot] [PATCH v6 15/20] tegra: fdt: Add function to return peripheral/clock ID

2012-02-27 Thread Stephen Warren
On 02/27/2012 01:52 PM, Simon Glass wrote:
> 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).

> +int clock_decode_periph_id(const void *blob, int node)

> + valid = clock_periph_id_isvalid(id);

clock_periph_id_isvalid() is not the correct function to use here; the
code should be checking for invalid IDs in the CAR binding, not invalid
IDs in the HW periph ID definition. They're different.

Just to be explicit, the function you need here would be:

int clkid_to_periphid(int clkid)
{
if (clk_id > 95)
return -1;
switch (clk_id) {
case 1:
case 2:
case 7:
case 10:
case 20:
case 30:
case 35:
case 49:
case 56:
case 74:
case 77:
case 78:
case 79:
case 80:
case 81:
case 82:
case 83:
case 91:
case 95:
return -1;
default:
return clkid;
}
}

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


Re: [U-Boot] [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard

2012-02-27 Thread Stephen Warren
On 02/27/2012 01:52 PM, Simon Glass wrote:
> Add the definition of the oscillator clock frequency.

> diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
> b/board/nvidia/dts/tegra2-seaboard.dts

> + clock@60006000 {
> + clocks = <&osc>;
> + };

The CAR takes two clock inputs; one 32KHz clock (typically from the
PMU/PMIC) and one from the oscillator. The 32KHz one is missing here. I
guess this won't make any difference to U-Boot since it isn't using the
clock inputs in the CAR driver, but it'd be best if the .dts file
contained the correct content so it didn't act as an incorrect example.
See the example in the binding documentation for what should be there.

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


Re: [U-Boot] [PATCH v6 09/20] tegra: fdt: Add additional USB binding

2012-02-27 Thread Stephen Warren
On 02/27/2012 01:52 PM, Simon Glass wrote:
> This adds a property to indicate a port which can switch between host and 
> device
> mode.
...
> diff --git a/doc/device-tree-bindings/usb/tegra-usb.txt 
> b/doc/device-tree-bindings/usb/tegra-usb.txt
...
> +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.

Those last two lines need to be indented 1 extra space each so the text
lines up with "dr_mode". I assume that Tom can do this when applying the
change to save any respins etc.

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


Re: [U-Boot] ARM: Update mach-types

2012-02-27 Thread Marek Vasut
> |ARM: Update mach-types
> |
> |This commit updates the mach-types based on the latest in Linus's head
> |
> |Signed-off-by: Marek Vasut 
> 
> Hi Marek,
> 
> 
> Can I get you to do this again? I'd the symbol for
> MACH_MX6Q_SABRELITE.


No, can you please submit the mach-types update yourself? Thank you!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface

2012-02-27 Thread Scott Wood
On 02/27/2012 04:02 AM, Stefan Roese wrote:
>> diff --git a/include/configs/spear-common.h
>> b/include/configs/spear-common.h index 516b78e..c37305f 100644
>> --- a/include/configs/spear-common.h
>> +++ b/include/configs/spear-common.h
>> @@ -90,7 +90,7 @@
>>  /* NAND FLASH Configuration */
>>  #define CONFIG_MTD_DEVICE
>>  #define CONFIG_MTD_PARTITIONS
>> -#define CONFIG_NAND_SPEAR   1
>> +#define CONFIG_NAND_FSMC
>>  #define CONFIG_SYS_MAX_NAND_DEVICE  1
>>  #define CONFIG_MTD_NAND_VERIFY_WRITE
> 
> I suggest that you remove this last define. Most likely it was added for 
> debugging purpose only. It slows down the speed and it brakes UBI support.

What is the problem with UBI?

>> +/* NAND flash configuration */
>> +#define CONFIG_SYS_FSMC_NAND_SP
>> +#define CONFIG_SYS_FSMC_NAND_8BIT
> 
> You also need the following define for this to work with the latest NAND 
> subsystem:
> 
> #define CONFIG_MTD_ECC_SOFT
> 
> Not sure about SPEAr3xx. Most likely this needs it as well.

This is going to be reverted for now -- I meant to leave it out of the
last patchset because of the need to update all boards (which the patch
did not do).

-Scott

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


[U-Boot] [PATCH] ARM: Add .data/.rodata/.bss section starts to gd_t

2012-02-27 Thread Peter Barada
When debugging u-boot, after relocation its tedious to calculate positions
of the various sections (.data, .rodata, .bss).  To make it easier, add
the structure "sections" to gd_t that contains the relocated start of
those sections.  Then the gdb command "add-symbol-file" can by used with
"-s  " that corresponds to the values in gd_t->sections.

Signed-off-by: Peter Barada 
---
 README |6 ++
 arch/arm/cpu/arm1136/start.S   |   10 ++
 arch/arm/cpu/arm1136/u-boot.lds|6 +-
 arch/arm/cpu/arm1176/start.S   |   10 ++
 arch/arm/cpu/arm1176/u-boot.lds|6 +-
 arch/arm/cpu/arm720t/start.S   |   10 ++
 arch/arm/cpu/arm720t/u-boot.lds|6 +-
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds |   10 --
 arch/arm/cpu/arm920t/start.S   |   10 ++
 arch/arm/cpu/arm920t/u-boot.lds|6 +-
 arch/arm/cpu/arm925t/start.S   |   10 ++
 arch/arm/cpu/arm925t/u-boot.lds|6 +-
 arch/arm/cpu/arm926ejs/mx28/start.S|   10 ++
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds |6 +-
 arch/arm/cpu/arm926ejs/start.S |   10 ++
 arch/arm/cpu/arm926ejs/u-boot.lds  |6 +-
 arch/arm/cpu/arm946es/start.S  |   10 ++
 arch/arm/cpu/arm946es/u-boot.lds   |6 +-
 arch/arm/cpu/arm_intcm/start.S |   10 ++
 arch/arm/cpu/arm_intcm/u-boot.lds  |6 +-
 arch/arm/cpu/armv7/omap-common/u-boot-spl.lds  |   11 +--
 arch/arm/cpu/armv7/start.S |   10 ++
 arch/arm/cpu/armv7/u-boot.lds  |6 +-
 arch/arm/cpu/ixp/start.S   |   10 ++
 arch/arm/cpu/ixp/u-boot.lds|6 +-
 arch/arm/cpu/lh7a40x/start.S   |   10 ++
 arch/arm/cpu/lh7a40x/u-boot.lds|6 +-
 arch/arm/cpu/pxa/start.S   |   10 ++
 arch/arm/cpu/pxa/u-boot.lds|6 +-
 arch/arm/cpu/s3c44b0/start.S   |   10 ++
 arch/arm/cpu/s3c44b0/u-boot.lds|6 +-
 arch/arm/cpu/sa1100/start.S|   10 ++
 arch/arm/cpu/sa1100/u-boot.lds |6 +-
 arch/arm/include/asm/config.h  |3 +++
 arch/arm/include/asm/global_data.h |   13 +
 arch/arm/include/asm/u-boot-arm.h  |4 
 arch/arm/lib/board.c   |7 +++
 board/ait/cam_enc_4xx/u-boot-spl.lds   |   11 +--
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |   10 --
 board/davinci/da8xxevm/u-boot-spl-hawk.lds |6 +-
 board/vpac270/u-boot-spl.lds   |6 +-
 common/cmd_bdinfo.c|5 +
 nand_spl/board/freescale/mx31pdk/u-boot.lds|6 +-
 nand_spl/board/karo/tx25/u-boot.lds|6 +-
 44 files changed, 317 insertions(+), 27 deletions(-)

diff --git a/README b/README
index eba6378..0d7a7a0 100644
--- a/README
+++ b/README
@@ -426,6 +426,12 @@ The following options need to be configured:
Select high exception vectors of the ARM core, e.g., do not
clear the V bit of the c1 register of CP15.
 
+   CONFIG_GDB_SECTIONS_START
+
+   Add to gd_t "sections" structure containing starting addresses
+   of .bss, .data, and .rodata sections to allow
+   "gdb add-symbol-file" to work once u-boot is relocated.
+
 - Linux Kernel Interface:
CONFIG_CLOCKS_IN_MHZ
 
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index c0db96c..9ab4351 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -108,6 +108,16 @@ _bss_end_ofs:
 _end_ofs:
.word _end - _start
 
+#ifdef CONFIG_GDB_SECTIONS_START
+.globl _data_start_ofs
+_data_start_ofs:
+   .word __data_start - _start
+
+.globl _rodata_start_ofs
+_rodata_start_ofs:
+   .word __rodata_start - _start
+#endif
+
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm1136/u-boot.lds b/arch/arm/cpu/arm1136/u-boot.lds
index d1e2851..751fa21 100644
--- a/arch/arm/cpu/arm1136/u-boot.lds
+++ b/arch/arm/cpu/arm1136/u-boot.lds
@@ -45,10 +45,14 @@ SECTIONS
}
 
. = ALIGN(4);
-   .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
+   .rodata : {
+   __rodata_start = .;
+   *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+   }
 
. = ALIGN(4);
.data : {
+   __data_start = .;
*(.data)
}
 
diff --git a/arch/arm/cpu/arm1176

Re: [U-Boot] ARM: Update mach-types

2012-02-27 Thread Troy Kisky

|ARM: Update mach-types
|
|This commit updates the mach-types based on the latest in Linus's head
|
|Signed-off-by: Marek Vasut 

Hi Marek,


Can I get you to do this again? I'd the symbol for
MACH_MX6Q_SABRELITE.

Thanks
Troy

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


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

2012-02-27 Thread Simon Glass
Hi Tom,

On Mon, Feb 27, 2012 at 1:44 PM, Tom Warren  wrote:
> Marek/Simon,
>
>> -Original Message-
>> From: Marek Vasut [mailto:marek.va...@gmail.com]
>> Sent: Monday, February 27, 2012 1:55 PM
>> To: u-boot@lists.denx.de
>> Cc: Simon Glass; Tom Warren
>> Subject: Re: [U-Boot] [PATCH v5 0/18] tegra: Add fdt definitions and USB
>> driver
>>
>> > Hi,
>> >
>> > On Sun, Feb 26, 2012 at 7:02 PM, Simon Glass  wrote:
>> > > Hi Marek,
>> > >
>> > > On Sun, Feb 26, 2012 at 3:13 PM, Marek Vasut  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).
>> > >>
>> > >> Hi,
>> > >>
>> > >> what's the status of this patch/patchset?
>> > >
>> > > Superceded, v6 is on its way in the next few days.
>> >
>> > I am about to send v6. Due to the way things are organized, 6 of that
>> > patches have changed. I have also dropped the fdt alignment one. So I
>> > think it is safest to resend the whole 20-patch series again.
>> >
>> > Regards,
>> > Simon
>>
>> Please wait until wednesday with the submission until we sort out the usb
>> maintainership and until the most significant USB changes find their way
>> into mainline uboot.
>>
>
> For those that don't want to wait, I've applied this patch series to 
> u-boot-tegra/test and pushed to denx.
>
> Simon - seems to work fine - USB->NET dongle, USB mouse, and USB stick all 
> detected OK, both directly and behind the hub on the USB->NET dongle (Asix 
> 3-port hub w/Ethernet adapter).

OK thanks, good. Hoping that Puneet's alignment fixes can go in soon also.

>
> I'll wait a couple of days for the reviews & USB issues to sort themselves 
> out before doing a pull request to Albert for ARM, but I want to get this in 
> so I can move forward with the other Tegra2 drivers (I2C, LCD, kbd, etc.) 
> that depend on fdt/DT.

I will have to do an update to i2c sorry, due to Stephen's clock
binding changes. Yes I know it is acked and ready, but it will not
work now. Wil try to do that today. After that is warmboot - have you
taken a look at that?

Regards,
Simon

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


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

2012-02-27 Thread Tom Warren
Marek/Simon,

> -Original Message-
> From: Marek Vasut [mailto:marek.va...@gmail.com]
> Sent: Monday, February 27, 2012 1:55 PM
> To: u-boot@lists.denx.de
> Cc: Simon Glass; Tom Warren
> Subject: Re: [U-Boot] [PATCH v5 0/18] tegra: Add fdt definitions and USB
> driver
> 
> > Hi,
> >
> > On Sun, Feb 26, 2012 at 7:02 PM, Simon Glass  wrote:
> > > Hi Marek,
> > >
> > > On Sun, Feb 26, 2012 at 3:13 PM, Marek Vasut  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).
> > >>
> > >> Hi,
> > >>
> > >> what's the status of this patch/patchset?
> > >
> > > Superceded, v6 is on its way in the next few days.
> >
> > I am about to send v6. Due to the way things are organized, 6 of that
> > patches have changed. I have also dropped the fdt alignment one. So I
> > think it is safest to resend the whole 20-patch series again.
> >
> > Regards,
> > Simon
> 
> Please wait until wednesday with the submission until we sort out the usb
> maintainership and until the most significant USB changes find their way
> into mainline uboot.
> 

For those that don't want to wait, I've applied this patch series to 
u-boot-tegra/test and pushed to denx.

Simon - seems to work fine - USB->NET dongle, USB mouse, and USB stick all 
detected OK, both directly and behind the hub on the USB->NET dongle (Asix 
3-port hub w/Ethernet adapter).

I'll wait a couple of days for the reviews & USB issues to sort themselves out 
before doing a pull request to Albert for ARM, but I want to get this in so I 
can move forward with the other Tegra2 drivers (I2C, LCD, kbd, etc.) that 
depend on fdt/DT.

Tom

-- 
nvpublic

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


[U-Boot] [PATCH v6 06/20] tegra: fdt: Add device tree file for Tegra2 Seaboard from kernel

2012-02-27 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 
---

 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 v6 12/20] tegra: usb: fdt: Add additional device tree definitions for USB ports

2012-02-27 Thread Simon Glass
This adds clock references to the USB part of the device tree for U-Boot,
and marks USB1 as supporting legacy mode (which we disable in the driver).

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 
---
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 /* */

Changes in v6:
- Remove dr_mode properties from SOC .dtsi file and move to boards

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

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index 2c46e11..d6bc9f1 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -165,6 +165,8 @@
reg = <0xc500 0x4000>;
interrupts = < 52 >;
phy_type = "utmi";
+   clocks = <&tegra_car 22>;   /* PERIPH_ID_USBD */
+   nvidia,has-legacy-mode;
};
 
usb@c5004000 {
@@ -172,6 +174,7 @@
reg = <0xc5004000 0x4000>;
interrupts = < 53 >;
phy_type = "ulpi";
+   clocks = <&tegra_car 58>;   /* PERIPH_ID_USB2 */
};
 
usb@c5008000 {
@@ -179,6 +182,7 @@
reg = <0xc5008000 0x4000>;
interrupts = < 129 >;
phy_type = "utmi";
+   clocks = <&tegra_car 59>;   /* PERIPH_ID_USB3 */
};
 
 };
-- 
1.7.7.3

___
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-02-27 Thread Marek Vasut
> On Sunday 26 February 2012 23:10:18 Mike Frysinger wrote:
> > On Sunday 26 February 2012 17:08:04 Marek Vasut wrote:
> > > > On Tuesday 24 January 2012 15:27:57 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.
> > > > 
> > > > Hi, what is state of this patch series? From our discussion is only
> > > > problematic bootmenu part, but other could be OK.
> > > > 
> > > > So what is needed for including this patches (without bootmenu
> > > > support) to uboot master?
> > > 
> > > You should probably split the patches into smaller series and resubmit
> > > individually.
> > 
> > yeah, we aren't keen on manually trying to pick things out of a patchset
> > since it's hard for us to know what is required to be together.  a
> > patchset, by nature, should be merged as a group.
> > -mike
> 
> Ok, I will create new patchset and fix known problems
> (CONFIG_CMDLINE_EDITING)

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


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

2012-02-27 Thread Simon Glass
Hi Mike,

On Mon, Feb 27, 2012 at 10:32 AM, Mike Frysinger  wrote:
> On Monday 27 February 2012 00:43:30 Simon Glass wrote:
>> On Sun, Feb 26, 2012 at 8:42 PM, Mike Frysinger wrote:
>> > drivers/mtd/spi/sandbox.c:
>> > static int sb_cmdline_cb_spi_sf(struct sandbox_state *state, const char
>> > *arg) {
>> >    unsigned long bus, cs;
>> >    const char *spec = sb_spi_parse_spec(arg, &bus, &cs);
>> >
>> >    if (!spec)
>> >        return 1;
>> >
>> >    state->spi[bus][cs][0] = &sb_sf_ops;
>> >    state->spi[bus][cs][1] = spec;
>> >    return 0;
>> > }
>> > SB_CMDLINE_OPT(spi_sf, 1, "connect a SPI flash: :::");
>>
>> sandbox...give me your address and I'll send you a cheque to cover the
>> bytes so used :-)
>
> it'll have to be a big one to stop the cascading line wrapping :P
>
>> > and people could do:
>> >        ./u-boot --spi_sf 0:3:m25p16:./some-file.bin
>> > this would connect the spi flash simulation up to the simulated spi bus 0
>> > on cs 3 and have it simulate a m25p16 flash with "some-file.bin" backing
>> > it.
>> >
>> > if someone were to enter the wrong value for
>> > "0:3:m25p16:./some-file.bin", how do you propose we communicate that ?
>> >  the existing code can easily signal the higher parsing logic via return
>> > values, but then we'd just get:
>> >        failed to parse option: 0:3:m25p16:./some-file.bin
>> >
>> > but what exactly did the code not like ?  was it the bus # ?  the cs # ?
>> >  the spi flash id ?  the backing file ?  if the getopt code has access
>> > to printf(), we can clearly communicate to the user what is going wrong.
>>
>> Yes I think printf() is useful in getopt, I just would prefer to avoid
>> using U-Boot's printf. It goes through all the console code, and we
>> might be running a test that deliberately breaks that, perhaps.
>> Actually this could be a pretty important thing to sort out - we need
>> to keep a clear boundary between test code and U-Boot code (as we
>> discussed over GPIO). Having the test code use U-Boot's printf() is
>> blurring that.
>
> we probably need to add architecture details like this to doc/README.sandbox
> so we can stay on the same page ...

Yes I agree.

>
>> To your example, if the syntax is correct perhaps, then it got through
>> initial parsing. If the filename is wrong, or the bus number, then
>> perhaps there will be a message and failure much later. Perhaps the
>> initial parsing just does what it can to avoid running past an obvious
>> syntax error. But we can't really know success until we open the file,
>> or try the bus.
>
> if the bus/cs are valid, the rest of the parsing is delayed until you do "sf
> probe" at which point you'd get an explanation of what is wrong.  i guess we
> can live with this for now.

Yes, I feel like we have done more than enough plumbing in advance of
use. Let's see how it goes.

Regards,
Simon

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


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

2012-02-27 Thread Marek Vasut
> Hi,
> 
> On Sun, Feb 26, 2012 at 7:02 PM, Simon Glass  wrote:
> > Hi Marek,
> > 
> > On Sun, Feb 26, 2012 at 3:13 PM, Marek Vasut  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).
> >> 
> >> Hi,
> >> 
> >> what's the status of this patch/patchset?
> > 
> > Superceded, v6 is on its way in the next few days.
> 
> I am about to send v6. Due to the way things are organized, 6 of that
> patches have changed. I have also dropped the fdt alignment one. So I
> think it is safest to resend the whole 20-patch series again.
> 
> Regards,
> Simon

Please wait until wednesday with the submission until we sort out the usb 
maintainership and until the most significant USB changes find their way into 
mainline uboot.

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


Re: [U-Boot] [PULL] u-boot-pxa / fix

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> Le 27/02/2012 14:03, Marek Vasut a écrit :
> > The following changes since commit 417c2c787e32784b5de975065a7d1dd5b3cc8ecd:
> >at91: modified NAND flash timing on otc570 board (2012-02-20 09:00:13
> >+0100)
> > 
> > are available in the git repository at:
> >git://git.denx.de/u-boot-pxa.git fix
> > 
> > for you to fetch changes up to 2e85d5c10f01b21ac47f9b0dd4a9dcc022ac0be6:
> >PXA: Fix missing get_tbclk() breaking vpac boards (2012-02-27 13:59:47
> >+0100)
> > 
> > 
> > 
> > Marek Vasut (3):
> >PXA: Remove PXA PCMCIA support
> >PXA: Fix warning in zipitz2
> >PXA: Fix missing get_tbclk() breaking vpac boards
> > 
> > Simon Glass (1):
> >arm: Remove jornada link script
> > 
> > Vasily Khoruzhick (2):
> >zipitz2: fix boot issue introduced by PXA low level init rework
> >zipitz2: use pxa_mmc_gen as MMC driver
> >   
> >   arch/arm/cpu/pxa/timer.c|5 ++
> >   board/jornada/u-boot.lds|   58 ---
> >   board/zipitz2/zipitz2.c |9 
> >   doc/README.PXA_CF   |   56 --
> >   drivers/pcmcia/Makefile |1 -
> >   drivers/pcmcia/pxa_pcmcia.c |   93
> >   --- include/configs/zipitz2.h 
> >|   14 +-
> >   include/pcmcia.h|3 +-
> >   8 files changed, 26 insertions(+), 213 deletions(-)
> >   delete mode 100644 board/jornada/u-boot.lds
> >   delete mode 100644 doc/README.PXA_CF
> >   delete mode 100644 drivers/pcmcia/pxa_pcmcia.c
> 
> Is there a reason why this pull request is on a "fix" branch, not "master"?
> 
> Amicalement,

Since those are mostly fixes.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] USB:host: Attribute packed removed from usb structures

2012-02-27 Thread Marek Vasut
> On Monday 27 February 2012 08:14:26 Marek Vasut wrote:
> > > On 2/25/2012 3:42 PM, Albert ARIBAUD wrote:
> > > > Le 24/02/2012 12:58, Amit Virdi a écrit :
> > > >> Packed attribute is forcing a bytewise write on device registers,
> > > >> there by, resulting in a misbehavior on gcc-4.4.1.
> > > >> Reverting the structures to non-packed
> > > > 
> > > > If (just asking, not asserting) the issue is caused by fields being
> > > > u8 where u8 access is not possible, then should you not make the
> > > > fields u16 / u32 according to access requirements?
> > > 
> > > The problem is not with the fields being of a different width. AFAIK,
> > > the packed attribute changes the generated code to access even the word
> > > field elements in a byte by byte manner
> > > 
> > > Infact, there is a discussion on lkml that I can point
> > > https://lkml.org/lkml/2011/4/27/278
> > > 
> > > It seems that the discussion did not lead to a conclusion but it was
> > > sensible (at least for ARM) to remove the packed attribute from this
> > > structure
> > 
> > What does the USB spec say ? It might be a HW bug?
> 
> it isn't covered by the USB spec.  these are structs for hardware registers
> in the EHCI usb host controller.
> -mike

I see ... so replacing them with unions of accessors where it colides might 
work 
?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v6 11/20] tegra: fdt: Add clock bindings for Tegra2 Seaboard

2012-02-27 Thread Simon Glass
Add the definition of the oscillator clock frequency.

Signed-off-by: Simon Glass 
---
Changes in v6:
- Add new patch to bring in clock bindings to seaboard

 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..87f58fb 100644
--- a/board/nvidia/dts/tegra2-seaboard.dts
+++ b/board/nvidia/dts/tegra2-seaboard.dts
@@ -16,6 +16,16 @@
reg = < 0x 0x4000 >;
};
 
+   clocks {
+   osc {
+   clock-frequency = <1200>;
+   };
+   };
+
+   clock@60006000 {
+   clocks = <&osc>;
+   };
+
serial@70006300 {
clock-frequency = < 21600 >;
};
-- 
1.7.7.3

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


[U-Boot] [PATCH v6 19/20] tegra: usb: Enable USB on Seaboard

2012-02-27 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 
---
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 v6 18/20] tegra: usb: Add common USB defines for tegra2 boards

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

Signed-off-by: Simon Glass 
---
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 
 
-- 
1.7.7.3

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


[U-Boot] [PATCH v6 16/20] tegra: usb: Add support for Tegra USB peripheral

2012-02-27 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 
Signed-off-by: Simon Glass 
---
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

Changes in v6:
- Use updated clock_decode_periph_id() function

 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..c80de7f
--- /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 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+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 */
+   PARAM_BIAS_TIME,/* 20US DELAY AFter bias cell op */
+
+   PARAM_COUNT
+};
+
+/* Possible port types (dual role mode) */
+enum dr_mode {
+

[U-Boot] [PATCH v6 20/20] tegra: fdt: Enable FDT support for Seaboard

2012-02-27 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 
---
Changes in v3:
- Drop Tegra USB alignment patch as we will deal with this another way

Changes in v6:
- Drop fdt alignment patch as we will handle this after generic reloc

 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 
 #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 v6 15/20] tegra: fdt: Add function to return peripheral/clock ID

2012-02-27 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 
---
Changes in v4:
- Add fdtdec function to return peripheral ID

Changes in v6:
- Move peripheral decode function into Tegra's clock.c

 arch/arm/cpu/armv7/tegra2/clock.c|   19 +++
 arch/arm/include/asm/arch-tegra2/clock.h |   13 +
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/tegra2/clock.c 
b/arch/arm/cpu/armv7/tegra2/clock.c
index 11d2346..ffbfc28 100644
--- a/arch/arm/cpu/armv7/tegra2/clock.c
+++ b/arch/arm/cpu/armv7/tegra2/clock.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * This is our record of the current clock rate of each clock. We don't
@@ -918,6 +919,24 @@ void clock_ll_start_uart(enum periph_id periph_id)
reset_set_enable(periph_id, 0);
 }
 
+
+int clock_decode_periph_id(const void *blob, int node)
+{
+   enum periph_id id;
+   int err, valid;
+   u32 cell[2];
+
+   err = fdtdec_get_int_array(blob, node, "clocks", cell,
+  ARRAY_SIZE(cell));
+   if (err)
+   return -1;
+   id = cell[1];
+
+   valid = clock_periph_id_isvalid(id);
+   assert(valid);
+   return valid ? id : PERIPH_ID_NONE;
+}
+
 int clock_verify(void)
 {
struct clk_pll *pll = get_pll(CLOCK_ID_PERIPH);
diff --git a/arch/arm/include/asm/arch-tegra2/clock.h 
b/arch/arm/include/asm/arch-tegra2/clock.h
index 080ef18..6b12c76 100644
--- a/arch/arm/include/asm/arch-tegra2/clock.h
+++ b/arch/arm/include/asm/arch-tegra2/clock.h
@@ -177,6 +177,7 @@ enum periph_id {
PERIPH_ID_CRAM2,
 
PERIPH_ID_COUNT,
+   PERIPH_ID_NONE = -1,
 };
 
 /* Converts a clock number to a clock register: 0=L, 1=H, 2=U */
@@ -355,6 +356,18 @@ unsigned clock_get_rate(enum clock_id clkid);
  */
 void clock_ll_start_uart(enum periph_id periph_id);
 
+/**
+ * Decode a peripheral ID from a device tree node.
+ *
+ * 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 peripheral ID, or PERIPH_ID_NONE if none
+ */
+enum periph_id clock_decode_periph_id(const void *blob, int node);
+
 /*
  * Checks that clocks are valid and prints a warning if not
  *
-- 
1.7.7.3

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


[U-Boot] [PATCH v6 14/20] usb: Add support for txfifo threshold

2012-02-27 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 
Acked-by: Remy Bohmer 
---

 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 v6 07/20] fdt: Add staging area for device tree binding documentation

2012-02-27 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 
---
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 v6 05/20] tegra: fdt: Add Tegra2x device tree file from kernel

2012-02-27 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 
---

 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";
+

[U-Boot] [PATCH v6 13/20] tegra: usb: fdt: Add USB definitions for Tegra2 Seaboard

2012-02-27 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 
---
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

Changes in v6:
- Remove dr_mode properties from SOC .dtsi file and move to boards

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

diff --git a/board/nvidia/dts/tegra2-seaboard.dts 
b/board/nvidia/dts/tegra2-seaboard.dts
index 87f58fb..4fbb252 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 >;
@@ -42,5 +48,10 @@
 
usb@c500 {
nvidia,vbus-gpio = <&gpio 24 0>; /* PD0 */
+   dr_mode = "otg";
+   };
+
+   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 v6 10/20] tegra: fdt: Add clock bindings

2012-02-27 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

It is taken from Stephen Warren's patch here:

http://patchwork.ozlabs.org/patch/141359/

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add clock bindings for Tegra2x

Changes in v6:
- Add clock bindings from Stephen Warren's latest patch

 arch/arm/dts/tegra20.dtsi  |   16 ++
 .../clock/nvidia,tegra20-car.txt   |  207 
 2 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100644 doc/device-tree-bindings/clock/nvidia,tegra20-car.txt

diff --git a/arch/arm/dts/tegra20.dtsi b/arch/arm/dts/tegra20.dtsi
index a9a98ea..2c46e11 100644
--- a/arch/arm/dts/tegra20.dtsi
+++ b/arch/arm/dts/tegra20.dtsi
@@ -4,6 +4,22 @@
compatible = "nvidia,tegra20";
interrupt-parent = <&intc>;
 
+   tegra_car: clock@60006000 {
+   compatible = "nvidia,tegra20-car";
+   reg = <0x60006000 0x1000>;
+   #clock-cells = <1>;
+   };
+
+   clocks {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   osc: clock {
+   compatible = "fixed-clock";
+   #clock-cells = <0>;
+   };
+   };
+
intc: interrupt-controller@50041000 {
compatible = "nvidia,tegra20-gic";
interrupt-controller;
diff --git a/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt 
b/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt
new file mode 100644
index 000..5c07fca
--- /dev/null
+++ b/doc/device-tree-bindings/clock/nvidia,tegra20-car.txt
@@ -0,0 +1,207 @@
+NVIDIA Tegra20 Clock And Reset Controller
+
+This binding uses the common clock binding:
+Documentation/devicetree/bindings/clock/clock-bindings.txt
+
+The CAR (Clock And Reset) Controller on Tegra is the HW module responsible
+for muxing and gating Tegra's clocks, and setting their rates.
+
+Required properties :
+- compatible : Should be "nvidia,tegra20-car"
+- reg : Should contain CAR registers location and length
+- clocks : Should contain phandle and clock specifiers for two clocks:
+  the 32 KHz "32k_in", and the board-specific oscillator "osc".
+- #clock-cells : Should be 1.
+  In clock consumers, this cell represents the clock ID exposed by the CAR.
+
+  The first 96 clocks are numbered to match the bits in the CAR's CLK_OUT_ENB
+  registers. These IDs often match those in the CAR's RST_DEVICES registers,
+  but not in all cases. Some bits in CLK_OUT_ENB affect multiple clocks. In
+  this case, those clocks are assigned IDs above 95 in order to highlight
+  this issue. Implementations that interpret these clock IDs as bit values
+  within the CLK_OUT_ENB or RST_DEVICES registers should be careful to
+  explicitly handle these special cases.
+
+  The balance of the clocks controlled by the CAR are assigned IDs of 96 and
+  above.
+
+  0cpu
+  1unassigned
+  2unassigned
+  3ac97
+  4rtc
+  5tmr
+  6uart1
+  7unassigned  (register bit affects uart2 and vfir)
+  8gpio
+  9sdmmc2
+  10   unassigned  (register bit affects spdif_in and spdif_out)
+  11   i2s1
+  12   i2c1
+  13   ndflash
+  14   sdmmc1
+  15   sdmmc4
+  16   twc
+  17   pwm
+  18   i2s2
+  19   epp
+  20   unassigned  (register bit affects vi and vi_sensor)
+  21   2d
+  22   usbd
+  23   isp
+  24   3d
+  25   ide
+  26   disp2
+  27   disp1
+  28   host1x
+  29   vcp
+  30   unassigned
+  31   cache2
+
+  32   mem
+  33   ahbdma
+  34   apbdma
+  35   unassigned
+  36   kbc
+  37   stat_mon
+  38   pmc
+  39   fuse
+  40   kfuse
+  41   sbc1
+  42   snor
+  43   spi1
+  44   sbc2
+  45   xio
+  46   sbc3
+  47   dvc
+  48   dsi
+  49   unassigned  (register bit affects tvo and cve)
+  50   mipi
+  51   hdmi
+  52   csi
+  53   tvdac
+  54   i2c2
+  55   uart3
+  56   unassigned
+  57   emc
+  58   usb2
+  59   usb3
+  60   mpe
+  61   vde
+  62   bsea
+  63   bsev
+
+  64   speedo
+  65   uart4
+  66   uart5
+  67   i2c3
+  68   sbc4
+  69   sdmmc3
+  70   pcie
+  71   owr
+  72   afi
+  73   csite
+  74   unassigned
+  75   avpucq
+  76   la
+  77   unassigned
+  78   unassigned
+  79   unassigned
+  80   unassigned
+  81   unassigned
+  82   unassigned
+  83   unassigned
+  84   irama
+  85   iramb
+  86   iramc
+  87   iramd
+  88   cram2
+  89   audio_2xa/k/a audio_2x_sync_clk
+  90   clk_d
+  91   unassigned
+  92   sus
+  93   cdev1
+  94   cdev2
+  95   unassigned
+
+  96   uart2
+  97   vfir
+  98   spdif_in
+  99   spdif_out
+  100  vi
+  101  vi_sensor
+  102  tvo
+  103  cve
+  104  osc
+  105  clk_32k a/k/a clk_s
+  106  clk_m
+  107  sclk
+  108  cclk
+  109  hclk
+  110  pclk
+  111  blink
+  112 

[U-Boot] [PATCH v6 08/20] fdt: Add tegra-usb bindings file from linux

2012-02-27 Thread Simon Glass
This file is taken from the Linux mailing list.

Signed-off-by: Simon Glass 
---

 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 v6 03/20] fdt: Add basic support for decoding GPIO definitions

2012-02-27 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 = ;

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 . 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 
---
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 
 #include 
 
+/* we need the generic GPIO interface here */
+#include 
+
 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 Array of gpio elements to fill from FDT. This will be
+ * untouched 

[U-Boot] [PATCH v6 02/20] fdt: Add functions to access phandles, arrays and bools

2012-02-27 Thread Simon Glass
Add a function to look up a property which is a phandle in a node, and
another to read a fixed-length integer array from an fdt property.
Also add a function to read boolean properties, although there is no
actual boolean type in U-Boot.

Signed-off-by: Simon Glass 
Acked-by: Gerald Van Baren 
Acked-by: Stephen Warren 
---

 include/fdtdec.h |   39 +++
 lib/fdtdec.c |   67 ++
 2 files changed, 106 insertions(+), 0 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 01badd4..047f603 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -188,3 +188,42 @@ int fdtdec_find_aliases_for_id(const void *blob, const 
char *name,
  * @return compatible string for that id
  */
 const char *fdtdec_get_compatible(enum fdt_compat_id id);
+
+/* Look up a phandle and follow it to its node. Then return the offset
+ * of that node.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @return node offset if found, -ve error code on error
+ */
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name);
+
+/**
+ * Look up a property in a node and return its contents in an integer
+ * array of given length. The property must have at least enough data for
+ * the array (4*count bytes). It may have more, but this will be ignored.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param arrayarray to fill with data
+ * @param countnumber of array elements
+ * @return 0 if ok, or -FDT_ERR_NOTFOUND if the property is not found,
+ * or -FDT_ERR_BADLAYOUT if not enough data
+ */
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+   u32 *array, int count);
+
+/**
+ * Look up a boolean property in a node and return it.
+ *
+ * A boolean properly is true if present in the device tree and false if not
+ * present, regardless of its value.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @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);
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 846ec3f..977528b 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -269,3 +269,70 @@ int fdtdec_check_fdt(void)
"binary or define CONFIG_OF_EMBED\n");
return 0;
 }
+
+int fdtdec_lookup_phandle(const void *blob, int node, const char *prop_name)
+{
+   const u32 *phandle;
+   int lookup;
+
+   phandle = fdt_getprop(blob, node, prop_name, NULL);
+   if (!phandle)
+   return -FDT_ERR_NOTFOUND;
+
+   lookup = fdt_node_offset_by_phandle(blob, fdt32_to_cpu(*phandle));
+   return lookup;
+}
+
+/**
+ * Look up a property in a node and check that it has a minimum length.
+ *
+ * @param blob FDT blob
+ * @param node node to examine
+ * @param prop_namename of property to find
+ * @param min_len  minimum property length in bytes
+ * @param err  0 if ok, or -FDT_ERR_NOTFOUND if the property is not
+   found, or -FDT_ERR_BADLAYOUT if not enough data
+ * @return pointer to cell, which is only valid if err == 0
+ */
+static const void *get_prop_check_min_len(const void *blob, int node,
+   const char *prop_name, int min_len, int *err)
+{
+   const void *cell;
+   int len;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, &len);
+   if (!cell)
+   *err = -FDT_ERR_NOTFOUND;
+   else if (len < min_len)
+   *err = -FDT_ERR_BADLAYOUT;
+   else
+   *err = 0;
+   return cell;
+}
+
+int fdtdec_get_int_array(const void *blob, int node, const char *prop_name,
+   u32 *array, int count)
+{
+   const u32 *cell;
+   int i, err = 0;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = get_prop_check_min_len(blob, node, prop_name,
+ sizeof(u32) * count, &err);
+   if (!err) {
+   for (i = 0; i < count; i++)
+   array[i] = fdt32_to_cpu(cell[i]);
+   }
+   return err;
+}
+
+int fdtdec_get_bool(const void *blob, int node, const char *prop_name)
+{
+   const s32 *cell;
+   int len;
+
+   debug("%s: %s\n", __func__, prop_name);
+   cell = fdt_getprop(blob, node, prop_name, &len);
+   return cell != NULL;
+}
-- 
1.7.7.3

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


[U-Boot] [PATCH v6 17/20] tegra: usb: Add USB support to nvidia boards

2012-02-27 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 
---
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 
 #include 
 #include 
+#include 
 #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 v6 01/20] fdt: Tidy up a few fdtdec problems

2012-02-27 Thread Simon Glass
This fixes five trivial issues in fdtdec.c:
1. fdtdec_get_is_enabled() doesn't really need a default value
2. The fdt must be word-aligned, since otherwise it will fail on ARM
3. The compat_names[] array is missing its first element. This is needed
only because the first fdt_compat_id is defined to be invalid.
4. Added a header prototype for fdtdec_next_compatible()
5. Change fdtdec_next_alias() to only increment its 'upto' parameter
on success, to make the display error messages in the caller easier.

Signed-off-by: Simon Glass 
Acked-by: Gerald Van Baren 
Acked-by: Stephen Warren 
---

 include/fdtdec.h |   23 +++
 lib/fdtdec.c |   22 --
 2 files changed, 35 insertions(+), 10 deletions(-)

diff --git a/include/fdtdec.h b/include/fdtdec.h
index 3a15f55..01badd4 100644
--- a/include/fdtdec.h
+++ b/include/fdtdec.h
@@ -82,6 +82,21 @@ int fdtdec_next_alias(const void *blob, const char *name,
enum fdt_compat_id id, int *upto);
 
 /**
+ * Find the next compatible node for a peripheral.
+ *
+ * Do the first call with node = 0. This function will return a pointer to
+ * the next compatible node. Next time you call this function, pass the
+ * value returned, and the next node will be provided.
+ *
+ * @param blob FDT blob to use
+ * @param node Start node for search
+ * @param id   Compatible ID to look for (enum fdt_compat_id)
+ * @return offset of next compatible node, or -FDT_ERR_NOTFOUND if no more
+ */
+int fdtdec_next_compatible(const void *blob, int node,
+   enum fdt_compat_id id);
+
+/**
  * Look up an address property in a node and return it as an address.
  * The property must hold either one address with no trailing data or
  * one address with a length. This is only tested on 32-bit machines.
@@ -112,14 +127,14 @@ s32 fdtdec_get_int(const void *blob, int node, const char 
*prop_name,
  * Checks whether a node is enabled.
  * This looks for a 'status' property. If this exists, then returns 1 if
  * the status is 'ok' and 0 otherwise. If there is no status property,
- * it returns the default value.
+ * it returns 1 on the assumption that anything mentioned should be enabled
+ * by default.
  *
  * @param blob FDT blob
  * @param node node to examine
- * @param default_val  default value to return if no 'status' property exists
- * @return integer value 0/1, if found, or default_val if not
+ * @return integer value 0 (not enabled) or 1 (enabled)
  */
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val);
+int fdtdec_get_is_enabled(const void *blob, int node);
 
 /**
  * Checks whether we have a valid fdt available to control U-Boot, and panic
diff --git a/lib/fdtdec.c b/lib/fdtdec.c
index 3852038..846ec3f 100644
--- a/lib/fdtdec.c
+++ b/lib/fdtdec.c
@@ -33,6 +33,7 @@ DECLARE_GLOBAL_DATA_PTR;
  */
 #define COMPAT(id, name) name
 static const char * const compat_names[COMPAT_COUNT] = {
+   COMPAT(UNKNOWN, ""),
 };
 
 const char *fdtdec_get_compatible(enum fdt_compat_id id)
@@ -89,14 +90,21 @@ s32 fdtdec_get_int(const void *blob, int node, const char 
*prop_name,
return default_val;
 }
 
-int fdtdec_get_is_enabled(const void *blob, int node, int default_val)
+int fdtdec_get_is_enabled(const void *blob, int node)
 {
const char *cell;
 
+   /*
+* It should say "okay", so only allow that. Some fdts use "ok" but
+* this is a bug. Please fix your device tree source file. See here
+* for discussion:
+*
+* http://www.mail-archive.com/u-boot@lists.denx.de/msg71598.html
+*/
cell = fdt_getprop(blob, node, "status", NULL);
if (cell)
-   return 0 == strcmp(cell, "ok");
-   return default_val;
+   return 0 == strcmp(cell, "okay");
+   return 1;
 }
 
 enum fdt_compat_id fd_dec_lookup(const void *blob, int node)
@@ -127,14 +135,16 @@ int fdtdec_next_alias(const void *blob, const char *name,
/* snprintf() is not available */
assert(strlen(name) < MAX_STR_LEN);
sprintf(str, "%.*s%d", MAX_STR_LEN, name, *upto);
-   (*upto)++;
node = find_alias_node(blob, str);
if (node < 0)
return node;
err = fdt_node_check_compatible(blob, node, compat_names[id]);
if (err < 0)
return err;
-   return err ? -FDT_ERR_NOTFOUND : node;
+   if (err)
+   return -FDT_ERR_NOTFOUND;
+   (*upto)++;
+   return node;
 }
 
 /* TODO: Can we tighten this code up a little? */
@@ -254,7 +264,7 @@ int fdtdec_find_aliases_for_id(const void *blob, const char 
*name,
 int fdtdec_check_fdt(void)
 {
/* We must have an fdt */
-   if (fdt_check_header(gd->fdt_blob))
+   if (((uintptr_t)gd->fdt_blob & 3) || fdt_check_header(gd->fdt_blob))
panic("No valid fdt found - please append one to U-Boot\n"
"binary or define CONFIG_OF_EMBED\n");
return 0;
-- 
1.7.7.

[U-Boot] [PATCH v6 09/20] tegra: fdt: Add additional USB binding

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

Signed-off-by: Simon Glass 
---
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 v6 04/20] arm: fdt: Add skeleton device tree file from kernel

2012-02-27 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 
---

 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 v6 0/20] tegra: Add fdt definitions and USB driver

2012-02-27 Thread Simon Glass
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:
- Add setting of pinmux for USB VBUS GPIO
- 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 0x from fdt aliases
- Remove non-fdt operation of USB, since it is not needed
- Remove unneeded CONFIG_TEGRA_USBx defines
- 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
- Use "okay" instead of "ok" for fdt node status

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

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

Changes in v5:
- Add CONFIG_EHCI_DCACHE which is needed for dcache operation
- Add additional debugging to report active USB ports
- Add dr_mode property to control host/device/otg mode
- Add nvidia,has-legacy-mode property per review comments
- Allow any port to operate in otg mode
- Change device tree comment style from // to /* */
- Correct PTS_MASK value to be unsigned
- Drop unused CONFIG_USB_EHCI_DATA_ALIGN option
- Fixed endian bug in fdtdec_decode_gpios()
- Implement new device tree properties
- Make sure GPIO name is NULL if incorrectly decoded
- Put pinmux setting into a board-specific function
- Remove checking of peripheral ID and try to use only device tree
- Remove support-host-mode property
- Report error if phy clock does not start up
- Update README to indicate that we will commit fdt documentation to U-Boot

Changes in v6:
- Add clock bindings from Stephen Warren's latest patch
- Add new patch to bring in clock bindings to seaboard
- Drop fdt alignment patch as we will handle this after generic reloc
- Move peripheral decode function into Tegra's clock.c
- Remove dr_mode properties from SOC .dtsi file and move to boards
- Use updated clock_decode_periph_id() function

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: 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: fdt: Add clock bindings for Tegra2 Seaboard
  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
  tegra: 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/clock.c  |   19 +
 arch/arm/cpu/armv7/tegra2/config.mk|2 +
 arch/arm/cpu/armv7/tegra2/usb.c|  460 
 arch/arm/dts/skeleton.dtsi |   13 +
 arch/arm/dts/tegra20.dtsi  |  188 
 arch/arm/include/asm/arch-tegra2/clock.h   |   13 +
 arch/arm/include/asm/arch-tegra2/tegra2.h  |2 +
 arch/arm/include/asm/arch-tegra2/usb.h |  252 +++
 board/nvidia/common/board.c|   12 +
 board/nvidia/common/board.h|6 +
 board/nvidia/dts/tegra2-seaboard.dts   |   57 +++
 board/nvidia/s

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

2012-02-27 Thread Simon Glass
Hi,

On Sun, Feb 26, 2012 at 7:02 PM, Simon Glass  wrote:
> Hi Marek,
>
> On Sun, Feb 26, 2012 at 3:13 PM, Marek Vasut  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).
>>>
>>
>> Hi,
>>
>> what's the status of this patch/patchset?
>
> Superceded, v6 is on its way in the next few days.
>

I am about to send v6. Due to the way things are organized, 6 of that
patches have changed. I have also dropped the fdt alignment one. So I
think it is safest to resend the whole 20-patch series again.

Regards,
Simon

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


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

2012-02-27 Thread Mike Frysinger
On Wednesday 25 January 2012 13:05:31 Marek Vasut wrote:
> >  * Ignore ANSI escape codes for moving cursor, which are generated by
> > keyboard
> 
> I think WD should comment on this one.

no need ... see the previous thread on the previous version of this patch.  
Pali should be able to drop this.
-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 04/20] arm: fdt: Ensure that an embedded fdt is word-aligned

2012-02-27 Thread Simon Glass
Hi Albert,

On Sun, Feb 19, 2012 at 10:33 AM, Albert ARIBAUD
 wrote:
> Hi Simon,
>
> Le 19/02/2012 17:23, Simon Glass a écrit :
>
>
>> Sorry I had that wrong - it's not the link step I am bothered by, it is
>> the
>> objcopy step.
>>
>> What I would like to do is mark the input section, created by objcopy,
>> with
>> a particular alignment so that the linker does the right thing. This
>> feature appears to be present in objcopy but does not appear to work.
>> Perhaps I should debug that first to see what is going on.
>
>
> (Formally there are two "objcopy steps" in u-boot building. One happens
> after the link step, where from the u-boot ELF binary objcopy derives the
> u-boot.bin pure binary and u-boot.srec S-Record file. I suspect you're
> referring to the other one, which happens before the link stage and which
> turns the binary FDT data into an ELF-linkable object. Correct?)
>
> Maybe one is allowed to specify alignment requirements when making an ELF
> object file from a pure binary with objcopy; but obviously it does not work
> as you want it to, whereas section alignment in linker scripts is a tried
> and proven method.
>
>
> So I must be missing something. Can you clarify the scenario that gets


 fixed here?

 The fdt blob is in one of the object files. If during linking the file
 before it has a data segment whose size is not a multiple of 4, then the
 fdt object can be misaligned in the output.
>>>
>>>
>>>
>>> Understood. This example of an alignment failure scenario shows that the
>>
>> failure cause is indeed that the FDT is embedded in the .data output
>> section at link time.
>>>
>>>
>>>
> Not that I am against the patch, mind you, quite the opposite. I am
> just


 wondering about the pros and cons of having a separated (and aligned)
 DTS
 data *output* section and placing that section after .code and .data
>>
>> rather

 than between them.

 Bear in mind that embedding the fdt in the image is really only for
 development.
>>>
>>>
>>>
>>> Understood, and I think that's one more reason to make sure that the act
>>
>> of FDT embedding does not alter .data input section ordering.
>>
>> Well it is just a data section really.
>
>
> So are the relocation tables in .rel.dyn and .dynsyms, but that does not
> mean they have to go to the "dot data" output section.
>
>
 We could have a separate output section if you like. Up to you.
>>>
>>>
>>>
>>> I much prefer embedded FDT data to be explicitly mapped to a a dedicated
>>
>> .fdt output section in u-boot.lds, because it ensures that aligment
>> constaints for .fdt and .data can be controlled independently.
>>
>> I will take a look at this.
>
>
> Thanks. This should be fairly easy to do in the linker script by inserting
> an output section (e.g. ".fdt") after .data, aligning the start of that
> section to a word boundary, and explicitly mapping the .data section of the
> FDT object file into it.

Just an update on this: I am going to drop this patch from the series
now and deal with it later once the lds cleanup series lands. I don't
want to patch a file that is being removed.

Regards,
Simon

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


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

2012-02-27 Thread Albert ARIBAUD

Hi Wolfgang,

The following changes since commit 54e96680cb96fb7a4b8f43fd949c62054004d3e5:

  Merge branch 'master' of git://git.denx.de/u-boot-microblaze 
(2012-02-26 22:17:40 +0100)


are available in the git repository at:

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

Aneesh V (1):
  armv7: omap3: leave outer cache enabled

Chase Maupin (1):
  am33xx: ddr_defs.h: Change DDR timings

Daniel Gorsulowski (2):
  at91: modified NAND flash timing on meesc board
  at91: modified NAND flash timing on otc570 board

Detlev Zundel (1):
  mcx: Enable command line editing

Eric Nelson (6):
  mx6q: define GPIO macros for translating between ordinals and 
port:index

  mxc_spi: move machine specifics into CPU headers
  mx6q: Add support for ECSPI through mxc_spi driver
  mx6q: mx6qsabrelite: Add ECSPI support to the Sabrelite platform
  mx6q: mx6qsabrelite: Provide default serial flash bus and chip-select
  mx6q: mx6qsabrelite: Conditionally define macros for environment 
in serial flash


Fabio Estevam (7):
  mx53loco: Use gpio_direction_input prior to gpio_get_value
  mx53ard: Use gpio_direction_input prior to gpio_get_value
  mx53evk: Use gpio_direction_input prior to gpio_get_value
  mx53smd: Use gpio_direction_input prior to gpio_get_value
  mx51evk: Use gpio_direction_input prior to gpio_get_value
  mx35: generic: Let get_reset_cause be defined only when 
CONFIG_DISPLAY_CPUINFO is selected

  mx35pdk: Remove duplicate CPU revision and reset cause information

Hadli, Manjunath (3):
  davinci: cleanup davinci_sync_env_enetaddr() fucntion
  da850evm: add support to read mac address from SPI flash
  da850evm: read mac address from I2C EEPROM on AM18x EVM

Helmut Raiger (3):
  tt01: fix environment size
  tt01: add video support
  tt01: fix hush parser config, add release config

Linus Walleij (3):
  integrator: stop calling pci_init() twice
  integrator: rewrite the AP PCI driver
  integrator: update the Integrator/CP config

Marek Vasut (2):
  i.MX28: Fix VDDIO and VDDA setup
  MX28: Fix get_timer() / get_tbclk() issue

Matthias Fuchs (4):
  mx28evk: add RTC support
  mx28evk: add USB support
  mx28evk: add SPI support
  mx28: fix SPL code to make USB booting work

Peter Meerwald (1):
  beagle: enable DVI_PUP

Shawn Guo (1):
  common/image.c: align usage of fdt_high with initrd_high

Stefano Babic (4):
  MX35: add missing get_ticks() and get_tbclk()
  MX31: add missing get_tbclk()
  MX5/MX6: add missing get_ticks() and get_tbclk()
  MX27: add missing get_tbclk()

Thomas Weber (2):
  Tricorder: Switch env to generic mmc driver
  OMAP3: Remove unused CONFIG_SYS_NAND_ECCSTEPS/TOTAL

Tom Rini (2):
  am335x_evm: Change MAINTAINERS entry
  omap3_beagle: Change MAINTAINERS entry

Troy Kisky (5):
  net: fec_mxc: add 1000 Mbps selection
  net: fec_mxc: add PHYLIB support
  net: phy: add support for Micrel's KSZ9021
  net: phy: make board_phy_config responsible for calling drv->config
  i.mx6q: mx6qsabrelite: Update the network configuration

prabhakar.cse...@gmail.com (1):
  dm6467Tevm: Use a common configuration file for davinci_dm6467evm 
and davinci_dm6467Tevm


 MAINTAINERS   |   10 +-
 README|8 +
 arch/arm/cpu/arm1136/mx31/timer.c |9 +
 arch/arm/cpu/arm1136/mx35/generic.c   |2 +-
 arch/arm/cpu/arm1136/mx35/timer.c |  103 +++--
 arch/arm/cpu/arm926ejs/davinci/cpu.c  |2 +-
 arch/arm/cpu/arm926ejs/davinci/misc.c |9 +-
 arch/arm/cpu/arm926ejs/mx27/timer.c   |5 +
 arch/arm/cpu/arm926ejs/mx28/spl_power_init.c  |   16 +-
 arch/arm/cpu/arm926ejs/mx28/start.S   |   21 +-
 arch/arm/cpu/arm926ejs/mx28/timer.c   |   19 +-
 arch/arm/cpu/armv7/imx-common/timer.c |   75 +++-
 arch/arm/cpu/armv7/omap3/board.c  |2 +-
 arch/arm/include/asm/arch-am33xx/ddr_defs.h   |2 +-
 arch/arm/include/asm/arch-mx31/imx-regs.h |   27 ++
 arch/arm/include/asm/arch-mx31/sys_proto.h|1 +
 arch/arm/include/asm/arch-mx35/imx-regs.h |   25 +
 arch/arm/include/asm/arch-mx5/imx-regs.h  |   30 ++
 arch/arm/include/asm/arch-mx6/imx-regs.h  |   49 ++
 board/armltd/integrator/integrator.c  |3 -
 board/armltd/integrator/pci.c |  582 
++---

 board/armltd/integrator/pci_v3.h  |  200 +
 board/davinci/da8xxevm/da850evm.c |  103 +
 board/davinci/dm6467evm/dm6467evm.c   |2 +-
 board/esd/meesc/meesc.c   |8 +-
 board/esd/otc570/otc570.c |8 +-
 board/freescale/corenet_ds/eth_p4080.c|2 +
 board/freescale/mpc8544ds/mpc8544ds.c |2 +
 board/freescale/mx28evk/iomux.c   |8 +
 board/freescale/mx2

Re: [U-Boot] [PATCH 05/15] common/main.c: Fix function readline

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 13:40:07 Pali Rohár wrote:
> On Sunday 26 February 2012 23:33:01 Mike Frysinger wrote:
> > On Saturday 07 January 2012 03:51:16 Pali Rohár wrote:
> > > On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
> > > > On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
> > > > >  * Ignore ANSI escape codes for moving cursor, which are generated
> > > > >  by
> > > > > 
> > > > > keyboard
> > > > 
> > > > this probably should be behind an appropriate CONFIG knob.  i don't
> > > > think
> > > > this is relevant to serial users (which are the majority of boards).
> > > 
> > > I think this is also relevant to serial console too. I tried serial
> > > console
> > > (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed
> > > cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline
> > > function buffer was stored ANSI sequence. So when I pressed ENTER,
> > > u-boot tried to execute that buffer and showed me error. But it showed
> > > error message something like unknown command . ansi_seq was
> > > recognized in ansi terminal on computer and it garbaged output. (for
> > > example if asn_seq was move up, error message continued on previous
> > > line...)
> > > 
> > > This patch ignore ansi codes which can be generated by curosor keys, so
> > > there will not be that bad error messages...
> > 
> > do you have CONFIG_CMDLINE_EDITING enabled ?  arrow keys work just fine
> > when that's enabled, and if it isn't, then i think it's expected
> > behavior that pressing the arrow keys would generate "junk" that u-boot
> > wouldn't interpret.
> 
> I had CONFIG_CMDLINE_EDITING disabled - I did not know this option. Anyway,
> when I enabled it arrow keys does not worked with cfb video driver and rx51
> platform code.
> 
> I will try to fix that problem and I then will delete this patch.

sounds good.  not sure if this something we could really document in a way 
that'd help people :/.
-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] Please pull u-boot-ti/master

2012-02-27 Thread Albert ARIBAUD

Hi Tom,

Le 23/02/2012 17:01, Tom Rini a écrit :

Hello,

The following changes since commit 417c2c787e32784b5de975065a7d1dd5b3cc8ecd:
   Daniel Gorsulowski (1):
 at91: modified NAND flash timing on otc570 board

are available in the git repository at:

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

Aneesh V (1):
   armv7: omap3: leave outer cache enabled

  arch/arm/cpu/armv7/omap3/board.c |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

While this was not submitted by the normal cutoff what happened was that
in v2011.12 we disabled all of the caches with the expectation that the
kernel was re-enabling them.  This however is not true (and so most
distributions that ship v2011.12 revert the cache disable patch for
non-omap4).  The outcome of discussing with the kernel folks what they
want is Aneesh's patch.


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

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


Re: [U-Boot] [PULL] u-boot-pxa / fix

2012-02-27 Thread Albert ARIBAUD

Hi Marek,

Le 27/02/2012 14:03, Marek Vasut a écrit :

The following changes since commit 417c2c787e32784b5de975065a7d1dd5b3cc8ecd:

   at91: modified NAND flash timing on otc570 board (2012-02-20 09:00:13 +0100)

are available in the git repository at:

   git://git.denx.de/u-boot-pxa.git fix

for you to fetch changes up to 2e85d5c10f01b21ac47f9b0dd4a9dcc022ac0be6:

   PXA: Fix missing get_tbclk() breaking vpac boards (2012-02-27 13:59:47 +0100)


Marek Vasut (3):
   PXA: Remove PXA PCMCIA support
   PXA: Fix warning in zipitz2
   PXA: Fix missing get_tbclk() breaking vpac boards

Simon Glass (1):
   arm: Remove jornada link script

Vasily Khoruzhick (2):
   zipitz2: fix boot issue introduced by PXA low level init rework
   zipitz2: use pxa_mmc_gen as MMC driver

  arch/arm/cpu/pxa/timer.c|5 ++
  board/jornada/u-boot.lds|   58 ---
  board/zipitz2/zipitz2.c |9 
  doc/README.PXA_CF   |   56 --
  drivers/pcmcia/Makefile |1 -
  drivers/pcmcia/pxa_pcmcia.c |   93 ---
  include/configs/zipitz2.h   |   14 +-
  include/pcmcia.h|3 +-
  8 files changed, 26 insertions(+), 213 deletions(-)
  delete mode 100644 board/jornada/u-boot.lds
  delete mode 100644 doc/README.PXA_CF
  delete mode 100644 drivers/pcmcia/pxa_pcmcia.c


Is there a reason why this pull request is on a "fix" branch, not "master"?

Amicalement,
--
Albert.
___
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-02-27 Thread Pali Rohár
On Sunday 26 February 2012 23:10:18 Mike Frysinger wrote:
> On Sunday 26 February 2012 17:08:04 Marek Vasut wrote:
> > > On Tuesday 24 January 2012 15:27:57 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.
> > >
> > > Hi, what is state of this patch series? From our discussion is only
> > > problematic bootmenu part, but other could be OK.
> > >
> > > So what is needed for including this patches (without bootmenu support)
> > > to uboot master?
> >
> > You should probably split the patches into smaller series and resubmit
> > individually.
>
> yeah, we aren't keen on manually trying to pick things out of a patchset
> since it's hard for us to know what is required to be together.  a
> patchset, by nature, should be merged as a group.
> -mike

Ok, I will create new patchset and fix known problems (CONFIG_CMDLINE_EDITING)

--
Pali Rohár
pali.ro...@gmail.com

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 05/15] common/main.c: Fix function readline

2012-02-27 Thread Pali Rohár
On Sunday 26 February 2012 23:33:01 Mike Frysinger wrote:
> On Saturday 07 January 2012 03:51:16 Pali Rohár wrote:
> > On Friday 06 January 2012 15:15:29 Mike Frysinger wrote:
> > > On Sunday 18 December 2011 16:34:01 Pali Rohár wrote:
> > > >  * Ignore ANSI escape codes for moving cursor, which are generated by
> > > >
> > > > keyboard
> > >
> > > this probably should be behind an appropriate CONFIG knob.  i don't
> > > think
> > > this is relevant to serial users (which are the majority of boards).
> >
> > I think this is also relevant to serial console too. I tried serial
> > console
> > (over USB) with Nokia N900 on computer (ANSI terminal) and if I pressed
> > cursor key (UP/DOWN/LEFT/RIGHT) it moved cursor. But in readline function
> > buffer was stored ANSI sequence. So when I pressed ENTER, u-boot tried to
> > execute that buffer and showed me error. But it showed error message
> > something like unknown command . ansi_seq was recognized in ansi
> > terminal on computer and it garbaged output. (for example if asn_seq was
> > move up, error message continued on previous line...)
> >
> > This patch ignore ansi codes which can be generated by curosor keys, so
> > there will not be that bad error messages...
>
> do you have CONFIG_CMDLINE_EDITING enabled ?  arrow keys work just fine when
> that's enabled, and if it isn't, then i think it's expected behavior that
> pressing the arrow keys would generate "junk" that u-boot wouldn't
> interpret. -mike

I had CONFIG_CMDLINE_EDITING disabled - I did not know this option. Anyway,
when I enabled it arrow keys does not worked with cfb video driver and rx51
platform code.

I will try to fix that problem and I then will delete this patch.

--
Pali Rohár
pali.ro...@gmail.com

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 8/8] sandbox: Add basic command line parsing

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 00:43:30 Simon Glass wrote:
> On Sun, Feb 26, 2012 at 8:42 PM, Mike Frysinger wrote:
> > drivers/mtd/spi/sandbox.c:
> > static int sb_cmdline_cb_spi_sf(struct sandbox_state *state, const char
> > *arg) {
> >unsigned long bus, cs;
> >const char *spec = sb_spi_parse_spec(arg, &bus, &cs);
> > 
> >if (!spec)
> >return 1;
> > 
> >state->spi[bus][cs][0] = &sb_sf_ops;
> >state->spi[bus][cs][1] = spec;
> >return 0;
> > }
> > SB_CMDLINE_OPT(spi_sf, 1, "connect a SPI flash: :::");
> 
> sandbox...give me your address and I'll send you a cheque to cover the
> bytes so used :-)

it'll have to be a big one to stop the cascading line wrapping :P

> > and people could do:
> >./u-boot --spi_sf 0:3:m25p16:./some-file.bin
> > this would connect the spi flash simulation up to the simulated spi bus 0
> > on cs 3 and have it simulate a m25p16 flash with "some-file.bin" backing
> > it.
> > 
> > if someone were to enter the wrong value for
> > "0:3:m25p16:./some-file.bin", how do you propose we communicate that ?
> >  the existing code can easily signal the higher parsing logic via return
> > values, but then we'd just get:
> >failed to parse option: 0:3:m25p16:./some-file.bin
> > 
> > but what exactly did the code not like ?  was it the bus # ?  the cs # ?
> >  the spi flash id ?  the backing file ?  if the getopt code has access
> > to printf(), we can clearly communicate to the user what is going wrong.
> 
> Yes I think printf() is useful in getopt, I just would prefer to avoid
> using U-Boot's printf. It goes through all the console code, and we
> might be running a test that deliberately breaks that, perhaps.
> Actually this could be a pretty important thing to sort out - we need
> to keep a clear boundary between test code and U-Boot code (as we
> discussed over GPIO). Having the test code use U-Boot's printf() is
> blurring that.

we probably need to add architecture details like this to doc/README.sandbox 
so we can stay on the same page ...

> To your example, if the syntax is correct perhaps, then it got through
> initial parsing. If the filename is wrong, or the bus number, then
> perhaps there will be a message and failure much later. Perhaps the
> initial parsing just does what it can to avoid running past an obvious
> syntax error. But we can't really know success until we open the file,
> or try the bus.

if the bus/cs are valid, the rest of the parsing is delayed until you do "sf 
probe" at which point you'd get an explanation of what is wrong.  i guess we 
can live with this for now.
-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 2/2] usb: Add CONFIG to fetch string descriptor

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 10:36:32 Puneet Saxena wrote:
> Add "CONFIG_USB_STRING_FETCH" to fetch string using descriptor length
> then fetch actual bytes, returned in descriptor buffer.

i'm having a hard time understanding what you're trying to say here

new CONFIG_xxx knobs should be documented in top level README

> --- a/include/configs/tegra2-common.h
> +++ b/include/configs/tegra2-common.h
> 
>  #define CONFIG_TEGRA2_GPIO
>  #define CONFIG_CMD_GPIO
> +
>  #endif /* __TEGRA2_COMMON_H */

please do not include unrelated whitespace changes
-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] USB:host: Attribute packed removed from usb structures

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 08:14:26 Marek Vasut wrote:
> > On 2/25/2012 3:42 PM, Albert ARIBAUD wrote:
> > > Le 24/02/2012 12:58, Amit Virdi a écrit :
> > >> Packed attribute is forcing a bytewise write on device registers,
> > >> there by, resulting in a misbehavior on gcc-4.4.1.
> > >> Reverting the structures to non-packed
> > > 
> > > If (just asking, not asserting) the issue is caused by fields being u8
> > > where u8 access is not possible, then should you not make the fields
> > > u16 / u32 according to access requirements?
> > 
> > The problem is not with the fields being of a different width. AFAIK,
> > the packed attribute changes the generated code to access even the word
> > field elements in a byte by byte manner
> > 
> > Infact, there is a discussion on lkml that I can point
> > https://lkml.org/lkml/2011/4/27/278
> > 
> > It seems that the discussion did not lead to a conclusion but it was
> > sensible (at least for ARM) to remove the packed attribute from this
> > structure
> 
> What does the USB spec say ? It might be a HW bug?

it isn't covered by the USB spec.  these are structs for hardware registers in 
the EHCI usb host controller.
-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] USB:host: Attribute packed removed from usb structures

2012-02-27 Thread Mike Frysinger
On Monday 27 February 2012 05:02:14 Amit Virdi wrote:
> On 2/25/2012 12:48 AM, Mike Frysinger wrote:
> > On Friday 24 February 2012 06:58:40 Amit Virdi wrote:
> >> Packed attribute is forcing a bytewise write on device registers,
> >> there by, resulting in a misbehavior on gcc-4.4.1.
> > 
> > so use a compiler that isn't broken ?
> 
> It doesn't seem like compiler issue (on ARM).

i think it is ... you don't see this behavior on other architectures.  the 
recent thread indicates that ARM has been broken for a long time though.

http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/85629
-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] AT91SAM9*: Change kernel address in dataflash to match u-boot's size

2012-02-27 Thread Ulf Samuelsson

On 2012-02-20 17:40, Alexandre Belloni wrote:

On at91sam platforms, u-boot grew larger than the allocated size in
dataflash, the layout was:
bootstrap  0x
ubootenv   0x4200
uboot  0x8400
kernel 0x00042000

u-boot with the defconfig doesn't seem to fit in 0x42000 - 0x8400 =
0x39C00 bytes anymore.

Now, the layout is:
bootstrap  0x
uboot  0x4000
ubootenv   0x00084000
ubootenv2  0x00088000
kernel 0x0008C000




NAK!

1. You need to be aware of the page size of dataflashes.
Each page is 1056 bytes, not 1024 bytes.
Your patch will make the U-Boot image start in the middle of a page.
2. Std AT91bootstrap loads U-Boot from 0x8400
so your patch breaks 99% of all SAM9  boards.

If you want to grow U-Boot, then

bootstrap  0x   ; 16 kB
ubootenv   0x4200   ; 16 kB - Should be plenty
uboot  0x8400   ;
kernel 0x00063000   ; Why waste space...





Signed-off-by: Alexandre Belloni
---
Changes for v2:
- changed the layout as per Marek's recommendation
Changes for v3:
- prefixed the patch title with AT91SAM9*:

  include/configs/at91sam9260ek.h |   18 --
  include/configs/at91sam9261ek.h |   18 --
  include/configs/at91sam9263ek.h |   10 +++---
  include/configs/at91sam9rlek.h  |   10 +++---
  4 files changed, 38 insertions(+), 18 deletions(-)

diff --git a/include/configs/at91sam9260ek.h b/include/configs/at91sam9260ek.h
index db52ee6..b537760 100644
--- a/include/configs/at91sam9260ek.h
+++ b/include/configs/at91sam9260ek.h
@@ -185,10 +185,12 @@
  /* bootstrap + u-boot + env + linux in dataflash on CS0 */
  #define CONFIG_ENV_IS_IN_DATAFLASH1
  #define CONFIG_SYS_MONITOR_BASE   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
  #define CONFIG_ENV_ADDR   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x2200 0x21; bootm"
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND "cp.b 0xC008C000 0x2200 0x21; bootm"
  #define CONFIG_BOOTARGS   "console=ttyS0,115200 " 
  \
"root=/dev/mtdblock0 "\
"mtdparts=atmel_nand:-(root) "\
@@ -199,10 +201,12 @@
  /* bootstrap + u-boot + env + linux in dataflash on CS1 */
  #define CONFIG_ENV_IS_IN_DATAFLASH1
  #define CONFIG_SYS_MONITOR_BASE   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
  #define CONFIG_ENV_ADDR   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS1 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND "cp.b 0xD0042000 0x2200 0x21; bootm"
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND "cp.b 0xD008C000 0x2200 0x21; bootm"
  #define CONFIG_BOOTARGS   "console=ttyS0,115200 " 
  \
"root=/dev/mtdblock0 "\
"mtdparts=atmel_nand:-(root) "\
@@ -231,6 +235,8 @@
  #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + 
sizeof(CONFIG_SYS_PROMPT) + 16)
  #define CONFIG_SYS_LONGHELP   1
  #define CONFIG_CMDLINE_EDITING1
+#define CONFIG_AUTO_COMPLETE
+#define CONFIG_SYS_REDUNDAND_ENVIRONMENT

  /*
   * Size of malloc() pool
diff --git a/include/configs/at91sam9261ek.h b/include/configs/at91sam9261ek.h
index 5140b26..fa461da 100644
--- a/include/configs/at91sam9261ek.h
+++ b/include/configs/at91sam9261ek.h
@@ -187,10 +187,12 @@
  /* bootstrap + u-boot + env + linux in dataflash on CS0 */
  #define CONFIG_ENV_IS_IN_DATAFLASH
  #define CONFIG_SYS_MONITOR_BASE   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
0x8400)
-#define CONFIG_ENV_OFFSET  0x4200
+#define CONFIG_ENV_OFFSET  0x84000
  #define CONFIG_ENV_ADDR   (CONFIG_SYS_DATAFLASH_LOGIC_ADDR_CS0 + 
CONFIG_ENV_OFFSET)
-#define CONFIG_ENV_SIZE0x4200
-#define CONFIG_BOOTCOMMAND "cp.b 0xC0042000 0x2200 0x21; bootm"
+#define CONFIG_ENV_SIZE0x4000
+#define CONFIG_ENV_ADDR_REDUND (CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)
+#define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
+#define CONFIG_BOOTCOMMAND "cp.b 0xC008C000 0x2200 0x21; bootm"
  #define CONFIG_BOOTARGS   "console=ttyS0,115200 " 
  \
"r

[U-Boot] REg : EIM Registers Configuration Required or Not to access NOR Flash in Flash_Header.s File

2012-02-27 Thread Balaji Sivakumar, ERS, HCLTech
Hi,

Am using IMX6 processor based board. I am customizing U-boot for my design.


In my  board I have NOR Flash which is connected via EIM CS0 port. My question 
do I have to add any DCD Settings for EIM registers, because IMX6 RM document 
they mentioned  You can use DCD for configuring EIM and MMDC. But they also 
mentioned " the EIM default settings allow the core to interface to a NOR flash 
device
immediately out of reset. This allows the Chip to interface with any NOR flash 
device,but has the cost of slow performance"


What they are meaning here "it cost of slow performance"

Can anyone guide me??

Thank,

Balaji S

-

::DISCLAIMER::
---

The contents of this e-mail and any attachment(s) are confidential and intended 
for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. 
Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the 
opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, 
distribution and / or publication of
this message without the prior written consent of the author of this e-mail is 
strictly prohibited. If you have
received this email in error please delete it and notify the sender 
immediately. Before opening any mail and
attachments please check them for viruses and defect.

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


Re: [U-Boot] How to Change the DDR3 Speed to low in U-boot

2012-02-27 Thread Balaji Sivakumar, ERS, HCLTech
Hi,

I have verified the lowlwevel_init.s file but there are not initializing DDR3. 
They do only following instructions,

"Invalidate_dcache

Init L2 cache

Init AIPS

Init Clock"


And in the "mx6q_saberlite.C" board file they are just doing "dram_init" , this 
function does only banks and its size.

I want to control the speed of the DDR3 Bus , Can anyone guide me?

Thanks,
Balaji S

-Original Message-
From: Balaji Sivakumar, ERS, HCLTech
Sent: Monday, February 27, 2012 4:40 PM
To: 'u-boot-ow...@lists.denx.de'
Subject: How to Change the DDR3 Speed to low in U-boot

Hi,

Am working on Freescale's IMX6 based Custom Board. I have done some changes 
according to my board specific design.

But I want currently to set the DDR3 speed to low, I have gone through the 
lowlevel_init.s file but am not sure which register to change.

Can you please guide me at which place I have to change?

Thanks
Balaji S

-Original Message-
From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On 
Behalf Of u-boot-requ...@lists.denx.de
Sent: Monday, February 27, 2012 4:30 PM
To: u-boot@lists.denx.de
Subject: U-Boot Digest, Vol 45, Issue 34

Send U-Boot mailing list submissions to
u-boot@lists.denx.de

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.denx.de/mailman/listinfo/u-boot
or, via email, send a message with subject or body 'help' to
u-boot-requ...@lists.denx.de

You can reach the person managing the list at
u-boot-ow...@lists.denx.de

When replying, please edit your Subject line so it is more specific
than "Re: Contents of U-Boot digest..."


Today's Topics:

   1. [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface
  (Amit Virdi)
   2. [PATCH 3/3] mtd/NAND: Remove obsolete SPEAr specific NAND
  drivers (Amit Virdi)
   3. Re: [PATCH 2/3] SPEAr: Configure FSMC driver for NAND
  interface (Stefan Roese)
   4. Re: [PATCH] USB:host: Attribute packed removed from usb
  structures (Amit Virdi)
   5. Re: [PATCH 2/3] SPEAr: Configure FSMC driver for NAND
  interface (Amit Virdi)
   6. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around
  gdata/bdata (Sughosh Ganu)
   7. Re: [PATCH 03/11] st_smi: Return error in case TFF is not set
  (Stefan Roese)
   8. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around
  gdata/bdata (Christian Riesch)
   9. Re: [PATCH v4 07/13] davinci: Use correct #ifdef around
  gdata/bdata (Sughosh Ganu)


--

Message: 1
Date: Mon, 27 Feb 2012 15:08:23 +0530
From: Amit Virdi 
Subject: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for NAND
interface
To: 
Cc: armando.visco...@st.com, shiraz.has...@st.com,  Amit Virdi
, scottw...@freescale.com, s...@denx.de
Message-ID: <1330335504-32226-3-git-send-email-amit.vi...@st.com>
Content-Type: text/plain

From: Vipin KUMAR 

Since FSMC is a standard IP and it supports different memory interfaces, it
is supported independent of spear platform and spear is configured to use that
driver for interfacing with the NAND device

Signed-off-by: Vipin Kumar 
Signed-off-by: Amit Virdi 
---
 arch/arm/include/asm/arch-spear/hardware.h |8 
 board/spear/spear300/spear300.c|7 ---
 board/spear/spear310/spear310.c|7 ---
 board/spear/spear320/spear320.c|7 ---
 board/spear/spear600/spear600.c|7 ---
 include/configs/spear-common.h |2 +-
 include/configs/spear3xx.h |4 
 include/configs/spear6xx.h |3 +++
 8 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/arch/arm/include/asm/arch-spear/hardware.h 
b/arch/arm/include/asm/arch-spear/hardware.h
index 818f36c..a6517b2 100644
--- a/arch/arm/include/asm/arch-spear/hardware.h
+++ b/arch/arm/include/asm/arch-spear/hardware.h
@@ -37,15 +37,15 @@

 #if defined(CONFIG_SPEAR600)
 #define CONFIG_SYS_I2C_BASE(0xD020)
-#define CONFIG_SPEAR_FSMCBASE  (0xD180)
+#define CONFIG_SYS_FSMC_BASE   (0xD180)

 #elif defined(CONFIG_SPEAR300)
 #define CONFIG_SYS_I2C_BASE(0xD018)
-#define CONFIG_SPEAR_FSMCBASE  (0x9400)
+#define CONFIG_SYS_FSMC_BASE   (0x9400)

 #elif defined(CONFIG_SPEAR310)
 #define CONFIG_SYS_I2C_BASE(0xD018)
-#define CONFIG_SPEAR_FSMCBASE  (0x4400)
+#define CONFIG_SYS_FSMC_BASE   (0x4400)

 #undef CONFIG_SYS_NAND_CLE
 #undef CONFIG_SYS_NAND_ALE
@@ -57,7 +57,7 @@

 #elif defined(CONFIG_SPEAR320)
 #define CONFIG_SYS_I2C_BASE(0xD018)
-#define CONFIG_SPEAR_FSMCBASE  (0x4C00)
+#define CONFIG_SYS_FSMC_BASE   (0x4C00)

 #define CONFIG_SPEAR_EMIBASE   (0x4000)
 #define CONFIG_SPEAR_RASBASE

Re: [U-Boot] [PATCH v2 1/2] usb: align buffers at cacheline

2012-02-27 Thread Simon Glass
Hi Marek,

On Mon, Feb 27, 2012 at 9:11 AM, Marek Vasut  wrote:
>> Hi Marek,
>>
>> On Mon, Feb 27, 2012 at 8:49 AM, Marek Vasut  wrote:
>> >> As DMA expects the buffers to be equal and larger then
>> >> cache lines, This aligns buffers at cacheline.
>> >>
>> >> Signed-off-by: Puneet Saxena 
>> >> Signed-off-by: Jim Lin 
>> >> ---
>> >
>> > First of all, thanks for this patch, it really helps. But, there are a
>> > few things that concern me.
>> >
>> >> Changes for V2:
>> >>     - Use "ARCH_DMA_MINALIGN" directly
>> >>     - Use "ALIGN" to align size as cacheline
>> >>     - Removed headers from usb.h
>> >>     - Send 8 bytes of device descriptor size to read
>> >>       Max packet size
>> >> scsi.h header is needed to avoid extra memcpy from local buffer
>> >> to global buffer.
>> >>
>> >>  common/cmd_usb.c            |    3 +-
>> >>  common/usb.c                |   61
>> >> -- common/usb_storage.c        |
>> >> 59 +++-- disk/part_dos.c
>> >> | 2 +-
>> >>  drivers/usb/host/ehci-hcd.c |    8 +
>> >>  include/scsi.h              |    4 ++-
>> >>  6 files changed, 77 insertions(+), 60 deletions(-)
>> >>
>> >> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
>> >> index 320667f..bca9d94 100644
>> >> --- a/common/cmd_usb.c
>> >> +++ b/common/cmd_usb.c
>> >> @@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass,
>> >> unsigned char subclass,
>> >>
>> >>  void usb_display_string(struct usb_device *dev, int index)
>> >>  {
>> >> -     char buffer[256];
>> >> +     ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);
>> >
>> > Why not memalign(), do you want to allocate on stack so badly ?
>>
>> This issue came up with MMC and there was a strong request not to
>> sprinkle the code with malloc. In fact the macro above was devised at
>> some cost just to solve this problem.
>
> This is really weird solution :-(

It's not pretty under the hood but it solves the problem well for MMC.
Apart from the alignment of buffers, it is as efficient as the
original code.

>>
>> [snip]
>>
>> >>  {
>> >>       int tries;
>> >> -     struct usb_port_status portsts;
>> >> +     ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
>> >
>> > Looking at all this stuff, it's already allocated on stack. Ok, I already
>> > outlined first option -- memalign(), but that'd really put quite a strain
>> > on the memory allocator -- the other option (and maybe even better) is
>> > to use __attribute__((aligned)), which will allow the compiler to
>> > reorder data allocated on the stack so the array you create is aligned
>> > and not much space around on the stack is wasted. Apparently,
>> > ALLOC_CACHE_ALIGN_BUFFER() wastes a lot of space on the stack.
>>
>> There was quite a bit of discussion about this related to MMC. I think
>> the current solution is the result of that discussion...
>
> Can you please point me to such discussion?

Start here perhaps and look at the whole thread:

http://lists.denx.de/pipermail/u-boot/2011-August/099152.html

>
> Thanks!

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


Re: [U-Boot] [PATCH v2 1/2] usb: align buffers at cacheline

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> On Mon, Feb 27, 2012 at 8:49 AM, Marek Vasut  wrote:
> >> As DMA expects the buffers to be equal and larger then
> >> cache lines, This aligns buffers at cacheline.
> >> 
> >> Signed-off-by: Puneet Saxena 
> >> Signed-off-by: Jim Lin 
> >> ---
> > 
> > First of all, thanks for this patch, it really helps. But, there are a
> > few things that concern me.
> > 
> >> Changes for V2:
> >> - Use "ARCH_DMA_MINALIGN" directly
> >> - Use "ALIGN" to align size as cacheline
> >> - Removed headers from usb.h
> >> - Send 8 bytes of device descriptor size to read
> >>   Max packet size
> >> scsi.h header is needed to avoid extra memcpy from local buffer
> >> to global buffer.
> >> 
> >>  common/cmd_usb.c|3 +-
> >>  common/usb.c|   61
> >> -- common/usb_storage.c|
> >> 59 +++-- disk/part_dos.c
> >> | 2 +-
> >>  drivers/usb/host/ehci-hcd.c |8 +
> >>  include/scsi.h  |4 ++-
> >>  6 files changed, 77 insertions(+), 60 deletions(-)
> >> 
> >> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
> >> index 320667f..bca9d94 100644
> >> --- a/common/cmd_usb.c
> >> +++ b/common/cmd_usb.c
> >> @@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass,
> >> unsigned char subclass,
> >> 
> >>  void usb_display_string(struct usb_device *dev, int index)
> >>  {
> >> - char buffer[256];
> >> + ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);
> > 
> > Why not memalign(), do you want to allocate on stack so badly ?
> 
> This issue came up with MMC and there was a strong request not to
> sprinkle the code with malloc. In fact the macro above was devised at
> some cost just to solve this problem.

This is really weird solution :-(
> 
> [snip]
> 
> >>  {
> >>   int tries;
> >> - struct usb_port_status portsts;
> >> + ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
> > 
> > Looking at all this stuff, it's already allocated on stack. Ok, I already
> > outlined first option -- memalign(), but that'd really put quite a strain
> > on the memory allocator -- the other option (and maybe even better) is
> > to use __attribute__((aligned)), which will allow the compiler to
> > reorder data allocated on the stack so the array you create is aligned
> > and not much space around on the stack is wasted. Apparently,
> > ALLOC_CACHE_ALIGN_BUFFER() wastes a lot of space on the stack.
> 
> There was quite a bit of discussion about this related to MMC. I think
> the current solution is the result of that discussion...

Can you please point me to such discussion?

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


Re: [U-Boot] [PATCH v2 1/2] usb: align buffers at cacheline

2012-02-27 Thread Simon Glass
Hi Marek,

On Mon, Feb 27, 2012 at 8:49 AM, Marek Vasut  wrote:
>> As DMA expects the buffers to be equal and larger then
>> cache lines, This aligns buffers at cacheline.
>>
>> Signed-off-by: Puneet Saxena 
>> Signed-off-by: Jim Lin 
>> ---
>>
>
> First of all, thanks for this patch, it really helps. But, there are a few
> things that concern me.
>
>> Changes for V2:
>>     - Use "ARCH_DMA_MINALIGN" directly
>>     - Use "ALIGN" to align size as cacheline
>>     - Removed headers from usb.h
>>     - Send 8 bytes of device descriptor size to read
>>       Max packet size
>> scsi.h header is needed to avoid extra memcpy from local buffer
>> to global buffer.
>>
>>  common/cmd_usb.c            |    3 +-
>>  common/usb.c                |   61
>> -- common/usb_storage.c        |
>> 59 +++-- disk/part_dos.c             |
>>    2 +-
>>  drivers/usb/host/ehci-hcd.c |    8 +
>>  include/scsi.h              |    4 ++-
>>  6 files changed, 77 insertions(+), 60 deletions(-)
>>
>> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
>> index 320667f..bca9d94 100644
>> --- a/common/cmd_usb.c
>> +++ b/common/cmd_usb.c
>> @@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass,
>> unsigned char subclass,
>>
>>  void usb_display_string(struct usb_device *dev, int index)
>>  {
>> -     char buffer[256];
>> +     ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);
>
> Why not memalign(), do you want to allocate on stack so badly ?

This issue came up with MMC and there was a strong request not to
sprinkle the code with malloc. In fact the macro above was devised at
some cost just to solve this problem.

[snip]
>>  {
>>       int tries;
>> -     struct usb_port_status portsts;
>> +     ALLOC_CACHE_ALIGN_BUFFER(struct usb_port_status, portsts, 1);
>
> Looking at all this stuff, it's already allocated on stack. Ok, I already
> outlined first option -- memalign(), but that'd really put quite a strain on 
> the
> memory allocator -- the other option (and maybe even better) is to use
> __attribute__((aligned)), which will allow the compiler to reorder data
> allocated on the stack so the array you create is aligned and not much space
> around on the stack is wasted. Apparently, ALLOC_CACHE_ALIGN_BUFFER() wastes a
> lot of space on the stack.

There was quite a bit of discussion about this related to MMC. I think
the current solution is the result of that discussion...

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


Re: [U-Boot] [PATCH v2 1/2] usb: align buffers at cacheline

2012-02-27 Thread Marek Vasut
> As DMA expects the buffers to be equal and larger then
> cache lines, This aligns buffers at cacheline.
> 
> Signed-off-by: Puneet Saxena 
> Signed-off-by: Jim Lin 
> ---
> 

First of all, thanks for this patch, it really helps. But, there are a few 
things that concern me.

> Changes for V2:
> - Use "ARCH_DMA_MINALIGN" directly
> - Use "ALIGN" to align size as cacheline
> - Removed headers from usb.h
> - Send 8 bytes of device descriptor size to read
>   Max packet size
> scsi.h header is needed to avoid extra memcpy from local buffer
> to global buffer.
> 
>  common/cmd_usb.c|3 +-
>  common/usb.c|   61
> -- common/usb_storage.c|  
> 59 +++-- disk/part_dos.c |
>2 +-
>  drivers/usb/host/ehci-hcd.c |8 +
>  include/scsi.h  |4 ++-
>  6 files changed, 77 insertions(+), 60 deletions(-)
> 
> diff --git a/common/cmd_usb.c b/common/cmd_usb.c
> index 320667f..bca9d94 100644
> --- a/common/cmd_usb.c
> +++ b/common/cmd_usb.c
> @@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass,
> unsigned char subclass,
> 
>  void usb_display_string(struct usb_device *dev, int index)
>  {
> - char buffer[256];
> + ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);

Why not memalign(), do you want to allocate on stack so badly ?

> +
>   if (index != 0) {
>   if (usb_string(dev, index, &buffer[0], 256) > 0)
>   printf("String: \"%s\"", buffer);
> diff --git a/common/usb.c b/common/usb.c
> index 63a11c8..2279459 100644
> --- a/common/usb.c
> +++ b/common/usb.c
> @@ -73,7 +73,6 @@ static struct usb_device usb_dev[USB_MAX_DEVICE];
>  static int dev_index;
>  static int running;
>  static int asynch_allowed;
> -static struct devrequest setup_packet;
> 
>  char usb_started; /* flag for the started/stopped USB status */
> 
> @@ -185,23 +184,25 @@ int usb_control_msg(struct usb_device *dev, unsigned
> int pipe, unsigned short value, unsigned short index,
>   void *data, unsigned short size, int timeout)
>  {
> + ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet,
> + sizeof(struct devrequest));

DTTO, btw does the setup packet need to be aligned too ?

>   if ((timeout == 0) && (!asynch_allowed)) {
>   /* request for a asynch control pipe is not allowed */
>   return -1;
>   }
> 
>   /* set setup command */
> - setup_packet.requesttype = requesttype;
> - setup_packet.request = request;
> - setup_packet.value = cpu_to_le16(value);
> - setup_packet.index = cpu_to_le16(index);
> - setup_packet.length = cpu_to_le16(size);
> + setup_packet->requesttype = requesttype;
> + setup_packet->request = request;
> + setup_packet->value = cpu_to_le16(value);
> + setup_packet->index = cpu_to_le16(index);
> + setup_packet->length = cpu_to_le16(size);
>   USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X, " \
>  "value 0x%X index 0x%X length 0x%X\n",
>  request, requesttype, value, index, size);
>   dev->status = USB_ST_NOT_PROC; /*not yet processed */
> 
> - submit_control_msg(dev, pipe, data, size, &setup_packet);
> + submit_control_msg(dev, pipe, data, size, setup_packet);
>   if (timeout == 0)
>   return (int)size;
> 
> @@ -694,7 +695,7 @@ static int usb_string_sub(struct usb_device *dev,
> unsigned int langid, */
>  int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
>  {
> - unsigned char mybuf[USB_BUFSIZ];
> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mybuf, USB_BUFSIZ);
>   unsigned char *tbuf;
>   int err;
>   unsigned int u, idx;
> @@ -794,7 +795,7 @@ int usb_new_device(struct usb_device *dev)
>  {
>   int addr, err;
>   int tmp;
> - unsigned char tmpbuf[USB_BUFSIZ];
> + ALLOC_CACHE_ALIGN_BUFFER(unsigned char, tmpbuf, USB_BUFSIZ);

Why not simply memalign() them all?
> 
>   /* We still haven't set the Address yet */
>   addr = dev->devnum;
> @@ -842,7 +843,10 @@ int usb_new_device(struct usb_device *dev)
>   dev->epmaxpacketin[0] = 64;
>   dev->epmaxpacketout[0] = 64;
> 
> - err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
> + desc->bMaxPacketSize0 = 0;
> + /*8 bytes of the descriptor to read Max packet size*/
> + err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc,
> + 8);
>   if (err < 0) {
>   USB_PRINTF("usb_new_device: usb_get_descriptor() failed\n");
>   return 1;
> @@ -905,7 +909,7 @@ int usb_new_device(struct usb_device *dev)
>   tmp = sizeof(dev->descriptor);
> 
>   err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
> -  &dev->descriptor, sizeof(dev->descriptor));
> +  desc, sizeof(dev->descriptor));
>   if (err <

Re: [U-Boot] [RFC PATCH 0/2] fdt: Deal correctly with alias nodes

2012-02-27 Thread Marek Vasut
> Marek/Simon,
> 
> > -Original Message-
> > From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> > Sent: Sunday, February 26, 2012 7:55 PM
> > To: Marek Vasut; Tom Warren
> > Subject: Re: [U-Boot] [RFC PATCH 0/2] fdt: Deal correctly with alias
> > nodes
> > 
> > +Tom, tegra maintainer
> > 
> > Hi Marek,
> > 
> > On Sun, Feb 26, 2012 at 3:09 PM, Marek Vasut  wrote:
> > >> This series proposes a new way to deal with alias nodes and
> > >> introduces a function to take care of it.
> > >> 
> > >> It includes an example of converting USB code over to use this new
> > >> function.
> > >> 
> > >> Note: At present it does not deal automatically with disabled nodes,
> > >> but perhaps it should? Or perhaps this is better as an option.
> > >> Something to leave for later perhaps.
> > >> 
> > >> Note 2: The actual logic of this function is not properly tested yet.
> > >> 
> > >> 
> > >> Simon Glass (2):
> > >>   fdt: Add fdtdec_find_aliases() to deal with alias nodes
> > >>   tegra: Use fdtdec_find_aliases() to find USB ports
> > >> 
> > >>  arch/arm/cpu/armv7/tegra2/usb.c |   17 
> > >>  include/fdtdec.h|   51 ++
> > >>  lib/fdtdec.c|   89
> > >> +++ 3 files changed, 148
> > >> insertions(+), 9 deletions(-)
> > > 
> > > Hi,
> > > 
> > > what's the status of this patch/patchset?
> > 
> > I believe it is sitting in the tegra tree ready for a pull request, but
> > waiting on USB. Tom will know.
> 
> Simon is correct. The 18 fdt/USB patches (v5 and 2 from v6) are sitting in
> u-boot-tegra/test waiting on a final ACK for one clock binding DT change
> from Simon based on Stephen's review. As Simon says in answer to a
> separate email, he's working on getting all these to jibe so that I can
> apply them cleanly to u-boot-tegra. As soon as they're ready, I'll apply &
> test and if all goes well, submit a pull request. Then we can move on the
> I2C, LCD, kbd, etc. for Tegra2.
> 
That's good then, I won't care for these and let them go through the tegra 
tree. 
Thank you for your good work.

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


Re: [U-Boot] [RFC PATCH 0/2] fdt: Deal correctly with alias nodes

2012-02-27 Thread Tom Warren
Marek/Simon,

> -Original Message-
> From: s...@google.com [mailto:s...@google.com] On Behalf Of Simon Glass
> Sent: Sunday, February 26, 2012 7:55 PM
> To: Marek Vasut; Tom Warren
> Subject: Re: [U-Boot] [RFC PATCH 0/2] fdt: Deal correctly with alias nodes
> 
> +Tom, tegra maintainer
> 
> Hi Marek,
> 
> On Sun, Feb 26, 2012 at 3:09 PM, Marek Vasut  wrote:
> >> This series proposes a new way to deal with alias nodes and
> >> introduces a function to take care of it.
> >>
> >> It includes an example of converting USB code over to use this new
> >> function.
> >>
> >> Note: At present it does not deal automatically with disabled nodes,
> >> but perhaps it should? Or perhaps this is better as an option.
> >> Something to leave for later perhaps.
> >>
> >> Note 2: The actual logic of this function is not properly tested yet.
> >>
> >>
> >> Simon Glass (2):
> >>   fdt: Add fdtdec_find_aliases() to deal with alias nodes
> >>   tegra: Use fdtdec_find_aliases() to find USB ports
> >>
> >>  arch/arm/cpu/armv7/tegra2/usb.c |   17 
> >>  include/fdtdec.h                |   51 ++
> >>  lib/fdtdec.c                    |   89
> >> +++ 3 files changed, 148
> >> insertions(+), 9 deletions(-)
> >
> > Hi,
> >
> > what's the status of this patch/patchset?
> 
> I believe it is sitting in the tegra tree ready for a pull request, but
> waiting on USB. Tom will know.
> 
Simon is correct. The 18 fdt/USB patches (v5 and 2 from v6) are sitting in 
u-boot-tegra/test waiting on a final ACK for one clock binding DT change from 
Simon based on Stephen's review. As Simon says in answer to a separate email, 
he's working on getting all these to jibe so that I can apply them cleanly to 
u-boot-tegra. As soon as they're ready, I'll apply & test and if all goes well, 
submit a pull request. Then we can move on the I2C, LCD, kbd, etc. for Tegra2.

Tom

-- 
nvpublic

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


Re: [U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs

2012-02-27 Thread Marek Vasut
> On Mon, Feb 27, 2012 at 6:51 AM, Marek Vasut  wrote:
> >> Hi Marek,
> >> 
> >> On Mon, Feb 27, 2012 at 4:43 AM, Marek Vasut  wrote:
> >> >> From: "Govindraj.R" 
> >> >> 
> >> >> Clean up ehci-omap added and make it generic to extend support for
> >> >> omap4 socs. Add ehci support for panda board.
> >> >> 
> >> >> Patch series depends on below patch:
> >> >>   http://patchwork.ozlabs.org/patch/130952/
> >> >> 
> >> >> Patch series based commit id:
> >> >>   9a4209869bd2c37affd931d627b3c3e72952
> >> >> 
> >> >> This patch series long with above dependent patch is avialable at:
> >> >>   git://gitorious.org/denx_u-boot/denx_uboot_omap.git
> >> >>   v2_ehci_omap4
> >> >> 
> >> >> Fatls, ping and tftp was tested with this patch series.
> >> >> Test log for Panda available here:
> >> >>   http://pastebin.pandaboard.org/index.php/view/55361716
> >> >> Test log for Beagle-XM available here:
> >> >>   http://pastebin.pandaboard.org/index.php/view/98437825
> >> > 
> >> > Hi,
> >> > 
> >> > what's the status of this patch/patchset?
> >> 
> >> It's merged.
> >> 
> >> ubnuser@ula0131859:~/clones/mainline_loaders/u-boot$ gls
> >> dd54d31..49be71c 49be71c  OMAP4: ehci-omap: enable ehci-omap for panda
> >> boards (2 weeks ago) 860004c  OMAP4: clock-common: Move the usb dppl
> >> configuration to new func (2 weeks ago)
> >> 95f8791  OMAP3+: Clock: Adding ehci clock enabling (2 weeks ago)
> >> 43b6239  ehci-omap: Clean up added ehci-omap.c (2 weeks ago)
> >> 29321c0  ehci-omap: driver for EHCI host on OMAP3 (2 weeks ago)
> >> 928c4bd  usb: ulpi: Add omap-ulpi-view port support (2 weeks ago)
> >> 3e6e809  usb: ulpi: Extend the existing ulpi framework. (2 weeks ago)
> > 
> > That's good. Thank you. Cleaned up in patchwork
> 
> Cleaned up how?  I had been (I thought...) keeping the old serieses
> marked as superseded/changes requested/etc and the one that made it in
> accepted.  Thanks.

There was a patch that was not marked in any way, so I set it to superseded.

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


Re: [U-Boot] [PATCH 1/2] usb: align buffers at cacheline

2012-02-27 Thread puneets

Hi,
On Friday 24 February 2012 06:12 PM, Simon Glass wrote:

Hi,

On Thu, Feb 23, 2012 at 6:25 AM, Puneet Saxena  wrote:

As DMA expects the buffers to be equal and larger then
cache lines, This aligns buffers at cacheline.

Signed-off-by: Puneet Saxena
Signed-off-by: Jim Lin
---
Changes for v2:
   - Split the commit in to 2 commits
   - "ARCH_DMA_MINALIGN" replacement
   - Making stop address cache line aligned by
 making size as multiple of cache line
   - incorporated Marek and Mike's comment

  common/cmd_usb.c|3 +-
  common/usb.c|   53 ++
  common/usb_storage.c|   66 ++
  drivers/usb/host/ehci-hcd.c |9 ++
  include/scsi.h  |8 -
  include/usb.h   |8 -
  6 files changed, 88 insertions(+), 59 deletions(-)
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index d893b2a..82652f5 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -120,6 +120,15 @@ static struct descriptor {
  */
  static void flush_invalidate(u32 addr, int size, int flush)
  {
+   /*
+* Size is the bytes actually moved during transaction,
+* which may not equal to the cache line. This results
+* stop address passed for invalidating cache may not be aligned.
+* Therfore making size as nultiple of cache line size.
+*/
+   if (size&  (ARCH_DMA_MINALIGN - 1))
+   size = ((size / ARCH_DMA_MINALIGN) + 1)
+   * ARCH_DMA_MINALIGN;

Can we just use:

size = ALIGN(size, ARCH_DMA_MINALIGN)

here or does it increase size even if already aligned?

size = ALIGN(size, ARCH_DMA_MINALIGN) can be used in place of this.
The code in patch does not increase the size if size is already aligned.

if (flush)
flush_dcache_range(addr, addr + size);
else
diff --git a/include/scsi.h b/include/scsi.h
index c52759c..c1f573e 100644
--- a/include/scsi.h
+++ b/include/scsi.h
@@ -26,7 +26,13 @@

  typedef struct SCSI_cmd_block{
unsigned char   cmd[16];
/* command */
-   unsigned char   sense_buf[64];  /* for request sense */
+   /* for request sense */
+#ifdef ARCH_DMA_MINALIGN
+   unsigned char   sense_buf[64]
+   __attribute__((aligned(ARCH_DMA_MINALIGN)));
+#else
+   unsigned char   sense_buf[64];
+#endif

I think Mike said this, but I thought ARCH_DMA_MINALIGN should always
be defined.

Is it possible to align something in the middle of a structure? How
does that work? I'm suppose you have this working, I would just like
to understand what the resulting code does in this case.

I verified that ARCH_DMA_MINALIGN is already defined so I will not check 
it in next patch.


Yes it would align the variable in middle at the time of instantiating 
the structure.
Compiler generates the addresses of this variable and structure 
variable, as 32 __BYTE__ aligned(cache line is 32).

It try to accommodate all the variables in these two addresses till 32 byte.
Another solution could be, Align whole structure of cacheline and keep 
the buffer as first element.
However in case more than one buffers are in a structure, only option is 
to align individual buffer in place of

whole structure.


unsigned char   status; 
/* SCSI Status   */
unsigned char   target; 
/* Target ID */
unsigned char   lun;
/* Target LUN*/
diff --git a/include/usb.h b/include/usb.h
index 06170cd..d38817a 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -109,7 +109,13 @@ struct usb_device {
int epmaxpacketout[16]; /* OUTput endpoint specific maximums */

int configno;   /* selected config number */
-   struct usb_device_descriptor descriptor; /* Device Descriptor */
+/* Device Descriptor */
+#ifdef ARCH_DMA_MINALIGN
+   struct usb_device_descriptor descriptor
+   __attribute__((aligned(ARCH_DMA_MINALIGN)));
+#else
+   struct usb_device_descriptor descriptor;
+#endif

Same question here, it seems even more exotic - maybe you will need a
memcpy somewhere after all?


struct usb_config config; /* config descriptor */

int have_langid;/* whether string_langid is valid yet */
--
1.7.1


Regards,
Simon



---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, p

[U-Boot] [PATCH v2 1/2] usb: align buffers at cacheline

2012-02-27 Thread Puneet Saxena
As DMA expects the buffers to be equal and larger then
cache lines, This aligns buffers at cacheline.

Signed-off-by: Puneet Saxena 
Signed-off-by: Jim Lin 
---

Changes for V2:
- Use "ARCH_DMA_MINALIGN" directly  
- Use "ALIGN" to align size as cacheline 
- Removed headers from usb.h
- Send 8 bytes of device descriptor size to read 
  Max packet size 
scsi.h header is needed to avoid extra memcpy from local buffer 
to global buffer.

 common/cmd_usb.c|3 +-
 common/usb.c|   61 --
 common/usb_storage.c|   59 +++--
 disk/part_dos.c |2 +-
 drivers/usb/host/ehci-hcd.c |8 +
 include/scsi.h  |4 ++-
 6 files changed, 77 insertions(+), 60 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 320667f..bca9d94 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -150,7 +150,8 @@ void usb_display_class_sub(unsigned char dclass, unsigned 
char subclass,
 
 void usb_display_string(struct usb_device *dev, int index)
 {
-   char buffer[256];
+   ALLOC_CACHE_ALIGN_BUFFER(char, buffer, 256);
+
if (index != 0) {
if (usb_string(dev, index, &buffer[0], 256) > 0)
printf("String: \"%s\"", buffer);
diff --git a/common/usb.c b/common/usb.c
index 63a11c8..2279459 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -73,7 +73,6 @@ static struct usb_device usb_dev[USB_MAX_DEVICE];
 static int dev_index;
 static int running;
 static int asynch_allowed;
-static struct devrequest setup_packet;
 
 char usb_started; /* flag for the started/stopped USB status */
 
@@ -185,23 +184,25 @@ int usb_control_msg(struct usb_device *dev, unsigned int 
pipe,
unsigned short value, unsigned short index,
void *data, unsigned short size, int timeout)
 {
+   ALLOC_CACHE_ALIGN_BUFFER(struct devrequest, setup_packet,
+   sizeof(struct devrequest));
if ((timeout == 0) && (!asynch_allowed)) {
/* request for a asynch control pipe is not allowed */
return -1;
}
 
/* set setup command */
-   setup_packet.requesttype = requesttype;
-   setup_packet.request = request;
-   setup_packet.value = cpu_to_le16(value);
-   setup_packet.index = cpu_to_le16(index);
-   setup_packet.length = cpu_to_le16(size);
+   setup_packet->requesttype = requesttype;
+   setup_packet->request = request;
+   setup_packet->value = cpu_to_le16(value);
+   setup_packet->index = cpu_to_le16(index);
+   setup_packet->length = cpu_to_le16(size);
USB_PRINTF("usb_control_msg: request: 0x%X, requesttype: 0x%X, " \
   "value 0x%X index 0x%X length 0x%X\n",
   request, requesttype, value, index, size);
dev->status = USB_ST_NOT_PROC; /*not yet processed */
 
-   submit_control_msg(dev, pipe, data, size, &setup_packet);
+   submit_control_msg(dev, pipe, data, size, setup_packet);
if (timeout == 0)
return (int)size;
 
@@ -694,7 +695,7 @@ static int usb_string_sub(struct usb_device *dev, unsigned 
int langid,
  */
 int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
 {
-   unsigned char mybuf[USB_BUFSIZ];
+   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mybuf, USB_BUFSIZ);
unsigned char *tbuf;
int err;
unsigned int u, idx;
@@ -794,7 +795,7 @@ int usb_new_device(struct usb_device *dev)
 {
int addr, err;
int tmp;
-   unsigned char tmpbuf[USB_BUFSIZ];
+   ALLOC_CACHE_ALIGN_BUFFER(unsigned char, tmpbuf, USB_BUFSIZ);
 
/* We still haven't set the Address yet */
addr = dev->devnum;
@@ -842,7 +843,10 @@ int usb_new_device(struct usb_device *dev)
dev->epmaxpacketin[0] = 64;
dev->epmaxpacketout[0] = 64;
 
-   err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc, 64);
+   desc->bMaxPacketSize0 = 0;
+   /*8 bytes of the descriptor to read Max packet size*/
+   err = usb_get_descriptor(dev, USB_DT_DEVICE, 0, desc,
+   8);
if (err < 0) {
USB_PRINTF("usb_new_device: usb_get_descriptor() failed\n");
return 1;
@@ -905,7 +909,7 @@ int usb_new_device(struct usb_device *dev)
tmp = sizeof(dev->descriptor);
 
err = usb_get_descriptor(dev, USB_DT_DEVICE, 0,
-&dev->descriptor, sizeof(dev->descriptor));
+desc, sizeof(dev->descriptor));
if (err < tmp) {
if (err < 0)
printf("unable to get device descriptor (error=%d)\n",
@@ -915,14 +919,18 @@ int usb_new_device(struct usb_device *dev)
"(expected %i, got %i)\n", tmp, err);
return 1;
}
+   dev->descriptor.bcdUSB = desc->bcdUSB;
+   dev-

[U-Boot] [PATCH v2 2/2] usb: Add CONFIG to fetch string descriptor

2012-02-27 Thread Puneet Saxena
Add "CONFIG_USB_STRING_FETCH" to fetch string using descriptor length
then fetch actual bytes, returned in descriptor buffer.

Signed-off-by: Puneet Saxena 
---

Changes for V2:
   - Change config by "CONFIG_USB_STRING_FETCH"

 common/usb.c|4 
 include/configs/tegra2-common.h |3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 2279459..83c6c5c 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -658,9 +658,13 @@ static int usb_string_sub(struct usb_device *dev, unsigned 
int langid,
 {
int rc;
 
+#ifdef CONFIG_USB_STRING_FETCH
+   rc = -1;
+#else
/* Try to read the string descriptor by asking for the maximum
 * possible number of bytes */
rc = usb_get_string(dev, langid, index, buf, 255);
+#endif
 
/* If that failed try to read the descriptor length, then
 * ask for just that many bytes */
diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h
index 266d0e5..420d2a9 100644
--- a/include/configs/tegra2-common.h
+++ b/include/configs/tegra2-common.h
@@ -93,6 +93,8 @@
 #define CONFIG_USB_EHCI_TXFIFO_THRESH  10
 #define CONFIG_EHCI_IS_TDI
 #define CONFIG_EHCI_DCACHE
+/* string descriptors must not be fetched using a 255-byte read */
+#define CONFIG_USB_STRING_FETCH
 
 /* include default commands */
 #include 
@@ -172,4 +174,5 @@
 
 #define CONFIG_TEGRA2_GPIO
 #define CONFIG_CMD_GPIO
+
 #endif /* __TEGRA2_COMMON_H */
-- 
1.7.1

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


Re: [U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs

2012-02-27 Thread Tom Rini
On Mon, Feb 27, 2012 at 6:51 AM, Marek Vasut  wrote:
>> Hi Marek,
>>
>> On Mon, Feb 27, 2012 at 4:43 AM, Marek Vasut  wrote:
>> >> From: "Govindraj.R" 
>> >>
>> >> Clean up ehci-omap added and make it generic to extend support for omap4
>> >> socs. Add ehci support for panda board.
>> >>
>> >> Patch series depends on below patch:
>> >>       http://patchwork.ozlabs.org/patch/130952/
>> >>
>> >> Patch series based commit id:
>> >>       9a4209869bd2c37affd931d627b3c3e72952
>> >>
>> >> This patch series long with above dependent patch is avialable at:
>> >>       git://gitorious.org/denx_u-boot/denx_uboot_omap.git
>> >>       v2_ehci_omap4
>> >>
>> >> Fatls, ping and tftp was tested with this patch series.
>> >> Test log for Panda available here:
>> >>       http://pastebin.pandaboard.org/index.php/view/55361716
>> >> Test log for Beagle-XM available here:
>> >>       http://pastebin.pandaboard.org/index.php/view/98437825
>> >
>> > Hi,
>> >
>> > what's the status of this patch/patchset?
>>
>> It's merged.
>>
>> ubnuser@ula0131859:~/clones/mainline_loaders/u-boot$ gls dd54d31..49be71c
>> 49be71c  OMAP4: ehci-omap: enable ehci-omap for panda boards (2 weeks ago)
>> 860004c  OMAP4: clock-common: Move the usb dppl configuration to new
>> func (2 weeks ago)
>> 95f8791  OMAP3+: Clock: Adding ehci clock enabling (2 weeks ago)
>> 43b6239  ehci-omap: Clean up added ehci-omap.c (2 weeks ago)
>> 29321c0  ehci-omap: driver for EHCI host on OMAP3 (2 weeks ago)
>> 928c4bd  usb: ulpi: Add omap-ulpi-view port support (2 weeks ago)
>> 3e6e809  usb: ulpi: Extend the existing ulpi framework. (2 weeks ago)
>
> That's good. Thank you. Cleaned up in patchwork

Cleaned up how?  I had been (I thought...) keeping the old serieses
marked as superseded/changes requested/etc and the one that made it in
accepted.  Thanks.

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


Re: [U-Boot] [PATCH]powerpc/8xxx:Add MPH controller support in USB device-tree fixup

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> The final version of this patch is under review, didn't get any more
> comments, waiting for its acceptance...
> 
> http://patchwork.ozlabs.org/patch/140557/

Someone who knows PowerPC would be welcome to review this patch. Otherwise, 
resubmit if this is forgotten please and Cc me.

Thanks for your good work!

M
> 
> Thanks and Regards,
> Ramneek
> 
> > -Original Message-
> > From: Marek Vasut [mailto:ma...@denx.de]
> > Sent: Monday, February 27, 2012 4:42 AM
> > To: u-boot@lists.denx.de
> > Cc: Mehresh Ramneek-B31383
> > Subject: Re: [U-Boot] [PATCH]powerpc/8xxx:Add MPH controller support in
> > USB device-tree fixup
> > 
> > > Add support for fixing usb mode and phy type for MPH(Multi Port Host)
> > > USB controllers in device-tree nodes.
> > > Required for socs like P3060, P5020, etc having MPH USB controller.
> > > 
> > > Signed-off-by: Ramneek Mehresh 
> > > ---
> > > 
> > >  arch/powerpc/cpu/mpc8xxx/fdt.c |   46
> > > 
> > > ++-- include/fdt_support.h
> > > 
> > >   4 +-
> > >  
> > >  2 files changed, 32 insertions(+), 18
> > 
> > Hi,
> > 
> > what's the status of this patch/patchset?
> > 
> > Thanks
> > M
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: omap3: temporary disable USB on TAM3517 boards

2012-02-27 Thread Marek Vasut
> On 27/02/2012 00:10, Marek Vasut wrote:
> >> The TAM3517 boards require a patch for EHCI OMAP
> >> that does not yet find a way to mainline. The patch
> >> disables temporary USB until EHCI OMAP will be supported.
> >> 
> >> Signed-off-by: Stefano Babic 
> >> Cc: Tom Rini 
> >> Cc: Albert Aribaud 
> >> ---
> >> 
> >>  include/configs/tam3517-common.h |7 +--
> >>  1 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > Hi,
> > 
> > what's the status of this patch/patchset?
> 
> The patch must be dropped - after I sent it, Govindraj's patches cleaned
> up the code adding OMAP4 support and these patches are now mainline.
> Everything is mainlined now, we need only to discharge this patch.
> 
> Stefano

Updated status in patchwork, Thanks!

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


Re: [U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> On Mon, Feb 27, 2012 at 4:43 AM, Marek Vasut  wrote:
> >> From: "Govindraj.R" 
> >> 
> >> Clean up ehci-omap added and make it generic to extend support for omap4
> >> socs. Add ehci support for panda board.
> >> 
> >> Patch series depends on below patch:
> >>   http://patchwork.ozlabs.org/patch/130952/
> >> 
> >> Patch series based commit id:
> >>   9a4209869bd2c37affd931d627b3c3e72952
> >> 
> >> This patch series long with above dependent patch is avialable at:
> >>   git://gitorious.org/denx_u-boot/denx_uboot_omap.git
> >>   v2_ehci_omap4
> >> 
> >> Fatls, ping and tftp was tested with this patch series.
> >> Test log for Panda available here:
> >>   http://pastebin.pandaboard.org/index.php/view/55361716
> >> Test log for Beagle-XM available here:
> >>   http://pastebin.pandaboard.org/index.php/view/98437825
> > 
> > Hi,
> > 
> > what's the status of this patch/patchset?
> 
> It's merged.
> 
> ubnuser@ula0131859:~/clones/mainline_loaders/u-boot$ gls dd54d31..49be71c
> 49be71c  OMAP4: ehci-omap: enable ehci-omap for panda boards (2 weeks ago)
> 860004c  OMAP4: clock-common: Move the usb dppl configuration to new
> func (2 weeks ago)
> 95f8791  OMAP3+: Clock: Adding ehci clock enabling (2 weeks ago)
> 43b6239  ehci-omap: Clean up added ehci-omap.c (2 weeks ago)
> 29321c0  ehci-omap: driver for EHCI host on OMAP3 (2 weeks ago)
> 928c4bd  usb: ulpi: Add omap-ulpi-view port support (2 weeks ago)
> 3e6e809  usb: ulpi: Extend the existing ulpi framework. (2 weeks ago)

That's good. Thank you. Cleaned up in patchwork

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


Re: [U-Boot] [PATCH] USB: relax usbcore reset timings

2012-02-27 Thread Marek Vasut
> On 02/27/2012 12:10 AM, Marek Vasut wrote:
> >> From: Wolfgang Grandegger 
> >> 
> >> Following the corresponding Linux code, this patch relaxes reset timings
> >> waiting at least 100ms after power to the ports. There are some reports
> >> that it helps make enumeration work better on some high speed devices.
> >> Furthermore, the wait is only done once after power has been enabled
> >> on all ports.
> >> 
> >> CC: Remy Bohmer 
> >> CC: Vincent Palatin 
> >> Signed-off-by: Wolfgang Grandegger 
> >> ---
> > 
> > Hi,
> > 
> > what's the status of this patch/patchset?
> 
> Already a while ago Remy wrote "Applied to u-boot-usb" but I can't find
> it yet in mainline. Remy?
> 
> Wolfgang

Well, Remy seems N/A recently, I'll apply these on my tree and send pull RQ 
after EW. Ok with you ?

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


Re: [U-Boot] [PATCH] AVR32 removal due to lack of custodian.

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> On 27.02.2012 14:09, Marek Vasut wrote:
> >> I'm willing to get u-boot avr32 support to live on for at least some
> >> years, if no one else volunteers.
> > 
> > that'd be great! There's especially one problem I found with the AVR32
> > stuff. The MMC driver. I take it the "gen_atmel_mci.c" driver can be
> > used instead of "atmel_mci.c", which uses the legacy MMC API? Can you
> > flip the AVR32 boards to the new MMC driver so we can drop the legacy
> > MMC API any soon please?
> 
> Sven posted patches [1] some days ago which are almost working. That
> series have some timing issues which should be fixed inside the mmc
> framework, see [2] for more information on that.
> 
> I will rework these patches next days and do some testing. Would be
> great to get a comment on [2] from Andy Fleming (as MMC custodian).
> 
Awesome! Keep me in CC please.

Thanks!

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


Re: [U-Boot] [PATCH] AVR32 removal due to lack of custodian.

2012-02-27 Thread Andreas Bießmann
Hi Marek,

On 27.02.2012 14:09, Marek Vasut wrote:

>> I'm willing to get u-boot avr32 support to live on for at least some
>> years, if no one else volunteers.
>>

> that'd be great! There's especially one problem I found with the AVR32 stuff. 
> The MMC driver. I take it the "gen_atmel_mci.c" driver can be used instead of 
> "atmel_mci.c", which uses the legacy MMC API? Can you flip the AVR32 boards 
> to 
> the new MMC driver so we can drop the legacy MMC API any soon please?

Sven posted patches [1] some days ago which are almost working. That
series have some timing issues which should be fixed inside the mmc
framework, see [2] for more information on that.

I will rework these patches next days and do some testing. Would be
great to get a comment on [2] from Andy Fleming (as MMC custodian).

regards

Andreas Bießmann

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


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

2012-02-27 Thread Marek Vasut
> Hi Marek,
> 
> On Sun, Feb 26, 2012 at 3:09 PM, Marek Vasut  wrote:
> >> This series brings in the 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
> >> 
> >> Simon Glass (16):
> >>   fdt: Tidy up a few fdtdec problems
> >>   fdt: Add functions to access phandles, arrays and bools
> >>   Add gpio_request() to asm-generic header
> >>   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
> >>   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
> >>   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   |  430
> >> + arch/arm/cpu/armv7/u-boot.lds
> >> | 5 +
> >>  arch/arm/dts/skeleton.dtsi|   13 +
> >>  arch/arm/dts/tegra20.dtsi |  172 
> >>  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 
> >>  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/asm-generic/gpio.h|   10 +
> >>  include/configs/seaboard.h|   12 +
> >>  include/configs/tegra2-common.h   |   14 +
> >>  include/fdtdec.h  |  109 +++-
> >>  lib/fdtdec.c  |  168 +++-
> >>  21 files changed, 1320 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 board/nvidia/dts/tegra2-seaboard.dts
> >>  create mode 100644 drivers/usb/host/ehci-tegra.c
> > 
> > Hi,
> > 
> > what's the status of this patch/patchset?
> 
> It needs a small update to the Tegra device tree files (2 of the
> patches) and another change to deal with peripheral IDs (another 2 of
> the patches). I expect to get this done in the next few days. After
> that I am hoping we are done, but let's see.
> 
> Regards,
> Simon
> 
Ok, please CC me when you resubmit so I can check and apply the USB stuff. 
Thanks!

M
_

Re: [U-Boot] [PATCH] USB:host: Attribute packed removed from usb structures

2012-02-27 Thread Marek Vasut
> On 2/25/2012 3:42 PM, Albert ARIBAUD wrote:
> > Hi Amit,
> 
> Hello Albert,
> 
> > Le 24/02/2012 12:58, Amit Virdi a écrit :
> >> From: Vipin Kumar
> >> 
> >> Packed attribute is forcing a bytewise write on device registers,
> >> there by, resulting in a misbehavior on gcc-4.4.1.
> >> Reverting the structures to non-packed
> > 
> > If (just asking, not asserting) the issue is caused by fields being u8
> > where u8 access is not possible, then should you not make the fields u16
> > / u32 according to access requirements?
> 
> The problem is not with the fields being of a different width. AFAIK,
> the packed attribute changes the generated code to access even the word
> field elements in a byte by byte manner
> 
> Infact, there is a discussion on lkml that I can point
> https://lkml.org/lkml/2011/4/27/278
> 
> It seems that the discussion did not lead to a conclusion but it was
> sensible (at least for ARM) to remove the packed attribute from this
> structure
> 
What does the USB spec say ? It might be a HW bug?

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


Re: [U-Boot] [PATCH] usb: musb: fix printf warning

2012-02-27 Thread Marek Vasut
> On Sunday 26 February 2012 18:48:26 Marek Vasut wrote:
> > > On Sunday 26 February 2012 18:13:58 Marek Vasut wrote:
> > > > > musb_hcd.c: In function 'musb_submit_rh_msg':
> > > > > musb_hcd.c:827:2: warning: format '%d' expects type 'int',
> > > > > 
> > > > >   but argument 3 has type 'long unsigned int'
> > > > 
> > > > what's the status of this patch/patchset?
> > > 
> > > the usb ones are waiting for someone to pick up
> > 
> > Ok, can you please resend and Cc me so I can pick them up?
> 
> http://patchwork.ozlabs.org/patch/139366/
> -mike

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


Re: [U-Boot] [PATCH] AVR32 removal due to lack of custodian.

2012-02-27 Thread Marek Vasut
> Hi Wolfgang,
> 
> On 25.02.2012 23:13, Wolfgang Denk wrote:
> > AVR32 appaers to be unmaintained, and nobody appears to care about
> 
> s/appaers/appears/g
> 
> well, there where at least two users (sven and I) last year ...
> 
> > that.  Let's get rid fof it.
> 
> Would be sad, at least now ...
> 
> I'm willing to get u-boot avr32 support to live on for at least some
> years, if no one else volunteers.
> 

Hi,

that'd be great! There's especially one problem I found with the AVR32 stuff. 
The MMC driver. I take it the "gen_atmel_mci.c" driver can be used instead of 
"atmel_mci.c", which uses the legacy MMC API? Can you flip the AVR32 boards to 
the new MMC driver so we can drop the legacy MMC API any soon please?

Thanks!

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


[U-Boot] [PULL] u-boot-pxa / fix

2012-02-27 Thread Marek Vasut
The following changes since commit 417c2c787e32784b5de975065a7d1dd5b3cc8ecd:

  at91: modified NAND flash timing on otc570 board (2012-02-20 09:00:13 +0100)

are available in the git repository at:

  git://git.denx.de/u-boot-pxa.git fix

for you to fetch changes up to 2e85d5c10f01b21ac47f9b0dd4a9dcc022ac0be6:

  PXA: Fix missing get_tbclk() breaking vpac boards (2012-02-27 13:59:47 +0100)


Marek Vasut (3):
  PXA: Remove PXA PCMCIA support
  PXA: Fix warning in zipitz2
  PXA: Fix missing get_tbclk() breaking vpac boards

Simon Glass (1):
  arm: Remove jornada link script

Vasily Khoruzhick (2):
  zipitz2: fix boot issue introduced by PXA low level init rework
  zipitz2: use pxa_mmc_gen as MMC driver

 arch/arm/cpu/pxa/timer.c|5 ++
 board/jornada/u-boot.lds|   58 ---
 board/zipitz2/zipitz2.c |9 
 doc/README.PXA_CF   |   56 --
 drivers/pcmcia/Makefile |1 -
 drivers/pcmcia/pxa_pcmcia.c |   93 ---
 include/configs/zipitz2.h   |   14 +-
 include/pcmcia.h|3 +-
 8 files changed, 26 insertions(+), 213 deletions(-)
 delete mode 100644 board/jornada/u-boot.lds
 delete mode 100644 doc/README.PXA_CF
 delete mode 100644 drivers/pcmcia/pxa_pcmcia.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] PXA: Fix missing get_tbclk() breaking vpac boards

2012-02-27 Thread Marek Vasut
Signed-off-by: Marek Vasut 
---
 arch/arm/cpu/pxa/timer.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/pxa/timer.c b/arch/arm/cpu/pxa/timer.c
index b7b0da9..a8f7462 100644
--- a/arch/arm/cpu/pxa/timer.c
+++ b/arch/arm/cpu/pxa/timer.c
@@ -94,3 +94,8 @@ void __udelay(unsigned long usec)
while (get_ticks() < tmp)   /* loop till event */
 /*NOP*/;
 }
+
+ulong get_tbclk(void)
+{
+   return TIMER_FREQ_HZ;
+}
-- 
1.7.9

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


Re: [U-Boot] [PATCH v3] AVR32: fix timer_init() function

2012-02-27 Thread Sven Schnelle

Hi Wolfgang,

On 02/26/2012 11:40 PM, Wolfgang Denk wrote:

Dear Sven,


Date: Sun,  4 Oct 2015 21:53:32 +0200


would you be willing to disclose the secrets of running such a time
machine ?


Hehe. The 'time machine' was basically a dead CMOS battery in my 
Thinkpad at that time ;)




In message<1443988412-13421-1-git-send-email-sv...@stackframe.org>  you wrote:

timer_init() now returns an int (the error code) instead of void.
This makes compilation fail with:

interrupts.c:111: error: conflicting types for 'timer_init'
/home/svens/u-boot/u-boot/include/common.h:246: error: previous declaration of 
'timer_init' was here
make[1]: *** [interrupts.o] Error 1


We're just discussing to drop support for AVR32 systems due to lack of
a custodian, and appearent lack of interest, see
  02/25 To:u-boot@lists.d  [PATCH] AVR32 removal due to lack of custodian.
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/125752

Are you still interestedin AVR32?  Would you be willing to volunteer
to take over custodianship for this processor family?


I fear i don't have enough time for maintaining a port, and i only have 
one AVR32 Board (the ATGNW100). I think Andreas would be a much better 
maintainer, IMHO he has much more knowledge on the AVR32 area.


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


Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-27 Thread Sughosh Ganu
hi Christian,

On Mon Feb 27, 2012 at 12:37:16PM +0100, Christian Riesch wrote:
> Hi Sughosh,
> 
> On Mon, Feb 27, 2012 at 11:56 AM, Sughosh Ganu  
> wrote:
> > hi Christian,
> >
> > On Mon Feb 27, 2012 at 11:39:42AM +0100, Christian Riesch wrote:
> >> Hi,
> >>
> >> On Mon, Feb 27, 2012 at 11:16 AM, Sughosh Ganu  
> >> wrote:
> >
> > 
> >
> >> >> >>  arch/arm/cpu/arm926ejs/davinci/spl.c |    2 ++
> >> >> >>  1 files changed, 2 insertions(+), 0 deletions(-)
> >> >> >>
> >> >> >> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
> >> >> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> >> index b1eff26..2861907 100644
> >> >> >> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> >> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> >> @@ -32,10 +32,12 @@
> >> >> >>
> >> >> >>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >> >> >>
> >> >> >> +#ifdef CONFIG_SPL_SPI_LOAD
> >> >> >>  DECLARE_GLOBAL_DATA_PTR;
> >> >> >>  /* Define global data structure pointer to it*/
> >> >> >>  static gd_t gdata __attribute__ ((section(".data")));
> >> >> >>  static bd_t bdata __attribute__ ((section(".data")));
> >> >> >> +#endif
> >
> > 
> >
> >> >> >  Can you specify which boards you get this warning for. With your
> >> >> >  patch to add libcommon to hawkboard's spl image, this is now also
> >> >> >  needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.
> >>
> >> Simon's patch is for the hawkboard, since due to another patch in his
> >> patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board
> >> that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did
> >> not check the rest of your patchset, why do you need LIBCOMMON on the
> >> hawkboard at all?)
> >
> >  LIBCOMMON is now needed as the generic relocation based functions
> >  are part of the libcommon.o, which are being enabled in the same
> >  patchset for all arm boards. So if i understand correct, all arm
> >  board based spl's now need libcommon and libgeneric.
> >
> >  The only thing i see is that libcommon and libgeneric are not
> >  defined for cam_enc_4xx board which uses spl, and this patchset does
> >  not add it either. Not sure whether it got missed.
> 
> When I asked Heiko Schocher a few month ago why he defined putc and
> puts in arch/arm/cpu/arm926ejs/davinci/spl.c he replied that he could
> not use LIBCOMMON due to size limitations for the SPL. So I guess that
> this board will not be able to use the generic relocation functions,
> unless the SPL is smaller than 16kB, right? Simon's patchset will
> break this board then, right?

  That is exactly what i reported in one of the threads in response to
  addition of libcommon and libgeneric to the hawkboard's spl. In
  fact, this might cause problems on quite a few boards with spl size
  restrictions. I am not sure, whether the generic relocation feature
  should be turned on by default on all boards or should be a config
  option -- at least for the spl builds. Another option would be to
  move it to a place where it is not needed to compile in the entire
  libcommon/libgeneric support that is not needed for the generic
  relocation code. I think that would help us keep the generic
  relocation without the size bloat that we see right now.

  http://lists.denx.de/pipermail/u-boot/2012-February/118567.html



> >> void board_init_r(gd_t *id, ulong dummy)
> >> {
> >> #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >>         mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
> >>                         CONFIG_SYS_MALLOC_LEN);
> >
> >  Can you please explain why we need the mem_malloc_init. I did not
> >  include this, and spl boots up just fine on my board.
> >
> 
> malloc is required for the SPI code only, so you could also put it
> within #ifdef CONFIG_SPL_SPI_LOAD

  Ok, i will move the common changes to a static function, and call
  it from both the nand and spi load cases. Or, should i wait till a
  consensus is drawn on whether to enable this feature for spl images
  also. In case this is not needed for spl, then we don't need this
  change.

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


[U-Boot] [PATCH] PXA: Fix warning in zipitz2

2012-02-27 Thread Marek Vasut
Configuring for zipitz2 board...
zipitz2.c: In function ‘board_mmc_init’:
zipitz2.c:85:2: warning: implicit declaration of function ‘pxa_mmc_register’ 
[-Wimplicit-function-declaration]

Signed-off-by: Marek Vasut 
---
 board/zipitz2/zipitz2.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/board/zipitz2/zipitz2.c b/board/zipitz2/zipitz2.c
index 4075fb6..82dfa82 100644
--- a/board/zipitz2/zipitz2.c
+++ b/board/zipitz2/zipitz2.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
-- 
1.7.9

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


Re: [U-Boot] Unable to run scripts with autoscr command

2012-02-27 Thread Graeme Russ
Hi Asif,

On 02/27/2012 07:19 PM, Asif Sulikeri wrote:
> Hi Graeme,
> 
> On Mon, Feb 27, 2012 at 12:12 PM, Graeme Russ  > wrote:
> 
> Hi Asif,
> 
> On 02/27/2012 05:26 PM, Asif Sulikeri wrote:
> > >> And the increase of 100kB is massive - are you sure you are
> > compiling with
> > >> the same set of options defined in the board config file? If
> you are
> > sure,
> > >> then it would be interesting to find out what has caused it.
> >
> >
> > I am compiling with the default options, with no additional changes
> made to
> > the conf file, the 1.3.4 version used to give me 150kB binary as 
> compared
> > to the 252kB binary generated by the 2010.06 version.
> 
> Ah - Looks like some more options have crept into the default 
> configuration
> - Can you send the two board config files (as inline text, not 
> attachments)
> so I can compare?

[snip]


> and the contents of: *u-boot-2010.06/include/configs/davinci_dm365evm.h *
> u-boot version: *2010.06*

[snip]

> 
> /* USB Configuration */
> #define CONFIG_USB_DAVINCI
> #define CONFIG_MUSB_HCD

I think this is where most of the code size increase is coming from - Try
to #undef there and all of the following USB stuff will go

> #ifdef CONFIG_USB_DAVINCI
> #define CONFIG_CMD_USB /* include support for usb  */
> #define CONFIG_CMD_STORAGE /* include support for usb  */
> #define CONFIG_CMD_FAT /* include support for FAT/storage*/
> #define CONFIG_DOS_PARTITION   /* include support for FAT/storage*/
> #endif
> 
> #ifdef CONFIG_MUSB_HCD /* include support for usb host */
> #define CONFIG_CMD_USB /* include support for usb cmd */
> #define CONFIG_USB_STORAGE /* MSC class support */
> #define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */
> #define CONFIG_CMD_FAT /* inclue support for FAT/storage */
> #define CONFIG_DOS_PARTITION   /* inclue support for FAT/storage */
> 
> #ifdef CONFIG_USB_KEYBOARD /* HID class support */
> #define CONFIG_SYS_USB_EVENT_POLL
> 
> #define CONFIG_PREBOOT "usb start"
> #endif /* CONFIG_USB_KEYBOARD */
> #endif /* CONFIG_MUSB_HCD */
> 
> #ifdef CONFIG_MUSB_UDC
> #define CONFIG_USB_DEVICE  1
> #define CONFIG_USB_TTY 1
> #define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
> #define CONFIG_USBD_VENDORID   0x0451
> #define CONFIG_USBD_PRODUCTID  0x5678
> #define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
> #define CONFIG_USBD_PRODUCT_NAME   "DM365VM"
> #endif /* CONFIG_MUSB_UDC */
> 

Regards,

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


Re: [U-Boot] [PATCH] Enable high speed support for USB device framework and usbtty

2012-02-27 Thread Marek Vasut
> From: Vipin KUMAR 
> 
> This patch adds the support for high speed in usb device framework and
> usbtty driver. This feature has been kept within a macro CONFIG_USBD_HS,
> so the board configuration files have to define this macro to enable high
> speed support.
> 
> Along with that specific peripheral drivers also need to define a function
> to let the framework know that the enumeration has happened at high speed.
> This function prototype is "int is_usbd_high_speed(void)"
> 
> Signed-off-by: Vipin Kumar 
> Signed-off-by: Amit Virdi 
> ---
>  README|8 +++
>  drivers/serial/usbtty.c   |   50
> - drivers/serial/usbtty.h   | 
>   4 +++
>  drivers/usb/gadget/core.c |   14 
>  drivers/usb/gadget/ep0.c  |   24 ++---
>  include/usbdescriptors.h  |   15 +
>  include/usbdevice.h   |   24 -
>  7 files changed, 133 insertions(+), 6 deletions(-)
> 
> diff --git a/README b/README
> index eba6378..d54bb68 100644
> --- a/README
> +++ b/README
> @@ -1165,6 +1165,14 @@ The following options need to be configured:
>   Define this to have a tty type of device available to
>   talk to the UDC device
> 
> + CONFIG_USBD_HS
> + Define this to enable the high speed support for usb
> + device and usbtty. If this feature is enabled, a routine
> + int is_usbd_high_speed(void)
> + also needs to be defined by the driver to dynamically 
poll
> + whether the enumeration has succeded at high speed or 
full
> + speed.
> +
>   CONFIG_SYS_CONSOLE_IS_IN_ENV
>   Define this if you want stdin, stdout &/or stderr to
>   be set to usbtty.
> diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
> index 550bc58..0374c7d 100644
> --- a/drivers/serial/usbtty.c
> +++ b/drivers/serial/usbtty.c
> @@ -133,6 +133,19 @@ static struct usb_device_descriptor device_descriptor
> = { };
> 
> 
> +#if defined(CONFIG_USBD_HS)
> +static struct usb_qualifier_descriptor qualifier_descriptor = {
> + .bLength = sizeof(struct usb_qualifier_descriptor),
> + .bDescriptorType =  USB_DT_QUAL,
> + .bcdUSB =   cpu_to_le16(USB_BCD_VERSION),
> + .bDeviceClass = COMMUNICATIONS_DEVICE_CLASS,
> + .bDeviceSubClass =  0x00,
> + .bDeviceProtocol =  0x00,
> + .bMaxPacketSize0 =  EP0_MAX_PACKET_SIZE,
> + .bNumConfigurations =   NUM_CONFIGS
> +};
> +#endif
> +
>  /*
>   * Static CDC ACM specific descriptors
>   */
> @@ -638,6 +651,9 @@ static void usbtty_init_instances (void)
>   memset (device_instance, 0, sizeof (struct usb_device_instance));
>   device_instance->device_state = STATE_INIT;
>   device_instance->device_descriptor = &device_descriptor;
> +#if defined(CONFIG_USBD_HS)
> + device_instance->qualifier_descriptor = &qualifier_descriptor;
> +#endif
>   device_instance->event = usbtty_event_handler;
>   device_instance->cdc_recv_setup = usbtty_cdc_setup;
>   device_instance->bus = bus_instance;
> @@ -751,6 +767,10 @@ static void usbtty_init_terminal_type(short type)
>   device_descriptor.idProduct =
>   cpu_to_le16(CONFIG_USBD_PRODUCTID_CDCACM);
> 
> +#if defined(CONFIG_USBD_HS)
> + qualifier_descriptor.bDeviceClass =
> + COMMUNICATIONS_DEVICE_CLASS;
> +#endif
>   /* Assign endpoint indices */
>   tx_endpoint = ACM_TX_ENDPOINT;
>   rx_endpoint = ACM_RX_ENDPOINT;
> @@ -779,7 +799,9 @@ static void usbtty_init_terminal_type(short type)
>   device_descriptor.bDeviceClass = 0xFF;
>   device_descriptor.idProduct =
>   cpu_to_le16(CONFIG_USBD_PRODUCTID_GSERIAL);
> -
> +#if defined(CONFIG_USBD_HS)
> + qualifier_descriptor.bDeviceClass = 0xFF;
> +#endif
>   /* Assign endpoint indices */
>   tx_endpoint = GSERIAL_TX_ENDPOINT;
>   rx_endpoint = GSERIAL_RX_ENDPOINT;
> @@ -932,6 +954,9 @@ static int usbtty_configured (void)
>  static void usbtty_event_handler (struct usb_device_instance *device,
> usb_device_event_t event, int data)
>  {
> +#if defined(CONFIG_USBD_HS)
> + int i;
> +#endif
>   switch (event) {
>   case DEVICE_RESET:
>   case DEVICE_BUS_INACTIVE:
> @@ -942,6 +967,29 @@ static void usbtty_event_handler (struct
> usb_device_instance *device, break;
> 
>   case DEVICE_ADDRESS_ASSIGNED:
> +#if defined(CONFIG_USBD_HS)
> + /*
> +  * is_usbd_high_speed routine needs to be defined by
> +  * specific gadget driver
> +   

Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-27 Thread Christian Riesch
Hi Sughosh,

On Mon, Feb 27, 2012 at 11:56 AM, Sughosh Ganu  wrote:
> hi Christian,
>
> On Mon Feb 27, 2012 at 11:39:42AM +0100, Christian Riesch wrote:
>> Hi,
>>
>> On Mon, Feb 27, 2012 at 11:16 AM, Sughosh Ganu  
>> wrote:
>
> 
>
>> >> >>  arch/arm/cpu/arm926ejs/davinci/spl.c |    2 ++
>> >> >>  1 files changed, 2 insertions(+), 0 deletions(-)
>> >> >>
>> >> >> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
>> >> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> >> index b1eff26..2861907 100644
>> >> >> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> >> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> >> @@ -32,10 +32,12 @@
>> >> >>
>> >> >>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>> >> >>
>> >> >> +#ifdef CONFIG_SPL_SPI_LOAD
>> >> >>  DECLARE_GLOBAL_DATA_PTR;
>> >> >>  /* Define global data structure pointer to it*/
>> >> >>  static gd_t gdata __attribute__ ((section(".data")));
>> >> >>  static bd_t bdata __attribute__ ((section(".data")));
>> >> >> +#endif
>
> 
>
>> >> >  Can you specify which boards you get this warning for. With your
>> >> >  patch to add libcommon to hawkboard's spl image, this is now also
>> >> >  needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.
>>
>> Simon's patch is for the hawkboard, since due to another patch in his
>> patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board
>> that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did
>> not check the rest of your patchset, why do you need LIBCOMMON on the
>> hawkboard at all?)
>
>  LIBCOMMON is now needed as the generic relocation based functions
>  are part of the libcommon.o, which are being enabled in the same
>  patchset for all arm boards. So if i understand correct, all arm
>  board based spl's now need libcommon and libgeneric.
>
>  The only thing i see is that libcommon and libgeneric are not
>  defined for cam_enc_4xx board which uses spl, and this patchset does
>  not add it either. Not sure whether it got missed.

When I asked Heiko Schocher a few month ago why he defined putc and
puts in arch/arm/cpu/arm926ejs/davinci/spl.c he replied that he could
not use LIBCOMMON due to size limitations for the SPL. So I guess that
this board will not be able to use the generic relocation functions,
unless the SPL is smaller than 16kB, right? Simon's patchset will
break this board then, right?

However, I we can make all davinci boards use LIBCOMMON, we can remove
the putc/puts functions from spl.c.

>> However, the patch fixes the warning, but now we use putc and puts
>> from LIBCOMMON without initializing them. Thus it breaks the console
>> output of the hawkboard SPL.
>>
>> So the correct solution would be to keep the ifdefs around the
>> definition of gdata and bdata as they are, but change board_init_f()
>> like this:
>
>  I have a patch for this, which i will send today. There is only one
>  question i have though.
>
>>
>> void board_init_r(gd_t *id, ulong dummy)
>> {
>> #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>         mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
>>                         CONFIG_SYS_MALLOC_LEN);
>
>  Can you please explain why we need the mem_malloc_init. I did not
>  include this, and spl boots up just fine on my board.
>

malloc is required for the SPI code only, so you could also put it
within #ifdef CONFIG_SPL_SPI_LOAD

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


Re: [U-Boot] [PATCH] AVR32 removal due to lack of custodian.

2012-02-27 Thread Andreas Bießmann
Hi Wolfgang,

On 25.02.2012 23:13, Wolfgang Denk wrote:
> AVR32 appaers to be unmaintained, and nobody appears to care about

s/appaers/appears/g

well, there where at least two users (sven and I) last year ...

> that.  Let's get rid fof it.

Would be sad, at least now ...

I'm willing to get u-boot avr32 support to live on for at least some
years, if no one else volunteers.

regards

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


Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-27 Thread Sughosh Ganu
hi Christian,

On Mon Feb 27, 2012 at 11:39:42AM +0100, Christian Riesch wrote:
> Hi,
> 
> On Mon, Feb 27, 2012 at 11:16 AM, Sughosh Ganu  
> wrote:



> >> >>  arch/arm/cpu/arm926ejs/davinci/spl.c |    2 ++
> >> >>  1 files changed, 2 insertions(+), 0 deletions(-)
> >> >>
> >> >> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
> >> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> index b1eff26..2861907 100644
> >> >> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> >> @@ -32,10 +32,12 @@
> >> >>
> >> >>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >> >>
> >> >> +#ifdef CONFIG_SPL_SPI_LOAD
> >> >>  DECLARE_GLOBAL_DATA_PTR;
> >> >>  /* Define global data structure pointer to it*/
> >> >>  static gd_t gdata __attribute__ ((section(".data")));
> >> >>  static bd_t bdata __attribute__ ((section(".data")));
> >> >> +#endif



> >> >  Can you specify which boards you get this warning for. With your
> >> >  patch to add libcommon to hawkboard's spl image, this is now also
> >> >  needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.
> 
> Simon's patch is for the hawkboard, since due to another patch in his
> patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board
> that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did
> not check the rest of your patchset, why do you need LIBCOMMON on the
> hawkboard at all?)

  LIBCOMMON is now needed as the generic relocation based functions
  are part of the libcommon.o, which are being enabled in the same
  patchset for all arm boards. So if i understand correct, all arm
  board based spl's now need libcommon and libgeneric.

  The only thing i see is that libcommon and libgeneric are not
  defined for cam_enc_4xx board which uses spl, and this patchset does
  not add it either. Not sure whether it got missed.


> However, the patch fixes the warning, but now we use putc and puts
> from LIBCOMMON without initializing them. Thus it breaks the console
> output of the hawkboard SPL.
> 
> So the correct solution would be to keep the ifdefs around the
> definition of gdata and bdata as they are, but change board_init_f()
> like this:

  I have a patch for this, which i will send today. There is only one
  question i have though.

> 
> void board_init_r(gd_t *id, ulong dummy)
> {
> #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
> CONFIG_SYS_MALLOC_LEN);

  Can you please explain why we need the mem_malloc_init. I did not
  include this, and spl boots up just fine on my board.

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


Re: [U-Boot] [PATCH v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-27 Thread Christian Riesch
Hi,

On Mon, Feb 27, 2012 at 11:16 AM, Sughosh Ganu  wrote:
> hi Simon,
>
> On Sun Feb 26, 2012 at 09:56:37AM -0800, Simon Glass wrote:
>> Hi Sughosh,
>>
>> On Thu, Feb 23, 2012 at 9:25 AM, Sughosh Ganu  
>> wrote:
>> > hi Simon,
>> >
>> > On Mon Feb 20, 2012 at 05:32:49PM -0800, Simon Glass wrote:
>> >> This fixes the following warnings in an SPL build when libcommon is
>> >> in use:
>> >>
>> >> spl.c:37: warning: 'gdata' defined but not used
>> >> spl.c:38: warning: 'bdata' defined but not used
>> >>
>> >> Signed-off-by: Simon Glass 
>> >> ---
>> >> Changes in v4:
>> >> - Add new patch to fix davinci build warnings
>> >>
>> >>  arch/arm/cpu/arm926ejs/davinci/spl.c |    2 ++
>> >>  1 files changed, 2 insertions(+), 0 deletions(-)
>> >>
>> >> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
>> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> index b1eff26..2861907 100644
>> >> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> >> @@ -32,10 +32,12 @@
>> >>
>> >>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>> >>
>> >> +#ifdef CONFIG_SPL_SPI_LOAD
>> >>  DECLARE_GLOBAL_DATA_PTR;
>> >>  /* Define global data structure pointer to it*/
>> >>  static gd_t gdata __attribute__ ((section(".data")));
>> >>  static bd_t bdata __attribute__ ((section(".data")));
>> >> +#endif

In arch/arm/cpu/arm926ejs/davinci/spl.c gdata and bdata are used for
serial_init() to allow output to the console from the SPL. However,
this is only the case when LIBCOMMON is used. LIBCOMMON is required
for booting from SPI, but not for booting from NAND. Up to now davinci
boards that boot from NAND with SPL did not use LIBCOMMON but used the
puts and putc functions defined in spl.c for console output.

>> >  Can you specify which boards you get this warning for. With your
>> >  patch to add libcommon to hawkboard's spl image, this is now also
>> >  needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.

Simon's patch is for the hawkboard, since due to another patch in his
patchset LIBCOMMON is enabled in hawkboard's SPL. Now we have a board
that boots from NAND with SPL and has LIBCOMMON enabled (Simon, I did
not check the rest of your patchset, why do you need LIBCOMMON on the
hawkboard at all?)

However, the patch fixes the warning, but now we use putc and puts
from LIBCOMMON without initializing them. Thus it breaks the console
output of the hawkboard SPL.

So the correct solution would be to keep the ifdefs around the
definition of gdata and bdata as they are, but change board_init_f()
like this:

void board_init_r(gd_t *id, ulong dummy)
{
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
CONFIG_SYS_MALLOC_LEN);

gd = &gdata;
gd->bd = &bdata;
gd->flags |= GD_FLG_RELOC;
gd->baudrate = CONFIG_BAUDRATE;
serial_init();  /* serial communications setup */
gd->have_console = 1;
#endif
#ifdef CONFIG_SPL_NAND_LOAD
nand_init();
puts("Nand boot...\n");
nand_boot();
#endif
#ifdef CONFIG_SPL_SPI_LOAD
puts("SPI boot...\n");
spi_boot();
#endif
}

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


Re: [U-Boot] [PATCH 03/11] st_smi: Return error in case TFF is not set

2012-02-27 Thread Stefan Roese
On Friday 24 February 2012 13:23:06 Amit Virdi wrote:
> Curently the code makes wrong assumption that the Transfer finished flag
> shall be set within the stipulated time. However, there may occur a
> scenario in which the TFF flag is not set. Return error in that case.
> 
> Signed-off-by: Vipin Kumar 
> Signed-off-by: Amit Virdi 
> ---
>  drivers/mtd/st_smi.c |   22 ++
>  1 files changed, 14 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mtd/st_smi.c b/drivers/mtd/st_smi.c
> index 82f1fe1..ec19b0d 100644
> --- a/drivers/mtd/st_smi.c
> +++ b/drivers/mtd/st_smi.c
> @@ -58,13 +58,15 @@ static struct flash_dev flash_ids[] = {
>   *
>   * Wait until TFF is set in status register
>   */
> -static void smi_wait_xfer_finish(int timeout)
> +static int smi_wait_xfer_finish(int timeout)
>  {
> - while (timeout--) {
> + do {
>   if (readl(&smicntl->smi_sr) & TFF)
> - break;
> + return 0;
>   udelay(1000);
> - }
> + } while (timeout--);
> +
> + return -1;

Somewhat unrelated to the patch topic, but I don't really like this kind of 
timeout loops. Since it always adds at least 1ms delay after initial failing 
test. Better use something like this:

static int smi_wait_xfer_finish(int timeout)
{
ulong start = get_timer(0);

while (get_timer(start) < timeout) {
if (readl(&smicntl->smi_sr) & TFF)
return 0;

/* Try again after 100usec */
udelay(100);
}

return -1;
}

You could tune this udelay(100) down more or even remove it completely.

But such a change could be done in a addon cleanup patch, changing all timeout 
loops this way. I suggest you take a look at my version, here these loops are 
changes. In the designware networking driver as well, iirc.

Thanks,
Stefan

--
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 v4 07/13] davinci: Use correct #ifdef around gdata/bdata

2012-02-27 Thread Sughosh Ganu
hi Simon,

On Sun Feb 26, 2012 at 09:56:37AM -0800, Simon Glass wrote:
> Hi Sughosh,
> 
> On Thu, Feb 23, 2012 at 9:25 AM, Sughosh Ganu  wrote:
> > hi Simon,
> >
> > On Mon Feb 20, 2012 at 05:32:49PM -0800, Simon Glass wrote:
> >> This fixes the following warnings in an SPL build when libcommon is
> >> in use:
> >>
> >> spl.c:37: warning: 'gdata' defined but not used
> >> spl.c:38: warning: 'bdata' defined but not used
> >>
> >> Signed-off-by: Simon Glass 
> >> ---
> >> Changes in v4:
> >> - Add new patch to fix davinci build warnings
> >>
> >>  arch/arm/cpu/arm926ejs/davinci/spl.c |    2 ++
> >>  1 files changed, 2 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
> >> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> index b1eff26..2861907 100644
> >> --- a/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> >> @@ -32,10 +32,12 @@
> >>
> >>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> >>
> >> +#ifdef CONFIG_SPL_SPI_LOAD
> >>  DECLARE_GLOBAL_DATA_PTR;
> >>  /* Define global data structure pointer to it*/
> >>  static gd_t gdata __attribute__ ((section(".data")));
> >>  static bd_t bdata __attribute__ ((section(".data")));
> >> +#endif
> >
> >  Can you specify which boards you get this warning for. With your
> >  patch to add libcommon to hawkboard's spl image, this is now also
> >  needed for hawkboard which uses CONFIG_SPL_NAND_LOAD.
> 
> Perhaps it is any davinci board, with SPI? I don't have any of these -
> I was just fixing what I thought was a minor #ifdef bug in the code.

  I checked the configs for all the davinci boards, and cam_enc_4xx,
  da850* and hawkboard use spl. Out of these the da850* use a spi
  flash, while cam_enc_4xx and hawkboard both use a nand. So we should
  not be using the CONFIG_SPL_SPI_LOAD check to exclude the gdata and
  bdata objects -- these are now needed after adding the libcommon
  support to the hawkboard.

  Also, the cam_enc_4xx board which uses a spl does not have
  CONFIG_SPL_LIBCOMMON_SUPPORT and CONFIG_SPL_LIBGENERIC_SUPPORT
  defined and this patchset does not add these defines for the
  board. Was adding these defines for the board missed out. If so,
  then this patch would no longer be needed.

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


Re: [U-Boot] [PATCH 2/3] SPEAr: Configure FSMC driver for NAND interface

2012-02-27 Thread Amit Virdi

Hello Stefan,

On 2/27/2012 3:32 PM, Stefan Roese wrote:

Hi Amit,

please find a few comments below.

On Monday 27 February 2012 10:38:23 Amit Virdi wrote:

From: Vipin KUMAR

Since FSMC is a standard IP and it supports different memory interfaces, it
is supported independent of spear platform and spear is configured to use
that driver for interfacing with the NAND device

Signed-off-by: Vipin Kumar
Signed-off-by: Amit Virdi
---
  arch/arm/include/asm/arch-spear/hardware.h |8 
  board/spear/spear300/spear300.c|7 ---
  board/spear/spear310/spear310.c|7 ---
  board/spear/spear320/spear320.c|7 ---
  board/spear/spear600/spear600.c|7 ---
  include/configs/spear-common.h |2 +-
  include/configs/spear3xx.h |4 
  include/configs/spear6xx.h |3 +++
  8 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/arch/arm/include/asm/arch-spear/hardware.h
b/arch/arm/include/asm/arch-spear/hardware.h index 818f36c..a6517b2 100644
--- a/arch/arm/include/asm/arch-spear/hardware.h
+++ b/arch/arm/include/asm/arch-spear/hardware.h
@@ -37,15 +37,15 @@

  #if defined(CONFIG_SPEAR600)
  #define CONFIG_SYS_I2C_BASE   (0xD020)
-#define CONFIG_SPEAR_FSMCBASE  (0xD180)
+#define CONFIG_SYS_FSMC_BASE   (0xD180)


Please remove the parentheses here as they are not needed. Should be done to
all those defines, perhaps in a cosmetic cleanup patch at some time as well:



Yes. I'll be sending a separate cleanup commit.


+#define CONFIG_SYS_FSMC_BASE   0xD180


  #elif defined(CONFIG_SPEAR300)





diff --git a/include/configs/spear-common.h
b/include/configs/spear-common.h index 516b78e..c37305f 100644
--- a/include/configs/spear-common.h
+++ b/include/configs/spear-common.h
@@ -90,7 +90,7 @@
  /* NAND FLASH Configuration */
  #define CONFIG_MTD_DEVICE
  #define CONFIG_MTD_PARTITIONS
-#define CONFIG_NAND_SPEAR  1
+#define CONFIG_NAND_FSMC
  #define CONFIG_SYS_MAX_NAND_DEVICE1
  #define CONFIG_MTD_NAND_VERIFY_WRITE


I suggest that you remove this last define. Most likely it was added for
debugging purpose only. It slows down the speed and it brakes UBI support.



Ok.


diff --git a/include/configs/spear3xx.h b/include/configs/spear3xx.h
index bd5d111..5bdd874 100644
--- a/include/configs/spear3xx.h
+++ b/include/configs/spear3xx.h
@@ -117,6 +117,10 @@

  #endif

+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT
+
  #if defined(CONFIG_SPEAR300)
  #define CONFIG_SYS_NAND_BASE  0x8000

diff --git a/include/configs/spear6xx.h b/include/configs/spear6xx.h
index 8de7ebd..1e06c72 100644
--- a/include/configs/spear6xx.h
+++ b/include/configs/spear6xx.h
@@ -38,6 +38,9 @@
  #define CONFIG_PL01x_PORTS{ (void

*)CONFIG_SYS_SERIAL0, \

(void

*)CONFIG_SYS_SERIAL1 }


+/* NAND flash configuration */
+#define CONFIG_SYS_FSMC_NAND_SP
+#define CONFIG_SYS_FSMC_NAND_8BIT


You also need the following define for this to work with the latest NAND
subsystem:

#define CONFIG_MTD_ECC_SOFT

Not sure about SPEAr3xx. Most likely this needs it as well.



Ok. I'll verify the image after the making the changes you suggested and 
then get back.


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


  1   2   >