Re: [U-Boot] uboot_porting_guide

2013-04-16 Thread Albert ARIBAUD
Hi Carmine,

On Mon, 15 Apr 2013 13:16:24 +0200, Carmine Garripoli
garripoli.carm...@gmail.com wrote:

 Hi everybody,
 I'm an electronics engineering student and i'm very passionated about 
 embedded systems. I would like to design my own totally custom board. 
 Supposing that i've already choosen an ARM microprocessor supported by 
 linux kernel, ram and nand flash and i've designed my board, i would 
 like to know if there is a generic guide for u-boot porting. I've 
 already done a search on the net for uboot porting guide but 99,9% of 
 material i found sounds like ...if your board is similar to another 
 already existing, use command  make boardname_config with 
 similar board etc. etc.
 Now does a general porting guide for uboot exist somewhere?

If you mean a step-by-step recipe starting from the ground up, no, you
won't find this I think. Really, the simplest and, in my experience,
most efficient method, is indeed to study how support for a similar
board was added.

I would suggest cloning the official git tree and then either looking
for commits that have add support to in their summary, or doing a 'git
log' on files specific to a given board; the oldest commit logged
should be the one where support for this board was added. These support
addition commits will show you which files were specifically modified
and added, which should give you a starting point for preparing your
own support patch.

This does not mean that you should start supporting every feature and
the (watch)dog, though! You should start simple, with only low level,
DRAM and console init; forget about USB, Ethernet, I2C etc unless they
are vital to booting.

Once you get a booting U-Boot and can enter commands at the console
prompt, and truly basic commands like md, mw, mtest work, then you can
add further functions like Flash support and from there, environment
storage and filesystems will follow; same goes for Ethernet and network
functions, etc.

 I really thank you for your answer

np

 Metalgarri

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


[U-Boot] [PATCH v3] powerpc/mpc85xx: set clock-frequency for T4/B4 clockgen node

2013-04-16 Thread Yuantian.Tang
From: Tang Yuantian yuantian.t...@freescale.com

For T4/B4, the clockgen node compatible string is updated to version 2.0.
Add clock-frequency setting for this new version.

Signed-off-by: Tang Yuantian yuantian.t...@freescale.com
---
v3:
- update the compatible string from *-2 to *-2.0
v2:
- fix the codestyle

 arch/powerpc/cpu/mpc85xx/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 24eb978..b1aafac 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -663,6 +663,8 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_FSL_CORENET
do_fixup_by_compat_u32(blob, fsl,qoriq-clockgen-1.0,
clock-frequency, CONFIG_SYS_CLK_FREQ, 1);
+   do_fixup_by_compat_u32(blob, fsl,qoriq-clockgen-2.0,
+   clock-frequency, CONFIG_SYS_CLK_FREQ, 1);
 #endif
 
fdt_fixup_memory(blob, (u64)bd-bi_memstart, (u64)bd-bi_memsize);
-- 
1.8.0


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


[U-Boot] [PATCH 4/4 v2] mtd: mxs_nand: Add support for i.MX6

2013-04-16 Thread Stefan Roese
Signed-off-by: Stefan Roese s...@denx.de
Acked-by: Scott Wood scottw...@freescale.com
Cc: Stefano Babic sba...@denx.de
Cc: Marek Vasut ma...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
---
v2:
- Changed tab to space after #ifdef

Scott, is it okay for you if Stefano pulls this patchset via his
ARM/imx repository? As it touches mainly ARM related bits and the
MTD driver change is quite small (I have added your Acked-by to this
patch version)?

Thanks,
Stefan

 arch/arm/cpu/armv7/mx6/soc.c   |  7 +++
 arch/arm/include/asm/imx-common/regs-bch.h | 10 ++
 drivers/mtd/nand/mxs_nand.c| 11 +--
 3 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 2ea8ca3..69b8487 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -30,6 +30,7 @@
 #include asm/arch/clock.h
 #include asm/arch/sys_proto.h
 #include asm/imx-common/boot_mode.h
+#include asm/imx-common/dma.h
 #include stdbool.h
 
 struct scu_regs {
@@ -151,6 +152,12 @@ int arch_cpu_init(void)
set_vddsoc(1200);   /* Set VDDSOC to 1.2V */
 
imx_set_wdog_powerdown(false); /* Disable PDE bit of WMCR register */
+
+#ifdef CONFIG_APBH_DMA
+   /* Start APBH DMA */
+   mxs_dma_init();
+#endif
+
return 0;
 }
 
diff --git a/arch/arm/include/asm/imx-common/regs-bch.h 
b/arch/arm/include/asm/imx-common/regs-bch.h
index 3a73de4..dbe7ac8 100644
--- a/arch/arm/include/asm/imx-common/regs-bch.h
+++ b/arch/arm/include/asm/imx-common/regs-bch.h
@@ -136,8 +136,13 @@ struct mxs_bch_regs {
 #defineBCH_FLASHLAYOUT0_NBLOCKS_OFFSET 24
 #defineBCH_FLASHLAYOUT0_META_SIZE_MASK (0xff  16)
 #defineBCH_FLASHLAYOUT0_META_SIZE_OFFSET   16
+#if defined(CONFIG_MX6)
+#defineBCH_FLASHLAYOUT0_ECC0_MASK  (0x1f  11)
+#defineBCH_FLASHLAYOUT0_ECC0_OFFSET11
+#else
 #defineBCH_FLASHLAYOUT0_ECC0_MASK  (0xf  12)
 #defineBCH_FLASHLAYOUT0_ECC0_OFFSET12
+#endif
 #defineBCH_FLASHLAYOUT0_ECC0_NONE  (0x0  12)
 #defineBCH_FLASHLAYOUT0_ECC0_ECC2  (0x1  12)
 #defineBCH_FLASHLAYOUT0_ECC0_ECC4  (0x2  12)
@@ -161,8 +166,13 @@ struct mxs_bch_regs {
 
 #defineBCH_FLASHLAYOUT1_PAGE_SIZE_MASK (0x  16)
 #defineBCH_FLASHLAYOUT1_PAGE_SIZE_OFFSET   16
+#if defined(CONFIG_MX6)
+#defineBCH_FLASHLAYOUT1_ECCN_MASK  (0x1f  11)
+#defineBCH_FLASHLAYOUT1_ECCN_OFFSET11
+#else
 #defineBCH_FLASHLAYOUT1_ECCN_MASK  (0xf  12)
 #defineBCH_FLASHLAYOUT1_ECCN_OFFSET12
+#endif
 #defineBCH_FLASHLAYOUT1_ECCN_NONE  (0x0  12)
 #defineBCH_FLASHLAYOUT1_ECCN_ECC2  (0x1  12)
 #defineBCH_FLASHLAYOUT1_ECCN_ECC4  (0x2  12)
diff --git a/drivers/mtd/nand/mxs_nand.c b/drivers/mtd/nand/mxs_nand.c
index c21fd69..398e4dd 100644
--- a/drivers/mtd/nand/mxs_nand.c
+++ b/drivers/mtd/nand/mxs_nand.c
@@ -42,6 +42,11 @@
 #defineMXS_NAND_DMA_DESCRIPTOR_COUNT   4
 
 #defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE  512
+#if defined(CONFIG_MX6)
+#defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT2
+#else
+#defineMXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT0
+#endif
 #defineMXS_NAND_METADATA_SIZE  10
 
 #defineMXS_NAND_COMMAND_BUFFER_SIZE32
@@ -982,14 +987,16 @@ static int mxs_nand_scan_bbt(struct mtd_info *mtd)
tmp |= MXS_NAND_METADATA_SIZE  BCH_FLASHLAYOUT0_META_SIZE_OFFSET;
tmp |= (mxs_nand_get_ecc_strength(mtd-writesize, mtd-oobsize)  1)
 BCH_FLASHLAYOUT0_ECC0_OFFSET;
-   tmp |= MXS_NAND_CHUNK_DATA_CHUNK_SIZE;
+   tmp |= MXS_NAND_CHUNK_DATA_CHUNK_SIZE
+MXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT;
writel(tmp, bch_regs-hw_bch_flash0layout0);
 
tmp = (mtd-writesize + mtd-oobsize)
 BCH_FLASHLAYOUT1_PAGE_SIZE_OFFSET;
tmp |= (mxs_nand_get_ecc_strength(mtd-writesize, mtd-oobsize)  1)
 BCH_FLASHLAYOUT1_ECCN_OFFSET;
-   tmp |= MXS_NAND_CHUNK_DATA_CHUNK_SIZE;
+   tmp |= MXS_NAND_CHUNK_DATA_CHUNK_SIZE
+MXS_NAND_CHUNK_DATA_CHUNK_SIZE_SHIFT;
writel(tmp, bch_regs-hw_bch_flash0layout1);
 
/* Set *all* chip selects to use layout 0 */
-- 
1.8.2.1

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


[U-Boot] [PATCH v3] imx: Add titanium board support (i.MX6 based)

2013-04-16 Thread Stefan Roese
Titanium is a i.MX6 based board from ProjectionDesign / Barco. This
patch adds support for this board with the newly introduced NAND
support for i.MX6.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
---
v3:
- Rebased on current master (ARM PR included, 2013.04-rc3)
- Removed get_board_revision()
- Fixed problem with MMC pad muxing in v2

v2:
- Fixed comment in imximage.imx
- Use only english comments
- Move include files to top of config header
- Remove unnecessary loop in board_mmc_init()
- Minor fixups
- No magic values used any more
- Increade NAND clock (GPMI IO) to 100MHz
- CONFIG_ARP_TIMEOUT removed as its not needed

 MAINTAINERS  |   2 +
 arch/arm/include/asm/arch-mx6/crm_regs.h |   7 +-
 board/freescale/titanium/Makefile|  36 
 board/freescale/titanium/imximage.cfg| 173 +++
 board/freescale/titanium/titanium.c  | 355 +++
 boards.cfg   |   1 +
 include/configs/titanium.h   | 278 
 7 files changed, 850 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/titanium/Makefile
 create mode 100644 board/freescale/titanium/imximage.cfg
 create mode 100644 board/freescale/titanium/titanium.c
 create mode 100644 include/configs/titanium.h

diff --git a/MAINTAINERS b/MAINTAINERS
index bbab5fe..fd595f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -877,6 +877,8 @@ Stefan Roese s...@denx.de
 
x600ARM926EJS (spear600 Soc)
 
+   titaniumi.MX6Q
+
pdnb3   xscale/ixp
scpuxscale/ixp
 
diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h 
b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 7676457..cf5c694 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -262,10 +262,13 @@ struct mxc_ccm_reg {
 /* Define the bits in register CS2CDR */
 #define MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK  (0x3F  21)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PODF_OFFSET21
+#define MXC_CCM_CS2CDR_ENFC_CLK_PODF(v)(((v)  0x3f) 
 21)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK  (0x7  18)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PRED_OFFSET18
+#define MXC_CCM_CS2CDR_ENFC_CLK_PRED(v)(((v)  0x7)  
18)
 #define MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK   (0x3  16)
 #define MXC_CCM_CS2CDR_ENFC_CLK_SEL_OFFSET 16
+#define MXC_CCM_CS2CDR_ENFC_CLK_SEL(v) (((v)  0x3)  16)
 #define MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK(0x7  12)
 #define MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET  12
 #define MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK(0x7  9)
@@ -415,8 +418,8 @@ struct mxc_ccm_reg {
 #define MXC_CCM_CCGR0_AIPS_TZ1_MASK
(3MXC_CCM_CCGR0_AIPS_TZ1_OFFSET)
 #define MXC_CCM_CCGR0_AIPS_TZ2_OFFSET  2
 #define MXC_CCM_CCGR0_AIPS_TZ2_MASK
(3MXC_CCM_CCGR0_AIPS_TZ2_OFFSET)
-#define MXC_CCM_CCGR0_APBHDMA HCLK_OFFSET  4
-#define MXC_CCM_CCGR0_AMASK
(3MXC_CCM_CCGR0_APBHDMA)
+#define MXC_CCM_CCGR0_APBHDMA_OFFSET   4
+#define MXC_CCM_CCGR0_APBHDMA_MASK 
(3MXC_CCM_CCGR0_APBHDMA_OFFSET)
 #define MXC_CCM_CCGR0_ASRC_OFFSET  6
 #define MXC_CCM_CCGR0_ASRC_MASK
(3MXC_CCM_CCGR0_ASRC_OFFSET)
 #define MXC_CCM_CCGR0_CAAM_SECURE_MEM_OFFSET   8
diff --git a/board/freescale/titanium/Makefile 
b/board/freescale/titanium/Makefile
new file mode 100644
index 000..46827f8
--- /dev/null
+++ b/board/freescale/titanium/Makefile
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de
+#
+# (C) Copyright 2011 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := titanium.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/titanium/imximage.cfg 
b/board/freescale/titanium/imximage.cfg
new file 

Re: [U-Boot] [PATCH v3] imx: Add titanium board support (i.MX6 based)

2013-04-16 Thread Stefano Babic
On 16/04/2013 09:19, Stefan Roese wrote:
 Titanium is a i.MX6 based board from ProjectionDesign / Barco. This
 patch adds support for this board with the newly introduced NAND
 support for i.MX6.
 

Hi Stefan.

 diff --git a/board/freescale/titanium/imximage.cfg 
 b/board/freescale/titanium/imximage.cfg
 new file mode 100644
 index 000..5661d58
 --- /dev/null
 +++ b/board/freescale/titanium/imximage.cfg
 @@ -0,0 +1,173 @@
 +/*
 + * Projectiondesign AS
 + * Derived from ./board/freescale/mx6qsabrelite/imximage.cfg
 + *
 + * Copyright (C) 2011 Freescale Semiconductor, Inc.
 + * Jason Liu r64...@freescale.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.
 + *
 + * Refer docs/README.imxmage for more details about how-to configure
 + * and create imximage boot image
 + *
 + * The syntax is taken as close as possible with the kwbimage
 + */
 +
 +/* image version */
 +
 +IMAGE_VERSION 2
 +
 +/*
 + * Boot Device : one of
 + * sd, nand
 + */
 +BOOT_FROM  nand
 +
 +/*
 + * Device Configuration Data (DCD)
 + *
 + * Each entry must have the format:
 + * Addr-type   AddressValue
 + *
 + * where:
 + *  Addr-type register length (1,2 or 4 bytes)
 + *  Address   absolute address of the register
 + *  value value to be stored in the register
 + */
 +DATA 4 0x020e05a8 0x0030
 +DATA 4 0x020e05b0 0x0030
 +DATA 4 0x020e0524 0x0030
 +DATA 4 0x020e051c 0x0030
 +

I know that this comes from Sabre, and this was done in this way.
Anyway, with the addition of the Boundary's board, this file is
preprocessed by the precompiler, allowing us to use macros and making
this configuration file something better as a blob of hexadecimal values.

Any chances to replace here the register addresses with their defined
macro (see for example board/boundary/nitrogen6x/800mhz_2x128mx16.cfg) ?


 +
 +static void setup_iomux_uart(void)
 +{
 + imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 + imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
 + imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
 +}
 +
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 + return 0;

It seems to me we have a problem (not here), but in general i.MX code.
If the board maintainer must implement an empty function, this function
should be declared __weak where it is called.

 +int board_mmc_init(bd_t *bis)
 +{
 + /*
 +  * Only one USDHC controller on titianium
 +  */
 + imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
 + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
 +
 + return fsl_esdhc_initialize(bis, usdhc_cfg[0]);
 +}
 +#endif
 +
 +int board_phy_config(struct phy_device *phydev)
 +{
 + /* min rx data delay */
 + ksz9021_phy_extended_write(phydev,
 +MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW, 0x0);
 + /* min tx data delay */
 + ksz9021_phy_extended_write(phydev,
 +MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW, 0x0);
 + /* max rx/tx clock delay, min rx/tx control */
 + ksz9021_phy_extended_write(phydev,
 +MII_KSZ9021_EXT_RGMII_CLOCK_SKEW, 0xf0f0);
 + if (phydev-drv-config)
 + phydev-drv-config(phydev);
 +
 + return 0;
 +}
 +
 +int board_eth_init(bd_t *bis)
 +{
 + int ret;
 +
 + setup_iomux_enet();
 +
 + ret = cpu_eth_init(bis);
 + if (ret)
 + printf(FEC MXC: %s:failed\n, __func__);
 +
 + return 0;
 +}
 +
 +int board_early_init_f(void)
 +{
 + setup_iomux_uart();
 +
 + return 0;
 +}
 +
 +/*
 + * Do not overwrite the console
 + * Use always serial for U-Boot console
 + */
 +int overwrite_console(void)
 +{
 + return 1;
 +}

Needed ? I have not seen CONFIG_VIDEO. Do you support a splashscreen ?


 +#define CONFIG_BOOTCOMMAND   run bootnfs

Is it ok as default value ?


Best regards,
Stefano


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

[U-Boot] [PATCH 1/5][v5] powerpc/mpc85xx:No NOR boot, do not compile IFC errata A003399

2013-04-16 Thread Prabhakar Kushwaha
IFC errata A003399 is valid for IFC NOR boot i.e.if no on-board NOR flash or
no NOR boot, do not compile its workaround.

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
 Based upon git://git.denx.de/u-boot.git branch master
 Changes for v2:
- Add CONFIG_A003399_NOR_WORKAROUND for errata workaround
- Add CONFIG_A003399_NOR_WORKAROUND in README
 Changes for v3:
- Use only CONFIG_A003399_NOR_WORKAROUND for errata workaround
 Changes for v4: Sending as it is
 Changes for v5: 
- Rebased
- Define CONFIG_A003399_NOR_WORKAROUND to take care git bisectability

 README|4 
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |6 +++---
 arch/powerpc/cpu/mpc8xxx/fsl_ifc.c|2 +-
 include/configs/P1010RDB.h|   11 +--
 4 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 0bc0af5..b946982 100644
--- a/README
+++ b/README
@@ -414,6 +414,10 @@ The following options need to be configured:
See Freescale App Note 4493 for more information about
this erratum.
 
+   CONFIG_A003399_NOR_WORKAROUND
+   Enables a workaround for IFC erratum A003399. It is only
+   requred during NOR boot.
+
CONFIG_SYS_FSL_CORENET_SNOOPVEC_COREONLY
 
This is the value to write into CCSR offset 0x18600
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
index dacfdd1..439a873 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -25,7 +25,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)  !defined(CONFIG_SYS_RAMBOOT)
+#ifdef CONFIG_A003399_NOR_WORKAROUND
 void setup_ifc(void)
 {
struct fsl_ifc *ifc_regs = (void *)CONFIG_SYS_IFC_ADDR;
@@ -99,7 +99,7 @@ void cpu_init_early_f(void)
 #ifdef CONFIG_SYS_FSL_ERRATUM_P1010_A003549
ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR);
 #endif
-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)  !defined(CONFIG_SYS_RAMBOOT)
+#ifdef CONFIG_A003399_NOR_WORKAROUND
ccsr_l2cache_t *l2cache = (void *)CONFIG_SYS_MPC85xx_L2_ADDR;
u32  *dst, *src;
void (*setup_ifc_sram)(void);
@@ -138,7 +138,7 @@ void cpu_init_early_f(void)
  * Work Around for IFC Erratum A003399, issue will hit only when execution
  * from NOR Flash
  */
-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)  !defined(CONFIG_SYS_RAMBOOT)
+#ifdef CONFIG_A003399_NOR_WORKAROUND
 #define SRAM_BASE_ADDR (0x)
/* TLB for SRAM */
mas0 = MAS0_TLBSEL(1) | MAS0_ESEL(9);
diff --git a/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c 
b/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c
index 56b319f..959a0e2 100644
--- a/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c
+++ b/arch/powerpc/cpu/mpc8xxx/fsl_ifc.c
@@ -43,7 +43,7 @@ void init_early_memctl_regs(void)
set_ifc_ftim(IFC_CS0, IFC_FTIM2, CONFIG_SYS_CS0_FTIM2);
set_ifc_ftim(IFC_CS0, IFC_FTIM3, CONFIG_SYS_CS0_FTIM3);
 
-#if !defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399) || defined(CONFIG_SYS_RAMBOOT)
+#ifndef CONFIG_A003399_NOR_WORKAROUND
 #ifdef CONFIG_SYS_CSPR0_EXT
set_ifc_cspr_ext(IFC_CS0, CONFIG_SYS_CSPR0_EXT);
 #endif
diff --git a/include/configs/P1010RDB.h b/include/configs/P1010RDB.h
index 437ee6e..d850666 100644
--- a/include/configs/P1010RDB.h
+++ b/include/configs/P1010RDB.h
@@ -31,10 +31,10 @@
 #define CONFIG_PHYS_64BIT
 #endif
 
-#ifdef CONFIG_P1010RDB
 #define CONFIG_P1010
+#define CONFIG_E500/* BOOKE e500 family */
+#include asm/config_mpc85xx.h
 #define CONFIG_NAND_FSL_IFC
-#endif
 
 #ifdef CONFIG_SDCARD
 #define CONFIG_RAMBOOT_SDCARD
@@ -428,6 +428,13 @@ extern unsigned long get_sdram_size(void);
 #undef CONFIG_SYS_RAMBOOT
 #endif
 
+#ifdef CONFIG_SYS_FSL_ERRATUM_IFC_A003399
+#if !defined(CONFIG_SPL)  !defined(CONFIG_SYS_RAMBOOT)\
+!defined(CONFIG_SECURE_BOOT)
+#define CONFIG_A003399_NOR_WORKAROUND
+#endif
+#endif
+
 #define CONFIG_BOARD_EARLY_INIT_F  /* Call board_pre_init */
 #define CONFIG_BOARD_EARLY_INIT_R
 
-- 
1.7.9.5



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


[U-Boot] [PATCH 2/5][v5] powerpc/mpc85xx: new SPL support for IFC NAND

2013-04-16 Thread Prabhakar Kushwaha
Linker script is not able find start.o binary. So add its absolute path in
u-boot-spl.lds. This change is similar to u-boot-nand.lds

common/Makefile: Avoid compiling unnecssary files

fsl_ifc_spl.c : It is is responsible for reading u-boot binary from
NAND flash and copying into DDR. It also transfer cotrol from NAND SPL
to u-boot image present in DDR.

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
 Changes for v2: Sending as it is
 Changes for v3: Fix tools/checkpatch errors
 Changes for v4: Sending as it is
 Changes for v5: Rebased

 arch/powerpc/cpu/mpc85xx/u-boot-spl.lds |2 +-
 board/freescale/common/Makefile |   10 ++
 drivers/mtd/nand/Makefile   |1 +
 drivers/mtd/nand/fsl_ifc_spl.c  |  258 +++
 4 files changed, 270 insertions(+), 1 deletion(-)
 create mode 100644 drivers/mtd/nand/fsl_ifc_spl.c

diff --git a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds 
b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
index f2b7bff..cf6fa7c 100644
--- a/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
+++ b/arch/powerpc/cpu/mpc85xx/u-boot-spl.lds
@@ -60,7 +60,7 @@ SECTIONS
 #if defined(CONFIG_FSL_IFC) /* Restrict bootpg at 4K boundry for IFC */
.bootpg ADDR(.text) + 0x1000 :
{
-   start.o (.bootpg)
+   arch/powerpc/cpu/mpc85xx/start.o (.bootpg)
}
 #define RESET_VECTOR_OFFSET 0x1ffc /* IFC has 8K sram */
 #elif defined(CONFIG_FSL_ELBC)
diff --git a/board/freescale/common/Makefile b/board/freescale/common/Makefile
index 75725b4..a4d521c 100644
--- a/board/freescale/common/Makefile
+++ b/board/freescale/common/Makefile
@@ -29,6 +29,15 @@ endif
 
 LIB= $(obj)libfreescale.o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifndef MINIMAL
 COBJS-$(CONFIG_FSL_CADMUS) += cadmus.o
 COBJS-$(CONFIG_FSL_VIA)+= cds_via.o
 COBJS-$(CONFIG_FMAN_ENET)  += fman.o
@@ -62,6 +71,7 @@ SUBLIB-$(CONFIG_P3041DS)  += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P4080DS)   += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5020DS)   += p_corenet/libp_corenet.o
 SUBLIB-$(CONFIG_P5040DS)   += p_corenet/libp_corenet.o
+endif
 
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index 35769c5..dd1df4a 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -81,6 +81,7 @@ COBJS-$(CONFIG_NAND_PLAT) += nand_plat.o
 else  # minimal SPL drivers
 
 COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_spl.o
+COBJS-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_spl.o
 COBJS-$(CONFIG_NAND_MXC) += mxc_nand_spl.o
 
 endif # drivers
diff --git a/drivers/mtd/nand/fsl_ifc_spl.c b/drivers/mtd/nand/fsl_ifc_spl.c
new file mode 100644
index 000..adfe7b1
--- /dev/null
+++ b/drivers/mtd/nand/fsl_ifc_spl.c
@@ -0,0 +1,258 @@
+/*
+ * NAND boot for Freescale Integrated Flash Controller, NAND FCM
+ *
+ * Copyright 2011 Freescale Semiconductor, Inc.
+ * Author: Dipen Dudhat dipen.dud...@freescale.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/io.h
+#include asm/fsl_ifc.h
+#include linux/mtd/nand.h
+
+static inline int is_blank(uchar *addr, int page_size)
+{
+   int i;
+
+   for (i = 0; i  page_size; i++) {
+   if (__raw_readb(addr[i]) != 0xff)
+   return 0;
+   }
+
+   /*
+* For the SPL, don't worry about uncorrectable errors
+* where the main area is all FFs but shouldn't be.
+*/
+   return 1;
+}
+
+/* returns nonzero if entire page is blank */
+static inline int check_read_ecc(uchar *buf, u32 *eccstat,
+unsigned int bufnum, int page_size)
+{
+   u32 reg = eccstat[bufnum / 4];
+   int errors = (reg  ((3 - bufnum % 4) * 8))  15;
+
+   if (errors == 15) { /* uncorrectable */
+   /* Blank pages fail hw ECC checks */
+   if (is_blank(buf, page_size))
+   return 1;
+
+   puts(ecc error\n);
+   for (;;)
+   ;
+   }
+
+   return 0;
+}
+
+static inline void nand_wait(uchar *buf, int bufnum, int page_size)
+{
+   struct fsl_ifc *ifc = IFC_BASE_ADDR;
+   u32 status;

[U-Boot] [v5] new SPL support for IFC based Feescale platforms

2013-04-16 Thread Prabhakar Kushwaha
This patch series ports existing Freescale's IFC based platforms/boards to
new SPL based architecture. It is done to support NAND boot.
It contains following patches:

 1. powerpc/mpc85xx:No NOR boot,do not compile IFC errata A003399

 2. powerpc/mpc85xx: new SPL support for IFC NAND

 3. board/p1010rdb:Add NAND boot support using new SPL format

 4. board/bsc9131rdb:Add NAND boot support using new SPL format

 5. board/bsc9132qds:Add NAND boot support using new SPL format


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


[U-Boot] [PATCH 3/5][v5] board/p1010rdb:Add NAND boot support using new SPL format

2013-04-16 Thread Prabhakar Kushwaha
  - defines contants
  - Add spl_minimal.c to initialise DDR
  - update TLB entries as per NAND boot
  - remove nand_spl support for P1010RDB

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
Based upon git://git.denx.de/u-boot.git branch master

 Changes for v2:
- Define CONFIG_A003399_NOR_WORKAROUND for NOR boot
 Changes for v3:
- Put CONFIG_A003399_NOR_WORKAROUND in 
CONFIG_SYS_FSL_ERRATUM_IFC_A003399
- Fix tools/checkpatch errors
 Changes for v4:
- Remove unused CONFIG_P1010RDB
 Changes for v5: 
- Rebased
- define CONFIG_SPL_MAX_SIZE as 8192 instead of 8 * 1204

 board/freescale/p1010rdb/Makefile  |   16 ++
 .../freescale/p1010rdb/spl_minimal.c   |   20 +-
 board/freescale/p1010rdb/tlb.c |   12 +-
 include/configs/P1010RDB.h |   66 ++---
 nand_spl/board/freescale/p1010rdb/Makefile |  142 --
 nand_spl/nand_boot_fsl_ifc.c   |  271 
 6 files changed, 69 insertions(+), 458 deletions(-)
 rename nand_spl/board/freescale/p1010rdb/nand_boot.c = 
board/freescale/p1010rdb/spl_minimal.c (95%)
 delete mode 100644 nand_spl/board/freescale/p1010rdb/Makefile
 delete mode 100644 nand_spl/nand_boot_fsl_ifc.c

diff --git a/board/freescale/p1010rdb/Makefile 
b/board/freescale/p1010rdb/Makefile
index 4c705b6..e6563be 100644
--- a/board/freescale/p1010rdb/Makefile
+++ b/board/freescale/p1010rdb/Makefile
@@ -24,11 +24,27 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifdef MINIMAL
+
+COBJS-y+= spl_minimal.o tlb.o law.o
+
+else
+
 COBJS-y+= $(BOARD).o
 COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 
+endif
+
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/nand_spl/board/freescale/p1010rdb/nand_boot.c 
b/board/freescale/p1010rdb/spl_minimal.c
similarity index 95%
rename from nand_spl/board/freescale/p1010rdb/nand_boot.c
rename to board/freescale/p1010rdb/spl_minimal.c
index 3c7bc2b..c909e0e 100644
--- a/nand_spl/board/freescale/p1010rdb/nand_boot.c
+++ b/board/freescale/p1010rdb/spl_minimal.c
@@ -31,11 +31,18 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-unsigned long ddr_freq_mhz;
 
 void sdram_init(void)
 {
ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+   u32 ddr_ratio;
+   unsigned long ddr_freq_mhz;
+
+   ddr_ratio = in_be32(gur-porpllsr)  MPC85xx_PORPLLSR_DDR_RATIO;
+   ddr_ratio = ddr_ratio  MPC85xx_PORPLLSR_DDR_RATIO_SHIFT;
+   ddr_freq_mhz = (CONFIG_SYS_CLK_FREQ * ddr_ratio) / 0x100;
+
/* mask off E bit */
u32 svr = SVR_SOC_VER(mfspr(SPRN_SVR));
 
@@ -81,6 +88,7 @@ void sdram_init(void)
__raw_writel((CONFIG_SYS_DDR_CS0_BNDS  1)  0x0fff0fff, 
ddr-cs0_bnds);
}
 
+   asm volatile(sync;isync);
udelay(500);
 
/* Let the controller go */
@@ -91,7 +99,7 @@ void sdram_init(void)
 
 void board_init_f(ulong bootflag)
 {
-   u32 plat_ratio, ddr_ratio;
+   u32 plat_ratio;
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
 
/* initialize selected port with appropriate baud rate */
@@ -99,10 +107,6 @@ void board_init_f(ulong bootflag)
plat_ratio = 1;
gd-bus_clk = CONFIG_SYS_CLK_FREQ * plat_ratio;
 
-   ddr_ratio = in_be32(gur-porpllsr)  MPC85xx_PORPLLSR_DDR_RATIO;
-   ddr_ratio = ddr_ratio  MPC85xx_PORPLLSR_DDR_RATIO_SHIFT;
-   ddr_freq_mhz = (CONFIG_SYS_CLK_FREQ * ddr_ratio) / 0x100;
-
NS16550_init((NS16550_t)CONFIG_SYS_NS16550_COM1,
gd-bus_clk / 16 / CONFIG_BAUDRATE);
 
@@ -115,8 +119,8 @@ void board_init_f(ulong bootflag)
/* NOTE - code has to be copied out of NAND buffer before
 * other blocks can be read.
 */
-   relocate_code(CONFIG_SYS_NAND_U_BOOT_RELOC_SP, 0,
-   CONFIG_SYS_NAND_U_BOOT_RELOC);
+
+   relocate_code(CONFIG_SPL_RELOC_STACK, 0, CONFIG_SPL_RELOC_TEXT_BASE);
 }
 
 void board_init_r(gd_t *gd, ulong dest_addr)
diff --git a/board/freescale/p1010rdb/tlb.c b/board/freescale/p1010rdb/tlb.c
index 4256bf4..7a8690a 100644
--- a/board/freescale/p1010rdb/tlb.c
+++ b/board/freescale/p1010rdb/tlb.c
@@ -43,16 +43,16 @@ struct fsl_e_tlb_entry tlb_table[] = {
 
/* TLB 1 */
/* *I*** - Covers boot page */
-   SET_TLB_ENTRY(1, 0xf000, 0xf000,
-   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
-   0, 0, BOOKE_PAGESZ_4K, 1),
+   SET_TLB_ENTRY(1, 0xe000, 0xe000,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 0, BOOKE_PAGESZ_8K, 1),
 
/* *I*G* - CCSRBAR */
SET_TLB_ENTRY(1, 

[U-Boot] [PATCH 4/5][v5] board/bsc9131rdb:Add NAND boot support using new SPL format

2013-04-16 Thread Prabhakar Kushwaha
   - Add NAND boot target
   - defines contants
   - Add spl_minimal.c to initialise DDR
   - update TLB entries as per NAND boot

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
Based upon git://git.denx.de/u-boot.git branch master

 Changes for v2: Sending as it is
 Changes for v3: Fix tools/checkpatch errors
 Changes for v4: Sending as it is
 Changes for v5: 
- Rebased
- define CONFIG_SPL_MAX_SIZE as 8192 instead of 8 * 1204

 board/freescale/bsc9131rdb/Makefile  |   16 
 board/freescale/bsc9131rdb/spl_minimal.c |  118 ++
 board/freescale/bsc9131rdb/tlb.c |8 +-
 boards.cfg   |1 +
 include/configs/BSC9131RDB.h |   49 ++---
 5 files changed, 177 insertions(+), 15 deletions(-)
 create mode 100644 board/freescale/bsc9131rdb/spl_minimal.c

diff --git a/board/freescale/bsc9131rdb/Makefile 
b/board/freescale/bsc9131rdb/Makefile
index 6f4cb26..2e829ad 100644
--- a/board/freescale/bsc9131rdb/Makefile
+++ b/board/freescale/bsc9131rdb/Makefile
@@ -24,12 +24,28 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifdef MINIMAL
+
+COBJS-y+= spl_minimal.o tlb.o law.o
+
+else
+
 COBJS-y+= $(BOARD).o
 COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 #COBJS-y   += bsc9131rdb_mux.o
 
+endif
+
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/freescale/bsc9131rdb/spl_minimal.c 
b/board/freescale/bsc9131rdb/spl_minimal.c
new file mode 100644
index 000..301115e
--- /dev/null
+++ b/board/freescale/bsc9131rdb/spl_minimal.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include common.h
+#include ns16550.h
+#include asm/io.h
+#include nand.h
+#include linux/compiler.h
+#include asm/fsl_law.h
+#include asm/fsl_ddr_sdram.h
+#include asm/global_data.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Fixed sdram init -- doesn't use serial presence detect.
+ */
+static void sdram_init(void)
+{
+   ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
+
+   __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, ddr-cs0_bnds);
+   __raw_writel(CONFIG_SYS_DDR_CS0_CONFIG, ddr-cs0_config);
+#if CONFIG_CHIP_SELECTS_PER_CTRL  1
+   __raw_writel(CONFIG_SYS_DDR_CS1_BNDS, ddr-cs1_bnds);
+   __raw_writel(CONFIG_SYS_DDR_CS1_CONFIG, ddr-cs1_config);
+#endif
+   __raw_writel(CONFIG_SYS_DDR_TIMING_3_800, ddr-timing_cfg_3);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_0_800, ddr-timing_cfg_0);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_1_800, ddr-timing_cfg_1);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_2_800, ddr-timing_cfg_2);
+
+   __raw_writel(CONFIG_SYS_DDR_CONTROL_2, ddr-sdram_cfg_2);
+   __raw_writel(CONFIG_SYS_DDR_MODE_1_800, ddr-sdram_mode);
+   __raw_writel(CONFIG_SYS_DDR_MODE_2_800, ddr-sdram_mode_2);
+
+   __raw_writel(CONFIG_SYS_DDR_INTERVAL_800, ddr-sdram_interval);
+   __raw_writel(CONFIG_SYS_DDR_DATA_INIT, ddr-sdram_data_init);
+   __raw_writel(CONFIG_SYS_DDR_CLK_CTRL_800, ddr-sdram_clk_cntl);
+
+   __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL_800, ddr-ddr_wrlvl_cntl);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_4, ddr-timing_cfg_4);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_5, ddr-timing_cfg_5);
+   __raw_writel(CONFIG_SYS_DDR_ZQ_CONTROL, ddr-ddr_zq_cntl);
+
+   /* Set, but do not enable the memory */
+   __raw_writel(CONFIG_SYS_DDR_CONTROL  ~SDRAM_CFG_MEM_EN, 
ddr-sdram_cfg);
+
+   asm volatile(sync;isync);
+   udelay(500);
+
+   /* Let the controller go */
+   out_be32(ddr-sdram_cfg, in_be32(ddr-sdram_cfg) | SDRAM_CFG_MEM_EN);
+
+   set_next_law(CONFIG_SYS_NAND_DDR_LAW, LAW_SIZE_1G, LAW_TRGT_IF_DDR_1);
+}
+
+void board_init_f(ulong bootflag)
+{
+   u32 plat_ratio;
+   ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
+
+   /* initialize selected port with appropriate baud rate */
+   plat_ratio = in_be32(gur-porpllsr)  MPC85xx_PORPLLSR_PLAT_RATIO;
+   plat_ratio = 1;
+   gd-bus_clk = CONFIG_SYS_CLK_FREQ 

[U-Boot] [PATCH 5/5][v5] board/bsc9132qds:Add NAND boot support using new SPL format

2013-04-16 Thread Prabhakar Kushwaha
   - Add NAND boot target
   - defines contants
   - Add spl_minimal.c to initialise DDR
   - update TLB, LAW entries as per NAND boot

Signed-off-by: Prabhakar Kushwaha prabha...@freescale.com
---
Based upon git://git.denx.de/u-boot.git branch master

 Changes for v2: Sending as it is
 Changes for v2: Fix tools/checkpatch errors
 Changes for v4: Sending as it is
 Changes for v5: 
- Rebased
- define CONFIG_SPL_MAX_SIZE as 8192 instead of 8 * 1204

 board/freescale/bsc9132qds/Makefile  |   17 
 board/freescale/bsc9132qds/law.c |6 +-
 board/freescale/bsc9132qds/spl_minimal.c |  130 ++
 board/freescale/bsc9132qds/tlb.c |   24 +++---
 boards.cfg   |2 +
 include/configs/BSC9132QDS.h |   63 +--
 6 files changed, 225 insertions(+), 17 deletions(-)
 create mode 100644 board/freescale/bsc9132qds/spl_minimal.c

diff --git a/board/freescale/bsc9132qds/Makefile 
b/board/freescale/bsc9132qds/Makefile
index 267400b..72b1917 100644
--- a/board/freescale/bsc9132qds/Makefile
+++ b/board/freescale/bsc9132qds/Makefile
@@ -24,11 +24,28 @@ include $(TOPDIR)/config.mk
 
 LIB= $(obj)lib$(BOARD).o
 
+MINIMAL=
+
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_INIT_MINIMAL
+MINIMAL=y
+endif
+endif
+
+ifdef MINIMAL
+
+COBJS-y+= spl_minimal.o tlb.o law.o
+
+else
+
+
 COBJS-y+= $(BOARD).o
 COBJS-y+= ddr.o
 COBJS-y+= law.o
 COBJS-y+= tlb.o
 
+endif
+
 SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS-y))
 SOBJS  := $(addprefix $(obj),$(SOBJS))
diff --git a/board/freescale/bsc9132qds/law.c b/board/freescale/bsc9132qds/law.c
index dc23658..b4bce99 100644
--- a/board/freescale/bsc9132qds/law.c
+++ b/board/freescale/bsc9132qds/law.c
@@ -25,11 +25,13 @@
 #include asm/mmu.h
 
 struct law_entry law_table[] = {
-#ifndef CONFIG_SYS_NO_FLASH
SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_128M, LAW_TRGT_IF_IFC),
-#endif
+#ifdef CONFIG_SYS_NAND_BASE_PHYS
SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_IFC),
+#endif
+#ifdef CONFIG_SYS_FPGA_BASE_PHYS
SET_LAW(CONFIG_SYS_FPGA_BASE_PHYS, LAW_SIZE_128K, LAW_TRGT_IF_IFC),
+#endif
 };
 
 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/bsc9132qds/spl_minimal.c 
b/board/freescale/bsc9132qds/spl_minimal.c
new file mode 100644
index 000..62dee52
--- /dev/null
+++ b/board/freescale/bsc9132qds/spl_minimal.c
@@ -0,0 +1,130 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ */
+
+#include common.h
+#include ns16550.h
+#include asm/io.h
+#include nand.h
+#include linux/compiler.h
+#include asm/fsl_law.h
+#include asm/fsl_ddr_sdram.h
+#include asm/global_data.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static void sdram_init(void)
+{
+   ccsr_ddr_t *ddr = (ccsr_ddr_t *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
+#if CONFIG_DDR_CLK_FREQ == 1
+   __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, ddr-cs0_bnds);
+   __raw_writel(CONFIG_SYS_DDR_CS0_CONFIG, ddr-cs0_config);
+   __raw_writel(CONFIG_SYS_DDR_CONTROL_800 | SDRAM_CFG_32_BE, 
ddr-sdram_cfg);
+   __raw_writel(CONFIG_SYS_DDR_CONTROL_2_800, ddr-sdram_cfg_2);
+   __raw_writel(CONFIG_SYS_DDR_DATA_INIT, ddr-sdram_data_init);
+
+   __raw_writel(CONFIG_SYS_DDR_TIMING_3_800, ddr-timing_cfg_3);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_0_800, ddr-timing_cfg_0);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_1_800, ddr-timing_cfg_1);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_2_800, ddr-timing_cfg_2);
+   __raw_writel(CONFIG_SYS_DDR_MODE_1_800, ddr-sdram_mode);
+   __raw_writel(CONFIG_SYS_DDR_MODE_2_800, ddr-sdram_mode_2);
+   __raw_writel(CONFIG_SYS_DDR_INTERVAL_800, ddr-sdram_interval);
+   __raw_writel(CONFIG_SYS_DDR_CLK_CTRL_800, ddr-sdram_clk_cntl);
+   __raw_writel(CONFIG_SYS_DDR_WRLVL_CONTROL_800, ddr-ddr_wrlvl_cntl);
+
+   __raw_writel(CONFIG_SYS_DDR_TIMING_4_800, ddr-timing_cfg_4);
+   __raw_writel(CONFIG_SYS_DDR_TIMING_5_800, ddr-timing_cfg_5);
+   __raw_writel(CONFIG_SYS_DDR_ZQ_CONTROL, ddr-ddr_zq_cntl);
+#elif CONFIG_DDR_CLK_FREQ == 13300
+   __raw_writel(CONFIG_SYS_DDR_CS0_BNDS, ddr-cs0_bnds);
+   

Re: [U-Boot] [PATCH V8 4/9] EXYNOS5: DWMMC: Added FDT support for DWMMC

2013-04-16 Thread Amarendra Reddy
Hi Jaehoon,

Please find my response below.

Thanks  Regards
Amarendra Reddy

On 12 April 2013 16:50, Jaehoon Chung jh80.ch...@samsung.com wrote:

 On 04/10/2013 03:13 PM, Amarendra Reddy wrote:
  Hi Jaehoon,
 
  Please find my responses below.
 
  Thanks  Regards
  Amarendra Reddy
 
  On 9 April 2013 16:23, Jaehoon Chung jh80.ch...@samsung.com wrote:
 
  On 04/03/2013 11:08 PM, Amar wrote:
  This patch adds FDT support for DWMMC, by reading the DWMMC node data
  from the device tree and initialising DWMMC channels as per data
  obtained from the node.
 
  Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
  Signed-off-by: Amar amarendra...@samsung.com
  Acked-by: Simon Glass s...@chromium.org
  ---
  Changes since V1:
1)Updated code to have same signature for the function
exynos_dwmci_init() for both FDT and non-FDT versions.
2)Updated code to pass device_id parameter to the function
exynos5_mmc_set_clk_div() instead of index.
3)Updated code to decode the value of samsung,width from FDT.
4)Channel index is computed instead of getting from FDT.
 
  Changes since V2:
1)Updation of commit message and resubmition of proper patch set.
 
  Changes since V3:
1)Replaced the new function exynos5_mmc_set_clk_div() with the
existing function set_mmc_clk(). set_mmc_clk() will do the
 purpose.
2)Computation of FSYS block clock divisor (pre-ratio) is added.
 
  Changes since V4:
1)Replaced unsigned int exynos_dwmmc_init(int index, int
  bus_width) with
int exynos_dwmci_add_port(int, u32, inth, u32)
i)exynos_dwmmc_add_port() will be used by non-FDT boards.
ii)In FDT case, exynos_dwmmc_init(const void *blob) will
  use
exynos_dwmmc_add_port() for every channel enabled in
  device node.
2)Changed the computation method of mmc clock divisor.
3)Updated exynos_dwmmc_init() to compute the 'clksel_val' within
  the function.
 
  Changes since V5:
1)Updated in response to review comments and changed the mmc
 clock
  value
from 50MHz to 52MHz.
 
  Changes since V6:
No change.
 
  Changes since V7:
No change.
 
   arch/arm/include/asm/arch-exynos/dwmmc.h |  11 +--
   drivers/mmc/exynos_dw_mmc.c  | 127
  ---
   include/dwmmc.h  |   3 +
   3 files changed, 124 insertions(+), 17 deletions(-)
 
  diff --git a/arch/arm/include/asm/arch-exynos/dwmmc.h
  b/arch/arm/include/asm/arch-exynos/dwmmc.h
  index 8acdf9b..3b147b8 100644
  --- a/arch/arm/include/asm/arch-exynos/dwmmc.h
  +++ b/arch/arm/include/asm/arch-exynos/dwmmc.h
  @@ -27,10 +27,7 @@
   #define DWMCI_SET_DRV_CLK(x) ((x)  16)
   #define DWMCI_SET_DIV_RATIO(x)   ((x)  24)
 
  -int exynos_dwmci_init(u32 regbase, int bus_width, int index);
  -
  -static inline unsigned int exynos_dwmmc_init(int index, int bus_width)
  -{
  - unsigned int base = samsung_get_base_mmc() + (0x1 * index);
  - return exynos_dwmci_init(base, bus_width, index);
  -}
  +#ifdef CONFIG_OF_CONTROL
  +int exynos_dwmmc_init(const void *blob);
  +#endif
  +int exynos_dwmci_add_port(int index, u32 regbase, int bus_width, u32
  clksel);
  diff --git a/drivers/mmc/exynos_dw_mmc.c b/drivers/mmc/exynos_dw_mmc.c
  index 72a31b7..4238dd9 100644
  --- a/drivers/mmc/exynos_dw_mmc.c
  +++ b/drivers/mmc/exynos_dw_mmc.c
  @@ -19,39 +19,146 @@
*/
 
   #include common.h
  -#include malloc.h
   #include dwmmc.h
  +#include fdtdec.h
  +#include libfdt.h
  +#include malloc.h
   #include asm/arch/dwmmc.h
   #include asm/arch/clk.h
  +#include asm/arch/pinmux.h
 
  -static char *EXYNOS_NAME = EXYNOS DWMMC;
  +#define  DWMMC_MAX_CH_NUM4
  +#define  DWMMC_MAX_FREQ  5200
  +#define  DWMMC_MIN_FREQ  40
  +#define  DWMMC_MMC0_CLKSEL_VAL   0x03030001
  +#define  DWMMC_MMC2_CLKSEL_VAL   0x03020001
  I known that CLKSEL's value is SoC specific.
  All exynos series are working fine? I didn't think so.
 
  Best Regards,
  Jaehoon Chung
 
 
  The above values of CLKSEL work fine for Exynos5 (5250  5410) and is
  tested.
 
  The above CLKSEL values donot hold good for Exynos4 series. Exynos4 has
  Mobile Storage Host with only one port.
  But this file 'drivers/mmc/exynos_dw_mmc.c' is specific to Exynos5 series
  and gets compiled only when CONFIG_EXYNOS_DWMMC is defined.
 No, driver/mmc/exynos_dw_mmc.c isn't specific to Exynos5 series.
 We can use this controller at the exynos4.
 Then we need to consider how get the clksel value according to SoC.

 Best Regards,
 Jaehoon Chung


OK. Then I shall add the macro for supporting exynos4 also as shown below
#define EXYNOS4_DWMMC_MMC0_CLKSEL_VAL   0x (reset value)
#define EXYNOS5_DWMMC_MMC0_CLKSEL_VAL   0x03030001
#define EXYNOS5_DWMMC_MMC2_CLKSEL_VAL   0x03020001

In Exynos4, Mobile Storage Host has 

[U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Chunhe Lan
P1023RDB Specification:
---
Memory subsystem:
   512MB DDR3 (Fixed DDR on board)
   64MB NOR flash
   128MB NAND flash

Ethernet:
   eTSEC1: Connected to Atheros AR8035 GETH PHY
   eTSEC2: Connected to Atheros AR8035 GETH PHY

PCIe:
   Three mini-PCIe slots

USB: Two USB2.0 Type A ports

I2C:
   AT24C08 8K Board EEPROM (8 bit address)

Signed-off-by: Chunhe Lan chunhe@freescale.com
---
 board/freescale/p1023rdb/Makefile   |   32 +++
 board/freescale/p1023rdb/law.c  |   34 +++
 board/freescale/p1023rdb/p1023rdb.c |  194 
 board/freescale/p1023rdb/tlb.c  |  116 ++
 boards.cfg  |1 +
 include/configs/P1023RDB.h  |  433 +++
 6 files changed, 810 insertions(+), 0 deletions(-)
 create mode 100644 board/freescale/p1023rdb/Makefile
 create mode 100644 board/freescale/p1023rdb/law.c
 create mode 100644 board/freescale/p1023rdb/p1023rdb.c
 create mode 100644 board/freescale/p1023rdb/tlb.c
 create mode 100644 include/configs/P1023RDB.h

diff --git a/board/freescale/p1023rdb/Makefile 
b/board/freescale/p1023rdb/Makefile
new file mode 100644
index 000..c8e0866
--- /dev/null
+++ b/board/freescale/p1023rdb/Makefile
@@ -0,0 +1,32 @@
+#
+# Copyright 2013 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option)
+# any later version.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS-y+= $(BOARD).o
+COBJS-y+= law.o
+COBJS-y+= tlb.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS-y))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/freescale/p1023rdb/law.c b/board/freescale/p1023rdb/law.c
new file mode 100644
index 000..b041d1f
--- /dev/null
+++ b/board/freescale/p1023rdb/law.c
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include common.h
+#include asm/fsl_law.h
+#include asm/mmu.h
+
+struct law_entry law_table[] = {
+   SET_LAW(CONFIG_SYS_NAND_BASE_PHYS, LAW_SIZE_1M, LAW_TRGT_IF_LBC),
+   SET_LAW(CONFIG_SYS_QMAN_MEM_PHYS, LAW_SIZE_4M,
+   LAW_TRGT_IF_DPAA_SWP_SRAM),
+   SET_LAW(CONFIG_SYS_FLASH_BASE_PHYS, LAW_SIZE_256M, LAW_TRGT_IF_LBC),
+};
+
+int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/p1023rdb/p1023rdb.c 
b/board/freescale/p1023rdb/p1023rdb.c
new file mode 100644
index 000..16659e9
--- /dev/null
+++ b/board/freescale/p1023rdb/p1023rdb.c
@@ -0,0 +1,194 @@
+/*
+ * Copyright 2013 Freescale Semiconductor, Inc.
+ *
+ * Authors:  Roy Zang tie-fei.z...@freescale.com
+ *   Chunhe Lan chunhe@freescale.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 common.h
+#include command.h
+#include pci.h
+#include asm/io.h
+#include asm/cache.h
+#include asm/processor.h
+#include asm/mmu.h
+#include 

Re: [U-Boot] fatwrite problem

2013-04-16 Thread Ruud Commandeur
Hi Everyone,

As far as I noticed, set_cluster can be called quite often with a size being 
zero. That can indeed be with a file that has a size being an exact multiple 
(including 0) of the clustersize, but also for files that are smaller than the 
size of one cluster. In that case, the 1st call to set_cluster has a size being 
zero:

 fatwrite mmc 0:1 4200 test3 200
writing test3
set_cluster; clustnum: 1487, startsect: 6104, size 0
set_cluster; clustnum: 1487, startsect: 6104, size 512
set_cluster; clustnum: -6, startsect: 132, size 2048
512 bytes written

This was solved by adding the if(size) in set_cluster (otherwise the above 
test would fail). However: this does not solve all the problems. If I tried to 
write a file of 16 bytes, I still got an error. Looking closer at set_cluster, 
the 1st call to disk_write( ) has a size being size / mydata-sect_size. This 
would mean that for any file (or file remainder) smaller than the sector size 
(typicaly 512 bytes), the fatwrite would fail.

So to my opinion, the actual cause of the problem is in the function 
disk_write( ), that can't be called with a size being zero. That could be 
solved by adding tests before calling set_cluster and/or before calling 
disk_write from set_cluster, but the safest (and simplest) would be to add this 
piece of code to disk_write:

if(nr_blocks == 0) {
return 0;
}

With this change I have been able to write various file sizes so far without 
problems (512 bytes, 2048, 2049, 16, 0). 

Another option would be to solve this in the cur_dev-block_write function, 
being mmc_bwrite( ) for the mmc device. Since his has a do { } while, it will 
always call mmc_write_blocks() even if blkcnt equals zero. Maybe even the 
mmc_write_blocks would be the best place to fix this...

I will do some further testing here. Meanwhile, please let me know if this 
change would make sense to you, and what would be the best place to put it. 
Probably the lowest level function, if you would ask me.
Also I would like to know if it would not cause any oher problems according to 
your knowledge.

Regards,

Ruud

-Oorspronkelijk bericht-
Van: Benoît Thébaudeau [mailto:benoit.thebaud...@advansee.com] 
Verzonden: vrijdag 12 april 2013 23:18
Aan: Tom Rini
CC: Ruud Commandeur; u-boot@lists.denx.de; Mats K?rrman
Onderwerp: Re: [U-Boot] fatwrite problem

Hi Tom,

On Friday, April 12, 2013 10:42:34 PM, Tom Rini wrote:
 On Fri, Apr 12, 2013 at 09:39:19PM +0200, Beno??t Th??baudeau wrote:
  Hi Tom, Ruud, Mats,
  
  On Friday, April 12, 2013 5:12:31 PM, Tom Rini wrote:
   On Fri, Apr 12, 2013 at 05:06:35PM +0200, Ruud Commandeur wrote:
Hi Mats,

Thanks a lot, this seems to solve my problem. Nothing more actualy than
adding a if(size) around the code block of set_sector( ). I could
have
thought of that myself, but was not sure if anything else should be
done
in this case...
   
   Since your change sounds slightly different, can you confirm that it
   also solves the problem and if so post it as patch with Signed-off-by
   and so forth?  Thanks!
   

Regards,

Ruud

-Oorspronkelijk bericht-
Van: Mats K?rrman [mailto:mats.karr...@tritech.se]
Verzonden: vrijdag 12 april 2013 16:11
Aan: Ruud Commandeur
CC: u-boot@lists.denx.de
Onderwerp: RE: fatwrite problem

Hi Ruud,

Ruud Commandeur wrote:
 Once the size of the set_cluster call equals 0, the mmc command is
 incomplete and times out. In the earlier reported problem, a patch is
 mentioned, but not available for dowload here. Also in the latest
 versions of the git repository I could not find a patch for this
 problem. Can anyone tell me if there is a fix for this problem?

I asked Damien Huang (back then) and got the following reply (I think
there
was
some character encoding problem so his mail never was accepted by the
list).
I have not further analyzed the contents, anyway it wasn't the solution
to
my problem.
BR // Mats

Damien Huang wrote:
As requested from Mats, I am resending this email. The patch is given
below:

diff -cr ./u-boot-original/u-boot/fs/fat/fat_write.c
./u-boot-test/u-boot/fs/fat/fat_write.c
*** ./u-boot-original/u-boot/fs/fat/fat_write.c2013-02-07
14:47:33.314732999 +1100
--- ./u-boot-test/u-boot/fs/fat/fat_write.c2013-02-28
15:36:24.551861920 +1100
***
*** 562,596 
  {
  int idx = 0;
  __u32 startsect;
!
! if (clustnum  0)
! startsect = mydata-data_begin +
! clustnum * mydata-clust_size;
! else
! startsect = mydata-rootdir_sect;
!
! debug(clustnum: %d, startsect: %d\n, clustnum, startsect);
!
! if (disk_write(startsect, size / mydata-sect_size, buffer)  0)
{
! debug(Error writing data\n);
!

[U-Boot] [PATCH] patman: fix gitutil for decorations

2013-04-16 Thread Andreas Bießmann
The git config parameter log.decorate is quite useful when working with git.
Patman, however can not handle the decorated output when parsing the commit.
To prevent this use the '--no-decorate' switch for git-log.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
Cc: Tom Rini tr...@ti.com
Cc: Simon Glass s...@chromium.org
---

Since this is required for me to get patman working it would be great to have
this trivial change in the upcoming release.

 tools/patman/gitutil.py |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index f485750..8b61410 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -39,7 +39,8 @@ def CountCommitsToBranch():
 Return:
 Number of patches that exist on top of the branch
 
-pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
+pipe = [['git', 'log', '--no-color', '--oneline', '--no-decorate',
+ '@{upstream}..'],
 ['wc', '-l']]
 stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)
-- 
1.7.10.4

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


[U-Boot] [PATCH v2] patman: fix gitutil for decorations

2013-04-16 Thread Andreas Bießmann
The git config parameter log.decorate is quite useful when working with git.
Patman, however can not handle the decorated output when parsing the commit.
To prevent this use the '--no-decorate' switch for git-log.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
---
Changes in v2:
 * add --no-decorate to all git-log instances

 tools/patman/gitutil.py |8 +---
 tools/patman/patchstream.py |3 ++-
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py
index f485750..e31da15 100644
--- a/tools/patman/gitutil.py
+++ b/tools/patman/gitutil.py
@@ -39,7 +39,8 @@ def CountCommitsToBranch():
 Return:
 Number of patches that exist on top of the branch
 
-pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'],
+pipe = [['git', 'log', '--no-color', '--oneline', '--no-decorate',
+ '@{upstream}..'],
 ['wc', '-l']]
 stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)
@@ -92,7 +93,8 @@ def CountCommitsInBranch(git_dir, branch, 
include_upstream=False):
 Number of patches that exist on top of the branch
 
 range_expr = GetRangeInBranch(git_dir, branch, include_upstream)
-pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', range_expr],
+pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', '--no-decorate',
+ range_expr],
 ['wc', '-l']]
 result = command.RunPipe(pipe, capture=True, oneline=True)
 patch_count = int(result.stdout)
@@ -106,7 +108,7 @@ def CountCommits(commit_range):
 Return:
 Number of patches that exist on top of the branch
 
-pipe = [['git', 'log', '--oneline', commit_range],
+pipe = [['git', 'log', '--oneline', '--no-decorate', commit_range],
 ['wc', '-l']]
 stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout
 patch_count = int(stdout)
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index 7334ed3..b4337cc 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -359,7 +359,8 @@ def GetMetaDataForList(commit_range, git_dir=None, 
count=None,
 Returns:
 A Series object containing information about the commits.
 
-params = ['git', 'log', '--no-color', '--reverse', commit_range]
+params = ['git', 'log', '--no-color', '--reverse', '--no-decorate',
+commit_range]
 if count is not None:
 params[2:2] = ['-n%d' % count]
 if git_dir:
-- 
1.7.10.4

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


Re: [U-Boot] [PATCH v2] mx35 iomux: correct offsets of IOMUX registers

2013-04-16 Thread Stefano Babic
On 10/04/2013 00:44, Philip Paeps wrote:
 This makes mxc_iomux_set_input() work correctly.  Previously, the
 incorrect offset of IOMUXSW_INPUT_CTL caused mxc_iomux_set_input()
 to write to the wrong register, possibly resulting in unexpected
 behaviour.
 
 Signed-off-by: Philip Paeps phi...@paeps.cx
 ---

Applied to u-boot-imx, -next branch, thanks.

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH] mx28evk: add trimffs to nand command

2013-04-16 Thread Stefano Babic
On 08/04/2013 20:59, Eric Bénard wrote:
 this is usefull when writing an UBI image which contains
 and UBIFS volume (check README.nand and UBI FAQ for more details)
 
 Signed-off-by: Eric Bénard e...@eukrea.com
 ---

Applied to u-boot-imx, -next branch, thanks.

Best regards,
Stefano Babic


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


Re: [U-Boot] [PATCH] arm: imx: Change iomux functions to void type

2013-04-16 Thread Stefano Babic
On 11/04/2013 11:06, Stefan Roese wrote:
 They never return anything also than 0, so lets change the function
 to void instead.
 
 Signed-off-by: Stefan Roese s...@denx.de
 ---

Applied to u-boot-imx, -next branch, thanks.

Best regards,
Stefano Babic



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


[U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
This patch also does some minor coding style cleanups.

Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com

---
 arch/arm/lib/board.c|3 ++-
 arch/avr32/lib/board.c  |3 ++-
 arch/blackfin/lib/board.c   |3 ++-
 arch/m68k/lib/board.c   |3 ++-
 arch/microblaze/lib/board.c |5 +++--
 arch/mips/lib/board.c   |3 ++-
 arch/nds32/lib/board.c  |3 ++-
 arch/nios2/lib/board.c  |5 +++--
 arch/openrisc/lib/board.c   |3 ++-
 arch/powerpc/lib/board.c|4 ++--
 arch/sandbox/lib/board.c|3 ++-
 arch/sh/lib/board.c |3 ++-
 arch/sparc/lib/board.c  |3 ++-
 arch/x86/lib/board.c|3 ++-
 common/board_f.c|3 ++-
 common/spl/spl.c|3 ++-
 drivers/mtd/nand/mxc_nand_spl.c |3 ++-
 17 files changed, 36 insertions(+), 20 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 0521178..4a00e16 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
/* NOTREACHED - no way out of command loop except booting */
 }
 
-void hang(void)
+void __hang(void)
 {
puts(### ERROR ### Please RESET the board ###\n);
for (;;);
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 57e07df..7e3380a 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -120,10 +120,11 @@ static int display_banner (void)
return 0;
 }
 
-void hang(void)
+void __hang(void)
 {
for (;;) ;
 }
+void hang(void) __attribute__((weak, alias(__hang)));
 
 static int display_dram_config (void)
 {
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 75b6c46..7769962 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -433,7 +433,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
main_loop();
 }
 
-void hang(void)
+void __hang(void)
 {
 #ifdef CONFIG_STATUS_LED
status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
@@ -446,3 +446,4 @@ void hang(void)
 */
asm(emuexcpt;);
 }
+void hang(void) __attribute__((weak, alias(__hang));
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index adaccfe..93aeafb 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -665,8 +665,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
 }
 
 
-void hang(void)
+void __hang(void)
 {
puts (### ERROR ### Please RESET the board ###\n);
for (;;);
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index a7c2f76..e661704 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -195,8 +195,9 @@ void board_init_f(ulong not_used)
}
 }
 
-void hang (void)
+void __hang(void)
 {
-   puts (### ERROR ### Please RESET the board ###\n);
+   puts(### ERROR ### Please RESET the board ###\n);
for (;;) ;
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index f19f198..ad18440 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -345,9 +345,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
/* NOTREACHED - no way out of command loop except booting */
 }
 
-void hang(void)
+void __hang(void)
 {
puts(### ERROR ### Please RESET the board ###\n);
for (;;)
;
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index a7d27fc..2433d8a 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -405,9 +405,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
/* NOTREACHED - no way out of command loop except booting */
 }
 
-void hang(void)
+void __hang(void)
 {
puts(### ERROR ### Please RESET the board ###\n);
for (;;)
;
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
index 1e495d4..517a3a1 100644
--- a/arch/nios2/lib/board.c
+++ b/arch/nios2/lib/board.c
@@ -168,9 +168,10 @@ void board_init (void)
 
 /***/
 
-void hang (void)
+void __hang(void)
 {
-   disable_interrupts ();
+   disable_interrupts();
puts(### ERROR ### Please reset board ###\n);
for (;;);
 }
+void hang(void) __attribute__((weak, alias(__hang)));
diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
index 85aa189..c5437db 100644
--- a/arch/openrisc/lib/board.c
+++ b/arch/openrisc/lib/board.c
@@ -158,7 +158,7 @@ void board_init(void)
 
 /***/
 
-void hang(void)
+void __hang(void)
 {
disable_interrupts();
puts(### ERROR ### 

Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Stefan Roese
Hi Andreas,

On 16.04.2013 12:14, Andreas Bießmann wrote:
 This patch also does some minor coding style cleanups.
 
 Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
 
 ---
  arch/arm/lib/board.c|3 ++-
  arch/avr32/lib/board.c  |3 ++-
  arch/blackfin/lib/board.c   |3 ++-
  arch/m68k/lib/board.c   |3 ++-
  arch/microblaze/lib/board.c |5 +++--
  arch/mips/lib/board.c   |3 ++-
  arch/nds32/lib/board.c  |3 ++-
  arch/nios2/lib/board.c  |5 +++--
  arch/openrisc/lib/board.c   |3 ++-
  arch/powerpc/lib/board.c|4 ++--
  arch/sandbox/lib/board.c|3 ++-
  arch/sh/lib/board.c |3 ++-
  arch/sparc/lib/board.c  |3 ++-
  arch/x86/lib/board.c|3 ++-
  common/board_f.c|3 ++-
  common/spl/spl.c|3 ++-
  drivers/mtd/nand/mxc_nand_spl.c |3 ++-
  17 files changed, 36 insertions(+), 20 deletions(-)
 
 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
 index 0521178..4a00e16 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
   /* NOTREACHED - no way out of command loop except booting */
  }
  
 -void hang(void)
 +void __hang(void)
  {
   puts(### ERROR ### Please RESET the board ###\n);
   for (;;);
  }
 +void hang(void) __attribute__((weak, alias(__hang)));

Please include linux/compiler.h and use:

void __weak hang(void)
{
puts(### ERROR ### Please RESET the board ###\n);
for (;;);
}

instead. No __attribute__ needed and easier to read.

Thanks,
Stefan

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Graeme Russ
Hi Andreas,


On Tue, Apr 16, 2013 at 8:14 PM, Andreas Bießmann 
andreas.de...@googlemail.com wrote:

 This patch also does some minor coding style cleanups.


Coding style cleanups belong in a separate patch - Rules are rules ;)

Regards,

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Albert ARIBAUD
Hi Andreas,

On Tue, 16 Apr 2013 12:14:09 +0200, Andreas Bießmann
andreas.de...@googlemail.com wrote:

 This patch also does some minor coding style cleanups.
 
 Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com
 
 ---
  arch/arm/lib/board.c|3 ++-
  arch/avr32/lib/board.c  |3 ++-
  arch/blackfin/lib/board.c   |3 ++-
  arch/m68k/lib/board.c   |3 ++-
  arch/microblaze/lib/board.c |5 +++--
  arch/mips/lib/board.c   |3 ++-
  arch/nds32/lib/board.c  |3 ++-
  arch/nios2/lib/board.c  |5 +++--
  arch/openrisc/lib/board.c   |3 ++-
  arch/powerpc/lib/board.c|4 ++--
  arch/sandbox/lib/board.c|3 ++-
  arch/sh/lib/board.c |3 ++-
  arch/sparc/lib/board.c  |3 ++-
  arch/x86/lib/board.c|3 ++-
  common/board_f.c|3 ++-
  common/spl/spl.c|3 ++-
  drivers/mtd/nand/mxc_nand_spl.c |3 ++-
  17 files changed, 36 insertions(+), 20 deletions(-)
 
 diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
 index 0521178..4a00e16 100644
 --- a/arch/arm/lib/board.c
 +++ b/arch/arm/lib/board.c
 @@ -707,8 +707,9 @@ void board_init_r(gd_t *id, ulong dest_addr)
   /* NOTREACHED - no way out of command loop except booting */
  }
  
 -void hang(void)
 +void __hang(void)
  {
   puts(### ERROR ### Please RESET the board ###\n);
   for (;;);
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
 index 57e07df..7e3380a 100644
 --- a/arch/avr32/lib/board.c
 +++ b/arch/avr32/lib/board.c
 @@ -120,10 +120,11 @@ static int display_banner (void)
   return 0;
  }
  
 -void hang(void)
 +void __hang(void)
  {
   for (;;) ;
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
  
  static int display_dram_config (void)
  {
 diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
 index 75b6c46..7769962 100644
 --- a/arch/blackfin/lib/board.c
 +++ b/arch/blackfin/lib/board.c
 @@ -433,7 +433,7 @@ void board_init_r(gd_t * id, ulong dest_addr)
   main_loop();
  }
  
 -void hang(void)
 +void __hang(void)
  {
  #ifdef CONFIG_STATUS_LED
   status_led_set(STATUS_LED_BOOT, STATUS_LED_OFF);
 @@ -446,3 +446,4 @@ void hang(void)
*/
   asm(emuexcpt;);
  }
 +void hang(void) __attribute__((weak, alias(__hang));
 diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
 index adaccfe..93aeafb 100644
 --- a/arch/m68k/lib/board.c
 +++ b/arch/m68k/lib/board.c
 @@ -665,8 +665,9 @@ void board_init_r (gd_t *id, ulong dest_addr)
  }
  
  
 -void hang(void)
 +void __hang(void)
  {
   puts (### ERROR ### Please RESET the board ###\n);
   for (;;);
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
 index a7c2f76..e661704 100644
 --- a/arch/microblaze/lib/board.c
 +++ b/arch/microblaze/lib/board.c
 @@ -195,8 +195,9 @@ void board_init_f(ulong not_used)
   }
  }
  
 -void hang (void)
 +void __hang(void)
  {
 - puts (### ERROR ### Please RESET the board ###\n);
 + puts(### ERROR ### Please RESET the board ###\n);
   for (;;) ;
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
 index f19f198..ad18440 100644
 --- a/arch/mips/lib/board.c
 +++ b/arch/mips/lib/board.c
 @@ -345,9 +345,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
   /* NOTREACHED - no way out of command loop except booting */
  }
  
 -void hang(void)
 +void __hang(void)
  {
   puts(### ERROR ### Please RESET the board ###\n);
   for (;;)
   ;
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
 index a7d27fc..2433d8a 100644
 --- a/arch/nds32/lib/board.c
 +++ b/arch/nds32/lib/board.c
 @@ -405,9 +405,10 @@ void board_init_r(gd_t *id, ulong dest_addr)
   /* NOTREACHED - no way out of command loop except booting */
  }
  
 -void hang(void)
 +void __hang(void)
  {
   puts(### ERROR ### Please RESET the board ###\n);
   for (;;)
   ;
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
 index 1e495d4..517a3a1 100644
 --- a/arch/nios2/lib/board.c
 +++ b/arch/nios2/lib/board.c
 @@ -168,9 +168,10 @@ void board_init (void)
  
  /***/
  
 -void hang (void)
 +void __hang(void)
  {
 - disable_interrupts ();
 + disable_interrupts();
   puts(### ERROR ### Please reset board ###\n);
   for (;;);
  }
 +void hang(void) __attribute__((weak, alias(__hang)));
 diff --git a/arch/openrisc/lib/board.c b/arch/openrisc/lib/board.c
 index 85aa189..c5437db 100644
 --- a/arch/openrisc/lib/board.c
 +++ b/arch/openrisc/lib/board.c
 @@ -158,7 

Re: [U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Timur Tabi
On Tue, Apr 16, 2013 at 4:00 AM, Chunhe Lan chunhe@freescale.com wrote:

 +#define CONFIG_SYS_BAUDRATE_TABLE  \
 +   {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}


It's amazing that Freescale is still producing board files that are
missing 57,600 baud.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Hi Albert,

On 04/16/2013 01:36 PM, Albert ARIBAUD wrote:
 Hi Andreas,
 
 On Tue, 16 Apr 2013 12:14:09 +0200, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 
 This patch also does some minor coding style cleanups.

 Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com

 ---
  arch/arm/lib/board.c|3 ++-
  arch/avr32/lib/board.c  |3 ++-
  arch/blackfin/lib/board.c   |3 ++-
  arch/m68k/lib/board.c   |3 ++-
  arch/microblaze/lib/board.c |5 +++--
  arch/mips/lib/board.c   |3 ++-
  arch/nds32/lib/board.c  |3 ++-
  arch/nios2/lib/board.c  |5 +++--
  arch/openrisc/lib/board.c   |3 ++-
  arch/powerpc/lib/board.c|4 ++--
  arch/sandbox/lib/board.c|3 ++-
  arch/sh/lib/board.c |3 ++-
  arch/sparc/lib/board.c  |3 ++-
  arch/x86/lib/board.c|3 ++-
  common/board_f.c|3 ++-
  common/spl/spl.c|3 ++-
  drivers/mtd/nand/mxc_nand_spl.c |3 ++-
  17 files changed, 36 insertions(+), 20 deletions(-)

snip

 
 Apart from Stefan's comments: considered standalone, doesn't this patch
 have zero effect? I suspect you intend to use this in a later patch,
 and if so, I would suggest grouping these in a series so that the
 subsequent patch(es) explain this one.

I would like to use a specialized hang() for a not mainlined board, thus
there will no more patches using this currently.

Best regards

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


Re: [U-Boot] [PATCH v3] imx: Add titanium board support (i.MX6 based)

2013-04-16 Thread Stefan Roese
Hi Stefano,

thanks for your review. I'll adress your comments in v4.

Thanks,
Stefan

On 16.04.2013 09:50, Stefano Babic wrote:
 On 16/04/2013 09:19, Stefan Roese wrote:
 Titanium is a i.MX6 based board from ProjectionDesign / Barco. This
 patch adds support for this board with the newly introduced NAND
 support for i.MX6.

 
 Hi Stefan.
 
 diff --git a/board/freescale/titanium/imximage.cfg 
 b/board/freescale/titanium/imximage.cfg
 new file mode 100644
 index 000..5661d58
 --- /dev/null
 +++ b/board/freescale/titanium/imximage.cfg
 @@ -0,0 +1,173 @@
 +/*
 + * Projectiondesign AS
 + * Derived from ./board/freescale/mx6qsabrelite/imximage.cfg
 + *
 + * Copyright (C) 2011 Freescale Semiconductor, Inc.
 + * Jason Liu r64...@freescale.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.
 + *
 + * Refer docs/README.imxmage for more details about how-to configure
 + * and create imximage boot image
 + *
 + * The syntax is taken as close as possible with the kwbimage
 + */
 +
 +/* image version */
 +
 +IMAGE_VERSION 2
 +
 +/*
 + * Boot Device : one of
 + * sd, nand
 + */
 +BOOT_FROM  nand
 +
 +/*
 + * Device Configuration Data (DCD)
 + *
 + * Each entry must have the format:
 + * Addr-type   AddressValue
 + *
 + * where:
 + *  Addr-type register length (1,2 or 4 bytes)
 + *  Address   absolute address of the register
 + *  value value to be stored in the register
 + */
 +DATA 4 0x020e05a8 0x0030
 +DATA 4 0x020e05b0 0x0030
 +DATA 4 0x020e0524 0x0030
 +DATA 4 0x020e051c 0x0030
 +
 
 I know that this comes from Sabre, and this was done in this way.
 Anyway, with the addition of the Boundary's board, this file is
 preprocessed by the precompiler, allowing us to use macros and making
 this configuration file something better as a blob of hexadecimal values.
 
 Any chances to replace here the register addresses with their defined
 macro (see for example board/boundary/nitrogen6x/800mhz_2x128mx16.cfg) ?
 
 
 +
 +static void setup_iomux_uart(void)
 +{
 +imx_iomux_v3_setup_multiple_pads(uart1_pads, ARRAY_SIZE(uart1_pads));
 +imx_iomux_v3_setup_multiple_pads(uart2_pads, ARRAY_SIZE(uart2_pads));
 +imx_iomux_v3_setup_multiple_pads(uart4_pads, ARRAY_SIZE(uart4_pads));
 +}
 +
 +#ifdef CONFIG_USB_EHCI_MX6
 +int board_ehci_hcd_init(int port)
 +{
 +return 0;
 
 It seems to me we have a problem (not here), but in general i.MX code.
 If the board maintainer must implement an empty function, this function
 should be declared __weak where it is called.
 
 +int board_mmc_init(bd_t *bis)
 +{
 +/*
 + * Only one USDHC controller on titianium
 + */
 +imx_iomux_v3_setup_multiple_pads(usdhc3_pads, ARRAY_SIZE(usdhc3_pads));
 +usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
 +
 +return fsl_esdhc_initialize(bis, usdhc_cfg[0]);
 +}
 +#endif
 +
 +int board_phy_config(struct phy_device *phydev)
 +{
 +/* min rx data delay */
 +ksz9021_phy_extended_write(phydev,
 +   MII_KSZ9021_EXT_RGMII_RX_DATA_SKEW, 0x0);
 +/* min tx data delay */
 +ksz9021_phy_extended_write(phydev,
 +   MII_KSZ9021_EXT_RGMII_TX_DATA_SKEW, 0x0);
 +/* max rx/tx clock delay, min rx/tx control */
 +ksz9021_phy_extended_write(phydev,
 +   MII_KSZ9021_EXT_RGMII_CLOCK_SKEW, 0xf0f0);
 +if (phydev-drv-config)
 +phydev-drv-config(phydev);
 +
 +return 0;
 +}
 +
 +int board_eth_init(bd_t *bis)
 +{
 +int ret;
 +
 +setup_iomux_enet();
 +
 +ret = cpu_eth_init(bis);
 +if (ret)
 +printf(FEC MXC: %s:failed\n, __func__);
 +
 +return 0;
 +}
 +
 +int board_early_init_f(void)
 +{
 +setup_iomux_uart();
 +
 +return 0;
 +}
 +
 +/*
 + * Do not overwrite the console
 + * Use always serial for U-Boot console
 + */
 +int overwrite_console(void)
 +{
 +return 1;
 +}
 
 Needed ? I have not seen CONFIG_VIDEO. Do you support a splashscreen ?
 
 
 +#define CONFIG_BOOTCOMMAND  run bootnfs
 
 Is it ok as default value ?
 
 
 Best regards,
 Stefano
 
 


-- 
Viele Grüße,
Stefan Roese

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

Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas Bießmann,

In message 516d39cf.9020...@gmail.com you wrote:
 
  Apart from Stefan's comments: considered standalone, doesn't this patch
  have zero effect? I suspect you intend to use this in a later patch,
  and if so, I would suggest grouping these in a series so that the
  subsequent patch(es) explain this one.
 
 I would like to use a specialized hang() for a not mainlined board, thus
 there will no more patches using this currently.

So it is dead code in mainline, and we will not add it.


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
Keep your eyes wide open before marriage, half shut afterwards.
 -- Benjamin Franklin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 06:35:13AM -0500, Timur Tabi wrote:

 On Tue, Apr 16, 2013 at 4:00 AM, Chunhe Lan chunhe@freescale.com wrote:
 
  +#define CONFIG_SYS_BAUDRATE_TABLE  \
  +   {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
 
 
 It's amazing that Freescale is still producing board files that are
 missing 57,600 baud.

When they could just use the default table?

-- 
Tom


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


[U-Boot] [PATCH v4] imx: Add titanium board support (i.MX6 based)

2013-04-16 Thread Stefan Roese
Titanium is a i.MX6 based board from ProjectionDesign / Barco. This
patch adds support for this board with the newly introduced NAND
support for i.MX6.

Signed-off-by: Stefan Roese s...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Fabio Estevam fabio.este...@freescale.com
---
v4:
- Use register defines instead of hardcoded addresses by including
  the headers in imximage.cfg
- Remove overwrite_console() as its not needed
- Change CONFIG_BOOTCOMMAND

v3:
- Rebased on current master (ARM PR included, 2013.04-rc3)
- Removed get_board_revision()
- Fixed problem with MMC pad muxing in v2

v2:
- Fixed comment in imximage.imx
- Use only english comments
- Move include files to top of config header
- Remove unnecessary loop in board_mmc_init()
- Minor fixups
- No magic values used any more
- Increade NAND clock (GPMI IO) to 100MHz
- CONFIG_ARP_TIMEOUT removed as its not needed

 MAINTAINERS  |   2 +
 arch/arm/include/asm/arch-mx6/crm_regs.h |   7 +-
 board/freescale/titanium/Makefile|  36 
 board/freescale/titanium/imximage.cfg| 173 +++
 board/freescale/titanium/titanium.c  | 355 +++
 boards.cfg   |   1 +
 include/configs/titanium.h   | 278 
 7 files changed, 850 insertions(+), 2 deletions(-)
 create mode 100644 board/freescale/titanium/Makefile
 create mode 100644 board/freescale/titanium/imximage.cfg
 create mode 100644 board/freescale/titanium/titanium.c
 create mode 100644 include/configs/titanium.h

diff --git a/MAINTAINERS b/MAINTAINERS
index bbab5fe..fd595f4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -877,6 +877,8 @@ Stefan Roese s...@denx.de
 
x600ARM926EJS (spear600 Soc)
 
+   titaniumi.MX6Q
+
pdnb3   xscale/ixp
scpuxscale/ixp
 
diff --git a/arch/arm/include/asm/arch-mx6/crm_regs.h 
b/arch/arm/include/asm/arch-mx6/crm_regs.h
index 7676457..cf5c694 100644
--- a/arch/arm/include/asm/arch-mx6/crm_regs.h
+++ b/arch/arm/include/asm/arch-mx6/crm_regs.h
@@ -262,10 +262,13 @@ struct mxc_ccm_reg {
 /* Define the bits in register CS2CDR */
 #define MXC_CCM_CS2CDR_ENFC_CLK_PODF_MASK  (0x3F  21)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PODF_OFFSET21
+#define MXC_CCM_CS2CDR_ENFC_CLK_PODF(v)(((v)  0x3f) 
 21)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PRED_MASK  (0x7  18)
 #define MXC_CCM_CS2CDR_ENFC_CLK_PRED_OFFSET18
+#define MXC_CCM_CS2CDR_ENFC_CLK_PRED(v)(((v)  0x7)  
18)
 #define MXC_CCM_CS2CDR_ENFC_CLK_SEL_MASK   (0x3  16)
 #define MXC_CCM_CS2CDR_ENFC_CLK_SEL_OFFSET 16
+#define MXC_CCM_CS2CDR_ENFC_CLK_SEL(v) (((v)  0x3)  16)
 #define MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_MASK(0x7  12)
 #define MXC_CCM_CS2CDR_LDB_DI1_CLK_SEL_OFFSET  12
 #define MXC_CCM_CS2CDR_LDB_DI0_CLK_SEL_MASK(0x7  9)
@@ -415,8 +418,8 @@ struct mxc_ccm_reg {
 #define MXC_CCM_CCGR0_AIPS_TZ1_MASK
(3MXC_CCM_CCGR0_AIPS_TZ1_OFFSET)
 #define MXC_CCM_CCGR0_AIPS_TZ2_OFFSET  2
 #define MXC_CCM_CCGR0_AIPS_TZ2_MASK
(3MXC_CCM_CCGR0_AIPS_TZ2_OFFSET)
-#define MXC_CCM_CCGR0_APBHDMA HCLK_OFFSET  4
-#define MXC_CCM_CCGR0_AMASK
(3MXC_CCM_CCGR0_APBHDMA)
+#define MXC_CCM_CCGR0_APBHDMA_OFFSET   4
+#define MXC_CCM_CCGR0_APBHDMA_MASK 
(3MXC_CCM_CCGR0_APBHDMA_OFFSET)
 #define MXC_CCM_CCGR0_ASRC_OFFSET  6
 #define MXC_CCM_CCGR0_ASRC_MASK
(3MXC_CCM_CCGR0_ASRC_OFFSET)
 #define MXC_CCM_CCGR0_CAAM_SECURE_MEM_OFFSET   8
diff --git a/board/freescale/titanium/Makefile 
b/board/freescale/titanium/Makefile
new file mode 100644
index 000..46827f8
--- /dev/null
+++ b/board/freescale/titanium/Makefile
@@ -0,0 +1,36 @@
+#
+# Copyright (C) 2007, Guennadi Liakhovetski l...@denx.de
+#
+# (C) Copyright 2011 Freescale Semiconductor, Inc.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := titanium.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+

Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Dear Wolfgang Denk,

On 04/16/2013 02:22 PM, Wolfgang Denk wrote:
 Dear Andreas Bießmann,
 
 In message 516d39cf.9020...@gmail.com you wrote:

 Apart from Stefan's comments: considered standalone, doesn't this patch
 have zero effect? I suspect you intend to use this in a later patch,
 and if so, I would suggest grouping these in a series so that the
 subsequent patch(es) explain this one.

 I would like to use a specialized hang() for a not mainlined board, thus
 there will no more patches using this currently.
 
 So it is dead code in mainline, and we will not add it.

Well, I don't think it is dead code cause the hang() is called in some ways.
This patch opens just the possibility to specialize the hang() by for
example a specific board. Maybe this could also be used for specific
hang() for different arches when we get closer to the common board files.
It is correct that we do not need this patch now and I can handle it
here in my own tree.

Best regards

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas,

In message 516d4b00.9030...@gmail.com you wrote:

  So it is dead code in mainline, and we will not add it.
 
 Well, I don't think it is dead code cause the hang() is called in some ways.
 This patch opens just the possibility to specialize the hang() by for
 example a specific board. Maybe this could also be used for specific
 hang() for different arches when we get closer to the common board files.

I think it is dead code, and not needed nor useful in mainline.  I
cannot even see how it would be useful for you.  hang() is defined to
hang the CPU, i. e. to make sure the system will remain in the
current state.  To me this naturally translates into an infinite loop,
the implementation of which is completely hardware and architecture
independent.

Note that hang() is not supposed to do anything else, it just hangs
the system.  If you have a debugger attached, you will be able to do a
simple stack backtrace and see exactly where you are hanging, and why.

If you think you need to have specialized code, you are doing
something wrong.

 It is correct that we do not need this patch now and I can handle it
 here in my own tree.

Good.

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
God made machine language; all the rest is the work of man.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Dear Wolfgang,

On 04/16/2013 03:05 PM, Wolfgang Denk wrote:
 Dear Andreas,
 
 In message 516d4b00.9030...@gmail.com you wrote:

 So it is dead code in mainline, and we will not add it.

 Well, I don't think it is dead code cause the hang() is called in some ways.
 This patch opens just the possibility to specialize the hang() by for
 example a specific board. Maybe this could also be used for specific
 hang() for different arches when we get closer to the common board files.
 
 I think it is dead code, and not needed nor useful in mainline.  I
 cannot even see how it would be useful for you.  hang() is defined to
 hang the CPU, i. e. to make sure the system will remain in the
 current state.  To me this naturally translates into an infinite loop,
 the implementation of which is completely hardware and architecture
 independent.

Yes it is independent (or should at least). But there are still slightly
different versions:

---8---
arch/blackfin/lib/board.c:void hang(void)
arch/blackfin/lib/board.c-{
arch/blackfin/lib/board.c-#ifdef CONFIG_STATUS_LED
arch/blackfin/lib/board.c-  status_led_set(STATUS_LED_BOOT,
STATUS_LED_OFF);
arch/blackfin/lib/board.c-  status_led_set(STATUS_LED_CRASH,
STATUS_LED_BLINKING);
---8---

---8---
arch/arm/lib/board.c:void __hang(void)
arch/arm/lib/board.c-{
arch/arm/lib/board.c-   puts(### ERROR ### Please RESET the board ###\n);
arch/arm/lib/board.c-   for (;;);
arch/arm/lib/board.c-}
---8---

---8---
arch/powerpc/lib/board.c:void __hang(void)
arch/powerpc/lib/board.c-{
arch/powerpc/lib/board.c-   puts(### ERROR ### Please RESET the
board ###\n);
arch/powerpc/lib/board.c-   bootstage_error(BOOTSTAGE_ID_NEED_RESET);
arch/powerpc/lib/board.c-   for (;;)
---8---

 Note that hang() is not supposed to do anything else, it just hangs
 the system.  If you have a debugger attached, you will be able to do a
 simple stack backtrace and see exactly where you are hanging, and why.

Well, for this specific board I plan to panic() on wrong hardware
detection (which will in turn call hang()). My requirements say that I
have to visualize this state then, I thought it would be a good idea to
blink some lights in the endless loop in hang() for this specific board.

 If you think you need to have specialized code, you are doing
 something wrong.

Really? How would you solve this requirement?

Best regards

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Graeme Russ
Hi Andreas,


On Tue, Apr 16, 2013 at 11:32 PM, Andreas Bießmann 
andreas.de...@googlemail.com wrote:

 Dear Wolfgang,

 On 04/16/2013 03:05 PM, Wolfgang Denk wrote:
  Dear Andreas,
 
  In message 516d4b00.9030...@gmail.com you wrote:
 
  So it is dead code in mainline, and we will not add it.
 
  Well, I don't think it is dead code cause the hang() is called in some
ways.
  This patch opens just the possibility to specialize the hang() by for
  example a specific board. Maybe this could also be used for specific
  hang() for different arches when we get closer to the common board
files.
 
  I think it is dead code, and not needed nor useful in mainline.  I
  cannot even see how it would be useful for you.  hang() is defined to
  hang the CPU, i. e. to make sure the system will remain in the
  current state.  To me this naturally translates into an infinite loop,
  the implementation of which is completely hardware and architecture
  independent.

 Yes it is independent (or should at least). But there are still slightly
 different versions:

 ---8---
 arch/blackfin/lib/board.c:void hang(void)
 arch/blackfin/lib/board.c-{
 arch/blackfin/lib/board.c-#ifdef CONFIG_STATUS_LED
 arch/blackfin/lib/board.c-  status_led_set(STATUS_LED_BOOT,
 STATUS_LED_OFF);
 arch/blackfin/lib/board.c-  status_led_set(STATUS_LED_CRASH,
 STATUS_LED_BLINKING);
 ---8---

 ---8---
 arch/arm/lib/board.c:void __hang(void)
 arch/arm/lib/board.c-{
 arch/arm/lib/board.c-   puts(### ERROR ### Please RESET the board
###\n);
 arch/arm/lib/board.c-   for (;;);
 arch/arm/lib/board.c-}
 ---8---

 ---8---
 arch/powerpc/lib/board.c:void __hang(void)
 arch/powerpc/lib/board.c-{
 arch/powerpc/lib/board.c-   puts(### ERROR ### Please RESET the
 board ###\n);
 arch/powerpc/lib/board.c-   bootstage_error(BOOTSTAGE_ID_NEED_RESET);
 arch/powerpc/lib/board.c-   for (;;)
 ---8---

I think that ultimately there should only be a single hang() function

  Note that hang() is not supposed to do anything else, it just hangs
  the system.  If you have a debugger attached, you will be able to do a
  simple stack backtrace and see exactly where you are hanging, and why.

 Well, for this specific board I plan to panic() on wrong hardware
 detection (which will in turn call hang()). My requirements say that I
 have to visualize this state then, I thought it would be a good idea to
 blink some lights in the endless loop in hang() for this specific board.

  If you think you need to have specialized code, you are doing
  something wrong.

 Really? How would you solve this requirement?

Doesn't it make  sense to use panic()?

Regards,

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Hi Graeme,

On 04/16/2013 03:35 PM, Graeme Russ wrote:
 Hi Andreas,
 
 On Tue, Apr 16, 2013 at 11:32 PM, Andreas Bießmann
 andreas.de...@googlemail.com mailto:andreas.de...@googlemail.com wrote:

 Dear Wolfgang,

 On 04/16/2013 03:05 PM, Wolfgang Denk wrote:
  Dear Andreas,
 
  In message 516d4b00.9030...@gmail.com
 mailto:516d4b00.9030...@gmail.com you wrote:

snip

 I think that ultimately there should only be a single hang() function

Ok.

  Note that hang() is not supposed to do anything else, it just hangs
  the system.  If you have a debugger attached, you will be able to do a
  simple stack backtrace and see exactly where you are hanging, and why.

 Well, for this specific board I plan to panic() on wrong hardware
 detection (which will in turn call hang()). My requirements say that I
 have to visualize this state then, I thought it would be a good idea to
 blink some lights in the endless loop in hang() for this specific board.

  If you think you need to have specialized code, you are doing
  something wrong.

 Really? How would you solve this requirement?
 
 Doesn't it make  sense to use panic()?

In my opinion it makes sense to panic(). In my special case I also need
to hang() when panic(). The next question is then how to visualize the
(end-)user of that device that we hang().

Best regards

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas,

In message 516d52ee.1040...@gmail.com you wrote:
 
 Yes it is independent (or should at least). But there are still slightly
 different versions:

Yes, I know :-(

 ---8---
 arch/powerpc/lib/board.c:void __hang(void)
 arch/powerpc/lib/board.c-{
 arch/powerpc/lib/board.c-   puts(### ERROR ### Please RESET the
 board ###\n);
 arch/powerpc/lib/board.c-   bootstage_error(BOOTSTAGE_ID_NEED_RESET);
 arch/powerpc/lib/board.c-   for (;;)
 ---8---

This is probably what the generic code should look like.

  Note that hang() is not supposed to do anything else, it just hangs
  the system.  If you have a debugger attached, you will be able to do a
  simple stack backtrace and see exactly where you are hanging, and why.
 
 Well, for this specific board I plan to panic() on wrong hardware
 detection (which will in turn call hang()). My requirements say that I
 have to visualize this state then, I thought it would be a good idea to
 blink some lights in the endless loop in hang() for this specific board.
 
  If you think you need to have specialized code, you are doing
  something wrong.
 
 Really? How would you solve this requirement?

Turn on the blinking in panic(), before calling hang().  This requires
that you have some way to blink a LED when the CPU is hanging in an
endlss loop, though.

In general, panic() and hang() are for fatal errors where no way of
recovery is possible and where you cannot make any assumptions about
remaining (or even allowed) functionality. The puts() and
bootstage_*() calls above are already stretching the design pretty
far.  We should not add more functionality here.

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
That said, there may be good reasons for what you did beyond obsequi-
ous sycophantic parody. Perhaps you might be so kind as to elucidate.
 -- Tom Christiansen in 5ldjbm$jtk$1...@csnews.cs.colorado.edu
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Graeme Russ
Hi Andreas,


On Wed, Apr 17, 2013 at 12:15 AM, Andreas Bießmann 
andreas.de...@googlemail.com wrote:

 Hi Graeme,

 On 04/16/2013 03:35 PM, Graeme Russ wrote:
  Hi Andreas,
 
  On Tue, Apr 16, 2013 at 11:32 PM, Andreas Bießmann
  andreas.de...@googlemail.com mailto:andreas.de...@googlemail.com
wrote:
 
  Dear Wolfgang,
 
  On 04/16/2013 03:05 PM, Wolfgang Denk wrote:
   Dear Andreas,
  
   In message 516d4b00.9030...@gmail.com
  mailto:516d4b00.9030...@gmail.com you wrote:

 snip

  I think that ultimately there should only be a single hang() function

 Ok.

   Note that hang() is not supposed to do anything else, it just hangs
   the system.  If you have a debugger attached, you will be able to do
a
   simple stack backtrace and see exactly where you are hanging, and
why.
 
  Well, for this specific board I plan to panic() on wrong hardware
  detection (which will in turn call hang()). My requirements say that I
  have to visualize this state then, I thought it would be a good idea to
  blink some lights in the endless loop in hang() for this specific
board.
 
   If you think you need to have specialized code, you are doing
   something wrong.
 
  Really? How would you solve this requirement?
 
  Doesn't it make  sense to use panic()?

 In my opinion it makes sense to panic(). In my special case I also need
 to hang() when panic(). The next question is then how to visualize the
 (end-)user of that device that we hang().

In panic()?

My thought would be along the lines of:
 - Detect something fatal
 - Call panic()
 - Do something to alert the user - puts(), start a LED blinking, etc.
 - Stay in panic() if you need CPU cycles to  keep alerting the user (LED
blinking for example)
 - Call hang() if you've done everything you can

Regards,

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas,

In message 516d5d0a.20...@gmail.com you wrote:
 
 In my opinion it makes sense to panic(). In my special case I also need
 to hang() when panic(). The next question is then how to visualize the
 (end-)user of that device that we hang().

The intention behind hang() is to stop doing anything, i. e. to idle
the board.  Nothing else.

We can argue if this is always a good thing to do.  For example, in
some situations it may be possible to switch off the board instead.
Or, as in your case, to run some code to visualize the state.

I fully agree that these are perfectly reasonable use cases for fatal
error handling in U-Boot.  But then, these are not functions to be
implemented in the context of hang().  Hang is a synonym for place
the CPU into an infinite loop and stop doing anything else.

If you call hang() you agree to hang the system.

If you want to do something else, then please do not call hang(), but
some other function.

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
Overdrawn?  But I still have checks left!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Sinan Akman

Chunhe Lan wrote:

P1023RDB Specification:
---
Memory subsystem:
   512MB DDR3 (Fixed DDR on board)
   64MB NOR flash
   128MB NAND flash

  


Chunhe, what is the orderable part number of
this board, I don't see anything on the FSL web page
with the description above.

Regards

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


[U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Mark Jackson
NanoBone Specification:
---
Memory:
  256MB DDR3
  64MB NOR flash
  256MB NAND flash
  128KB FRAM

Ethernet:
  2 x 10/100 connected to SMSC LAN8710 PHY

USB:
  1 x USB2.0 Type A

I2C:
  2Kbit EEPROM (Microchip 24AA02)
  RTC (Maxim DS1338)
  GPIO Expander (Microchip MCP23017)

Expansion connector:
  6 x UART
  1 x MMC/SD
  1 x USB2.0

Signed-off-by: Mark Jackson m...@newflow.co.uk
---
 MAINTAINERS |4 +
 board/newflow/nanobone/Makefile |   46 ++
 board/newflow/nanobone/board.c  |  337 +++
 board/newflow/nanobone/board.h  |   24 +++
 board/newflow/nanobone/mux.c|  203 +++
 boards.cfg  |1 +
 include/configs/nanobone.h  |  291 +
 7 files changed, 906 insertions(+)
 create mode 100644 board/newflow/nanobone/Makefile
 create mode 100644 board/newflow/nanobone/board.c
 create mode 100644 board/newflow/nanobone/board.h
 create mode 100644 board/newflow/nanobone/mux.c
 create mode 100644 include/configs/nanobone.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 1614b91..7778883 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -710,6 +710,10 @@ Ilko Iliev il...@ronetix.at
PM9263  AT91SAM9263
PM9G45  ARM926EJS (AT91SAM9G45 SoC)
 
+Mark Jackson m...@newflow.co.uk
+
+   NANOBONEARM ARMV7 (AM33xx Soc)
+
 Michael Jones michael.jo...@matrix-vision.de
 
omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/newflow/nanobone/Makefile b/board/newflow/nanobone/Makefile
new file mode 100644
index 000..67a87a1
--- /dev/null
+++ b/board/newflow/nanobone/Makefile
@@ -0,0 +1,46 @@
+#
+# Makefile
+#
+# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed as is WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+ifdef CONFIG_SPL_BUILD
+COBJS  := mux.o
+endif
+
+COBJS  += board.o
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/newflow/nanobone/board.c b/board/newflow/nanobone/board.c
new file mode 100644
index 000..e8f7e00
--- /dev/null
+++ b/board/newflow/nanobone/board.c
@@ -0,0 +1,337 @@
+/*
+ * board.c
+ *
+ * Board functions for Newflow NanoBone board
+ *
+ * Copyright (C) 2013, Newflow Ltd - http://www.newflow.co.uk/
+ *
+ * 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.
+ */
+
+#include common.h
+#include errno.h
+#include asm/arch/clock.h
+#include asm/arch/cpu.h
+#include asm/arch/ddr_defs.h
+#include asm/arch/gpio.h
+#include asm/arch/hardware.h
+#include asm/arch/sys_proto.h
+#include asm/arch/mem.h
+#include asm/arch/mmc_host_def.h
+#include asm/arch/omap.h
+#include asm/emif.h
+#include asm/gpio.h
+#include asm/io.h
+#include cpsw.h
+#include i2c.h
+#include miiphy.h
+#include spl.h
+#include board.h
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* FRAM config */
+#define FRAM_CS1
+#define FRAM_BASE  0x1c00
+#define FRAM_SIZE  GPMC_SIZE_16M
+static u32 gpmc_fram_config[GPMC_MAX_REG] = {
+   0x1200,
+   0x00101000,
+   0x00020201,
+   0x0f030f03,
+   0x010d1010,
+   0x000301c0,
+   0
+};
+
+/* NOR Flash config */
+#define NOR_CS 3
+#define NOR_BASE   0x1800
+#define NOR_SIZE   GPMC_SIZE_64M
+static u32 gpmc_nor_config[GPMC_MAX_REG] = {
+   0x1200,
+   0x00101004,
+   0x00020201,
+   0x10041004,
+   0x010f1010,
+   0x000601c0,
+   0
+};
+
+static struct wd_timer *wdtimer = (struct 

Re: [U-Boot] [PATCH] ARM: mx6: define CONFIG_ARM_ERRATA_742230

2013-04-16 Thread Stefano Babic
On 16/04/2013 16:58, Shawn Guo wrote:
 The ARM errata 742230 - ARM errata: DMB operation may be faulty is
 claimed for Cortex-A9 (r1p0..r2p2).  Though i.MX6 uses a newer revision
 than r2p2, we are seeing a reboot failure on i.MX6 SMP build that can be
 fixed by applying the workaround for this errata.  So for safety, let's
 define CONFIG_ARM_ERRATA_742230 to enable the workaround on i.MX6.
 
 Signed-off-by: Shawn Guo shawn@linaro.org

Hi Shawn,

 ---
  include/configs/mx6_common.h |1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
 index b333937..674bcd3 100644
 --- a/include/configs/mx6_common.h
 +++ b/include/configs/mx6_common.h
 @@ -17,6 +17,7 @@
  #ifndef __MX6_COMMON_H
  #define __MX6_COMMON_H
  
 +#define CONFIG_ARM_ERRATA_742230
  #define CONFIG_ARM_ERRATA_743622
  #define CONFIG_ARM_ERRATA_751472
  

This is a fix, but the release is coming (end of the week). What do you
think if I push this to -next ?

Best regards,
Stefano


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


[U-Boot] [PATCH] ARM: mx6: define CONFIG_ARM_ERRATA_742230

2013-04-16 Thread Shawn Guo
The ARM errata 742230 - ARM errata: DMB operation may be faulty is
claimed for Cortex-A9 (r1p0..r2p2).  Though i.MX6 uses a newer revision
than r2p2, we are seeing a reboot failure on i.MX6 SMP build that can be
fixed by applying the workaround for this errata.  So for safety, let's
define CONFIG_ARM_ERRATA_742230 to enable the workaround on i.MX6.

Signed-off-by: Shawn Guo shawn@linaro.org
---
 include/configs/mx6_common.h |1 +
 1 file changed, 1 insertion(+)

diff --git a/include/configs/mx6_common.h b/include/configs/mx6_common.h
index b333937..674bcd3 100644
--- a/include/configs/mx6_common.h
+++ b/include/configs/mx6_common.h
@@ -17,6 +17,7 @@
 #ifndef __MX6_COMMON_H
 #define __MX6_COMMON_H
 
+#define CONFIG_ARM_ERRATA_742230
 #define CONFIG_ARM_ERRATA_743622
 #define CONFIG_ARM_ERRATA_751472
 
-- 
1.7.9.5


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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Dear Wolfgang,

On 04/16/2013 04:23 PM, Wolfgang Denk wrote:
 Dear Andreas,
 
 In message 516d5d0a.20...@gmail.com you wrote:

 In my opinion it makes sense to panic(). In my special case I also need
 to hang() when panic(). The next question is then how to visualize the
 (end-)user of that device that we hang().
 
 The intention behind hang() is to stop doing anything, i. e. to idle
 the board.  Nothing else.
 
 We can argue if this is always a good thing to do.  For example, in
 some situations it may be possible to switch off the board instead.
 Or, as in your case, to run some code to visualize the state.
 
 I fully agree that these are perfectly reasonable use cases for fatal
 error handling in U-Boot.  But then, these are not functions to be
 implemented in the context of hang().  Hang is a synonym for place
 the CPU into an infinite loop and stop doing anything else.
 
 If you call hang() you agree to hang the system.

I got your point.

 If you want to do something else, then please do not call hang(), but
 some other function.

I will find a solution for my very specific state of the device.

But how about other places in u-boot hang()ing the device? How can we
tell the user that state without a terminal? If one plugs a uart cable
he might see some cause of the hang() but this is not acceptable for
some groups of users.
Is it wise to completely stop a device without showing the state to the
user?
This question is a bit hypothetical cause we should eliminate the root
causes for hang()s before going to market. However I would like to hear
your thoughts about that.

Best regards

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


[U-Boot] Bug in fdt_fixup_fman_firmware

2013-04-16 Thread Николай Пузанов
Hello!

In my opinion I found a bug in the function 'fdt_fixup_fman_firmware'
(arch/powerpc/cpu/mpc85xx/fdt.c): on line 495 function
'simple_strtul' takes an hex number without the prefix '0x' and
considers it a decimal. Here are two variants for correcting this bug,
but I do not know what will be correct:

--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -308,9 +308,9 @@
  */
 int setenv_hex(const char *varname, ulong value)
 {
- char str[17];
+ char str[19];

- sprintf(str, %lx, value);
+ sprintf(str, 0x%lx, value);
  return setenv(varname, str);
 }


--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -492,7 +492,7 @@
  if (!p)
  return;

- fmanfw = (struct qe_firmware *) simple_strtoul(p, NULL, 0);
+ fmanfw = (struct qe_firmware *) simple_strtoul(p, NULL, 16);
  if (!fmanfw)
  return;

I think that would be correct to patch cmd_nvedit.c

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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas,

In message 516d62e1.7090...@gmail.com you wrote:

 But how about other places in u-boot hang()ing the device? How can we
 tell the user that state without a terminal? If one plugs a uart cable
 he might see some cause of the hang() but this is not acceptable for
 some groups of users.
 Is it wise to completely stop a device without showing the state to the
 user?

If you want to tell the user, this should be done _before_ calling
hang() - if you decide to hang() your board.  Keep in mind that you
don't have to define CONFIG_PANIC_HANG.

Also, as done in arch/powerpc/lib/board.c we usually print an error
message on the console device, and we can call bootstage_error(),
which could initialte such actions.

 This question is a bit hypothetical cause we should eliminate the root
 causes for hang()s before going to market. However I would like to hear
 your thoughts about that.

You cannot eliminate all causes that will lead a board to run into
hang().  There may be simply broken hardware, for example...

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
F u cn rd ths u cnt spl wrth a dm!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: mx6: define CONFIG_ARM_ERRATA_742230

2013-04-16 Thread Shawn Guo
On Tue, Apr 16, 2013 at 05:05:30PM +0200, Stefano Babic wrote:
 This is a fix, but the release is coming (end of the week). What do you
 think if I push this to -next ?

No pressure on this, so -next is fine.  Thanks, Stefano.

Shawn

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


[U-Boot] [PATCH v4] add support for the palm treo 680 board

2013-04-16 Thread Mike Dunn
A quick overview of u-boot implementation on the treo 680...

The treo 680 has a Diskonchip G4 nand flash chip.  This device has a 2k region
that maps to the system bus at the reset vector in a NOR-like fashion so that it
can be used as the boot device.  The phone is shipped with this 2k region
configured as write-protected (can't be modified) and programmed with an initial
program loader (IPL).  At power-up, this IPL loads the contents of two flash
blocks to SDRAM and jumps to it.  The capacity of the two blocks is not large
enough to hold all of u-boot, so a u-boot SPL is used.  To conserve flash space,
these two blocks and the necessary number of subsequent blocks are programmed
with a concatenated spl + u-boot image.  That way, the IPL will also load a
portion of u-boot proper, and when the spl runs, it relocates the portion of
u-boot that the IPL has already loaded, and then resumes loading the remaining
part of u-boot before jumping to it.

The default_environment is used (CONFIG_ENV_IS_NOWHERE) because I didn't think
that having a writable environment was worth the cost of a flash block, although
adding it would be straightforward.  I abuse the CONFIG_EXTRA_ENV_SETTINGS
option to specify the usbtty for the console (CONFIG_SYS_CONSOLE_IS_IN_ENV).

Support for the LCD is included, but currently it is only useful for displaying
the u-boot splash screen.  But if u-boot is built without the usbtty console, it
does display the auto-boot progress nicely.

Signed-off-by: Mike Dunn miked...@newsguy.com
---
Changelog:
  v4:
- use CONFIG_MACH_TYPE instead of MACH_TYPE_TREO680 to initialize
  bi_arch_number
- use offset from CONFIG_SYS_DRAM_BASE to initialize bi_boot_params,
  instead of hard-coding an absolute address
- use shift operator to set one bit when initializing gpio register
- remove memcpy() definition from spl build; use
  CONFIG_SPL_LIBGENERIC_SUPPORT to properly build and link with
  u-boot's memcpy()
- config file cleanup: remove erroneous comments, unneeded numerical
  definitions
- edited README.palmtreo680 a bit
  v3: flash_u-boot utility split into separate patch
  v2:
- tabs removed in #defines in palmtreo680.h
- utility for programming u-boot to flash moved to tools/palmtreo680

 CREDITS   |4 +
 MAINTAINERS   |3 +
 board/palmtreo680/Makefile|   34 ++
 board/palmtreo680/palmtreo680.c   |  154 +
 board/palmtreo680/palmtreo680_spl.lds |   51 +++
 boards.cfg|1 +
 doc/README.palmtreo680|  581 +
 include/configs/palmtreo680.h |  287 
 8 files changed, 1115 insertions(+), 0 deletions(-)
 create mode 100644 board/palmtreo680/Makefile
 create mode 100644 board/palmtreo680/palmtreo680.c
 create mode 100644 board/palmtreo680/palmtreo680_spl.lds
 create mode 100644 doc/README.palmtreo680
 create mode 100644 include/configs/palmtreo680.h

diff --git a/CREDITS b/CREDITS
index 7c1458f..3b657e9 100644
--- a/CREDITS
+++ b/CREDITS
@@ -124,6 +124,10 @@ N: James F. Dougherty
 E: j...@gigabitnetworks.com
 D: Port to the MOUSSE board
 
+N: Mike Dunn
+E: miked...@newsguy.com
+D: Palmtreo680 board, docg4 nand flash driver
+
 N: Dave Ellis
 E: d...@sixnetio.com
 D: EEPROM Speedup, SXNI855T port
diff --git a/MAINTAINERS b/MAINTAINERS
index 1614b91..db62af1 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -650,6 +650,9 @@ Wolfgang Denk w...@denx.de
imx27lite   i.MX27
qongi.MX31
 
+Mike Dunn miked...@newsguy.com
+   palmtreo680 pxa270
+
 Kristoffer Ericson kristoffer.eric...@gmail.com
 
jornada SA1110
diff --git a/board/palmtreo680/Makefile b/board/palmtreo680/Makefile
new file mode 100644
index 000..34ffb99
--- /dev/null
+++ b/board/palmtreo680/Makefile
@@ -0,0 +1,34 @@
+#
+# Palm Treo680 Support
+#
+# Copyright (C) 2013 Mike Dunn miked...@newsguy.com
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := palmtreo680.o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/palmtreo680/palmtreo680.c b/board/palmtreo680/palmtreo680.c
new file mode 100644
index 000..d721657
--- /dev/null
+++ b/board/palmtreo680/palmtreo680.c
@@ -0,0 +1,154 @@
+/*
+ * Palm Treo 680 Support
+ *
+ * Copyright (C) 2013 Mike 

Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:

[snip]
 +static struct emif_regs ddr3_emif_reg_data = {
 + .sdram_config = MT41J128MJT125_EMIF_SDCFG,
 + .ref_ctrl = MT41J128MJT125_EMIF_SDREF,
 + .sdram_tim1 = MT41J128MJT125_EMIF_TIM1,
 + .sdram_tim2 = MT41J128MJT125_EMIF_TIM2,
 + .sdram_tim3 = MT41J128MJT125_EMIF_TIM3,
 + .zq_config = MT41J128MJT125_ZQ_CFG,
 + .emif_ddr_phy_ctlr_1 = MT41J128MJT125_EMIF_READ_LATENCY,

On the READ_LATENCY, you probably want | PHY_EN_DYN_PWRDN for that
(since it's not part of MT41J128MJT125_EMIF_READ_LATENCY) bit of
savings.

 +static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const 
 argv[])

Why are we bringing this in?

[snip]
 + config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, ddr3_data,
 +ddr3_cmd_ctrl_data, ddr3_emif_reg_data, 0);

And are you unable to run at 400MHz here?  Or just weren't aware /
having tried updating the timing parameters, etc?

[snip]
 +static struct cpsw_platform_data cpsw_data = {
 + .mdio_base  = CPSW_MDIO_BASE,
 + .cpsw_base  = CPSW_BASE,
 + .mdio_div   = 0xff,
 + .channels   = 8,
 + .cpdma_reg_ofs  = 0x800,
 + .slaves = 2,

Is this all that was needed for both interfaces to work in U-Boot, along
with a config change or two?  If so, I should take a stab at getting
both working on the EVM-SK.

[snip]
 + writel(PORT1_MII_MODE_ENABLE | PORT2_MII_MODE_ENABLE, cdev-miisel);
 + cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_MII;

Can't you just do that in the struct?  And avoid the checkpatch warning
too.

[snip]
 +#define CONFIG_SYS_NO_FLASH

But you have NOR.  Is it not working yet?

 +/*
 + * memtest works on 8 MB in DRAM after skipping 32MB from
 + * start addr of ram disk
 + */
 +#define CONFIG_SYS_MEMTEST_START (PHYS_DRAM_1 + (64 * 1024 * 1024))
 +#define CONFIG_SYS_MEMTEST_END   (CONFIG_SYS_MEMTEST_START \
 + + (8 * 1024 * 1024))

Please see doc/README.memory-test and then eiter update the range to be
most of memory or drop these and add #undef CONFIG_CMD_MEMTEST.

 +#define CONFIG_SYS_HZ1000 /* 1ms clock */
[snip]
 +#define CONFIG_SYS_HZ1000

I see this is a copy/paste problem too from am335x_evm.h, can you fix
there and pcm051.h?

 +#define CONFIG_SERIAL_MULTI

Same (not needed anymore, not sure how it didn't get removed before).

[snip]
 +#define CONFIG_CMD_EEPROM
 +#define CONFIG_SYS_I2C_EEPROM_ADDR   0x50/* Main EEPROM */
 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN   2
 +#define CONFIG_SYS_I2C_MULTI_EEPROMS

Do you really have the EEPROM at 0x50 like the TI boards do (and then at
other offets for capes/daughter cards) ?

[snip]
 +#define  CONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
 + CONFIG_SYS_NAND_ECCSTEPS)
 +
 +#define  CONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE

Another problem duplicated from am335x_evm.h :(

[snip]
 +#define MTDPARTS_DEFAULT mtdparts=nand: \
 + 128k(spl), \
 + 1792k(boot), \

This isn't quite right.  Your first 128k chunks are ROM-checked
redundant locations for SPL to live (hence the write of U-Boot at 512k
in).

 +#undef CONFIG_ENV_IS_NOWHERE

Did you ever set this?  I don't think so... on am335x_evm.h we do since
we can build for SPI env or NAND env.

All that said, yay for another board to try and help flush out generic
problems in am33xx land!

-- 
Tom


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


Re: [U-Boot] [PATCH v2] patman: fix gitutil for decorations

2013-04-16 Thread Simon Glass
On Tue, Apr 16, 2013 at 2:52 AM, Andreas Bießmann
andreas.de...@googlemail.com wrote:
 The git config parameter log.decorate is quite useful when working with git.
 Patman, however can not handle the decorated output when parsing the commit.
 To prevent this use the '--no-decorate' switch for git-log.

 Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com

Thanks.

Acked-by: Simon Glass s...@chromium.org
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Dear Wolfgang,

On 04/16/2013 05:14 PM, Wolfgang Denk wrote:
 Dear Andreas,
 
 In message 516d62e1.7090...@gmail.com you wrote:

 But how about other places in u-boot hang()ing the device? How can we
 tell the user that state without a terminal? If one plugs a uart cable
 he might see some cause of the hang() but this is not acceptable for
 some groups of users.
 Is it wise to completely stop a device without showing the state to the
 user?
 
 If you want to tell the user, this should be done _before_ calling
 hang() - if you decide to hang() your board.  

Well, that is my point. We have about 40 places where we may hang() a
arm device:

---8---
abiessmann@punisher % git grep hang( drivers/ arch/arm/ | wc -l
40
---8---

You say (or at least I understand you so), that I have to hack all these
places with some application specific stuff to inform the user of the
device that we will stop processing now. Why don't we add an interface
to easily change the behavior of hang application specific.

 Keep in mind that you
 don't have to define CONFIG_PANIC_HANG.

Thats true, but in some cases we just want to hang on panic.

 Also, as done in arch/powerpc/lib/board.c we usually print an error
 message on the console device, and we can call bootstage_error(),
 which could initialte such actions.

Ahhh ... I got it. So this is the interface I want! All we need is
bootstage_error() in all hang() variants and thats it.

 This question is a bit hypothetical cause we should eliminate the root
 causes for hang()s before going to market. However I would like to hear
 your thoughts about that.
 
 You cannot eliminate all causes that will lead a board to run into
 hang().  There may be simply broken hardware, for example...

Thats true.

Best regards

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


Re: [U-Boot] Bug in fdt_fixup_fman_firmware

2013-04-16 Thread Wolfgang Denk
Dear Николай Пузанов,

In message cakj6i9ipzbmugxmyfghsquaoy3yz6pntd6ijxgpk-1ps3ok...@mail.gmail.com 
you wrote:
 
 In my opinion I found a bug in the function 'fdt_fixup_fman_firmware'
 (arch/powerpc/cpu/mpc85xx/fdt.c): on line 495 function
 'simple_strtul' takes an hex number without the prefix '0x' and
 considers it a decimal. Here are two variants for correcting this bug,
...
  int setenv_hex(const char *varname, ulong value)
  {
 - char str[17];
 + char str[19];
 
 - sprintf(str, %lx, value);
 + sprintf(str, 0x%lx, value);

NAK.  We don't need all these 0x prefixes.  Hex is the default number
base in U-Boot, so this is redundant.

 - fmanfw = (struct qe_firmware *) simple_strtoul(p, NULL, 0);
 + fmanfw = (struct qe_firmware *) simple_strtoul(p, NULL, 16);

This looks like a reasonable fix to me.

Note: you should have added the MC85xx custodian on Cc: (done now).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
When properly administered, vacations do not  diminish  productivity:
for every week you're away and get nothing done, there's another when
your boss is away and you get twice as much done.  -- Daniel B. Luten
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2013-04-16 Thread Tom Rini
On Mon, Apr 15, 2013 at 09:36:37PM +0200, Albert ARIBAUD wrote:

 Hi Tom,
 
 The following changes since commit
 8960af8ba9488fc54e2e4733cbada26d3cece225:
 
   cosmetic: fix CONFIG_SPL_BSS_MAX_SIZE typo in README (2013-04-14
   17:04:43 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-arm master
 
 for you to fetch changes up to c4a4e2e20ca226948b62ed116df98f7a3932f2ac:
 
   ARMv7: start.S: stay in HYP mode if u-boot is entered in it
   (2013-04-15 18:30:59 +0200)
 
 
 Andre Przywara (1):
   ARMv7: start.S: stay in HYP mode if u-boot is entered in it
 
  arch/arm/cpu/armv7/start.S |   10 +++---
  1 file changed, 7 insertions(+), 3 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Wolfgang Denk
Dear Andreas,

In message 516d6f71.8090...@gmail.com you wrote:
 
 You say (or at least I understand you so), that I have to hack all these
 places with some application specific stuff to inform the user of the
 device that we will stop processing now. Why don't we add an interface
 to easily change the behavior of hang application specific.

Because hang() is a trivial function that does just what the name
says.  If you don't want this, then don't use this.  If you need
additional functionality, then use a function that provides such.

  Keep in mind that you
  don't have to define CONFIG_PANIC_HANG.
 
 Thats true, but in some cases we just want to hang on panic.

Indeed.  Normally this is the most useful thing to do.

  Also, as done in arch/powerpc/lib/board.c we usually print an error
  message on the console device, and we can call bootstage_error(),
  which could initialte such actions.
 
 Ahhh ... I got it. So this is the interface I want! All we need is
 bootstage_error() in all hang() variants and thats it.

As you have to touch all these places anyway, please rather move
hang() out of all architecture specific code and place it in the
global lib/.

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
Misquotation is, in fact, the pride and privilege of the  learned.  A
widely-read  man  never  quotes  accurately,  for  the rather obvious
reason that he has read too widely.
- Hesketh Pearson _Common Misquotations_ introduction
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] make hang() a weak function

2013-04-16 Thread Andreas Bießmann
Dear Wolfgang,

On 16.04.13 18:00, Wolfgang Denk wrote:
 Dear Andreas,
 
 In message 516d6f71.8090...@gmail.com you wrote:

 Also, as done in arch/powerpc/lib/board.c we usually print an error
 message on the console device, and we can call bootstage_error(),
 which could initialte such actions.

 Ahhh ... I got it. So this is the interface I want! All we need is
 bootstage_error() in all hang() variants and thats it.
 
 As you have to touch all these places anyway, please rather move
 hang() out of all architecture specific code and place it in the
 global lib/.

will do.

Best regards

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


Re: [U-Boot] [PATCH 1/5][v4] powerpc/mpc85xx:No NOR boot, do not compile IFC errata A003399

2013-04-16 Thread Scott Wood

On 04/15/2013 11:19:55 PM, Prabhakar Kushwaha wrote:

On 04/16/2013 03:11 AM, Scott Wood wrote:

On 04/15/2013 05:12:48 AM, Prabhakar Kushwaha wrote:
diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c  
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

index dacfdd1..439a873 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -25,7 +25,7 @@

 DECLARE_GLOBAL_DATA_PTR;

-#if defined(CONFIG_SYS_FSL_ERRATUM_IFC_A003399)   
!defined(CONFIG_SYS_RAMBOOT)

+#ifdef CONFIG_A003399_NOR_WORKAROUND


Won't this break bisectability since you don't define  
CONFIG_A003399_NOR_WORKAROUND until a later patch?




This workaround is only required for P1010. so for other SoC it  
should not be defined.  For P1010 it is defined in P10101RDB.h

also all patches of a patch set should be applied at once.

may be I am unable to understand the question.


My point is you should have P1010 define this symbol before you change  
the code here to expect it.  Otherwise, P1010 will be broken for two  
commits and break bisectability.


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


Re: [U-Boot] pull request for u-boot-tegra/master into ARM/master

2013-04-16 Thread Albert ARIBAUD
Hi Tom,

On Mon, 15 Apr 2013 16:28:20 -0700, Tom Warren
twarren.nvi...@gmail.com wrote:

 Albert,
 
 Please pull u-boot-tegra/master into ARM/master. Thanks!
 
 ./MAKEALL for all the Tegra boards is OK, running a ./MAKEALL -a arm now.
 tools/checkpatch.pl is clean.
 
 The following changes since commit c4a4e2e20ca226948b62ed116df98f7a3932f2ac:
 
   ARMv7: start.S: stay in HYP mode if u-boot is entered in it (2013-04-15
 18:30:59 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-tegra master
 
 for you to fetch changes up to 601795462a4e7ede97b64dc306de1002e688eef6:
 
   Tegra: T30: Beaver board support. (2013-04-15 16:13:51 -0700)

+Tom R

Build-testing done on ARM, all fine ; launching some non-ARM tests just
in case. In parallel I'm struggling to run-test on TrimSlice as Stephen
W and Tom W know :), so either someone confirms that ARM ToT does not
break their own Tegra HW, or my 'applied' will have to wait a couple of
hours more, until I apply the Trimslice recipe Stephen gave me off-list.

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


Re: [U-Boot] [PATCH v3 8/8] palmtreo680: add utility that writes u-boot to flash

2013-04-16 Thread Mike Dunn
Thanks again Marek.  A question below...


On 04/14/2013 10:38 AM, Marek Vasut wrote:


[...]


 +
 +if (argc != 3) {
 +printf(usage: %s image file mtd dev node\n, argv[0]);
 +exit(-1);
 
 Use proper errno and return as you're returning from main() anyway.


Agreed regarding 'return'.  But should I be concerned with setting or preserving
errno before all 'return -1' lines?  Is it normal practice for a common utility
to set errno?  errno will have to be saved in many places, since perror() itself
can change it.  This will add many more lines of code.


[...]


 +
 +blockbuf = malloc(RELIABLE_BLOCKSIZE);
 
 Do you not want to use some calloc() here to make sure the blockbuf is 
 zeroed?


Not necessary here; the buffer is always filled or the utility exits with error.
 But will change to calloc() anyway.

[...]


 +
 +/* read data for one block from file */
 +while (len != 0  (read_ret = read(datafd, buf, len)) != 0) {
 
 Uh, this really might be a candidate for IOCCC, split this please ...


Well, OK, but... I normally don't embed calls in tests, but I do it here because
the read is performed at the start of each loop iteration, and I thought this
made it clearer and more concise.  Basically it means loop while there's still
more data to write, and read() does not return EOF.

Actually, read() should never return EOF, because earlier I check the file
length, so if I'm going to do the sanity check anyway, maybe it should be 
separate.

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


Re: [U-Boot] [PATCH v3 8/8] palmtreo680: add utility that writes u-boot to flash

2013-04-16 Thread Marek Vasut
Dear Mike Dunn,

 Thanks again Marek.  A question below...
 
 
 On 04/14/2013 10:38 AM, Marek Vasut wrote:
 
 
 [...]
 
  +
  +  if (argc != 3) {
  +  printf(usage: %s image file mtd dev node\n, argv[0]);
  +  exit(-1);
  
  Use proper errno and return as you're returning from main() anyway.
 
 Agreed regarding 'return'.  But should I be concerned with setting or
 preserving errno before all 'return -1' lines?  Is it normal practice for
 a common utility to set errno?  errno will have to be saved in many
 places, since perror() itself can change it.  This will add many more
 lines of code.

Ooops! errno.h, sorry for the confusion :-(

 [...]
 
  +
  +  blockbuf = malloc(RELIABLE_BLOCKSIZE);
  
  Do you not want to use some calloc() here to make sure the blockbuf is
  zeroed?
 
 Not necessary here; the buffer is always filled or the utility exits with
 error. But will change to calloc() anyway.

If you're sure it's filled, then it's no problem.

 [...]
 
  +
  +  /* read data for one block from file */
  +  while (len != 0  (read_ret = read(datafd, buf, len)) != 0) {
  
  Uh, this really might be a candidate for IOCCC, split this please ...
 
 Well, OK, but... I normally don't embed calls in tests, but I do it here
 because the read is performed at the start of each loop iteration, and I
 thought this made it clearer and more concise.  Basically it means loop
 while there's still more data to write, and read() does not return EOF.
 
 Actually, read() should never return EOF, because earlier I check the file
 length, so if I'm going to do the sanity check anyway, maybe it should be
 separate.

I'd say you can loop and break; out if needed, no ?

while (cond.) {
 if (x)
  break;
 if (y)
  break;

 do_useful_stuff here;
}

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


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Mark Jackson

On 16/04/13 16:48, Tom Rini wrote:

On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:

[snip]

+static struct emif_regs ddr3_emif_reg_data = {
+   .sdram_config = MT41J128MJT125_EMIF_SDCFG,
+   .ref_ctrl = MT41J128MJT125_EMIF_SDREF,
+   .sdram_tim1 = MT41J128MJT125_EMIF_TIM1,
+   .sdram_tim2 = MT41J128MJT125_EMIF_TIM2,
+   .sdram_tim3 = MT41J128MJT125_EMIF_TIM3,
+   .zq_config = MT41J128MJT125_ZQ_CFG,
+   .emif_ddr_phy_ctlr_1 = MT41J128MJT125_EMIF_READ_LATENCY,


On the READ_LATENCY, you probably want | PHY_EN_DYN_PWRDN for that
(since it's not part of MT41J128MJT125_EMIF_READ_LATENCY) bit of
savings.


Okay, I'd not looked at the DDR setup in great detail, simply copying 
what the EVM-SK did.



+static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const 
argv[])


Why are we bringing this in?


There's currently no way to enable BCH8 ECC mode.  I need this so that 
all writes to the on-board NAND have the correct ECC values.


There's a similar bunch of code in the OMAP3 board.c file, so I just 
copied that principal.


Ah ... I've just seen this changed recently (don't know why my code even 
compiles now as the headers are different !!).  I'll just back this out 
and use the existing version.



+   config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, ddr3_data,
+  ddr3_cmd_ctrl_data, ddr3_emif_reg_data, 0);


And are you unable to run at 400MHz here?  Or just weren't aware /
having tried updating the timing parameters, etc?


Again, I just copied the EVM-SK code.

DDR3 is a new technology for us, but now the board essentially works I 
should (when I have time !!) be able do some further timing tweaks.



+static struct cpsw_platform_data cpsw_data = {
+   .mdio_base  = CPSW_MDIO_BASE,
+   .cpsw_base  = CPSW_BASE,
+   .mdio_div   = 0xff,
+   .channels   = 8,
+   .cpdma_reg_ofs  = 0x800,
+   .slaves = 2,


Is this all that was needed for both interfaces to work in U-Boot, along
with a config change or two?  If so, I should take a stab at getting
both working on the EVM-SK.


Yes ... the config change is just to set CONFIG_PHY_ADDR to the correct 
value.


Unfortunately, since the CONFIG_PHY_ADDR value is hard-coded into 
quite a bit of the uboot code, to change ports, you need to re-compile 
!!  Not ideal, and I don't suppose it's too much work to get both

working together, but I don't see much demand for it.


+   writel(PORT1_MII_MODE_ENABLE | PORT2_MII_MODE_ENABLE, cdev-miisel);
+   cpsw_slaves[0].phy_if = cpsw_slaves[1].phy_if = PHY_INTERFACE_MODE_MII;


Can't you just do that in the struct?  And avoid the checkpatch warning
too.


Sure, will do.


+#define CONFIG_SYS_NO_FLASH


But you have NOR.  Is it not working yet?


We do have NOR and it's working, but it doesn't contain any user 
accessible data.  We use it as long-term storage using a custom layout, 
so there's no point in exposing it to uboot.



+/*
+ * memtest works on 8 MB in DRAM after skipping 32MB from
+ * start addr of ram disk
+ */
+#define CONFIG_SYS_MEMTEST_START   (PHYS_DRAM_1 + (64 * 1024 * 1024))
+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \
+   + (8 * 1024 * 1024))


Please see doc/README.memory-test and then eiter update the range to be
most of memory or drop these and add #undef CONFIG_CMD_MEMTEST.


I'll just drop memtest.


+#define CONFIG_SYS_HZ  1000 /* 1ms clock */

[snip]

+#define CONFIG_SYS_HZ  1000


I see this is a copy/paste problem too from am335x_evm.h, can you fix
there and pcm051.h?


Sure, I'll post a remove duplicate #defines patch.


+#define CONFIG_SERIAL_MULTI


Same (not needed anymore, not sure how it didn't get removed before).


Ok.


+#define CONFIG_CMD_EEPROM
+#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50/* Main EEPROM */
+#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
+#define CONFIG_SYS_I2C_MULTI_EEPROMS


Do you really have the EEPROM at 0x50 like the TI boards do (and then at
other offets for capes/daughter cards) ?


Yes, but it doesn't contain the same TI EEPROM data structure.  In fact, 
at the moment, it doesn't contain anything (!!).


It's just there for future expansion  in which case, should I remove 
the #defines for the time being ?



+#defineCONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
+   CONFIG_SYS_NAND_ECCSTEPS)
+
+#defineCONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE


Another problem duplicated from am335x_evm.h :(


I'll add it to the remove duplicates patch.


+#define MTDPARTS_DEFAULT   mtdparts=nand: \
+   128k(spl), \
+   1792k(boot), \


This isn't quite right.  Your first 128k chunks are ROM-checked
redundant locations for SPL to live (hence 

[U-Boot] Please pull u-boot-x86.git

2013-04-16 Thread Simon Glass
Hi Tom,

[sorry, take 2]

Unfortunately I found some problems in x86 that I had not picked up on earlier.


The following changes since commit cba6494f24d711ba63afb22b1ee691a41fee121c:

  Prepare v2013.04-rc3 (2013-04-15 11:47:10 -0400)

are available in the git repository at:

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

for you to fetch changes up to 054fcf6b562cd80a5e8cbf0fa61db9e8695fe3e4:

  x86: Fix wrong 4G filtering (2013-04-15 16:39:57 -0700)


Simon Glass (3):
  x86: Fix DRAM bank size init with generic board
  x86: Allow setup code to manage its own global data
  x86: config: Init PCI before SPI

Vladimir 'φ-coder/phcoder' Serbinenko (1):
  x86: Fix wrong 4G filtering

 arch/x86/cpu/coreboot/sdram.c | 12 ++--
 common/board_f.c  |  5 ++---
 common/board_r.c  |  3 ---
 include/configs/coreboot.h|  1 +
 4 files changed, 13 insertions(+), 8 deletions(-)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 08:14:13PM +0100, Mark Jackson wrote:

 On 16/04/13 16:48, Tom Rini wrote:
 On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:
 
 [snip]
 +static int do_switch_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * 
 const argv[])
 
 Why are we bringing this in?
 
 There's currently no way to enable BCH8 ECC mode.  I need this so
 that all writes to the on-board NAND have the correct ECC values.
 
 There's a similar bunch of code in the OMAP3 board.c file, so I just
 copied that principal.
 
 Ah ... I've just seen this changed recently (don't know why my code
 even compiles now as the headers are different !!).  I'll just back
 this out and use the existing version.

Right, for am335x we just always do BCH8 in hardware (can't easily make
SW matching BCH8).  Once we have BCH16 it'll also be automatic switching
since that's what the ROM does and we always want to be ROM-compatible.

 +   config_ddr(303, MT41J128MJT125_IOCTRL_VALUE, ddr3_data,
 +  ddr3_cmd_ctrl_data, ddr3_emif_reg_data, 0);
 
 And are you unable to run at 400MHz here?  Or just weren't aware /
 having tried updating the timing parameters, etc?
 
 Again, I just copied the EVM-SK code.
 
 DDR3 is a new technology for us, but now the board essentially works
 I should (when I have time !!) be able do some further timing
 tweaks.

You should be able to come up with optimal ones with your DDR data sheet
and the TRM at hand.

 +static struct cpsw_platform_data cpsw_data = {
 +   .mdio_base  = CPSW_MDIO_BASE,
 +   .cpsw_base  = CPSW_BASE,
 +   .mdio_div   = 0xff,
 +   .channels   = 8,
 +   .cpdma_reg_ofs  = 0x800,
 +   .slaves = 2,
 
 Is this all that was needed for both interfaces to work in U-Boot, along
 with a config change or two?  If so, I should take a stab at getting
 both working on the EVM-SK.
 
 Yes ... the config change is just to set CONFIG_PHY_ADDR to the
 correct value.
 
 Unfortunately, since the CONFIG_PHY_ADDR value is hard-coded into
 quite a bit of the uboot code, to change ports, you need to
 re-compile !!  Not ideal, and I don't suppose it's too much work to
 get both
 working together, but I don't see much demand for it.

Ah, so it's not quite right :(  Other platforms support multiple
interfaces, but I don't know how they're setup.

[snip]
 +#define CONFIG_SYS_NO_FLASH
 
 But you have NOR.  Is it not working yet?
 
 We do have NOR and it's working, but it doesn't contain any user
 accessible data.  We use it as long-term storage using a custom
 layout, so there's no point in exposing it to uboot.

A comment above please, roughly to that effect?

[snip]
 +#define CONFIG_SYS_HZ  1000 /* 1ms clock */
 [snip]
 +#define CONFIG_SYS_HZ  1000
 
 I see this is a copy/paste problem too from am335x_evm.h, can you fix
 there and pcm051.h?
 
 Sure, I'll post a remove duplicate #defines patch.
 
 +#define CONFIG_SERIAL_MULTI
 
 Same (not needed anymore, not sure how it didn't get removed before).
 
 Ok.

Thanks!

 +#define CONFIG_CMD_EEPROM
 +#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50/* Main EEPROM */
 +#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
 +#define CONFIG_SYS_I2C_MULTI_EEPROMS
 
 Do you really have the EEPROM at 0x50 like the TI boards do (and then at
 other offets for capes/daughter cards) ?
 
 Yes, but it doesn't contain the same TI EEPROM data structure.  In
 fact, at the moment, it doesn't contain anything (!!).
 
 It's just there for future expansion  in which case, should I
 remove the #defines for the time being ?

No, that's fine, just making sure it's really there.

 +#defineCONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
 +   CONFIG_SYS_NAND_ECCSTEPS)
 +
 +#defineCONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE
 
 Another problem duplicated from am335x_evm.h :(
 
 I'll add it to the remove duplicates patch.

Thanks!

-- 
Tom


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


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Mark Jackson

On 16/04/13 20:14, Mark Jackson wrote:

On 16/04/13 16:48, Tom Rini wrote:

On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:


snip


+#defineCONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
+CONFIG_SYS_NAND_ECCSTEPS)
+
+#defineCONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE


Another problem duplicated from am335x_evm.h :(


I'll add it to the remove duplicates patch.


Replied a bit too soon on this one ... I thought they were duplicated, 
but they're not.


what's the problem with these lines ?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 08:25:17PM +0100, Mark Jackson wrote:
 On 16/04/13 20:14, Mark Jackson wrote:
 On 16/04/13 16:48, Tom Rini wrote:
 On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:
 
 snip
 
 +#defineCONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
 +CONFIG_SYS_NAND_ECCSTEPS)
 +
 +#defineCONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE
 
 Another problem duplicated from am335x_evm.h :(
 
 I'll add it to the remove duplicates patch.
 
 Replied a bit too soon on this one ... I thought they were
 duplicated, but they're not.
 
 what's the problem with these lines ?

'#definetab' not '#definespace'.  A general fixup patch is fine.

-- 
Tom


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


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Mark Jackson

On 16/04/13 20:27, Tom Rini wrote:

On Tue, Apr 16, 2013 at 08:25:17PM +0100, Mark Jackson wrote:

On 16/04/13 20:14, Mark Jackson wrote:

On 16/04/13 16:48, Tom Rini wrote:

On Tue, Apr 16, 2013 at 04:02:34PM +0100, Mark Jackson wrote:


snip


+#defineCONFIG_SYS_NAND_ECCTOTAL(CONFIG_SYS_NAND_ECCBYTES * \
+CONFIG_SYS_NAND_ECCSTEPS)
+
+#defineCONFIG_SYS_NAND_U_BOOT_STARTCONFIG_SYS_TEXT_BASE


Another problem duplicated from am335x_evm.h :(


I'll add it to the remove duplicates patch.


Replied a bit too soon on this one ... I thought they were
duplicated, but they're not.

what's the problem with these lines ?


'#definetab' not '#definespace'.  A general fixup patch is fine.


Actually, neither CONFIG_SYS_NAND_ECCTOTAL nor CONFIG_SYS_NAND_ECCSTEPS 
are used anywhere in the code !!


I'll just remove them.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Please pull u-boot-x86.git

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 12:15:36PM -0700, Simon Glass wrote:

 Vladimir '?-coder/phcoder' Serbinenko (1):
   x86: Fix wrong 4G filtering

Two problems.  First, this is missing a signed-off-by line.  Second,
nicnames in the author field are frowned upon to not allowed here.
Thanks!

-- 
Tom


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


Re: [U-Boot] pull request for u-boot-tegra/master into ARM/master

2013-04-16 Thread Stephen Warren
On 04/16/2013 11:17 AM, Albert ARIBAUD wrote:
 Hi Tom,
 
 On Mon, 15 Apr 2013 16:28:20 -0700, Tom Warren
 twarren.nvi...@gmail.com wrote:
 
 Albert,

 Please pull u-boot-tegra/master into ARM/master. Thanks!

 ./MAKEALL for all the Tegra boards is OK, running a ./MAKEALL -a arm now.
 tools/checkpatch.pl is clean.

 The following changes since commit c4a4e2e20ca226948b62ed116df98f7a3932f2ac:

   ARMv7: start.S: stay in HYP mode if u-boot is entered in it (2013-04-15
 18:30:59 +0200)

 are available in the git repository at:

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

 for you to fetch changes up to 601795462a4e7ede97b64dc306de1002e688eef6:

   Tegra: T30: Beaver board support. (2013-04-15 16:13:51 -0700)
 
 +Tom R
 
 Build-testing done on ARM, all fine ; launching some non-ARM tests just
 in case. In parallel I'm struggling to run-test on TrimSlice as Stephen
 W and Tom W know :), so either someone confirms that ARM ToT does not
 break their own Tegra HW, or my 'applied' will have to wait a couple of
 hours more, until I apply the Trimslice recipe Stephen gave me off-list.

FWIW, I just tested both u-boot-arm/master and u-boot-tegra/master on
TrimSlice and they work fine (well, at least boot to the command-prompt
anyway)

ARM:
c4a4e2e ARMv7: start.S: stay in HYP mode if u-boot is entered in it
Tegra:
6017954 Tegra: T30: Beaver board support.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] pull request for u-boot-tegra/master into ARM/master

2013-04-16 Thread Tom Warren
Thanks, Stephen.

 -Original Message-
 From: Stephen Warren [mailto:swar...@wwwdotorg.org]
 Sent: Tuesday, April 16, 2013 12:56 PM
 To: Albert ARIBAUD
 Cc: Tom Warren; m...@theia.denx.de; Jimmy Zhang; u-boot@lists.denx.de;
 Tom Warren; Tom Rini; Stephen Warren
 Subject: Re: [U-Boot] pull request for u-boot-tegra/master into ARM/master
 
 On 04/16/2013 11:17 AM, Albert ARIBAUD wrote:
  Hi Tom,
 
  On Mon, 15 Apr 2013 16:28:20 -0700, Tom Warren
  twarren.nvi...@gmail.com wrote:
 
  Albert,
 
  Please pull u-boot-tegra/master into ARM/master. Thanks!
 
  ./MAKEALL for all the Tegra boards is OK, running a ./MAKEALL -a arm
 now.
  tools/checkpatch.pl is clean.
 
  The following changes since commit
 c4a4e2e20ca226948b62ed116df98f7a3932f2ac:
 
ARMv7: start.S: stay in HYP mode if u-boot is entered in it
  (2013-04-15
  18:30:59 +0200)
 
  are available in the git repository at:
 
git://git.denx.de/u-boot-tegra master
 
  for you to fetch changes up to
 601795462a4e7ede97b64dc306de1002e688eef6:
 
Tegra: T30: Beaver board support. (2013-04-15 16:13:51 -0700)
 
  +Tom R
 
  Build-testing done on ARM, all fine ; launching some non-ARM tests
  just in case. In parallel I'm struggling to run-test on TrimSlice as
  Stephen W and Tom W know :), so either someone confirms that ARM ToT
  does not break their own Tegra HW, or my 'applied' will have to wait a
  couple of hours more, until I apply the Trimslice recipe Stephen gave me
 off-list.
 
 FWIW, I just tested both u-boot-arm/master and u-boot-tegra/master on
 TrimSlice and they work fine (well, at least boot to the command-prompt
 anyway)
 
 ARM:
 c4a4e2e ARMv7: start.S: stay in HYP mode if u-boot is entered in it
 Tegra:
 6017954 Tegra: T30: Beaver board support.
--
nvpublic
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Fix wrong 4G filtering

2013-04-16 Thread Simon Glass
+Tom

Hi Vladimir,

On Mon, Apr 15, 2013 at 4:51 PM, Simon Glass s...@chromium.org wrote:
 On Sun, Apr 7, 2013 at 8:33 AM, Vladimir 'φ-coder/phcoder' Serbinenko
 phco...@gmail.com wrote:
 Filtering of 4G chunks is wrong and one of such chunks can be improperly 
 declared
 as usable ram top after being cut down to 4G, so uboot tries to relocate to 
 ROM.


 With commit message re-formatted to 80cols, applied to x86/master, thank you.

My mistake - this is missing a signoff, and also should not have a
Nickname in your email.

Can you please resend this patch with these problems fixed?

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


Re: [U-Boot] Please pull u-boot-x86.git

2013-04-16 Thread Simon Glass
Hi Tom,

[Trying again with the offending patch removed for now]

The following changes since commit cba6494f24d711ba63afb22b1ee691a41fee121c:

  Prepare v2013.04-rc3 (2013-04-15 11:47:10 -0400)

are available in the git repository at:

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

for you to fetch changes up to 617c246f3c123d4a2d4dba9d08a4a2dd324cb407:

  x86: config: Init PCI before SPI (2013-04-15 16:26:43 -0700)


Simon Glass (3):
  x86: Fix DRAM bank size init with generic board
  x86: Allow setup code to manage its own global data
  x86: config: Init PCI before SPI

 arch/x86/cpu/coreboot/sdram.c | 7 ++-
 common/board_f.c  | 5 ++---
 common/board_r.c  | 3 ---
 include/configs/coreboot.h| 1 +
 4 files changed, 9 insertions(+), 7 deletions(-)

Regards,
Simon


On Tue, Apr 16, 2013 at 12:53 PM, Tom Rini tr...@ti.com wrote:
 On Tue, Apr 16, 2013 at 12:15:36PM -0700, Simon Glass wrote:

 Vladimir '?-coder/phcoder' Serbinenko (1):
   x86: Fix wrong 4G filtering

 Two problems.  First, this is missing a signed-off-by line.  Second,
 nicnames in the author field are frowned upon to not allowed here.
 Thanks!

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


[U-Boot] [PATCH v4] palmtreo680: add utility that writes u-boot to flash

2013-04-16 Thread Mike Dunn
This adds a userspace linux utility that writes the u-boot image to an mtd
partition on the docg4 nand flash.

A special utility is required to do this because u-boot is partially loaded by
an initial program loader (IPL) that is permanently programmed to the boot
region of the flash.  This IPL expects the image to be written in a unique
format. The characteristics of this format can be summarized as follows:
  - Flash blocks to be loaded must have a magic number in the oob bytes of the
first page of the block.
  - Each page must be written redundantly in the subsequent page.
  - The integrated flash controller's reliable mode is used, requiring that
alternate 2k regions (4 pages) are skipped when writing.
For these reasons, a u-boot image can not be written using nandwrite from
mtd-utils.

Signed-off-by: Mike Dunn miked...@newsguy.com
---
Changelog:
  v4:
- use return instead of exit
- use calloc() instead of malloc()
- remove call to read() from within while loop test 
  v3: new patch; split off from patch 7 in v2 of patchset

I was wrong, Marek... the read() will return EOF while writing the last block,
unless the size of the image is such that it fills the last block.  Otherwise,
the last block is only partially written, and stops at EOF.  This is fine.

 tools/palmtreo680/flash_u-boot.c |  168 ++
 1 files changed, 168 insertions(+), 0 deletions(-)
 create mode 100644 tools/palmtreo680/flash_u-boot.c

diff --git a/tools/palmtreo680/flash_u-boot.c b/tools/palmtreo680/flash_u-boot.c
new file mode 100644
index 000..8f8dadf
--- /dev/null
+++ b/tools/palmtreo680/flash_u-boot.c
@@ -0,0 +1,168 @@
+/*
+ * Copyright (C) 2013 Mike Dunn miked...@newsguy.com
+ *
+ * This file is released under the terms of GPL v2 and any later version.
+ * See the file COPYING in the root directory of the source tree for details.
+ *
+ *
+ * This is a userspace Linux utility that, when run on the Treo 680, will
+ * program u-boot to flash.  The docg4 driver *must* be loaded with the
+ * reliable_mode and ignore_badblocks parameters enabled:
+ *
+ *modprobe docg4 ignore_badblocks=1 reliable_mode=1
+ *
+ * This utility writes the concatenated spl + u-boot image to the start of the
+ * mtd device in the format expected by the IPL/SPL.  The image file and mtd
+ * device node are passed to the utility as arguments.  The blocks must have
+ * been erased beforehand.
+ *
+ * When you compile this, note that it links to libmtd from mtd-utils, so 
ensure
+ * that your include and lib paths include this.
+ */
+
+#include stdio.h
+#include stdlib.h
+#include sys/stat.h
+#include fcntl.h
+#include string.h
+#include sys/types.h
+#include unistd.h
+#include errno.h
+#include mtd/mtd-user.h
+#include libmtd.h
+
+#define RELIABLE_BLOCKSIZE  0x1 /* block capacity in reliable mode */
+#define STANDARD_BLOCKSIZE  0x4 /* block capacity in normal mode */
+#define PAGESIZE 512
+#define PAGES_PER_BLOCK 512
+#define OOBSIZE 7  /* available to user (16 total) */
+
+uint8_t ff_oob[OOBSIZE] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
+
+/* this is the magic number the IPL looks for (ASCII BIPO) */
+uint8_t page0_oob[OOBSIZE] = {'B', 'I', 'P', 'O', 0xff, 0xff, 0xff};
+
+int main(int argc, char * const argv[])
+{
+   int devfd, datafd, num_blocks, block;
+   off_t file_size;
+   libmtd_t mtd_desc;
+   struct mtd_dev_info devinfo;
+   uint8_t *blockbuf;
+   char response[8];
+
+   if (argc != 3) {
+   printf(usage: %s image file mtd dev node\n, argv[0]);
+   return -1;
+   }
+
+   mtd_desc = libmtd_open();
+   if (mtd_desc == NULL) {
+   fprintf(stderr, can't initialize libmtd\n);
+   return -1;
+   }
+
+   /* open the spl image file and mtd device */
+   datafd = open(argv[1], O_RDONLY);
+   if (datafd == -1) {
+   perror(argv[1]);
+   return -1;
+   }
+   devfd = open(argv[2], O_WRONLY);
+   if (devfd == -1) {
+   perror(argv[2]);
+   return -1;
+   }
+   if (mtd_get_dev_info(mtd_desc, argv[2], devinfo)  0) {
+   fprintf(stderr, mtd_get_dev_info failed\n);
+   return -1;
+   }
+
+   /* determine the number of blocks needed by the image */
+   file_size = lseek(datafd, 0, SEEK_END);
+   if (file_size == (off_t)-1) {
+   perror(lseek);
+   return -1;
+   }
+   num_blocks = (file_size + RELIABLE_BLOCKSIZE - 1) / RELIABLE_BLOCKSIZE;
+   file_size = lseek(datafd, 0, SEEK_SET);
+   if (file_size == (off_t)-1) {
+   perror(lseek);
+   return -1;
+   }
+   printf(The mtd partition contains %d blocks\n, devinfo.eb_cnt);
+   printf(U-boot will occupy %d blocks\n, num_blocks);
+   if (num_blocks  devinfo.eb_cnt) {
+   fprintf(stderr, Insufficient blocks on partition\n);
+   

Re: [U-Boot] Please pull u-boot-x86.git

2013-04-16 Thread Tom Rini
On Tue, Apr 16, 2013 at 01:07:33PM -0700, Simon Glass wrote:

 Hi Tom,
 
 [Trying again with the offending patch removed for now]
 
 The following changes since commit cba6494f24d711ba63afb22b1ee691a41fee121c:
 
   Prepare v2013.04-rc3 (2013-04-15 11:47:10 -0400)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-x86.git master
 
 for you to fetch changes up to 617c246f3c123d4a2d4dba9d08a4a2dd324cb407:
 
   x86: config: Init PCI before SPI (2013-04-15 16:26:43 -0700)
 
 
 Simon Glass (3):
   x86: Fix DRAM bank size init with generic board
   x86: Allow setup code to manage its own global data
   x86: config: Init PCI before SPI
 
  arch/x86/cpu/coreboot/sdram.c | 7 ++-
  common/board_f.c  | 5 ++---
  common/board_r.c  | 3 ---
  include/configs/coreboot.h| 1 +
  4 files changed, 9 insertions(+), 7 deletions(-)

Applied to u-boot/master, thanks!

-- 
Tom


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


[U-Boot] [PATCH] beagleboard: Update comment in get_board_rev()

2013-04-16 Thread Tom Rini
We are able to tell the difference between xM Rev Ax/Bx and xM Rev Cx,
and have been for some time.  The comment above the function however did
not list this, so update.

Signed-off-by: Tom Rini tr...@ti.com
---
 board/ti/beagle/beagle.c |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 3d9b6dd..c686f40 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -108,13 +108,14 @@ int board_init(void)
 /*
  * Routine: get_board_revision
  * Description: Detect if we are running on a Beagle revision Ax/Bx,
- * C1/2/3, C4 or xM. This can be done by reading
+ * C1/2/3, C4, xM Ax/Bx or xM Cx. This can be done by reading
  * the level of GPIO173, GPIO172 and GPIO171. This should
  * result in
  * GPIO173, GPIO172, GPIO171: 1 1 1 = Ax/Bx
  * GPIO173, GPIO172, GPIO171: 1 1 0 = C1/2/3
  * GPIO173, GPIO172, GPIO171: 1 0 1 = C4
- * GPIO173, GPIO172, GPIO171: 0 0 0 = xM
+ * GPIO173, GPIO172, GPIO171: 0 1 0 = xM Cx
+ * GPIO173, GPIO172, GPIO171: 0 0 0 = xM Ax/Bx
  */
 static int get_board_revision(void)
 {
-- 
1.7.9.5

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


Re: [U-Boot] [PATCH v4 7/7] cros: enable cros-ec for smdk5250

2013-04-16 Thread Simon Glass
Hi Minkyu,

On Thu, Apr 4, 2013 at 1:17 PM, Simon Glass s...@chromium.org wrote:
 On Tue, Apr 2, 2013 at 3:01 AM, Hung-ying Tyan ty...@chromium.org wrote:

 This patch initiates cros-ec in board_init() to enable it for smdk5250.

 Signed-off-by: Simon Glass s...@chromium.org
 Signed-off-by: Vincent Palatin vpala...@chromium.org
 Signed-off-by: Hung-ying Tyan ty...@chromium.org
 ---
 Changes in v4: None
 Changes in v3: None
 Changes in v2:
 - Moved code from smdk5250.c (non-FDT) to exynos5-dt.c (FDT).
 - Moved code from smdk5250.h to exynos5250-dt.h.
 - Added commit message.
 - Dropped the period from commit subject.


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


I see now that this patch has the wrong tag (cros: but should be
exynos:) and so perhaps you didn't see it. It was queued up for the
current release but may be too late now - can you please take a look?

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


Re: [U-Boot] pull request for u-boot-tegra/master into ARM/master

2013-04-16 Thread Albert ARIBAUD
Hi Tom,

On Mon, 15 Apr 2013 16:28:20 -0700, Tom Warren
twarren.nvi...@gmail.com wrote:

 Albert,
 
 Please pull u-boot-tegra/master into ARM/master. Thanks!
 
 ./MAKEALL for all the Tegra boards is OK, running a ./MAKEALL -a arm now.
 tools/checkpatch.pl is clean.
 
 The following changes since commit c4a4e2e20ca226948b62ed116df98f7a3932f2ac:
 
   ARMv7: start.S: stay in HYP mode if u-boot is entered in it (2013-04-15
 18:30:59 +0200)
 
 are available in the git repository at:
 
   git://git.denx.de/u-boot-tegra master
 
 for you to fetch changes up to 601795462a4e7ede97b64dc306de1002e688eef6:
 
   Tegra: T30: Beaver board support. (2013-04-15 16:13:51 -0700)
 
 
 Stephen Warren (1):
   ARM: tegra: support T33 SKU of Tegra30
 
 Thierry Reding (4):
   Tegra: All Tamonten-derived boards use onboard NAND
   Tegra: Medcom-Wide: Enable NAND and boot script support
   Tegra: Plutux: Enable NAND and boot script support
   Tegra: TEC: Enable boot script support
 
 Tom Warren (7):
   Tegra: enable verify support for the crc32 command
   Tegra: Restore cp15 VBAR _start vector write for ARMv7
   Tegra: Configure L2 cache control reg properly.
   Tegra114: Initialize System Counter (TSC) with osc frequency
   Tegra: Fix MSELECT clock divisors for T30/T114.
   Tegra: Split tegra_get_chip_type() into soc  sku funcs
   Tegra: T30: Beaver board support.
 
  MAINTAINERS|  1 +
  arch/arm/cpu/arm720t/tegra-common/cpu.c| 48 +---
  arch/arm/cpu/arm720t/tegra-common/cpu.h|  4 +-
  arch/arm/cpu/arm720t/tegra114/cpu.c| 10 ++--
  arch/arm/cpu/arm720t/tegra30/cpu.c |  4 +-
  arch/arm/cpu/armv7/start.S |  2 -
  arch/arm/cpu/tegra-common/Makefile |  2 +-
  arch/arm/cpu/tegra-common/ap.c | 53 --
  arch/arm/cpu/tegra-common/cache.c  | 48 
  arch/arm/cpu/tegra-common/clock.c  |  3 +
  arch/arm/cpu/tegra114-common/clock.c   | 22 
  arch/arm/cpu/tegra20-common/clock.c|  4 ++
  arch/arm/cpu/tegra20-common/pmu.c  |  4 +-
  arch/arm/cpu/tegra30-common/clock.c|  4 ++
  arch/arm/include/asm/arch-tegra/ap.h   | 21 ++-
  arch/arm/include/asm/arch-tegra/clock.h|  3 +
  arch/arm/include/asm/arch-tegra/tegra.h|  1 +
  arch/arm/include/asm/arch-tegra114/sysctr.h| 35 
  arch/arm/include/asm/arch-tegra114/tegra.h |  1 +
  board/avionic-design/dts/tegra20-tamonten.dtsi | 11 
  board/avionic-design/dts/tegra20-tec.dts   | 11 
  board/nvidia/common/emc.c  |  2 +-
  board/nvidia/dts/tegra30-beaver.dts| 71
 
  boards.cfg |  1 +
  include/configs/beaver.h   | 76
 ++
  include/configs/medcom-wide.h  | 21 ---
  include/configs/plutux.h   | 18 +++---
  include/configs/tec.h  | 10 +---
  include/configs/tegra-common.h |  2 +
  29 files changed, 404 insertions(+), 89 deletions(-)
  create mode 100644 arch/arm/cpu/tegra-common/cache.c
  create mode 100644 arch/arm/include/asm/arch-tegra114/sysctr.h
  create mode 100644 board/nvidia/dts/tegra30-beaver.dts
  create mode 100644 include/configs/beaver.h

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

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


Re: [U-Boot] [PATCH] crc32: Correct endianness of crc32 result

2013-04-16 Thread Simon Glass
Hi Wolfgang,

On Sat, Apr 6, 2013 at 12:04 AM, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,

 In message 1365203470-9099-1-git-send-email-...@chromium.org you wrote:
 When crc32 is handled by the hash library, it requires the data to be in
 big-endian format, since it reads it byte-wise. Thus at present the 'crc32'
 command reports incorrect data. For example, previously we might see:


 +#ifdef USE_HOSTCC
 + crc = htobe32(crc);
   memcpy(output, crc, sizeof(crc));
 +#else
 + put_unaligned_be32(crc, output);
 +#endif

 Why is this depending on USE_HOSTCC, and not on the endianess?

We always want big-endian in this case, since the bytes have to date
been written that way by the crc32 command.


 And why do we need the #ifdef?  Can we not always use htobe32() and
 put_unaligned_be32() ?

Well I don't think put_unaligned_be32 is available to user space,
which is the environment that the tools are built under. It is
available in the kernel, but that's not our environment.

I'm not happy with this solution and would be pleased to find a better
way, but I'm not sure what it is.

But this patch does fix a real bug which we should sort out before the
release, one way or another.


 Best regards,

 Wolfgang Denk

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


Re: [U-Boot] [PATCH v2] patman: fix gitutil for decorations

2013-04-16 Thread Simon Glass
+Tom

On Tue, Apr 16, 2013 at 8:48 AM, Simon Glass s...@chromium.org wrote:
 On Tue, Apr 16, 2013 at 2:52 AM, Andreas Bießmann
 andreas.de...@googlemail.com wrote:
 The git config parameter log.decorate is quite useful when working with git.
 Patman, however can not handle the decorated output when parsing the commit.
 To prevent this use the '--no-decorate' switch for git-log.

 Signed-off-by: Andreas Bießmann andreas.de...@googlemail.com

 Thanks.

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

Tom can you please pick this fix up also? It could cause people some problems.

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


Re: [U-Boot] [PATCH] crc32: Correct endianness of crc32 result

2013-04-16 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 04/16/2013 05:57 PM, Simon Glass wrote:
 Hi Wolfgang,
 
 On Sat, Apr 6, 2013 at 12:04 AM, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,
 
 In message 1365203470-9099-1-git-send-email-...@chromium.org
 you wrote:
 When crc32 is handled by the hash library, it requires the data
 to be in big-endian format, since it reads it byte-wise. Thus
 at present the 'crc32' command reports incorrect data. For
 example, previously we might see:
 
 
 +#ifdef USE_HOSTCC + crc = htobe32(crc); memcpy(output,
 crc, sizeof(crc)); +#else + put_unaligned_be32(crc,
 output); +#endif
 
 Why is this depending on USE_HOSTCC, and not on the endianess?
 
 We always want big-endian in this case, since the bytes have to
 date been written that way by the crc32 command.

In other words, this code is executed on both the host and the target,
and there's not a uniform endian sanitizer function.

- -- 
Tom
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJRbdghAAoJENk4IS6UOR1WzzsP/j+JhIIkp9EK4YwDQ7H6F06V
i60/Y/EaVg32HAqMjo66y2GCcu7ak9fobZo3wHnAjrFkaSJWq4s+eDNOtJiHbr/O
ZwQbDJ/t5Yf7vuZ1OhBTII+pYHXYcDW+30QZpBP3+ydY8Zkg7tsAcQ5rH7KdHWuD
83k7DLjv9obn85eeVikNkfB7ONNFVRug07Obcd+jbXdQamc/VWxWZyvUwDiKGCYH
eqmss/hQ7o343FWKqsVNSxd3/tF7z3PNevWm83xJxlc5xbtyJ/8kad6qkkILtOGd
G5OOXnL7BpSqL2mxt5ruW+cwqOnp74SvoQXuM6lNZzeAmlirAginYbnDSvjQamIy
DK1BQAjodXGU7nZxffw4vKZzbGzkgRl2KkuGvQfpMJzoJRyWvrbDzIVOeF/bXXQS
UEvASOFAdqKpMPNJnIm16GUtH6/OyEWK+8HInFse7K19ycM4M/TpM2dhmVZrHG0S
Q+Xq7ZI6pEq0SjMIfhuCwYJS6lqbtlQ5eOk+KoTYXOWneOzOgDGKO+El53wDwKQ5
0icIUwNKn4ZKMg7HLE25Docx3Ez6OVBD2Aelz0wlc5FMWlmLrHe9oYaufDN36bBH
D5XrLeBDjj89mTOHl4V0U3tZ/1iLLFqxo9RyNG6lPkLOQD62vLPxjyPYqY8Q6q85
kPdToR/o/YfFk3EsiYpD
=0O7d
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] crc32: Correct endianness of crc32 result

2013-04-16 Thread Simon Glass
Hi Tom,

On Tue, Apr 16, 2013 at 4:00 PM, Tom Rini tr...@ti.com wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 On 04/16/2013 05:57 PM, Simon Glass wrote:
 Hi Wolfgang,

 On Sat, Apr 6, 2013 at 12:04 AM, Wolfgang Denk w...@denx.de wrote:
 Dear Simon Glass,

 In message 1365203470-9099-1-git-send-email-...@chromium.org
 you wrote:
 When crc32 is handled by the hash library, it requires the data
 to be in big-endian format, since it reads it byte-wise. Thus
 at present the 'crc32' command reports incorrect data. For
 example, previously we might see:


 +#ifdef USE_HOSTCC + crc = htobe32(crc); memcpy(output,
 crc, sizeof(crc)); +#else + put_unaligned_be32(crc,
 output); +#endif

 Why is this depending on USE_HOSTCC, and not on the endianess?

 We always want big-endian in this case, since the bytes have to
 date been written that way by the crc32 command.

 In other words, this code is executed on both the host and the target,
 and there's not a uniform endian sanitizer function.

Well to be honest, I don't think the code is needed on the host, and I
could put the #ifdef around the whole function. I just thought that
might be a bit short-sighted.

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


Re: [U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Scott Wood

On 04/16/2013 04:00:46 AM, Chunhe Lan wrote:

+struct fsl_e_tlb_entry tlb_table[] = {
+   /* TLB 0 - for temp stack in cache */
+	SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR,  
CONFIG_SYS_INIT_RAM_ADDR,

+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 0, BOOKE_PAGESZ_4K, 0),
+   SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
+ CONFIG_SYS_INIT_RAM_ADDR + 4 * 1024,
+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 0, BOOKE_PAGESZ_4K, 0),
+   SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
+ CONFIG_SYS_INIT_RAM_ADDR + 8 * 1024,
+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 0, BOOKE_PAGESZ_4K, 0),
+   SET_TLB_ENTRY(0, CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
+ CONFIG_SYS_INIT_RAM_ADDR + 12 * 1024,
+ MAS3_SX|MAS3_SW|MAS3_SR, 0,
+ 0, 0, BOOKE_PAGESZ_4K, 0),
+
+   /* TLB 1 */
+   /* *I*** - Covers boot page */
+   SET_TLB_ENTRY(1, 0xf000, 0xf000,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I,
+ 0, 0, BOOKE_PAGESZ_4K, 1),
+
+   /* *I*G* - CCSRBAR */
+   SET_TLB_ENTRY(1, CONFIG_SYS_CCSRBAR, CONFIG_SYS_CCSRBAR_PHYS,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 1, BOOKE_PAGESZ_4M, 1),
+
+   /* W**G* - Flash/promjet, localbus */
+   /* This will be changed to *I*G* after relocation to RAM. */
+	SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE,  
CONFIG_SYS_FLASH_BASE_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_W|MAS2_G,
+ 0, 2, BOOKE_PAGESZ_256M, 1),
+
+   /* *I*G* - PCI */
+	SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT,  
CONFIG_SYS_PCIE3_MEM_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 3, BOOKE_PAGESZ_1G, 1),
+
+   /* *I*G* - PCI */
+   SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x4000,
+ CONFIG_SYS_PCIE3_MEM_PHYS + 0x4000,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 4, BOOKE_PAGESZ_256M, 1),
+
+   SET_TLB_ENTRY(1, CONFIG_SYS_PCIE3_MEM_VIRT + 0x5000,
+ CONFIG_SYS_PCIE3_MEM_PHYS + 0x5000,
+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 5, BOOKE_PAGESZ_256M, 1),


Do not use MAS3_SX on I/O mappings.  The G bit does not prevent  
speculative instruction fetches.



+   /* *I*G - NAND */
+	SET_TLB_ENTRY(1, CONFIG_SYS_NAND_BASE,  
CONFIG_SYS_NAND_BASE_PHYS,

+ MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+ 0, 11, BOOKE_PAGESZ_1M, 1),


Why do you need 1M for NAND?  There's only 8K of stuff there.


+/*
+ * Memory map
+ *
+ * 0x_	0x1fff_	DDR			500M  
Cacheable
+ * 0x8000_	0xbfff_	PCI Express Mem		1G  
non-cacheable
+ * 0xc000_	0xdfff_	PCI			512M  
non-cacheable
+ * 0xe100_	0xe3ff_	PCI IO range		4M  
non-cacheable

+ *
+ * Localbus non-cacheable
+ *
+ * 0xec00_	0xefff_	NOR flash		64M NOR  
flash

+ * 0xff00_ 0xff3f_ DPAA_QBMAN  4M
+ * 0xff60_	0xff7f_	CCSR			2M  
non-cacheable
+ * 0xffa0_	0xffaf_	NAND			1M  
non-cacheable
+ * 0xffd0_	0xffd0_3fff	L1 for stack		16K  
Cacheable TLB0

+ */


L1 for stack is neither localbus nor non-cacheable.  If you don't  
want to distinguish that category, remove the comment.


[snip hundreds of lines of board config file]

Can we please refactor these board config headers to focus only on  
what's different from board to board?  These patches are very hard to  
effectively review as is.


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


[U-Boot] [PATCH] Allow U-Boot scripts to be placed in a .env file

2013-04-16 Thread Simon Glass
At present U-Boot environment variables, and thus scripts, are defined
by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
to this file and dealing with quoting and newlines is harder than it
should be. It would be better if we could just type the script into a
text file and have it included by U-Boot.

Add a feature that brings in a .env file associated with the board
config, if present. To use it, create a file in include/configs
with the same name as you could board config file, except with a
.env extension instead of a .h extension. The variables should be
separated by \0. Comments are permitted, using # as the first character
in a line.

Signed-off-by: Simon Glass s...@chromium.org
---
 Makefile | 25 -
 README   | 28 
 include/env_default.h|  2 ++
 mkconfig |  4 
 tools/scripts/env2string.sed |  7 +++
 5 files changed, 65 insertions(+), 1 deletion(-)
 create mode 100644 tools/scripts/env2string.sed

diff --git a/Makefile b/Makefile
index 252fc6c..f400d21 100644
--- a/Makefile
+++ b/Makefile
@@ -680,7 +680,7 @@ $(obj)include/autoconf.mk.dep: $(obj)include/config.h 
include/common.h
$(CC) -x c -DDO_DEPS_ONLY -M $(CFLAGS) $(CPPFLAGS) \
-MQ $(obj)include/autoconf.mk include/common.h  $@
 
-$(obj)include/autoconf.mk: $(obj)include/config.h
+$(obj)include/generated/autoconf.mk.base: $(obj)include/config.h
@$(XECHO) Generating $@ ; \
set -e ; \
: Extract the config macros ; \
@@ -688,6 +688,29 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
sed -n -f tools/scripts/define2mk.sed  $@.tmp  \
mv $@.tmp $@
 
+ENV_HEADER = $(obj)include/generated/environment.h
+
+$(obj)include/generated/environment.inc: 
$(obj)include/generated/autoconf.mk.base
+   @$(XECHO) Generating $@ ; \
+   set -e ; \
+   : Process the environment file ; \
+   envf=$$(sed -n -e '/CONFIG_EXTRA_ENV_SCRIPT/ { 
s/CONFIG_EXTRA_ENV_SCRIPT=\\(.*\)\/\1/;  p }' \
+   $) ; \
+   echo -n CONFIG_EXTRA_ENV_TEXT=\ $@ ; \
+   echo -n #define CONFIG_EXTRA_ENV_TEXT \ $(ENV_HEADER) ; \
+   if [ -f $(src)include/configs/$${envf} ]; then \
+   : Change newline to \n, and quote quotes ; \
+   sed -e 's/^\#.*//' $(src)include/configs/$${envf} | \
+   sed -f tools/scripts/env2string.sed | \
+   sed -e 's//\\/g' | \
+   tr -d '\n' | tee -a $(ENV_HEADER) $@ ; \
+   fi ; \
+   echo \ $@
+   echo \ $(ENV_HEADER)
+
+$(obj)include/autoconf.mk: $(obj)include/generated/environment.inc
+   cat $(obj)include/generated/autoconf.mk.base $ $@
+
 $(obj)include/generated/generic-asm-offsets.h: $(obj)include/autoconf.mk.dep \
$(obj)lib/asm-offsets.s
@$(XECHO) Generating $@
diff --git a/README b/README
index 0bc0af5..6076c90 100644
--- a/README
+++ b/README
@@ -4245,6 +4245,34 @@ environment. As long as you don't save the environment 
you are
 working with an in-memory copy. In case the Flash area containing the
 environment is erased by accident, a default environment is provided.
 
+The default environment is created in include/env_default.h, and can be
+augmented by various CONFIG defines. See that file for details. In
+particular you can define CONFIG_EXTRA_ENV_SETTINGS in your board file
+to add environment variables (see 'CONFIG_EXTRA_ENV_SETTINGS' above
+for details).
+
+It is also possible to create a .env file in include/configs for your
+board. For example, for snapper9260 you would create a text file called
+include/configs/snapper9260.env containing the environment text. This
+file can include comments (lines starting with #) and blank lines. As
+with CONFIG_EXTRA_ENV_SETTINGS you must add a \0 at the end of each
+variable (except the last). For example:
+
+bootcmd=
+# U-Boot script for booting
+
+if [ -z ${tftpserverip} ]; then
+   echo Use 'setenv tftpserverip a.b.c.d' to set your machine IP address.
+fi
+
+usb start; setenv autoload n; bootp;
+tftpboot ${tftpserverip}:;
+bootm
+\0failed=
+# Print a message when boot fails
+echo Boot failed - please check your image
+
+
 Some configuration options can be set using Environment Variables.
 
 List of environment variables (most likely not complete):
diff --git a/include/env_default.h b/include/env_default.h
index 39c5b7c..a394df5 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -137,6 +137,8 @@ const uchar default_environment[] = {
 #ifdef CONFIG_EXTRA_ENV_SETTINGS
CONFIG_EXTRA_ENV_SETTINGS
 #endif
+   /* This is created in the Makefile */
+   CONFIG_EXTRA_ENV_TEXT
\0
 #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
}
diff --git a/mkconfig b/mkconfig
index 73f852e..c54b730 100755
--- a/mkconfig
+++ b/mkconfig
@@ -171,10 +171,14 @@ echo #define CONFIG_SYS_BOARD \${board}\  config.h
 
 cat  EOF  config.h
 

Re: [U-Boot] [PATCH] Exynos5: Add support for USB download boot mode

2013-04-16 Thread Minkyu Kang
On 15/04/13 14:36, Vivek Gautam wrote:
 Hi,
 
 
 On Sat, Apr 13, 2013 at 7:50 PM, Simon Glass s...@chromium.org wrote:
 Hi,

 On Tue, Feb 5, 2013 at 9:04 PM, Vivek Gautam gautamvivek1...@gmail.com 
 wrote:
 Hi Simon,


 On Tue, Feb 5, 2013 at 2:56 AM, Simon Glass s...@chromium.org wrote:
 Hi,

 On Mon, Jan 28, 2013 at 2:39 AM, Vivek Gautam gautam.vi...@samsung.com 
 wrote:
 Exynos5250 supports secondary USB device boot mode. If the iROM fails
 to download u-boot from the primary boot device (such as SD or eMMC),
 it will try to retrieve from the secondary boot device (such as USB).

 Signed-off-by: Naveen Krishna Ch ch.nav...@samsung.com
 Signed-off-by: Simon Glass s...@chromium.org
 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

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


 Thanks for reviewing.

 But please see comment below.

 ---

 NOTE:
  - Based on 'master' branch of u-boot-samsung.
  - Tested with smdk5250 for usb download mode.

  board/samsung/smdk5250/spl_boot.c |   40 
 +++-
  include/configs/exynos5250-dt.h   |5 
  2 files changed, 43 insertions(+), 2 deletions(-)

 diff --git a/board/samsung/smdk5250/spl_boot.c 
 b/board/samsung/smdk5250/spl_boot.c
 index d8f3c1e..c0bcf46 100644
 --- a/board/samsung/smdk5250/spl_boot.c
 +++ b/board/samsung/smdk5250/spl_boot.c
 @@ -32,6 +32,21 @@ enum boot_mode {
  };

 typedef u32 (*spi_copy_func_t)(u32 offset, u32 nblock, u32 dst);
 +   typedef u32 (*usb_copy_func_t)(void);
 +
 +/*
 + * Set/clear program flow prediction and return the previous state.
 + */
 +static int config_branch_prediction(int set_cr_z)
 +{
 +   unsigned int cr;
 +
 +   /* System Control Register: 11th bit Z Branch prediction enable */
 +   cr = get_cr();
 +   set_cr(set_cr_z ? cr | CR_Z : cr  ~CR_Z);
 +
 +   return cr  CR_Z;
 +}

  /*
  * Copy U-boot from mmc to RAM:
 @@ -41,10 +56,20 @@ enum boot_mode {
  void copy_uboot_to_ram(void)
  {
 spi_copy_func_t spi_copy;
 -   enum boot_mode bootmode;
 +   usb_copy_func_t usb_copy;
 +
 +   int is_cr_z_set;
 +   unsigned int sec_boot_check;
 +   enum boot_mode bootmode = BOOT_MODE_OM;
 u32 (*copy_bl2)(u32, u32, u32);

 -   bootmode = readl(EXYNOS5_POWER_BASE)  OM_STAT;
 +   /* Read iRAM location to check for secondary USB boot mode */
 +   sec_boot_check = readl(EXYNOS_IRAM_SECONDARY_BASE);
 +   if (sec_boot_check == EXYNOS_USB_SECONDARY_BOOT)
 +   bootmode = BOOT_MODE_USB;
 +
 +   if (bootmode == BOOT_MODE_OM)
 +   bootmode = readl(EXYNOS5_POWER_BASE)  OM_STAT;

 switch (bootmode) {
 case BOOT_MODE_SERIAL:
 @@ -57,6 +82,17 @@ void copy_uboot_to_ram(void)
 copy_bl2(BL2_START_OFFSET, BL2_SIZE_BLOC_COUNT,
 CONFIG_SYS_TEXT_BASE);
 break;
 +   case BOOT_MODE_USB:
 +   /*
 +* iROM needs program flow prediction to be disabled
 +* before copy from USB device to RAM
 +*/
 +   is_cr_z_set = config_branch_prediction(0);
 +   usb_copy = *(usb_copy_func_t *)
 +   EXYNOS_COPY_USB_FNPTR_ADDR;
 +   usb_copy();
 +   config_branch_prediction(is_cr_z_set);
 +   break;
 default:
 break;
 }
 diff --git a/include/configs/exynos5250-dt.h 
 b/include/configs/exynos5250-dt.h
 index cabd2f2..6728b0e 100644
 --- a/include/configs/exynos5250-dt.h
 +++ b/include/configs/exynos5250-dt.h
 @@ -123,6 +123,11 @@
  #define CONFIG_USB_EHCI_EXYNOS
  #define CONFIG_USB_STORAGE

 +/* USB boot mode */
 +#define EXYNOS_COPY_USB_FNPTR_ADDR 0x02020070
 +#define EXYNOS_USB_SECONDARY_BOOT  0xfeed0002
 +#define EXYNOS_IRAM_SECONDARY_BASE 0x02020018


 What happened to the function pointer table patch?

 I think i missed that patch from Amar, :-(
 will remove these #defines and use the function pointer table instead.

 I notice that this patch has not made it to mainline. It really should
 be there since without it it is not possible to USB boot on snow,
 which makes development awkward.

 Can we get this applied in time for the release? The comment made
 above can be dealt with later perhaps.
 
 Sorry for not responding to this patch for long, but was still waiting
 for Amar's emmc booting patch
 to get merged (which carries the funtion pointer table).
 
 Hi Minkyu,
 Is it fine with you if we pull this in for now, and post a patch later
 to make things aligned
 with funtion-pointer table ?
 
 This patch cleanly applies on u-boot-samsung/master.
 
 

applied to u-boot-samsung

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


Re: [U-Boot] [PATCH 1/2] exynos: Correct use of 64-bit division

2013-04-16 Thread Minkyu Kang
On 13/04/13 23:26, Simon Glass wrote:
 The current code is causing errors like this on my toolchains:
 
 /usr/x86_64-pc-linux-gnu/armv7a-cros-linux-gnueabi/binutils-bin/2.22/
 ld.bfd.real: failed to merge target specific data of file /usr/lib/gcc/
 armv7a-cros-linux-gnueabi/4.7.x-google/libgcc.a(_divdi3.o)
 
 Use do_div() to avoid this.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
  arch/arm/cpu/armv7/s5p-common/timer.c | 7 ++-
  1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/armv7/s5p-common/timer.c 
 b/arch/arm/cpu/armv7/s5p-common/timer.c
 index 6a0fa58..4adfaae 100644
 --- a/arch/arm/cpu/armv7/s5p-common/timer.c
 +++ b/arch/arm/cpu/armv7/s5p-common/timer.c
 @@ -24,6 +24,7 @@
   */
  
  #include common.h
 +#include div64.h
  #include asm/io.h
  #include asm/arch/pwm.h
  #include asm/arch/clk.h
 @@ -76,6 +77,8 @@ int timer_init(void)
   */
  unsigned long get_timer(unsigned long base)
  {
 + unsigned long long time_ms;
 +
   ulong now = timer_get_us_down();
  
   /*
 @@ -87,7 +90,9 @@ unsigned long get_timer(unsigned long base)
   gd-arch.lastinc = now;
  
   /* Divide by 1000 to convert from us to ms */
 - return gd-arch.timer_reset_value / 1000 - base;
 + time_ms = gd-arch.timer_reset_value;
 + do_div(time_ms, 1000);
 + return time_ms - base;
  }
  
  unsigned long timer_get_us(void)
 

applied to u-boot-samsung

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


Re: [U-Boot] [PATCH 2/2] exynos: fdt: Add TMU node for snow

2013-04-16 Thread Minkyu Kang
On 13/04/13 23:26, Simon Glass wrote:
 Snow is missing a TMU node, and with TMU support this is not allowed, so it
 fails to boot. Add it.
 
 Signed-off-by: Simon Glass s...@chromium.org
 ---
  board/samsung/dts/exynos5250-snow.dts | 14 ++
  1 file changed, 14 insertions(+)
 
 diff --git a/board/samsung/dts/exynos5250-snow.dts 
 b/board/samsung/dts/exynos5250-snow.dts
 index 8b303bf..24658c1 100644
 --- a/board/samsung/dts/exynos5250-snow.dts
 +++ b/board/samsung/dts/exynos5250-snow.dts
 @@ -55,4 +55,18 @@
   compatible = maxim,max77686_pmic;
   };
   };
 +
 + tmu@1006 {
 + samsung,min-temp= 25;
 + samsung,max-temp= 125;
 + samsung,start-warning   = 95;
 + samsung,start-tripping  = 105;
 + samsung,hw-tripping = 110;
 + samsung,efuse-min-value = 40;
 + samsung,efuse-value = 55;
 + samsung,efuse-max-value = 100;
 + samsung,slope   = 274761730;
 + samsung,dc-value= 25;
 + };
 +
  };
 

applied to u-boot-samsung

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


[U-Boot] please pull u-boot-samsung master

2013-04-16 Thread Minkyu Kang
Dear Albert,

The following changes since commit 601795462a4e7ede97b64dc306de1002e688eef6:

  Tegra: T30: Beaver board support. (2013-04-15 16:13:51 -0700)

are available in the git repository at:

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

for you to fetch changes up to f2e8a87305a55652488af140adcf65b1e688f287:

  exynos: fdt: Add TMU node for snow (2013-04-17 10:00:44 +0900)


Simon Glass (2):
  exynos: Correct use of 64-bit division
  exynos: fdt: Add TMU node for snow

Vivek Gautam (1):
  Exynos5: Add support for USB download boot mode

 arch/arm/cpu/armv7/s5p-common/timer.c |7 +-
 board/samsung/dts/exynos5250-snow.dts |   14 
 board/samsung/smdk5250/spl_boot.c |   40 +++--
 include/configs/exynos5250-dt.h   |5 +
 4 files changed, 63 insertions(+), 3 deletions(-)
-- 
Thanks,
Minkyu Kang.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [STATUS] v2013.04-rc3 released

2013-04-16 Thread Minkyu Kang
On 16/04/13 08:12, Simon Glass wrote:
 +Minkyu,
 
 Hi Tom,
 
 On Mon, Apr 15, 2013 at 8:57 AM, Tom Rini tr...@ti.com wrote:
 Hey all,

 I was hoping to release v2013.04 today, but that's not happening.  The
 good news is that there were some issues in the ARM tree that got sorted
 out and things are better now than they were before.  But, I didn't want
 to grab the PR over the weekend and then release today, so I grabbed the
 pull today, tested it a bit here too, and now we have -rc3.

 I plan to grab the following tomorrow, unless people point out a
 problem:
 http://patchwork.ozlabs.org/patch/188194/
 http://patchwork.ozlabs.org/patch/226608/
 http://patchwork.ozlabs.org/patch/216783/
 http://patchwork.ozlabs.org/patch/216766/ (these two will need a little
 hand fiddling to apply, that's all).
 
 It seems that this exynos patch got dropped on the floor:
 
 http://patchwork.ozlabs.org/patch/216155/
 
 and these two seem to be needed for snow to boot now:
 
 http://patchwork.ozlabs.org/patch/236360/
 http://patchwork.ozlabs.org/patch/236358/
 
 Minkyu, can you please look at picking these up for this release?
 
 
 I have also found a few x86 problems will I will collect apply to x86/master.
 

 I've also asked Albert to take a look at:
 http://patchwork.ozlabs.org/patch/233094/

 And at this point I plan to release Friday.

 --
 Tom
 
 Regards,
 Simon
 

applied those tree patches.

Albert, please pull u-boot-samsung master

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


Re: [U-Boot] [PATCH] fdt: Ensure that libfdt_env.h comes from U-Boot

2013-04-16 Thread Jerry Van Baren

Hi Simon,

On 04/12/2013 04:24 PM, Simon Glass wrote:

Hi Tom / Jerry,


[snip]


Another way to fix this is to use -nostdinc and -idirafter to ensure that
system includes are included after U-Boot ones. Unfortunately this means
that U-Boot's errno.h gets included instead of the system one. This in
turn requires a hack to errno.h to redirect things, so all in all the
solution in this patch is probably cleaner.


[snip]


Can this be considered for the release please?


This appears to be a reasonable request to fix an outstanding bug.  I 
don't have time today or tomorrow, but I'll pull in your patch and move 
it forward, Tom willing.



Regards,
Simon


Thanks,
gvb


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


Re: [U-Boot] [PATCH 1/3 V5] EXYNOS5: Add gpio pin numbering feature

2013-04-16 Thread Rajeshwari Birje
Hi Minkyu Kang,

Please do let me know if any comments on these patchset.

Regards,
Rajeshwari Shinde

On Wed, Apr 3, 2013 at 5:24 PM, Rajeshwari Shinde
rajeshwar...@samsung.com wrote:
 This patch adds support for gpio pin numbering support on
 EXYNOS5250
 To have consistent 0..n-1 GPIO numbering the banks are divided
 into different parts where ever they have holes in them.

 Signed-off-by: Leela Krishna Amudala l.kris...@samsung.com
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
 Changes in V2:
 - none.
 Changes in V3:
 - none.
 Changes in V4:
 - To have consistent 0..n-1 GPIO numbering the banks are divided
 into different parts where ever they have holes in them.
 - Combined previous patch 1 and 2 into single patch.
 Changes in V5:
 - Removed Exynos5 specific code in gpio driver api to
 get bank.
 - Added #define HAVE_GENERIC_GPIO in config file
 to remove conditinal CPU check in gpio driver.
  arch/arm/cpu/armv7/exynos/pinmux.c  |  150 --
  arch/arm/include/asm/arch-exynos/cpu.h  |   10 +-
  arch/arm/include/asm/arch-exynos/gpio.h |  452 
 +++
  board/samsung/smdk5250/smdk5250.c   |   24 +-
  drivers/gpio/s5p_gpio.c |   42 +++
  include/configs/exynos5250-dt.h |1 +
  6 files changed, 522 insertions(+), 157 deletions(-)

 diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c 
 b/arch/arm/cpu/armv7/exynos/pinmux.c
 index bd499b4..2fb5963 100644
 --- a/arch/arm/cpu/armv7/exynos/pinmux.c
 +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
 @@ -29,89 +29,77 @@

  static void exynos5_uart_config(int peripheral)
  {
 -   struct exynos5_gpio_part1 *gpio1 =
 -   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 -   struct s5p_gpio_bank *bank;
 int i, start, count;

 switch (peripheral) {
 case PERIPH_ID_UART0:
 -   bank = gpio1-a0;
 -   start = 0;
 +   start = EXYNOS5_GPIO_A00;
 count = 4;
 break;
 case PERIPH_ID_UART1:
 -   bank = gpio1-d0;
 -   start = 0;
 +   start = EXYNOS5_GPIO_D00;
 count = 4;
 break;
 case PERIPH_ID_UART2:
 -   bank = gpio1-a1;
 -   start = 0;
 +   start = EXYNOS5_GPIO_A10;
 count = 4;
 break;
 case PERIPH_ID_UART3:
 -   bank = gpio1-a1;
 -   start = 4;
 +   start = EXYNOS5_GPIO_A14;
 count = 2;
 break;
 }
 for (i = start; i  start + count; i++) {
 -   s5p_gpio_set_pull(bank, i, GPIO_PULL_NONE);
 -   s5p_gpio_cfg_pin(bank, i, GPIO_FUNC(0x2));
 +   gpio_set_pull(i, GPIO_PULL_NONE);
 +   gpio_cfg_pin(i, GPIO_FUNC(0x2));
 }
  }

  static int exynos5_mmc_config(int peripheral, int flags)
  {
 -   struct exynos5_gpio_part1 *gpio1 =
 -   (struct exynos5_gpio_part1 *) samsung_get_base_gpio_part1();
 -   struct s5p_gpio_bank *bank, *bank_ext;
 -   int i, start = 0, gpio_func = 0;
 +   int i, start, start_ext, gpio_func = 0;

 switch (peripheral) {
 case PERIPH_ID_SDMMC0:
 -   bank = gpio1-c0;
 -   bank_ext = gpio1-c1;
 -   start = 0;
 +   start = EXYNOS5_GPIO_C00;
 +   start_ext = EXYNOS5_GPIO_C10;
 gpio_func = GPIO_FUNC(0x2);
 break;
 case PERIPH_ID_SDMMC1:
 -   bank = gpio1-c2;
 -   bank_ext = NULL;
 +   start = EXYNOS5_GPIO_C20;
 +   start_ext = 0;
 break;
 case PERIPH_ID_SDMMC2:
 -   bank = gpio1-c3;
 -   bank_ext = gpio1-c4;
 -   start = 3;
 +   start = EXYNOS5_GPIO_C30;
 +   start_ext = EXYNOS5_GPIO_C43;
 gpio_func = GPIO_FUNC(0x3);
 break;
 case PERIPH_ID_SDMMC3:
 -   bank = gpio1-c4;
 -   bank_ext = NULL;
 +   start = EXYNOS5_GPIO_C40;
 +   start_ext = 0;
 break;
 }
 -   if ((flags  PINMUX_FLAG_8BIT_MODE)  !bank_ext) {
 +   if ((flags  PINMUX_FLAG_8BIT_MODE)  !start_ext) {
 debug(SDMMC device %d does not support 8bit mode,
 peripheral);
 return -1;
 }
 if (flags  PINMUX_FLAG_8BIT_MODE) {
 -   for (i = start; i = (start + 3); i++) {
 -   s5p_gpio_cfg_pin(bank_ext, i, gpio_func);
 -   s5p_gpio_set_pull(bank_ext, i, GPIO_PULL_UP);
 -   s5p_gpio_set_drv(bank_ext, i, GPIO_DRV_4X);
 +   for (i = start_ext; i = (start_ext + 3); i++) {
 +   gpio_cfg_pin(i, 

Re: [U-Boot] [PATCH] powerpc/85xx: Add P1023RDB board support

2013-04-16 Thread Chunhe Lan

On 04/16/2013 09:57 PM, Sinan Akman wrote:

Chunhe Lan wrote:

P1023RDB Specification:
---
Memory subsystem:
   512MB DDR3 (Fixed DDR on board)
   64MB NOR flash
   128MB NAND flash



Chunhe, what is the orderable part number of
this board, I don't see anything on the FSL web page
with the description above.

Now, Freescale is developing it, and does not normally release it.

Thanks,
-Chunhe


Regards

Sinan Akman





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


Re: [U-Boot] [PATCH] Add NanoBone board support

2013-04-16 Thread Hebbar, Gururaja
Mark,

On Tue, Apr 16, 2013 at 20:32:34, Mark Jackson wrote:
 NanoBone Specification:
 ---
 Memory:
   256MB DDR3
   64MB NOR flash
   256MB NAND flash
   128KB FRAM
 
 Ethernet:
   2 x 10/100 connected to SMSC LAN8710 PHY
 
 USB:
   1 x USB2.0 Type A
 
 I2C:
   2Kbit EEPROM (Microchip 24AA02)
   RTC (Maxim DS1338)
   GPIO Expander (Microchip MCP23017)
 
 Expansion connector:
   6 x UART
   1 x MMC/SD
   1 x USB2.0
 
 Signed-off-by: Mark Jackson m...@newflow.co.uk
 ---
  MAINTAINERS |4 +
  board/newflow/nanobone/Makefile |   46 ++
  board/newflow/nanobone/board.c  |  337 
 +++
  board/newflow/nanobone/board.h  |   24 +++
  board/newflow/nanobone/mux.c|  203 +++
  boards.cfg  |1 +
  include/configs/nanobone.h  |  291 +
  7 files changed, 906 insertions(+)
  create mode 100644 board/newflow/nanobone/Makefile
  create mode 100644 board/newflow/nanobone/board.c
  create mode 100644 board/newflow/nanobone/board.h
  create mode 100644 board/newflow/nanobone/mux.c
  create mode 100644 include/configs/nanobone.h
 
 diff --git a/MAINTAINERS b/MAINTAINERS
 index 1614b91..7778883 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -710,6 +710,10 @@ Ilko Iliev il...@ronetix.at
   PM9263  AT91SAM9263
   PM9G45  ARM926EJS (AT91SAM9G45 SoC)
  
 +Mark Jackson m...@newflow.co.uk

A small nit-pick, you sent the commit using email id as mpfj-l...@mimc.co.uk
But in the maintainer file, it shows as m...@newflow.co.uk.

Is this valid/correct?

Regards
Gururaja

 +
 + NANOBONEARM ARMV7 (AM33xx Soc)
 +
  Michael Jones michael.jo...@matrix-vision.de
  
   omap3_mvblx ARM ARMV7 (OMAP3xx SoC)
 diff --git a/board/newflow/nanobone/Makefile b/board/newflow/nanobone/Makefile
 new file mode 100644
 index 000..67a87a1
 --- /dev/null
 +++ b/board/newflow/nanobone/Makefile
 @@ -0,0 +1,46 @@
 +#
 +# Makefile
 +#
 +# Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
 +#
 +# This program is free software; you can redistribute it and/or
 +# modify it under the terms of the GNU General Public License as
 +# published by the Free Software Foundation; either version 2 of
 +# the License, or (at your option) any later version.
 +#
 +# This program is distributed as is WITHOUT ANY WARRANTY of any
 +# kind, whether express or implied; without even the implied warranty
 +# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 +# GNU General Public License for more details.
 +#
 +
 +include $(TOPDIR)/config.mk
 +
 +LIB  = $(obj)lib$(BOARD).o
 +
 +ifdef CONFIG_SPL_BUILD
 +COBJS:= mux.o
 +endif
 +
 +COBJS+= board.o
 +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
 +OBJS := $(addprefix $(obj),$(COBJS))
 +SOBJS:= $(addprefix $(obj),$(SOBJS))
 +
 +$(LIB):  $(obj).depend $(OBJS) $(SOBJS)
 + $(call cmd_link_o_target, $(OBJS) $(SOBJS))
 +
 +clean:
 + rm -f $(SOBJS) $(OBJS)
 +
 +distclean:   clean
 + rm -f $(LIB) core *.bak $(obj).depend
 +
 +#
 +
 +# defines $(obj).depend target
 +include $(SRCTREE)/rules.mk
 +
 +sinclude $(obj).depend
 +
 +#
 diff --git a/board/newflow/nanobone/board.c b/board/newflow/nanobone/board.c
 new file mode 100644
 index 000..e8f7e00
 --- /dev/null
 +++ b/board/newflow/nanobone/board.c
 @@ -0,0 +1,337 @@
 +/*
 + * board.c
 + *
 + * Board functions for Newflow NanoBone board
 + *
 + * Copyright (C) 2013, Newflow Ltd - http://www.newflow.co.uk/
 + *
 + * 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.
 + */
 +
 +#include common.h
 +#include errno.h
 +#include asm/arch/clock.h
 +#include asm/arch/cpu.h
 +#include asm/arch/ddr_defs.h
 +#include asm/arch/gpio.h
 +#include asm/arch/hardware.h
 +#include asm/arch/sys_proto.h
 +#include asm/arch/mem.h
 +#include asm/arch/mmc_host_def.h
 +#include asm/arch/omap.h
 +#include asm/emif.h
 +#include asm/gpio.h
 +#include asm/io.h
 +#include cpsw.h
 +#include i2c.h
 +#include miiphy.h
 +#include spl.h
 +#include board.h
 +
 +DECLARE_GLOBAL_DATA_PTR;
 +
 +/* FRAM config */
 +#define FRAM_CS  1
 +#define FRAM_BASE0x1c00
 +#define FRAM_SIZEGPMC_SIZE_16M
 +static u32 gpmc_fram_config[GPMC_MAX_REG] = {
 + 0x1200,
 + 0x00101000,
 + 0x00020201,
 + 0x0f030f03,
 + 0x010d1010,
 

Re: [U-Boot] [PATCH] crc32: Correct endianness of crc32 result

2013-04-16 Thread Wolfgang Denk
Dear Simon Glass,

In message capnjgz2jrvpq56_epvkumh8e1l2lj0hgzncs-grn9bxfosx...@mail.gmail.com 
you wrote:
 
  +#ifdef USE_HOSTCC
  + crc = htobe32(crc);
memcpy(output, crc, sizeof(crc));
  +#else
  + put_unaligned_be32(crc, output);
  +#endif
 
  Why is this depending on USE_HOSTCC, and not on the endianess?
 
 We always want big-endian in this case, since the bytes have to date
 been written that way by the crc32 command.

Let me rephrase.  Why do we need an #ifdef here, and why depends this
on USE_HOSTCC?

  And why do we need the #ifdef?  Can we not always use htobe32() and
  put_unaligned_be32() ?
 
 Well I don't think put_unaligned_be32 is available to user space,
 which is the environment that the tools are built under. It is
 available in the kernel, but that's not our environment.

It appears put_unaligned_be32() is a widely unknown, pretty exotic
function that so far has been used in ony two source files:

drivers/usb/gadget/f_mass_storage.c
lib/tpm.c

The implementation (in include/linux/unaligned/generic.h) is ugly
and pretty expensive in terms of run time and memory footprint.

I would like to avoid it's usage all together.

 I'm not happy with this solution and would be pleased to find a better
 way, but I'm not sure what it is.

Does the htobe32() + memcpy() approach not work everywhere?

 But this patch does fix a real bug which we should sort out before the
 release, one way or another.

Agreed.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I find this a nice feature but it is not according to  the  documen-
tation. Or is it a BUG?   Let's call it an accidental feature. :-)
   - Larry Wall in 6...@jpl-devvax.jpl.nasa.gov
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Allow U-Boot scripts to be placed in a .env file

2013-04-16 Thread Wolfgang Denk
Dear Simon Glass,

In message 1366155414-6525-1-git-send-email-...@chromium.org you wrote:
 At present U-Boot environment variables, and thus scripts, are defined
 by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
 to this file and dealing with quoting and newlines is harder than it
 should be. It would be better if we could just type the script into a
 text file and have it included by U-Boot.
 
 Add a feature that brings in a .env file associated with the board
 config, if present. To use it, create a file in include/configs
 with the same name as you could board config file, except with a
 .env extension instead of a .h extension. The variables should be
 separated by \0. Comments are permitted, using # as the first character
 in a line.

Please do not litter the include/configs/ directory with such stuff.
It's more than big enough already.  Please put such files into the
respective board directories.

And if you do something like this, then please go the way to the end.
Forget about the \0 termination, make it a plain text file instead,
something that can be used with env import -t as well (or created
with env export -t).

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
Many companies that have made themselves dependent on [the  equipment
of  a  certain  major  manufacturer] (and in doing so have sold their
soul to the devil) will collapse under the sheer weight  of  the  un-
mastered complexity of their data processing systems.
  -- Edsger W. Dijkstra, SIGPLAN Notices, Volume 17, Number 5
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot