[U-Boot] [PATCH 1/3] MSM7630 Interrupt support

2012-05-11 Thread Mohamed Haneef
* Support for msm7630 interrupts

Signed-off-by: Mohamed Haneef mohamed.han...@lntinfotech.com
---
 arch/arm/cpu/armv7/msm7630/Makefile|1 +
 arch/arm/cpu/armv7/msm7630/interrupts.c|  155 +
 arch/arm/include/asm/arch-msm7630/exclusion.h  |   42 ++
 arch/arm/include/asm/arch-msm7630/interrupts.h |   40 ++
 arch/arm/include/asm/arch-msm7630/irqs.h   |  173 
 board/qcom/msm7630_surf/msm7630_surf.c |3 +
 6 files changed, 414 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/msm7630/interrupts.c
 create mode 100644 arch/arm/include/asm/arch-msm7630/exclusion.h
 create mode 100644 arch/arm/include/asm/arch-msm7630/interrupts.h
 create mode 100644 arch/arm/include/asm/arch-msm7630/irqs.h

diff --git a/arch/arm/cpu/armv7/msm7630/Makefile 
b/arch/arm/cpu/armv7/msm7630/Makefile
index b97026f..b106ddc 100644
--- a/arch/arm/cpu/armv7/msm7630/Makefile
+++ b/arch/arm/cpu/armv7/msm7630/Makefile
@@ -40,6 +40,7 @@ COBJS-y   := board.o
 COBJS-y+= timer.o
 COBJS-y+= acpuclock.o
 COBJS-y+= gpio.o
+COBJS-$(CONFIG_USE_IRQ)+= interrupts.o
 
  SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c)
  OBJS  := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
diff --git a/arch/arm/cpu/armv7/msm7630/interrupts.c 
b/arch/arm/cpu/armv7/msm7630/interrupts.c
new file mode 100644
index 000..6cae9c8
--- /dev/null
+++ b/arch/arm/cpu/armv7/msm7630/interrupts.c
@@ -0,0 +1,155 @@
+/*
+ * Copyright (c) 2008, Google Inc.
+ * All rights reserved.
+ *
+ * (C) Copyright 2012
+ * Larsen  Toubro Infotech Ltd. www.lntinfotech.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *  * Neither the name of Google, Inc. nor the names of its contributors
+ *may be used to endorse or promote products derived from this
+ *software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/arch/interrupts.h
+#include asm/arch/irqs.h
+#include asm/arch/iomap.h
+#include asm/arch/exclusion.h
+
+#define VIC_REG(off) (MSM_VIC_BASE + (off))
+
+#define VIC_INT_SELECT0 VIC_REG(0x)/* 1: FIQ, 0: IRQ */
+#define VIC_INT_SELECT1 VIC_REG(0x0004)/* 1: FIQ, 0: IRQ */
+#define VIC_INT_EN0 VIC_REG(0x0010)
+#define VIC_INT_EN1 VIC_REG(0x0014)
+#define VIC_INT_ENCLEAR0VIC_REG(0x0020)
+#define VIC_INT_ENCLEAR1VIC_REG(0x0024)
+#define VIC_INT_ENSET0  VIC_REG(0x0030)
+#define VIC_INT_ENSET1  VIC_REG(0x0034)
+#define VIC_INT_TYPE0   VIC_REG(0x0040)/* 1: EDGE, 0: LEVEL  */
+#define VIC_INT_TYPE1   VIC_REG(0x0044)/* 1: EDGE, 0: LEVEL  */
+#define VIC_INT_POLARITY0   VIC_REG(0x0050)/* 1: NEG, 0: POS */
+#define VIC_INT_POLARITY1   VIC_REG(0x0054)/* 1: NEG, 0: POS */
+#define VIC_NO_PEND_VAL VIC_REG(0x0060)
+#define VIC_INT_MASTERENVIC_REG(0x0068)/* 1: IRQ, 2: FIQ */
+#define VIC_CONFIG  VIC_REG(0x006C)/* 1: USE ARM1136 VIC */
+#define VIC_SECURITY0   VIC_REG(0x0070)
+#define VIC_SECURITY1   VIC_REG(0x0074)
+#define VIC_IRQ_STATUS0 VIC_REG(0x0080)
+#define VIC_IRQ_STATUS1 VIC_REG(0x0084)
+#define VIC_FIQ_STATUS0 VIC_REG(0x0090)
+#define VIC_FIQ_STATUS1 VIC_REG(0x0094)
+#define VIC_RAW_STATUS0 VIC_REG(0x00A0)
+#define VIC_RAW_STATUS1 VIC_REG(0x00A4)
+#define VIC_INT_CLEAR0  VIC_REG(0x00B0)
+#define VIC_INT_CLEAR1  VIC_REG(0x00B4)
+#define VIC_SOFTINT0VIC_REG(0x00C0)
+#define VIC_SOFTINT1VIC_REG(0x00C4)
+#define VIC_IRQ_VEC_RD  VIC_REG(0x00D0)/* pending int # */
+#define VIC_IRQ_VEC_PEND_RD VIC_REG(0x00D4)/* pending vector addr */
+#define 

[U-Boot] [PATCH 0/3] msm7630 usb gadget and emmc support

2012-05-11 Thread Mohamed Haneef
This patch series contains support for usb gadget, enabling eMMC high capacity 
and interrupt support
for msm7630 surf.

Mohamed Haneef (3):
  MSM7630 Interrupt support
  MSM7630 gadget usb support
  board: qcom: enable high capacity eMMC cards

 arch/arm/cpu/armv7/msm7630/Makefile|1 +
 arch/arm/cpu/armv7/msm7630/interrupts.c|  155 +++
 arch/arm/include/asm/arch-msm7630/exclusion.h  |   42 ++
 arch/arm/include/asm/arch-msm7630/hsusb.h  |  182 
 arch/arm/include/asm/arch-msm7630/interrupts.h |   40 ++
 arch/arm/include/asm/arch-msm7630/irqs.h   |  173 
 board/qcom/msm7630_surf/msm7630_surf.c |5 +-
 drivers/serial/usbtty.h|2 +
 drivers/usb/gadget/Makefile|1 +
 drivers/usb/gadget/msm_udc.c   |  560 
 include/configs/msm7630_surf.h |   12 +-
 include/usb/msm_udc.h  |   46 ++
 12 files changed, 1215 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/msm7630/interrupts.c
 create mode 100644 arch/arm/include/asm/arch-msm7630/exclusion.h
 create mode 100644 arch/arm/include/asm/arch-msm7630/hsusb.h
 create mode 100644 arch/arm/include/asm/arch-msm7630/interrupts.h
 create mode 100644 arch/arm/include/asm/arch-msm7630/irqs.h
 create mode 100644 drivers/usb/gadget/msm_udc.c
 create mode 100644 include/usb/msm_udc.h

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


[U-Boot] [PATCH 3/3] board: qcom: enable high capacity eMMC cards

2012-05-11 Thread Mohamed Haneef
* enabling high capacity eMMC cards.

Signed-off-by: Mohamed Haneef mohamed.han...@lntinfotech.com
---
 board/qcom/msm7630_surf/msm7630_surf.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/board/qcom/msm7630_surf/msm7630_surf.c 
b/board/qcom/msm7630_surf/msm7630_surf.c
index 9dcf95b..9ca6843 100644
--- a/board/qcom/msm7630_surf/msm7630_surf.c
+++ b/board/qcom/msm7630_surf/msm7630_surf.c
@@ -147,7 +147,7 @@ int board_mmc_init(bd_t *bis)
mmc_2-init = qc_board_mmc_init;
mmc_2-voltages = MMC_VDD_29_30|MMC_VDD_165_195;
mmc_2-host_caps = MMC_MODE_4BIT|MMC_MODE_HS|MMC_MODE_8BIT|
-   MMC_MODE_HS_52MHz;
+   MMC_MODE_HS_52MHz|MMC_MODE_HC;
mmc_2-f_min = MMC_CLK_400KHZ;
mmc_2-f_max = MMC_CLK_48MHZ;
sprintf(mmc_2-name, Internal_Card);
-- 
1.7.1

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


[U-Boot] [PATCH 2/3] MSM7630 gadget usb support

2012-05-11 Thread Mohamed Haneef
* Support for usb gadget device.

Signed-off-by: Mohamed Haneef mohamed.han...@lntinfotech.com
---
 arch/arm/include/asm/arch-msm7630/hsusb.h |  182 ++
 drivers/serial/usbtty.h   |2 +
 drivers/usb/gadget/Makefile   |1 +
 drivers/usb/gadget/msm_udc.c  |  560 +
 include/configs/msm7630_surf.h|   12 +-
 include/usb/msm_udc.h |   46 +++
 6 files changed, 800 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-msm7630/hsusb.h
 create mode 100644 drivers/usb/gadget/msm_udc.c
 create mode 100644 include/usb/msm_udc.h

diff --git a/arch/arm/include/asm/arch-msm7630/hsusb.h 
b/arch/arm/include/asm/arch-msm7630/hsusb.h
new file mode 100644
index 000..a20f907
--- /dev/null
+++ b/arch/arm/include/asm/arch-msm7630/hsusb.h
@@ -0,0 +1,182 @@
+/*
+ * Copyright (c) 2008, Google Inc.
+ * All rights reserved.
+ *
+ * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
+ * (C) Copyright 2012
+ * Larsen  Toubro Infotech Ltd. www.lntinfotech.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _HSUSB_H_
+#define _HSUSB_H_
+
+#include asm/arch/iomap.h
+
+#ifndef MSM_USB_BASE
+#error Must define base address of USB controller MSM_USB_BASE
+#endif
+
+#define USB_ID   (MSM_USB_BASE + 0x)
+#define USB_HWGENERAL(MSM_USB_BASE + 0x0004)
+#define USB_HWHOST   (MSM_USB_BASE + 0x0008)
+#define USB_HWDEVICE (MSM_USB_BASE + 0x000C)
+#define USB_HWTXBUF  (MSM_USB_BASE + 0x0010)
+#define USB_HWRXBUF  (MSM_USB_BASE + 0x0014)
+#define USB_SBUSCFG  (MSM_USB_BASE + 0x0090)
+
+#define USB_AHB_BURST(MSM_USB_BASE + 0x0090)
+#define USB_AHB_MODE (MSM_USB_BASE + 0x0098)
+#define USB_CAPLENGTH(MSM_USB_BASE + 0x0100) /* 8 bit */
+#define USB_HCIVERSION   (MSM_USB_BASE + 0x0102) /* 16 bit */
+#define USB_HCSPARAMS(MSM_USB_BASE + 0x0104)
+#define USB_HCCPARAMS(MSM_USB_BASE + 0x0108)
+#define USB_DCIVERSION   (MSM_USB_BASE + 0x0120)   /* 16 bit */
+#define USB_USBCMD   (MSM_USB_BASE + 0x0140)
+#define USB_USBSTS   (MSM_USB_BASE + 0x0144)
+#define USB_USBINTR  (MSM_USB_BASE + 0x0148)
+#define USB_FRINDEX  (MSM_USB_BASE + 0x014C)
+#define USB_DEVICEADDR   (MSM_USB_BASE + 0x0154)
+#define USB_ENDPOINTLISTADDR (MSM_USB_BASE + 0x0158)
+#define USB_BURSTSIZE(MSM_USB_BASE + 0x0160)
+#define USB_TXFILLTUNING (MSM_USB_BASE + 0x0164)
+#define USB_ULPI_VIEWPORT(MSM_USB_BASE + 0x0170)
+#define USB_ENDPTNAK (MSM_USB_BASE + 0x0178)
+#define USB_ENDPTNAKEN   (MSM_USB_BASE + 0x017C)
+#define USB_PORTSC   (MSM_USB_BASE + 0x0184)
+#define USB_OTGSC(MSM_USB_BASE + 0x01A4)
+#define USB_USBMODE  (MSM_USB_BASE + 0x01A8)
+#define USB_ENDPTSETUPSTAT   (MSM_USB_BASE + 0x01AC)
+#define USB_ENDPTPRIME   (MSM_USB_BASE + 0x01B0)
+#define USB_ENDPTFLUSH   (MSM_USB_BASE + 0x01B4)
+#define USB_ENDPTSTAT(MSM_USB_BASE + 0x01B8)
+#define USB_ENDPTCOMPLETE(MSM_USB_BASE + 0x01BC)
+#define USB_ENDPTCTRL(n) (MSM_USB_BASE + 0x01C0 + (4 * (n)))
+
+#define USBCMD_RESET   2
+#define USBCMD_ATTACH  1
+
+#define USBMODE_DEVICE 2
+#define USBMODE_HOST   3
+
+
+/* Endpoint Txfer Descriptor dTD as defined by DC */
+struct ept_queue_item {
+   struct ept_queue_item *next;
+#define UDC_DTD_TOTAL_BYTES(info) (((info)  16)  0x7FFF)
+   unsigned info; /* 30:16-Total Bytes,7:0-Status */
+   unsigned page0;
+   unsigned page1;
+   unsigned page2;
+   unsigned page3;
+   unsigned page4;
+   unsigned reserved;
+};
+

[U-Boot] [PATCH 0/2] This patch series contains support for interrupt and USB gadget in MSM7x27a surf board

2012-05-11 Thread Srikanth Reddy Vintha
Srikanth Reddy Vintha (2):
  MSM7x27a:Add support for interrupt
  MSM7x27a:Add support for USB gadget

 arch/arm/cpu/armv7/msm7x27a/Makefile|1 +
 arch/arm/cpu/armv7/msm7x27a/acpuclock.c |7 +
 arch/arm/cpu/armv7/msm7x27a/interrupts.c|  136 +
 arch/arm/include/asm/arch-msm7x27a/exclusion.h  |   42 +
 arch/arm/include/asm/arch-msm7x27a/hsusb.h  |  183 +++
 arch/arm/include/asm/arch-msm7x27a/interrupts.h |   39 +
 arch/arm/include/asm/arch-msm7x27a/iomap.h  |2 +
 arch/arm/include/asm/arch-msm7x27a/irqs.h   |   98 
 board/qcom/msm7x27a_surf/msm7x27a_surf.c|2 +
 drivers/usb/gadget/msm_udc.c|   11 +-
 include/configs/msm7x27a_surf.h |   14 +-
 11 files changed, 524 insertions(+), 11 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/msm7x27a/interrupts.c
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/exclusion.h
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/hsusb.h
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/interrupts.h
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/irqs.h

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


[U-Boot] [PATCH 1/2] MSM7x27a:Add support for interrupt

2012-05-11 Thread Srikanth Reddy Vintha
* support for msm7x27a interrupt

Signed-off-by: Srikanth Reddy Vintha srikanth.re...@lntinfotech.com
---
 arch/arm/cpu/armv7/msm7x27a/Makefile|1 +
 arch/arm/cpu/armv7/msm7x27a/interrupts.c|  136 +++
 arch/arm/include/asm/arch-msm7x27a/exclusion.h  |   42 +++
 arch/arm/include/asm/arch-msm7x27a/interrupts.h |   39 +++
 arch/arm/include/asm/arch-msm7x27a/irqs.h   |   98 
 board/qcom/msm7x27a_surf/msm7x27a_surf.c|2 +
 include/configs/msm7x27a_surf.h |2 +-
 7 files changed, 319 insertions(+), 1 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/msm7x27a/interrupts.c
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/exclusion.h
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/interrupts.h
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/irqs.h

diff --git a/arch/arm/cpu/armv7/msm7x27a/Makefile 
b/arch/arm/cpu/armv7/msm7x27a/Makefile
index 5f493d7..19e7546 100644
--- a/arch/arm/cpu/armv7/msm7x27a/Makefile
+++ b/arch/arm/cpu/armv7/msm7x27a/Makefile
@@ -34,6 +34,7 @@ COBJS-y   := board.o
 COBJS-y+= timer.o
 COBJS-y+= acpuclock.o
 COBJS-y+= gpio.o
+COBJS-$(CONFIG_USE_IRQ)+= interrupts.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
diff --git a/arch/arm/cpu/armv7/msm7x27a/interrupts.c 
b/arch/arm/cpu/armv7/msm7x27a/interrupts.c
new file mode 100644
index 000..cc45c4b
--- /dev/null
+++ b/arch/arm/cpu/armv7/msm7x27a/interrupts.c
@@ -0,0 +1,136 @@
+/*
+ * Copyright (c) 2008, Google Inc.
+ * All rights reserved.
+ *
+ * (C) Copyright 2012
+ * Larsen  Toubro Infotech Ltd. www.lntinfotech.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *  * Neither the name of Google, Inc. nor the names of its contributors
+ * may be used to endorse or promote products derived from this
+ * software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/arch/interrupts.h
+#include asm/arch/irqs.h
+#include asm/arch/iomap.h
+#include asm/arch/exclusion.h
+
+#define VIC_REG(off) (MSM_VIC_BASE + (off))
+
+#define VIC_INT_SELECT0 VIC_REG(0x)  /* 1: FIQ, 0: IRQ */
+#define VIC_INT_SELECT1 VIC_REG(0x0004)  /* 1: FIQ, 0: IRQ */
+#define VIC_INT_EN0 VIC_REG(0x0010)
+#define VIC_INT_EN1 VIC_REG(0x0014)
+#define VIC_INT_ENCLEAR0   VIC_REG(0x0020)
+#define VIC_INT_ENCLEAR1   VIC_REG(0x0024)
+#define VIC_INT_ENSET0   VIC_REG(0x0030)
+#define VIC_INT_ENSET1   VIC_REG(0x0034)
+#define VIC_INT_TYPE0 VIC_REG(0x0040)  /* 1: EDGE, 0: LEVEL  */
+#define VIC_INT_TYPE1 VIC_REG(0x0044)  /* 1: EDGE, 0: LEVEL  */
+#define VIC_INT_POLARITY0   VIC_REG(0x0050)  /* 1: NEG, 0: POS */
+#define VIC_INT_POLARITY1   VIC_REG(0x0054)  /* 1: NEG, 0: POS */
+#define VIC_NO_PEND_VAL VIC_REG(0x0060)
+#define VIC_INT_MASTEREN   VIC_REG(0x0064)  /* 1: IRQ, 2: FIQ   */
+#define VIC_PROTECTION   VIC_REG(0x006C)  /* 1: ENABLE   */
+#define VIC_CONFIG   VIC_REG(0x0068)  /* 1: USE ARM1136 VIC */
+#define VIC_IRQ_STATUS0 VIC_REG(0x0080)
+#define VIC_IRQ_STATUS1 VIC_REG(0x0084)
+#define VIC_FIQ_STATUS0 VIC_REG(0x0090)
+#define VIC_FIQ_STATUS1 VIC_REG(0x0094)
+#define VIC_RAW_STATUS0 VIC_REG(0x00A0)
+#define VIC_RAW_STATUS1 VIC_REG(0x00A4)
+#define VIC_INT_CLEAR0   VIC_REG(0x00B0)
+#define VIC_INT_CLEAR1   VIC_REG(0x00B4)
+#define VIC_SOFTINT0   VIC_REG(0x00C0)
+#define VIC_SOFTINT1   VIC_REG(0x00C4)
+#define VIC_IRQ_VEC_RD   VIC_REG(0x00D0)  /* pending int # */
+#define 

[U-Boot] [PATCH 2/2] MSM7x27a:Add support for USB gadget

2012-05-11 Thread Srikanth Reddy Vintha
* USB gadget support

Signed-off-by: Srikanth Reddy Vintha srikanth.re...@lntinfotech.com
---
 arch/arm/cpu/armv7/msm7x27a/acpuclock.c|7 +
 arch/arm/include/asm/arch-msm7x27a/hsusb.h |  183 
 arch/arm/include/asm/arch-msm7x27a/iomap.h |2 +
 drivers/usb/gadget/msm_udc.c   |   11 +-
 include/configs/msm7x27a_surf.h|   12 +-
 5 files changed, 205 insertions(+), 10 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-msm7x27a/hsusb.h

diff --git a/arch/arm/cpu/armv7/msm7x27a/acpuclock.c 
b/arch/arm/cpu/armv7/msm7x27a/acpuclock.c
index 7f46d18..ae9db0d 100644
--- a/arch/arm/cpu/armv7/msm7x27a/acpuclock.c
+++ b/arch/arm/cpu/armv7/msm7x27a/acpuclock.c
@@ -220,6 +220,13 @@ void acpu_clock_init(void)
}
 }
 
+void hsusb_clock_init(void)
+{
+   /* USB local clock control not enabled; use proc comm */
+   usb_clock_init();
+}
+
+
 #ifdef CONFIG_QC_MMC
 /* Configure MMC clock */
 void clock_config_mmc(uint32_t interface, uint32_t freq)
diff --git a/arch/arm/include/asm/arch-msm7x27a/hsusb.h 
b/arch/arm/include/asm/arch-msm7x27a/hsusb.h
new file mode 100644
index 000..0a8f853
--- /dev/null
+++ b/arch/arm/include/asm/arch-msm7x27a/hsusb.h
@@ -0,0 +1,183 @@
+/*
+ * Copyright (c) 2008, Google Inc.
+ * All rights reserved.
+ *
+ * Copyright (c) 2009-2010, Code Aurora Forum. All rights reserved.
+ *
+ * (C) Copyright 2012
+ * Larsen  Toubro Infotech Ltd. www.lntinfotech.com
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *  * Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ *  * Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in
+ *the documentation and/or other materials provided with the
+ *distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef _HSUSB_H_
+#define _HSUSB_H_
+
+#include asm/arch/iomap.h
+
+#ifndef MSM_USB_BASE
+#error Must define base address for USB controller MSM_USB_BASE
+#endif
+
+#define USB_ID   (MSM_USB_BASE + 0x)
+#define USB_HWGENERAL(MSM_USB_BASE + 0x0004)
+#define USB_HWHOST   (MSM_USB_BASE + 0x0008)
+#define USB_HWDEVICE (MSM_USB_BASE + 0x000C)
+#define USB_HWTXBUF  (MSM_USB_BASE + 0x0010)
+#define USB_HWRXBUF  (MSM_USB_BASE + 0x0014)
+#define USB_SBUSCFG  (MSM_USB_BASE + 0x0090)
+
+#define USB_AHB_BURST(MSM_USB_BASE + 0x0090)
+#define USB_AHB_MODE (MSM_USB_BASE + 0x0098)
+#define USB_CAPLENGTH(MSM_USB_BASE + 0x0100) /* 8 bit */
+#define USB_HCIVERSION   (MSM_USB_BASE + 0x0102) /* 16 bit */
+#define USB_HCSPARAMS(MSM_USB_BASE + 0x0104)
+#define USB_HCCPARAMS(MSM_USB_BASE + 0x0108)
+#define USB_DCIVERSION   (MSM_USB_BASE + 0x0120) /* 16 bit */
+#define USB_USBCMD   (MSM_USB_BASE + 0x0140)
+#define USB_USBSTS   (MSM_USB_BASE + 0x0144)
+#define USB_USBINTR  (MSM_USB_BASE + 0x0148)
+#define USB_FRINDEX  (MSM_USB_BASE + 0x014C)
+#define USB_DEVICEADDR   (MSM_USB_BASE + 0x0154)
+#define USB_ENDPOINTLISTADDR (MSM_USB_BASE + 0x0158)
+#define USB_BURSTSIZE(MSM_USB_BASE + 0x0160)
+#define USB_TXFILLTUNING (MSM_USB_BASE + 0x0164)
+#define USB_ULPI_VIEWPORT(MSM_USB_BASE + 0x0170)
+#define USB_ENDPTNAK (MSM_USB_BASE + 0x0178)
+#define USB_ENDPTNAKEN   (MSM_USB_BASE + 0x017C)
+#define USB_PORTSC   (MSM_USB_BASE + 0x0184)
+#define USB_OTGSC(MSM_USB_BASE + 0x01A4)
+#define USB_USBMODE  (MSM_USB_BASE + 0x01A8)
+#define USB_ENDPTSETUPSTAT   (MSM_USB_BASE + 0x01AC)
+#define USB_ENDPTPRIME   (MSM_USB_BASE + 0x01B0)
+#define USB_ENDPTFLUSH   (MSM_USB_BASE + 0x01B4)
+#define USB_ENDPTSTAT(MSM_USB_BASE + 0x01B8)
+#define USB_ENDPTCOMPLETE(MSM_USB_BASE + 0x01BC)
+#define USB_ENDPTCTRL(n) (MSM_USB_BASE + 0x01C0 + (4 * (n)))
+
+
+#define USBCMD_RESET   2
+#define USBCMD_ATTACH  1
+
+#define USBMODE_DEVICE 2
+#define USBMODE_HOST   3
+
+/* Endpoint 

[U-Boot] [PATCH] Ignore all Carriage Returns when importing an environment.

2012-05-11 Thread Alexander Holler
This is used for compatibility with text files which are
using CRLF instead of LF as the end of a line.

Signed-off-by: Alexander Holler hol...@ahsoftware.de
---
 lib/hashtable.c |   18 +++---
 1 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/lib/hashtable.c b/lib/hashtable.c
index abd61c8..6e146ce 100644
--- a/lib/hashtable.c
+++ b/lib/hashtable.c
@@ -623,9 +623,9 @@ ssize_t hexport_r(struct hsearch_data *htab, const char sep,
  * (entries separated by newline characters).
  *
  * To allow for nicely formatted text input, leading white space
- * (sequences of SPACE and TAB chars) is ignored, and entries starting
- * (after removal of any leading white space) with a '#' character are
- * considered comments and ignored.
+ * (sequences of SPACE and TAB chars) is ignored, all Carriage Returns
+ * are ignored and entries starting (after removal of any leading white
+ * space) with a '#' character are considered comments and ignored.
  *
  * [NOTE: this means that a variable name cannot start with a '#'
  * character.]
@@ -642,6 +642,7 @@ int himport_r(struct hsearch_data *htab,
  const char *env, size_t size, const char sep, int flag)
 {
char *data, *sp, *dp, *name, *value;
+   unsigned ignored_crs;
 
/* Test for correct arguments.  */
if (htab == NULL) {
@@ -698,6 +699,17 @@ int himport_r(struct hsearch_data *htab,
}
}
 
+   /* Remove all Carriage Returns */
+   ignored_crs = 0;
+   for(;dp  data + size  *dp; ++dp) {
+   if( *dp == '\r' )
+   ++ignored_crs;
+   else if(ignored_crs)
+   *(dp-ignored_crs) = *dp;
+   }
+   size -= ignored_crs;
+   dp = data;
+
/* Parse environment; allow for '\0' and 'sep' as separators */
do {
ENTRY e, *rv;
-- 
1.7.3.4

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


Re: [U-Boot] [PATCH 1/3] mx53: Change IPU_CTRL_BASE_ADDR definition

2012-05-11 Thread Stefano Babic
On 11/05/2012 03:07, Fabio Estevam wrote:
 From: Fabio Estevam fabio.este...@freescale.com
 
 The original definition of IPU_CTRL_BASE_ADDR does match the value stated
 in the MX53 Reference Manual.
 
 However, if using such value the IPU driver hangs when trying to access the 
 IPU registers.
 
 Looking for this definition in Freescale U-boot version shows that it is set 
 as 0.
 
 Set it as 0 here as well, so that we can have a working IPU driver for mx53.
 
 Signed-off-by: Fabio Estevam fabio.este...@freescale.com
 ---


Hi Fabio,

  arch/arm/include/asm/arch-mx5/imx-regs.h |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/arch/arm/include/asm/arch-mx5/imx-regs.h 
 b/arch/arm/include/asm/arch-mx5/imx-regs.h
 index cef4190..171c4ab 100644
 --- a/arch/arm/include/asm/arch-mx5/imx-regs.h
 +++ b/arch/arm/include/asm/arch-mx5/imx-regs.h
 @@ -34,7 +34,7 @@
  #define NFC_BASE_ADDR_AXI   0xCFFF
  #define CS1_BASE_ADDR   0xB800
  #elif defined(CONFIG_MX53)
 -#define IPU_CTRL_BASE_ADDR  0x1800
 +#define IPU_CTRL_BASE_ADDR  0x
  #define SPBA0_BASE_ADDR 0x5000
  #define AIPS1_BASE_ADDR 0x53F0
  #define AIPS2_BASE_ADDR 0x63F0

Apart of the fact that it works, this chane appears really strange to
me. Maybe now it is not writing anymore in ipu, and the default values
are ok for mx53. It seems more a MX53 related issu in IPU3 driver, and
this change maybe hides the real problem. Do you have any additional
information to make this modification against the official Freescale's
reference manual ?

Regards,
Stefano

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


Re: [U-Boot] Unable to use USB Keyboard on u-boot

2012-05-11 Thread Marek Vasut
Dear Atul Kumar,

 Dear Marek,
 
  I am tring to bring up USB Keyboard on u-boot with Beagle_board
 xM ver B..  found number of post,but the stack is already updated one..
 I am able to find the info of the connected device but some how keyboard
 does not works..  can you suggest/guide me were i am making mistake or
 where I need to do some device specific changes..
 

Please always CC the U-Boot mailing list (CCed).

Did you try running coninfo after the usb reset/usb start? What does it 
output, do you see usbkbd there? Wild guess would be to run setenv stdin 
usbkbd or something after you do usb reset.

 *logs for usb start*
 
 OMAP3 beagleboard.org #
 
 usb start
 
 (Re)start USB...
 
 USB: Initializing OMAP EHCI
 
 OMAP UHH_REV
 
 ISION 0x10
 
 OMAP EHCI init done
 
 Register 1313 NbrPorts 3
 
 USB EHCI 1.00
 
 scanning bus for devices...
 
 4 USB Device(s) found
 
 USB KBD: found set protocol...
 
 USB KBD: found set idle...
 
 USB
 
 KBD: enable interrupt pipe...
 
 USB KBD: found set up device.
 
 USB KBD: register.
 
 usb_kbd_dev.name- usbkbd
 
 before stdio register
 
 clone _dev-name-usbkbd,dev-name-usbkbd
 
 in stdio register,usb_kbd_dev.name- usbkbd
 
 After stdio register
 
 before strcmp
 
 stdin name- *serial*
 
 scan end
 
 scanning bus for storage devices... 0 Storage Device(s) found
 
 scanning bus for ethernet devices... Warning: failed to set MAC address
 
 1 Ethernet Device(s) found
 
 OMAP3 beagleboard.org #
 
 *logs for usb info*
 
 OMAP3 beagleboard.org #
 
 usb info
 
 1: Hub, USB Revision 2.0
 
 - u-boot EHCI Host Controller
 
 - Class: Hub
 
 - PacketSize: 64 Configurations: 1
 
 -
 
 Vendor: 0x Product 0x Version 1.0
 
 Configuration: 1
 
 - Interfaces: 1 Self Powered 0mA
 
 Interface: 0
 
 - Alternate Setting 0, Endpoints: 1
 
 - Class Hub
 
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms
 
 2: Hub, USB Revision 2.0
 
 - Class: Hub
 
 - PacketSize: 64 Configurations: 1
 
 - Vendor: 0x0424 Product 0x9514 Version 2.0
 
 Configuration: 1
 
 - Interfaces: 1 Self Powered Remote Wakeup 2mA
 
 Interface: 0
 
 - Alternate Setting 0, Endpoints: 1
 
 - Class Hub
 
 - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
 
 - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
 
 3: Vendor specific, USB Revision 2.0
 
 - Class: Vendor specific
 
 - PacketSize: 64 Configurations: 1
 
 - Vendor: 0x0424 Product 0xec00 Version 2.0
 
 Configuration: 1
 
 - Interfaces: 1 Self Powered Remote Wakeup 2mA
 
 Interface: 0
 
 - Alternate Setting 0, Endpoints: 3
 
 - Class Vendor specific
 
 - Endpoint 1 In Bulk MaxPacket 512
 
 - Endpoint 2 Out Bulk MaxPacket 512
 
 - Endpoint 3 In Interrupt MaxPacket 16 Interval 4ms
 
 4: Human Interface, USB Revision 1.10
 
 - LITEON Technology USB Multimedia Keyboard
 
 - Class: (from Interface) Human Interface
 
 - PacketSize: 8 Configurations: 1
 
 - Vendor: 0x046d Product 0xc312 Version 1.1
 
 Configuration: 1
 
 - Interfaces: 1 Bus Powered Remote Wakeup 70mA
 
 Interface: 0
 
 - Alternate Setting 0, Endpoints: 1
 
 - Class Human Interface, Subclass: Boot Keyboard
 
 - Endpoint 1 In Interrupt MaxPacket 8 Interval 24ms
 
 OMAP3 beagleboard.org #
 
 
 
 Thanks  Regards
 Atul Kumar
 9845495793
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Unable to use USB Keyboard on u-boot

2012-05-11 Thread Marek Vasut
Dear Atul Kumar,

Please CC the mailing list, always.

 Dear Marek,
 
  Thanks for your attention.. After doing coninfo, i get below
 msg..
 
 OMAP3 beagleboard.org #
 
 coninfo
 
 List of available devices:
 
 serial 8003 SIO stdin stdout stderr
 
 usbtty 0
 
 003 .IO
 
 usbkbd 8001 SI.
 
 OMAP3 beagleboard.org #
 
 tried to do setenv...
 
  OMAP3 beagleboard.org #
 
 setenv stdin usbkbd

All right, maybe you should fix your method of pasting u-boot output, you have 
every second line blank and a few linebreaks here and there, randomly. It'd be 
cool to fix it, it'd make it much easier to read. Can you do something about it 
please?
 
 OMAP3 beagleboard.org #
 
 After doing this my terminal does not prints any logs but i am able to type
 on console..

You mean with the keyboard? Because setenv stdin usbkbd tells the system to 
read input from the USB keyboard.

 Once when i reboot the board again the logs starts coming up..

Ah ... so you got no console output. Try typing on the usb keyboard. If you 
change stdin to usbkbd, you'd only be able to type with the USB keyboard, it 
won't pick input from the UART/serial port or whatever other source you use.

 
 I see on *stdin name- *serial**  .. if instead of serial *usbkbd* is
 there it will be able to register the kbd..
 
 I tried this another way but do not find any change in pri ..

Pri?
[...]

btw it's a good practice in the mailing list to not top-post (aka reply under 
the email you're replying to). But if you comment on stuff, you can do it in 
the 
middle of the email (just like I did with this one) to better identify what 
you're replying to.

 
 Thanks  Regards
 Atul Kumar
 9845495793
 
 On Fri, May 11, 2012 at 4:25 PM, Marek Vasut ma...@denx.de wrote:
  Dear Atul Kumar,
  
   Dear Marek,
   
I am tring to bring up USB Keyboard on u-boot with
Beagle_board
   
   xM ver B..  found number of post,but the stack is already updated
   one.. I am able to find the info of the connected device but some how
   keyboard does not works..  can you suggest/guide me were i am making
   mistake or where I need to do some device specific changes..
  
  Please always CC the U-Boot mailing list (CCed).
  
  Did you try running coninfo after the usb reset/usb start? What
  does it
  output, do you see usbkbd there? Wild guess would be to run setenv
  stdin usbkbd or something after you do usb reset.
  
   *logs for usb start*
   
   OMAP3 beagleboard.org #
   
   usb start
   
   (Re)start USB...
   
   USB: Initializing OMAP EHCI
   
   OMAP UHH_REV
   
   ISION 0x10
   
   OMAP EHCI init done
   
   Register 1313 NbrPorts 3
   
   USB EHCI 1.00
   
   scanning bus for devices...
   
   4 USB Device(s) found
   
   USB KBD: found set protocol...
   
   USB KBD: found set idle...
   
   USB
   
   KBD: enable interrupt pipe...
   
   USB KBD: found set up device.
   
   USB KBD: register.
   
   usb_kbd_dev.name- usbkbd
   
   before stdio register
   
   clone _dev-name-usbkbd,dev-name-usbkbd
   
   in stdio register,usb_kbd_dev.name- usbkbd
   
   After stdio register
   
   before strcmp
   
   stdin name- *serial*
   
   scan end
   
   scanning bus for storage devices... 0 Storage Device(s) found
   
   scanning bus for ethernet devices... Warning: failed to set MAC address
   
   1 Ethernet Device(s) found
   
   OMAP3 beagleboard.org #
   
   *logs for usb info*
   
   OMAP3 beagleboard.org #
   
   usb info
   
   1: Hub, USB Revision 2.0
   
   - u-boot EHCI Host Controller
   
   - Class: Hub
   
   - PacketSize: 64 Configurations: 1
   
   -
   
   Vendor: 0x Product 0x Version 1.0
   
   Configuration: 1
   
   - Interfaces: 1 Self Powered 0mA
   
   Interface: 0
   
   - Alternate Setting 0, Endpoints: 1
   
   - Class Hub
   
   - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms
   
   2: Hub, USB Revision 2.0
   
   - Class: Hub
   
   - PacketSize: 64 Configurations: 1
   
   - Vendor: 0x0424 Product 0x9514 Version 2.0
   
   Configuration: 1
   
   - Interfaces: 1 Self Powered Remote Wakeup 2mA
   
   Interface: 0
   
   - Alternate Setting 0, Endpoints: 1
   
   - Class Hub
   
   - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
   
   - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
   
   3: Vendor specific, USB Revision 2.0
   
   - Class: Vendor specific
   
   - PacketSize: 64 Configurations: 1
   
   - Vendor: 0x0424 Product 0xec00 Version 2.0
   
   Configuration: 1
   
   - Interfaces: 1 Self Powered Remote Wakeup 2mA
   
   Interface: 0
   
   - Alternate Setting 0, Endpoints: 3
   
   - Class Vendor specific
   
   - Endpoint 1 In Bulk MaxPacket 512
   
   - Endpoint 2 Out Bulk MaxPacket 512
   
   - Endpoint 3 In Interrupt MaxPacket 16 Interval 4ms
   
   4: Human Interface, USB Revision 1.10
   
   - LITEON Technology USB Multimedia Keyboard
   
   - Class: (from Interface) Human Interface
   
   - PacketSize: 8 Configurations: 1
   
   - Vendor: 0x046d Product 0xc312 Version 

Re: [U-Boot] [PATCH 1/2] mx28evk: extend default environment

2012-05-11 Thread Otavio Salvador
On Thu, May 10, 2012 at 2:23 PM, Marek Vasut ma...@denx.de wrote:
 Dear Fabio Estevam,

 From: Otavio Salvador ota...@ossystems.com.br

 The environment has been based on mx53loco but keeping the possibility
 to easy change the default console device as Freescale and mainline
 kernels differ on the device name.

 Signed-off-by: Otavio Salvador ota...@ossystems.com.br
 Cc: Fabio Estevam fabio.este...@freescale.com
 Cc: Stefano Babic sba...@denx.de

 Can we possibly unify it with what's already in m28evk? Also, it'd be cool if 
 we
 had some default -- very generic -- env. Can we go in that direction?

I have prepared a set of commits in this direction. Please take a look at:

https://github.com/otavio/u-boot/commit/5745dfbfa1bd69b23c73dc3d2b2c2932c338e750
https://github.com/otavio/u-boot/commit/d8b1ea575177038f6e37f28563f00c9260016ac9

Is that what you expect? I want to put sdcard based update commands
before sending it for merging.


-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mx28evk: extend default environment

2012-05-11 Thread Otavio Salvador
On Fri, May 11, 2012 at 10:54 AM, Otavio Salvador
ota...@ossystems.com.br wrote:
 Can we possibly unify it with what's already in m28evk? Also, it'd be cool 
 if we
 had some default -- very generic -- env. Can we go in that direction?

 I have prepared a set of commits in this direction. Please take a look at:

 https://github.com/otavio/u-boot/commit/5745dfbfa1bd69b23c73dc3d2b2c2932c338e750
 https://github.com/otavio/u-boot/commit/d8b1ea575177038f6e37f28563f00c9260016ac9

 Is that what you expect? I want to put sdcard based update commands
 before sending it for merging.

Fabio has pointed a example for me of 'magnesium' board config. Is it
what you expect? it does make sense for me to make a common header
file for both boards and others that might come later.

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] mx28evk: extend default environment

2012-05-11 Thread Marek Vasut
Dear Otavio Salvador,

 On Fri, May 11, 2012 at 10:54 AM, Otavio Salvador
 
 ota...@ossystems.com.br wrote:
  Can we possibly unify it with what's already in m28evk? Also, it'd be
  cool if we had some default -- very generic -- env. Can we go in that
  direction?
  
  I have prepared a set of commits in this direction. Please take a look
  at:
  
  https://github.com/otavio/u-boot/commit/5745dfbfa1bd69b23c73dc3d2b2c2932c
  338e750
  https://github.com/otavio/u-boot/commit/d8b1ea575177038f6e37f28563f00c92
  60016ac9
  
  Is that what you expect? I want to put sdcard based update commands
  before sending it for merging.
 
 Fabio has pointed a example for me of 'magnesium' board config. Is it
 what you expect? it does make sense for me to make a common header
 file for both boards and others that might come later.

Something like that, but you're missing update_sd_firmware ;-)

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


Re: [U-Boot] [PATCH 1/2] mx28evk: extend default environment

2012-05-11 Thread Stefano Babic
On 11/05/2012 16:10, Otavio Salvador wrote:
 On Fri, May 11, 2012 at 10:54 AM, Otavio Salvador
 ota...@ossystems.com.br wrote:
 Can we possibly unify it with what's already in m28evk? Also, it'd be cool 
 if we
 had some default -- very generic -- env. Can we go in that direction?

 I have prepared a set of commits in this direction. Please take a look at:

 https://github.com/otavio/u-boot/commit/5745dfbfa1bd69b23c73dc3d2b2c2932c338e750
 https://github.com/otavio/u-boot/commit/d8b1ea575177038f6e37f28563f00c9260016ac9

 Is that what you expect? I want to put sdcard based update commands
 before sending it for merging.
 

Hi Otavio,

 Fabio has pointed a example for me of 'magnesium' board config. Is it
 what you expect? it does make sense for me to make a common header
 file for both boards and others that might come later.

This is an example, but the imx27lite and the magnesium are very close.
Of course, you could prepare some kind of mx28-common, that all boards
can include.

Another example is amcc-common.h  for PowerPC 4xx. Up now we have not a
real common environment, that spreads among boards. Each board defines
its own set - it is not bad to define some common scripts, that a board
maintainer can use.

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH 1/2] mx28evk: extend default environment

2012-05-11 Thread Otavio Salvador
On Fri, May 11, 2012 at 11:25 AM, Stefano Babic sba...@denx.de wrote:
 Another example is amcc-common.h  for PowerPC 4xx. Up now we have not a
 real common environment, that spreads among boards. Each board defines
 its own set - it is not bad to define some common scripts, that a board
 maintainer can use.

Right; I will work on that.

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] kirkwood: add support for D-Link DNS-320

2012-05-11 Thread Jamie Lentin
On Wed, 02 May 2012 19:45:15 +0100, Luka Perkov ub...@lukaperkov.net  
wrote:



Hi Jamie,

I know that you have sent newer version of this patch but here is easier
for me to comment... I have also put maintainer of NAS325 board in
CC.


On Thu, Apr 26, 2012 at 11:23:58AM +0100, Jamie Lentin wrote:

This patch adds support for D-Link DNS-320 ShareCenter NAS.


...


+#ifdef CONFIG_RESET_PHY_R
+/* Configure and initialize PHY */
+void reset_phy(void)
+{
+   u16 reg;
+   u16 devadr;
+   char *name = egiga0;
+
+   if (miiphy_set_current_dev(name))
+   return;
+
+   /* command to read PHY dev address */
+   if (miiphy_read(name, 0xEE, 0xEE, (u16 *) devadr)) {
+   printf(Err..(%s) could not read PHY dev address\n, __func__);
+   return;
+   }
+
+   /*
+* Enable RGMII delay on Tx and Rx for CPU port
+* Ref: sec 4.7.2 of chip datasheet
+*/
+   miiphy_write(name, devadr, MV88E1116_PGADR_REG, 2);
+   miiphy_read(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
+   reg |= (MV88E1116_RGMII_RXTM_CTRL | MV88E1116_RGMII_TXTM_CTRL);
+   miiphy_write(name, devadr, MV88E1116_MAC_CTRL_REG, reg);
+   miiphy_write(name, devadr, MV88E1116_PGADR_REG, 0);
+
+   /* reset the phy */
+   miiphy_reset(name, devadr);
+
+   debug(88E1116 Initialized on %s\n, name);
+}
+#endif /* CONFIG_RESET_PHY_R */


Are you sure you need this CONFIG_RESET_PHY_R at all? I mean I have the
same SoC and I do not need this at all. I think this part is left over
from other boards that we do not need anymore. It makes sense to remove
this if you do not need it on your board.

Take a look here:

http://git.denx.de/?p=u-boot/u-boot-arm.git;a=blob;f=board/raidsonic/ib62x0/ib62x0.c;h=65f2c2ea6a0415b0f508bc078528884e526dd201;hb=HEAD


I've fiddled for a while and cannot get a working Ethernet connection  
without this code to enable RGMII delay. Tried cloning configs/ib62x0.h,  
but no luck. Presumably you have the same PHY chip (88E1116R-NNC1) too?


Agree that it's a copy and pasted chunk of code that shouldn't be there  
though and at least should find a common home somewhere.




Luka



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


[U-Boot] [PATCH 2/8] m28evk: use same notation to alloc the 128kB stack

2012-05-11 Thread Otavio Salvador
Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 include/configs/m28evk.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index c62f4d0..7472ddc 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -88,7 +88,7 @@
 #defineCONFIG_NR_DRAM_BANKS1   /* 1 bank of 
DRAM */
 #definePHYS_SDRAM_10x4000  /* Base address 
*/
 #definePHYS_SDRAM_1_SIZE   0x2000  /* Max 512 MB 
RAM */
-#defineCONFIG_STACKSIZE0x0001  /* 128 KB stack 
*/
+#defineCONFIG_STACKSIZE(128 * 1024)/* 128 KB stack 
*/
 #defineCONFIG_SYS_MALLOC_LEN   0x0040  /* 4 MB for 
malloc */
 #defineCONFIG_SYS_GBL_DATA_SIZE128 /* Initial data 
*/
 #defineCONFIG_SYS_MEMTEST_START0x4000  /* Memtest 
start adr */
-- 
1.7.10

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


[U-Boot] [PATCH 1/8] MX28: Fix a typo in mx28_reg_8 macro

2012-05-11 Thread Otavio Salvador
The macro mistakenly referred to 32bit struct instead of 8bit one.

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Marek Vasut ma...@denx.de
---
 arch/arm/include/asm/arch-mx28/regs-common.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/arch-mx28/regs-common.h 
b/arch/arm/include/asm/arch-mx28/regs-common.h
index 94b512d..d2e1953 100644
--- a/arch/arm/include/asm/arch-mx28/regs-common.h
+++ b/arch/arm/include/asm/arch-mx28/regs-common.h
@@ -70,7 +70,7 @@ struct mx28_register_32 {
 #definemx28_reg_8(name)\
union { \
struct { __mx28_reg_8(name) };  \
-   struct mx28_register_32 name##_reg; \
+   struct mx28_register_8 name##_reg;  \
};
 
 #definemx28_reg_32(name)   \
-- 
1.7.10

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


[U-Boot] [PATCH 3/8] m28evk: use M28EVK U-Boot = as prompt

2012-05-11 Thread Otavio Salvador
Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 include/configs/m28evk.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 7472ddc..ebf7e39 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -114,7 +114,7 @@
  * U-Boot general configurations
  */
 #defineCONFIG_SYS_LONGHELP
-#defineCONFIG_SYS_PROMPT   = 
+#defineCONFIG_SYS_PROMPT   M28EVK U-Boot = 
 #defineCONFIG_SYS_CBSIZE   1024/* Console I/O buffer 
size */
 #defineCONFIG_SYS_PBSIZE   \
(CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
-- 
1.7.10

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


[U-Boot] [PATCH 4/8] mx28evk: ensure command definition is in alphabetic order

2012-05-11 Thread Otavio Salvador
Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 include/configs/mx28evk.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 0c18e50..5ccfe70 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -54,11 +54,11 @@
 #include config_cmd_default.h
 #define CONFIG_DISPLAY_CPUINFO
 #define CONFIG_DOS_PARTITION
-#define CONFIG_CMD_FAT
 
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_DATE
 #define CONFIG_CMD_DHCP
+#define CONFIG_CMD_FAT
 #define CONFIG_CMD_GPIO
 #define CONFIG_CMD_MII
 #define CONFIG_CMD_MMC
-- 
1.7.10

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


[U-Boot] [PATCH 5/8] mxsboot: stop referring to i.MX28 as this ought to work for all i.MXS SoCs

2012-05-11 Thread Otavio Salvador
Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 tools/mxsboot.c |  110 +++
 1 file changed, 55 insertions(+), 55 deletions(-)

diff --git a/tools/mxsboot.c b/tools/mxsboot.c
index 6c05aa4..9661a48 100644
--- a/tools/mxsboot.c
+++ b/tools/mxsboot.c
@@ -1,5 +1,5 @@
 /*
- * Freescale i.MX28 image generator
+ * Freescale i.MXS image generator
  *
  * Copyright (C) 2011 Marek Vasut marek.va...@gmail.com
  * on behalf of DENX Software Engineering GmbH
@@ -60,13 +60,13 @@ uint32_t sd_sector = 2048;
  */
 #defineMAX_BOOTSTREAM_SIZE (1 * 1024 * 1024)
 
-/* i.MX28 NAND controller-specific constants. DO NOT TWEAK! */
+/* i.MXS NAND controller-specific constants. DO NOT TWEAK! */
 #defineMXS_NAND_DMA_DESCRIPTOR_COUNT   4
 #defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE  512
 #defineMXS_NAND_METADATA_SIZE  10
 #defineMXS_NAND_COMMAND_BUFFER_SIZE32
 
-struct mx28_nand_fcb {
+struct mxs_nand_fcb {
uint32_tchecksum;
uint32_tfingerprint;
uint32_tversion;
@@ -111,7 +111,7 @@ struct mx28_nand_fcb {
uint32_tbb_marker_physical_offset;
 };
 
-struct mx28_nand_dbbt {
+struct mxs_nand_dbbt {
uint32_tchecksum;
uint32_tfingerprint;
uint32_tversion;
@@ -119,13 +119,13 @@ struct mx28_nand_dbbt {
uint32_tnumber_2k_pages_bb;
 };
 
-struct mx28_nand_bbt {
+struct mxs_nand_bbt {
uint32_tnand;
uint32_tnumber_bb;
uint32_tbadblock[510];
 };
 
-struct mx28_sd_drive_info {
+struct mxs_sd_drive_info {
uint32_tchip_num;
uint32_tdrive_type;
uint32_ttag;
@@ -133,20 +133,20 @@ struct mx28_sd_drive_info {
uint32_tsector_count;
 };
 
-struct mx28_sd_config_block {
+struct mxs_sd_config_block {
uint32_tsignature;
uint32_tprimary_boot_tag;
uint32_tsecondary_boot_tag;
uint32_tnum_copies;
-   struct mx28_sd_drive_info   drv_info[1];
+   struct mxs_sd_drive_infodrv_info[1];
 };
 
-static inline uint32_t mx28_nand_ecc_size_in_bits(uint32_t ecc_strength)
+static inline uint32_t mxs_nand_ecc_size_in_bits(uint32_t ecc_strength)
 {
return ecc_strength * 13;
 }
 
-static inline uint32_t mx28_nand_get_ecc_strength(uint32_t page_data_size,
+static inline uint32_t mxs_nand_get_ecc_strength(uint32_t page_data_size,
uint32_t page_oob_size)
 {
if (page_data_size == 2048)
@@ -163,7 +163,7 @@ static inline uint32_t mx28_nand_get_ecc_strength(uint32_t 
page_data_size,
return 0;
 }
 
-static inline uint32_t mx28_nand_get_mark_offset(uint32_t page_data_size,
+static inline uint32_t mxs_nand_get_mark_offset(uint32_t page_data_size,
uint32_t ecc_strength)
 {
uint32_t chunk_data_size_in_bits;
@@ -174,7 +174,7 @@ static inline uint32_t mx28_nand_get_mark_offset(uint32_t 
page_data_size,
uint32_t block_mark_bit_offset;
 
chunk_data_size_in_bits = MXS_NAND_CHUNK_DATA_CHUNK_SIZE * 8;
-   chunk_ecc_size_in_bits  = mx28_nand_ecc_size_in_bits(ecc_strength);
+   chunk_ecc_size_in_bits  = mxs_nand_ecc_size_in_bits(ecc_strength);
 
chunk_total_size_in_bits =
chunk_data_size_in_bits + chunk_ecc_size_in_bits;
@@ -212,21 +212,21 @@ static inline uint32_t mx28_nand_get_mark_offset(uint32_t 
page_data_size,
return block_mark_bit_offset;
 }
 
-static inline uint32_t mx28_nand_mark_byte_offset(void)
+static inline uint32_t mxs_nand_mark_byte_offset(void)
 {
uint32_t ecc_strength;
-   ecc_strength = mx28_nand_get_ecc_strength(nand_writesize, nand_oobsize);
-   return mx28_nand_get_mark_offset(nand_writesize, ecc_strength)  3;
+   ecc_strength = mxs_nand_get_ecc_strength(nand_writesize, nand_oobsize);
+   return mxs_nand_get_mark_offset(nand_writesize, ecc_strength)  3;
 }
 
-static inline uint32_t mx28_nand_mark_bit_offset(void)
+static inline uint32_t mxs_nand_mark_bit_offset(void)
 {
uint32_t ecc_strength;
-   ecc_strength = mx28_nand_get_ecc_strength(nand_writesize, nand_oobsize);
-   return mx28_nand_get_mark_offset(nand_writesize, ecc_strength)  0x7;
+   ecc_strength = mxs_nand_get_ecc_strength(nand_writesize, nand_oobsize);
+   return mxs_nand_get_mark_offset(nand_writesize, ecc_strength)  0x7;
 }
 
-static uint32_t mx28_nand_block_csum(uint8_t *block, uint32_t size)
+static uint32_t mxs_nand_block_csum(uint8_t *block, uint32_t size)
 {
uint32_t csum = 0;
int i;
@@ -237,9 +237,9 @@ static 

[U-Boot] [PATCH 8/8] MX28: rename regs-clkctrl.h to regs-clkctrl-mx28.h

2012-05-11 Thread Otavio Salvador
The CLKCTRL registers are SoC specific so we ought to have it clear on
filename.

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 arch/arm/include/asm/arch-mxs/imx-regs.h  |2 +-
 arch/arm/include/asm/arch-mxs/regs-clkctrl-mx28.h |  294 +
 arch/arm/include/asm/arch-mxs/regs-clkctrl.h  |  294 -
 drivers/usb/host/ehci-mxs.c   |2 +-
 4 files changed, 296 insertions(+), 296 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-mxs/regs-clkctrl-mx28.h
 delete mode 100644 arch/arm/include/asm/arch-mxs/regs-clkctrl.h

diff --git a/arch/arm/include/asm/arch-mxs/imx-regs.h 
b/arch/arm/include/asm/arch-mxs/imx-regs.h
index 37d0a93..5e1901e 100644
--- a/arch/arm/include/asm/arch-mxs/imx-regs.h
+++ b/arch/arm/include/asm/arch-mxs/imx-regs.h
@@ -26,7 +26,7 @@
 #include asm/arch/regs-apbh.h
 #include asm/arch/regs-base.h
 #include asm/arch/regs-bch.h
-#include asm/arch/regs-clkctrl.h
+#include asm/arch/regs-clkctrl-mx28.h
 #include asm/arch/regs-digctl.h
 #include asm/arch/regs-gpmi.h
 #include asm/arch/regs-i2c.h
diff --git a/arch/arm/include/asm/arch-mxs/regs-clkctrl-mx28.h 
b/arch/arm/include/asm/arch-mxs/regs-clkctrl-mx28.h
new file mode 100644
index 000..127370b
--- /dev/null
+++ b/arch/arm/include/asm/arch-mxs/regs-clkctrl-mx28.h
@@ -0,0 +1,294 @@
+/*
+ * Freescale i.MX28 CLKCTRL Register Definitions
+ *
+ * Copyright (C) 2011 Marek Vasut marek.va...@gmail.com
+ * on behalf of DENX Software Engineering GmbH
+ *
+ * Based on code from LTIB:
+ * Copyright 2008-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ *
+ */
+
+#ifndef __MX28_REGS_CLKCTRL_H__
+#define __MX28_REGS_CLKCTRL_H__
+
+#include asm/arch/regs-common.h
+
+#ifndef__ASSEMBLY__
+struct mx28_clkctrl_regs {
+   mxs_reg_32(hw_clkctrl_pll0ctrl0)/* 0x00 */
+   mxs_reg_32(hw_clkctrl_pll0ctrl1)/* 0x10 */
+   mxs_reg_32(hw_clkctrl_pll1ctrl0)/* 0x20 */
+   mxs_reg_32(hw_clkctrl_pll1ctrl1)/* 0x30 */
+   mxs_reg_32(hw_clkctrl_pll2ctrl0)/* 0x40 */
+   mxs_reg_32(hw_clkctrl_cpu)  /* 0x50 */
+   mxs_reg_32(hw_clkctrl_hbus) /* 0x60 */
+   mxs_reg_32(hw_clkctrl_xbus) /* 0x70 */
+   mxs_reg_32(hw_clkctrl_xtal) /* 0x80 */
+   mxs_reg_32(hw_clkctrl_ssp0) /* 0x90 */
+   mxs_reg_32(hw_clkctrl_ssp1) /* 0xa0 */
+   mxs_reg_32(hw_clkctrl_ssp2) /* 0xb0 */
+   mxs_reg_32(hw_clkctrl_ssp3) /* 0xc0 */
+   mxs_reg_32(hw_clkctrl_gpmi) /* 0xd0 */
+   mxs_reg_32(hw_clkctrl_spdif)/* 0xe0 */
+   mxs_reg_32(hw_clkctrl_emi)  /* 0xf0 */
+   mxs_reg_32(hw_clkctrl_saif0)/* 0x100 */
+   mxs_reg_32(hw_clkctrl_saif1)/* 0x110 */
+   mxs_reg_32(hw_clkctrl_lcdif)/* 0x120 */
+   mxs_reg_32(hw_clkctrl_etm)  /* 0x130 */
+   mxs_reg_32(hw_clkctrl_enet) /* 0x140 */
+   mxs_reg_32(hw_clkctrl_hsadc)/* 0x150 */
+   mxs_reg_32(hw_clkctrl_flexcan)  /* 0x160 */
+
+   uint32_treserved[16];
+
+   mxs_reg_8(hw_clkctrl_frac0) /* 0x1b0 */
+   mxs_reg_8(hw_clkctrl_frac1) /* 0x1c0 */
+   mxs_reg_32(hw_clkctrl_clkseq)   /* 0x1d0 */
+   mxs_reg_32(hw_clkctrl_reset)/* 0x1e0 */
+   mxs_reg_32(hw_clkctrl_status)   /* 0x1f0 */
+   mxs_reg_32(hw_clkctrl_version)  /* 0x200 */
+};
+#endif
+
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_MASK  (0x3  28)
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_OFFSET28
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_DEFAULT   (0x0  28)
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_TIMES_2   (0x1  28)
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_TIMES_05  (0x2  28)
+#defineCLKCTRL_PLL0CTRL0_LFR_SEL_UNDEFINED (0x3  28)
+#defineCLKCTRL_PLL0CTRL0_CP_SEL_MASK   (0x3  24)
+#defineCLKCTRL_PLL0CTRL0_CP_SEL_OFFSET 24
+#defineCLKCTRL_PLL0CTRL0_CP_SEL_DEFAULT(0x0  24)
+#defineCLKCTRL_PLL0CTRL0_CP_SEL_TIMES_2(0x1  24)
+#define

[U-Boot] [PATCH 7/8] mxs: prefix register acessor macros with 'mxs' prefix

2012-05-11 Thread Otavio Salvador
As the register accessing mode is the same for all i.MXS SoCs we ought
to use 'mxs' prefix intead of 'mx28'.

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
---
 arch/arm/cpu/arm926ejs/mxs/clock.c   |4 +-
 arch/arm/cpu/arm926ejs/mxs/iomux.c   |6 +-
 arch/arm/cpu/arm926ejs/mxs/mx28.c|6 +-
 arch/arm/include/asm/arch-mxs/regs-apbh.h|  254 +-
 arch/arm/include/asm/arch-mxs/regs-bch.h |   42 ++---
 arch/arm/include/asm/arch-mxs/regs-clkctrl.h |   58 +++---
 arch/arm/include/asm/arch-mxs/regs-common.h  |   34 ++--
 arch/arm/include/asm/arch-mxs/regs-digctl.h  |   50 ++---
 arch/arm/include/asm/arch-mxs/regs-gpmi.h|   26 +--
 arch/arm/include/asm/arch-mxs/regs-i2c.h |   28 +--
 arch/arm/include/asm/arch-mxs/regs-ocotp.h   |   86 -
 arch/arm/include/asm/arch-mxs/regs-pinctrl.h |  168 -
 arch/arm/include/asm/arch-mxs/regs-power.h   |   28 +--
 arch/arm/include/asm/arch-mxs/regs-rtc.h |   28 +--
 arch/arm/include/asm/arch-mxs/regs-ssp.h |   40 ++--
 arch/arm/include/asm/arch-mxs/regs-timrot.h  |   38 ++--
 arch/arm/include/asm/arch-mxs/regs-usbphy.h  |   20 +-
 arch/arm/include/asm/arch-mxs/sys_proto.h|6 +-
 drivers/gpio/mxs_gpio.c  |   16 +-
 drivers/usb/host/ehci-mxs.c  |8 +-
 20 files changed, 473 insertions(+), 473 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/mxs/clock.c 
b/arch/arm/cpu/arm926ejs/mxs/clock.c
index 0439f9c..3e29c56 100644
--- a/arch/arm/cpu/arm926ejs/mxs/clock.c
+++ b/arch/arm/cpu/arm926ejs/mxs/clock.c
@@ -207,7 +207,7 @@ void mx28_set_sspclk(enum mxs_sspclock ssp, uint32_t freq, 
int xtal)
return;
 
clkreg = (uint32_t)(clkctrl_regs-hw_clkctrl_ssp0) +
-   (ssp * sizeof(struct mx28_register_32));
+   (ssp * sizeof(struct mxs_register_32));
 
clrbits_le32(clkreg, CLKCTRL_SSP_CLKGATE);
while (readl(clkreg)  CLKCTRL_SSP_CLKGATE)
@@ -256,7 +256,7 @@ static uint32_t mx28_get_sspclk(enum mxs_sspclock ssp)
return XTAL_FREQ_KHZ;
 
clkreg = (uint32_t)(clkctrl_regs-hw_clkctrl_ssp0) +
-   (ssp * sizeof(struct mx28_register_32));
+   (ssp * sizeof(struct mxs_register_32));
 
tmp = readl(clkreg)  CLKCTRL_SSP_DIV_MASK;
 
diff --git a/arch/arm/cpu/arm926ejs/mxs/iomux.c 
b/arch/arm/cpu/arm926ejs/mxs/iomux.c
index 12916b6..73f1446 100644
--- a/arch/arm/cpu/arm926ejs/mxs/iomux.c
+++ b/arch/arm/cpu/arm926ejs/mxs/iomux.c
@@ -43,7 +43,7 @@ int mxs_iomux_setup_pad(iomux_cfg_t pad)
 {
u32 reg, ofs, bp, bm;
void *iomux_base = (void *)MXS_PINCTRL_BASE;
-   struct mx28_register_32 *mxs_reg;
+   struct mxs_register_32 *mxs_reg;
 
/* muxsel */
ofs = 0x100;
@@ -70,7 +70,7 @@ int mxs_iomux_setup_pad(iomux_cfg_t pad)
/* vol */
if (PAD_VOL_VALID(pad)) {
bp = PAD_PIN(pad) % 8 * 4 + 2;
-   mxs_reg = (struct mx28_register_32 *)(iomux_base + ofs);
+   mxs_reg = (struct mxs_register_32 *)(iomux_base + ofs);
if (PAD_VOL(pad))
writel(1  bp, mxs_reg-reg_set);
else
@@ -82,7 +82,7 @@ int mxs_iomux_setup_pad(iomux_cfg_t pad)
ofs = PULL_OFFSET;
ofs += PAD_BANK(pad) * 0x10;
bp = PAD_PIN(pad);
-   mxs_reg = (struct mx28_register_32 *)(iomux_base + ofs);
+   mxs_reg = (struct mxs_register_32 *)(iomux_base + ofs);
if (PAD_PULL(pad))
writel(1  bp, mxs_reg-reg_set);
else
diff --git a/arch/arm/cpu/arm926ejs/mxs/mx28.c 
b/arch/arm/cpu/arm926ejs/mxs/mx28.c
index a82ff25..a0ec06e 100644
--- a/arch/arm/cpu/arm926ejs/mxs/mx28.c
+++ b/arch/arm/cpu/arm926ejs/mxs/mx28.c
@@ -81,7 +81,7 @@ void enable_caches(void)
 #endif
 }
 
-int mx28_wait_mask_set(struct mx28_register_32 *reg, uint32_t mask, int 
timeout)
+int mx28_wait_mask_set(struct mxs_register_32 *reg, uint32_t mask, int timeout)
 {
while (--timeout) {
if ((readl(reg-reg)  mask) == mask)
@@ -92,7 +92,7 @@ int mx28_wait_mask_set(struct mx28_register_32 *reg, uint32_t 
mask, int timeout)
return !timeout;
 }
 
-int mx28_wait_mask_clr(struct mx28_register_32 *reg, uint32_t mask, int 
timeout)
+int mx28_wait_mask_clr(struct mxs_register_32 *reg, uint32_t mask, int timeout)
 {
while (--timeout) {
if ((readl(reg-reg)  mask) == 0)
@@ -103,7 +103,7 @@ int mx28_wait_mask_clr(struct mx28_register_32 *reg, 
uint32_t mask, int timeout)
return !timeout;
 }
 
-int mx28_reset_block(struct mx28_register_32 *reg)
+int mx28_reset_block(struct mxs_register_32 *reg)
 {
/* Clear SFTRST */
writel(MX28_BLOCK_SFTRST, reg-reg_clr);
diff --git a/arch/arm/include/asm/arch-mxs/regs-apbh.h 
b/arch/arm/include/asm/arch-mxs/regs-apbh.h
index 91d7bc8..7c6bd04 

Re: [U-Boot] [PATCH 6/8] mxs: reorganize source directory for easy sharing of code among i.MXS SoCs

2012-05-11 Thread Otavio Salvador
On Fri, May 11, 2012 at 12:38 PM, Otavio Salvador
ota...@ossystems.com.br wrote:
 Most code can be shared amount i.MX23 and i.MX28 as both are from
 i.MXS family; this source directory structure makes easy to share code
 among them.

 Signed-off-by: Otavio Salvador ota...@ossystems.com.br

This and next patches are not yet ready for merging but I'd like to
get an review on the concept of it.

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Tom Warren
Graeme,

 -Original Message-
 From: Graeme Russ [mailto:graeme.r...@gmail.com]
 Sent: Thursday, May 10, 2012 4:46 PM
 To: Tom Warren
 Cc: Simon Glass; U-Boot Mailing List; Stephen Warren; Tom Rini; Albert
 ARIBAUD
 Subject: Re: [PATCH v7 03/23] Add abs() macro to return absolute value
 
 Hi Tom,
 
 On Fri, May 11, 2012 at 8:56 AM, Tom Warren twar...@nvidia.com wrote:
  Simon,
 
  -Original Message-
  From: Simon Glass [mailto:s...@chromium.org]
  Sent: Thursday, May 10, 2012 2:38 PM
  To: U-Boot Mailing List
  Cc: Tom Warren; Stephen Warren; Simon Glass
  Subject: [PATCH v7 03/23] Add abs() macro to return absolute value
 
  This macro is generally useful to make it available in common.
 
  Signed-off-by: Simon Glass s...@chromium.org
  ---
  Changes in v3:
  - Add new patch to put abs() in common.h
 
  Changes in v6:
  - Update x86emu and omap4 to use the abs() macro
 
  Adding Tom Rini and Graeme Russ to CC for OMAP4 and x86 signoff,
  although
 
 /drivers/bios_emulator/x86emu is not under my control - I think this is used
 mostly by PPC. But I do have a couple of questions/comments

Thanks for the review, regardless. Using 'git blame', it appears that Jason Jin 
@ Freescale wrote most of this file.

 
  it's a trivial change.
 
 Hmm, int abs(in v)  is in prim_ops.c and not declared static - Is there a
 matching declaration in a header somewhere or is it really a static function
 which has not been declared as such?

As Simon said, it appears to be a static func that wasn't declared as such, so 
no header to worry about.

 
  I've applied this, run a MAKEALL w/o errors/warnings, and pushed it to
 
 Is that a complplete MAKEALL for all boards?

I did a MAKEALL -c armv7. Simon did the larger build, since it's his change.

 
  u-boot-tegra/master, ready to generate a new pull request for ARM
  master when I get the Acks on this final patch.
 
  I'd like to get this in before EOW, so Simon and I can finish up w/T20
  LCD support and the SPI/UART fix and have a complete Tegra2
  implementation ready for use.
 
  Changes in v7:
  - Use a really simple abs() macro for now
 
   arch/arm/cpu/armv7/omap4/clocks.c       |    2 --
   drivers/bios_emulator/x86emu/prim_ops.c |    5 -
   include/common.h                        |    3 +++
   3 files changed, 3 insertions(+), 7 deletions(-)
 
  diff --git a/arch/arm/cpu/armv7/omap4/clocks.c
  b/arch/arm/cpu/armv7/omap4/clocks.c
  index e2189f7..ce3f59c 100644
  --- a/arch/arm/cpu/armv7/omap4/clocks.c
  +++ b/arch/arm/cpu/armv7/omap4/clocks.c
  @@ -46,8 +46,6 @@
   #define puts(s)
   #endif
 
  -#define abs(x) (((x)  0) ? ((x)*-1) : (x))
  -
   struct omap4_prcm_regs *const prcm = (struct omap4_prcm_regs
  *)0x4A004100;
 
   const u32 sys_clk_array[8] = {
  diff --git a/drivers/bios_emulator/x86emu/prim_ops.c
  b/drivers/bios_emulator/x86emu/prim_ops.c
  index 7553087..5f6c795 100644
  --- a/drivers/bios_emulator/x86emu/prim_ops.c
  +++ b/drivers/bios_emulator/x86emu/prim_ops.c
  @@ -118,11 +118,6 @@ static u32 x86emu_parity_tab[8] =
 
   #define PARITY(x)   (((x86emu_parity_tab[(x) / 32]  ((x) % 32)) 
  1) ==
  0)
   #define XOR2(x)          (((x) ^ ((x)1))  0x1)
  -/*- Implementation
   */ -int abs(int v) -{
  -     return (v0)?v:-v;
  -}
 
 What on earth has your mailer done here?

No idea - sorry about that. Outlook sucks.

 
 
   /*- Implementation
   */
 
  diff --git a/include/common.h b/include/common.h index
  4b5841e..2f2a869
  100644
  --- a/include/common.h
  +++ b/include/common.h
  @@ -222,6 +222,9 @@ typedef void (interrupt_handler_t)(void *);
  #define MIN(x, y)  min(x, y)  #define MAX(x, y)  max(x, y)
 
  +/* Return the absolute value of a number */ #define abs(x)
  +((x)  0 ? -(x) : (x))
  +
 
 Is that really the the extent of abs() in U-Boot (sorry, I don't have the
 code at hand to do a search)?

As Simon said, it appears that that's it for abs() - only OMAP4 and x86emu.

 
   #if defined(CONFIG_ENV_IS_EMBEDDED)
   #define TOTAL_MALLOC_LEN     CONFIG_SYS_MALLOC_LEN
   #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) 
  CONFIG_SYS_MONITOR_BASE) || \
  --
  1.7.7.3
  --
  nvpublic
 
 
 Regards,
 
 Graeme
-- 
nvpublic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Michael Walle
Am Donnerstag 10 Mai 2012, 19:32:11 schrieb Michael Walle:
 This patchset is a split-off from my patch series Kirkwood: add lschlv2
 and lsxhl board support.

Hi Joe,

will you ack/nak these patch series and in case of an ack, Prafulla will fetch 
these into his tree? Or how is it supposed to work?

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


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Joe Hershberger
Hi Michael,

On Fri, May 11, 2012 at 11:32 AM, Michael Walle mich...@walle.cc wrote:
 Am Donnerstag 10 Mai 2012, 19:32:11 schrieb Michael Walle:
 This patchset is a split-off from my patch series Kirkwood: add lschlv2
 and lsxhl board support.

 Hi Joe,

 will you ack/nak these patch series and in case of an ack, Prafulla will fetch
 these into his tree? Or how is it supposed to work?

It is up to Prafulla.  If it makes more sense due to being required
for your other patch, then it can go through his branch.  Let me know.

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


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Prafulla Wadaskar


 -Original Message-
 From: Joe Hershberger [mailto:joe.hershber...@gmail.com]
 Sent: 11 May 2012 09:47
 To: Michael Walle
 Cc: u-boot@lists.denx.de; Prafulla Wadaskar
 Subject: Re: [PATCH v4 0/3] net: helper functions
 
 Hi Michael,
 
 On Fri, May 11, 2012 at 11:32 AM, Michael Walle mich...@walle.cc
 wrote:
  Am Donnerstag 10 Mai 2012, 19:32:11 schrieb Michael Walle:
  This patchset is a split-off from my patch series Kirkwood: add
 lschlv2
  and lsxhl board support.
 
  Hi Joe,
 
  will you ack/nak these patch series and in case of an ack, Prafulla
 will fetch
  these into his tree? Or how is it supposed to work?
 
 It is up to Prafulla.  If it makes more sense due to being required
 for your other patch, then it can go through his branch.  Let me know.

I will check on this patch in this week end since I am travelling.

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


Re: [U-Boot] [PATCH 1/3] mx53: Change IPU_CTRL_BASE_ADDR definition

2012-05-11 Thread Fabio Estevam
Hi Stefano,

On Fri, May 11, 2012 at 7:46 AM, Stefano Babic sba...@denx.de wrote:

 Apart of the fact that it works, this chane appears really strange to
 me. Maybe now it is not writing anymore in ipu, and the default values
 are ok for mx53. It seems more a MX53 related issu in IPU3 driver, and
 this change maybe hides the real problem. Do you have any additional
 information to make this modification against the official Freescale's
 reference manual ?

I investigated this and I understand it better now.

I am working on a solution that will be flexible to handle mx51/mx53/mx6.

Regards,

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


Re: [U-Boot] [PATCH] Ignore all Carriage Returns when importing an environment.

2012-05-11 Thread Wolfgang Denk
Dear Alexander Holler,

In message 1336720486-7424-1-git-send-email-hol...@ahsoftware.de you wrote:
 This is used for compatibility with text files which are
 using CRLF instead of LF as the end of a line.

I don't think we should do this.  If you have text files with CR-LF
line endings, then please use external tools (like dos2unix) to filter
these and bring them into the appropriate format.

I would like to put as little restrictions on the content of an
environment variable as possible.  I can see valid use for strings
that contain a CR character.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There is, however, a strange, musty smell in the air that reminds  me
of something...hmm...yes...I've got it...there's a VMS nearby, or I'm
a Blit.  - Larry Wall in Configure from the perl distribution
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Wolfgang Denk
Dear Simon Glass,

In message 1336685875-13177-4-git-send-email-...@chromium.org you wrote:
 This macro is generally useful to make it available in common.

I agree with the idea of the patch, but I object against the
current implementation.

 +/* Return the absolute value of a number */
 +#define abs(x)   ((x)  0 ? -(x) : (x))

NAK.  This macro can have nasty side effects.  Consider something like

foo = abs(bar++);

or

foo = abs(in_be32(reg));

etc.

Why do you re-invent the wheel (poorly) instead of - for example -
copying the definition from Linux (include/linux/kernel.h) ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It seems intuitively obvious to me, which  means  that  it  might  be
wrong. -- Chris Torek
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 1336671134-16342-1-git-send-email-mich...@walle.cc you wrote:
 This patchset is a split-off from my patch series Kirkwood: add lschlv2
 and lsxhl board support.
 
 Changes:
 v4:
  - typo fixes (thanks Mike)
  - seed all 46bits of the generated ethernet address (suggested by Mike)
 v3, v2:
  [contained only lsxhl board changes]
 
 Michael Walle (3):
   lib: add rand() function
   net: add helper to generate random mac address
   net: add eth_setenv_enetaddr_by_index()

This patchset alone just adds unused (= dead code), and will not be
added because of this.

Please submit with the patches that actually use this code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 1336671134-16342-2-git-send-email-mich...@walle.cc you wrote:
 It's a PRNG using the simple and fast xorshift method.
...
 +static unsigned int y = 2463534242U;

Hm... can we introduce at least a little entropy somewhere?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
A Puritan is someone who is deathly afraid that  someone,  somewhere,
is having fun.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/3] net: add helper to generate random mac address

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 1336671134-16342-3-git-send-email-mich...@walle.cc you wrote:
 Add new function eth_random_enetaddr() to generate a locally administered
 ethernet address.
 
 Signed-off-by: Michael Walle mich...@walle.cc
 ---
  include/net.h |   15 +++
  net/eth.c |   20 
  2 files changed, 35 insertions(+), 0 deletions(-)

Please make this code configurable.  I don't want to bloat code size
for all boards when only one or two will ever use this feature.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I'd like to meet the man who invented sex and see what  he's  working
on now.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 3/3] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 1336671134-16342-4-git-send-email-mich...@walle.cc you wrote:
 Signed-off-by: Michael Walle mich...@walle.cc

How many boards will be using this code?  

Eventually this should be made configurable?

 + sprintf(enetvar, index ? %s%daddr : %saddr, base_name, index);

This should generate a warning: too many arguments for format.

Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
In the pitiful, multipage, connection-boxed form to which  the  flow-
chart  has  today  been  elaborated, it has proved to be useless as a
design tool -- programmers draw flowcharts after, not before, writing
the programs they describe.- Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Simon Glass
Hi,

On Fri, May 11, 2012 at 12:16 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Simon Glass,

 In message 1336685875-13177-4-git-send-email-...@chromium.org you wrote:
  This macro is generally useful to make it available in common.

 I agree with the idea of the patch, but I object against the
 current implementation.

  +/* Return the absolute value of a number */
  +#define abs(x)   ((x)  0 ? -(x) : (x))

 NAK.  This macro can have nasty side effects.  Consider something like

foo = abs(bar++);

 or

foo = abs(in_be32(reg));

 etc.

 Why do you re-invent the wheel (poorly) instead of - for example -
 copying the definition from Linux (include/linux/kernel.h) ?


That was the similar to the first implementation, which always returned
long, but Albert didn't like it do I did something simple.

So I will go back to the more complicated way, and this time just copy what
the kernel does. The difference is that it doesn't use typeof().

Regards,
Simon


 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 It seems intuitively obvious to me, which  means  that  it  might  be
 wrong. -- Chris Torek

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


Re: [U-Boot] [PATCH] kirkwood: add support for D-Link DNS-320

2012-05-11 Thread Luka Perkov
On Fri, May 11, 2012 at 03:09:25PM +0100, Jamie Lentin wrote:
 Are you sure you need this CONFIG_RESET_PHY_R at all? I mean I have the
 same SoC and I do not need this at all. I think this part is left over
 from other boards that we do not need anymore. It makes sense to remove
 this if you do not need it on your board.
 
 Take a look here:
 
 http://git.denx.de/?p=u-boot/u-boot-arm.git;a=blob;f=board/raidsonic/ib62x0/ib62x0.c;h=65f2c2ea6a0415b0f508bc078528884e526dd201;hb=HEAD
 
 I've fiddled for a while and cannot get a working Ethernet
 connection without this code to enable RGMII delay. Tried cloning
 configs/ib62x0.h, but no luck. Presumably you have the same PHY chip
 (88E1116R-NNC1) too?

I'm not sure... But if you really need this info I will disassemble the
box and take a look.

Anyway I'm glad you have double checked this.

 Agree that it's a copy and pasted chunk of code that shouldn't be
 there though and at least should find a common home somewhere.

Probably, but this is unrelated to this patch.

I have no more questions regarding this patch...

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


Re: [U-Boot] [PATCH] spi: Tegra2: Seaboard: fix UART corruption during SPI transactions

2012-05-11 Thread jimmzhang
On Wed, 2012-05-09 at 10:34 -0700, Tom Warren wrote:
 Simon Glass's proposal to fix this on Seaboard was NAK'd, so I
 removed his NS16550 references and added a small delay before
 SPI/UART muxing. Tested on my Seaboard with large SPI reads/writes
 and saw no corruption (crc's matched) and no spurious comm chars.
 
 Signed-off-by: Tom Warren twar...@nvidia.com

Tested-by: Jimmy Zhang jimmzh...@nvidia.com



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


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Wolfgang Denk
Dear Simon Glass,

In message CAPnjgZ2hep7ApaNMakKrAEpCPffQ74BogGo=gnwty47akew...@mail.gmail.com 
you wrote:

 So I will go back to the more complicated way, and this time just copy what
 the kernel does. The difference is that it doesn't use typeof().

I have to admit that I tend to prefer the typeof() version, and I
wonder why the kernel doesn;t use that.  I guess there are reasons for
that.  Does anybody know what these might be?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Reader, suppose you were an idiot. And suppose you were a  member  of
Congress. But I repeat myself.   - Mark Twain
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 21:18:50 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 1336671134-16342-1-git-send-email-mich...@walle.cc you wrote:
  This patchset is a split-off from my patch series Kirkwood: add lschlv2
  and lsxhl board support.
  
  Changes:
  
  v4:
   - typo fixes (thanks Mike)
   - seed all 46bits of the generated ethernet address (suggested by Mike)
  
  v3, v2:
   [contained only lsxhl board changes]
  
  Michael Walle (3):
lib: add rand() function
net: add helper to generate random mac address
net: add eth_setenv_enetaddr_by_index()
 
 This patchset alone just adds unused (= dead code), and will not be
 added because of this.
 
 Please submit with the patches that actually use this code.

Please have a look at
  [PATCH v4] Kirkwood: add lschlv2 and lsxhl board support

All introduced functions are used by this bsp. The original patch series was 
split because those three patches affect the net subsystem and should be 
reviewed/picked by Joe Hershberger.

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


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 21:20:02 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 1336671134-16342-2-git-send-email-mich...@walle.cc you wrote:
  It's a PRNG using the simple and fast xorshift method.
 
 ...
 
  +static unsigned int y = 2463534242U;
 
 Hm... can we introduce at least a little entropy somewhere?
Mh? A user is supposed to seed via srand().

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


[U-Boot] [PATCH v2] mx28evk, m28evk: sync extra environment content

2012-05-11 Thread Otavio Salvador
The environment has been based on mx53loco but keeping the possibility
to easy change the default console device as Freescale and mainline
kernels differ on the device name and inclusing m28evk update commands.

Signed-off-by: Otavio Salvador ota...@ossystems.com.br
Cc: Fabio Estevam fabio.este...@freescale.com
Cc: Stefano Babic sba...@denx.de
---
 include/configs/m28evk.h  |   57 +-
 include/configs/mx28-common.h |  129 +
 include/configs/mx28evk.h |   26 +
 3 files changed, 133 insertions(+), 79 deletions(-)
 create mode 100644 include/configs/mx28-common.h

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index ebf7e39..ed8166a 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -271,60 +271,7 @@
 #endif
 #endif
 
-/*
- * Boot Linux
- */
-#defineCONFIG_CMDLINE_TAG
-#defineCONFIG_SETUP_MEMORY_TAGS
-#defineCONFIG_BOOTDELAY3
-#defineCONFIG_BOOTFILE uImage
-#defineCONFIG_BOOTARGS console=ttyAM0,115200n8 
-#defineCONFIG_BOOTCOMMAND  run bootcmd_net
-#defineCONFIG_LOADADDR 0x4200
-#defineCONFIG_SYS_LOAD_ADDRCONFIG_LOADADDR
-#defineCONFIG_OF_LIBFDT
-
-/*
- * Extra Environments
- */
-#defineCONFIG_EXTRA_ENV_SETTINGS   
\
-   update_nand_full_filename=u-boot.nand\0   \
-   update_nand_firmware_filename=u-boot.sb\0 \
-   update_sd_firmware_filename=u-boot.sd\0   \
-   update_nand_firmware_maxsz=0x10\0 \
-   update_nand_stride=0x40\0 /* MX28 datasheet ch. 12.12 */  \
-   update_nand_count=0x4\0   /* MX28 datasheet ch. 12.12 */  \
-   update_nand_get_fcb_size= /* Get size of FCB blocks */\
-   nand device 0 ;   \
-   nand info ;   \
-   setexpr fcb_sz ${update_nand_stride} * ${update_nand_count}; \
-   setexpr update_nand_fcb ${fcb_sz} * ${nand_writesize}\0 \
-   update_nand_full= /* Update FCB, DBBT and FW */   \
-   if tftp ${update_nand_full_filename} ; then   \
-   run update_nand_get_fcb_size ;\
-   nand scrub -y 0x0 ${filesize} ;   \
-   nand write.raw ${loadaddr} 0x0 ${update_nand_fcb} ;   \
-   setexpr update_off ${loadaddr} + ${update_nand_fcb} ;  \
-   setexpr update_sz ${filesize} - ${update_nand_fcb} ;  \
-   nand write ${update_off} ${update_nand_fcb} ${update_sz} ;  \
-   fi\0  \
-   update_nand_firmware= /* Update only firmware */  \
-   if tftp ${update_nand_firmware_filename} ; then   \
-   run update_nand_get_fcb_size ;\
-   setexpr fcb_sz ${update_nand_fcb} * 2 ;  /* FCB + DBBT */ \
-   setexpr fw_sz ${update_nand_firmware_maxsz} * 2 ; \
-   setexpr fw_off ${fcb_sz} + ${update_nand_firmware_maxsz}; \
-   nand erase ${fcb_sz} ${fw_sz} ;   \
-   nand write ${loadaddr} ${fcb_sz} ${filesize} ;\
-   nand write ${loadaddr} ${fw_off} ${filesize} ;\
-   fi\0  \
-   update_sd_firmware=   /* Update the SD firmware partition */ \
-   if mmc rescan ; then  \
-   if tftp ${update_sd_firmware_filename} ; then \
-   setexpr fw_sz ${filesize} / 0x200 ;   /* SD block size */ \
-   setexpr fw_sz ${fw_sz} + 1 ;  \
-   mmc write ${loadaddr} 0x800 ${fw_sz} ;\
-   fi ;  \
-   fi\0
+/* Boot configuration and environemnt */
+#include mx28-common.h
 
 #endif /* __M28_H__ */
diff --git a/include/configs/mx28-common.h b/include/configs/mx28-common.h
new file mode 100644
index 000..2fd436c
--- /dev/null
+++ b/include/configs/mx28-common.h
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2012 Otavio Salvador ota...@ossystems.com.br
+ * on behalf of O.S. Systems Software LTDA.
+ *
+ * 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 

Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112229.44084.mich...@walle.cc you wrote:

  Please submit with the patches that actually use this code.
 
 Please have a look at
   [PATCH v4] Kirkwood: add lschlv2 and lsxhl board support
 
 All introduced functions are used by this bsp. The original patch series was 
 split because those three patches affect the net subsystem and should be 
 reviewed/picked by Joe Hershberger.

Keep these patches together, please.  The responsible custodians can
still ACK individual patches of the series.

The fact that only a single board ever needed these functions makes me
wonder if these are really of any general use.

In any case, I want to see these configurable, so that boards that do
not need these will not have to suffer.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
When in doubt, mumble;   when in trouble, delegate;  when in  charge,
ponder. -- James H. Boren
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112232.20664.mich...@walle.cc you wrote:

   +static unsigned int y = 2463534242U;
  
  Hm... can we introduce at least a little entropy somewhere?
 Mh? A user is supposed to seed via srand().

Then why initialize y at all?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
And now remains  That we find out the cause of this effect, Or rather
say, the cause of this defect...   -- Hamlet, Act II, Scene 2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mx28evk, m28evk: sync extra environment content

2012-05-11 Thread Wolfgang Denk
Dear Otavio Salvador,

In message 1336768754-18896-1-git-send-email-ota...@ossystems.com.br you 
wrote:
 The environment has been based on mx53loco but keeping the possibility
 to easy change the default console device as Freescale and mainline
 kernels differ on the device name and inclusing m28evk update commands.
 
 Signed-off-by: Otavio Salvador ota...@ossystems.com.br
 Cc: Fabio Estevam fabio.este...@freescale.com
 Cc: Stefano Babic sba...@denx.de
 ---
  include/configs/m28evk.h  |   57 +-
  include/configs/mx28-common.h |  129 
 +
  include/configs/mx28evk.h |   26 +
  3 files changed, 133 insertions(+), 79 deletions(-)
  create mode 100644 include/configs/mx28-common.h

I have to admit that I have other ideas what the environment on the
M28 boards should look like.  I don't want to see this style enforced
(or even encouraged) for this board.

Sorry.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It became apparent that one reason why the Ice Giants were  known  as
the  Ice  Giants  was  because they were, well, giants. The other was
that they were made of ice.  -Terry Pratchett, _Sourcery_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 22:43:16 schrieb Wolfgang Denk:
 Keep these patches together, please.  The responsible 
custodians can
 still ACK individual patches of the series.
 
 The fact that only a single board ever needed these 
functions makes me
 wonder if these are really of any general use.
Sorry, Prafulla asked me to split the patches, so should 
i combine them with the v5 respin again?


 In any case, I want to see these configurable, so that 
boards that do
 not need these will not have to suffer.
Agreed.

What about the rand function? I guess that should be two 
compile time options

- CONFIG_RAND
- CONFIG_RANDOM_HWADDR

Any better names?

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


Re: [U-Boot] [PATCH v4 3/3] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 21:25:27 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 1336671134-16342-4-git-send-email-mich...@walle.cc you wrote:
  Signed-off-by: Michael Walle mich...@walle.cc
 
 How many boards will be using this code?
Hopefully more boars will use this function in the future, instead of messing 
around with the variable names themselves.

 Eventually this should be made configurable?
Given the above, i would keep it non-configurable if youre fine with that.

 
  +   sprintf(enetvar, index ? %s%daddr : %saddr, base_name, index);
 
 This should generate a warning: too many arguments for format.
Mh, nice catch. That was just copied from the eth_getenv_enetaddr_by_index() 
function. I'll fix all of them.

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


Re: [U-Boot] [PATCH 1/8] MX28: Fix a typo in mx28_reg_8 macro

2012-05-11 Thread Marek Vasut
Dear Otavio Salvador,

 The macro mistakenly referred to 32bit struct instead of 8bit one.
 
 Signed-off-by: Otavio Salvador ota...@ossystems.com.br
 Cc: Fabio Estevam fabio.este...@freescale.com
 Cc: Marek Vasut ma...@denx.de
 ---
  arch/arm/include/asm/arch-mx28/regs-common.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/arch/arm/include/asm/arch-mx28/regs-common.h
 b/arch/arm/include/asm/arch-mx28/regs-common.h index 94b512d..d2e1953
 100644
 --- a/arch/arm/include/asm/arch-mx28/regs-common.h
 +++ b/arch/arm/include/asm/arch-mx28/regs-common.h
 @@ -70,7 +70,7 @@ struct mx28_register_32 {
  #define  mx28_reg_8(name)\
   union { \
   struct { __mx28_reg_8(name) };  \
 - struct mx28_register_32 name##_reg; \
 + struct mx28_register_8 name##_reg;  \
   };
 
  #define  mx28_reg_32(name)   \

Didn't Fabio sent in something similar already? Either way

Acked-by: Marek Vasut ma...@denx.de

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


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Simon Glass
Hi Wolfgang,

On Fri, May 11, 2012 at 1:13 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Simon Glass,

 In message CAPnjgZ2hep7ApaNMakKrAEpCPffQ74BogGo=
 gnwty47akew...@mail.gmail.com you wrote:
 
  So I will go back to the more complicated way, and this time just copy
 what
  the kernel does. The difference is that it doesn't use typeof().

 I have to admit that I tend to prefer the typeof() version, and I
 wonder why the kernel doesn;t use that.  I guess there are reasons for
 that.  Does anybody know what these might be?


Not me, but:

commit 71a9048448de302d1e968f336de01060d02fae71
Author: Andrew Morton a...@linux-foundation.org
Date:   Wed Jan 12 16:59:35 2011 -0800

include/linux/kernel.h: abs(): fix handling of 32-bit unsigneds on
64-bit

Michal reports:

In the framebuffer subsystem the abs() macro is often used as a part of
the calculation of a Manhattan metric, which in turn is used as a
measure
of similarity between video modes.  The arguments of abs() are sometimes
unsigned numbers.  This worked fine until commit a49c59c0 (Make sure
the
value in abs() does not get truncated if it is greater than 2^32:) ,
which
changed the definition of abs() to prevent truncation.  As a result of
this change, in the following piece of code:

u32 a = 0, b = 1;
u32 c = abs(a - b);

'c' will end up with a value of 0x instead of the expected 0x1.

A problem caused by this change and visible by the end user is that
framebuffer drivers relying on functions from modedb.c will fail to find
high resolution video modes similar to that explicitly requested by the
user if an exact match cannot be found (see e.g.

Fix this by special-casing `long' types within abs().

This patch reduces x86_64 code size a bit - drivers/video/uvesafb.o
shrunk
by 15 bytes, presumably because it is doing abs() on 4-byte quantities,
and expanding those to 8-byte longs adds code.

testcase:

#define oldabs(x) ({\
long __x = (x); \
(__x  0) ? -__x : __x; \
})

#define newabs(x) ({\
long ret;   \
if (sizeof(x) == sizeof(long)) {\
long __x = (x); \
ret = (__x  0) ? -__x : __x;   \
} else {\
int __x = (x);  \
ret = (__x  0) ? -__x : __x;   \
}   \
ret;\
})

typedef unsigned int u32;

main()
{
u32 a = 0;
u32 b = 1;
u32 oldc = oldabs(a - b);
u32 newc = newabs(a - b);

printf(%u %u\n, oldc, newc);
}

akpm:/home/akpm gcc t.c
akpm:/home/akpm ./a.out
4294967295 1

Reported-by: Michal Januszewski mich...@gmail.com
Cc: Rolf Eike Beer eike-ker...@sf-tec.de
Cc: Geert Uytterhoeven ge...@linux-m68k.org
Signed-off-by: Andrew Morton a...@linux-foundation.org
Signed-off-by: Linus Torvalds torva...@linux-foundation.org

Regards,
Simon




 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 Reader, suppose you were an idiot. And suppose you were a  member  of
 Congress. But I repeat myself.   - Mark Twain

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


Re: [U-Boot] [PATCH v2] mx28evk, m28evk: sync extra environment content

2012-05-11 Thread Wolfgang Denk
Dear Otavio Salvador,

please keep the ML on Cc: - thanks.

In message CAP9ODKq=mee0uxzmjyfedkocn0cw+rzkzdnvsjmdtehfu67...@mail.gmail.com 
you wrote:

  I have to admit that I have other ideas what the environment on the
  M28 boards should look like.  I don't want to see this style enforced
  (or even encouraged) for this board.

 Can you explain what do you have in mind?

Over the years we have developed our own style for the default
environment of DENX maintained boards, and I want to keep this
consistently used, especially for our own products.  The (Frescale
originating?) style you are using here  does not fit.  [The cuurent
default env is not much better, agreed; this needs fixing.  But when
changing the environment for M28, then in the right direction.]

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The sight of death frightens them [Earthers].
-- Kras the Klingon, Friday's Child, stardate 3497.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

please keep the ML on Cc: - thanks.

In message 201205112249.27871.mich...@walle.cc you wrote:

 +static unsigned int y = 2463534242U;

Hm... can we introduce at least a little entropy somewhere?
   
   Mh? A user is supposed to seed via srand().
  
  Then why initialize y at all?
 To have a sane fallback. Maybe i should have written
  A user is supposed to seed via srand() if he wan't some 
 entropy.

This is inconsequent.  Either we assume that the user will seed
srand(), then y should not be initialized at all, so it goes to the
BSS segment and does not waste space in the binary image.  Or we want
to deal with cases where the user doesn call srand(), and then we
should provide a bit better than such a static initialization.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/8] MX28: Fix a typo in mx28_reg_8 macro

2012-05-11 Thread Otavio Salvador
On Fri, May 11, 2012 at 6:03 PM, Marek Vasut ma...@denx.de wrote:
 The macro mistakenly referred to 32bit struct instead of 8bit one.
 Didn't Fabio sent in something similar already? Either way

Yes; I asked him to send my patch while I was in a client with a very
restricted firewall.

Thanks by acking it.

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2] mx28evk, m28evk: sync extra environment content

2012-05-11 Thread Otavio Salvador
On Fri, May 11, 2012 at 6:08 PM, Wolfgang Denk w...@denx.de wrote:
 Can you explain what do you have in mind?

 Over the years we have developed our own style for the default
 environment of DENX maintained boards, and I want to keep this
 consistently used, especially for our own products.  The (Frescale
 originating?) style you are using here  does not fit.  [The cuurent
 default env is not much better, agreed; this needs fixing.  But when
 changing the environment for M28, then in the right direction.]

In this case I'll send it for mx28evk again. So we can have it there
in meanwhile.

-- 
Otavio Salvador                             O.S. Systems
E-mail: ota...@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112254.13896.mich...@walle.cc you wrote:

 What about the rand function? I guess that should be two 
 compile time options
 
 - CONFIG_RAND
 - CONFIG_RANDOM_HWADDR
 
 Any better names?

Please make this a single option, CONFIG_RANDOM_MACADDR.  It appears
nobody else ever needed a random number before, and we can still
factor this out if another user pops up after another 12 years.

Eventually, also move the code together.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The lesser of two evils -- is evil. - Seymour (Sy) Leon
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 3/3] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112301.50311.mich...@walle.cc you wrote:

  Eventually this should be made configurable?
 Given the above, i would keep it non-configurable if youre fine with that.

Only if the code size for the existing boards that don't need this
does not grow.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If you fail to plan, plan to fail.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Michael Walle

 please keep the ML on Cc: - thanks.
sorry wrong key

 In message 201205112249.27871.mich...@walle.cc you wrote:
  +static unsigned int y = 2463534242U;
 
 Hm... can we introduce at least a little entropy somewhere?

Mh? A user is supposed to seed via srand().
   
   Then why initialize y at all?
  
  To have a sane fallback. Maybe i should have written
  
   A user is supposed to seed via srand() if he wan't some
  
  entropy.
 
 This is inconsequent.  Either we assume that the user will seed
 srand(), then y should not be initialized at all, so it goes to the
 BSS segment and does not waste space in the binary image.  Or we want
 to deal with cases where the user doesn call srand(), and then we
 should provide a bit better than such a static initialization.

Again, i wanted to stick with the regular rand() srand() semantics.

http://pubs.opengroup.org/onlinepubs/009695399/functions/rand.html
If rand() is called before any calls to srand() are made, the same sequence 
shall be generated as when srand() is first called with a seed value of 1.

But i'm fine with removing the initialization.

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


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 23:14:25 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 201205112254.13896.mich...@walle.cc you wrote:
  What about the rand function? I guess that should be two
  compile time options
  
  - CONFIG_RAND
  - CONFIG_RANDOM_HWADDR
  
  Any better names?
 
 Please make this a single option, CONFIG_RANDOM_MACADDR.  It appears
 nobody else ever needed a random number before, and we can still
 factor this out if another user pops up after another 12 years.

from net/net.c:
unsigned int random_port(void)
{
return 1024 + (get_timer(0) % 0x4000);
}

CONFIG_BOOTP_RANDOM_DELAY, in net/bootp.c

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


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Wolfgang Denk
Dear Simon Glass,

In message CAPnjgZ1jSrcdNVgN5aMG+z-94-vpH2ym3B=d6pj6bxib7oe...@mail.gmail.com 
you wrote:

  I have to admit that I tend to prefer the typeof() version, and I
  wonder why the kernel doesn;t use that.  I guess there are reasons for
  that.  Does anybody know what these might be?
 
 
 Not me, but:

Thanks.  So there is indeed a problem with the obvious
implementation :-(

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Madness takes its toll. Please have exact change.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112320.15462.mich...@walle.cc you wrote:
 
  This is inconsequent.  Either we assume that the user will seed
  srand(), then y should not be initialized at all, so it goes to the
  BSS segment and does not waste space in the binary image.  Or we want
  to deal with cases where the user doesn call srand(), and then we
  should provide a bit better than such a static initialization.
 
 Again, i wanted to stick with the regular rand() srand() semantics.
 
 http://pubs.opengroup.org/onlinepubs/009695399/functions/rand.html
 If rand() is called before any calls to srand() are made, the same sequence 
 shall be generated as when srand() is first called with a seed value of 1.

Good point.

But then y should be initialized as 1 ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Security is mostly a superstition. It does not  exist  in  nature...
Life is either a daring adventure or nothing. - Helen Keller
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112322.23891.mich...@walle.cc you wrote:

   - CONFIG_RAND
   - CONFIG_RANDOM_HWADDR
   
   Any better names?
  
  Please make this a single option, CONFIG_RANDOM_MACADDR.  It appears
  nobody else ever needed a random number before, and we can still
  factor this out if another user pops up after another 12 years.
 
 from net/net.c:
 unsigned int random_port(void)
 {
 return 1024 + (get_timer(0) % 0x4000);
 }
 
 CONFIG_BOOTP_RANDOM_DELAY, in net/bootp.c

Well, you patch did not change this code.

And I have to admit that I doubt the increased code size would be
worth such a change, at this place.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [PATCH v4 1/3] lib: add rand() function

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 23:29:47 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 201205112320.15462.mich...@walle.cc you wrote:
   This is inconsequent.  Either we assume that the user will seed
   srand(), then y should not be initialized at all, so it goes to the
   BSS segment and does not waste space in the binary image.  Or we want
   to deal with cases where the user doesn call srand(), and then we
   should provide a bit better than such a static initialization.
  
  Again, i wanted to stick with the regular rand() srand() semantics.
  
  http://pubs.opengroup.org/onlinepubs/009695399/functions/rand.html
  If rand() is called before any calls to srand() are made, the same
  sequence shall be generated as when srand() is first called with a seed
  value of 1.
 
 Good point.
 
 But then y should be initialized as 1 ?
I'm no crypto expert, so i sticked with the values/examples from the cited 
paper. But i guess it shouldn't make any difference, i'll change it to 1.

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


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 23:30:59 schrieb Wolfgang Denk:
 Well, you patch did not change this code.
 
 And I have to admit that I doubt the increased code size would be
 worth such a change, at this place.
Ok, can we agree on keeping the rand function in lib/ but using just one macro 
CONFIG_RANDOM_MACADDR?

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


Re: [U-Boot] [PATCH v4 0/3] net: helper functions

2012-05-11 Thread Wolfgang Denk
Dear Michael Walle,

In message 201205112342.43133.mich...@walle.cc you wrote:
 Am Freitag 11 Mai 2012, 23:30:59 schrieb Wolfgang Denk:
  Well, you patch did not change this code.
  
  And I have to admit that I doubt the increased code size would be
  worth such a change, at this place.
 Ok, can we agree on keeping the rand function in lib/ but using just one 
 macro 
 CONFIG_RANDOM_MACADDR?

Yes, that should do for now. thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The complexity of software is an essential property, not an  acciden-
tal  one. Hence, descriptions of a software entity that abstract away
its complexity often abstract away its essence.- Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 3/3] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Michael Walle
Am Freitag 11 Mai 2012, 23:16:02 schrieb Wolfgang Denk:
 Dear Michael Walle,
 
 In message 201205112301.50311.mich...@walle.cc you wrote:
   Eventually this should be made configurable?
  
  Given the above, i would keep it non-configurable if youre fine with
  that.
 
 Only if the code size for the existing boards that don't need this
 does not grow.
Well i can't add a new function without increasing the filesize, can i? 

Using inline functions would be one option, but that would be inconsistend 
with the eth_getenv_enetaddr_by_index().

phew, i wonder how the eth_getenv_enetaddr_by_index() made it into uboot ;)

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


Re: [U-Boot] [PATCH v7 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Simon Glass
Hi,

On Fri, May 11, 2012 at 2:24 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Simon Glass,

 In message CAPnjgZ1jSrcdNVgN5aMG+z-94-vpH2ym3B=
 d6pj6bxib7oe...@mail.gmail.com you wrote:
 
   I have to admit that I tend to prefer the typeof() version, and I
   wonder why the kernel doesn;t use that.  I guess there are reasons for
   that.  Does anybody know what these might be?
  
 
  Not me, but:

 Thanks.  So there is indeed a problem with the obvious
 implementation :-(


Yes, there are always problems, normally solved by additional complexity
and lines of code. I will do a patch with the kernel version as I
mentioned, as perhaps we can go with that.

Regards,
Simon



 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 Madness takes its toll. Please have exact change.

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


[U-Boot] [PATCH v5 0/5] Kirkwood: add lschlv2 and lsxhl board support

2012-05-11 Thread Michael Walle
Changes:
v5:
 - combine patchset again. the net: * patches should be individually
   acked by net custodian
 - make features configurable at compile time (CONFIG_RANDOM_MACADDR and
   CONFIG_SETENV_ENETADDR_BY_INDEX)
 - remove unused variable in boards/buffalo/lsxl.c
 - fix potential compiler warning too many arguments for format
 - new patch which fixes eth_getenv_enetaddr_by_index() and eth_mac_skip()
 - change initial seed of rand() to 1
 - enable CONFIG_API and CONFIG_CMD_ELF for lsxl boards

v4:
 - typo fixes (thanks Mike)
 - seed all 46bits of the generated ethernet address (suggested by Mike)
 - split patchset (generic net helpers and lsxl support)
 - fix typo in bootcmd_hdd
 - removed board/buffalo/lsxl/config.mk patch from patchset

v3:
 - add Kirkwood: prefix to patch subject
 - moved board/buffalo/lsxl/config.mk to an own patch, so it can be
   separately acked/naked ;)
 - removed any hardcoding, that is the mac address is now automatically
   generated (random, locally administered) and the IP settings are
   fetched with DHCP/BOOTP.
 - add detailed comments to every configuration line in kwbimage.cfg
 - add comments in MPP configuration about GPIO usage
 - removed lschlv2 ramboot
 - use short board ident string
 - small cleanups

v2:
 - add to buffalo vendor directory instead of Marvell
 - add both boards to MAINTAINERS
 - don't define values for feature macros
 - use tab for vertical alignment
 - remove static network configuration, instead introduce a rescue mode
 - add some convenience scripts
 - small cleanups

Michael Walle (5):
  lib: add rand() function
  net: add helper to generate random mac address
  net: fix potential compiler warning
  net: add eth_setenv_enetaddr_by_index()
  Kirkwood: add lschlv2 and lsxhl board support

 MAINTAINERS   |5 +
 board/buffalo/lsxl/Makefile   |   50 ++
 board/buffalo/lsxl/kwbimage-lschl.cfg |  229 +
 board/buffalo/lsxl/kwbimage-lsxhl.cfg |  229 +
 board/buffalo/lsxl/lsxl.c |  302 +
 board/buffalo/lsxl/lsxl.h |   75 
 boards.cfg|2 +
 include/common.h  |6 +
 include/configs/lsxl.h|  182 
 include/net.h |   33 
 lib/Makefile  |1 +
 lib/rand.c|   43 +
 net/eth.c |   51 ++-
 13 files changed, 1206 insertions(+), 2 deletions(-)
 create mode 100644 board/buffalo/lsxl/Makefile
 create mode 100644 board/buffalo/lsxl/kwbimage-lschl.cfg
 create mode 100644 board/buffalo/lsxl/kwbimage-lsxhl.cfg
 create mode 100644 board/buffalo/lsxl/lsxl.c
 create mode 100644 board/buffalo/lsxl/lsxl.h
 create mode 100644 include/configs/lsxl.h
 create mode 100644 lib/rand.c

-- 
1.7.2.5

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


[U-Boot] [PATCH v5 1/5] lib: add rand() function

2012-05-11 Thread Michael Walle
It's a PRNG using the simple and fast xorshift method.

Signed-off-by: Michael Walle mich...@walle.cc
Cc: Wolfgang Denk w...@denx.de
---
 include/common.h |6 ++
 lib/Makefile |1 +
 lib/rand.c   |   43 +++
 3 files changed, 50 insertions(+), 0 deletions(-)
 create mode 100644 lib/rand.c

diff --git a/include/common.h b/include/common.h
index 4b5841e..a9cb62c 100644
--- a/include/common.h
+++ b/include/common.h
@@ -733,6 +733,12 @@ char * strmhz(char *buf, unsigned long hz);
 /* lib/crc32.c */
 #include u-boot/crc.h
 
+/* lib/rand.c */
+#ifdef CONFIG_RANDOM_MACADDR
+void srand(unsigned int seed);
+unsigned int rand(void);
+#endif
+
 /* common/console.c */
 intconsole_init_f(void);   /* Before relocation; uses the serial  stuff
*/
 intconsole_init_r(void);   /* After  relocation; uses the console stuff
*/
diff --git a/lib/Makefile b/lib/Makefile
index a0fec60..74579f9 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -65,6 +65,7 @@ COBJS-y += string.o
 COBJS-y += time.o
 COBJS-$(CONFIG_BOOTP_PXE) += uuid.o
 COBJS-y += vsprintf.o
+COBJS-$(CONFIG_RANDOM_MACADDR) += rand.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/lib/rand.c b/lib/rand.c
new file mode 100644
index 000..6cb76ac
--- /dev/null
+++ b/lib/rand.c
@@ -0,0 +1,43 @@
+/*
+ * Simple xorshift PRNG
+ *   see http://www.jstatsoft.org/v08/i14/paper
+ *
+ * Copyright (c) 2012 Michael Walle
+ * Michael Walle mich...@walle.cc
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+
+static unsigned int y = 1U;
+
+void srand(unsigned int seed)
+{
+   y = seed;
+}
+
+unsigned int rand(void)
+{
+   y ^= (y  13);
+   y ^= (y  17);
+   y ^= (y  5);
+
+   return y;
+}
-- 
1.7.2.5

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


[U-Boot] [PATCH v5 4/5] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Michael Walle
Signed-off-by: Michael Walle mich...@walle.cc
Cc: Joe Hershberger joe.hershber...@gmail.com
---
 include/net.h |   16 
 net/eth.c |   15 +++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/include/net.h b/include/net.h
index f6aeba2..bdc3da6 100644
--- a/include/net.h
+++ b/include/net.h
@@ -104,7 +104,9 @@ extern struct eth_device *eth_get_dev_by_index(int index); 
/* get dev @ index */
 extern int eth_get_dev_index (void);   /* get the device index */
 extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
 extern int eth_getenv_enetaddr(char *name, uchar *enetaddr);
+#ifdef CONFIG_SETENV_ENETADDR_BY_INDEX
 extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
+#endif
 
 /*
  * Get the hardware address for an ethernet interface .
@@ -118,6 +120,20 @@ extern int eth_setenv_enetaddr(char *name, const uchar 
*enetaddr);
 extern int eth_getenv_enetaddr_by_index(const char *base_name, int index,
uchar *enetaddr);
 
+#ifdef CONFIG_SETENV_ENETADDR_BY_INDEX
+/*
+ * Set the hardware address for an ethernet interface .
+ * Args:
+ * base_name - base name for device (normally eth)
+ * index - device index number (0 for first)
+ * enetaddr - returns 6 byte hardware address
+ * Returns:
+ * 0 on success, else 1.
+ */
+extern int eth_setenv_enetaddr_by_index(const char *base_name, int index,
+   const uchar *enetaddr);
+#endif
+
 #ifdef CONFIG_RANDOM_MACADDR
 /*
  * The u-boot policy does not allow hardcoded ethernet addresses. Under the
diff --git a/net/eth.c b/net/eth.c
index afce863..d66e22a 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -67,6 +67,21 @@ int eth_getenv_enetaddr_by_index(const char *base_name, int 
index,
return eth_getenv_enetaddr(enetvar, enetaddr);
 }
 
+#ifdef CONFIG_SETENV_ENETADDR_BY_INDEX
+int eth_setenv_enetaddr_by_index(const char *base_name, int index,
+   const uchar *enetaddr)
+{
+   char enetvar[32];
+
+   if (index)
+   sprintf(enetvar, %s%daddr, base_name, index);
+   else
+   sprintf(enetvar, %saddr, base_name);
+
+   return eth_setenv_enetaddr(enetvar, enetaddr);
+}
+#endif
+
 static int eth_mac_skip(int index)
 {
char enetvar[15];
-- 
1.7.2.5

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


[U-Boot] [PATCH v5 3/5] net: fix potential compiler warning

2012-05-11 Thread Michael Walle
Future compiler versions may generate a too many arguments for functions
warning.

Signed-off-by: Michael Walle mich...@walle.cc
Cc: Joe Hershberger joe.hershber...@gmail.com
---
 net/eth.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/net/eth.c b/net/eth.c
index c9f05d8..afce863 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -58,7 +58,12 @@ int eth_getenv_enetaddr_by_index(const char *base_name, int 
index,
 uchar *enetaddr)
 {
char enetvar[32];
-   sprintf(enetvar, index ? %s%daddr : %saddr, base_name, index);
+
+   if (index)
+   sprintf(enetvar, %s%daddr, base_name, index);
+   else
+   sprintf(enetvar, %saddr, base_name);
+
return eth_getenv_enetaddr(enetvar, enetaddr);
 }
 
@@ -66,7 +71,12 @@ static int eth_mac_skip(int index)
 {
char enetvar[15];
char *skip_state;
-   sprintf(enetvar, index ? eth%dmacskip : ethmacskip, index);
+
+   if (index)
+   sprintf(enetvar, eth%dmacskip, index);
+   else
+   sprintf(enetvar, ethmacskip);
+
return ((skip_state = getenv(enetvar)) != NULL);
 }
 
-- 
1.7.2.5

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


[U-Boot] [PATCH v5 2/5] net: add helper to generate random mac address

2012-05-11 Thread Michael Walle
Add new function eth_random_enetaddr() to generate a locally administered
ethernet address.

Signed-off-by: Michael Walle mich...@walle.cc
Cc: Joe Hershberger joe.hershber...@gmail.com
---
 include/net.h |   17 +
 net/eth.c |   22 ++
 2 files changed, 39 insertions(+), 0 deletions(-)

diff --git a/include/net.h b/include/net.h
index ee11f82..f6aeba2 100644
--- a/include/net.h
+++ b/include/net.h
@@ -118,6 +118,23 @@ extern int eth_setenv_enetaddr(char *name, const uchar 
*enetaddr);
 extern int eth_getenv_enetaddr_by_index(const char *base_name, int index,
uchar *enetaddr);
 
+#ifdef CONFIG_RANDOM_MACADDR
+/*
+ * The u-boot policy does not allow hardcoded ethernet addresses. Under the
+ * following circumstances a random generated address is allowed:
+ *  - in emergency cases, where you need a working network connection to set
+ *the ethernet address.
+ *Eg. you want a rescue boot and don't have a serial port to access the
+ *CLI to set environment variables.
+ *
+ * In these cases, we generate a random locally administered ethernet address.
+ *
+ * Args:
+ *  enetaddr - returns 6 byte hardware address
+ */
+extern void eth_random_enetaddr(uchar *enetaddr);
+#endif
+
 extern int usb_eth_initialize(bd_t *bi);
 extern int eth_init(bd_t *bis);/* Initialize the 
device */
 extern int eth_send(volatile void *packet, int length);   /* Send a 
packet */
diff --git a/net/eth.c b/net/eth.c
index 3eeb908..c9f05d8 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -70,6 +70,28 @@ static int eth_mac_skip(int index)
return ((skip_state = getenv(enetvar)) != NULL);
 }
 
+#ifdef CONFIG_RANDOM_MACADDR
+void eth_random_enetaddr(uchar *enetaddr)
+{
+   uint32_t rval;
+
+   srand(get_timer(0));
+
+   rval = rand();
+   enetaddr[0] = rval  0xff;
+   enetaddr[1] = (rval  8)  0xff;
+   enetaddr[2] = (rval  16)  0xff;
+
+   rval = rand();
+   enetaddr[3] = rval  0xff;
+   enetaddr[4] = (rval  8)  0xff;
+   enetaddr[5] = (rval  16)  0xff;
+
+   /* make sure it's local and unicast */
+   enetaddr[0] = (enetaddr[0] | 0x02)  ~0x01;
+}
+#endif
+
 /*
  * CPU and board-specific Ethernet initializations.  Aliased function
  * signals caller to move on
-- 
1.7.2.5

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


[U-Boot] [PATCH v5 5/5] Kirkwood: add lschlv2 and lsxhl board support

2012-05-11 Thread Michael Walle
This patch adds support for both the Linkstation Live (LS-CHLv2) and
Linkstation Pro (LS-XHL) by Buffalo.

Signed-off-by: Michael Walle mich...@walle.cc
Cc: Prafulla Wadaskar prafu...@marvell.com
---
 MAINTAINERS   |5 +
 board/buffalo/lsxl/Makefile   |   50 ++
 board/buffalo/lsxl/kwbimage-lschl.cfg |  229 +
 board/buffalo/lsxl/kwbimage-lsxhl.cfg |  229 +
 board/buffalo/lsxl/lsxl.c |  302 +
 board/buffalo/lsxl/lsxl.h |   75 
 boards.cfg|2 +
 include/configs/lsxl.h|  182 
 8 files changed, 1074 insertions(+), 0 deletions(-)
 create mode 100644 board/buffalo/lsxl/Makefile
 create mode 100644 board/buffalo/lsxl/kwbimage-lschl.cfg
 create mode 100644 board/buffalo/lsxl/kwbimage-lsxhl.cfg
 create mode 100644 board/buffalo/lsxl/lsxl.c
 create mode 100644 board/buffalo/lsxl/lsxl.h
 create mode 100644 include/configs/lsxl.h

diff --git a/MAINTAINERS b/MAINTAINERS
index e2441d8..929ba6f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -894,6 +894,11 @@ Prafulla Wadaskar prafu...@marvell.com
rd6281a ARM926EJS (Kirkwood SoC)
sheevaplug  ARM926EJS (Kirkwood SoC)
 
+Michael Walle mich...@walle.cc
+
+   lschlv2 ARM926EJS (Kirkwood SoC)
+   lsxhl   ARM926EJS (Kirkwood SoC)
+
 Tom Warren twar...@nvidia.com
 
harmony Tegra2 (ARM7  A9 Dual Core)
diff --git a/board/buffalo/lsxl/Makefile b/board/buffalo/lsxl/Makefile
new file mode 100644
index 000..d06c882
--- /dev/null
+++ b/board/buffalo/lsxl/Makefile
@@ -0,0 +1,50 @@
+#
+# Copyright (c) 2012 Michael Walle
+# Michael Walle mich...@walle.cc
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := lsxl.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak .depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/buffalo/lsxl/kwbimage-lschl.cfg 
b/board/buffalo/lsxl/kwbimage-lschl.cfg
new file mode 100644
index 000..2b9b3cd
--- /dev/null
+++ b/board/buffalo/lsxl/kwbimage-lschl.cfg
@@ -0,0 +1,229 @@
+#
+# Copyright (c) 2012 Michael Walle
+# Michael Walle mich...@walle.cc
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+# Refer docs/README.kwimage for more details about how-to configure
+# and create kirkwood boot image
+#
+
+# Boot Media configurations
+BOOT_FROM spi
+
+# SOC registers configuration using bootrom header extension
+# Maximum KWBIMAGE_MAX_CONFIG configurations allowed
+
+# Configure RGMII-0/1 interface pad voltage to 1.8V
+DATA 0xFFD100E0 0x1B1B1B9B
+
+# L2 RAM Timing 0
+DATA 0xFFD20134 0x
+# not further specified in HW manual, timing taken from original vendor port
+
+# L2 RAM Timing 1
+DATA 0xFFD20138 0x00BB
+# not further specified in HW manual, timing taken from original vendor port
+
+# DDR Configuration register
+DATA 0xFFD01400 0x43000618

Re: [U-Boot] [PATCH v5 4/5] net: add eth_setenv_enetaddr_by_index()

2012-05-11 Thread Michael Walle
Am Samstag 12 Mai 2012, 00:50:48 schrieb Michael Walle:
 Signed-off-by: Michael Walle mich...@walle.cc
 Cc: Joe Hershberger joe.hershber...@gmail.com
 ---
  include/net.h |   16 
  net/eth.c |   15 +++
  2 files changed, 31 insertions(+), 0 deletions(-)
 
 diff --git a/include/net.h b/include/net.h
 index f6aeba2..bdc3da6 100644
 --- a/include/net.h
 +++ b/include/net.h
 @@ -104,7 +104,9 @@ extern struct eth_device *eth_get_dev_by_index(int
 index); /* get dev @ index */ extern int eth_get_dev_index (void);
/* get
 the device index */
  extern void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
  extern int eth_getenv_enetaddr(char *name, uchar *enetaddr);
 +#ifdef CONFIG_SETENV_ENETADDR_BY_INDEX
  extern int eth_setenv_enetaddr(char *name, const uchar *enetaddr);
 +#endif

sorry, wrong function, will be corrected in next version.

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


[U-Boot] [PATCH v8 03/23] Add abs() macro to return absolute value

2012-05-11 Thread Simon Glass
This macro is generally useful to make it available in common.

This version is taken directly from the Linux kernel include/linux/kernel.h

Signed-off-by: Simon Glass s...@chromium.org
---
Changes in v3:
- Add new patch to put abs() in common.h

Changes in v6:
- Update x86emu and omap4 to use the abs() macro

Changes in v7:
- Use a really simple abs() macro for now

Changes in v8:
- Go back to the complex abs() macro, but use the kernel version now

 arch/arm/cpu/armv7/omap4/clocks.c   |2 --
 drivers/bios_emulator/x86emu/prim_ops.c |5 -
 include/common.h|   25 +
 3 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/clocks.c 
b/arch/arm/cpu/armv7/omap4/clocks.c
index e2189f7..ce3f59c 100644
--- a/arch/arm/cpu/armv7/omap4/clocks.c
+++ b/arch/arm/cpu/armv7/omap4/clocks.c
@@ -46,8 +46,6 @@
 #define puts(s)
 #endif
 
-#define abs(x) (((x)  0) ? ((x)*-1) : (x))
-
 struct omap4_prcm_regs *const prcm = (struct omap4_prcm_regs *)0x4A004100;
 
 const u32 sys_clk_array[8] = {
diff --git a/drivers/bios_emulator/x86emu/prim_ops.c 
b/drivers/bios_emulator/x86emu/prim_ops.c
index 7553087..5f6c795 100644
--- a/drivers/bios_emulator/x86emu/prim_ops.c
+++ b/drivers/bios_emulator/x86emu/prim_ops.c
@@ -118,11 +118,6 @@ static u32 x86emu_parity_tab[8] =
 
 #define PARITY(x)   (((x86emu_parity_tab[(x) / 32]  ((x) % 32))  1) == 0)
 #define XOR2(x)(((x) ^ ((x)1))  0x1)
-/*- Implementation */
-int abs(int v)
-{
-   return (v0)?v:-v;
-}
 
 /*- Implementation */
 
diff --git a/include/common.h b/include/common.h
index 4b5841e..ff7126d 100644
--- a/include/common.h
+++ b/include/common.h
@@ -222,6 +222,31 @@ typedef void (interrupt_handler_t)(void *);
 #define MIN(x, y)  min(x, y)
 #define MAX(x, y)  max(x, y)
 
+/*
+ * Return the absolute value of a number.
+ *
+ * This handles unsigned and signed longs, ints, shorts and chars.  For all
+ * input types abs() returns a signed long.
+ *
+ * For 64-bit types, use abs64()
+ */
+#define abs(x) ({  \
+   long ret;   \
+   if (sizeof(x) == sizeof(long)) {\
+   long __x = (x); \
+   ret = (__x  0) ? -__x : __x;   \
+   } else {\
+   int __x = (x);  \
+   ret = (__x  0) ? -__x : __x;   \
+   }   \
+   ret;\
+   })
+
+#define abs64(x) ({\
+   s64 __x = (x);  \
+   (__x  0) ? -__x : __x; \
+   })
+
 #if defined(CONFIG_ENV_IS_EMBEDDED)
 #define TOTAL_MALLOC_LEN   CONFIG_SYS_MALLOC_LEN
 #elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE)  CONFIG_SYS_MONITOR_BASE) || \
-- 
1.7.7.3

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


Re: [U-Boot] [PATCH] spi: Tegra2: Seaboard: fix UART corruption during SPI transactions

2012-05-11 Thread Simon Glass
Hi Tom,

On Fri, May 11, 2012 at 1:14 PM, jimmzhang jimmzh...@nvidia.com wrote:

 On Wed, 2012-05-09 at 10:34 -0700, Tom Warren wrote:
  Simon Glass's proposal to fix this on Seaboard was NAK'd, so I
  removed his NS16550 references and added a small delay before
  SPI/UART muxing. Tested on my Seaboard with large SPI reads/writes
  and saw no corruption (crc's matched) and no spurious comm chars.\


I'm afraid this version does not work fully for me. The problem is I think
that the UART gets zero bytes in it from when the SPI was active. This
causes the next command to be ignored. So for example:

Tegra2 (SeaBoard) # echo fred
fred
Tegra2 (SeaBoard) # echo edmund
edmund
Tegra2 (SeaBoard) # saveenv
Saving Environment to SPI Flash...
Erasing SPI flash...Writing to SPI flash...done
Tegra2 (SeaBoard) # echo blackadder

 this command does nothing!

Tegra2 (SeaBoard) # echo blackadder
blackadder
Tegra2 (SeaBoard) #

This is the reason why my original patch cleaned out the UART before
reading further characters. If that logic really in impossible to have in
U-Boot then the only option is (after a SPI operation) to read UART output
using tstc() and getc() until there is nothing more. Ick.

That said, this is an improvement, since it allows SPI to work. So I am
going to ack it so we can hopefully get it in there.

Acked-by: Simon Glass s...@chromium.org



 
  Signed-off-by: Tom Warren twar...@nvidia.com

 Tested-by: Jimmy Zhang jimmzh...@nvidia.com




 ---
 This email message is for the sole use of the intended recipient(s) and
 may contain
 confidential information.  Any unauthorized review, use, disclosure or
 distribution
 is prohibited.  If you are not the intended recipient, please contact the
 sender by
 reply email and destroy all copies of the original message.

 ---


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


[U-Boot] [PATCH] mx53: Fix mask for SATA reference clock

2012-05-11 Thread Fabio Estevam
From: Fabio Estevam fabio.este...@freescale.com

SATA_ALT_REF_CLK field corresponds to bits 1 and 2 of offset 0x180c.

Fix the mask for these bits.

Signed-off-by: Fabio Estevam fabio.este...@freescale.com
---
Stefano,

I don't have a SATA disk handy to try this.

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

diff --git a/arch/arm/cpu/armv7/mx5/clock.c b/arch/arm/cpu/armv7/mx5/clock.c
index fc2406b..64862b3 100644
--- a/arch/arm/cpu/armv7/mx5/clock.c
+++ b/arch/arm/cpu/armv7/mx5/clock.c
@@ -843,7 +843,7 @@ void mxc_set_sata_internal_clock(void)
 
set_usb_phy1_clk();
 
-   writel((readl(tmp_base)  (~0x7)) | 0x4, tmp_base);
+   writel((readl(tmp_base)  (~0x6)) | 0x4, tmp_base);
 }
 #endif
 
-- 
1.7.1

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