[U-Boot] [PATCH 2/2] powerpc/c29xpcie: add support for C29XPCIE board

2013-07-01 Thread y
From: Mingkai Hu 

C29XPCIE board is a series of Freescale PCIe add-in cards to perform
as public key crypto accelerator or secure key management module. It
includes C293PCIE board, C293PCIE board and C291PCIE board.

 - 512KB platform SRAM in addition to 512K L2 Cache/SRAM
 - 512MB soldered DDR3 32bit memory
 - CPLD System Logic
 - 64MB x16 NOR flash and 4GB x8 NAND flash
 - 16MB SPI flash

Signed-off-by: Mingkai Hu 
Singed-off-by: Po Liu 
---
Base on git://git.denx.de/u-boot.git
 board/freescale/c29xpcie/Makefile   |  34 +++
 board/freescale/c29xpcie/c29xpcie.c | 150 +++
 board/freescale/c29xpcie/cpld.c | 155 
 board/freescale/c29xpcie/cpld.h |  53 
 board/freescale/c29xpcie/ddr.c  |  89 +++
 board/freescale/c29xpcie/law.c  |  22 ++
 board/freescale/c29xpcie/tlb.c  |  89 +++
 boards.cfg  |   2 +
 include/configs/C29XPCIE.h  | 490 
 9 files changed, 1084 insertions(+)
 create mode 100644 board/freescale/c29xpcie/Makefile
 create mode 100644 board/freescale/c29xpcie/c29xpcie.c
 create mode 100644 board/freescale/c29xpcie/cpld.c
 create mode 100644 board/freescale/c29xpcie/cpld.h
 create mode 100644 board/freescale/c29xpcie/ddr.c
 create mode 100644 board/freescale/c29xpcie/law.c
 create mode 100644 board/freescale/c29xpcie/tlb.c
 create mode 100644 include/configs/C29XPCIE.h

diff --git a/board/freescale/c29xpcie/Makefile 
b/board/freescale/c29xpcie/Makefile
new file mode 100644
index 000..15bef9a
--- /dev/null
+++ b/board/freescale/c29xpcie/Makefile
@@ -0,0 +1,34 @@
+#
+# Copyright 2013 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= cpld.o
+COBJS-y+= ddr.o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/c29xpcie/c29xpcie.c 
b/board/freescale/c29xpcie/c29xpcie.c
new file mode 100644
index 000..21f3892
--- /dev/null
+++ b/board/freescale/c29xpcie/c29xpcie.c
@@ -0,0 +1,150 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "cpld.h"
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int checkboard(void)
+{
+   struct cpu_type *cpu = gd->arch.cpu;
+
+   printf("Board: %sPCIe, ", cpu->name);
+   printf("CPLD Ver: 0x%02x\n", CPLD_READ(cpldver));
+
+   return 0;
+}
+
+int board_early_init_f(void)
+{
+   struct fsl_ifc *ifc = (void *)CONFIG_SYS_IFC_ADDR;
+
+   /* Clock configuration to access CPLD using IFC(GPCM) */
+   setbits_be32(&ifc->ifc_gcr, 1 << IFC_GCR_TBCTL_TRN_TIME_SHIFT);
+
+   return 0;
+}
+
+int board_early_init_r(void)
+{
+   const unsigned long flashbase = CONFIG_SYS_FLASH_BASE;
+   const u8 flash_esel = find_tlb_idx((void *)flashbase, 1);
+
+   /*
+* Remap Boot flash region to caching-inhibited
+* so that flash can be erased properly.
+*/
+
+   /* Flush d-cache and invalidate i-cache of any FLASH data */
+   flush_dcache();
+   invalidate_icache();
+
+   /* invalidate existing TLB entry for flash */
+   disable_tlb(flash_esel);
+
+   set_tlb(1, flashbase, CONFIG_SYS_FLASH_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, flash_esel, BOOKE_PAGESZ_64M, 1);
+
+   return 0;
+}
+
+#ifdef CONFIG_PCI
+void pci_init_board(void)
+{
+   fsl_pcie_init_board(0);
+}
+#endif /* ifdef CONFIG_PCI */
+
+#ifdef CONFIG_TSEC_ENET
+int board_eth_init(bd_t *bis)
+{
+   struct fsl_pq_mdio_info mdio_info;
+   struct tsec_info_struct tsec_info[2];
+   int num = 0;
+
+#ifdef CONFIG_TSEC1
+   SET_STD_TSEC_INFO(tsec_info[num], 1);
+   num++;
+#endif
+#ifdef CONFIG_TSEC2
+   SET_STD_TSEC_INFO(tsec_info[

[U-Boot] [PATCH 1/2] powerpc/85xx: Add C29x SoC support

2013-07-01 Thread y
From: Mingkai Hu 

The Freescale C29x family is a high performance crypto co-processor.
It combines a single e500v2 core with necessary SEC engine. There're
three SoC types(C291, C292, C293) with the following features:

 - 512K L2 Cache/SRAM and 512 KB platform SRAM
 - DDR3/DDR3L 32bit DDR controller
 - One PCI express (x1, x2, x4) Gen 2.0 Controller
 - Trust Architecture 2.0
 - SEC6.0 engine

Signed-off-by: Mingkai Hu 
Signed-off-by: Po Liu 
---
Base on git://git.denx.de/u-boot.git
 arch/powerpc/cpu/mpc85xx/Makefile |  2 +
 arch/powerpc/cpu/mpc85xx/c29x_serdes.c| 65 +++
 arch/powerpc/cpu/mpc8xxx/cpu.c|  3 ++
 arch/powerpc/include/asm/config_mpc85xx.h | 12 ++
 arch/powerpc/include/asm/fsl_law.h|  1 +
 arch/powerpc/include/asm/immap_85xx.h | 23 +++
 arch/powerpc/include/asm/processor.h  |  3 ++
 7 files changed, 109 insertions(+)
 create mode 100644 arch/powerpc/cpu/mpc85xx/c29x_serdes.c

diff --git a/arch/powerpc/cpu/mpc85xx/Makefile 
b/arch/powerpc/cpu/mpc85xx/Makefile
index 4669883..28f00af 100644
--- a/arch/powerpc/cpu/mpc85xx/Makefile
+++ b/arch/powerpc/cpu/mpc85xx/Makefile
@@ -62,6 +62,7 @@ COBJS-$(CONFIG_MPC8568) += ddr-gen2.o
 COBJS-$(CONFIG_MPC8544) += ddr-gen2.o
 
 # supports ddr1/2/3
+COBJS-$(CONFIG_C29X)   += ddr-gen3.o
 COBJS-$(CONFIG_MPC8572) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8536) += ddr-gen3.o
 COBJS-$(CONFIG_MPC8569)+= ddr-gen3.o
@@ -116,6 +117,7 @@ COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS1) += 
fsl_corenet_serdes.o
 COBJS-$(CONFIG_SYS_FSL_QORIQ_CHASSIS2) += fsl_corenet2_serdes.o
 
 # SoC specific SERDES support
+COBJS-$(CONFIG_C29X)   += c29x_serdes.o
 COBJS-$(CONFIG_MPC8536) += mpc8536_serdes.o
 COBJS-$(CONFIG_MPC8544) += mpc8544_serdes.o
 COBJS-$(CONFIG_MPC8548) += mpc8548_serdes.o
diff --git a/arch/powerpc/cpu/mpc85xx/c29x_serdes.c 
b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
new file mode 100644
index 000..4b3214d
--- /dev/null
+++ b/arch/powerpc/cpu/mpc85xx/c29x_serdes.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#define SRDS1_MAX_LANES4
+
+static u32 serdes1_prtcl_map;
+
+struct serdes_config {
+   u32 protocol;
+   u8 lanes[SRDS1_MAX_LANES];
+};
+
+static const struct serdes_config serdes1_cfg_tbl[] = {
+   /* SerDes 1 */
+   {1, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {2, {PCIE1, PCIE1, PCIE1, PCIE1} },
+   {3, {PCIE1, PCIE1, NONE, NONE} },
+   {4, {PCIE1, PCIE1, NONE, NONE} },
+   {5, {PCIE1, NONE, NONE, NONE} },
+   {6, {PCIE1, NONE, NONE, NONE} },
+   {}
+};
+
+int is_serdes_configured(enum srds_prtcl device)
+{
+   return (1 << device) & serdes1_prtcl_map;
+}
+
+void fsl_serdes_init(void)
+{
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+   u32 pordevsr = in_be32(&gur->pordevsr);
+   u32 srds_cfg = (pordevsr & MPC85xx_PORDEVSR_IO_SEL) >>
+   MPC85xx_PORDEVSR_IO_SEL_SHIFT;
+   const struct serdes_config *ptr;
+   int lane;
+
+   debug("PORDEVSR[IO_SEL_SRDS] = %x\n", srds_cfg);
+
+   if (srds_cfg > ARRAY_SIZE(serdes1_cfg_tbl)) {
+   printf("Invalid PORDEVSR[IO_SEL_SRDS] = %d\n", srds_cfg);
+   return;
+   }
+
+   ptr = &serdes1_cfg_tbl[srds_cfg];
+   if (!ptr->protocol)
+   return;
+
+   for (lane = 0; lane < SRDS1_MAX_LANES; lane++) {
+   enum srds_prtcl lane_prtcl = ptr->lanes[lane];
+   serdes1_prtcl_map |= (1 << lane_prtcl);
+   }
+}
diff --git a/arch/powerpc/cpu/mpc8xxx/cpu.c b/arch/powerpc/cpu/mpc8xxx/cpu.c
index bc26855..2eed872 100644
--- a/arch/powerpc/cpu/mpc8xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc8xxx/cpu.c
@@ -95,6 +95,9 @@ static struct cpu_type cpu_type_list[] = {
CPU_TYPE_ENTRY(BSC9131, 9131, 1),
CPU_TYPE_ENTRY(BSC9132, 9132, 2),
CPU_TYPE_ENTRY(BSC9232, 9232, 2),
+   CPU_TYPE_ENTRY(C291, C291, 1),
+   CPU_TYPE_ENTRY(C292, C292, 1),
+   CPU_TYPE_ENTRY(C293, C293, 1),
 #elif defined(CONFIG_MPC86xx)
CPU_TYPE_ENTRY(8610, 8610, 1),
CPU_TYPE_ENTRY(8641, 8641, 2),
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 1d46b14..ae52159 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -626,6 +626,18 @@
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe00
 
+#elif defined(CONFIG_C29X)
+#define CONFIG_MAX_CPUS1
+#define CONFIG_FSL_SDHC_V2_3
+#define CONFIG_SYS_FSL_NUM_LAWS12
+#define CONFIG_SYS_PPC_E500_DEBUG

[U-Boot] [PATCH] eb_cpux9k2: fix chip select

2012-04-29 Thread y
From: Jens Scharsig 

* fix chip select initialization for frame buffer, this will be
  increase frame buffer access speed

Signed-off-by: Jens Scharsig 
---
 board/BuS/eb_cpux9k2/cpux9k2.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/BuS/eb_cpux9k2/cpux9k2.c b/board/BuS/eb_cpux9k2/cpux9k2.c
index 54f9b64..15a31be 100644
--- a/board/BuS/eb_cpux9k2/cpux9k2.c
+++ b/board/BuS/eb_cpux9k2/cpux9k2.c
@@ -269,9 +269,9 @@ int drv_video_init(void)
display_height = 256;
printf("%ld x %ld pixel matrix\n", display_width, display_height);
 
-   /* RWH = 7 | RWS =7  | TDF = 15 | NWS = 0x7F */
-   csr =   AT91_SMC_CSR_RWHOLD(7) | AT91_SMC_CSR_RWSETUP(7) |
-   AT91_SMC_CSR_TDF(15) | AT91_SMC_CSR_NWS(127) |
+   /* RWH = 2 | RWS =2  | TDF = 4 | NWS = 0x6 */
+   csr =   AT91_SMC_CSR_RWHOLD(2) | AT91_SMC_CSR_RWSETUP(2) |
+   AT91_SMC_CSR_TDF(4) | AT91_SMC_CSR_NWS(6) |
AT91_SMC_CSR_ACSS_STANDARD | AT91_SMC_CSR_DBW_16 |
AT91_SMC_CSR_BAT_16 | AT91_SMC_CSR_WSEN;
writel(csr, &mc->smc.csr[2]);
-- 
1.7.7

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


[U-Boot] [PATCH RESEND v2 0/4] usb:gadget: USB Mass Storage Gadget

2013-03-05 Thread y
From: Piotr Wilczek 

This patch series add support for the USB Mass Storage (UMS)
New "ums" command provide access to on-device persistent memory.

The storage_common.c and f_mass_storage.c source files are
ported from v2.6.36 Linux kernel

Changes in v2:
- removed commented code;

Lukasz Majewski (3):
  usb:composite: USB Mass Storage - storage_common.c from Linux kernel
  usb:gadget: USB Mass Storage Gadget support
  arm:trats: Use new ums command

Piotr Wilczek (1):
  usb:composite: USB Mass Storage - f_mass_storage.c from Linux kernel

 board/samsung/trats/trats.c |   63 +
 common/Makefile |1 +
 common/cmd_usb_mass_storage.c   |   86 ++
 drivers/usb/gadget/f_mass_storage.c | 2793 +++
 drivers/usb/gadget/g_dnl.c  |6 +
 drivers/usb/gadget/storage_common.c |  653 
 include/configs/trats.h |5 +
 include/usb_mass_storage.h  |   55 +
 8 files changed, 3662 insertions(+)
 create mode 100644 common/cmd_usb_mass_storage.c
 create mode 100644 drivers/usb/gadget/f_mass_storage.c
 create mode 100644 drivers/usb/gadget/storage_common.c
 create mode 100644 include/usb_mass_storage.h

-- 
1.7.9.5

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


[U-Boot] [PATCH RESEND v2 1/4] usb:composite: USB Mass Storage - storage_common.c from Linux kernel

2013-03-05 Thread y
From: Lukasz Majewski 

The storage_common.c source file from v2.6.36 Linux kernel.

commit d26a6aa08b9f12b44fb1ee65625e7480d3d5bb81
Author: Michal Nazarewicz 
Date:   Mon Nov 9 14:15:23 2009 +0100

USB: g_mass_storage: code cleaned up and comments updated

Signed-off-by: Lukasz Majewski 
Signed-off-by: Andrzej Pietrasiewicz 
Signed-off-by: Kyungmin Park 
CC: Marek Vasut 
---
Changes in v2: None

 drivers/usb/gadget/storage_common.c |  653 +++
 1 file changed, 653 insertions(+)
 create mode 100644 drivers/usb/gadget/storage_common.c

diff --git a/drivers/usb/gadget/storage_common.c 
b/drivers/usb/gadget/storage_common.c
new file mode 100644
index 000..594dc10
--- /dev/null
+++ b/drivers/usb/gadget/storage_common.c
@@ -0,0 +1,653 @@
+/*
+ * storage_common.c -- Common definitions for mass storage functionality
+ *
+ * Copyright (C) 2003-2008 Alan Stern
+ * Copyeight (C) 2009 Samsung Electronics
+ * Author: Michal Nazarewicz (m.nazarew...@samsung.com)
+ *
+ * Ported to u-boot:
+ * Andrzej Pietrasiewicz 
+ *
+ * Code refactoring & cleanup:
+ * ??ukasz Majewski 
+ *
+ * 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
+ */
+
+
+/*
+ * This file requires the following identifiers used in USB strings to
+ * be defined (each of type pointer to char):
+ *  - fsg_string_manufacturer -- name of the manufacturer
+ *  - fsg_string_product  -- name of the product
+ *  - fsg_string_serial   -- product's serial
+ *  - fsg_string_config   -- name of the configuration
+ *  - fsg_string_interface-- name of the interface
+ * The first four are only needed when FSG_DESCRIPTORS_DEVICE_STRINGS
+ * macro is defined prior to including this file.
+ */
+
+/*
+ * When FSG_NO_INTR_EP is defined fsg_fs_intr_in_desc and
+ * fsg_hs_intr_in_desc objects as well as
+ * FSG_FS_FUNCTION_PRE_EP_ENTRIES and FSG_HS_FUNCTION_PRE_EP_ENTRIES
+ * macros are not defined.
+ *
+ * When FSG_NO_DEVICE_STRINGS is defined FSG_STRING_MANUFACTURER,
+ * FSG_STRING_PRODUCT, FSG_STRING_SERIAL and FSG_STRING_CONFIG are not
+ * defined (as well as corresponding entries in string tables are
+ * missing) and FSG_STRING_INTERFACE has value of zero.
+ *
+ * When FSG_NO_OTG is defined fsg_otg_desc won't be defined.
+ */
+
+/*
+ * When FSG_BUFFHD_STATIC_BUFFER is defined when this file is included
+ * the fsg_buffhd structure's buf field will be an array of FSG_BUFLEN
+ * characters rather then a pointer to void.
+ */
+
+
+/* #include  */
+
+
+/*
+ * Thanks to NetChip Technologies for donating this product ID.
+ *
+ * DO NOT REUSE THESE IDs with any other driver!!  Ever!!
+ * Instead:  allocate your own, using normal USB-IF procedures.
+ */
+#define FSG_VENDOR_ID  0x0525  /* NetChip */
+#define FSG_PRODUCT_ID 0xa4a5  /* Linux-USB File-backed Storage Gadget */
+
+/*-*/
+
+#ifndef DEBUG
+#undef VERBOSE_DEBUG
+#undef DUMP_MSGS
+#endif /* !DEBUG */
+
+#ifdef VERBOSE_DEBUG
+#define VLDBG  LDBG
+#else
+#define VLDBG(lun, fmt, args...) do { } while (0)
+#endif /* VERBOSE_DEBUG */
+
+/*
+#define LDBG(lun, fmt, args...)   dev_dbg (&(lun)->dev, fmt, ## args)
+#define LERROR(lun, fmt, args...) dev_err (&(lun)->dev, fmt, ## args)
+#define LWARN(lun, fmt, args...)  dev_warn(&(lun)->dev, fmt, ## args)
+#define LINFO(lun, fmt, args...)  dev_info(&(lun)->dev, fmt, ## args)
+*/
+
+#define LDBG(lun, fmt, args...) do { } while (0)
+#define LERROR(lun, fmt, args...) do { } while (0)
+#define LWARN(lun, fmt, args...) do { } while (0)
+#define LINFO(lun, fmt, args...) do { } while (0)
+
+/*
+ * Keep those macros in sync with those in
+ * include/linux/usb/composite.h or else GCC will complain.  If they
+ * are identical (the same names of arguments, white spaces in the
+ * same places) GCC will allow redefinition otherwise (even if some
+ * white space is removed or added) warning will be issued.
+ *
+ * Those macros are needed here because File Storage Gadget does not
+ * include the composite.h header.  For composite gadgets those macros
+ * are redundant since composite.h is included any way.
+ *
+ * One could check whether those macros are already defined (which
+ * would indicate composite.h had been included) or not (which would
+ * indicate we were in FSG) but this is not done because a warning is
+ *

[U-Boot] [PATCH RESEND v2 3/4] usb:gadget: USB Mass Storage Gadget support

2013-03-05 Thread y
From: Lukasz Majewski 

This patch adds the USB Mass Storage Gadget to u-boot
New command called "ums" is implemented to provide access
to on-device embedded persistent memory.

USB Mass Storage is supposed to work on top of the USB
Gadget framework

Signed-off-by: Lukasz Majewski 
Signed-off-by: Piotr Wilczek 
Signed-off-by: Kyungmin Park 
CC: Marek Vasut 
---
Changes in v2: None

 common/Makefile   |1 +
 common/cmd_usb_mass_storage.c |   86 +
 drivers/usb/gadget/g_dnl.c|6 +++
 include/usb_mass_storage.h|   55 ++
 4 files changed, 148 insertions(+)
 create mode 100644 common/cmd_usb_mass_storage.c
 create mode 100644 include/usb_mass_storage.h

diff --git a/common/Makefile b/common/Makefile
index 54fcc81..8ec95d2 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -174,6 +174,7 @@ COBJS-y += cmd_usb.o
 COBJS-y += usb.o usb_hub.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
+COBJS-$(CONFIG_CMD_USB_MASS_STORAGE) += cmd_usb_mass_storage.o
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
diff --git a/common/cmd_usb_mass_storage.c b/common/cmd_usb_mass_storage.c
new file mode 100644
index 000..87a5f2f
--- /dev/null
+++ b/common/cmd_usb_mass_storage.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Lukasz Majewski 
+ *
+ * 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 
+
+int do_usb_mass_storage(cmd_tbl_t *cmdtp, int flag,
+  int argc, char * const argv[])
+{
+   char *ep;
+   unsigned int dev_num = 0, offset = 0, part_size = 0;
+   int rc;
+
+   struct ums_board_info *ums_info;
+   static char *s = "ums";
+
+   if (argc < 2) {
+   printf("usage: ums  - e.g. ums 0\n");
+   return 0;
+   }
+
+   dev_num = (int)simple_strtoul(argv[1], &ep, 16);
+
+   if (dev_num) {
+   puts("\nSet eMMC device to 0! - e.g. ums 0\n");
+   goto fail;
+   }
+
+   board_usb_init();
+   ums_info = board_ums_init(dev_num, offset, part_size);
+
+   if (!ums_info) {
+   printf("MMC: %d -> NOT available\n", dev_num);
+   goto fail;
+   }
+   rc = fsg_init(ums_info);
+   if (rc) {
+   printf("cmd ums: fsg_init failed\n");
+   goto fail;
+   }
+
+   g_dnl_register(s);
+
+   while (1) {
+   /* Handle control-c and timeouts */
+   if (ctrlc()) {
+   printf("The remote end did not respond in time.\n");
+   goto exit;
+   }
+   usb_gadget_handle_interrupts();
+   /* Check if USB cable has been detached */
+   if (fsg_main_thread(NULL) == EIO)
+   goto exit;
+   }
+exit:
+   g_dnl_unregister();
+   return 0;
+
+fail:
+   return -1;
+}
+
+U_BOOT_CMD(ums, CONFIG_SYS_MAXARGS, 1, do_usb_mass_storage,
+   "Use the UMS [User Mass Storage]",
+   "ums - User Mass Storage Gadget"
+);
diff --git a/drivers/usb/gadget/g_dnl.c b/drivers/usb/gadget/g_dnl.c
index a5a4c1f..cc3f344 100644
--- a/drivers/usb/gadget/g_dnl.c
+++ b/drivers/usb/gadget/g_dnl.c
@@ -31,6 +31,7 @@
 
 #include "gadget_chips.h"
 #include "composite.c"
+#include "f_mass_storage.c"
 
 /*
  * One needs to define the following:
@@ -104,6 +105,8 @@ static int g_dnl_do_config(struct usb_configuration *c)
printf("GADGET DRIVER: %s\n", s);
if (!strcmp(s, "usb_dnl_dfu"))
ret = dfu_add(c);
+   else if (!strcmp(s, "usb_dnl_ums"))
+   ret = fsg_add(c);
 
return ret;
 }
@@ -188,6 +191,9 @@ int g_dnl_register(const char *type)
if (!strcmp(type, "dfu")) {
strcpy(name, shortname);
strcat(name, type);
+   } else if (!strcmp(type, "ums")) {
+   strcpy(name, shortname);
+   strcat(name, type);
} else {
printf("%s: 

[U-Boot] [PATCH RESEND v2 4/4] arm:trats: Use new ums command

2013-03-05 Thread y
From: Lukasz Majewski 

This patch enables new "ums" command on Trats board

Signed-off-by: Lukasz Majewski 
Signed-off-by: Piotr Wilczek 
Signed-off-by: Kyungmin Park 
CC: Minkyu Kang 
---
Changes in v2: None

 board/samsung/trats/trats.c |   63 +++
 include/configs/trats.h |5 
 2 files changed, 68 insertions(+)

diff --git a/board/samsung/trats/trats.c b/board/samsung/trats/trats.c
index 88d193d..9207646 100644
--- a/board/samsung/trats/trats.c
+++ b/board/samsung/trats/trats.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "setup.h"
 
@@ -791,3 +792,65 @@ void init_panel_info(vidinfo_t *vid)
 
setenv("lcdinfo", "lcd=s6e8ax0");
 }
+
+#ifdef CONFIG_USB_GADGET_MASS_STORAGE
+static int ums_read_sector(struct ums_device *ums_dev,
+  ulong start, lbaint_t blkcnt, void *buf)
+{
+   if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num,
+   start + ums_dev->offset, blkcnt, buf) != blkcnt)
+   return -1;
+
+   return 0;
+}
+
+static int ums_write_sector(struct ums_device *ums_dev,
+   ulong start, lbaint_t blkcnt, const void *buf)
+{
+   if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num,
+   start + ums_dev->offset, blkcnt, buf) != blkcnt)
+   return -1;
+
+   return 0;
+}
+
+static void ums_get_capacity(struct ums_device *ums_dev,
+long long int *capacity)
+{
+   long long int tmp_capacity;
+
+   tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size)
+   * SECTOR_SIZE);
+   *capacity = ums_dev->mmc->capacity - tmp_capacity;
+}
+
+static struct ums_board_info ums_board = {
+   .read_sector = ums_read_sector,
+   .write_sector = ums_write_sector,
+   .get_capacity = ums_get_capacity,
+   .name = "TRATS UMS disk",
+   .ums_dev = {
+   .mmc = NULL,
+   .dev_num = 0,
+   .offset = 0,
+   .part_size = 0.
+   },
+};
+
+struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int 
offset,
+ unsigned int part_size)
+{
+   struct mmc *mmc;
+
+   mmc = find_mmc_device(dev_num);
+   if (!mmc)
+   return NULL;
+
+   ums_board.ums_dev.mmc = mmc;
+   ums_board.ums_dev.dev_num = dev_num;
+   ums_board.ums_dev.offset = offset;
+   ums_board.ums_dev.part_size = part_size;
+
+   return &ums_board;
+}
+#endif
diff --git a/include/configs/trats.h b/include/configs/trats.h
index 63745ac..31d8190 100644
--- a/include/configs/trats.h
+++ b/include/configs/trats.h
@@ -316,4 +316,9 @@
 #define CONFIG_VIDEO_BMP_GZIP
 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 120 * 4) + (1 << 12))
 
+#define CONFIG_CMD_USB_MASS_STORAGE
+#if defined(CONFIG_CMD_USB_MASS_STORAGE)
+#define CONFIG_USB_GADGET_MASS_STORAGE
+#endif
+
 #endif /* __CONFIG_H */
-- 
1.7.9.5

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


[U-Boot] [PATCH v2 2/5] coldfire: Clean _config rules and move simple ones to boards.cfg

2011-08-31 Thread y
From: Stany MARCEL 

Signed-off-by: Stany MARCEL 
---
Changes for v2:
   - Move boards with simple configurations to boards.cfg
   - Some build corrections

 MAKEALL|6 --
 Makefile   |  126 ++-
 boards.cfg |   20 +++
 include/configs/M5329EVB.h |8 ++--
 4 files changed, 42 insertions(+), 118 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 3b98f03..37fe10e 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -558,18 +558,12 @@ LIST_microblaze="$(boards_by_arch microblaze)"
 #

 LIST_coldfire="$(boards_by_arch m68k)
-   astro_mcf5373l  \
-   cobra5272   \
EB+MCF-EV123\
EB+MCF-EV123_internal   \
M52277EVB   \
M5235EVB\
-   M5329AFEE   \
-   M5373EVB\
M54451EVB   \
M54455EVB   \
-   M5475AFE\
-   M5485AFE\
 "

 #
diff --git a/Makefile b/Makefile
index 03d80b7..be9f325 100644
--- a/Makefile
+++ b/Makefile
@@ -591,14 +591,11 @@ ucname= $(shell echo $(1) | sed -e 
's/\(.*\)_config/\U\1/')
 #
 ## Coldfire
 #
-
-astro_mcf5373l_config \
-astro_mcf5373l_RAM_config :unconfig
-   @$(MKCONFIG) -n $@ -t $@ astro_mcf5373l m68k mcf532x mcf5373l astro
-
 M52277EVB_config \
 M52277EVB_spansion_config \
 M52277EVB_stmicro_config : unconfig
+   @mkdir -p $(obj)include
+   @mkdir -p $(obj)board/freescale/m52277evb
@case "$@" in \
M52277EVB_config)   FLASH=SPANSION;; \
M52277EVB_spansion_config)  FLASH=SPANSION;; \
@@ -607,19 +604,21 @@ M52277EVB_stmicro_config :unconfig
if [ "$${FLASH}" = "SPANSION" ] ; then \
echo "#define CONFIG_SYS_SPANSION_BOOT" >> 
$(obj)include/config.h ; \
echo "CONFIG_SYS_TEXT_BASE = 0x" > 
$(obj)board/freescale/m52277evb/config.tmp ; \
-   cp $(obj)board/freescale/m52277evb/u-boot.spa 
$(obj)board/freescale/m52277evb/u-boot.lds ; \
+   cp board/freescale/m52277evb/u-boot.spa 
board/freescale/m52277evb/u-boot.lds ; \
fi; \
if [ "$${FLASH}" = "STMICRO" ] ; then \
echo "#define CONFIG_CF_SBF">> $(obj)include/config.h ; \
echo "#define CONFIG_SYS_STMICRO_BOOT"  >> 
$(obj)include/config.h ; \
echo "CONFIG_SYS_TEXT_BASE = 0x43E0" > 
$(obj)board/freescale/m52277evb/config.tmp ; \
-   cp $(obj)board/freescale/m52277evb/u-boot.stm 
$(obj)board/freescale/m52277evb/u-boot.lds ; \
+   cp board/freescale/m52277evb/u-boot.stm 
board/freescale/m52277evb/u-boot.lds ; \
fi
@$(MKCONFIG) -n $@ -a M52277EVB m68k mcf5227x m52277evb freescale

 M5235EVB_config \
 M5235EVB_Flash16_config \
 M5235EVB_Flash32_config:   unconfig
+   @mkdir -p $(obj)include
+   @mkdir -p $(obj)board/freescale/m5235evb
@case "$@" in \
M5235EVB_config)FLASH=16;; \
M5235EVB_Flash16_config)FLASH=16;; \
@@ -628,63 +627,40 @@ M5235EVB_Flash32_config:  unconfig
if [ "$${FLASH}" != "16" ] ; then \
echo "#define NORFLASH_PS32BIT  1" >> $(obj)include/config.h ; \
echo "CONFIG_SYS_TEXT_BASE = 0xFFC0" > 
$(obj)board/freescale/m5235evb/config.tmp ; \
-   cp $(obj)board/freescale/m5235evb/u-boot.32 
$(obj)board/freescale/m5235evb/u-boot.lds ; \
+   cp board/freescale/m5235evb/u-boot.32 
board/freescale/m5235evb/u-boot.lds ; \
else \
echo "CONFIG_SYS_TEXT_BASE = 0xFFE0" > 
$(obj)board/freescale/m5235evb/config.tmp ; \
-   cp $(obj)board/freescale/m5235evb/u-boot.16 
$(obj)board/freescale/m5235evb/u-boot.lds ; \
+   cp board/freescale/m5235evb/u-boot.16 
board/freescale/m5235evb/u-boot.lds ; \
fi
@$(MKCONFIG) -n $@ -a M5235EVB m68k mcf523x m5235evb freescale

-cobra5272_config : unconfig
-   @$(MKCONFIG) $@ m68k mcf52x2 cobra5272
-
 EB+MCF-EV123_config :  unconfig
-   @mkdir -p $(obj)include
@mkdir -p $(obj)board/BuS/EB+MCF-EV123
@echo "CONFIG_SYS_TEXT_BASE = 0xFFE0"|tee 
$(obj)board/BuS/EB+MCF-EV123/textbase.mk
@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS

 EB+MCF-EV123_internal_config : unconfig
-   @mkdir -p $(obj)include
@mkdir -p $(obj)board/BuS/EB+MCF-EV123
@echo "CONFIG_SYS_TEXT_BASE = 0xF000"|tee 
$(obj)board/BuS/EB+MCF-EV123/textbase.mk
@$(MKCONFIG) -n $@ EB+MCF-EV123 m68k mcf52x2 EB+MCF-EV123 BuS

-M5329AFEE_config \
-M5

[U-Boot] [PATCH v2 3/5] coldfire: Permit build in a different directory

2011-08-31 Thread y
From: Stany MARCEL 

Add $(obj) before lib$(CPU) to permit build in a different directory

Signed-off-by: Stany MARCEL 
---
Changes for v2:
   - None

 arch/m68k/cpu/mcf5227x/Makefile   |2 +-
 arch/m68k/cpu/mcf523x/Makefile|2 +-
 arch/m68k/cpu/mcf532x/Makefile|2 +-
 arch/m68k/cpu/mcf5445x/Makefile   |2 +-
 arch/m68k/cpu/mcf547x_8x/Makefile |2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/cpu/mcf5227x/Makefile b/arch/m68k/cpu/mcf5227x/Makefile
index eb36264..0490f0e 100644
--- a/arch/m68k/cpu/mcf5227x/Makefile
+++ b/arch/m68k/cpu/mcf5227x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk

 # CFLAGS += -DET_DEBUG

-LIB= lib$(CPU).o
+LIB= $(obj)lib$(CPU).o

 START  = start.o
 COBJS  = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf523x/Makefile b/arch/m68k/cpu/mcf523x/Makefile
index eb36264..0490f0e 100644
--- a/arch/m68k/cpu/mcf523x/Makefile
+++ b/arch/m68k/cpu/mcf523x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk

 # CFLAGS += -DET_DEBUG

-LIB= lib$(CPU).o
+LIB= $(obj)lib$(CPU).o

 START  = start.o
 COBJS  = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf532x/Makefile b/arch/m68k/cpu/mcf532x/Makefile
index 257d46d..eb043d9 100644
--- a/arch/m68k/cpu/mcf532x/Makefile
+++ b/arch/m68k/cpu/mcf532x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk

 # CFLAGS += -DET_DEBUG

-LIB= lib$(CPU).o
+LIB= $(obj)lib$(CPU).o

 START  =
 COBJS  = cpu.o speed.o cpu_init.o interrupts.o
diff --git a/arch/m68k/cpu/mcf5445x/Makefile b/arch/m68k/cpu/mcf5445x/Makefile
index 047e35d..5b7ddd6 100644
--- a/arch/m68k/cpu/mcf5445x/Makefile
+++ b/arch/m68k/cpu/mcf5445x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk

 # CFLAGS += -DET_DEBUG

-LIB= lib$(CPU).o
+LIB= $(obj)lib$(CPU).o

 START  = start.o
 COBJS  = cpu.o speed.o cpu_init.o interrupts.o pci.o
diff --git a/arch/m68k/cpu/mcf547x_8x/Makefile 
b/arch/m68k/cpu/mcf547x_8x/Makefile
index e41ce68..a415aab 100644
--- a/arch/m68k/cpu/mcf547x_8x/Makefile
+++ b/arch/m68k/cpu/mcf547x_8x/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk

 # CFLAGS += -DET_DEBUG

-LIB= lib$(CPU).o
+LIB= $(obj)lib$(CPU).o

 START  =
 COBJS  = cpu.o speed.o cpu_init.o pci.o interrupts.o slicetimer.o
--
1.7.1

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


[U-Boot] [PATCH v2 4/5] coldfire: Remove link files entries to prevent multiple definitions

2011-08-31 Thread y
From: Stany MARCEL 

Signed-off-by: Stany MARCEL 
---
Changes for v2:
   - Missing Corrections of link files for m54451evb board

 board/BuS/EB+MCF-EV123/u-boot.lds|5 -
 board/astro/mcf5373l/u-boot.lds  |4 
 board/cobra5272/u-boot.lds   |5 -
 board/esd/tasreg/u-boot.lds  |4 
 board/freescale/m5208evbe/u-boot.lds |1 -
 board/freescale/m5235evb/u-boot.16   |5 -
 board/freescale/m5235evb/u-boot.32   |   13 -
 board/freescale/m5249evb/u-boot.lds  |4 
 board/freescale/m5253demo/u-boot.lds |4 
 board/freescale/m5253evbe/u-boot.lds |4 
 board/freescale/m5271evb/u-boot.lds  |4 
 board/freescale/m5272c3/u-boot.lds   |4 
 board/freescale/m5275evb/u-boot.lds  |3 ---
 board/freescale/m5282evb/u-boot.lds  |4 
 board/freescale/m53017evb/u-boot.lds |2 --
 board/freescale/m5329evb/u-boot.lds  |4 
 board/freescale/m5373evb/u-boot.lds  |4 
 board/freescale/m54451evb/u-boot.spa |9 +
 board/freescale/m54451evb/u-boot.stm |   12 +---
 board/freescale/m54455evb/u-boot.atm |4 
 board/freescale/m547xevb/u-boot.lds  |3 ---
 board/freescale/m548xevb/u-boot.lds  |3 ---
 board/idmr/u-boot.lds|4 
 23 files changed, 2 insertions(+), 107 deletions(-)

diff --git a/board/BuS/EB+MCF-EV123/u-boot.lds 
b/board/BuS/EB+MCF-EV123/u-boot.lds
index e0359e3..08983c9 100644
--- a/board/BuS/EB+MCF-EV123/u-boot.lds
+++ b/board/BuS/EB+MCF-EV123/u-boot.lds
@@ -56,11 +56,6 @@ SECTIONS
 /* the sector layout of our flash chips!   XXX FIXME XXX   */

 arch/m68k/cpu/mcf52x2/start.o  (.text)
-common/dlmalloc.o  (.text)
-lib/string.o   (.text)
-lib/vsprintf.o (.text)
-lib/crc32.o(.text)
-lib/zlib.o (.text)

 /*. = env_offset; */
 common/env_embedded.o(.text)
diff --git a/board/astro/mcf5373l/u-boot.lds b/board/astro/mcf5373l/u-boot.lds
index a1d8e0f..e628c36 100644
--- a/board/astro/mcf5373l/u-boot.lds
+++ b/board/astro/mcf5373l/u-boot.lds
@@ -56,10 +56,6 @@ SECTIONS
 /* the sector layout of our flash chips!   XXX FIXME XXX   */

 arch/m68k/cpu/mcf532x/start.o  (.text)
-arch/m68k/lib/traps.o  (.text)
-arch/m68k/lib/interrupts.o (.text)
-common/dlmalloc.o  (.text)
-lib/zlib.o (.text)

 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.text)
diff --git a/board/cobra5272/u-boot.lds b/board/cobra5272/u-boot.lds
index da14807..a641452 100644
--- a/board/cobra5272/u-boot.lds
+++ b/board/cobra5272/u-boot.lds
@@ -55,11 +55,6 @@ SECTIONS
 /* WARNING - the following is hand-optimized to fit within */
 /* the sector layout of our flash chips!   XXX FIXME XXX   */
 arch/m68k/cpu/mcf52x2/start.o  (.text)
-arch/m68k/cpu/mcf52x2/cpu_init.o   (.text)
-arch/m68k/lib/traps.o  (.text)
-arch/m68k/cpu/mcf52x2/interrupts.o (.text)
-common/dlmalloc.o  (.text)
-lib/zlib.o (.text)

 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.text)
diff --git a/board/esd/tasreg/u-boot.lds b/board/esd/tasreg/u-boot.lds
index 27a6b93..451d721 100644
--- a/board/esd/tasreg/u-boot.lds
+++ b/board/esd/tasreg/u-boot.lds
@@ -56,10 +56,6 @@ SECTIONS
 /* the sector layout of our flash chips!   XXX FIXME XXX   */

 arch/m68k/cpu/mcf52x2/start.o  (.text)
-arch/m68k/lib/traps.o  (.text)
-arch/m68k/cpu/mcf52x2/interrupts.o (.text)
-common/dlmalloc.o  (.text)
-lib/zlib.o (.text)

 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.text)
diff --git a/board/freescale/m5208evbe/u-boot.lds 
b/board/freescale/m5208evbe/u-boot.lds
index e5011a6..a7b1eb3 100644
--- a/board/freescale/m5208evbe/u-boot.lds
+++ b/board/freescale/m5208evbe/u-boot.lds
@@ -58,7 +58,6 @@ SECTIONS
 arch/m68k/cpu/mcf52x2/start.o  (.text)
 arch/m68k/cpu/mcf52x2/libmcf52x2.o (.text)
 arch/m68k/lib/libm68k.o(.text)
-common/dlmalloc.o  (.text)

 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.text)
diff --git a/board/freescale/m5235evb/u-boot.16 
b/board/freescale/m5235evb/u-boot.16
index 657cd9d..1df2b07 100644
--- a/board/freescale/m5235evb/u-boot.16
+++ b/board/freescale/m5235evb/u-boot.16
@@ -56,11 +56,6 @@ SECTIONS
 /* the sector layout of our flash chips!   XXX FIXME XXX   */

 arch/m68k/cpu/mcf523x/start.o  (.text)
-arch/m68k/cpu/mcf523x/cpu_init.o   (.text)
-arch/m68k/lib/traps.o  (.text)
-arch/m68k/lib/interrupts.o (.text)
-common/dlmalloc.o  (.text)
-lib/zlib.o (.text)

 . = DEFINED(env_offset) ? env_offset : .;
 common/env_embedded.o  (.text)
diff --git a/board/freescale/m5235evb/u-boot.32 
b/board/freescale/m5235evb/u-boot.32
ind

[U-Boot] [PATCH v2 1/5] coldfire: Change timer_init return type from void to int

2011-08-31 Thread y
From: Stany MARCEL 

timer_init protorype change for uniformization with other architectures

Signed-off-by: Stany MARCEL 
---
Changes for v2:
   - Remove extern of timer_init

 arch/m68k/cpu/mcf547x_8x/slicetimer.c |4 +++-
 arch/m68k/lib/board.c |2 --
 arch/m68k/lib/time.c  |8 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/arch/m68k/cpu/mcf547x_8x/slicetimer.c 
b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
index 467a807..ee96aad 100644
--- a/arch/m68k/cpu/mcf547x_8x/slicetimer.c
+++ b/arch/m68k/cpu/mcf547x_8x/slicetimer.c
@@ -72,7 +72,7 @@ void dtimer_interrupt(void *not_used)
}
 }

-void timer_init(void)
+int timer_init(void)
 {
volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE);

@@ -93,6 +93,8 @@ void timer_init(void)
/* set a period of 1us, set timer mode to restart and
   enable timer and interrupt */
timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
+
+   return 0;
 }

 ulong get_timer(ulong base)
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 945ab66..1df50f1 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -78,8 +78,6 @@ static char *failed = "*** failed ***\n";
 extern ulong __init_end;
 extern ulong __bss_end__;

-extern void timer_init(void);
-
 #if defined(CONFIG_WATCHDOG)
 # define INIT_FUNC_WATCHDOG_INIT   watchdog_init,
 # define WATCHDOG_DISABLE  watchdog_disable
diff --git a/arch/m68k/lib/time.c b/arch/m68k/lib/time.c
index a316cdf..a1eb983 100644
--- a/arch/m68k/lib/time.c
+++ b/arch/m68k/lib/time.c
@@ -91,7 +91,7 @@ void dtimer_interrupt(void *not_used)
}
 }

-void timer_init(void)
+int timer_init(void)
 {
volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE);

@@ -114,6 +114,8 @@ void timer_init(void)
/* set a period of 1us, set timer mode to restart and enable timer and 
interrupt */
timerp->tmr = CONFIG_SYS_TIMER_PRESCALER | DTIM_DTMR_CLK_DIV1 |
DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
+
+   return 0;
 }

 ulong get_timer(ulong base)
@@ -153,7 +155,7 @@ void __udelay(unsigned long usec)
}
 }

-void timer_init(void)
+int timer_init(void)
 {
volatile pit_t *timerp = (pit_t *) (CONFIG_SYS_PIT_BASE);
timestamp = 0;
@@ -162,6 +164,8 @@ void timer_init(void)
timerp->pcsr = PIT_PCSR_OVW;
timerp->pmr = lastinc = 0;
timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
+
+   return 0;
 }

 ulong get_timer(ulong base)
--
1.7.1

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


[U-Boot] V2 of OMAP3 USB device Support

2009-09-28 Thread y

The technical change is better handling of address setting on the
usb handshaking setup phase. 

Other changes from Jean's comments

2/8 USB add macros for debugging usb device setup.

static inline function replacing debug macros

3/8 TWL4030 Add usb PHY support

add empty lines between variables and statements
other empty lines added for readablity

4/8 OMAP3 Add usb device support

80+ char lines reduced
Used MUSB_FLAGS_PRINT macro suggestion
lowercased function names
multi-lined ep0_state_enum
Used suggestion on udelay to 1000 * 1000 
add empty lines between variables and statements
inverted check of ep0_urb->device_request.wLength
other empty lines added for readablity

5/8 OMAP3 zoom1 Add usbtty configuration

This was ack-ed by Jean

6/8 OMAP3 beagle Add usbtty configuration

This was ack-ed by Jean

8/8 OMAP3 zoom2 Use usbtty if the debug board

cleanup using usbtty_* functions or their stubs without #define's
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 2/8] USB add macros for debugging usb device setup.

2009-09-28 Thread y
From: Tom Rix 

When developing usb device features, it is useful to print out
common usb structures.

Signed-off-by: Tom Rix 
---
 include/usbdescriptors.h |   26 
 include/usbdevice.h  |  103 ++
 2 files changed, 129 insertions(+), 0 deletions(-)

diff --git a/include/usbdescriptors.h b/include/usbdescriptors.h
index ea05672..2d0b059 100644
--- a/include/usbdescriptors.h
+++ b/include/usbdescriptors.h
@@ -510,4 +510,30 @@ struct usb_class_descriptor {
 
 } __attribute__ ((packed));
 
+#ifdef DEBUG
+static inline void print_device_descriptor(struct usb_device_descriptor *d)
+{
+   serial_printf("usb device descriptor \n");
+   serial_printf("\tbLength %2.2x\n", d->bLength);
+   serial_printf("\tbDescriptorType %2.2x\n", d->bDescriptorType);
+   serial_printf("\tbcdUSB %4.4x\n", d->bcdUSB);
+   serial_printf("\tbDeviceClass %2.2x\n", d->bDeviceClass);
+   serial_printf("\tbDeviceSubClass %2.2x\n", d->bDeviceSubClass);
+   serial_printf("\tbDeviceProtocol %2.2x\n", d->bDeviceProtocol);
+   serial_printf("\tbMaxPacketSize0 %2.2x\n", d->bMaxPacketSize0);
+   serial_printf("\tidVendor %4.4x\n", d->idVendor);
+   serial_printf("\tidProduct %4.4x\n", d->idProduct);
+   serial_printf("\tbcdDevice %4.4x\n", d->bcdDevice);
+   serial_printf("\tiManufacturer %2.2x\n", d->iManufacturer);
+   serial_printf("\tiProduct %2.2x\n", d->iProduct);
+   serial_printf("\tiSerialNumber %2.2x\n", d->iSerialNumber);
+   serial_printf("\tbNumConfigurations %2.2x\n", d->bNumConfigurations);
+}
+
+#else
+
+/* stubs */
+#define print_device_descriptor(d)
+
+#endif /* DEBUG */
 #endif
diff --git a/include/usbdevice.h b/include/usbdevice.h
index 206dbbc..4171636 100644
--- a/include/usbdevice.h
+++ b/include/usbdevice.h
@@ -663,4 +663,107 @@ int usbd_endpoint_halted (struct usb_device_instance 
*device, int endpoint);
 void usbd_rcv_complete(struct usb_endpoint_instance *endpoint, int len, int 
urb_bad);
 void usbd_tx_complete (struct usb_endpoint_instance *endpoint);
 
+/* These are macros used in debugging */
+#ifdef DEBUG
+static inline void print_urb(struct urb *u)
+{
+   serial_printf("urb %p\n", (u));
+   serial_printf("\tendpoint %p\n", u->endpoint);
+   serial_printf("\tdevice %p\n", u->device);
+   serial_printf("\tbuffer %p\n", u->buffer);
+   serial_printf("\tbuffer_length %d\n", u->buffer_length);
+   serial_printf("\tactual_length %d\n", u->actual_length);
+   serial_printf("\tstatus %d\n", u->status);
+   serial_printf("\tdata %d\n", u->data);
+}
+
+static inline void print_usb_device_request(struct usb_device_request *r)
+{
+   serial_printf("usb request\n");
+   serial_printf("\tbmRequestType 0x%2.2x\n", r->bmRequestType);
+   if ((r->bmRequestType & USB_REQ_DIRECTION_MASK) == 0)
+   serial_printf("\t\tDirection : To device\n");
+   else
+   serial_printf("\t\tDirection : To host\n");
+   if ((r->bmRequestType & USB_TYPE_STANDARD) == USB_TYPE_STANDARD)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_CLASS) == USB_TYPE_CLASS)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_VENDOR) == USB_TYPE_VENDOR)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_TYPE_RESERVED) == USB_TYPE_RESERVED)
+   serial_printf("\t\tType  : Standard\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_DEVICE)
+   serial_printf("\t\tRecipient : Device\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_INTERFACE)
+   serial_printf("\t\tRecipient : Interface\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_ENDPOINT)
+   serial_printf("\t\tRecipient : Endpoint\n");
+   if ((r->bmRequestType & USB_REQ_RECIPIENT_MASK) ==
+   USB_REQ_RECIPIENT_OTHER)
+   serial_printf("\t\tRecipient : Other\n");
+   serial_printf("\tbRequest  0x%2.2x\n", r->bRequest);
+   if (r->bRequest == USB_REQ_GET_STATUS)
+   serial_printf("\t\tGET_STATUS\n");
+   else if (r->bRequest == USB_REQ_SET_ADDRESS)
+   serial_printf("\t\tSET_ADDRESS\n");
+   else if (r->bRequest == USB_REQ_SET_FEATURE)
+   serial_printf("\t\tSET_FEATURE\n");
+   else if (r->bRequest == USB_REQ_GET_DESCRIPTOR)
+   serial_printf("\t\tGET_DESCRIPTOR\n");
+   else if (r->bRequest == USB_REQ_SET_CONFIGURATION)
+   serial_printf("\t\tSET_CONFIGURATION\n");
+   else if (r->bRequest == USB_REQ_SET_INTERFACE)
+   serial_printf("\t\tUSB_REQ_SET_INTERFACE\n");
+   else
+   serial_printf("\tUNKNOWN %d\n", r->bRequest);
+   serial_printf("\twValue   

[U-Boot] [PATCH 1/8] USB Consolidate descriptor definitions

2009-09-28 Thread y
From: Tom Rix 

The header files usb.h and usbdescriptors.h have the same or
similarly named structure definitions for

usb_device_descriptor
usb_string_descriptor
usb_endpoint_descriptor
usb_config_descriptor vs usb_configuration_descriptor
usb_interface_descriptor

There should only be one definition of these structures.
Some of these structures are element-wise duplicates,
one has unused elements that can be reduced to a duplicate,
and some of the the structures have additional elements.

These are the element-wise duplicates in usb.h

usb_device_descriptor
usb_string_descriptor

For these, the usb.h definition will be removed.

This definition in usb.h has extra unused elements

usb_endpoint_descriptor

unsigned char   bRefresh
unsigned char   bSynchAddress;

The definition of usb_endpoint_descriptor in usb.h will
be removed.

These definitions in usb.h have extra elements at the end of
the usb 2.0 specified descriptor:

usb_config_descriptor
usb_interface_descriptor

These structures will have their name shorted by removing the
'_descriptor' suffix.

So

usb_config_descriptor -> usb_config
usb_interface_descriptor -> usb_interface

The common descriptor elements are now defined by the macros

USB_CONFIG_DESCRIPTOR_DEFINITION
USB_INTERFACE_DESCRIPTOR_DEFINITION

This has been compile tested on MAKEALL arm, ppc and mips.

Signed-off-by: Tom Rix 
---
 common/cmd_usb.c|   12 
 common/usb.c|8 ++--
 common/usb_kbd.c|4 +-
 common/usb_storage.c|2 +-
 cpu/ppc4xx/usbdev.c |4 +-
 drivers/usb/host/ehci-hcd.c |2 +-
 drivers/usb/musb/musb_hcd.c |2 +-
 include/usb.h   |   70 +-
 include/usbdescriptors.h|   40 ++--
 9 files changed, 49 insertions(+), 95 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 7b8ee6b..6f3b095 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -187,14 +187,14 @@ void usb_display_desc(struct usb_device *dev)
 
 }
 
-void usb_display_conf_desc(struct usb_config_descriptor *config,
+void usb_display_conf_desc(struct usb_config *config,
   struct usb_device *dev)
 {
printf("   Configuration: %d\n", config->bConfigurationValue);
printf("   - Interfaces: %d %s%s%dmA\n", config->bNumInterfaces,
   (config->bmAttributes & 0x40) ? "Self Powered " : "Bus Powered ",
   (config->bmAttributes & 0x20) ? "Remote Wakeup " : "",
-   config->MaxPower*2);
+   config->bMaxPower*2);
if (config->iConfiguration) {
printf("   - ");
usb_display_string(dev, config->iConfiguration);
@@ -202,7 +202,7 @@ void usb_display_conf_desc(struct usb_config_descriptor 
*config,
}
 }
 
-void usb_display_if_desc(struct usb_interface_descriptor *ifdesc,
+void usb_display_if_desc(struct usb_interface *ifdesc,
 struct usb_device *dev)
 {
printf(" Interface: %d\n", ifdesc->bInterfaceNumber);
@@ -246,8 +246,8 @@ void usb_display_ep_desc(struct usb_endpoint_descriptor 
*epdesc)
 /* main routine to diasplay the configs, interfaces and endpoints */
 void usb_display_config(struct usb_device *dev)
 {
-   struct usb_config_descriptor *config;
-   struct usb_interface_descriptor *ifdesc;
+   struct usb_config *config;
+   struct usb_interface *ifdesc;
struct usb_endpoint_descriptor *epdesc;
int i, ii;
 
@@ -321,7 +321,7 @@ void usb_show_tree_graph(struct usb_device *dev, char *pre)
printf(" %s (%s, %dmA)\n", usb_get_class_desc(
dev->config.if_desc[0].bInterfaceClass),
portspeed(dev->speed),
-   dev->config.MaxPower * 2);
+   dev->config.bMaxPower * 2);
if (strlen(dev->mf) || strlen(dev->prod) || strlen(dev->serial))
printf(" %s  %s %s %s\n", pre, dev->mf, dev->prod, dev->serial);
printf(" %s\n", pre);
diff --git a/common/usb.c b/common/usb.c
index 87fca70..6649f8c 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -440,10 +440,10 @@ int usb_get_configuration_no(struct usb_device *dev,
 {
int result;
unsigned int tmp;
-   struct usb_config_descriptor *config;
+   struct usb_config *config;
 
 
-   config = (struct usb_config_descriptor *)&buffer[0];
+   config = (struct usb_config *)&buffer[0];
result = usb_get_descriptor(dev, USB_DT_CONFIG, cfgno, buffer, 9);
if (result < 9) {
if (result < 0)
@@ -489,7 +489,7 @@ int usb_set_address(struct usb_device *dev)
  */
 int usb_set_interface(struct usb_device *dev, int interface, int alternate)
 {
-   struct usb_interface_descriptor *if_face = NULL;
+   struct usb_interface *if_face = NULL;
int ret, i;
 
for (i = 0; i < dev->con

[U-Boot] [PATCH 3/8] TWL4030 Add usb PHY support

2009-09-28 Thread y
From: Tom Rix 

The twl4030 provides a PHY device for connecting a link device,
like musb, to physical connection.

This change adds the twl4030 usb registers and functions for
initializing the PHY as required by omap3.

Signed-off-by: Tom Rix 
---
 Makefile  |1 +
 drivers/usb/phy/Makefile  |   44 +++
 drivers/usb/phy/twl4030.c |  189 +
 include/twl4030.h |  143 ++
 4 files changed, 362 insertions(+), 15 deletions(-)
 create mode 100644 drivers/usb/phy/Makefile
 create mode 100644 drivers/usb/phy/twl4030.c

diff --git a/Makefile b/Makefile
index 356ca29..7ceb066 100644
--- a/Makefile
+++ b/Makefile
@@ -243,6 +243,7 @@ LIBS += drivers/twserial/libtws.a
 LIBS += drivers/usb/gadget/libusb_gadget.a
 LIBS += drivers/usb/host/libusb_host.a
 LIBS += drivers/usb/musb/libusb_musb.a
+LIBS += drivers/usb/phy/libusb_phy.a
 LIBS += drivers/video/libvideo.a
 LIBS += drivers/watchdog/libwatchdog.a
 LIBS += common/libcommon.a
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
new file mode 100644
index 000..200b907
--- /dev/null
+++ b/drivers/usb/phy/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (c) 2009 Wind River Systems, Inc.
+# Tom Rix 
+#
+# 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)libusb_phy.a
+
+COBJS-$(CONFIG_TWL4030_USB) += twl4030.o
+COBJS-y := twl4030.o
+
+COBJS  := $(COBJS-y)
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+all:   $(LIB)
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/drivers/usb/phy/twl4030.c b/drivers/usb/phy/twl4030.c
new file mode 100644
index 000..54d2e61
--- /dev/null
+++ b/drivers/usb/phy/twl4030.c
@@ -0,0 +1,189 @@
+/*
+ * Copyright (c) 2009 Wind River Systems, Inc.
+ * Tom Rix 
+ *
+ * This is file is based on
+ * repository git.gitorious.org/u-boot-omap3/mainline.git,
+ * branch omap3-dev-usb, file drivers/usb/gadget/twl4030_usb.c
+ *
+ * This is the unique part of its copyright :
+ *
+ * 
+ *
+ *  * (C) Copyright 2009 Atin Malaviya (atin.malav...@gmail.com)
+ *
+ * Based on: twl4030_usb.c in linux 2.6 (drivers/i2c/chips/twl4030_usb.c)
+ * Copyright (C) 2004-2007 Texas Instruments
+ * Copyright (C) 2008 Nokia Corporation
+ * Contact: Felipe Balbi 
+ *
+ * Author: Atin Malaviya (atin.malav...@gmail.com)
+ *
+ * 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License 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 
+
+/* Defines for bits in registers */
+#define OPMODE_MASK(3 << 3)
+#define XCVRSELECT_MASK(3 << 0)
+#define CARKITMODE (1 << 2)
+#define OTG_ENAB   (1 << 5)
+#define PHYPWD (1 << 0)
+#define CLOCKGATING_EN (1 << 2)
+#define CLK32K_EN  (1 << 1)
+#define REQ_PHY_DPLL_CLK   (1 << 0)
+#define PHY_DPLL_CLK   (1 << 0)
+
+static int twl4030_usb_write(u8 address, u8 data)
+{
+   int ret;
+
+   ret = twl4030_i2c_write_u8(TWL4030_CHIP_USB, data, address);
+   if (ret != 0)
+   printf("TWL4030:USB:Write[0x%x] Error %d\n", address, ret);
+
+   return ret;
+}
+
+static int 

[U-Boot] [PATCH 5/8] OMAP3 zoom1 Add usbtty configuration

2009-09-28 Thread y
From: Tom Rix 

The primary console of zoom1 is the serial out from the jumpers
accessed by removing the back panel.

A secondary console is to use the usbtty.  The user can set this
manually by doing

setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty
saveenv

usbtty will be usable by accessing the /dev/ttyACM0 on a linux host.

Signed-off-by: Tom Rix 
---
 include/configs/omap3_zoom1.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_zoom1.h b/include/configs/omap3_zoom1.h
index b55b8f0..c4527e6 100644
--- a/include/configs/omap3_zoom1.h
+++ b/include/configs/omap3_zoom1.h
@@ -99,6 +99,21 @@
 #define CONFIG_OMAP3_MMC   1
 #define CONFIG_DOS_PARTITION   1
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID   0x0451
+#define CONFIG_USBD_PRODUCTID  0x5678
+#define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME   "Zoom1"
+
 /* commands to include */
 #include 
 
@@ -161,6 +176,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"videomode=1024x...@60,vxres=1024,vyres=768\0" \
"videospec=omapfb:vram:2M,vram:4M\0" \
-- 
1.6.0.6

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


[U-Boot] [PATCH 6/8] OMAP3 beagle Add usbtty configuration

2009-09-28 Thread y
From: Tom Rix 

The primary console of beagle is the serial header.

A secondary console is to use the usbtty.  The user can set this
manually by doing

setenv stdout usbtty; setenv stdin usbtty; setenv stderr usbtty
saveenv

usbtty will be usable by accessing the /dev/ttyACM0 on a linux host.

Signed-off-by: Tom Rix 
---
 include/configs/omap3_beagle.h |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/include/configs/omap3_beagle.h b/include/configs/omap3_beagle.h
index 55eeb94..253cdba 100644
--- a/include/configs/omap3_beagle.h
+++ b/include/configs/omap3_beagle.h
@@ -98,6 +98,21 @@
 #define CONFIG_OMAP3_MMC   1
 #define CONFIG_DOS_PARTITION   1
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV   1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID   0x0451
+#define CONFIG_USBD_PRODUCTID  0x5678
+#define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME   "Beagle"
+
 /* commands to include */
 #include 
 
@@ -164,6 +179,7 @@
 
 #define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x8200\0" \
+   "usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"videomode=1024x...@60,vxres=1024,vyres=768\0" \
"videospec=omapfb:vram:2M,vram:4M\0" \
-- 
1.6.0.6

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


[U-Boot] [PATCH 7/8] USBTTY make some function declarations easier to use.

2009-09-28 Thread y
From: Tom Rix 

Zoom2 needs to use these declarations and the include directory is a
better place from them than in the middle of the driver directory.
It did not make sense to create a new file for just a couple of
lines so they were appended to the serial.h

Signed-off-by: Tom Rix 
---
 include/serial.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/serial.h b/include/serial.h
index 821b583..2c150ff 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -59,4 +59,10 @@ extern void serial_stdio_init(void);
 extern int serial_assign(char * name);
 extern void serial_reinit_all(void);
 
+/* For usbtty */
+extern int usbtty_getc(void);
+extern void usbtty_putc(const char c);
+extern void usbtty_puts(const char *str);
+extern int usbtty_tstc(void);
+
 #endif
-- 
1.6.0.6

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


[U-Boot] [PATCH 8/8] OMAP3 zoom2 Use usbtty if the debug board is not connected.

2009-09-28 Thread y
From: Tom Rix 

The preferred serial output comes from the debug board.
When the debug board is disconnected, fall back on using
usbtty from the usb connector on the Zoom2 board.

This shows up as /dev/ttyACM0 in a linux host.

Signed-off-by: Tom Rix 
---
 board/logicpd/zoom2/zoom2_serial.c |   12 
 include/configs/omap3_zoom2.h  |   17 +
 include/serial.h   |   12 
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/board/logicpd/zoom2/zoom2_serial.c 
b/board/logicpd/zoom2/zoom2_serial.c
index a3d777d..ba58e39 100644
--- a/board/logicpd/zoom2/zoom2_serial.c
+++ b/board/logicpd/zoom2/zoom2_serial.c
@@ -86,6 +86,8 @@ void quad_putc_dev (unsigned long base, const char c)
quad_putc_dev (base, '\r');
 
NS16550_putc ((NS16550_t) base, c);
+   } else {
+   usbtty_putc(c);
}
 }
 
@@ -94,6 +96,8 @@ void quad_puts_dev (unsigned long base, const char *s)
if (zoom2_debug_board_connected ()) {
while ((s != NULL) && (*s != '\0'))
quad_putc_dev (base, *s++);
+   } else {
+   usbtty_puts(s);
}
 }
 
@@ -101,16 +105,16 @@ int quad_getc_dev (unsigned long base)
 {
if (zoom2_debug_board_connected ())
return NS16550_getc ((NS16550_t) base);
-   else
-   return 0;
+
+   return usbtty_getc();
 }
 
 int quad_tstc_dev (unsigned long base)
 {
if (zoom2_debug_board_connected ())
return NS16550_tstc ((NS16550_t) base);
-   else
-   return 0;
+
+   return usbtty_tstc();
 }
 
 void quad_setbrg_dev (unsigned long base)
diff --git a/include/configs/omap3_zoom2.h b/include/configs/omap3_zoom2.h
index 75ab980..8d24efe 100644
--- a/include/configs/omap3_zoom2.h
+++ b/include/configs/omap3_zoom2.h
@@ -123,6 +123,20 @@
 #define CONFIG_OMAP3_GPIO_3 /* board revision */
 #define CONFIG_OMAP3_GPIO_5 /* debug board detection, ZOOM2_LED_BLUE */
 
+/* USB */
+#define CONFIG_MUSB_UDC1
+#define CONFIG_USB_OMAP3   1
+#define CONFIG_TWL4030_USB 1
+
+/* USB device configuration */
+#define CONFIG_USB_DEVICE  1
+#define CONFIG_USB_TTY 1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID   0x0451
+#define CONFIG_USBD_PRODUCTID  0x5678
+#define CONFIG_USBD_MANUFACTURER   "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME   "Zoom2"
+
 /* commands to include */
 #include 
 
@@ -170,6 +184,9 @@
 /* Environment information */
 #define CONFIG_BOOTDELAY   10
 
+#define CONFIG_EXTRA_ENV_SETTINGS \
+   "usbtty=cdc_acm\0" \
+
 /*
  * Miscellaneous configurable options
  */
diff --git a/include/serial.h b/include/serial.h
index 2c150ff..c0e1bce 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -60,9 +60,21 @@ extern int serial_assign(char * name);
 extern void serial_reinit_all(void);
 
 /* For usbtty */
+#ifdef CONFIG_USB_TTY
+
 extern int usbtty_getc(void);
 extern void usbtty_putc(const char c);
 extern void usbtty_puts(const char *str);
 extern int usbtty_tstc(void);
 
+#else
+
+/* stubs */
+#define usbtty_getc() 0
+#define usbtty_putc(a)
+#define usbtty_puts(a)
+#define usbtty_tstc() 0
+
+#endif /* CONFIG_USB_TTY */
+
 #endif
-- 
1.6.0.6

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


[U-Boot] [PATCH 4/8] OMAP3 Add usb device support

2009-09-28 Thread y
From: Tom Rix 

This change adds the usb device support for musb.

Omap3 platform support added at the same level as davinci.

The interface for usbtty to use the musb device support was added.

Verified on omap3 beagle, zoom1 and zoom2.

Signed-off-by: Tom Rix 
---
 drivers/serial/usbtty.h   |2 +
 drivers/usb/musb/Makefile |2 +
 drivers/usb/musb/musb_core.c  |8 +-
 drivers/usb/musb/musb_core.h  |   40 ++
 drivers/usb/musb/musb_debug.h |  205 +
 drivers/usb/musb/musb_udc.c   |  963 +
 drivers/usb/musb/omap3.c  |  129 ++
 drivers/usb/musb/omap3.h  |   48 ++
 include/usb.h |3 +-
 include/usb/musb_udc.h|   54 +++
 10 files changed, 1451 insertions(+), 3 deletions(-)
 create mode 100644 drivers/usb/musb/musb_debug.h
 create mode 100644 drivers/usb/musb/musb_udc.c
 create mode 100644 drivers/usb/musb/omap3.c
 create mode 100644 drivers/usb/musb/omap3.h
 create mode 100644 include/usb/musb_udc.h

diff --git a/drivers/serial/usbtty.h b/drivers/serial/usbtty.h
index f746d63..6b6c4a1 100644
--- a/drivers/serial/usbtty.h
+++ b/drivers/serial/usbtty.h
@@ -29,6 +29,8 @@
 #include 
 #elif defined(CONFIG_OMAP1510)
 #include 
+#elif defined(CONFIG_MUSB_UDC)
+#include 
 #elif defined(CONFIG_PXA27X)
 #include 
 #endif
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile
index 09e0a5f..f2ccd9f 100644
--- a/drivers/usb/musb/Makefile
+++ b/drivers/usb/musb/Makefile
@@ -26,7 +26,9 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
+COBJS-$(CONFIG_MUSB_UDC) += musb_udc.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_OMAP3) += omap3.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index ec57fc8..22f3dba 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -32,7 +32,9 @@ struct musb_regs *musbr;
  */
 void musb_start(void)
 {
+#if defined(CONFIG_MUSB_HCD)
u8 devctl;
+#endif
 
/* disable all interrupts */
writew(0, &musbr->intrtxe);
@@ -74,9 +76,10 @@ void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt)
/* Configure fifo size and fifo base address */
writeb(idx, &musbr->txfifosz);
writew(fifoaddr >> 3, &musbr->txfifoadd);
+
+   csr = readw(&musbr->txcsr);
 #if defined(CONFIG_MUSB_HCD)
/* clear the data toggle bit */
-   csr = readw(&musbr->txcsr);
writew(csr | MUSB_TXCSR_CLRDATATOG, &musbr->txcsr);
 #endif
/* Flush fifo if required */
@@ -87,9 +90,10 @@ void musb_configure_ep(struct musb_epinfo *epinfo, u8 cnt)
/* Configure fifo size and fifo base address */
writeb(idx, &musbr->rxfifosz);
writew(fifoaddr >> 3, &musbr->rxfifoadd);
+
+   csr = readw(&musbr->rxcsr);
 #if defined(CONFIG_MUSB_HCD)
/* clear the data toggle bit */
-   csr = readw(&musbr->rxcsr);
writew(csr | MUSB_RXCSR_CLRDATATOG, &musbr->rxcsr);
 #endif
/* Flush fifo if required */
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index f9da3f0..15c7f49 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -40,6 +40,36 @@
 
 #define MUSB_EP0_FIFOSIZE  64  /* This is non-configurable */
 
+/* EP0 */
+struct musb_ep0_regs {
+   u16 reserved4;
+   u16 csr0;
+   u16 reserved5;
+   u16 reserved6;
+   u16 count0;
+   u8  host_type0;
+   u8  host_naklimit0;
+   u8  reserved7;
+   u8  reserved8;
+   u8  reserved9;
+   u8  configdata;
+};
+
+/* EP 1-15 */
+struct musb_epN_regs {
+   u16 txmaxp;
+   u16 txcsr;
+   u16 rxmaxp;
+   u16 rxcsr;
+   u16 rxcount;
+   u8  txtype;
+   u8  txinterval;
+   u8  rxtype;
+   u8  rxinterval;
+   u8  reserved0;
+   u8  fifosize;
+};
+
 /* Mentor USB core register overlay structure */
 struct musb_regs {
/* common registers */
@@ -97,6 +127,16 @@ struct musb_regs {
u8  rxhubaddr;
u8  rxhubport;
} tar[16];
+   /*
+* end point registers
+* ep0 elements are valid when array index is 0
+* otherwise epN is valid
+*/
+   union musb_ep_regs {
+   struct musb_ep0_regs ep0;
+   struct musb_epN_regs epN;
+   } ep[16];
+
 } __attribute__((aligned(32)));
 
 /*
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/

[U-Boot] [PATCH] cpu/ppc4xx/fdt.c: avoid strcpy() to constant string

2009-10-20 Thread y
From: Wolfgang Denk 

strcpy() was iused with the target address being a pointer to a
constant string, which potentially is read-only. Use a (writable)
array of characters instead.

Signed-off-by: Wolfgang Denk 
---
 cpu/ppc4xx/fdt.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cpu/ppc4xx/fdt.c b/cpu/ppc4xx/fdt.c
index 496e028..b310832 100644
--- a/cpu/ppc4xx/fdt.c
+++ b/cpu/ppc4xx/fdt.c
@@ -42,7 +42,7 @@ void __ft_board_setup(void *blob, bd_t *bd)
u32 bxcr;
u32 ranges[EBC_NUM_BANKS * 4];
u32 *p = ranges;
-   char *ebc_path = "/plb/opb/ebc";
+   char ebc_path[] = "/plb/opb/ebc";
 
ft_cpu_setup(blob, bd);
 
-- 
1.6.2.5

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


[U-Boot] [PATCH] tools: fw_printenv supports mmc device

2010-12-15 Thread y
From: Donghwa Lee 

I modified fw_printenv tools to use /dev/mmcblk0 node. Original fw_printenv tool
can be access MTD devices, but, in some cases, environment variables can be 
stored
other memory devices, for example, mmc devices.
So, I modified a few code to use /dev/mmcblk0.

Signed-off-by: Donghwa Lee 
Signed-off-by: Kyungmin Park 

---
 tools/env/fw_env.c  |   13 ++---
 tools/env/fw_env.config |7 +--
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c
index 8ff7052..5a707f6 100644
--- a/tools/env/fw_env.c
+++ b/tools/env/fw_env.c
@@ -855,6 +855,7 @@ static int flash_write_buf (int dev, int fd, void *buf, 
size_t count,
}
 
erase.start = blockstart;
+#ifndef CONFIG_ENV_IS_IN_MMC
ioctl (fd, MEMUNLOCK, &erase);
 
if (ioctl (fd, MEMERASE, &erase) != 0) {
@@ -863,7 +864,7 @@ static int flash_write_buf (int dev, int fd, void *buf, 
size_t count,
 strerror (errno));
return -1;
}
-
+#endif
if (lseek (fd, blockstart, SEEK_SET) == -1) {
fprintf (stderr,
 "Seek error on %s: %s\n",
@@ -880,8 +881,9 @@ static int flash_write_buf (int dev, int fd, void *buf, 
size_t count,
return -1;
}
 
+#ifndef CONFIG_ENV_IS_IN_MMC
ioctl (fd, MEMLOCK, &erase);
-
+#endif
processed  += blocklen;
block_seek = 0;
blockstart += blocklen;
@@ -964,9 +966,10 @@ static int flash_write (int fd_current, int fd_target, int 
dev_target)
 
 static int flash_read (int fd)
 {
-   struct mtd_info_user mtdinfo;
int rc;
 
+#ifndef CONFIG_ENV_IS_IN_MMC
+   struct mtd_info_user mtdinfo;
rc = ioctl (fd, MEMGETINFO, &mtdinfo);
if (rc < 0) {
perror ("Cannot get MTD information");
@@ -982,6 +985,10 @@ static int flash_read (int fd)
 
rc = flash_read_buf (dev_current, fd, environment.image, 
CONFIG_ENV_SIZE,
 DEVOFFSET (dev_current), mtdinfo.type);
+#else
+   rc = flash_read_buf (dev_current, fd, environment.image, 
CONFIG_ENV_SIZE,
+DEVOFFSET (dev_current), 0);
+#endif
 
return (rc != CONFIG_ENV_SIZE) ? -1 : 0;
 }
diff --git a/tools/env/fw_env.config b/tools/env/fw_env.config
index c8f12cf..228ded8 100644
--- a/tools/env/fw_env.config
+++ b/tools/env/fw_env.config
@@ -4,8 +4,11 @@
 # Notice, that the "Number of sectors" is ignored on NOR.
 
 # MTD device name  Device offset   Env. size   Flash sector size   
Number of sectors
-/dev/mtd1  0x  0x4000  0x4000
-/dev/mtd2  0x  0x4000  0x4000
+#/dev/mtd1 0x  0x4000  0x4000
+#/dev/mtd2 0x  0x4000  0x4000
 
 # NAND example
 #/dev/mtd0 0x4000  0x4000  0x2 
2
+
+# MMC device name  Device offset   Env. size   Flash sector size   
Number of sectors
+/dev/mmcblk0   0x7000  0x1000  0x1000
-- 
1.6.0.4

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


[U-Boot] [PATCH 3/4] nand_spl/spiboot/sdboot: Add ability to have smaller middle loader

2011-06-02 Thread y
From: Matthew McClintock 

This patch allows some boards do define CONFIG_BOOTSTRAP to let them
build a MPL or middle program loader to setup the board before booting
to the full u-boot build. The advantage is that we are using the same
build system and linker scripts that would be used in a normal u-boot
build.

This is used on powerpc/85xx parts that only have 256kB of cache
and also need to perform DDR SPD. So, the nand_spl will load the
MPL to L2 SRAM and there DDR will be configured. Afterwards the
MPL uses the CONFIG_BOOTCOMMAND environment variable to boot to
the appropriate media. This also works with SD and SPI via the
on chip rom but instead it goes from on-chip-rom to MPL to full
version of u-boot.

Depends on previous icache/dcache command changes and various
build fixes for add cases that occur when trying to build an
extremely minimal image

Signed-off-by: Matthew McClintock 
---
 Makefile |   38 +-
 mkconfig |1 +
 2 files changed, 38 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 0400930..7a9cae7 100644
--- a/Makefile
+++ b/Makefile
@@ -317,6 +317,16 @@ ifeq ($(CONFIG_NAND_U_BOOT),y)
 ALL += $(obj)u-boot-nand.bin
 endif
 
+ifndef CONFIG_IN_BOOTSTRAP
+ifeq ($(CONFIG_SPIFLASH), y)
+ALL += $(obj)u-boot-spi.bin
+endif
+
+ifeq ($(CONFIG_SDCARD), y)
+ALL += $(obj)u-boot-sd.bin
+endif
+endif
+
 ifeq ($(CONFIG_ONENAND_U_BOOT),y)
 ALL += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
@@ -404,8 +414,16 @@ $(obj)u-boot.lds: $(LDSCRIPT)
 nand_spl:  $(TIMESTAMP_FILE) $(VERSION_FILE) depend
$(MAKE) -C nand_spl/board/$(BOARDDIR) all
 
+NAND_SPL_OBJS-y += $(obj)nand_spl/u-boot-spl-16k.bin
+NAND_SPL_OBJS-$(CONFIG_BOOTSTRAP) += $(obj)u-boot-bootstrap.bin
+NAND_SPL_OBJS-y += $(obj)u-boot.bin
+
+ifeq ($(CONFIG_BOOTSTRAP),y)
+$(obj)u-boot-nand.bin: nand_spl $(obj)u-boot-bootstrap.bin $(obj)u-boot.bin
+else
 $(obj)u-boot-nand.bin: nand_spl $(obj)u-boot.bin
-   cat $(obj)nand_spl/u-boot-spl-16k.bin $(obj)u-boot.bin > 
$(obj)u-boot-nand.bin
+endif
+   cat $(NAND_SPL_OBJS-y) > $(obj)u-boot-nand.bin
 
 onenand_ipl:   $(TIMESTAMP_FILE) $(VERSION_FILE) $(obj)include/autoconf.mk
$(MAKE) -C onenand_ipl/board/$(BOARDDIR) all
@@ -413,6 +431,23 @@ onenand_ipl:   $(TIMESTAMP_FILE) $(VERSION_FILE) 
$(obj)include/autoconf.mk
 $(obj)u-boot-onenand.bin:  onenand_ipl $(obj)u-boot.bin
cat $(ONENAND_BIN) $(obj)u-boot.bin > $(obj)u-boot-onenand.bin
 
+ifdef CONFIG_BOOTSTRAP
+$(obj)u-boot-spi.bin:  $(obj)u-boot.bin $(obj)u-boot-bootstrap.bin
+   cat $(obj)u-boot-bootstrap.bin $(obj)u-boot.bin > 
$(obj)u-boot-spi.bin
+$(obj)u-boot-sd.bin:   $(obj)u-boot.bin $(obj)u-boot-bootstrap.bin
+   cat $(obj)u-boot-bootstrap.bin $(obj)u-boot.bin > 
$(obj)u-boot-sd.bin
+else
+$(obj)u-boot-spi.bin:  $(obj)u-boot.bin
+   ln -s u-boot.bin u-boot-spi.bin
+$(obj)u-boot-sd.bin:   $(obj)u-boot.bin
+   ln -s u-boot.bin u-boot-sd.bin
+endif
+
+$(obj)u-boot-bootstrap.bin:
+   rm -rf $(BUILD_DIR)bootstrap
+   $(MAKE) $(CONFIG_BOARD_NAME) O=bootstrap/ 
EXTRA_OPTS=IN_BOOTSTRAP
+   cp $(BUILD_DIR)bootstrap/u-boot.bin u-boot-bootstrap.bin
+
 $(VERSION_FILE):
@( localvers='$(shell $(TOPDIR)/tools/setlocalversion 
$(TOPDIR))' ; \
   printf '#define PLAIN_VERSION "%s%s"\n' \
@@ -1130,6 +1165,7 @@ clean:
\( -name 'core' -o -name '*.bak' -o -name '*~' \
-o -name '*.o'  -o -name '*.a' -o -name '*.exe' \) -print \
| xargs rm -f
+   @rm -fr $(BUILD_DIR)bootstrap/
 
 clobber:   clean
@find $(OBJTREE) -type f \( -name '*.depend' \
diff --git a/mkconfig b/mkconfig
index e72ec3d..74294ec 100755
--- a/mkconfig
+++ b/mkconfig
@@ -159,6 +159,7 @@ for i in ${TARGETS} ; do
 done
 
 cat << EOF >> config.h
+#define CONFIG_BOARD_NAME $BOARD_NAME
 #define CONFIG_BOARDDIR board/$BOARDDIR
 #include 
 #include 
-- 
1.7.5


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


[U-Boot] [PATCH 1/4] common/env_common: Add CONFIG_SILENT_CONSOLE_AT_BOOT env option

2011-06-02 Thread y
From: Matthew McClintock 

Just setting CONFIG_SILENT_CONSOLE does not make the CONSOLE
silent without the silent env variable set. This adds a new
define to add this to the default environment easily

Signed-off-by: Matthew McClintock 
---
 README  |4 
 common/env_common.c |3 +++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/README b/README
index ed73981..8779544 100644
--- a/README
+++ b/README
@@ -546,6 +546,10 @@ The following options need to be configured:
the "silent" environment variable. See
doc/README.silent for more information.
 
+   When CONFIG_SILENT_CONSOLE_AT_BOOT is set u-boot
+   will be built with silent defined in the default
+   environment for a completly silent console at boot
+
 - Console Baudrate:
CONFIG_BAUDRATE - in bps
Select one of the baudrates listed in
diff --git a/common/env_common.c b/common/env_common.c
index c3e6388..3b09373 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -123,6 +123,9 @@ uchar default_environment[] = {
 #if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
"pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY)"\0"
 #endif
+#ifdef CONFIG_SILENT_CONSOLE_AT_BOOT
+   "silent=1\0"
+#endif
 #ifdef  CONFIG_EXTRA_ENV_SETTINGS
CONFIG_EXTRA_ENV_SETTINGS
 #endif
-- 
1.7.5


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


[U-Boot] [PATCH 4/4] Add P1021MDS board support

2011-06-02 Thread y
Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+COBJS-y    += ddr.o
+
+SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS-y))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS) $(SOBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/p1021mds/ddr.c b/board/freescale/p1021mds/ddr.c
new file mode 100644
index 000..19a2072
--- /dev/null
+++ b/board/freescale/p1021mds/ddr.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+void fsl_ddr_board_options(memctl_options_t *popts,
+   dimm_params_t *pdimm,
+   unsigned int ctrl_num)
+{
+   /*
+* Factors to consider for clock adjust:
+*/
+   popts->clk_adjust = 6;
+
+   /*
+* Factors to consider for CPO:
+*/
+   popts->cpo_override = 0x1f;
+
+   /*
+* Factors to consider for write data delay:
+*/
+   popts->write_data_delay = 2;
+
+   /*
+* Factors to consider for half-strength driver enable:
+*/
+   popts->half_strength_driver_enable = 1;
+
+   /*
+* Rtt and Rtt_WR override
+*/
+   popts->rtt_override = 1;
+   popts->rtt_override_value = DDR3_RTT_40_OHM; /* 40 Ohm rtt */
+   popts->rtt_wr_override_value = 2; /* Rtt_WR */
+
+   /* Write leveling override */
+   popts->wrlvl_en = 1;
+   popts->wrlvl_override = 1;
+   popts->wrlvl_sample = 0xa;
+   popts->wrlvl_start = 0x8;
+   /*
+* P1021 supports max 32-bit DDR width
+*/
+   popts->data_bus_width = 1;
+
+   /*
+* disable on-the-fly burst chop mode for 32 bit data bus
+*/
+   popts->OTF_burst_chop_en = 0;
+
+   /*
+* Set fixed 8 beat burst for 32 bit data bus
+*/
+   popts->burst_length = DDR_BL8;
+}
diff --git a/board/freescale/p1021mds/law.c b/board/freescale/p1021mds/law.c
new file mode 100644
index 000..8e5e305
--- /dev/null
+++ b/board/freescale/p1021mds/law.c
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+
+struct law_entry law_table[] = {
+   SET_LAW(CONFIG_SYS_BCSR_BASE_PHYS, LAW_SIZE_256K, LAW_TRGT_IF_LBC),
+   SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/p1021mds/p1021mds.c 
b/board/freescale/p1021mds/p1021mds.c
new file mode 100644
index 000..f6dccc0
--- /dev/null
+++ b/board/freescale/p1021mds/p1021mds.c
@@ -0,0 +1,181 @@
+/*
+ * Copyright 2010-2011 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who co

[U-Boot] [PATCH 2/4] build/mkconfig: Add EXTRA_OPTS argument to make to modify build

2011-06-02 Thread y
From: Matthew McClintock 

Allow users to pass in extra defines via make so they can
modify the build. Example

make P1022DS EXTRA_OPTS=NAND

is equivalent to

make P1022DS_NAND

Signed-off-by: Matthew McClintock 
---
 mkconfig |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/mkconfig b/mkconfig
index 6ff533f..e72ec3d 100755
--- a/mkconfig
+++ b/mkconfig
@@ -81,6 +81,12 @@ if [ "${ARCH}" -a "${ARCH}" != "${arch}" ]; then
exit 1
 fi
 
+if [ -z "${options}" ] ; then
+options+=$EXTRA_OPTS
+else
+options+=,$EXTRA_OPTS
+fi
+
 if [ "$options" ] ; then
echo "Configuring for ${BOARD_NAME} - Board: ${CONFIG_NAME}, Options: 
${options}"
 else
@@ -146,7 +152,7 @@ else
> config.h  # Create new config file
 fi
 echo "/* Automatically generated - do not edit */" >>config.h
-
+TARGETS+=`echo $EXTRA_OPTS | tr ',' ' '`
 for i in ${TARGETS} ; do
i="`echo ${i} | sed '/=/ {s/=/\t/;q } ; { s/$/\t1/ }'`"
echo "#define CONFIG_${i}" >>config.h ;
-- 
1.7.5


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


[U-Boot] [PATCH 1/2] Make "usage" messages more helpful.

2009-05-24 Thread y
From: Wolfgang Denk 

In case of incorrect command invocations U-Boot used to print pretty
useless "usage" messages, for example:

=> nand markbad
Usage:
nand - NAND sub-system

In the result, the user would have to run the "help" command to get
the (available) information about correct command usage. Change this,
so that this information gets always printed.

Note that this changes the user interface of all commands, but
hopefully to the better.

Signed-off-by: Wolfgang Denk 
---
Please help test this patch - many boards have developed their own
style, and this affects them all.

 common/command.c  |   33 -
 include/command.h |2 +-
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/common/command.c b/common/command.c
index c9a3f5b..16f3afe 100644
--- a/common/command.c
+++ b/common/command.c
@@ -286,21 +286,7 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, 
cmd_tbl_t * cmdtp, int
 */
for (i = 1; i < argc; ++i) {
if ((cmdtp = find_cmd_tbl (argv[i], cmd_start, cmd_items )) != 
NULL) {
-#ifdef CONFIG_SYS_LONGHELP
-   /* found - print (long) help info */
-   puts (cmdtp->name);
-   putc (' ');
-   if (cmdtp->help) {
-   puts (cmdtp->help);
-   } else {
-   puts ("- No help available.\n");
-   rcode = 1;
-   }
-   putc ('\n');
-#else  /* no long help available */
-   if (cmdtp->usage)
-   printf ("%s - %s\n", cmdtp->name, cmdtp->usage);
-#endif /* CONFIG_SYS_LONGHELP */
+   rcode |= cmd_usage(cmdtp);
} else {
printf ("Unknown command '%s' - try 'help'"
" without arguments for list of all"
@@ -386,9 +372,22 @@ cmd_tbl_t *find_cmd (const char *cmd)
return find_cmd_tbl(cmd, &__u_boot_cmd_start, len);
 }
 
-void cmd_usage(cmd_tbl_t *cmdtp)
+int cmd_usage(cmd_tbl_t *cmdtp)
 {
-   printf("Usage:\n%s - %s\n\n", cmdtp->name, cmdtp->usage);
+   printf("%s - %s\n\n", cmdtp->name, cmdtp->usage);
+
+#ifdef CONFIG_SYS_LONGHELP
+   printf("Usage:\n%s ", cmdtp->name);
+
+   if (!cmdtp->help) {
+   puts ("- No additional help available.\n");
+   return 1;
+   }
+
+   puts (cmdtp->help);
+   putc ('\n');
+#endif /* CONFIG_SYS_LONGHELP */
+   return 0;
 }
 
 #ifdef CONFIG_AUTO_COMPLETE
diff --git a/include/command.h b/include/command.h
index bd47853..55caa6e 100644
--- a/include/command.h
+++ b/include/command.h
@@ -71,7 +71,7 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t 
* cmdtp, int
 cmd_tbl_t *find_cmd(const char *cmd);
 cmd_tbl_t *find_cmd_tbl (const char *cmd, cmd_tbl_t *table, int table_len);
 
-extern void cmd_usage(cmd_tbl_t *cmdtp);
+extern int cmd_usage(cmd_tbl_t *cmdtp);
 
 #ifdef CONFIG_AUTO_COMPLETE
 extern void install_auto_complete(void);
-- 
1.6.0.6

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


[U-Boot] [PATCH v2] arm: fix a comment

2013-05-09 Thread y
From: Masahiro Yamada 

Signed-off-by: Masahiro Yamada 
---

Changed for v2:
   - Fix one more comment

 arch/arm/lib/crt0.S |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index a9657d1..a5bffb8 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -97,13 +97,13 @@ ENTRY(_main)
  * 'here' but relocated.
  */
 
-   ldr sp, [r8, #GD_START_ADDR_SP] /* r8 = gd->start_addr_sp */
+   ldr sp, [r8, #GD_START_ADDR_SP] /* sp = gd->start_addr_sp */
bic sp, sp, #7  /* 8-byte alignment for ABI compliance */
ldr r8, [r8, #GD_BD]/* r8 = gd->bd */
sub r8, r8, #GD_SIZE/* new GD is below bd */
 
adr lr, here
-   ldr r0, [r8, #GD_RELOC_OFF] /* lr = gd->start_addr_sp */
+   ldr r0, [r8, #GD_RELOC_OFF] /* r0 = gd->reloc_off */
add lr, lr, r0
ldr r0, [r8, #GD_RELOCADDR] /* r0 = gd->relocaddr */
b   relocate_code
-- 
1.7.9.5

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


[U-Boot] [PATCH] avr32: disable branch folding

2010-06-09 Thread y
From: Andreas Bießmann 

Due to a hardware bug mentioned in latest AP7000 datasheet errata
(revision M from 09.09) branch folding is unreliable.
This patch disables CPUCR.FE bitfield as stated in datasheet.

Signed-off-by: Andreas Bießmann 
---
 arch/avr32/cpu/start.S |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/cpu/start.S b/arch/avr32/cpu/start.S
index d37a46e..3d73196 100644
--- a/arch/avr32/cpu/start.S
+++ b/arch/avr32/cpu/start.S
@@ -27,9 +27,10 @@
 #define SYSREG_MMUCR_S_OFFSET  4
 
 #define SR_INIT (SYSREG_BIT(GM) | SYSREG_BIT(EM) | SYSREG_BIT(M0))
-#define CPUCR_INIT (SYSREG_BIT(BI) | SYSREG_BIT(BE)\
-   | SYSREG_BIT(FE) | SYSREG_BIT(RE)   \
-   | SYSREG_BIT(IBE) | SYSREG_BIT(IEE))
+// due to errata (unreliable branch folding) set FE bit to '0'
+#define CPUCR_INIT ((SYSREG_BIT(BI) | SYSREG_BIT(BE)   \
+   | SYSREG_BIT(RE)   |  SYSREG_BIT(IBE)   \
+   | SYSREG_BIT(IEE)) & ~SYSREG_BIT(FE))
 
/*
 * To save some space, we use the same entry point for
-- 
1.7.1

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


[U-Boot] [PATCH] include/compiler.h: remove redunandt declaration of errno

2010-06-19 Thread y
From: Wolfgang Denk 

Commit 37566090 "compiler.h: unify system ifdef cruft here" added both
a "#include " and a "extern int errno;" to include/compiler.h
which is causing build warnings for some systems, for example for the
"netstar" board:

In file included from /home/wd/git/u-boot/work/lib/crc32.c:15:
include/compiler.h:28: warning: function declaration isn't a prototype

The declaration of "errno" should be redundant, as  is
supposed to provide a correct declaration, so drop it.

Signed-off-by: Wolfgang Denk 
Cc: Mike Frysinger 
---
 include/compiler.h |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/include/compiler.h b/include/compiler.h
index 8030bf6..23f4b83 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -25,8 +25,6 @@
 #include 
 #include 
 
-extern int errno;
-
 #if !defined(__WIN32__) && !defined(__MINGW32__)
 # include 
 #endif
-- 
1.7.0.1

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


[U-Boot] [PATCH v3 0/3] Modifies the erratum A006261 according to endianness

2016-08-17 Thread y
From: Sriram Dash 

Modifies erratum A006261 implementation due to the fact that P3041,
P5020, and P5040 are all big endian for the USB PHY registers, but
they were specified little endian.
Enables the Phy init settings for P1010 Soc.
Also, applies the erratum for P2041 rev 2.0, P2040 rev 2.0, P5040 rev 2.0, 2.1
and removes the erratum for T4160, T4080, T1040, T1042, T1020, T1022, T2080,
T2081.

Sriram Dash (3):
  mpc85xx: powerpc: usb: Modified the erratum A006261 according to
endianness
  mpc85xx: powerpc: usb: Enable Usb phy initialisation settings for
P1010
  mpc85xx: powerpc: usb: Update the list of Socs afftected by erratum
A006261

 arch/powerpc/cpu/mpc85xx/cpu_init.c   |  4 ++--
 arch/powerpc/include/asm/config_mpc85xx.h |  5 ++---
 arch/powerpc/include/asm/immap_85xx.h |  2 ++
 drivers/usb/common/fsl-errata.c   | 13 -
 4 files changed, 10 insertions(+), 14 deletions(-)

-- 
2.1.0

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


[U-Boot] [PATCH v3 1/3] mpc85xx: powerpc: usb: Modified the erratum A006261 according to endianness

2016-08-17 Thread y
From: Sriram Dash 

Modifies erratum implementation due to the fact that P3041,
P5020, and P5040 are all big endian for the USB PHY registers, but
they were specified little endian.

Signed-off-by: Sriram Dash 
Signed-off-by: Rajesh Bhagat 
---
Changes in v3:
  - Modify the commit message
  - Modify the commit description

Changes in v2:
  - Adds the errata number to title of patch
  - Makes separate patch for addition of errata to specific Socs.

 arch/powerpc/cpu/mpc85xx/cpu_init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index ace4279..53b3729 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -114,10 +114,10 @@ void fsl_erratum_a006261_workaround(struct ccsr_usb_phy 
__iomem *usb_phy)
setbits_be32(&usb_phy->config2,
 CONFIG_SYS_FSL_USB_RX_AUTO_CAL_RD_WR_SEL);
 
-   temp = squelch_prog_rd_0_2 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_0;
+   temp = squelch_prog_rd_0_2 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_3;
out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp);
 
-   temp = squelch_prog_rd_3_5 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_3;
+   temp = squelch_prog_rd_3_5 << CONFIG_SYS_FSL_USB_SQUELCH_PROG_WR_0;
out_be32(&usb_phy->config2, in_be32(&usb_phy->config2) | temp);
 #endif
 }
-- 
2.1.0

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


[U-Boot] [PATCH v3 2/3] mpc85xx: powerpc: usb: Enable Usb phy initialisation settings for P1010

2016-08-17 Thread y
From: Sriram Dash 

CONFIG_SYS_FSL_USB1_PHY_ENABLE is set and the USB Phy
offset are set to enable the initial setting of Usb Phy for P1010.

Signed-off-by: Sriram Dash 
Signed-off-by: Rajesh Bhagat 
---
Changes in v3:
  - Modify the commit message
  - Modify the commit description

 arch/powerpc/include/asm/config_mpc85xx.h | 1 +
 arch/powerpc/include/asm/immap_85xx.h | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 505d355..9b7feda 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -162,6 +162,7 @@
 #define CONFIG_SYS_FSL_ERRATUM_I2C_A004447
 #define CONFIG_SYS_FSL_ERRATUM_A004508
 #define CONFIG_SYS_FSL_ERRATUM_A007075
+#define CONFIG_SYS_FSL_USB1_PHY_ENABLE
 #define CONFIG_SYS_FSL_ERRATUM_A006261
 #define CONFIG_SYS_FSL_ERRATUM_A004477
 #define CONFIG_SYS_FSL_A004447_SVR_REV 0x10
diff --git a/arch/powerpc/include/asm/immap_85xx.h 
b/arch/powerpc/include/asm/immap_85xx.h
index c045a24..07ad22d 100644
--- a/arch/powerpc/include/asm/immap_85xx.h
+++ b/arch/powerpc/include/asm/immap_85xx.h
@@ -2953,6 +2953,8 @@ struct ccsr_pman {
 #define CONFIG_SYS_MPC85xx_DMA_OFFSET  0x21000
 #define CONFIG_SYS_MPC85xx_USB1_OFFSET 0x22000
 #define CONFIG_SYS_MPC85xx_USB2_OFFSET 0x23000
+#define CONFIG_SYS_MPC85xx_USB1_PHY_OFFSET 0xE5000
+#define CONFIG_SYS_MPC85xx_USB2_PHY_OFFSET 0xE5100
 #ifdef CONFIG_TSECV2
 #define CONFIG_SYS_TSEC1_OFFSET0xB
 #elif defined(CONFIG_TSECV2_1)
-- 
2.1.0

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


[U-Boot] [PATCH v3 3/3] mpc85xx: powerpc: usb: Update the list of Socs afftected by erratum A006261

2016-08-17 Thread y
From: Sriram Dash 

Apply the erratum A006261 for the following Socs:
P2041 rev 2.0, P2040 rev 2.0, P5040 rev 2.0, 2.1

Do not apply erratum A006261 for the following Socs:
T4160, T4080, T1040, T1042, T1020, T1022, T2080, T2081

Erratum A006261 is applicable for the following Socs:
P1010(1.0, 2.0), P2041(1.0, 1.1, 2.0, 2.1), P2040(1.0, 1.1, 2.0, 2.1),
P3041(1.0, 1.1, 2.0, 2.1), P5010(1.0, 2.0), P5020(1.0, 2.0),
P5021(1.0, 2.0), T4240(1.0, 2.0), P5040(1.0,2.0,2.1).

Signed-off-by: Sriram Dash 
Signed-off-by: Rajesh Bhagat 
---
Changes in v3:
  - Modify the commit message
  - Modify the commit description
  - Make a single patch for all the Socs getting affected by erratum A6261.
Also, list the current Socs in description, for which erratum A006261
is applicable.


 arch/powerpc/include/asm/config_mpc85xx.h |  4 +---
 drivers/usb/common/fsl-errata.c   | 13 -
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 9b7feda..6d845e8 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -641,6 +641,7 @@
 #define CONFIG_SYS_NUM_FM2_DTSEC   8
 #define CONFIG_SYS_NUM_FM2_10GEC   2
 #define CONFIG_NUM_DDR_CONTROLLERS 3
+#define CONFIG_SYS_FSL_ERRATUM_A006261
 #else
 #define CONFIG_SYS_NUM_FM1_DTSEC   6
 #define CONFIG_SYS_NUM_FM1_10GEC   1
@@ -682,7 +683,6 @@
 #define CONFIG_SYS_FSL_ERRATUM_A004468
 #define CONFIG_SYS_FSL_ERRATUM_A_004934
 #define CONFIG_SYS_FSL_ERRATUM_A005871
-#define CONFIG_SYS_FSL_ERRATUM_A006261
 #define CONFIG_SYS_FSL_ERRATUM_A006379
 #define CONFIG_SYS_FSL_ERRATUM_A007186
 #define CONFIG_SYS_FSL_ERRATUM_A006593
@@ -800,7 +800,6 @@ defined(CONFIG_PPC_T1020) || defined(CONFIG_PPC_T1022)
 #define CONFIG_SYS_FSL_PCIE_COMPAT "fsl,qoriq-pcie-v2.4"
 #define CONFIG_SYS_FSL_USB_DUAL_PHY_ENABLE
 #define CONFIG_SYS_FSL_USB_INTERNAL_UTMI_PHY
-#define CONFIG_SYS_FSL_ERRATUM_A006261
 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xfe00
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
 #define ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE
@@ -908,7 +907,6 @@ defined(CONFIG_PPC_T1014) || defined(CONFIG_PPC_T1013)
 #define CONFIG_SYS_FSL_SFP_VER_3_0
 #define CONFIG_SYS_FSL_ISBC_VER2
 #define CONFIG_SYS_FSL_ERRATUM_ESDHC111
-#define CONFIG_SYS_FSL_ERRATUM_A006261
 #define CONFIG_SYS_FSL_ERRATUM_A006593
 #define CONFIG_SYS_FSL_ERRATUM_A007186
 #define CONFIG_SYS_FSL_ERRATUM_A006379
diff --git a/drivers/usb/common/fsl-errata.c b/drivers/usb/common/fsl-errata.c
index 183bf2b..972016c 100644
--- a/drivers/usb/common/fsl-errata.c
+++ b/drivers/usb/common/fsl-errata.c
@@ -53,7 +53,8 @@ bool has_erratum_a006261(void)
case SVR_P2041:
case SVR_P2040:
return IS_SVR_REV(svr, 1, 0) ||
-   IS_SVR_REV(svr, 1, 1) || IS_SVR_REV(svr, 2, 1);
+   IS_SVR_REV(svr, 1, 1) ||
+   IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
case SVR_P3041:
return IS_SVR_REV(svr, 1, 0) ||
IS_SVR_REV(svr, 1, 1) ||
@@ -63,16 +64,10 @@ bool has_erratum_a006261(void)
case SVR_P5021:
return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
case SVR_T4240:
-   case SVR_T4160:
-   case SVR_T4080:
return IS_SVR_REV(svr, 1, 0) || IS_SVR_REV(svr, 2, 0);
-   case SVR_T1040:
-   return IS_SVR_REV(svr, 1, 0);
-   case SVR_T2080:
-   case SVR_T2081:
-   return IS_SVR_REV(svr, 1, 0);
case SVR_P5040:
-   return IS_SVR_REV(svr, 1, 0);
+   return IS_SVR_REV(svr, 1, 0) ||
+   IS_SVR_REV(svr, 2, 0) || IS_SVR_REV(svr, 2, 1);
 #endif
}
 
-- 
2.1.0

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


[U-Boot] [PATCH] ls2-2085ardb: Correct the model name of ls2085ardb

2016-01-14 Thread y
From: Ashish Kumar 

Signed-off-by: Ashish Kumar 
---
 arch/arm/dts/fsl-ls2080a-rdb.dts |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/dts/fsl-ls2080a-rdb.dts b/arch/arm/dts/fsl-ls2080a-rdb.dts
index 1a1813b..71d1969 100644
--- a/arch/arm/dts/fsl-ls2080a-rdb.dts
+++ b/arch/arm/dts/fsl-ls2080a-rdb.dts
@@ -11,7 +11,7 @@
 #include "fsl-ls2080a.dtsi"
 
 / {
-   model = "Freescale Layerscape 2080a RDB Board";
+   model = "Freescale Layerscape 2085a RDB Board";
compatible = "fsl,ls2080a-rdb", "fsl,ls2080a";
 
aliases {
-- 
1.7.6.GIT

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


[U-Boot] [PATCH] ls2-2085a: Increase default hugepage count

2016-01-14 Thread y
From: Ashish Kumar 

 * Increase default hugepage count to 256 from 16
 * Note: default env variables are stored at 0x58020/0x58420
of size 0x2000

Signed-off-by: Ashish Kumar 
---
 include/configs/ls2080a_common.h |2 +-
 include/configs/ls2080ardb.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
index 4ae7d11..a503934 100644
--- a/include/configs/ls2080a_common.h
+++ b/include/configs/ls2080a_common.h
@@ -272,7 +272,7 @@ unsigned long long get_qixis_addr(void);
 #define CONFIG_BOOTARGS"console=ttyS0,115200 root=/dev/ram0 " \
"earlycon=uart8250,mmio,0x21c0500" \
"ramdisk_size=0x200 default_hugepagesz=2m" \
-   " hugepagesz=2m hugepages=16"
+   " hugepagesz=2m hugepages=256"
 #define CONFIG_BOOTCOMMAND "cp.b $kernel_start $kernel_load " \
"$kernel_size && bootm $kernel_load"
 #define CONFIG_BOOTDELAY   10
diff --git a/include/configs/ls2080ardb.h b/include/configs/ls2080ardb.h
index 116dbcd..356d254 100644
--- a/include/configs/ls2080ardb.h
+++ b/include/configs/ls2080ardb.h
@@ -333,7 +333,7 @@ unsigned long get_board_sys_clk(void);
 #define CONFIG_BOOTARGS"console=ttyS1,115200 root=/dev/ram0 " \
"earlycon=uart8250,mmio,0x21c0600" \
"ramdisk_size=0x200 default_hugepagesz=2m" \
-   " hugepagesz=2m hugepages=16"
+   " hugepagesz=2m hugepages=256"
 
 /* MAC/PHY configuration */
 #ifdef CONFIG_FSL_MC_ENET
-- 
1.7.6.GIT

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


[U-Boot] tlb15_entry is set wrong in the 4K code when the MPC8572DS boots from nand flash

2014-01-30 Thread Y fan
Hello,

The memory of the MPC8572DS can't be read correctly after the setup of the
tlb1_entry in the 4K boot code.

And also in the create_init_ram code, the tlb1_entry15&14 are set to be in
the address space 0 which are supposed to be used in the address space 1.
There seems somthing wrong with the writing of the TLB entry. But I don't
know why. Do anyone know the reason?

Thank you very much.

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


Re: [U-Boot] tlb15_entry is set wrong in the 4K code when the MPC8572DS boots from nand flash

2014-02-12 Thread Y fan
Thank you for your reply.

u-boot 2014.01-rc3

The board MPC8572DS could work well with the u-boot code.However, when I
want to boot from the nand flash. There's something wrong.

 I have modified the CS0 to nand flash. when I make the uboot code, I use
the command " make distclean; make MPC8572DS_NAND".


* the create_init_ram_area in start.S:*

It should create a tlb1_entry 15 in AS1, but instead it creates a
tlb1_entry 15 for AS0 and have a wrong size(if the fifth bit of the
tlb1_entry 15 value is for the AS.) According to the code, the size of this
entry should be 1Mbyte. However the real one is 256Mbyte.



in the start_e500 in start.S:

there should be a tlb1_entry 2 (for e500 debugging) for AS0 , again when I
tracing the execution of the code, I didn't find the tlb entry is
constructed.


cheers,

Y.Fan


2014-02-12 23:11 GMT+01:00 Scott Wood :

> On Thu, 2014-01-30 at 15:57 +0100, Y fan wrote:
> > Hello,
> >
> > The memory of the MPC8572DS can't be read correctly after the setup of
> the
> > tlb1_entry in the 4K boot code.
>
> What specific memory location can't be read?  What part of the code is
> failing?
>
> What version of U-Boot are you running?
>
> > And also in the create_init_ram code, the tlb1_entry15&14 are set to be
> in
> > the address space 0 which are supposed to be used in the address space 1.
> > There seems somthing wrong with the writing of the TLB entry. But I don't
> > know why. Do anyone know the reason?
>
> If you mean create_init_ram_area in start.S, it is creating the entries
> in AS1.  What do you see than indicates the contrary?
>
> -Scott
>
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Enabling E1000 driver support for P1_P2 Boards

2010-10-20 Thread y bhanu
Hi all,

I have 2 questions.

1)
I have a P1020RDB Board on which I am trying to configure by E1000
82574 PCI express Ethernet Card. I see support for 82571 but not for
82574.

I don't know how different these chips. Can I expect this PCI express
Card to work with the e1000 driver in U-boot?

2)
I saw it is enabled by default in P1_P2_RDB.h header file.
I can see it while building the driver is being grabbed.

But, the real question is how do I configure this interface from
u-boot command line?

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


Re: [U-Boot] Enabling E1000 driver support for P1_P2 Boards

2010-10-21 Thread y bhanu
So do you mean adding one "eth3addr" to ENV will do the job.

eth3addr= 00:04:9F:01:08:23

I help to support the patch for this chip to U-boot.
It looks like most of the code is taken from Linux kernel.
Can you provide any references?

Thanks,
Mukund


On Thu, Oct 21, 2010 at 6:33 AM, Kumar Gala  wrote:
>
> On Oct 21, 2010, at 1:34 AM, y bhanu wrote:
>
>> Hi all,
>>
>> I have 2 questions.
>>
>> 1)
>> I have a P1020RDB Board on which I am trying to configure by E1000
>> 82574 PCI express Ethernet Card. I see support for 82571 but not for
>> 82574.
>>
>> I don't know how different these chips. Can I expect this PCI express
>> Card to work with the e1000 driver in U-boot?
>
> This card isn't supported by the driver
>
>> 2)
>> I saw it is enabled by default in P1_P2_RDB.h header file.
>> I can see it while building the driver is being grabbed.
>>
>> But, the real question is how do I configure this interface from
>> u-boot command line?
>
> Its no different from any other ethernet device in u-boot.
>
> - k
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Mathematics operation on uboot variables

2010-11-23 Thread Eran Y

Hi

Is there any way to use mathematics operation on uboot environment or  uboot
local variables?
since $varA+$varB and $(varA+varB) just save the string. 
-- 
View this message in context: 
http://old.nabble.com/Mathematics-operation-on-uboot-variables-tp30283797p30283797.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


[U-Boot] Can you help me?

2011-09-30 Thread Philip Y Wong
I am Sgt John Adams of the US Army base in Iraq for peace keeping I found your 
contact detail in a address journal am seeking your assistance to evacuate the 
sum of $25,000,000 to you as long as I am assured that it will be safe in your 
care until I complete my service here in Iraq. This is not stolen money and  
there are no dangers involved. I count on your understanding. 

Please reply me on my private email address:- sgtjohna...@gmail.com
Sgt John Adams

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


Re: [U-Boot] [PATCH] ls2085a: esdhc: flush D-cache before 'mmc read'

2015-08-12 Thread Lu Y . B .
Hi Pantelis,


> Hi Yangbo,
> 
> > On Jun 24, 2015, at 05:13 , Yangbo Lu  wrote:
> >
> > It needs to flush D-cache before 'mmc read' so that we can see the
> > right data in DDR. And fix parameter for invalidate_dcache_range()
> > after 'mmc read'.
> >
> > Signed-off-by: Yangbo Lu 
> > Cc: York Sun 
> > ---
> > drivers/mmc/fsl_esdhc.c | 21 +++--
> > 1 file changed, 15 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > c4719e6..3ca25bd 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -192,6 +192,17 @@ static int esdhc_setup_data(struct mmc *mmc,
> struct mmc_data *data)
> > wml_value = data->blocksize/4;
> >
> > if (data->flags & MMC_DATA_READ) {
> > +#ifndef CONFIG_SYS_FSL_ESDHC_USE_PIO
> > +#ifdef CONFIG_LS2085A
> > +   /*
> > +* It's temporary for ls2085a so that
> > +* we can see right data in DDR
> > +*/
> > +   flush_dcache_range((ulong)data->dest,
> > +  (ulong)data->dest+data->blocks
> > +*data->blocksize);
> > +#endif
> > +#endif
> > if (wml_value > WML_RD_WML_MAX)
> > wml_value = WML_RD_WML_MAX_VAL;
> >
> 
> This looks like not board/soc specific, more like whether a non-coherent
> architecture.
> 
> Please rework as a configuration option that’s suited for that kind of
> architectures.
> 
> It looks like you’re only doing this for reads? What about writes?

The LS2085A platform exists cache coherency issue now. mmc writing is normal 
while mmc reading should use this workaround to work fine.
When cache coherency bug is fixed, this code would be removed.
Do I still need to rework as a configuration option?
Thanks a lot.

-Yangbo Lu


> 
> > @@ -278,14 +289,9 @@ static int esdhc_setup_data(struct mmc *mmc,
> > struct mmc_data *data) static void check_and_invalidate_dcache_range
> > (struct mmc_cmd *cmd,
> >  struct mmc_data *data) {
> > -#ifdef CONFIG_LS2085A
> > -   unsigned start = 0;
> > -#else
> > -   unsigned start = (unsigned)data->dest ;
> > -#endif
> > +   unsigned start, end;
> > unsigned size = roundup(ARCH_DMA_MINALIGN,
> > data->blocks*data->blocksize);
> > -   unsigned end = start+size ;
> > #ifdef CONFIG_LS2085A
> > dma_addr_t addr;
> >
> > @@ -294,7 +300,10 @@ static void check_and_invalidate_dcache_range
> > printf("Error found for upper 32 bits\n");
> > else
> > start = lower_32_bits(addr);
> > +#else
> > +   start = (unsigned)data->dest;
> > #endif
> > +   end = start + size;
> > invalidate_dcache_range(start, end);
> > }
> > #endif
> > --
> > 2.1.0.27.g96db324
> >
> 
> Regards
> 
> — Pantelis

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


Re: [U-Boot] [PATCH 1/2] spl: Fix compile warning for arm64

2015-08-12 Thread Gong Q . Y .
Hi,

Please help to review the two patches. Thanks!:)

Regards,
Qianyu

-Original Message-
From: Gong Qianyu [mailto:qianyu.g...@freescale.com] 
Sent: Thursday, July 30, 2015 2:07 PM
To: u-boot@lists.denx.de
Cc: Hu Mingkai-B21284; Gong Qianyu-B52263
Subject: [PATCH 1/2] spl: Fix compile warning for arm64

Make the cast explicit for "warning: cast to pointer from integer of different 
size".

Signed-off-by: Gong Qianyu 

diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 494f683..ce58c58 
100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -44,7 +44,7 @@ static int mmc_load_image_raw_sector(struct mmc *mmc, 
unsigned long sector)
 
/* Read the header too to avoid extra memcpy */
count = mmc->block_dev.block_read(0, sector, image_size_sectors,
- (void *)spl_image.load_addr);
+ (void *)(ulong)spl_image.load_addr);
debug("read %x sectors to %x\n", image_size_sectors,
  spl_image.load_addr);
 
--
2.1.0.27.g96db324

-Original Message-
From: Gong Qianyu [mailto:qianyu.g...@freescale.com] 
Sent: Thursday, July 30, 2015 2:00 PM
To: u-boot@lists.denx.de
Cc: Hu Mingkai-B21284; Gong Qianyu-B52263
Subject: [PATCH 2/2] common/cmd_source.c: Fix the source command failure under 
64-bit platform

Modify the data pointer type from ulong* to u32*.

For arm64 type "ulong" could be 64-bit. Then in line 89 of common/cmd_source.c:
"while (*data++);" data will point to the next 64 bits each time. As the uImage 
file generated by mkimage tool keeps the same data format in either 32-bit or 
64-bit platform, the difference would cause failure in 64-bit platform.

Signed-off-by: Gong Qianyu 

diff --git a/common/cmd_source.c b/common/cmd_source.c index d2a881d..db7ab7e 
100644
--- a/common/cmd_source.c
+++ b/common/cmd_source.c
@@ -33,7 +33,7 @@ source (ulong addr, const char *fit_uname)  #if 
defined(CONFIG_IMAGE_FORMAT_LEGACY)
const image_header_t *hdr;
 #endif
-   ulong   *data;
+   u32 *data;
int verify;
void *buf;
 #if defined(CONFIG_FIT)
@@ -74,7 +74,7 @@ source (ulong addr, const char *fit_uname)
}
 
/* get length of script */
-   data = (ulong *)image_get_data (hdr);
+   data = (u32 *)image_get_data (hdr);
 
if ((len = uimage_to_cpu (*data)) == 0) {
puts ("Empty Script\n");
@@ -128,7 +128,7 @@ source (ulong addr, const char *fit_uname)
return 1;
}
 
-   data = (ulong *)fit_data;
+   data = (u32 *)fit_data;
len = (ulong)fit_len;
break;
 #endif
--
2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH] arm/ls102xa:add hwconfig setting to support disable unused devices.

2015-08-14 Thread Zhang Z . Y .
Hi, Alison

Please see the comments inline.

Zhuoyu

> -Original Message-
> From: Wang Huan-B18965
> Sent: Friday, August 14, 2015 4:15 PM
> To: Zhang Zhuoyu-B46552; Sun York-R58495
> Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188
> Subject: RE: [PATCH] arm/ls102xa:add hwconfig setting to support disable
> unused devices.
> 
> Hi, zhuoyu,
> 
> > -Original Message-
> > From: Zhuoyu Zhang [mailto:zhuoyu.zh...@freescale.com]
> > Sent: Friday, August 07, 2015 7:49 PM
> > To: Sun York-R58495
> > Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188; Wang Huan-B18965
> > Subject: [PATCH] arm/ls102xa:add hwconfig setting to support disable
> > unused devices.
> >
> > DEVDISRn registers provides a mechanism for gating clocks of IP blocks
> > that are not used. Here we implement hwconfig option to allow users to
> > disable unused peripherals on the board.
> >
> > For ex. If eSDHC/qDMA/eDMA are unused and with disabled status in dts,
> > User can also enable CONFIG_DEVICE_DISABLE and set
> > "devdis:esdhc,qdma,edma"
> > in hwconfig, thus ESDHC controller & eDMA/qDMA will be clock gated to
> > save more power.
> >
> > Signed-off-by: Zhuoyu Zhang 
> > ---
> >  arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h | 52
> > ++
> >  board/freescale/ls1021aqds/ls1021aqds.c|  5 +++
> >  board/freescale/ls1021atwr/ls1021atwr.c|  5 +++
> >  drivers/misc/Makefile  |  1 +
> >  drivers/misc/fsl_devdis.c  | 29 
> >  include/configs/ls1021aqds.h   |  4 +-
> >  include/configs/ls1021atwr.h   |  4 +-
> >  include/fsl_devdis.h   | 18 
> >  8 files changed, 116 insertions(+), 2 deletions(-)  create mode
> > 100644 arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h
> >  create mode 100644 drivers/misc/fsl_devdis.c  create mode 100644
> > include/fsl_devdis.h
> >
> > diff --git a/arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h
> > b/arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h
> > new file mode 100644
> > index 000..3e9e9ea
> > --- /dev/null
> > +++ b/arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h
> > @@ -0,0 +1,52 @@
> > +/*
> > + * Copyright 2015 Freescale Semiconductor, Inc.
> > + *
> > + * SPDX-License-Identifier:GPL-2.0+
> > + */
> > +
> > +#ifndef __FSL_LS102XA_DEVDIS_H_
> > +#define __FSL_LS102XA_DEVDIS_H_
> > +
> > +#include 
> > +
> > +const struct devdis_table devdis_tbl[] = {
> > +   { "pbl", 0x0, 0x8000 }, /* PBL  */
> > +   { "esdhc", 0x0, 0x2000 },   /* eSDHC*/
> > +   { "qdma", 0x0, 0x80 },  /* qDMA */
> > +   { "edma", 0x0, 0x40 },  /* eDMA */
> > +   { "usb3", 0x0, 0x84000 },   /* USB3.0 controller and PHY*/
> > +   { "usb2", 0x0, 0x4 },   /* USB2.0 controller*/
> > +   { "sata", 0x0, 0x8000 },/* SATA */
> > +   { "sec", 0x0, 0x200 },  /* SEC  */
> > +   { "dcu", 0x0, 0x2 },/* Display controller Unit  */
> > +   { "qe", 0x0, 0x1 }, /* QUICC Engine */
> > +   { "etsec1", 0x1, 0x8000 },  /* eTSEC1 controller*/
> > +   { "etesc2", 0x1, 0x4000 },  /* eTSEC2 controller*/
> > +   { "etsec3", 0x1, 0x2000 },  /* eTSEC3 controller*/
> > +   { "pex1", 0x2, 0x8000 },/* PCIE controller 1*/
> > +   { "pex2", 0x2, 0x4000 },/* PCIE controller 2*/
> > +   { "duart1", 0x3, 0x2000 },  /* DUART1   */
> > +   { "duart2", 0x3, 0x1000 },  /* DUART2   */
> > +   { "qspi", 0x3, 0x800 }, /* QSPI */
> > +   { "ddr", 0x4, 0x8000 }, /* DDR  */
> > +   { "ocram1", 0x4, 0x800 },   /* OCRAM1   */
> > +   { "ifc", 0x4, 0x80 },   /* IFC  */
> > +   { "gpio", 0x4, 0x40 },  /* GPIO */
> > +   { "dbg", 0x4, 0x20 },   /* DBG  */
> > +   { "can1", 0x4, 0x8 },   /* FlexCAN1 */
> > +   { "can2_4", 0x4, 0x4 }, /* FlexCAN2_3_4 */
> > +   { "ftm2_8", 0x4, 0x2 }, /* FlexTimer2_3_4_5_6_7_8   */
> > +   { "secmon", 0x4, 0x4000 },  /* Security Monitor */
> > +   { "wdog1_2", 0x4, 0x400 },  /* WatchDog1_2  */
> > +   { "i2c2_3", 0x4, 0x200 },   /* I2C2_3   */
> > +   { "sai1_4", 0x4, 0x100 },   /* SAI1_2_3_4   */
> > +   { "lpuart2_6", 0x4, 0x80 }, /* LPUART2_3_4_5_6  */
> > +   { "dspi1_2", 0x4, 0x40 },   /* DSPI1_2  */
> > +   { "asrc", 0x4, 0x20 },  /* ASRC */
> > +   { "spdif", 0x4, 0x10 }, /* SPDIF*/
> > +   { "i2c1", 0x4, 0x4 },   /* I2C1 */
> > +   { "lpuart1", 0x4, 0x2 },/* LPUART1  */
> > +   { "ftm1", 0x4, 0x1 },   /* FlexTimer1   */
> > +};
> > +
> > +#endif
> > diff --git a/board/freescale/ls1021aqds/ls1021aqds.c
> > b/board/freescale/ls1021aqds/ls1021aqds.c
> > index d6ef6ba..b7049f7 100644
> > --- a/board/freescale/ls1021aqds/

Re: [U-Boot] [PATCH v2 1/1] arm/ls102xa:add hwconfig setting to support disable unused devices.

2015-08-17 Thread Zhang Z . Y .
Hi, York 

Alison help me find out a macro definition mistake, v2 just correct this 
mistake.
I will resend it again and add change-log in.

Zhuoyu

> -Original Message-
> From: Sun York-R58495
> Sent: Saturday, August 15, 2015 12:07 AM
> To: Zhang Zhuoyu-B46552
> Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188; Wang Huan-B18965
> Subject: Re: [PATCH v2 1/1] arm/ls102xa:add hwconfig setting to support
> disable unused devices.
> 
> 
> 
> On 08/14/2015 02:53 AM, Zhuoyu Zhang wrote:
> > DEVDISRn registers provides a mechanism for gating clocks of IP blocks
> > that are not used. Here we implement hwconfig option to allow users to
> > disable unused peripherals on the board.
> >
> > For ex. If eSDHC/qDMA/eDMA are unused and with disabled status in dts,
> > User can enable CONFIG_FSL_DEVICE_DISABLE and set
> "devdis:esdhc,qdma,edma"
> > in hwconfig, thus ESDHC controller & eDMA/qDMA will be clock gated to
> > save more power.
> >
> > Signed-off-by: Zhuoyu Zhang 
> > ---
> >  arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h | 52
> ++
> >  board/freescale/ls1021aqds/ls1021aqds.c|  5 +++
> >  board/freescale/ls1021atwr/ls1021atwr.c|  5 +++
> >  drivers/misc/Makefile  |  1 +
> >  drivers/misc/fsl_devdis.c  | 29 
> >  include/configs/ls1021aqds.h   |  4 +-
> >  include/configs/ls1021atwr.h   |  4 +-
> >  include/fsl_devdis.h   | 18 
> >  8 files changed, 116 insertions(+), 2 deletions(-)  create mode
> > 100644 arch/arm/include/asm/arch-ls102xa/ls102xa_devdis.h
> >  create mode 100644 drivers/misc/fsl_devdis.c  create mode 100644
> > include/fsl_devdis.h
> >
> 
> What's the change since v1? You missed change log.
> 
> York

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


[U-Boot] TFTP Timeout Interval problem

2015-08-31 Thread Gong Q . Y .
Hi,

I got a problem with tftp and found this patch.
-
commit 620776d734e4b126c407f636bda825a594a17723
Author: Pavel Machek 
Date:   Tue Aug 18 14:34:26 2015 +0200

tftp: adjust settings to be suitable for 100Mbit ethernet
--
The default timeout is changed to 100 (ms) and this causes "TFTP error: 
'Unsupported option(s) requested' (8)".

Because the option is equal to timeout/1000, now it's zero(100/1000 -> 0) which 
is not supported.
Actually I find in an original doc RFC-2349 which specifies this value should 
range between "1" and "255" seconds.

So I think there may be a conflict?
Look forward to your help.

This is my test log:
=> tftp a000 gqy/bootscript
Using FM1@DTSEC3 device
TFTP from server 10.192.208.233; our IP address is 10.193.20.130
Filename 'gqy/bootscript'.
Load address: 0xa000
Loading: *
TFTP error: 'Unsupported option(s) requested' (8)
Starting again
=> setenv tftptimeout 1000
=> tftp a000 gqy/bootscript
Using FM1@DTSEC3 device
TFTP from server 10.192.208.233; our IP address is 10.193.20.130
Filename 'gqy/bootscript'.
Load address: 0xa000
Loading: #
 44.9 KiB/s
done
Bytes transferred = 92 (5c hex)
=>

Regards,
Qianyu

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


Re: [U-Boot] [PATCH] arm:ls1021a: Reserve secure code into RAM instead of OCRAM

2015-07-28 Thread Zhang Z . Y .
Hi, York

Sorry for the delay, I wrongly filter this patch and missed it.
As for your question, if platform does not define CONFIG_ARMV7_SECURE_BASE, 
U-boot  will help define a default secure text section in linker script to 
reserve secure code. CONFIG_ARMV7_SECURE_BASE  for LS1 is previously defined as 
OCRAM_BASE, This patch just remove it and use DDR by default.

Zhuoyu

> -Original Message-
> From: Sun York-R58495
> Sent: Friday, April 17, 2015 4:03 AM
> To: Zhang Zhuoyu-B46552
> Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188; Wang Huan-B18965
> Subject: Re: [PATCH] arm:ls1021a: Reserve secure code into RAM instead of
> OCRAM
> 
> On 03/24/2015 02:27 AM, Zhuoyu Zhang wrote:
> > For ls1021a, Reserve secure code in to memory in case OCRAM is needed
> > by other usage.
> >
> > Signed-off-by: Zhuoyu Zhang 
> > ---
> >  include/configs/ls1021aqds.h | 1 -
> >  include/configs/ls1021atwr.h | 1 -
> >  2 files changed, 2 deletions(-)
> >
> > diff --git a/include/configs/ls1021aqds.h
> > b/include/configs/ls1021aqds.h index 3dc4da3..42439a4 100644
> > --- a/include/configs/ls1021aqds.h
> > +++ b/include/configs/ls1021aqds.h
> > @@ -554,7 +554,6 @@ unsigned long get_board_ddr_clk(void);  #define
> > CONFIG_LS102XA_NS_ACCESS
> >  #define CONFIG_SMP_PEN_ADDR0x01ee0200
> >  #define CONFIG_TIMER_CLK_FREQ  1250
> > -#define CONFIG_ARMV7_SECURE_BASE   OCRAM_BASE_S_ADDR
> >
> >  #define CONFIG_HWCONFIG
> >  #define HWCONFIG_BUFFER_SIZE   128
> > diff --git a/include/configs/ls1021atwr.h
> > b/include/configs/ls1021atwr.h index a13876b..dccc661 100644
> > --- a/include/configs/ls1021atwr.h
> > +++ b/include/configs/ls1021atwr.h
> > @@ -347,7 +347,6 @@
> >  #define CONFIG_LS102XA_NS_ACCESS
> >  #define CONFIG_SMP_PEN_ADDR0x01ee0200
> >  #define CONFIG_TIMER_CLK_FREQ  1250
> > -#define CONFIG_ARMV7_SECURE_BASE   OCRAM_BASE_S_ADDR
> >
> >  #define CONFIG_HWCONFIG
> >  #define HWCONFIG_BUFFER_SIZE   128
> >
> 
> Zhuoyu,
> 
> I don't see how the secure code is reserved in RAM. You only remove
> CONFIG_ARMV7_SECURE_BASE. Did I miss something?
> 
> York
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] arm:ls1021a: Reserve secure code into RAM instead of OCRAM

2015-07-30 Thread Zhang Z . Y .
Hi, York

Could you help ACK this patch?

Best Regards
Zhuoyu

> -Original Message-
> From: Zhang Zhuoyu-B46552
> Sent: Wednesday, July 29, 2015 10:25 AM
> To: Sun York-R58495
> Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188; Wang Huan-B18965
> Subject: RE: [PATCH] arm:ls1021a: Reserve secure code into RAM instead of
> OCRAM
> 
> Hi, York
> 
> Sorry for the delay, I wrongly filter this patch and missed it.
> As for your question, if platform does not define
> CONFIG_ARMV7_SECURE_BASE, U-boot  will help define a default secure text
> section in linker script to reserve secure code. CONFIG_ARMV7_SECURE_BASE
> for LS1 is previously defined as OCRAM_BASE, This patch just remove it and use
> DDR by default.
> 
> Zhuoyu
> 
> > -Original Message-
> > From: Sun York-R58495
> > Sent: Friday, April 17, 2015 4:03 AM
> > To: Zhang Zhuoyu-B46552
> > Cc: u-boot@lists.denx.de; Jin Zhengxiong-R64188; Wang Huan-B18965
> > Subject: Re: [PATCH] arm:ls1021a: Reserve secure code into RAM instead
> > of OCRAM
> >
> > On 03/24/2015 02:27 AM, Zhuoyu Zhang wrote:
> > > For ls1021a, Reserve secure code in to memory in case OCRAM is
> > > needed by other usage.
> > >
> > > Signed-off-by: Zhuoyu Zhang 
> > > ---
> > >  include/configs/ls1021aqds.h | 1 -
> > >  include/configs/ls1021atwr.h | 1 -
> > >  2 files changed, 2 deletions(-)
> > >
> > > diff --git a/include/configs/ls1021aqds.h
> > > b/include/configs/ls1021aqds.h index 3dc4da3..42439a4 100644
> > > --- a/include/configs/ls1021aqds.h
> > > +++ b/include/configs/ls1021aqds.h
> > > @@ -554,7 +554,6 @@ unsigned long get_board_ddr_clk(void);  #define
> > > CONFIG_LS102XA_NS_ACCESS
> > >  #define CONFIG_SMP_PEN_ADDR  0x01ee0200
> > >  #define CONFIG_TIMER_CLK_FREQ1250
> > > -#define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR
> > >
> > >  #define CONFIG_HWCONFIG
> > >  #define HWCONFIG_BUFFER_SIZE 128
> > > diff --git a/include/configs/ls1021atwr.h
> > > b/include/configs/ls1021atwr.h index a13876b..dccc661 100644
> > > --- a/include/configs/ls1021atwr.h
> > > +++ b/include/configs/ls1021atwr.h
> > > @@ -347,7 +347,6 @@
> > >  #define CONFIG_LS102XA_NS_ACCESS
> > >  #define CONFIG_SMP_PEN_ADDR  0x01ee0200
> > >  #define CONFIG_TIMER_CLK_FREQ1250
> > > -#define CONFIG_ARMV7_SECURE_BASE OCRAM_BASE_S_ADDR
> > >
> > >  #define CONFIG_HWCONFIG
> > >  #define HWCONFIG_BUFFER_SIZE 128
> > >
> >
> > Zhuoyu,
> >
> > I don't see how the secure code is reserved in RAM. You only remove
> > CONFIG_ARMV7_SECURE_BASE. Did I miss something?
> >
> > York
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] TFTP Timeout Interval problem

2015-08-31 Thread Gong Q . Y .
Hi,

That's all right. Thanks a lot!

Regards,
Qianyu

-Original Message-
From: Pavel Machek [mailto:pa...@denx.de] 
Sent: Monday, August 31, 2015 8:16 PM
To: Gong Qianyu-B52263
Cc: u-boot@lists.denx.de
Subject: Re: TFTP Timeout Interval problem

Hi!

> I got a problem with tftp and found this patch.

Yes, sorry about that. Just revert it, or update to newer u-boot where it 
should be reverted.

> -
> commit 620776d734e4b126c407f636bda825a594a17723
> Author: Pavel Machek 
> Date:   Tue Aug 18 14:34:26 2015 +0200
> 
> tftp: adjust settings to be suitable for 100Mbit ethernet
> --
> The default timeout is changed to 100 (ms) and this causes "TFTP error: 
> 'Unsupported option(s) requested' (8)".
> 
> Because the option is equal to timeout/1000, now it's zero(100/1000 -> 0) 
> which is not supported.
> Actually I find in an original doc RFC-2349 which specifies this value should 
> range between "1" and "255" seconds.
> 
> So I think there may be a conflict?
> Look forward to your help.
> 
> This is my test log:
> => tftp a000 gqy/bootscript
> Using FM1@DTSEC3 device
> TFTP from server 10.192.208.233; our IP address is 10.193.20.130 
> Filename 'gqy/bootscript'.
> Load address: 0xa000
> Loading: *
> TFTP error: 'Unsupported option(s) requested' (8) Starting again => 
> setenv tftptimeout 1000 => tftp a000 gqy/bootscript Using 
> FM1@DTSEC3 device TFTP from server 10.192.208.233; our IP address is 
> 10.193.20.130 Filename 'gqy/bootscript'.
> Load address: 0xa000
> Loading: #
>  44.9 KiB/s
> done
> Bytes transferred = 92 (5c hex)
> =>
> 
> Regards,
> Qianyu
> 

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] mmc: fsl_esdhc: enable dat[4:7] for eMMC4.5

2015-09-14 Thread Lu Y . B .
Hi York,

Please see my comments below.

> -Original Message-
> From: Sun York-R58495
> Sent: Monday, September 14, 2015 11:57 PM
> To: Lu Yangbo-B47093; u-boot@lists.denx.de
> Subject: Re: [PATCH 1/3] mmc: fsl_esdhc: enable dat[4:7] for eMMC4.5
> 
> Yangbo,
> 
> On 09/13/2015 08:04 PM, Yangbo Lu wrote:
> > If adapter card type identification is supported for platform, we
> > would enable dat[4:7] for eMMC4.5 card.
> >
> > Signed-off-by: Yangbo Lu 
> > Cc: York Sun 
> > ---
> >  board/freescale/common/qixis.h | 2 ++
> >  drivers/mmc/fsl_esdhc.c| 3 +++
> >  2 files changed, 5 insertions(+)
> >
> > diff --git a/board/freescale/common/qixis.h
> > b/board/freescale/common/qixis.h index 51ce9c3..450cd0d 100644
> > --- a/board/freescale/common/qixis.h
> > +++ b/board/freescale/common/qixis.h
> > @@ -127,6 +127,8 @@ void qixis_write_i2c(unsigned int reg, u8 value);
> >  #define QIXIS_ESDHC_NO_ADAPTER  0x7/* No Card is
> Present*/
> >  #define QIXIS_SDCLKIN  0x08
> >  #define QIXIS_SDCLKOUT 0x02
> > +#define QIXIS_DAT5_6_7 0X02
> > +#define QIXIS_DAT4 0X01
> >  #endif
> >
> >  #endif
> > diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> > 0b37002..639ec02 100644
> > --- a/drivers/mmc/fsl_esdhc.c
> > +++ b/drivers/mmc/fsl_esdhc.c
> > @@ -747,6 +747,9 @@ void mmc_adapter_card_type_ident(void)
> >
> > switch (card_id) {
> > case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45:
> > +   value = QIXIS_READ(brdcfg[5]);
> > +   value |= (QIXIS_DAT4 | QIXIS_DAT5_6_7);
> > +   QIXIS_WRITE(brdcfg[5], value);
> > break;
> > case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY:
> > break;
> >
> 
> Does any other board have this identification feature? I see the code
> only use qixis. How are RDB and customer boards handled?
> 
> York
[Lu Yangbo-B47093] This feature is used for QDS boards that use SDHC Adapter 
card. Now only T1040QDS and T2080QDS are enabled, because we want to support 
SD/MMC UHS-I speed mode on these two boards in kernel and these QIXIS 
configuration are needed for *the Adapter*. For RDB and customer boards, they 
don't use Adapter card and the default configuration is ok for SD/MMC Default 
speed mode and High speed mode.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] mmc: fsl_esdhc: enable dat[4:7] for eMMC4.5

2015-09-14 Thread Lu Y . B .
> On 09/14/2015 07:22 PM, Lu Yangbo-B47093 wrote:
> > Hi York,
> >
> > Please see my comments below.
> >
> >> -Original Message-
> >> From: Sun York-R58495
> >> Sent: Monday, September 14, 2015 11:57 PM
> >> To: Lu Yangbo-B47093; u-boot@lists.denx.de
> >> Subject: Re: [PATCH 1/3] mmc: fsl_esdhc: enable dat[4:7] for eMMC4.5
> >>
> >> Yangbo,
> >>
> >> On 09/13/2015 08:04 PM, Yangbo Lu wrote:
> >>> If adapter card type identification is supported for platform, we
> >>> would enable dat[4:7] for eMMC4.5 card.
> >>>
> >>> Signed-off-by: Yangbo Lu 
> >>> Cc: York Sun 
> >>> ---
> >>>  board/freescale/common/qixis.h | 2 ++
> >>>  drivers/mmc/fsl_esdhc.c| 3 +++
> >>>  2 files changed, 5 insertions(+)
> >>>
> >>> diff --git a/board/freescale/common/qixis.h
> >>> b/board/freescale/common/qixis.h index 51ce9c3..450cd0d 100644
> >>> --- a/board/freescale/common/qixis.h
> >>> +++ b/board/freescale/common/qixis.h
> >>> @@ -127,6 +127,8 @@ void qixis_write_i2c(unsigned int reg, u8 value);
> >>>  #define QIXIS_ESDHC_NO_ADAPTER  0x7  /* No Card is
> >> Present*/
> >>>  #define QIXIS_SDCLKIN0x08
> >>>  #define QIXIS_SDCLKOUT   0x02
> >>> +#define QIXIS_DAT5_6_7   0X02
> >>> +#define QIXIS_DAT4   0X01
> >>>  #endif
> >>>
> >>>  #endif
> >>> diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index
> >>> 0b37002..639ec02 100644
> >>> --- a/drivers/mmc/fsl_esdhc.c
> >>> +++ b/drivers/mmc/fsl_esdhc.c
> >>> @@ -747,6 +747,9 @@ void mmc_adapter_card_type_ident(void)
> >>>
> >>>   switch (card_id) {
> >>>   case QIXIS_ESDHC_ADAPTER_TYPE_EMMC45:
> >>> + value = QIXIS_READ(brdcfg[5]);
> >>> + value |= (QIXIS_DAT4 | QIXIS_DAT5_6_7);
> >>> + QIXIS_WRITE(brdcfg[5], value);
> >>>   break;
> >>>   case QIXIS_ESDHC_ADAPTER_TYPE_SDMMC_LEGACY:
> >>>   break;
> >>>
> >>
> >> Does any other board have this identification feature? I see the code
> >> only use qixis. How are RDB and customer boards handled?
> >>
> >> York
> > [Lu Yangbo-B47093] This feature is used for QDS boards that use SDHC
> Adapter card. Now only T1040QDS and T2080QDS are enabled, because we want
> to support SD/MMC UHS-I speed mode on these two boards in kernel and
> these QIXIS configuration are needed for *the Adapter*. For RDB and
> customer boards, they don't use Adapter card and the default
> configuration is ok for SD/MMC Default speed mode and High speed mode.
> >
> 
> I am actually more concerned how a customer board can take advantage of
> this.
> 
> York
[Lu Yangbo-B47093] This feature is used to resolve pin multiplexing and Adapter 
card configuration on QDS board.
RDB and custom boards don't support Adapter card, and the FPGA/CPLD is 
easier(don't have these register and settings), having no need to change.
So they couldn't take advantage of this... 

Thanks.

-Yangbo Lu


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


Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot support

2015-09-15 Thread Gong Q . Y .
> -Original Message-
> From: Wood Scott-B07421
> Sent: Tuesday, September 15, 2015 7:08 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou Zhiqiang-B48286; Hu
> Mingkai-B21284; Song Wenbin-B53747
> Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot
> support
>
> On Fri, 2015-09-11 at 19:07 +0800, Gong Qianyu wrote:
> > Signed-off-by: Gong Qianyu 
> > mailto:qianyu.g...@freescale.com>>
> > Signed-off-by: Hou Zhiqiang 
> > mailto:b48...@freescale.com>>
> > Signed-off-by: Shaohui Xie 
> > mailto:shaohui@freescale.com>>
> > Signed-off-by: Mingkai Hu 
> > mailto:mingkai...@freescale.com>>
> > ---
> >  arch/arm/Kconfig   |  1 +
> >  arch/arm/cpu/armv8/fsl-lsch2/Makefile  |  1 +
> >  arch/arm/cpu/armv8/fsl-lsch2/spl.c | 91
> > ++
> >  arch/arm/include/asm/arch-fsl-lsch2/config.h   |  2 +
> >  board/freescale/ls1043ardb/ls1043ardb_pbi.cfg  | 14 
> >  board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg |  7 ++
> >  configs/ls1043ardb_nand_defconfig  |  4 +
> >  include/configs/ls1043a_common.h   | 31 
> >  include/configs/ls1043ardb.h   | 40 ++
> >  9 files changed, 191 insertions(+)
> >
> > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index
> > f935f19..197c72d 100644
> > --- a/arch/arm/Kconfig
> > +++ b/arch/arm/Kconfig
> > @@ -612,6 +612,7 @@ config TARGET_VEXPRESS64_BASE_FVP  config
> > TARGET_VEXPRESS64_JUNO
> >   bool "Support Versatile Express Juno Development Platform"
> >   select ARM64
> > + select SUPPORT_SPL
>
> The subject line says you're adding nand boot support to ls1043ardb, not
> Juno.
>
> Also, the previous patch adds SUPPORT_SPL to ls1043ardb -- was it
> supported in that patch (for non-NAND boot) or is that an error?
>

Sorry, this is really a patching mistake.:(

> >
> >  config TARGET_LS2085A_EMU
> >   bool "Support ls2085a_emu"
> > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > b/arch/arm/cpu/armv8/fsl- lsch2/Makefile index 23c5bf9..0573659 100644
> > --- a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > +++ b/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > @@ -10,3 +10,4 @@ obj-y += lowlevel.o
> >  obj-y += speed.o
> >  obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o ls1043a_serdes.o
> >  obj-$(CONFIG_OF_LIBFDT) += fdt.o
> > +obj-$(CONFIG_SPL) += spl.o
> > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/spl.c
> > b/arch/arm/cpu/armv8/fsl- lsch2/spl.c new file mode 100644 index
> > 000..980901a
> > --- /dev/null
> > +++ b/arch/arm/cpu/armv8/fsl-lsch2/spl.c
> > @@ -0,0 +1,91 @@
> > +/*
> > + * Copyright 2014 Freescale Semiconductor, Inc.
> > + *
> > + * SPDX-License-Identifier:  GPL-2.0+  */
> > +
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include 
> > +#include "../../../../../board/freescale/common/ns_access.h"
>
> Why is this header in board/freescale/common if code outside that
> directory needs it?
>
> Where did you note the dependency on "ARMv7/ls1021a: move ns_access to
> common file" which is not in this patchset?
>
>

The ns_access.h is common and shared by not only LS1043A but also LS1021A 
boards.

The "ARMv7/ls1021a” patch had been sent out much earlier while the ls1043a 
patches were not ready.
Some details are still overlooked, though.

> > +#ifdef CONFIG_SPL_BUILD
> > +void board_init_f(ulong dummy)
> > +{
> > +#ifdef CONFIG_SPL_NAND_SUPPORT
> > + init_early_memctl_regs();
> > +
> > + /*
> > +  * There is LS1 SoC issue where NOR, FPGA are during
> > +  * NAND boot because IFC signals > IFC_AD7 are not enabled.
> > +  * This workaround changes RCW source to make all signals enabled.
> > +  */
> > + u32 porsr1, pinctl;
> > + struct ccsr_gur __iomem *gur = (void *)CONFIG_SYS_FSL_GUTS_ADDR;
> > + porsr1 = in_be32(&gur->porsr1);
> > + pinctl = ((porsr1 & ~(FSL_CHASSIS2_CCSR_PORSR1_RCW_MASK)) |
> 0x2480);
> > + out_be32((unsigned int *)CONFIG_SYS_DCSR_DCFG_ADDR, pinctl);
> > +#endif
>
> This looks like erratum_rcw_src() in arch/cpu/armv8/fsl-lsch3/soc.c.  It
> should probably be moved somewhere common.
>
> Did this ever get an erratum number?
>

This is from ls1021a spl code. Seems that it could be removed now since ls1043a 
won’t get

Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot support

2015-09-16 Thread Gong Q . Y .
> -Original Message-
> From: Wood Scott-B07421
> Sent: Wednesday, September 16, 2015 6:33 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou Zhiqiang-B48286; Hu
> Mingkai-B21284; Song Wenbin-B53747; Sun York-R58495
> Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot
> support
> 
> [Added York Sun -- please CC him on future patches]
> 
> On Tue, 2015-09-15 at 06:47 -0500, Gong Qianyu-B52263 wrote:
> > > -Original Message-
> > > From: Wood Scott-B07421
> > > Sent: Tuesday, September 15, 2015 7:08 AM
> > > To: Gong Qianyu-B52263
> > > Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou Zhiqiang-B48286;
> > > Hu Mingkai-B21284; Song Wenbin-B53747
> > > Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot
> > > support
> > >
> > > On Fri, 2015-09-11 at 19:07 +0800, Gong Qianyu wrote:
> > > > Signed-off-by: Gong Qianyu 
> > > > Signed-off-by: Hou Zhiqiang 
> > > > Signed-off-by: Shaohui Xie 
> > > > Signed-off-by: Mingkai Hu 
> > > > ---
> > > >  arch/arm/Kconfig   |  1 +
> > > >  arch/arm/cpu/armv8/fsl-lsch2/Makefile  |  1 +
> > > >  arch/arm/cpu/armv8/fsl-lsch2/spl.c | 91
> > > > ++
> > > >  arch/arm/include/asm/arch-fsl-lsch2/config.h   |  2 +
> > > >  board/freescale/ls1043ardb/ls1043ardb_pbi.cfg  | 14 
> > > >  board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg |  7 ++
> > > >  configs/ls1043ardb_nand_defconfig  |  4 +
> > > >  include/configs/ls1043a_common.h   | 31 
> > > >  include/configs/ls1043ardb.h   | 40 ++
> > > >  9 files changed, 191 insertions(+)
> > > >
> > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index
> > > > f935f19..197c72d 100644
> > > > --- a/arch/arm/Kconfig
> > > > +++ b/arch/arm/Kconfig
> > > > @@ -612,6 +612,7 @@ config TARGET_VEXPRESS64_BASE_FVP  config
> > > > TARGET_VEXPRESS64_JUNO
> > > >   bool "Support Versatile Express Juno Development Platform"
> > > >   select ARM64
> > > > + select SUPPORT_SPL
> > >
> > > The subject line says you're adding nand boot support to ls1043ardb,
> > > not Juno.
> > >
> > > Also, the previous patch adds SUPPORT_SPL to ls1043ardb -- was it
> > > supported in that patch (for non-NAND boot) or is that an error?
> > >
> >
> > Sorry, this is really a patching mistake.:(
> >
> > > >
> > > >  config TARGET_LS2085A_EMU
> > > >   bool "Support ls2085a_emu"
> > > > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > b/arch/arm/cpu/armv8/fsl- lsch2/Makefile index 23c5bf9..0573659
> > > > 100644
> > > > --- a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > +++ b/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > @@ -10,3 +10,4 @@ obj-y += lowlevel.o  obj-y += speed.o
> > > >  obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o
> > > > ls1043a_serdes.o
> > > >  obj-$(CONFIG_OF_LIBFDT) += fdt.o
> > > > +obj-$(CONFIG_SPL) += spl.o
> > > > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/spl.c
> > > > b/arch/arm/cpu/armv8/fsl- lsch2/spl.c new file mode 100644 index
> > > > 000..980901a
> > > > --- /dev/null
> > > > +++ b/arch/arm/cpu/armv8/fsl-lsch2/spl.c
> > > > @@ -0,0 +1,91 @@
> > > > +/*
> > > > + * Copyright 2014 Freescale Semiconductor, Inc.
> > > > + *
> > > > + * SPDX-License-Identifier:  GPL-2.0+  */
> > > > +
> > > > +#include 
> > > > +#include 
> > > > +#include 
> > > > +#include 
> > > > +#include 
> > > > +#include 
> > > > +#include "../../../../../board/freescale/common/ns_access.h"
> > >
> > > Why is this header in board/freescale/common if code outside that
> > > directory needs it?
> > >
> > > Where did you note the dependency on "ARMv7/ls1021a: move ns_access
> > > to common file" which is not in this patchset?
> > >
> > >
> >
> > The ns_access.h is common and shared by not only LS1043A but also
> > LS1021A boards.
> >
> > The "ARMv7/ls1021a” patch had been sent ou

Re: [U-Boot] [Patch v2 11/16] armv8/ls1043ardb: Add nand boot support

2015-09-17 Thread Gong Q . Y .

> -Original Message-
> From: Wood Scott-B07421
> Sent: Friday, September 18, 2015 4:16 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou
> Zhiqiang-B48286; Song Wenbin-B53747; Xie Shaohui-B21989; Wood Scott-
> B07421
> Subject: Re: [Patch v2 11/16] armv8/ls1043ardb: Add nand boot support
> 
> On Thu, 2015-09-17 at 15:06 +0800, Gong Qianyu wrote:
> >
> 
> >
> > +/* NAND SPL */
> > +#ifdef CONFIG_NAND_BOOT
> > +#define CONFIG_SPL_PBL_PAD
> > +#define CONFIG_SPL_FRAMEWORK
> > +#define CONFIG_SPL_LDSCRIPT  "arch/arm/cpu/armv8/u-boot-
> spl.lds"
> > +#define CONFIG_SPL_TARGET"u-boot-with-spl.bin"
> > +#define CONFIG_SPL_LIBCOMMON_SUPPORT
> > +#define CONFIG_SPL_LIBGENERIC_SUPPORT #define CONFIG_SPL_ENV_SUPPORT
> > +#define CONFIG_SPL_WATCHDOG_SUPPORT #define CONFIG_SPL_I2C_SUPPORT
> > +#define CONFIG_SPL_SERIAL_SUPPORT #define
> > +CONFIG_SPL_MPC8XXX_INIT_DDR_SUPPORT
> > +#define CONFIG_SPL_NAND_SUPPORT
> > +#define CONFIG_SPL_DRIVERS_MISC_SUPPORT
> > +#define CONFIG_SPL_TEXT_BASE 0x1000
> > +#define CONFIG_SPL_MAX_SIZE  0x1a000
> > +#define CONFIG_SPL_STACK 0x1001d000
> > +#define CONFIG_SPL_PAD_TO0x1c000
> > +#define CONFIG_SYS_NAND_U_BOOT_OFFS  CONFIG_SPL_PAD_TO #define
> > +CONFIG_SYS_NAND_U_BOOT_SIZE  (640 << 10)
> 
> You made the U-Boot size be block aligned (assuming 128k block size,
> which the SoC common file should not do), but its offset is not.
> 
> -Scott

Eh, yes. The CONFIG_SPL_PAD_TO should be block aligned and put to board 
specific file assuming different NAND chips.
That reminds me. SPL and U-Boot size should be block aligned, so it is with the 
env size. Right?

Regards,
Qianyu



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


Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot support

2015-09-18 Thread Gong Q . Y .

> -Original Message-
> From: Wood Scott-B07421
> Sent: Friday, September 18, 2015 3:26 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou Zhiqiang-B48286; Hu
> Mingkai-B21284; Song Wenbin-B53747; Sun York-R58495
> Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot
> support
> 
> On Wed, 2015-09-16 at 04:25 -0500, Gong Qianyu-B52263 wrote:
> > > -Original Message-
> > > From: Wood Scott-B07421
> > > Sent: Wednesday, September 16, 2015 6:33 AM
> > > To: Gong Qianyu-B52263
> > > Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou Zhiqiang-B48286;
> > > Hu Mingkai-B21284; Song Wenbin-B53747; Sun York-R58495
> > > Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand boot
> > > support
> > >
> > > [Added York Sun -- please CC him on future patches]
> > >
> > > On Tue, 2015-09-15 at 06:47 -0500, Gong Qianyu-B52263 wrote:
> > > > > -Original Message-
> > > > > From: Wood Scott-B07421
> > > > > Sent: Tuesday, September 15, 2015 7:08 AM
> > > > > To: Gong Qianyu-B52263
> > > > > Cc: u-boot@lists.denx.de; Xie Shaohui-B21989; Hou
> > > > > Zhiqiang-B48286; Hu Mingkai-B21284; Song Wenbin-B53747
> > > > > Subject: Re: [U-Boot] [PATCH 09/14] armv8/ls1043ardb: Add nand
> > > > > boot support
> > > > >
> > > > > On Fri, 2015-09-11 at 19:07 +0800, Gong Qianyu wrote:
> > > > > > Signed-off-by: Gong Qianyu 
> > > > > > Signed-off-by: Hou Zhiqiang 
> > > > > > Signed-off-by: Shaohui Xie 
> > > > > > Signed-off-by: Mingkai Hu 
> > > > > > ---
> > > > > >  arch/arm/Kconfig   |  1 +
> > > > > >  arch/arm/cpu/armv8/fsl-lsch2/Makefile  |  1 +
> > > > > >  arch/arm/cpu/armv8/fsl-lsch2/spl.c | 91
> > > > > > ++
> > > > > >  arch/arm/include/asm/arch-fsl-lsch2/config.h   |  2 +
> > > > > >  board/freescale/ls1043ardb/ls1043ardb_pbi.cfg  | 14 
> > > > > >  board/freescale/ls1043ardb/ls1043ardb_rcw_nand.cfg |  7 ++
> > > > > >  configs/ls1043ardb_nand_defconfig  |  4 +
> > > > > >  include/configs/ls1043a_common.h   | 31
> 
> > > > > >  include/configs/ls1043ardb.h   | 40
> ++
> > > > > >  9 files changed, 191 insertions(+)
> > > > > >
> > > > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index
> > > > > > f935f19..197c72d 100644
> > > > > > --- a/arch/arm/Kconfig
> > > > > > +++ b/arch/arm/Kconfig
> > > > > > @@ -612,6 +612,7 @@ config TARGET_VEXPRESS64_BASE_FVP  config
> > > > > > TARGET_VEXPRESS64_JUNO
> > > > > >   bool "Support Versatile Express Juno Development
> Platform"
> > > > > >   select ARM64
> > > > > > + select SUPPORT_SPL
> > > > >
> > > > > The subject line says you're adding nand boot support to
> > > > > ls1043ardb, not Juno.
> > > > >
> > > > > Also, the previous patch adds SUPPORT_SPL to ls1043ardb -- was
> > > > > it supported in that patch (for non-NAND boot) or is that an
> error?
> > > > >
> > > >
> > > > Sorry, this is really a patching mistake.:(
> > > >
> > > > > >
> > > > > >  config TARGET_LS2085A_EMU
> > > > > >   bool "Support ls2085a_emu"
> > > > > > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > > > b/arch/arm/cpu/armv8/fsl- lsch2/Makefile index
> > > > > > 23c5bf9..0573659
> > > > > > 100644
> > > > > > --- a/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > > > +++ b/arch/arm/cpu/armv8/fsl-lsch2/Makefile
> > > > > > @@ -10,3 +10,4 @@ obj-y += lowlevel.o  obj-y += speed.o
> > > > > >  obj-$(CONFIG_SYS_HAS_SERDES) += fsl_lsch2_serdes.o
> > > > > > ls1043a_serdes.o
> > > > > >  obj-$(CONFIG_OF_LIBFDT) += fdt.o
> > > > > > +obj-$(CONFIG_SPL) += spl.o
> > > > > > diff --git a/arch/arm/cpu/armv8/fsl-lsch2/spl.c
> > > > > > b/arch/arm/cpu/armv8

Re: [U-Boot] [Patch v2 02/16] common/board_f.c: modify the macro to use get_clocks() more common

2015-09-21 Thread Gong Q . Y .

> -Original Message-
> From: Sun York-R58495
> Sent: Tuesday, September 22, 2015 1:27 AM
> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-
> B21989; Song Wenbin-B53747; Wood Scott-B07421
> Subject: Re: [Patch v2 02/16] common/board_f.c: modify the macro to use
> get_clocks() more common
> 
> 
> 
> On 09/17/2015 12:02 AM, Gong Qianyu wrote:
> > get_clocks() should not be limited by ESDHC.
> >
> > Signed-off-by: Gong Qianyu 
> > ---
> >  common/board_f.c  | 2 +-
> >  include/configs/BSC9132QDS.h  | 1 +
> >  include/configs/MPC8308RDB.h  | 1 +
> >  include/configs/MPC837XEMDS.h | 1 +
> >  include/configs/MPC837XERDB.h | 1 +
> >  include/configs/MPC8536DS.h   | 1 +
> >  include/configs/MPC8569MDS.h  | 1 +
> >  include/configs/P1010RDB.h| 1 +
> >  include/configs/P1022DS.h | 1 +
> >  include/configs/P2041RDB.h| 1 +
> >  include/configs/T102xQDS.h| 1 +
> >  include/configs/T102xRDB.h| 1 +
> >  include/configs/T1040QDS.h| 1 +
> >  include/configs/T104xRDB.h| 1 +
> >  include/configs/T208xQDS.h| 1 +
> >  include/configs/T208xRDB.h| 1 +
> >  include/configs/T4240QDS.h| 1 +
> >  include/configs/T4240RDB.h| 1 +
> >  include/configs/UCP1020.h | 1 +
> >  include/configs/colibri_vf.h  | 1 +
> >  include/configs/controlcenterd.h  | 1 +
> >  include/configs/corenet_ds.h  | 1 +
> >  include/configs/hrcon.h   | 1 +
> >  include/configs/ima3-mx53.h   | 1 +
> >  include/configs/ls1021aqds.h  | 1 +
> >  include/configs/ls1021atwr.h  | 1 +
> >  include/configs/ls2085aqds.h  | 1 +
> >  include/configs/ls2085ardb.h  | 1 +
> >  include/configs/m53evk.h  | 1 +
> >  include/configs/mx25pdk.h | 1 +
> >  include/configs/mx35pdk.h | 1 +
> >  include/configs/mx51_efikamx.h| 1 +
> >  include/configs/mx51evk.h | 1 +
> >  include/configs/mx53ard.h | 1 +
> >  include/configs/mx53evk.h | 1 +
> >  include/configs/mx53loco.h| 1 +
> >  include/configs/mx53smd.h | 1 +
> >  include/configs/mx6_common.h  | 1 +
> >  include/configs/p1_p2_rdb_pc.h| 1 +
> >  include/configs/p1_twr.h  | 1 +
> >  include/configs/usbarmory.h   | 1 +
> >  include/configs/vf610twr.h| 1 +
> >  include/configs/vision2.h | 1 +
> >  include/configs/woodburn_common.h | 1 +
> >  44 files changed, 44 insertions(+), 1 deletion(-)
> 
> Can you take a closer look at the powerpc boards? I think most of them
> already calling get_clocks under this
> 
> defined(CONFIG_PPC) && !defined(CONFIG_8xx_CPUCLK_DEFAULT)
> 
> York

I'm also confused about this. They have called get_clocks() twice on PPC before 
even though they use CONFIG_FSL_ESDHC.
I just made a replacement for it to keep the original meaning. 
So where should get_clocks() be called correctly on PPC?

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


Re: [U-Boot] [PATCH 3/3] spi: fsl_quadspi: Fix qspi_op_rdid memcpy issue

2015-12-14 Thread Gong Q . Y .
Oh, so sorry for the mess... The network seems to get problems..:(

Regards,
Qianyu

> -Original Message-
> From: Gong Qianyu [mailto:qianyu.g...@freescale.com]
> Sent: Monday, December 14, 2015 6:37 PM
> To: u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Yuan Yao-B46683;
> jt...@openedev.com; Gong Qianyu-B52263
> Subject: [PATCH 3/3] spi: fsl_quadspi: Fix qspi_op_rdid memcpy issue
> 
> In current driver everytime we memcpy 4 bytes to the dest memory
> regardless of the remaining length.
> This patch add checking the remaining length before memcpy.
> If the length is shorter than 4 bytes, memcpy the actual length of data
> to the dest memory.
> 
> Signed-off-by: Gong Qianyu 
> ---
>  drivers/spi/fsl_qspi.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
> 755cc27..b41b226 100644
> --- a/drivers/spi/fsl_qspi.c
> +++ b/drivers/spi/fsl_qspi.c
> @@ -499,7 +499,10 @@ static void qspi_op_rdid(struct fsl_qspi_priv *priv,
> u32 *rxbuf, u32 len)
>   if (rbsr_reg & QSPI_RBSR_RDBFL_MASK) {
>   data = qspi_read32(priv->flags, ®s->rbdr[i]);
>   data = qspi_endian_xchg(data);
> - memcpy(rxbuf, &data, 4);
> + if (size < 4)
> + memcpy(rxbuf, &data, size);
> + else
> + memcpy(rxbuf, &data, 4);
>   rxbuf++;
>   size -= 4;
>   i++;
> --
> 2.1.0.27.g96db324

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


Re: [U-Boot] [PATCH] i2c: mxc: allow executing the code that only applies to i.MX platforms

2015-12-14 Thread Gong Q . Y .

> -Original Message-
> From: Sun York-R58495
> Sent: Monday, December 14, 2015 6:37 PM
> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Fan Peng-B51431
> Subject: Re: [PATCH] i2c: mxc: allow executing the code that only applies
> to i.MX platforms
> 
> 
> 
> On 12/14/2015 06:23 PM, Gong Qianyu wrote:
> > The bus_i2c_init() is called before relocation and will assgin value
> > to a static variable. If U-Boot is then still running in a flash
> > device, it's theoretically not allowed to write data to flash without
> > an erasing operation. For i.MX platforms, the U-Boot is always running
> > in DDR.
> >
> > Actually it causes asynchronous error when the ARM64 system error
> > report is enabled and the flash write protect is set.
> >
> > Signed-off-by: Gong Qianyu 
> > ---
> >  drivers/i2c/mxc_i2c.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index
> > fa4c82f..4dddb83 100644
> > --- a/drivers/i2c/mxc_i2c.c
> > +++ b/drivers/i2c/mxc_i2c.c
> > @@ -581,8 +581,11 @@ void bus_i2c_init(int index, int speed, int unused,
> > return;
> > }
> >
> > +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
> > +   defined(CONFIG_MX6) || defined(CONFIG_MX7)
> > mxc_i2c_buses[index].idle_bus_fn = idle_bus_fn;
> > mxc_i2c_buses[index].idle_bus_data = idle_bus_data;
> > +#endif
> >
> 
> I also think using variable mxc_i2c_buses is problematic. But using ifdef
> doesn't look like a solution. I think this variable should be put into
> stack, or use malloc. It works with execution-in-place in read-only space.
> 
> York

But we don't know if the stack will be enough before relocation. For SD boot of 
LS1043A, 

there is now only 4KB for it and if the spl image is bigger in the future, the 
stack is 

smaller. So isn't leaving more stack(if possible) for necessary code better? 

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


Re: [U-Boot] [PATCH] i2c: mxc: allow executing the code that only applies to i.MX platforms

2015-12-14 Thread Gong Q . Y .

>> On 12/14/2015 07:03 PM, Gong Qianyu-B52263 wrote:
>> 
>>> -Original Message-
>>> From: Sun York-R58495
>>> Sent: Monday, December 14, 2015 6:37 PM
>>> To: Gong Qianyu-B52263; u-boot@lists.denx.de
>>> Cc: Hu Mingkai-B21284; Sun York-R58495; Fan Peng-B51431
>>> Subject: Re: [PATCH] i2c: mxc: allow executing the code that only applies
>>> to i.MX platforms
>>> 
>>> 
>>> 
 On 12/14/2015 06:23 PM, Gong Qianyu wrote:
 The bus_i2c_init() is called before relocation and will assgin value
 to a static variable. If U-Boot is then still running in a flash
 device, it's theoretically not allowed to write data to flash without
 an erasing operation. For i.MX platforms, the U-Boot is always running
 in DDR.
 
 Actually it causes asynchronous error when the ARM64 system error
 report is enabled and the flash write protect is set.
 
 Signed-off-by: Gong Qianyu 
 ---
 drivers/i2c/mxc_i2c.c | 3 +++
 1 file changed, 3 insertions(+)
 
 diff --git a/drivers/i2c/mxc_i2c.c b/drivers/i2c/mxc_i2c.c index
 fa4c82f..4dddb83 100644
 --- a/drivers/i2c/mxc_i2c.c
 +++ b/drivers/i2c/mxc_i2c.c
 @@ -581,8 +581,11 @@ void bus_i2c_init(int index, int speed, int unused,
return;
}
 
 +#if defined(CONFIG_MX51) || defined(CONFIG_MX53) || \
 +defined(CONFIG_MX6) || defined(CONFIG_MX7)
mxc_i2c_buses[index].idle_bus_fn = idle_bus_fn;
mxc_i2c_buses[index].idle_bus_data = idle_bus_data;
 +#endif
>>> 
>>> I also think using variable mxc_i2c_buses is problematic. But using ifdef
>>> doesn't look like a solution. I think this variable should be put into
>>> stack, or use malloc. It works with execution-in-place in read-only space.
>>> 
>>> York
>> 
>> But we don't know if the stack will be enough before relocation. For SD boot 
>> of LS1043A, 
>> 
>> there is now only 4KB for it and if the spl image is bigger in the future, 
>> the stack is 
>> 
>> smaller. So isn't leaving more stack(if possible) for necessary code better?
> 
> This array is small. The size of stack depends on the deepest one in all
> functions. I don't think this driver use deep stack. I remember Linux has a 
> tool
> to calculate the stack. You can try it to examine the stack depth.
> 
> York
> 
Ok. So the array won't need to be reserved in stack. I just didn't read much of 
the driver code and wanted to keep the original meaning of the author. I'm also 
confused why it has to be static. But before that it was put in gdata.


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


Re: [U-Boot] [Patch V2 1/4] spi: fsl_qspi: fix compile warning for 64-bit platform

2015-12-16 Thread Gong Q . Y .

> -Original Message-
> From: Jagan Teki [mailto:jt...@openedev.com]
> Sent: Wednesday, December 16, 2015 12:55 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de
> Subject: Re: [U-Boot] [Patch V2 1/4] spi: fsl_qspi: fix compile warning
> for 64-bit platform
> 
> On 15 December 2015 at 15:59, Gong Qianyu 
> wrote:
> > This patch fixes the following compile warning:
> > drivers/spi/fsl_qspi.c: In function 'fsl_qspi_probe':
> > drivers/spi/fsl_qspi.c:937:15:
> >   warning: cast to pointer from integer of different size
> >  [-Wint-to-pointer-cast]
> >   priv->regs = (struct fsl_qspi_regs *)plat->reg_base;
> >^
> >
> > Signed-off-by: Gong Qianyu 
> > ---
> > V2:
> >  - No change.
> >
> >  drivers/spi/fsl_qspi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/spi/fsl_qspi.c b/drivers/spi/fsl_qspi.c index
> > ed39114..9f296c1 100644
> > --- a/drivers/spi/fsl_qspi.c
> > +++ b/drivers/spi/fsl_qspi.c
> > @@ -931,7 +931,7 @@ static int fsl_qspi_probe(struct udevice *bus)
> >
> > dm_spi_bus->max_hz = plat->speed_hz;
> >
> > -   priv->regs = (struct fsl_qspi_regs *)plat->reg_base;
> > +   priv->regs = (struct fsl_qspi_regs *)(unsigned
> > + long)plat->reg_base;
> 
> What about using fdtdec_get_addr instead of typecasting long?
> 
> thanks!
> --
> Jagan.

But the reg_base could be a 32-bit type on 64-bit platform. Then the 
fdtdec_get_addr would return a wrong value which actually gets 64 bits
from the node. Or else we still have to convert it.

So I think just making the cast explicit is easier to look at.

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


Re: [U-Boot] mmc erase command fails with DAT0 timeout on eMMC on iMX6 board

2015-06-05 Thread Lu Y . B .
Hello Hector,

I am not familiar with iMX6 based board.
I only know the DAT0 checking was introduced in commit 
7a5b80297bc6cef0c10e5f57ac0450678dc7bc5e

And different cards may have different secure erase timeout value.
This should be found in chip datasheet.

But I've never meet your issue...

> -Original Message-
> From: Palacios, Hector [mailto:hector.palac...@digi.com]
> Sent: Thursday, June 04, 2015 7:24 PM
> To: u-boot@lists.denx.de; Estevam Fabio-R49496; Lu Yangbo-B47093
> Cc: Engel, Mike
> Subject: mmc erase command fails with DAT0 timeout on eMMC on iMX6 board
> 
> Hello,
> 
> I can see the command 'mmc erase blk# cnt' fails with a DAT0 timeout on
> iMX6 boards when run over the eMMC.
> 
> => mmc dev 2
> => mmc erase 4000 1000
> MMC erase: dev # 2, block # 16384, count 4096 ... Timeout waiting for
> DAT0 to go high!
> mmc erase failed
> 0 blocks erase: ERROR
> 
> I reproduced it with the SabreSD board running upstream U-Boot v2015.04.
> The error does not happen using microSD card, though.
> 
> Does anybody else have the same problem on other iMX6 based boards?
> Thank you.
> 
> PS. Increasing the timeout value ad infinitum does not help.
> --
> Héctor Palacios
> 

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


Re: [U-Boot] [Patch V5 02/17] common/board_f.c: modify the macro to use get_clocks() more common

2015-10-15 Thread Gong Q . Y .

> -Original Message-
> From: Kushwaha Prabhakar-B32579
> Sent: Friday, October 16, 2015 12:08 PM
> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-
> B21989; Song Wenbin-B53747; Wood Scott-B07421; Wang Huan-B18965; Gong
> Qianyu-B52263
> Subject: RE: [Patch V5 02/17] common/board_f.c: modify the macro to use
> get_clocks() more common
> 
> 
> > -Original Message-
> > From: Gong Qianyu [mailto:qianyu.g...@freescale.com]
> > Sent: Thursday, October 15, 2015 6:32 PM
> > To: u-boot@lists.denx.de
> > Cc: Hu Mingkai-B21284 ; Sun York-R58495
> > ; Hou Zhiqiang-B48286 ;
> > Xie Shaohui-B21989 ; Song Wenbin-B53747
> > ; Wood Scott-B07421
> > ; Kushwaha Prabhakar-B32579
> > ; Wang Huan-B18965
> > ; Gong Qianyu-B52263
> > 
> > Subject: [Patch V5 02/17] common/board_f.c: modify the macro to use
> > get_clocks() more common
> >
> > get_clocks() should not be limited by ESDHC.
> >
> > Signed-off-by: Gong Qianyu 
> > ---
> > V5:
> >  - No change.
> > V4:
> >  - No change.
> > V3:
> >  - Removed defines in PPC configs that have no need to use.
> > V2:
> >  - No change.
> >
> >  common/board_f.c  | 2 +-
> >  include/configs/colibri_vf.h  | 1 +
> >  include/configs/ls1021aqds.h  | 1 +
> >  include/configs/ls1021atwr.h  | 1 +
> >  include/configs/ls2085aqds.h  | 1 +
> >  include/configs/ls2085ardb.h  | 1 +
> >  include/configs/m53evk.h  | 1 +
> >  include/configs/mx25pdk.h | 1 +
> >  include/configs/mx35pdk.h | 1 +
> >  include/configs/mx51evk.h | 1 +
> >  include/configs/mx53ard.h | 1 +
> >  include/configs/mx53evk.h | 1 +
> >  include/configs/mx53loco.h| 1 +
> >  include/configs/mx53smd.h | 1 +
> >  include/configs/mx6_common.h  | 1 +
> >  include/configs/mx7_common.h  | 1 +
> >  include/configs/usbarmory.h   | 1 +
> >  include/configs/vf610twr.h| 1 +
> >  include/configs/woodburn_common.h | 1 +
> >  19 files changed, 19 insertions(+), 1 deletion(-)
> >
> > diff --git a/common/board_f.c b/common/board_f.c index
> > 613332e..1bb84b3
> > 100644
> > --- a/common/board_f.c
> > +++ b/common/board_f.c
> > @@ -806,7 +806,7 @@ static init_fnc_t init_sequence_f[] = {  #if
> > defined(CONFIG_BOARD_POSTCLK_INIT)
> > board_postclk_init,
> >  #endif
> > -#ifdef CONFIG_FSL_ESDHC
> > +#ifdef CONFIG_FSL_CLK
> > get_clocks,
> >  #endif
> 
> New define CONFIG_FSL_CLK used. Please add its description in README file.
> 
> Also, is there no need of  defining CONFIG_FSL_CLK for PowerPC platforms?
> 
> --prabhakar

No. They have already called the first get_clocks() in init_sequence_f[] as 
they define CONFIG_PPC.
CONFIG_FSL_CLK is then used to call the second get_clocks(), which may be 
redundant for PPC. 

Regards,
Qianyu



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


Re: [U-Boot] [Patch V5 11/17] armv8/fsl_lsch3: Change arch to fsl-layerscape

2015-10-16 Thread Gong Q . Y .

> -Original Message-
> From: Prabhakar [mailto:prabha...@freescale.com]
> Sent: Friday, October 16, 2015 2:20 PM
> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-
> B21989; Song Wenbin-B53747; Wood Scott-B07421; Wang Huan-B18965
> Subject: Re: [Patch V5 11/17] armv8/fsl_lsch3: Change arch to fsl-
> layerscape
> 
> 
> 
> On 10/15/2015 6:32 PM, Gong Qianyu wrote:
> > From: Mingkai Hu 
> >
> > There are two LS series processors are built on ARMv8 Layersacpe
> > architecture currently, LS2085A and LS1043A. They are based on
> > ARMv8 core although use different chassis, so create fsl-layerscape
> > to refactor the common code for the LS series processors which also
> > paves the way for adding LS1043A platform.
> >
> > Signed-off-by: Mingkai Hu 
> > Signed-off-by: Gong Qianyu 
> > ---
> > V5:
> >   - Move LS2085A ddr macros out of soc #ifdef.
> >   - Move macros and structs from cpu.c to cpu.h.
> >   - Wrap le32 and be32 functions for ccsr gur and scfg. Defined in
> soc.h
> >   - Modify fsl-layerscape/Makefile.
> > V4:
> >   - New patch.
> >
> >   arch/arm/cpu/armv8/Makefile|   2 +-
> >   arch/arm/cpu/armv8/fsl-layerscape/Makefile |  21 ++
> >   .../README => fsl-layerscape/README.lsch3} |   0
> >   .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.c  | 249 ++--
> -
> >   .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/cpu.h  |   2 +-
> >   .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/fdt.c  |  17 +-
> >   .../fsl_lsch3_serdes.c |   8 +-
> >   .../speed.c => fsl-layerscape/fsl_lsch3_speed.c}   |  12 +-
> >   .../armv8/{fsl-lsch3 => fsl-layerscape}/lowlevel.S |  14 +-
> >   .../{fsl-lsch3 => fsl-layerscape}/ls2085a_serdes.c |   3 +-
> >   .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/mp.c   |  15 +-
> >   .../cpu/armv8/{fsl-lsch3 => fsl-layerscape}/soc.c  |  35 +--
> >   arch/arm/cpu/armv8/fsl-layerscape/spl.c|  76 +++
> >   arch/arm/cpu/armv8/fsl-lsch3/Makefile  |  13 --
> >   arch/arm/cpu/armv8/fsl-lsch3/speed.h   |   7 -
> >   .../clock.h|   8 +-
> >   arch/arm/include/asm/arch-fsl-layerscape/config.h  |  59 +
> >   arch/arm/include/asm/arch-fsl-layerscape/cpu.h | 165
> ++
> >   .../{arch-fsl-lsch3 => arch-fsl-layerscape}/fdt.h  |   4 +
> >   .../fsl_serdes.h   |  11 +-
> >   .../immap_lsch3.h  | 119 --
> >   .../arm/include/asm/arch-fsl-layerscape/imx-regs.h |  55 +
> >   .../ls2085a_stream_id.h|   0
> >   arch/arm/include/asm/arch-fsl-layerscape/mmu.h |  10 +
> >   .../asm/arch-fsl-layerscape}/mp.h  |  10 +-
> >   .../{arch-fsl-lsch3 => arch-fsl-layerscape}/soc.h  |  21 +-
> >   arch/arm/include/asm/arch-fsl-layerscape/speed.h   |  10 +
> >   arch/arm/include/asm/arch-fsl-lsch3/config.h   | 185 
> ---
> >   arch/arm/include/asm/arch-fsl-lsch3/gpio.h |   9 -
> >   arch/arm/include/asm/arch-fsl-lsch3/imx-regs.h |  13 --
> >   arch/arm/include/asm/config.h  |   7 +-
> >   arch/arm/include/asm/global_data.h |   2 +-
> >   board/freescale/ls2085aqds/Kconfig |   2 +-
> >   board/freescale/ls2085aqds/eth.c   |   1 -
> >   board/freescale/ls2085aqds/ls2085aqds.c|   2 +-
> >   board/freescale/ls2085ardb/Kconfig |   2 +-
> >   board/freescale/ls2085ardb/eth_ls2085rdb.c |   1 -
> >   board/freescale/ls2085ardb/ls2085ardb.c|   2 +-
> >   drivers/i2c/mxc_i2c.c  |   4 +-
> >   drivers/misc/fsl_debug_server.c|   1 -
> >   drivers/net/ldpaa_eth/ls2085a.c|   2 -
> >   drivers/pci/pcie_layerscape.c  |   4 +-
> >   include/common.h   |   3 +
> >   include/configs/ls2085a_common.h   |  47 +++-
> >   44 files changed, 712 insertions(+), 521 deletions(-)
> >
> > diff --git a/arch/arm/cpu/armv8/fsl-lsch3/fdt.c
> b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> > similarity index 94%
> > rename from arch/arm/cpu/armv8/fsl-lsch3/fdt.c
> > rename to arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> > index 567c419..aa88d34 100644
> > --- a/arch/arm/cpu/armv8/fsl-lsch3/fdt.c
> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
> > @@ -1,5 +1,5 @@
> >   /*
> > - * Copyright 2014 Freescale Semiconductor, Inc.
> > + * Copyright 2014-2015 Freescale Semiconductor, Inc.
> >*
> >* SPDX-License-Identifier:   GPL-2.0+
> >*/
> > @@ -7,11 +7,16 @@
> >   #include 
> >   #include 
> >   #include 
> > -#include 
> > +#include 
> > +#ifdef CONFIG_FSL_LSCH3
> > +#include 
> > +#endif
> >   #ifdef CONFIG_FSL_ESDHC
> >   #include 
> >   #endif
> > -#include "mp.h"
> > +#ifdef CONFIG_MP
> > +#include 
>

Re: [U-Boot] [Patch V5 12/17] armv8/fsl_lsch2: Add fsl_lsch2 SoC

2015-10-16 Thread Gong Q . Y .

> -Original Message-
> From: Prabhakar [mailto:prabha...@freescale.com]
> Sent: Friday, October 16, 2015 2:28 PM
> To: Gong Qianyu-B52263; u-boot@lists.denx.de
> Cc: Hu Mingkai-B21284; Sun York-R58495; Hou Zhiqiang-B48286; Xie Shaohui-
> B21989; Song Wenbin-B53747; Wood Scott-B07421; Wang Huan-B18965; Li Yang-
> Leo-R58472
> Subject: Re: [Patch V5 12/17] armv8/fsl_lsch2: Add fsl_lsch2 SoC
> 
> 
> 
> On 10/15/2015 6:32 PM, Gong Qianyu wrote:
> > From: Mingkai Hu 
> >
> > Freescale LayerScape with Chassis Generation 2 is a set of SoCs with
> > ARMv8 cores and 2rd generation of Chassis.
> >
> > Signed-off-by: Li Yang 
> > Signed-off-by: Hou Zhiqiang 
> > Signed-off-by: Mingkai Hu 
> > Signed-off-by: Gong Qianyu 
> > ---
> > V5:
> >   - Move LS1043A ddr macros out of soc #ifdef.
> >   - Move macros and structs from cpu.c to cpu.h.
> >   - Wrap le32 and be32 functions for ccsr gur and scfg. Defined in
> soc.h
> >   - Modify fsl-layerscape/Makefile.
> > V4:
> >   - Add fsl_lsch2 to fsl-layerscape framework.
> > V3:
> >   - Update MMU table initialization to match the latest code.
> >   - Remove some dead code
> >   - Rename #include to #include
> > V2:
> >   - remove FSL_LS102xA_DEVDISR3_PCIE from immap_lsch2.h
> >
> >   arch/arm/cpu/armv8/fsl-layerscape/Makefile |   5 +
> >   arch/arm/cpu/armv8/fsl-layerscape/README.lsch2 |  10 +
> >   arch/arm/cpu/armv8/fsl-layerscape/cpu.c|  13 +
> >   .../cpu/armv8/fsl-layerscape/fsl_lsch2_serdes.c| 117 +
> >   .../arm/cpu/armv8/fsl-layerscape/fsl_lsch2_speed.c | 137 +
> >   arch/arm/cpu/armv8/fsl-layerscape/soc.c|  17 +
> >   arch/arm/include/asm/arch-fsl-layerscape/config.h  |  40 ++
> >   arch/arm/include/asm/arch-fsl-layerscape/cpu.h |  64 +++
> >   .../include/asm/arch-fsl-layerscape/fsl_serdes.h   |  91 
> >   .../include/asm/arch-fsl-layerscape/immap_lsch2.h  | 555
> +
> >   .../include/asm/arch-fsl-layerscape/ns_access.h| 158 ++
> >   arch/arm/include/asm/arch-fsl-layerscape/soc.h |   6 +
> >   arch/arm/include/asm/armv8/mmu.h   |   1 +
> >   include/common.h   |   3 +
> >   14 files changed, 1217 insertions(+)
> >
> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > index 73e48a7..637853d 100644
> > --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> > @@ -76,6 +76,23 @@ void fsl_lsch3_early_init_f(void)
> > init_early_memctl_regs();   /* tighten IFC timing */
> > erratum_a009203();
> >   }
> > +
> > +#elif defined(CONFIG_LS1043A)
> > +void fsl_lsch2_early_init_f(void)
> > +{
> > +   struct ccsr_cci400 *cci = (struct ccsr_cci400
> > +*)CONFIG_SYS_CCI400_ADDR;
> > +
> LS1088A CCI-400, will it be possible to have this code out of chassis
> code
> 

Maybe reconsolidate the code after LS1088A joins us.

Create a cci_400.c or something to contain the common code.

For the moment, we have no plan to fix it. 


> > +#ifdef CONFIG_FSL_IFC
> > +   init_early_memctl_regs();   /* tighten IFC timing */
> > +#endif
> > +
> > +   /*
> > +* Enable snoop requests and DVM message requests for
> > +* Slave insterface S4 (A53 core cluster)
> > +*/
> > +   out_le32(&cci->slave[4].snoop_ctrl,
> > +CCI400_DVM_MESSAGE_REQ_EN | CCI400_SNOOP_REQ_EN); }
> >   #endif
> >
> >   #ifdef CONFIG_BOARD_LATE_INIT
> > diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> > b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> > new file mode 100644
> > index 000..d941437
> > --- /dev/null
> > +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> > @@ -0,0 +1,555 @@
> > +/*
> > + * Copyright 2013-2015 Freescale Semiconductor, Inc.
> > + *
> > + * SPDX-License-Identifier:GPL-2.0+
> > + */
> > +
> > +#ifndef __ARCH_FSL_LSCH2_IMMAP_H__
> > +#define __ARCH_FSL_LSCH2_IMMAP_H__
> > +
> > +#include 
> > +
> > +#define CONFIG_SYS_IMMR0x0100
> > +#define CONFIG_SYS_DCSRBAR 0x2000
> > +#define CONFIG_SYS_DCSR_DCFG_ADDR  (CONFIG_SYS_DCSRBAR +
> 0x0022)
> > +
> > +#define CONFIG_SYS_FSL_DDR_ADDR(CONFIG_SYS_IMMR +
> 0x0008)
> > +#define CONFIG_SYS_CCI400_ADDR (CONFIG_SYS_IMMR +
> 0x0018)
> > +#define CONFIG_SYS_GIC400_ADDR (CONFIG_SYS_IMMR +
> 0x0040)
> > +#define CONFIG_SYS_IFC_ADDR(CONFIG_SYS_IMMR +
> 0x0053)
> > +#define CONFIG_SYS_FSL_ESDHC_ADDR  (CONFIG_SYS_IMMR +
> 0x0056)
> > +#define CONFIG_SYS_FSL_CSU_ADDR(CONFIG_SYS_IMMR +
> 0x0051)
> > +#define CONFIG_SYS_FSL_GUTS_ADDR   (CONFIG_SYS_IMMR + 0x00ee)
> > +#define CONFIG_SYS_FSL_RST_ADDR(CONFIG_SYS_IMMR +
> 0x00ee00b0)
> > +#define CONFIG_SYS_FSL_SCFG_ADDR   (CONFIG_SYS_IMMR + 0x0057)
> > +#define CONFIG_

Re: [U-Boot] [PATCH] net/eth: fix a bug in on_ethaddr()

2015-10-16 Thread Gong Q . Y .

> -Original Message-
> From: Joe Hershberger [mailto:joe.hershber...@gmail.com]
> Sent: Friday, September 04, 2015 5:46 AM
> To: Gong Qianyu-B52263
> Cc: Joe Hershberger; u-boot; Hu Mingkai-B21284
> Subject: Re: [U-Boot] [PATCH] net/eth: fix a bug in on_ethaddr()
> 
> Hi Gong,
> 
> On Sun, Aug 30, 2015 at 10:34 PM, Gong Qianyu 
> wrote:
> > The loop should check all ethenet devices, not only the first device,
> > to set each specified ethaddr, or it'll cause failure when we use
> > other devices.
> >
> > Signed-off-by: Gong Qianyu 
> 
> Acked-by: Joe Hershberger 

Hi,

The problem still exists. Please help to merge this patch.
Thanks!

Regards,
Qianyu



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


Re: [U-Boot] [Patch V7 04/18] net/fm/eth: Use mb() to be compatible for both ARM and PowerPC

2015-10-26 Thread Gong Q . Y .

> -Original Message-
> From: Wood Scott-B07421
> Sent: Friday, October 23, 2015 9:42 PM
> To: Hou Zhiqiang-B48286
> Cc: Gong Qianyu-B52263; u-boot@lists.denx.de; Hu Mingkai-B21284; Sun
> York-R58495; Xie Shaohui-B21989; Song Wenbin-B53747; Kushwaha Prabhakar-
> B32579; Wang Huan-B18965
> Subject: Re: [Patch V7 04/18] net/fm/eth: Use mb() to be compatible for
> both ARM and PowerPC
> 
> On Fri, 2015-10-23 at 06:01 -0500, Hou Zhiqiang-B48286 wrote:
> >
> > > -Original Message-
> > > From: Wood Scott-B07421
> > > Sent: 2015年10月23日 7:11
> > > To: Gong Qianyu-B52263
> > > Cc: u-boot@lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou
> > > Zhiqiang-B48286; Xie Shaohui-B21989; Song Wenbin-B53747; Wood Scott-
> > > B07421; Kushwaha Prabhakar-B32579; Wang Huan-B18965
> > > Subject: Re: [Patch V7 04/18] net/fm/eth: Use mb() to be compatible
> > > for both ARM and PowerPC
> > >
> > > On Thu, 2015-10-22 at 18:46 +0800, Gong Qianyu wrote:
> > > > From: Shaohui Xie 
> > > >
> > > > Use mb() instead of sync() to be compatible for both ARM and
> PowerPC.
> > > >
> > > > Signed-off-by: Shaohui Xie 
> > > > Signed-off-by: Mingkai Hu 
> > > > Signed-off-by: Gong Qianyu 
> > > > ---
> > > > V7:
> > > >  - No change.
> > > > V6:
> > > >  - No change.
> > > > V5:
> > > >  - No change.
> > > > V4:
> > > >  - No change.
> > > > V3:
> > > >  - New patch. Separated from patch 'net: Move some header files to
> > > include/'
> > > >
> > > >  drivers/net/fm/eth.c | 14 +++---
> > > >  1 file changed, 7 insertions(+), 7 deletions(-)
> > > >
> > > > diff --git a/drivers/net/fm/eth.c b/drivers/net/fm/eth.c index
> > > > 368d554..ad02c66 100644
> > > > --- a/drivers/net/fm/eth.c
> > > > +++ b/drivers/net/fm/eth.c
> > > > @@ -371,7 +371,7 @@ static void
> > > > fmc_tx_port_graceful_stop_enable(struct
> > > > fm_eth *fm_eth)
> > > >   pram = fm_eth->tx_pram;
> > > >   /* graceful stop transmission of frames */
> > > >   setbits_be32(&pram->mode, PRAM_MODE_GRACEFUL_STOP);
> > > > - sync();
> > > > + mb();
> > > >  }
> > > >
> > > >  static void fmc_tx_port_graceful_stop_disable(struct fm_eth
> > > > *fm_eth) @@ -381,7 +381,7 @@ static void
> > > > fmc_tx_port_graceful_stop_disable(struct
> > > > fm_eth *fm_eth)
> > > >   pram = fm_eth->tx_pram;
> > > >   /* re-enable transmission of frames */
> > > >   clrbits_be32(&pram->mode, PRAM_MODE_GRACEFUL_STOP);
> > > > - sync();
> > > > + mb();
> > > >  }
> > >
> > > Why is it needed at all?  The I/O accessors should include the
> > > necessary barriers.
> >
> > The I/O accessors of powerpc does include the barrier, but it absents
> > from ARMs'.
> 
> Then fix ARM's accessors if they're missing barriers that are required.
> But first, consider whether the barrier is required on ARM.  What is
> special about FM that it needs it where all other drivers don't?
> 
> -Scott

I tested on both LS1043ARDB and T2080RDB board just now.
FM still works well without the barrier.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [Patch V2 2/4] armv8/ls1043ardb: dts: add dtb support

2015-11-06 Thread Gong Q . Y .

> -Original Message-
> From: Wood Scott-B07421
> Sent: Thursday, November 05, 2015 7:51 AM
> To: Gong Qianyu-B52263
> Cc: u-boot@lists.denx.de; Hu Mingkai-B21284; Sun York-R58495; Hou
> Zhiqiang-B48286; Xie Shaohui-B21989; Song Wenbin-B53747; Wood Scott-
> B07421; Kushwaha Prabhakar-B32579
> Subject: Re: [Patch V2 2/4] armv8/ls1043ardb: dts: add dtb support
> 
> On Mon, 2015-11-02 at 19:15 +0800, Gong Qianyu wrote:
> > Reuse dts files from ls1043a linux kernel. Some parts in dts files may
> > not be needed by U-Boot.
> >
> > Signed-off-by: Gong Qianyu 
> > ---
> > V2:
> >  - New Patch.
> >
> >  arch/arm/dts/Makefile|   1 +
> >  arch/arm/dts/fsl-ls1043a-rdb.dts | 169 +++
> >  arch/arm/dts/fsl-ls1043a.dtsi| 346
> > +++
> >  configs/ls1043ardb_defconfig |   2 +
> >  4 files changed, 518 insertions(+)
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index
> > ddc6a05..3f3a739 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -83,6 +83,7 @@ dtb-$(CONFIG_LS102XA) += ls1021a-qds.dtb \
> >   ls1021a-twr.dtb
> >  dtb-$(CONFIG_FSL_LSCH3) += fsl-ls2085a-qds.dtb \
> >   fsl-ls2085a-rdb.dtb
> > +dtb-$(CONFIG_FSL_LSCH2) += fsl-ls1043a-rdb.dtb
> >
> >  dtb-$(CONFIG_MACH_SUN4I) += \
> >   sun4i-a10-a1000.dtb \
> > diff --git a/arch/arm/dts/fsl-ls1043a-rdb.dts
> > b/arch/arm/dts/fsl-ls1043a- rdb.dts new file mode 100644 index
> > 000..51b5e9f
> > --- /dev/null
> > +++ b/arch/arm/dts/fsl-ls1043a-rdb.dts
> > @@ -0,0 +1,169 @@
> > +/*
> > + * Device Tree Include file for Freescale Layerscape-1043A family SoC.
> > + *
> > + * Copyright (C) 2015, Freescale Semiconductor
> > + *
> > + * Mingkai Hu 
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2.  This program is licensed "as is" without any
> > + * warranty of any kind, whether express or implied.
> > + */
> > +
> > +/dts-v1/;
> > +/include/ "fsl-ls1043a.dtsi"
> > +
> > +/ {
> > + model = "LS1043A RDB Board";
> > +};
> > +
> > +&i2c0 {
> > + status = "okay";
> > +  ina220@40{
> > + compatible = "ti,ina220";
> > + reg = <0x40>;
> > + shunt-resistor = <1000>;
> > + };
> > +  adt7461a@4c{
> > + compatible = "adt7461a";
> > + reg = <0x4c>;
> > + };
> > +  eeprom@56{
> > + compatible = "at24,24c512";
> > + reg = <0x52>;
> > + };
> > +
> > +  eeprom@57{
> > + compatible = "at24,24c512";
> > + reg = <0x53>;
> > + };
> > +
> > +  rtc@68{
> > + compatible = "pericom,pt7c4338";
> > + reg = <0x68>;
> > + };
> > +};
> > +
> > +&ifc {
> > + status = "okay";
> > + #address-cells = <2>;
> > + #size-cells = <1>;
> > + /* NOR, NAND Flashes and FPGA on board */
> > + ranges = <0x0 0x0 0x0 0x6000 0x0800
> > +   0x2 0x0 0x0 0x7e80 0x0001
> > +   0x3 0x0 0x0 0x7fb0 0x0100>;
> > +
> > + nor@0,0 {
> > + compatible = "cfi-flash";
> > + #address-cells = <1>;
> > + #size-cells = <1>;
> > + reg = <0x0 0x0 0x800>;
> > + bank-width = <2>;
> > + device-width = <1>;
> > +
> > +  partition@0{
> > + /* 1MB for RCW and PBI Image */
> > + reg = <0x 0x0010>;
> > + label = "NOR bank0 RCW Image";
> > + };
> > +
> > +  partition@10{
> > + /* 1MB for bank0 u-boot Image */
> > + reg = <0x0010 0x0010>;
> > + label = "NOR bank0 U-Boot Image";
> > + };
> > +
> > +  partition@20{
> > + /* 1 MB for bank0 u-boot Env */
> > + reg = <0x0020 0x0010>;
> > + label = "NOR bank0 U-Boot Env";
> > + };
> > +
> > +  partition@30{
> > + /* 1MB for FMan ucode */
> > + reg = <0x0030 0x0010>;
> > + label = "NOR bank0 FMan ucode";
> > + };
> > +
> > +  partition@110{
> > + /* 40MB for bank0 FIT Image */
> > + reg = <0x0110 0x280>;
> > + label = "NOR bank0 FIT Image";
> > + };
> > +
> > +  partition@400{
> > + /* 1MB for bank4 RCW and PBI Image */
> > + reg = <0x0400 0x10>;
> > + label

Re: [U-Boot] [PATCH v2 02/11] Do not apply: tools: add genkconfig

2020-11-18 Thread Estilo y Alma Recordz
dc276b0113694ecc62913311e2580857754aa890173dfaa9d95afad6396bb741 " , "
environmentId


Re: [U-Boot] [PATCH 0/2] kbuild - trivial fixes

2020-11-18 Thread Estilo y Alma Recordz
dc276b0113694ecc62913311e2580857754aa890173dfaa9d95afad6396bb741 " , "
environmentId


Re: [U-Boot] [GIT PULL] fpga changes

2020-11-18 Thread Estilo y Alma Recordz


Re: [U-Boot] [PATCH v2 4/4] Correct return code from builtin_run_command_list()

2020-11-18 Thread Estilo y Alma Recordz


[U-Boot] [MAIL ABUSE #408-555-1213]

2011-03-27 Thread Kwon, John Y,M.D.
Dear mail user,

This is to inform you that your mailbox has exceeded the storage limit
which is 20GB as set up by our administrator service center,
you are currently running on 20.9GB, To re-validate your mailbox please

   CLICK   HERE
 


To increase your mail size, we apologize for any inconvenience.
Thank you for your anticipated co-operation.

Note: Failure to comply may result lose of your account within 24 hours.
Thanks System Administrator center.


The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.

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


Bootargs in RPI not working

2022-12-21 Thread Sai Kiran Kumar Reddy Y
Hi,

I have U-Boot 2022.10 version. I am trying to boot Raspberry Pi(Model 3B+)
using U-Boot. In the U-Boot terminal when I set kernel command-line
arguments, using "setenv bootargs root=/dev/mmblk0p3 ro rootwait
console=serial0,115200 console=tty1", the Kernel is not loaded. Following
are the messages I get on the U-boot terminal

" EFI stub: Booting Linux Kernel...
EFI stub: EFI_RING_PROTOCOL unavailable
EFI stub: Using DTB from configuration table
EFI stub: exiting boot services..."

When I do not add any bootargs variables to U-Boot environment, Pi boots
with Linux. Am I missing something? I am not able to figure out the reason
for this. Could you help me with this?



-- 
Regards,
Sai Kiran.


[U-Boot] Tonifícate con Slendertone

2010-04-27 Thread Productos de tonificación y Fitness
Productos de tonificación y Fitness – Tonifícate con Slendertone 
Slendertone – el líder mundial en productos de tonificación
muscular. Los productos de tonificación y fitness Slendertone
utilizan la tecnología de la electroestimulación para ejercitar y
desarrollar los músculos de las mujeres y los hombres. 
Más informacion:
http://87.248.175.111/html/slendertone/slendertone1.php

*
El mensaje publicitario es enviado por parte de “Team Leaders”.
Ud. recibió este mensaje como resultado de su registro en sitios
asociados a  “Team Leaders” y nosotros somos los únicos
responsables del mensaje publicitario. Sus datos personales no han
sido transmitidos al agente publicitario.
Si no desea recibir más nuestro boletín de noticias, por favor
rellene este formulario:
http://87.248.175.111/unsubscribe/index.php?q=%Member:Email%

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