[U-Boot] [PATCH] remove-flash.c-in-board-dbau1x00

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
Hi

when I run "CROSS_COMPILE=mips_4KCle- ./MAKEALL mips_el". I got those[1] errors.
this patch fixed that error. make board compile fine.
but I am not sure if the bin image works fine in device. please test it.

[1]
==
Configuring for dbau1x00 board...
board/dbau1x00/libdbau1x00.o: In function `flash_init':
/home/xiangfu/u-boot/u-boot.github/board/dbau1x00/flash.c:34: multiple 
definition of `flash_init'
drivers/mtd/libmtd.o:/home/xiangfu/u-boot/u-boot.github/drivers/mtd/cfi_flash.c:2027:
 first defined here
board/dbau1x00/libdbau1x00.o: In function `write_buff':
/home/xiangfu/u-boot/u-boot.github/board/dbau1x00/flash.c:40: multiple 
definition of `write_buff'
drivers/mtd/libmtd.o:/home/xiangfu/u-boot/u-boot.github/drivers/mtd/cfi_flash.c:1247:
 first defined here
make: *** [/home/xiangfu/u-boot/u-boot-build/u-boot] Error 1

 board/dbau1x00/Makefile |2 +-
 board/dbau1x00/flash.c  |   43 ---
 2 files changed, 1 insertions(+), 44 deletions(-)
 delete mode 100644 board/dbau1x00/flash.c

diff --git a/board/dbau1x00/Makefile b/board/dbau1x00/Makefile
index f1594a2..e36a9d2 100644
--- a/board/dbau1x00/Makefile
+++ b/board/dbau1x00/Makefile
@@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).o
 
-COBJS  = $(BOARD).o flash.o
+COBJS  = $(BOARD).o
 SOBJS  = lowlevel_init.o
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
diff --git a/board/dbau1x00/flash.c b/board/dbau1x00/flash.c
deleted file mode 100644
index a2fed1d..000
--- a/board/dbau1x00/flash.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * (C) Copyright 2003
- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
- *
- * 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 
-
-flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS];   /* info for FLASH chips 
*/
-
-/*---
- * flash_init()
- *
- * sets up flash_info and returns size of FLASH (bytes)
- */
-unsigned long flash_init (void)
-{
-   printf ("Skipping flash_init\n");
-   return (0);
-}
-
-int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt)
-{
-   printf ("write_buff not implemented\n");
-   return (-1);
-}
-- 
1.7.0.4

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


[U-Boot] [PATCH v2] OMAP3: add CM-T35 board

2010-12-07 Thread Mike Rapoport

This patch adds support for CM-T35 board

Signed-off-by: Mike Rapoport 
---

v2 changes:
* address Nishanth's comments

 MAINTAINERS  |4 +
 MAKEALL  |1 +
 board/cm_t35/Makefile|   47 ++
 board/cm_t35/cm_t35.c|  222 
 board/cm_t35/cm_t35.h|  184 +++
 board/cm_t35/config.mk   |   30 
 boards.cfg   |1 +
 doc/README.omap3 |   16 ++-
 include/configs/cm_t35.h |  369 ++
 9 files changed, 872 insertions(+), 2 deletions(-)
 create mode 100644 board/cm_t35/Makefile
 create mode 100644 board/cm_t35/cm_t35.c
 create mode 100644 board/cm_t35/cm_t35.h
 create mode 100644 board/cm_t35/config.mk
 create mode 100644 include/configs/cm_t35.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 9258cb1..b44b843 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -750,6 +750,10 @@ Stelian Pop 
at91sam9263ek   ARM926EJS (AT91SAM9263 SoC)
at91sam9rlekARM926EJS (AT91SAM9RL SoC)

+Mike Rapoport 
+
+   cm_t35  ARM ARMV7 (OMAP3xx SoC)
+
 Tom Rix 

omap3_zoom2 ARM ARMV7 (OMAP3xx SoC)
diff --git a/MAKEALL b/MAKEALL
index c54c6e8..e0fe12f 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -412,6 +412,7 @@ LIST_ARM11="\
 LIST_ARMV7="   \
am3517_evm  \
ca9x4_ct_vxp\
+   cm_t35  \
devkit8000  \
igep0020\
igep0030\
diff --git a/board/cm_t35/Makefile b/board/cm_t35/Makefile
new file mode 100644
index 000..320a817
--- /dev/null
+++ b/board/cm_t35/Makefile
@@ -0,0 +1,47 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := cm_t35.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/cm_t35/cm_t35.c b/board/cm_t35/cm_t35.c
new file mode 100644
index 000..21e8762
--- /dev/null
+++ b/board/cm_t35/cm_t35.c
@@ -0,0 +1,222 @@
+/*
+ * (C) Copyright 2010
+ * CompuLab, Ltd. 
+ *
+ * Author: Mike Rapoport 
+ *
+ * Derived from omap3evm and Beagle Board by
+ * Manikandan Pillai 
+ * Richard Woodruff 
+ * Syed Mohammed Khasim 
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "cm_t35.h"
+
+static u32 gpmc_net_config[GPMC_MAX_REG] = {
+   NET_GPMC_CONFIG1,
+   NET_GPMC_CONFIG2,
+   NET_GPMC_CONFIG3,
+   NET_GPMC_CONFIG4,
+   NET_GPMC_CONFIG5,
+   NET_GPMC_CONFIG6,
+   0
+};
+
+static u32 gpmc_nand_config[GPMC_MAX_REG] = {
+   SMNAND_GPMC_CONFIG1,
+   SMNAND_GPMC_CONFIG2,
+   SMNAND_GPMC_CONFIG3,
+   SMNAND_GPMC_CONFIG4,
+   SMNAND_GPMC_CONFIG5,
+   SMNAND_GPMC_CONFIG6,
+   0,
+};
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+   D

[U-Boot] [PATCH v4 5/7] add Ben NanoNote board

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 board/xburst/nanonote/Makefile|   45 
 board/xburst/nanonote/config.mk   |   31 ++
 board/xburst/nanonote/nanonote.c  |   96 +
 board/xburst/nanonote/u-boot-nand.lds |   63 +++
 include/configs/nanonote.h|  188 +
 include/configs/qi_lb60.h |   28 +
 6 files changed, 451 insertions(+), 0 deletions(-)
 create mode 100644 board/xburst/nanonote/Makefile
 create mode 100644 board/xburst/nanonote/config.mk
 create mode 100644 board/xburst/nanonote/nanonote.c
 create mode 100644 board/xburst/nanonote/u-boot-nand.lds
 create mode 100644 include/configs/nanonote.h
 create mode 100644 include/configs/qi_lb60.h

diff --git a/board/xburst/nanonote/Makefile b/board/xburst/nanonote/Makefile
new file mode 100644
index 000..2f5b4be
--- /dev/null
+++ b/board/xburst/nanonote/Makefile
@@ -0,0 +1,45 @@
+#
+# (C) Copyright 2006
+# Ingenic Semiconductor, 
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/xburst/nanonote/config.mk b/board/xburst/nanonote/config.mk
new file mode 100644
index 000..858e6a2
--- /dev/null
+++ b/board/xburst/nanonote/config.mk
@@ -0,0 +1,31 @@
+#
+# (C) Copyright 2006 Qi Hardware, Inc.
+# Author: Xiangfu Liu 
+#
+# 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
+#
+
+#
+# Qi Hardware, Inc. Ben NanoNote (QI_LB60)
+#
+
+ifndef TEXT_BASE
+# ROM version
+# TEXT_BASE = 0x8800
+
+# RAM version
+TEXT_BASE = 0x8010
+endif
diff --git a/board/xburst/nanonote/nanonote.c b/board/xburst/nanonote/nanonote.c
new file mode 100644
index 000..1a577e0
--- /dev/null
+++ b/board/xburst/nanonote/nanonote.c
@@ -0,0 +1,96 @@
+/*
+ * Authors: Xiangfu Liu 
+ *
+ * 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
+ * 3 of the License, or (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void gpio_init(void)
+{
+   /* Initialize NAND Flash Pins */
+   __gpio_as_nand();
+
+   /* Initialize SDRAM pins */
+   __gpio_as_sdram_16bit_4720();
+
+   /* Initialize LCD pins */
+   __gpio_as_lcd_18bit();
+
+   /* Initialize MSC pins */
+   __gpio_as_msc();
+
+   /* Initialize Other pins */
+   unsigned int i;
+   for (i = 0; i < 7; i++){
+   __gpio_as_input(GPIO_KEYIN_BASE + i);
+   __gpio_enable_pull(GPIO_KEYIN_BASE + i);
+   }
+
+   for (i = 0; i < 8; i++) {
+   __gpio_as_output(GPIO_KEYOUT_BASE + i);
+   __gpio_clear_pin(GPIO_KEYOUT_BASE + i);
+   }
+
+   __gpio_as_input(GPIO_KEYIN_8);
+   __gpio_enable_pull(GPIO_KEYIN_8);
+
+   /* enable the TP4, TP5 as UART0 */
+   __gpio_jtag_to_uart0();
+
+   __gpio_as_output(GPIO_AUDIO_POP);
+   __gpio_set_pin(GPIO_AUDIO_POP);
+
+   __gpio_as_output(GPIO_LCD_CS);
+   

[U-Boot] [PATCH v4 6/7] add entry to MAINTAINERS and boards.cfg

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 MAINTAINERS |4 
 boards.cfg  |1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index f47fca5..c6518f9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -900,6 +900,10 @@ Stefan Roese 
 
vct_xxx MIPS32 4Kc
 
+Xiangfu Liu 
+
+   qi_lb60 MIPS32 jz4740
+
 #
 # Nios-II Systems: #
 #  #
diff --git a/boards.cfg b/boards.cfg
index 2209676..c7ae650 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -202,6 +202,7 @@ EP2500   m68kmcf52x2 ep2500 
 Mercury
 microblaze-generic   microblaze  microblaze  microblaze-generic  xilinx
 purple   mipsmips
 tb0229   mipsmips
+qi_lb60  mipsmips
 PCI5441  nios2   nios2   pci5441 psyent
 PK1C20   nios2   nios2   pk1c20  psyent
 EVB64260 powerpc 74xx_7xxevb64260- 
 -   EVB64260
-- 
1.7.0.4

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


[U-Boot] [PATCH v4 2/7] this is jz4740 head file

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 arch/mips/include/asm/jz4740.h | 1380 
 1 files changed, 1380 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/include/asm/jz4740.h

diff --git a/arch/mips/include/asm/jz4740.h b/arch/mips/include/asm/jz4740.h
new file mode 100644
index 000..5be26dc
--- /dev/null
+++ b/arch/mips/include/asm/jz4740.h
@@ -0,0 +1,1380 @@
+/*
+ * Include file for Ingenic Semiconductor's JZ4740 CPU.
+ */
+#ifndef __JZ4740_H__
+#define __JZ4740_H__
+
+#include 
+#include 
+
+/* Boot ROM Specification  */
+/* NOR Boot config */
+#define JZ4740_NORBOOT_8BIT0x  /* 8-bit data bus flash */
+#define JZ4740_NORBOOT_16BIT   0x10101010  /* 16-bit data bus flash */
+#define JZ4740_NORBOOT_32BIT   0x20202020  /* 32-bit data bus flash */
+/* NAND Boot config */
+#define JZ4740_NANDBOOT_B8R3   0x  /* 8-bit bus & 3 row cycles */
+#define JZ4740_NANDBOOT_B8R2   0xf0f0f0f0  /* 8-bit bus & 2 row cycles */
+#define JZ4740_NANDBOOT_B16R3  0x0f0f0f0f  /* 16-bit bus & 3 row cycles */
+#define JZ4740_NANDBOOT_B16R2  0x  /* 16-bit bus & 2 row cycles */
+
+/* Register Definitions */
+#defineCPM_BASE0xB000
+#defineINTC_BASE   0xB0001000
+#defineTCU_BASE0xB0002000
+#defineWDT_BASE0xB0002000
+#defineRTC_BASE0xB0003000
+#defineGPIO_BASE   0xB001
+#defineAIC_BASE0xB002
+#defineICDC_BASE   0xB002
+#defineMSC_BASE0xB0021000
+#defineUART0_BASE  0xB003
+#defineI2C_BASE0xB0042000
+#defineSSI_BASE0xB0043000
+#defineSADC_BASE   0xB007
+#defineEMC_BASE0xB301
+#defineDMAC_BASE   0xB302
+#defineUHC_BASE0xB303
+#defineUDC_BASE0xB304
+#defineLCD_BASE0xB305
+#defineSLCD_BASE   0xB305
+#defineCIM_BASE0xB306
+#defineETH_BASE0xB310
+
+/*
+ * INTC (Interrupt Controller)
+ */
+#define INTC_ISR   (INTC_BASE + 0x00)
+#define INTC_IMR   (INTC_BASE + 0x04)
+#define INTC_IMSR  (INTC_BASE + 0x08)
+#define INTC_IMCR  (INTC_BASE + 0x0c)
+#define INTC_IPR   (INTC_BASE + 0x10)
+
+
+/* 1st-level interrupts */
+#define IRQ_I2C1
+#define IRQ_UHC3
+#define IRQ_UART0  9
+#define IRQ_SADC   12
+#define IRQ_MSC14
+#define IRQ_RTC15
+#define IRQ_SSI16
+#define IRQ_CIM17
+#define IRQ_AIC18
+#define IRQ_ETH19
+#define IRQ_DMAC   20
+#define IRQ_TCU2   21
+#define IRQ_TCU1   22
+#define IRQ_TCU0   23
+#define IRQ_UDC24
+#define IRQ_GPIO3  25
+#define IRQ_GPIO2  26
+#define IRQ_GPIO1  27
+#define IRQ_GPIO0  28
+#define IRQ_IPU29
+#define IRQ_LCD30
+
+/* 2nd-level interrupts */
+#define IRQ_DMA_0  32  /* 32 to 37 for DMAC channel 0 to 5 */
+#define IRQ_GPIO_0 48  /* 48 to 175 for GPIO pin 0 to 127 */
+
+/*
+ * RTC
+ */
+#define RTC_RCR(RTC_BASE + 0x00) /* RTC Control Register */
+#define RTC_RSR(RTC_BASE + 0x04) /* RTC Second Register */
+#define RTC_RSAR   (RTC_BASE + 0x08) /* RTC Second Alarm Register */
+#define RTC_RGR(RTC_BASE + 0x0c) /* RTC Regulator Register */
+
+#define RTC_HCR(RTC_BASE + 0x20) /* Hibernate Control Register 
*/
+#define RTC_HWFCR  (RTC_BASE + 0x24) /* Hibernate Wakeup Filter Counter 
Reg */
+#define RTC_HRCR   (RTC_BASE + 0x28) /* Hibernate Reset Counter Register */
+#define RTC_HWCR   (RTC_BASE + 0x2c) /* Hibernate Wakeup Control Register 
*/
+#define RTC_HWRSR  (RTC_BASE + 0x30) /* Hibernate Wakeup Status Register */
+#define RTC_HSPR   (RTC_BASE + 0x34) /* Hibernate Scratch Pattern Register 
*/
+
+
+/* RTC Control Register */
+#define RTC_RCR_WRDY   (1 << 7)  /* Write Ready Flag */
+#define RTC_RCR_HZ (1 << 6)  /* 1Hz Flag */
+#define RTC_RCR_HZIE   (1 << 5)  /* 1Hz Interrupt Enable */
+#define RTC_RCR_AF (1 << 4)  /* Alarm Flag */
+#define RTC_RCR_AIE(1 << 3)  /* Alarm Interrupt Enable */
+#define RTC_RCR_AE (1 << 2)  /* Alarm Enable */
+#define RTC_RCR_RTCE   (1 << 0)  /* RTC Enable */
+
+/* RTC Regulator Register */
+#define RTC_RGR_LOCK   (1 << 31) /* Lock Bit */
+#define RTC_RGR_ADJC_BIT   16
+#define RTC_RGR_ADJC_MASK  (0x3ff << RTC_RGR_ADJC_BIT)
+#define RTC_RGR_NC1HZ_BIT  0
+#define RTC_RGR_NC1HZ_MASK (0x << RTC_RGR_NC1HZ_BIT)
+
+/* Hibernate Control Register */
+#define RTC_HCR_PD (1 << 0)  /* Power Down */
+
+/* Hibernate Wakeup Filter Counter Register */
+#define RTC_HWFCR_BIT  5
+#define RTC_HWFCR_MASK (0x7ff << RTC_HWFCR_BIT)
+
+/* Hibernate Reset Counter Register */
+#

[U-Boot] [PATCH v4 4/7] jz4740 nand driver

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 drivers/mtd/nand/Makefile  |1 +
 drivers/mtd/nand/jz4740_nand.c |  252 
 2 files changed, 253 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/nand/jz4740_nand.c

diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 8b598f6..bf2a8f9 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -50,6 +50,7 @@ COBJS-$(CONFIG_NAND_S3C64XX) += s3c64xx.o
 COBJS-$(CONFIG_NAND_SPEAR) += spr_nand.o
 COBJS-$(CONFIG_NAND_OMAP_GPMC) += omap_gpmc.o
 COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
+COBJS-$(CONFIG_NAND_JZ4740) += jz4740_nand.o
 endif
 
 COBJS  := $(COBJS-y)
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
new file mode 100644
index 000..e82d7d3
--- /dev/null
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -0,0 +1,252 @@
+/*
+ * Platform independend driver for JZ4740.
+ *
+ * Copyright (c) 2007 Ingenic Semiconductor Inc.
+ * Author: 
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ */
+#include 
+
+#if defined(CONFIG_CMD_NAND)
+#include 
+#include 
+#include 
+
+#define JZ_NAND_DATA_ADDR ((void __iomem *)0xB800)
+#define JZ_NAND_CMD_ADDR (JZ_NAND_DATA_ADDR + 0x8000)
+#define JZ_NAND_ADDR_ADDR (JZ_NAND_DATA_ADDR + 0x1)
+
+#define BIT(x) (1 << (x))
+#define JZ_NAND_ECC_CTRL_ENCODING  BIT(3)
+#define JZ_NAND_ECC_CTRL_RSBIT(2)
+#define JZ_NAND_ECC_CTRL_RESET BIT(1)
+#define JZ_NAND_ECC_CTRL_ENABLEBIT(0)
+
+static struct nand_ecclayout qi_lb60_ecclayout_2gb = {
+   .eccbytes = 72,
+   .eccpos = {
+   12, 13, 14, 15, 16, 17, 18, 19,
+   20, 21, 22, 23, 24, 25, 26, 27, 
+   28, 29, 30, 31, 32, 33, 34, 35,
+   36, 37, 38, 39, 40, 41, 42, 43,
+   44, 45, 46, 47, 48, 49, 50, 51, 
+   52, 53, 54, 55, 56, 57, 58, 59, 
+   60, 61, 62, 63, 64, 65, 66, 67, 
+   68, 69, 70, 71, 72, 73, 74, 75, 
+   76, 77, 78, 79, 80, 81, 82, 83},
+   .oobfree = {
+   {.offset = 2,
+.length = 10},
+   {.offset = 84,
+.length = 44}}
+};
+
+static int is_reading;
+
+static void jz_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
+{
+   struct nand_chip *this = mtd->priv;
+
+   if (ctrl & NAND_CTRL_CHANGE) {
+   if (ctrl & NAND_ALE)
+   this->IO_ADDR_W = JZ_NAND_ADDR_ADDR;
+   else if (ctrl & NAND_CLE)
+   this->IO_ADDR_W = JZ_NAND_CMD_ADDR;
+   else
+   this->IO_ADDR_W = JZ_NAND_DATA_ADDR;
+
+   if (ctrl & NAND_NCE)
+   writel(readl(EMC_NFCSR) | EMC_NFCSR_NFCE1, EMC_NFCSR); 
+   else
+   writel(readl(EMC_NFCSR) & ~EMC_NFCSR_NFCE1, EMC_NFCSR);
+   }
+
+   if (cmd != NAND_CMD_NONE)
+   writeb(cmd, this->IO_ADDR_W);
+}
+
+static int jz_nand_device_ready(struct mtd_info *mtd)
+{
+   udelay(20);
+   return (readl(GPIO_PXPIN(2)) & 0x4000) ? 1 : 0;
+}
+
+void board_nand_select_device(struct nand_chip *nand, int chip)
+{
+   /*
+* Don't use "chip" to address the NAND device,
+* generate the cs from the address where it is encoded.
+*/
+}
+
+static int jz_nand_rs_calculate_ecc(struct mtd_info* mtd, const u_char* dat,
+   u_char* ecc_code)
+{
+   uint32_t status;
+   int i;
+   volatile u8 *paraddr = (volatile u8 *)EMC_NFPAR0;
+
+   if (is_reading)
+   return 0;
+
+   do {
+   status = readl(EMC_NFINTS);
+   } while(!(status & EMC_NFINTS_ENCF));
+
+   /* disable ecc */
+   writel(readl(EMC_NFECR) & ~EMC_NFECR_ECCE, EMC_NFECR);
+
+   for (i = 0; i < 9; i++)
+   ecc_code[i] = *(paraddr + i);
+
+   return 0;
+}
+
+static void jz_nand_hwctl(struct mtd_info* mtd, int mode)
+{
+   uint32_t reg;
+
+   writel(0, EMC_NFINTS);
+   reg = readl(EMC_NFECR);
+   reg |= JZ_NAND_ECC_CTRL_RESET;
+   reg |= JZ_NAND_ECC_CTRL_ENABLE;
+   reg |= JZ_NAND_ECC_CTRL_RS;
+
+   switch (mode) {
+   case NAND_ECC_READ:
+   reg &= ~JZ_NAND_ECC_CTRL_ENCODING;
+   is_reading = 1;
+   break;
+   case NAND_ECC_WRITE:
+   reg |= JZ_NAND_ECC_CTRL_ENCODING;
+   is_reading = 0;
+   break;
+   default:
+   break;
+   }
+
+   writel(reg, EMC_NFECR);
+}
+
+/* Correct 1~9-bit errors in 512-bytes data */
+static void jz_rs_correct(unsigned char *dat, int idx, int mask)
+{
+   int i;
+
+   idx--;
+
+   i = idx + (idx >> 3);
+   if (i >= 

[U-Boot] [PATCH v4 0/7] those series patches for add ben nanonote board

2010-12-07 Thread Xiangfu Liu
Hi Wolfgang
  those patches are for add xburst jz4740 and Ben NanoNote(named qi_lb60) to 
U-Boot

some info about xburst jz4740:
  the xburst jz4740 is recently added to linux 2.6.36
  and it's support the device Ben NanoNote out of box,

  this xburst jz4740 cpu have one feature is Boot From USB, there is a 
  small rom in jz4740, but LOW some PIN, the cpu will boot to this small
  rom, then init cpu and USB module, then we can send 8KB bin file to 
  the cpu by USB(by using 'xbboot' or 'usbboot'[1]).

  which means if your bootloader is borken,(the first few KBs in NAND)
  you can always boot the device from usb, then reflash the nand.

  in OpenMoko FreeRunner, there are NOR and NAND. when people broken the 
  nand bootloader, it's must boot from NOR, reflash the bootloader back
  when people broken the NAND and NOR, he(she) must reflash by using JTAG
  but in Ben NanoNote, we just need boot from usb. flash the nand again :)

  BTW:there are a lot of PMP, Audio device in China use the Xburst cpu,
  but I think they are all base on u-boot 1.1.6. by working on
  Ben NanoNote (http://en.qi-hardware.com) one year, we try to
  update the u-boot to last version and send it to upstream. :)

for more info about Ingenic Xburst JZ4740
  http://www.ingenic.cn/eng/default.aspx
  http://www.linux-mips.org/wiki/Ingenic


FIXED in [PATCH v3]
  1. describe what Jz4740 SoC
  2. remove the ENDIANNESS in config.mk
  3. don't breaks the 80-charcter-wide rule
  4. get rid of #if 0
  5. use proper I/O accessors to access registers.
  6. remove C++ comments, cleanup code style.

FIXED in [PATCH v4]
  1. add Entry to MAINTAINERS and boards.cfg
  2. add ben nanonote(qi_lb60) to Makefile
  3. tested with CROSS_COMPILE=mips_4KCle- ./MAKEALL mips_el

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


[U-Boot] [PATCH v4 7/7] modify files for ben nanonote board

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 MAKEALL |4 +++-
 Makefile|   10 ++
 arch/mips/include/asm/global_data.h |9 +
 arch/mips/lib/board.c   |8 
 arch/mips/lib/time.c|2 ++
 5 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/MAKEALL b/MAKEALL
index 767d561..8631cc5 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -541,7 +541,9 @@ LIST_mips=" \
 ## MIPS Systems(little endian)
 #
 
-LIST_mips4kc_el=""
+LIST_mips4kc_el="  \
+   qi_lb60
+"
 
 LIST_mips5kc_el=""
 
diff --git a/Makefile b/Makefile
index 0685ef9..62e59e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1176,6 +1176,16 @@ qemu_mips_config : unconfig
@echo "#define CONFIG_QEMU_MIPS 1" >$(obj)include/config.h
@$(MKCONFIG) -a qemu-mips mips mips qemu-mips
 
+#
+## MIPS32 XBurst jz4740
+#
+qi_lb60_config  : unconfig
+   @mkdir -p $(obj)include
+   @echo "#define CONFIG_NAND_U_BOOT" > $(obj)include/config.h
+   @echo "Compile NAND boot image for QI LB60"
+   @$(MKCONFIG) -a qi_lb60 mips xburst nanonote xburst
+   @echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk
+
 #
 # Nios
 #
diff --git a/arch/mips/include/asm/global_data.h 
b/arch/mips/include/asm/global_data.h
index 271a290..256f242 100644
--- a/arch/mips/include/asm/global_data.h
+++ b/arch/mips/include/asm/global_data.h
@@ -39,6 +39,15 @@
 typedefstruct  global_data {
bd_t*bd;
unsigned long   flags;
+#if defined(CONFIG_JZSOC)
+/* There are other clocks in the jz4740 */
+unsigned long   cpu_clk;/* CPU core clock */
+unsigned long   sys_clk;/* System bus clock */
+unsigned long   per_clk;/* Peripheral bus clock */
+unsigned long   mem_clk;/* Memory bus clock */
+unsigned long   dev_clk;/* Device clock */
+unsigned long   fb_base;/* base address of framebuffer */
+#endif
unsigned long   baudrate;
unsigned long   have_console;   /* serial_init() was called */
phys_size_t ram_size;   /* RAM size */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index f317124..9115055 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -136,10 +136,18 @@ static int init_baudrate (void)
  * argument, and returns an integer return code, where 0 means
  * "continue" and != 0 means "fatal error, hang the system".
  */
+
+#if defined(CONFIG_JZSOC)
+extern int jzsoc_init(void);
+#endif
+
 typedef int (init_fnc_t) (void);
 
 init_fnc_t *init_sequence[] = {
board_early_init_f,
+#if defined(CONFIG_JZSOC)
+   jzsoc_init, /* init gpio/clocks/dram etc. */
+#endif
timer_init,
env_init,   /* initialize environment */
 #ifdef CONFIG_INCA_IP
diff --git a/arch/mips/lib/time.c b/arch/mips/lib/time.c
index 0e66441..653be6c 100644
--- a/arch/mips/lib/time.c
+++ b/arch/mips/lib/time.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 
+#ifndef CONFIG_JZSOC
 static unsigned long timestamp;
 
 /* how many counter cycles in a jiffy */
@@ -96,3 +97,4 @@ ulong get_tbclk(void)
 {
return CONFIG_SYS_HZ;
 }
+#endif
-- 
1.7.0.4

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


[U-Boot] [PATCH v4 3/7] jz4740 nand spl files

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 nand_spl/board/xburst/nanonote/Makefile   |   96 
 nand_spl/board/xburst/nanonote/u-boot.lds |   63 ++
 nand_spl/nand_boot_jz4740.c   |  344 +
 3 files changed, 503 insertions(+), 0 deletions(-)
 create mode 100644 nand_spl/board/xburst/nanonote/Makefile
 create mode 100644 nand_spl/board/xburst/nanonote/u-boot.lds
 create mode 100644 nand_spl/nand_boot_jz4740.c

diff --git a/nand_spl/board/xburst/nanonote/Makefile 
b/nand_spl/board/xburst/nanonote/Makefile
new file mode 100644
index 000..f5d1eb5
--- /dev/null
+++ b/nand_spl/board/xburst/nanonote/Makefile
@@ -0,0 +1,96 @@
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering, s...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+TEXT_BASE = 0x8000
+
+LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
+LDFLAGS= -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE)
+AFLAGS += -DCONFIG_NAND_SPL
+CFLAGS += -DCONFIG_NAND_SPL -O2
+
+SOBJS  = start.o usbboot.o
+COBJS  = nand_boot_jz4740.o cpu.o jz4740.o jz_serial.o
+
+SRCS   := $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS := $(SOBJS) $(COBJS)
+LNDIR  := $(OBJTREE)/nand_spl/board/$(BOARDDIR)
+
+nandobj:= $(OBJTREE)/nand_spl/
+
+ALL= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin 
$(nandobj)u-boot-spl-16k.bin
+all:   $(obj).depend $(ALL)
+
+$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl.bin
+   dd bs=1024 count=8 if=/dev/zero of=$(nandobj)junk1
+   cat $< $(nandobj)junk1 > $(nandobj)junk2
+   dd bs=1024 count=8 if=$(nandobj)junk2 of=$(nandobj)junk3
+   cat $(nandobj)junk3 $(nandobj)junk3 > $(nandobj)junk4
+   dd bs=1024 count=256 if=/dev/zero of=$(nandobj)junk5
+   cat $(nandobj)junk4 $(nandobj)junk5 > $(nandobj)junk6
+   dd bs=1024 count=256 if=$(nandobj)junk6 of=$@
+   rm -f $(nandobj)junk*
+
+$(nandobj)u-boot-spl.bin:  $(nandobj)u-boot-spl
+   $(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(nandobj)u-boot-spl:  $(OBJS)
+   cd $(LNDIR) && $(LD) $(LDFLAGS) $$UNDEF_SYM $(__OBJS) \
+   -Map $(nandobj)u-boot-spl.map \
+   -o $(nandobj)u-boot-spl
+
+# create symbolic links for common files
+$(obj)start.S:
+   @rm -f $(obj)start.S
+   ln -s $(SRCTREE)/arch/mips/cpu/xburst/start_spl.S $(obj)start.S
+
+$(obj)usbboot.S:
+   @rm -f $(obj)usbboot.S
+   ln -s $(SRCTREE)/arch/mips/cpu/xburst/usbboot.S $(obj)usbboot.S
+
+$(obj)cpu.c:
+   @rm -f $(obj)cpu.c
+   ln -s $(SRCTREE)/arch/mips/cpu/xburst/cpu.c $(obj)cpu.c
+
+$(obj)jz4740.c:
+   @rm -f $(obj)jz4740.c
+   ln -s $(SRCTREE)/arch/mips/cpu/xburst/jz4740.c $(obj)jz4740.c
+
+$(obj)jz_serial.c:
+   @rm -f $(obj)jz_serial.c
+   ln -s $(SRCTREE)/arch/mips/cpu/xburst/jz_serial.c $(obj)jz_serial.c
+
+$(obj)nand_boot_jz4740.c:
+   @rm -f $(obj)nand_boot_jz4740.c
+   ln -s $(SRCTREE)/nand_spl/nand_boot_jz4740.c $(obj)nand_boot_jz4740.c
+
+$(obj)%.o: $(obj)%.S
+   $(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o: $(obj)%.c
+   $(CC) $(CFLAGS) -c -o $@ $<
+
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/nand_spl/board/xburst/nanonote/u-boot.lds 
b/nand_spl/board/xburst/nanonote/u-boot.lds
new file mode 100644
index 000..7042388
--- /dev/null
+++ b/nand_spl/board/xburst/nanonote/u-boot.lds
@@ -0,0 +1,63 @@
+/*
+ * (C) Copyright 2005
+ * Ingenic Semiconductor, 
+ *
+ * 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
+ *

[U-Boot] [PATCH v4 1/7] those files are jz4740 base files

2010-12-07 Thread Xiangfu Liu
Signed-off-by: Xiangfu Liu 
---
 arch/mips/cpu/xburst/Makefile|   50 +++
 arch/mips/cpu/xburst/config.mk   |   33 ++
 arch/mips/cpu/xburst/cpu.c   |  160 
 arch/mips/cpu/xburst/jz4740.c|  266 
 arch/mips/cpu/xburst/jz_serial.c |  128 ++
 arch/mips/cpu/xburst/start.S |  164 
 arch/mips/cpu/xburst/start_spl.S |   63 +++
 arch/mips/cpu/xburst/timer.c |  172 
 arch/mips/cpu/xburst/usbboot.S   |  841 ++
 9 files changed, 1877 insertions(+), 0 deletions(-)
 create mode 100644 arch/mips/cpu/xburst/Makefile
 create mode 100644 arch/mips/cpu/xburst/config.mk
 create mode 100644 arch/mips/cpu/xburst/cpu.c
 create mode 100644 arch/mips/cpu/xburst/jz4740.c
 create mode 100644 arch/mips/cpu/xburst/jz_serial.c
 create mode 100644 arch/mips/cpu/xburst/start.S
 create mode 100644 arch/mips/cpu/xburst/start_spl.S
 create mode 100644 arch/mips/cpu/xburst/timer.c
 create mode 100644 arch/mips/cpu/xburst/usbboot.S

diff --git a/arch/mips/cpu/xburst/Makefile b/arch/mips/cpu/xburst/Makefile
new file mode 100644
index 000..a9a6e77
--- /dev/null
+++ b/arch/mips/cpu/xburst/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2000-2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(CPU).o
+
+START  = start.o
+SOBJS-y= 
+COBJS-y = cpu.o timer.o jz_serial.o 
+
+COBJS-$(CONFIG_JZ4740) += jz4740.o
+
+SRCS   := $(START:.o=.S) $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
+START  := $(addprefix $(obj),$(START))
+
+all:   $(obj).depend $(START) $(LIB)
+
+$(LIB):$(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/mips/cpu/xburst/config.mk b/arch/mips/cpu/xburst/config.mk
new file mode 100644
index 000..fc9b255
--- /dev/null
+++ b/arch/mips/cpu/xburst/config.mk
@@ -0,0 +1,33 @@
+#
+# (C) Copyright 2003
+# Wolfgang Denk, DENX Software Engineering, 
+#
+# 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
+#
+v=$(shell $(AS) --version | grep 'GNU assembler' | egrep -o '2\.[0-9\.]+' | 
cut -d. -f2)
+MIPSFLAGS:=$(shell \
+if [ "$v" -lt "14" ]; then \
+   echo "-mcpu=4kc"; \
+else \
+   echo "-march=4kc -mtune=4kc"; \
+fi)
+
+MIPSFLAGS += -mabicalls -mips32
+
+PLATFORM_CPPFLAGS += $(MIPSFLAGS)
diff --git a/arch/mips/cpu/xburst/cpu.c b/arch/mips/cpu/xburst/cpu.c
new file mode 100644
index 000..22261cf
--- /dev/null
+++ b/arch/mips/cpu/xburst/cpu.c
@@ -0,0 +1,160 @@
+/*
+ * (C) Copyright 2003
+ * Wolfgang Denk, DENX Software Engineering, 
+ *
+ * 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 co

Re: [U-Boot] [PATCH v4 1/7] arm: Add Support for Marvell ARMADA 100 Familiy SoCs

2010-12-07 Thread Prafulla Wadaskar


> -Original Message-
> From: Eric Miao [mailto:eric.y.m...@gmail.com]
> Sent: Wednesday, December 08, 2010 8:03 AM
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Lei Wen; Yu Tang; Kiran Vedere; Manas Saksena;
> Prabhanjan Sarnaik; Ashish Karkare; Mahavir Jain
> Subject: Re: [PATCH v4 1/7] arm: Add Support for Marvell ARMADA 100
> Familiy SoCs
> 
> On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar 
> wrote:
> > ARMADA 100 Family processors are highly integrated SoCs
> > based on Sheeva_88SV331x-v5 PJ1 cpu core.
> > Ref: http://www.marvell.com/products/processors/applications/armada_100
> >
> > SoC versions Supported:
> > 1) ARMADA168/88AP168    (Aspen P)
> > 2) ARMADA166/88AP166    (Aspen M)
> > 3) ARMADA162/88AP162    (Aspen L)
> >
> > Contributors:
> > Eric Miao 
> 
> 
> 
> Or
> 
> 

Hi Eric
I will correct this.

> 
> Actually I have little contribution to this, // red face.

Something is always better than nothing :-)

> 
> The patch below seems quite good. I'll be glad to see this be
> upstreamed in the u-boot tree.

Thanks, hope it will happen soon.

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


[U-Boot] [PATCH 5/5] sh: r2dplus: Add support zimageboot

2010-12-07 Thread nobuhiro . iwamatsu . yj
From: Nobuhiro Iwamatsu 

Signed-off-by: Nobuhiro Iwamatsu 
---
 include/configs/r2dplus.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/r2dplus.h b/include/configs/r2dplus.h
index ade6f7c..8689513 100644
--- a/include/configs/r2dplus.h
+++ b/include/configs/r2dplus.h
@@ -24,6 +24,7 @@
 #define CONFIG_CMD_IDE
 #define CONFIG_CMD_EXT2
 #define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_SH_ZIMAGEBOOT
 
 /* SCIF */
 #define CONFIG_SCIF_CONSOLE1
-- 
1.7.2.3

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


[U-Boot] [PATCH 2/5] sh: Divided macro for zImage and add asm/zimage.h

2010-12-07 Thread nobuhiro . iwamatsu . yj
From: Nobuhiro Iwamatsu 

Signed-off-by: Nobuhiro Iwamatsu 
---
 arch/sh/include/asm/zimage.h |   41 +
 arch/sh/lib/bootm.c  |   20 
 2 files changed, 45 insertions(+), 16 deletions(-)
 create mode 100644 arch/sh/include/asm/zimage.h

diff --git a/arch/sh/include/asm/zimage.h b/arch/sh/include/asm/zimage.h
new file mode 100644
index 000..33a680b
--- /dev/null
+++ b/arch/sh/include/asm/zimage.h
@@ -0,0 +1,41 @@
+/*
+ * (C) Copyright 2010
+ *   Renesas Solutions Corp.
+ *   Nobuhiro Iwamatsu 
+ *
+ * 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
+ */
+
+#ifndef _ASM_ZIMAGE_H_
+#define _ASM_ZIMAGE_H_
+
+#define MOUNT_ROOT_RDONLY  0x000
+#define RAMDISK_FLAGS  0x004
+#define ORIG_ROOT_DEV  0x008
+#define LOADER_TYPE0x00c
+#define INITRD_START   0x010
+#define INITRD_SIZE0x014
+#define COMMAND_LINE   0x100
+
+#define RD_PROMPT  (1<<15)
+#define RD_DOLOAD  (1<<14)
+#define CMD_ARG_RD_PROMPT  "prompt_ramdisk="
+#define CMD_ARG_RD_DOLOAD  "load_ramdisk="
+
+#endif
diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c
index fe23b58..57273fa 100644
--- a/arch/sh/lib/bootm.c
+++ b/arch/sh/lib/bootm.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_SYS_DEBUG
 static void hexdump(unsigned char *buf, int len)
@@ -43,19 +44,6 @@ static void hexdump(unsigned char *buf, int len)
 }
 #endif
 
-#define MOUNT_ROOT_RDONLY  0x000
-#define RAMDISK_FLAGS  0x004
-#define ORIG_ROOT_DEV  0x008
-#define LOADER_TYPE0x00c
-#define INITRD_START   0x010
-#define INITRD_SIZE0x014
-#define COMMAND_LINE   0x100
-
-#define RD_PROMPT  (1<<15)
-#define RD_DOLOAD  (1<<14)
-#define CMD_ARG_RD_PROMPT  "prompt_ramdisk="
-#define CMD_ARG_RD_DOLOAD  "load_ramdisk="
-
 #ifdef CONFIG_SH_SDRAM_OFFSET
 #define GET_INITRD_START(initrd, linux) (initrd - linux + 
CONFIG_SH_SDRAM_OFFSET)
 #else
@@ -94,8 +82,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
if ((flag != 0) && (flag != BOOTM_STATE_OS_GO))
return 1;
 
-   /* Setup parameters */
-   memset(param, 0, size); /* Clear zero page */
+   /* Clear zero page */
+   memset(param, 0, size);
 
/* Set commandline */
strcpy(cmdline, bootargs);
@@ -127,7 +115,7 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
 
/* Boot kernel */
kernel();
-   /* does not return */
 
+   /* does not return */
return 1;
 }
-- 
1.7.2.3

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


[U-Boot] [PATCH 1/5] sh: Delete the function that was not necessary

2010-12-07 Thread nobuhiro . iwamatsu . yj
From: Nobuhiro Iwamatsu 

Signed-off-by: Nobuhiro Iwamatsu 
---
 arch/sh/lib/bootm.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/sh/lib/bootm.c b/arch/sh/lib/bootm.c
index 19b3a94..fe23b58 100644
--- a/arch/sh/lib/bootm.c
+++ b/arch/sh/lib/bootm.c
@@ -100,7 +100,6 @@ int do_bootm_linux(int flag, int argc, char * const argv[], 
bootm_headers_t *ima
/* Set commandline */
strcpy(cmdline, bootargs);
 
-   sh_check_cmd_arg(bootargs, CMD_ARG_RD_DOLOAD, 10);
/* Initrd */
if (images->rd_start || images->rd_end) {
unsigned long ramdisk_flags = 0;
-- 
1.7.2.3

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


[U-Boot] [PATCH 3/5] sh: Add support zimageboot command for Renesas SH

2010-12-07 Thread nobuhiro . iwamatsu . yj
From: Nobuhiro Iwamatsu 

Curent U-Boot can boot zImage by use the "go" command.
But this is not right method. And this method can not set command-line
to linux kernel.
zimageboot sets command-line in environment of u-boot in linux kernel,
and provides function to boot it.

Signed-off-by: Nobuhiro Iwamatsu 
---
 arch/sh/lib/Makefile |3 ++
 arch/sh/lib/zimageboot.c |   80 ++
 2 files changed, 83 insertions(+), 0 deletions(-)
 create mode 100644 arch/sh/lib/zimageboot.c

diff --git a/arch/sh/lib/Makefile b/arch/sh/lib/Makefile
index 7f60396..c0670cb 100644
--- a/arch/sh/lib/Makefile
+++ b/arch/sh/lib/Makefile
@@ -31,6 +31,9 @@ COBJS-y   += time_sh2.o
 else
 COBJS-y+= time.o
 endif
+ifeq ($(CONFIG_CMD_SH_ZIMAGEBOOT),y)
+COBJS-y += zimageboot.o
+endif
 
 SRCS   := $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
diff --git a/arch/sh/lib/zimageboot.c b/arch/sh/lib/zimageboot.c
new file mode 100644
index 000..dd413c0
--- /dev/null
+++ b/arch/sh/lib/zimageboot.c
@@ -0,0 +1,80 @@
+/*
+ * (C) Copyright 2010
+ *   Renesas Solutions Corp.
+ *   Nobuhiro Iwamatsu 
+ *
+ * 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
+ */
+
+/*
+ * Linux SuperH zImage loading and boot
+ */
+
+#include 
+#include 
+#include 
+
+int do_sh_zimageboot (cmd_tbl_t *cmdtp, int flag, int argc, char * const 
argv[])
+{
+   ulong (*zboot_entry)(int, char * const []) = NULL;
+   char *s0, *s1;
+   unsigned char *param = NULL;
+   char *cmdline;
+   char *bootargs;
+
+   disable_interrupts();
+
+   if (argc >= 3) {
+   /* argv[1] holds the address of the zImage */
+   s0 = argv[1];
+   /* argv[2] holds the address of zero page */
+   s1 = argv[2];
+   } else {
+   goto exit;
+   }
+
+   if (s0)
+   zboot_entry = (ulong (*)(int, char * const 
[]))simple_strtoul(s0, NULL, 16);
+
+   /* empty_zero_page */
+   if (s1)
+   param = (unsigned char*)simple_strtoul(s1, NULL, 16);
+
+   /* Linux kernel command line */
+   cmdline = (char *)param + COMMAND_LINE;
+   bootargs = getenv("bootargs");
+
+   /* Clear zero page */
+   memset(param, 0, 0x1000);
+
+   /* Set commandline */
+   strcpy(cmdline, bootargs);
+
+   /* Boot */
+   zboot_entry(0, NULL);
+
+exit:
+   return -1;
+}
+
+U_BOOT_CMD(
+   zimageboot, 3, 0,   do_sh_zimageboot,
+   "Boot zImage for Renesas SH",
+   ""
+);
-- 
1.7.2.3

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


[U-Boot] [PATCH 4/5] sh: sh7785lcr: Add support zimageboot

2010-12-07 Thread nobuhiro . iwamatsu . yj
From: Nobuhiro Iwamatsu 

Signed-off-by: Nobuhiro Iwamatsu 
---
 include/configs/sh7785lcr.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/sh7785lcr.h b/include/configs/sh7785lcr.h
index 591fb5c..a95a759 100644
--- a/include/configs/sh7785lcr.h
+++ b/include/configs/sh7785lcr.h
@@ -41,6 +41,7 @@
 #define CONFIG_CMD_SDRAM
 #define CONFIG_CMD_RUN
 #define CONFIG_CMD_SAVEENV
+#define CONFIG_CMD_SH_ZIMAGEBOOT
 
 #define CONFIG_CMD_USB
 #define CONFIG_USB_STORAGE
-- 
1.7.2.3

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


Re: [U-Boot] [PATCH v4 1/7] arm: Add Support for Marvell ARMADA 100 Familiy SoCs

2010-12-07 Thread Eric Miao
On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar  wrote:
> ARMADA 100 Family processors are highly integrated SoCs
> based on Sheeva_88SV331x-v5 PJ1 cpu core.
> Ref: http://www.marvell.com/products/processors/applications/armada_100
>
> SoC versions Supported:
> 1) ARMADA168/88AP168    (Aspen P)
> 2) ARMADA166/88AP166    (Aspen M)
> 3) ARMADA162/88AP162    (Aspen L)
>
> Contributors:
> Eric Miao 



Or



Actually I have little contribution to this, // red face.

The patch below seems quite good. I'll be glad to see this be
upstreamed in the u-boot tree.

> Lei Wen 
> Mahavir Jain 
>
> Signed-off-by: Mahavir Jain 
> Signed-off-by: Prafulla Wadaskar 
> ---
> Change log V2:
> 1. C-struct used for dram.c
> 2. lib declaration changed from .a to .o
> 3. Implemented review feedback for v1
>
> Changelog V3:
> 1. timer variables in gt_t used insted of locally defined global variables
> 2. register global pointer moved to respective functions
> 3. Macro READ_TIMER converted to function read_timer()
> 4. c-struc in armada100.h fixed for wrong padding
>
> Changelog V4:
> 1. timer.c updated for build warning
>
>  arch/arm/cpu/arm926ejs/armada100/Makefile       |   46 +
>  arch/arm/cpu/arm926ejs/armada100/cpu.c          |   92 ++
>  arch/arm/cpu/arm926ejs/armada100/dram.c         |  131 ++
>  arch/arm/cpu/arm926ejs/armada100/timer.c        |  207 
> +++
>  arch/arm/include/asm/arch-armada100/armada100.h |  121 +
>  arch/arm/include/asm/arch-armada100/cpu.h       |   53 ++
>  6 files changed, 650 insertions(+), 0 deletions(-)
>  create mode 100644 arch/arm/cpu/arm926ejs/armada100/Makefile
>  create mode 100644 arch/arm/cpu/arm926ejs/armada100/cpu.c
>  create mode 100644 arch/arm/cpu/arm926ejs/armada100/dram.c
>  create mode 100644 arch/arm/cpu/arm926ejs/armada100/timer.c
>  create mode 100644 arch/arm/include/asm/arch-armada100/armada100.h
>  create mode 100644 arch/arm/include/asm/arch-armada100/cpu.h
>
> diff --git a/arch/arm/cpu/arm926ejs/armada100/Makefile 
> b/arch/arm/cpu/arm926ejs/armada100/Makefile
> new file mode 100644
> index 000..76bd06d
> --- /dev/null
> +++ b/arch/arm/cpu/arm926ejs/armada100/Makefile
> @@ -0,0 +1,46 @@
> +#
> +# (C) Copyright 2010
> +# Marvell Semiconductor 
> +# Written-by: Prafulla Wadaskar 
> +#
> +# See file CREDITS for list of people who contributed to this
> +# project.
> +#
> +# This program is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU General Public License as
> +# published by the Free Software Foundation; either version 2 of
> +# the License, or (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
> +# MA 02110-1301 USA
> +#
> +
> +include $(TOPDIR)/config.mk
> +
> +LIB    = $(obj)lib$(SOC).o
> +
> +COBJS-y        = cpu.o timer.o dram.o
> +
> +SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
> +OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
> +
> +all:   $(obj).depend $(LIB)
> +
> +$(LIB):        $(OBJS)
> +       $(AR) $(ARFLAGS) $@ $(OBJS)
> +
> +#
> +
> +# defines $(obj).depend target
> +include $(SRCTREE)/rules.mk
> +
> +sinclude $(obj).depend
> +
> +#
> diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c 
> b/arch/arm/cpu/arm926ejs/armada100/cpu.c
> new file mode 100644
> index 000..62aa175
> --- /dev/null
> +++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c
> @@ -0,0 +1,92 @@
> +/*
> + * (C) Copyright 2010
> + * Marvell Semiconductor 
> + * Written-by: Prafulla Wadaskar 
> + * Contributor: Mahavir Jain 
> + *
> + * 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 
> +#include 
> +#include 
> +

[U-Boot] [PATCH] omap3: emif|sdrc: use a single global data define

2010-12-07 Thread Nishanth Menon
DECLARE_GLOBAL_DATA_PTR declarations in functions are inherently
troublesome with various compilers (e.g. gcc 4.5)

Signed-off-by: Nishanth Menon 
---
Similar to the fix I did in:
http://marc.info/?t=12880377354&r=1&w=2
for OMAP4
 arch/arm/cpu/armv7/omap3/emif4.c |3 +--
 arch/arm/cpu/armv7/omap3/sdrc.c  |3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap3/emif4.c b/arch/arm/cpu/armv7/omap3/emif4.c
index 2227576..3085637 100644
--- a/arch/arm/cpu/armv7/omap3/emif4.c
+++ b/arch/arm/cpu/armv7/omap3/emif4.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
 extern omap3_sysinfo sysinfo;
 
 static emif4_t *emif4_base = (emif4_t *)OMAP34XX_SDRC_BASE;
@@ -139,7 +140,6 @@ void do_emif4_init(void)
  */
 int dram_init(void)
 {
-   DECLARE_GLOBAL_DATA_PTR;
unsigned int size0 = 0, size1 = 0;
 
size0 = get_sdr_cs_size(CS0);
@@ -157,7 +157,6 @@ int dram_init(void)
 
 void dram_init_banksize (void)
 {
-   DECLARE_GLOBAL_DATA_PTR;
unsigned int size0 = 0, size1 = 0;
 
size0 = get_sdr_cs_size(CS0);
diff --git a/arch/arm/cpu/armv7/omap3/sdrc.c b/arch/arm/cpu/armv7/omap3/sdrc.c
index a4979ce..2a7970b 100644
--- a/arch/arm/cpu/armv7/omap3/sdrc.c
+++ b/arch/arm/cpu/armv7/omap3/sdrc.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 
+DECLARE_GLOBAL_DATA_PTR;
 extern omap3_sysinfo sysinfo;
 
 static struct sdrc *sdrc_base = (struct sdrc *)OMAP34XX_SDRC_BASE;
@@ -172,7 +173,6 @@ void do_sdrc_init(u32 cs, u32 early)
  */
 int dram_init(void)
 {
-   DECLARE_GLOBAL_DATA_PTR;
unsigned int size0 = 0, size1 = 0;
 
size0 = get_sdr_cs_size(CS0);
@@ -194,7 +194,6 @@ int dram_init(void)
 
 void dram_init_banksize (void)
 {
-   DECLARE_GLOBAL_DATA_PTR;
unsigned int size0 = 0, size1 = 0;
 
size0 = get_sdr_cs_size(CS0);
-- 
1.6.3.3

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


[U-Boot] Aspire Property Magazine - Spring 2011 and beyond! SW London

2010-12-07 Thread Aspire Property Magazine London
Hi there 

We're delighted to inform you that your organisation has been invited to 
participate in Aspire Property Magazine, for the Spring 2011 edition (and 
beyond). 

As the brainchild of Aspire Estate Agents, SW London, this quarterly magazine 
features some of the most appealing properties for sale in the SW London 
region. An exclusive title, the magazine is now four times annually, and is 
distributed accordingly, with 8,500 copies per edition hand-delivered to 
property buyers, accompanying professions (eg surveyors, interior designers, 
legal firms etc), and plenty of sought-after private and commercial addresses 
within the SW London region, from Knightsbridge to Chelsea to Wimbledon. 
Sporting a long 'shelf-life' too, this means it is an outstanding vehicle for 
you to reach this financially capable AB1/high net worth demographic for your 
direct sales and marketing. 

Regarding your organisation and your potential participation, we're pleased to 
tell you that the Special Introductory Rate for booking for the Spring 2011 
Edition is now open, and until 31st December 2010 we would like to offer you 
the improved reduced 'trial' rate of just £999.00 total for a full A4 page 
advertisement (list price £1250.00 premium position), or a half page, 
well-placed at just £500.00. This will enable you to try the response from this 
financially capable audience at limited risk to yourselves (media pack and ad 
specs available through links below). 

Once you have seen the effectiveness of this sales and PR channel, we would 
then, of course, hope that you would choose to to appear regularly in further 
editions. 

To book for this attractive trial rate offer, simply reply to this email with 
the words '[insert ad size here] - Yes please' no later than 31st December 2010 
to begin reaching this high net worth audience for your business. 

Hope to hear from you soon! 

Kind regards 

Sam Featherstone 

for ASPIRE PROPERTY MAGAZINE, LONDON


T:  +44 (0)845 428 9350 F:  +44 (0)207 183 4752 

W: www.aspire.co.uk

Current Edition Aspire Magazine at 
http://www.aspire.co.uk/newlook/aspire_magazine.php

Downloads: 

Media Kit - http://www.sksassociates.co.uk/aspire/AspireAdRates.pdf

AdSpecs - http://www.sksassociates.co.uk/aspire/AspireAdSpec.pdf

Contracted exclusively by: 

SKS Media
Trusted UK Agents

"Bringing the top drawer to you!"

** You were subscribed to this offer list through one of our extensive, but 
discerning luxury partner networks. 

** If you feel you have received this email in error, simply REPLY and SEND 
with the subject line intact. Thanks.

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


Re: [U-Boot] [PATCH] boot cmds: convert to getenv_yesno() with autostart

2010-12-07 Thread Mike Frysinger
On Tuesday, December 07, 2010 17:19:38 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > In addition to the default values, there is the difference that the
> > > documentation states that "autostart" has to be set to "yes", i. e. a
> > > plain "y" is not supposed to mean 'yes'.
> > 
> > consider it an enhancement then ?  i dont see a problem with making the
> > values fuzzier.  personally, i make funcs like this accept any of the
> > common strings such as true/false/0/1/y/n/yes/no.
> 
> That should be documented, then.  And it should be sensible not to
> accept anything.  A typo like "yno" should IMHO _not_ be interpreted
> as "yes".

good point ... i hadnt thought of that

> > > I think the easiest way to fix this is to revert the commit.
> > 
> > it's in "next", so it could even just be dropped
> 
> Yes, but then I have to rebase next...

imo, keeping the "next" branch clean at the cost of unstableness isnt a 
problem.  this seems to be the convention that Linux started and other people 
follow.  personally, when i use "next" from anywhere, the first thing i do is 
reset my local "next" branch to whatever the current upstream state.
-mike


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


Re: [U-Boot] [PATCH] nand: constify id/manu tables

2010-12-07 Thread Scott Wood
On Tue, 7 Dec 2010 17:14:14 -0500
Mike Frysinger  wrote:

> On Wednesday, October 20, 2010 07:15:21 Mike Frysinger wrote:
> > These id tables need not be writable.
> 
> was this missed ?  or is something pending ?

Current batch was fixes for the imminent release; this looked like a
cleanup which I'll stick in -next shortly.

-Scott

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


Re: [U-Boot] [PATCH] nand: constify id/manu tables

2010-12-07 Thread Mike Frysinger
On Wednesday, October 20, 2010 07:15:21 Mike Frysinger wrote:
> These id tables need not be writable.

was this missed ?  or is something pending ?
-mike


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


Re: [U-Boot] [PATCH] boot cmds: convert to getenv_yesno() with autostart

2010-12-07 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201012071657.42065.vap...@gentoo.org> you wrote:
>
> > In addition to the default values, there is the difference that the
> > documentation states that "autostart" has to be set to "yes", i. e. a
> > plain "y" is not supposed to mean 'yes'.
>
> consider it an enhancement then ?  i dont see a problem with making the 
> values 
> fuzzier.  personally, i make funcs like this accept any of the common strings 
> such as true/false/0/1/y/n/yes/no.

That should be documented, then.  And it should be sensible not to
accept anything.  A typo like "yno" should IMHO _not_ be interpreted
as "yes".

> > I think the easiest way to fix this is to revert the commit.
>
> it's in "next", so it could even just be dropped

Yes, but then I have to rebase next...

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
"You shouldn't make my toaster angry." - Household security explained
in "Johnny Quest"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: nand flash

2010-12-07 Thread Scott Wood
The following changes since commit f12af1f38dc59a6dfe0fed1359e1a05e700a435b:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-video

are available in the git repository at:

  git://git.denx.de/u-boot-nand-flash.git master

David Müller (ELSOFT AG) (1):
  fix s3c2410_nand timing default values

Lei Wen (1):
  onenand: fix oob print out issue

Scott Wood (1):
  83xx NAND boot: fix boards.cfg

Steve Sakoman (1):
  env_nand: Use nand_read_skip_bad instead of nand_read

 boards.cfg  |6 +++---
 common/cmd_onenand.c|4 +++-
 common/env_nand.c   |2 +-
 drivers/mtd/nand/s3c2410_nand.c |   12 +---
 4 files changed, 16 insertions(+), 8 deletions(-)

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


Re: [U-Boot] [U-BOOT][PATCH V2] onenand: fix oob print out issue

2010-12-07 Thread Scott Wood
On Tue, Dec 07, 2010 at 09:38:18AM +0800, Lei Wen wrote:
> Seems original implementation forget to set the pointer to point
> to the oobbuf, so when we want to see oob buf, we see nothing...
> Fix it by get pointer as the oobbuf set.
> 
> Signed-off-by: Lei Wen 
> ---
> Changelog:
> V1: Initial patch
> V2: remove the comment of oob data appended to datbuf

Applied to u-boot-nand-flash

-Scott

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


Re: [U-Boot] [PATCH] boot cmds: convert to getenv_yesno() with autostart

2010-12-07 Thread Mike Frysinger
On Tuesday, December 07, 2010 16:51:41 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > hrm, after running this through our test bench, it seems the old code and
> > new code are not functionality equivalent.  it boils down to default
> > values when the env var is not set.  some places interpret this to mean
> > "yes" while others expect "no".  getenv_yesno() takes the "no" default
> > which doesnt always work.
> 
> In addition to the default values, there is the difference that the
> documentation states that "autostart" has to be set to "yes", i. e. a
> plain "y" is not supposed to mean 'yes'.

consider it an enhancement then ?  i dont see a problem with making the values 
fuzzier.  personally, i make funcs like this accept any of the common strings 
such as true/false/0/1/y/n/yes/no.

> > i can update the API to take a 2nd arg (the default value), or we can
> > punt this patch.  it's in "next", so there's less pressure to get it
> > fixed immediately ...
> 
> I think the easiest way to fix this is to revert the commit.

it's in "next", so it could even just be dropped
-mike


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


[U-Boot] [PATCHv2] pca953x: support 16-pin devices

2010-12-07 Thread Chris Packham
This adds support for for the PCA9535/PCA9539 family of gpio devices which
have 16 output pins.

To let the driver know which devices are 16-pin it is necessary to define
CONFIG_SYS_I2C_PCA953X_WIDTH in your board config file. This is used to
create an array of {chip, ngpio} tuples that are used to determine the
width of a particular chip. For backwards compatibility it is assumed that
any chip not defined in CONFIG_SYS_I2C_PCA953X_WIDTH has 8 pins.
---

As suggested by Peter I've implemented the 16-pin support in the existing
pca953x driver. So this is pretty much a re-write of the v1 patch. Is the commit
message sufficient to document CONFIG_SYS_I2C_PCA953X_WIDTH or is
there something under doc/ that I should be adding to.

 drivers/gpio/pca953x.c |  107 ++--
 1 files changed, 85 insertions(+), 22 deletions(-)

diff --git a/drivers/gpio/pca953x.c b/drivers/gpio/pca953x.c
index 6e82bd6..491b79e 100644
--- a/drivers/gpio/pca953x.c
+++ b/drivers/gpio/pca953x.c
@@ -17,8 +17,8 @@
  */

 /*
- * Driver for NXP's 4 and 8 bit I2C gpio expanders (eg pca9537, pca9557, etc)
- * TODO: support additional devices with more than 8-bits GPIO
+ * Driver for NXP's 4, 8 and 16 bit I2C gpio expanders (eg pca9537, pca9557,
+ * pca9539, etc)
  */

 #include 
@@ -38,22 +38,78 @@ enum {
PCA953X_CMD_INVERT,
 };

+#ifdef CONFIG_SYS_I2C_PCA953X_WIDTH
+struct chip_ngpio {
+   uint8_t chip;
+   uint8_t ngpio;
+};
+
+static struct chip_ngpio chip_ngpios[] = CONFIG_SYS_I2C_PCA953X_WIDTH;
+#define NUM_CHIP_GPIOS (sizeof(chip_ngpios) / sizeof(struct chip_ngpio))
+
+/*
+ * Determine the number of GPIO pins supported. If we don't know we assume
+ * 8 pins.
+ */
+static int ngpio(uint8_t chip)
+{
+   int i;
+
+   for (i = 0; i < NUM_CHIP_GPIOS; i++) {
+   if (chip_ngpios[i].chip == chip)
+   return chip_ngpios[i].ngpio;
+   }
+   return 8;
+}
+#else
+#define ngpio(chip)8
+#endif
+
 /*
  * Modify masked bits in register
  */
 static int pca953x_reg_write(uint8_t chip, uint addr, uint mask, uint data)
 {
-   uint8_t val;
+   uint8_t  valb;
+   uint16_t valw;

-   if (i2c_read(chip, addr, 1, &val, 1))
-   return -1;
+   if (ngpio(chip) <= 8) {
+   if (i2c_read(chip, addr, 1, &valb, 1))
+   return -1;
+
+   valb &= ~mask;
+   valb |= data;
+
+   return i2c_write(chip, addr, 1, &valb, 1);
+   } else {
+   if (i2c_read(chip, addr << 1, 1, (u8*)&valw, 2))
+   return -1;
+
+   valw &= ~mask;
+   valw |= data;
+
+   return i2c_write(chip, addr << 1, 1, (u8*)&valw, 2);
+   }
+}

-   val &= ~mask;
-   val |= data;
+static int pca953x_reg_read(uint8_t chip, uint addr, uint *data)
+{
+   uint8_t  valb;
+   uint16_t valw;

-   return i2c_write(chip, addr, 1, &val, 1);
+   if (ngpio(chip) <= 8) {
+   if (i2c_read(chip, addr, 1, &valb, 1))
+   return -1;
+   *data = (int) valb;
+   } else {
+   if (i2c_read(chip, addr << 1, 1, (u8*)&valw, 2))
+   return -1;
+   *data = (int) valw;
+   }
+   return 0;
 }

+
 /*
  * Set output value of IO pins in 'mask' to corresponding value in 'data'
  * 0 = low, 1 = high
@@ -86,9 +142,9 @@ int pca953x_set_dir(uint8_t chip, uint mask, uint data)
  */
 int pca953x_get_val(uint8_t chip)
 {
-   uint8_t val;
+   uint val;

-   if (i2c_read(chip, 0, 1, &val, 1))
+   if (pca953x_reg_read(chip, PCA953X_IN, &val) < 0)
return -1;

return (int)val;
@@ -102,37 +158,44 @@ int pca953x_get_val(uint8_t chip)
 static int pca953x_info(uint8_t chip)
 {
int i;
-   uint8_t data;
+   uint data;
+   int nr_gpio = ngpio(chip);
+   int msb = nr_gpio - 1;

-   printf("pca953x@ 0x%x:\n\n", chip);
-   printf("gpio pins: 76543210\n");
+   printf("pca953x@ 0x%x (%d pins):\n\n", chip, nr_gpio);
+   printf("gpio pins: ");
+   for (i = msb; i >= 0; i--)
+   printf("%x",i);
+   printf("\n");
+   if (nr_gpio > 8)
+   printf("");
printf("---\n");

-   if (i2c_read(chip, PCA953X_CONF, 1, &data, 1))
+   if (pca953x_reg_read(chip, PCA953X_CONF, &data) < 0)
return -1;
printf("conf:  ");
-   for (i = 7; i >= 0; i--)
+   for (i = msb; i >= 0; i--)
printf("%c", data & (1 << i) ? 'i' : 'o');
printf("\n");

-   if (i2c_read(chip, PCA953X_POL, 1, &data, 1))
+   if (pca953x_reg_read(chip, PCA953X_POL, &data) < 0)
return -1;
printf("invert:");
-   for (i = 7; i >= 0; i--)
+   for (i = msb; i >= 0; i--)
printf("%c", data & (1 << i) ? '1' : '0');
printf("\n");

-   if (i2c_read(ch

Re: [U-Boot] [PATCH] boot cmds: convert to getenv_yesno() with autostart

2010-12-07 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <201012010634.19596.vap...@gentoo.org> you wrote:
>
> hrm, after running this through our test bench, it seems the old code and new 
> code are not functionality equivalent.  it boils down to default values when 
> the env var is not set.  some places interpret this to mean "yes" while 
> others 
> expect "no".  getenv_yesno() takes the "no" default which doesnt always work.

In addition to the default values, there is the difference that the
documentation states that "autostart" has to be set to "yes", i. e. a
plain "y" is not supposed to mean 'yes'.

> i can update the API to take a 2nd arg (the default value), or we can punt
> this patch.  it's in "next", so there's less pressure to get it fixed 
> immediately ...

I think the easiest way to fix this is to revert the commit.

Do you agree?

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
Unix is supported by IBM, like a hanging man is supported by rope.
- Don Libes & Sandy Ressler: _Life With Unix_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Honor /memory/reg node in DTB files

2010-12-07 Thread Scott Wood
On Mon, 6 Dec 2010 16:56:26 -0800
Deepak Saxena  wrote:

> +/*
> + * Check to see if an valid memory/reg property exists
> + * in the fdt. If so, we do not overwrite it with what's
> + * been scanned.
> + *
> + * Valid mean all the following:
> + *
> + * - Memory node has a device-type of "memory"
> + * - A reg property exists which:
> + *   + has exactly as many cells as #address-cells + #size-cells
> + *   + provides a range that is within [bi_memstart, bi_memstart + 
> bi_memsize]
> + */

This will get false positives -- a lot of existing device tree
templates have something like this:

memory {
device_type = "memory";
reg = <0 0 0 0>;// Filled by U-Boot
};

-Scott

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


[U-Boot] V2: Please pull u-boot-atmel/for2010.12

2010-12-07 Thread Reinhard Meyer
Dear Wolfgang,

compiled TOT git. Now it handles the "ß" in e-Mails correctly

The following changes since commit 52eb2c79110151b9017a0829c4d44ee7b8e2ca04:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-samsung

are available in the git repository at:

  git://git.denx.de/u-boot-atmel.git for2010.12

Andreas Bießmann (5):
  at91rm9200ek: fix SDRAM initialistation values
  at91rm9200ek: add configure target for RAM boot
  MAKEALL: fix AT91
  arm920t/at91/reset: board_reset: define weak symbol
  arm920t/at91/timer: replace bss variables by gd

Reinhard Meyer (3):
  AT91: gen_atmel_mci.c: fix bug when Slot B is used
  AT91: fix EMAC gpio init in at91sam9260_devices.c
  AT91: add TOP9000 support

 MAINTAINERS   |3 +-
 MAKEALL   |   18 +-
 arch/arm/cpu/arm920t/at91/reset.c |8 +-
 arch/arm/cpu/arm920t/at91/timer.c |   29 +-
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |5 +
 arch/arm/include/asm/global_data.h|1 +
 board/atmel/at91rm9200ek/config.mk|2 -
 board/emk/top9000/Makefile|   54 
 board/emk/top9000/spi.c   |   61 
 board/emk/top9000/top9000.c   |  290 +++
 boards.cfg|5 +-
 drivers/mmc/gen_atmel_mci.c   |1 +
 include/configs/at91rm9200ek.h|   18 ++-
 include/configs/top9000.h |  314 +
 14 files changed, 771 insertions(+), 38 deletions(-)
 delete mode 100644 board/atmel/at91rm9200ek/config.mk
 create mode 100644 board/emk/top9000/Makefile
 create mode 100644 board/emk/top9000/spi.c
 create mode 100644 board/emk/top9000/top9000.c
 create mode 100644 include/configs/top9000.h

Best Regards,
Reinhard

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


Re: [U-Boot] cache_flush() function

2010-12-07 Thread Mike Frysinger
On Tuesday, December 07, 2010 07:44:53 Sergey Mironov wrote:
> I'm porting u-boot on our arm1176-based SoC which uses greth as
> ethernet controller. I have removed sparc code from greth.c and now
> almost ready to send the patch. Last thing to fix is cache flusher
> function which is required by the driver. Originally algorithm used
> sparc_flush_cachces which is not suitable for the driver.
> 
> Is there any 'official' guidelines on using the caches? What
> hardware-abstract function should I prefer?

if the func is defined in include/*.h, it tends to be OK to use portability 
(ignoring the arch-specific files which shouldnt be in include/).  in terms of 
cache, a simple grep tells you the answer:
grep cache include/common.h
-mike


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


Re: [U-Boot] [PATCH] Fix "autostart" env variable handling

2010-12-07 Thread Mike Frysinger
On Tuesday, December 07, 2010 05:19:01 Stefan Roese wrote:
> Patch 5a442c0a [boot cmds: convert to getenv_yesno() with autostart]
> changes the boot commands code to use the getenv_yesno() helper
> function. But this function returns true (1) when "autostart" is not
> defined at all.
> 
> This patch changes the logic of getenv_yesno() to only return true when
> "autostart" is defined and the first char is set to "y". This restores
> the old behavior on boards where "autostart" is not defined at all.

NAK; this breaks other things.  i already mentioned the issue here:
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/87057/focus=90059
but waiting for response from wolfgang ...
-mke


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


Re: [U-Boot] [PATCH] Honor /memory/reg node in DTB files

2010-12-07 Thread Hollis Blanchard
On 12/06/2010 10:52 PM, Wolfgang Denk wrote:
> If you define that the device tree is the "master" for information
> about the memory layout (and potentially other hardware specifics),
> then you should be consequent and pass make U-Boot process this
> information.  We've discussed before that there are a number of cases
> where it would be nice if U-Boot itself could be configured usign a
> device tree.  This appears to be another one.
I *think* what you're suggesting is basically providing u-boot with a 
single device tree, even when it will load multiple operating systems. 
The tree would then look something like this:

/
 cpus
 ...
 memory
 reg = <0 2000>
 soc
 ...
 partitions
 partit...@0
 memory
 reg = <0 1000>
 partit...@1
 memory
 reg = <1000 1000>

U-boot would then be responsible for constructing multiple device trees 
(one for each partition) itself, based on the additional information 
found in the "partitions" node.

Is that correct?

Hollis Blanchard
Mentor Graphics, Embedded Systems Division


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


Re: [U-Boot] [PATCH] Honor /memory/reg node in DTB files

2010-12-07 Thread Wolfgang Denk
Dear Hollis,

In message <4cfe7fa8.2030...@mentor.com> you wrote:
> On 12/06/2010 10:52 PM, Wolfgang Denk wrote:
> > If you define that the device tree is the "master" for information
> > about the memory layout (and potentially other hardware specifics),
> > then you should be consequent and pass make U-Boot process this
> > information.  We've discussed before that there are a number of cases
> > where it would be nice if U-Boot itself could be configured usign a
> > device tree.  This appears to be another one.
> I *think* what you're suggesting is basically providing u-boot with a 
> single device tree, even when it will load multiple operating systems. 
> The tree would then look something like this:

To be honest - I have not spent thoughts yet how this can be
implemented.  I would expect that there might be some common part, but
there will eventually also be per-core configurations.

>  cpus
>  ...
>  memory
>  reg = <0 2000>
>  soc
>  ...
>  partitions
>  partit...@0
>  memory
>  reg = <0 1000>
>  partit...@1
>  memory
>  reg = <1000 1000>
> 
> U-boot would then be responsible for constructing multiple device trees 
> (one for each partition) itself, based on the additional information 
> found in the "partitions" node.
> 
> Is that correct?

I did not think about that. I did not think about how to boot an OS
and how to provide a DT to these.

My concerns are still on a lower level. Memory initialization is a
very basic task of the boot loader. We are discussiong to move the
description of this resource out of U-Boot (where it was
traditionally statically coinfigured at compile time, with the
exception of auti-sizing). When doing so, we should not let U-Boot
live in a different world, or let it operate on a different set of
information. If the description of a resource is in the DT, then
U-Boot has to use this information (from the DT) for all operations
that deal with this resource.

Just passing such information to the OS, behind U-Boot's back and with
U-Boot having an independt (and probably different) view makes no
sense to me.

There are a number of features (persistent RAM, shared log buffer,
shared video buffers, ...) where U-Boot and Linux need to have exactly
the same understanding about available and usable memory.  I just want
to make sure that future extensions will allow to keep these features
instead of breaking them.


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 optimum committee has no members.
   - Norman Augustine
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Honor /memory/reg node in DTB files

2010-12-07 Thread Wolfgang Denk
Dear Deepak,

In message <4cfe775c.6050...@mentor.com> you wrote:
>
> I am a big fan of having consistent and clear definitions of 
> responsibilities; however, I think the model of having U-Boot
> handle the creation of memory nodes in the DTB does not scale
> cleanly to users configuring, deploying, and managing complicated
> AMP environments.

I agree with you, but I think this is just one part (and eventually a
minor part) of the issue.  I would not protest if you say thatthe whol
(static, compile time) configuration of U-Boot does not scale well for
such requirements.

So far we usually had pretty static board configurations, and a static
compile time description was all we needed.  Some developers consider
even simple extensions like auto-sizing the available RAM as
unnecessary luxury that just inreases the boot time and memory
footprint.

When it comes to more complicated setups we should provide means for a
more dynamic configuration - this has been discussed before, and there
was a general agreement that the device tree would be a usable way to
implement such a description of the hardware.

So what I'm proposing is not an opposite to what you have in mind, it
just takes it one step further, and makes the whole system consistent
again.

Waht I don't like is the tunneling of information through U-Boot,
while U-Boot actually needs and uses this very information as well.

> While we could provide a method to provide this information at build
> time to make U-Boot, this forces a static memory partitioning on the 
> system and does not mesh well with use cases where developers may

This is NOT what I suggested.

> The bootm_low and bootm_size variables are an attempt to get around
> this by overriding what U-Boot knows about the system but I think
> those also don't scale well when we start dealing with large numbers
> of cores (32+) with independent OS instances on them for some of the 
> same reasons. I think it is far simpler to have some custom scripts to 
> spit out new DTB files that uBoot is configured to load every time it 
> boots than to have to change a bunch of environment variables on boot.

Again, there is no conflict between your statement and what I
suggested.

> In the multi-node environments, we can't simply tell U-Boot to process 
> the DTB to determine how much memory is in the system as there is one 
> DTB per AMP node. One idea that comes to mind but that I think is not

Please explain: you can use the DT to tell Linux (or other OS) how
much memory they shoulduse, but you cannot use the same mechanism to
pass the same information to U-Boot?

> the right way to go due to complexity is to have the concept of
> nested DTBs that can define multiple operational "machines" and
> U-Boot knows how to read this and send the right sub-DTB to the
> right kernel image.

This is a technical details that can and should be discussed when we
have an agreement about the basic mechanism.

> I'm new to U-Boot development so would like to hear about the other use 
> cases you mentioned (pointer to email threads are OK) so I can have a 
> better understanding of the overall issues.

There are many board vendors who shipt boards with different
configurations - with or without NAND flash; with or without other
peripherals like CAN contollers, LCD, etc.; with different LCD sizes
and types, in portrait or landscape orientation, etc.  Some of these
features can be determined by probing the hardware, others (like the
orientation of a LCD) cannot.  It is sometimes a maintenance nightmare
to provide tens of different configurations of U-Boot for a single
product.  Being able to cinfigure available hardware through the DT,
and using a single common binary image of U-Boot for such systems
would be a great benefit.

> Thinking about this at a higher level, I think the question is where
> is the delineation between board bringup/configuration and run time
> configuration management? Scanning memory and determining how much 
> exists and programming the memory controller is a board-bring up and 
> configuration task that a bootloader has traditionally done. 

And probaly one it still has to do, as there are good chances that you
don't know the actual memory size in advance - like on systems that
come in several configruations but use a common U-Boot image, or
systems where the user can plug in DIMMs of different size.

> Partitioning for AMP operation is about managing what and how is running
> on top of the bootloader. How much knowledge should the bootloader have
> about this? The approach of providing the memory partitioning in the DTB 
> basically removes any of this knowledge from U-Boot, while the

I see many use cases where this is simply not possible, because you
need need the help of the bootloader to determine parameters that are
not known in advance, and that thus cannot be encoded in the DT.
Memory size if a very typical example for such a parameter.  It may be
OK for the use case you have currently in 

Re: [U-Boot] [PATCH] Honor /memory/reg node in DTB files

2010-12-07 Thread Deepak Saxena
On 12/06/2010 10:52 PM, Wolfgang Denk wrote:
> Dear Deepak Saxena,
>
> I am not sure this is a good idea.
>
> So far we have a pretty clear definition of responsibilities.
> U-Boot does the low level initialization, including the sizing and
> testing of the system memory.  U-Boot then passes its results to Linux
> in the (modified by U-Boot) device tree.
>
> Your patch inverts this situation, at least for the memory.
>
> I agree that there may be situations where you want an easy way to
> pass such information.  But then let's handle this right.
>
> If you define that the device tree is the "master" for information
> about the memory layout (and potentially other hardware specifics),
> then you should be consequent and pass make U-Boot process this
> information.  We've discussed before that there are a number of cases
> where it would be nice if U-Boot itself could be configured usign a
> device tree.  This appears to be another one.
>
> What do you think?

Hi Wolfgang,

Thanks for the response, I have a few different thoughts on the subject.

I am a big fan of having consistent and clear definitions of 
responsibilities; however, I think the model of having U-Boot
handle the creation of memory nodes in the DTB does not scale
cleanly to users configuring, deploying, and managing complicated
AMP environments.

While we could provide a method to provide this information at build
time to make U-Boot, this forces a static memory partitioning on the 
system and does not mesh well with use cases where developers may
be testing different system layout options as it would require
a rebuild and reflash every time a new configuration is to be tested.
In certain environments, a developer may not be permitted to reflash the 
bootloader on a board shared by others (such as a remote HW lab).

The bootm_low and bootm_size variables are an attempt to get around
this by overriding what U-Boot knows about the system but I think
those also don't scale well when we start dealing with large numbers
of cores (32+) with independent OS instances on them for some of the 
same reasons. I think it is far simpler to have some custom scripts to 
spit out new DTB files that uBoot is configured to load every time it 
boots than to have to change a bunch of environment variables on boot.

In the multi-node environments, we can't simply tell U-Boot to process 
the DTB to determine how much memory is in the system as there is one 
DTB per AMP node. One idea that comes to mind but that I think is not
the right way to go due to complexity is to have the concept of
nested DTBs that can define multiple operational "machines" and
U-Boot knows how to read this and send the right sub-DTB to the
right kernel image.

I'm new to U-Boot development so would like to hear about the other use 
cases you mentioned (pointer to email threads are OK) so I can have a 
better understanding of the overall issues.

Thinking about this at a higher level, I think the question is where
is the delineation between board bringup/configuration and run time
configuration management? Scanning memory and determining how much 
exists and programming the memory controller is a board-bring up and 
configuration task that a bootloader has traditionally done. 
Partitioning for AMP operation is about managing what and how is running
on top of the bootloader. How much knowledge should the bootloader have
about this? The approach of providing the memory partitioning in the DTB 
basically removes any of this knowledge from U-Boot, while the
other approaches (bootm, build-time configuration) make U-Boot very 
aware and tied to what might be running above and reduce flexibility
to easily change that.

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


Re: [U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs

2010-12-07 Thread Albert ARIBAUD
Le 07/12/2010 18:10, Prafulla Wadaskar a écrit :

>>> +   val&= ~MFP_AF_MASK;
>> Do we need to do this&  here? For val is only 0 here...
>
> This can be removed.

OTOH, with the &, this line makes no assumption about val, and thus will 
work regardless of it. If the & is removed, and if later val is set to 
non-zero before reaching this instruction, it will cause a bug.

IOW, the & makes the statement more resilient.

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


Re: [U-Boot] gen_atmel_mci freeze on at91sam9g45

2010-12-07 Thread eric cariat
Hi Rheinard,

2010/12/5 Reinhard Meyer 

> Dear eric cariat,
> > I'm currently working on a custom board with an at91sam9g45 : I followed
> the
> > instruction in README.atmel_mci. In U-boot, if I use the command mmcinfo,
> > the system hang. The uSD is working correctly with at91bootstrap and
> linux.
> > In U-boot everything seems fine, the card exchange a few command and
> > response, and then freeze on the command 55 51 (the first command that
> will
> > receive some data on DAT0 ) :
> >
> > U-Boot> mmcinfo
> > mci: bus_hz is 1, setting clock 15 Hz, block size 512
> "setting clock" should read "requesting clock". 15 is the clock a MMC
> card
> should be inquired with. Unfortunately the minimum clock obtainable is
> 260416,
> but that did not cause problems with SD cards so far...
> > mci: setting clock 260416 Hz, block size 512
> So the software sets it to the minimum-.
> > mci: bus_hz is 1, setting clock 0 Hz, block size 512
> > mci: setting clock 260416 Hz, block size 512
> > mci: bus_hz is 1, setting clock 260416 Hz, block size 512
> > mci: setting clock 260416 Hz, block size 512
>
> First make sure the clock values are correct: Assuming the system is
> running
> at 400MHz, this would make sense if the MCI is clocked by system clock / 3.
> Then the minimum clock would indeed be 260416.
>

Clock values are OK (running from 12 Mhz like the 9g45 eval kit), system
running at 400 Mhz.
260416 Hz is exactly what I probe on the hardware.


>
> Is the 9G45 (H)MCI is really identical to the 9260 MCI or are there subtle
> differences?
>

I checked the datasheet of the 9260, most register seems to be the same...
I suppose you have been testing the gen_atmel_mci on the 9260 ?

>
> > But if I add some printf to debug , just after the
> > mci_data_op=mci_data_read() in gen_atmel_mci, then everything is OK and I
> > can now use the uSD without any problem.
> > Here is where I add the printf, so uSD is correctly handled :
> >
> > diff -crbN u-boot-2010.09.orig/drivers/mmc/gen_atmel_mci.c
> > u-boot-2010.09/drivers/mmc/gen_atmel_mci.c
> > *** u-boot-2010.09.orig/drivers/mmc/gen_atmel_mci.c2010-09-28
> > 23:20:55.0 +0200
> > --- u-boot-2010.09/drivers/mmc/gen_atmel_mci.c2010-12-04
> > 17:52:59.092770689 +0100
> > ***
> > *** 252,257 
> > --- 252,258 
> >   while (!status && word_count < (sys_blocksize / 4)) {
> >   status = mci_data_op(mci, &dummy,
> >   error_flags);
> > + printf("status=%x\n",status);
> >   word_count++;
> >   }
> >   if (status) {
> >
>
> Have you tested whether a udelay() serves the same purpose? It would seem
> that there is
> an issue when mci_data_op() is called too frequently. However, quite the
> same code exists
> a few lines above and it did not hang there.
>
>
I added a udelay(1) and udelay(50) -> it freeze
If I put a udelay(100) -> everything is OK (same effect as printf)


> Is your data cache on?
>

I suppose it is enabled by default, so I added #define
CONFIG_SYS_NO_CP15_CACHE in my config file -> but that still freeze

>
> There are no timeouts coded in mci_data_read() and mci_data_write(), maybe
> it would be good
> to add some...
>
> I also cannot rule out that pre-initialisation of the MCI by the bootstrap
> code could leave
> some registers with values that the gen_atmel_mci driver does not reset.
> But then, a printf
> would unlikely fix the problem.
>
> Patches are always welcome ;)
>
> Best Regards,
> Reinhard
>
>
My observation are the following :

It seems that we are trying to read too many data byte : for ACMD 51 : the
data reply is not a full 512 bytes data packet, but only 8 bytes len
(checked with oscillo). Actually when in function mci_send_cmd() with ACMD
51, we first read the 8 "useful" byte ... then we try to "fill the rest of
block" => we try to read 512 - 8 = 504 more bytes  (which never comes on the
DAT0 )
as there are no more data we should exit from mci_data_read() with a timeout
error, but this never happen (I have to check error_flags about that)

Doing a pause or printf in the while change the RXRDY flag (set to 1) and so
we exit from the while without any error... ( I could not understand why ?
). It seems that when we don't read the correct number of byte, the MCI
controller behave incorrectly (the status register seems to be incoherent)

Actually the driver set a block len of 512 byte only once (at
initialization) in the mode register (mr) in gen_atmel_mci:mci_set_mode().
So I suppose we need to change dynamically the block len for each command
(most command will use the 512 byte data block reply, but some (like ACMD51)
are using a specific len -> I think we don't need to change the block len in
the SDCard see comment [1] below )

So I made the following change, ( just for information ) :

diff -crbN u-boot-2010.09.orig/drivers/mmc/gen_atmel_mci.c
u-boot-2010.09/drivers/mmc/gen_atmel_mci

Re: [U-Boot] [PATCH v4 6/7] mv-common.h: Add support for ARMADA100 Platforms

2010-12-07 Thread Prafulla Wadaskar


> -Original Message-
> From: Lei Wen [mailto:adrian.w...@gmail.com]
> Sent: Tuesday, December 07, 2010 9:02 PM
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Eric Miao; Manas Saksena; Lei Wen; Yu Tang;
> Ashish Karkare; Kiran Vedere; Prabhanjan Sarnaik
> Subject: Re: [U-Boot] [PATCH v4 6/7] mv-common.h: Add support for
> ARMADA100 Platforms
> 
> Hi Prafulla,
> 
> On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar 
> wrote:
> > This patch adds commonly used macros for ARMADA100 based
> > baords, Also some code reshuffled and updated for typos and comments
> >
> > Signed-off-by: Prafulla Wadaskar 
> > ---
> > Changelog v3:
> > CONFIG_ARCH_CPU_INIT moved out of #ifdef
> >
> > Changelog v4:
> > CONFIG_MFP change to CONFIG_MARVELL_MFP
> > some whitespaces removed
> >
> >  include/configs/mv-common.h |   65 
> --
> >  1 files changed, 49 insertions(+), 16 deletions(-)
> >
> > diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
> > index 0a76163..067527a 100644
> > --- a/include/configs/mv-common.h
> > +++ b/include/configs/mv-common.h
> > @@ -39,6 +39,7 @@
> >  #define CONFIG_MARVELL         1
> >  #define CONFIG_ARM926EJS       1       /* Basic Architecture */
> >
> > +/* > Kirkwood Platform Common Definations */
> >  #if defined(CONFIG_KIRKWOOD)
> >  #define CONFIG_MD5     /* get_random_hex on krikwood needs MD5 support
> */
> >  #define CONFIG_KIRKWOOD_EGIGA_INIT     /* Enable GbePort0/1 for kernel
> */
> > @@ -54,27 +55,45 @@
> >  #define        CONFIG_SYS_KWD_CONFIG
> $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
> >  #endif /* CONFIG_SYS_KWD_CONFIG */
> >
> > -/*
> > - * CONFIG_SYS_TEXT_BASE can be defined in board specific header file,
> if needed
> > - */
> > -#ifndef CONFIG_SYS_TEXT_BASE
> > -#define        CONFIG_SYS_TEXT_BASE    0x0060
> > -#endif /* CONFIG_SYS_TEXT_BASE */
> > +/* Kirkwood has 2k of Security SRAM, use it for SP */
> > +#define CONFIG_SYS_INIT_SP_ADDR                0xC8012000
> > +#define CONFIG_NR_DRAM_BANKS_MAX       2
> >
> >  #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
> > -#define MV_UART0_BASE          KW_UART0_BASE
> > +#define MV_UART_CONSOLE_BASE   KW_UART0_BASE
> 
> Could we just define the uart base as hard coding one here? For it
> must refer to the .h
> file in the arch/arm/include directory, which make no sense for the
> configure file.

NACK, Console can be on any one of available UART.

> 
> >  #define MV_SATA_BASE           KW_SATA_BASE
> >  #define MV_SATA_PORT0_OFFSET   KW_SATA_PORT0_OFFSET
> >  #define MV_SATA_PORT1_OFFSET   KW_SATA_PORT1_OFFSET
> >
> > +/* > ARMADA100 Platform Common Definations */
> 
> I think you probably need to think to seperate armada100 sepecific and
> kirkwood specific stuff from mv-common.h now.
> For those two kind of definition makes mv-common not so common as it is.

NACK, objective of mv-common.h to abstract marvell specific stuff.
There is no sense making SoC specific .h

...snip...
> > +#define CONFIG_MII             /* expose smi ove miiphy interface */
> >  #define CONFIG_MVGBE           /* Enable Marvell Gbe Controller Driver
> */
> >  #define CONFIG_SYS_FAULT_ECHO_LINK_DOWN        /* detect link using phy
> */
> >  #define CONFIG_ENV_OVERWRITE   /* ethaddr can be reprogrammed */
> > @@ -232,6 +263,7 @@
> >  /*
> >  * File system
> >  */
> > +#ifndef CONFIG_ARMADA100       /* will be removed latter */
> We may need think how to remove it later now...

Sure, when we will support respective peripheral, this will be removed.

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


Re: [U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs

2010-12-07 Thread Prafulla Wadaskar


> -Original Message-
> From: Lei Wen [mailto:adrian.w...@gmail.com]
> Sent: Tuesday, December 07, 2010 8:53 PM
> To: Prafulla Wadaskar
> Cc: u-boot@lists.denx.de; Eric Miao; Manas Saksena; Lei Wen; Yu Tang;
> Ashish Karkare; Kiran Vedere; Prabhanjan Sarnaik
> Subject: Re: [U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin
> configuration driver for Marvell SoCs
> 
> Hi Prafulla,
> 
> On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar 
> wrote:
> > Most of the Marvell SoCs has Multi Function Pin (MFP) configuration
> registers
> > For ex. ARMADA100.
> >
> > These registers are programmed to expose the specific functionality
> > associated with respective SoC Pins
> >
> > This driver provides configuration APIs,
> > using them, configuration need to be done in board specific code
> >
> > for ex- following code configures MFPs 107 and 108 for UART_TX/RX
> functionality
> >
> > int board_early_init_f(void)
> > {
> >        u32 mfp_cfg[] = {
> >                /* Console on UART1 */
> >                MFP107_UART1_RXD,
> >                MFP108_UART1_TXD,
> >                MFP_EOC         /*End of configureation*/
> >        };
> >        /* configure MFP's */
> >        mfp_config(mfp_cfg);
> >        return 0;
> > }
> >
> > Signed-off-by: Prafulla Wadaskar 
> > ---
> > Changelog v4:
> > 1. Driver renamed as mvmfp
> > 2. Re-architected mvmfp driver as per review feedback
> >
> >  drivers/gpio/Makefile |    1 +
> >  drivers/gpio/mvmfp.c  |   90
> 
> >  include/mvmfp.h       |  100
> +
> >  3 files changed, 191 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/gpio/mvmfp.c
> >  create mode 100644 include/mvmfp.h
> >
> > diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> > index 398024c..a5fa2b5 100644
> > --- a/drivers/gpio/Makefile
> > +++ b/drivers/gpio/Makefile
> > @@ -27,6 +27,7 @@ LIB   := $(obj)libgpio.o
> >
> >  COBJS-$(CONFIG_AT91_GPIO)      += at91_gpio.o
> >  COBJS-$(CONFIG_KIRKWOOD_GPIO)  += kw_gpio.o
> > +COBJS-$(CONFIG_MARVELL_MFP)    += mvmfp.o
> >  COBJS-$(CONFIG_MXC_GPIO)       += mxc_gpio.o
> >  COBJS-$(CONFIG_PCA953X)                += pca953x.o
> >  COBJS-$(CONFIG_S5P)            += s5p_gpio.o
> > diff --git a/drivers/gpio/mvmfp.c b/drivers/gpio/mvmfp.c
> > new file mode 100644
> > index 000..3472278
> > --- /dev/null
> > +++ b/drivers/gpio/mvmfp.c
> > @@ -0,0 +1,90 @@
> > +/*
> > + * (C) Copyright 2010
> > + * Marvell Semiconductor 
> > + * Written-by: Prafulla Wadaskar ,
> > + *
> > + * 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 
> > +#include 
> > +#include 
> > +#include 
> > +#ifdef CONFIG_ARMADA100
> > +#include 
> > +#define MFPR_BASE      ARMD1_MFPR_BASE
> > +#else
> > +#error Unsupported SoC...
> > +#endif
> 
> Why not directly name a CONFIG_MFPR_BASE, and define its value in the
> config file?

Otherway, We can eliminate #define MFPR_BASE here and define the same in 
asm/arch/armada100.h instead of ARMD1_MFPR_BASE

> If we do like this ifdef, we may need do add each arch here, seems
> some kind of redundant?

This is required here, see drivers/serial/serial.c

...snip...
> > +               /* Write a mfg register as per configuration */
> > +               if (cfg_val & MFP_AF_FLAG) {
> > +                       /* Abstract and program Afternate-Func Selection
> */
> > +                       val &= ~MFP_AF_MASK;
> Do we need to do this & here? For val is only 0 here...

This can be removed.

> Should not it be more concise like:
> writel(cfg_val, p_mfpr);

NACK, cfg_val have some more stuff like offset, flags, those are not required 
to write on mfp register.

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


Re: [U-Boot] Please pull u-boot-atmel/for2010.12

2010-12-07 Thread Reinhard Meyer
Dear Wolfgang Denk,
> Well, the point is that your referenc ist not the ARM tree, but you
> pulled inbetween and thus have stuff in your tree that is not present
> in u-boot-arm # master yet - so when I pull from your repo, I will get
> all this stuff as well.

Umm, thats true. I pulled from u-boot.git/master to my master.
I will repull/rebase that to u-boot-arm. Did not think about that.
Previously I was just lucky that u-boot-arm was identical to u-boot :) 
Solves one mystery.

> 
>> For Andreas' patches, it seems that Signed-off-by: lines with non-ASCII 
>> characters in the name do cause
>> trouble and git-am choses to use the e-mail address instead.
> 
> I don't think that this is a problem with git-am.
> 
> When I use git-am to apply one of Andreas' patches, I will get a
> warning but only for the body of the commit message (for the SoB line,
> to be precise):
> 
> ...
> Applying: at91rm9200ek: add configure target for RAM boot
> Warning: commit message does not conform to UTF-8.
> You may want to amend it after fixing the message, or set the config
> variable i18n.commitencoding to the encoding your project uses.
> 
> But except from that it works fine, and it shows 
> 
> Author: Andreas Bießmann   2010-11-30 20:45:03
> Committer: Wolfgang Denk   2010-12-07 15:28:06
> 
> 
> I get identical results when downloading the mbox file from patchwork
> or when using the file in my local mailing list archive.

What I get when I do that (after save to disk the mbox files):

reinh...@sieb:~/embedded/u-boot-atmel$ git-am ../u-boot-patches/*.patch
Applying at91rm9200ek: fix SDRAM initialistation values
Applying at91rm9200ek: add configure target for RAM boot
Applying MAKEALL: fix AT91
Applying arm920t/at91/reset: board_reset: define weak symbol
Applying arm920t/at91/timer: replace bss variables by gd
reinh...@sieb:~/embedded/u-boot-atmel$ gitk
reinh...@sieb:~/embedded/u-boot-atmel$ git-request-pull master 
git://git.denx.de/u-boot-atmel.git to2010.12 >pull.txt
reinh...@sieb:~/embedded/u-boot-atmel$ cat pull.txt
The following changes since commit 52eb2c79110151b9017a0829c4d44ee7b8e2ca04:
  Wolfgang Denk (1):
Merge branch 'master' of git://git.denx.de/u-boot-samsung

are available in the git repository at:

  git://git.denx.de/u-boot-atmel.git for2010.12

Andreas Bießmann (1):
  arm920t/at91/reset: board_reset: define weak symbol

Reinhard Meyer (3):
  AT91: gen_atmel_mci.c: fix bug when Slot B is used
  AT91: fix EMAC gpio init in at91sam9260_devices.c
  AT91: add TOP9000 support

andreas.de...@googlemail.com (4):
  at91rm9200ek: fix SDRAM initialistation values
  at91rm9200ek: add configure target for RAM boot
  MAKEALL: fix AT91
  arm920t/at91/timer: replace bss variables by gd

 MAINTAINERS   |3 +-
 MAKEALL   |   18 +-
 arch/arm/cpu/arm920t/at91/reset.c |8 +-
 arch/arm/cpu/arm920t/at91/timer.c |   29 +-
 arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |5 +
 arch/arm/include/asm/global_data.h|1 +
 board/atmel/at91rm9200ek/config.mk|2 -
 board/emk/top9000/Makefile|   54 
 board/emk/top9000/spi.c   |   61 
 board/emk/top9000/top9000.c   |  290 +++
 boards.cfg|5 +-
 drivers/mmc/gen_atmel_mci.c   |1 +
 include/configs/at91rm9200ek.h|   18 ++-
 include/configs/top9000.h |  314 +
 14 files changed, 771 insertions(+), 38 deletions(-)
 delete mode 100644 board/atmel/at91rm9200ek/config.mk
 create mode 100644 board/emk/top9000/Makefile
 create mode 100644 board/emk/top9000/spi.c
 create mode 100644 board/emk/top9000/top9000.c
 create mode 100644 include/configs/top9000.h
reinh...@sieb:~/embedded/u-boot-atmel$ 

The ones he sent via the googlemail.com account still look funny for the Author 
part.
But does that really matter. The commit itself, including the Signed-off-by 
line os fine.

Best Regards,
Reinhard

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


Re: [U-Boot] [PATCH v4 6/7] mv-common.h: Add support for ARMADA100 Platforms

2010-12-07 Thread Lei Wen
Hi Prafulla,

On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar  wrote:
> This patch adds commonly used macros for ARMADA100 based
> baords, Also some code reshuffled and updated for typos and comments
>
> Signed-off-by: Prafulla Wadaskar 
> ---
> Changelog v3:
> CONFIG_ARCH_CPU_INIT moved out of #ifdef
>
> Changelog v4:
> CONFIG_MFP change to CONFIG_MARVELL_MFP
> some whitespaces removed
>
>  include/configs/mv-common.h |   65 --
>  1 files changed, 49 insertions(+), 16 deletions(-)
>
> diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
> index 0a76163..067527a 100644
> --- a/include/configs/mv-common.h
> +++ b/include/configs/mv-common.h
> @@ -39,6 +39,7 @@
>  #define CONFIG_MARVELL         1
>  #define CONFIG_ARM926EJS       1       /* Basic Architecture */
>
> +/* > Kirkwood Platform Common Definations */
>  #if defined(CONFIG_KIRKWOOD)
>  #define CONFIG_MD5     /* get_random_hex on krikwood needs MD5 support */
>  #define CONFIG_KIRKWOOD_EGIGA_INIT     /* Enable GbePort0/1 for kernel */
> @@ -54,27 +55,45 @@
>  #define        CONFIG_SYS_KWD_CONFIG   
> $(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
>  #endif /* CONFIG_SYS_KWD_CONFIG */
>
> -/*
> - * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if 
> needed
> - */
> -#ifndef CONFIG_SYS_TEXT_BASE
> -#define        CONFIG_SYS_TEXT_BASE    0x0060
> -#endif /* CONFIG_SYS_TEXT_BASE */
> +/* Kirkwood has 2k of Security SRAM, use it for SP */
> +#define CONFIG_SYS_INIT_SP_ADDR                0xC8012000
> +#define CONFIG_NR_DRAM_BANKS_MAX       2
>
>  #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
> -#define MV_UART0_BASE          KW_UART0_BASE
> +#define MV_UART_CONSOLE_BASE   KW_UART0_BASE

Could we just define the uart base as hard coding one here? For it
must refer to the .h
file in the arch/arm/include directory, which make no sense for the
configure file.

>  #define MV_SATA_BASE           KW_SATA_BASE
>  #define MV_SATA_PORT0_OFFSET   KW_SATA_PORT0_OFFSET
>  #define MV_SATA_PORT1_OFFSET   KW_SATA_PORT1_OFFSET
>
> +/* > ARMADA100 Platform Common Definations */

I think you probably need to think to seperate armada100 sepecific and
kirkwood specific stuff from mv-common.h now.
For those two kind of definition makes mv-common not so common as it is.

> +#elif defined (CONFIG_ARMADA100)
> +
> +#define CONFIG_SYS_TCLK                (14745600)      /* NS16550 clk config 
> */
> +#define CONFIG_SYS_HZ_CLOCK    (325)       /* Timer Freq. 3.25MHZ */
> +#define CONFIG_MARVELL_MFP                     /* Enable mvmfp driver */
> +#define MV_UART_CONSOLE_BASE   ARMD1_UART1_BASE
> +#define CONFIG_SYS_NS16550_IER (1 << 6)        /* Bit 6 in UART_IER register
> +                                               represents UART Unit Enable */
> +/*
> + * There is no internal RAM in ARMADA100, using DRAM
> + * TBD: dcache to be used for this
> + */
> +#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_TEXT_BASE - 
> 0x0020)
> +#define CONFIG_NR_DRAM_BANKS_MAX       2
> +
>  #else
> -#error "Unsupported SoC"
> +#error "Unsupported SoC Platform..."
>  #endif
>
> +/*
> + * Custom CONFIG_SYS_TEXT_BASE can be done in .h
> + */
> +#ifndef CONFIG_SYS_TEXT_BASE
> +#define        CONFIG_SYS_TEXT_BASE    0x0060
> +#endif /* CONFIG_SYS_TEXT_BASE */
> +
>  /* additions for new ARM relocation support */
> -#define CONFIG_SYS_SDRAM_BASE          0x
> -/* Kirkwood has 2k of Security SRAM, use it for SP */
> -#define CONFIG_SYS_INIT_SP_ADDR                0xC8012000
> +#define CONFIG_SYS_SDRAM_BASE  0x
>
>  /*
>  * CLKs configurations
> @@ -88,7 +107,7 @@
>  #define CONFIG_SYS_NS16550_SERIAL
>  #define CONFIG_SYS_NS16550_REG_SIZE    (-4)
>  #define CONFIG_SYS_NS16550_CLK         CONFIG_SYS_TCLK
> -#define CONFIG_SYS_NS16550_COM1                MV_UART0_BASE
> +#define CONFIG_SYS_NS16550_COM1                MV_UART_CONSOLE_BASE
>
>  /*
>  * Serial Port configuration
> @@ -156,25 +175,37 @@
>  #define CONFIG_CMDLINE_EDITING
>  #define CONFIG_CONSOLE_INFO_QUIET      /* some code reduction */
>  #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
> +#ifndef CONFIG_ARMADA100       /* will be removed latter */
>  #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
> +#endif /* CONFIG_ARMADA100 */
>  #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
>  #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
> -#define CONFIG_NR_DRAM_BANKS   4
>  #define CONFIG_STACKSIZE       0x0010      /* regular stack- 1M */
>  #define CONFIG_SYS_LOAD_ADDR   0x0080      /* default load adr- 8M */
> -#define CONFIG_SYS_MEMTEST_START 0x0040    /* 4M */
> -#define CONFIG_SYS_MEMTEST_END 0x007f      /*(_8M -1) */
> +#define CONFIG_SYS_MEMTEST_START 0x0080    /* 8M */
> +#define CONFIG_SYS_MEMTEST_END 0x00ff      /*(_16M -1) */
>  #define CONFIG_SYS_RESET_ADDRESS 0x    /* Rst Vector Adr */
>  #define CONFIG_SYS_MAXARGS     16  

Re: [U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs

2010-12-07 Thread Lei Wen
Hi Prafulla,

On Wed, Dec 8, 2010 at 1:06 AM, Prafulla Wadaskar  wrote:
> Most of the Marvell SoCs has Multi Function Pin (MFP) configuration registers
> For ex. ARMADA100.
>
> These registers are programmed to expose the specific functionality
> associated with respective SoC Pins
>
> This driver provides configuration APIs,
> using them, configuration need to be done in board specific code
>
> for ex- following code configures MFPs 107 and 108 for UART_TX/RX 
> functionality
>
> int board_early_init_f(void)
> {
>        u32 mfp_cfg[] = {
>                /* Console on UART1 */
>                MFP107_UART1_RXD,
>                MFP108_UART1_TXD,
>                MFP_EOC         /*End of configureation*/
>        };
>        /* configure MFP's */
>        mfp_config(mfp_cfg);
>        return 0;
> }
>
> Signed-off-by: Prafulla Wadaskar 
> ---
> Changelog v4:
> 1. Driver renamed as mvmfp
> 2. Re-architected mvmfp driver as per review feedback
>
>  drivers/gpio/Makefile |    1 +
>  drivers/gpio/mvmfp.c  |   90 
>  include/mvmfp.h       |  100 
> +
>  3 files changed, 191 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/gpio/mvmfp.c
>  create mode 100644 include/mvmfp.h
>
> diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
> index 398024c..a5fa2b5 100644
> --- a/drivers/gpio/Makefile
> +++ b/drivers/gpio/Makefile
> @@ -27,6 +27,7 @@ LIB   := $(obj)libgpio.o
>
>  COBJS-$(CONFIG_AT91_GPIO)      += at91_gpio.o
>  COBJS-$(CONFIG_KIRKWOOD_GPIO)  += kw_gpio.o
> +COBJS-$(CONFIG_MARVELL_MFP)    += mvmfp.o
>  COBJS-$(CONFIG_MXC_GPIO)       += mxc_gpio.o
>  COBJS-$(CONFIG_PCA953X)                += pca953x.o
>  COBJS-$(CONFIG_S5P)            += s5p_gpio.o
> diff --git a/drivers/gpio/mvmfp.c b/drivers/gpio/mvmfp.c
> new file mode 100644
> index 000..3472278
> --- /dev/null
> +++ b/drivers/gpio/mvmfp.c
> @@ -0,0 +1,90 @@
> +/*
> + * (C) Copyright 2010
> + * Marvell Semiconductor 
> + * Written-by: Prafulla Wadaskar ,
> + *
> + * 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 
> +#include 
> +#include 
> +#include 
> +#ifdef CONFIG_ARMADA100
> +#include 
> +#define MFPR_BASE      ARMD1_MFPR_BASE
> +#else
> +#error Unsupported SoC...
> +#endif

Why not directly name a CONFIG_MFPR_BASE, and define its value in the
config file?
If we do like this ifdef, we may need do add each arch here, seems
some kind of redundant?


> +
> +/*
> + * mfp_config
> + *
> + * On most of Marvell SoCs (ex. ARMADA100) there is Multi-Funtion-Pin
> + * configuration registers to configure each GPIO/Function pin on the
> + * SoC.
> + *
> + * This function reads the array of values for
> + * MFPR_X registers and programms them into respective
> + * Multi-Function Pin registers.
> + * It supports - Alternate Function Selection programming.
> + *
> + * Whereas,
> + * The Configureation value is constructed using MFP()
> + * array consists of 32bit values as defined in MFP(xx,xx..) macro
> + */
> +void mfp_config(u32 *mfp_cfgs)
> +{
> +       u32 *p_mfpr = NULL;
> +       u32 cfg_val, val=0;
> +
> +       do {
> +               cfg_val = *mfp_cfgs++;
> +               /* exit if End of configuration table detected */
> +               if (cfg_val == MFP_EOC)
> +                       break;
> +
> +               p_mfpr = (u32 *)(MFPR_BASE + MFP_REG_GET_OFFSET(cfg_val));



> +
> +               /* Write a mfg register as per configuration */
> +               if (cfg_val & MFP_AF_FLAG) {
> +                       /* Abstract and program Afternate-Func Selection */
> +                       val &= ~MFP_AF_MASK;
Do we need to do this & here? For val is only 0 here...
Should not it be more concise like:
writel(cfg_val, p_mfpr);


> +                       val |= cfg_val & MFP_AF_MASK;
> +               } if (cfg_val & MFP_EDGE_FLAG) {
> +                       /* Abstract and program Edge configuration */
> +                       val &= ~MFP_LPM_EDGE_MASK;
> +                       val |= cfg_val & MFP_LPM_EDGE_MASK;
> +               } if (cfg_val & MFP_DRIVE_FLAG) {
> +                       /* Abstract and program Drive configuration */

Re: [U-Boot] Please pull u-boot-atmel/for2010.12

2010-12-07 Thread Wolfgang Denk
Dear Reinhard Meyer,

In message <4cfe3553.7080...@emk-elektronik.de> you wrote:
>
> did you find out what happened here? I can clearly see in my local tree and 
> also in the webinterface
> of the u-boot-atmel.git at your server that there are exactly 8 commits 
> between
> 49733aa0b9d29803384ad4bce74985f4bbe7e9aa and top of for2010.12. None of them 
> affects the extra files
> you seem to see locally.

Well, the point is that your referenc ist not the ARM tree, but you
pulled inbetween and thus have stuff in your tree that is not present
in u-boot-arm # master yet - so when I pull from your repo, I will get
all this stuff as well.

> For Andreas' patches, it seems that Signed-off-by: lines with non-ASCII 
> characters in the name do cause
> trouble and git-am choses to use the e-mail address instead.

I don't think that this is a problem with git-am.

When I use git-am to apply one of Andreas' patches, I will get a
warning but only for the body of the commit message (for the SoB line,
to be precise):

...
Applying: at91rm9200ek: add configure target for RAM boot
Warning: commit message does not conform to UTF-8.
You may want to amend it after fixing the message, or set the config
variable i18n.commitencoding to the encoding your project uses.

But except from that it works fine, and it shows 

Author: Andreas Bießmann   2010-11-30 20:45:03
Committer: Wolfgang Denk   2010-12-07 15:28:06


I get identical results when downloading the mbox file from patchwork
or when using the file in my local mailing list archive.


Thi sis not a git-am issue, but something on your end.


> I'll hand edit the "ß" to "ss" and it is ok.

I see no reason for doing this.

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 well-written program is its own heaven; a poorly-written program is
its own hell. -- Geoffrey James, "The Tao of Programming"
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc: transform init_sequence into a function.

2010-12-07 Thread Joakim Tjernlund
Wolfgang Denk  wrote on 2010/12/07 14:07:56:
>
> Dear Joakim Tjernlund,
>
> In message 
>  you 
> wrote:
> >
> > > > MPC8321 and BDI2000. I have to play games with some internal
> > > > BDI command called SAP. Maybe they have fixed this in later models?
> > >
> > > Are you using the latest firmware, i. . 1.31 from October 2009?
> >
> > No, got an earlier one, 1.24
>
> Well, 1.24 is from April 2006.  Information about the MPC8321 must

No surprise there considering we were beta testers of MPC8321. We
actually had to nag on Freescale to send Abatron an eval board so
we could buy a BDI2000 with MPC832x support :)

> have been pretty limited at that time.  Please update.  [Let me know
> if you want me to send you a quote for the latest firmware :-) ]

He, I sent an email to Abatron and they already replied with the
firmware we are entitled to which is somewhat newer than 1.24 so I will
try that one first :)

 Jocke

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


[U-Boot] [PATCH] xilinx-ppc4xx-generic: Use common u-boot.lds

2010-12-07 Thread Ricardo Ribalda Delgado
Use common ppc4xx linker script for xilinx ppc440 and ppc405 related boards.

Signed-off-by: Ricardo Ribalda Delgado 
---
 arch/powerpc/cpu/ppc4xx/start.S|2 +-
 arch/powerpc/cpu/ppc4xx/u-boot.lds |8 ++
 board/xilinx/ppc405-generic/Makefile   |4 +-
 board/xilinx/ppc405-generic/u-boot-ram.lds |  131 -
 board/xilinx/ppc405-generic/u-boot-rom.lds |  141 ---
 board/xilinx/ppc440-generic/Makefile   |4 +-
 board/xilinx/ppc440-generic/u-boot-ram.lds |  132 --
 board/xilinx/ppc440-generic/u-boot-rom.lds |  142 
 boards.cfg |   20 ++--
 include/configs/xilinx-ppc.h   |1 +
 10 files changed, 26 insertions(+), 559 deletions(-)
 delete mode 100644 board/xilinx/ppc405-generic/u-boot-ram.lds
 delete mode 100644 board/xilinx/ppc405-generic/u-boot-rom.lds
 delete mode 100644 board/xilinx/ppc440-generic/u-boot-ram.lds
 delete mode 100644 board/xilinx/ppc440-generic/u-boot-rom.lds

diff --git a/arch/powerpc/cpu/ppc4xx/start.S b/arch/powerpc/cpu/ppc4xx/start.S
index 0e75794..d57225d 100644
--- a/arch/powerpc/cpu/ppc4xx/start.S
+++ b/arch/powerpc/cpu/ppc4xx/start.S
@@ -265,7 +265,7 @@
/* NOTREACHED - board_init_f() does not return */
 #endif
 
-#if defined(CONFIG_SYS_RAMBOOT)
+#if defined(CONFIG_SYS_RAMBOOT) || defined(CONFIG_BOOT_FROM_XMD)
/*
 * 4xx RAM-booting U-Boot image is started from offset 0
 */
diff --git a/arch/powerpc/cpu/ppc4xx/u-boot.lds 
b/arch/powerpc/cpu/ppc4xx/u-boot.lds
index dac0e5b..842ff5f 100644
--- a/arch/powerpc/cpu/ppc4xx/u-boot.lds
+++ b/arch/powerpc/cpu/ppc4xx/u-boot.lds
@@ -23,8 +23,12 @@
 #include "config.h"/* CONFIG_BOARDDIR */
 
 #ifndef RESET_VECTOR_ADDRESS
+#ifdef CONFIG_RESET_VECTOR_ADDRESS
+#define RESET_VECTOR_ADDRESS   CONFIG_RESET_VECTOR_ADDRESS
+#else
 #define RESET_VECTOR_ADDRESS   0xfffc
 #endif
+#endif
 
 OUTPUT_ARCH(powerpc)
 
@@ -100,7 +104,11 @@ SECTIONS
  * start.o, since the first shadow TLB only covers 4k
  * of address space.
  */
+#ifdef CONFIG_INIT_TLB
+CONFIG_INIT_TLB (.bootpg)
+#else
 CONFIG_BOARDDIR/init.o (.bootpg)
+#endif
   } :text = 0x
 #endif
 
diff --git a/board/xilinx/ppc405-generic/Makefile 
b/board/xilinx/ppc405-generic/Makefile
index 4b8e4f4..717ffc9 100644
--- a/board/xilinx/ppc405-generic/Makefile
+++ b/board/xilinx/ppc405-generic/Makefile
@@ -41,7 +41,9 @@ SRCS  := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):$(OBJS) $(SOBJS)
+all: $(LIB) $(SOBJS)
+
+$(LIB):$(OBJS)
$(call cmd_link_o_target, $^)
 
 clean:
diff --git a/board/xilinx/ppc405-generic/u-boot-ram.lds 
b/board/xilinx/ppc405-generic/u-boot-ram.lds
deleted file mode 100644
index a7539fd..000
--- a/board/xilinx/ppc405-generic/u-boot-ram.lds
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * (C) Copyright 2000-2004
- * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
- *
- * 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
- */
-
-OUTPUT_ARCH(powerpc)
-ENTRY(_start)
-
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash  : { *(.hash)  }
-  .dynsym: { *(.dynsym)}
-  .dynstr: { *(.dynstr)}
-  .rel.text  : { *(.rel.text)  }
-  .rela.text : { *(.rela.text) }
-  .rel.data  : { *(.rel.data)  }
-  .rela.data : { *(.rela.data) }
-  .rel.rodata: { *(.rel.rodata)}
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got   : { *(.rel.got)   }
-  .rela.got  : { *(.rela.got)  }
-  .rel.ctors : { *(.rel.ctors) }
-  .rela.ctors: { *(.rela.ctors)}
-  .rel.dtors : { *(.rel.dtors) }
-  .rela.dtors: { *(.rela.dtors)}
-  .rel.bss   : { *(.rel.bss)   }
-  .rela.bss  : { *(.rela.bss)  }
-  .rel.plt   : { *(.rel.plt)   }
-  .rela.plt  : { *(.rela.plt)  }
-  .init  : { *(.init)  }
-  .plt : { *(.plt) }
-  .text   

Re: [U-Boot] Please pull u-boot-atmel/for2010.12

2010-12-07 Thread Reinhard Meyer
> Dear Wolfgang Denk,
>> In message<4cfcb04b.10...@emk-elektronik.de>  you wrote:
>>> Dear Wolfgang, Albert,
>>>
>>> The following changes since commit 49733aa0b9d29803384ad4bce74985f4bbe7e9aa:
>>>Wolfgang Denk (1):
>>>  Merge branch 'master' of /home/wd/git/u-boot/custodians
>>>
>>> are available in the git repository at:
>>>
>>>git://git.denx.de/u-boot-atmel.git for2010.12
>>>
>>> Andreas Bießmann (1):
>>>arm920t/at91/reset: board_reset: define weak symbol
>>>
>>> Reinhard Meyer (3):
>>>AT91: gen_atmel_mci.c: fix bug when Slot B is used
>>>AT91: fix EMAC gpio init in at91sam9260_devices.c
>>>AT91: add TOP9000 support
>>>
>>> andreas.de...@googlemail.com (4):
>>>at91rm9200ek: add configure target for RAM boot
>>>MAKEALL: fix AT91
>>>arm920t/at91/timer: replace bss variables by gd
>>>at91rm9200ek: fix SDRAM initialistation values
>>>
>>>   MAINTAINERS   |3 +-
>>>   MAKEALL   |   18 +-
>>>   arch/arm/cpu/arm920t/at91/reset.c |8 +-
>>>   arch/arm/cpu/arm920t/at91/timer.c |   29 +-
>>>   arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |5 +
>>>   arch/arm/include/asm/global_data.h|1 +
>>>   board/atmel/at91rm9200ek/config.mk|2 -
>>>   board/emk/top9000/Makefile|   54 
>>>   board/emk/top9000/spi.c   |   61 
>>>   board/emk/top9000/top9000.c   |  290 
>>> +++
>>>   boards.cfg|5 +-
>>>   drivers/mmc/gen_atmel_mci.c   |1 +
>>>   include/configs/at91rm9200ek.h|   18 ++-
>>>   include/configs/top9000.h |  314 
>>> +
>>>   14 files changed, 771 insertions(+), 38 deletions(-)
>>>   delete mode 100644 board/atmel/at91rm9200ek/config.mk
>>>   create mode 100644 board/emk/top9000/Makefile
>>>   create mode 100644 board/emk/top9000/spi.c
>>>   create mode 100644 board/emk/top9000/top9000.c
>>>   create mode 100644 include/configs/top9000.h
>> Hm... what I see looks quite different:
>>
>>   MAINTAINERS   |3 +-
>>   MAKEALL   |   18 +-
>>   arch/arm/cpu/arm920t/at91/reset.c |8 +-
>>   arch/arm/cpu/arm920t/at91/timer.c |   29 +-
>>   arch/arm/cpu/arm926ejs/at91/at91sam9260_devices.c |5 +
>>   arch/arm/include/asm/global_data.h|1 +
>>   arch/powerpc/cpu/mpc83xx/start.S  |8 +
>>   arch/powerpc/lib/board.c  |   11 +
>>   arch/sh/cpu/sh2/start.S   |8 +-
>>   arch/sh/cpu/sh3/start.S   |8 +-
>>   arch/sh/cpu/sh4/start.S   |   10 +-
>>   board/atmel/at91rm9200ek/config.mk|2 -
>>   board/emk/top9000/Makefile|   54 
>>   board/emk/top9000/spi.c   |   61 
>>   board/emk/top9000/top9000.c   |  290 
>> +++
>>   board/freescale/mpc8641hpcn/mpc8641hpcn.c |3 -
>>   board/freescale/p2020ds/p2020ds.c |3 -
>>   boards.cfg|5 +-
>>   common/hwconfig.c |   14 +-
>>   drivers/mmc/gen_atmel_mci.c   |1 +
>>   include/configs/MPC8360EMDS.h |4 +-
>>   include/configs/MPC8536DS.h   |5 +-
>>   include/configs/MPC8569MDS.h  |3 +-
>>   include/configs/P1_P2_RDB.h   |5 +-
>>   include/configs/at91rm9200ek.h|   18 ++-
>>   include/configs/atngw100.h|2 -
>>   include/configs/mimc200.h |2 -
>>   include/configs/r7780mp.h |1 -
>>   include/configs/top9000.h |  314 
>> +
>>   include/pci_ids.h |1 +
>>   30 files changed, 820 insertions(+), 77 deletions(-)
>>   delete mode 100644 board/atmel/at91rm9200ek/config.mk
>>   create mode 100644 board/emk/top9000/Makefile
>>   create mode 100644 board/emk/top9000/spi.c
>>   create mode 100644 board/emk/top9000/top9000.c
>>   create mode 100644 include/configs/top9000.h
> 
> Have a look at:
> 
> http://git.denx.de/?p=u-boot/u-boot-atmel.git;a=shortlog;h=refs/heads/for2010.12
> 
> There it does not show the extra files you seem to see.
> 
> Please verify that.

Hello Wolfgang,

did you find out what happened here? I can clearly see in my local tree and 
also in the webinterface
of the u-boot-atmel.git at your server that there are exactly 8 commits between
49733aa0b9d29803384ad4bce74985f4bb

Re: [U-Boot] [PATCH] ARM: make timer variables in gt_t available for all ARM platforms

2010-12-07 Thread Wolfgang Denk
Dear Prafulla Wadaskar,

In message  
you wrote:
> 
> > This patch makes timer related variables in gd_t available for
> > all ARM implementation
---^

> Applied to u-boot-marvell.git master branch

Thisis NOT a Marvell specific commit.  It is not supposed to go
through the Marvell repository.  It is a common ARM patch and should
go through the ARM repo.

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
Anything free is worth what you pay for it.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ppc: transform init_sequence into a function.

2010-12-07 Thread Wolfgang Denk
Dear Joakim Tjernlund,

In message 
 you 
wrote:
>
> > > MPC8321 and BDI2000. I have to play games with some internal
> > > BDI command called SAP. Maybe they have fixed this in later models?
> >
> > Are you using the latest firmware, i. . 1.31 from October 2009?
> 
> No, got an earlier one, 1.24

Well, 1.24 is from April 2006.  Information about the MPC8321 must
have been pretty limited at that time.  Please update.  [Let me know
if you want me to send you a quote for the latest firmware :-) ]

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
"...this does not mean that some of us should not want, in  a  rather
dispassionate sort of way, to put a bullet through csh's head."
   - Larry Wall in <1992aug6.221512.5...@netlabs.com>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MAINTAINERS: Transfer openrd_base maintainership to Prafulla Wadaskar

2010-12-07 Thread Prafulla Wadaskar


> -Original Message-
> From: Simon Kagstrom [mailto:simon.kagst...@netinsight.net]
> Sent: Wednesday, December 01, 2010 1:04 PM
> To: U-Boot ML
> Cc: Prafulla Wadaskar; Albert ARIBAUD
> Subject: [PATCH] MAINTAINERS: Transfer openrd_base maintainership to
> Prafulla Wadaskar
> 
> Signed-off-by: Simon Kagstrom 
> ---
> I no longer work on OpenRD base, so transfer the maintainership to
> Prafulla at Marvell.
> 
>  MAINTAINERS |5 +
>  1 files changed, 1 insertions(+), 4 deletions(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index f47fca5..ed07052 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -663,10 +663,6 @@ Matthias Kaehlcke 
>  Konstantin Kletschke 
>   scb9328 ARM920T
> 
> -Simon Kagstrom 
> -
> -   openrd_base ARM926EJS (Kirkwood SoC)
> -
>  Nishant Kamat 
> 
>   omap1610h2  ARM926EJS
> @@ -837,6 +833,7 @@ Matt Waddel 
>  Prafulla Wadaskar 
> 
>   mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
> + openrd_base ARM926EJS (Kirkwood SoC)
>   rd6281a ARM926EJS (Kirkwood SoC)
>   sheevaplug  ARM926EJS (Kirkwood SoC)

Applied to u-boot-marvell.git

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


[U-Boot] [PATCH v4 0/7] Add Marvell New Soc Support ARMADA100

2010-12-07 Thread Prafulla Wadaskar
This patch series adds basic ARMADA100 support, with minimal drivers
(UART, MFP) support and Aspenite-DB board support for simple boot

Changelog v2:
1. This patch series is in sync latest u-boot
2. config.mk removed
3. CONFIG_SYS_NS16550_IER used for serial drivers
4. mv-common.h updated for aspenite support
5. c-struct used for dram.c
6. All review feedback for v1 implemented

Changelog v3:
1. timer.c: timer variables in gt_t used insted of locally defined global 
variables
2. timer.c: register global pointer moved to respective functions
3. timer.c: Macro READ_TIMER converted to function read_timer()
4. armada100.h: c-struc in armada100.h fixed for wrong padding
5. macro defination CONFIG_SYS_NS16550_IER moved from ns16550.h to ns16550.c
6. Removed reordiring of header files in serial.c, the diff is only limited
   to include armada100.h
7. mv-common.h: CONFIG_ARCH_CPU_INIT moved out of #ifdef
8. aspenite.h: #define DEBUG removed

Changelog v4:
1. mfp driver renamed as mvmfp
2. re-architected mvmfp driver as per review feedback

These patches are tested on board
Fo sucessfull build, these patches are dependent upon a patch.
 "ARM: make timer variables in gt_t available for all ARM platforms"
  ref: http://lists.denx.de/pipermail/u-boot/2010-December/082834.html

Regards..
Prafulla . .

Prafulla Wadaskar (7):
  arm: Add Support for Marvell ARMADA 100 Familiy SoCs
  gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs
  add Multi Function Pin configuration support for ARMADA100
  Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro
  Serial: Add UART support for Marvell ARMADA 100 SoCs.
  mv-common.h: Add support for ARMADA100 Platforms
  Armada100: Add Board Support for Marvell Aspenite-DB

 MAINTAINERS |1 +
 MAKEALL |1 +
 arch/arm/cpu/arm926ejs/armada100/Makefile   |   46 +
 arch/arm/cpu/arm926ejs/armada100/cpu.c  |   92 ++
 arch/arm/cpu/arm926ejs/armada100/dram.c |  131 ++
 arch/arm/cpu/arm926ejs/armada100/timer.c|  207 +++
 arch/arm/include/asm/arch-armada100/armada100.h |  121 +
 arch/arm/include/asm/arch-armada100/cpu.h   |   53 ++
 arch/arm/include/asm/arch-armada100/mfp.h   |   67 
 board/Marvell/aspenite/Makefile |   52 ++
 board/Marvell/aspenite/aspenite.c   |   53 ++
 boards.cfg  |1 +
 drivers/gpio/Makefile   |1 +
 drivers/gpio/mvmfp.c|   90 ++
 drivers/serial/ns16550.c|8 +-
 drivers/serial/serial.c |5 +-
 include/configs/aspenite.h  |   63 +++
 include/configs/mv-common.h |   65 ++--
 include/mvmfp.h |  100 +++
 19 files changed, 1137 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/dram.c
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/timer.c
 create mode 100644 arch/arm/include/asm/arch-armada100/armada100.h
 create mode 100644 arch/arm/include/asm/arch-armada100/cpu.h
 create mode 100644 arch/arm/include/asm/arch-armada100/mfp.h
 create mode 100644 board/Marvell/aspenite/Makefile
 create mode 100644 board/Marvell/aspenite/aspenite.c
 create mode 100644 drivers/gpio/mvmfp.c
 create mode 100644 include/configs/aspenite.h
 create mode 100644 include/mvmfp.h

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


[U-Boot] [PATCH v4 7/7] Armada100: Add Board Support for Marvell Aspenite-DB

2010-12-07 Thread Prafulla Wadaskar
Aspenite is a Development Board for ASPEN/ARMADA168(88AP168) with
* Processor upto 1.2GHz
* Parallel 1Gb x8 DDR2-1066 MHz
* 16 Mb x16 NOR, 4Gb x8 SLC NAND, footprint for SPI NOR
* Footprints for eMMC/eSD NAND & MMC x8 card
* 4-in-1 card reader (xD, MMC/SD/MS Pro), CF True IDE socket
* SEAF memory board, subset of PISMO2
With Peripherals:
* 4.3” WVGA 24-bit LCD
* Audio codecs (AC97 & I2S), TSI
* VGA camera
* Video in via 3 RCA jacks, and HDMI type C out
* Marvell 88W8688 802.11bg/BT module
* GPS RF IC
* Dual analog mics & speakers, headset jack, LED, ambient light sensor
* USB2.0 HS host  (A), OTG (micro AB)
* FE PHY, PCIE Mini Card  slot
* GPIO, GPIO expander with DIP switches for easier selection UART 
serial over USB, CIR

This patch adds basic board support with DRAM and UART functionality
The patch is tested for boot from DRAM using XDB

Signed-off-by: Mahavir Jain 
Signed-off-by: Prafulla Wadaskar 
---
Change log for v2:
used mv-common.h
defined CONFIG_SYS_NS16550_IER macro in Soc heder file
removed config.mk

Change log for v3:
DEBUG removed from aspenite.h

Change log for v4:
name changes as per mvmfp

 MAINTAINERS   |1 +
 MAKEALL   |1 +
 board/Marvell/aspenite/Makefile   |   52 ++
 board/Marvell/aspenite/aspenite.c |   53 +++
 boards.cfg|1 +
 include/configs/aspenite.h|   63 +
 6 files changed, 171 insertions(+), 0 deletions(-)
 create mode 100644 board/Marvell/aspenite/Makefile
 create mode 100644 board/Marvell/aspenite/aspenite.c
 create mode 100644 include/configs/aspenite.h

diff --git a/MAINTAINERS b/MAINTAINERS
index f47fca5..d7e47a6 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -836,6 +836,7 @@ Matt Waddel 
 
 Prafulla Wadaskar 
 
+   aspeniteARM926EJS (ARMADA100 88AP168 SoC)
mv88f6281gtw_ge ARM926EJS (Kirkwood SoC)
rd6281a ARM926EJS (Kirkwood SoC)
sheevaplug  ARM926EJS (Kirkwood SoC)
diff --git a/MAKEALL b/MAKEALL
index 767d561..e83c9d7 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -326,6 +326,7 @@ LIST_ARM9=" \
ap926ejs\
ap946es \
ap966   \
+   aspenite\
cp920t  \
cp922_XA10  \
cp926ejs\
diff --git a/board/Marvell/aspenite/Makefile b/board/Marvell/aspenite/Makefile
new file mode 100644
index 000..cb1b65f
--- /dev/null
+++ b/board/Marvell/aspenite/Makefile
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2010
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+# Contributor: Mahavir Jain 
+#
+# 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  := aspenite.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(AR) $(ARFLAGS) $@ $(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/Marvell/aspenite/aspenite.c 
b/board/Marvell/aspenite/aspenite.c
new file mode 100644
index 000..046ffd6
--- /dev/null
+++ b/board/Marvell/aspenite/aspenite.c
@@ -0,0 +1,53 @@
+/*
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar 
+ * Contributor: Mahavir Jain 
+ *
+ * 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.
+ *
+ * 

[U-Boot] [PATCH v4 6/7] mv-common.h: Add support for ARMADA100 Platforms

2010-12-07 Thread Prafulla Wadaskar
This patch adds commonly used macros for ARMADA100 based
baords, Also some code reshuffled and updated for typos and comments

Signed-off-by: Prafulla Wadaskar 
---
Changelog v3:
CONFIG_ARCH_CPU_INIT moved out of #ifdef

Changelog v4:
CONFIG_MFP change to CONFIG_MARVELL_MFP
some whitespaces removed

 include/configs/mv-common.h |   65 --
 1 files changed, 49 insertions(+), 16 deletions(-)

diff --git a/include/configs/mv-common.h b/include/configs/mv-common.h
index 0a76163..067527a 100644
--- a/include/configs/mv-common.h
+++ b/include/configs/mv-common.h
@@ -39,6 +39,7 @@
 #define CONFIG_MARVELL 1
 #define CONFIG_ARM926EJS   1   /* Basic Architecture */
 
+/* > Kirkwood Platform Common Definations */
 #if defined(CONFIG_KIRKWOOD)
 #define CONFIG_MD5 /* get_random_hex on krikwood needs MD5 support */
 #define CONFIG_KIRKWOOD_EGIGA_INIT /* Enable GbePort0/1 for kernel */
@@ -54,27 +55,45 @@
 #defineCONFIG_SYS_KWD_CONFIG   
$(SRCTREE)/$(CONFIG_BOARDDIR)/kwbimage.cfg
 #endif /* CONFIG_SYS_KWD_CONFIG */
 
-/*
- * CONFIG_SYS_TEXT_BASE can be defined in board specific header file, if needed
- */
-#ifndef CONFIG_SYS_TEXT_BASE
-#defineCONFIG_SYS_TEXT_BASE0x0060
-#endif /* CONFIG_SYS_TEXT_BASE */
+/* Kirkwood has 2k of Security SRAM, use it for SP */
+#define CONFIG_SYS_INIT_SP_ADDR0xC8012000
+#define CONFIG_NR_DRAM_BANKS_MAX   2
 
 #define CONFIG_I2C_MVTWSI_BASE KW_TWSI_BASE
-#define MV_UART0_BASE  KW_UART0_BASE
+#define MV_UART_CONSOLE_BASE   KW_UART0_BASE
 #define MV_SATA_BASE   KW_SATA_BASE
 #define MV_SATA_PORT0_OFFSET   KW_SATA_PORT0_OFFSET
 #define MV_SATA_PORT1_OFFSET   KW_SATA_PORT1_OFFSET
 
+/* > ARMADA100 Platform Common Definations */
+#elif defined (CONFIG_ARMADA100)
+
+#define CONFIG_SYS_TCLK(14745600)  /* NS16550 clk config */
+#define CONFIG_SYS_HZ_CLOCK(325)   /* Timer Freq. 3.25MHZ */
+#define CONFIG_MARVELL_MFP /* Enable mvmfp driver */
+#define MV_UART_CONSOLE_BASE   ARMD1_UART1_BASE
+#define CONFIG_SYS_NS16550_IER (1 << 6)/* Bit 6 in UART_IER register
+   represents UART Unit Enable */
+/*
+ * There is no internal RAM in ARMADA100, using DRAM
+ * TBD: dcache to be used for this
+ */
+#define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_TEXT_BASE - 
0x0020)
+#define CONFIG_NR_DRAM_BANKS_MAX   2
+
 #else
-#error "Unsupported SoC"
+#error "Unsupported SoC Platform..."
 #endif
 
+/*
+ * Custom CONFIG_SYS_TEXT_BASE can be done in .h
+ */
+#ifndef CONFIG_SYS_TEXT_BASE
+#defineCONFIG_SYS_TEXT_BASE0x0060
+#endif /* CONFIG_SYS_TEXT_BASE */
+
 /* additions for new ARM relocation support */
-#define CONFIG_SYS_SDRAM_BASE  0x
-/* Kirkwood has 2k of Security SRAM, use it for SP */
-#define CONFIG_SYS_INIT_SP_ADDR0xC8012000
+#define CONFIG_SYS_SDRAM_BASE  0x
 
 /*
  * CLKs configurations
@@ -88,7 +107,7 @@
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE(-4)
 #define CONFIG_SYS_NS16550_CLK CONFIG_SYS_TCLK
-#define CONFIG_SYS_NS16550_COM1MV_UART0_BASE
+#define CONFIG_SYS_NS16550_COM1MV_UART_CONSOLE_BASE
 
 /*
  * Serial Port configuration
@@ -156,25 +175,37 @@
 #define CONFIG_CMDLINE_EDITING
 #define CONFIG_CONSOLE_INFO_QUIET  /* some code reduction */
 #define CONFIG_ARCH_CPU_INIT   /* call arch_cpu_init() */
+#ifndef CONFIG_ARMADA100   /* will be removed latter */
 #define CONFIG_ARCH_MISC_INIT  /* call arch_misc_init() */
+#endif /* CONFIG_ARMADA100 */
 #define CONFIG_BOARD_EARLY_INIT_F /* call board_init_f for early inits */
 #define CONFIG_DISPLAY_CPUINFO /* Display cpu info */
-#define CONFIG_NR_DRAM_BANKS   4
 #define CONFIG_STACKSIZE   0x0010  /* regular stack- 1M */
 #define CONFIG_SYS_LOAD_ADDR   0x0080  /* default load adr- 8M */
-#define CONFIG_SYS_MEMTEST_START 0x0040/* 4M */
-#define CONFIG_SYS_MEMTEST_END 0x007f  /*(_8M -1) */
+#define CONFIG_SYS_MEMTEST_START 0x0080/* 8M */
+#define CONFIG_SYS_MEMTEST_END 0x00ff  /*(_16M -1) */
 #define CONFIG_SYS_RESET_ADDRESS 0x/* Rst Vector Adr */
 #define CONFIG_SYS_MAXARGS 16  /* max number of command args */
 
 /*
+ * DRAM Banks configuration, Custom config can be done in .h
+ */
+#ifndef CONFIG_NR_DRAM_BANKS
+#define CONFIG_NR_DRAM_BANKS   CONFIG_NR_DRAM_BANKS_MAX
+#else
+#if (CONFIG_NR_DRAM_BANKS > CONFIG_NR_DRAM_BANKS_MAX)
+#error CONFIG_NR_DRAM_BANKS Configurated more than available
+#endif
+#endif /* CONFIG_NR_DRAM_BANKS */
+
+/*
  * Ethernet Driver configuration
  */
 #ifdef CONFIG_CMD_NET
 #define CONFIG_CMD_MII
 #define CONFIG_NETCONSOLE  /* include NetConsole support   */
 #define CONFIG_NET_MULTI   /* specify more that one ports available */
-#defineCONFIG_MII  /* expose s

[U-Boot] [PATCH v4 5/7] Serial: Add UART support for Marvell ARMADA 100 SoCs.

2010-12-07 Thread Prafulla Wadaskar
ARMADA 100 SoCs has NS16550 compatible UART peripheral
This patch enables the same for ARMADA100 platforms

Signed-off-by: Mahavir Jain 
Signed-off-by: Prafulla Wadaskar 
---
Change log for v2:
defined CONFIG_SYS_NS16550_IER macro in Soc heder file
Change log for v3:
Removed reordiring of header files, the diff is only
limited to include armada100.h

 drivers/serial/serial.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c
index 1073ac0..cd3439e 100644
--- a/drivers/serial/serial.c
+++ b/drivers/serial/serial.c
@@ -29,9 +29,10 @@
 #endif
 #ifdef CONFIG_KIRKWOOD
 #include 
-#endif
-#ifdef CONFIG_ORION5X
+#elif defined(CONFIG_ORION5X)
 #include 
+#elif defined(CONFIG_ARMADA100)
+#include 
 #endif
 
 #if defined (CONFIG_SERIAL_MULTI)
-- 
1.5.3.4

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


[U-Boot] [PATCH v4 2/7] gpio: Add Multi-Function-Pin configuration driver for Marvell SoCs

2010-12-07 Thread Prafulla Wadaskar
Most of the Marvell SoCs has Multi Function Pin (MFP) configuration registers
For ex. ARMADA100.

These registers are programmed to expose the specific functionality
associated with respective SoC Pins

This driver provides configuration APIs,
using them, configuration need to be done in board specific code

for ex- following code configures MFPs 107 and 108 for UART_TX/RX functionality

int board_early_init_f(void)
{
u32 mfp_cfg[] = {
/* Console on UART1 */
MFP107_UART1_RXD,
MFP108_UART1_TXD,
MFP_EOC /*End of configureation*/
};
/* configure MFP's */
mfp_config(mfp_cfg);
return 0;
}

Signed-off-by: Prafulla Wadaskar 
---
Changelog v4:
1. Driver renamed as mvmfp
2. Re-architected mvmfp driver as per review feedback

 drivers/gpio/Makefile |1 +
 drivers/gpio/mvmfp.c  |   90 
 include/mvmfp.h   |  100 +
 3 files changed, 191 insertions(+), 0 deletions(-)
 create mode 100644 drivers/gpio/mvmfp.c
 create mode 100644 include/mvmfp.h

diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 398024c..a5fa2b5 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -27,6 +27,7 @@ LIB   := $(obj)libgpio.o
 
 COBJS-$(CONFIG_AT91_GPIO)  += at91_gpio.o
 COBJS-$(CONFIG_KIRKWOOD_GPIO)  += kw_gpio.o
+COBJS-$(CONFIG_MARVELL_MFP)+= mvmfp.o
 COBJS-$(CONFIG_MXC_GPIO)   += mxc_gpio.o
 COBJS-$(CONFIG_PCA953X)+= pca953x.o
 COBJS-$(CONFIG_S5P)+= s5p_gpio.o
diff --git a/drivers/gpio/mvmfp.c b/drivers/gpio/mvmfp.c
new file mode 100644
index 000..3472278
--- /dev/null
+++ b/drivers/gpio/mvmfp.c
@@ -0,0 +1,90 @@
+/*
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar ,
+ *
+ * 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 
+#include 
+#include 
+#include 
+#ifdef CONFIG_ARMADA100
+#include 
+#define MFPR_BASE  ARMD1_MFPR_BASE
+#else
+#error Unsupported SoC...
+#endif
+
+/*
+ * mfp_config
+ *
+ * On most of Marvell SoCs (ex. ARMADA100) there is Multi-Funtion-Pin
+ * configuration registers to configure each GPIO/Function pin on the
+ * SoC.
+ *
+ * This function reads the array of values for
+ * MFPR_X registers and programms them into respective
+ * Multi-Function Pin registers.
+ * It supports - Alternate Function Selection programming.
+ *
+ * Whereas,
+ * The Configureation value is constructed using MFP()
+ * array consists of 32bit values as defined in MFP(xx,xx..) macro
+ */
+void mfp_config(u32 *mfp_cfgs)
+{
+   u32 *p_mfpr = NULL;
+   u32 cfg_val, val=0;
+
+   do {
+   cfg_val = *mfp_cfgs++;
+   /* exit if End of configuration table detected */
+   if (cfg_val == MFP_EOC)
+   break;
+
+   p_mfpr = (u32 *)(MFPR_BASE + MFP_REG_GET_OFFSET(cfg_val));
+
+   /* Write a mfg register as per configuration */
+   if (cfg_val & MFP_AF_FLAG) {
+   /* Abstract and program Afternate-Func Selection */
+   val &= ~MFP_AF_MASK;
+   val |= cfg_val & MFP_AF_MASK;
+   } if (cfg_val & MFP_EDGE_FLAG) {
+   /* Abstract and program Edge configuration */
+   val &= ~MFP_LPM_EDGE_MASK;
+   val |= cfg_val & MFP_LPM_EDGE_MASK;
+   } if (cfg_val & MFP_DRIVE_FLAG) {
+   /* Abstract and program Drive configuration */
+   val &= ~MFP_DRIVE_MASK;
+   val |= cfg_val & MFP_DRIVE_MASK;
+   } if (cfg_val & MFP_PULL_FLAG) {
+   /* Abstract and program Pullup/down configuration */
+   val &= ~MFP_PULL_MASK;
+   val |= cfg_val & MFP_PULL_MASK;
+   }
+   writel(val, p_mfpr);
+   } while (1);
+   /*
+* perform a read-back of any MFPR register to make sure the
+* previous writings are finished
+*/
+   readl(p_mfpr);
+}
diff --git a/include/mvmfp.h b/include/mvmfp.h
ne

[U-Boot] [PATCH v4 4/7] Serial: ns16550: Add support for CONFIG_SYS_NS16550_IER macro

2010-12-07 Thread Prafulla Wadaskar
On some processors this ier register configuration is different
for ex. Marvell Armada100

This patch introduce CONFIG_SYS_NS16550_IER macro support to
unconditionally initialize this register.

Signed-off-by: Prafulla Wadaskar 
---
Changelog v3:
macro defination CONFIG_SYS_NS16550_IER moved from ns16550.h to ns16550.c

 drivers/serial/ns16550.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 32f24de..8eeb48f 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -24,9 +24,13 @@
 #define serial_in(y)   readb(y)
 #endif
 
+#ifndef CONFIG_SYS_NS16550_IER
+#define CONFIG_SYS_NS16550_IER  0x00
+#endif /* CONFIG_SYS_NS16550_IER */
+
 void NS16550_init (NS16550_t com_port, int baud_divisor)
 {
-   serial_out(0x00, &com_port->ier);
+   serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
 #if defined(CONFIG_OMAP) && !defined(CONFIG_OMAP3_ZOOM2)
serial_out(0x7, &com_port->mdr1);   /* mode select reset TL16C750*/
 #endif
@@ -52,7 +56,7 @@ void NS16550_init (NS16550_t com_port, int baud_divisor)
 #ifndef CONFIG_NS16550_MIN_FUNCTIONS
 void NS16550_reinit (NS16550_t com_port, int baud_divisor)
 {
-   serial_out(0x00, &com_port->ier);
+   serial_out(CONFIG_SYS_NS16550_IER, &com_port->ier);
serial_out(UART_LCR_BKSE | UART_LCRVAL, &com_port->lcr);
serial_out(0, &com_port->dll);
serial_out(0, &com_port->dlm);
-- 
1.5.3.4

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


[U-Boot] [PATCH v4 3/7] add Multi Function Pin configuration support for ARMADA100

2010-12-07 Thread Prafulla Wadaskar
This patch adds the support MFP support for Marvell ARMADA100 SoCs

Signed-off-by: Prafulla Wadaskar 
---
Changelog v4:
macros redefined as per new mvmfp driver architecture

 arch/arm/include/asm/arch-armada100/mfp.h |   67 +
 1 files changed, 67 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-armada100/mfp.h

diff --git a/arch/arm/include/asm/arch-armada100/mfp.h 
b/arch/arm/include/asm/arch-armada100/mfp.h
new file mode 100644
index 000..d21a79f
--- /dev/null
+++ b/arch/arm/include/asm/arch-armada100/mfp.h
@@ -0,0 +1,67 @@
+/*
+ * Based on linux/arch/arm/mach-mpp/include/mfp-pxa168.h
+ * (C) Copyright 2007
+ * Marvell Semiconductor 
+ * 2007-08-21: eric miao 
+ *
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar 
+ * Contributor: Mahavir Jain 
+ *
+ * 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
+ */
+
+#ifndef __ARMADA100_MFP_H
+#define __ARMADA100_MFP_H
+
+/*
+ * Frequently used MFP Configuration macros for all ARMADA100 family of SoCs
+ *
+ * offset, pull,pF, drv,dF, edge,eF ,afn,aF
+ */
+/* UART1 */
+#define MFP107_UART1_TXD   MFP_REG(0x01ac) | MFP_AF1 | MFP_DRIVE_FAST
+#define MFP107_UART1_RXD   MFP_REG(0x01ac) | MFP_AF2 | MFP_DRIVE_FAST
+#define MFP108_UART1_RXD   MFP_REG(0x01b0) | MFP_AF1 | MFP_DRIVE_FAST
+#define MFP108_UART1_TXD   MFP_REG(0x01b0) | MFP_AF2 | MFP_DRIVE_FAST
+#define MFP109_UART1_CTS   MFP_REG(0x01b4) | MFP_AF1 | MFP_DRIVE_MEDIUM
+#define MFP109_UART1_RTS   MFP_REG(0x01b4) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFP110_UART1_RTS   MFP_REG(0x01b8) | MFP_AF1 | MFP_DRIVE_MEDIUM
+#define MFP110_UART1_CTS   MFP_REG(0x01b8) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFP111_UART1_RIMFP_REG(0x01bc) | MFP_AF1 | 
MFP_DRIVE_MEDIUM
+#define MFP111_UART1_DSR   MFP_REG(0x01bc) | MFP_AF2 | MFP_DRIVE_MEDIUM
+#define MFP112_UART1_DTR   MFP_REG(0x01c0) | MFP_AF1 | MFP_DRIVE_MEDIUM
+#define MFP112_UART1_DCD   MFP_REG(0x01c0) | MFP_AF2 | MFP_DRIVE_MEDIUM
+
+/* UART2 */
+#define MFP47_UART2_RXDMFP_REG(0x0028) | MFP_AF6 | 
MFP_DRIVE_MEDIUM
+#define MFP48_UART2_TXDMFP_REG(0x002c) | MFP_AF6 | 
MFP_DRIVE_MEDIUM
+#define MFP88_UART2_RXDMFP_REG(0x0160) | MFP_AF2 | 
MFP_DRIVE_MEDIUM
+#define MFP89_UART2_TXDMFP_REG(0x0164) | MFP_AF2 | 
MFP_DRIVE_MEDIUM
+
+/* UART3 */
+#define MFPO8_UART3_RXDMFP_REG(0x06c) | MFP_AF2 | 
MFP_DRIVE_MEDIUM
+#define MFPO9_UART3_TXDMFP_REG(0x070) | MFP_AF2 | 
MFP_DRIVE_MEDIUM
+
+/* More macros can be defined here... */
+
+#define MFP_PIN_MAX117
+
+#endif /* __ARMADA100_MFP_H */
-- 
1.5.3.4

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


[U-Boot] [PATCH v4 1/7] arm: Add Support for Marvell ARMADA 100 Familiy SoCs

2010-12-07 Thread Prafulla Wadaskar
ARMADA 100 Family processors are highly integrated SoCs
based on Sheeva_88SV331x-v5 PJ1 cpu core.
Ref: http://www.marvell.com/products/processors/applications/armada_100

SoC versions Supported:
1) ARMADA168/88AP168(Aspen P)
2) ARMADA166/88AP166(Aspen M)
3) ARMADA162/88AP162(Aspen L)

Contributors:
Eric Miao 
Lei Wen 
Mahavir Jain 

Signed-off-by: Mahavir Jain 
Signed-off-by: Prafulla Wadaskar 
---
Change log V2:
1. C-struct used for dram.c
2. lib declaration changed from .a to .o
3. Implemented review feedback for v1

Changelog V3:
1. timer variables in gt_t used insted of locally defined global variables
2. register global pointer moved to respective functions
3. Macro READ_TIMER converted to function read_timer()
4. c-struc in armada100.h fixed for wrong padding

Changelog V4:
1. timer.c updated for build warning

 arch/arm/cpu/arm926ejs/armada100/Makefile   |   46 +
 arch/arm/cpu/arm926ejs/armada100/cpu.c  |   92 ++
 arch/arm/cpu/arm926ejs/armada100/dram.c |  131 ++
 arch/arm/cpu/arm926ejs/armada100/timer.c|  207 +++
 arch/arm/include/asm/arch-armada100/armada100.h |  121 +
 arch/arm/include/asm/arch-armada100/cpu.h   |   53 ++
 6 files changed, 650 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/dram.c
 create mode 100644 arch/arm/cpu/arm926ejs/armada100/timer.c
 create mode 100644 arch/arm/include/asm/arch-armada100/armada100.h
 create mode 100644 arch/arm/include/asm/arch-armada100/cpu.h

diff --git a/arch/arm/cpu/arm926ejs/armada100/Makefile 
b/arch/arm/cpu/arm926ejs/armada100/Makefile
new file mode 100644
index 000..76bd06d
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/armada100/Makefile
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2010
+# Marvell Semiconductor 
+# Written-by: Prafulla Wadaskar 
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1301 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(SOC).o
+
+COBJS-y= cpu.o timer.o dram.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS-y))
+
+all:   $(obj).depend $(LIB)
+
+$(LIB):$(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/arm926ejs/armada100/cpu.c 
b/arch/arm/cpu/arm926ejs/armada100/cpu.c
new file mode 100644
index 000..62aa175
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/armada100/cpu.c
@@ -0,0 +1,92 @@
+/*
+ * (C) Copyright 2010
+ * Marvell Semiconductor 
+ * Written-by: Prafulla Wadaskar 
+ * Contributor: Mahavir Jain 
+ *
+ * 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 
+#include 
+#include 
+
+#define UARTCLK14745KHZ(APBC_APBCLK | APBC_FNCLK | APBC_FNCLKSEL(1))
+#define SET_MRVL_ID(1<<8)
+#define L2C_RAM_SEL(1<<4)
+
+int arch_cpu_init(void)
+{
+   u32 val;
+   struct armd1cpu_registers *cpuregs =
+   (struct armd1cpu_registers *) ARMD1_CPU_BASE;
+
+   struct armd1apb1_registers *apb1clkres =
+   (struct armd1apb1_registers *) ARMD1_APBC1_BASE;
+
+   struct armd1mpmu_registers *mpmu =
+   (struct armd

[U-Boot] cache_flush() function

2010-12-07 Thread Sergey Mironov
Hi, community.
I'm porting u-boot on our arm1176-based SoC which uses greth as
ethernet controller. I have removed sparc code from greth.c and now
almost ready to send the patch. Last thing to fix is cache flusher
function which is required by the driver. Originally algorithm used
sparc_flush_cachces which is not suitable for the driver.

Is there any 'official' guidelines on using the caches? What
hardware-abstract function should I prefer?

Please CC answers to me since I am not in the list.

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


Re: [U-Boot] [PATCH] ARM: make timer variables in gt_t available for all ARM platforms

2010-12-07 Thread Prafulla Wadaskar


> -Original Message-
> From: Prafulla Wadaskar [mailto:prafu...@marvell.com]
> Sent: Wednesday, December 01, 2010 5:47 PM
> To: u-boot@lists.denx.de
> Cc: Manas Saksena; Prabhanjan Sarnaik; Ashish Karkare; Prafulla Wadaskar
> Subject: [PATCH] ARM: make timer variables in gt_t available for all ARM
> platforms
> 
> After ARM relocation,
> any code executed directly or indirectly by board_init_f() have
> global (BSS) variables need to be fixed. mostly timer.c needs to
> fix on most of the ARM platforms.
> 
> This patch makes timer related variables in gd_t available for
> all ARM implementation
> 
> Signed-off-by: Prafulla Wadaskar 
> ---
>  arch/arm/include/asm/global_data.h |4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/include/asm/global_data.h
> b/arch/arm/include/asm/global_data.h
> index ada3fbb..efb502e 100644
> --- a/arch/arm/include/asm/global_data.h
> +++ b/arch/arm/include/asm/global_data.h
> @@ -55,7 +55,9 @@ typedef struct  global_data {
>   unsigned long   plla_rate_hz;
>   unsigned long   pllb_rate_hz;
>   unsigned long   at91_pllb_usb_init;
> - /* "static data" needed by at91's timer.c */
> +#endif
> +#ifdef CONFIG_ARM
> + /* "static data" needed by most of timer.c on ARM platforms */
>   unsigned long   timer_rate_hz;
>   unsigned long   tbl;
>   unsigned long   tbu;
> --

Applied to u-boot-marvell.git master branch

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


Re: [U-Boot] Multiple chip support in ndfc driver

2010-12-07 Thread Felix Radensky
Hi Stefan,

Thanks for a prompt reply.

Stefan Roese wrote:
> Hi Felix,
>
> On Sunday 05 December 2010 15:27:02 Felix Radensky wrote:
>   
>> On a custom 460EX board I have a 2Gbyte NAND device, 1Gbyte per chip
>> select. I'm trying to enable support for the second NAND CS, so far
>> without success.
>>
>> U-Boot properly detects both devices, (manufacturer, size, bus width).
>> First device
>> works as expected, on second device bad blocks are reported correctly,
>> but attempt
>> to erase the device results in I/O errors on every block. The bank
>> settings are identical
>> for both chips.
>>
>> What am I missing ?
>> 
>
> Perhaps a misconfiguration in your board config header? How did you configure 
> the NAND driver? Take a look at DU440.h or bamboo.h for example. Those boards 
> use multiple NAND devices.
>  
>   
Thanks for the hint. I've looked at these boards, and I cannot see 
what's wrong with my configuration.
Since second chip is properly detected, I think configuration is 
correct. Read also works, only erase
and program fail. Looks like a hardware problem to me.
>> BTW, I was wandering why NAND TLB window size on Canyonlands is 16Mbytes.
>> 
>
> Yes. This TLB could be smaller. 1KiB should be enough. Patch welcome. ;)
>
>   
OK, I'll send the patch.

Felix.


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


[U-Boot] [PATCH] Fix "autostart" env variable handling

2010-12-07 Thread Stefan Roese
Patch 5a442c0a [boot cmds: convert to getenv_yesno() with autostart]
changes the boot commands code to use the getenv_yesno() helper
function. But this function returns true (1) when "autostart" is not
defined at all.

This patch changes the logic of getenv_yesno() to only return true when
"autostart" is defined and the first char is set to "y". This restores
the old behavior on boards where "autostart" is not defined at all.

Signed-off-by: Stefan Roese 
Cc: Mike Frysinger 
---
 common/image.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/image.c b/common/image.c
index f63a2ff..aa95882 100644
--- a/common/image.c
+++ b/common/image.c
@@ -412,7 +412,7 @@ static const image_header_t *image_get_ramdisk (ulong 
rd_addr, uint8_t arch,
 int getenv_yesno (char *var)
 {
char *s = getenv (var);
-   return (s && (*s == 'n')) ? 0 : 1;
+   return (s && (*s == 'y')) ? 1 : 0;
 }
 
 ulong getenv_bootm_low(void)
-- 
1.7.3.3

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


Re: [U-Boot] [PATCH] ppc: transform init_sequence into a function.

2010-12-07 Thread Joakim Tjernlund
Wolfgang Denk  wrote on 2010/12/07 07:34:49:
>
> Dear Joakim Tjernlund,
>
> In message 
>  you 
> wrote:
> >
> > > > though the loop is cumbersome and not easy as BDI tends to
> > > > flush the cache when it stops so you loose your stack.
> > >
> > > Does it? On which architecture / processor is this?
> >
> > MPC8321 and BDI2000. I have to play games with some internal
> > BDI command called SAP. Maybe they have fixed this in later models?
>
> Are you using the latest firmware, i. . 1.31 from October 2009?

No, got an earlier one, 1.24

>
> > > ...but ugly to read.  And if you really want to introduce this style,
> > > it has to be done for all architectures, as I want to see this code to
> > > become common across architectures.
> >
> > That is the next issue, lets not stray from the path ..
>
> Right, that's the next issue, lets not stray from the path and put
> additional road blocks into our way when we already know where we are
> heading to.

hmm, not sure how to read this. Irony? I was not trying to dodge
the subject, just wanted to keep the discussion focused. Of course
this can be adapted on all archs.

>
> > > I haven't, lately, that's true, or when I had, I always knew pretty
> > > well where I had to expect the issues.  But I've been there before,
> > > many, many times.
> >
> > And you never found it annoying when you hit these function ptrs?
>
> Actually, no.
>
> In an earlier life I've been programming in Forth for some time, so I
> find a list of addresses to process quite natural and efficient.
>
> > Now you are proposing that I instrument the code, much like Scott and his
> > print of address idea. This is exactly what I want to avoid as it would
> > probably have to be adapted from case to case and there is always the
> > case when there is no output and then I am back to square zero again.
>
> Don't you use oneliners in the shell that you just make up as needed
> and then throw away, and reinvent when you need them again?
>
> Same here. Adding a printf() or similar to some code under test is
> something I do several times a day. Even when running under a
> debugger, and even when I'm not executing a list of function pointers.
> I see no issue with adding this on a case-by-case base, had-tailored
> to the specific problem I'm tracking down.

Yes, this is a useful technique but it costs time. You don't
add these printout unless you need them, right? This is my
point. If you move to pure function calls you don't have to add
them just to identify what function crashes or lookup addresses etc.
Just move a BPs around without recompiling and reloading the code.

>
> > The argument that it is uglier alone is not a very good one.
> > Image the roles were reversed, I am sure you would dismiss me as
> > "less beautiful" is really not an argument alone.
>
> Ugliness was only one of several arguments, and there were several
> votes againt yours.

There was votes against with false claims that is is just as easy
to debug function ptrs.
And there was Scott which one day hope to have "real section-list initfuncs"
Bottom line argument is that the new code is uglier and that trumps
any of my arguments.

>
> Please consider the case closed.  I already marked the patch as NAKed.

I see, thanks for your time.

 Jocke

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