Re: [U-Boot] [PATCH 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-24 Thread Sumit Gemini
Hi Lukasz,

 My dfu version is 1.0 and am using SPI flash NOR. downloading is fine
but uploading failed.

I am trying lot to upload binary from dfu-device to pc but not able to
do that.

I am facing following error :-

when i apply
  dfu-util -v -a u-boot -U dfu-UBOOT from my host
machine,


I got such log on Host machine :-

Device returned transfer size 4096
bytes_per_hash=4096
Copying data from DFU device to PC
Starting upload: [] finished!
Received a total of 1 bytes

and finally dfu-SPL file created with 4kb size.


but on target machine, i got

Running: sf read 0x 0x2 0x0
Failed to map physical memory.

May i know why i got such error or user have to specify address over which
we read our binary.


Any help will appreciate and if any body has related pointer, please let me
know, I have stuck in this error.

and further more,

After analyzing a lot, i got a function "dfu_upload" in dfu.c file, calling
another function "libusb_control_transfer" which return only 1, might be it
is not getting interface, because when i pass

dfu-util -a u-boot -U SPL-uboot in host machine


i got in target machine :-

SF: Detected N25Q256 with page size 64 KiB, total 32 MiB

Running: sf read 0x 0x2 0x0
Failed to map physical memory

So, how can i analyze  flash memory, why it is getting fail to map itself
with physical memory.


Thanks


On Tue, Jun 25, 2013 at 12:14 PM, Lukasz Majewski wrote:

> Hi Sumit,
>
> > Hi Lukasz,
> >
> >   I put the dfu support into am335x board even i able to download
> > all images from dfu-util, but when i trying to upload images, (from
> > dfu devices to PC), my system failed.
> >
> >  Could you tell me what is the problem and where should i look into?
>
> Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend).
> I've checked and fixed problem with dfu write yesterday (also with
> eMMC).
>
> Recently the dfu subsystem has been reworked to get rid of fixed buffer
> size, so please regard it as "under heavy development".
>
> I will look into this problem (for eMMC, not NAND - since my Trats
> doesn't have NAND memory).
>
> BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian
> 5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work
> with current dfu code).
>
>
>
> >
> >
> > Thanks & Regards
> > ~Sumit gemini
> >
> >
> > On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski
> > wrote:
> >
> > > From: Arkadiusz Wlodarczyk 
> > >
> > > Proper adjustment for supporting DFU at GONI target has been made.
> > > The s5p_goni.h file has been updated. Moreover the code for low
> > > level USB initialization has been added to GONI board code.
> > >
> > > Signed-off-by: Arkadiusz Wlodarczyk 
> > > Signed-off-by: Kyungmin Park 
> > > Tested-by: Arkadiusz Wlodarczyk 
> > > Cc: Minkyu Kang 
> > > ---
> > >  board/samsung/goni/goni.c  |7 +++
> > >  include/configs/s5p_goni.h |   20 +++-
> > >  2 files changed, 26 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
> > > index ff76963..3c53106 100644
> > > --- a/board/samsung/goni/goni.c
> > > +++ b/board/samsung/goni/goni.c
> > > @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
> > > .regs_otg = S5PC110_OTG_BASE,
> > > .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
> > >  };
> > > +
> > > +void board_usb_init(void)
> > > +{
> > > +   debug("USB_udc_probe\n");
> > > +   s3c_udc_probe(&s5pc110_otg_data);
> > > +}
> > > +
> > >  #endif
> > > diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> > > index ec43652..8a824c7 100644
> > > --- a/include/configs/s5p_goni.h
> > > +++ b/include/configs/s5p_goni.h
> > > @@ -86,6 +86,17 @@
> > >  #define CONFIG_CMD_ONENAND
> > >  #define CONFIG_CMD_MTDPARTS
> > >  #define CONFIG_CMD_MMC
> > > +#define CONFIG_CMD_DFU
> > > +
> > > +/* USB Composite download gadget - g_dnl */
> > > +#define CONFIG_USBDOWNLOAD_GADGET
> > > +#define CONFIG_DFU_FUNCTION
> > > +#define CONFIG_DFU_MMC
> > > +
> > > +/* USB Samsung's IDs */
> > > +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
> > > +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
> > > +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
> > >
> > >  #define CONFIG_BOOTDELAY   1
> > >  #define CONFIG_ZERO_BOOTDELAY_CHECK
> > > @@ -105,6 +116,10 @@
> > > ",60m(qboot)"\
> > > ",-(UBI)\0"
> > >
> > > +#define CONFIG_DFU_ALT \
> > > +   "u-boot mmc 80 400;" \
> > > +   "uImage fat 0 2\0" \
> > > +
> > >  #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
> > >
> > >  #define CONFIG_BOOTCOMMAND "run mmcboot"
> > > @@ -175,7 +190,9 @@
> > > "bootblock=9\0" \
> > > "ubiblock=8\0" \
> > > "ubi=enabled\0" \
> > > -   "opts=always_resume=1"
> > > +   "opts=always_resume=1\0" \
> > > +   "dfu_alt_info=" CONFIG_DFU_ALT
> > > +
> > >
> > >  /* Miscellaneous

Re: [U-Boot] [PATCH 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-24 Thread Lukasz Majewski
Hi Sumit,

> Hi Lukasz,
> 
>   I put the dfu support into am335x board even i able to download
> all images from dfu-util, but when i trying to upload images, (from
> dfu devices to PC), my system failed.
> 
>  Could you tell me what is the problem and where should i look into?

Indeed dfu upload doesn't work on Trats anymore (it uses eMMC backend).
I've checked and fixed problem with dfu write yesterday (also with
eMMC).

Recently the dfu subsystem has been reworked to get rid of fixed buffer
size, so please regard it as "under heavy development".

I will look into this problem (for eMMC, not NAND - since my Trats
doesn't have NAND memory).

BTW: Which version of dfu-util do you use? (Mine is 0.5, but for debian
5.0 / 6.0 there also was very ancient 0.1 version - which doesn't work
with current dfu code).



> 
> 
> Thanks & Regards
> ~Sumit gemini
> 
> 
> On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski
> wrote:
> 
> > From: Arkadiusz Wlodarczyk 
> >
> > Proper adjustment for supporting DFU at GONI target has been made.
> > The s5p_goni.h file has been updated. Moreover the code for low
> > level USB initialization has been added to GONI board code.
> >
> > Signed-off-by: Arkadiusz Wlodarczyk 
> > Signed-off-by: Kyungmin Park 
> > Tested-by: Arkadiusz Wlodarczyk 
> > Cc: Minkyu Kang 
> > ---
> >  board/samsung/goni/goni.c  |7 +++
> >  include/configs/s5p_goni.h |   20 +++-
> >  2 files changed, 26 insertions(+), 1 deletion(-)
> >
> > diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
> > index ff76963..3c53106 100644
> > --- a/board/samsung/goni/goni.c
> > +++ b/board/samsung/goni/goni.c
> > @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
> > .regs_otg = S5PC110_OTG_BASE,
> > .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
> >  };
> > +
> > +void board_usb_init(void)
> > +{
> > +   debug("USB_udc_probe\n");
> > +   s3c_udc_probe(&s5pc110_otg_data);
> > +}
> > +
> >  #endif
> > diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> > index ec43652..8a824c7 100644
> > --- a/include/configs/s5p_goni.h
> > +++ b/include/configs/s5p_goni.h
> > @@ -86,6 +86,17 @@
> >  #define CONFIG_CMD_ONENAND
> >  #define CONFIG_CMD_MTDPARTS
> >  #define CONFIG_CMD_MMC
> > +#define CONFIG_CMD_DFU
> > +
> > +/* USB Composite download gadget - g_dnl */
> > +#define CONFIG_USBDOWNLOAD_GADGET
> > +#define CONFIG_DFU_FUNCTION
> > +#define CONFIG_DFU_MMC
> > +
> > +/* USB Samsung's IDs */
> > +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
> > +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
> > +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
> >
> >  #define CONFIG_BOOTDELAY   1
> >  #define CONFIG_ZERO_BOOTDELAY_CHECK
> > @@ -105,6 +116,10 @@
> > ",60m(qboot)"\
> > ",-(UBI)\0"
> >
> > +#define CONFIG_DFU_ALT \
> > +   "u-boot mmc 80 400;" \
> > +   "uImage fat 0 2\0" \
> > +
> >  #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
> >
> >  #define CONFIG_BOOTCOMMAND "run mmcboot"
> > @@ -175,7 +190,9 @@
> > "bootblock=9\0" \
> > "ubiblock=8\0" \
> > "ubi=enabled\0" \
> > -   "opts=always_resume=1"
> > +   "opts=always_resume=1\0" \
> > +   "dfu_alt_info=" CONFIG_DFU_ALT
> > +
> >
> >  /* Miscellaneous configurable options */
> >  #define CONFIG_SYS_LONGHELP/* undef to save memory */
> > @@ -242,5 +259,6 @@
> >  #define CONFIG_USB_GADGET
> >  #define CONFIG_USB_GADGET_S3C_UDC_OTG
> >  #define CONFIG_USB_GADGET_DUALSPEED
> > +#define CONFIG_USB_GADGET_VBUS_DRAW 2
> >
> >  #endif /* __CONFIG_H */
> > --
> > 1.7.10.4
> >
> > ___
> > U-Boot mailing list
> > U-Boot@lists.denx.de
> > http://lists.denx.de/mailman/listinfo/u-boot
> >



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 5/5] ARM: at91: atmel_nand: add code to check the ONFI parameter ECC requirement

2013-06-24 Thread Josh Wu

Hi, Dear Scott

On 6/21/2013 4:57 AM, Scott Wood wrote:

On 06/17/2013 05:51:21 AM, Josh Wu wrote:

+static int pmecc_choose_ecc(struct atmel_nand_host *host,
+struct nand_chip *chip,
+int *cap, int *sector_size)
+{
+/* Get ECC requirement from ONFI parameters */
+*cap = *sector_size = 0;
+if (chip->onfi_version) {
+if (!get_onfi_ecc_param(chip, cap, sector_size))
+pr_debug("ONFI params, minimum required ECC: %d bits in 
%d bytes\n",

+*cap, *sector_size);
+else
+dev_info(NULL, "NAND chip ECC reqirement is in Extended 
ONFI parameter, we don't support yet.\n");

+} else {
+dev_info(NULL, "NAND chip is not ONFI compliant, assume 
ecc_bits is 2 in 512 bytes");

+}


Don't pass NULL to dev_info().  Either pass host->dev as the Linux 
code does (and use dev_dbg rather than pr_debug), or just use printf() 
(and debug()) if there's no intent to sync this change back to Linux.  
It doesn't matter if host->dev doesn't exist in U-Boot, as the macro 
doesn't use that parameter, but the only reason to use Linux-style 
prints is to keep the code common with Linux.


understood. I prefer to use dev_xxx(host->dev, ...) to keep consistent 
with kernel.


I use pr_debug because it is defined as MTDDEBUG in mtd/mtd.h, that is 
exact what I want.
Since if use debug(), then when I enable debug, there are many mtd 
non-related message shows up.


Best Regards,
Josh Wu



-Scott


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


[U-Boot] [PATCH] Fix ext2/ext4 filesystem accesses beyond 2TiB

2013-06-24 Thread Frederic Leroy
From: Frédéric Leroy 

With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
which is required to represent block numbers for storage devices that
exceed 2TiB (the block size usually is 512B), e.g. recent hard drives

We now use lbaint_t for partition offset to reflect the lbaint_t change,
and access partitions beyond or crossing the 2TiB limit.
This required changes to signature of ext4fs_devread(), and type of all
variables relatives to block sector.

ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
block is a multiple of device block sector. To avoid overflow problem
when calling ext4fs_devread(), we need to cast the sector parameter.

Signed-off-by: Frédéric Leroy 
---

Added Signed-off-by and fix 2.1TiB value in the comment.

Thanks Sascha :)

 common/cmd_disk.c  |  2 +-
 disk/part_efi.c|  4 ++--
 fs/ext4/dev.c  |  8 
 fs/ext4/ext4_common.c  | 40 
 fs/ext4/ext4_journal.c | 12 ++--
 fs/ext4/ext4_write.c   | 38 +++---
 fs/ext4/ext4fs.c   | 14 +++---
 include/ext4fs.h   |  2 +-
 include/ext_common.h   |  2 +-
 include/ide.h  |  2 ++
 include/part.h |  4 ++--
 11 files changed, 65 insertions(+), 63 deletions(-)

diff --git a/common/cmd_disk.c b/common/cmd_disk.c
index ee4e215..809e231 100644
--- a/common/cmd_disk.c
+++ b/common/cmd_disk.c
@@ -67,7 +67,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int 
argc,
   "Name: %.32s  Type: %.32s\n", intf, dev, part, info.name,
   info.type);
 
-   debug("First Block: %ld,  # of blocks: %ld, Block Size: %ld\n",
+   debug("First Block: " LBAFu ",  # of blocks: " LBAFu ", Block Size: 
%ld\n",
  info.start, info.size, info.blksz);
 
if (dev_desc->block_read(dev, info.start, 1, (ulong *) addr) != 1) {
diff --git a/disk/part_efi.c b/disk/part_efi.c
index fb5e9f0..5c426fe 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -200,7 +200,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
uuid_string(gpt_pte[part - 1].unique_partition_guid.b, info->uuid);
 #endif
 
-   debug("%s: start 0x%lX, size 0x%lX, name %s", __func__,
+   debug("%s: start 0x" LBAF ", size 0x" LBAF ", name %s", __func__,
info->start, info->size, info->name);
 
/* Remember to free pte */
@@ -431,7 +431,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
gpt_e[i].partition_name[k] =
(efi_char16_t)(partitions[i].name[k]);
 
-   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x%lx\n",
+   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x" LBAF "\n",
  __func__, partitions[i].name, i,
  offset, i, partitions[i].size);
}
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 81b7633..7296118 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -42,7 +42,7 @@
 #include 
 #include "ext4_common.h"
 
-unsigned long part_offset;
+lbaint_t part_offset;
 
 static block_dev_desc_t *ext4fs_block_dev_desc;
 static disk_partition_t *part_info;
@@ -58,7 +58,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, 
disk_partition_t *info)
get_fs()->dev_desc->log2blksz;
 }
 
-int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
+int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
 {
unsigned block_len;
int log2blksz = ext4fs_block_dev_desc->log2blksz;
@@ -74,7 +74,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
if ((sector < 0) ||
((sector + ((byte_offset + byte_len - 1) >> log2blksz))
 >= part_info->size)) {
-   printf("%s read outside partition %d\n", __func__, sector);
+   printf("%s read outside partition " LBAFu "\n", __func__, 
sector);
return 0;
}
 
@@ -82,7 +82,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
sector += byte_offset >> log2blksz;
byte_offset &= ext4fs_block_dev_desc->blksz - 1;
 
-   debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
+   debug(" <" LBAFu ", %d, %d>\n", sector, byte_offset, byte_len);
 
if (byte_offset != 0) {
/* read first part which isn't aligned with start of sector */
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 58880b4..61b1ca1 100644
--- a/fs/ext4/ext4_common.c
+++ b/fs/ext4/ext4_common.c
@@ -84,7 +84,7 @@ void put_ext4(uint64_t off, void *buf, uint32_t size)
 
if ((startblock + (size >> log2blksz)) >
(part_offset + fs->total_sect)) {
-   printf("part_offset is %lu\n", part_offset);
+   printf("part_offset is " LBAFu "\n", part_offset);
printf("total_sector is %llu\n", fs->total_sect);
printf("error

[U-Boot] [PATCH 2/2] board/bsc9132qds: Configure DSP DDR controller

2013-06-24 Thread Priyanka Jain
BSC9132 SoC has two separate DDR controllers for PowerPC side and DSP side
DDR. They are mapped to PowerPC and DSP CCSR space respectively.
BSC9132QDS has two on-board MC34716EP DDR3 memory one connected to PowerPC
and other to DSP side controller.

Configure DSP DDR controller similar to PowerPC side DDR controller as
memories are exactly similar.

Signed-off-by: Manish Jaggi
Signed-off-by: Priyanka Jain 
---
 arch/powerpc/include/asm/immap_85xx.h   |6 ++
 board/freescale/bsc9132qds/bsc9132qds.c |   22 ++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/include/asm/immap_85xx.h 
b/arch/powerpc/include/asm/immap_85xx.h
index db70d04..ae9a016 100644
--- a/arch/powerpc/include/asm/immap_85xx.h
+++ b/arch/powerpc/include/asm/immap_85xx.h
@@ -3047,6 +3047,12 @@ struct ccsr_pman {
 #define CONFIG_SYS_MPC85xx_GUTS_OFFSET 0xE
 #define CONFIG_SYS_FSL_SRIO_OFFSET 0xC
 
+#if defined(CONFIG_BSC9132)
+#define CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET 0x1
+#define CONFIG_SYS_FSL_DSP_CCSR_DDR_ADDR \
+   (CONFIG_SYS_FSL_DSP_CCSRBAR + CONFIG_SYS_FSL_DSP_CCSR_DDR_OFFSET)
+#endif
+
 #define CONFIG_SYS_FSL_CPC_ADDR\
(CONFIG_SYS_CCSRBAR + CONFIG_SYS_FSL_CPC_OFFSET)
 #define CONFIG_SYS_FSL_QMAN_ADDR \
diff --git a/board/freescale/bsc9132qds/bsc9132qds.c 
b/board/freescale/bsc9132qds/bsc9132qds.c
index ddc9d0a..b084c1b 100644
--- a/board/freescale/bsc9132qds/bsc9132qds.c
+++ b/board/freescale/bsc9132qds/bsc9132qds.c
@@ -141,6 +141,27 @@ void board_config_serdes_mux(void)
}
 }
 
+/* Configure DSP DDR controller */
+void dsp_ddr_configure(void)
+{
+   /*
+*There are separate DDR-controllers for DSP and PowerPC side DDR.
+*copy the ddr controller settings from PowerPC side DDR controller
+*to the DSP DDR controller as connected DDR memories are similar.
+*/
+   ccsr_ddr_t __iomem *pa_ddr =
+   (ccsr_ddr_t __iomem *)CONFIG_SYS_MPC8xxx_DDR_ADDR;
+   ccsr_ddr_t temp_ddr;
+   ccsr_ddr_t __iomem *dsp_ddr =
+   (ccsr_ddr_t __iomem *)CONFIG_SYS_FSL_DSP_CCSR_DDR_ADDR;
+
+   memcpy(&temp_ddr, pa_ddr, sizeof(ccsr_ddr_t));
+   temp_ddr.cs0_bnds = CONFIG_SYS_DDR1_CS0_BNDS;
+   temp_ddr.sdram_cfg &= ~SDRAM_CFG_MEM_EN;
+   memcpy(dsp_ddr, &temp_ddr, sizeof(ccsr_ddr_t));
+   dsp_ddr->sdram_cfg |= SDRAM_CFG_MEM_EN;
+}
+
 int board_early_init_r(void)
 {
 #ifndef CONFIG_SYS_NO_FLASH
@@ -169,6 +190,7 @@ int board_early_init_r(void)
0, flash_esel+1, BOOKE_PAGESZ_64M, 1);
 #endif
board_config_serdes_mux();
+   dsp_ddr_configure();
return 0;
 }
 
-- 
1.7.4.1



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


[U-Boot] [PATCH 1/2] board/bsc9132qds: Add DSP side tlb and laws

2013-06-24 Thread Priyanka Jain
BSC9132QDS is a Freescale Reference Design Board for BSC9132 SoC which is a
integrated device that contains two powerpc e500v2 cores and two DSP
starcores.

To support DSP starcore
-Creating LAW and TLB for DSP-CCSR space.
-Creating LAW for DSP-core subsystem M2 and M3 memory
-Creating LAW for 1GB DDR which is connected exclusively to DSP-cores

Signed-off-by: Manish Jaggi
Signed-off-by: Priyanka Jain 
---
 README|8 
 arch/powerpc/include/asm/config_mpc85xx.h |4 
 arch/powerpc/include/asm/fsl_law.h|6 +-
 board/freescale/bsc9132qds/law.c  |8 
 board/freescale/bsc9132qds/tlb.c  |5 +
 include/configs/BSC9132QDS.h  |4 
 6 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/README b/README
index e8359f8..99a2c02 100644
--- a/README
+++ b/README
@@ -422,10 +422,18 @@ The following options need to be configured:
This is the value to write into CCSR offset 0x18600
according to the A004510 workaround.
 
+   CONFIG_SYS_FSL_DSP_DDR_ADDR
+   This value denotes start offset of DDR memory which is
+   connected exclusively to the DSP cores.
+
CONFIG_SYS_FSL_DSP_M2_RAM_ADDR
This value denotes start offset of M2 memory
which is directly connected to the DSP core.
 
+   CONFIG_SYS_FSL_DSP_M3_RAM_ADDR
+   This value denotes start offset of M3 memory which is directly
+   connected to the DSP core.
+
CONFIG_SYS_FSL_DSP_CCSRBAR_DEFAULT
This value denotes start offset of DSP CCSR space.
 
diff --git a/arch/powerpc/include/asm/config_mpc85xx.h 
b/arch/powerpc/include/asm/config_mpc85xx.h
index 1d46b14..16ef7df 100644
--- a/arch/powerpc/include/asm/config_mpc85xx.h
+++ b/arch/powerpc/include/asm/config_mpc85xx.h
@@ -506,6 +506,10 @@
 #define CONFIG_TSECV2
 #define CONFIG_SYS_FSL_SEC_COMPAT  4
 #define CONFIG_NUM_DDR_CONTROLLERS 2
+#define CONFIG_SYS_FSL_DSP_DDR_ADDR0x4000
+#define CONFIG_SYS_FSL_DSP_M2_RAM_ADDR 0xb000
+#define CONFIG_SYS_FSL_DSP_M3_RAM_ADDR 0xc000
+#define CONFIG_SYS_FSL_DSP_CCSRBAR_DEFAULT 0xff60
 #define CONFIG_SYS_FSL_IFC_BANK_COUNT  3
 #define CONFIG_SYS_CCSRBAR_DEFAULT 0xff70
 #define CONFIG_NAND_FSL_IFC
diff --git a/arch/powerpc/include/asm/fsl_law.h 
b/arch/powerpc/include/asm/fsl_law.h
index bea1636..fa51e59 100644
--- a/arch/powerpc/include/asm/fsl_law.h
+++ b/arch/powerpc/include/asm/fsl_law.h
@@ -82,7 +82,7 @@ enum law_trgt_if {
 #ifndef CONFIG_MPC8641
LAW_TRGT_IF_PCIE_1 = 0x02,
 #endif
-#if defined(CONFIG_BSC9131)
+#if defined(CONFIG_BSC9131) || defined(CONFIG_BSC9132)
LAW_TRGT_IF_OCN_DSP = 0x03,
 #else
 #if !defined(CONFIG_MPC8572) && !defined(CONFIG_P2020)
@@ -94,7 +94,11 @@ enum law_trgt_if {
LAW_TRGT_IF_DSP_CCSR = 0x09,
LAW_TRGT_IF_DDR_INTRLV = 0x0b,
LAW_TRGT_IF_RIO = 0x0c,
+#if defined(CONFIG_BSC9132)
+   LAW_TRGT_IF_CLASS_DSP = 0x0d,
+#else
LAW_TRGT_IF_RIO_2 = 0x0d,
+#endif
LAW_TRGT_IF_DPAA_SWP_SRAM = 0x0e,
LAW_TRGT_IF_DDR = 0x0f,
LAW_TRGT_IF_DDR_2 = 0x16,   /* 2nd controller */
diff --git a/board/freescale/bsc9132qds/law.c b/board/freescale/bsc9132qds/law.c
index b4bce99..99ea56b 100644
--- a/board/freescale/bsc9132qds/law.c
+++ b/board/freescale/bsc9132qds/law.c
@@ -32,6 +32,14 @@ struct law_entry law_table[] = {
 #ifdef CONFIG_SYS_FPGA_BASE_PHYS
SET_LAW(CONFIG_SYS_FPGA_BASE_PHYS, LAW_SIZE_128K, LAW_TRGT_IF_IFC),
 #endif
+   SET_LAW(CONFIG_SYS_FSL_DSP_CCSRBAR_PHYS, LAW_SIZE_1M,
+   LAW_TRGT_IF_DSP_CCSR),
+   SET_LAW(CONFIG_SYS_FSL_DSP_M2_RAM_ADDR, LAW_SIZE_32M,
+   LAW_TRGT_IF_OCN_DSP),
+   SET_LAW(CONFIG_SYS_FSL_DSP_M3_RAM_ADDR, LAW_SIZE_32K,
+   LAW_TRGT_IF_CLASS_DSP),
+   SET_LAW(CONFIG_SYS_FSL_DSP_DDR_ADDR, LAW_SIZE_1G,
+   LAW_TRGT_IF_CLASS_DSP)
 };
 
 int num_law_entries = ARRAY_SIZE(law_table);
diff --git a/board/freescale/bsc9132qds/tlb.c b/board/freescale/bsc9132qds/tlb.c
index 0ec9a85..734f3f8 100644
--- a/board/freescale/bsc9132qds/tlb.c
+++ b/board/freescale/bsc9132qds/tlb.c
@@ -57,6 +57,11 @@ struct fsl_e_tlb_entry tlb_table[] = {
MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
0, 1, BOOKE_PAGESZ_1M, 1),
 
+   /* CCSRBAR (DSP) */
+   SET_TLB_ENTRY(1, CONFIG_SYS_FSL_DSP_CCSRBAR,
+ CONFIG_SYS_FSL_DSP_CCSRBAR_PHYS, MAS3_SW|MAS3_SR,
+ MAS2_I|MAS2_G, 0, 2, BOOKE_PAGESZ_1M, 1),
+
 #ifndef CONFIG_SPL_BUILD
SET_TLB_ENTRY(1, CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE_PHYS,
MAS3_SX|MAS3_SR, MAS2_W|MAS2_G,
diff --git a/include/configs/BSC9132QDS.h b/include/configs/BSC9132QDS.h
index 3aa4443..91105eb 100644
--- a/include/configs/BSC9132QDS.h
+++ b/include/configs/BSC

Re: [U-Boot] [PATCH 1/4] ARM: AM33xx: Cleanup dplls data

2013-06-24 Thread Lokesh Vutla

Hi Heiko,
On Tuesday 25 June 2013 10:24 AM, Heiko Schocher wrote:

Hello Lokesh,

Am 25.06.2013 05:48, schrieb Lokesh Vutla:

Hi Heiko,
On Tuesday 25 June 2013 12:42 AM, Heiko Schocher wrote:

Hello Lokesh,

Am 24.06.2013 15:15, schrieb Lokesh Vutla:

Locking sequence for all the dplls is same.
In the current code same sequence is done repeatedly
for each dpll. Instead have a generic function
for locking dplls and pass dpll data to that function.

This is derived from OMAP4 boards.

Signed-off-by: Lokesh Vutla 
---
   arch/arm/cpu/armv7/am33xx/Makefile   |1 +
   arch/arm/cpu/armv7/am33xx/clock.c|  116 ++
   arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  222 
+-
   arch/arm/cpu/armv7/am33xx/emif4.c|4 +
   arch/arm/include/asm/arch-am33xx/clock.h |   68 
   arch/arm/include/asm/arch-am33xx/ddr_defs.h  |2 +
   arch/arm/include/asm/arch-am33xx/sys_proto.h |1 +
   7 files changed, 232 insertions(+), 182 deletions(-)
   create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c


[...]

diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock.c
new file mode 100644
index 000..a7f1d83
--- /dev/null
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -0,0 +1,116 @@

[...]

+static void do_setup_dpll(const struct dpll_regs *dpll_regs,
+ const struct dpll_params *params)
+{


Could we have this function not only static? I posted a patch:

[U-Boot] arm, am335x: make mpu pll config configurable
http://patchwork.ozlabs.org/patch/248509/

which uses mpu_pll_config() for switching mpu pll clock
from board code ... you delete this function later in this patch,
so I think, I can switch to do_setup_pll() ... if this is not
static code ...

Yes I saw that patch. No need to make this non-static.
Please have your own struct "const struct dpll_params dpll_mpu"
and update your values accordingly.


Hmm.. maybe I miss something here. You call setup_dplls()
in arch/arm/cpu/armv7/am33xx/clock.c using &dpll_mpu defined
in arch/arm/cpu/armv7/am33xx/clock_am33xx.c ... so how to
make here a board specific struct?

The MPUCLK is configurable through the define CONFIG_SYS_MPUCLK
which is good, but I have on this board a PMIC, which in board SPL
code change MPU and core voltage ... and after that I change
the MPU clock again ...

Ohk.
Can't we scale the voltages before calling setup_dplls()
(Why do you want to configure the MPU clocks twice?
I don't know much about your board, so I am just asking..:) )
What I meant is something like below:
void __weak scale_vcores(void)
{}

void prcm_init()
{
enable_basic_clocks();
scale_vcores();
setup_dplls();
}

have your own scale_vcores in your board file.
and for dpll_mpu have something like this:
#ifdef CONFIG_
const struct dpll_params dpll_mpu = {
M, N, 1, -1, -1, -1, -1};
#else
const struct dpll_params dpll_mpu = {
CONFIG_SYS_MPUCLK, OSC-1, 1, -1, -1, -1, -1};
#endif

I hope this should be possible on your board.
I am telling this because it will be easy for me during my next cleanup 
during

which I planned to combine omap-common and am33xx code..:)

This is the exactly what is done for omap( program voltages and then 
setup dplls)

You can refer to arch/arm/cpu/armv7/omap-common/clocks-common.c
prcm_init() function.

Please correct me if I am wrong..

Thanks and regards,
Lokesh



bye,
Heiko



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


Re: [U-Boot] [PATCH 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-24 Thread Sumit Gemini
Hi Lukasz,

  I put the dfu support into am335x board even i able to download all
images from dfu-util, but when i trying to upload images, (from dfu devices
to PC), my system failed.

 Could you tell me what is the problem and where should i look into?


Thanks & Regards
~Sumit gemini


On Mon, Jun 24, 2013 at 9:06 PM, Lukasz Majewski wrote:

> From: Arkadiusz Wlodarczyk 
>
> Proper adjustment for supporting DFU at GONI target has been made.
> The s5p_goni.h file has been updated. Moreover the code for low level
> USB initialization has been added to GONI board code.
>
> Signed-off-by: Arkadiusz Wlodarczyk 
> Signed-off-by: Kyungmin Park 
> Tested-by: Arkadiusz Wlodarczyk 
> Cc: Minkyu Kang 
> ---
>  board/samsung/goni/goni.c  |7 +++
>  include/configs/s5p_goni.h |   20 +++-
>  2 files changed, 26 insertions(+), 1 deletion(-)
>
> diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
> index ff76963..3c53106 100644
> --- a/board/samsung/goni/goni.c
> +++ b/board/samsung/goni/goni.c
> @@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
> .regs_otg = S5PC110_OTG_BASE,
> .usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
>  };
> +
> +void board_usb_init(void)
> +{
> +   debug("USB_udc_probe\n");
> +   s3c_udc_probe(&s5pc110_otg_data);
> +}
> +
>  #endif
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index ec43652..8a824c7 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -86,6 +86,17 @@
>  #define CONFIG_CMD_ONENAND
>  #define CONFIG_CMD_MTDPARTS
>  #define CONFIG_CMD_MMC
> +#define CONFIG_CMD_DFU
> +
> +/* USB Composite download gadget - g_dnl */
> +#define CONFIG_USBDOWNLOAD_GADGET
> +#define CONFIG_DFU_FUNCTION
> +#define CONFIG_DFU_MMC
> +
> +/* USB Samsung's IDs */
> +#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
> +#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
> +#define CONFIG_G_DNL_MANUFACTURER "Samsung"
>
>  #define CONFIG_BOOTDELAY   1
>  #define CONFIG_ZERO_BOOTDELAY_CHECK
> @@ -105,6 +116,10 @@
> ",60m(qboot)"\
> ",-(UBI)\0"
>
> +#define CONFIG_DFU_ALT \
> +   "u-boot mmc 80 400;" \
> +   "uImage fat 0 2\0" \
> +
>  #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
>
>  #define CONFIG_BOOTCOMMAND "run mmcboot"
> @@ -175,7 +190,9 @@
> "bootblock=9\0" \
> "ubiblock=8\0" \
> "ubi=enabled\0" \
> -   "opts=always_resume=1"
> +   "opts=always_resume=1\0" \
> +   "dfu_alt_info=" CONFIG_DFU_ALT
> +
>
>  /* Miscellaneous configurable options */
>  #define CONFIG_SYS_LONGHELP/* undef to save memory */
> @@ -242,5 +259,6 @@
>  #define CONFIG_USB_GADGET
>  #define CONFIG_USB_GADGET_S3C_UDC_OTG
>  #define CONFIG_USB_GADGET_DUALSPEED
> +#define CONFIG_USB_GADGET_VBUS_DRAW 2
>
>  #endif /* __CONFIG_H */
> --
> 1.7.10.4
>
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Heiko Schocher
Hello Summit,

Am 25.06.2013 07:09, schrieb Sumit Gemini:
> Hi Heiko,
> 
>  I followed the same steps that you mentioned, but still i have same 
> problem.
>  During get uboot-spl.bin from uart, system become hanged and it is not 
> ready to receive u-boot.img.

On which hardware?

>  Still compiling to uboot, i had to comment rtc32k_enable() function. 
> then it is working fine.

Ok ... Hmm.. maybe some missing init the ROM Bootloader does (and some
ROM bootloader versions not, and we miss this in spl code)?
(just speculation ...)

bye,
Heiko
> On Tue, Jun 25, 2013 at 1:14 AM, Heiko Schocher  > wrote:
> 
> Hello Tom,
> 
> Am 24.06.2013 21 :31, schrieb Tom Rini:
> > On 06/24/2013 03:17 PM, Heiko Schocher wrote:
> >> Hello Lokesh,
> > [snip]
> >>> +   /* Enable RTC32K clock */ + rtc32k_enable();
> >
> >> I tried your patches on my three boards. The board with the
> >> rtc32k_enable() problem, did not work with them too :-(
> >
> >> Maybe we make rtc32k_enable() weak in common code, and so I can
> >> make a board specific (dummy) function?
> >
> > I'm not a big fan of this since without this kicked, you can't do PM.
> >  And we don't want to do it in the kernel as it takes a few seconds to
> > settle.  Kicking it in U-Boot means it will be settled by the time
> > it's needed, if I recall things right.
> 
> Hmm.. but on my board, the cpu hangs (not accessible through bdi
> anymore) if I access this registers ... looking still for an
> explanation ...
> 
> Clocks are enabled, 24MHz (same as on am335x eval board) used ...
> I know, this is only a bugfix, without knowing the real reason ...
> 
> bye,
> Heiko
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de 
> http://lists.denx.de/mailman/listinfo/u-boot
> 
> 


-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Sumit Gemini
Hi Heiko,

 I followed the same steps that you mentioned, but still i have same
problem.
 During get uboot-spl.bin from uart, system become hanged and it is not
ready to receive u-boot.img.

 Still compiling to uboot, i had to comment rtc32k_enable() function.
then it is working fine.


Thanks & Regards
~Sumit


On Tue, Jun 25, 2013 at 1:14 AM, Heiko Schocher  wrote:

> Hello Tom,
>
> Am 24.06.2013 21:31, schrieb Tom Rini:
> > On 06/24/2013 03:17 PM, Heiko Schocher wrote:
> >> Hello Lokesh,
> > [snip]
> >>> +   /* Enable RTC32K clock */ + rtc32k_enable();
> >
> >> I tried your patches on my three boards. The board with the
> >> rtc32k_enable() problem, did not work with them too :-(
> >
> >> Maybe we make rtc32k_enable() weak in common code, and so I can
> >> make a board specific (dummy) function?
> >
> > I'm not a big fan of this since without this kicked, you can't do PM.
> >  And we don't want to do it in the kernel as it takes a few seconds to
> > settle.  Kicking it in U-Boot means it will be settled by the time
> > it's needed, if I recall things right.
>
> Hmm.. but on my board, the cpu hangs (not accessible through bdi
> anymore) if I access this registers ... looking still for an
> explanation ...
>
> Clocks are enabled, 24MHz (same as on am335x eval board) used ...
> I know, this is only a bugfix, without knowing the real reason ...
>
> bye,
> Heiko
> --
> DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> ___
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] powerpc/mpc85xx:Disable Debug TLB entry for non-minimal SPL

2013-06-24 Thread Prabhakar Kushwaha
CONFIG_SPL_BUILD creates debug TLB entry, so disable it before init_tlbs.

CONFIG_SPL_INIT_MINIMAL never creates any debug TLB entry, so no need
of disable_tlb().

Signed-off-by: Prabhakar Kushwaha 
---
 arch/powerpc/cpu/mpc85xx/cpu_init_early.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
index 837c034..0cb2717 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
@@ -180,7 +180,8 @@ void cpu_init_early_f(void)
 
invalidate_tlb(1);
 
-#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_SPL_BUILD) && 
!defined(CONFIG_NAND_SPL)
+#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
+   !defined(CONFIG_SPL_INIT_MINIMAL) && !defined(CONFIG_NAND_SPL)
disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
 #endif
 
-- 
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 1/4] ARM: AM33xx: Cleanup dplls data

2013-06-24 Thread Heiko Schocher
Hello Lokesh,

Am 25.06.2013 05:48, schrieb Lokesh Vutla:
> Hi Heiko,
> On Tuesday 25 June 2013 12:42 AM, Heiko Schocher wrote:
>> Hello Lokesh,
>>
>> Am 24.06.2013 15:15, schrieb Lokesh Vutla:
>>> Locking sequence for all the dplls is same.
>>> In the current code same sequence is done repeatedly
>>> for each dpll. Instead have a generic function
>>> for locking dplls and pass dpll data to that function.
>>>
>>> This is derived from OMAP4 boards.
>>>
>>> Signed-off-by: Lokesh Vutla 
>>> ---
>>>   arch/arm/cpu/armv7/am33xx/Makefile   |1 +
>>>   arch/arm/cpu/armv7/am33xx/clock.c|  116 ++
>>>   arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  222 
>>> +-
>>>   arch/arm/cpu/armv7/am33xx/emif4.c|4 +
>>>   arch/arm/include/asm/arch-am33xx/clock.h |   68 
>>>   arch/arm/include/asm/arch-am33xx/ddr_defs.h  |2 +
>>>   arch/arm/include/asm/arch-am33xx/sys_proto.h |1 +
>>>   7 files changed, 232 insertions(+), 182 deletions(-)
>>>   create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c
>>>
>> [...]
>>> diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
>>> b/arch/arm/cpu/armv7/am33xx/clock.c
>>> new file mode 100644
>>> index 000..a7f1d83
>>> --- /dev/null
>>> +++ b/arch/arm/cpu/armv7/am33xx/clock.c
>>> @@ -0,0 +1,116 @@
>> [...]
>>> +static void do_setup_dpll(const struct dpll_regs *dpll_regs,
>>> + const struct dpll_params *params)
>>> +{
>>
>> Could we have this function not only static? I posted a patch:
>>
>> [U-Boot] arm, am335x: make mpu pll config configurable
>> http://patchwork.ozlabs.org/patch/248509/
>>
>> which uses mpu_pll_config() for switching mpu pll clock
>> from board code ... you delete this function later in this patch,
>> so I think, I can switch to do_setup_pll() ... if this is not
>> static code ...
> Yes I saw that patch. No need to make this non-static.
> Please have your own struct "const struct dpll_params dpll_mpu"
> and update your values accordingly.

Hmm.. maybe I miss something here. You call setup_dplls()
in arch/arm/cpu/armv7/am33xx/clock.c using &dpll_mpu defined
in arch/arm/cpu/armv7/am33xx/clock_am33xx.c ... so how to
make here a board specific struct?

The MPUCLK is configurable through the define CONFIG_SYS_MPUCLK
which is good, but I have on this board a PMIC, which in board SPL
code change MPU and core voltage ... and after that I change
the MPU clock again ...

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [U-Boot, v2] powerpc/mpc85xx:Disable Debug TLB entry before init_tlbs

2013-06-24 Thread Prabhakar Kushwaha

On 06/24/2013 11:11 PM, Scott Wood wrote:

On 06/24/2013 01:17:11 AM, Prabhakar Kushwaha wrote:

On 06/24/2013 08:44 AM, Prabhakar Kushwaha wrote:

On 06/22/2013 02:42 AM, Scott Wood wrote:

On 06/21/2013 04:05:37 PM, Fleming Andy-AFLEMING wrote:


On Jun 21, 2013, at 3:59 PM, Scott Wood wrote:

> On 06/21/2013 03:38:48 PM, Andy Fleming wrote:
>> On Thu, Jun 13, 2013 at 10:14:00AM +0530, Prabhakar Kushwaha 
wrote:
>> > init_tlbs() initialize all the TLB entries required for the 
system.

>> >
>> > So disable DEBUG TLB entry before TLB entries initialization.
>> >
>> > Signed-off-by: Prabhakar Kushwaha 
>> Applied, with fixes.
>> > diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c 
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

>> > index f4403c2..340b063 100644
>> > --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> > +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> > @@ -180,5 +180,9 @@ void cpu_init_early_f(void)
>> >
>> >  invalidate_tlb(1);
>> >
>> > +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && 
!defined(CONFIG_SPL_BUILD)

>> > + disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
>> > +#endif
>> Had to add CONFIG_NAND_SPL here, as well, just for future 
reference

>
> Why exclude all SPLs?  Only minimal SPLs skip creating the debug 
TLB.


The definition of disable_tlb() is excluded when NAND_SPL is defined.


I'm talking about new-SPL, not NAND_SPL.  My comment is about the 
original patch (I made the comment before internally), not your 
edit to it.


as per comment from Scott, we should have below define. It takes 
care of SPL minimal + nand_spl


#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && 
!defined(CONFIG_SPL_INIT_MINIMAL) && !defined(CONFIG_NAND_SPL)


May I resend this patch?


It would need to be:

#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
!(defined(CONFIG_SPL_INIT_MINIMAL) && defined(CONFIG_SPL_BUILD)) && \
!defined(CONFIG_NAND_SPL)

just a afterthought, current modified* patch is correct i.e. " #if 
defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_SPL_BUILD) 
&& !defined(CONFIG_NAND_SPL)"

DEBUG TLB never been created for SPL & NAND_SPL so no need to disable.


Why would the debug TLB not be created for a non-minimal-init SPL?


Looks like my assumption is *wrong*.  as per this define

#if defined(CONFIG_NAND_SPL) || \
(defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_INIT_MINIMAL))
#define MINIMAL_SPL
#endif
MINIMAL_SPL is defined only with CONFIG_SPL_INIT_MINIMAL. for 
MINIMAL_SPL interrupt vectors are never relocated. hence,  no need of  
DEBUG TLB entry.


for rest, interrupt vectors are relocated, so debug tlb entry is must.

I will post a patch upstream to fix this problem.

Thanks,
Prabhakar




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


Re: [U-Boot] [PATCH 2/4] usb:composite: use memcpy to avoid unaligned access

2013-06-24 Thread Heiko Schocher
Hello Prafulla,

just saw, that the below patch is delegated to you:
(added also Marek Vasut to cc, as he is the usb maintainer)

Am 10.04.2013 14:07, schrieb Piotr Wilczek:
> This patch memcpy is used instead of an assignment to
> avoid unaligned access execption on some ARM platforms.
> 
> Signed-off-by: Piotr Wilczek 
> Signed-off-by: Kyungmin Park 
> CC: Lukasz Majewski 
> ---
>  drivers/usb/gadget/composite.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
> index 2c5600e..0716e52 100644
> --- a/drivers/usb/gadget/composite.c
> +++ b/drivers/usb/gadget/composite.c
> @@ -997,7 +997,8 @@ static int composite_bind(struct usb_gadget *gadget)
>   if (status < 0)
>   goto fail;
>  
> - cdev->desc = *composite->dev;
> + memcpy(&cdev->desc, composite->dev,
> +sizeof(struct usb_device_descriptor));
>   cdev->desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
>  
>   debug("%s: ready\n", composite->name);
> 

This fixes a bug... do you plan to work it in for this release? Or
are there some issues with this patch?

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: AM33xx: Cleanup dplls data

2013-06-24 Thread Lokesh Vutla

Hi Heiko,
On Tuesday 25 June 2013 12:42 AM, Heiko Schocher wrote:

Hello Lokesh,

Am 24.06.2013 15:15, schrieb Lokesh Vutla:

Locking sequence for all the dplls is same.
In the current code same sequence is done repeatedly
for each dpll. Instead have a generic function
for locking dplls and pass dpll data to that function.

This is derived from OMAP4 boards.

Signed-off-by: Lokesh Vutla 
---
  arch/arm/cpu/armv7/am33xx/Makefile   |1 +
  arch/arm/cpu/armv7/am33xx/clock.c|  116 ++
  arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  222 +-
  arch/arm/cpu/armv7/am33xx/emif4.c|4 +
  arch/arm/include/asm/arch-am33xx/clock.h |   68 
  arch/arm/include/asm/arch-am33xx/ddr_defs.h  |2 +
  arch/arm/include/asm/arch-am33xx/sys_proto.h |1 +
  7 files changed, 232 insertions(+), 182 deletions(-)
  create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c


[...]

diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock.c
new file mode 100644
index 000..a7f1d83
--- /dev/null
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -0,0 +1,116 @@

[...]

+static void do_setup_dpll(const struct dpll_regs *dpll_regs,
+ const struct dpll_params *params)
+{


Could we have this function not only static? I posted a patch:

[U-Boot] arm, am335x: make mpu pll config configurable
http://patchwork.ozlabs.org/patch/248509/

which uses mpu_pll_config() for switching mpu pll clock
from board code ... you delete this function later in this patch,
so I think, I can switch to do_setup_pll() ... if this is not
static code ...

Yes I saw that patch. No need to make this non-static.
Please have your own struct "const struct dpll_params dpll_mpu"
and update your values accordingly.

Thanks and regards,
Lokesh


[...]

diff --git a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c 
b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
index 9c4d0b4..e878b25 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
@@ -26,56 +26,53 @@
  #define PRCM_FORCE_WAKEUP 0x2
  #define PRCM_FUNCTL   0x0

-#define PRCM_EMIF_CLK_ACTIVITY BIT(2)
-#define PRCM_L3_GCLK_ACTIVITY  BIT(4)
-
-#define PLL_BYPASS_MODE0x4
-#define ST_MN_BYPASS   0x0100
-#define ST_DPLL_CLK0x0001
-#define CLK_SEL_MASK   0x7
-#define CLK_DIV_MASK   0x1f
-#define CLK_DIV2_MASK  0x7f
-#define CLK_SEL_SHIFT  0x8
-#define CLK_MODE_SEL   0x7
-#define CLK_MODE_MASK  0xfff8
-#define CLK_DIV_SEL0xFFE0
  #define CPGMAC0_IDLE  0x3
-#define DPLL_CLKDCOLDO_GATE_CTRL0x300
-
  #define OSC   (V_OSCK/100)


and could we move this define then to
arch/arm/include/asm/arch-am33xx/clock.h
too?

Thnaks!

bye,
Heiko



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


Re: [U-Boot] [PATCH] gpio: s3c2440_gpio: Fix wrong writel arguments

2013-06-24 Thread Minkyu Kang
On 15/06/13 18:56, Axel Lin wrote:
> Current code had writel arguments the wrong way around, fix it.
> 
> Signed-off-by: Axel Lin 
> ---
> Hi,
> I don't have this hardware to test, but current code looks obviously wrong.
> I'd appreciate if someone can review and test this patch.
> 
> Axel
>  drivers/gpio/s3c2440_gpio.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c
> index 43bbf11..09b04eb 100644
> --- a/drivers/gpio/s3c2440_gpio.c
> +++ b/drivers/gpio/s3c2440_gpio.c
> @@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value)
>   else
>   l &= ~bit;
>  
> - return writel(port, l);
> + return writel(l, port);
>  }
>  
>  int gpio_get_value(unsigned gpio)
> @@ -85,11 +85,11 @@ int gpio_free(unsigned gpio)
>  
>  int gpio_direction_input(unsigned gpio)
>  {
> - return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio));
> + return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
>  }
>  
>  int gpio_direction_output(unsigned gpio, int value)
>  {
> - writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio));
> + writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio));
>   return gpio_set_value(gpio, value);
>  }
> 

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] gpio: s5p_gpio: Call s5p_gpio_set_value() instead of open-code

2013-06-24 Thread Minkyu Kang
On 15/06/13 23:19, Axel Lin wrote:
> Call s5p_gpio_set_value() to avoid code duplication.
> 
> Signed-off-by: Axel Lin 
> ---
>  drivers/gpio/s5p_gpio.c | 9 +
>  1 file changed, 1 insertion(+), 8 deletions(-)
> 
> diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
> index 656bf4a..4efb768 100644
> --- a/drivers/gpio/s5p_gpio.c
> +++ b/drivers/gpio/s5p_gpio.c
> @@ -48,15 +48,8 @@ void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int 
> gpio, int cfg)
>  
>  void s5p_gpio_direction_output(struct s5p_gpio_bank *bank, int gpio, int en)
>  {
> - unsigned int value;
> -
>   s5p_gpio_cfg_pin(bank, gpio, GPIO_OUTPUT);
> -
> - value = readl(&bank->dat);
> - value &= ~DAT_MASK(gpio);
> - if (en)
> - value |= DAT_SET(gpio);
> - writel(value, &bank->dat);
> + s5p_gpio_set_value(bank, gpio, en);
>  }
>  
>  void s5p_gpio_direction_input(struct s5p_gpio_bank *bank, int gpio)
> 

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] cmd_i2c: Use ARRAY_SIZE instead of reinventing it

2013-06-24 Thread Axel Lin
2013/6/25 Simon Glass :
> On Sat, Jun 22, 2013 at 6:56 AM, Axel Lin  wrote:
>>
>> Signed-off-by: Axel Lin 
>
>
> Missing commit message?

Because the subject line is already very clear.
And tools/checkpatch.pl does not complaint.

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


Re: [U-Boot] [PATH v5 00/14] sf: Update sf framework to support all sizes of flashes

2013-06-24 Thread Simon Glass
Hi Jagan,


On Sun, Jun 23, 2013 at 11:04 AM, Jagan Teki wrote:

> On 21-06-2013 20:12, Jagannadha Sutradharudu Teki wrote:
>
>> This is a v5 patch series with some modifications on previous series
>> with same head "sf: Update sf framework to support all sizes of flashes"
>>
>> The current implementation in sf supports 3-byte address mode due to
>> this up to 16MB amount of flash is able to access for those flashes
>> which has an actual size of > 16MB.
>>
>> This series of patches is more detailed/meatured changes w.r.t the
>> current sf framework in addition to changes related to support all
>> sizes using bank/exnt register addr accessing support.
>>
>> With these new updates on sf framework, the flashes which has < 16MB
>> are not effected as per as performance is concern and but the
>> u-boot.bin size incrased ~460 bytes.
>>
>> sf update(for first 16MBytes), Changes before:
>> U-Boot> sf update 0x100 0x0 0x100
>> - N25Q256
>>16777216 bytes written, 0 bytes skipped in 199.72s, speed 86480 B/s
>> - W25Q128BV
>>16777216 bytes written, 0 bytes skipped in 351.739s, speed 48913 B/s
>> - S25FL256S_64K
>>16777216 bytes written, 0 bytes skipped in 65.659s, speed 262144 B/s
>>
>> sf update(for first 16MBytes), Changes after:
>> U-Boot> sf update 0x100 0x0 0x100
>> - N25Q256
>>16777216 bytes written, 0 bytes skipped in 198.953s, speed 86480 B/s
>> - W25Q128BV
>>16777216 bytes written, 0 bytes skipped in 350.90s, speed 49200 B/s
>> - S25FL256S_64K
>>16777216 bytes written, 0 bytes skipped in 66.521s, speed 262144 B/s
>>
>> The main aim of these changes is to not effect the current framework
>> and at the same time to support the > 16Mbyte flashes, becuase of this
>> I involved few flash vendor people in CC [thought that they may/mayn't
>> be a mailing list members] to know their views.
>>
>> REQUEST FOR ALL SPI CODE CONTRIBUTORS/USERS, PLEASE TEST THESE
>> CHANGES W.R.T YOUR HW IF POSSIBLE.
>> Please let me know for any issues/concerns/questions.
>>
>> --
>> Thanks,
>> Jagan.
>>
>> Jagannadha Sutradharudu Teki (14):
>>sf: Add bank address register writing support
>>sf: Discover the bank addr commands
>>sf: Read flash bank addr register at probe time
>>sf: Update sf to support all sizes of flashes
>>sf: Update sf read to support all sizes of flashes
>>sf: Add bank addr code in CONFIG_SPI_FLASH_BAR
>>sf: Use spi_flash_addr() in write call
>>sf: stmicro: Add support for N25Q512
>>sf: stmicro: Add support for N25Q512A
>>sf: stmicro: Add support for N25Q1024
>>sf: stmicro: Add support for N25Q1024A
>>sf: spansion: Add support for S25FL512S_64K
>>sf: Remove spi_flash_cmd_poll_bit()
>>sf: Add flag status register polling support
>>
>>   README   |   5 +
>>   drivers/mtd/spi/spansion.c   |   7 ++
>>   drivers/mtd/spi/spi_flash.c  | 186
>> +-**-
>>   drivers/mtd/spi/spi_flash_**internal.h |  29 +-
>>   drivers/mtd/spi/stmicro.c|  28 ++
>>   include/spi_flash.h  |  10 ++
>>   6 files changed, 232 insertions(+), 33 deletions(-)
>>
>>
> Applied to u-boot-spi/master
>

I took a look at both series and they look good to me. Thanks for
addressing the comments.

I also sent out a sandbox series today that you may have seen.

Regards,
Simon


>
> --
> Thanks,
> Jagan.
> __**_
> U-Boot mailing list
> U-Boot@lists.denx.de
> http://lists.denx.de/mailman/**listinfo/u-boot
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_i2c: Use ARRAY_SIZE instead of reinventing it

2013-06-24 Thread Simon Glass
On Sat, Jun 22, 2013 at 6:56 AM, Axel Lin  wrote:

> Signed-off-by: Axel Lin 
>

Missing commit message?

Otherwise:

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


Re: [U-Boot] [PATCH v4 0/8] Provide a mechanism to avoid using #ifdef everywhere

2013-06-24 Thread Simon Glass
Hi Albert,

On Sun, Jun 23, 2013 at 12:29 AM, Albert ARIBAUD
wrote:

> Hi Simon,
>
> On Mon, 17 Jun 2013 07:44:52 -0700, Simon Glass 
> wrote:
>
> > Note that a config_drop.h file is added - this defines all the CONFIGs
> > which are not used in any board config file. Without this, autoconf
> cannot
> > define the macros for this CONFIGs.
> >
> > Compile time for main.c does not seem to be any different in my tests.
> The
> > time to perform the 'dep' step (which now creates autoconf.h) increases,
> > from about 2.8s to about 4.6s. This additional time is used to grep, sed
> > and sort the contents of all the header file in U-Boot. The time for an
> > incremental build is not affected.
> >
> > It would be much more efficient to maintain a list of all available
> CONFIG
> > defines, but no such list exists at present.
>
> Stop me if I am wrong, but do you not have this list already, since at
> one point you grep, sed and sort the whole list of config options, then
> at another point generate the list of unused ones?
>

Well yes I create the list. But I don't 'have' it in the sense that it is a
pre-existing file in the tree. My point was that if the file existed I
would not need to create it in the build system. I asked about this at one
point, and the comment was made that putting it in the source tree
'staticly' is risky, since someone might add a new option and it would not
work.

Perhaps when Kconfig is in there things will be different.


>
> Granted, that's the list of config options defined, not necessarily the
> list of options used, but a second variation of the grep/sed/sort might
> give you a hint on that.
>
> Plus, I would love having scripts in tools/ that look for either
> defined or used config options.
>

With this series you kind-of get this feature - you can look at the files
it creates along the way.

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


Re: [U-Boot] [PATCH V2 3/9] dts/Makefile: simplify dtc invocation

2013-06-24 Thread Simon Glass
On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren wrote:

> From: Stephen Warren 
> The invocation of dtc is significantly more complex that it could be,
> in order to work around an issue on old versions of dtc, which print
> a message to stdout every time they run.
>
> Remove this workaround, on the assumption that people have or will
> upgrade to a newer version of dtc. This simplifies the build rule
> significantly.
>
> Related, split the invocation of cpp and dtc into separate commands
> rather than a pipeline, so that if either fail, it is detected. This has
> the nice benefit of saving off the result of the pre-processing step,
> allowing it to be easily inspected.
>
> Assuming a new enough dtc (which an earlier patch enforces), dtc will
> parse #line directives in its input file, and generate correct file and
> line numbers in error messages, even though cpp is unconditionally
> applied to its input file.
>
> Signed-off-by: Stephen Warren 
>

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


Re: [U-Boot] [PATCH V2 1/9] Validate dtc is new enough

2013-06-24 Thread Simon Glass
Hi Stephen,

On Mon, Jun 24, 2013 at 8:43 AM, Stephen Warren wrote:

> From: Stephen Warren 
>
> Subsequent patches assume that dtc supports various recent features.
> These are available in dtc 1.4.0. Validate that dtc is at least that
> version.
>
> Signed-off-by: Stephen Warren 
> ---
> v2: New patch.
>

Acked-by: Simon Glass 

See note below.


> ---
>  Makefile |  8 +++-
>  config.mk|  1 +
>  tools/dtc-version.sh | 20 
>  3 files changed, 28 insertions(+), 1 deletion(-)
>  create mode 100755 tools/dtc-version.sh
>
> diff --git a/Makefile b/Makefile
> index 50880c9..f167458 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -428,7 +428,7 @@ endif
>
>  all:   $(ALL-y) $(SUBDIR_EXAMPLES)
>
> -$(obj)u-boot.dtb:  $(obj)u-boot
> +$(obj)u-boot.dtb:  checkdtc $(obj)u-boot
>

Any reason this is not in dts/Makefile? Still this is fine.


> $(MAKE) -C dts binary
> mv $(obj)dts/dt.dtb $@
>
> @@ -686,6 +686,12 @@ checkgcc4:
> false; \
> fi
>
> +checkdtc:
> +   @if test $(call dtc-version) -lt 0104; then \
> +   echo '*** Your dtc is too old, please upgrade to dtc 1.4
> or newer'; \
> +   false; \
> +   fi
> +
>  #
>  # Auto-generate the autoconf.mk file (which is included by all makefiles)
>  #
> diff --git a/config.mk b/config.mk
> index 6e17ed8..32643ec 100644
> --- a/config.mk
> +++ b/config.mk
> @@ -136,6 +136,7 @@ endif
>  # Usage gcc-ver := $(call cc-version)
>  cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
>  binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh
> $(AS))
> +dtc-version = $(shell $(SHELL) $(SRCTREE)/tools/dtc-version.sh $(DTC))
>
>  #
>  # Include the make variables (CC, etc...)
> diff --git a/tools/dtc-version.sh b/tools/dtc-version.sh
> new file mode 100755
> index 000..e8c94d3
> --- /dev/null
> +++ b/tools/dtc-version.sh
> @@ -0,0 +1,20 @@
> +#!/bin/sh
> +#
> +# dtc-version dtc-command
> +#
> +# Prints the dtc version of `dtc-command' in a canonical 4-digit form
> +# such as `0222' for binutils 2.22
> +#
> +
> +dtc="$*"
> +
> +if [ ${#dtc} -eq 0 ]; then
> +   echo "Error: No dtc command specified."
> +   printf "Usage:\n\t$0 \n"
> +   exit 1
> +fi
> +
> +MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1)
> +MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2)
> +
> +printf "%02d%02d\\n" $MAJOR $MINOR
> --
> 1.8.1.5
>
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Pull request: u-boot-net.git master

2013-06-24 Thread Joe Hershberger
The following changes since commit 348e47f766ac228fb02d1af562b2e9a4c69355db:

  Merge branch 'master' of git://git.denx.de/u-boot-arm (2013-06-22
07:38:12 -0400)

are available in the git repository at:


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

for you to fetch changes up to 433a2c5325b982b49b099e526d373d07d0cc5e97:

  phylib: add atheros ar803x phy (2013-06-24 19:11:17 -0500)


Bo Shen (5):
  checkpatch: add ignore for network block comment style checking
  ARM: at91sam9n12: add network support with ksz8851_16mll
  net: macb: using AT91FAMILY replace #ifdeferry
  net: macb: using phylib to configure phy device
  net: macb: add support for gigabit MAC

Charles Coldwell (1):
  add support for Xilinx 1000BASE-X phy (GTX)

David Andrey (1):
  PHY: micrel.c: add support for KSZ9031

Heiko Schocher (2):
  phylib: add natsemi dp83630 phy
  phylib: add atheros ar803x phy

Henrik Nordström (1):
  net: Add sunxi (Allwinner) wemac driver

Joe Hershberger (3):
  net: Fix build regression in cmd_pxe.c
  net: Fix build regression in macb.c
  net: Correct check for link-local target IP conflict

Kim Phillips (2):
  net: make IPaddr type big endian
  net/tftp: sparse fixes

Kuo-Jung Su (2):
  net: add Faraday FTMAC110 10/100Mbps ethernet support
  net: update FTGMAC100 for MMU/D-cache support

Matthias Brugger (1):
  net: nfs: add dynamic wait period

Rob Herring (10):
  pxe: Use ethact setting for pxe
  pxe: make string parameters const
  pxe: fix handling of different localboot values
  bootz: un-staticize do_bootz
  pxe: try bootz if bootm fails to find a valid image
  pxe: always display a menu when present
  pxe: simplify menu display and selection
  pxe: add support for ontimeout token
  pxe: add support for per arch and SoC default paths
  pxe: add ipappend support

Roberto Cerati (1):
  net: ks8851_mll: add ethernet support

SARTRE Leo (1):
  net: phy: supplement support for Micrel's KSZ9031

Sebastian Hesselbarth (3):
  NET: phy: add 88E1310 PHY initialization
  NET: mvgbe: add phylib support
  NET: mvgbe: add support for Dove

Shiraz Hashim (1):
  net/macb: Add arch specific routine to get mdio control

Vipin Kumar (1):
  net/designware: Do not select MIIPORT for RGMII interface

Xie Xiaobo (1):
  phylib: Add Atheros AR8035 GETH PHY support

Yegor Yefremov (2):
  phy: export genphy_parse_link()
  net: add ICPlus PHY driver

 .checkpatch.conf  |   3 +
 board/atmel/at91sam9n12ek/at91sam9n12ek.c |  36 ++
 common/cmd_bootm.c|   2 +-
 common/cmd_pxe.c  | 221 ++
 drivers/net/Makefile  |   3 +
 drivers/net/designware.c  |   4 +-
 drivers/net/ftgmac100.c   |  70 +++-
 drivers/net/ftmac110.c| 473 ++
 drivers/net/ftmac110.h| 177 
 drivers/net/ks8851_mll.c  | 645 ++
 drivers/net/ks8851_mll.h  | 357 +
 drivers/net/macb.c| 185 +++--
 drivers/net/macb.h|  55 ++-
 drivers/net/mvgbe.c   |  71 +++-
 drivers/net/mvgbe.h   |   7 +
 drivers/net/phy/Makefile  |   1 +
 drivers/net/phy/atheros.c |  45 ++-
 drivers/net/phy/icplus.c  |  94 +
 drivers/net/phy/marvell.c |  48 +++
 drivers/net/phy/micrel.c  | 113 --
 drivers/net/phy/natsemi.c |  37 ++
 drivers/net/phy/phy.c |  26 +-
 drivers/net/sunxi_wemac.c | 533 
 include/command.h |   2 +
 include/configs/at91sam9n12ek.h   |   4 +
 include/linux/ethtool.h   |   4 +
 include/linux/mii.h   |   2 +
 include/micrel.h  |  11 +
 include/net.h |   2 +-
 include/netdev.h  |   3 +
 include/phy.h |   1 +
 net/link_local.c  |  17 +-
 net/nfs.c |  74 +++-
 net/tftp.c|  12 +-
 34 files changed, 3117 insertions(+), 221 deletions(-)
 create mode 100644 drivers/net/ftmac110.c
 create mode 100644 drivers/net/ftmac110.h
 create mode 100644 drivers/net/ks8851_mll.c
 create mode 100644 drivers/net/ks8851_mll.h
 create mode 100644 drivers/net/phy/icplus.c
 create mode 100644 drivers/net/sunxi_wemac.c
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/3] net: macb: using AT91FAMILY replace #ifdeferry

2013-06-24 Thread Joe Hershberger
On Mon, Jun 24, 2013 at 9:57 AM, Andreas Bießmann
 wrote:
> Hi Joe,
>
> On 04/24/2013 09:59 AM, Bo Shen wrote:
>> Using CONFIG_AT91FAMILY replace #ifdeferry for atmel SoC
>>
>> Signed-off-by: Bo Shen 
>> ---
>>  drivers/net/macb.c |   10 ++
>>  1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
>> index 8bacbda..753fb96 100644
>> --- a/drivers/net/macb.c
>> +++ b/drivers/net/macb.c
>> @@ -466,19 +466,13 @@ static int macb_init(struct eth_device *netdev, bd_t 
>> *bd)
>>
>>   /* choose RMII or MII mode. This depends on the board */
>>  #ifdef CONFIG_RMII
>> -#if  defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
>> - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
>> - defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
>> - defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
>> +#ifdef CONFIG_AT91FAMILY
>>   macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
>>  #else
>>   macb_writel(macb, USRIO, 0);
>>  #endif
>>  #else
>> -#if  defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
>> - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
>> - defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
>> - defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
>> +#ifdef CONFIG_AT91FAMILY
>>   macb_writel(macb, USRIO, MACB_BIT(CLKEN));
>>  #else
>>   macb_writel(macb, USRIO, MACB_BIT(MII));
>>
>
> just realized that this patch is still not in u-boot/master. Will you
> apply it (and the rest of the series) for this release?

Yes.  I have a PR ready now.

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


Re: [U-Boot] [PATCH] board/bsc913x: Add config flag for bootdelay

2013-06-24 Thread Scott Wood

On 06/24/2013 04:28:26 AM, Rai Harninder-B01044 wrote:

Hello Albert,


Plase fix commit message: you're not simply adding a boot delay flag,  
you're in fact disabling autoboot, which is quite different.
[Rai Harninder-B01044] "Disable autoboot through bootdelay config  
flag". Is this ok?


But the patch isn't disabling autoboot.  It was already compile-time  
disabled, since CONFIG_BOOTDELAY wasn't specified at all.  The patch is  
allowing it to be enabled at runtime, without enabling it by default.


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


Re: [U-Boot] [PATCH v4] dfu, nand: before write a buffer to nand, erase the nand sectors

2013-06-24 Thread Scott Wood

On 06/24/2013 11:50:40 AM, Heiko Schocher wrote:

before writing the received buffer to nand, erase the nand
sectors. If not doing this, nand write fails. See for
more info here:

http://lists.denx.de/pipermail/u-boot/2013-June/156361.html

Using the nand erase option "spread", maybe overwrite
blocks on, for example another mtd partition, if the
erasing range contains bad blocks.
So a limit option is added to nand_erase_opts()

Signed-off-by: Heiko Schocher 
Cc: Scott Wood 
Cc: Pantelis Antoniou 
Cc: Lukasz Majewski 
Cc: Kyungmin Park 
Cc: Marek Vasut 
Cc: Tom Rini 

---
- changes for v2:
  - use opts.spread as Scott Wood suggested
- changes for v3:
  - add opts.lim as Scott Wood suggested
- changes for v4:
  - fix boundary check as Scott Wood mentioned


Applied to u-boot-nand-flash

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


[U-Boot] [PATCH v4 5/6] sandbox: spi: Add new SPI flash driver

2013-06-24 Thread Simon Glass
From: Mike Frysinger 

This adds a SPI flash driver which simulates SPI flash clients.
Currently supports the bare min that U-Boot requires: you can
probe, read, erase, and write.  Should be easy to extend to make
it behave more exactly like a real SPI flash, but this is good
enough to merge now.

Signed-off-by: Mike Frysinger 
Signed-off-by: Simon Glass 
---
Changes in v4:
- Add a description to the sandbox README
- Add full error handling and reporting
- Add more helpful errors when the SPI spec is wrong
- Add support for a Winbond 4MB/16MB parts
- Fix bug in alignment checking
- Make use of new struct sandbox_spi_info
- Rename sb to sandbox in SPI driver
- Tidy up erasing to cope with any size
- Update the copyright year

Changes in v3:
- rearchitected on top of state/getopt support

Changes in v2: None

 board/sandbox/sandbox/README.sandbox |  54 
 drivers/mtd/spi/Makefile |   1 +
 drivers/mtd/spi/sandbox.c| 464 +++
 3 files changed, 519 insertions(+)
 create mode 100644 drivers/mtd/spi/sandbox.c

diff --git a/board/sandbox/sandbox/README.sandbox 
b/board/sandbox/sandbox/README.sandbox
index 04692b3..f7745f2 100644
--- a/board/sandbox/sandbox/README.sandbox
+++ b/board/sandbox/sandbox/README.sandbox
@@ -47,6 +47,60 @@ the console. It does not set the terminal into raw mode, so 
cursor keys and
 history will not work yet.
 
 
+SPI Emulation
+-
+
+Sandbox supports SPI and SPI flash emulation.
+
+This is controlled by the spi_sf argument, the format of which is:
+
+   bus:cs:device:file
+
+   bus- SPI bus number
+   cs - SPI chip select number
+   device - SPI device emulation name
+   file   - File on disk containing the data
+
+For example:
+
+ dd if=/dev/zero of=spi.bin bs=1M count=4
+ ./u-boot --spi_sf 0:0:M25P16:spi.bin
+
+With this setup you can issue SPI flash commands as normal:
+
+=>sf probe
+SF: Detected M25P16 with page size 64 KiB, total 2 MiB
+=>sf read 0 0 1
+SF: 65536 bytes @ 0x0 Read: OK
+=>
+
+Since this is a full SPI emulation (rather than just flash), you can
+also use low-level SPI commands:
+
+=>sspi 0:0 32 9f
+FF202015
+
+This is issuing a READ_ID command and getting back 20 (ST Micro) part
+0x2015 (the M25P16).
+
+Drivers are connected to a particular bus/cs using sandbox's state
+structure (see the 'spi' member). A set of operations must be provided
+for each driver.
+
+
+Configuration settings for the curious are:
+
+CONFIG_SANDBOX_SPI_MAX_BUS
+   The maximum number of SPI buses supported by the driver (default 1).
+
+CONFIG_SANDBOX_SPI_MAX_CS
+   The maximum number of chip selects supported by the driver
+   (default 10).
+
+CONFIG_SPI_IDLE_VAL
+   The idle value on the SPI bus
+
+
 Tests
 -
 
diff --git a/drivers/mtd/spi/Makefile b/drivers/mtd/spi/Makefile
index 90f8392..fb37807 100644
--- a/drivers/mtd/spi/Makefile
+++ b/drivers/mtd/spi/Makefile
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_SPI_FLASH) += spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)  += eon.o
 COBJS-$(CONFIG_SPI_FLASH_MACRONIX) += macronix.o
+COBJS-$(CONFIG_SPI_FLASH_SANDBOX)  += sandbox.o
 COBJS-$(CONFIG_SPI_FLASH_SPANSION) += spansion.o
 COBJS-$(CONFIG_SPI_FLASH_SST)  += sst.o
 COBJS-$(CONFIG_SPI_FLASH_STMICRO)  += stmicro.o
diff --git a/drivers/mtd/spi/sandbox.c b/drivers/mtd/spi/sandbox.c
new file mode 100644
index 000..16728ed
--- /dev/null
+++ b/drivers/mtd/spi/sandbox.c
@@ -0,0 +1,464 @@
+/*
+ * Simulate a SPI flash
+ *
+ * Copyright (c) 2011-2013 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include "spi_flash_internal.h"
+
+#include 
+#include 
+#include 
+
+/*
+ * The different states that our SPI flash transitions between.
+ * We need to keep track of this across multiple xfer calls since
+ * the SPI bus could possibly call down into us multiple times.
+ */
+enum sandbox_sf_state {
+   SF_CMD,   /* default state -- we're awaiting a command */
+   SF_ID,/* read the flash's (jedec) ID code */
+   SF_ADDR,  /* processing the offset in the flash to read/etc... */
+   SF_READ,  /* reading data from the flash */
+   SF_WRITE, /* writing data to the flash, i.e. page programming */
+   SF_ERASE, /* erase the flash */
+   SF_READ_STATUS, /* read the flash's status register */
+};
+
+static const char *sandbox_sf_state_name(enum sandbox_sf_state state)
+{
+   static const char * const states[] = {
+   "CMD", "ID", "ADDR", "READ", "WRITE", "ERASE", "READ_STATUS",
+   };
+   return states[state];
+}
+
+/* Bits for the status register */
+#define STAT_WIP   (1 << 0)
+#define STAT_WEL   (1 << 1)
+
+/* Assume all SPI flashes have 3 byte addresses since they do atm */
+#define SF_ADDR_LEN3
+
+struct sandbox_spi_flash_erase_comm

[U-Boot] [PATCH v4 6/6] sandbox: spi: Enable new spi/sf layers

2013-06-24 Thread Simon Glass
From: Mike Frysinger 

We want to test SPI flash code in the sandbox, so enable the new drivers and
the 'sf test' command.

This command is used to validate the sandbox SPI / SPI flash implementation,
so enable it.

Signed-off-by: Mike Frysinger 
Signed-off-by: Simon Glass 
---
Changes in v4:
- Enable 'sf test' command on sandbox
- Enable support for winbond emulation as well as ST micro

Changes in v3: None
Changes in v2:
- No change log available in original v2 series

 include/configs/sandbox.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 369b808..33aaecd 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -67,6 +67,16 @@
 #define CONFIG_ENV_SIZE8192
 #define CONFIG_ENV_IS_NOWHERE
 
+/* SPI */
+#define CONFIG_SANDBOX_SPI
+#define CONFIG_CMD_SF
+#define CONFIG_CMD_SF_TEST
+#define CONFIG_CMD_SPI
+#define CONFIG_SPI_FLASH
+#define CONFIG_SPI_FLASH_SANDBOX
+#define CONFIG_SPI_FLASH_STMICRO
+#define CONFIG_SPI_FLASH_WINBOND
+
 #define CONFIG_SYS_HZ  1000
 
 /* Memory things - we don't really want a memory test */
-- 
1.8.3

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


[U-Boot] [PATCH v4 2/6] sandbox: spi: Adjust 'sf test' to work on sandbox

2013-06-24 Thread Simon Glass
Add map_sysmem() calls so that this test works correctly on sandbox.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add new patch to make 'sf test' work on sandbox

Changes in v3: None
Changes in v2: None

 common/cmd_sf.c | 14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 19b0dc9..55a1c52 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -345,7 +345,8 @@ static void show_time(struct test_info *test, int stage)
int bps;/* Bits per second */
 
speed = (long long)test->bytes * 1000;
-   do_div(speed, test->time_ms[stage] * 1024);
+   if (test->time_ms[stage])
+   do_div(speed, test->time_ms[stage] * 1024);
bps = speed * 8;
 
printf("%d %s: %d ticks, %d KiB/s %d.%03d Mbps\n", stage,
@@ -433,11 +434,13 @@ static int do_spi_flash_test(int argc, char * const 
argv[])
 {
unsigned long offset;
unsigned long len;
-   uint8_t *buf = (uint8_t *)CONFIG_SYS_TEXT_BASE;
+   uint8_t *buf, *from;
char *endp;
uint8_t *vbuf;
int ret;
 
+   if (argc < 3)
+   return -1;
offset = simple_strtoul(argv[1], &endp, 16);
if (*argv[1] == 0 || *endp != 0)
return -1;
@@ -447,17 +450,18 @@ static int do_spi_flash_test(int argc, char * const 
argv[])
 
vbuf = malloc(len);
if (!vbuf) {
-   printf("Cannot allocate memory\n");
+   printf("Cannot allocate memory (%lu bytes)\n", len);
return 1;
}
buf = malloc(len);
if (!buf) {
free(vbuf);
-   printf("Cannot allocate memory\n");
+   printf("Cannot allocate memory (%lu bytes)\n", len);
return 1;
}
 
-   memcpy(buf, (char *)CONFIG_SYS_TEXT_BASE, len);
+   from = map_sysmem(CONFIG_SYS_TEXT_BASE, 0);
+   memcpy(buf, from, len);
ret = spi_flash_test(flash, buf, len, offset, vbuf);
free(vbuf);
free(buf);
-- 
1.8.3

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


[U-Boot] [PATCH v4 1/6] sandbox: Increase memory size to 32MB

2013-06-24 Thread Simon Glass
The current 4MB size is a little small for some tests, so increase it.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add new patch to increase sandbox memory size, so 'sf test' works

Changes in v3: None
Changes in v2: None

 include/configs/sandbox.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h
index 788207d..369b808 100644
--- a/include/configs/sandbox.h
+++ b/include/configs/sandbox.h
@@ -48,7 +48,7 @@
 /*
  * Size of malloc() pool, although we don't actually use this yet.
  */
-#define CONFIG_SYS_MALLOC_LEN  (4 << 20)   /* 4MB  */
+#define CONFIG_SYS_MALLOC_LEN  (32 << 20)  /* 32MB  */
 
 #define CONFIG_SYS_PROMPT  "=>"/* Command Prompt */
 #define CONFIG_SYS_HUSH_PARSER
-- 
1.8.3

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


[U-Boot] [PATCH v4 4/6] sandbox: spi: Add SPI emulation bus

2013-06-24 Thread Simon Glass
From: Mike Frysinger 

This adds a SPI framework for people to hook up simulated SPI clients.

Signed-off-by: Mike Frysinger 
Signed-off-by: Simon Glass 
---
Changes in v4:
- Add additional error checking
- Fix new checkpatch warnings
- Rebase on top of recent spi changes
- Rename sb to sandbox
- Update copyright year

Changes in v3:
- rearchitected on top of state/getopt support

Changes in v2: None

 arch/sandbox/include/asm/config.h |   8 ++
 arch/sandbox/include/asm/spi.h|  58 +++
 arch/sandbox/include/asm/state.h  |   9 ++
 drivers/spi/Makefile  |   1 +
 drivers/spi/sandbox_spi.c | 199 ++
 5 files changed, 275 insertions(+)
 create mode 100644 arch/sandbox/include/asm/spi.h
 create mode 100644 drivers/spi/sandbox_spi.c

diff --git a/arch/sandbox/include/asm/config.h 
b/arch/sandbox/include/asm/config.h
index 2ef0564..0899fee 100644
--- a/arch/sandbox/include/asm/config.h
+++ b/arch/sandbox/include/asm/config.h
@@ -23,4 +23,12 @@
 
 #define CONFIG_SANDBOX_ARCH
 
+/* Used by drivers/spi/sandbox_spi.c and arch/sandbox/include/asm/state.h */
+#ifndef CONFIG_SANDBOX_SPI_MAX_BUS
+#define CONFIG_SANDBOX_SPI_MAX_BUS 1
+#endif
+#ifndef CONFIG_SANDBOX_SPI_MAX_CS
+#define CONFIG_SANDBOX_SPI_MAX_CS 10
+#endif
+
 #endif
diff --git a/arch/sandbox/include/asm/spi.h b/arch/sandbox/include/asm/spi.h
new file mode 100644
index 000..49b4a0f
--- /dev/null
+++ b/arch/sandbox/include/asm/spi.h
@@ -0,0 +1,58 @@
+/*
+ * Simulate a SPI port and clients (see README.sandbox for details)
+ *
+ * Copyright (c) 2011-2013 The Chromium OS Authors.
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * Licensed under the GPL-2 or later.
+ */
+
+#ifndef __ASM_SPI_H__
+#define __ASM_SPI_H__
+
+#include 
+
+/*
+ * The interface between the SPI bus and the SPI client.  The bus will
+ * instantiate a client, and that then call into it via these entry
+ * points.  These should be enough for the client to emulate the SPI
+ * device just like the real hardware.
+ */
+struct sandbox_spi_emu_ops {
+   /* The bus wants to instantiate a new client, so setup everything */
+   int (*setup)(void **priv, const char *spec);
+   /* The bus is done with us, so break things down */
+   void (*free)(void *priv);
+   /* The CS has been "activated" -- we won't worry about low/high */
+   void (*cs_activate)(void *priv);
+   /* The CS has been "deactivated" -- we won't worry about low/high */
+   void (*cs_deactivate)(void *priv);
+   /* The client is rx-ing bytes from the bus, so it should tx some */
+   int (*xfer)(void *priv, const u8 *rx, u8 *tx, uint bytes);
+};
+
+/*
+ * There are times when the data lines are allowed to tristate.  What
+ * is actually sensed on the line depends on the hardware.  It could
+ * always be 0xFF/0x00 (if there are pull ups/downs), or things could
+ * float and so we'd get garbage back.  This func encapsulates that
+ * scenario so we can worry about the details here.
+ */
+static inline void sandbox_spi_tristate(u8 *buf, uint len)
+{
+   /* XXX: make this into a user config option ? */
+   memset(buf, 0xff, len);
+}
+
+/*
+ * Extract the bus/cs from the spi spec and return the start of the spi
+ * client spec.  If the bus/cs are invalid for the current config, then
+ * it returns NULL.
+ *
+ * Example: arg="0:1:foo" will set bus to 0, cs to 1, and return "foo"
+ */
+const char *sandbox_spi_parse_spec(const char *arg, unsigned long *bus,
+  unsigned long *cs);
+
+#endif
diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h
index 9552708..0d35554 100644
--- a/arch/sandbox/include/asm/state.h
+++ b/arch/sandbox/include/asm/state.h
@@ -31,6 +31,11 @@ enum exit_type_id {
STATE_EXIT_POWER_OFF,
 };
 
+struct sandbox_spi_info {
+   const char *spec;
+   const struct sandbox_spi_emu_ops *ops;
+};
+
 /* The complete state of the test system */
 struct sandbox_state {
const char *cmd;/* Command to execute */
@@ -39,6 +44,10 @@ struct sandbox_state {
const char *parse_err;  /* Error to report from parsing */
int argc;   /* Program arguments */
char **argv;
+
+   /* Pointer to information for each SPI bus/cs */
+   struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS]
+   [CONFIG_SANDBOX_SPI_MAX_CS];
 };
 
 /**
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
index d08609e..56d67db 100644
--- a/drivers/spi/Makefile
+++ b/drivers/spi/Makefile
@@ -47,6 +47,7 @@ COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
 COBJS-$(CONFIG_MXS_SPI) += mxs_spi.o
 COBJS-$(CONFIG_OC_TINY_SPI) += oc_tiny_spi.o
 COBJS-$(CONFIG_OMAP3_SPI) += omap3_spi.o
+COBJS-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 COBJS-$(CONFIG_SH_SPI) += sh_spi.o
 COBJS-$(CONFIG_FSL_ESPI) += fsl_espi.o
diff --git

[U-Boot] [PATCH v4 3/6] sandbox: Rename sb_cmdline_option to sandbox_cmdline_option

2013-06-24 Thread Simon Glass
The new name is longer but more clearly related to sandbox.

This is in a separate patch within the same series since some coments on the
SPI series rely on it.

Signed-off-by: Simon Glass 
---
Changes in v4:
- Add new patch to rename to sandbox_cmdline_option

Changes in v3: None
Changes in v2: None

 arch/sandbox/cpu/os.c   |  2 +-
 arch/sandbox/cpu/start.c| 17 +
 arch/sandbox/include/asm/getopt.h   | 23 ---
 arch/sandbox/include/asm/sections.h |  4 ++--
 4 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/arch/sandbox/cpu/os.c b/arch/sandbox/cpu/os.c
index d075407..3e4fd0e 100644
--- a/arch/sandbox/cpu/os.c
+++ b/arch/sandbox/cpu/os.c
@@ -176,7 +176,7 @@ static struct option *long_opts;
 
 int os_parse_args(struct sandbox_state *state, int argc, char *argv[])
 {
-   struct sb_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
+   struct sandbox_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
size_t num_options = __u_boot_sandbox_option_count();
size_t i;
 
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index ae6e16c..e1f83f9 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -29,7 +29,7 @@
 int sandbox_early_getopt_check(void)
 {
struct sandbox_state *state = state_get_current();
-   struct sb_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
+   struct sandbox_cmdline_option **sb_opt = __u_boot_sandbox_option_start;
size_t num_options = __u_boot_sandbox_option_count();
size_t i;
int max_arg_len, max_noarg_len;
@@ -56,7 +56,7 @@ int sandbox_early_getopt_check(void)
max_noarg_len = max_arg_len + 7;
 
for (i = 0; i < num_options; ++i) {
-   struct sb_cmdline_option *opt = sb_opt[i];
+   struct sandbox_cmdline_option *opt = sb_opt[i];
 
/* first output the short flag if it has one */
if (opt->flag_short >= 0x100)
@@ -77,12 +77,12 @@ int sandbox_early_getopt_check(void)
os_exit(0);
 }
 
-static int sb_cmdline_cb_help(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_help(struct sandbox_state *state, const char 
*arg)
 {
/* just flag to sandbox_early_getopt_check to show usage */
return 1;
 }
-SB_CMDLINE_OPT_SHORT(help, 'h', 0, "Display help");
+SANDBOX_CMDLINE_OPT_SHORT(help, 'h', 0, "Display help");
 
 int sandbox_main_loop_init(void)
 {
@@ -97,19 +97,20 @@ int sandbox_main_loop_init(void)
return 0;
 }
 
-static int sb_cmdline_cb_command(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_command(struct sandbox_state *state,
+ const char *arg)
 {
state->cmd = arg;
return 0;
 }
-SB_CMDLINE_OPT_SHORT(command, 'c', 1, "Execute U-Boot command");
+SANDBOX_CMDLINE_OPT_SHORT(command, 'c', 1, "Execute U-Boot command");
 
-static int sb_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
+static int sandbox_cmdline_cb_fdt(struct sandbox_state *state, const char *arg)
 {
state->fdt_fname = arg;
return 0;
 }
-SB_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
+SANDBOX_CMDLINE_OPT_SHORT(fdt, 'd', 1, "Specify U-Boot's control FDT");
 
 int main(int argc, char *argv[])
 {
diff --git a/arch/sandbox/include/asm/getopt.h 
b/arch/sandbox/include/asm/getopt.h
index 685883c..3048c2c 100644
--- a/arch/sandbox/include/asm/getopt.h
+++ b/arch/sandbox/include/asm/getopt.h
@@ -18,7 +18,7 @@ struct sandbox_state;
  * consumer code should focus on the macros below and
  * the callback function.
  */
-struct sb_cmdline_option {
+struct sandbox_cmdline_option {
/* The long flag name: "help" for "--help" */
const char *flag;
/* The (optional) short flag name: "h" for "-h" */
@@ -35,18 +35,19 @@ struct sb_cmdline_option {
  * Internal macro to expand the lower macros into the necessary
  * magic junk that makes this all work.
  */
-#define _SB_CMDLINE_OPT(f, s, ha, h) \
-   static struct sb_cmdline_option sb_cmdline_option_##f = { \
+#define _SANDBOX_CMDLINE_OPT(f, s, ha, h) \
+   static struct sandbox_cmdline_option sandbox_cmdline_option_##f = { \
.flag = #f, \
.flag_short = s, \
.help = h, \
.has_arg = ha, \
-   .callback = sb_cmdline_cb_##f, \
+   .callback = sandbox_cmdline_cb_##f, \
}; \
/* Ppointer to the struct in a special section for the linker script */ 
\
static __attribute__((section(".u_boot_sandbox_getopt"), used)) \
-   struct sb_cmdline_option *sb_cmdline_option_##f##_ptr = \
-   &sb_cmdline_option_##f
+   struct sandbox_cmdline_option \
+   *sandbox_cmdline_option_##f##_ptr = \
+   &sandbox_cmdline_option_##f
 
 /**
  * Macros for end code to declare new command li

[U-Boot] [PATCH v4 0/6] sandbox: Add SPI and SPI flash emulation

2013-06-24 Thread Simon Glass
This series was written by Mike Frysinger some time ago. It was fully
functional but had a few outstanding comments and the patches were never
applied:

http://patchwork.ozlabs.org/patch/146127/
http://patchwork.ozlabs.org/patch/146128/
http://patchwork.ozlabs.org/patch/146129/

I have picked these up, tidied up a few things and re-submitted. With the
addition of the 'sf test' command we can now test this series more easier,
and in fact it did find an erase bug which is now fixed.

The test used was:

 ./u-boot --spi_sf 0:0:M25P16:../image-peach-pit-adv.bin \
-c "sf probe; sf test 0 40"

U-Boot 2013.07-rc1-00016-g50db40c-dirty (Jun 22 2013 - 22:23:10)

DRAM:  128 MiB
Using default environment

In:serial
Out:   serial
Err:   serial
SF: Detected M25P16 with page size 64 KiB, total 2 MiB
SPI flash test:
0 erase: 2 ticks, 2048000 KiB/s 16384.000 Mbps
1 check: 5 ticks, 819200 KiB/s 6553.600 Mbps
2 write: 22 ticks, 186181 KiB/s 1489.448 Mbps
3 read: 1 ticks, 4096000 KiB/s 32768.000 Mbps
Test passed
0 erase: 2 ticks, 2048000 KiB/s 16384.000 Mbps
1 check: 5 ticks, 819200 KiB/s 6553.600 Mbps
2 write: 22 ticks, 186181 KiB/s 1489.448 Mbps
3 read: 1 ticks, 4096000 KiB/s 32768.000 Mbps

(the .bin file is a 4MB SPI flash image)

Changes in v4:
- Add a description to the sandbox README
- Add additional error checking
- Add full error handling and reporting
- Add more helpful errors when the SPI spec is wrong
- Add new patch to increase sandbox memory size, so 'sf test' works
- Add new patch to make 'sf test' work on sandbox
- Add new patch to rename to sandbox_cmdline_option
- Add support for a Winbond 4MB/16MB parts
- Enable 'sf test' command on sandbox
- Enable support for winbond emulation as well as ST micro
- Fix bug in alignment checking
- Fix new checkpatch warnings
- Make use of new struct sandbox_spi_info
- Rebase on top of recent spi changes
- Rename sb to sandbox
- Rename sb to sandbox in SPI driver
- Tidy up erasing to cope with any size
- Update copyright year
- Update the copyright year

Changes in v3:
- rearchitected on top of state/getopt support

Changes in v2:
- No change log available in original v2 series

Mike Frysinger (3):
  sandbox: spi: Add SPI emulation bus
  sandbox: spi: Add new SPI flash driver
  sandbox: spi: Enable new spi/sf layers

Simon Glass (3):
  sandbox: Increase memory size to 32MB
  sandbox: spi: Adjust 'sf test' to work on sandbox
  sandbox: Rename sb_cmdline_option to sandbox_cmdline_option

 arch/sandbox/cpu/os.c|   2 +-
 arch/sandbox/cpu/start.c |  17 +-
 arch/sandbox/include/asm/config.h|   8 +
 arch/sandbox/include/asm/getopt.h|  23 +-
 arch/sandbox/include/asm/sections.h  |   4 +-
 arch/sandbox/include/asm/spi.h   |  58 +
 arch/sandbox/include/asm/state.h |   9 +
 board/sandbox/sandbox/README.sandbox |  54 
 common/cmd_sf.c  |  14 +-
 drivers/mtd/spi/Makefile |   1 +
 drivers/mtd/spi/sandbox.c| 464 +++
 drivers/spi/Makefile |   1 +
 drivers/spi/sandbox_spi.c| 199 +++
 include/configs/sandbox.h|  12 +-
 14 files changed, 838 insertions(+), 28 deletions(-)
 create mode 100644 arch/sandbox/include/asm/spi.h
 create mode 100644 drivers/mtd/spi/sandbox.c
 create mode 100644 drivers/spi/sandbox_spi.c

-- 
1.8.3

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


Re: [U-Boot] [PATCH] Fix ext2/ext4 filesystem accesses beyond 2TiB

2013-06-24 Thread Sascha Silbe
Frederic Leroy  writes:

> From: Frédéric Leroy 
>
> With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
> which is required to represent block numbers for storage devices that
> exceed 2TiB (the block size usually is 512B), e.g. recent hard drives
>
> We now use lbaint_t for partition offset to reflect the lbaint_t change,
> and access partitions beyond or crossing the 2.1TiB limit.
> This required changes to signature of ext4fs_devread(), and type of all
> variables relatives to block sector.
>
> ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
> block is a multiple of device block sector. To avoid overflow problem
> when calling ext4fs_devread(), we need to cast the sector parameter.

Thanks for the patch!

Reading a file on an ext4 file system located on a partition starting
beyond the 2TiB limit on a SATA hard disk attached to a CuBox Pro
works fine now.

Tested-by: Sascha Silbe 


You'll probably have to add your Signed-off-by before your patch can be
merged.

A minor nitpick: The limit is at 2TiB (2^41 Bytes), which is roughly
2.2TB (2.2 * 10^12 Bytes).

Sascha


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


[U-Boot] [PATCH] Fix ext2/ext4 filesystem accesses beyond 2TiB

2013-06-24 Thread Frederic Leroy
From: Frédéric Leroy 

With CONFIG_SYS_64BIT_LBA, lbaint_t gets defined as a 64-bit type,
which is required to represent block numbers for storage devices that
exceed 2TiB (the block size usually is 512B), e.g. recent hard drives

We now use lbaint_t for partition offset to reflect the lbaint_t change,
and access partitions beyond or crossing the 2.1TiB limit.
This required changes to signature of ext4fs_devread(), and type of all
variables relatives to block sector.

ext2/ext4 fs uses logical block represented by a 32 bit value. Logical
block is a multiple of device block sector. To avoid overflow problem
when calling ext4fs_devread(), we need to cast the sector parameter.
---

This patch applies on top of Sascha one.
It has been tested with CONFIG_SYS_64BIT_LBA disabled on a small
disk and CONFIG_SYS_64BIT_LBA enabled on a 3TB disk on a LaCie 
arm platform. Moreover, CONFIG_CMD_EXT4 and CONFIG_FS_EXT4 was enabled.
Both compilation issue no warning.

For the 3TB setup, 3 partition have been created beyond the 2.1TiB limit.
One partition ext2, one ext4, and one vfat. Each one filled with an 
uImage kernel.
For all partition, commands fatls and ext2ls did work, as well as loading
and booting uImage.

 common/cmd_disk.c  |  2 +-
 disk/part_efi.c|  4 ++--
 fs/ext4/dev.c  |  8 
 fs/ext4/ext4_common.c  | 40 
 fs/ext4/ext4_journal.c | 12 ++--
 fs/ext4/ext4_write.c   | 38 +++---
 fs/ext4/ext4fs.c   | 14 +++---
 include/ext4fs.h   |  2 +-
 include/ext_common.h   |  2 +-
 include/ide.h  |  2 ++
 include/part.h |  4 ++--
 11 files changed, 65 insertions(+), 63 deletions(-)

diff --git a/common/cmd_disk.c b/common/cmd_disk.c
index ee4e215..809e231 100644
--- a/common/cmd_disk.c
+++ b/common/cmd_disk.c
@@ -67,7 +67,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int 
argc,
   "Name: %.32s  Type: %.32s\n", intf, dev, part, info.name,
   info.type);
 
-   debug("First Block: %ld,  # of blocks: %ld, Block Size: %ld\n",
+   debug("First Block: " LBAFu ",  # of blocks: " LBAFu ", Block Size: 
%ld\n",
  info.start, info.size, info.blksz);
 
if (dev_desc->block_read(dev, info.start, 1, (ulong *) addr) != 1) {
diff --git a/disk/part_efi.c b/disk/part_efi.c
index fb5e9f0..5c426fe 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -200,7 +200,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int 
part,
uuid_string(gpt_pte[part - 1].unique_partition_guid.b, info->uuid);
 #endif
 
-   debug("%s: start 0x%lX, size 0x%lX, name %s", __func__,
+   debug("%s: start 0x" LBAF ", size 0x" LBAF ", name %s", __func__,
info->start, info->size, info->name);
 
/* Remember to free pte */
@@ -431,7 +431,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
gpt_e[i].partition_name[k] =
(efi_char16_t)(partitions[i].name[k]);
 
-   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x%lx\n",
+   debug("%s: name: %s offset[%d]: 0x%x size[%d]: 0x" LBAF "\n",
  __func__, partitions[i].name, i,
  offset, i, partitions[i].size);
}
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 81b7633..7296118 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -42,7 +42,7 @@
 #include 
 #include "ext4_common.h"
 
-unsigned long part_offset;
+lbaint_t part_offset;
 
 static block_dev_desc_t *ext4fs_block_dev_desc;
 static disk_partition_t *part_info;
@@ -58,7 +58,7 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, 
disk_partition_t *info)
get_fs()->dev_desc->log2blksz;
 }
 
-int ext4fs_devread(int sector, int byte_offset, int byte_len, char *buf)
+int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
 {
unsigned block_len;
int log2blksz = ext4fs_block_dev_desc->log2blksz;
@@ -74,7 +74,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
if ((sector < 0) ||
((sector + ((byte_offset + byte_len - 1) >> log2blksz))
 >= part_info->size)) {
-   printf("%s read outside partition %d\n", __func__, sector);
+   printf("%s read outside partition " LBAFu "\n", __func__, 
sector);
return 0;
}
 
@@ -82,7 +82,7 @@ int ext4fs_devread(int sector, int byte_offset, int byte_len, 
char *buf)
sector += byte_offset >> log2blksz;
byte_offset &= ext4fs_block_dev_desc->blksz - 1;
 
-   debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
+   debug(" <" LBAFu ", %d, %d>\n", sector, byte_offset, byte_len);
 
if (byte_offset != 0) {
/* read first part which isn't aligned with start of sector */
diff --git a/fs/ext4/ext4_common.c b/fs/ext4/ext4_common.c
index 58880b4..61b1ca1 100644
--- a/fs/ext4/ext4_comm

Re: [U-Boot] [PATCH] Fix block device accesses beyond 2TiB

2013-06-24 Thread Sascha Silbe
Frédéric Leroy  writes:

> Le 22/06/2013 17:31, Albert ARIBAUD a écrit :
>> > However, the patch issues no warning at compile time and fixes the ide
>> > block layer.
>>
>> OK -- anyone has any idea why Sasha's patch fixes reading from "far"
>> blocks but does not fix ex2ls? Frankly, I'd prefer it if the patch
>> fixed it all. :)

Thanks to Frédéric for testing and to Marek for the quick review.


[...]
> Ext2 code use "unsigned long" for the partition offset and "int" for
> sector computation.
> I will try to fix it, and try to test the other fs ( ext4, xfs, fat).
> I would see one patch for the ide code, and one or more patch for the fs
> code.
> IMHO, Sascha patch can be applied as.

While the IDE layer fix isn't enough for most use cases (storage devices
in the TiB range are usually used with file systems rather than raw
partitions), I agree that the file system level fixes should happen in
separate patches.

Tom, do you consider this a bug fix worth landing in v2013.07 or an
intrusive change (possibly even a feature as it never worked before)
that would go into v2013.10 instead?

If it's considered a bug fix, it would probably be a good idea to land
my patch ASAP rather than waiting for the FS level fixes. In the
"feature" case we can wait and include both IDE and FS fixes in a single
patch set once someone gets around to do the FS fixes.

Sascha


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


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

2013-06-24 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 a board//env
directory called .env (or common.env if you want the same
environment for all boards).

The environment variables should be of the form "var=value". Values can
extend to multiple lines. See the README under 'Environment Variables:'
for more information and an example.

Comments are not permitted in the environment with this commit.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add additional include to env_embedded to deal with its dirty trick
- Add dependency rule so that the environment is rebuilt when it changes
- Add information and updated example script to README
- Move .env file from include/configs to board/
- Use awk script to process environment since it is much easier on the brain

 Makefile | 30 +-
 README   | 34 ++
 common/env_embedded.c|  1 +
 config.mk|  2 ++
 include/env_default.h|  2 ++
 mkconfig |  6 ++
 tools/scripts/env2string.awk | 43 +++
 7 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 tools/scripts/env2string.awk

diff --git a/Makefile b/Makefile
index 693b3f2..9dae750 100644
--- a/Makefile
+++ b/Makefile
@@ -695,7 +695,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 ; \
@@ -703,6 +703,34 @@ $(obj)include/autoconf.mk: $(obj)include/config.h
sed -n -f tools/scripts/define2mk.sed > $@.tmp && \
mv $@.tmp $@
 
+# We expect '.env' but failing that will use 'common.env'
+ENV_HEADER := $(obj)include/generated/environment.h
+ENV_DIR := $(if $(VENDOR),$(VENDOR)/env,$(BOARD)/env)
+ENV_FILE_BOARD := $(src)board/${ENV_DIR}/$(BOARD).env
+ENV_FILE_COMMON := $(src)board/${ENV_DIR}/common.env
+ENV_FILE := $(if $(wildcard 
$(ENV_FILE_BOARD)),$(ENV_FILE_BOARD),$(ENV_FILE_COMMON))
+
+# Regenerate the environment if it changes
+$(obj)include/generated/environment.in: 
$(obj)include/generated/autoconf.mk.base \
+   $(wildcard $(ENV_FILE))
+   if [ -f "$(ENV_FILE)" ]; then \
+   cat $(ENV_FILE) >$@ ; \
+   else \
+   echo -n >$@ ; \
+   fi
+
+$(obj)include/generated/environment.inc: $(obj)include/generated/environment.in
+   @$(XECHO) Generating $@ ; \
+   set -e ; \
+   : Process the environment file ; \
+   echo -n "CONFIG_EXTRA_ENV_TEXT=" >$@ ; \
+   echo -n "#define CONFIG_EXTRA_ENV_TEXT " >$(ENV_HEADER) ; \
+   awk -f tools/scripts/env2string.awk $< | \
+   tee -a $(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 cd0336c..2c8a8c9 100644
--- a/README
+++ b/README
@@ -4363,6 +4363,40 @@ 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 an environment file with the name
+board//env/.env for your board. If that file is not present
+then U-Boot will look for board//env/common.env so that you can
+have a common environment for all vendor boards.
+
+This is a plain text file where you can type your environment variables in
+the form 'var=value'. Blank lines and multi-line variables are supported.
+
+For example, for snapper9260 you would create a text file called
+board/bluewater/env/snapper9260.env containing the environment text.
+
+>>>
+bootcmd=
+   if [ -z ${tftpserverip} ]; then
+   echo "Use 'setenv tftpserverip a.b.c.d' to set IP address."
+   fi
+
+   usb start; setenv autoload n; boot

[U-Boot] [PATCH v2 5/5] RFC: tegra: Convert to using environment files

2013-06-24 Thread Simon Glass
This seems more intuitive that the current #define way of doing things.
The resulting code is shorter, avoids the quoting and line continuation
pain, and also improves the clumsy way that stdio variables are created:

 #ifdef CONFIG_VIDEO_TEGRA
 #define STDOUT_LCD ",lcd"
 #else
 #define STDOUT_LCD ""
 #endif

...
 #define TEGRA_DEVICE_SETTINGS \
"stdout=serial" STDOUT_LCD "\0" \
...

The MEM_LAYOUT_ENV_SETTINGS variable is left in the header files, since
it depends on the SOC type and we probably don't want to add .emv files
for each board at this stage.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add new patch to illustrate the impact on Tegra environment

 board/nvidia/env/common.env |  79 
 include/configs/tegra-common-post.h | 120 +---
 2 files changed, 80 insertions(+), 119 deletions(-)
 create mode 100644 board/nvidia/env/common.env

diff --git a/board/nvidia/env/common.env b/board/nvidia/env/common.env
new file mode 100644
index 000..aca36a5
--- /dev/null
+++ b/board/nvidia/env/common.env
@@ -0,0 +1,79 @@
+#ifndef CONFIG_BOOTCOMMAND
+rootpart=1
+script_boot=
+   if load ${devtype} ${devnum}:${rootpart}
+   ${scriptaddr} ${prefix}${script}; then
+   echo ${script} found! Executing ...
+   source ${scriptaddr}
+   fi
+
+scan_boot=
+   echo Scanning ${devtype} ${devnum}...
+   for prefix in ${boot_prefixes}; do
+   for script in ${boot_scripts}; do
+   run script_boot
+   done
+   done
+
+boot_targets=
+boot_prefixes=/ /boot/
+boot_scripts=boot.scr.uimg boot.scr
+
+#ifdef CONFIG_CMD_MMC
+mmc_boot=
+   setenv devtype mmc
+   if mmc dev ${devnum}; then
+   run scan_boot
+   fi
+bootcmd_mmc0=setenv devnum 0; run mmc_boot
+bootcmd_mmc1=setenv devnum 1; run mmc_booxt
+boot_targets+= mmc1 mmc0
+#endif
+
+#ifdef CONFIG_CMD_USB
+#define BOOTCMD_INIT_USB run usb_init
+usb_init=
+   if ${usb_need_init}; then
+   set usb_need_init false
+   usb start 0
+   fi
+usb_boot=
+   setenv devtype usb
+   BOOTCMD_INIT_USB
+   if usb dev ${devnum}; then
+   run scan_boot
+   fi
+bootcmd_usb0=setenv devnum 0; run usb_boot
+boot_targets+= usb0
+#else
+#define BOOTCMD_INIT_USB
+#endif
+
+#ifdef CONFIG_CMD_DHCP
+bootcmd_dhcp=
+   BOOTCMD_INIT_USB
+   if dhcp ${scriptaddr} boot.scr.uimg; then
+   source ${scriptaddr}
+   fi
+boot_targets+= dhcp
+#endif
+
+bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
+#endif
+
+/* Decide on values for stdio */
+stdin=serial
+stdout=serial
+stderr=serial
+
+#ifdef CONFIG_TEGRA_KEYBOARD
+stdin+=,tegra-kbc
+#endif
+
+#ifdef CONFIG_USB_KEYBOARD
+stdin+=,usbkbd
+#endif
+
+#ifdef CONFIG_VIDEO_TEGRA
+stdout+=,lcd
+#endif
diff --git a/include/configs/tegra-common-post.h 
b/include/configs/tegra-common-post.h
index 6ed2fde..e14a0e1 100644
--- a/include/configs/tegra-common-post.h
+++ b/include/configs/tegra-common-post.h
@@ -24,131 +24,13 @@
 #ifndef __TEGRA_COMMON_POST_H
 #define __TEGRA_COMMON_POST_H
 
-#ifdef CONFIG_BOOTCOMMAND
-
-#define BOOTCMDS_COMMON ""
-
-#else
-
-#ifdef CONFIG_CMD_MMC
-#define BOOTCMDS_MMC \
-   "mmc_boot=" \
-   "setenv devtype mmc; " \
-   "if mmc dev ${devnum}; then " \
-   "run scan_boot; " \
-   "fi\0" \
-   "bootcmd_mmc0=setenv devnum 0; run mmc_boot;\0" \
-   "bootcmd_mmc1=setenv devnum 1; run mmc_boot;\0"
-#define BOOT_TARGETS_MMC "mmc1 mmc0"
-#else
-#define BOOTCMDS_MMC ""
-#define BOOT_TARGETS_MMC ""
-#endif
-
-#ifdef CONFIG_CMD_USB
-#define BOOTCMD_INIT_USB "run usb_init; "
-#define BOOTCMDS_USB \
-   "usb_init=" \
-   "if ${usb_need_init}; then " \
-   "set usb_need_init false; " \
-   "usb start 0; " \
-   "fi\0" \
-   \
-   "usb_boot=" \
-   "setenv devtype usb; " \
-   BOOTCMD_INIT_USB \
-   "if usb dev ${devnum}; then " \
-   "run scan_boot; " \
-   "fi\0" \
-   \
-   "bootcmd_usb0=setenv devnum 0; run usb_boot;\0"
-#define BOOT_TARGETS_USB "usb0"
-#else
-#define BOOTCMD_INIT_USB ""
-#define BOOTCMDS_USB ""
-#define BOOT_TARGETS_USB ""
-#endif
-
-#ifdef CONFIG_CMD_DHCP
-#define BOOTCMDS_DHCP \
-   "bootcmd_dhcp=" \
-   BOOTCMD_INIT_USB \
-   "if dhcp ${scriptaddr} boot.scr.uimg; then "\
-   "source ${scriptaddr}; " \
-   "fi\0"
-#define BOOT_TARGETS_DHCP "dhcp"
-#else
-#define BOOTCMDS_DHCP ""
-#define BOOT_TARGETS_DHCP ""
-#endif
-
-#define BOOTCMDS_COMMON \
-   "rootpart=1\0" \
-   \
-   "script_boot="\
-   "if load ${devtype} ${devnum}:${rootpart} "  

[U-Boot] [PATCH v2 2/5] Make 'run' use run_command_list() instead of run_command()

2013-06-24 Thread Simon Glass
In the case where an environment variable spans multiple lines, we should
use run_command_list() so that all lines are executed. This shold be
backwards compatible with existing behaviour for existing scripts.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add new patch to adjust 'run' command to better support testing

 common/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/main.c b/common/main.c
index 56da214..3b7f2f7 100644
--- a/common/main.c
+++ b/common/main.c
@@ -1560,7 +1560,7 @@ int do_run (cmd_tbl_t * cmdtp, int flag, int argc, char * 
const argv[])
return 1;
}
 
-   if (run_command(arg, flag) != 0)
+   if (run_command_list(arg, -1, flag) != 0)
return 1;
}
return 0;
-- 
1.8.3

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


[U-Boot] [PATCH v2 1/5] sandbox: Support 'env import' and 'env export'

2013-06-24 Thread Simon Glass
Adjust the code for these commands so that they work on sandbox.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add new patch to get 'env import/export' working on sandbox

 common/cmd_nvedit.c | 31 ++-
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 2478c95..e8493c2 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -49,6 +49,7 @@
 #include 
 #include 
 #include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -864,7 +865,8 @@ static int do_env_export(cmd_tbl_t *cmdtp, int flag,
 int argc, char * const argv[])
 {
charbuf[32];
-   char*addr, *cmd, *res;
+   ulong   addr;
+   char*ptr, *cmd, *res;
size_t  size = 0;
ssize_t len;
env_t   *envp;
@@ -909,10 +911,11 @@ NXTARG:   ;
if (argc < 1)
return CMD_RET_USAGE;
 
-   addr = (char *)simple_strtoul(argv[0], NULL, 16);
+   addr = simple_strtoul(argv[0], NULL, 16);
+   ptr = map_sysmem(addr, size);
 
if (size)
-   memset(addr, '\0', size);
+   memset(ptr, '\0', size);
 
argc--;
argv++;
@@ -920,7 +923,7 @@ NXTARG: ;
if (sep) {  /* export as text file */
len = hexport_r(&env_htab, sep,
H_MATCH_KEY | H_MATCH_IDENT,
-   &addr, size, argc, argv);
+   &ptr, size, argc, argv);
if (len < 0) {
error("Cannot export environment: errno = %d\n", errno);
return 1;
@@ -931,12 +934,12 @@ NXTARG:   ;
return 0;
}
 
-   envp = (env_t *)addr;
+   envp = (env_t *)ptr;
 
if (chk)/* export as checksum protected block */
res = (char *)envp->data;
else/* export as raw binary data */
-   res = addr;
+   res = ptr;
 
len = hexport_r(&env_htab, '\0',
H_MATCH_KEY | H_MATCH_IDENT,
@@ -978,7 +981,8 @@ sep_err:
 static int do_env_import(cmd_tbl_t *cmdtp, int flag,
 int argc, char * const argv[])
 {
-   char*cmd, *addr;
+   ulong   addr;
+   char*cmd, *ptr;
charsep = '\n';
int chk = 0;
int fmt = 0;
@@ -1022,12 +1026,13 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
if (!fmt)
printf("## Warning: defaulting to text format\n");
 
-   addr = (char *)simple_strtoul(argv[0], NULL, 16);
+   addr = simple_strtoul(argv[0], NULL, 16);
+   ptr = map_sysmem(addr, 0);
 
if (argc == 2) {
size = simple_strtoul(argv[1], NULL, 16);
} else {
-   char *s = addr;
+   char *s = ptr;
 
size = 0;
 
@@ -1047,7 +1052,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
 
if (chk) {
uint32_t crc;
-   env_t *ep = (env_t *)addr;
+   env_t *ep = (env_t *)ptr;
 
size -= offsetof(env_t, data);
memcpy(&crc, &ep->crc, sizeof(crc));
@@ -1056,11 +1061,11 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
puts("## Error: bad CRC, import failed\n");
return 1;
}
-   addr = (char *)ep->data;
+   ptr = (char *)ep->data;
}
 
-   if (himport_r(&env_htab, addr, size, sep, del ? 0 : H_NOCLEAR,
-   0, NULL) == 0) {
+   if (himport_r(&env_htab, ptr, size, sep, del ? 0 : H_NOCLEAR, 0,
+ NULL) == 0) {
error("Environment import failed: errno = %d\n", errno);
return 1;
}
-- 
1.8.3

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


[U-Boot] [PATCH v2 4/5] env: Allow environment files to use the C preprocessor

2013-06-24 Thread Simon Glass
In many cases environment variables need access to the U-Boot CONFIG
variables to select different options. Enable this so that the environment
scripts can be as useful as the ones currently in the board config files.

Signed-off-by: Simon Glass 
---
Changes in v2:
- Add separate patch to enable C preprocessor for environment files
- Enable var+=value form to simplify composing variables in multiple steps

 Makefile |  3 ++-
 README   | 17 -
 tools/scripts/env2string.awk |  6 ++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 9dae750..89ac4c5 100644
--- a/Makefile
+++ b/Makefile
@@ -714,7 +714,8 @@ ENV_FILE := $(if $(wildcard 
$(ENV_FILE_BOARD)),$(ENV_FILE_BOARD),$(ENV_FILE_COMM
 $(obj)include/generated/environment.in: 
$(obj)include/generated/autoconf.mk.base \
$(wildcard $(ENV_FILE))
if [ -f "$(ENV_FILE)" ]; then \
-   cat $(ENV_FILE) >$@ ; \
+   $(CPP) -P $(CFLAGS) -x assembler-with-cpp -D__ASSEMBLY__ \
+   -include $(obj)include/config.h $(ENV_FILE) -o $@; \
else \
echo -n >$@ ; \
fi
diff --git a/README b/README
index 2c8a8c9..6711cd0 100644
--- a/README
+++ b/README
@@ -4376,12 +4376,25 @@ have a common environment for all vendor boards.
 
 This is a plain text file where you can type your environment variables in
 the form 'var=value'. Blank lines and multi-line variables are supported.
+To add additional text to a variable you can use var+=value. This text is
+merged into the variable during the make process and made available as a
+single value to U-Boot.
 
 For example, for snapper9260 you would create a text file called
 board/bluewater/env/snapper9260.env containing the environment text.
 
+This file can include C-style comments. Blank lines and multi-line
+variables are supported, and you can use normal C preprocessor directives
+and CONFIG defines from your board config also.
+
 >>>
+stdout=serial
+#ifdef CONFIG_LCD
+stdout+=,lcd
+#endif
 bootcmd=
+   /* U-Boot script for booting */
+
if [ -z ${tftpserverip} ]; then
echo "Use 'setenv tftpserverip a.b.c.d' to set IP address."
fi
@@ -4390,7 +4403,9 @@ bootcmd=
tftpboot ${tftpserverip}:
bootm
 failed=
-   echo boot failed - please check your image
+   /* Print a message when boot fails */
+   echo CONFIG_SYS_BOARD boot failed - please check your image
+   echo Load address is CONFIG_SYS_LOAD_ADDR
 <<<
 
 The resulting environment can be exported and importing using the
diff --git a/tools/scripts/env2string.awk b/tools/scripts/env2string.awk
index 2d167c0..d647cf3 100644
--- a/tools/scripts/env2string.awk
+++ b/tools/scripts/env2string.awk
@@ -23,6 +23,12 @@ BEGIN {
}
var = arr[1]
env = arr[2]
+
+   # Deal with +=
+   if (match(var, "(.*)[+]$", var_arr)) {
+   var = var_arr[1]
+   env = vars[var] env
+   }
} else {
# Change newline to \n
env = env "\\n" $0;
-- 
1.8.3

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


[U-Boot] [PATCH v2 0/5] env: Add support for environment files

2013-06-24 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.

This series adds a feature that brings in a .env file associated with the
board config, if present. To use it, create a file in a board//env
directory called .env (or common.env if you want the same
environment for all boards for that vendor).

The environment variables should be of the form "var=value". Values can
extend to multiple lines. See the README under 'Environment Variables:'
for more information and an example.

After discussion on the mailing list the .emv file was moved from
include/configs to board/. See here:

   http://patchwork.ozlabs.org/patch/237120/

There was also talk of using the C preprocessor for these boards. I tried
this out and found it to be extremely useful. In fact without it, the
scripts probably cannot move from the config header file, since many scripts
are put together based on information from CONFIG variables.

Another discussion was compatibility with the environment commands
'env export -t' and 'env import -t'. This series permits these to be used
and the environment is exported and imported as expected. I have dropped
the ugly \0 approach in favour of a more flexible awk script for parsing
the environment file. The environment commands use \ at the end of a line
for continuation which works nicely with this feature. I have added a patch
to 'run' so that it runs the entire script, not just the first line. A nice
benefit is that there is no longer any need to put ';' at the end of every
line - in other words U-Boot scripts become proper scripts with multiple
lines instead of messy and fragile continuations.

As an example, I have converted most of the tegra environment over to this
new approach on an RFC basis.

Changes in v2:
- Add additional include to env_embedded to deal with its dirty trick
- Add dependency rule so that the environment is rebuilt when it changes
- Add information and updated example script to README
- Add new patch to adjust 'run' command to better support testing
- Add new patch to get 'env import/export' working on sandbox
- Add new patch to illustrate the impact on Tegra environment
- Add separate patch to enable C preprocessor for environment files
- Enable var+=value form to simplify composing variables in multiple steps
- Move .env file from include/configs to board/
- Use awk script to process environment since it is much easier on the brain

Simon Glass (5):
  sandbox: Support 'env import' and 'env export'
  Make 'run' use run_command_list() instead of run_command()
  Allow U-Boot scripts to be placed in a .env file
  env: Allow environment files to use the C preprocessor
  RFC: tegra: Convert to using environment files

 Makefile|  31 +-
 README  |  49 +++
 board/nvidia/env/common.env |  79 
 common/cmd_nvedit.c |  31 ++
 common/env_embedded.c   |   1 +
 common/main.c   |   2 +-
 config.mk   |   2 +
 include/configs/tegra-common-post.h | 120 +---
 include/env_default.h   |   2 +
 mkconfig|   6 ++
 tools/scripts/env2string.awk|  49 +++
 11 files changed, 238 insertions(+), 134 deletions(-)
 create mode 100644 board/nvidia/env/common.env
 create mode 100644 tools/scripts/env2string.awk

-- 
1.8.3

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


[U-Boot] PPC: MPC5xxx Pull request

2013-06-24 Thread Wolfgang Denk
Dear Tom,

The following changes since commit e1208c2fe5e07f9a248cfbf9bbb212aa34ad2806:

  MIPS: asm/errno.h: switch to asm-generic/errno.h (2013-06-08 23:10:10 +0200)

are available in the git repository at:

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

for you to fetch changes up to 6c5001d5429bed52c25cbfc1ed6e244beced3ed5:

  ac14xx: rephrase network boot config for development (2013-06-24 22:29:05 
+0200)


Gerhard Sittig (7):
  ac14xx: fix a potential NULL deref in diagnostics
  ac14xx: cleanup comments in the board support
  ac14xx: minor improvement in diagnostics
  ac14xx: re-order the recovery condition checks
  ac14xx: remove obsolete board config items
  ac14xx: use the official product name everywhere
  ac14xx: rephrase network boot config for development

 board/ifm/ac14xx/ac14xx.c | 50 +--
 include/configs/ac14xx.h  | 28 +++---
 2 files changed, 38 insertions(+), 40 deletions(-)


Note that these patches are strictly local to a single board
configuration, and a build test did not show any issues, so I think
these patches are OK even in the current stage of the release cycle -
but of course the final decision is up to you.

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
Looks clean and obviously correct to me, but then _everything_ I
write always looks obviously correct to me.  - Linus Torvalds in

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


Re: [U-Boot] [PATCH V2 0/9] rely on latest dtc, simplify

2013-06-24 Thread Tom Rini
On Mon, Jun 24, 2013 at 09:43:40AM -0600, Stephen Warren wrote:

> From: Stephen Warren 
> 
> This is a series of patches which simplifies the rules to build *.dts in
> U-Boot by relying on features in the latest dtc. The include rules are
> made more consistent between cpp (when processing *.dts) and dtc. The cpp
> flags are made more consistent with the way the kernel processes *.dts to
> allow better portability of *.dts between the two.
> 
> I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence
> there's a version number that patch 1/9 "Validate dtc is new enough" can
> check for. I'll leave it up to you whether this series is applicable for
> the current or next release.

OK, thanks.  I'm going to hold this out of the upcoming release but
spell out in the release notes that change is coming.

-- 
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] arm: omap5_uevm: Correct the console sys prompt for 5432

2013-06-24 Thread Tom Rini
On Sat, Jun 22, 2013 at 11:33:11AM +0200, Albert ARIBAUD wrote:
> Hi Tom,
> 
> On Tue, 11 Jun 2013 11:53:42 -0400, Tom Rini  wrote:
> 
> > On Thu, Jun 06, 2013 at 04:30:38PM -0500, Dan Murphy wrote:
> > 
> > > Correct the console sys prompt to display the correct processor
> > > and the corrent board
> > > 
> > > Signed-off-by: Dan Murphy 
> > > Reported-by: Lubomir Popov 
> > 
> > Reviewed-by: Tom Rini 
> > 
> > But personally, this is why I'm a fan of 'U-Boot # ' as the prompt :)
> 
> I'd like it too if we could simply have all boards using the same
> prompt, but there might be some scripts out there which rely on the
> prompt being something else than "U-Boot # ' or worse yet, using the
> prompt to determine which variant of the HW the scripts are dealing
> with.

True.  Looking ahead however, given device trees and the need to know
what tree to request/load, I hope more boards will go with enabling
CONFIG_ENV_VARS_UBOOT_CONFIG and can then use cpu/board/board_name as
needed to determine those things at run-time.

-- 
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 7/7] ac14xx: rephrase network boot config for development

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-8-git-send-email-...@denx.de> you wrote:
> - remove the builtin 'rootpath' spec (according to U-Boot project
>   policy) and require user provided environments to contain these
> - rephrase the evaluation of the 'muster_nr' approach which allows to
>   quickly switch among several network boot setups (make the setting
>   transparent when empty, resulting in default DULG behaviour)
> - reduce the ARP timeout for faster network boot
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  include/configs/ac14xx.h |   17 +
>  1 file changed, 9 insertions(+), 8 deletions(-)

Applied to u-boot-mpc5xxx, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"There was no difference between  the  behavior  of  a  god  and  the
operations of pure chance..."   - Thomas Pynchon, _Gravity's Rainbow_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 6/7] ac14xx: use the official product name everywhere

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-7-git-send-email-...@denx.de> you wrote:
> remove remaining "k6" code names, switch to the official 'ac14xx' name
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  include/configs/ac14xx.h |   10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

Applied to u-boot-mpc5xxx, thanks.


Best regards,

Wolfgang Denk

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


Re: [U-Boot] [PATCH v2 5/7] ac14xx: remove obsolete board config items

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-6-git-send-email-...@denx.de> you wrote:
> - use the default baudrate table for serial communication
> - remove hostname/boofile/rootpath defines which were not referenced elsewhere
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  include/configs/ac14xx.h |6 --
>  1 file changed, 6 deletions(-)

Applied to u-boot-mpc5xxx, thanks.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The further the spiritual evolution of  mankind  advances,  the  more
certain  it seems to me that the path to genuine religiosity does not
lie through the fear of life, and the fear of death, and blind faith,
but through striving after rational knowledge.  - Albert Einstein
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/7] ac14xx: minor improvement in diagnostics

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-4-git-send-email-...@denx.de> you wrote:
> - minor rewording of diagnostics output
> - make diagnostics optional and off by default
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  board/ifm/ac14xx/ac14xx.c |   34 --
>  1 file changed, 20 insertions(+), 14 deletions(-)

Applied to u-boot-mpc5xxx, thanks.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I wrote my name at the top of the page. I wrote down  the  number  of
the  question  ``1''.  After much reflection I put a bracket round it
thus ``(1)''. But thereafter I could not think of anything  connected
with it that was either relevant or true.
- Sir Winston Churchill _My Early Life_ ch. 2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 4/7] ac14xx: re-order the recovery condition checks

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-5-git-send-email-...@denx.de> you wrote:
> re-order the conditions which make the recovery system startup: combine
> those conditions which were explicitly initiated (key press, software
> request) and those which post-process error conditions (installer issues)
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  board/ifm/ac14xx/ac14xx.c |   12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)

Applied to u-boot-mpc5xxx, thanks.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There are certain things men must do to remain men.
-- Kirk, "The Ultimate Computer", stardate 4929.4
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 2/7] ac14xx: cleanup comments in the board support

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-3-git-send-email-...@denx.de> you wrote:
> fix typos, minor rephrasing, remove obsolete notes and TODO items
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  board/ifm/ac14xx/ac14xx.c |   10 ++
>  include/configs/ac14xx.h  |5 ++---
>  2 files changed, 4 insertions(+), 11 deletions(-)

Applied to u-boot-mpc5xxx, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I still miss my ex-wife, but my aim is getting better.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 1/7] ac14xx: fix a potential NULL deref in diagnostics

2013-06-24 Thread Wolfgang Denk
Dear Gerhard Sittig,

In message <1370436671-12422-2-git-send-email-...@denx.de> you wrote:
> getenv() immediately after setenv() may perfectly legally return NULL, so
> make sure to not deference an invalid pointer when creating diagnostic output
> 
> Signed-off-by: Gerhard Sittig 
> ---
>  board/ifm/ac14xx/ac14xx.c |8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Applied to u-boot-mpc5xxx, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
My brother sent me a postcard the other day with this  big  sattelite
photo  of the entire earth on it. On the back it said: "Wish you were
here".- Steven Wright
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


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

2013-06-24 Thread Tom Rini
On Fri, Jun 21, 2013 at 03:51:37PM -0500, Andy Fleming wrote:

> The following changes since commit 7315cfd9e1922ee1c3c5f016e5a3b16199122172:
> 
>   NET: Fix system hanging if NET device is not installed (2013-06-19 08:32:44 
> -0400)
> 
> are available in the git repository at:
> 
>   git://www.denx.de/git/u-boot-mpc85xx.git master
> 
> for you to fetch changes up to 5707233880090f785c33df32c04549ea1aeef61e:
> 
>   powerpc/85xx: Add P1023RDB board support (2013-06-20 17:08:53 -0500)
> 
> 
> Andy Fleming (2):
>   85xx: Change clock-frequency compatible to 2.0
>   85xx: Change case of MPC85XX_PORBMSR_ROMLOC_SHIFT
> 
> Axel Lin (1):
>   powerpc: mpc85xx/mpc86xx: Fix off-by-one boundary checking with 
> ARRAY_SIZE
> 
> Chris Packham (1):
>   powerpc/CoreNet: Allow pbl images to take u-boot images != 512K
> 
> Chunhe Lan (1):
>   powerpc/85xx: Add P1023RDB board support
> 
> Fabio Estevam (1):
>   powerpc: Use lower case for the core names
> 
> Liu Gang (6):
>   powerpc/doc: Update the README.srio-pcie-boot-corenet
>   powerpc/boot: Change the macro of Boot from SRIO and PCIE master module
>   powerpc/b4860qds: Enable master module for boot from SRIO and PCIE
>   powerpc/b4860qds: Slave module for boot from SRIO and PCIE
>   powerpc/t4qds: Enable master module for Boot from SRIO and PCIE
>   powerpc/t4qds: Slave module for boot from SRIO and PCIE
> 
> Mingkai Hu (2):
>   powerpc/mpc85xx: explicit cast the SDRAM size to type phys_size_t
>   fsl_ifc: add support for different IFC bank count
> 
> Prabhakar Kushwaha (9):
>   powerpc/mpc85xx:No NOR boot, do not compile IFC errata A003399
>   powerpc/mpc85xx: new SPL support for IFC NAND
>   board/p1010rdb:Add NAND boot support using new SPL format
>   board/bsc9131rdb:Add NAND boot support using new SPL format
>   board/bsc9132qds:Add NAND boot support using new SPL format
>   powerpc/mpc85xx:Fix "boot page TLB" entry size for NAND SPL
>   board/b4860qds: Relax NOR flash teadc timing parameter
>   board/p1010rdb: Fix PCIe TLB creation on CONFIG_PCI define
>   powerpc/mpc85xx:Disable Debug TLB entry before init_tlbs
> 
> Priyanka Jain (3):
>   board/bsc9131rdb: Add targets for Sysclk 100MHz
>   board/bsc9131rdb: Add DSP side tlb and laws
>   board/bsc9131rdb: Update default boot environment settings
> 
> Scott Wood (1):
>   powerpc/mpc85xx: work around erratum A-006593
> 
> Ying Zhang (4):
>   powerpc/mpc85xx: support application without resetvec segment in the 
> linker script
>   powerpc/mpc85xx: modify the functionality clear_bss and aligning the 
> end address of the BSS
>   common/Makefile: Add new symbol CONFIG_SPL_ENV_SUPPORT for environment 
> in SPL
>   Makefile: move the common makefile line to public area
> 
> York Sun (2):
>   powerpc/BSC9132: Add IFC bank count
>   powerpc/pixis: Fix pixis help message
> 
>  README |   27 ++
>  arch/powerpc/cpu/mpc85xx/Makefile  |1 +
>  arch/powerpc/cpu/mpc85xx/cmd_errata.c  |3 +
>  arch/powerpc/cpu/mpc85xx/cpu.c |   10 +-
>  arch/powerpc/cpu/mpc85xx/cpu_init.c|5 +-
>  arch/powerpc/cpu/mpc85xx/cpu_init_early.c  |   10 +-
>  arch/powerpc/cpu/mpc85xx/fdt.c |2 +-
>  arch/powerpc/cpu/mpc85xx/mpc8536_serdes.c  |4 +-
>  arch/powerpc/cpu/mpc85xx/mpc8544_serdes.c  |4 +-
>  arch/powerpc/cpu/mpc85xx/mpc8548_serdes.c  |2 +-
>  arch/powerpc/cpu/mpc85xx/mpc8568_serdes.c  |2 +-
>  arch/powerpc/cpu/mpc85xx/mpc8569_serdes.c  |2 +-
>  arch/powerpc/cpu/mpc85xx/mpc8572_serdes.c  |2 +-
>  arch/powerpc/cpu/mpc85xx/p1010_serdes.c|4 +-
>  arch/powerpc/cpu/mpc85xx/p1021_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p1022_serdes.c|4 +-
>  arch/powerpc/cpu/mpc85xx/p1023_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p2020_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p2041_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p3041_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p4080_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p5020_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/p5040_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/start.S   |2 +-
>  arch/powerpc/cpu/mpc85xx/t1040_serdes.c|2 +-
>  arch/powerpc/cpu/mpc85xx/u-boot-spl.lds|   18 +-
>  arch/powerpc/cpu/mpc85xx/u-boot.lds|8 +
>  arch/powerpc/cpu/mpc86xx/cpu.c |2 +-
>  arch/powerpc/cpu/mpc86xx/mpc8610_serdes.c  |4 +-
>  arch/powerpc/cpu/mpc86xx/mpc8641_serdes.c  |4 +-
>  arch/powerpc/cpu/mpc8xxx/fsl_ifc.c |   60 ++-
>  arch/powe

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

2013-06-24 Thread Tom Rini
On Fri, Jun 21, 2013 at 11:52:51PM +0200, Albert ARIBAUD wrote:

> Hello Tom,
> 
> The following changes since commit
> 847e6693ccb529bf8346db62876f38f0c4e04ade:
> 
>   arm: pxa: config option for PXA270 turbo mode (2013-06-12 22:24:12
>   +0200)
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-arm master
> 
> for you to fetch changes up to fbf87b1823dd5ebc2a384711ea2c677543019ece:
> 
>   arm: optimize relocate_code routine (2013-06-21 23:05:50 +0200)
> 
> 
> Akshay Saraswat (2):
>   Exynos5: clock: Update the equation to calculate PLL output
> frequency Exynos: uart: s5p: enabling the uart tx/rx fifo
> 
> Albert ARIBAUD (8):
>   Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
>   Merge branch 'u-boot-ti/master' into 'u-boot-arm/master'
>   arm: ensure u-boot only uses relative relocations
>   remove all references to .dynsym
>   arm: generalize lib/bss.c into lib/sections.c
>   arm: make __image_copy_{start, end} compiler-generated
>   arm: make __rel_dyn_{start, end} compiler-generated
>   arm: optimize relocate_code routine
> 
> Amar (9):
>   FDT: Add compatible string for DWMMC
>   EXYNOS5: FDT: Add DWMMC device node data
>   DWMMC: Initialise dwmci and resolve EMMC read write issues
>   EXYNOS5: DWMMC: Added FDT support for DWMMC
>   EXYNOS5: DWMMC: Initialise the local variable to avoid unwanted
> results. SMDK5250: Initialise and Enable DWMMC, support FDT and non-FDT
>   MMC: APIs to support resize of EMMC boot partition
>   SMDK5250: Enable EMMC booting
>   COMMON: MMC: Command to support EMMC booting and to resize EMMC
> boot partition
> 
> Arkadiusz Wlodarczyk (1):
>   arm:trats: change auto-booting to boot kernel with separate
> device tree blob
> 
> Dan Murphy (5):
>   arm: omap: Add check for fdtfile in the findfdt macro
>   arm: omap5_uevm: Correct the console sys prompt for 5432
>   arm: dra7xx: Update the EXTRA_ENV_SETTINGS
>   arm: omap4: panda: Add reading of the board revision
>   arm: omap4: panda: Fix checkpatch on panda file
> 
> Heiko Schocher (3):
>   arm, am33xx: move rtc32k_enable() to common place
>   arm, am335x: make mpu pll config configurable
>   arm, am33xx: move uart soft reset code to common place
> 
> Inderpal Singh (3):
>   exynos: move tzpc_init to armv7/exynos
>   exynos: update tzpc to make it common for exynos4 and exynos5
>   exynos: Update origen and smdkv310 to use common tzpc_init
> 
> Naveen Krishna Chatradhi (2):
>   power: exynos-tmu: fix warnings and clean up code
>   power: exynos-tmu: use the mux_addr bit fields in tmu_control
> register
> 
> Rajeshwari Shinde (3):
>   SF: Add driver for Gigabyte device GD25LQ and GD25Q64B
>   SMDK5250: Enable SPI Gigabyte device.
>   MMC: DWMMC: Fix FIFO_DEPTH calculation
> 
> Simon Guinot (3):
>   net2big_v2: initialize I2C fan at startup
>   LaCie/common: add support for the CPLD GPIO bus
>   net2big_v2: initialize LEDs at startup
> 
>  Makefile   |   7 +
>  arch/arm/config.mk |   5 +
>  arch/arm/cpu/arm920t/ep93xx/u-boot.lds |   6 +-
>  arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds  |   5 -
>  arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds|   5 -
>  arch/arm/cpu/armv7/am33xx/board.c  |  40 ++
>  arch/arm/cpu/armv7/am33xx/clock_am33xx.c   |   9 +-
>  arch/arm/cpu/armv7/exynos/Makefile |   2 +-
>  arch/arm/cpu/armv7/exynos/clock.c  |  10 +-
>  .../arm/cpu/armv7/exynos/tzpc.c|  25 +-
>  arch/arm/cpu/armv7/s5p-common/Makefile |   2 +
>  arch/arm/cpu/ixp/u-boot.lds|  20 +-
>  arch/arm/cpu/u-boot-spl.lds|   6 +-
>  arch/arm/cpu/u-boot.lds|  21 +-
>  arch/arm/dts/exynos5250.dtsi   |  33 ++
>  arch/arm/include/asm/arch-am33xx/sys_proto.h   |   4 +
>  arch/arm/include/asm/arch-exynos/cpu.h |   4 +
>  arch/arm/include/asm/arch-exynos/dwmmc.h   |  11 +-
>  arch/arm/include/asm/arch-exynos/tmu.h |  58 ++-
>  arch/arm/include/asm/arch-exynos/tzpc.h|  20 +
>  arch/arm/lib/Makefile  |   2 +-
>  arch/arm/lib/relocate.S|  61 +--
>  arch/arm/lib/{bss.c => sections.c} |   8 +-
>  board/LaCie/common/cpld-gpio-bus.c |  50 +++
>  board/LaCie/common/cpld-gpio-bus.h |  24 ++
>  board/LaCie/net2big_v2/Makefile|   3 +
>  board/LaCie/net2big_v2/net2big_v2.c| 154 +++-
>  board/LaCie/net2big_v2/net2big_v2.h|   5 +
>  board/actux1/u-boot.lds|  20 +-
>  board/actux2/u-boot.lds  

Re: [U-Boot] [RFC] [UBOOT] [PATCH v2 2/4] USB: Adapt the usb-compat.h to uboot and fix compiler errors

2013-06-24 Thread Tom Rini
On Mon, Jun 24, 2013 at 11:43:53AM -0500, Dan Murphy wrote:

> Adapt the usb-compat.h to uBoot.
> 
> Use #ifndef __UBOOT__ for code that is not applicable to uBoot.
> Use #ifdef __UBOOT__ to add code that is uBoot specific.
> 
> Create linux-compat.h - Linux kernel compatibility definitions that do not
> exist in the uBoot.  Moved the compatibility definitions from 
> lin_gadget_compat.h
> to this file as well.
> 
> Create usb-mod-devicetable.h - Is a partial back port of mod_devicetable.h in 
> the linux
> kernel only taking the portion needed for USB
> 
> Already existing header files were modified to pick up the new header files.
[snip]
> +++ b/include/linux/usb/linux-compat.h
[snip]
> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

This is already in 

> diff --git a/include/linux/usb/usb-compat.h b/include/linux/usb/usb-compat.h
> index a0bee5a..a46d1e6 100644
> --- a/include/linux/usb/usb-compat.h
> +++ b/include/linux/usb/usb-compat.h
[snip]
> @@ -1770,10 +1903,16 @@ usb_maxpacket(struct usb_device *udev, int pipe, int 
> is_out)
>   unsignedepnum = usb_pipeendpoint(pipe);
>  
>   if (is_out) {
> +#ifndef __UBOOT__
> + /* Fix this warning */
>   WARN_ON(usb_pipein(pipe));
> +#endif
>   ep = udev->ep_out[epnum];
>   } else {
> +#ifndef __UBOOT__
> + /* Fix this warning */
>   WARN_ON(usb_pipeout(pipe));
> +#endif

Are these warnings that aren't applicable to us, or things that need to
be fixed as part of the series, eventually?

But, in general, as this is the approach I suggested, I'm fine with it.

-- 
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] pxa: fix compiler warnings about unused variables

2013-06-24 Thread Mike Dunn
Newer gcc versions warn about unused variables.  This patch corrects a few of
those warnings that popped up in a pxa build.

Signed-off-by: Mike Dunn 
---
 drivers/mtd/nand/docg4_spl.c| 15 +++
 drivers/usb/gadget/pxa27x_udc.c | 14 +-
 2 files changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/mtd/nand/docg4_spl.c b/drivers/mtd/nand/docg4_spl.c
index 95e856c..734cbeb 100644
--- a/drivers/mtd/nand/docg4_spl.c
+++ b/drivers/mtd/nand/docg4_spl.c
@@ -113,7 +113,6 @@ static int docg4_load_block_reliable(uint32_t flash_offset, 
void *dest_addr)
int g4_index = 0;
uint16_t flash_status;
uint16_t *buf;
-   uint16_t discard, magic_high, magic_low;
 
/* flash_offset must be aligned to the start of a block */
if (flash_offset & 0x3)
@@ -154,9 +153,9 @@ static int docg4_load_block_reliable(uint32_t flash_offset, 
void *dest_addr)
 * The IPL on the palmtreo680 requires that this contain a 32 bit magic
 * number, or the load aborts.  We'll ignore it.
 */
-   discard = readw(docptr + 0x103c); /* hw quirk; 1st read discarded */
-   magic_low = readw(docptr + 0x103c);
-   magic_high = readw(docptr + DOCG4_MYSTERY_REG);
+   readw(docptr + 0x103c); /* hw quirk; 1st read discarded */
+   readw(docptr + 0x103c); /* lower 16 bits of magic number */
+   readw(docptr + DOCG4_MYSTERY_REG); /* upper 16 bits of magic number */
writew(0, docptr + DOC_DATAEND);
write_nop(docptr);
write_nop(docptr);
@@ -183,15 +182,15 @@ static int docg4_load_block_reliable(uint32_t 
flash_offset, void *dest_addr)
write_nop(docptr);
 
/* read the 512 bytes of page data, 2 bytes at a time */
-   discard = readw(docptr + 0x103c);
+   readw(docptr + 0x103c); /* hw quirk */
for (i = 0; i < 256; i++)
*buf++ = readw(docptr + 0x103c);
 
/* read oob, but discard it */
for (i = 0; i < 7; i++)
-   discard = readw(docptr + 0x103c);
-   discard = readw(docptr + DOCG4_OOB_6_7);
-   discard = readw(docptr + DOCG4_OOB_6_7);
+   readw(docptr + 0x103c);
+   readw(docptr + DOCG4_OOB_6_7);
+   readw(docptr + DOCG4_OOB_6_7);
 
writew(0, docptr + DOC_DATAEND);
write_nop(docptr);
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 71cc0f2..598923d 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -151,7 +151,7 @@ static int udc_read_urb(struct usb_endpoint_instance 
*endpoint)
struct urb *urb = endpoint->rcv_urb;
int ep_num = endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK;
u32 *data32 = (u32 *) urb->buffer;
-   unsigned int i, n, is_short ;
+   unsigned int i, n;
 
usbdbg("read urb on ep %d", ep_num);
 #if defined(USBDDBG) && defined(USBDPARANOIA)
@@ -165,9 +165,8 @@ static int udc_read_urb(struct usb_endpoint_instance 
*endpoint)
n = readl(UDCBCN(ep_num)) & 0x3ff;
else /* zlp */
n = 0;
-   is_short = n != endpoint->rcv_packetSize;
 
-   usbdbg("n %d%s", n, is_short ? "-s" : "");
+   usbdbg("n %d%s", n, n != endpoint->rcv_packetSize ? "-s" : "");
for (i = 0; i < n; i += 4)
data32[urb->actual_length / 4 + i / 4] = readl(UDCDN(ep_num));
 
@@ -402,16 +401,13 @@ static void udc_handle_ep(struct usb_endpoint_instance 
*endpoint)
 
 static void udc_state_changed(void)
 {
-   int config, interface, alternate;
 
writel(readl(UDCCR) | UDCCR_SMAC, UDCCR);
 
-   config = (readl(UDCCR) & UDCCR_ACN) >> UDCCR_ACN_S;
-   interface = (readl(UDCCR) & UDCCR_AIN) >> UDCCR_AIN_S;
-   alternate = (readl(UDCCR) & UDCCR_AAISN) >> UDCCR_AAISN_S;
-
usbdbg("New UDC settings are: conf %d - inter %d - alter %d",
-   config, interface, alternate);
+  (readl(UDCCR) & UDCCR_ACN) >> UDCCR_ACN_S,
+  (readl(UDCCR) & UDCCR_AIN) >> UDCCR_AIN_S,
+  (readl(UDCCR) & UDCCR_AAISN) >> UDCCR_AAISN_S);
 
usbd_device_event_irq(udc_device, DEVICE_CONFIGURED, 0);
writel(UDCISR1_IRCC, UDCISR1);
-- 
1.8.1.5

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


Re: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Heiko Schocher
Hello Tom,

Am 24.06.2013 21:31, schrieb Tom Rini:
> On 06/24/2013 03:17 PM, Heiko Schocher wrote:
>> Hello Lokesh,
> [snip]
>>> +   /* Enable RTC32K clock */ + rtc32k_enable();
> 
>> I tried your patches on my three boards. The board with the 
>> rtc32k_enable() problem, did not work with them too :-(
> 
>> Maybe we make rtc32k_enable() weak in common code, and so I can
>> make a board specific (dummy) function?
> 
> I'm not a big fan of this since without this kicked, you can't do PM.
>  And we don't want to do it in the kernel as it takes a few seconds to
> settle.  Kicking it in U-Boot means it will be settled by the time
> it's needed, if I recall things right.

Hmm.. but on my board, the cpu hangs (not accessible through bdi
anymore) if I access this registers ... looking still for an
explanation ...

Clocks are enabled, 24MHz (same as on am335x eval board) used ...
I know, this is only a bugfix, without knowing the real reason ...

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v5 1/3] ARM: Tegra: FDT: Add USB EHCI function for T30/T114

2013-06-24 Thread Stephen Warren
On 06/21/2013 05:05 AM, Jim Lin wrote:
> Add DT node for USB EHCI function.
> Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

The series,

Reviewed-by: Stephen Warren 

Also, on Beaver, Cardhu-A04, and Dalmore, I tested downloading/booting a
kernel over a USB Ethernet dongle, so,

Tested-by: Stephen Warren 

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


[U-Boot] stb7100mboard

2013-06-24 Thread holovati
Hi

Does anyone know where i can find u-boot source with pre-configured support
for stb7100mboard, it used to be available on stlinux website, but can't
seem to find it any longer.


D



--
View this message in context: 
http://u-boot.10912.n7.nabble.com/stb7100mboard-tp157738.html
Sent from the U-Boot mailing list archive at Nabble.com.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] ARM: OMAP: GPIO: Fix valid range and enable usage of all GPIOs on OMAP5

2013-06-24 Thread Heiko Schocher
Hello Axel,

Am 21.06.2013 12:54, schrieb Axel Lin:
> The omap_gpio driver is used by AM33XX, OMAP3/4, OMAP54XX and DRA7XX SoCs.
> These SoCs have different gpio count but currently omap_gpio driver uses hard
> coded 192 which is wrong.
> 
> This patch fixes this issue by:
> 1. Move define of OMAP_MAX_GPIO to all arch/arm/include/asm/arch-omap*/gpio.h.
> 2. Update gpio bank settings and enable GPIO modules 7 & 8 clocks for OMAP5.
> 
> Thanks for Lubomir Popov to provide valuable comments to fix this issue.
> 
> Signed-off-by: Axel Lin 
> ---
> This patch supersedes below patches:
> 
> [PATCH v3 1/2] gpio: omap_gpio: Fix valid gpio range for AM33XX [1]
> [PATCH v3 2/2] gpio: omap_gpio: Fix valid GPIO range for OMAP5 [2]
> [PATCH 1/2] OMAP5: Fix gpio_bank_54xx setting [3]
> [PATCH 2/2] OMAP: gpio: Introduce get_omap_gpio_count() function to get gpio 
> count [4]
> 
> [1] http://lists.denx.de/pipermail/u-boot/2013-June/156980.html
> [2] http://lists.denx.de/pipermail/u-boot/2013-June/156981.html
> [3] http://lists.denx.de/pipermail/u-boot/2013-June/156984.html
> [4] http://lists.denx.de/pipermail/u-boot/2013-June/156985.html

Acked-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] musb: Disable extra prints

2013-06-24 Thread Heiko Schocher
Hello Lokesh,

Am 24.06.2013 15:15, schrieb Lokesh Vutla:
> There are many musb prints in SPL and U-Boot log.
> These prints are required only during musb debug.
> So replacing printk with pr_debug in musb_core.
> 
> Signed-off-by: Lokesh Vutla 
> ---
>  drivers/usb/musb-new/musb_core.c |   18 +++---
>  1 file changed, 7 insertions(+), 11 deletions(-)

Acked-by: Heiko Schocher 

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Tom Rini
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 06/24/2013 03:17 PM, Heiko Schocher wrote:
> Hello Lokesh,
[snip]
>> +/* Enable RTC32K clock */ + rtc32k_enable();
> 
> I tried your patches on my three boards. The board with the 
> rtc32k_enable() problem, did not work with them too :-(
> 
> Maybe we make rtc32k_enable() weak in common code, and so I can
> make a board specific (dummy) function?

I'm not a big fan of this since without this kicked, you can't do PM.
 And we don't want to do it in the kernel as it takes a few seconds to
settle.  Kicking it in U-Boot means it will be settled by the time
it's needed, if I recall things right.

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

iQIcBAEBAgAGBQJRyJ6YAAoJENk4IS6UOR1WpRsP/id6+SDeuNpbq3+d2e4VXXii
j4Wq9Sm0wKkzzg/TcDT3ycyp7EqfyaJnpYjRORMAUjNjVcGAqTrssYtnjYgTLZXS
oAN9E4hv15bxUPJJs2+/aLsI8jaHQ8E6IzKI5qLfxOKZePMPhhXmCes4V4qrkpMQ
BcwinNMgfcyiNhkiDX4MvdB/tnKpMddzK/3SjiokGvH7jESFUzxw26BzpOy6uD8j
tFj4D/LRzRmGXp1YqdtdqIAy15oNmTmOfK9zwVDPKLs4NUDHLGBUE6sgQJ5JLxjT
pbS3JzQLe57weuW7WbD6/2RN7sJXfeZR1OUgJxuSzw8JQVDvWpW+2BJLyzoyOO7x
t2XeuVgEyNyEVBRDtoeQ42hLFyk3O5G/kvRfLqqH0jDFkQKkMXMBhs2Bo4HA+157
o+HbB7GZkwR5ZKx+8RqmhP9t+IQjb1A8dkD/4gA0U0bYhbj4XhJSsDYtw1DMjya2
gr19m4n0qaRcwsRWZKX0ZahcxqWFWoRiNFxIBOeFSpeilR9dxEA3xE9VMC0jTSKA
1Wgi+cyRICTqXFhhpNinK79aszHEVBcU+A1ZgmHtpvZ2UNh4V+uXE0ydWMLw61gT
ZHfB96WmFWQItu40/DN9Fo3JbJcGPtRHoR9yYV52WFszFml6p5+y6BHrNQ6D0a7l
2/4y5iHiZ7b8xpQKZbAp
=ZwYD
-END PGP SIGNATURE-
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Heiko Schocher
Hello Lokesh,

Am 24.06.2013 15:15, schrieb Lokesh Vutla:
> From: Heiko Schocher 
> 
> s_init has the same outline for all the AM33xx based
> board. So making it generic.
> This also helps in addition of new Soc with minimal changes.
> 
> Signed-off-by: Lokesh Vutla 
> Signed-off-by: Heiko Schocher 
> Signed-off-by: Tom Rini 
> ---
>  arch/arm/cpu/armv7/am33xx/board.c|   46 +--
>  arch/arm/cpu/armv7/am33xx/clock_ti814x.c |6 ++
>  arch/arm/cpu/armv7/am33xx/emif4.c|6 +-
>  arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |6 +-
>  arch/arm/include/asm/arch-am33xx/sys_proto.h |5 +-
>  board/isee/igep0033/board.c  |   49 +++-
>  board/phytec/pcm051/board.c  |   48 +++-
>  board/ti/am335x/board.c  |   52 +++--
>  board/ti/ti814x/evm.c|   67 
> +++---
>  9 files changed, 90 insertions(+), 195 deletions(-)
> 
> diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
> b/arch/arm/cpu/armv7/am33xx/board.c
> index 1d743d6..3d08673 100644
> --- a/arch/arm/cpu/armv7/am33xx/board.c
> +++ b/arch/arm/cpu/armv7/am33xx/board.c
> @@ -145,7 +145,7 @@ int arch_misc_init(void)
>  }
>  
>  #ifdef CONFIG_SPL_BUILD
> -void rtc32k_enable(void)
> +static void rtc32k_enable(void)
>  {
>   struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
>  
> @@ -161,11 +161,7 @@ void rtc32k_enable(void)
>   writel((1 << 3) | (1 << 6), &rtc->osc);
>  }
>  
> -#define UART_RESET   (0x1 << 1)
> -#define UART_CLK_RUNNING_MASK0x1
> -#define UART_SMART_IDLE_EN   (0x1 << 0x3)
> -
> -void uart_soft_reset(void)
> +static void uart_soft_reset(void)
>  {
>   struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
>   u32 regval;
> @@ -182,4 +178,42 @@ void uart_soft_reset(void)
>   regval |= UART_SMART_IDLE_EN;
>   writel(regval, &uart_base->uartsyscfg);
>  }
> +
> +static void watchdog_disable(void)
> +{
> + struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
> +
> + writel(0x, &wdtimer->wdtwspr);
> + while (readl(&wdtimer->wdtwwps) != 0x0)
> + ;
> + writel(0x, &wdtimer->wdtwspr);
> + while (readl(&wdtimer->wdtwwps) != 0x0)
> + ;
> +}
>  #endif
> +
> +void s_init(void)
> +{
> + /*
> +  * Save the boot parameters passed from romcode.
> +  * We cannot delay the saving further than this,
> +  * to prevent overwrites.
> +  */
> +#ifdef CONFIG_SPL_BUILD
> + save_omap_boot_params();
> + watchdog_disable();
> + timer_init();
> + set_uart_mux_conf();
> + setup_clocks_for_console();
> + uart_soft_reset();
> +
> + gd = &gdata;
> + preloader_console_init();
> +
> + prcm_init();
> + set_mux_conf_regs();
> + /* Enable RTC32K clock */
> + rtc32k_enable();

I tried your patches on my three boards. The board with the
rtc32k_enable() problem, did not work with them too :-(

Maybe we make rtc32k_enable() weak in common code, and so
I can make a board specific (dummy) function?

[...]

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] ARM: AM33xx: Cleanup dplls data

2013-06-24 Thread Heiko Schocher
Hello Lokesh,

Am 24.06.2013 15:15, schrieb Lokesh Vutla:
> Locking sequence for all the dplls is same.
> In the current code same sequence is done repeatedly
> for each dpll. Instead have a generic function
> for locking dplls and pass dpll data to that function.
> 
> This is derived from OMAP4 boards.
> 
> Signed-off-by: Lokesh Vutla 
> ---
>  arch/arm/cpu/armv7/am33xx/Makefile   |1 +
>  arch/arm/cpu/armv7/am33xx/clock.c|  116 ++
>  arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  222 
> +-
>  arch/arm/cpu/armv7/am33xx/emif4.c|4 +
>  arch/arm/include/asm/arch-am33xx/clock.h |   68 
>  arch/arm/include/asm/arch-am33xx/ddr_defs.h  |2 +
>  arch/arm/include/asm/arch-am33xx/sys_proto.h |1 +
>  7 files changed, 232 insertions(+), 182 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c
> 
[...]
> diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
> b/arch/arm/cpu/armv7/am33xx/clock.c
> new file mode 100644
> index 000..a7f1d83
> --- /dev/null
> +++ b/arch/arm/cpu/armv7/am33xx/clock.c
> @@ -0,0 +1,116 @@
[...]
> +static void do_setup_dpll(const struct dpll_regs *dpll_regs,
> +   const struct dpll_params *params)
> +{

Could we have this function not only static? I posted a patch:

[U-Boot] arm, am335x: make mpu pll config configurable
http://patchwork.ozlabs.org/patch/248509/

which uses mpu_pll_config() for switching mpu pll clock
from board code ... you delete this function later in this patch,
so I think, I can switch to do_setup_pll() ... if this is not
static code ...

[...]
> diff --git a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c 
> b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
> index 9c4d0b4..e878b25 100644
> --- a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
> +++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
> @@ -26,56 +26,53 @@
>  #define PRCM_FORCE_WAKEUP0x2
>  #define PRCM_FUNCTL  0x0
>  
> -#define PRCM_EMIF_CLK_ACTIVITY   BIT(2)
> -#define PRCM_L3_GCLK_ACTIVITYBIT(4)
> -
> -#define PLL_BYPASS_MODE  0x4
> -#define ST_MN_BYPASS 0x0100
> -#define ST_DPLL_CLK  0x0001
> -#define CLK_SEL_MASK 0x7
> -#define CLK_DIV_MASK 0x1f
> -#define CLK_DIV2_MASK0x7f
> -#define CLK_SEL_SHIFT0x8
> -#define CLK_MODE_SEL 0x7
> -#define CLK_MODE_MASK0xfff8
> -#define CLK_DIV_SEL  0xFFE0
>  #define CPGMAC0_IDLE 0x3
> -#define DPLL_CLKDCOLDO_GATE_CTRL0x300
> -
>  #define OSC  (V_OSCK/100)

and could we move this define then to
arch/arm/include/asm/arch-am33xx/clock.h
too?

Thnaks!

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] AM335x: enabling datacache in SPL slows down system?

2013-06-24 Thread Jeroen Hofstee

Hello Bas,

On 06/24/2013 10:01 AM, Bas van den Berg wrote:

After debugging a bit more, I found that in our code, we didn't set the RAM size
correctly (so no real RAM section was setup for caching). Fixing this fixed our
time to 2.4 seconds (U-boot still took 1.8 sec).

Adding your SRAM patch (modified, since AM335x has more SRAM),
The load time dropped from 2.4 -> 1.9 seconds. So adding this small area saved
half a second!
I write off the remaing difference (1.8 vs 1.9 seconds) to code differences 
between
our SPL and U-boot nand functions.

Thanks for reporting and checking that adding the SRAM region is
needed as well (I suppose you already verified that -O2 cannot get
rid of the last difference).

Regards,
Jeroen

ps: the consensus on this mailinglist is not to top post..
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] board/bsc913x: Add config flag for bootdelay

2013-06-24 Thread Rai Harninder-B01044
Hello Albert,


Plase fix commit message: you're not simply adding a boot delay flag, you're in 
fact disabling autoboot, which is quite different.
[Rai Harninder-B01044] "Disable autoboot through bootdelay config flag". Is 
this ok?

Also, when touching on a board's code, you should Cc: the board's 
maintainer(s). Please do so for V2 of your patch -- and if you get a 
non-delivery status (e.g. a maintainer's mail address does not exist any more), 
please follow up on your patch submission to let us know.
[Rai Harninder-B01044] The board's maintainer is Andy Fleming who is already 
included in cc


Harry++


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


Re: [U-Boot] [U-Boot, v2] powerpc/mpc85xx:Disable Debug TLB entry before init_tlbs

2013-06-24 Thread Scott Wood

On 06/24/2013 01:17:11 AM, Prabhakar Kushwaha wrote:

On 06/24/2013 08:44 AM, Prabhakar Kushwaha wrote:

On 06/22/2013 02:42 AM, Scott Wood wrote:

On 06/21/2013 04:05:37 PM, Fleming Andy-AFLEMING wrote:


On Jun 21, 2013, at 3:59 PM, Scott Wood wrote:

> On 06/21/2013 03:38:48 PM, Andy Fleming wrote:
>> On Thu, Jun 13, 2013 at 10:14:00AM +0530, Prabhakar Kushwaha  
wrote:
>> > init_tlbs() initialize all the TLB entries required for the  
system.

>> >
>> > So disable DEBUG TLB entry before TLB entries initialization.
>> >
>> > Signed-off-by: Prabhakar Kushwaha 
>> Applied, with fixes.
>> > diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c  
b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c

>> > index f4403c2..340b063 100644
>> > --- a/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> > +++ b/arch/powerpc/cpu/mpc85xx/cpu_init_early.c
>> > @@ -180,5 +180,9 @@ void cpu_init_early_f(void)
>> >
>> >  invalidate_tlb(1);
>> >
>> > +#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
!defined(CONFIG_SPL_BUILD)

>> > +disable_tlb(CONFIG_SYS_PPC_E500_DEBUG_TLB);
>> > +#endif
>> Had to add CONFIG_NAND_SPL here, as well, just for future  
reference

>
> Why exclude all SPLs?  Only minimal SPLs skip creating the debug  
TLB.


The definition of disable_tlb() is excluded when NAND_SPL is  
defined.


I'm talking about new-SPL, not NAND_SPL.  My comment is about the  
original patch (I made the comment before internally), not your  
edit to it.


as per comment from Scott, we should have below define. It takes  
care of SPL minimal + nand_spl


#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) &&  
!defined(CONFIG_SPL_INIT_MINIMAL) && !defined(CONFIG_NAND_SPL)


May I resend this patch?


It would need to be:

#if defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && \
	!(defined(CONFIG_SPL_INIT_MINIMAL) &&  
defined(CONFIG_SPL_BUILD)) && \

!defined(CONFIG_NAND_SPL)

just a afterthought, current modified* patch is correct i.e. " #if  
defined(CONFIG_SYS_PPC_E500_DEBUG_TLB) && !defined(CONFIG_SPL_BUILD)  
&& !defined(CONFIG_NAND_SPL)"

DEBUG TLB never been created for SPL & NAND_SPL so no need to disable.


Why would the debug TLB not be created for a non-minimal-init SPL?

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


Re: [U-Boot] [PATCH v2] powerpc/85xx: Add TWR-P10xx board support

2013-06-24 Thread Scott Wood

On 06/24/2013 02:01:30 AM, Xie Xiaobo wrote:

TWR-P1025 Specification:


Please CC Andy Fleming on mpc85xx patches.


+   /* W**G* - Flash, localbus */
+   /* This will be changed to *I*G* after relocation to RAM. */
+   SET_TLB_ENTRY(1, CONFIG_SYS_SSD_BASE, CONFIG_SYS_SSD_BASE_PHYS,
+   MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
+   0, 5, BOOKE_PAGESZ_1M, 1),


Inappropriate comment (it's already *I*G*) and don't set MAS3_SX on I/O
regions.


+#ifdef CONFIG_SYS_RAMBOOT
+   /* *I*G - eSDHC boot */
+	SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE,  
CONFIG_SYS_DDR_SDRAM_BASE,

+   MAS3_SX|MAS3_SW|MAS3_SR, 0,
+   0, 8, BOOKE_PAGESZ_1G, 1),
+#endif


Comment says *I*G but it's actually .


+/*
+ * Memory map
+ *
+ * 0x_ 0x1fff_ DDR Up to 512MB cacheable
+ * 0x8000_ 0xdfff_	PCI Express Mem	1.5G non-cacheable(PCIe  
* 3)

+ * 0xffc0_ 0xffc3_ PCI IO range256k non-cacheable
+ *
+ * Localbus
+ * 0xe000_ 0xe002_ SSD1289 128K non-cacheable


This says 128K, but elsewhere you map the LAW and TLB as 1M, and you
configure it as 64K in eLBC.


+ * 0xec00_ 0xefff_ FLASH   Up to 64M non-cacheable
+ *
+ * 0xff90_ 0xff97_ L2 SRAM Up to 512K cacheable
+ * 0xffd0_ 0xffd0_3fff init ram16K Cacheable
+ * 0xffe0_ 0xffef_ CCSR1M non-cacheable


L2 SRAM, init ram, and CCSR do not belong under "Localbus".


+/* Serial Port
+ * open - index 2
+ * shorted - index 1
+ */
+#define CONFIG_CONS_INDEX  1
+#undef CONFIG_SERIAL_SOFTWARE_FIFO


Don't undef things that were never defined in the first place.  The only
place in the entire tree that CONFIG_SERIAL_SOFTWARE_FIFO exists at all
is a few similar undefs in other Freescale boards.


+/* Use the HUSH parser */
+#define CONFIG_SYS_HUSH_PARSER
+#ifdef CONFIG_SYS_HUSH_PARSER
+#define CONFIG_SYS_PROMPT_HUSH_PS2 "> "
+#endif


This is a pointless ifdef, and a pointless setting of PS2 since that's
already the default.


+#define CONFIG_BOOTDELAY 10/* -1 disables auto-boot */


Please consider defaulting to -1 here, now that it no longer disables
bootdelay support at compile-time.

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


Re: [U-Boot] [PATCH] arm, am33xx: move s_init to a common place

2013-06-24 Thread Lokesh Vutla

Hi Heiko,
On Monday 24 June 2013 09:46 PM, Heiko Schocher wrote:

Hello Lokesh,

Am 24.06.2013 06:01, schrieb Lokesh Vutla:

Hi Heiko,
On Thursday 20 June 2013 09:22 AM, Heiko Schocher wrote:

Hello Tom,

Am 14.06.2013 16:58, schrieb Tom Rini:

On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:

Hello Tom,

Am 13.06.2013 17:53, schrieb Tom Rini:

On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:


move s_init from every board code to a common place.

Signed-off-by: Heiko Schocher 
Cc: Tom Rini 
Cc: Matt Porter 
Cc: Lars Poeschel 
Cc: Tom Rini 
Cc: Enric Balletbo i Serra 

---
This patch is based on the following patches:

- [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
http://patchwork.ozlabs.org/patch/248908/

- [U-Boot] arm, am33xx: move uart soft reset code to common place
http://patchwork.ozlabs.org/patch/248508/


These two apply best to u-boot-ti, and with them this patch doesn't
apply cleanly.  Please sort that out.


I based my patches on u-boot ... I look at this ..


The following adds moving ti814x_evm into the mix and I've sent Matt
some binaries to give a whirl to test on the board:


[...]

   /*
* Basic board specific setup.  Pinmux has been handled already.

Please fold into v2

Signed-off-by: Tom Rini 


Ok, thanks!


There's a minor bug in what I posted, however.  ti814x needs timer_init
called _before_ pll_init() as setting the sata clocks (which are shared
with other periphrals that we do enable right now) needs udelay(50) to
settle as we go along.  That also needs to be commented in the code as I
had to think about it for a bit to recall exactly what was going on.


Do you have an update here for me?

We can have a timer_init for am33xx boards also. It doesn't harm.
So keep timer_init in your common s_init


Ok, fine.


BTW:
I just realized that I have on one of the three boards a problem,
that in spl code calling the rtc32k_enable() crashes ... which
votes against moving this to a common place ... I haveno real idea
why ... did you heard from such a behaviour? Is there some am335x
soc, which differs from the others?

On which board it is giving a problem?


Not in mainline yet, posting soon ...


Did you make sure clocks for rtc are enabled?


Yes.

I posted a clean up series for am33xx today
"[PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit"
Can you please try with this series on your board.
Check the SPL log for any clock failure. If no error, then
ideally registers should be accessible. (Please make sure
register offsets that you are using are correct).

If not there is something really bad.

Thanks and regards,
Lokesh


I have 3 boards with an am335x, two works with the
rtc32k_enable() call without problems ... the third board
hang when accessing rtc registers ... no idea why ...
Code on all three boards is at this point identical, all
use 24MHz ...


I am making a cleanup series for am33xx boards. If you don't mind can I
take this
patch as part of my series.


I am fine with that ... but what do we do with my
probem with rtc23k_enable?



Thanks and regards,
Lokesh


You aren't using a different clock crystal rate than the reference
platforms, are you?  I know that's a problem that needs solving still.


I am prospecting, whats going on here ... but have no real idea,
why it is not possible to write this registers ... if writing this
registers, cpu hang ...

But I want to have a common function here ... maybe it is OK to make
the rtc32k_enable() call configurable through a define?

Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"

and document in the u-boot README this define, and why it is
necessary?


Would this be acceptable?

bye,
Heiko



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


Re: [U-Boot] [PATCH] board/bsc913x: Add config flag for bootdelay

2013-06-24 Thread Albert ARIBAUD
Hi Rai,

On Mon, 24 Jun 2013 09:28:26 +, Rai Harninder-B01044
 wrote:

> Hello Albert,
> 
> 
> Plase fix commit message: you're not simply adding a boot delay flag, you're 
> in fact disabling autoboot, which is quite different.
> [Rai Harninder-B01044] "Disable autoboot through bootdelay config flag". Is 
> this ok?

(weird way of quoting messages; makes it really hard to see who said
what. Can't your mail client use the standard ">" line prefix?)

As for the commit summary, it is fine by me.

> Also, when touching on a board's code, you should Cc: the board's 
> maintainer(s). Please do so for V2 of your patch -- and if you get a 
> non-delivery status (e.g. a maintainer's mail address does not exist any 
> more), please follow up on your patch submission to let us know.
> [Rai Harninder-B01044] The board's maintainer is Andy Fleming who is already 
> included in cc

Are you not mixing up BSC9131RDB and BSC9132QDS maintainership with
MPC85xx tree custodianship?

Andy is the MPC85xx custodian, but has no entry in the MAINTAINERS
file, which OTOH lists Poonam Aggrwal  as
the BSC9131RDB maintainer, and Naveen Burmi 
as the BSC9132QDS one.

> Harry++

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


[U-Boot] [PATCH v4] dfu, nand: before write a buffer to nand, erase the nand sectors

2013-06-24 Thread Heiko Schocher
before writing the received buffer to nand, erase the nand
sectors. If not doing this, nand write fails. See for
more info here:

http://lists.denx.de/pipermail/u-boot/2013-June/156361.html

Using the nand erase option "spread", maybe overwrite
blocks on, for example another mtd partition, if the
erasing range contains bad blocks.
So a limit option is added to nand_erase_opts()

Signed-off-by: Heiko Schocher 
Cc: Scott Wood 
Cc: Pantelis Antoniou 
Cc: Lukasz Majewski 
Cc: Kyungmin Park 
Cc: Marek Vasut 
Cc: Tom Rini 

---
- changes for v2:
  - use opts.spread as Scott Wood suggested
- changes for v3:
  - add opts.lim as Scott Wood suggested
- changes for v4:
  - fix boundary check as Scott Wood mentioned

 drivers/dfu/dfu_nand.c   | 18 --
 drivers/mtd/nand/nand_util.c |  4 
 include/nand.h   |  2 ++
 3 Dateien geändert, 22 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/drivers/dfu/dfu_nand.c b/drivers/dfu/dfu_nand.c
index 7dc89b2..07dee89 100644
--- a/drivers/dfu/dfu_nand.c
+++ b/drivers/dfu/dfu_nand.c
@@ -63,12 +63,26 @@ static int nand_block_op(enum dfu_nand_op op, struct 
dfu_entity *dfu,
 
nand = &nand_info[nand_curr_device];
 
-   if (op == DFU_OP_READ)
+   if (op == DFU_OP_READ) {
ret = nand_read_skip_bad(nand, start, &count, &actual,
lim, buf);
-   else
+   } else {
+   nand_erase_options_t opts;
+
+   memset(&opts, 0, sizeof(opts));
+   opts.offset = start;
+   opts.length = count;
+   opts.spread = 1;
+   opts.quiet = 1;
+   opts.lim = lim;
+   /* first erase */
+   ret = nand_erase_opts(nand, &opts);
+   if (ret)
+   return ret;
+   /* then write */
ret = nand_write_skip_bad(nand, start, &count, &actual,
lim, buf, 0);
+   }
 
if (ret != 0) {
printf("%s: nand_%s_skip_bad call failed at %llx!\n",
diff --git a/drivers/mtd/nand/nand_util.c b/drivers/mtd/nand/nand_util.c
index d81972c..1d22b52 100644
--- a/drivers/mtd/nand/nand_util.c
+++ b/drivers/mtd/nand/nand_util.c
@@ -120,6 +120,10 @@ int nand_erase_opts(nand_info_t *meminfo, const 
nand_erase_options_t *opts)
 
WATCHDOG_RESET();
 
+   if (opts->lim && (erase.addr >= (opts->offset + opts->lim))) {
+   puts("Size of erase exceeds limit\n");
+   return -EFBIG;
+   }
if (!opts->scrub && bbtest) {
int ret = mtd_block_isbad(meminfo, erase.addr);
if (ret > 0) {
diff --git a/include/nand.h b/include/nand.h
index 26190e4..228d871 100644
--- a/include/nand.h
+++ b/include/nand.h
@@ -125,6 +125,8 @@ struct nand_erase_options {
 
/* Don't include skipped bad blocks in size to be erased */
int spread;
+   /* maximum size that actual may be in order to not exceed the buf */
+   loff_t lim;
 };
 
 typedef struct nand_erase_options nand_erase_options_t;
-- 
1.7.11.7

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


[U-Boot] [RFC] [UBOOT] [PATCH v2 2/4] USB: Adapt the usb-compat.h to uboot and fix compiler errors

2013-06-24 Thread Dan Murphy
Adapt the usb-compat.h to uBoot.

Use #ifndef __UBOOT__ for code that is not applicable to uBoot.
Use #ifdef __UBOOT__ to add code that is uBoot specific.

Create linux-compat.h - Linux kernel compatibility definitions that do not
exist in the uBoot.  Moved the compatibility definitions from 
lin_gadget_compat.h
to this file as well.

Create usb-mod-devicetable.h - Is a partial back port of mod_devicetable.h in 
the linux
kernel only taking the portion needed for USB

Already existing header files were modified to pick up the new header files.

Currently musb will not compile.

Signed-off-by: Dan Murphy 
---
 drivers/usb/musb-new/musb_host.h|1 +
 drivers/usb/musb-new/usb-compat.h   |   30 
 include/linux/usb/gadget.h  |  184 +++-
 include/linux/usb/linux-compat.h|  234 +++
 include/linux/usb/usb-compat.h  |  186 +---
 include/linux/usb/usb-mod-devicetable.h |  131 +
 include/usb.h   |  119 +---
 include/usb/lin_gadget_compat.h |   29 +---
 8 files changed, 685 insertions(+), 229 deletions(-)
 create mode 100644 include/linux/usb/linux-compat.h
 create mode 100644 include/linux/usb/usb-mod-devicetable.h

diff --git a/drivers/usb/musb-new/musb_host.h b/drivers/usb/musb-new/musb_host.h
index ebebe0c..49cb094 100644
--- a/drivers/usb/musb-new/musb_host.h
+++ b/drivers/usb/musb-new/musb_host.h
@@ -35,6 +35,7 @@
 #ifndef _MUSB_HOST_H
 #define _MUSB_HOST_H
 #ifdef __UBOOT__
+#include 
 #include "usb-compat.h"
 #endif
 
diff --git a/drivers/usb/musb-new/usb-compat.h 
b/drivers/usb/musb-new/usb-compat.h
index 27f656f..bdb5f0e 100644
--- a/drivers/usb/musb-new/usb-compat.h
+++ b/drivers/usb/musb-new/usb-compat.h
@@ -6,13 +6,6 @@
 struct usb_hcd {
void *hcd_priv;
 };
-
-struct usb_host_endpoint {
-   struct usb_endpoint_descriptor  desc;
-   struct list_head urb_list;
-   void *hcpriv;
-};
-
 /*
  * urb->transfer_flags:
  *
@@ -20,29 +13,6 @@ struct usb_host_endpoint {
  */
 #define URB_SHORT_NOT_OK   0x0001  /* report short reads as errors */
 #define URB_ZERO_PACKET0x0040  /* Finish bulk OUT with short 
packet */
-
-struct urb;
-
-typedef void (*usb_complete_t)(struct urb *);
-
-struct urb {
-   void *hcpriv;   /* private data for host controller */
-   struct list_head urb_list;  /* list head for use by the urb's
-* current owner */
-   struct usb_device *dev; /* (in) pointer to associated device */
-   struct usb_host_endpoint *ep;   /* (internal) pointer to endpoint */
-   unsigned int pipe;  /* (in) pipe information */
-   int status; /* (return) non-ISO status */
-   unsigned int transfer_flags;/* (in) URB_SHORT_NOT_OK | ...*/
-   void *transfer_buffer;  /* (in) associated data buffer */
-   dma_addr_t transfer_dma;/* (in) dma addr for transfer_buffer */
-   u32 transfer_buffer_length; /* (in) data buffer length */
-   u32 actual_length;  /* (return) actual transfer length */
-   unsigned char *setup_packet;/* (in) setup packet (control only) */
-   int start_frame;/* (modify) start frame (ISO) */
-   usb_complete_t complete;/* (in) completion routine */
-};
-
 #define usb_hcd_link_urb_to_ep(hcd, urb)   ({  \
int ret = 0;\
list_add_tail(&urb->urb_list, &urb->ep->urb_list);  \
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 220d068..f987ff2 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -18,7 +18,11 @@
 #ifndef __LINUX_USB_GADGET_H
 #define __LINUX_USB_GADGET_H
 
+#include 
 #include 
+#include 
+
+#define USB_GADGET_DELAYED_STATUS   0x7fff /* Impossibly large value */
 
 struct usb_ep;
 
@@ -83,6 +87,11 @@ struct usb_request {
unsignedlength;
dma_addr_t  dma;
 
+   struct scatterlist  *sg;
+   unsignednum_sgs;
+   unsignednum_mapped_sgs;
+
+   unsignedstream_id:16;
unsignedno_interrupt:1;
unsignedzero:1;
unsignedshort_not_ok:1;
@@ -119,6 +128,8 @@ struct usb_ep_ops {
int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
 
int (*set_halt) (struct usb_ep *ep, int value);
+   int (*set_wedge) (struct usb_ep *ep);
+
int (*fifo_status) (struct usb_ep *ep);
void (*fifo_flush) (struct usb_ep *ep);
 };
@@ -140,10 +151,17 @@ struct usb_ep_ops {
  */
 struct usb_ep {
void*driver_data;
+
const char  *name;
const struct usb_ep_ops *ops;
struct list_headep_

[U-Boot] [RFC] [UBOOT] [PATCH v2 4/4] omap5: usb: Add usb otg clocks and enable

2013-06-24 Thread Dan Murphy
Add and enable the USB OTG clocks.

Signed-off-by: Dan Murphy 
---
 arch/arm/cpu/armv7/omap5/hw_data.c  |   14 ++
 arch/arm/cpu/armv7/omap5/prcm-regs.c|1 +
 arch/arm/include/asm/arch-omap5/clock.h |4 
 arch/arm/include/asm/omap_common.h  |1 +
 common/cmd_usb.c|6 +-
 include/configs/omap5_common.h  |9 +
 6 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c 
b/arch/arm/cpu/armv7/omap5/hw_data.c
index 56cf1f8..7b88338 100644
--- a/arch/arm/cpu/armv7/omap5/hw_data.c
+++ b/arch/arm/cpu/armv7/omap5/hw_data.c
@@ -456,6 +456,20 @@ void enable_basic_clocks(void)
OPTFCLKEN_SCRM_PER_MASK);
setbits_le32((*prcm)->cm_wkupaon_scrm_clkctrl,
OPTFCLKEN_SCRM_CORE_MASK);
+
+/* TODO wrap this with USB defines */
+   /* Setting OCP2SCP1 register */
+   setbits_le32((*prcm)->cm_l3init_ocp2scp1_clkctrl,
+   MODULE_CLKCTRL_MODULEMODE_HW_AUTO);
+
+   /* Select USB OTG SS clock */
+   setbits_le32((*prcm)->cm_l3init_usb_otg_ss_clkctrl,
+   (MODULE_CLKCTRL_MODULEMODE_HW_AUTO |
+OPTFCLKEN_USB_OTG_SS_FCLK_MASK));
+
+   /* Setting l3init register */
+   setbits_le32((*prcm)->cm_l3init_clkstctrl, 
OPTFCLKEN_USB_OTG_SS_FCLK_MASK);
+
 }
 
 void enable_basic_uboot_clocks(void)
diff --git a/arch/arm/cpu/armv7/omap5/prcm-regs.c 
b/arch/arm/cpu/armv7/omap5/prcm-regs.c
index e839ff5..f90da58 100644
--- a/arch/arm/cpu/armv7/omap5/prcm-regs.c
+++ b/arch/arm/cpu/armv7/omap5/prcm-regs.c
@@ -718,6 +718,7 @@ struct prcm_regs const omap5_es2_prcm = {
.cm_l3init_p1500_clkctrl = 0x4a009678,
.cm_l3init_fsusb_clkctrl = 0x4a0096d0,
.cm_l3init_ocp2scp1_clkctrl = 0x4a0096e0,
+   .cm_l3init_usb_otg_ss_clkctrl = 0x4a0096f0,
 
/* prm irqstatus regs */
.prm_irqstatus_mpu_2 = 0x4ae06014,
diff --git a/arch/arm/include/asm/arch-omap5/clock.h 
b/arch/arm/include/asm/arch-omap5/clock.h
index 4d2765d..24ef2bc 100644
--- a/arch/arm/include/asm/arch-omap5/clock.h
+++ b/arch/arm/include/asm/arch-omap5/clock.h
@@ -165,6 +165,10 @@
 /* CM_L3INIT_USBPHY_CLKCTRL */
 #define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK  8
 
+/* CM_L3INIT_USB_OTG_SS_CLKCTRL */
+#define OPTFCLKEN_USB_OTG_SS_FCLK_SHIFT8
+#define OPTFCLKEN_USB_OTG_SS_FCLK_MASK (1 << 8)
+
 /* CM_MPU_MPU_CLKCTRL */
 #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT 24
 #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK  (3 << 24)
diff --git a/arch/arm/include/asm/omap_common.h 
b/arch/arm/include/asm/omap_common.h
index 0dbe81b..11cc870 100644
--- a/arch/arm/include/asm/omap_common.h
+++ b/arch/arm/include/asm/omap_common.h
@@ -241,6 +241,7 @@ struct prcm_regs {
u32 cm_l3init_p1500_clkctrl;
u32 cm_l3init_fsusb_clkctrl;
u32 cm_l3init_ocp2scp1_clkctrl;
+   u32 cm_l3init_usb_otg_ss_clkctrl;
 
u32 prm_irqstatus_mpu_2;
 
diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index 70e803b..816fb23 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifdef CONFIG_USB_STORAGE
 static int usb_stor_curr_dev = -1; /* current device */
@@ -160,6 +161,7 @@ static void usb_display_string(struct usb_device *dev, int 
index)
 
 static void usb_display_desc(struct usb_device *dev)
 {
+#if 0
if (dev->descriptor.bDescriptorType == USB_DT_DEVICE) {
printf("%d: %s,  USB Revision %x.%x\n", dev->devnum,
usb_get_class_desc(dev->config.if_desc[0].desc.bInterfaceClass),
@@ -189,7 +191,7 @@ static void usb_display_desc(struct usb_device *dev)
(dev->descriptor.bcdDevice>>8) & 0xff,
dev->descriptor.bcdDevice & 0xff);
}
-
+#endif
 }
 
 static void usb_display_conf_desc(struct usb_config_descriptor *config,
@@ -350,10 +352,12 @@ static void usb_show_tree_graph(struct usb_device *dev, 
char *pre)
pre[index++] = ' ';
pre[index++] = has_child ? '|' : ' ';
pre[index] = 0;
+#if 0
printf(" %s (%s, %dmA)\n", usb_get_class_desc(

dev->config.if_desc[0].desc.bInterfaceClass),
portspeed(dev->speed),
dev->config.desc.bMaxPower * 2);
+#endif
if (strlen(dev->mf) || strlen(dev->prod) || strlen(dev->serial))
printf(" %s  %s %s %s\n", pre, dev->mf, dev->prod, dev->serial);
printf(" %s\n", pre);
diff --git a/include/configs/omap5_common.h b/include/configs/omap5_common.h
index ddf2ad4..8a71e62 100644
--- a/include/configs/omap5_common.h
+++ b/include/configs/omap5_common.h
@@ -96,6 +96,15 @@
 
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
 
+/* USB */
+#define CONFIG_CMD_USB
+#define CONFIG_USB_STORAGE
+#define CONFIG_USB_DWC3
+#define CONFIG_USB_DWC3_GADGET
+#define CONFI

[U-Boot] [RFC] [UBOOT] [PATCH v2 0/4] DWC back port from Linux kernel

2013-06-24 Thread Dan Murphy
This patch series has been generated in an effort to get comments on 
the implementation of the dwc code within the uBoot.

V2 incorporates comments to first port the kernel header backward to uBoot
and then produce the uBoot changes so the uBoot changes are easily 
distinguishable
from the original kernel source.

The first patch is the one of major concern as this patch will make an
attempt to commonize the usb headers so that there is re-use and prepare
the usb headers for future usb code back ports from the linux kernel.

This code will compile for omap5 and omap4 but fails for am335x. 
Before I invest anymore time in this I would like to understand if there are
any comments on the overall implemenation.

 Makefile|1 +
 arch/arm/cpu/armv7/omap5/hw_data.c  |   14 +
 arch/arm/cpu/armv7/omap5/prcm-regs.c|1 +
 arch/arm/include/asm/arch-omap5/clock.h |4 +
 arch/arm/include/asm/omap_common.h  |1 +
 common/cmd_usb.c|6 +-
 drivers/usb/dwc3/Makefile   |   53 +
 drivers/usb/dwc3/core.c |  847 ++
 drivers/usb/dwc3/core.h |  974 +++
 drivers/usb/dwc3/dwc3-omap.c|  505 ++
 drivers/usb/dwc3/dwc3-omap.h|   41 +
 drivers/usb/dwc3/dwc3-uboot.c   |  384 +
 drivers/usb/dwc3/ep0.c  | 1085 
 drivers/usb/dwc3/gadget.c   | 2806 +++
 drivers/usb/dwc3/gadget.h   |  196 +++
 drivers/usb/dwc3/host.c |  107 ++
 drivers/usb/dwc3/io.h   |   81 +
 drivers/usb/musb-new/musb_host.h|1 +
 drivers/usb/musb-new/usb-compat.h   |   30 -
 include/configs/omap5_common.h  |9 +
 include/linux/usb/gadget.h  |  184 +-
 include/linux/usb/linux-compat.h|  234 +++
 include/linux/usb/usb-compat.h  | 1965 ++
 include/linux/usb/usb-mod-devicetable.h |  131 ++
 include/usb.h   |  119 +-
 include/usb/lin_gadget_compat.h |   29 +-
 26 files changed, 9596 insertions(+), 212 deletions(-)


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


Re: [U-Boot] [PATCH] arm, am33xx: move s_init to a common place

2013-06-24 Thread Heiko Schocher
Hello Lokesh,

Am 24.06.2013 06:01, schrieb Lokesh Vutla:
> Hi Heiko,
> On Thursday 20 June 2013 09:22 AM, Heiko Schocher wrote:
>> Hello Tom,
>>
>> Am 14.06.2013 16:58, schrieb Tom Rini:
>>> On Fri, Jun 14, 2013 at 07:59:26AM +0200, Heiko Schocher wrote:
 Hello Tom,

 Am 13.06.2013 17:53, schrieb Tom Rini:
> On Thu, Jun 13, 2013 at 05:53:17AM +0200, Heiko Schocher wrote:
>
>> move s_init from every board code to a common place.
>>
>> Signed-off-by: Heiko Schocher 
>> Cc: Tom Rini 
>> Cc: Matt Porter 
>> Cc: Lars Poeschel 
>> Cc: Tom Rini 
>> Cc: Enric Balletbo i Serra 
>>
>> ---
>> This patch is based on the following patches:
>>
>> - [U-Boot,v2] arm, am33xx: move rtc32k_enable() to common place
>>http://patchwork.ozlabs.org/patch/248908/
>>
>> - [U-Boot] arm, am33xx: move uart soft reset code to common place
>>http://patchwork.ozlabs.org/patch/248508/
>
> These two apply best to u-boot-ti, and with them this patch doesn't
> apply cleanly.  Please sort that out.

 I based my patches on u-boot ... I look at this ..

> The following adds moving ti814x_evm into the mix and I've sent Matt
> some binaries to give a whirl to test on the board:
>
 [...]
>   /*
>* Basic board specific setup.  Pinmux has been handled already.
>
> Please fold into v2
>
> Signed-off-by: Tom Rini 

 Ok, thanks!
>>>
>>> There's a minor bug in what I posted, however.  ti814x needs timer_init
>>> called _before_ pll_init() as setting the sata clocks (which are shared
>>> with other periphrals that we do enable right now) needs udelay(50) to
>>> settle as we go along.  That also needs to be commented in the code as I
>>> had to think about it for a bit to recall exactly what was going on.
>>
>> Do you have an update here for me?
> We can have a timer_init for am33xx boards also. It doesn't harm.
> So keep timer_init in your common s_init

Ok, fine.

 BTW:
 I just realized that I have on one of the three boards a problem,
 that in spl code calling the rtc32k_enable() crashes ... which
 votes against moving this to a common place ... I haveno real idea
 why ... did you heard from such a behaviour? Is there some am335x
 soc, which differs from the others?
> On which board it is giving a problem?

Not in mainline yet, posting soon ...

> Did you make sure clocks for rtc are enabled?

Yes.

I have 3 boards with an am335x, two works with the
rtc32k_enable() call without problems ... the third board
hang when accessing rtc registers ... no idea why ...
Code on all three boards is at this point identical, all
use 24MHz ...

> I am making a cleanup series for am33xx boards. If you don't mind can I 
> take this
> patch as part of my series.

I am fine with that ... but what do we do with my
probem with rtc23k_enable?


> Thanks and regards,
> Lokesh
>>>
>>> You aren't using a different clock crystal rate than the reference
>>> platforms, are you?  I know that's a problem that needs solving still.
>>
>> I am prospecting, whats going on here ... but have no real idea,
>> why it is not possible to write this registers ... if writing this
>> registers, cpu hang ...
>>
>> But I want to have a common function here ... maybe it is OK to make
>> the rtc32k_enable() call configurable through a define?
>>
>> Saying "CONFIG_SPL_AM33XX_DO_NOT_ENABLE_RTC32K"
>>
>> and document in the u-boot README this define, and why it is
>> necessary?

Would this be acceptable?

bye,
Heiko
-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH V2 7/9] config: don't define CONFIG_ARCH_DEVICE_TREE

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Now that nothing uses CONFIG_ARCH_DEVICE_TREE, stop defining it.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 arch/arm/cpu/armv7/tegra114/config.mk | 19 ---
 arch/arm/cpu/armv7/tegra20/config.mk  | 26 --
 arch/arm/cpu/armv7/tegra30/config.mk  | 19 ---
 arch/microblaze/config.mk |  2 --
 arch/x86/cpu/coreboot/config.mk   | 23 ---
 doc/README.fdt-control|  3 +--
 include/configs/exynos5250-dt.h   |  1 -
 7 files changed, 1 insertion(+), 92 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/tegra114/config.mk
 delete mode 100644 arch/arm/cpu/armv7/tegra20/config.mk
 delete mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
 delete mode 100644 arch/x86/cpu/coreboot/config.mk

diff --git a/arch/arm/cpu/armv7/tegra114/config.mk 
b/arch/arm/cpu/armv7/tegra114/config.mk
deleted file mode 100644
index cb1a19d..000
--- a/arch/arm/cpu/armv7/tegra114/config.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2010-2013, NVIDIA CORPORATION.  All rights reserved.
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, 
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope 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, see .
-#
-CONFIG_ARCH_DEVICE_TREE := tegra114
diff --git a/arch/arm/cpu/armv7/tegra20/config.mk 
b/arch/arm/cpu/armv7/tegra20/config.mk
deleted file mode 100644
index 6432e75..000
--- a/arch/arm/cpu/armv7/tegra20/config.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# (C) Copyright 2010,2011
-# NVIDIA Corporation 
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, 
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-CONFIG_ARCH_DEVICE_TREE := tegra20
diff --git a/arch/arm/cpu/armv7/tegra30/config.mk 
b/arch/arm/cpu/armv7/tegra30/config.mk
deleted file mode 100644
index 719ca81..000
--- a/arch/arm/cpu/armv7/tegra30/config.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2010-2012, NVIDIA CORPORATION.  All rights reserved.
-#
-# (C) Copyright 2002
-# Gary Jennejohn, DENX Software Engineering, 
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope 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, see .
-#
-CONFIG_ARCH_DEVICE_TREE := tegra30
diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index b4935f0..aca79e2 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -31,5 +31,3 @@ CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F0
 PLATFORM_CPPFLAGS += -ffixed-r31 -D__microblaze__
 
 LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds
-
-CONFIG_ARCH_DEVICE_TREE := microblaze
diff --git a/arch/x86/cpu/coreboot/config.mk b/arch/x86/cpu/coreboot/config.mk
deleted file mode 100644
index 4858fc3..000
--- a/arch/x86/cpu/coreboot/config.mk
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-# Copyright (c) 2012 The Chromium OS Authors.
-#
-# 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,
-

[U-Boot] [PATCH V2 3/9] dts/Makefile: simplify dtc invocation

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

The invocation of dtc is significantly more complex that it could be,
in order to work around an issue on old versions of dtc, which print
a message to stdout every time they run.

Remove this workaround, on the assumption that people have or will
upgrade to a newer version of dtc. This simplifies the build rule
significantly.

Related, split the invocation of cpp and dtc into separate commands
rather than a pipeline, so that if either fail, it is detected. This has
the nice benefit of saving off the result of the pre-processing step,
allowing it to be easily inspected.

Assuming a new enough dtc (which an earlier patch enforces), dtc will
parse #line directives in its input file, and generate correct file and
line numbers in error messages, even though cpp is unconditionally
applied to its input file.

Signed-off-by: Stephen Warren 
---
v2:
* Added note to commit description re: line numbers.
* s/.dtstmp/dts.tmp/ in temporary filenames.
---
 .gitignore   | 1 +
 dts/Makefile | 9 ++---
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4116448..7aa4adc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@
 *.patch
 *.bin
 *.cfgtmp
+*.dts.tmp
 
 # Build tree
 /build-*
diff --git a/dts/Makefile b/dts/Makefile
index 03e163e..722cc37 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -51,13 +51,8 @@ all: $(obj).depend $(LIB)
 DT_BIN := $(obj)dt.dtb
 
 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-   rc=$$( \
-   cat $< | $(CPP) -P $(DTS_CPPFLAGS) - | \
-   { { $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} - 2>&1 ; \
-   echo $$? >&3 ; } | \
- grep -v '^DTC: dts->dtb  on file' ; \
-   } 3>&1 1>&2 ) ; \
-   exit $$rc
+   $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
+   $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
 
 process_lds = \
$(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 5/9] dt: don't use ARCH_CPU_DTS

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Now that we assume dtc supports the -i option, we don't need to use
ARCH_CPU_DTS in *.dts{,i}; we simply specify the include filename
directly, and dtc will find it.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 board/chromebook-x86/dts/link.dts | 2 +-
 board/samsung/dts/exynos5250-smdk5250.dts | 2 +-
 board/samsung/dts/exynos5250-snow.dts | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/board/chromebook-x86/dts/link.dts 
b/board/chromebook-x86/dts/link.dts
index d0738cb..c95ee8a 100644
--- a/board/chromebook-x86/dts/link.dts
+++ b/board/chromebook-x86/dts/link.dts
@@ -1,6 +1,6 @@
 /dts-v1/;
 
-/include/ ARCH_CPU_DTS
+/include/ "coreboot.dtsi"
 
 / {
 #address-cells = <1>;
diff --git a/board/samsung/dts/exynos5250-smdk5250.dts 
b/board/samsung/dts/exynos5250-smdk5250.dts
index 8da973b..538b820 100644
--- a/board/samsung/dts/exynos5250-smdk5250.dts
+++ b/board/samsung/dts/exynos5250-smdk5250.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ ARCH_CPU_DTS
+/include/ "exynos5250.dtsi"
 
 / {
model = "SAMSUNG SMDK5250 board based on EXYNOS5250";
diff --git a/board/samsung/dts/exynos5250-snow.dts 
b/board/samsung/dts/exynos5250-snow.dts
index 24658c1..30c22c9 100644
--- a/board/samsung/dts/exynos5250-snow.dts
+++ b/board/samsung/dts/exynos5250-snow.dts
@@ -10,7 +10,7 @@
 */
 
 /dts-v1/;
-/include/ ARCH_CPU_DTS
+/include/ "exynos5250.dtsi"
 
 / {
model = "Google Snow";
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 6/9] dts/Makefile: don't define ARCH_CPU_DTS, BOARD_DTS

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Now that nothing uses the defines ARCH_CPU_DTS, BOARD_DTS, stop defining
them.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 dts/Makefile | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index ce774e0..42ba42f 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -33,18 +33,11 @@ $(error Please define CONFIG_DEFAULT_DEVICE_TREE in your 
board header file))
 DEVICE_TREE = $(subst ",,$(CONFIG_DEFAULT_DEVICE_TREE))
 endif
 
-$(if $(CONFIG_ARCH_DEVICE_TREE),,\
-$(error Your architecture does not have device tree support enabled. \
-Please define CONFIG_ARCH_DEVICE_TREE))
-
 DTS_INCDIRS =  $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts
 DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts
 DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
 
-# We preprocess the device tree file provide a useful define
 DTS_CPPFLAGS := -x assembler-with-cpp \
-   
-DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \
-   
-DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\" \
-nostdinc $(addprefix -I,$(DTS_INCDIRS))
 
 DTC_FLAGS := -R 4 -p 0x1000 \
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 9/9] dts/Makefile: pass -undef -D__DTS__ to cpp

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

This brings U-Boot's cpp invocation into line with the way the Linux
kernel invokes cpp on device trees. Consistency will be useful to ensure
*.dts is portable between the two.

-undef also has the added advantage of not defining "linux", so DT
property names such as "linux,keymap" don't get mangled.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dts/Makefile b/dts/Makefile
index 805d2cc..b125bd3 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -37,7 +37,7 @@ DTS_INCDIRS =  $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts
 DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts
 DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
 
-DTS_CPPFLAGS := -x assembler-with-cpp \
+DTS_CPPFLAGS := -x assembler-with-cpp -undef -D__DTS__ \
-nostdinc $(addprefix -I,$(DTS_INCDIRS))
 
 DTC_FLAGS := -R 4 -p 0x1000 \
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 1/9] Validate dtc is new enough

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Subsequent patches assume that dtc supports various recent features.
These are available in dtc 1.4.0. Validate that dtc is at least that
version.

Signed-off-by: Stephen Warren 
---
v2: New patch.
---
 Makefile |  8 +++-
 config.mk|  1 +
 tools/dtc-version.sh | 20 
 3 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100755 tools/dtc-version.sh

diff --git a/Makefile b/Makefile
index 50880c9..f167458 100644
--- a/Makefile
+++ b/Makefile
@@ -428,7 +428,7 @@ endif
 
 all:   $(ALL-y) $(SUBDIR_EXAMPLES)
 
-$(obj)u-boot.dtb:  $(obj)u-boot
+$(obj)u-boot.dtb:  checkdtc $(obj)u-boot
$(MAKE) -C dts binary
mv $(obj)dts/dt.dtb $@
 
@@ -686,6 +686,12 @@ checkgcc4:
false; \
fi
 
+checkdtc:
+   @if test $(call dtc-version) -lt 0104; then \
+   echo '*** Your dtc is too old, please upgrade to dtc 1.4 or 
newer'; \
+   false; \
+   fi
+
 #
 # Auto-generate the autoconf.mk file (which is included by all makefiles)
 #
diff --git a/config.mk b/config.mk
index 6e17ed8..32643ec 100644
--- a/config.mk
+++ b/config.mk
@@ -136,6 +136,7 @@ endif
 # Usage gcc-ver := $(call cc-version)
 cc-version = $(shell $(SHELL) $(SRCTREE)/tools/gcc-version.sh $(CC))
 binutils-version = $(shell $(SHELL) $(SRCTREE)/tools/binutils-version.sh $(AS))
+dtc-version = $(shell $(SHELL) $(SRCTREE)/tools/dtc-version.sh $(DTC))
 
 #
 # Include the make variables (CC, etc...)
diff --git a/tools/dtc-version.sh b/tools/dtc-version.sh
new file mode 100755
index 000..e8c94d3
--- /dev/null
+++ b/tools/dtc-version.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+# dtc-version dtc-command
+#
+# Prints the dtc version of `dtc-command' in a canonical 4-digit form
+# such as `0222' for binutils 2.22
+#
+
+dtc="$*"
+
+if [ ${#dtc} -eq 0 ]; then
+   echo "Error: No dtc command specified."
+   printf "Usage:\n\t$0 \n"
+   exit 1
+fi
+
+MAJOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 1)
+MINOR=$($dtc -v | head -1 | awk '{print $NF}' | cut -d . -f 2)
+
+printf "%02d%02d\\n" $MAJOR $MINOR
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 8/9] dts/Makefile: don't use cpp -P

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Recent dtc supports #line directives in the input source code, and even
uses them to generate useful line numbers in any messages it emits. Stop
passing -P to cpp, since there's no need any more.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 dts/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dts/Makefile b/dts/Makefile
index 42ba42f..805d2cc 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -51,7 +51,7 @@ all:  $(obj).depend $(LIB)
 DT_BIN := $(obj)dt.dtb
 
 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
-   $(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
+   $(CPP) $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
$(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
 
 process_lds = \
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 4/9] dts/Makefile: unify cpp/dtc include paths

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

*.dts may use #include (via cpp) or /include/ (via dtc; assuming a newer
dtc). The choice is up to the creator of the DT. Create a common variable
DTC_INCDIRS that lists the paths searched by include statements, and
update cpp and dtc invocation to use them.

For cpp, also specify -nostdinc to ensure the same set of paths is
available to both type of include statement.

For dtc, create a new DTC_FLAGS variable to hold all the flags passed to
dtc.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
---
 dts/Makefile | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dts/Makefile b/dts/Makefile
index 722cc37..ce774e0 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -37,11 +37,18 @@ $(if $(CONFIG_ARCH_DEVICE_TREE),,\
 $(error Your architecture does not have device tree support enabled. \
 Please define CONFIG_ARCH_DEVICE_TREE))
 
+DTS_INCDIRS =  $(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts
+DTS_INCDIRS += $(SRCTREE)/board/$(VENDOR)/dts
+DTS_INCDIRS += $(SRCTREE)/arch/$(ARCH)/dts
+
 # We preprocess the device tree file provide a useful define
 DTS_CPPFLAGS := -x assembler-with-cpp \

-DARCH_CPU_DTS=\"$(SRCTREE)/arch/$(ARCH)/dts/$(CONFIG_ARCH_DEVICE_TREE).dtsi\" \

-DBOARD_DTS=\"$(SRCTREE)/board/$(VENDOR)/$(BOARD)/dts/$(DEVICE_TREE).dts\" \
-   -I$(SRCTREE)/board/$(VENDOR)/dts -I$(SRCTREE)/arch/$(ARCH)/dts
+   -nostdinc $(addprefix -I,$(DTS_INCDIRS))
+
+DTC_FLAGS := -R 4 -p 0x1000 \
+   $(addprefix -i ,$(DTS_INCDIRS))
 
 all:   $(obj).depend $(LIB)
 
@@ -52,7 +59,7 @@ DT_BIN:= $(obj)dt.dtb
 
 $(DT_BIN): $(TOPDIR)/board/$(VENDOR)/dts/$(DEVICE_TREE).dts
$(CPP) -P $(DTS_CPPFLAGS) $< -o $(DT_BIN).dts.tmp
-   $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
+   $(DTC) $(DTC_FLAGS) -O dtb -o ${DT_BIN} $(DT_BIN).dts.tmp
 
 process_lds = \
$(1) | sed -r -n 's/^OUTPUT_$(2)[ ("]*([^")]*).*/\1/p'
-- 
1.8.1.5

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


[U-Boot] [PATCH V2 0/9] rely on latest dtc, simplify

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

This is a series of patches which simplifies the rules to build *.dts in
U-Boot by relying on features in the latest dtc. The include rules are
made more consistent between cpp (when processing *.dts) and dtc. The cpp
flags are made more consistent with the way the kernel processes *.dts to
allow better portability of *.dts between the two.

I'm sending V2 now that dtc-1.4.0 has been tagged/released, and hence
there's a version number that patch 1/9 "Validate dtc is new enough" can
check for. I'll leave it up to you whether this series is applicable for
the current or next release.

Stephen Warren (9):
  Validate dtc is new enough
  xilinx: move microblaze-generic .dts to standard location
  dts/Makefile: simplify dtc invocation
  dts/Makefile: unify cpp/dtc include paths
  dt: don't use ARCH_CPU_DTS
  dts/Makefile: don't define ARCH_CPU_DTS, BOARD_DTS
  config: don't define CONFIG_ARCH_DEVICE_TREE
  dts/Makefile: don't use cpp -P
  dts/Makefile: pass -undef -D__DTS__ to cpp

 .gitignore |  1 +
 Makefile   |  8 ++-
 arch/arm/cpu/armv7/tegra114/config.mk  | 19 
 arch/arm/cpu/armv7/tegra20/config.mk   | 26 --
 arch/arm/cpu/armv7/tegra30/config.mk   | 19 
 arch/microblaze/config.mk  |  2 --
 arch/x86/cpu/coreboot/config.mk| 23 ---
 board/chromebook-x86/dts/link.dts  |  2 +-
 board/samsung/dts/exynos5250-smdk5250.dts  |  2 +-
 board/samsung/dts/exynos5250-snow.dts  |  2 +-
 .../microblaze.dts => dts/microblaze-generic.dts}  |  0
 board/xilinx/dts/microblaze.dts|  1 -
 config.mk  |  1 +
 doc/README.fdt-control |  3 +--
 dts/Makefile   | 25 +
 include/configs/exynos5250-dt.h|  1 -
 include/configs/microblaze-generic.h   |  2 +-
 tools/dtc-version.sh   | 20 +
 18 files changed, 44 insertions(+), 113 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/tegra114/config.mk
 delete mode 100644 arch/arm/cpu/armv7/tegra20/config.mk
 delete mode 100644 arch/arm/cpu/armv7/tegra30/config.mk
 delete mode 100644 arch/x86/cpu/coreboot/config.mk
 rename board/xilinx/{microblaze-generic/dts/microblaze.dts => 
dts/microblaze-generic.dts} (100%)
 delete mode 100644 board/xilinx/dts/microblaze.dts
 create mode 100755 tools/dtc-version.sh

-- 
1.8.1.5

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


[U-Boot] [PATCH V2 2/9] xilinx: move microblaze-generic .dts to standard location

2013-06-24 Thread Stephen Warren
From: Stephen Warren 

Aside from microblaze, all other SoCs/boards/vendors store their DT files
in board/$vendor/dts/$soc-$board.dts. Move microblaze-generic.dts to this
location for consistency.

Signed-off-by: Stephen Warren 
Acked-by: Simon Glass 
Acked-by: Michal Simek 
---
 .../dts/microblaze.dts => dts/microblaze-generic.dts}   | 0
 board/xilinx/dts/microblaze.dts | 1 -
 include/configs/microblaze-generic.h| 2 +-
 3 files changed, 1 insertion(+), 2 deletions(-)
 rename board/xilinx/{microblaze-generic/dts/microblaze.dts => 
dts/microblaze-generic.dts} (100%)
 delete mode 100644 board/xilinx/dts/microblaze.dts

diff --git a/board/xilinx/microblaze-generic/dts/microblaze.dts 
b/board/xilinx/dts/microblaze-generic.dts
similarity index 100%
rename from board/xilinx/microblaze-generic/dts/microblaze.dts
rename to board/xilinx/dts/microblaze-generic.dts
diff --git a/board/xilinx/dts/microblaze.dts b/board/xilinx/dts/microblaze.dts
deleted file mode 100644
index bf984b0..000
--- a/board/xilinx/dts/microblaze.dts
+++ /dev/null
@@ -1 +0,0 @@
-/include/ BOARD_DTS
diff --git a/include/configs/microblaze-generic.h 
b/include/configs/microblaze-generic.h
index 17f53ba..ad91d21 100644
--- a/include/configs/microblaze-generic.h
+++ b/include/configs/microblaze-generic.h
@@ -34,7 +34,7 @@
 /* Open Firmware DTS */
 #define CONFIG_OF_CONTROL  1
 #define CONFIG_OF_EMBED1
-#define CONFIG_DEFAULT_DEVICE_TREE microblaze
+#define CONFIG_DEFAULT_DEVICE_TREE microblaze-generic
 
 /* linear and spi flash memory */
 #ifdef XILINX_FLASH_START
-- 
1.8.1.5

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


[U-Boot] [PATCH 4/4] arm:goni: Add support for USB mass storage

2013-06-24 Thread Lukasz Majewski
From: Arkadiusz Wlodarczyk 

This commit enables support for USB mass storage composite function.
It defines platform code and enables it at config file.

Signed-off-by: Arkadiusz Wlodarczyk 
Signed-off-by: Kyungmin Park 
Tested-by: Arkadiusz Wlodarczyk 
Cc: Minkyu Kang 
---
 board/samsung/goni/goni.c  |   68 
 include/configs/s5p_goni.h |5 
 2 files changed, 73 insertions(+)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index 3c53106..a09daca 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 DECLARE_GLOBAL_DATA_PTR;
 
 static struct s5pc110_gpio *s5pc110_gpio;
@@ -163,3 +164,70 @@ void board_usb_init(void)
 }
 
 #endif
+
+#ifdef CONFIG_USB_GADGET_MASS_STORAGE
+static int ums_read_sector(struct ums_device *ums_dev,
+   ulong start, lbaint_t blkcnt, void *buf)
+{
+   if (ums_dev->mmc->block_dev.block_read(ums_dev->dev_num,
+   start + ums_dev->offset, blkcnt, buf) != blkcnt)
+   return -1;
+
+   return 0;
+}
+
+static int ums_write_sector(struct ums_device *ums_dev,
+   ulong start, lbaint_t blkcnt, const void *buf)
+{
+   if (ums_dev->mmc->block_dev.block_write(ums_dev->dev_num,
+   start + ums_dev->offset, blkcnt, buf) != blkcnt)
+   return -1;
+
+   return 0;
+}
+
+static void ums_get_capacity(struct ums_device *ums_dev,
+   long long int *capacity)
+{
+   long long int tmp_capacity;
+
+   tmp_capacity = (long long int) ((ums_dev->offset + ums_dev->part_size)
+   * SECTOR_SIZE);
+   *capacity = ums_dev->mmc->capacity - tmp_capacity;
+}
+
+static struct ums_board_info ums_board = {
+   .read_sector = ums_read_sector,
+   .write_sector = ums_write_sector,
+   .get_capacity = ums_get_capacity,
+   .name = "GONI UMS disk",
+   .ums_dev = {
+   .mmc = NULL,
+   .dev_num = 0,
+   .offset = 0,
+   .part_size = 0.
+   },
+};
+
+struct ums_board_info *board_ums_init(unsigned int dev_num, unsigned int 
offset,
+   unsigned int part_size)
+{
+   struct mmc *mmc;
+
+   mmc = find_mmc_device(dev_num);
+   /* mmc initialization is necessary prior to the ums command usage
+* due to fact that on goni target environment is read from oneNand
+* memory, so the mmc remains uninitialized whenu-boot prompt appears
+* */
+   if (!mmc || mmc_init(mmc))
+   return NULL;
+
+   ums_board.ums_dev.mmc = mmc;
+   ums_board.ums_dev.dev_num = dev_num;
+   ums_board.ums_dev.offset = offset;
+   ums_board.ums_dev.part_size = part_size;
+
+   return &ums_board;
+}
+
+#endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index e8f2639..1cfbb88 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -269,4 +269,9 @@
 #define CONFIG_USB_GADGET_DUALSPEED
 #define CONFIG_USB_GADGET_VBUS_DRAW 2
 
+#define CONFIG_CMD_USB_MASS_STORAGE
+#if defined(CONFIG_CMD_USB_MASS_STORAGE)
+#define CONFIG_USB_GADGET_MASS_STORAGE
+#endif
+
 #endif /* __CONFIG_H */
-- 
1.7.10.4

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


[U-Boot] [PATCH 1/4] arm:goni: Update configuration for goni target

2013-06-24 Thread Lukasz Majewski
From: Arkadiusz Wlodarczyk 

Configuration file for GONI has been updated to support FAT file system,
new mmc partitioning scheme and read linux kernel from eMMC instead of
OneNAND.

Signed-off-by: Arkadiusz Wlodarczyk 
Signed-off-by: Kyungmin Park 
Tested-by: Arkadiusz Wlodarczyk 
Cc: Minkyu Kang 
---
 include/configs/s5p_goni.h |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 56e8347..ec43652 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -107,7 +107,7 @@
 
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
-#define CONFIG_BOOTCOMMAND "run ubifsboot"
+#define CONFIG_BOOTCOMMAND "run mmcboot"
 
 #define CONFIG_DEFAULT_CONSOLE "console=ttySAC2,115200n8\0"
 
@@ -137,7 +137,7 @@
"onenand erase 0x0156 0x1eaa;" \
"onenand write 0x3200 0x126 0x8C\0" \
"bootk=" \
-   "onenand read 0x30007FC0 0xc0 0x60;" \
+   "run loaduimage;" \
"bootm 0x30007FC0\0" \
"flashboot=" \
"set bootargs root=/dev/mtdblock${bootblock} " \
@@ -156,16 +156,21 @@
"set bootargs " CONFIG_RAMDISK_BOOT \
" initrd=0x3300,8M ramdisk=8192\0" \
"mmcboot=" \
-   "set bootargs root=${mmcblk} rootfstype=${rootfstype}" \
+   "set bootargs root=/dev/mmcblk${mmcdev}p${mmcrootpart} " \
+   "rootfstype=${rootfstype}" \
CONFIG_UBI_MTD " ${opts} ${lcdinfo} " \
CONFIG_COMMON_BOOT "; run bootk\0" \
"boottrace=setenv opts initcall_debug; run bootcmd\0" \
"bootchart=set opts init=/sbin/bootchartd; run bootcmd\0" \
"verify=n\0" \
-   "rootfstype=cramfs\0" \
+   "rootfstype=ext4\0" \
"console=" CONFIG_DEFAULT_CONSOLE \
"mtdparts=" MTDPARTS_DEFAULT \
"meminfo=mem=80M mem=256M@0x4000 mem=128M@0x5000\0" \
+   "loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
+   "mmcdev=0\0" \
+   "mmcbootpart=2\0" \
+   "mmcrootpart=5\0" \
"mmcblk=/dev/mmcblk1p1\0" \
"bootblock=9\0" \
"ubiblock=8\0" \
@@ -211,6 +216,10 @@
 
 #define CONFIG_DOS_PARTITION   1
 
+/* FAT */
+#define CONFIG_CMD_FAT
+#define CONFIG_FAT_WRITE
+
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 0x100)
 
 #define CONFIG_SYS_CACHELINE_SIZE   64
-- 
1.7.10.4

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


[U-Boot] [PATCH 0/4] arm:goni: Update GONI configuration

2013-06-24 Thread Lukasz Majewski
Samsung's GONI target has been updated to support:
- New GPT partition layout
- USB Mass Storage Gadget
- DFU support
- Loading uImage from eMMC not OneNAND

Arkadiusz Wlodarczyk (4):
  arm:goni: Update configuration for goni target
  arm:goni:dfu Add support for DFU at GONI target
  arm:goni: Update of GONI partitioning scheme at eMMC
  arm:goni: Add support for USB mass storage

 board/samsung/goni/goni.c  |   75 +
 include/configs/s5p_goni.h |   88 
 2 files changed, 139 insertions(+), 24 deletions(-)

-- 
1.7.10.4

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


[U-Boot] [PATCH 2/4] arm:goni:dfu Add support for DFU at GONI target

2013-06-24 Thread Lukasz Majewski
From: Arkadiusz Wlodarczyk 

Proper adjustment for supporting DFU at GONI target has been made.
The s5p_goni.h file has been updated. Moreover the code for low level
USB initialization has been added to GONI board code.

Signed-off-by: Arkadiusz Wlodarczyk 
Signed-off-by: Kyungmin Park 
Tested-by: Arkadiusz Wlodarczyk 
Cc: Minkyu Kang 
---
 board/samsung/goni/goni.c  |7 +++
 include/configs/s5p_goni.h |   20 +++-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index ff76963..3c53106 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -155,4 +155,11 @@ struct s3c_plat_otg_data s5pc110_otg_data = {
.regs_otg = S5PC110_OTG_BASE,
.usb_phy_ctrl = S5PC110_USB_PHY_CONTROL,
 };
+
+void board_usb_init(void)
+{
+   debug("USB_udc_probe\n");
+   s3c_udc_probe(&s5pc110_otg_data);
+}
+
 #endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index ec43652..8a824c7 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -86,6 +86,17 @@
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
+#define CONFIG_CMD_DFU
+
+/* USB Composite download gadget - g_dnl */
+#define CONFIG_USBDOWNLOAD_GADGET
+#define CONFIG_DFU_FUNCTION
+#define CONFIG_DFU_MMC
+
+/* USB Samsung's IDs */
+#define CONFIG_G_DNL_VENDOR_NUM 0x04E8
+#define CONFIG_G_DNL_PRODUCT_NUM 0x6601
+#define CONFIG_G_DNL_MANUFACTURER "Samsung"
 
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
@@ -105,6 +116,10 @@
",60m(qboot)"\
",-(UBI)\0"
 
+#define CONFIG_DFU_ALT \
+   "u-boot mmc 80 400;" \
+   "uImage fat 0 2\0" \
+
 #define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
 
 #define CONFIG_BOOTCOMMAND "run mmcboot"
@@ -175,7 +190,9 @@
"bootblock=9\0" \
"ubiblock=8\0" \
"ubi=enabled\0" \
-   "opts=always_resume=1"
+   "opts=always_resume=1\0" \
+   "dfu_alt_info=" CONFIG_DFU_ALT
+
 
 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP/* undef to save memory */
@@ -242,5 +259,6 @@
 #define CONFIG_USB_GADGET
 #define CONFIG_USB_GADGET_S3C_UDC_OTG
 #define CONFIG_USB_GADGET_DUALSPEED
+#define CONFIG_USB_GADGET_VBUS_DRAW 2
 
 #endif /* __CONFIG_H */
-- 
1.7.10.4

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


[U-Boot] [PATCH 3/4] arm:goni: Update of GONI partitioning scheme at eMMC

2013-06-24 Thread Lukasz Majewski
From: Arkadiusz Wlodarczyk 

New partitioning scheme has been defined at GONI target. It complies with
new GPT partitioning introduced previously.

Default partition layout has been defined at s5p_goni.h

Signed-off-by: Arkadiusz Wlodarczyk 
Signed-off-by: Kyungmin Park 
Tested-by: Arkadiusz Wlodarczyk 
Cc: Minkyu Kang 
---
 include/configs/s5p_goni.h |   44 ++--
 1 file changed, 26 insertions(+), 18 deletions(-)

diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 8a824c7..e8f2639 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -84,9 +84,9 @@
 #define CONFIG_CMD_CACHE
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
-#define CONFIG_CMD_MTDPARTS
 #define CONFIG_CMD_MMC
 #define CONFIG_CMD_DFU
+#define CONFIG_CMD_GPT
 
 /* USB Composite download gadget - g_dnl */
 #define CONFIG_USBDOWNLOAD_GADGET
@@ -101,26 +101,30 @@
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
 
-#define CONFIG_MTD_DEVICE
-#define CONFIG_MTD_PARTITIONS
-
-/* Actual modem binary size is 16MiB. Add 2MiB for bad block handling */
-#define MTDIDS_DEFAULT "onenand0=samsung-onenand"
-#define MTDPARTS_DEFAULT   "mtdparts=samsung-onenand:1m(bootloader)"\
-   ",256k(params)"\
-   ",2816k(config)"\
-   ",8m(csa)"\
-   ",7m(kernel)"\
-   ",1m(log)"\
-   ",12m(modem)"\
-   ",60m(qboot)"\
-   ",-(UBI)\0"
-
 #define CONFIG_DFU_ALT \
"u-boot mmc 80 400;" \
"uImage fat 0 2\0" \
 
-#define NORMAL_MTDPARTS_DEFAULT MTDPARTS_DEFAULT
+/* partitions definitions */
+#define PARTS_CSA  "csa-mmc"
+#define PARTS_BOOTLOADER   "u-boot"
+#define PARTS_BOOT "boot"
+#define PARTS_ROOT "platform"
+#define PARTS_DATA "data"
+#define PARTS_CSC  "csc"
+#define PARTS_UMS  "ums"
+
+#define PARTS_DEFAULT \
+   "uuid_disk=${uuid_gpt_disk};" \
+   "name="PARTS_CSA",size=8MiB,uuid=${uuid_gpt_"PARTS_CSA"};" \
+   "name="PARTS_BOOTLOADER",size=60MiB," \
+   "uuid=${uuid_gpt_"PARTS_BOOTLOADER"};" \
+   "name="PARTS_BOOT",size=100MiB,uuid=${uuid_gpt_"PARTS_BOOT"};" \
+   "name="PARTS_ROOT",size=1GiB,uuid=${uuid_gpt_"PARTS_ROOT"};" \
+   "name="PARTS_DATA",size=3GiB,uuid=${uuid_gpt_"PARTS_DATA"};" \
+   "name="PARTS_CSC",size=150MiB,uuid=${uuid_gpt_"PARTS_CSC"};" \
+   "name="PARTS_UMS",size=-,uuid=${uuid_gpt_"PARTS_UMS"}\0" \
+
 
 #define CONFIG_BOOTCOMMAND "run mmcboot"
 
@@ -180,12 +184,12 @@
"verify=n\0" \
"rootfstype=ext4\0" \
"console=" CONFIG_DEFAULT_CONSOLE \
-   "mtdparts=" MTDPARTS_DEFAULT \
"meminfo=mem=80M mem=256M@0x4000 mem=128M@0x5000\0" \
"loaduimage=fatload mmc ${mmcdev}:${mmcbootpart} 0x30007FC0 uImage\0" \
"mmcdev=0\0" \
"mmcbootpart=2\0" \
"mmcrootpart=5\0" \
+   "partitions=" PARTS_DEFAULT \
"mmcblk=/dev/mmcblk1p1\0" \
"bootblock=9\0" \
"ubiblock=8\0" \
@@ -237,6 +241,10 @@
 #define CONFIG_CMD_FAT
 #define CONFIG_FAT_WRITE
 
+/* GPT */
+#define CONFIG_EFI_PARTITION
+#define CONFIG_PARTITION_UUIDS
+
 #define CONFIG_SYS_INIT_SP_ADDR(CONFIG_SYS_LOAD_ADDR - 0x100)
 
 #define CONFIG_SYS_CACHELINE_SIZE   64
-- 
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 1/3] net: macb: using AT91FAMILY replace #ifdeferry

2013-06-24 Thread Andreas Bießmann
Hi Joe,

On 04/24/2013 09:59 AM, Bo Shen wrote:
> Using CONFIG_AT91FAMILY replace #ifdeferry for atmel SoC
> 
> Signed-off-by: Bo Shen 
> ---
>  drivers/net/macb.c |   10 ++
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/macb.c b/drivers/net/macb.c
> index 8bacbda..753fb96 100644
> --- a/drivers/net/macb.c
> +++ b/drivers/net/macb.c
> @@ -466,19 +466,13 @@ static int macb_init(struct eth_device *netdev, bd_t 
> *bd)
>  
>   /* choose RMII or MII mode. This depends on the board */
>  #ifdef CONFIG_RMII
> -#if  defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
> - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
> - defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
> - defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
> +#ifdef CONFIG_AT91FAMILY
>   macb_writel(macb, USRIO, MACB_BIT(RMII) | MACB_BIT(CLKEN));
>  #else
>   macb_writel(macb, USRIO, 0);
>  #endif
>  #else
> -#if  defined(CONFIG_AT91CAP9) || defined(CONFIG_AT91SAM9260) || \
> - defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G20) || \
> - defined(CONFIG_AT91SAM9G45) || defined(CONFIG_AT91SAM9M10G45) || \
> - defined(CONFIG_AT91SAM9XE) || defined(CONFIG_AT91SAM9X5)
> +#ifdef CONFIG_AT91FAMILY
>   macb_writel(macb, USRIO, MACB_BIT(CLKEN));
>  #else
>   macb_writel(macb, USRIO, MACB_BIT(MII));
> 

just realized that this patch is still not in u-boot/master. Will you
apply it (and the rest of the series) for this release?

Best regards

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


[U-Boot] [PATCH] dfu:ext4:fix Fix ext4{read|write} command formatting

2013-06-24 Thread Lukasz Majewski
In the following commit:
"dfu: Support larger than memory transfers."
SHA1: ea2453d56b8860dbd18a3c517531ffc8dcb5c839

The ext4{read|write} command formatting has been changed. It removed
a mandatory [sizebytes] parameter.

It prevented from ext4 update via dfu. This commit restored the previous
behaviour.

Signed-off-by: Lukasz Majewski 
Signed-off-by: Kyungmin Park 
Cc: Tom Rini 
Cc: Pantelis Antoniou 
---
 drivers/dfu/dfu_mmc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index e2f3978..032c6a7 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -94,10 +94,10 @@ static int mmc_file_op(enum dfu_mmc_op op, struct 
dfu_entity *dfu,
sprintf(cmd_buf + strlen(cmd_buf), " %lx", *len);
break;
case DFU_FS_EXT4:
-   sprintf(cmd_buf, "ext4%s mmc %d:%d 0x%x /%s",
+   sprintf(cmd_buf, "ext4%s mmc %d:%d 0x%x /%s %ld",
op == DFU_OP_READ ? "load" : "write",
dfu->data.mmc.dev, dfu->data.mmc.part,
-   (unsigned int) buf, dfu->name);
+   (unsigned int) buf, dfu->name, *len);
break;
default:
printf("%s: Layout (%s) not (yet) supported!\n", __func__,
-- 
1.7.10.4

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


[U-Boot] [PATCH 2/4] ARM: AM33xx: Cleanup clocks layer

2013-06-24 Thread Lokesh Vutla
Cleaning up the clocks layer.
This helps in addition of new Soc with minimal
changes.
This is derived from OMAP4 boards.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/cpu/armv7/am33xx/board.c   |6 -
 arch/arm/cpu/armv7/am33xx/clock.c   |   62 +-
 arch/arm/cpu/armv7/am33xx/clock_am33xx.c|  275 ---
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c|   19 +-
 arch/arm/cpu/armv7/am33xx/emif4.c   |1 -
 arch/arm/include/asm/arch-am33xx/clock.h|   28 ++-
 arch/arm/include/asm/arch-am33xx/ddr_defs.h |2 -
 board/isee/igep0033/board.c |   11 +-
 board/ti/am335x/board.c |   10 +-
 board/ti/ti814x/evm.c   |   12 +-
 10 files changed, 193 insertions(+), 233 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index b935a29..1d743d6 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -64,12 +64,6 @@ int cpu_mmc_init(bd_t *bis)
 }
 #endif
 
-void setup_clocks_for_console(void)
-{
-   /* Not yet implemented */
-   return;
-}
-
 /* AM33XX has two MUSB controllers which can be host or gadget */
 #if (defined(CONFIG_MUSB_GADGET) || defined(CONFIG_MUSB_HOST)) && \
(defined(CONFIG_AM335X_USB0) || defined(CONFIG_AM335X_USB1))
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock.c
index a7f1d83..372e369 100644
--- a/arch/arm/cpu/armv7/am33xx/clock.c
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -106,7 +106,7 @@ static void do_setup_dpll(const struct dpll_regs *dpll_regs,
wait_for_lock(dpll_regs);
 }
 
-void setup_dplls(void)
+static void setup_dplls(void)
 {
do_setup_dpll(&dpll_core_regs, &dpll_core);
do_setup_dpll(&dpll_mpu_regs, &dpll_mpu);
@@ -114,3 +114,63 @@ void setup_dplls(void)
writel(0x300, &cmwkup->clkdcoldodpllper);
do_setup_dpll(&dpll_ddr_regs, &dpll_ddr);
 }
+
+static inline void wait_for_clk_enable(u32 *clkctrl_addr)
+{
+   u32 clkctrl, idlest = MODULE_CLKCTRL_IDLEST_DISABLED;
+   u32 bound = LDELAY;
+
+   while ((idlest == MODULE_CLKCTRL_IDLEST_DISABLED) ||
+   (idlest == MODULE_CLKCTRL_IDLEST_TRANSITIONING)) {
+   clkctrl = readl(clkctrl_addr);
+   idlest = (clkctrl & MODULE_CLKCTRL_IDLEST_MASK) >>
+MODULE_CLKCTRL_IDLEST_SHIFT;
+   if (--bound == 0) {
+   printf("Clock enable failed for 0x%p idlest 0x%x\n",
+  clkctrl_addr, clkctrl);
+   return;
+   }
+   }
+}
+
+static inline void enable_clock_module(u32 *const clkctrl_addr, u32 
enable_mode,
+  u32 wait_for_enable)
+{
+   clrsetbits_le32(clkctrl_addr, MODULE_CLKCTRL_MODULEMODE_MASK,
+   enable_mode << MODULE_CLKCTRL_MODULEMODE_SHIFT);
+   debug("Enable clock module - %p\n", clkctrl_addr);
+   if (wait_for_enable)
+   wait_for_clk_enable(clkctrl_addr);
+}
+
+static inline void enable_clock_domain(u32 *const clkctrl_reg, u32 enable_mode)
+{
+   clrsetbits_le32(clkctrl_reg, CD_CLKCTRL_CLKTRCTRL_MASK,
+   enable_mode << CD_CLKCTRL_CLKTRCTRL_SHIFT);
+   debug("Enable clock domain - %p\n", clkctrl_reg);
+}
+
+void do_enable_clocks(u32 *const *clk_domains,
+ u32 *const *clk_modules_explicit_en, u8 wait_for_enable)
+{
+   u32 i, max = 100;
+
+   /* Put the clock domains in SW_WKUP mode */
+   for (i = 0; (i < max) && clk_domains[i]; i++) {
+   enable_clock_domain(clk_domains[i],
+   CD_CLKCTRL_CLKTRCTRL_SW_WKUP);
+   }
+
+   /* Clock modules that need to be put in SW_EXPLICIT_EN mode */
+   for (i = 0; (i < max) && clk_modules_explicit_en[i]; i++) {
+   enable_clock_module(clk_modules_explicit_en[i],
+   MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN,
+   wait_for_enable);
+   };
+}
+
+void prcm_init()
+{
+   enable_basic_clocks();
+   setup_dplls();
+}
diff --git a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c 
b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
index e878b25..b0b5c8b 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_am33xx.c
@@ -22,17 +22,12 @@
 #include 
 #include 
 
-#define PRCM_MOD_EN0x2
-#define PRCM_FORCE_WAKEUP  0x2
-#define PRCM_FUNCTL0x0
-
-#define CPGMAC0_IDLE   0x3
 #define OSC(V_OSCK/100)
 
-const struct cm_perpll *cmper = (struct cm_perpll *)CM_PER;
-const struct cm_wkuppll *cmwkup = (struct cm_wkuppll *)CM_WKUP;
-const struct cm_dpll *cmdpll = (struct cm_dpll *)CM_DPLL;
-const struct cm_rtc *cmrtc = (struct cm_rtc *)CM_RTC;
+struct cm_perpll *const cmper = (struct cm_perpll *)CM_PER;
+struct cm_wkuppll *const cmwkup = (struct cm_wkuppll *)CM_WK

[U-Boot] [PATCH 3/4] ARM: AM33xx: Move s_init to a common place

2013-06-24 Thread Lokesh Vutla
From: Heiko Schocher 

s_init has the same outline for all the AM33xx based
board. So making it generic.
This also helps in addition of new Soc with minimal changes.

Signed-off-by: Lokesh Vutla 
Signed-off-by: Heiko Schocher 
Signed-off-by: Tom Rini 
---
 arch/arm/cpu/armv7/am33xx/board.c|   46 +--
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c |6 ++
 arch/arm/cpu/armv7/am33xx/emif4.c|6 +-
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |6 +-
 arch/arm/include/asm/arch-am33xx/sys_proto.h |5 +-
 board/isee/igep0033/board.c  |   49 +++-
 board/phytec/pcm051/board.c  |   48 +++-
 board/ti/am335x/board.c  |   52 +++--
 board/ti/ti814x/evm.c|   67 +++---
 9 files changed, 90 insertions(+), 195 deletions(-)

diff --git a/arch/arm/cpu/armv7/am33xx/board.c 
b/arch/arm/cpu/armv7/am33xx/board.c
index 1d743d6..3d08673 100644
--- a/arch/arm/cpu/armv7/am33xx/board.c
+++ b/arch/arm/cpu/armv7/am33xx/board.c
@@ -145,7 +145,7 @@ int arch_misc_init(void)
 }
 
 #ifdef CONFIG_SPL_BUILD
-void rtc32k_enable(void)
+static void rtc32k_enable(void)
 {
struct rtc_regs *rtc = (struct rtc_regs *)RTC_BASE;
 
@@ -161,11 +161,7 @@ void rtc32k_enable(void)
writel((1 << 3) | (1 << 6), &rtc->osc);
 }
 
-#define UART_RESET (0x1 << 1)
-#define UART_CLK_RUNNING_MASK  0x1
-#define UART_SMART_IDLE_EN (0x1 << 0x3)
-
-void uart_soft_reset(void)
+static void uart_soft_reset(void)
 {
struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;
u32 regval;
@@ -182,4 +178,42 @@ void uart_soft_reset(void)
regval |= UART_SMART_IDLE_EN;
writel(regval, &uart_base->uartsyscfg);
 }
+
+static void watchdog_disable(void)
+{
+   struct wd_timer *wdtimer = (struct wd_timer *)WDT_BASE;
+
+   writel(0x, &wdtimer->wdtwspr);
+   while (readl(&wdtimer->wdtwwps) != 0x0)
+   ;
+   writel(0x, &wdtimer->wdtwspr);
+   while (readl(&wdtimer->wdtwwps) != 0x0)
+   ;
+}
 #endif
+
+void s_init(void)
+{
+   /*
+* Save the boot parameters passed from romcode.
+* We cannot delay the saving further than this,
+* to prevent overwrites.
+*/
+#ifdef CONFIG_SPL_BUILD
+   save_omap_boot_params();
+   watchdog_disable();
+   timer_init();
+   set_uart_mux_conf();
+   setup_clocks_for_console();
+   uart_soft_reset();
+
+   gd = &gdata;
+   preloader_console_init();
+
+   prcm_init();
+   set_mux_conf_regs();
+   /* Enable RTC32K clock */
+   rtc32k_enable();
+   sdram_init();
+#endif
+}
diff --git a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c 
b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
index 1a23746..ca7d7ad 100644
--- a/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
+++ b/arch/arm/cpu/armv7/am33xx/clock_ti814x.c
@@ -285,6 +285,12 @@ static void enable_per_clocks(void)
writel(PRCM_MOD_EN, &cmalwon->ethernet1clkctrl);
while ((readl(&cmalwon->ethernet1clkctrl) & ENET_CLKCTRL_CMPL) != 0)
;
+
+   /* RTC clocks */
+   writel(PRCM_MOD_EN, &cmalwon->rtcclkstctrl);
+   writel(PRCM_MOD_EN, &cmalwon->rtcclkctrl);
+   while (readl(&cmalwon->rtcclkctrl) != PRCM_MOD_EN)
+   ;
 }
 
 /*
diff --git a/arch/arm/cpu/armv7/am33xx/emif4.c 
b/arch/arm/cpu/armv7/am33xx/emif4.c
index 47d3dee..3abb609 100644
--- a/arch/arm/cpu/armv7/am33xx/emif4.c
+++ b/arch/arm/cpu/armv7/am33xx/emif4.c
@@ -44,8 +44,6 @@ void dram_init_banksize(void)
 
 
 #ifdef CONFIG_SPL_BUILD
-static struct dmm_lisa_map_regs *hw_lisa_map_regs =
-   (struct dmm_lisa_map_regs *)DMM_BASE;
 static struct vtp_reg *vtpreg[2] = {
(struct vtp_reg *)VTP0_CTRL_ADDR,
(struct vtp_reg *)VTP1_CTRL_ADDR};
@@ -53,6 +51,9 @@ static struct vtp_reg *vtpreg[2] = {
 static struct ddr_ctrl *ddrctrl = (struct ddr_ctrl *)DDR_CTRL_ADDR;
 #endif
 
+#ifdef CONFIG_TI81XX
+static struct dmm_lisa_map_regs *hw_lisa_map_regs =
+   (struct dmm_lisa_map_regs *)DMM_BASE;
 void config_dmm(const struct dmm_lisa_map_regs *regs)
 {
enable_dmm_clocks();
@@ -67,6 +68,7 @@ void config_dmm(const struct dmm_lisa_map_regs *regs)
writel(regs->dmm_lisa_map_1, &hw_lisa_map_regs->dmm_lisa_map_1);
writel(regs->dmm_lisa_map_0, &hw_lisa_map_regs->dmm_lisa_map_0);
 }
+#endif
 
 static void config_vtp(int nr)
 {
diff --git a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h 
b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
index 89b63d9..dc49e7e 100644
--- a/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
+++ b/arch/arm/include/asm/arch-am33xx/clocks_am33xx.h
@@ -24,8 +24,10 @@
 #define CONFIG_SYS_MPUCLK  550
 #endif
 
-extern void pll_init(void);
-extern void enable_emif_clocks(

[U-Boot] [PATCH 0/4] ARM: AM33xx: Cleanup clocks and hwinit

2013-06-24 Thread Lokesh Vutla
This series tries to cleanup code for AM33xx,
inorder to ensure code reusabilty by moving the
duplicated code to common place.
This also helps in addition of new Soc with minimal
changes.

Testing:
Boot tested on BeagleBone White/Black, AM35xx EVM, TI814x.
Verified MAKEALL for armv7 and am33xx boards.

This series is on top of u-boot merged with u-boot-arm.

Heiko Schocher (1):
  ARM: AM33xx: Move s_init to a common place

Lokesh Vutla (3):
  ARM: AM33xx: Cleanup dplls data
  ARM: AM33xx: Cleanup clocks layer
  musb: Disable extra prints

 arch/arm/cpu/armv7/am33xx/Makefile   |1 +
 arch/arm/cpu/armv7/am33xx/board.c|   52 ++-
 arch/arm/cpu/armv7/am33xx/clock.c|  176 
 arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  497 +-
 arch/arm/cpu/armv7/am33xx/clock_ti814x.c |   25 +-
 arch/arm/cpu/armv7/am33xx/emif4.c|   11 +-
 arch/arm/include/asm/arch-am33xx/clock.h |   92 
 arch/arm/include/asm/arch-am33xx/clocks_am33xx.h |6 +-
 arch/arm/include/asm/arch-am33xx/sys_proto.h |6 +-
 board/isee/igep0033/board.c  |   48 +--
 board/phytec/pcm051/board.c  |   48 +--
 board/ti/am335x/board.c  |   50 +--
 board/ti/ti814x/evm.c|   65 +--
 drivers/usb/musb-new/musb_core.c |   18 +-
 14 files changed, 498 insertions(+), 597 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c

-- 
1.7.9.5

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


[U-Boot] [PATCH 1/4] ARM: AM33xx: Cleanup dplls data

2013-06-24 Thread Lokesh Vutla
Locking sequence for all the dplls is same.
In the current code same sequence is done repeatedly
for each dpll. Instead have a generic function
for locking dplls and pass dpll data to that function.

This is derived from OMAP4 boards.

Signed-off-by: Lokesh Vutla 
---
 arch/arm/cpu/armv7/am33xx/Makefile   |1 +
 arch/arm/cpu/armv7/am33xx/clock.c|  116 ++
 arch/arm/cpu/armv7/am33xx/clock_am33xx.c |  222 +-
 arch/arm/cpu/armv7/am33xx/emif4.c|4 +
 arch/arm/include/asm/arch-am33xx/clock.h |   68 
 arch/arm/include/asm/arch-am33xx/ddr_defs.h  |2 +
 arch/arm/include/asm/arch-am33xx/sys_proto.h |1 +
 7 files changed, 232 insertions(+), 182 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/am33xx/clock.c

diff --git a/arch/arm/cpu/armv7/am33xx/Makefile 
b/arch/arm/cpu/armv7/am33xx/Makefile
index c97e30d..f4ccd2a 100644
--- a/arch/arm/cpu/armv7/am33xx/Makefile
+++ b/arch/arm/cpu/armv7/am33xx/Makefile
@@ -18,6 +18,7 @@ LIB   = $(obj)lib$(SOC).o
 
 COBJS-$(CONFIG_AM33XX) += clock_am33xx.o
 COBJS-$(CONFIG_TI814X) += clock_ti814x.o
+COBJS-$(CONFIG_AM33XX) += clock.o
 COBJS  += sys_info.o
 COBJS  += mem.o
 COBJS  += ddr.o
diff --git a/arch/arm/cpu/armv7/am33xx/clock.c 
b/arch/arm/cpu/armv7/am33xx/clock.c
new file mode 100644
index 000..a7f1d83
--- /dev/null
+++ b/arch/arm/cpu/armv7/am33xx/clock.c
@@ -0,0 +1,116 @@
+/*
+ * clock.c
+ *
+ * Clock initialization for AM33XX boards.
+ * Derived from OMAP4 boards
+ *
+ * Copyright (C) 2013, 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 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 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static void setup_post_dividers(const struct dpll_regs *dpll_regs,
+const struct dpll_params *params)
+{
+   /* Setup post-dividers */
+   if (params->m2 >= 0)
+   writel(params->m2, dpll_regs->cm_div_m2_dpll);
+   if (params->m3 >= 0)
+   writel(params->m3, dpll_regs->cm_div_m3_dpll);
+   if (params->m4 >= 0)
+   writel(params->m4, dpll_regs->cm_div_m4_dpll);
+   if (params->m5 >= 0)
+   writel(params->m5, dpll_regs->cm_div_m5_dpll);
+   if (params->m6 >= 0)
+   writel(params->m6, dpll_regs->cm_div_m6_dpll);
+}
+
+static inline void do_lock_dpll(const struct dpll_regs *dpll_regs)
+{
+   clrsetbits_le32(dpll_regs->cm_clkmode_dpll,
+   CM_CLKMODE_DPLL_DPLL_EN_MASK,
+   DPLL_EN_LOCK << CM_CLKMODE_DPLL_EN_SHIFT);
+}
+
+static inline void wait_for_lock(const struct dpll_regs *dpll_regs)
+{
+   if (!wait_on_value(ST_DPLL_CLK_MASK, ST_DPLL_CLK_MASK,
+  (void *)dpll_regs->cm_idlest_dpll, LDELAY)) {
+   printf("DPLL locking failed for 0x%x\n",
+  dpll_regs->cm_clkmode_dpll);
+   hang();
+   }
+}
+
+static inline void do_bypass_dpll(const struct dpll_regs *dpll_regs)
+{
+   clrsetbits_le32(dpll_regs->cm_clkmode_dpll,
+   CM_CLKMODE_DPLL_DPLL_EN_MASK,
+   DPLL_EN_MN_BYPASS << CM_CLKMODE_DPLL_EN_SHIFT);
+}
+
+static inline void wait_for_bypass(const struct dpll_regs *dpll_regs)
+{
+   if (!wait_on_value(ST_DPLL_CLK_MASK, 0,
+  (void *)dpll_regs->cm_idlest_dpll, LDELAY)) {
+   printf("Bypassing DPLL failed 0x%x\n",
+  dpll_regs->cm_clkmode_dpll);
+   }
+}
+
+static void bypass_dpll(const struct dpll_regs *dpll_regs)
+{
+   do_bypass_dpll(dpll_regs);
+   wait_for_bypass(dpll_regs);
+}
+
+static void do_setup_dpll(const struct dpll_regs *dpll_regs,
+ const struct dpll_params *params)
+{
+   u32 temp;
+
+   if (!params)
+   return;
+
+   temp = readl(dpll_regs->cm_clksel_dpll);
+
+   bypass_dpll(dpll_regs);
+
+   /* Set M & N */
+   temp &= ~CM_CLKSEL_DPLL_M_MASK;
+   temp |= (params->m << CM_CLKSEL_DPLL_M_SHIFT) & CM_CLKSEL_DPLL_M_MASK;
+
+   temp &= ~CM_CLKSEL_DPLL_N_MASK;
+   temp |= (params->n << CM_CLKSEL_DPLL_N_SHIFT) & CM_CLKSEL_DPLL_N_MASK;
+
+   writel(temp, dpll_regs->cm_clksel_dpll);
+
+   setup_post_dividers(dpll_regs, params);
+
+   /* Wait till the DPLL locks */
+   do_lock_dpll(dpll_regs);
+   wait_for_lock(dpll_regs);
+}
+
+void setup_dplls(void)
+{
+   do_setup_dpll(&dpll_core_regs, &dpll_core);
+   do_setup_dpll(&dpll_m

[U-Boot] [PATCH 4/4] musb: Disable extra prints

2013-06-24 Thread Lokesh Vutla
There are many musb prints in SPL and U-Boot log.
These prints are required only during musb debug.
So replacing printk with pr_debug in musb_core.

Signed-off-by: Lokesh Vutla 
---
 drivers/usb/musb-new/musb_core.c |   18 +++---
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/musb-new/musb_core.c b/drivers/usb/musb-new/musb_core.c
index da93571..a7d1c56 100644
--- a/drivers/usb/musb-new/musb_core.c
+++ b/drivers/usb/musb-new/musb_core.c
@@ -1311,9 +1311,7 @@ static int __devinit ep_config_from_table(struct musb 
*musb)
break;
}
 
-   printk(KERN_DEBUG "%s: setup fifo_mode %d\n",
-   musb_driver_name, fifo_mode);
-
+   pr_debug("%s: setup fifo_mode %d\n", musb_driver_name, fifo_mode);
 
 done:
offset = fifo_setup(musb, hw_ep, &ep0_cfg, 0);
@@ -1341,10 +1339,9 @@ done:
musb->nr_endpoints = max(epn, musb->nr_endpoints);
}
 
-   printk(KERN_DEBUG "%s: %d/%d max ep, %d/%d memory\n",
-   musb_driver_name,
-   n + 1, musb->config->num_eps * 2 - 1,
-   offset, (1 << (musb->config->ram_bits + 2)));
+   pr_debug("%s: %d/%d max ep, %d/%d memory\n", musb_driver_name, n + 1,
+musb->config->num_eps * 2 - 1, offset,
+(1 << (musb->config->ram_bits + 2)));
 
if (!musb->bulk_ep) {
pr_debug("%s: missing bulk\n", musb_driver_name);
@@ -1447,8 +1444,7 @@ static int __devinit musb_core_init(u16 musb_type, struct 
musb *musb)
if (reg & MUSB_CONFIGDATA_SOFTCONE)
strcat(aInfo, ", SoftConn");
 
-   printk(KERN_DEBUG "%s: ConfigData=0x%02x (%s)\n",
-   musb_driver_name, reg, aInfo);
+   pr_debug("%s:ConfigData=0x%02x (%s)\n", musb_driver_name, reg, aInfo);
 
aDate[0] = 0;
if (MUSB_CONTROLLER_MHDRC == musb_type) {
@@ -1469,8 +1465,8 @@ static int __devinit musb_core_init(u16 musb_type, struct 
musb *musb)
snprintf(aRevision, 32, "%d.%d%s", MUSB_HWVERS_MAJOR(musb->hwvers),
MUSB_HWVERS_MINOR(musb->hwvers),
(musb->hwvers & MUSB_HWVERS_RC) ? "RC" : "");
-   printk(KERN_DEBUG "%s: %sHDRC RTL version %s %s\n",
-   musb_driver_name, type, aRevision, aDate);
+   pr_debug("%s: %sHDRC RTL version %s %s\n", musb_driver_name, type,
+aRevision, aDate);
 
/* configure ep0 */
musb_configure_ep0(musb);
-- 
1.7.9.5

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


Re: [U-Boot] [RFC] interrupt handling

2013-06-24 Thread Lukasz Majewski
Hi Stefan,

> Hi Albert,
> 
> On 22.06.2013 11:58, Albert ARIBAUD wrote:
> > From time to time there is discussion about the need for proper
> > interrupt support in U-Boot.
> > 
> > Right now, the only thing left in the source code which remotely
> > looks like interrupt support is a few code sections compiled
> > conditionally under CONFIG_USE_IRQ, and it does not constitute a
> > good approach to interrupt support, if only for the following
> > reasons:
> > 
> > - CONFIG_USE_IRQ is very general and imprecise as far as overall
> >   meaning goes. It does not say "allow drivers to use IRQs", or
> > "IRQs are provided by supporting this specific interrupt
> > controller", or "this driver requires IRQs to work". It does not
> > help us either that the option was never documented...
> > 
> > - CONFIG_USE_IRQ is, OTOH, very specific as far as interrupt types
> > go. IRQ is an acronym known in ARM for a specific type of
> > interrupt, but ARM also knows FIQ. IRQ may have a different meaning
> > for another architecture, and each platform has its own
> > classification and attributes for interrupts.
> > 
> > - no API is defined for registering interrupt controller or
> > interrupt client drivers.
> > 
> > But the worst part is, CONFIG_USE_IRQ is never *ever* defined. :)
> > 
> > So I am tempted to start this RFC with a first question: do we
> > *need* interrupts in the first place, and if we do, do we need an
> > organized interrupts subsystem or do we keep an ad hoc approach?
> 
> I know that interrupts are currently used on PowerPC for the PPC4xx
> ethernet driver (emac). This could be reworked to of cause, but I just
> wanted to point this out.
> 
> I have no idea if interrupts are used on any ARM platform though.

For me it looks, like a fundamental decision to support interrupts on
ARM. Do we need them - it's an open question. Does anyone have good use
case for it?

On the other hand I remember that Marek was struggling to introduce new
driver model. It was also a fundamental change and as fair as I know we
don't have it yet finished. 

Anyway it is a good discussion topic :-)


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



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [RFC] [UBOOT] [PATCH 2/4] USB: dwc3: Initial back port of dwc3 code

2013-06-24 Thread Dan Murphy
Ludasz
On 06/24/2013 06:24 AM, Lukasz Majewski wrote:
> Hi Dan,
>
>>  drivers/usb/dwc3/ep0.c| 1085 
>>  drivers/usb/dwc3/gadget.c | 2806
>> +
>> drivers/usb/dwc3/gadget.h |  196 +++
> How does this code map to the one already available
> at ./drivers/usb/gadget ?
Which code specifically are you referring to in the the drivers/usb/gadget?
The dwc3 gadget.c is the plumbing for the dwc to the gadget driver.
> Is there a change to reuse that code?
>
> Is your dwc3 gadget implementation working with composite layer? 
Currently I have only back ported the code for compilation.  I was RFCing to 
get comments
on how the header files will need to be updated and moved in order to 
accommodate the DWC and
host stack.
>


-- 
--
Dan Murphy

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


  1   2   >