[U-Boot] [PATCH v5] mmc: add generic mmc spi driver

2010-04-28 Thread Thomas Chou
This patch supports mmc/sd card with spi interface. It is based on
the generic mmc framework. It works with SDHC and supports write.

The crc7 lib func is merged from linux and used to compute mmc
command checksum.

There is a subcomamnd mmc_spi to setup spi bus and cs at run time.

Signed-off-by: Thomas Chou tho...@wytron.com.tw
---
v5: remove dev_num limit to search.
v4: change mmc_spi subcommand to search and create new mmc dev.
v3: add mmc_spi_init() proto to mmc_spi.h.
v2: add crc7, use cmd58 to read ocr, add subcommand mmc_spi.

 common/Makefile   |1 +
 common/cmd_mmc_spi.c  |  114 ++
 drivers/mmc/Makefile  |1 +
 drivers/mmc/mmc_spi.c |  318 +
 include/linux/crc7.h  |   14 ++
 include/mmc_spi.h |   27 
 lib/Makefile  |1 +
 lib/crc7.c|   62 ++
 8 files changed, 538 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_mmc_spi.c
 create mode 100644 drivers/mmc/mmc_spi.c
 create mode 100644 include/linux/crc7.h
 create mode 100644 include/mmc_spi.h
 create mode 100644 lib/crc7.c

diff --git a/common/Makefile b/common/Makefile
index dbf7a05..ee23e2f 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -118,6 +118,7 @@ COBJS-$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_CMD_MMC_SPI) += cmd_mmc_spi.o
 COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_MTDPARTS) += cmd_mtdparts.o
 COBJS-$(CONFIG_CMD_NAND) += cmd_nand.o
diff --git a/common/cmd_mmc_spi.c b/common/cmd_mmc_spi.c
new file mode 100644
index 000..0cbb449
--- /dev/null
+++ b/common/cmd_mmc_spi.c
@@ -0,0 +1,114 @@
+/*
+ * Command for mmc_spi setup.
+ *
+ * Copyright (C) 2010 Thomas Chou tho...@wytron.com.tw
+ * Licensed under the GPL-2 or later.
+ */
+
+#include common.h
+#include malloc.h
+#include mmc.h
+#include spi.h
+#include mmc_spi.h
+
+#ifndef CONFIG_MMC_SPI_BUS
+# define CONFIG_MMC_SPI_BUS 0
+#endif
+#ifndef CONFIG_MMC_SPI_CS
+# define CONFIG_MMC_SPI_CS 1
+#endif
+#ifndef CONFIG_MMC_SPI_SPEED
+# define CONFIG_MMC_SPI_SPEED 3000
+#endif
+#ifndef CONFIG_MMC_SPI_MODE
+# define CONFIG_MMC_SPI_MODE SPI_MODE_3
+#endif
+
+static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
+{
+   int dev_num = -1;
+   uint bus;
+   uint cs;
+   uint speed;
+   uint mode;
+   char *endp;
+   struct mmc *mmc;
+   struct mmc_spi_priv *priv;
+
+   do {
+   mmc = find_mmc_device(++dev_num);
+   } while (mmc  strcmp(mmc-name, MMC_SPI));
+   if (!mmc) {
+   printf(Create MMC Device\n);
+   mmc = mmc_spi_init(CONFIG_MMC_SPI_BUS,
+  CONFIG_MMC_SPI_CS,
+  CONFIG_MMC_SPI_SPEED,
+  CONFIG_MMC_SPI_MODE);
+   if (!mmc) {
+   printf(Failed to create MMC Device\n);
+   return 1;
+   }
+   dev_num = mmc-block_dev.dev;
+   }
+
+   priv = mmc-priv;
+   bus = priv-bus;
+   cs = priv-cs;
+   speed = priv-speed;
+   mode = priv-mode;
+
+   if (argc  2)
+   goto info;
+   cs = simple_strtoul(argv[1], endp, 0);
+   if (*argv[1] == 0 || (*endp != 0  *endp != ':'))
+   goto usage;
+   if (*endp == ':') {
+   if (endp[1] == 0)
+   goto usage;
+   bus = cs;
+   cs = simple_strtoul(endp + 1, endp, 0);
+   if (*endp != 0)
+   goto usage;
+   }
+   if (argc = 3) {
+   speed = simple_strtoul(argv[2], endp, 0);
+   if (*argv[2] == 0 || *endp != 0)
+   goto usage;
+   }
+   if (argc = 4) {
+   mode = simple_strtoul(argv[3], endp, 16);
+   if (*argv[3] == 0 || *endp != 0)
+   goto usage;
+   }
+   if (!spi_cs_is_valid(bus, cs)) {
+   printf(Invalid SPI bus %u cs %u\n, bus, cs);
+   return 1;
+   }
+
+   if (bus != priv-bus || cs != priv-cs ||
+   speed != priv-speed || mode != priv-mode) {
+   priv-bus = bus;
+   priv-cs = cs;
+   priv-speed = speed;
+   priv-mode = mode;
+   if (priv-slave) {
+   spi_free_slave(priv-slave);
+   priv-slave = NULL;
+   }
+   }
+info:
+   printf(%s: %d at %u:%u %u %u\n, mmc-name, dev_num,
+  bus, cs, speed, mode);
+   return 0;
+
+usage:
+   cmd_usage(cmdtp);
+   return 1;
+}
+
+U_BOOT_CMD(
+   mmc_spi,4,  0,  do_mmc_spi,
+   mmc_spi setup,
+   [bus:][cs] [hz] [mode] - setup mmc_spi device on given\n
+ SPI bus and chip select\n
+);
diff --git 

Re: [U-Boot] [PATCH 2/3] video: add support for display controller in MB86R0x SoCs

2010-04-28 Thread Matthias Weißer
Am 22.04.2010 14:41, schrieb Wolfgang Denk:
 Dear Matthias Weisser,

 In message1271932257-14618-3-git-send-email-weiss...@arcor.de  you wrote:
 This patch adds support for the display controller in
 the MB86R0x SoCs.

 Signed-off-by: Matthias Weisserweiss...@arcor.de
 ...
 +pGD-memSize = VIDEO_MEM_SIZE;
 +pGD-frameAdrs = PHYS_SDRAM + PHYS_SDRAM_SIZE - VIDEO_MEM_SIZE;

 Please pay attention to the global memory map requirements. PRAM might
 go first.

Can you please explain this a bit more in detail? I checked the source 
and README for CONFIG_PRAM and it seems to be reserving some space at 
the end of RAM. But I have only found reference to it in ppc and m68k code.

What would be the correct way to reserve some 2MB-4MB at the end of 
system RAM as a framebuffer for the integrated graphics device?

Thanks in advance

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


Re: [U-Boot] [PATCH 2/3] video: add support for display controller in MB86R0x SoCs

2010-04-28 Thread Wolfgang Denk
Dear Matthias,

in message 4bd7d5dd.6080...@arcor.de you wrote:

  +  pGD-memSize = VIDEO_MEM_SIZE;
  +  pGD-frameAdrs = PHYS_SDRAM + PHYS_SDRAM_SIZE - VIDEO_MEM_SIZE;
 
  Please pay attention to the global memory map requirements. PRAM might
  go first.
 
 Can you please explain this a bit more in detail? I checked the source 
 and README for CONFIG_PRAM and it seems to be reserving some space at 
 the end of RAM. But I have only found reference to it in ppc and m68k code.

Right. But there is a chance that the ARM implementation might be
reworked soon, and then it will follow the documented approach as
well, so better start correctly from the beginning so you don;t run
into conflicts soon.

 What would be the correct way to reserve some 2MB-4MB at the end of 
 system RAM as a framebuffer for the integrated graphics device?

See the PPC implementation for reference.

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
Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160)
O, throw away the worser part of it,
And live the purer with the other half.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Uboot application problem

2010-04-28 Thread Wolfgang Denk
Dear robin,

please keep the mailing list on Cc:

Also, please do not top post / full quote - make sure to read
http://www.netmeister.org/news/learn2quote.html


In message 1272433162.2567.4.ca...@ubuntu-desktop you wrote:
 
 I am making use of u-boot 1.3.3
 and i am using the omap3530 based board (Beagleboard).

U-Boot 1.3.3 is very old. A _lot_ has been changed since. Please
update and use recent code instead.

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
Teenagers are people who express a burning desire to be different by
dressing exactly alike.
There are some strings. They're just not attached.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v3] Fixup native builds on powerpc

2010-04-28 Thread Kumar Gala
When we changed ARCH from ppc to powerpc we need to treat HOSTARCH the
same way.  We use HOSTARCH == ARCH to determine if a build is native.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Put the ppc64 case first otherwise we get powerpc64

 Makefile |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 25e3b8c..f2b1ed9 100644
--- a/Makefile
+++ b/Makefile
@@ -38,9 +38,9 @@ HOSTARCH := $(shell uname -m | \
-e s/sun4u/sparc64/ \
-e s/arm.*/arm/ \
-e s/sa110/arm/ \
-   -e s/powerpc/ppc/ \
-   -e s/ppc64/ppc/ \
-   -e s/macppc/ppc/)
+   -e s/ppc64/powerpc/ \
+   -e s/ppc/powerpc/ \
+   -e s/macppc/powerpc/)
 
 HOSTOS := $(shell uname -s | tr '[:upper:]' '[:lower:]' | \
sed -e 's/\(cygwin\).*/cygwin/')
-- 
1.6.0.6

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


[U-Boot] [PATCH] Save environment data to mmc.

2010-04-28 Thread Terry Lv
This patch is to save environment data to mmc card.
It uses interfaces defined in generic mmc.

Signed-off-by: Terry Lv r65...@freescale.com
---
 arch/arm/lib/board.c |   10 ++--
 arch/powerpc/lib/board.c |   12 ++--
 common/Makefile  |1 +
 common/cmd_nvedit.c  |1 +
 common/env_mmc.c |  160 ++
 5 files changed, 173 insertions(+), 11 deletions(-)
 create mode 100644 common/env_mmc.c

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index f5660a9..f62e0eb 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -347,6 +347,11 @@ void start_armboot (void)
dataflash_print_info();
 #endif
 
+#ifdef CONFIG_GENERIC_MMC
+   puts (MMC:   );
+   mmc_initialize (gd-bd);
+#endif
+
/* initialize environment */
env_relocate ();
 
@@ -419,11 +424,6 @@ extern void davinci_eth_set_mac_addr (const u_int8_t 
*addr);
board_late_init ();
 #endif
 
-#ifdef CONFIG_GENERIC_MMC
-   puts (MMC:   );
-   mmc_initialize (gd-bd);
-#endif
-
 #ifdef CONFIG_BITBANGMII
bb_miiphy_init();
 #endif
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 7b09fb5..1008635 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -783,6 +783,12 @@ void board_init_r (gd_t *id, ulong dest_addr)
nand_init();/* go init the NAND */
 #endif
 
+#ifdef CONFIG_GENERIC_MMC
+   WATCHDOG_RESET ();
+   puts (MMC:  );
+   mmc_initialize (bd);
+#endif
+
/* relocate environment function pointers etc. */
env_relocate ();
 
@@ -939,12 +945,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
scsi_init ();
 #endif
 
-#ifdef CONFIG_GENERIC_MMC
-   WATCHDOG_RESET ();
-   puts (MMC:  );
-   mmc_initialize (bd);
-#endif
-
 #if defined(CONFIG_CMD_DOC)
WATCHDOG_RESET ();
puts (DOC:   );
diff --git a/common/Makefile b/common/Makefile
index dbf7a05..2c37073 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -58,6 +58,7 @@ COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
 COBJS-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
 COBJS-$(CONFIG_ENV_IS_IN_MG_DISK) += env_mgdisk.o
+COBJS-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
 COBJS-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
 COBJS-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
 COBJS-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index eb89e9e..78f75fb 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -59,6 +59,7 @@ DECLARE_GLOBAL_DATA_PTR;
 !defined(CONFIG_ENV_IS_IN_FLASH)\
 !defined(CONFIG_ENV_IS_IN_DATAFLASH)\
 !defined(CONFIG_ENV_IS_IN_MG_DISK)  \
+!defined(CONFIG_ENV_IS_IN_MMC)   \
 !defined(CONFIG_ENV_IS_IN_NAND) \
 !defined(CONFIG_ENV_IS_IN_NVRAM)\
 !defined(CONFIG_ENV_IS_IN_ONENAND)  \
diff --git a/common/env_mmc.c b/common/env_mmc.c
new file mode 100644
index 000..202370e
--- /dev/null
+++ b/common/env_mmc.c
@@ -0,0 +1,160 @@
+/*
+ * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+
+ * (C) Copyright 2000-2006
+ * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+ *
+ * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH www.elinos.com
+ * Andreas Heppel ahep...@sysgo.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
+ */
+
+/* #define DEBUG */
+
+#include common.h
+
+#include command.h
+#include environment.h
+#include linux/stddef.h
+#include malloc.h
+#include mmc.h
+
+/* references to names in env_common.c */
+extern uchar default_environment[];
+
+char *env_name_spec = MMC;
+
+#ifdef ENV_IS_EMBEDDED
+extern uchar environment[];
+env_t *env_ptr = (env_t *)(environment[0]);
+#else /* ! ENV_IS_EMBEDDED */
+env_t *env_ptr;
+#endif /* ENV_IS_EMBEDDED */
+
+/* local functions */
+#if !defined(ENV_IS_EMBEDDED)
+static void use_default(void);
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define BLOCK_ALIGN(x) ((x  (0x200 - 1)) \
+? ((x  9) + 1) : (x  9))
+
+uchar env_get_char_spec(int index)
+{
+   return *((uchar *)(gd-env_addr + index));
+}
+
+int env_init(void)
+{
+   /* use default */
+   gd-env_addr = 

Re: [U-Boot] [PATCH 2/4] 85xx: Add is_serdes_configured() support to MPC8536 SERDES

2010-04-28 Thread Kumar Gala

On Apr 20, 2010, at 10:39 AM, Kumar Gala wrote:

 Add the ability to determine if a given IP block connected on SERDES is
 configured.  This is useful for things like PCIe and SRIO since they are
 only ever connected on SERDES.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 arch/ppc/cpu/mpc85xx/mpc8536_serdes.c |   79 ++--
 arch/ppc/include/asm/fsl_serdes.h |   53 +-
 2 files changed, 114 insertions(+), 18 deletions(-)

applied to 85xx

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


Re: [U-Boot] [PATCH] ubifsmount fails due to not initialized list

2010-04-28 Thread Stefan Roese
On Wednesday 21 April 2010 09:47:19 Stefano Babic wrote:
 ubifsmount is not working and causes an access with
 a pointer set to zero because the ubifs_fs_type
 is not initialized correctly.

Applied to u-boot-ubi/master. Thanks.
 
Cheers,
Stefan

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


Re: [U-Boot] [PATCH v1 1/3] fsl-diu: Using I/O accessor to CCSR space

2010-04-28 Thread Kumar Gala

On Apr 8, 2010, at 2:56 AM, Dave Liu wrote:

 From: Jerry Huang chang-ming.hu...@freescale.com
 
 Using PPC I/O accessor to DIU I/O space instead of directly
 read/write. It will prevent the dozen of compiler order issue
 and PPC hardware order issue for accessing I/O space.
 
 Using the toolchain(tc-fsl-x86lnx-e500-dp-4.3.74-2.i386.rpm)
 can show up the order issue of DIU driver.
 
 Signed-off-by: Dave Liu dave...@freescale.com
 Signed-off-by: Jerry Huang chang-ming.hu...@freescale.com
 ---
 * address Timur's comments
 
 board/freescale/common/fsl_diu_fb.c |   55 ++-
 1 files changed, 28 insertions(+), 27 deletions(-)

applied to mpc85xx

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


[U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use is_serdes_configured() to determine of PCIe enabled

2010-04-28 Thread Kumar Gala
The new is_serdes_configured covers a broader range of devices than the
PCI specific code.  Use it instead as we convert away from the
is_fsl_pci_cfg() code.

Additionally move to setting LAWs for PCI based on if its configured.
Also updated PCI FDT fixup code to remove PCI controllers from dtb if
they are configured.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Added code to handle dynamic LAW setup for PCI
* Added removing of PCI controller nodes from dtb if not cfg

 arch/powerpc/cpu/mpc8xxx/pci_cfg.c|   12 
 board/freescale/mpc8536ds/law.c   |8 
 board/freescale/mpc8536ds/mpc8536ds.c |   33 +
 3 files changed, 29 insertions(+), 24 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/pci_cfg.c 
b/arch/powerpc/cpu/mpc8xxx/pci_cfg.c
index 85995ca..186936f 100644
--- a/arch/powerpc/cpu/mpc8xxx/pci_cfg.c
+++ b/arch/powerpc/cpu/mpc8xxx/pci_cfg.c
@@ -56,18 +56,6 @@ static struct pci_info pci_config_info[] =
 #elif defined(CONFIG_MPC8536)
 static struct pci_info pci_config_info[] =
 {
-   [LAW_TRGT_IF_PCI] = {
-   .cfg =   0,
-   },
-   [LAW_TRGT_IF_PCIE_1] = {
-   .cfg =   (1  2) | (1  3) | (1  5) | (1  7),
-   },
-   [LAW_TRGT_IF_PCIE_2] = {
-   .cfg =   (1  5) | (1  7),
-   },
-   [LAW_TRGT_IF_PCIE_3] = {
-   .cfg =   (1  7),
-   },
 };
 #elif defined(CONFIG_MPC8544)
 static struct pci_info pci_config_info[] =
diff --git a/board/freescale/mpc8536ds/law.c b/board/freescale/mpc8536ds/law.c
index 1f11563..61b7454 100644
--- a/board/freescale/mpc8536ds/law.c
+++ b/board/freescale/mpc8536ds/law.c
@@ -28,15 +28,7 @@
 #include asm/mmu.h
 
 struct law_entry law_table[] = {
-   SET_LAW(CONFIG_SYS_PCI1_MEM_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_PCI),
-   SET_LAW(CONFIG_SYS_PCI1_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCI),
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
-   SET_LAW(CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_128M, LAW_TRGT_IF_PCIE_1),
-   SET_LAW(CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_1),
-   SET_LAW(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_128M, LAW_TRGT_IF_PCIE_2),
-   SET_LAW(CONFIG_SYS_PCIE2_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_2),
-   SET_LAW(CONFIG_SYS_PCIE3_MEM_PHYS, LAW_SIZE_512M, LAW_TRGT_IF_PCIE_3),
-   SET_LAW(CONFIG_SYS_PCIE3_IO_PHYS, LAW_SIZE_64K, LAW_TRGT_IF_PCIE_3),
SET_LAW(PIXIS_BASE_PHYS, LAW_SIZE_4K, LAW_TRGT_IF_LBC),
SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
 };
diff --git a/board/freescale/mpc8536ds/mpc8536ds.c 
b/board/freescale/mpc8536ds/mpc8536ds.c
index 253ed18..8daa0c3 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2008-2009 Freescale Semiconductor, Inc.
+ * Copyright 2008-2010 Freescale Semiconductor, Inc.
  *
  * See file CREDITS for list of people who contributed to this
  * project.
@@ -30,6 +30,7 @@
 #include asm/fsl_pci.h
 #include asm/fsl_ddr_sdram.h
 #include asm/io.h
+#include asm/fsl_serdes.h
 #include spd.h
 #include miiphy.h
 #include libfdt.h
@@ -219,9 +220,13 @@ void pci_init_board(void)
 
puts(\n);
 #ifdef CONFIG_PCIE3
-   pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_3, io_sel);
+   pcie_configured = is_serdes_configured(PCIE3);
 
if (pcie_configured  !(devdisr  MPC85xx_DEVDISR_PCIE3)){
+   set_next_law(CONFIG_SYS_PCIE3_MEM_PHYS, LAW_SIZE_512M,
+   LAW_TRGT_IF_PCIE_3);
+   set_next_law(CONFIG_SYS_PCIE3_IO_PHYS, LAW_SIZE_64K,
+   LAW_TRGT_IF_PCIE_3);
SET_STD_PCIE_INFO(pci_info[num], 3);
pcie_ep = fsl_setup_hose(pcie3_hose, pci_info[num].regs);
printf (PCIE3 connected to Slot3 as %s (base address 
%lx)\n,
@@ -239,9 +244,13 @@ void pci_init_board(void)
 #endif
 
 #ifdef CONFIG_PCIE1
-   pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_1, io_sel);
+   pcie_configured = is_serdes_configured(PCIE1);
 
if (pcie_configured  !(devdisr  MPC85xx_DEVDISR_PCIE)){
+   set_next_law(CONFIG_SYS_PCIE1_MEM_PHYS, LAW_SIZE_128M,
+   LAW_TRGT_IF_PCIE_1);
+   set_next_law(CONFIG_SYS_PCIE1_IO_PHYS, LAW_SIZE_64K,
+   LAW_TRGT_IF_PCIE_1);
SET_STD_PCIE_INFO(pci_info[num], 1);
pcie_ep = fsl_setup_hose(pcie1_hose, pci_info[num].regs);
printf (PCIE1 connected to Slot1 as %s (base address 
%lx)\n,
@@ -259,9 +268,13 @@ void pci_init_board(void)
 #endif
 
 #ifdef CONFIG_PCIE2
-   pcie_configured = is_fsl_pci_cfg(LAW_TRGT_IF_PCIE_2, io_sel);
+   pcie_configured = is_serdes_configured(PCIE2);
 
if (pcie_configured  !(devdisr  MPC85xx_DEVDISR_PCIE2)){
+   set_next_law(CONFIG_SYS_PCIE2_MEM_PHYS, LAW_SIZE_128M,
+

[U-Boot] [PATCH v2 2/2] 85xx/fsl-sata: Use is_serdes_configured() to determine if SATA is enabled

2010-04-28 Thread Kumar Gala
On the MPC85xx platform if we have SATA its connected on SERDES.
Determing if SATA is enabled via sata_initialize should not be board
specific and thus we move it out of the MPC8536DS board code.

Additionally, now that we have is_serdes_configured() we can determine
if the given SATA port is enabled and error out if its not in the
driver.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
 arch/powerpc/cpu/mpc85xx/cpu_init.c   |   14 +-
 board/freescale/mpc8536ds/mpc8536ds.c |   11 ---
 drivers/block/fsl_sata.c  |   14 +-
 3 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init.c
index e578b29..99431dc 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2009 Freescale Semiconductor, Inc.
+ * Copyright 2007-2010 Freescale Semiconductor, Inc.
  *
  * (C) Copyright 2003 Motorola Inc.
  * Modified by Xianghua Xiao, x.x...@motorola.com
@@ -30,9 +30,11 @@
 #include watchdog.h
 #include asm/processor.h
 #include ioports.h
+#include sata.h
 #include asm/io.h
 #include asm/mmu.h
 #include asm/fsl_law.h
+#include asm/fsl_serdes.h
 #include mp.h
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -418,3 +420,13 @@ void arch_preboot_os(void)
 
setup_ivors();
 }
+
+#if defined(CONFIG_CMD_SATA)  defined(CONFIG_FSL_SATA)
+int sata_initialize(void)
+{
+   if (is_serdes_configured(SATA1) || is_serdes_configured(SATA2))
+   return __sata_initialize();
+
+   return 1;
+}
+#endif
diff --git a/board/freescale/mpc8536ds/mpc8536ds.c 
b/board/freescale/mpc8536ds/mpc8536ds.c
index 8daa0c3..1968106 100644
--- a/board/freescale/mpc8536ds/mpc8536ds.c
+++ b/board/freescale/mpc8536ds/mpc8536ds.c
@@ -498,17 +498,6 @@ get_board_ddr_clk(ulong dummy)
 }
 #endif
 
-int sata_initialize(void)
-{
-   volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
-   uint sdrs2_io_sel =
-   (gur-pordevsr  MPC85xx_PORDEVSR_SRDS2_IO_SEL)  27;
-   if (sdrs2_io_sel  0x04)
-   return 1;
-
-   return __sata_initialize();
-}
-
 int board_eth_init(bd_t *bis)
 {
 #ifdef CONFIG_TSEC_ENET
diff --git a/drivers/block/fsl_sata.c b/drivers/block/fsl_sata.c
index 8878560..4b97a0e 100644
--- a/drivers/block/fsl_sata.c
+++ b/drivers/block/fsl_sata.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Freescale Semiconductor, Inc.
+ * Copyright (C) 2008,2010 Freescale Semiconductor, Inc.
  * Dave Liu dave...@freescale.com
  *
  * This program is free software; you can redistribute it and/or
@@ -22,6 +22,7 @@
 #include command.h
 #include asm/io.h
 #include asm/processor.h
+#include asm/fsl_serdes.h
 #include malloc.h
 #include libata.h
 #include fis.h
@@ -129,6 +130,17 @@ int init_sata(int dev)
return -1;
}
 
+#ifdef CONFIG_MPC85xx
+   if ((dev == 0)  (!is_serdes_configured(SATA1))) {
+   printf(SATA%d [dev = %d] is not enabled\n, dev+1, dev);
+   return -1;
+   }
+   if ((dev == 1)  (!is_serdes_configured(SATA2))) {
+   printf(SATA%d [dev = %d] is not enabled\n, dev+1, dev);
+   return -1;
+   }
+#endif
+
/* Allocate SATA device driver struct */
sata = (fsl_sata_t *)malloc(sizeof(fsl_sata_t));
if (!sata) {
-- 
1.6.0.6

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


[U-Boot] Please pull u-boot-ubi/master

2010-04-28 Thread Stefan Roese
The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:

  Merge branch 'master' of git://git.denx.de/u-boot-video (2010-04-28 00:10:41 
+0200)

are available in the git repository at:

  git://www.denx.de/git/u-boot-ubi.git master

Stefano Babic (1):
  ubifsmount fails due to not initialized list

 fs/ubifs/super.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] powerpc: Consolidate bootcount_{store|load} for PowerPC

2010-04-28 Thread Michael Zaidman
On Wed, Apr 28, 2010 at 10:14 AM, Stefan Roese s...@denx.de wrote:
 Hi Michael,

 On Tuesday 27 April 2010 17:56:27 Michael Zaidman wrote:
 It makes sense to keep some measure of flexibility by giving to the
 user possibility to override the CONFIG_SYS_BOOTCOUNT_ADDR definition.
 It can be easily achieved by adding the following lines:

 #ifdef CONFIG_SYS_BOOTCOUNT_ADDR
 #define _BOOTCOUNT_ADDR CONFIG_SYS_BOOTCOUNT_ADDR
 #else

  +#if defined(CONFIG_MPC5xxx)
  +#define CONFIG_BOOTCOUNT_ADDR  (MPC5XXX_CDM_BRDCRMB)
  +#define CONFIG_SYS_BOOTCOUNT_USE_32BIT

 Also CONFIG_ as stated in u-boot's README should specify selectable by
 user options. I suggest omitting of all the locally defined CONFIG_ in
 your code.

 I'll change CONFIG_BOOTCOUNT_ADDR to CONFIG_SYS_BOOTCOUNT_ADDR. And only
 overwrite/define this value, when not already defined.

 Ok, I did it a slightly different way for the post_word cleanup in
http://lists.denx.de/pipermail/u-boot/2010-April/070729.html


  +#endif /* defined(CONFIG_MPC5xxx) */
  +
  +#if defined(CONFIG_MPC821) || defined(CONFIG_MPC823) || \
  +    defined(CONFIG_MPC850) || defined(CONFIG_MPC852T) || \
  +    defined(CONFIG_MPC855) || \
  +    defined(CONFIG_MPC860) || defined(CONFIG_MPC866) || \
  +    defined(CONFIG_MPC885)

 This fragment does not cover all mpc8xx permutations.

 I did run MAKEALL 8xx and nothing broke. But you may be right. I'll check this
 again.

 We can cover
 them all by the following code:

 #if   defined(CONFIG_MPC821) || defined(CONFIG_MPC823) || \
       defined(CONFIG_MPC855) || defined(CONFIG_MPC855T)|| \
       defined(CONFIG_MPC850) || defined(CONFIG_MPC86x)

 Some 8xx variants are missing here as well (e.g. CONFIG_MPC852T,
 CONFIG_MPC885).

No, they have already been taken in account by CONFIG_MPC86x in common.h

 I just used the CONFIG_MPC86x which has been already constructed by
 common.h and accomplished the list by CPUs that for unknown to me reason
 are not mentioned in common.h Probably, the better way is to add them into
 the common.h...

 CONFIG_8xx seems the way to go. I just noticed it and will use it in the next
 patch version.

Agree.

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


Re: [U-Boot] [PATCH 2/3] video: add support for display controller in MB86R0x SoCs

2010-04-28 Thread Matthias Weißer
Am 28.04.2010 08:44, schrieb Wolfgang Denk:
 Dear Matthias,


 in message4bd7d5dd.6080...@arcor.de  you wrote:

 +  pGD-memSize = VIDEO_MEM_SIZE;
 +  pGD-frameAdrs = PHYS_SDRAM + PHYS_SDRAM_SIZE - VIDEO_MEM_SIZE;

 Please pay attention to the global memory map requirements. PRAM might
 go first.

 Can you please explain this a bit more in detail? I checked the source
 and README for CONFIG_PRAM and it seems to be reserving some space at
 the end of RAM. But I have only found reference to it in ppc and m68k code.

 Right. But there is a chance that the ARM implementation might be
 reworked soon, and then it will follow the documented approach as
 well, so better start correctly from the beginning so you don;t run
 into conflicts soon.

I totally agree with you, but...

 What would be the correct way to reserve some 2MB-4MB at the end of
 system RAM as a framebuffer for the integrated graphics device?

 See the PPC implementation for reference.

I had a look into the PPC code and its clear to me how it is done there. 
But I currently do not see how this can be done on ARM without a couple 
of changes to arch/arm/lib/board.c

Another question regarding the video driver:
I have seen some video drivers in driver/video/... and some are in 
arch/.../cpu/...

What would be the right place for mine? As it is integrated into the SoC 
I tend to put it in arch/arm/cpu/arm/arm926ejs/mb86r0x and not into 
drivers/video. On the other hand there is a imx31 related video driver 
in drivers/video.

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


[U-Boot] U-boot MIPS ROM Exception Handler Error

2010-04-28 Thread  Gurumurthy G M


Hi all,
   I am porting U-boot-2010.03 on MIPS32 Architecture ( au1350 processor). 
u-boot is compiled for little endian and downloaded the u-boot.bin file to NOR 
Flash.After reset followed by go command , I observe that cpu hangs at 
0xbfc00570 (ROM Exception Handler).

we are using BDI3000 debugger and bdiGDB for programming.

please let me know where is the problem? whether I am missing something.

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


Re: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use is_serdes_configured()to determine of PCIe enabled

2010-04-28 Thread Li Yang-R58472
Subject: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use 
is_serdes_configured()to determine of PCIe enabled

The new is_serdes_configured covers a broader range of devices than the
PCI specific code.  Use it instead as we convert away from the
is_fsl_pci_cfg() code.

Additionally move to setting LAWs for PCI based on if its configured.
Also updated PCI FDT fixup code to remove PCI controllers from dtb if
they are configured.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Added code to handle dynamic LAW setup for PCI
* Added removing of PCI controller nodes from dtb if not cfg

 arch/powerpc/cpu/mpc8xxx/pci_cfg.c|   12 
 board/freescale/mpc8536ds/law.c   |8 
 board/freescale/mpc8536ds/mpc8536ds.c |   33 
+

Wouldn't it be better to share the PCIE initialization code through all
the MPC85xx boards?  Like in the P2020 serdes patch series I proposed
last year.  What do you think?

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


Re: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use is_serdes_configured()to determine of PCIe enabled

2010-04-28 Thread Li Yang-R58472
 
Subject: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use 
is_serdes_configured()to determine of PCIe enabled

The new is_serdes_configured covers a broader range of 
devices than the 
PCI specific code.  Use it instead as we convert away from the
is_fsl_pci_cfg() code.

Additionally move to setting LAWs for PCI based on if its configured.
Also updated PCI FDT fixup code to remove PCI controllers from dtb if 
they are configured.

Signed-off-by: Kumar Gala ga...@kernel.crashing.org
---
* Added code to handle dynamic LAW setup for PCI
* Added removing of PCI controller nodes from dtb if not cfg

 arch/powerpc/cpu/mpc8xxx/pci_cfg.c|   12 
 board/freescale/mpc8536ds/law.c   |8 
 board/freescale/mpc8536ds/mpc8536ds.c |   33 
+

Wouldn't it be better to share the PCIE initialization code 
through all the MPC85xx boards?  Like in the P2020 serdes 
patch series I proposed last year.  What do you think?

The patch can be referenced at
http://www.mail-archive.com/u-boot@lists.denx.de/msg26339.html

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


[U-Boot] [PATCH v2] powerpc: Consolidate bootcount_{store|load} for PowerPC

2010-04-28 Thread Stefan Roese
This patch consolidates bootcount_{store|load} for PowerPC by
implementing a common version in arch/powerpc/lib/bootcount.c. This
code is now used by all PowerPC variants that currently have these
functions implemented.

The functions now use the proper IO-accessor functions to read/write the
values.

This code also supports two different bootcount versions:

a) Use 2 seperate words (2 * 32bit) to store the bootcounter
b) Use only 1 word (2 * 16bit) to store the bootcounter

Version b) was already used by MPC5xxx.

Signed-off-by: Stefan Roese s...@denx.de
Acked-by: Detlev Zundel d...@denx.de
Cc: Michael Zaidman michael.zaid...@gmail.com
Cc: Wolfgang Denk w...@denx.de
Cc: Kim Phillips kim.phill...@freescale.com
Cc: Anatolij Gustschin ag...@denx.de
---
v2:
- Replace CONFIG_SYS_BOOTCOUNT_USE_32BIT with CONFIG_SYS_BOOTCOUNT_SINGLEWORD
  as suggested by Detlev
- Use CONFIG_8xx for MPC8xx define section
- Replace CONFIG_BOOTCOUNT_ADDR with CONFIG_SYS_BOOTCOUNT_ADDR

 arch/powerpc/cpu/mpc5xxx/cpu.c  |   20 
 arch/powerpc/cpu/mpc8260/commproc.c |   24 -
 arch/powerpc/cpu/mpc83xx/cpu.c  |   30 
 arch/powerpc/cpu/mpc8xx/commproc.c  |   26 --
 arch/powerpc/cpu/ppc4xx/commproc.c  |   24 -
 arch/powerpc/lib/Makefile   |1 +
 arch/powerpc/lib/bootcount.c|   90 +++
 7 files changed, 91 insertions(+), 124 deletions(-)
 create mode 100644 arch/powerpc/lib/bootcount.c

diff --git a/arch/powerpc/cpu/mpc5xxx/cpu.c b/arch/powerpc/cpu/mpc5xxx/cpu.c
index b20234d..44b8a7a 100644
--- a/arch/powerpc/cpu/mpc5xxx/cpu.c
+++ b/arch/powerpc/cpu/mpc5xxx/cpu.c
@@ -154,26 +154,6 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 }
 #endif
 
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr = (volatile ulong *) (MPC5XXX_CDM_BRDCRMB);
-
-   *save_addr = (BOOTCOUNT_MAGIC  0x) | a;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr = (volatile ulong *) (MPC5XXX_CDM_BRDCRMB);
-
-   if ((*save_addr  0x) != (BOOTCOUNT_MAGIC  0x))
-   return 0;
-   else
-   return (*save_addr  0x);
-}
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
-
 #ifdef CONFIG_MPC5xxx_FEC
 /* Default initializations for FEC controllers.  To override,
  * create a board-specific function called:
diff --git a/arch/powerpc/cpu/mpc8260/commproc.c 
b/arch/powerpc/cpu/mpc8260/commproc.c
index 111a67c..c522bc5 100644
--- a/arch/powerpc/cpu/mpc8260/commproc.c
+++ b/arch/powerpc/cpu/mpc8260/commproc.c
@@ -195,27 +195,3 @@ ulong post_word_load (void)
 }
 
 #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)(CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR);
-
-   save_addr[0] = a;
-   save_addr[1] = BOOTCOUNT_MAGIC;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)(CONFIG_SYS_IMMR + CPM_BOOTCOUNT_ADDR);
-
-   if (save_addr[1] != BOOTCOUNT_MAGIC)
-   return 0;
-   else
-   return save_addr[0];
-}
-
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
diff --git a/arch/powerpc/cpu/mpc83xx/cpu.c b/arch/powerpc/cpu/mpc83xx/cpu.c
index 51180d6..fb32f01 100644
--- a/arch/powerpc/cpu/mpc83xx/cpu.c
+++ b/arch/powerpc/cpu/mpc83xx/cpu.c
@@ -302,33 +302,3 @@ int cpu_mmc_init(bd_t *bis)
return 0;
 #endif
 }
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-#if !defined(CONFIG_MPC8360)
-#error CONFIG_BOOTCOUNT_LIMIT only for MPC8360 implemented
-#endif
-
-#if !defined(CONFIG_BOOTCOUNT_ADDR)
-#define CONFIG_BOOTCOUNT_ADDR  (0x11 + QE_MURAM_SIZE - 2 * sizeof(unsigned 
long))
-#endif
-
-#include asm/io.h
-
-void bootcount_store (ulong a)
-{
-   void *reg = (void *)(CONFIG_SYS_IMMR + CONFIG_BOOTCOUNT_ADDR);
-   out_be32 (reg, a);
-   out_be32 (reg + 4, BOOTCOUNT_MAGIC);
-}
-
-ulong bootcount_load (void)
-{
-   void *reg = (void *)(CONFIG_SYS_IMMR + CONFIG_BOOTCOUNT_ADDR);
-
-   if (in_be32 (reg + 4) != BOOTCOUNT_MAGIC)
-   return 0;
-   else
-   return in_be32 (reg);
-}
-#endif /* CONFIG_BOOTCOUNT_LIMIT */
diff --git a/arch/powerpc/cpu/mpc8xx/commproc.c 
b/arch/powerpc/cpu/mpc8xx/commproc.c
index a87a0dc..2c85377 100644
--- a/arch/powerpc/cpu/mpc8xx/commproc.c
+++ b/arch/powerpc/cpu/mpc8xx/commproc.c
@@ -103,29 +103,3 @@ ulong post_word_load (void)
 }
 
 #endif /* CONFIG_POST || CONFIG_LOGBUFFER*/
-
-#ifdef CONFIG_BOOTCOUNT_LIMIT
-
-void bootcount_store (ulong a)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)( ((immap_t *) 
CONFIG_SYS_IMMR)-im_cpm.cp_dpmem +
-   CPM_BOOTCOUNT_ADDR );
-
-   save_addr[0] = a;
-   save_addr[1] = BOOTCOUNT_MAGIC;
-}
-
-ulong bootcount_load (void)
-{
-   volatile ulong *save_addr =
-   (volatile ulong *)( ((immap_t *) 

Re: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use is_serdes_configured()to determine of PCIe enabled

2010-04-28 Thread Kumar Gala

On Apr 28, 2010, at 3:25 AM, Li Yang-R58472 wrote:

 
 Subject: [U-Boot] [PATCH v2 1/2] 85xx/mpc8536ds: Use 
 is_serdes_configured()to determine of PCIe enabled
 
 The new is_serdes_configured covers a broader range of 
 devices than the 
 PCI specific code.  Use it instead as we convert away from the
 is_fsl_pci_cfg() code.
 
 Additionally move to setting LAWs for PCI based on if its configured.
 Also updated PCI FDT fixup code to remove PCI controllers from dtb if 
 they are configured.
 
 Signed-off-by: Kumar Gala ga...@kernel.crashing.org
 ---
 * Added code to handle dynamic LAW setup for PCI
 * Added removing of PCI controller nodes from dtb if not cfg
 
 arch/powerpc/cpu/mpc8xxx/pci_cfg.c|   12 
 board/freescale/mpc8536ds/law.c   |8 
 board/freescale/mpc8536ds/mpc8536ds.c |   33 
 +
 
 Wouldn't it be better to share the PCIE initialization code 
 through all the MPC85xx boards?  Like in the P2020 serdes 
 patch series I proposed last year.  What do you think?
 
 The patch can be referenced at
 http://www.mail-archive.com/u-boot@lists.denx.de/msg26339.html
 
 - Leo

Yeah, we can get there.  Just one step at a time.

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


[U-Boot] [PATCH 1/2] mtdparts: fix write through NULL pointer

2010-04-28 Thread Wolfgang Denk
The mtdparts add command wrote through a NULL pointer - on many
systems this went unnoticed (PowerPC has writable RAM there, some ARM
systems have ROM where a write has no effect), but on arm1136
(i.MX31) it crashed the system.

Add appropriate checks.

Signed-off-by: Wolfgang Denk w...@denx.de
---
 common/cmd_mtdparts.c |   19 ---
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 0b5f747..cec154c 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -837,14 +837,16 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
u32 offset;
int err = 1;
 
-   p = mtd_dev;
+   DEBUGF(===device_parse===\n);
+
+   assert(retdev);
*retdev = NULL;
-   *ret = NULL;
 
-   DEBUGF(===device_parse===\n);
+   if (ret)
+   *ret = NULL;
 
/* fetch mtd-id */
-   mtd_id = p;
+   mtd_id = p = mtd_dev;
if (!(p = strchr(mtd_id, ':'))) {
printf(no mtd-id identifier\n);
return 1;
@@ -913,12 +915,15 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
/* check for next device presence */
if (p) {
if (*p == ';') {
-   *ret = ++p;
+   if (ret)
+   *ret = ++p;
} else if (*p == '\0') {
-   *ret = p;
+   if (ret)
+   *ret = p;
} else {
printf(unexpected character '%c' at the end of 
device\n, *p);
-   *ret = NULL;
+   if (ret)
+   *ret = NULL;
return 1;
}
}
-- 
1.6.2.5

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


[U-Boot] [PATCH 2/2] mtdparts: get rid of custom DEBUG macro, use debug()

2010-04-28 Thread Wolfgang Denk
Signed-off-by: Wolfgang Denk w...@denx.de
---
 common/cmd_mtdparts.c |   90 ++---
 1 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index cec154c..116e637 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -103,16 +103,6 @@
 #include onenand_uboot.h
 #endif
 
-/* enable/disable debugging messages */
-#defineDEBUG_MTDPARTS
-#undef DEBUG_MTDPARTS
-
-#ifdef  DEBUG_MTDPARTS
-# define DEBUGF(fmt, args...)  printf(fmt ,##args)
-#else
-# define DEBUGF(fmt, args...)
-#endif
-
 /* special size referring to all the remaining space in a partition */
 #define SIZE_REMAINING 0x
 
@@ -243,7 +233,7 @@ static void index_partitions(void)
struct list_head *dentry;
struct mtd_device *dev;
 
-   DEBUGF(--- index partitions ---\n);
+   debug(--- index partitions ---\n);
 
if (current_mtd_dev) {
mtddevnum = 0;
@@ -261,12 +251,12 @@ static void index_partitions(void)
part = mtd_part_info(current_mtd_dev, current_mtd_partnum);
setenv(mtddevname, part-name);
 
-   DEBUGF(= mtddevnum %d,\n= mtddevname %s\n, mtddevnum, 
part-name);
+   debug(= mtddevnum %d,\n= mtddevname %s\n, mtddevnum, 
part-name);
} else {
setenv(mtddevnum, NULL);
setenv(mtddevname, NULL);
 
-   DEBUGF(= mtddevnum NULL\n= mtddevname NULL\n);
+   debug(= mtddevnum NULL\n= mtddevname NULL\n);
}
 }
 
@@ -277,7 +267,7 @@ static void current_save(void)
 {
char buf[16];
 
-   DEBUGF(--- current_save ---\n);
+   debug(--- current_save ---\n);
 
if (current_mtd_dev) {
sprintf(buf, %s%d,%d, MTD_DEV_TYPE(current_mtd_dev-id-type),
@@ -286,12 +276,12 @@ static void current_save(void)
setenv(partition, buf);
strncpy(last_partition, buf, 16);
 
-   DEBUGF(= partition %s\n, buf);
+   debug(= partition %s\n, buf);
} else {
setenv(partition, NULL);
last_partition[0] = '\0';
 
-   DEBUGF(= partition NULL\n);
+   debug(= partition NULL\n);
}
index_partitions();
 }
@@ -505,7 +495,7 @@ static int part_sort_add(struct mtd_device *dev, struct 
part_info *part)
part-dev = dev;
 
if (list_empty(dev-parts)) {
-   DEBUGF(part_sort_add: list empty\n);
+   debug(part_sort_add: list empty\n);
list_add(part-link, dev-parts);
dev-num_parts++;
index_partitions();
@@ -598,7 +588,7 @@ static int part_parse(const char *const partdef, const char 
**ret, struct part_i
/* fetch the partition size */
if (*p == '-') {
/* assign all remaining space to this partition */
-   DEBUGF('-': remaining size assigned\n);
+   debug('-': remaining size assigned\n);
size = SIZE_REMAINING;
p++;
} else {
@@ -683,7 +673,7 @@ static int part_parse(const char *const partdef, const char 
**ret, struct part_i
part-name[name_len - 1] = '\0';
INIT_LIST_HEAD(part-link);
 
-   DEBUGF(+ partition: name %-22s size 0x%08x offset 0x%08x mask flags 
%d\n,
+   debug(+ partition: name %-22s size 0x%08x offset 0x%08x mask flags 
%d\n,
part-name, part-size,
part-offset, part-mask_flags);
 
@@ -837,7 +827,7 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
u32 offset;
int err = 1;
 
-   DEBUGF(===device_parse===\n);
+   debug(===device_parse===\n);
 
assert(retdev);
*retdev = NULL;
@@ -860,11 +850,11 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
return 1;
}
 
-   DEBUGF(dev type = %d (%s), dev num = %d, mtd-id = %s\n,
+   debug(dev type = %d (%s), dev num = %d, mtd-id = %s\n,
id-type, MTD_DEV_TYPE(id-type),
id-num, id-mtd_id);
pend = strchr(p, ';');
-   DEBUGF(parsing partitions %.*s\n, (pend ? pend - p : strlen(p)), p);
+   debug(parsing partitions %.*s\n, (pend ? pend - p : strlen(p)), p);
 
 
/* parse partitions */
@@ -910,7 +900,7 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
return 1;
}
 
-   DEBUGF(\ntotal partitions: %d\n, num_parts);
+   debug(\ntotal partitions: %d\n, num_parts);
 
/* check for next device presence */
if (p) {
@@ -951,7 +941,7 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
 
*retdev = dev;
 
-   DEBUGF(===\n\n);
+   debug(===\n\n);
return 0;
 }
 
@@ -1003,13 +993,13 @@ static struct mtdids* 

[U-Boot] [PATCH] ppc4xx: Fix APC405 build breakage

2010-04-28 Thread Stefan Roese
This patch fixes APC405 build, by defining CONFIG_PPC4XX_I2C. This is
needed since the move of the PPC4xx I2C driver into the drivers/i2c
directory.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Matthias Fuchs matthias.fu...@esd.eu
---
 include/configs/APC405.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/configs/APC405.h b/include/configs/APC405.h
index 41eaaab..20849bc 100644
--- a/include/configs/APC405.h
+++ b/include/configs/APC405.h
@@ -304,6 +304,7 @@ extern int flash_banks;
  * I2C EEPROM (CAT24WC16) for environment
  */
 #define CONFIG_HARD_I2C/* I2c with hardware support */
+#define CONFIG_PPC4XX_I2C  /* use PPC4xx driver*/
 #define CONFIG_SYS_I2C_SPEED   10  /* I2C speed and slave address 
*/
 #define CONFIG_SYS_I2C_SLAVE   0x7F
 
-- 
1.7.1

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


[U-Boot] [PATCH 0/3] Support for TI's DA850/OMAP-L138 platform

2010-04-28 Thread Sudhakar Rajashekhara
This patch series adds support for TI's DA850/OMAP-L138
platform. This series is dependant on the following
patch which I have submitted earlier:

[U-Boot] [PATCH] da830: Move common code out of da830evm.c file

Sudhakar Rajashekhara (3):
  TI: DaVinci: Prepare for da850 support
  TI: DaVinci: Add board specific code for da850 EVM
  TI: DaVinci: Create configuration file for da850 EVM

 MAINTAINERS |4 +
 MAKEALL |1 +
 Makefile|5 +-
 arch/arm/include/asm/arch-davinci/hardware.h|1 +
 board/davinci/{da830evm = da8xxevm}/Makefile   |5 +-
 board/davinci/{da830evm = da8xxevm}/config.mk  |0 
 board/davinci/{da830evm = da8xxevm}/da830evm.c |0 
 board/davinci/da8xxevm/da850evm.c   |  111 +++
 include/configs/da850evm.h  |  135 +++
 9 files changed, 260 insertions(+), 2 deletions(-)
 rename board/davinci/{da830evm = da8xxevm}/Makefile (91%)
 rename board/davinci/{da830evm = da8xxevm}/config.mk (100%)
 rename board/davinci/{da830evm = da8xxevm}/da830evm.c (100%)
 create mode 100644 board/davinci/da8xxevm/da850evm.c
 create mode 100644 include/configs/da850evm.h

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


[U-Boot] [PATCH 1/3] TI: DaVinci: Prepare for da850 support

2010-04-28 Thread Sudhakar Rajashekhara
DA850/OMAP-L138 is a new SoC from Texas Instruments
(http://focus.ti.com/docs/prod/folders/print/omap-l138.html).
This SoC is similar to DA830/OMAP-L137 in many aspects. Hence
rename the da830 specific files and folders to da8xx to
accommodate DA850/OMAP-L138.

Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
---
 Makefile|2 +-
 board/davinci/{da830evm = da8xxevm}/Makefile   |4 +++-
 board/davinci/{da830evm = da8xxevm}/config.mk  |0 
 board/davinci/{da830evm = da8xxevm}/da830evm.c |0 
 4 files changed, 4 insertions(+), 2 deletions(-)
 rename board/davinci/{da830evm = da8xxevm}/Makefile (94%)
 rename board/davinci/{da830evm = da8xxevm}/config.mk (100%)
 rename board/davinci/{da830evm = da8xxevm}/da830evm.c (100%)

diff --git a/Makefile b/Makefile
index 25e3b8c..393b180 100644
--- a/Makefile
+++ b/Makefile
@@ -2914,7 +2914,7 @@ cp1026_config: unconfig
@board/armltd/integrator/split_by_variant.sh cp $@
 
 da830evm_config:   unconfig
-   @$(MKCONFIG) $(@:_config=) arm arm926ejs da830evm davinci davinci
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
 
 davinci_dvevm_config : unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs dvevm davinci davinci
diff --git a/board/davinci/da830evm/Makefile b/board/davinci/da8xxevm/Makefile
similarity index 94%
rename from board/davinci/da830evm/Makefile
rename to board/davinci/da8xxevm/Makefile
index 02636fa..20f4915 100644
--- a/board/davinci/da830evm/Makefile
+++ b/board/davinci/da8xxevm/Makefile
@@ -27,7 +27,9 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).a
 
-COBJS  := da830evm.o
+COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM) += da830evm.o
+
+COBJS   := $(sort $(COBJS-y))
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS))
diff --git a/board/davinci/da830evm/config.mk b/board/davinci/da8xxevm/config.mk
similarity index 100%
rename from board/davinci/da830evm/config.mk
rename to board/davinci/da8xxevm/config.mk
diff --git a/board/davinci/da830evm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
similarity index 100%
rename from board/davinci/da830evm/da830evm.c
rename to board/davinci/da8xxevm/da830evm.c
-- 
1.5.6

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


[U-Boot] [PATCH 3/3] TI: DaVinci: Create configuration file for da850 EVM

2010-04-28 Thread Sudhakar Rajashekhara
Provides initial support for TI OMAP-L138/DA850 SoC devices
on a Logic PD EVM board.

Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
---
 MAINTAINERS|4 +
 MAKEALL|1 +
 Makefile   |3 +
 include/configs/da850evm.h |  135 
 4 files changed, 143 insertions(+), 0 deletions(-)
 create mode 100644 include/configs/da850evm.h

diff --git a/MAINTAINERS b/MAINTAINERS
index a5d5835..c52803d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -758,6 +758,10 @@ Nick Thompson nick.thomp...@gefanuc.com
 
da830evmARM926EJS (DA830/OMAP-L137)
 
+Sudhakar Rajashekhara sudhakar@ti.com
+
+   da850evmARM926EJS (DA850/OMAP-L138)
+
 Albin Tonnerre albin.tonne...@free-electrons.com
 
sbc35_a9g20 ARM926EJS (AT91SAM9G20 SoC)
diff --git a/MAKEALL b/MAKEALL
index 34bc4a1..cdb6676 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -559,6 +559,7 @@ LIST_ARM9= \
cp946es \
cp966   \
da830evm\
+   da850evm\
edb9301 \
edb9302 \
edb9302a\
diff --git a/Makefile b/Makefile
index 393b180..0f21db6 100644
--- a/Makefile
+++ b/Makefile
@@ -2913,6 +2913,9 @@ cp922_XA10_config \
 cp1026_config: unconfig
@board/armltd/integrator/split_by_variant.sh cp $@
 
+da850evm_config:   unconfig
+   @$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
+
 da830evm_config:   unconfig
@$(MKCONFIG) $(@:_config=) arm arm926ejs da8xxevm davinci davinci
 
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
new file mode 100644
index 000..2fcc76d
--- /dev/null
+++ b/include/configs/da850evm.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2010 Texas Instruments Incorporated
+ *
+ * Based on davinci_dvevm.h. Original Copyrights follow:
+ *
+ * Copyright (C) 2007 Sergey Kubushyn k...@koi8.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/*
+ * Board
+ */
+
+/*
+ * SoC Configuration
+ */
+#define CONFIG_MACH_DAVINCI_DA850_EVM
+#define CONFIG_ARM926EJS   /* arm926ejs CPU core */
+#define CONFIG_SOC_DA8XX   /* TI DA8xx SoC */
+#define CONFIG_SYS_CLK_FREQclk_get(DAVINCI_ARM_CLKID)
+#define CONFIG_SYS_OSCIN_FREQ  2400
+#define CONFIG_SYS_TIMERBASE   DAVINCI_TIMER0_BASE
+#define CONFIG_SYS_HZ_CLOCKclk_get(DAVINCI_AUXCLK_CLKID)
+#define CONFIG_SYS_HZ  1000
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_SKIP_RELOCATE_UBOOT /* to a proper address, init done */
+
+/*
+ * Memory Info
+ */
+#define CONFIG_SYS_MALLOC_LEN  (0x1 + 1*1024*1024) /* malloc() len */
+#define CONFIG_SYS_GBL_DATA_SIZE   128 /* reserved for initial data */
+#define PHYS_SDRAM_1   DAVINCI_DDR_EMIF_DATA_BASE /* DDR Start */
+#define PHYS_SDRAM_1_SIZE  (64  20) /* SDRAM size 64MB */
+#define CONFIG_SYS_MEMTEST_START   PHYS_SDRAM_1 + 0x200 /* memtest 
start addr */
+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x200 + 
16*1024*1024) /* 16MB test */
+#define CONFIG_NR_DRAM_BANKS   1 /* we have 1 bank of DRAM */
+#define CONFIG_STACKSIZE   (256*1024) /* regular stack */
+
+/*
+ * Serial Driver info
+ */
+#define CONFIG_SYS_NS16550
+#define CONFIG_SYS_NS16550_SERIAL
+#define CONFIG_SYS_NS16550_REG_SIZE-4  /* NS16550 register size */
+#define CONFIG_SYS_NS16550_COM1DAVINCI_UART2_BASE /* Base address of 
UART2 */
+#define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
+#define CONFIG_CONS_INDEX  1   /* use UART0 for console */
+#define CONFIG_BAUDRATE115200  /* Default baud rate */
+#define CONFIG_SYS_BAUDRATE_TABLE  { 9600, 19200, 38400, 57600, 115200 }
+
+/*
+ * I2C Configuration
+ */
+#define CONFIG_HARD_I2C
+#define CONFIG_DRIVER_DAVINCI_I2C
+#define CONFIG_SYS_I2C_SPEED   25000
+#define CONFIG_SYS_I2C_SLAVE   10 /* Bogus, master-only in U-Boot */
+
+/*
+ * U-Boot general configuration
+ */
+#define CONFIG_BOOTFILEuImage /* Boot file name */
+#define CONFIG_SYS_PROMPT  DA850-evm   /* Command Prompt */

[U-Boot] [PATCH 2/3] TI: DaVinci: Add board specific code for da850 EVM

2010-04-28 Thread Sudhakar Rajashekhara
Provides initial support for TI OMAP-L138/DA850 SoC devices on
a Logic PD EVM board.

Provides:
Initial boot and configuration.
Support for i2c.
UART support (console).

Signed-off-by: Sudhakar Rajashekhara sudhakar@ti.com
---
 arch/arm/include/asm/arch-davinci/hardware.h |1 +
 board/davinci/da8xxevm/Makefile  |1 +
 board/davinci/da8xxevm/da850evm.c|  111 ++
 3 files changed, 113 insertions(+), 0 deletions(-)
 create mode 100644 board/davinci/da8xxevm/da850evm.c

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index 81cc8ab..3520cf8 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -398,6 +398,7 @@ struct davinci_syscfg_regs {
 #define DAVINCI_SYSCFG_SUSPSRC_EMAC(1  5)
 #define DAVINCI_SYSCFG_SUSPSRC_I2C (1  16)
 #define DAVINCI_SYSCFG_SUSPSRC_SPI0(1  21)
+#define DAVINCI_SYSCFG_SUSPSRC_SPI1(1  22)
 #define DAVINCI_SYSCFG_SUSPSRC_UART2   (1  20)
 #define DAVINCI_SYSCFG_SUSPSRC_TIMER0  (1  27)
 
diff --git a/board/davinci/da8xxevm/Makefile b/board/davinci/da8xxevm/Makefile
index 20f4915..bcf315c 100644
--- a/board/davinci/da8xxevm/Makefile
+++ b/board/davinci/da8xxevm/Makefile
@@ -28,6 +28,7 @@ include $(TOPDIR)/config.mk
 LIB= $(obj)lib$(BOARD).a
 
 COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM) += da830evm.o
+COBJS-$(CONFIG_MACH_DAVINCI_DA850_EVM) += da850evm.o
 
 COBJS   := $(sort $(COBJS-y))
 
diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
new file mode 100644
index 000..197df22
--- /dev/null
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2010 Texas Instruments Incorporated
+ *
+ * Based on da830evm.c. Original Copyrights follow:
+ *
+ * Copyright (C) 2009 Nick Thompson, GE Fanuc, Ltd. nick.thomp...@gefanuc.com
+ * Copyright (C) 2007 Sergey Kubushyn k...@koi8.net
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include common.h
+#include i2c.h
+#include asm/arch/hardware.h
+#include asm/io.h
+#include ../common/misc.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define pinmux davinci_syscfg_regs-pinmux
+
+/* SPI0 pin muxer settings */
+static const struct pinmux_config spi1_pins[] = {
+   { pinmux[5], 1, 1 },
+   { pinmux[5], 1, 2 },
+   { pinmux[5], 1, 4 },
+   { pinmux[5], 1, 5 }
+};
+
+/* UART pin muxer settings */
+static const struct pinmux_config uart_pins[] = {
+   { pinmux[0], 4, 6 },
+   { pinmux[0], 4, 7 },
+   { pinmux[4], 2, 4 },
+   { pinmux[4], 2, 5 }
+};
+
+/* I2C pin muxer settings */
+static const struct pinmux_config i2c_pins[] = {
+   { pinmux[4], 2, 2 },
+   { pinmux[4], 2, 3 }
+};
+
+static const struct pinmux_resource pinmuxes[] = {
+#ifdef CONFIG_SPI_FLASH
+   PINMUX_ITEM(spi1_pins),
+#endif
+   PINMUX_ITEM(uart_pins),
+   PINMUX_ITEM(i2c_pins),
+};
+
+static const struct lpsc_resource lpsc[] = {
+   DAVINCI_LPSC_AEMIF, /* NAND, NOR */
+   DAVINCI_LPSC_SPI1,  /* Serial Flash */
+   DAVINCI_LPSC_EMAC,  /* image download */
+   DAVINCI_LPSC_UART2, /* console */
+   DAVINCI_LPSC_GPIO,
+};
+
+int board_init(void)
+{
+#ifndef CONFIG_USE_IRQ
+   irq_init();
+#endif
+
+   /* arch number of the board */
+   gd-bd-bi_arch_number = MACH_TYPE_DAVINCI_DA850_EVM;
+
+   /* address of boot parameters */
+   gd-bd-bi_boot_params = LINUX_BOOT_PARAM_ADDR;
+
+   /*
+* Power on required peripherals
+* ARM does not have access by default to PSC0 and PSC1
+* assuming here that the DSP bootloader has set the IOPU
+* such that PSC access is available to ARM
+*/
+   if (davinci_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
+   return 1;
+
+   /* setup the SUSPSRC for ARM to control emulation suspend */
+   writel(readl(davinci_syscfg_regs-suspsrc) 
+  ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
+DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
+DAVINCI_SYSCFG_SUSPSRC_UART2),
+  davinci_syscfg_regs-suspsrc);
+
+   /* configure pinmux settings */
+   if 

Re: [U-Boot] [PATCH 1/2] mtdparts: fix write through NULL pointer

2010-04-28 Thread Stefano Babic
Wolfgang Denk wrote:
 The mtdparts add command wrote through a NULL pointer - on many
 systems this went unnoticed (PowerPC has writable RAM there, some ARM
 systems have ROM where a write has no effect), but on arm1136
 (i.MX31) it crashed the system.
 
 Add appropriate checks.
 

Hi Wolfgang,

I have already sent a patch fixing this issue,

http://lists.denx.de/pipermail/u-boot/2010-April/070347.html

However, I preferred (easier way) to fix the calling function as the
device_parse(). I do not know if Stefan has already merged it.

Stefano

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


Re: [U-Boot] [PATCH 1/2] mtdparts: fix write through NULL pointer

2010-04-28 Thread Stefan Roese
Hi Stefano,

On Wednesday 28 April 2010 13:12:22 Stefano Babic wrote:
  The mtdparts add command wrote through a NULL pointer - on many
  systems this went unnoticed (PowerPC has writable RAM there, some ARM
  systems have ROM where a write has no effect), but on arm1136
  (i.MX31) it crashed the system.
  
  Add appropriate checks.
 
 Hi Wolfgang,
 
 I have already sent a patch fixing this issue,
 
 http://lists.denx.de/pipermail/u-boot/2010-April/070347.html
 
 However, I preferred (easier way) to fix the calling function as the
 device_parse(). I do not know if Stefan has already merged it.

No, I haven't merged it. Since I was not sure if this has to go through one of 
my git repositories. Both cfi-flash and ubi don't really include this mtdparts 
stuff.

Wolfgang, I suggest you apply your preferred version directly.

Thanks.

Cheers,
Stefan

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


[U-Boot] [PATCH] MX31: Adjust default environment for QONG module

2010-04-28 Thread Stefano Babic
Because the the size of u-boot increased after adding
new features (mainly the support for ubi/ubifs), storing
u-boot requires an additional sector on the flash. The patch
adjusts the kernel_addr and mtdparts variables giving 128KB
more space for u-boot code.

Signed-off-by: Stefano Babic sba...@denx.de
---
 include/configs/qong.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/configs/qong.h b/include/configs/qong.h
index 1a2f19f..067dc79 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -144,7 +144,7 @@
addmtd=setenv bootargs ${bootargs} ${mtdparts}\0  \
addmisc=setenv bootargs ${bootargs}\0 \
uboot_addr=a000\0 \
-   kernel_addr=a008\0\
+   kernel_addr=a00a\0\
ramdisk_addr=a030\0   \
u-boot=qong/u-boot.bin\0  \
kernel_addr_r=8080\0  \
@@ -274,7 +274,7 @@ extern int qong_nand_rdy(void *chip);
 #define CONFIG_FLASH_CFI_MTD
 #define MTDIDS_DEFAULT nor0=physmap-flash.0
 #define MTDPARTS_DEFAULT   \
-   mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
+   mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
128k(env2),2560k(kernel),13m(ramdisk),-(user)
 
 #endif /* __CONFIG_H */
-- 
1.6.3.3

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


[U-Boot] [PATCH] MX31: Enabling hush shell for the QONG module

2010-04-28 Thread Stefano Babic
Signed-off-by: Stefano Babic sba...@denx.de
---
 include/configs/qong.h |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/configs/qong.h b/include/configs/qong.h
index 067dc79..c448f6c 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -187,6 +187,8 @@
 
 #define CONFIG_SYS_HZ  1000
 
+#define CONFIG_SYS_HUSH_PARSER /* Use the HUSH parser  */
+#defineCONFIG_SYS_PROMPT_HUSH_PS2  = 
 #define CONFIG_CMDLINE_EDITING 1
 
 #define CONFIG_MISC_INIT_R 1
-- 
1.6.3.3

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


Re: [U-Boot] [PATCH] Save environment data to mmc.

2010-04-28 Thread Andy Fleming
On Wed, Apr 28, 2010 at 2:52 AM, Terry Lv r65...@freescale.com wrote:
 This patch is to save environment data to mmc card.
 It uses interfaces defined in generic mmc.

 Signed-off-by: Terry Lv r65...@freescale.com


 diff --git a/common/env_mmc.c b/common/env_mmc.c
 new file mode 100644
 index 000..202370e
 --- /dev/null
 +++ b/common/env_mmc.c
 @@ -0,0 +1,160 @@
 +/*
 + * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
 +
 + * (C) Copyright 2000-2006
 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de.
 + *
 + * (C) Copyright 2001 Sysgo Real-Time Solutions, GmbH www.elinos.com
 + * Andreas Heppel ahep...@sysgo.de

Are these non-Freescale copyrights here for a reason, or were they
just copied from somewhere?

 +#ifdef ENV_IS_EMBEDDED
 +extern uchar environment[];
 +env_t *env_ptr = (env_t *)(environment[0]);
 +#else /* ! ENV_IS_EMBEDDED */
 +env_t *env_ptr;
 +#endif /* ENV_IS_EMBEDDED */

You should probably initialize env_ptr to NULL, here.

 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +#define BLOCK_ALIGN(x) ((x  (0x200 - 1)) \
 +                        ? ((x  9) + 1) : (x  9))

No need to reinvent the wheel, here.  This is the same as:

ALIGN(x, 0x200);

See: include/common.h

Also, are you sure the block size is 0x200?  That's a very common
block size, but the MMC spec allows a whole bunch of alternate ones.
You should use the actual value of mmc-read_bl_len and
mmc-write_bl_len;


 +int env_init(void)
 +{
 +       /* use default */
 +       gd-env_addr = (ulong)default_environment[0];
 +       gd-env_valid = 1;
 +
 +       return 0;
 +}
 +
 +inline int init_mmc_for_env(struct mmc *mmc)

Why is this inlined?  Don't inline a function if there's no good reason.

 +{
 +       if (!mmc) {
 +               puts(No MMC card found\n);
 +               return -1;
 +       }
 +
 +       if (mmc_init(mmc)) {
 +               puts(MMC init failed\n);
 +               return  -1;
 +       }
 +
 +       return 0;
 +}

 +inline int write_env(struct mmc *mmc, unsigned long size,
 +                                               unsigned long offset, const 
 void *buffer)
 +{
 +       uint blk_start = 0, blk_cnt = 0, n = 0;

Don't initialize variables to zero right before assigning them.

 +
 +       blk_start = BLOCK_ALIGN(offset);
 +       blk_cnt   = BLOCK_ALIGN(size);
 +
 +       n = mmc-block_dev.block_write(CONFIG_SYS_MMC_ENV_DEV, blk_start , 
 blk_cnt, (u_char *)buffer);
 +
 +       return (n == blk_cnt) ? 0 : -1;
 +}
 +
 +int saveenv(void)
 +{
 +       struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
 +
 +       if (init_mmc_for_env(mmc))
 +               return 1;
 +
 +       printf(Writing to MMC(%d)... , CONFIG_SYS_MMC_ENV_DEV);
 +       if (write_env(mmc, CONFIG_ENV_SIZE, \

You don't need that \.  C does that for you automatically.



 +inline int read_env(struct mmc *mmc, unsigned long size,
 +                                               unsigned long offset, const 
 void *buffer)
 +{
 +       uint blk_start = 0, blk_cnt = 0, n = 0;

Again, don't bother zeroing out values like this.

 +
 +       blk_start = BLOCK_ALIGN(offset);
 +       blk_cnt   = BLOCK_ALIGN(size);
 +
 +       n = mmc-block_dev.block_read(CONFIG_SYS_MMC_ENV_DEV, blk_start, 
 blk_cnt, (uchar *)buffer);
 +
 +       return (n == blk_cnt) ? 0 : -1;
 +}
 +
 +void env_relocate_spec(void)
 +{
 +#if !defined(ENV_IS_EMBEDDED)
 +       struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
 +
 +       if (init_mmc_for_env(mmc))
 +               return;
 +
 +       if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
 +               return use_default();


This is broken.  env_ptr hasn't been initialized to a value, yet!
This writes to random memory!  env_ptr needs to be malloc'ed.


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


[U-Boot] IRQ and SWI in Uboot

2010-04-28 Thread venky485

Hi, I am using uboot on beagle board. I have enabled compile switch
(CONFIG_USE_IRQ).
I have enabled the interrupts and generated a timer interrupt. But, it hangs
without executing the ISR.
As a test, i tried SWI also. Same situation.

Do you have any idea about this problem?

Thanks in advance for your help.

Regards

-- 
View this message in context: 
http://old.nabble.com/IRQ-and-SWI-in-Uboot-tp28387974p28387974.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] [PATCH v5] mmc: add generic mmc spi driver

2010-04-28 Thread Andy Fleming
On Wed, Apr 28, 2010 at 1:00 AM, Thomas Chou tho...@wytron.com.tw wrote:
 This patch supports mmc/sd card with spi interface. It is based on
 the generic mmc framework. It works with SDHC and supports write.

 The crc7 lib func is merged from linux and used to compute mmc
 command checksum.

This should probably be a separate patch.


 There is a subcomamnd mmc_spi to setup spi bus and cs at run time.

 Signed-off-by: Thomas Chou tho...@wytron.com.tw

 +
 +static int do_mmc_spi(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 +{
 +       int dev_num = -1;
 +       uint bus;
 +       uint cs;
 +       uint speed;
 +       uint mode;
 +       char *endp;
 +       struct mmc *mmc;
 +       struct mmc_spi_priv *priv;
 +
 +       do {
 +               mmc = find_mmc_device(++dev_num);
 +       } while (mmc  strcmp(mmc-name, MMC_SPI));
 +       if (!mmc) {
 +               printf(Create MMC Device\n);
 +               mmc = mmc_spi_init(CONFIG_MMC_SPI_BUS,
 +                                  CONFIG_MMC_SPI_CS,
 +                                  CONFIG_MMC_SPI_SPEED,
 +                                  CONFIG_MMC_SPI_MODE);
 +               if (!mmc) {
 +                       printf(Failed to create MMC Device\n);
 +                       return 1;
 +               }
 +               dev_num = mmc-block_dev.dev;
 +       }


I'm not sure I understand the logic behind this code.  The arguments
to the command should be used to either find the already-existing bus,
or to create a new one.  Unless I'm misunderstanding, this searches
for the first MMC_SPI bus, and if it finds it, uses that, otherwise it
creates a new one with the values specified in the config file.  Then
it parses the command and overwrites the old parameters for the bus
with new ones?  Why?  My instinct would be to create a separate
instance of an MMC_SPI bus for each bus and chip select.  My SPI is
rusty, so maybe chip-select should be configurable on a use-by-use
basis.

Certainly the current code will only use at most one MMC_SPI bus even
if more are created, which seems wrong.


 +
 +       priv = mmc-priv;
 +       bus = priv-bus;
 +       cs = priv-cs;
 +       speed = priv-speed;
 +       mode = priv-mode;
 +
 +       if (argc  2)
 +               goto info;
 +       cs = simple_strtoul(argv[1], endp, 0);
 +       if (*argv[1] == 0 || (*endp != 0  *endp != ':'))
 +               goto usage;
 +       if (*endp == ':') {
 +               if (endp[1] == 0)
 +                       goto usage;
 +               bus = cs;
 +               cs = simple_strtoul(endp + 1, endp, 0);
 +               if (*endp != 0)
 +                       goto usage;
 +       }
 +       if (argc = 3) {
 +               speed = simple_strtoul(argv[2], endp, 0);
 +               if (*argv[2] == 0 || *endp != 0)
 +                       goto usage;
 +       }
 +       if (argc = 4) {
 +               mode = simple_strtoul(argv[3], endp, 16);
 +               if (*argv[3] == 0 || *endp != 0)
 +                       goto usage;
 +       }
 +       if (!spi_cs_is_valid(bus, cs)) {
 +               printf(Invalid SPI bus %u cs %u\n, bus, cs);
 +               return 1;
 +       }
 +
 +       if (bus != priv-bus || cs != priv-cs ||
 +           speed != priv-speed || mode != priv-mode) {
 +               priv-bus = bus;
 +               priv-cs = cs;
 +               priv-speed = speed;
 +               priv-mode = mode;
 +               if (priv-slave) {
 +                       spi_free_slave(priv-slave);
 +                       priv-slave = NULL;
 +               }
 +       }

 diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
 new file mode 100644
 index 000..dedcef7
 --- /dev/null
 +++ b/drivers/mmc/mmc_spi.c
 @@ -0,0 +1,318 @@
 +/*
 + * generic mmc spi driver
 + *

 +static uint mmc_spi_sendcmd(struct mmc *mmc, u8 cmdidx, u32 cmdarg)
 +{
 +       struct mmc_spi_priv *priv = mmc-priv;
 +       u8 cmdo[7];
 +       u8 r1;
 +       int i;
 +       cmdo[0] = 0xff;
 +       cmdo[1] = 0x40 + cmdidx;

Use a #define'd constant for 0x40.  Maybe do this:

/* MMC SPI commands start with a start bit 0 and a transmit bit 1 */
#define MMC_SPI_CMD(x) (0x40 | (x  0x3f))

cmdo[1] = MMC_SPI_CMD(cmdidx);

 +       cmdo[2] = cmdarg  24;
 +       cmdo[3] = cmdarg  16;
 +       cmdo[4] = cmdarg  8;
 +       cmdo[5] = cmdarg;
 +       cmdo[6] = (crc7(0, cmdo[1], 5)  1) | 0x01;
 +       spi_xfer(priv-slave, 7 * 8, cmdo, NULL, SPI_XFER_BEGIN);
 +       for (i = 0; i  CTOUT; i++) {
 +               spi_xfer(priv-slave, 1 * 8, NULL, r1, 0);
 +               if ((r1  0x80) == 0)

define a constant

 +                       break;
 +       }
 +       debug(%s:cmd%d resp%d %x\n, __func__, cmdidx, i, r1);
 +       return r1;
 +}
 +
 +static uint mmc_spi_readdata(struct mmc *mmc, char *buf,
 +                               u32 bcnt, u32 bsize)
 +{
 +       struct mmc_spi_priv *priv = mmc-priv;
 +       u8 r1;
 +       u8 crc[2];
 +       int i;
 +       while (bcnt--) {
 +         

Re: [U-Boot] [PATCH] MX31: Adjust default environment for QONG module

2010-04-28 Thread Wolfgang Denk
Dear Stefano Babic,

In message 1272455915-1143-1-git-send-email-sba...@denx.de you wrote:
 Because the the size of u-boot increased after adding
 new features (mainly the support for ubi/ubifs), storing
 u-boot requires an additional sector on the flash. The patch
 adjusts the kernel_addr and mtdparts variables giving 128KB
 more space for u-boot code.
...
 @@ -144,7 +144,7 @@
   addmtd=setenv bootargs ${bootargs} ${mtdparts}\0  \
   addmisc=setenv bootargs ${bootargs}\0 \
   uboot_addr=a000\0 \
 - kernel_addr=a008\0\
 + kernel_addr=a00a\0\
   ramdisk_addr=a030\0   \
=^

   u-boot=qong/u-boot.bin\0  \
   kernel_addr_r=8080\0  \
 @@ -274,7 +274,7 @@ extern int qong_nand_rdy(void *chip);
  #define CONFIG_FLASH_CFI_MTD
  #define MTDIDS_DEFAULT   nor0=physmap-flash.0
  #define MTDPARTS_DEFAULT \
 - mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
 + mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
   128k(env2),2560k(kernel),13m(ramdisk),-(user)

This shifts the start address of the ramdisk' and user partitions
to some odd addresses; also, this makes the definition of
ramdisk_addr (see above) incorrct.

I recommend to do this instead:

-   mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
-   128k(env2),2560k(kernel),13m(ramdisk),-(user)
+   mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
+   128k(env2),2432k(kernel),13m(ramdisk),-(user)
 

What do you think?

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
People seldom know what they want until you give them what  they  ask
for.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MX31: Adjust default environment for QONG module

2010-04-28 Thread Stefano Babic
Wolfgang Denk wrote:
  ramdisk_addr=a030\0   \
 =^
 
  u-boot=qong/u-boot.bin\0  \
  kernel_addr_r=8080\0  \
 @@ -274,7 +274,7 @@ extern int qong_nand_rdy(void *chip);
  #define CONFIG_FLASH_CFI_MTD
  #define MTDIDS_DEFAULT  nor0=physmap-flash.0
  #define MTDPARTS_DEFAULT\
 -mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
 +mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
  128k(env2),2560k(kernel),13m(ramdisk),-(user)
 
 This shifts the start address of the ramdisk' and user partitions
 to some odd addresses; also, this makes the definition of
 ramdisk_addr (see above) incorrct.

You are right. The ramdisk_addr must be shifted, or the kernel size must
be adjusted.

 I recommend to do this instead:
 
 - mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
 - 128k(env2),2560k(kernel),13m(ramdisk),-(user)
 + mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
 + 128k(env2),2432k(kernel),13m(ramdisk),-(user)
  
 
 What do you think?

Agree. I will send a new version of the patch with your proposed values.

Best regards,
Stefano Babic

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


[U-Boot] [PATCH V2] MX31: Adjust default environment for QONG module

2010-04-28 Thread Stefano Babic
Because the the size of u-boot increased after adding
new features (mainly the support for ubi/ubifs), storing
u-boot requires an additional sector on the flash. The patch
adjusts the kernel_addr and mtdparts variable giving 128KB
more space for u-boot code.

Signed-off-by: Stefano Babic sba...@denx.de
---
 include/configs/qong.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/configs/qong.h b/include/configs/qong.h
index 1284a00..dc828f6 100644
--- a/include/configs/qong.h
+++ b/include/configs/qong.h
@@ -144,7 +144,7 @@
addmtd=setenv bootargs ${bootargs} ${mtdparts}\0  \
addmisc=setenv bootargs ${bootargs}\0 \
uboot_addr=a000\0 \
-   kernel_addr=a008\0\
+   kernel_addr=a00a\0\
ramdisk_addr=a030\0   \
u-boot=qong/u-boot.bin\0  \
kernel_addr_r=8080\0  \
@@ -276,7 +276,7 @@ extern int qong_nand_rdy(void *chip);
 #define CONFIG_FLASH_CFI_MTD
 #define MTDIDS_DEFAULT nor0=physmap-flash.0
 #define MTDPARTS_DEFAULT   \
-   mtdparts=physmap-flash.0:256k(U-Boot),128k(env1), \
-   128k(env2),2560k(kernel),13m(ramdisk),-(user)
+   mtdparts=physmap-flash.0:384k(U-Boot),128k(env1), \
+   128k(env2),2432k(kernel),13m(ramdisk),-(user)
 
 #endif /* __CONFIG_H */
-- 
1.6.3.3

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


[U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Ron Madrid
Added UPM array table, upmconfig, and Local Bus configuration support for 
SIMPC8313

Signed-off-by: Ron Madrid ron_mad...@sbcglobal.net
---
 board/sheldon/simpc8313/simpc8313.c |   34 ++
 include/configs/SIMPC8313.h |   10 ++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/board/sheldon/simpc8313/simpc8313.c 
b/board/sheldon/simpc8313/simpc8313.c
index 1044de2..3bfd4db 100644
--- a/board/sheldon/simpc8313/simpc8313.c
+++ b/board/sheldon/simpc8313/simpc8313.c
@@ -91,6 +91,40 @@ void pci_init_board(void)
 int misc_init_r(void)
 {
int rc = 0;
+   volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+   volatile fsl_lbus_t *lbus = immap-lbus;
+   volatile u32 *mxmr = lbus-mamr;   /* Pointer to mamr */
+
+   /* UPM Table Configuration Code */
+   static uint UPMATable[] = {
+   /* Read Single-Beat (RSS) */
+   0x0fff0c00, 0x0fffdc00, 0x0fff0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Read Burst (RBS) */
+   0x0fff0c00, 0x0ffcdc00, 0x0ffc0c00, 0x0ffc0f0c,
+   0x0ffccf0c, 0x0ffc0f0c, 0x0ffcce0c, 0x3ffc0c05,
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Write Single-Beat (WSS) */
+   0x0ffc0c00, 0x0ffcdc00, 0x0ffc0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Write Burst (WBS) */
+   0x0ffc0c00, 0x0fffcc0c, 0x0fff0c00, 0x0fffcc00,
+   0x0fff1c00, 0x0fffcf0c, 0x0fff0f0c, 0x0fffcf0c,
+   0x0fff0c0c, 0x0fffcc0c, 0x0fff0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Refresh Timer (RTS) */
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Exception Condition (EXS) */
+   0xfc00, 0xfc00, 0xfc00, 0xfc01
+   };
+
+   upmconfig(UPMA, UPMATable, sizeof(UPMATable) / sizeof(UPMATable[0]));
+
+   /* Set LUPWAIT to be active low and enabled */
+   *mxmr = 0x0800 | MxMR_GPL_x4DIS;
 
return rc;
 }
diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
index 84af8df..889050f 100644
--- a/include/configs/SIMPC8313.h
+++ b/include/configs/SIMPC8313.h
@@ -184,6 +184,16 @@
 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIMCONFIG_SYS_LBLAWBAR0_PRELIM
 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR0_PRELIM
 
+#define CONFIG_SYS_BR1_PRELIM  ( 0xFF00/* FPGA Base Addr */ \
+   | BR_PS_16 \
+   | BR_MS_UPMA \
+   | BR_V )
+#define CONFIG_SYS_OR1_PRELIM  ( 0xFFE0/* length 2MB */ \
+   | OR_UPM_BCTLD)
+
+#define CONFIG_SYS_LBLAWBAR1_PRELIM0xFF00  /* FPGA Base Addr */
+#define CONFIG_SYS_LBLAWAR1_PRELIM 0x8014  /* 2MB */
+
 /*
  * JFFS2 configuration
  */
-- 
1.5.5.1

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


Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-28 Thread Marek Vasut
Dne St 21. dubna 2010 17:08:20 Marek Vasut napsal(a):
 Hey Tom,
 
 sorry for the delay. I addressed the issues you pointed out about the last
 two patches. Also, I made the first two stack-alignment patches one as the
 second one was just a bugfix for the first one. No change to the PXAMMC
 patches. Cheers!
 
 The following changes since commit
 2a72e9ed18d2164eb7fe569119342eb631b568da: Stefan Roese (1):
 ppc4xx: Add option for PPC440SPe ports without old Rev. A support
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-pxa.git next
 
 Marek Vasut (5):
   PXA: Align stack to 8 bytes
   PXA: PXAMMC: Drop different delays for PXA27X
   PXA: PXAMMC: Add Monahans support
   PXA: Add UP2OCR register bit definitions
   PXA: Add missing MDREFR bits
 
  arch/arm/cpu/pxa/start.S |5 -
  arch/arm/include/asm/arch-pxa/pxa-regs.h |   25 +
  drivers/mmc/pxa_mmc.c|   17 ++---
  3 files changed, 31 insertions(+), 16 deletions(-)

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


[U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread ogara

Hi All,
I am trying to bring linux from RAM. I have compiled the kernel and created
uImage. I bring the image over tftp into the memory and then execute bootm
memaddress. Unfortunately here is the output from my command line:

 tftp 0x8000 ipaddress:uImage
Using egiga0 device
TFTP from server ipaddress; our IP address is ipaddress; sending through
gateway ipaddress
Filename 'uImage'.
Load address: 0x8000
Loading: #
 #
 #
 ###
done
Bytes transferred = 3132020 (2fca74 hex)
bootm 0x8000
## Booting kernel from Legacy Image at 8000 ...
   Image Name:   Linux-2.6.32.3
   Created:  2010-04-28  18:44:34 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:3131956 Bytes =  3 MB
   Load Address: 8000
   Entry Point:  8000
   Verifying Checksum ... OK
   XIP Kernel Image ... OK
OK

Starting kernel ...

undefined instruction
pc : [8008]  lr : [00647d1c]
sp : 005ffce8  ip : 08e0 fp : 06fc
r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
Resetting CPU ...

Now, the image is good for sure because I do not have issues bringing this
image from the hard drive. Do I need anything else (ftd or ramdisc) to boot
from RAM or the procedure presented is correct?
my bootargs are:
bootargs=console ttyS0,115200 root /dev/ram rw 

Thank you for your help,
Ogi




-- 
View this message in context: 
http://old.nabble.com/trying-to-bring-linux-2.6.32.3-from-RAM--tp28392641p28392641.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread Marek Vasut
Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and created
 uImage. I bring the image over tftp into the memory and then execute bootm
 memaddress. Unfortunately here is the output from my command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending through
 gateway ipaddress
 Filename 'uImage'.
 Load address: 0x8000
 Loading: #
  #
  #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex)
 bootm 0x8000
 ## Booting kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3131956 Bytes =  3 MB
Load Address: 8000
Entry Point:  8000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 undefined instruction
 pc : [8008]  lr : [00647d1c]
 sp : 005ffce8  ip : 08e0 fp : 06fc
 r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
 r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
 r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
 Resetting CPU ...
 
 Now, the image is good for sure because I do not have issues bringing this
 image from the hard drive. Do I need anything else (ftd or ramdisc) to boot
 from RAM or the procedure presented is correct?
 my bootargs are:
 bootargs=console ttyS0,115200 root /dev/ram rw
 
 Thank you for your help,
 Ogi

Hi, the image is probably corrupted ? Also, why do you load it to 0x8000 ? It's 
relocated anyway, but this way it has to be relocated twice)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Facing problems in Porting U-boot to MIPS32 (Au1350)

2010-04-28 Thread  Gurumurthy G M

Hi,
   i have one doubt regarding the configuring and working on serial port. In 
Free scale processors I used to #define the console write to smc or scc ( 
mpc8280 uart ports) .

But here i don't think console write or console debug messages are configured 
to UART2 ( Debug Port) of Au1350. If not then how console port UART2 is taken 
though serial_init will initialize UART2.

my concern is how output of printf or puts or debug messages is displayed on 
MIPS au1350 console( uart2 is debug port).

If am right by defining configs/dbau1x00.h it will just initialize the serial 
port and baud rate.

need help if am missing something regarding debug console.

Regards,
Gurumurthy


-Original Message-
From: Andrew Dyer [mailto:amd...@gmail.com]
Sent: Tue 4/27/2010 4:57 AM
To:  Gurumurthy G M
Cc: U-Boot List
Subject: Re: [U-Boot] Facing problems in Porting U-boot to MIPS32 (Au1350)
 
On Mon, Apr 26, 2010 at 2:07 PM, Gurumurthy G M
gurumurthy.gow...@gmobis.com wrote:


 Hi Andrew,
          Thank You very much for the reply.

 i have done a couple of porting for MPC82xx,MPC74xx i.e. only worked on Free 
 Scale processors. this is my first port on MIPS. i feel its not so simple as 
 MPC and ARM.

 In MIPS where i need to configure the Debug port initialization in board 
 config file.

 my debug port is UART 2 i.e. console port. but no where it is defined. only i 
 saw in au1x00.h file UART_DEBUG_BASE = UART2. but how it is configured to get 
 console messages.

 please let me know about this if am wrong let me know.

Please post to the list.  I've cc'd it

look in cpu/mips/au1x00_serial.c - in there everything is hardcoded to
uart 0.  I've attached a version from our local CVS that allows
selecting the uart, but I don't have it cleanly done as a nice patch.
Feel free to bang it into shape and submit it, but I can't support
that code.

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


Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread ogara


ogara wrote:
 
Hi, the image is probably corrupted ? Also, why do you load it to 0x8000 ?
It's 
relocated anyway, but this way it has to be relocated twice)
 
I boot it from 0x8000 because the image was built with load and execute
address 0x8000. Image is not corrupted for sure since I can boot this exact
file from hard drive without any problems. I was just wondering if my
procedure is correct or I am missing something? Could you explain what do
you mean by this way it has to be relocated twice.
Ogi


Marek Vasut wrote:
 
 Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and
 created
 uImage. I bring the image over tftp into the memory and then execute
 bootm
 memaddress. Unfortunately here is the output from my command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending through
 gateway ipaddress
 Filename 'uImage'.
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex)
 bootm 0x8000
 ## Booting kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3131956 Bytes =  3 MB
Load Address: 8000
Entry Point:  8000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 undefined instruction
 pc : [8008]  lr : [00647d1c]
 sp : 005ffce8  ip : 08e0 fp : 06fc
 r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
 r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
 r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
 Resetting CPU ...
 
 Now, the image is good for sure because I do not have issues bringing
 this
 image from the hard drive. Do I need anything else (ftd or ramdisc) to
 boot
 from RAM or the procedure presented is correct?
 my bootargs are:
 bootargs=console ttyS0,115200 root /dev/ram rw
 
 Thank you for your help,
 Ogi
 
 Hi, the image is probably corrupted ? Also, why do you load it to 0x8000 ?
 It's 
 relocated anyway, but this way it has to be relocated twice)
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 

-- 
View this message in context: 
http://old.nabble.com/trying-to-bring-linux-2.6.32.3-from-RAM--tp28392641p28393231.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


[U-Boot] [PATCH] Create a new driver for Atmel at91/avr MCI adapters that uses the u-boot mmc framework.

2010-04-28 Thread Rob Emanuele
To use it on your platform add defines like these:
#define CONFIG_MMC  1
#define CONFIG_GENERIC_MMC  1
#define CONFIG_GENERIC_ATMEL_MCI1
/*change this for your cpu */
#define MMCI_BASE   0xFFF8

Then create an init routine in your platform code:
/* this is a weak define that we are overriding */
int board_mmc_init(bd_t *bd)
{
/* This calls your code to clock the interface
 *  and set the pins up, etc.
 */
mmc_hw_init();
/* This calls the atmel_mmc_init in gen_atmel_mci.c */
return atmel_mmc_init(bd);
}


Signed-off-by: Rob Emanuele r...@emanuele.us
---
 drivers/mmc/Makefile|1 +
 drivers/mmc/gen_atmel_mci.c |  330 +++
 2 files changed, 331 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mmc/gen_atmel_mci.c

diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 6fa04b8..1785253 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
 LIB:= $(obj)libmmc.a
 
 COBJS-$(CONFIG_GENERIC_MMC) += mmc.o
+COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
 COBJS-$(CONFIG_ATMEL_MCI) += atmel_mci.o
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
new file mode 100644
index 000..9e3430a
--- /dev/null
+++ b/drivers/mmc/gen_atmel_mci.c
@@ -0,0 +1,330 @@
+/*
+ * Copyright 2010, Rob Emanuele r...@emanuele.us
+ *
+ * Original Driver:
+ * Copyright (C) 2004-2006 Atmel Corporation
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include config.h
+#include common.h
+#include command.h
+#include hwconfig.h
+#include mmc.h
+#include part.h
+#include malloc.h
+#include mmc.h
+#include asm/io.h
+#include asm/errno.h
+#include asm/byteorder.h
+#include asm/arch/clk.h
+#include asm/arch/memory-map.h
+#include atmel_mci.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_SYS_MMC_CLK_OD
+#define CONFIG_SYS_MMC_CLK_OD  15
+#endif
+#define MMC_DEFAULT_BLKLEN 512
+
+void dump_cmd(uint cmdr, uint arg, uint status, const char* msg)
+{
+   printf(gen_atmel_mci: CMDR 0x%08x (%2u) ARGR 0x%08x (SR: 0x%08x) %s\n,
+  cmdr, cmdr0x3F, arg, status, msg);
+}
+
+/* Setup for MCI Clock and Block Size */
+static void mci_set_mode(unsigned long hz, unsigned long blklen)
+{
+   unsigned long bus_hz;
+   unsigned long clkdiv;
+
+   if (hz  0) {
+   bus_hz = get_mck_clk_rate();
+   clkdiv = (bus_hz / hz) / 2 - 1;
+   } else {
+   clkdiv = ~0UL;
+   }
+
+   printf(mmc: setting clock %lu Hz, block size %lu\n,
+  hz, blklen);
+
+   if (clkdiv  ~255UL) {
+   clkdiv = 255;
+   printf(mmc: clock %lu too low; setting CLKDIV to 255\n,
+  hz);
+   }
+
+   blklen = 0xfffc;
+   /* On some platforms RDPROOF and WRPROOF are ignored */
+   mmci_writel(MR, (MMCI_BF(CLKDIV, clkdiv)
+| MMCI_BF(BLKLEN, blklen)
+| MMCI_BIT(RDPROOF)
+| MMCI_BIT(WRPROOF)));
+}
+
+/* Return the CMDR with flags for a given command and data packet */
+static uint atmel_encode_cmd(struct mmc_cmd *cmd, struct mmc_data *data, uint* 
error_flags)
+{
+   uint cmdr = 0;
+   /* Default Flags for Errors */
+   *error_flags |= (MMCI_BIT(DTOE) | MMCI_BIT(RDIRE) | MMCI_BIT(RENDE) | 
MMCI_BIT(RINDE) | MMCI_BIT(RTOE));
+
+   /* Default Flags for the Command */
+   cmdr |= MMCI_BIT(MAXLAT);
+
+   if (data) {
+   cmdr |= MMCI_BF(TRCMD,1);
+
+   if (data-blocks  1) {
+   cmdr |= MMCI_BF(TRTYP,1);
+   }
+
+   if (data-flags  MMC_DATA_READ)
+   cmdr |= MMCI_BIT(TRDIR);
+   }
+
+   if (cmd-resp_type  MMC_RSP_CRC)
+   *error_flags |= MMCI_BIT(RCRCE);
+
+   if (cmd-resp_type  MMC_RSP_136)
+   cmdr |= MMCI_BF(RSPTYP,2);
+   else if (cmd-resp_type  MMC_RSP_BUSY)
+   cmdr |= MMCI_BF(RSPTYP,3);
+   else if (cmd-resp_type 

Re: [U-Boot] at91sam9g45ekes SDHC/MMC

2010-04-28 Thread Robert Emanuele
Andy, Henry, Ulf, and the rest,

I've posted the patch that I'm using for my SD/MMC support.  It is a
new driver based on some of the code from the original Atmel driver
that uses the MMC framework.  I've tested it on a at91sam9g45 (ES and
production chips) and on an ek board and our own board.

I hope this can help you guys out and I hope this can get mainlined
for others to enjoy.

If the patch is not in your email, here is a link to it in the archives:
http://lists.denx.de/pipermail/u-boot/2010-April/070816.html

--Rob

On Fri, Apr 23, 2010 at 6:18 PM, Andy Fleming aflem...@gmail.com wrote:
 On Fri, Apr 23, 2010 at 6:21 PM, Albin Tonnerre
 albin.tonne...@free-electrons.com wrote:
 On Fri, 23 Apr 2010 16:58 -0500, Andy Fleming wrote :
 On Thu, Apr 22, 2010 at 7:51 PM, Rob Emanuele r...@emanuele.us wrote:
  Hi Henry  U-Boot Community,
 
  I've been experiencing the same errors and frustration you have.
 
  So I've been looking at this code and these patch sets for a day or
  two now.  I've done that in conjunction with reading the SD card spec:
  http://www.sdcard.org/developers/tech/sdcard/pls/
 
  I've come to the conclusion that this code as it stands will not work
  with any card that conforms to the SD Physical Layer Simplified
  Specification Version 2.0.  This includes all SDHC cards and some
  non-HC cards that conform to version 2.0.  I have a few 1GB cards that
  work just fine with the atmel_mci.c code on a 'G45 as it was in rev
  95c44ec485b46ffb43dbdaa299f1491a500fdadf .
 
  If your SD card is newer, you'll see in the for loop in sd_init_card
  in atmel_mci.c time out.  In the 2.0 spec, you need to perform a CMD8
  (SEND_IF_COND) first to see if your card is a 2.0 card.  In CMD8 you
  tell the card the voltages you support and if you support HC cards.
  Once you send it the right data there, then ACMD41 will not have its
  BUSY bit set.  That's all well and good, but additionally the CSD
  register is in a new format and that needs updating before any of this
  will work.


 The best solution is to use the MMC framework, which *does* do all of
 these things that you suggest.  It should be fairly straightforward to
 port the atmel_mci driver to this framework.  If you see something
 lacking, feel free to mention it, or modify the framework.  :)

 I did port the atmel_mci driver to the MMC framework and posted the results 
 on
 this mailing list a few months back. However, some people apparently 
 experienced
 issues I have never been able to reproduce, and got few review.
 I recently adapted the AT91 SD/MMC support patch and the atmel_mci port to 
 use
 the new C structures access, I'll repost it in a couple days in case anyone's
 interested.



 Yeah, I see that now.  I'm catching up from being in various other
 project quagmires.  Sadly,
 I can't apply your patch if people are running into problems with it,
 but I'd far prefer it.

 I also don't have such a board, though.  If someone could apply
 Albin's patches, and try to identify why it's not working, I'd be very
 appreciative.  :)

 Andy

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


Re: [U-Boot] [PATCH] at91: define matrix registers bit fields

2010-04-28 Thread Tom Rix
Asen Dimov wrote:
 Signed-off-by: Asen Dimov di...@ronetix.at
 ---
  arch/arm/include/asm/arch-at91/at91_matrix.h |  138 
 ++
  1 files changed, 138 insertions(+), 0 deletions(-)
 
 diff --git a/arch/arm/include/asm/arch-at91/at91_matrix.h 
 b/arch/arm/include/asm/arch-at91/at91_matrix.h
 index 981ec20..60fd75b 100644
 --- a/arch/arm/include/asm/arch-at91/at91_matrix.h
 +++ b/arch/arm/include/asm/arch-at91/at91_matrix.h
 @@ -113,4 +113,142 @@ typedef struct at91_matrix {
  
  #define AT91_MATRIX_CSA_EBI1_CS2A0x0008
  
 +#if defined(CONFIG_AT91SAM9261)
 +/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
 +#define  AT91_MATRIX_MCFG_RCB0   (1  0)

A space after #define is preferred to a 'tab'
Fix globally

 +/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
 +#define  AT91_MATRIX_MCFG_RCB1   (1  1)
 +#endif
 +
 +/* Undefined Length Burst Type */
 +#if defiled(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263) || \

'defiled' is a typo
Fix globally

Running MAKEALL arm will find this type of error.

Tom

 + defined(CONFIG_AT91SAM9G45)
 +#define AT91_MATRIX_MCFG_ULBT_INFINITE   0x
 +#define AT91_MATRIX_MCFG_ULBT_SINGLE 0x0001
 +#define AT91_MATRIX_MCFG_ULBT_FOUR   0x0002
 +#define AT91_MATRIX_MCFG_ULBT_EIGHT  0x0003
 +#define AT91_MATRIX_MCFG_ULBT_SIXTEEN0x0004
 +#endif
 +#if defined(CONFIG_AT91SAM9G45)
 +#define AT91_MATRIX_MCFG_ULBT_THIRTYTWO  0x0005
 +#define AT91_MATRIX_MCFG_ULBT_SIXTYFOUR  0x0006
 +#define AT91_MATRIX_MCFG_ULBT_1280x0007
 +#endif
 +
 +/* Default Master Type */
 +#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_NONE   0x
 +#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_LAST   0x0001
 +#define AT91_MATRIX_SCFG_DEFMSTR_TYPE_FIXED  0x0002
 +
 +/* Fixed Index of Default Master */
 +#if defiled(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9263)
 +#define  AT91_MATRIX_SCFG_FIXED_DEFMSTR(x)   ((x  0xf)  18)
 +#elif defiled(CONFIG_AT91SAM9261) || defined(CONFIG_AT91SAM9260)
 +#define  AT91_MATRIX_SCFG_FIXED_DEFMSTR(x)   ((x  7)  18)
 +#endif
 +
 +/* Maximum Number of Allowed Cycles for a Burst */
 +#if defiled(CONFIG_AT91SAM9G45)
 +#define  AT91_MATRIX_SCFG_SLOT_CYCLE(x)  ((x  0x1ff)  0)
 +#elif defiled(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263) || \
 + defined(CONFIG_AT91SAM9G45)
 +#define  AT91_MATRIX_SCFG_SLOT_CYCLE(x)  ((x  0xff)  0)
 +#endif
 +
 +/* Arbitration Type */
 +#if defiled(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263)
 +#define  AT91_MATRIX_SCFG_ARBT_ROUND_ROBIN   0x
 +#define  AT91_MATRIX_SCFG_ARBT_FIXED_PRIORITY0x0100
 +#endif
 +
 +/* Master Remap Control Register */
 +#elif defiled(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9263) || \
 + defined(CONFIG_AT91SAM9G45)
 +/* Remap Command for AHB Master 0 (ARM926EJ-S Instruction Master) */
 +#define  AT91_MATRIX_MRCR_RCB0   (1  0)
 +/* Remap Command for AHB Master 1 (ARM926EJ-S Data Master) */
 +#define  AT91_MATRIX_MRCR_RCB1   (1  1)
 +#endif
 +#if defiled(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G45)
 +#define  AT91_MATRIX_MRCR_RCB2   0x0004
 +#define  AT91_MATRIX_MRCR_RCB3   0x0008
 +#define  AT91_MATRIX_MRCR_RCB4   0x0010
 +#define  AT91_MATRIX_MRCR_RCB5   0x0020
 +#define  AT91_MATRIX_MRCR_RCB6   0x0040
 +#define  AT91_MATRIX_MRCR_RCB7   0x0080
 +#define  AT91_MATRIX_MRCR_RCB8   0x0100
 +#endif
 +#if defiled(CONFIG_AT91SAM9G45)
 +#define  AT91_MATRIX_MRCR_RCB9   0x0200
 +#define  AT91_MATRIX_MRCR_RCB10  0x0400
 +#define  AT91_MATRIX_MRCR_RCB11  0x0800
 +#endif
 +
 +/* TCM Configuration Register */
 +#if defiled(CONFIG_AT91SAM9G45)
 +/* Size of ITCM enabled memory block */
 +#define  AT91_MATRIX_TCMR_ITCM_0 0x
 +#define  AT91_MATRIX_TCMR_ITCM_320x0040
 +/* Size of DTCM enabled memory block */
 +#define  AT91_MATRIX_TCMR_DTCM_0 0x
 +#define  AT91_MATRIX_TCMR_DTCM_320x0060
 +#define  AT91_MATRIX_TCMR_DTCM_640x0070
 +/* Wait state TCM register */
 +#define  AT91_MATRIX_TCMR_TCM_NO_WS  0x
 +#define  AT91_MATRIX_TCMR_TCM_ONE_WS 0x0800
 +#endif
 +#if defiled(CONFIG_AT91SAM9263)
 +/* Size of ITCM enabled memory block */
 +#define  AT91_MATRIX_TCMR_ITCM_0 0x
 +#define  AT91_MATRIX_TCMR_ITCM_160x0005
 +#define  AT91_MATRIX_TCMR_ITCM_320x0006
 +/* Size of DTCM enabled memory block */
 +#define  AT91_MATRIX_TCMR_DTCM_0 0x
 +#define  AT91_MATRIX_TCMR_DTCM_160x0050
 +#define  AT91_MATRIX_TCMR_DTCM_320x0060
 +#endif
 +#if defiled(CONFIG_AT91SAM9261)
 +/* Size of ITCM enabled memory block */
 +#define  AT91_MATRIX_TCMR_ITCM_0 0x
 +#define  AT91_MATRIX_TCMR_ITCM_160x0005
 +#define  

Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread ogara

Rick,
I have custom board with DRAM starting at 0x - 0x2000 so I could
not load it to 0x8000 since I do not have that much memory. I noticed in
your report that the load address is 0x8000 but the kernel image was
built with:
Load Address: 80008000
Entry Point:  80008000.
I was wondering what does your bootm command line looks like and if yours
bootargs look like mine?
Ogi


Rick Ball wrote:
 
 I think you want to load the kernel to memory at 0x, even though
 the u-boot load address is set to 0x8000 - my kernel, which I load to
 memory at 0x8000 because that's where my SDRAM is, looks like this:
 
 Load address: 0x8000
 Loading: #
  #
  #
  #
  #
  #
  ##
 done
 Bytes transferred = 2128612 (207ae4 hex)
 ## Booting kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.29-rc3-omap1
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:2128548 Bytes =  2 MB
Load Address: 80008000
Entry Point:  80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 Uncompressing
 Linux...
 done, booting the kernel. 
 
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of Marek Vasut
 Sent: Wednesday, April 28, 2010 2:35 PM
 To: u-boot@lists.denx.de
 Cc: ogara
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and 
 created uImage. I bring the image over tftp into the memory and then 
 execute bootm memaddress. Unfortunately here is the output from my
 command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending 
 through gateway ipaddress Filename 'uImage'.
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex) bootm 0x8000 ## Booting 
 kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3131956 Bytes =  3 MB
Load Address: 8000
Entry Point:  8000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 undefined instruction
 pc : [8008]  lr : [00647d1c]
 sp : 005ffce8  ip : 08e0 fp : 06fc
 r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
 r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
 r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32 Resetting CPU ...
 
 Now, the image is good for sure because I do not have issues bringing 
 this image from the hard drive. Do I need anything else (ftd or 
 ramdisc) to boot from RAM or the procedure presented is correct?
 my bootargs are:
 bootargs=console ttyS0,115200 root /dev/ram rw
 
 Thank you for your help,
 Ogi
 
 Hi, the image is probably corrupted ? Also, why do you load it to 0x8000 ?
 It's relocated anyway, but this way it has to be relocated twice)
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 

-- 
View this message in context: 
http://old.nabble.com/trying-to-bring-linux-2.6.32.3-from-RAM--tp28392641p28393589.html
Sent from the Uboot - Users mailing list archive at Nabble.com.

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


Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread Rick Ball
Yes, but I think you need to load at address 0 instead of 0x8000, just like I 
load at 0x8000 instead of 0x80008000.  My kernel is also compiled to start 
at an offset of 0x8000, just like yours, but I think the image has 0x8000 of 
reserved space at the beginning (so you load it to 0, but it starts executing 
at 0x8000).

I don't think the bootargs are even coming into play - you're executing a bad 
instruction at 0x8008 because you loaded the kernel at 0x8000 instead of 0 (so 
you're trying to execute the uninitialized reserved space). 

Try changing your tftp command to load at 0 instead of 0x8000, and I think it 
should boot.

Rick

-Original Message-
From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On 
Behalf Of ogara
Sent: Wednesday, April 28, 2010 3:26 PM
To: u-boot@lists.denx.de
Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?


Rick,
I have custom board with DRAM starting at 0x - 0x2000 so I could 
not load it to 0x8000 since I do not have that much memory. I noticed in 
your report that the load address is 0x8000 but the kernel image was built 
with:
Load Address: 80008000
Entry Point:  80008000.
I was wondering what does your bootm command line looks like and if yours 
bootargs look like mine?
Ogi


Rick Ball wrote:
 
 I think you want to load the kernel to memory at 0x, even 
 though the u-boot load address is set to 0x8000 - my kernel, which I 
 load to memory at 0x8000 because that's where my SDRAM is, looks like 
 this:
 
 Load address: 0x8000
 Loading: #
  #
  #
  #
  #
  #
  ##
 done
 Bytes transferred = 2128612 (207ae4 hex) ## Booting kernel from Legacy 
 Image at 8000 ...
Image Name:   Linux-2.6.29-rc3-omap1
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:2128548 Bytes =  2 MB
Load Address: 80008000
Entry Point:  80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 Uncompressing
 Linux...
 done, booting the kernel. 
 
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of Marek Vasut
 Sent: Wednesday, April 28, 2010 2:35 PM
 To: u-boot@lists.denx.de
 Cc: ogara
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and 
 created uImage. I bring the image over tftp into the memory and then 
 execute bootm memaddress. Unfortunately here is the output from my 
 command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending 
 through gateway ipaddress Filename 'uImage'.
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex) bootm 0x8000 ## Booting 
 kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3131956 Bytes =  3 MB
Load Address: 8000
Entry Point:  8000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 undefined instruction
 pc : [8008]  lr : [00647d1c]
 sp : 005ffce8  ip : 08e0 fp : 06fc
 r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
 r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
 r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32 Resetting CPU ...
 
 Now, the image is good for sure because I do not have issues bringing 
 this image from the hard drive. Do I need anything else (ftd or
 ramdisc) to boot from RAM or the procedure presented is correct?
 my bootargs are:
 bootargs=console ttyS0,115200 root /dev/ram rw
 
 Thank you for your help,
 Ogi
 
 Hi, the image is probably corrupted ? Also, why do you load it to 0x8000 ?
 It's relocated anyway, but this way it has to be relocated twice) 
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 

Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread ogara

I understand your point. My memory alignment was off. So now I get:
## Booting kernel from Legacy Image at  ...

   Image Name:   Linux-2.6.32.3
   Created:  2010-04-28  18:44:34 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:3131956 Bytes =  3 MB
   Load Address: 8000
   Entry Point:  8000
   Verifying Checksum ... OK
ERROR: can't get kernel image!

As I said before this file works of hard drive no problem (I just did binary
comparison and file matches).



Rick Ball wrote:
 
 Yes, but I think you need to load at address 0 instead of 0x8000, just
 like I load at 0x8000 instead of 0x80008000.  My kernel is also
 compiled to start at an offset of 0x8000, just like yours, but I think the
 image has 0x8000 of reserved space at the beginning (so you load it to 0,
 but it starts executing at 0x8000).
 
 I don't think the bootargs are even coming into play - you're executing a
 bad instruction at 0x8008 because you loaded the kernel at 0x8000 instead
 of 0 (so you're trying to execute the uninitialized reserved space). 
 
 Try changing your tftp command to load at 0 instead of 0x8000, and I think
 it should boot.
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of ogara
 Sent: Wednesday, April 28, 2010 3:26 PM
 To: u-boot@lists.denx.de
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 
 Rick,
 I have custom board with DRAM starting at 0x - 0x2000 so I
 could not load it to 0x8000 since I do not have that much memory. I
 noticed in your report that the load address is 0x8000 but the kernel
 image was built with:
 Load Address: 80008000
 Entry Point:  80008000.
 I was wondering what does your bootm command line looks like and if yours
 bootargs look like mine?
 Ogi
 
 
 Rick Ball wrote:
 
 I think you want to load the kernel to memory at 0x, even 
 though the u-boot load address is set to 0x8000 - my kernel, which I 
 load to memory at 0x8000 because that's where my SDRAM is, looks like
 this:
 
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
 
 #
 
 #
 
 #
  ##
 done
 Bytes transferred = 2128612 (207ae4 hex) ## Booting kernel from Legacy 
 Image at 8000 ...
Image Name:   Linux-2.6.29-rc3-omap1
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:2128548 Bytes =  2 MB
Load Address: 80008000
Entry Point:  80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 Uncompressing
 Linux...
 done, booting the kernel. 
 
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of Marek Vasut
 Sent: Wednesday, April 28, 2010 2:35 PM
 To: u-boot@lists.denx.de
 Cc: ogara
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and 
 created uImage. I bring the image over tftp into the memory and then 
 execute bootm memaddress. Unfortunately here is the output from my 
 command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending 
 through gateway ipaddress Filename 'uImage'.
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex) bootm 0x8000 ## Booting 
 kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:3131956 Bytes =  3 MB
Load Address: 8000
Entry Point:  8000
Verifying Checksum ... OK
XIP Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 undefined instruction
 pc : [8008]  lr : [00647d1c]
 sp : 005ffce8  ip : 08e0 fp : 06fc
 r10: 00724db0  r9 : 005fff90 r8 : 005fffcc
 r7 : 0002  r6 : 0072372d r5 : 0154  r4 : 
 r3 : 8000  r2 : 0100 r1 : 06fc  r0 : 0001c200
 Flags: nZCv  IRQs off  FIQs off  Mode SVC_32 Resetting CPU ...
 
 

Re: [U-Boot] [PATCH v2] powerpc: Consolidate bootcount_{store|load} for PowerPC

2010-04-28 Thread Kim Phillips
On Wed, 28 Apr 2010 10:47:36 +0200
Stefan Roese s...@denx.de wrote:

 This patch consolidates bootcount_{store|load} for PowerPC by
 implementing a common version in arch/powerpc/lib/bootcount.c. This
 code is now used by all PowerPC variants that currently have these
 functions implemented.
 
 The functions now use the proper IO-accessor functions to read/write the
 values.
 
 This code also supports two different bootcount versions:
 
 a) Use 2 seperate words (2 * 32bit) to store the bootcounter
 b) Use only 1 word (2 * 16bit) to store the bootcounter
 
 Version b) was already used by MPC5xxx.
 
 Signed-off-by: Stefan Roese s...@denx.de
 Acked-by: Detlev Zundel d...@denx.de
 Cc: Michael Zaidman michael.zaid...@gmail.com
 Cc: Wolfgang Denk w...@denx.de
 Cc: Kim Phillips kim.phill...@freescale.com
 Cc: Anatolij Gustschin ag...@denx.de
 ---

83xx bits Acked-by: Kim Phillips kim.phill...@freescale.com

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


Re: [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Kim Phillips
On Wed, 28 Apr 2010 10:48:44 -0700
Ron Madrid ron_mad...@sbcglobal.net wrote:

 + volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
 + volatile fsl_lbus_t *lbus = immap-lbus;
 + volatile u32 *mxmr = lbus-mamr;   /* Pointer to mamr */

no volatiles...

 + /* Set LUPWAIT to be active low and enabled */
 + *mxmr = 0x0800 | MxMR_GPL_x4DIS;

...because we should now be using i/o accessors.  Also, let's add a
MxMR_UWPL in fsl_lbc.h please (can be in same patch).

 +#define CONFIG_SYS_BR1_PRELIM( 0xFF00/* FPGA Base 
 Addr */ \
 + | BR_PS_16 \
 + | BR_MS_UPMA \
 + | BR_V )
 +#define CONFIG_SYS_OR1_PRELIM( 0xFFE0/* length 2MB 
 */ \

OR_AM_2MB (and therefore drop the comment).

 + | OR_UPM_BCTLD)
 +
 +#define CONFIG_SYS_LBLAWBAR1_PRELIM  0xFF00  /* FPGA Base Addr */

if FPGA base address becomes a recurring reference, best to name it
something like CONFIG_SYS_FPGA_BASE.

 +#define CONFIG_SYS_LBLAWAR1_PRELIM   0x8014  /* 2MB */

(LBLAWAR_EN | LBLAWAR_2MB)

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


Re: [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Ron Madrid
  +/* Set LUPWAIT to be active low
 and enabled */
  +*mxmr = 0x0800 |
 MxMR_GPL_x4DIS;
 
 ...because we should now be using i/o accessors. 

Not entirely sure what you mean here.  Should I be
using __raw_writel, or writel, or ...?

Thanks.

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


Re: [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Kim Phillips
On Wed, 28 Apr 2010 15:18:36 -0700
Ron Madrid ron_mad...@sbcglobal.net wrote:

   +/* Set LUPWAIT to be active low
  and enabled */
   +*mxmr = 0x0800 |
  MxMR_GPL_x4DIS;
  
  ...because we should now be using i/o accessors. 
 
 Not entirely sure what you mean here.  Should I be
 using __raw_writel, or writel, or ...?

out_be32 (or even setbits_be32) looks appropriate here.  The raw
accessors can be used as an alternative when performance and/or code
density issues arise.

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


Re: [U-Boot] [PATCH] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Ron Madrid
 out_be32 (or even setbits_be32) looks appropriate
 here.  The raw
 accessors can be used as an alternative when performance
 and/or code
 density issues arise.

Thanks for the clarification!

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


[U-Boot] [PATCH][v2] mpc83xx: Add UPMA configuration to SIMPC8313

2010-04-28 Thread Ron Madrid
Added UPM array table, upmconfig, and Local Bus configuration support for 
SIMPC8313

Signed-off-by: Ron Madrid ron_mad...@sbcglobal.net
---
 arch/powerpc/include/asm/fsl_lbc.h  |1 +
 board/sheldon/simpc8313/simpc8313.c |   35 +++
 include/configs/SIMPC8313.h |   11 +++
 3 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/fsl_lbc.h 
b/arch/powerpc/include/asm/fsl_lbc.h
index dfe8f79..03ae6a7 100644
--- a/arch/powerpc/include/asm/fsl_lbc.h
+++ b/arch/powerpc/include/asm/fsl_lbc.h
@@ -245,6 +245,7 @@
 #define MxMR_DSx_4_CYCL0x00c0 /* 4 cycle Disable Period
   */
 #define MxMR_DSx_MSK   0x00c0 /* Disable Timer Period Mask*/
 #define MxMR_AMx_MSK   0x0700 /* Addess Multiplex Size Mask   */
+#define MxMR_UWPL  0x0800 /* LUPWAIT Polarity Mask*/
 #define MxMR_OP_NORM   0x /* Normal Operation */
 #define MxMR_OP_WARR   0x1000 /* Write to Array   */
 #define MxMR_OP_RARR   0x2000 /* Read from Array  */
diff --git a/board/sheldon/simpc8313/simpc8313.c 
b/board/sheldon/simpc8313/simpc8313.c
index 1044de2..64bae34 100644
--- a/board/sheldon/simpc8313/simpc8313.c
+++ b/board/sheldon/simpc8313/simpc8313.c
@@ -29,6 +29,7 @@
 #include mpc83xx.h
 #include ns16550.h
 #include nand.h
+#include asm/io.h
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -91,6 +92,40 @@ void pci_init_board(void)
 int misc_init_r(void)
 {
int rc = 0;
+   immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
+   fsl_lbus_t *lbus = immap-lbus;
+   u32 *mxmr = lbus-mamr;/* Pointer to mamr */
+
+   /* UPM Table Configuration Code */
+   static uint UPMATable[] = {
+   /* Read Single-Beat (RSS) */
+   0x0fff0c00, 0x0fffdc00, 0x0fff0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Read Burst (RBS) */
+   0x0fff0c00, 0x0ffcdc00, 0x0ffc0c00, 0x0ffc0f0c,
+   0x0ffccf0c, 0x0ffc0f0c, 0x0ffcce0c, 0x3ffc0c05,
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Write Single-Beat (WSS) */
+   0x0ffc0c00, 0x0ffcdc00, 0x0ffc0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Write Burst (WBS) */
+   0x0ffc0c00, 0x0fffcc0c, 0x0fff0c00, 0x0fffcc00,
+   0x0fff1c00, 0x0fffcf0c, 0x0fff0f0c, 0x0fffcf0c,
+   0x0fff0c0c, 0x0fffcc0c, 0x0fff0c05, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Refresh Timer (RTS) */
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc00,
+   0xfc00, 0xfc00, 0xfc00, 0xfc01,
+   /* Exception Condition (EXS) */
+   0xfc00, 0xfc00, 0xfc00, 0xfc01
+   };
+
+   upmconfig(UPMA, UPMATable, sizeof(UPMATable) / sizeof(UPMATable[0]));
+
+   /* Set LUPWAIT to be active low and enabled */
+   out_be32(mxmr, MxMR_UWPL | MxMR_GPL_x4DIS);
 
return rc;
 }
diff --git a/include/configs/SIMPC8313.h b/include/configs/SIMPC8313.h
index 84af8df..1a17323 100644
--- a/include/configs/SIMPC8313.h
+++ b/include/configs/SIMPC8313.h
@@ -126,6 +126,7 @@
 #else
 #define CONFIG_SYS_NAND_BASE   0xE280
 #endif
+#define CONFIG_SYS_FPGA_BASE   0xFF00
 
 #define CONFIG_SYS_MAX_NAND_DEVICE 1
 #define NAND_MAX_CHIPS 1
@@ -184,6 +185,16 @@
 #define CONFIG_SYS_NAND_LBLAWBAR_PRELIMCONFIG_SYS_LBLAWBAR0_PRELIM
 #define CONFIG_SYS_NAND_LBLAWAR_PRELIM CONFIG_SYS_LBLAWAR0_PRELIM
 
+#define CONFIG_SYS_BR1_PRELIM  ( CONFIG_SYS_FPGA_BASE \
+   | BR_PS_16 \
+   | BR_MS_UPMA \
+   | BR_V )
+#define CONFIG_SYS_OR1_PRELIM  ( OR_AM_2MB \
+   | OR_UPM_BCTLD)
+
+#define CONFIG_SYS_LBLAWBAR1_PRELIMCONFIG_SYS_FPGA_BASE
+#define CONFIG_SYS_LBLAWAR1_PRELIM (LBLAWAR_EN | LBLAWAR_2MB)
+
 /*
  * JFFS2 configuration
  */
-- 
1.5.5.1

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


[U-Boot] [PATCH] Blackfin: TWI/I2C: implement multibus support

2010-04-28 Thread Mike Frysinger
Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 drivers/i2c/bfin-twi_i2c.c |  169 
 1 files changed, 108 insertions(+), 61 deletions(-)

diff --git a/drivers/i2c/bfin-twi_i2c.c b/drivers/i2c/bfin-twi_i2c.c
index 73a78d2..b3a04d3 100644
--- a/drivers/i2c/bfin-twi_i2c.c
+++ b/drivers/i2c/bfin-twi_i2c.c
@@ -1,7 +1,7 @@
 /*
  * i2c.c - driver for Blackfin on-chip TWI/I2C
  *
- * Copyright (c) 2006-2008 Analog Devices Inc.
+ * Copyright (c) 2006-2010 Analog Devices Inc.
  *
  * Licensed under the GPL-2 or later.
  */
@@ -12,6 +12,35 @@
 #include asm/blackfin.h
 #include asm/mach-common/bits/twi.h
 
+/* Every register is 32bit aligned, but only 16bits in size */
+#define ureg(name) u16 name; u16 __pad_##name;
+struct twi_regs {
+   ureg(clkdiv);
+   ureg(control);
+   ureg(slave_ctl);
+   ureg(slave_stat);
+   ureg(slave_addr);
+   ureg(master_ctl);
+   ureg(master_stat);
+   ureg(master_addr);
+   ureg(int_stat);
+   ureg(int_mask);
+   ureg(fifo_ctl);
+   ureg(fifo_stat);
+   char __pad[0x50];
+   ureg(xmt_data8);
+   ureg(xmt_data16);
+   ureg(rcv_data8);
+   ureg(rcv_data16);
+};
+#undef ureg
+
+/* U-Boot I2C framework allows only one active device at a time.  */
+#ifdef TWI_CLKDIV
+#define TWI0_CLKDIV TWI_CLKDIV
+#endif
+static volatile struct twi_regs *twi = (void *)TWI0_CLKDIV;
+
 #ifdef DEBUG
 # define dmemset(s, c, n) memset(s, c, n)
 #else
@@ -19,29 +48,10 @@
 #endif
 #define debugi(fmt, args...) \
debug( \
-   MSTAT:0x%03x FSTAT:0x%x ISTAT:0x%02x\t \
-   %-20s:%-3i:  fmt \n, \
-   bfin_read_TWI_MASTER_STAT(), bfin_read_TWI_FIFO_STAT(), 
bfin_read_TWI_INT_STAT(), \
+   MSTAT:0x%03x FSTAT:0x%x ISTAT:0x%02x\t%-20s:%-3i:  fmt \n, \
+   twi-master_stat, twi-fifo_stat, twi-int_stat, \
__func__, __LINE__, ## args)
 
-#ifdef TWI0_CLKDIV
-#define bfin_write_TWI_CLKDIV(val)   bfin_write_TWI0_CLKDIV(val)
-#define bfin_read_TWI_CLKDIV(val)bfin_read_TWI0_CLKDIV(val)
-#define bfin_write_TWI_CONTROL(val)  bfin_write_TWI0_CONTROL(val)
-#define bfin_read_TWI_CONTROL(val)   bfin_read_TWI0_CONTROL(val)
-#define bfin_write_TWI_MASTER_ADDR(val)  bfin_write_TWI0_MASTER_ADDR(val)
-#define bfin_write_TWI_XMT_DATA8(val)bfin_write_TWI0_XMT_DATA8(val)
-#define bfin_read_TWI_RCV_DATA8()bfin_read_TWI0_RCV_DATA8()
-#define bfin_read_TWI_INT_STAT() bfin_read_TWI0_INT_STAT()
-#define bfin_write_TWI_INT_STAT(val) bfin_write_TWI0_INT_STAT(val)
-#define bfin_read_TWI_MASTER_STAT()  bfin_read_TWI0_MASTER_STAT()
-#define bfin_write_TWI_MASTER_STAT(val)  bfin_write_TWI0_MASTER_STAT(val)
-#define bfin_read_TWI_MASTER_CTL()   bfin_read_TWI0_MASTER_CTL()
-#define bfin_write_TWI_MASTER_CTL(val)   bfin_write_TWI0_MASTER_CTL(val)
-#define bfin_write_TWI_INT_MASK(val) bfin_write_TWI0_INT_MASK(val)
-#define bfin_write_TWI_FIFO_CTL(val) bfin_write_TWI0_FIFO_CTL(val)
-#endif
-
 #ifdef CONFIG_TWICLK_KHZ
 # error do not define CONFIG_TWICLK_KHZ ... use CONFIG_SYS_I2C_SPEED
 #endif
@@ -87,49 +97,48 @@ static int wait_for_completion(struct i2c_msg *msg)
ulong timebase = get_timer(0);
 
do {
-   int_stat = bfin_read_TWI_INT_STAT();
+   int_stat = twi-int_stat;
 
if (int_stat  XMTSERV) {
debugi(processing XMTSERV);
-   bfin_write_TWI_INT_STAT(XMTSERV);
+   twi-int_stat = XMTSERV;
SSYNC();
if (msg-alen) {
-   bfin_write_TWI_XMT_DATA8(*(msg-abuf++));
+   twi-xmt_data8 = *(msg-abuf++);
--msg-alen;
} else if (!(msg-flags  I2C_M_COMBO)  msg-len) {
-   bfin_write_TWI_XMT_DATA8(*(msg-buf++));
+   twi-xmt_data8 = *(msg-buf++);
--msg-len;
} else {
-   
bfin_write_TWI_MASTER_CTL(bfin_read_TWI_MASTER_CTL() |
-   (msg-flags  I2C_M_COMBO ? RSTART | 
MDIR : STOP));
+   twi-master_ctl |= (msg-flags  I2C_M_COMBO) ? 
RSTART | MDIR : STOP;
SSYNC();
}
}
if (int_stat  RCVSERV) {
debugi(processing RCVSERV);
-   bfin_write_TWI_INT_STAT(RCVSERV);
+   twi-int_stat = RCVSERV;
SSYNC();
if (msg-len) {
-   *(msg-buf++) = bfin_read_TWI_RCV_DATA8();
+   *(msg-buf++) = twi-rcv_data8;
--msg-len;
  

Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-28 Thread Marek Vasut
I rebased the branch ... Tom, please pull.
Thanks

The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
  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-pxa.git next

Marek Vasut (5):
  PXA: Align stack to 8 bytes
  PXA: PXAMMC: Drop different delays for PXA27X
  PXA: PXAMMC: Add Monahans support
  PXA: Add UP2OCR register bit definitions
  PXA: Add missing MDREFR bits

 arch/arm/cpu/pxa/start.S |5 -
 arch/arm/include/asm/arch-pxa/pxa-regs.h |   25 +
 drivers/mmc/pxa_mmc.c|   17 ++---
 3 files changed, 31 insertions(+), 16 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] PXA: Add helper macros

2010-04-28 Thread Marek Vasut
This patch adds macros for the following purposes:
- GPIO configuration
- SDRAM configuration
- Wakeup
These macros are intended to replace numerous copied of the same code.

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 arch/arm/include/asm/arch-pxa/macro.h |  325 +
 1 files changed, 325 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-pxa/macro.h

diff --git a/arch/arm/include/asm/arch-pxa/macro.h 
b/arch/arm/include/asm/arch-pxa/macro.h
new file mode 100644
index 000..cdc34e7
--- /dev/null
+++ b/arch/arm/include/asm/arch-pxa/macro.h
@@ -0,0 +1,325 @@
+/*
+ * arch/arm/include/asm/arch-pxa/macro.h
+ *
+ * Copyright (C) 2010 Marek Vasut marek.va...@gmail.com
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ASM_ARCH_PXA_MACRO_H__
+#define __ASM_ARCH_PXA_MACRO_H__
+#ifdef __ASSEMBLY__
+
+#include asm/macro.h
+#include asm/arch/pxa-regs.h
+
+/*
+ * This macro performs a 32bit write to a memory location and makes sure the
+ * write operation really happened by performing a read back.
+ *
+ * Clobbered regs: r4, r5
+ */
+.macro write32rb addr, data
+   ldr r4, =\addr
+   ldr r5, =\data
+   str r5, [r4]
+   ldr r5, [r4]
+.endm
+
+/*
+ * This macro waits according to OSCR incrementation
+ *
+ * Clobbered regs: r4, r5, r6
+ */
+.macro pxa_wait_ticks ticks
+   ldr r4, =OSCR
+   mov r5, #0
+   str r5, [r4]
+   ldr r5, =\ticks
+1:
+   ldr r6, [r4]
+   cmp r5, r6
+   bgt 1b
+.endm
+
+/*
+ * This macro sets up the GPIO pins of the PXA2xx/PXA3xx CPU
+ *
+ * Clobbered regs: r4, r5
+ */
+.macro pxa_gpio_setup
+   write32 GPSR0, CONFIG_SYS_GPSR0_VAL
+   write32 GPSR1, CONFIG_SYS_GPSR1_VAL
+   write32 GPSR2, CONFIG_SYS_GPSR2_VAL
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
+   write32 GPSR3, CONFIG_SYS_GPSR3_VAL
+#endif
+
+   write32 GPCR0, CONFIG_SYS_GPCR0_VAL
+   write32 GPCR1, CONFIG_SYS_GPCR1_VAL
+   write32 GPCR2, CONFIG_SYS_GPCR2_VAL
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
+   write32 GPCR3, CONFIG_SYS_GPCR3_VAL
+#endif
+
+   write32 GPDR0, CONFIG_SYS_GPDR0_VAL
+   write32 GPDR1, CONFIG_SYS_GPDR1_VAL
+   write32 GPDR2, CONFIG_SYS_GPDR2_VAL
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
+   write32 GPDR3, CONFIG_SYS_GPDR3_VAL
+#endif
+
+   write32 GAFR0_L, CONFIG_SYS_GAFR0_L_VAL
+   write32 GAFR0_U, CONFIG_SYS_GAFR0_U_VAL
+   write32 GAFR1_L, CONFIG_SYS_GAFR1_L_VAL
+   write32 GAFR1_U, CONFIG_SYS_GAFR1_U_VAL
+   write32 GAFR2_L, CONFIG_SYS_GAFR2_L_VAL
+   write32 GAFR2_U, CONFIG_SYS_GAFR2_U_VAL
+#if defined(CONFIG_PXA27X) || defined(CONFIG_CPU_MONAHANS)
+   write32 GAFR3_L, CONFIG_SYS_GAFR3_L_VAL
+   write32 GAFR3_U, CONFIG_SYS_GAFR3_U_VAL
+#endif
+
+   write32 PSSR, CONFIG_SYS_PSSR_VAL
+.endm
+
+/*
+ * This macro sets up the Memory controller of the PXA2xx CPU
+ *
+ * Clobbered regs: r3, r4, r5
+ */
+.macro pxa_mem_setup
+   /* This comes handy when setting MDREFR */
+   ldr r3, =MEMC_BASE
+
+   /*
+* 1) Initialize Asynchronous static memory controller
+*/
+
+   /* MSC0: nCS(0,1) */
+   write32rb   (MEMC_BASE + MSC0_OFFSET), CONFIG_SYS_MSC0_VAL
+   /* MSC1: nCS(2,3) */
+   write32rb   (MEMC_BASE + MSC1_OFFSET), CONFIG_SYS_MSC1_VAL
+   /* MSC2: nCS(4,5) */
+   write32rb   (MEMC_BASE + MSC2_OFFSET), CONFIG_SYS_MSC2_VAL
+
+   /*
+* 2) Initialize Card Interface
+*/
+
+   /* MECR: Memory Expansion Card Register */
+   write32rb   (MEMC_BASE + MECR_OFFSET), CONFIG_SYS_MECR_VAL
+   /* MCMEM0: Card Interface slot 0 timing */
+   write32rb   (MEMC_BASE + MCMEM0_OFFSET), CONFIG_SYS_MCMEM0_VAL
+   /* MCMEM1: Card Interface slot 1 timing */
+   write32rb   (MEMC_BASE + MCMEM1_OFFSET), CONFIG_SYS_MCMEM1_VAL
+   /* MCATT0: Card Interface Attribute Space Timing, slot 0 */
+   write32rb   (MEMC_BASE + MCATT0_OFFSET), CONFIG_SYS_MCATT0_VAL
+   /* MCATT1: Card Interface Attribute Space Timing, slot 1 */
+   write32rb   (MEMC_BASE + 

[U-Boot] [PATCH 2/2] PXA: ZipitZ2 support

2010-04-28 Thread Marek Vasut
This patch adds support for Aeronix Zipit Z2 handheld

Signed-off-by: Marek Vasut marek.va...@gmail.com
---
 Makefile  |3 +
 board/zipitz2/Makefile|   54 ++
 board/zipitz2/config.mk   |1 +
 board/zipitz2/lowlevel_init.S |   40 +++
 board/zipitz2/u-boot.lds  |   56 ++
 board/zipitz2/zipitz2.c   |   68 
 include/configs/zipitz2.h |  234 +
 7 files changed, 456 insertions(+), 0 deletions(-)
 create mode 100644 board/zipitz2/Makefile
 create mode 100644 board/zipitz2/config.mk
 create mode 100644 board/zipitz2/lowlevel_init.S
 create mode 100644 board/zipitz2/u-boot.lds
 create mode 100644 board/zipitz2/zipitz2.c
 create mode 100644 include/configs/zipitz2.h

diff --git a/Makefile b/Makefile
index 25e3b8c..b9f0616 100644
--- a/Makefile
+++ b/Makefile
@@ -3253,6 +3253,9 @@ xm250_config  :   unconfig
 xsengine_config :  unconfig
@$(MKCONFIG) $(@:_config=) arm pxa xsengine
 
+zipitz2_config :
+   @$(MKCONFIG) $(@:_config=) arm pxa zipitz2
+
 zylonite_config :
@$(MKCONFIG) $(@:_config=) arm pxa zylonite
 
diff --git a/board/zipitz2/Makefile b/board/zipitz2/Makefile
new file mode 100644
index 000..2673835
--- /dev/null
+++ b/board/zipitz2/Makefile
@@ -0,0 +1,54 @@
+
+#
+# Copyright (C) 2009
+# Marek Vasut marek.va...@gmail.com
+#
+# Heavily based on pxa255_idp platform
+#
+# 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  := zipitz2.o
+SOBJS  := lowlevel_init.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 $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/zipitz2/config.mk b/board/zipitz2/config.mk
new file mode 100644
index 000..1d650ac
--- /dev/null
+++ b/board/zipitz2/config.mk
@@ -0,0 +1 @@
+TEXT_BASE = 0xa100
diff --git a/board/zipitz2/lowlevel_init.S b/board/zipitz2/lowlevel_init.S
new file mode 100644
index 000..82a52e8
--- /dev/null
+++ b/board/zipitz2/lowlevel_init.S
@@ -0,0 +1,40 @@
+/*
+ * Aeronix Zipit Z2 Lowlevel Hardware Initialization
+ *
+ * Copyright (C) 2010 Marek Vasut marek.va...@gmail.com
+ *
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include config.h
+#include version.h
+#include asm/arch/pxa-regs.h
+#include asm/arch/macro.h
+
+.globl lowlevel_init
+lowlevel_init:
+   pxa_gpio_setup
+   pxa_wait_ticks  0x8000
+   pxa_mem_setup
+   pxa_wakeup
+   pxa_intr_setup
+   pxa_clock_setup
+
+   mov pc, lr
diff --git a/board/zipitz2/u-boot.lds b/board/zipitz2/u-boot.lds
new file mode 100644
index 000..fb4358b
--- /dev/null
+++ b/board/zipitz2/u-boot.lds
@@ -0,0 +1,56 @@
+/*
+ * (C) Copyright 2000-2005
+ * 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 

Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-28 Thread Marek Vasut
Dne Čt 29. dubna 2010 03:13:29 Marek Vasut napsal(a):
 I rebased the branch ... Tom, please pull.
 Thanks
 
 The following changes since commit
 3699c28e6d16b563629c285311a0ce62a2c4c5d0: 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-pxa.git next
 
 Marek Vasut (5):
   PXA: Align stack to 8 bytes
   PXA: PXAMMC: Drop different delays for PXA27X
   PXA: PXAMMC: Add Monahans support
   PXA: Add UP2OCR register bit definitions
   PXA: Add missing MDREFR bits
 
  arch/arm/cpu/pxa/start.S |5 -
  arch/arm/include/asm/arch-pxa/pxa-regs.h |   25 +
  drivers/mmc/pxa_mmc.c|   17 ++---
  3 files changed, 31 insertions(+), 16 deletions(-)

I fixed an issue (lower case letter instead of uppercase in ifdef, trivial 
change) in the UP2OCR patch and pushed it in ... hope it's fine. The pull 
request is the same.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [GIT PULL] Please pull u-boot-pxa/next

2010-04-28 Thread Wolfgang Denk
Dear Marek Vasut,

In message 201004290313.29496.marek.va...@gmail.com you wrote:
 I rebased the branch ... Tom, please pull.
 Thanks
 
 The following changes since commit 3699c28e6d16b563629c285311a0ce62a2c4c5d0:
   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-pxa.git next
 
 Marek Vasut (5):
   PXA: Align stack to 8 bytes

This one is a bug fix. Please let's add this to the current release.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There is a biblical analogy I'd like to draw here.   Casts are to C++
Programmers what the apple was to Eve. - Scott Douglas Meyers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] sf: move useful messages from debug to printf

2010-04-28 Thread Mike Frysinger
At the moment, the default SPI flash subsystem is quite terse.  Errors and
successes both result in a generic message.  So move the useful errors and
useful successes to printf output by default.

Signed-off-by: Mike Frysinger vap...@gentoo.org
---
 drivers/mtd/spi/atmel.c |2 +-
 drivers/mtd/spi/spansion.c  |4 ++--
 drivers/mtd/spi/spi_flash.c |4 ++--
 drivers/mtd/spi/sst.c   |4 ++--
 drivers/mtd/spi/stmicro.c   |4 ++--
 drivers/mtd/spi/winbond.c   |4 ++--
 6 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/mtd/spi/atmel.c b/drivers/mtd/spi/atmel.c
index 8306c00..f1f5975 100644
--- a/drivers/mtd/spi/atmel.c
+++ b/drivers/mtd/spi/atmel.c
@@ -540,7 +540,7 @@ struct spi_flash *spi_flash_probe_atmel(struct spi_slave 
*spi, u8 *idcode)
* params-blocks_per_sector
* params-nr_sectors;
 
-   debug(SF: Detected %s with page size %lu, total %u bytes\n,
+   printf(SF: Detected %s with page size %lu, total %u bytes\n,
params-name, page_size, asf-flash.size);
 
return asf-flash;
diff --git a/drivers/mtd/spi/spansion.c b/drivers/mtd/spi/spansion.c
index fdb7917..cd1f250 100644
--- a/drivers/mtd/spi/spansion.c
+++ b/drivers/mtd/spi/spansion.c
@@ -343,8 +343,8 @@ struct spi_flash *spi_flash_probe_spansion(struct spi_slave 
*spi, u8 *idcode)
spsn-flash.size = params-page_size * params-pages_per_sector
* params-nr_sectors;
 
-   debug(SF: Detected %s with page size %u, total %u bytes\n,
- params-name, params-page_size, spsn-flash.size);
+   printf(SF: Detected %s with page size %u, total %u bytes\n,
+  params-name, params-page_size, spsn-flash.size);
 
return spsn-flash;
 }
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index 612f819..bbb194e 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -106,7 +106,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
 
spi = spi_setup_slave(bus, cs, max_hz, spi_mode);
if (!spi) {
-   debug(SF: Failed to set up slave\n);
+   printf(SF: Failed to set up slave\n);
return NULL;
}
 
@@ -156,7 +156,7 @@ struct spi_flash *spi_flash_probe(unsigned int bus, 
unsigned int cs,
break;
 #endif
default:
-   debug(SF: Unsupported manufacturer %02X\n, idcode[0]);
+   printf(SF: Unsupported manufacturer %02X\n, idcode[0]);
flash = NULL;
break;
}
diff --git a/drivers/mtd/spi/sst.c b/drivers/mtd/spi/sst.c
index 50e9299..9d5ebef 100644
--- a/drivers/mtd/spi/sst.c
+++ b/drivers/mtd/spi/sst.c
@@ -364,8 +364,8 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode)
stm-flash.read = sst_read_fast;
stm-flash.size = SST_SECTOR_SIZE * params-nr_sectors;
 
-   debug(SF: Detected %s with page size %u, total %u bytes\n,
- params-name, SST_SECTOR_SIZE, stm-flash.size);
+   printf(SF: Detected %s with page size %u, total %u bytes\n,
+  params-name, SST_SECTOR_SIZE, stm-flash.size);
 
/* Flash powers up read-only, so clear BP# bits */
sst_unlock(stm-flash);
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index ae0d047..9b17b3e 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -344,8 +344,8 @@ struct spi_flash *spi_flash_probe_stmicro(struct spi_slave 
*spi, u8 * idcode)
stm-flash.size = params-page_size * params-pages_per_sector
* params-nr_sectors;
 
-   debug(SF: Detected %s with page size %u, total %u bytes\n,
- params-name, params-page_size, stm-flash.size);
+   printf(SF: Detected %s with page size %u, total %u bytes\n,
+  params-name, params-page_size, stm-flash.size);
 
return stm-flash;
 }
diff --git a/drivers/mtd/spi/winbond.c b/drivers/mtd/spi/winbond.c
index b8da923..09c4f1a 100644
--- a/drivers/mtd/spi/winbond.c
+++ b/drivers/mtd/spi/winbond.c
@@ -289,7 +289,7 @@ out:
 struct spi_flash *spi_flash_probe_winbond(struct spi_slave *spi, u8 *idcode)
 {
const struct winbond_spi_flash_params *params;
-   unsigned long page_size;
+   unsigned page_size;
struct winbond_spi_flash *stm;
unsigned int i;
 
@@ -325,7 +325,7 @@ struct spi_flash *spi_flash_probe_winbond(struct spi_slave 
*spi, u8 *idcode)
* params-sectors_per_block
* params-nr_blocks;
 
-   debug(SF: Detected %s with page size %u, total %u bytes\n,
+   printf(SF: Detected %s with page size %u, total %u bytes\n,
params-name, page_size, stm-flash.size);
 
return stm-flash;
-- 
1.7.0.4

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


Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?

2010-04-28 Thread Nikumbh, Raj (IE10)
The load address actually doesn't matter. You can tftp your uImage
anywhere in RAM and then just give a bootm command. It will get the
kernel and booting would happen fine. Though as I see in your bootargs
you don't define a filesystem so kernel might hang there.

Anyways you should be able to boot the kernel. Hope this helps.


-Original Message-
From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de]
On Behalf Of ogara
Sent: Thursday, April 29, 2010 2:49 AM
To: u-boot@lists.denx.de
Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?


I understand your point. My memory alignment was off. So now I get:
## Booting kernel from Legacy Image at  ...

   Image Name:   Linux-2.6.32.3
   Created:  2010-04-28  18:44:34 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:3131956 Bytes =  3 MB
   Load Address: 8000
   Entry Point:  8000
   Verifying Checksum ... OK
ERROR: can't get kernel image!

As I said before this file works of hard drive no problem (I just did
binary
comparison and file matches).



Rick Ball wrote:
 
 Yes, but I think you need to load at address 0 instead of 0x8000, just
 like I load at 0x8000 instead of 0x80008000.  My kernel is also
 compiled to start at an offset of 0x8000, just like yours, but I think
the
 image has 0x8000 of reserved space at the beginning (so you load it to
0,
 but it starts executing at 0x8000).
 
 I don't think the bootargs are even coming into play - you're
executing a
 bad instruction at 0x8008 because you loaded the kernel at 0x8000
instead
 of 0 (so you're trying to execute the uninitialized reserved space). 
 
 Try changing your tftp command to load at 0 instead of 0x8000, and I
think
 it should boot.
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de
[mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of ogara
 Sent: Wednesday, April 28, 2010 3:26 PM
 To: u-boot@lists.denx.de
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 
 Rick,
 I have custom board with DRAM starting at 0x - 0x2000 so I
 could not load it to 0x8000 since I do not have that much memory.
I
 noticed in your report that the load address is 0x8000 but the
kernel
 image was built with:
 Load Address: 80008000
 Entry Point:  80008000.
 I was wondering what does your bootm command line looks like and if
yours
 bootargs look like mine?
 Ogi
 
 
 Rick Ball wrote:
 
 I think you want to load the kernel to memory at 0x, even 
 though the u-boot load address is set to 0x8000 - my kernel, which I 
 load to memory at 0x8000 because that's where my SDRAM is, looks
like
 this:
 
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
 
 #
 
 #
 
 #
  ##
 done
 Bytes transferred = 2128612 (207ae4 hex) ## Booting kernel from
Legacy 
 Image at 8000 ...
Image Name:   Linux-2.6.29-rc3-omap1
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:2128548 Bytes =  2 MB
Load Address: 80008000
Entry Point:  80008000
Verifying Checksum ... OK
Loading Kernel Image ... OK
 OK
 
 Starting kernel ...
 
 Uncompressing

Linux...

 done, booting the kernel. 
 
 
 Rick
 
 -Original Message-
 From: u-boot-boun...@lists.denx.de 
 [mailto:u-boot-boun...@lists.denx.de]
 On Behalf Of Marek Vasut
 Sent: Wednesday, April 28, 2010 2:35 PM
 To: u-boot@lists.denx.de
 Cc: ogara
 Subject: Re: [U-Boot] trying to bring linux-2.6.32.3 from RAM?
 
 Dne St 28. dubna 2010 20:50:35 ogara napsal(a):
 Hi All,
 I am trying to bring linux from RAM. I have compiled the kernel and 
 created uImage. I bring the image over tftp into the memory and then

 execute bootm memaddress. Unfortunately here is the output from my 
 command line:
 
  tftp 0x8000 ipaddress:uImage
 Using egiga0 device
 TFTP from server ipaddress; our IP address is ipaddress; sending 
 through gateway ipaddress Filename 'uImage'.
 Load address: 0x8000
 Loading:
 #
 
 #
 
 #
  ###
 done
 Bytes transferred = 3132020 (2fca74 hex) bootm 0x8000 ## Booting 
 kernel from Legacy Image at 8000 ...
Image Name:   Linux-2.6.32.3
Created:  2010-04-28  18:44:34 UTC
Image 

Re: [U-Boot] [PATCH v5] mmc: add generic mmc spi driver

2010-04-28 Thread Thomas Chou
Hi Andy,

Thanks for you review.

On 04/28/2010 11:21 PM, Andy Fleming wrote:

 The crc7 lib func is merged from linux and used to compute mmc
 command checksum.
  
 This should probably be a separate patch.


OK.

 +
 +   do {
 +   mmc = find_mmc_device(++dev_num);
 +   } while (mmc  strcmp(mmc-name, MMC_SPI));
 +   if (!mmc) {
 +   printf(Create MMC Device\n);
 +   mmc = mmc_spi_init(CONFIG_MMC_SPI_BUS,
 +  CONFIG_MMC_SPI_CS,
 +  CONFIG_MMC_SPI_SPEED,
 +  CONFIG_MMC_SPI_MODE);
 +   if (!mmc) {
 +   printf(Failed to create MMC Device\n);
 +   return 1;
 +   }
 +   dev_num = mmc-block_dev.dev;
 +   }
  
 I'm not sure I understand the logic behind this code.  The arguments
 to the command should be used to either find the already-existing bus,
 or to create a new one.  Unless I'm misunderstanding, this searches
 for the first MMC_SPI bus, and if it finds it, uses that, otherwise it
 creates a new one with the values specified in the config file.  Then
 it parses the command and overwrites the old parameters for the bus
 with new ones?  Why?  My instinct would be to create a separate
 instance of an MMC_SPI bus for each bus and chip select.  My SPI is
 rusty, so maybe chip-select should be configurable on a use-by-use
 basis.

 Certainly the current code will only use at most one MMC_SPI bus even
 if more are created, which seems wrong.

Though more than one MMC_SPI device can be created for specific bus and 
cs by calling mmc_spi_init() within board_mmc_init() or cpu_mmc_init(). 
This command is used to change the spi bus and chip select on a 
use-by-use basis at run time, so one changeable mmc_spi device (the 
first one if we found) should be enough.



 +   cmdo[1] = 0x40 + cmdidx;
  
 Use a #define'd constant for 0x40.  Maybe do this:

 /* MMC SPI commands start with a start bit 0 and a transmit bit 1 */
 #define MMC_SPI_CMD(x) (0x40 | (x  0x3f))

 cmdo[1] = MMC_SPI_CMD(cmdidx);

OK. Will define macros for all the cmd, token and response.

 Why not check the CRC to make sure your data is correct?

OK. Will check CRC on data packet.


 +
 +static inline uint rswab(u8 *d)
  
 Did you mean swap, here?

It should be swap.

 Hmmm  I'm not entirely sure this is the way to go.  If I'm reading
 this correctly, this function is converting between the standard SD
 protocol, and the SPI version of the protocol.  It might be better to
 make mmc.c aware of which protocol it is using, so it a) doesn't issue
 commands that the SPI card doesn't understand, and b) can properly
 interpret responses.


I have avoided to touch the core mmc.c, so that I won't break other SD 
hosts by accident. Only minor translation of initialization commands and 
status mapping is enough to support SPI protocol.

 +   }
 +   if (data) {
 +   debug(%s:data %x %x %x\n, __func__,
 + data-flags, data-blocks, data-blocksize);
 +   if (data-flags == MMC_DATA_READ) {
 +   r1 = mmc_spi_readdata(mmc, data-dest,
 +   data-blocks, data-blocksize);
 +   } else if  (data-flags == MMC_DATA_WRITE) {
 +   if (cmdidx == MMC_CMD_WRITE_MULTIPLE_BLOCK)
 +   r1 = mmc_spi_writeblock(mmc, data-src,
 +   data-blocks, data-blocksize);
 +   else
 +   r1 = mmc_spi_writedata(mmc, data-src,
 +   data-blocks, data-blocksize);
 +   }
  
 Why not check r1 to make sure your writes actually succeeded?


OK. Will check data response.

 +
 +   mmc-voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
  
 Is this part of the SPI spec?  If so, this is fine, otherwise, we need
 to get the voltage information from the SPI bus, somehow.


There is no voltage capability from SPI bus. This assumes 3.3V 
interface. Should I include other voltage?


 +   mmc-f_max = speed;
 +   mmc-f_min = mmc-f_max  9;
  
 What's the logic behind f_min being f_max/512?


It yields f_min lower than 400KHz to meet the requirement for MMC.

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