Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Minkyu Kang
Dear Marek,

On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
  +int gpio_set_value(unsigned gpio, int value)
  +{
  +       unsigned l = readl(GPIO_FULLPORT(gpio));
  +       unsigned port = GPIO_FULLPORT(gpio);
  +
  +       /*
  +        * All GPIO Port have a configuration on
  +        * 2 bits excepted the first GPIO (A) which
  +        * have only 1 bit of configuration.
  +        */
  +       if (value)
  +               if (!GPIO_PORT(gpio))
  +                       l |= (0x1  GPIO_BIT(gpio));
  +               else
  +                       l |= (0x3  GPIO_BIT(gpio));
  +       else
  +               if (!GPIO_PORT(gpio))
  +                       l = ~(0x1  GPIO_BIT(gpio));
  +               else
  +                       l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)

As I know, it's a rule of u-boot.. maybe. :)

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] Query about Address line test in POST of Uboot

2012-05-02 Thread Bhorania Amit
-- Forwarded message --
From: Bhorania Amit anbhora...@gmail.com
Date: Wed, May 2, 2012 at 11:12 AM
Subject: Query about Address line test in POST of Uboot
To: u-boot@lists.denx.de


Respected Sir,
  I am understanding the code of POST for RAM. In the
comment of Memory.c file for Address line test.It s written that

*In the actual code, we start with address sizeof(ulong) since our test
pattern we use is a ulong and thus, if we tried to test lower order address
bits, it wouldn't work because our pattern would overwrite itself.*

Here if we try to test lower order address bits then why pattern gets
overwritten. I cant understand this. Please Explain me with example.
What happens if we start with value 1 ?

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


Re: [U-Boot] Can't read kernel if bad blocks are present in partition

2012-05-02 Thread Alexandre Gambier

Assuming you load the kernel to ram with tftp (and that AppKernel is
an mtdparts partition in NAND), then you could do:

nand erase.part AppKernel
tftp $load_addr uImage
crc32 $load_addr $filesize
nand write.i $load_addr AppKernel $filesize
nand read.i $load_addr AppKernel $filesize
crc32 $load_addr $filesize

To verify the CRCs match between what you load off tftp and what you
read back from NAND.

Everything works fine now.
I now use nand write.i and nand read.i instead of nand write and 
nand.read.

Does STLinux have a support contact?

This list is for mainline U-Boot.  Have you checked whether these chips
are supported in current mainline U-Boot?

It was just a misunderstanding of u-boot commands.

Thank you guys for your help.


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


Re: [U-Boot] [PATCH 0/4] usb:gadget:composite: Support for composite gadget framework

2012-05-02 Thread Lukasz Majewski
Hi Marek,

 Dear Lukasz Majewski,
 
  This patch set provides support for composite gadget framework.
  Files from Linux kernel (2.6.36) - namely composite.{c|h} have been
  ported.
  
  Some extra compatibility code has been added as well.
  
  Lukasz Majewski (4):
usb:gadget:composite Composite framework - files from Linux kernel
usb:gadget:composite: Linux composite.{h/c} code adjustement for
  u-boot
usb:gadget: Wrapper for extracting usb_gadget from linux's device
usb:gadget: Extend device struct to device_data pointer
 
 I just pushed new u-boot-usb (rebased on current u-boot head), can
 you please rebase your patches ?
 
 Is it correct to assume I can drop the following patches as we'll be
 seeing new revision?
 
 [U-Boot,6/6] usb:g_dnl: Support for g_dnl download usb gadget for
 TRATS board 2012-04-12Łukasz Majewski marex
 Under Review [U-Boot,5/6] usb:g_dnl: Support for g_dnl download usb
 gadget for GONI board 2012-04-12  Łukasz Majewski
 marex Under Review [U-Boot,4/6] usb:command: Support for USB
 Download command  2012-04-12 Łukasz Majewski  marex
   Under Review [U-Boot,3/6] usb:g_dnl:thor: THOR protocol back
 end support for f_usbd_thor function  2012-04-12
 Łukasz Majewski   marex   Under Review [U-Boot,2/6]
 usb:g_dnl:f_usbd_thor: USB Download function to support THOR protocol
   2012-04-12  Łukasz Majewski marex
 Under Review [U-Boot,1/6] usb:composite:g_dnl: Composite gadget
 (g_dnl) for USB downloading functions 2012-04-12
 Łukasz Majewski   marex   Under Review [U-Boot]
 usb:udc:samsung Add functions for storing private gadget data in UDC
 driver2012-04-12  Łukasz Majewski marex
   Under Review [U-Boot,4/4] usb:gadget: Extend device struct to
 device_data pointer 2012-04-12Łukasz Majewski marex
   Under Review [U-Boot,3/4] usb:gadget: Wrapper for extracting
 usb_gadget from linux's device 2012-04-12 Łukasz Majewski
   marex   Under Review [U-Boot,2/4] usb:gadget:composite:
 Linux composite.{h/c} code adjustement for u- boot2012-04-12
   Łukasz Majewski marex   Under Review
 [U-Boot,1/4] usb:gadget:composite Composite framework - files from
 Linux kernel 2012-04-12   Łukasz Majewski marex
 Under Review [U-Boot] usb:udc: Remove duplicated USB definitions from
 include/linux/usb/ch9.h file  2012-04-12  Łukasz
 Majewski  marex   Under Review
 

It is a little bit messy with so many patches flying around :-)

To make it a bit clear:

It is possible to apply following patches to u-boot-usb/next branch (or
u-boot-usb/master which are the same) on denx.de (in this order):

http://patchwork.ozlabs.org/patch/151983/
http://patchwork.ozlabs.org/patch/153532/
http://patchwork.ozlabs.org/patch/153533/


Please apply above patches to usb next/master branch.

Moreover the following patch

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

was criticized by Wolfgang for the DEBUG_SETUP( macro.

You can pull it to the next/master and I will make the patch for UDC to
remove those macros, or I will prepare the UDC patch and then resend
this one.

The first solution is more convenient for me, but it is up to You how we
will proceed.

Other patches can be dropped (for now).

-- 
Best regards,

Lukasz Majewski

Samsung Poland RD Center | Linux Platform Group
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] U-boot Required

2012-05-02 Thread Amber and Sarosh

 Hi

Can somebody mail us the u-boot files for these PR1 Appliances? ;

Appliance with 2xMT48LC32M8A2P-75 i.e. 64MB SDRAM

Appliance with 2xhy57v56820bt-h 



The one available on the switchfin site i.e. u-boot-pr1-ub2.30 is only for 
Appliance with 2xMT48LC64M8A2P-75 i.e. 128 MB SDRAM and is not working 
with other devices mentioned above. 



Waiting for your response.

 

Regards

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


Re: [U-Boot] [PATCH v2] TRATS: initialize panel_info data structure in board file

2012-05-02 Thread Minkyu Kang
On 26 April 2012 16:59, Anatolij Gustschin ag...@denx.de wrote:
 Hi,

 On Thu, 26 Apr 2012 08:29:39 +0900
 Donghwa Lee dh09@samsung.com wrote:

 panel_info data structure is gloable variable, so, I have initialized it
 in board file. If it is initialized in init_panel_info() like existing,
 it can't be used in drv_lcd_init() in common/lcd.c because
 init_panel_info() is called after drv_lcd_init().

 change of v1:
  - I had made a mistake that must do not included variables of vidinfo_t
 data structure was included in the file. So, I removed it.

 Signed-off-by: Donghwa Lee dh09@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  board/samsung/trats/trats.c |   71 
 ++-
  drivers/video/exynos_fb.c   |    3 --
  2 files changed, 36 insertions(+), 38 deletions(-)

 Acked-by: Anatolij Gustschin ag...@denx.de


applied to u-boot-samsung.

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Exynos: fix cpuinfo and cpu detecting

2012-05-02 Thread Minkyu Kang
On 26 April 2012 16:55, Minkyu Kang mk7.k...@samsung.com wrote:
 Since Exynos architecture have new SoCs,
 need to fix cpuinfo correctly.

 Signed-off-by: Minkyu Kang mk7.k...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Tested-by: Jaehoon Chung jh80.ch...@samsung.com
 Cc: Chander Kashyap chander.kash...@linaro.org
 ---
  arch/arm/cpu/armv7/s5p-common/cpu_info.c |    5 ++-
  arch/arm/include/asm/arch-exynos/cpu.h   |   42 
 --
  arch/arm/include/asm/arch-s5pc1xx/cpu.h  |    6 
  3 files changed, 37 insertions(+), 16 deletions(-)


applied to u-boot-samsung.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] LCD: support another s6e8ax0 panel type

2012-05-02 Thread Minkyu Kang
On 27 April 2012 13:52, Donghwa Lee dh09@samsung.com wrote:
 s6e8ax0 panel has many panel of types. This patch support another panel
 on TIZEN lunchbox board(HWREVISION 2). This panel has reversed panel
 display type. So, I had added necessary command.

 Signed-off-by: Donghwa Lee dh09@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 ---
  arch/arm/include/asm/arch-exynos/mipi_dsim.h |    1 +
  board/samsung/trats/trats.c                  |    8 
  drivers/video/s6e8ax0.c                      |   17 -
  3 files changed, 25 insertions(+), 1 deletions(-)


Acked-by: Minkyu Kang mk7.k...@samsung.com

-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] powerpc/85xx: fix NAND boot linker scripts for -fpic

2012-05-02 Thread Joakim Tjernlund
Scott Wood scottw...@freescale.com wrote on 2012/05/01 23:45:51:

 GOT is now handled the way the main u-boot.lds does it.  Without this,
 the boot hangs when built with newer GCC (since 4.6).  Older toolchains
 hid the issue by converting -fpic to -fPIC.

 Signed-off-by: Scott Wood scottw...@freescale.com

Loks good

Acked-by: Joakim Tjernlund joakim.tjernl...@transmode.se

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


[U-Boot] [PATCH v3] powerpc/p1022ds: Add sdcard and spi boot support to P1022DS

2012-05-02 Thread Dirk Eibach
Signed-off-by: Dirk Eibach eib...@gdsys.de
Cc: Timur Tabi ti...@freescale.com
---
Changes in v2:
- add Cc
- split up original patch series
Changes in v3:
- use clrsetbits() instead of clrbits()/setbits()
- remove dead code
- remove unnecessary #undef

 board/freescale/p1022ds/p1022ds.c |3 ++
 board/freescale/p1022ds/tlb.c |   10 ++
 boards.cfg|4 ++
 include/configs/P1022DS.h |   56 +---
 4 files changed, 68 insertions(+), 5 deletions(-)

diff --git a/board/freescale/p1022ds/p1022ds.c 
b/board/freescale/p1022ds/p1022ds.c
index 456d9b0..fd4193d 100644
--- a/board/freescale/p1022ds/p1022ds.c
+++ b/board/freescale/p1022ds/p1022ds.c
@@ -37,6 +37,9 @@ int board_early_init_f(void)
 {
ccsr_gur_t *gur = (void *)CONFIG_SYS_MPC85xx_GUTS_ADDR;
 
+   /* Reset eLBC_DIU and SPI_eLBC in case we are booting from SD */
+   clrsetbits_be32(gur-pmuxcr, 0x0060, 0x8000);
+
/* Set pmuxcr to allow both i2c1 and i2c2 */
setbits_be32(gur-pmuxcr, 0x1000);
 
diff --git a/board/freescale/p1022ds/tlb.c b/board/freescale/p1022ds/tlb.c
index e620112..1e9969f 100644
--- a/board/freescale/p1022ds/tlb.c
+++ b/board/freescale/p1022ds/tlb.c
@@ -71,6 +71,16 @@ struct fsl_e_tlb_entry tlb_table[] = {
SET_TLB_ENTRY(1, PIXIS_BASE, PIXIS_BASE_PHYS,
  MAS3_SX|MAS3_SW|MAS3_SR, MAS2_I|MAS2_G,
  0, 7, BOOKE_PAGESZ_4K, 1),
+
+#if defined(CONFIG_SYS_RAMBOOT)
+   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),
+   SET_TLB_ENTRY(1, CONFIG_SYS_DDR_SDRAM_BASE + 0x4000,
+   CONFIG_SYS_DDR_SDRAM_BASE + 0x4000,
+   MAS3_SX|MAS3_SW|MAS3_SR, 0,
+   0, 9, BOOKE_PAGESZ_1G, 1)
+#endif
 };
 
 int num_tlb_entries = ARRAY_SIZE(tlb_table);
diff --git a/boards.cfg b/boards.cfg
index 24c5879..8de4235 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -700,6 +700,10 @@ P1021RDB-PC_SDCARD   powerpc mpc85xx 
p1_p2_rdb_pcfreesca
 P1021RDB-PC_SPIFLASH powerpc mpc85xx p1_p2_rdb_pc
freescale  -   p1_p2_rdb_pc:P1021RDB,SPIFLASH
 P1022DS  powerpc mpc85xx p1022ds 
freescale
 P1022DS_36BITpowerpc mpc85xx p1022ds 
freescale  -   P1022DS:36BIT
+P1022DS_36BIT_SDCARD powerpc mpc85xx p1022ds 
freescale  -   P1022DS:36BIT,SDCARD
+P1022DS_36BIT_SPIFLASH   powerpc mpc85xx p1022ds 
freescale  -   P1022DS:36BIT,SPIFLASH
+P1022DS_SDCARD   powerpc mpc85xx p1022ds 
freescale  -   P1022DS:SDCARD
+P1022DS_SPIFLASH powerpc mpc85xx p1022ds 
freescale  -   P1022DS:SPIFLASH
 P1023RDS powerpc mpc85xx p1023rds
freescale  -   P1023RDS
 P1023RDS_NANDpowerpc mpc85xx p1023rds
freescale  -   P1023RDS:NAND
 P1024RDB powerpc mpc85xx p1_p2_rdb_pc
freescale  -   p1_p2_rdb_pc:P1024RDB
diff --git a/include/configs/P1022DS.h b/include/configs/P1022DS.h
index 70d751d..213c5e3 100644
--- a/include/configs/P1022DS.h
+++ b/include/configs/P1022DS.h
@@ -26,6 +26,18 @@
 #define CONFIG_P1022DS
 #define CONFIG_MP  /* support multiple processors */
 
+#ifdef CONFIG_SDCARD
+#define CONFIG_RAMBOOT_SDCARD  1
+#define CONFIG_SYS_TEXT_BASE   0x1100
+#define CONFIG_RESET_VECTOR_ADDRESS0x1107fffc
+#endif
+
+#ifdef CONFIG_SPIFLASH
+#define CONFIG_RAMBOOT_SPIFLASH1
+#define CONFIG_SYS_TEXT_BASE   0x1100
+#define CONFIG_RESET_VECTOR_ADDRESS0x1107fffc
+#endif
+
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE   0xeff8
 #endif
@@ -54,6 +66,7 @@
 
 #define CONFIG_SYS_CLK_FREQget_board_sys_clk()
 #define CONFIG_DDR_CLK_FREQget_board_ddr_clk()
+
 #define CONFIG_ICS307_REFCLK_HZ3000  /* ICS307 clock chip ref freq 
*/
 
 /*
@@ -138,6 +151,12 @@
 
 #define CONFIG_SYS_MONITOR_BASECONFIG_SYS_TEXT_BASE/* 
start of monitor */
 
+#if defined(CONFIG_RAMBOOT_NAND) || defined(CONFIG_RAMBOOT_SDCARD) || \
+   defined(CONFIG_RAMBOOT_SPIFLASH)
+#define CONFIG_SYS_RAMBOOT
+#define CONFIG_SYS_EXTRA_ENV_RELOC
+#endif
+
 #define CONFIG_FLASH_CFI_DRIVER
 #define CONFIG_SYS_FLASH_CFI
 #define CONFIG_SYS_FLASH_EMPTY_INFO
@@ -403,11 +422,38 @@
 /*
  * Environment
  */
-#define CONFIG_ENV_IS_IN_FLASH
-#define CONFIG_ENV_OVERWRITE
-#define CONFIG_ENV_ADDR(CONFIG_SYS_MONITOR_BASE - 
CONFIG_ENV_SECT_SIZE)
-#define CONFIG_ENV_SIZE0x2000
-#define CONFIG_ENV_SECT_SIZE   0x2
+#if 

[U-Boot] [PATCH] usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond() calls

2012-05-02 Thread Lukasz Majewski
This patch cleans up the Samsung's UDC driver. It replaces several
DEBUG_* macros with debug_cond().

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/usb/gadget/s3c_udc_otg.c  |   39 ++---
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |  287 +
 include/usb/s3c_udc.h |   48 -
 3 files changed, 189 insertions(+), 185 deletions(-)

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 1b589b2..c0bc0ff 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -30,7 +30,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
-#undef DEBUG
+
 #include common.h
 #include asm/errno.h
 #include linux/list.h
@@ -54,19 +54,11 @@
 
 #define OTG_DMA_MODE   1
 
-#undef DEBUG_S3C_UDC_SETUP
-#undef DEBUG_S3C_UDC_EP0
-#undef DEBUG_S3C_UDC_ISR
-#undef DEBUG_S3C_UDC_OUT_EP
-#undef DEBUG_S3C_UDC_IN_EP
-#undef DEBUG_S3C_UDC
-
-/* #define DEBUG_S3C_UDC_SETUP */
-/* #define DEBUG_S3C_UDC_EP0 */
-/* #define DEBUG_S3C_UDC_ISR */
-/* #define DEBUG_S3C_UDC_OUT_EP */
-/* #define DEBUG_S3C_UDC_IN_EP */
-/* #define DEBUG_S3C_UDC */
+#define DEBUG_SETUP 0
+#define DEBUG_EP0 0
+#define DEBUG_ISR 0
+#define DEBUG_OUT_EP 0
+#define DEBUG_IN_EP 0
 
 #include usb/s3c_udc.h
 
@@ -229,7 +221,7 @@ void otg_phy_off(struct s3c_udc *dev)
  */
 static void udc_disable(struct s3c_udc *dev)
 {
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
udc_set_address(dev, 0);
 
@@ -247,7 +239,7 @@ static void udc_reinit(struct s3c_udc *dev)
 {
unsigned int i;
 
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
/* device/ep0 records init */
INIT_LIST_HEAD(dev-gadget.ep_list);
@@ -278,12 +270,13 @@ static void udc_reinit(struct s3c_udc *dev)
  */
 static int udc_enable(struct s3c_udc *dev)
 {
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
otg_phy_init(dev);
reconfig_usbd();
 
-   DEBUG_SETUP(S3C USB 2.0 OTG Controller Core Initialized : 0x%x\n,
+   debug_cond(DEBUG_SETUP != 0,
+  S3C USB 2.0 OTG Controller Core Initialized : 0x%x\n,
readl(reg-gintmsk));
 
dev-gadget.speed = USB_SPEED_UNKNOWN;
@@ -300,7 +293,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
int retval = 0;
unsigned long flags;
 
-   DEBUG_SETUP(%s: %s\n, __func__, no name);
+   debug_cond(DEBUG_SETUP != 0, %s: %s\n, __func__, no name);
 
if (!driver
|| (driver-speed != USB_SPEED_FULL
@@ -324,7 +317,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
 
retval = driver-bind(dev-gadget);
if (retval) {
-   DEBUG_SETUP(%s: bind to driver -- error %d\n,
+   debug_cond(DEBUG_SETUP != 0,
+  %s: bind to driver -- error %d\n,
dev-gadget.name, retval);
dev-driver = 0;
return retval;
@@ -332,7 +326,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
 
enable_irq(IRQ_OTG);
 
-   DEBUG_SETUP(Registered gadget driver %s\n, dev-gadget.name);
+   debug_cond(DEBUG_SETUP != 0,
+  Registered gadget driver %s\n, dev-gadget.name);
udc_enable(dev);
 
return 0;
@@ -390,7 +385,7 @@ static void done(struct s3c_ep *ep, struct s3c_request 
*req, int status)
/* don't modify queue heads during completion callback */
ep-stopped = 1;
 
-#ifdef DEBUG_S3C_UDC
+#ifdef DEBUG
printf(calling complete callback\n);
{
int i, len = req-req.length;
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c 
b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
index afd4931..baac563 100644
--- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
@@ -53,7 +53,7 @@ static inline void s3c_udc_ep0_zlp(struct s3c_udc *dev)
writel(ep_ctrl|DEPCTL_EPENA|DEPCTL_CNAK,
   reg-in_endp[EP0_CON].diepctl);
 
-   DEBUG_EP0(%s:EP0 ZLP DIEPCTL0 = 0x%x\n,
+   debug_cond(DEBUG_EP0 != 0, %s:EP0 ZLP DIEPCTL0 = 0x%x\n,
__func__, readl(reg-in_endp[EP0_CON].diepctl));
dev-ep0state = WAIT_FOR_IN_COMPLETE;
 }
@@ -62,7 +62,8 @@ void s3c_udc_pre_setup(void)
 {
u32 ep_ctrl;
 
-   debug_cond(DEBUG_IN_EP, %s : Prepare Setup packets.\n, __func__);
+   debug_cond(DEBUG_IN_EP,
+  %s : Prepare Setup packets.\n, __func__);
 
invalidate_dcache_range((unsigned long) usb_ctrl_dma_addr,
(unsigned long) usb_ctrl_dma_addr
@@ -75,9 +76,9 @@ void s3c_udc_pre_setup(void)
 

[U-Boot] [PATCH] powerpc/p1010rdb: add readme document for p1010rdb

2012-05-02 Thread Shengzhou Liu
Signed-off-by: Shengzhou Liu shengzhou@freescale.com
---
 doc/README.p1010rdb |  138 +++
 1 files changed, 138 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.p1010rdb

diff --git a/doc/README.p1010rdb b/doc/README.p1010rdb
new file mode 100644
index 000..78b1dee
--- /dev/null
+++ b/doc/README.p1010rdb
@@ -0,0 +1,138 @@
+Overview
+=
+The P1010RDB is a Freescale reference design board that hosts the P1010 SoC.
+
+The P1010 is a cost-effective, low-power, highly integrated host processor
+based on a Power Architecture e500v2 core (maximum core frequency 800/1000 
MHz),
+that addresses the requirements of several routing, gateways, storage, 
consumer,
+and industrial applications. Applications of interest include the main CPUs and
+I/O processors in network attached storage (NAS), the voice over IP (VoIP)
+router/gateway, and wireless LAN (WLAN) and industrial controllers.
+
+The P1010RDB board features are as follows:
+Memory subsystem:
+   — 1Gbyte unbuffered DDR3 SDRAM discrete devices (32-bit bus)
+   — 32 Mbyte NOR flash single-chip memory
+   — 32 Mbyte NAND flash memory
+   — 256 Kbit M24256 I2C EEPROM
+   — 16 Mbyte SPI memory
+   — I2C Board EEPROM 128x8 bit memory
+   — SD/MMC connector to interface with the SD memory card
+Interfaces:
+   — PCIe:
+   – Lane0: x1 mini-PCIe slot
+   – Lane1: x1 PCIe standard slot
+   — SATA:
+   – 1 internal SATA connector to 2.5” 160G SATA2 HDD
+   – 1 eSATA connector to rear panel
+   — 10/100/1000 BaseT Ethernet ports:
+   – eTSEC1, RGMII: one 10/100/1000 port using Vitesse VSC8641XKO
+   – eTSEC2, SGMII: one 10/100/1000 port using Vitesse VSC8221
+   – eTSEC3, SGMII: one 10/100/1000 port using Vitesse VSC8221
+   — USB 2.0 port:
+   – x1 USB2.0 port: via an ULPI PHY to micro-AB connector
+   – x1 USB2.0 poort via an internal PHY to micro-AB connector
+   — FlexCAN ports:
+   – x2 DB-9 female connectors for FlexCAN bus(revision 2.0B)
+  interface;
+   — DUART interface:
+   – DUART interface: supports two UARTs up to 115200 bps for
+  console display
+   – RJ45 connectors are used for these 2 UART ports.
+   — TDM
+   – 2 FXS ports connected via an external SLIC to the TDM
+  interface. SLIC is controllled via SPI.
+   – 1 FXO port connected via a relay to FXS for switchover to
+  POTS
+Board connectors:
+   — Mini-ITX power supply connector
+   — JTAG/COP for debugging
+IEEE Std. 1588 signals for test and measurement
+Real-time clock on I2C bus
+POR
+   — support critical POR setting changed via switch on board
+PCB
+   — 6-layer routing (4-layer signals, 2-layer power and ground)
+
+
+
+Settings of DIP-switch
+==
+  SW4[1:4]=  and SW6[4]=0 for boot from 16bit NOR flash
+  SW4[1:4]= 1000 and SW6[4]=1 for boot from 8bit NAND flash
+  SW4[1:4]= 0110 and SW6[4]=0 for boot from SPI flash
+Note: 1 stands for 'on', 0 stands for 'off'
+
+Please refer to P1010-RDB User Guide for details.
+
+
+Setting of hwconfig
+===
+If FlexCAN or TDM is needed, please set fsl_p1010mux:tdm_can=can or
+fsl_p1010mux:tdm_can=tdm explicitly in u-booot prompt as below for example:
+setenv hwconfig fsl_p1010mux:tdm_can=tdm;usb1:dr_mode=host,phy_type=utmi
+By default, don't set fsl_p1010mux:tdm_can, in this case, spi chip selection
+is set to spi-flash instead of to SLIC/TDM/DAC and tdm_can_sel is set to TDM
+instead of to CAN/UART1.
+
+
+Build and burn u-boot to NOR flash
+===
+1. Build u-boot.bin image
+   export ARCH=powerpc
+   export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
+   make P1010RDB_NOR
+
+2. Burn u-boot.bin into NOR flash
+   = tftp $loadaddr $uboot
+   = protect off eff8 +$filesize
+   = erase eff8 +$filesize
+   = cp.b $loadaddr eff8 $filesize
+
+3. Check SW4[1:4]=  and SW6[4]=0, then power on.
+
+
+
+Build and burn u-boot to NAND flash
+
+1. Build u-boot.bin image
+   export ARCH=powerpc
+   export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
+   make P1010RDB_NAND
+
+2. Burn u-boot-nand.bin into NAND flash
+   = tftp $loadaddr $uboot-nand
+   = nand erase 0 $filesize
+   = nand write $loadaddr 0 $filesize
+
+3. Check SW4[1:4]= 1000 and SW6[4]=1, then power on.
+
+
+
+Build and burn u-boot to SPI flash
+===
+1. Build u-boot-spi.bin image
+   make P1010RDB_SPIFLASH_config; make
+   Boot up kernel with rootfs.ext2.gz.uboot.p1010rdb
+   Download u-boot.bin to linux and you can find some config files
+   

Re: [U-Boot] [PATCH 0/4] usb:gadget:composite: Support for composite gadget framework

2012-05-02 Thread Marek Vasut
Dear Lukasz Majewski,

 Hi Marek,
 
  Dear Lukasz Majewski,
  
   This patch set provides support for composite gadget framework.
   Files from Linux kernel (2.6.36) - namely composite.{c|h} have been
   ported.
   
   Some extra compatibility code has been added as well.
   
   Lukasz Majewski (4):
 usb:gadget:composite Composite framework - files from Linux kernel
 usb:gadget:composite: Linux composite.{h/c} code adjustement for
 
   u-boot
 
 usb:gadget: Wrapper for extracting usb_gadget from linux's device
 usb:gadget: Extend device struct to device_data pointer
  
  I just pushed new u-boot-usb (rebased on current u-boot head), can
  you please rebase your patches ?
  
  Is it correct to assume I can drop the following patches as we'll be
  seeing new revision?
  
  [U-Boot,6/6] usb:g_dnl: Support for g_dnl download usb gadget for
  TRATS board 2012-04-12  Łukasz Majewski marex
  Under Review [U-Boot,5/6] usb:g_dnl: Support for g_dnl download usb
  gadget for GONI board 2012-04-12Łukasz Majewski
  marex   Under Review [U-Boot,4/6] usb:command: Support for USB
  Download command2012-04-12 Łukasz Majewski  marex
  
  Under Review [U-Boot,3/6] usb:g_dnl:thor: THOR protocol back
  
  end support for f_usbd_thor function2012-04-12
  Łukasz Majewski marex   Under Review [U-Boot,2/6]
  usb:g_dnl:f_usbd_thor: USB Download function to support THOR protocol
  
  2012-04-12  Łukasz Majewski marex
  
  Under Review [U-Boot,1/6] usb:composite:g_dnl: Composite gadget
  (g_dnl) for USB downloading functions   2012-04-12
  Łukasz Majewski marex   Under Review [U-Boot]
  usb:udc:samsung Add functions for storing private gadget data in UDC
  driver  2012-04-12  Łukasz Majewski marex
  
  Under Review [U-Boot,4/4] usb:gadget: Extend device struct to
  
  device_data pointer 2012-04-12  Łukasz Majewski marex
  
  Under Review [U-Boot,3/4] usb:gadget: Wrapper for extracting
  
  usb_gadget from linux's device 2012-04-12   Łukasz Majewski
  
  marex   Under Review [U-Boot,2/4] usb:gadget:composite:
  Linux composite.{h/c} code adjustement for u- boot  2012-04-12
  
  Łukasz Majewski marex   Under Review
  
  [U-Boot,1/4] usb:gadget:composite Composite framework - files from
  Linux kernel 2012-04-12 Łukasz Majewski marex
  Under Review [U-Boot] usb:udc: Remove duplicated USB definitions from
  include/linux/usb/ch9.h file2012-04-12  Łukasz
  Majewskimarex   Under Review
 
 It is a little bit messy with so many patches flying around :-)
 
 To make it a bit clear:
 
 It is possible to apply following patches to u-boot-usb/next branch (or
 u-boot-usb/master which are the same) on denx.de (in this order):
 
 http://patchwork.ozlabs.org/patch/151983/
 http://patchwork.ozlabs.org/patch/153532/
 http://patchwork.ozlabs.org/patch/153533/

Thanks for clearing this up, can you please rebase them? I think they don't 
apply :(

 
 
 Please apply above patches to usb next/master branch.
 
 Moreover the following patch
 
 http://patchwork.ozlabs.org/patch/153531/
 
 was criticized by Wolfgang for the DEBUG_SETUP( macro.
 
 You can pull it to the next/master and I will make the patch for UDC to
 remove those macros, or I will prepare the UDC patch and then resend
 this one.
 
 The first solution is more convenient for me, but it is up to You how we
 will proceed.
 
 Other patches can be dropped (for now).
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] rename EB+MCF-EV123 to its current marketing name EB+CPU5282

2012-05-02 Thread Jens Scharsig (BuS Elektronik)
From: Jens Scharsig js_at...@scharsoft.de

* rename board directory to eb_cpu5282
* rename EB+MCF-EV123_.*config to eb_cpu5282_.*config
* add Maintainer for EB+CPU5282 board
* rename prompt

Signed-off-by: Jens Scharsig (BuS Elektronik) e...@bus-elektronik.de
---
 MAINTAINERS|4 
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/Makefile|0
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/cfm_flash.c |0
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/cfm_flash.h |0
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/config.mk   |0
 .../EB+MCF-EV123.c = eb_cpu5282/eb_cpu5282.c} |0
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/flash.c |0
 board/BuS/{EB+MCF-EV123 = eb_cpu5282}/u-boot.lds  |0
 boards.cfg |4 ++--
 include/configs/{EB+MCF-EV123.h = eb_cpu5282.h}   |9 -
 10 files changed, 10 insertions(+), 7 deletions(-)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/Makefile (100%)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/cfm_flash.c (100%)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/cfm_flash.h (100%)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/config.mk (100%)
 rename board/BuS/{EB+MCF-EV123/EB+MCF-EV123.c = eb_cpu5282/eb_cpu5282.c} 
(100%)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/flash.c (100%)
 rename board/BuS/{EB+MCF-EV123 = eb_cpu5282}/u-boot.lds (100%)
 rename include/configs/{EB+MCF-EV123.h = eb_cpu5282.h} (97%)

diff --git a/MAINTAINERS b/MAINTAINERS
index 708ded7..ace42de 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1022,6 +1022,10 @@ Matthias Fuchs matthias.fu...@esd-electronics.com
 
TASREG  MCF5249
 
+Jens Scharsig e...@bus-elektronik.de
+
+   eb_cpu5282  mfc5282
+
 TsiChung Liew tsi-chung.l...@freescale.com
 
M52277EVB   mcf5227x
diff --git a/board/BuS/EB+MCF-EV123/Makefile b/board/BuS/eb_cpu5282/Makefile
similarity index 100%
rename from board/BuS/EB+MCF-EV123/Makefile
rename to board/BuS/eb_cpu5282/Makefile
diff --git a/board/BuS/EB+MCF-EV123/cfm_flash.c 
b/board/BuS/eb_cpu5282/cfm_flash.c
similarity index 100%
rename from board/BuS/EB+MCF-EV123/cfm_flash.c
rename to board/BuS/eb_cpu5282/cfm_flash.c
diff --git a/board/BuS/EB+MCF-EV123/cfm_flash.h 
b/board/BuS/eb_cpu5282/cfm_flash.h
similarity index 100%
rename from board/BuS/EB+MCF-EV123/cfm_flash.h
rename to board/BuS/eb_cpu5282/cfm_flash.h
diff --git a/board/BuS/EB+MCF-EV123/config.mk b/board/BuS/eb_cpu5282/config.mk
similarity index 100%
rename from board/BuS/EB+MCF-EV123/config.mk
rename to board/BuS/eb_cpu5282/config.mk
diff --git a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c 
b/board/BuS/eb_cpu5282/eb_cpu5282.c
similarity index 100%
rename from board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
rename to board/BuS/eb_cpu5282/eb_cpu5282.c
diff --git a/board/BuS/EB+MCF-EV123/flash.c b/board/BuS/eb_cpu5282/flash.c
similarity index 100%
rename from board/BuS/EB+MCF-EV123/flash.c
rename to board/BuS/eb_cpu5282/flash.c
diff --git a/board/BuS/EB+MCF-EV123/u-boot.lds b/board/BuS/eb_cpu5282/u-boot.lds
similarity index 100%
rename from board/BuS/EB+MCF-EV123/u-boot.lds
rename to board/BuS/eb_cpu5282/u-boot.lds
diff --git a/boards.cfg b/boards.cfg
index 3cf75c3..e510406 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -304,8 +304,8 @@ M5235EVB m68kmcf523x 
m5235evbfreesca
 M5235EVB_Flash32 m68kmcf523x m5235evb
freescale  -   M5235EVB:NORFLASH_PS32BIT,SYS_TEXT_BASE=0xFFC0
 cobra5272m68kmcf52x2 cobra5272   -
 idmr m68kmcf52x2
-EB-MCF-EV123 m68kmcf52x2 EB+MCF-EV123BuS   
 -   EB+MCF-EV123:SYS_TEXT_BASE=0xFFE0
-EB-MCF-EV123_internalm68kmcf52x2 EB+MCF-EV123BuS   
 -   EB+MCF-EV123:SYS_TEXT_BASE=0xF000
+eb_cpu5282   m68kmcf52x2 eb_cpu5282  BuS   
 -   eb_cpu5282:SYS_TEXT_BASE=0xFFE0
+eb_cpu5282_internal  m68kmcf52x2 eb_cpu5282  BuS   
 -   eb_cpu5282:SYS_TEXT_BASE=0xF000
 TASREG   m68kmcf52x2 tasreg  esd
 M5208EVBEm68kmcf52x2 m5208evbe   
freescale
 M5249EVB m68kmcf52x2 m5249evb
freescale
diff --git a/include/configs/EB+MCF-EV123.h b/include/configs/eb_cpu5282.h
similarity index 97%
rename from include/configs/EB+MCF-EV123.h
rename to include/configs/eb_cpu5282.h
index 346b49c..ef9849d 100644
--- a/include/configs/EB+MCF-EV123.h
+++ b/include/configs/eb_cpu5282.h
@@ -1,5 +1,5 @@
 /*
- * Configuation settings for the BuS EB+MCF-EV123 boards.
+ * Configuation settings for the BuS EB+CPU5283 boards (aka EB+MCF-EV123)
  *
  * (C) Copyright 2005-2009 BuS Elektronik GmbH  Co.KG e...@bus-elektonik.de
  *
@@ -22,8 +22,8 @@
  * MA 02111-1307 USA
  */
 

[U-Boot] [RESEND PATCH 1/5] usb:udc: Remove duplicated USB definitions from include/linux/usb/ch9.h file

2012-05-02 Thread Lukasz Majewski
Remove the repeated USB descriptor code and use usbdescriptors.h file.
ch9.h file has been copied from linux and is needed for USB gadget
related work.
Now usbdescriptors.h and ch9.h shall be used together.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/usb/gadget/config.c  |1 +
 drivers/usb/gadget/epautoconf.c  |1 +
 drivers/usb/gadget/ether.c   |1 +
 drivers/usb/gadget/s3c_udc_otg.c |1 +
 drivers/usb/gadget/usbstring.c   |1 +
 include/linux/usb/ch9.h  |   67 --
 include/usb/s3c_udc.h|1 +
 7 files changed, 6 insertions(+), 67 deletions(-)

diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
index f9163a8..f88d0c1 100644
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -27,6 +27,7 @@
 #include linux/string.h
 
 #include linux/usb/ch9.h
+#include usbdescriptors.h
 #include linux/usb/gadget.h
 
 
diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c
index 5b8776e..b656c8b 100644
--- a/drivers/usb/gadget/epautoconf.c
+++ b/drivers/usb/gadget/epautoconf.c
@@ -23,6 +23,7 @@
 
 #include common.h
 #include linux/usb/ch9.h
+#include usbdescriptors.h
 #include asm/errno.h
 #include linux/usb/gadget.h
 #include asm/unaligned.h
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 9fb0e80..f693fea 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -24,6 +24,7 @@
 #include asm/errno.h
 #include linux/netdevice.h
 #include linux/usb/ch9.h
+#include usbdescriptors.h
 #include linux/usb/cdc.h
 #include linux/usb/gadget.h
 #include net.h
diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 1050a98..f7f7b54 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -37,6 +37,7 @@
 #include malloc.h
 
 #include linux/usb/ch9.h
+#include usbdescriptors.h
 #include linux/usb/gadget.h
 
 #include asm/byteorder.h
diff --git a/drivers/usb/gadget/usbstring.c b/drivers/usb/gadget/usbstring.c
index 9cf..4dbe060 100644
--- a/drivers/usb/gadget/usbstring.c
+++ b/drivers/usb/gadget/usbstring.c
@@ -13,6 +13,7 @@
 #include common.h
 #include asm/errno.h
 #include linux/usb/ch9.h
+#include usbdescriptors.h
 #include linux/usb/gadget.h
 
 #include asm/unaligned.h
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 49b7483..ce1d1e1 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -204,28 +204,6 @@ struct usb_descriptor_header {
__u8  bDescriptorType;
 } __attribute__ ((packed));
 
-
-/*-*/
-
-/* USB_DT_DEVICE: Device descriptor */
-struct usb_device_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __le16 bcdUSB;
-   __u8  bDeviceClass;
-   __u8  bDeviceSubClass;
-   __u8  bDeviceProtocol;
-   __u8  bMaxPacketSize0;
-   __le16 idVendor;
-   __le16 idProduct;
-   __le16 bcdDevice;
-   __u8  iManufacturer;
-   __u8  iProduct;
-   __u8  iSerialNumber;
-   __u8  bNumConfigurations;
-} __attribute__ ((packed));
-
 #define USB_DT_DEVICE_SIZE 18
 
 
@@ -282,56 +260,11 @@ struct usb_config_descriptor {
 #define USB_CONFIG_ATT_WAKEUP  (1  5)/* can wakeup */
 #define USB_CONFIG_ATT_BATTERY (1  4)/* battery powered */
 
-/*-*/
-
-/* USB_DT_STRING: String descriptor */
-struct usb_string_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __le16 wData[1];/* UTF-16LE encoded */
-} __attribute__ ((packed));
-
 /* note that string zero is special, it holds language codes that
  * the device supports, not Unicode characters.
  */
 
-/*-*/
-
-/* USB_DT_INTERFACE: Interface descriptor */
-struct usb_interface_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __u8  bInterfaceNumber;
-   __u8  bAlternateSetting;
-   __u8  bNumEndpoints;
-   __u8  bInterfaceClass;
-   __u8  bInterfaceSubClass;
-   __u8  bInterfaceProtocol;
-   __u8  iInterface;
-} __attribute__ ((packed));
-
 #define USB_DT_INTERFACE_SIZE  9
-
-/*-*/
-
-/* USB_DT_ENDPOINT: Endpoint descriptor */
-struct usb_endpoint_descriptor {
-   __u8  bLength;
-   __u8  bDescriptorType;
-
-   __u8  bEndpointAddress;
-   __u8  bmAttributes;
-   __le16 wMaxPacketSize;
-   __u8  bInterval;
-
-   /* NOTE:  these two are _only_ in audio endpoints. */
-   /* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
-   __u8  bRefresh;
-   __u8  bSynchAddress;
-} 

[U-Boot] [RESEND PATCH 2/5] usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond() calls

2012-05-02 Thread Lukasz Majewski
This patch cleans up the Samsung's UDC driver. It replaces several
DEBUG_* macros with debug_cond().

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/usb/gadget/s3c_udc_otg.c  |   37 ++--
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |  287 +
 include/usb/s3c_udc.h |   48 -
 3 files changed, 188 insertions(+), 184 deletions(-)

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index f7f7b54..24ff346 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -54,19 +54,11 @@
 
 #define OTG_DMA_MODE   1
 
-#undef DEBUG_S3C_UDC_SETUP
-#undef DEBUG_S3C_UDC_EP0
-#undef DEBUG_S3C_UDC_ISR
-#undef DEBUG_S3C_UDC_OUT_EP
-#undef DEBUG_S3C_UDC_IN_EP
-#undef DEBUG_S3C_UDC
-
-/* #define DEBUG_S3C_UDC_SETUP */
-/* #define DEBUG_S3C_UDC_EP0 */
-/* #define DEBUG_S3C_UDC_ISR */
-/* #define DEBUG_S3C_UDC_OUT_EP */
-/* #define DEBUG_S3C_UDC_IN_EP */
-/* #define DEBUG_S3C_UDC */
+#define DEBUG_SETUP 0
+#define DEBUG_EP0 0
+#define DEBUG_ISR 0
+#define DEBUG_OUT_EP 0
+#define DEBUG_IN_EP 0
 
 #include usb/s3c_udc.h
 
@@ -217,7 +209,7 @@ void otg_phy_off(struct s3c_udc *dev)
  */
 static void udc_disable(struct s3c_udc *dev)
 {
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
udc_set_address(dev, 0);
 
@@ -235,7 +227,7 @@ static void udc_reinit(struct s3c_udc *dev)
 {
unsigned int i;
 
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
/* device/ep0 records init */
INIT_LIST_HEAD(dev-gadget.ep_list);
@@ -266,12 +258,13 @@ static void udc_reinit(struct s3c_udc *dev)
  */
 static int udc_enable(struct s3c_udc *dev)
 {
-   DEBUG_SETUP(%s: %p\n, __func__, dev);
+   debug_cond(DEBUG_SETUP != 0, %s: %p\n, __func__, dev);
 
otg_phy_init(dev);
reconfig_usbd();
 
-   DEBUG_SETUP(S3C USB 2.0 OTG Controller Core Initialized : 0x%x\n,
+   debug_cond(DEBUG_SETUP != 0,
+  S3C USB 2.0 OTG Controller Core Initialized : 0x%x\n,
readl(reg-gintmsk));
 
dev-gadget.speed = USB_SPEED_UNKNOWN;
@@ -288,7 +281,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
int retval = 0;
unsigned long flags;
 
-   DEBUG_SETUP(%s: %s\n, __func__, no name);
+   debug_cond(DEBUG_SETUP != 0, %s: %s\n, __func__, no name);
 
if (!driver
|| (driver-speed != USB_SPEED_FULL
@@ -312,7 +305,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
 
retval = driver-bind(dev-gadget);
if (retval) {
-   DEBUG_SETUP(%s: bind to driver -- error %d\n,
+   debug_cond(DEBUG_SETUP != 0,
+  %s: bind to driver -- error %d\n,
dev-gadget.name, retval);
dev-driver = 0;
return retval;
@@ -320,7 +314,8 @@ int usb_gadget_register_driver(struct usb_gadget_driver 
*driver)
 
enable_irq(IRQ_OTG);
 
-   DEBUG_SETUP(Registered gadget driver %s\n, dev-gadget.name);
+   debug_cond(DEBUG_SETUP != 0,
+  Registered gadget driver %s\n, dev-gadget.name);
udc_enable(dev);
 
return 0;
@@ -378,7 +373,7 @@ static void done(struct s3c_ep *ep, struct s3c_request 
*req, int status)
/* don't modify queue heads during completion callback */
ep-stopped = 1;
 
-#ifdef DEBUG_S3C_UDC
+#ifdef DEBUG
printf(calling complete callback\n);
{
int i, len = req-req.length;
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c 
b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
index afd4931..baac563 100644
--- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
@@ -53,7 +53,7 @@ static inline void s3c_udc_ep0_zlp(struct s3c_udc *dev)
writel(ep_ctrl|DEPCTL_EPENA|DEPCTL_CNAK,
   reg-in_endp[EP0_CON].diepctl);
 
-   DEBUG_EP0(%s:EP0 ZLP DIEPCTL0 = 0x%x\n,
+   debug_cond(DEBUG_EP0 != 0, %s:EP0 ZLP DIEPCTL0 = 0x%x\n,
__func__, readl(reg-in_endp[EP0_CON].diepctl));
dev-ep0state = WAIT_FOR_IN_COMPLETE;
 }
@@ -62,7 +62,8 @@ void s3c_udc_pre_setup(void)
 {
u32 ep_ctrl;
 
-   debug_cond(DEBUG_IN_EP, %s : Prepare Setup packets.\n, __func__);
+   debug_cond(DEBUG_IN_EP,
+  %s : Prepare Setup packets.\n, __func__);
 
invalidate_dcache_range((unsigned long) usb_ctrl_dma_addr,
(unsigned long) usb_ctrl_dma_addr
@@ -75,9 +76,9 @@ void s3c_udc_pre_setup(void)
ep_ctrl = readl(reg-out_endp[EP0_CON].doepctl);
writel(ep_ctrl|DEPCTL_EPENA, reg-out_endp[EP0_CON].doepctl);
 
-   DEBUG_EP0(%s:EP0 ZLP DIEPCTL0 = 0x%x\n,
+   

[U-Boot] [RESEND PATCH 0/5] usb:udc:composite: Samsung's UDC cleanup and composite gadget implementation

2012-05-02 Thread Lukasz Majewski
This patch serie has been created as a combination of several patches previously
sent to u-boot mailing list:

- Duplicated USB code has been removed.
- Samsung's UDC driver has been cleaned up - DEBUG_ macros have been replaced
with debug_cond() calls.
- Version v4. of composite gadget implementation for u-boot.

Those patches have been rebased on top of u-boot-usb/master.

Lukasz Majewski (5):
  usb:udc: Remove duplicated USB definitions from
include/linux/usb/ch9.h file
  usb:udc:samsung:cleanup Replace DEBUG_* macros with debug_cond()
calls
  usb:gadget:composite USB composite gadget support
  usb:gadget:composite: Support for composite at gadget.h
  usb:udc:samsung Add functions for storing private gadget data in UDC
driver

 drivers/usb/gadget/composite.c| 1082 +
 drivers/usb/gadget/config.c   |1 +
 drivers/usb/gadget/epautoconf.c   |1 +
 drivers/usb/gadget/ether.c|1 +
 drivers/usb/gadget/s3c_udc_otg.c  |   53 +-
 drivers/usb/gadget/s3c_udc_otg_xfer_dma.c |  287 +---
 drivers/usb/gadget/usbstring.c|1 +
 include/linux/usb/ch9.h   |   67 --
 include/linux/usb/composite.h |  350 ++
 include/linux/usb/gadget.h|6 +
 include/usb/lin_gadget_compat.h   |   24 +-
 include/usb/s3c_udc.h |   49 +--
 12 files changed, 1668 insertions(+), 254 deletions(-)
 create mode 100644 drivers/usb/gadget/composite.c
 create mode 100644 include/linux/usb/composite.h

-- 
1.7.2.3

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


[U-Boot] [RESEND PATCH 4/5] usb:gadget:composite: Support for composite at gadget.h

2012-05-02 Thread Lukasz Majewski
Add device data pointer to the USB gadget's device struct.
Wrapper for extracting usb_gadget from Linux's usb device

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de

---
Changes for v2:
- Two separate patches regarding gadget.h file squashed together
---
 include/linux/usb/gadget.h |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 275cb5f..eba865e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -411,6 +411,7 @@ struct usb_gadget_ops {
 
 struct device {
void*driver_data;   /* data private to the driver */
+   void*device_data;   /* data private to the device */
 };
 
 /**
@@ -481,6 +482,11 @@ static inline void *get_gadget_data(struct usb_gadget 
*gadget)
return gadget-dev.driver_data;
 }
 
+static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
+{
+   return container_of(dev, struct usb_gadget, dev);
+}
+
 /* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
 #define gadget_for_each_ep(tmp, gadget) \
list_for_each_entry(tmp, (gadget)-ep_list, ep_list)
-- 
1.7.2.3

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


[U-Boot] [RESEND PATCH 5/5] usb:udc:samsung Add functions for storing private gadget data in UDC driver

2012-05-02 Thread Lukasz Majewski
This commit adds support for storing private data to Samsung's UDC
driver. This data is afterward used by usb gadget.

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/usb/gadget/s3c_udc_otg.c |   15 ++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/gadget/s3c_udc_otg.c b/drivers/usb/gadget/s3c_udc_otg.c
index 24ff346..41b738a 100644
--- a/drivers/usb/gadget/s3c_udc_otg.c
+++ b/drivers/usb/gadget/s3c_udc_otg.c
@@ -30,7 +30,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  */
-
+#undef DEBUG
 #include common.h
 #include asm/errno.h
 #include linux/list.h
@@ -125,6 +125,19 @@ static void nuke(struct s3c_ep *ep, int status);
 static int s3c_udc_set_halt(struct usb_ep *_ep, int value);
 static void s3c_udc_set_nak(struct s3c_ep *ep);
 
+void set_udc_gadget_private_data(void *p)
+{
+   debug_cond(DEBUG_SETUP != 0,
+  %s: the_controller: 0x%p, p: 0x%p\n, __func__,
+  the_controller, p);
+   the_controller-gadget.dev.device_data = p;
+}
+
+void *get_udc_gadget_private_data(struct usb_gadget *gadget)
+{
+   return gadget-dev.device_data;
+}
+
 static struct usb_ep_ops s3c_ep_ops = {
.enable = s3c_ep_enable,
.disable = s3c_ep_disable,
-- 
1.7.2.3

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


[U-Boot] [RESEND PATCH 3/5] usb:gadget:composite USB composite gadget support

2012-05-02 Thread Lukasz Majewski
USB Composite gadget implementation for u-boot. It builds on top
of USB UDC drivers.

This commit is based on following files from Linux Kernel v2.6.36:

./include/linux/usb/composite.h
./drivers/usb/gadget/composite.c

SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de

---
Changes for v2:
- Squash the strict kernel files with u-boot compatibility layer.
- Removal of dead/kernel specific code
- Comments corrected according to u-boot coding style
---
 drivers/usb/gadget/composite.c  | 1082 +++
 include/linux/usb/composite.h   |  350 +
 include/usb/lin_gadget_compat.h |   24 +-
 3 files changed, 1454 insertions(+), 2 deletions(-)
 create mode 100644 drivers/usb/gadget/composite.c
 create mode 100644 include/linux/usb/composite.h

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
new file mode 100644
index 000..905077d
--- /dev/null
+++ b/drivers/usb/gadget/composite.c
@@ -0,0 +1,1082 @@
+/*
+ * composite.c - infrastructure for Composite USB Gadgets
+ *
+ * Copyright (C) 2006-2008 David Brownell
+ * U-boot porting: Lukasz Majewski l.majew...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#undef DEBUG
+
+#include linux/bitops.h
+#include linux/usb/composite.h
+
+#define USB_BUFSIZ 4096
+
+static struct usb_composite_driver *composite;
+
+/**
+ * usb_add_function() - add a function to a configuration
+ * @config: the configuration
+ * @function: the function being added
+ * Context: single threaded during gadget setup
+ *
+ * After initialization, each configuration must have one or more
+ * functions added to it.  Adding a function involves calling its @bind()
+ * method to allocate resources such as interface and string identifiers
+ * and endpoints.
+ *
+ * This function returns the value of the function's bind(), which is
+ * zero for success else a negative errno value.
+ */
+int usb_add_function(struct usb_configuration *config,
+   struct usb_function *function)
+{
+   int value = -EINVAL;
+
+   debug(adding '%s'/%p to config '%s'/%p\n,
+   function-name, function,
+   config-label, config);
+
+   if (!function-set_alt || !function-disable)
+   goto done;
+
+   function-config = config;
+   list_add_tail(function-list, config-functions);
+
+   if (function-bind) {
+   value = function-bind(config, function);
+   if (value  0) {
+   list_del(function-list);
+   function-config = NULL;
+   }
+   } else
+   value = 0;
+
+   if (!config-fullspeed  function-descriptors)
+   config-fullspeed = 1;
+   if (!config-highspeed  function-hs_descriptors)
+   config-highspeed = 1;
+
+done:
+   if (value)
+   debug(adding '%s'/%p -- %d\n,
+   function-name, function, value);
+   return value;
+}
+
+/**
+ * usb_function_deactivate - prevent function and gadget enumeration
+ * @function: the function that isn't yet ready to respond
+ *
+ * Blocks response of the gadget driver to host enumeration by
+ * preventing the data line pullup from being activated.  This is
+ * normally called during @bind() processing to change from the
+ * initial ready to respond state, or when a required resource
+ * becomes available.
+ *
+ * For example, drivers that serve as a passthrough to a userspace
+ * daemon can block enumeration unless that daemon (such as an OBEX,
+ * MTP, or print server) is ready to handle host requests.
+ *
+ * Not all systems support software control of their USB peripheral
+ * data pullups.
+ *
+ * Returns zero on success, else negative errno.
+ */
+int usb_function_deactivate(struct usb_function *function)
+{
+   struct usb_composite_dev*cdev = function-config-cdev;
+   int status = 0;
+
+   if (cdev-deactivations == 0)
+   status = usb_gadget_disconnect(cdev-gadget);
+   if (status == 0)
+   cdev-deactivations++;
+
+   return status;
+}
+
+/**
+ * 

Re: [U-Boot] [PATCH] USB: S5P: Add ehci support

2012-05-02 Thread Rajeshwari Birje
Hi Marek Vasut,

Thank you for the comments.

On Wed, May 2, 2012 at 10:00 AM, Marek Vasutma...@denx.de wrote:
 Dear Rajeshwari Shinde,

 This patch adds ehci driver support  for s5p.

It'd be awesome if you CCed me ;-)
Also, it might be worth CCing Lukasz?
-- Will do so.


 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 ---
 arch/arm/include/asm/arch-exynos/ehci-s5p.h |   66 
  drivers/usb/host/Makefile                   |    1 +
  drivers/usb/host/ehci-s5p.c                 |  113
 +++ 3 files changed, 180 insertions(+), 0
 deletions(-)
  create mode 100755 arch/arm/include/asm/arch-exynos/ehci-s5p.h
  create mode 100644 drivers/usb/host/ehci-s5p.c

 diff --git a/arch/arm/include/asm/arch-exynos/ehci-s5p.h
 b/arch/arm/include/asm/arch-exynos/ehci-s5p.h new file mode 100755
 index 000..68feb85
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-exynos/ehci-s5p.h
 @@ -0,0 +1,66 @@
 +/*
 + * SAMSUNG S5P USB HOST EHCI Controller
 + *
 + * Copyright (C) 2012 Samsung Electronics Co.Ltd
 + *   Vivek Gautam gautam.vi...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 + * MA 02110-1301 USA
 + */
 +
 +#ifndef __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
 +#define __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
 +
 +#define CLK_24MHZ            5
 +
 +#define HOST_CTRL0_PHYSWRSTALL                       (1  31)
 +#define HOST_CTRL0_COMMONON_N                        (1  9)
 +#define HOST_CTRL0_SIDDQ                     (1  6)
 +#define HOST_CTRL0_FORCESLEEP                        (1  5)
 +#define HOST_CTRL0_FORCESUSPEND                      (1  4)
 +#define HOST_CTRL0_WORDINTERFACE             (1  3)
 +#define HOST_CTRL0_UTMISWRST                 (1  2)
 +#define HOST_CTRL0_LINKSWRST                 (1  1)
 +#define HOST_CTRL0_PHYSWRST                  (1  0)
 +
 +#define HOST_CTRL0_FSEL_MASK                 (7  16)
 +
 +#define EHCICTRL_ENAINCRXALIGN                       (1  29)
 +#define EHCICTRL_ENAINCR4                    (1  28)
 +#define EHCICTRL_ENAINCR8                    (1  27)
 +#define EHCICTRL_ENAINCR16                   (1  26)
 +
 +/* Register map for PHY control */
 +struct s5p_usb_phy {
 +     unsigned int usbphyctrl0;
 +     unsigned int usbphytune0;
 +     unsigned int reserved1[2];
 +     unsigned int hsicphyctrl1;
 +     unsigned int hsicphytune1;
 +     unsigned int reserved2[2];
 +     unsigned int hsicphyctrl2;
 +     unsigned int hsicphytune2;
 +     unsigned int reserved3[2];
 +     unsigned int ehcictrl;
 +     unsigned int ohcictrl;
 +     unsigned int usbotgsys;
 +     unsigned int reserved4;
 +     unsigned int usbotgtune;
 +};
 +
 +/* Switch on the VBUS power. */
 +int board_usb_vbus_init(void);
 +
 +#endif /* __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__ */
 diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
 index 0d4657e..59c3e57 100644
 --- a/drivers/usb/host/Makefile
 +++ b/drivers/usb/host/Makefile
 @@ -50,6 +50,7 @@ COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o
  COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
  COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
  COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
 +COBJS-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
  COBJS-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
  COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o

 diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
 new file mode 100644
 index 000..ac9f061
 --- /dev/null
 +++ b/drivers/usb/host/ehci-s5p.c
 @@ -0,0 +1,113 @@
 +/*
 + * SAMSUNG S5P USB HOST EHCI Controller
 + *
 + * Copyright (C) 2012 Samsung Electronics Co.Ltd
 + *   Vivek Gautam gautam.vi...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to 

Re: [U-Boot] [PATCH] USB: S5P: Add ehci support

2012-05-02 Thread Marek Vasut
Dear RAJESHWARI S SHINDE,

 Hi Marek,
 
 Thank you for the comments, would modify the code and send V2.

Thank you for your patches and your work, they are what's important here :-)

 Regards,
 Rajeshwari Shinde.
 
 --- Original Message ---
 Sender : Marek Vasutma...@denx.de
 Date : May 02, 2012 06:17 (GMT+09:00)
 Title : Re: [U-Boot] [PATCH] USB: S5P: Add ehci support
 
 Dear Rajeshwari Shinde,
 
  This patch adds ehci driver support  for s5p.
 
 It'd be awesome if you CCed me ;-)
 Also, it might be worth CCing Lukasz?
 
  Signed-off-by: Vivek Gautam
  Signed-off-by: Rajeshwari Shinde
  ---
  
   arch/arm/include/asm/arch-exynos/ehci-s5p.h |   66 
   drivers/usb/host/Makefile   |1 +
   drivers/usb/host/ehci-s5p.c |  113
  
  +++ 3 files changed, 180 insertions(+), 0
  deletions(-)
  
   create mode 100755 arch/arm/include/asm/arch-exynos/ehci-s5p.h
   create mode 100644 drivers/usb/host/ehci-s5p.c
  
  diff --git a/arch/arm/include/asm/arch-exynos/ehci-s5p.h
  b/arch/arm/include/asm/arch-exynos/ehci-s5p.h new file mode 100755
  index 000..68feb85
  --- /dev/null
  +++ b/arch/arm/include/asm/arch-exynos/ehci-s5p.h
  @@ -0,0 +1,66 @@
  +/*
  + * SAMSUNG S5P USB HOST EHCI Controller
  + *
  + * Copyright (C) 2012 Samsung Electronics Co.Ltd
  + * Vivek Gautam
  + *
  + * This program is free software; you can redistribute it and/or
  + * modify it under the terms of the GNU General Public License as
  + * published by the Free Software Foundation; either version 2 of
  + * the License, or (at your option) any later version.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  + * GNU General Public License for more details.
  + *
  + * You should have received a copy of the GNU General Public License
  + * along with this program; if not, write to the Free Software
  + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  + * MA 02110-1301 USA
  + */
  +
  +#ifndef __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
  +#define __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
  +
  +#define CLK_24MHZ 5
  +
  +#define HOST_CTRL0_PHYSWRSTALL (1  31)
  +#define HOST_CTRL0_COMMONON_N (1  9)
  +#define HOST_CTRL0_SIDDQ (1  6)
  +#define HOST_CTRL0_FORCESLEEP (1  5)
  +#define HOST_CTRL0_FORCESUSPEND (1  4)
  +#define HOST_CTRL0_WORDINTERFACE (1  3)
  +#define HOST_CTRL0_UTMISWRST (1  2)
  +#define HOST_CTRL0_LINKSWRST (1  1)
  +#define HOST_CTRL0_PHYSWRST (1  0)
  +
  +#define HOST_CTRL0_FSEL_MASK (7  16)
  +
  +#define EHCICTRL_ENAINCRXALIGN (1  29)
  +#define EHCICTRL_ENAINCR4 (1  28)
  +#define EHCICTRL_ENAINCR8 (1  27)
  +#define EHCICTRL_ENAINCR16 (1  26)
  +
  +/* Register map for PHY control */
  +struct s5p_usb_phy {
  + unsigned int usbphyctrl0;
  + unsigned int usbphytune0;
  + unsigned int reserved1[2];
  + unsigned int hsicphyctrl1;
  + unsigned int hsicphytune1;
  + unsigned int reserved2[2];
  + unsigned int hsicphyctrl2;
  + unsigned int hsicphytune2;
  + unsigned int reserved3[2];
  + unsigned int ehcictrl;
  + unsigned int ohcictrl;
  + unsigned int usbotgsys;
  + unsigned int reserved4;
  + unsigned int usbotgtune;
  +};
  +
  +/* Switch on the VBUS power. */
  +int board_usb_vbus_init(void);
  +
  +#endif /* __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__ */
  diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
  index 0d4657e..59c3e57 100644
  --- a/drivers/usb/host/Makefile
  +++ b/drivers/usb/host/Makefile
  @@ -50,6 +50,7 @@ COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o
  
   COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
   COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
   COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
  
  +COBJS-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
  
   COBJS-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
   COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
  
  diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
  new file mode 100644
  index 000..ac9f061
  --- /dev/null
  +++ b/drivers/usb/host/ehci-s5p.c
  @@ -0,0 +1,113 @@
  +/*
  + * SAMSUNG S5P USB HOST EHCI Controller
  + *
  + * Copyright (C) 2012 Samsung Electronics Co.Ltd
  + * Vivek Gautam
  + *
  + * 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, 

[U-Boot] [PATCH v2] i.MX6: Add ANATOP regulator init

2012-05-02 Thread Dirk Behme
Init the core regulator voltage to 1.2V. This is required for the correct
functioning of the GPU and when the ARM LDO is set to 1.225V. This is a
workaround to fix some memory clock jitter.

Note: This should be but can't be done in the DCD. The bootloader
  prevents access to the ANATOP registers.

Signed-off-by: Dirk Behme dirk.be...@de.bosch.com
CC: Jason Chen b02...@freescale.com
CC: Jason Liu r64...@freescale.com
CC: Ranjani Vaidyanathan ra5...@freescale.com
CC: Stefano Babic sba...@denx.de
CC: Fabio Estevam feste...@gmail.com
---
v2: Rename the function set_vddsoc(mV) and export it as discused in

http://lists.denx.de/pipermail/u-boot/2012-April/122946.html

 arch/arm/cpu/armv7/mx6/soc.c  |   30 +
 arch/arm/include/asm/arch-mx6/sys_proto.h |2 +
 2 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/mx6/soc.c b/arch/arm/cpu/armv7/mx6/soc.c
index 543b2cc..90f2088 100644
--- a/arch/arm/cpu/armv7/mx6/soc.c
+++ b/arch/arm/cpu/armv7/mx6/soc.c
@@ -77,10 +77,40 @@ void init_aips(void)
writel(0x, aips2-opacr4);
 }
 
+/*
+ * Set the VDDSOC
+ *
+ * Mask out the REG_CORE[22:18] bits (REG2_TRIG) and set
+ * them to the specified millivolt level.
+ * Possible values are from 0.725V to 1.450V in steps of
+ * 0.025V (25mV).
+ */
+void set_vddsoc(u32 mv)
+{
+   struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+   u32 val, reg = readl(anatop-reg_core);
+
+   if (mv  725)
+   val = 0x00; /* Power gated off */
+   else if (mv  1450)
+   val = 0x1F; /* Power FET switched full on. No regulation */
+   else
+   val = (mv - 700) / 25;
+
+   /*
+* Mask out the REG_CORE[22:18] bits (REG2_TRIG)
+* and set them to the calculated value (0.7V + val * 0.25V)
+*/
+   reg = (reg  ~(0x1F  18)) | (val  18);
+   writel(reg, anatop-reg_core);
+}
+
 int arch_cpu_init(void)
 {
init_aips();
 
+   set_vddsoc(1200);   /* Set VDDSOC to 1.2V */
+
return 0;
 }
 #endif
diff --git a/arch/arm/include/asm/arch-mx6/sys_proto.h 
b/arch/arm/include/asm/arch-mx6/sys_proto.h
index 668e77a..699e0b0 100644
--- a/arch/arm/include/asm/arch-mx6/sys_proto.h
+++ b/arch/arm/include/asm/arch-mx6/sys_proto.h
@@ -28,6 +28,8 @@
 
 u32 get_cpu_rev(void);
 
+void set_vddsoc(u32 mv);
+
 /*
  * Initializes on-chip ethernet controllers.
  * to override, implement board_eth_init()
-- 
1.7.0.4

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


Re: [U-Boot] [RESEND PATCH 3/5] usb:gadget:composite USB composite gadget support

2012-05-02 Thread Marek Vasut
Dear Lukasz Majewski,

 USB Composite gadget implementation for u-boot. It builds on top
 of USB UDC drivers.
 
 This commit is based on following files from Linux Kernel v2.6.36:

This one still doens't apply -- fails at lin-gadget-compat ... can you rebase 
this particular one? I just pushed u-boot-usb with 1,2,4,5 of your patches

 
 ./include/linux/usb/composite.h
 ./drivers/usb/gadget/composite.c
 
 SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Marek Vasut ma...@denx.de
 
 ---
 Changes for v2:
 - Squash the strict kernel files with u-boot compatibility layer.
 - Removal of dead/kernel specific code
 - Comments corrected according to u-boot coding style
 ---
  drivers/usb/gadget/composite.c  | 1082
 +++ include/linux/usb/composite.h   | 
 350 +
  include/usb/lin_gadget_compat.h |   24 +-
  3 files changed, 1454 insertions(+), 2 deletions(-)
  create mode 100644 drivers/usb/gadget/composite.c
  create mode 100644 include/linux/usb/composite.h
 
 diff --git a/drivers/usb/gadget/composite.c
 b/drivers/usb/gadget/composite.c new file mode 100644
 index 000..905077d
 --- /dev/null
 +++ b/drivers/usb/gadget/composite.c
 @@ -0,0 +1,1082 @@
 +/*
 + * composite.c - infrastructure for Composite USB Gadgets
 + *
 + * Copyright (C) 2006-2008 David Brownell
 + * U-boot porting: Lukasz Majewski l.majew...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
 USA + */
 +#undef DEBUG
 +
 +#include linux/bitops.h
 +#include linux/usb/composite.h
 +
 +#define USB_BUFSIZ   4096
 +
 +static struct usb_composite_driver *composite;
 +
 +/**
 + * usb_add_function() - add a function to a configuration
 + * @config: the configuration
 + * @function: the function being added
 + * Context: single threaded during gadget setup
 + *
 + * After initialization, each configuration must have one or more
 + * functions added to it.  Adding a function involves calling its @bind()
 + * method to allocate resources such as interface and string identifiers
 + * and endpoints.
 + *
 + * This function returns the value of the function's bind(), which is
 + * zero for success else a negative errno value.
 + */
 +int usb_add_function(struct usb_configuration *config,
 + struct usb_function *function)
 +{
 + int value = -EINVAL;
 +
 + debug(adding '%s'/%p to config '%s'/%p\n,
 + function-name, function,
 + config-label, config);
 +
 + if (!function-set_alt || !function-disable)
 + goto done;
 +
 + function-config = config;
 + list_add_tail(function-list, config-functions);
 +
 + if (function-bind) {
 + value = function-bind(config, function);
 + if (value  0) {
 + list_del(function-list);
 + function-config = NULL;
 + }
 + } else
 + value = 0;
 +
 + if (!config-fullspeed  function-descriptors)
 + config-fullspeed = 1;
 + if (!config-highspeed  function-hs_descriptors)
 + config-highspeed = 1;
 +
 +done:
 + if (value)
 + debug(adding '%s'/%p -- %d\n,
 + function-name, function, value);
 + return value;
 +}
 +
 +/**
 + * usb_function_deactivate - prevent function and gadget enumeration
 + * @function: the function that isn't yet ready to respond
 + *
 + * Blocks response of the gadget driver to host enumeration by
 + * preventing the data line pullup from being activated.  This is
 + * normally called during @bind() processing to change from the
 + * initial ready to respond state, or when a required resource
 + * becomes available.
 + *
 + * For example, drivers that serve as a passthrough to a userspace
 + * daemon can block enumeration unless that daemon (such as an OBEX,
 + * MTP, or print server) is ready to handle host requests.
 + *
 + * Not all systems support software control of their USB peripheral
 + * data pullups.
 + *
 + * Returns zero on success, else negative errno.
 + */
 +int usb_function_deactivate(struct usb_function *function)
 +{
 + struct usb_composite_dev*cdev = function-config-cdev;
 + int  

[U-Boot] [PATCH V2] USB: S5P: Add ehci support

2012-05-02 Thread Rajeshwari Shinde
This patch adds ehci driver support for s5p.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/include/asm/arch-exynos/ehci-s5p.h |   66 
 drivers/usb/host/Makefile   |1 +
 drivers/usb/host/ehci-s5p.c |  110 +++
 3 files changed, 177 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/ehci-s5p.h
 create mode 100644 drivers/usb/host/ehci-s5p.c

diff --git a/arch/arm/include/asm/arch-exynos/ehci-s5p.h 
b/arch/arm/include/asm/arch-exynos/ehci-s5p.h
new file mode 100644
index 000..68feb85
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/ehci-s5p.h
@@ -0,0 +1,66 @@
+/*
+ * SAMSUNG S5P USB HOST EHCI Controller
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Vivek Gautam gautam.vi...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#ifndef __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
+#define __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__
+
+#define CLK_24MHZ  5
+
+#define HOST_CTRL0_PHYSWRSTALL (1  31)
+#define HOST_CTRL0_COMMONON_N  (1  9)
+#define HOST_CTRL0_SIDDQ   (1  6)
+#define HOST_CTRL0_FORCESLEEP  (1  5)
+#define HOST_CTRL0_FORCESUSPEND(1  4)
+#define HOST_CTRL0_WORDINTERFACE   (1  3)
+#define HOST_CTRL0_UTMISWRST   (1  2)
+#define HOST_CTRL0_LINKSWRST   (1  1)
+#define HOST_CTRL0_PHYSWRST(1  0)
+
+#define HOST_CTRL0_FSEL_MASK   (7  16)
+
+#define EHCICTRL_ENAINCRXALIGN (1  29)
+#define EHCICTRL_ENAINCR4  (1  28)
+#define EHCICTRL_ENAINCR8  (1  27)
+#define EHCICTRL_ENAINCR16 (1  26)
+
+/* Register map for PHY control */
+struct s5p_usb_phy {
+   unsigned int usbphyctrl0;
+   unsigned int usbphytune0;
+   unsigned int reserved1[2];
+   unsigned int hsicphyctrl1;
+   unsigned int hsicphytune1;
+   unsigned int reserved2[2];
+   unsigned int hsicphyctrl2;
+   unsigned int hsicphytune2;
+   unsigned int reserved3[2];
+   unsigned int ehcictrl;
+   unsigned int ohcictrl;
+   unsigned int usbotgsys;
+   unsigned int reserved4;
+   unsigned int usbotgtune;
+};
+
+/* Switch on the VBUS power. */
+int board_usb_vbus_init(void);
+
+#endif /* __ASM_ARM_ARCH_EXYNOS5_EHCI_S5P_H__ */
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 0d4657e..59c3e57 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
@@ -50,6 +50,7 @@ COBJS-$(CONFIG_USB_EHCI_PPC4XX) += ehci-ppc4xx.o
 COBJS-$(CONFIG_USB_EHCI_IXP4XX) += ehci-ixp.o
 COBJS-$(CONFIG_USB_EHCI_MARVELL) += ehci-marvell.o
 COBJS-$(CONFIG_USB_EHCI_PCI) += ehci-pci.o
+COBJS-$(CONFIG_USB_EHCI_S5P) += ehci-s5p.o
 COBJS-$(CONFIG_USB_EHCI_TEGRA) += ehci-tegra.o
 COBJS-$(CONFIG_USB_EHCI_VCT) += ehci-vct.o
 
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
new file mode 100644
index 000..4dd4ec1
--- /dev/null
+++ b/drivers/usb/host/ehci-s5p.c
@@ -0,0 +1,110 @@
+/*
+ * SAMSUNG S5P USB HOST EHCI Controller
+ *
+ * Copyright (C) 2012 Samsung Electronics Co.Ltd
+ * Vivek Gautam gautam.vi...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301 USA
+ */
+
+#include common.h
+#include usb.h
+#include asm/arch/cpu.h
+#include asm/arch/ehci-s5p.h
+#include ehci.h
+#include ehci-core.h
+
+/* Setup the EHCI host controller. */
+static void setup_usb_phy(struct 

[U-Boot] [PATCH 0/5] exynos5: usb: Enable USB 2.0 support

2012-05-02 Thread Rajeshwari Shinde
This patchset series adds support to enable USB 2.0 on smdk5250.
It includes addition of system and power management registers, 
functions to enable and disable power to the USB host controller.

This patchset is based on:
USB: S5P: Add ehci support.patch
 
Rajeshwari Shinde (5):
  exynos5: Add system register structure
  exynos5: Add structure for PMU register
  exynos5: Add power Enable/Disable for USB-EHCI
  exynos5: usb: Fix incorrect USB base addresses
  exynos5: usb: Enable USB 2.0 on smdk5250

 arch/arm/cpu/armv7/exynos/power.c |   59 +++
 arch/arm/include/asm/arch-exynos/cpu.h|5 +-
 arch/arm/include/asm/arch-exynos/power.h  |  627 +
 arch/arm/include/asm/arch-exynos/sysreg.h |   44 ++
 drivers/usb/host/ehci-s5p.c   |3 +
 include/configs/smdk5250.h|6 +
 6 files changed, 742 insertions(+), 2 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h

-- 
1.7.4.4

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


[U-Boot] [PATCH 1/5] exynos5: Add system register structure

2012-05-02 Thread Rajeshwari Shinde
This patch add structure for SYSREG.

Signed-off-by: Che-Liang Chiou clch...@chromium.org
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
Reviewed-by: Vivek Gautam gautam.vi...@samsung.com
Reviewed-by: Simon Glass s...@chromium.org
---
 arch/arm/include/asm/arch-exynos/sysreg.h |   43 +
 1 files changed, 43 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h

diff --git a/arch/arm/include/asm/arch-exynos/sysreg.h 
b/arch/arm/include/asm/arch-exynos/sysreg.h
new file mode 100644
index 000..aca4b2b
--- /dev/null
+++ b/arch/arm/include/asm/arch-exynos/sysreg.h
@@ -0,0 +1,43 @@
+/*
+ * (C) Copyright 2012 Samsung Electronics
+ * Register map for sysreg
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __EXYNOS5_SYSREG_H__
+#define __EXYNOS5_SYSREG_H__
+
+#ifndef __ASSEMBLY__
+/* sysreg map */
+struct exynos5_sysreg {
+   /* Add registers as and when required */
+   unsigned char   res1[0x214];
+   unsigned intdisp1blk_cfg;
+   unsigned intdispblk_cfg2;
+   unsigned inthdcp_e_fuse_mem_cfg;
+   unsigned intgsclblk_cfg0;
+   unsigned intgsclblk_cfg1;
+   unsigned intispblk_cfg;
+   unsigned intusb20_phy_cfg;
+   unsigned char   res2[0x29c];
+   unsigned intmipi_dphy;
+   unsigned intdptx_phy;
+   unsigned intphyclk_sel;
+};
+#endif
+
+#endif
-- 
1.7.4.4

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


[U-Boot] [PATCH 2/5] exynos5: Add structure for PMU register

2012-05-02 Thread Rajeshwari Shinde
This patch adds power mananagement register structure for exynos5 SoC.

Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/include/asm/arch-exynos/power.h |  622 ++
 1 files changed, 622 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/power.h 
b/arch/arm/include/asm/arch-exynos/power.h
index 6444fd0..4236beb 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -225,6 +225,628 @@ struct exynos4_power {
unsigned intgps_alive_status;
unsigned intgps_alive_option;
 };
+
+struct exynos5_power {
+   unsigned intom_stat;
+   unsigned char   res1[0x18];
+   unsigned intrtc_clko_sel;
+   unsigned intgnss_rtc_out_ctrl;
+   unsigned char   res2[0x1dc];
+   unsigned intcentral_seq_configuration;
+   unsigned intcentral_seq_status;
+   unsigned intcentral_seq_option;
+   unsigned char   res3[0x14];
+   unsigned intseq_transition0;
+   unsigned intseq_transition1;
+   unsigned intseq_transition2;
+   unsigned intseq_transition3;
+   unsigned intseq_transition4;
+   unsigned intseq_transition5;
+   unsigned intseq_transition6;
+   unsigned intseq_transition7;
+   unsigned intcentral_seq_dmc_configuration;
+   unsigned intcentral_seq_dmc_status;
+   unsigned intcentral_seq_dmc_option;
+   unsigned char   res4[0x14];
+   unsigned intseq_dmc_transition0;
+   unsigned intseq_dmc_transition1;
+   unsigned intseq_dmc_transition2;
+   unsigned intseq_dmc_transition3;
+   unsigned intseq_dmc_transition4;
+   unsigned intseq_dmc_transition5;
+   unsigned intseq_dmc_transition6;
+   unsigned intseq_dmc_transition7;
+   unsigned char   res5[0x180];
+   unsigned intswreset;
+   unsigned intrst_stat;
+   unsigned intautomatic_wdt_reset_disable;
+   unsigned intmask_wdt_reset_request;
+   unsigned intmask_wreset_request;
+   unsigned char   res6[0xec];
+   unsigned intreset_sequencer_configuration;
+   unsigned intreset_sequencer_status;
+   unsigned intreset_sequencer_option;
+   unsigned char   res7[0xf4];
+   unsigned intwakeup_stat;
+   unsigned inteint_wakeup_mask;
+   unsigned intwakeup_mask;
+   unsigned intwakeup_interrupt;
+   unsigned char   res8[0x10];
+   unsigned intwakeup_stat_dmc;
+   unsigned inteint_wakeup_mask_dmc;
+   unsigned intwakeup_mask_dmc;
+   unsigned intwakeup_interrupt_dmc;
+   unsigned char   res9[0xd0];
+   unsigned inthdmi_phy_control;
+   unsigned intusbdrd_phy_control;
+   unsigned intusbhost_phy_control;
+   unsigned intefnand_phy_control;
+   unsigned intmipi_phy0_control;
+   unsigned intmipi_phy1_control;
+   unsigned intadc_phy_control;
+   unsigned intmtcadc_phy_control;
+   unsigned intdptx_phy_control;
+   unsigned intsata_phy_control;
+   unsigned char   res10[0xd8];
+   unsigned intinform0;
+   unsigned intinform1;
+   unsigned intinform2;
+   unsigned intinform3;
+   unsigned intsysip_dat0;
+   unsigned intsysip_dat1;
+   unsigned intsysip_dat2;
+   unsigned intsysip_dat3;
+   unsigned char   res11[0xe0];
+   unsigned intpmu_spare0;
+   unsigned intpmu_spare1;
+   unsigned intpmu_spare2;
+   unsigned intpmu_spare3;
+   unsigned char   res12[0x70];
+   unsigned intirom_data_reg0;
+   unsigned intirom_data_reg1;
+   unsigned intirom_data_reg2;
+   unsigned intirom_data_reg3;
+   unsigned char   res13[0x70];
+   unsigned intpmu_debug;
+   unsigned char   res14[0x5fc];
+   unsigned intarm_core0_sys_pwr_reg;
+   unsigned intdis_irq_arm_core0_local_sys_pwr_reg;
+   unsigned intdis_irq_arm_core0_central_sys_pwr_reg;
+   unsigned char   res15[0x4];
+   unsigned intarm_core1_sys_pwr_reg;
+   unsigned intdis_irq_arm_core1_local_sys_pwr_reg;
+   unsigned intdis_irq_arm_core1_central_sys_pwr_reg;
+   unsigned char   res16[0x24];
+   unsigned intfsys_arm_sys_pwr_reg;
+   unsigned intdis_irq_fsys_arm_local_sys_pwr_reg;
+   unsigned intdis_irq_fsys_arm_central_sys_pwr_reg;
+   unsigned char   res17[0x4];
+   unsigned intisp_arm_sys_pwr_reg;
+   unsigned intdis_irq_isp_arm_local_sys_pwr_reg;
+   unsigned intdis_irq_isp_arm_central_sys_pwr_reg;
+   unsigned char   res18[0x24];
+   unsigned intarm_common_sys_pwr_reg;
+   unsigned char   res19[0x3c];
+   unsigned intarm_l2_sys_pwr_reg;
+   unsigned char   res20[0x3c];
+   unsigned 

[U-Boot] [PATCH 3/5] exynos5: Add power Enable/Disable for USB-EHCI

2012-05-02 Thread Rajeshwari Shinde
This patch adds functions to enable/disable the power of USB
host controller for exynos5.

This patch depends on the patch:
USB: S5P: Add ehci support.patch

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Signed-off-by: Che-Liang Chiou clch...@chromium.org
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/cpu/armv7/exynos/power.c |   59 +
 arch/arm/include/asm/arch-exynos/power.h  |5 ++
 arch/arm/include/asm/arch-exynos/sysreg.h |1 +
 drivers/usb/host/ehci-s5p.c   |3 +
 4 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/armv7/exynos/power.c 
b/arch/arm/cpu/armv7/exynos/power.c
index c765304..a943219 100644
--- a/arch/arm/cpu/armv7/exynos/power.c
+++ b/arch/arm/cpu/armv7/exynos/power.c
@@ -24,6 +24,8 @@
 #include common.h
 #include asm/io.h
 #include asm/arch/power.h
+#include asm/arch/cpu.h
+#include asm/arch/sysreg.h
 
 static void exynos4_mipi_phy_control(unsigned int dev_index,
unsigned int enable)
@@ -52,3 +54,60 @@ void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int 
enable)
if (cpu_is_exynos4())
exynos4_mipi_phy_control(dev_index, enable);
 }
+
+void exynos5_ps_hold_setup(void)
+{
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+
+   /* Set PS-Hold high */
+   setbits_le32(power-ps_hold_control, POWER_PS_HOLD_CONTROL_DATA_HIGH);
+}
+
+void exynos5_enable_usb_phy(void)
+{
+   struct exynos5_sysreg *sysreg =
+   (struct exynos5_sysreg *)samsung_get_base_sysreg();
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+   unsigned int phy_cfg;
+
+   /* Setting USB20PHY_CONFIG register to USB 2.0 HOST link */
+   phy_cfg = readl(sysreg-usb20_phy_cfg);
+   if (phy_cfg  USB20_PHY_CFG_EN) {
+   debug(USB 2.0 HOST link already selected\n);
+   } else {
+   phy_cfg |= USB20_PHY_CFG_EN;
+   writel(phy_cfg, sysreg-usb20_phy_cfg);
+   }
+
+   /* Enabling USBHOST_PHY */
+   setbits_le32(power-usbhost_phy_control, POWER_USB_HOST_PHY_CTRL_EN);
+}
+
+void exynos5_disable_usb_phy(void)
+{
+   struct exynos5_power *power =
+   (struct exynos5_power *)samsung_get_base_power();
+
+   /* Disabling USBHost_PHY */
+   clrbits_le32(power-usbhost_phy_control, POWER_USB_HOST_PHY_CTRL_EN);
+}
+
+void ps_hold_setup(void)
+{
+   if (cpu_is_exynos5())
+   exynos5_ps_hold_setup();
+}
+
+void power_enable_usb_phy(void)
+{
+   if (cpu_is_exynos5())
+   exynos5_enable_usb_phy();
+}
+
+void power_disable_usb_phy(void)
+{
+   if (cpu_is_exynos5())
+   exynos5_disable_usb_phy();
+}
diff --git a/arch/arm/include/asm/arch-exynos/power.h 
b/arch/arm/include/asm/arch-exynos/power.h
index 4236beb..4e2448b 100644
--- a/arch/arm/include/asm/arch-exynos/power.h
+++ b/arch/arm/include/asm/arch-exynos/power.h
@@ -855,4 +855,9 @@ void set_mipi_phy_ctrl(unsigned int dev_index, unsigned int 
enable);
 #define EXYNOS_MIPI_PHY_SRESETN(1  1)
 #define EXYNOS_MIPI_PHY_MRESETN(1  2)
 
+#define POWER_USB_HOST_PHY_CTRL_EN (1  0)
+#define POWER_PS_HOLD_CONTROL_DATA_HIGH(1  8)
+void power_enable_usb_phy(void);
+void power_disable_usb_phy(void);
+
 #endif
diff --git a/arch/arm/include/asm/arch-exynos/sysreg.h 
b/arch/arm/include/asm/arch-exynos/sysreg.h
index aca4b2b..2d8d35a 100644
--- a/arch/arm/include/asm/arch-exynos/sysreg.h
+++ b/arch/arm/include/asm/arch-exynos/sysreg.h
@@ -40,4 +40,5 @@ struct exynos5_sysreg {
 };
 #endif
 
+#define USB20_PHY_CFG_EN   (1  0)
 #endif
diff --git a/drivers/usb/host/ehci-s5p.c b/drivers/usb/host/ehci-s5p.c
index 4dd4ec1..e575c48 100644
--- a/drivers/usb/host/ehci-s5p.c
+++ b/drivers/usb/host/ehci-s5p.c
@@ -30,6 +30,7 @@
 /* Setup the EHCI host controller. */
 static void setup_usb_phy(struct s5p_usb_phy *usb)
 {
+   power_enable_usb_phy();
clrbits_le32(usb-usbphyctrl0,
HOST_CTRL0_FSEL_MASK |
HOST_CTRL0_COMMONON_N |
@@ -70,6 +71,8 @@ static void reset_usb_phy(struct s5p_usb_phy *usb)
HOST_CTRL0_SIDDQ |
HOST_CTRL0_FORCESUSPEND |
HOST_CTRL0_FORCESLEEP);
+
+   power_disable_usb_phy();
 }
 
 /*
-- 
1.7.4.4

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


[U-Boot] [PATCH 4/5] exynos5: usb: Fix incorrect USB base addresses

2012-05-02 Thread Rajeshwari Shinde
This patch corrects the base addresses for USB_PHY and USB_OTG.

Signed-off-by: Vivek Gautam gautam.vi...@samsung.com
Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
---
 arch/arm/include/asm/arch-exynos/cpu.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h 
b/arch/arm/include/asm/arch-exynos/cpu.h
index ac4ddc7..891970d 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -68,10 +68,10 @@
 #define EXYNOS5_DMC_CTRL_BASE  0x10DD
 #define EXYNOS5_GPIO_PART1_BASE0x1140
 #define EXYNOS5_MIPI_DSIM_BASE 0x11D0
+#define EXYNOS5_USBPHY_BASE0x1213
+#define EXYNOS5_USBOTG_BASE0x1214
 #define EXYNOS5_MMC_BASE   0x1220
 #define EXYNOS5_SROMC_BASE 0x1225
-#define EXYNOS5_USBOTG_BASE0x1248
-#define EXYNOS5_USBPHY_BASE0x1248
 #define EXYNOS5_UART_BASE  0x12C0
 #define EXYNOS5_PWMTIMER_BASE  0x12DD
 #define EXYNOS5_GPIO_PART2_BASE0x1340
-- 
1.7.4.4

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


Re: [U-Boot] uboot and ZFS

2012-05-02 Thread Wolfgang Denk
Dear Jorgen,

In message 4fa0a7f3.8010...@lundman.net you wrote:
 
 Sorry if I am posting some kind of FAQ here,

Don't worry - AFAICT thisis the first time ZFS came up here.

 At first glance, it would suggest that it should be feasible to add ZFS to 
 uboot. But since I only have 'usage-level knowledge' of both boot systems, 
 I am unaware of any show-stoppers.

Technically it should be no unsolvable problem to add ZFS support to
U-Boot.  However, there are the same licensing issues that prevent ZFS
to be included with the Linux kernel; see
http://zfsonlinux.org/faq.html#WhatAboutTheLicensingIssue

Like Linux, U-Boot is released under GPL (v2+), which is not
compatible with the Sun CDDL.

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
Status quo. Latin for the mess we're in.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] USB: ehci-mx6: Fix broken IO access

2012-05-02 Thread Wolfgang Grandegger
To get USB working again on the i.MX6, this patch fixes a bug introduced
with commit 522b2a0 Add proper IO accessors for mx6 usb registers..
At that occasion, I also added the missing __iomem directive.

Cc: Marek Vasut ma...@denx.de
CC: Fabio Estevam feste...@gmail.com
Signed-off-by: Wolfgang Grandegger w...@denx.de
---
 drivers/usb/host/ehci-mx6.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-mx6.c b/drivers/usb/host/ehci-mx6.c
index 5dec673..42c77fe 100644
--- a/drivers/usb/host/ehci-mx6.c
+++ b/drivers/usb/host/ehci-mx6.c
@@ -73,7 +73,8 @@ static void usbh1_internal_phy_clock_gate(int on)
 
 static void usbh1_power_config(void)
 {
-   struct anatop_regs *anatop = (struct anatop_regs *)ANATOP_BASE_ADDR;
+   struct anatop_regs __iomem *anatop =
+   (struct anatop_regs __iomem *)ANATOP_BASE_ADDR;
/*
 * Some phy and power's special controls for host1
 * 1. The external charger detector needs to be disabled
@@ -87,7 +88,7 @@ static void usbh1_power_config(void)
 anatop-usb2_chrg_detect);
 
__raw_writel(ANADIG_USB2_PLL_480_CTRL_BYPASS,
-anatop-usb2_pll_480_ctrl);
+anatop-usb2_pll_480_ctrl_clr);
 
__raw_writel(ANADIG_USB2_PLL_480_CTRL_ENABLE |
 ANADIG_USB2_PLL_480_CTRL_POWER |
-- 
1.7.7.6


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


Re: [U-Boot] [PATCH] tegra2: trivially enable 13 mhz crystal frequency

2012-05-02 Thread Stephen Warren
On 05/01/2012 04:50 PM, Lucas Stach wrote:
 This is needed for upcoming Toradex Colibri T20 upstream support.

You probably want to CC the Tegra maintainer, so he notices this patch.
I've done so here.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] USB: ehci-mx6: Fix broken IO access

2012-05-02 Thread Fabio Estevam
On Wed, May 2, 2012 at 11:36 AM, Wolfgang Grandegger w...@denx.de wrote:
 To get USB working again on the i.MX6, this patch fixes a bug introduced
 with commit 522b2a0 Add proper IO accessors for mx6 usb registers..

Good catch on the usb register name change.

 At that occasion, I also added the missing __iomem directive.

Is this really needed?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [RESEND++ PATCH 3/5] usb:gadget:composite USB composite gadget support

2012-05-02 Thread Lukasz Majewski
USB Composite gadget implementation for u-boot. It builds on top
of USB UDC drivers.

This commit is based on following files from Linux Kernel v2.6.36:

./include/linux/usb/composite.h
./drivers/usb/gadget/composite.c

SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903

Signed-off-by: Lukasz Majewski l.majew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
Cc: Marek Vasut ma...@denx.de
---
 drivers/usb/gadget/composite.c  | 1082 +++
 include/linux/usb/composite.h   |  350 +
 include/usb/lin_gadget_compat.h |   19 +
 3 files changed, 1451 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/composite.c
 create mode 100644 include/linux/usb/composite.h

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
new file mode 100644
index 000..ebb5131
--- /dev/null
+++ b/drivers/usb/gadget/composite.c
@@ -0,0 +1,1082 @@
+/*
+ * composite.c - infrastructure for Composite USB Gadgets
+ *
+ * Copyright (C) 2006-2008 David Brownell
+ * U-boot porting: Lukasz Majewski l.majew...@samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#undef DEBUG
+
+#include linux/bitops.h
+#include linux/usb/composite.h
+
+#define USB_BUFSIZ 4096
+
+static struct usb_composite_driver *composite;
+
+/**
+ * usb_add_function() - add a function to a configuration
+ * @config: the configuration
+ * @function: the function being added
+ * Context: single threaded during gadget setup
+ *
+ * After initialization, each configuration must have one or more
+ * functions added to it.  Adding a function involves calling its @bind()
+ * method to allocate resources such as interface and string identifiers
+ * and endpoints.
+ *
+ * This function returns the value of the function's bind(), which is
+ * zero for success else a negative errno value.
+ */
+int usb_add_function(struct usb_configuration *config,
+   struct usb_function *function)
+{
+   int value = -EINVAL;
+
+   debug(adding '%s'/%p to config '%s'/%p\n,
+   function-name, function,
+   config-label, config);
+
+   if (!function-set_alt || !function-disable)
+   goto done;
+
+   function-config = config;
+   list_add_tail(function-list, config-functions);
+
+   if (function-bind) {
+   value = function-bind(config, function);
+   if (value  0) {
+   list_del(function-list);
+   function-config = NULL;
+   }
+   } else
+   value = 0;
+
+   if (!config-fullspeed  function-descriptors)
+   config-fullspeed = 1;
+   if (!config-highspeed  function-hs_descriptors)
+   config-highspeed = 1;
+
+done:
+   if (value)
+   debug(adding '%s'/%p -- %d\n,
+   function-name, function, value);
+   return value;
+}
+
+/**
+ * usb_function_deactivate - prevent function and gadget enumeration
+ * @function: the function that isn't yet ready to respond
+ *
+ * Blocks response of the gadget driver to host enumeration by
+ * preventing the data line pullup from being activated.  This is
+ * normally called during @bind() processing to change from the
+ * initial ready to respond state, or when a required resource
+ * becomes available.
+ *
+ * For example, drivers that serve as a passthrough to a userspace
+ * daemon can block enumeration unless that daemon (such as an OBEX,
+ * MTP, or print server) is ready to handle host requests.
+ *
+ * Not all systems support software control of their USB peripheral
+ * data pullups.
+ *
+ * Returns zero on success, else negative errno.
+ */
+int usb_function_deactivate(struct usb_function *function)
+{
+   struct usb_composite_dev*cdev = function-config-cdev;
+   int status = 0;
+
+   if (cdev-deactivations == 0)
+   status = usb_gadget_disconnect(cdev-gadget);
+   if (status == 0)
+   cdev-deactivations++;
+
+   return status;
+}
+
+/**
+ * usb_function_activate - allow function and gadget enumeration
+ * @function: function on which usb_function_activate() was called
+ *
+ * Reverses effect of usb_function_deactivate().  If no more 

Re: [U-Boot] [RESEND++ PATCH 3/5] usb:gadget:composite USB composite gadget support

2012-05-02 Thread Marek Vasut
Dear Lukasz Majewski,

 USB Composite gadget implementation for u-boot. It builds on top
 of USB UDC drivers.
 
 This commit is based on following files from Linux Kernel v2.6.36:

Ok, applied, thanks ;-)
 
 ./include/linux/usb/composite.h
 ./drivers/usb/gadget/composite.c
 
 SHA1: d187abb9a83e6c6b6e9f2ca17962bdeafb4bc903
 
 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Marek Vasut ma...@denx.de
 ---
  drivers/usb/gadget/composite.c  | 1082
 +++ include/linux/usb/composite.h   | 
 350 +
  include/usb/lin_gadget_compat.h |   19 +
  3 files changed, 1451 insertions(+), 0 deletions(-)
  create mode 100644 drivers/usb/gadget/composite.c
  create mode 100644 include/linux/usb/composite.h
 
 diff --git a/drivers/usb/gadget/composite.c
 b/drivers/usb/gadget/composite.c new file mode 100644
 index 000..ebb5131
 --- /dev/null
 +++ b/drivers/usb/gadget/composite.c
 @@ -0,0 +1,1082 @@
 +/*
 + * composite.c - infrastructure for Composite USB Gadgets
 + *
 + * Copyright (C) 2006-2008 David Brownell
 + * U-boot porting: Lukasz Majewski l.majew...@samsung.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License as published by
 + * the Free Software Foundation; either version 2 of the License, or
 + * (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
 USA + */
 +#undef DEBUG
 +
 +#include linux/bitops.h
 +#include linux/usb/composite.h
 +
 +#define USB_BUFSIZ   4096
 +
 +static struct usb_composite_driver *composite;
 +
 +/**
 + * usb_add_function() - add a function to a configuration
 + * @config: the configuration
 + * @function: the function being added
 + * Context: single threaded during gadget setup
 + *
 + * After initialization, each configuration must have one or more
 + * functions added to it.  Adding a function involves calling its @bind()
 + * method to allocate resources such as interface and string identifiers
 + * and endpoints.
 + *
 + * This function returns the value of the function's bind(), which is
 + * zero for success else a negative errno value.
 + */
 +int usb_add_function(struct usb_configuration *config,
 + struct usb_function *function)
 +{
 + int value = -EINVAL;
 +
 + debug(adding '%s'/%p to config '%s'/%p\n,
 + function-name, function,
 + config-label, config);
 +
 + if (!function-set_alt || !function-disable)
 + goto done;
 +
 + function-config = config;
 + list_add_tail(function-list, config-functions);
 +
 + if (function-bind) {
 + value = function-bind(config, function);
 + if (value  0) {
 + list_del(function-list);
 + function-config = NULL;
 + }
 + } else
 + value = 0;
 +
 + if (!config-fullspeed  function-descriptors)
 + config-fullspeed = 1;
 + if (!config-highspeed  function-hs_descriptors)
 + config-highspeed = 1;
 +
 +done:
 + if (value)
 + debug(adding '%s'/%p -- %d\n,
 + function-name, function, value);
 + return value;
 +}
 +
 +/**
 + * usb_function_deactivate - prevent function and gadget enumeration
 + * @function: the function that isn't yet ready to respond
 + *
 + * Blocks response of the gadget driver to host enumeration by
 + * preventing the data line pullup from being activated.  This is
 + * normally called during @bind() processing to change from the
 + * initial ready to respond state, or when a required resource
 + * becomes available.
 + *
 + * For example, drivers that serve as a passthrough to a userspace
 + * daemon can block enumeration unless that daemon (such as an OBEX,
 + * MTP, or print server) is ready to handle host requests.
 + *
 + * Not all systems support software control of their USB peripheral
 + * data pullups.
 + *
 + * Returns zero on success, else negative errno.
 + */
 +int usb_function_deactivate(struct usb_function *function)
 +{
 + struct usb_composite_dev*cdev = function-config-cdev;
 + int status = 0;
 +
 + if (cdev-deactivations == 0)
 + status = usb_gadget_disconnect(cdev-gadget);
 + if (status == 0)
 + cdev-deactivations++;
 +
 + return status;
 +}
 +
 +/**
 + * usb_function_activate - allow function and gadget enumeration
 + * @function: 

Re: [U-Boot] [PATCH 1/5] exynos5: Add system register structure

2012-05-02 Thread Marek Vasut
Dear Rajeshwari Shinde,

 This patch add structure for SYSREG.

Ccing Minkyu. Can I get your opinion on these patches please?

 
 Signed-off-by: Che-Liang Chiou clch...@chromium.org
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 Reviewed-by: Vivek Gautam gautam.vi...@samsung.com
 Reviewed-by: Simon Glass s...@chromium.org
 ---
  arch/arm/include/asm/arch-exynos/sysreg.h |   43
 + 1 files changed, 43 insertions(+), 0
 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h
 
 diff --git a/arch/arm/include/asm/arch-exynos/sysreg.h
 b/arch/arm/include/asm/arch-exynos/sysreg.h new file mode 100644
 index 000..aca4b2b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-exynos/sysreg.h
 @@ -0,0 +1,43 @@
 +/*
 + * (C) Copyright 2012 Samsung Electronics
 + * Register map for sysreg
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#ifndef __EXYNOS5_SYSREG_H__
 +#define __EXYNOS5_SYSREG_H__
 +
 +#ifndef __ASSEMBLY__
 +/* sysreg map */
 +struct exynos5_sysreg {
 + /* Add registers as and when required */
 + unsigned char   res1[0x214];
 + unsigned intdisp1blk_cfg;
 + unsigned intdispblk_cfg2;
 + unsigned inthdcp_e_fuse_mem_cfg;
 + unsigned intgsclblk_cfg0;
 + unsigned intgsclblk_cfg1;
 + unsigned intispblk_cfg;
 + unsigned intusb20_phy_cfg;
 + unsigned char   res2[0x29c];
 + unsigned intmipi_dphy;
 + unsigned intdptx_phy;
 + unsigned intphyclk_sel;
 +};
 +#endif
 +
 +#endif

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


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-05-02 Thread Fabio Estevam
Hi Stefano,

On Tue, Apr 17, 2012 at 11:30 AM, Stefano Babic sba...@denx.de wrote:

 Well, this is not a fix because it adds a feature that is not yet
 supported. It should be deferred to the next release.

Can this be applied now?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-05-02 Thread Marek Vasut
Dear Fabio Estevam,

 Hi Stefano,
 
 On Tue, Apr 17, 2012 at 11:30 AM, Stefano Babic sba...@denx.de wrote:
  Well, this is not a fix because it adds a feature that is not yet
  supported. It should be deferred to the next release.
 
 Can this be applied now?

Should be ...

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


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Scott Wood
On 05/02/2012 01:16 AM, Minkyu Kang wrote:
 Dear Marek,
 
 On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
 +int gpio_set_value(unsigned gpio, int value)
 +{
 +   unsigned l = readl(GPIO_FULLPORT(gpio));
 +   unsigned port = GPIO_FULLPORT(gpio);
 +
 +   /*
 +* All GPIO Port have a configuration on
 +* 2 bits excepted the first GPIO (A) which
 +* have only 1 bit of configuration.
 +*/
 +   if (value)
 +   if (!GPIO_PORT(gpio))
 +   l |= (0x1  GPIO_BIT(gpio));
 +   else
 +   l |= (0x3  GPIO_BIT(gpio));
 +   else
 +   if (!GPIO_PORT(gpio))
 +   l = ~(0x1  GPIO_BIT(gpio));
 +   else
 +   l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)
 
 As I know, it's a rule of u-boot.. maybe. :)

It is a U-Boot rule (multi-line if/loop body), and also it's good to
avoid the ambiguous if/if/else construct, but wouldn't this be better as:

if (GPIO_PORT(gpio))
bit = 1  GPIO_BIT(gpio);
else
bit = 3  GPIO_BIT(gpio);

if (value)
l |= bit;
else
l = ~bit;

?

-Scott

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


Re: [U-Boot] [PATCH] powerpc/p1010rdb: add readme document for p1010rdb

2012-05-02 Thread Scott Wood
On 05/02/2012 04:17 AM, Shengzhou Liu wrote:
 +Settings of DIP-switch
 +==
 +  SW4[1:4]=  and SW6[4]=0 for boot from 16bit NOR flash
 +  SW4[1:4]= 1000 and SW6[4]=1 for boot from 8bit NAND flash
 +  SW4[1:4]= 0110 and SW6[4]=0 for boot from SPI flash
 +Note: 1 stands for 'on', 0 stands for 'off'
 +
 +Please refer to P1010-RDB User Guide for details.

Where might one find this user guide?

 +Setting of hwconfig
 +===
 +If FlexCAN or TDM is needed, please set fsl_p1010mux:tdm_can=can or
 +fsl_p1010mux:tdm_can=tdm explicitly in u-booot prompt as below for example:
 +setenv hwconfig fsl_p1010mux:tdm_can=tdm;usb1:dr_mode=host,phy_type=utmi
 +By default, don't set fsl_p1010mux:tdm_can, in this case, spi chip selection
 +is set to spi-flash instead of to SLIC/TDM/DAC and tdm_can_sel is set to TDM
 +instead of to CAN/UART1.
 +
 +
 +Build and burn u-boot to NOR flash
 +===
 +1. Build u-boot.bin image
 + export ARCH=powerpc
 + export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
 + make P1010RDB_NOR
 +
 +2. Burn u-boot.bin into NOR flash
 + = tftp $loadaddr $uboot
 + = protect off eff8 +$filesize
 + = erase eff8 +$filesize
 + = cp.b $loadaddr eff8 $filesize
 +
 +3. Check SW4[1:4]=  and SW6[4]=0, then power on.
 +
 +
 +
 +Build and burn u-boot to NAND flash
 +
 +1. Build u-boot.bin image
 + export ARCH=powerpc
 + export CROSS_COMPILE=/your_path/powerpc-linux-gnu-
 + make P1010RDB_NAND
 +
 +2. Burn u-boot-nand.bin into NAND flash
 + = tftp $loadaddr $uboot-nand
 + = nand erase 0 $filesize
 + = nand write $loadaddr 0 $filesize
 +
 +3. Check SW4[1:4]= 1000 and SW6[4]=1, then power on.
 +
 +
 +
 +Build and burn u-boot to SPI flash
 +===
 +1. Build u-boot-spi.bin image
 + make P1010RDB_SPIFLASH_config; make
 + Boot up kernel with rootfs.ext2.gz.uboot.p1010rdb
 + Download u-boot.bin to linux and you can find some config files
 + under /usr/share such as config_xx.dat. Do below command:
 + boot_format config_ddr3_1gb_p1010rdb_800M.dat u-boot.bin -spi \
 + u-boot-spi.bin
 + to generate u-boot-spi.bin.
 +
 +2. Burn u-boot-spi.bin into SPI flash
 + = tftp $loadaddr $uboot-spi
 + = sf erase 0 10
 + = sf write $loadaddr 0 $filesize
 +
 +3. Check SW4[1:4]= 0110 and SW6[4]=0, then power on.

Also describe how do select boot mode via software rather than switches,
and describe alternate NOR bank.

-Scott

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


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

2012-05-02 Thread Luka Perkov
Hi Jamie,

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


On Thu, Apr 26, 2012 at 11:23:58AM +0100, Jamie Lentin wrote:
 This patch adds support for D-Link DNS-320 ShareCenter NAS.

...

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

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

Take a look here:

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

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


[U-Boot] USB on mx53loco

2012-05-02 Thread Fabio Estevam
Hi Wolfgang,

Have you tested USB host functionality on a mx53loco with a Freescale
MC34708 PMIC ?

I can succesfully detect a USB pen drive on a mx53loco board with a
Dialog PMIC, but not on the FSL PMIC version.

I am going to debug this, but just wondering if you have already seen
this issue.

Thanks,

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


[U-Boot] Default LAWBAR mapping at reset for mpc85xx?

2012-05-02 Thread Joakim Tjernlund

Still trying to wrap my head around the P2010 cpu and its boot sequence(NOR)
We can run the full u-boot it we use the BDI emulator but without emulator it
won't boot.
We have 64 MB NOR flash and have based out design on the P1020RDB and we boot 
from NOR.
Using the emulator but with minimal config we cannot get past the switch_as 
part in start.S
if we define a LAWBAR for our flash space in the emulator, u-boot will boot 
correctly.

We don't understand how the initial routing of addresses to CS0 work without an
LAWBAR mapping(all LAWBARS are invalid at reset). Is there some HW default at 
work
here we have yet to see?

Other observations
1) why not map initial stack to L2SRAM instead of cache? That would make early 
debugging
   much simpler as the memory would stay when stepping with gdb.

2) RDB has its CCSRBAR defined to 0xffe0 which is not the default 
ccsrbar(0xff70)
   this looks like a typo, and if it is, does u-boot work on RDB boards if 
changed
   to the default? I suspect RDB could end up in the same trap we are stuck in.

 Jocke


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


[U-Boot] [PATCH v2] kwboot: boot Marvell Kirkwood SoCs over a serial link

2012-05-02 Thread Luka Perkov
The kwboot program boots boards based on Marvell's Kirkwood platform
via Xmodem over their integrated UART.

Signed-off-by: Daniel Stodden daniel.stod...@googlemail.com
Acked-by: Luka Perkov ub...@lukaperkov.net
---

Changes from version v1:
 * fix man page
 * minor cosmetic fixes in tools/kwboot.c

I changed things pointed out on v1 of this patch which was originally
made by Daniel.

 doc/kwboot.1   |   76 ++
 tools/Makefile |6 +
 tools/kwboot.c |  738 
 3 files changed, 820 insertions(+)

diff --git a/doc/kwboot.1 b/doc/kwboot.1
new file mode 100644
index 000..70a2088
--- /dev/null
+++ b/doc/kwboot.1
@@ -0,0 +1,76 @@
+.TH KWBOOT 1 2012-05-02
+
+.SH NAME
+kwboot \- Boot Marvell Kirkwood SoCs over a serial link.
+.SH SYNOPSIS
+.B kwboot
+.RB [ -b \fIimage\fP ]
+.RB [ -p ]
+.RB [ -t ]
+.RB [ -B \fIbaudrate\fP ]
+.RB [\fITTY\fP]
+.SH DESCRIPTION
+
+The
+.B kwboot
+program boots boards based on Marvell's Kirkwood platform over their integrated
+UART. Boot image files will typically contain a second stage boot loader, such
+as U-Boot. The image file must conform to Marvell's BootROM firmware image
+format (\fIkwbimage\fP), created using a tool such as .B mkimage.
+
+Following power-up or a system reset, system BootROM code polls the UART for a
+brief period of time, sensing a handshake message which initiates an image
+upload. This program sends this boot message until it receives a positive
+acknowledgement. The image is transfered using Xmodem.
+
+Additionally, this program implements a minimal terminal mode, which can be
+used either standalone, or entered immediately following boot image transfer
+completion. This is often useful to catch early boot messages, or to manually
+interrupt a default boot procedure performed by the second-stage loader.
+
+.SH OPTIONS
+
+.TP
+.BI \-b \fIimage\fP
+Handshake; then upload file \fIimage\fP over \fITTY\fP.
+
+Note that for the encapsulated boot code to be executed, \fIimage\fP must be of
+type UART boot (0x69). Boot images of different types, such as backup images
+of vendor firmware downloaded from flash memory (type 0x8B), will not work (or
+not as expected). See \fB-p\fP for a workaround.
+
+This mode writes handshake status and upload progress indication to stdout.
+
+.TP
+.BI \-p
+In combination with \fB-b\fP, patches the header in \fIimage\fP prior to
+upload, to UART boot type.
+
+This option attempts on-the-fly conversion of some none-UART image types, such
+as images which were originally formatted to be stored in flash memory.
+
+Conversion is performed in memory. The contents of \fIimage\fP will not be
+altered.
+
+.TP
+.BI \-t
+Run a terminal program, connecting standard input and output to
+.RB \fITTY\fP.
+
+If used in combination with \fB-b\fP, terminal mode is entered immediately
+following a successful image upload.
+
+If standard I/O streams connect to a console, this mode will terminate after
+receiving 'ctrl-\\' followed by 'c' from console input.
+
+.TP
+.BI \-B \fIbaudrate\fP
+Adjust the baud rate on \fITTY\fP. Default rate is 115200.
+
+.SH SEE ALSO
+.PP
+\fBmkimage\fP(1)
+
+.SH AUTHORS
+
+Daniel Stodden daniel.stod...@gmail.com
diff --git a/tools/Makefile b/tools/Makefile
index 8993fdd..8097d95 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -72,6 +72,7 @@ BIN_FILES-$(CONFIG_SMDK5250) += mksmdk5250spl$(SFX)
 BIN_FILES-$(CONFIG_MX28) += mxsboot$(SFX)
 BIN_FILES-$(CONFIG_NETCONSOLE) += ncb$(SFX)
 BIN_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1$(SFX)
+BIN_FILES-$(CONFIG_KIRKWOOD) += kwboot$(SFX)
 
 # Source files which exist outside the tools directory
 EXT_OBJ_FILES-$(CONFIG_BUILD_ENVCRC) += common/env_embedded.o
@@ -101,6 +102,7 @@ OBJ_FILES-$(CONFIG_NETCONSOLE) += ncb.o
 NOPED_OBJ_FILES-y += os_support.o
 OBJ_FILES-$(CONFIG_SHA1_CHECK_UB_IMG) += ubsha1.o
 NOPED_OBJ_FILES-y += ublimage.o
+OBJ_FILES-$(CONFIG_KIRKWOOD) += kwboot.o
 
 # Don't build by default
 #ifeq ($(ARCH),ppc)
@@ -234,6 +236,10 @@ $(obj)ncb$(SFX):   $(obj)ncb.o
 $(obj)ubsha1$(SFX):$(obj)os_support.o $(obj)sha1.o $(obj)ubsha1.o
$(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
 
+$(obj)kwboot$(SFX): $(obj)kwboot.o
+   $(HOSTCC) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ $^
+   $(HOSTSTRIP) $@
+
 # Some of the tool objects need to be accessed from outside the tools directory
 $(obj)%.o: $(SRCTREE)/common/%.c
$(HOSTCC) -g $(HOSTCFLAGS_NOPED) -c -o $@ $
diff --git a/tools/kwboot.c b/tools/kwboot.c
new file mode 100644
index 000..6254296
--- /dev/null
+++ b/tools/kwboot.c
@@ -0,0 +1,738 @@
+/*
+ * Boot a Marvell Kirkwood SoC, with Xmodem over UART0.
+ *
+ * (c) 2012 Daniel Stodden daniel.stod...@gmail.com
+ *
+ * References: marvell.com, 88F6180, 88F6190, 88F6192, and 88F6281
+ *   Integrated Controller: Functional Specifications December 2,
+ *   2008. Chapter 24.2 BootROM Firmware.
+ */
+
+#include stdlib.h
+#include stdio.h
+#include string.h
+#include stdarg.h
+#include libgen.h

Re: [U-Boot] [PATCH] USB: ehci-mx6: Fix broken IO access

2012-05-02 Thread Wolfgang Grandegger
Hi Fabio,

On 05/02/2012 05:24 PM, Fabio Estevam wrote:
 On Wed, May 2, 2012 at 11:36 AM, Wolfgang Grandegger w...@denx.de wrote:
 To get USB working again on the i.MX6, this patch fixes a bug introduced
 with commit 522b2a0 Add proper IO accessors for mx6 usb registers..
 
 Good catch on the usb register name change.
 
 At that occasion, I also added the missing __iomem directive.
 
 Is this really needed?

As I see it, __iomem is a dummy function in U-Boot. I just added it for
consistency reasons. If we remove it, we should also remove all other
__iomem's from that file. Maybe somebody else could clarify if __iomem
should be used.

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


Re: [U-Boot] USB on mx53loco

2012-05-02 Thread Wolfgang Grandegger
On 05/02/2012 08:48 PM, Fabio Estevam wrote:
 Hi Wolfgang,
 
 Have you tested USB host functionality on a mx53loco with a Freescale
 MC34708 PMIC ?

I have a i.MX53 quick start board, which is named in U-Boot and Linux
mx53[_]loco. And yes, USB is working.

 I can succesfully detect a USB pen drive on a mx53loco board with a
 Dialog PMIC, but not on the FSL PMIC version.

I need to check, what PMIC my board uses.

 I am going to debug this, but just wondering if you have already seen
 this issue.

See above.

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


Re: [U-Boot] Default LAWBAR mapping at reset for mpc85xx?

2012-05-02 Thread Scott Wood
On 05/02/2012 02:04 PM, Joakim Tjernlund wrote:
 
 Still trying to wrap my head around the P2010 cpu and its boot sequence(NOR)

Yeah, it's a bit convoluted.

 We can run the full u-boot it we use the BDI emulator but without emulator it
 won't boot.

I'm not sure what BDI emulator but without emulator means.

If you mean the BDI is trying to initialize things rather than leave the
system in its default state, don't do that.

 We have 64 MB NOR flash and have based out design on the P1020RDB and we boot 
 from NOR.
 Using the emulator but with minimal config we cannot get past the switch_as 
 part in start.S
 if we define a LAWBAR for our flash space in the emulator, u-boot will boot 
 correctly.

Given the issues with e500v2 hardware debug that Prabhakar has been
trying to work around, I'd try debugging with serial output instead
during that phase of the boot, at least to see how far you get in the
absence of breakpoints or single stepping.

 We don't understand how the initial routing of addresses to CS0 work without 
 an
 LAWBAR mapping(all LAWBARS are invalid at reset). Is there some HW default at 
 work
 here we have yet to see?

There's a boot translation window that acts like a LAW.  This is
described in section 4.3.1.3 (Boot Page Translation) of the manual.

 Other observations
 1) why not map initial stack to L2SRAM instead of cache? That would make 
 early debugging
much simpler as the memory would stay when stepping with gdb.

You could do that, but then you'd have to have separate handling for
e500mc where the CPC (L3) is what can be used for SRAM -- and are there
any 85xx that don't have L2?

It would be nice to not need special hacks in simulators that don't
normally model cache (but could more easily model SRAM).

 2) RDB has its CCSRBAR defined to 0xffe0 which is not the default 
 ccsrbar(0xff70)
this looks like a typo,

It's not a typo.  We do this on all the 85xx boards.  At this point
you'll probably need a time machine to find out why (probably just fit
into software's intended memory map better), but we're not going to
change it now.

 and if it is, does u-boot work on RDB boards if changed
to the default?

I would not expect U-Boot to break if you change the CCSRBAR setting
(but of course I can't guarantee that), but you will need to update the
device tree to match, and other OSes may have this hardcoded.

 I suspect RDB could end up in the same trap we are stuck in.

What sort of trap?

-Scott

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


Re: [U-Boot] Default LAWBAR mapping at reset for mpc85xx?

2012-05-02 Thread Joakim Tjernlund
Scott Wood scottw...@freescale.com wrote on 2012/05/02 21:34:18:

 On 05/02/2012 02:04 PM, Joakim Tjernlund wrote:
 
  Still trying to wrap my head around the P2010 cpu and its boot sequence(NOR)

 Yeah, it's a bit convoluted.

Yes, fully agreed. I miss the sane 0 address boot vector too.


  We can run the full u-boot it we use the BDI emulator but without emulator 
  it
  won't boot.

 I'm not sure what BDI emulator but without emulator means.

ehh, emulator attached we can run u-boot to the fullest and without the 
emulator we cannot get
past start.S


 If you mean the BDI is trying to initialize things rather than leave the
 system in its default state, don't do that.

Yes, trying to get there.


  We have 64 MB NOR flash and have based out design on the P1020RDB and we 
  boot from NOR.
  Using the emulator but with minimal config we cannot get past the switch_as 
  part in start.S
  if we define a LAWBAR for our flash space in the emulator, u-boot will boot 
  correctly.

 Given the issues with e500v2 hardware debug that Prabhakar has been
 trying to work around, I'd try debugging with serial output instead
 during that phase of the boot, at least to see how far you get in the
 absence of breakpoints or single stepping.

Cant' get past the asm in start.S(is fails at switch_as:) so no serial output :(


  We don't understand how the initial routing of addresses to CS0 work 
  without an
  LAWBAR mapping(all LAWBARS are invalid at reset). Is there some HW default 
  at work
  here we have yet to see?

 There's a boot translation window that acts like a LAW.  This is
 described in section 4.3.1.3 (Boot Page Translation) of the manual.

Ahh, so we have 0xff80_ to 0x_ to begin with.
This space will probably be too small for us as we want to relocate the
main part of the boot to beginning of flash(once the bringup is complete).
This raises another question, not the is just one u-boot.bin img with
bot the bootpg and the rest of the uboot. This img pads the space between 
normal u-boot
and bootpg.
Ideally one show have the option to build 2 images, one bootpg and another img
for normal u-boot so one can burn these at different locations without padding.
I cannot see any support for this but i might be missing something?


  Other observations
  1) why not map initial stack to L2SRAM instead of cache? That would make 
  early debugging
 much simpler as the memory would stay when stepping with gdb.

 You could do that, but then you'd have to have separate handling for
 e500mc where the CPC (L3) is what can be used for SRAM -- and are there
 any 85xx that don't have L2?

No idea, just getting used to our P2010 :)
It would be very valuable to run gdb in the early phase during bringup as this
can be very time consuming.


 It would be nice to not need special hacks in simulators that don't
 normally model cache (but could more easily model SRAM).

  2) RDB has its CCSRBAR defined to 0xffe0 which is not the default 
  ccsrbar(0xff70)
 this looks like a typo,

 It's not a typo.  We do this on all the 85xx boards.  At this point
 you'll probably need a time machine to find out why (probably just fit
 into software's intended memory map better), but we're not going to
 change it now.

I see, I think you got this value from the reference manual because it is 
misprinted
in there and corrected in the errata.


  and if it is, does u-boot work on RDB boards if changed
 to the default?

 I would not expect U-Boot to break if you change the CCSRBAR setting
 (but of course I can't guarantee that), but you will need to update the
 device tree to match, and other OSes may have this hardcoded.

  I suspect RDB could end up in the same trap we are stuck in.

 What sort of trap?

Not getting past start.S :)
It was more a debug suggestion to see if u-boot still worked.

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


Re: [U-Boot] [PATCH 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Gabriel Huau
On Wed, May 02, 2012 at 01:40:35PM -0500, Scott Wood wrote:
 On 05/02/2012 01:16 AM, Minkyu Kang wrote:
  Dear Marek,
  
  On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
  +int gpio_set_value(unsigned gpio, int value)
  +{
  +   unsigned l = readl(GPIO_FULLPORT(gpio));
  +   unsigned port = GPIO_FULLPORT(gpio);
  +
  +   /*
  +* All GPIO Port have a configuration on
  +* 2 bits excepted the first GPIO (A) which
  +* have only 1 bit of configuration.
  +*/
  +   if (value)
  +   if (!GPIO_PORT(gpio))
  +   l |= (0x1  GPIO_BIT(gpio));
  +   else
  +   l |= (0x3  GPIO_BIT(gpio));
  +   else
  +   if (!GPIO_PORT(gpio))
  +   l = ~(0x1  GPIO_BIT(gpio));
  +   else
  +   l = ~(0x3  GPIO_BIT(gpio));
 
  Need brace at this if..else statement.
 
  I wanted to ask why, but ... C isn't python, good point ;-)
  
  As I know, it's a rule of u-boot.. maybe. :)
 
 It is a U-Boot rule (multi-line if/loop body), and also it's good to
 avoid the ambiguous if/if/else construct, but wouldn't this be better as:
 
 if (GPIO_PORT(gpio))
   bit = 1  GPIO_BIT(gpio);
 else
   bit = 3  GPIO_BIT(gpio);
 
 if (value)
   l |= bit;
 else
   l = ~bit;
 
 ?
 

For multi-line, we should maybe patch the checkpatch.pl to check this
statement. But, indeed, I will do the modification of Scott.

 -Scott
 
 ___
 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 1/2 v4] ARM : Add GPIO Driver and IOMUX definition for S3C2440

2012-05-02 Thread Scott Wood
On 05/02/2012 03:16 PM, Gabriel Huau wrote:
 On Wed, May 02, 2012 at 01:40:35PM -0500, Scott Wood wrote:
 On 05/02/2012 01:16 AM, Minkyu Kang wrote:
 Dear Marek,

 On 2 May 2012 11:44, Marek Vasut ma...@denx.de wrote:
 +int gpio_set_value(unsigned gpio, int value)
 +{
 +   unsigned l = readl(GPIO_FULLPORT(gpio));
 +   unsigned port = GPIO_FULLPORT(gpio);
 +
 +   /*
 +* All GPIO Port have a configuration on
 +* 2 bits excepted the first GPIO (A) which
 +* have only 1 bit of configuration.
 +*/
 +   if (value)
 +   if (!GPIO_PORT(gpio))
 +   l |= (0x1  GPIO_BIT(gpio));
 +   else
 +   l |= (0x3  GPIO_BIT(gpio));
 +   else
 +   if (!GPIO_PORT(gpio))
 +   l = ~(0x1  GPIO_BIT(gpio));
 +   else
 +   l = ~(0x3  GPIO_BIT(gpio));

 Need brace at this if..else statement.

 I wanted to ask why, but ... C isn't python, good point ;-)

 As I know, it's a rule of u-boot.. maybe. :)

 It is a U-Boot rule (multi-line if/loop body), and also it's good to
 avoid the ambiguous if/if/else construct, but wouldn't this be better as:

 if (GPIO_PORT(gpio))
  bit = 1  GPIO_BIT(gpio);
 else
  bit = 3  GPIO_BIT(gpio);

 if (value)
  l |= bit;
 else
  l = ~bit;

 ?

 
 For multi-line, we should maybe patch the checkpatch.pl to check this
 statement. But, indeed, I will do the modification of Scott.

...with the 1 and 3 swapped in the first if/else, of course. :-P

-Scott

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


[U-Boot] [PATCH 2/2 v10] ARM : Add support for MINI2440 (s3c2440).

2012-05-02 Thread Gabriel Huau
Support of the MINI2440 board from FriendlyARM from
an old version of u-boot :
http://repo.or.cz/r/u-boot-openmoko/mini2440.git

Currently, supporting only boot from NOR.

Signed-off-by: Gabriel Huau cont...@huau-gabriel.fr
---
Changes for v2:
- Coding style cleanup
- Remove unnecessary files modification
- Remove unnecessary board configuration set

Changes for v3:
- Coding style cleanup
- Move some macro definition from lowlevel_init.S
to a new header
- Remove some magic bloat with I/O board initialization
- Add a pll_delay and replace loop by it
- Somme cleanup in the configuration file
- Cancel modifications on an SoC specific header
- Add my name to copyright

Changes for v4:
- Move dram init to dram_init() instead low_levelinit
- Remove u  -boot env from configuration file and change
the address of initial SP
- Remove PLL init, now it's SoC specific

Changes for v5:
- Clean up configuration file
- Add a MAINTAINERS entry
- Add a README.mini2440 file
- Use gpio/iomux interface in case of magic numbers
- Use get_ram_size()

Changes for v6:
- Coding style cleanup
- Remove some unused define in the board config

Changes for v7:
- Cleanup coding style
- Changement of the commit message

Changes for v8:
- Replace define[tab] by define[space]

Changes for v9:
- Add a nice commit message

Changes for v10:
- Sort the MAINTAINERS file

 MAINTAINERS   |4 +
 board/friendlyarm/mini2440/Makefile   |   44 
 board/friendlyarm/mini2440/mini2440.c |  134 
 board/friendlyarm/mini2440/mini2440.h |  144 +
 boards.cfg|1 +
 doc/README.mini2440   |   28 +
 include/configs/mini2440.h|  186 +
 7 files changed, 541 insertions(+)
 create mode 100644 board/friendlyarm/mini2440/Makefile
 create mode 100644 board/friendlyarm/mini2440/mini2440.c
 create mode 100644 board/friendlyarm/mini2440/mini2440.h
 create mode 100644 doc/README.mini2440
 create mode 100644 include/configs/mini2440.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 708ded7..c31ae6f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -677,6 +677,10 @@ Vaibhav Hiremath hvaib...@ti.com
 
am3517_evm  ARM ARMV7 (AM35x SoC)
 
+Gabriel Huau cont...@huau-gabriel.fr
+
+   mini2440s3c2440
+
 Grazvydas Ignotas nota...@gmail.com
 
omap3_pandora   ARM ARMV7 (OMAP3xx SoC)
diff --git a/board/friendlyarm/mini2440/Makefile 
b/board/friendlyarm/mini2440/Makefile
new file mode 100644
index 000..b88e569
--- /dev/null
+++ b/board/friendlyarm/mini2440/Makefile
@@ -0,0 +1,44 @@
+#
+# (C) Copyright 2012
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := mini2440.o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/friendlyarm/mini2440/mini2440.c 
b/board/friendlyarm/mini2440/mini2440.c
new file mode 100644
index 000..e97d981
--- /dev/null
+++ b/board/friendlyarm/mini2440/mini2440.c
@@ -0,0 +1,134 @@
+/*
+ * (C) Copyright 2002
+ * Sysgo Real-Time Solutions, GmbH www.elinos.com
+ * Marius Groeger mgroe...@sysgo.de
+ *
+ * (C) Copyright 2002
+ * David Mueller, ELSOFT AG, d.muel...@elsoft.ch
+ *
+ * (C) Copyright 2009
+ * Michel Pollet buser...@gmail.com
+ *
+ * (C) Copyright 2012
+ * Gabriel Huau cont...@huau-gabriel.fr
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * 

Re: [U-Boot] Default LAWBAR mapping at reset for mpc85xx?

2012-05-02 Thread Scott Wood
On 05/02/2012 03:09 PM, Joakim Tjernlund wrote:
 Scott Wood scottw...@freescale.com wrote on 2012/05/02 21:34:18:

 On 05/02/2012 02:04 PM, Joakim Tjernlund wrote:
 We can run the full u-boot it we use the BDI emulator but without emulator 
 it
 won't boot.

 I'm not sure what BDI emulator but without emulator means.
 
 ehh, emulator attached we can run u-boot to the fullest and without the 
 emulator we cannot get
 past start.S

Ah, my brain filled in the missing punctuation in the wrong place. :-)

Is the BDI doing any initialization at all, when you have it attached?
Or is the mere presence enough?

The latter case reminds me of a problem on early rev mpc8313erdb where
there was a board design error, resulting in a hang when the power
management registers were accessed in the absence of a JTAG connection.

 If you mean the BDI is trying to initialize things rather than leave the
 system in its default state, don't do that.
 
 Yes, trying to get there.
 

 We have 64 MB NOR flash and have based out design on the P1020RDB and we 
 boot from NOR.
 Using the emulator but with minimal config we cannot get past the switch_as 
 part in start.S
 if we define a LAWBAR for our flash space in the emulator, u-boot will boot 
 correctly.

 Given the issues with e500v2 hardware debug that Prabhakar has been
 trying to work around, I'd try debugging with serial output instead
 during that phase of the boot, at least to see how far you get in the
 absence of breakpoints or single stepping.
 
 Cant' get past the asm in start.S(is fails at switch_as:) so no serial output 
 :(

You can do serial output in start.S, you just have to do everything
manually.

If you aren't doing serial output and don't have BDI attached, how do
you know switch_as is where it stops?

You may want to try installing usable exception handlers.

 We don't understand how the initial routing of addresses to CS0 work 
 without an
 LAWBAR mapping(all LAWBARS are invalid at reset). Is there some HW default 
 at work
 here we have yet to see?

 There's a boot translation window that acts like a LAW.  This is
 described in section 4.3.1.3 (Boot Page Translation) of the manual.
 
 Ahh, so we have 0xff80_ to 0x_ to begin with.
 This space will probably be too small for us as we want to relocate the
 main part of the boot to beginning of flash(once the bringup is complete).

Why do you want to do this?  You're creating more work for yourself by
not doing it the way other 85xx boards work.

 This raises another question, not the is just one u-boot.bin img with
 bot the bootpg and the rest of the uboot. This img pads the space between 
 normal u-boot
 and bootpg.
 Ideally one show have the option to build 2 images, one bootpg and another img
 for normal u-boot so one can burn these at different locations without 
 padding.
 I cannot see any support for this but i might be missing something?

This is not supported.  You're supposed to put everything at the end of
flash.

 2) RDB has its CCSRBAR defined to 0xffe0 which is not the default 
 ccsrbar(0xff70)
this looks like a typo,

 It's not a typo.  We do this on all the 85xx boards.  At this point
 you'll probably need a time machine to find out why (probably just fit
 into software's intended memory map better), but we're not going to
 change it now.
 
 I see, I think you got this value from the reference manual because it is 
 misprinted
 in there and corrected in the errata.

No.  Usually on e500v2 the hardware has a default CCSR of 0x0_ff70_,
and we change that to 0x0_ffe0_ (or 0xf_ffe0_ in a 36-bit
address map).  It's like this on all 85xx, not just p20x0.

Either someone took the value software uses and stuck it in the hardware
manual, or (more likely) it was due to confusion with e500mc-based SoCs,
which do have a default of 0x0_fe00_ because their CCSR is 16 MiB
and 0x0_ff70_ wouldn't be properly aligned.

-Scott

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


Re: [U-Boot] USB on mx53loco

2012-05-02 Thread stefano babic
Am 02/05/2012 20:48, schrieb Fabio Estevam:
 Hi Wolfgang,
 
 Have you tested USB host functionality on a mx53loco with a Freescale
 MC34708 PMIC ?

No, I tested on a board with the Dialog PMIC, and it worked flawlessy.
Maybe someone else tesetd with a newer board..

Best regards,
Stefano Babic

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


Re: [U-Boot] [PATCH] mx28evk: add NAND support

2012-05-02 Thread stefano babic
Am 02/05/2012 19:26, schrieb Fabio Estevam:
 Hi Stefano,
 
 On Tue, Apr 17, 2012 at 11:30 AM, Stefano Babic sba...@denx.de wrote:
 
 Well, this is not a fix because it adds a feature that is not yet
 supported. It should be deferred to the next release.
 
 Can this be applied now?
 

Yes, I will do it.

Best regards,
Stefano Babic


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


[U-Boot] [PATCH 1/3] Revert i.MX28: Enable additional DRAM address bits

2012-05-02 Thread Marek Vasut
This reverts commit 69d26d09de1cb93e0a09ca71d9f0d41a66f0756a.

Apparently, this commit got mainline only because of OOT port and causes
breakage on board that is mainline. Revert.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Detlev Zundel d...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Fabio Estevam feste...@gmail.com
---
 arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c 
b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
index 4f62142..0d13537 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
@@ -39,7 +39,7 @@ uint32_t dram_vals[] = {
0x, 0x0100, 0x, 0x,
0x, 0x, 0x, 0x,
0x, 0x, 0x00010101, 0x01010101,
-   0x000f0f01, 0x0f02010a, 0x, 0x00010101,
+   0x000f0f01, 0x0f02020a, 0x, 0x00010101,
0x0100, 0x0100, 0x, 0x0002,
0x0101, 0x05060302, 0x06005003, 0x0ac8,
0x02009c40, 0x030c, 0x0036a609, 0x031a0612,
-- 
1.7.10

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


[U-Boot] [PATCH 2/3] M28: Scan only first 512 MB of DRAM to avoid memory wraparound

2012-05-02 Thread Marek Vasut
Signed-off-by: Marek Vasut ma...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Detlev Zundel d...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Fabio Estevam feste...@gmail.com
---
 include/configs/m28evk.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/m28evk.h b/include/configs/m28evk.h
index 4016570..7e1661e 100644
--- a/include/configs/m28evk.h
+++ b/include/configs/m28evk.h
@@ -88,7 +88,7 @@
  */
 #defineCONFIG_NR_DRAM_BANKS1   /* 1 bank of 
DRAM */
 #definePHYS_SDRAM_10x4000  /* Base address 
*/
-#definePHYS_SDRAM_1_SIZE   0x4000  /* Max 1 GB RAM 
*/
+#definePHYS_SDRAM_1_SIZE   0x2000  /* Max 512 MB 
RAM */
 #defineCONFIG_STACKSIZE0x0001  /* 128 KB stack 
*/
 #defineCONFIG_SYS_MALLOC_LEN   0x0040  /* 4 MB for 
malloc */
 #defineCONFIG_SYS_GBL_DATA_SIZE128 /* Initial data 
*/
-- 
1.7.10

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


[U-Boot] [PATCH 3/3] i.MX28: Increase the delay after DRAM init

2012-05-02 Thread Marek Vasut
This solves issues when larger amount of DRAM is used.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Wolfgang Denk w...@denx.de
Cc: Detlev Zundel d...@denx.de
Cc: Stefano Babic sba...@denx.de
Cc: Fabio Estevam feste...@gmail.com
---
 arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c 
b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
index 0d13537..0b592f7 100644
--- a/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
+++ b/arch/arm/cpu/arm926ejs/mx28/spl_mem_init.c
@@ -237,4 +237,6 @@ void mx28_mem_init(void)
early_delay(1);
 
mx28_mem_setup_cpu_and_hbus();
+
+   early_delay(1);
 }
-- 
1.7.10

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


Re: [U-Boot] USB on mx53loco

2012-05-02 Thread Fabio Estevam
On Wed, May 2, 2012 at 5:56 PM, stefano babic sba...@denx.de wrote:

 No, I tested on a board with the Dialog PMIC, and it worked flawlessy.
 Maybe someone else tesetd with a newer board..

I have both boards here.

On a mx53loco with Dialog PMIC:

MX53LOCO U-Boot  usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
   scanning bus for storage devices... 1 Storage Device(s) found
   scanning bus for ethernet devices... 0 Ethernet Device(s) found

On a mx53loco with FSL PMIC:

MX53LOCO U-Boot  usb start
(Re)start USB...
USB:   Register 10011 NbrPorts 1
USB EHCI 1.00
scanning bus for devices... cannot reset port 1!?
1 USB Device(s) found
   scanning bus for storage devices... 0 Storage Device(s) found
   scanning bus for ethernet devices... 0 Ethernet Device(s) found

I still have not figured out why it cannot reset the USB port in this case.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] i.MX28: Increase the delay after DRAM init

2012-05-02 Thread Fabio Estevam
On Wed, May 2, 2012 at 7:14 PM, Marek Vasut ma...@denx.de wrote:
 This solves issues when larger amount of DRAM is used.

Shouldn't we check if we are using a large amount of DRAM?

If we don't check then even boards with small amount of RAM would have
this additional delay.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/3] i.MX28: Increase the delay after DRAM init

2012-05-02 Thread Marek Vasut
Dear Fabio Estevam,

 On Wed, May 2, 2012 at 7:14 PM, Marek Vasut ma...@denx.de wrote:
  This solves issues when larger amount of DRAM is used.
 
 Shouldn't we check if we are using a large amount of DRAM?
 
 If we don't check then even boards with small amount of RAM would have
 this additional delay.

I'm afraid this worked on boards with a small amound of RAM by sheer accident 
(or good will of the DRAM), time to play safe and fix this.

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


Re: [U-Boot] make menuconfig does not work

2012-05-02 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Graeme Russ,
 
 In message 
calbutckzc7cwoaql4b+mjndczgyzas0jpfzzf7q9psdhe_j...@mail.gmail.com you wrote:
   Any plan to add Kconfig or any other way to configure u-boot?
  
  Not that I am aware of, but I would support anyone who submitted
  patches to add Kconfig support
 
 Well, please talk to Marek, then...

Yohoho ... this is where it all leaked :-)

  (it would be great to get U-Boot added to buildroot as well - One
  build for bootloader + kernel + root filesystem :)
 
 Buildroot?  Isn't this kind of a dead horse now?  I thought everybody
 is using Yocto now...

It ain't dead, just ... noone uses it.

 
 Best regards,
 
 Wolfgang Denk

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


Re: [U-Boot] [PATCH 0/3] Initialisation Sequence Framework

2012-05-02 Thread Marek Vasut
Dear Graeme Russ,

 Well here it is (finally) - My Initialisation Sequence Framework
 
 This series is limited to x86 and is controlled by CONFIG_INIT_FUNC so
 no other arch should be effected. I don't have any cross compilers, so I
 would appreciate if others could confirm the zero impact assertion
 
 Asbestos suit on

Oh this is gonna be the flamewar of the year now :-E~

Gasoline ready, asbestos pants - check, flamethrower on ... let's go!

 )  (  ((
 (  )  () @@  )  (( (
 (  (  )( @@  (  )) ) (
   ((  ( ()( /---\   (()( (
 ___)  ) )(@ !O O! )@@  ( ) ) )
   )  ) (  ( )( ()@ \ o / (@ ( ()( )
 /--|  |(  o| (  )  ) ((@@(@@ !o! (@)() (
|  \___|  ) ( @)@@)@ /---\-/---\ )@()( )
|  /-+()@@@( // /-\ \\ @@@)@(  .
| |\ =__/|@(@@@ // @ /---\ @ \\ @(@@@(@@@ .  .
|  \   \\=--\|@ O @@@ /-\ @@@ O @@(@@)@@ @   .
|   \   \+--\-)))   @@ !!  %  !! @@)@@@ .. .
|   |\__|_)))/ .@@ !! @@ /---\ @@ !! @@(@@@ @ . .
 \__==   *.@@ /MM  /\O   O/\  MM\ @@@. .
|   |-\   \  (   .  @ !!!  !! \-/ !!  !!! @ .
|   |  \   \  )  . .   !! !!  .(. @.  .. .
|   |   \   \(/   .(  . \)). ( |O  )( O!  . )  .
|   |   /   / ) (  )).  ((  .) !! ((( !! @@ (. ((. .   .
|   |  /   /   ()  ))   ))   .( ( ( ) ). ( !!  )( !! ) ((   ))  ..
|   |_   /   ( ) ( (  ) )   (( )  )).) ((/ |  (  | \(  )) ((. ).
_\\__\__(___)_))_((_())__(_(___.oooO_Oooo.(_(_)_)((_


Artist:  P.r.i.m.a.l
Borrowed from: http://www.ascii-art.de/ascii/def/flamethrower.txt
Copyright © 1997-2004 Andreas Freise

 Fire away ;)
 
 Regards,
 
 Graeme
 
 Graeme Russ (3):
   init_func: Add fundamental framework
   init_func: Add x86 support
   init_func: Use for eNET board
 
  Makefile |   34 +-
  arch/x86/cpu/cpu.c   |3 +
  arch/x86/cpu/sc520/sc520_sdram.c |3 +
  arch/x86/cpu/sc520/sc520_timer.c |2 +
  arch/x86/cpu/u-boot.lds  |   23 +
  arch/x86/lib/board.c |   10 +-
  arch/x86/lib/init_helpers.c  |   14 +
  arch/x86/lib/init_wrappers.c |   11 +-
  arch/x86/lib/pcat_interrupts.c   |2 +
  arch/x86/lib/relocate.c  |4 +
  board/eNET/eNET.c|5 +
  common/Makefile  |2 +
  common/console.c |3 +
  common/env_dataflash.c   |1 +
  common/env_eeprom.c  |1 +
  common/env_fat.c |1 +
  common/env_flash.c   |2 +
  common/env_mgdisk.c  |1 +
  common/env_mmc.c |1 +
  common/env_nand.c|1 +
  common/env_nowhere.c |1 +
  common/env_nvram.c   |1 +
  common/env_onenand.c |1 +
  common/env_sf.c  |1 +
  common/serial.c  |2 +
  common/stdio.c   |2 +
  config.mk|2 +
  doc/README.INIT_FUNC |   65 ++
  include/configs/eNET.h   |1 +
  include/init_func.h  |   37 +
  tools/Makefile   |6 +
  tools/mkinitseq.c| 1512
 ++ 32 files changed, 1746
 insertions(+), 9 deletions(-)
  create mode 100644 doc/README.INIT_FUNC
  create mode 100644 include/init_func.h
  create mode 100644 tools/mkinitseq.c

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


Re: [U-Boot] [PATCH 1/3] init_func: Add fundamental framework

2012-05-02 Thread Marek Vasut
Dear Graeme Russ,

 Signed-off-by: Graeme Russ graeme.r...@gmail.com
 ---
  Makefile |   34 ++-
  common/Makefile  |2 +
  config.mk|2 +
  doc/README.INIT_FUNC |   65 +++
  include/init_func.h  |   37 ++
  tools/Makefile   |6 +
  tools/mkinitseq.c| 1512
 ++ 7 files changed, 1657
 insertions(+), 1 deletions(-)
  create mode 100644 doc/README.INIT_FUNC
  create mode 100644 include/init_func.h
  create mode 100644 tools/mkinitseq.c
 

[...]

 --- /dev/null
 +++ b/doc/README.INIT_FUNC
 @@ -0,0 +1,65 @@
 +The INIT_FUNC macro allows initialisation functions (i.e. functions which
 are +executed before the main loop) to be easily added to the init
 sequence +
 +
 +Specifying an Initialisation Function and is Dependencies
 +-
 +The format of the INIT_FUNC macro is:
 +
 +INIT_FUNC(fn, grp, man_reqs, pre_reqs, pst_reqs)
 +
 +fn is the name of the init function to call. This function must have the
 +following prototype:
 +
 +int foo(void);

What if I want to pass some data to such a func ? Clearly, I can think of this 
being doable, but extra hard.

 +
 +Each init function must return 0 to indicate success - any other return
 value +indicates failure and the init sequence will stop
 +
 +grp is the name of the group that the init function belongs to. grp may be
 +the same as fn for any individual init function, but between init
 functions, +fn and grp must be unique.
 +
 +The purpose of groups is to allow functions to be grouped together so
 other +functions can specify the group as a whole as a dependency rather
 than having +to list every function in the group in the dependency list
 +
 +man_reqs is a space seperated list of functions or groups that MUST exist
 and +MUST run BEFORE fn
 +
 +pre_reqs is a space seperated list of functions or groups that MAY exist
 and +(if they do) MUST run BEFORE fn
 +
 +pst_reqs is a space seperated list of functions or groups that MAY exist
 and +(if they do) MUST run AFTER fn

What's the point? Can't you create a kind of proxy object that the pst_reqs 
will 
have as a pre_req ?

Maybe you should create this:

INIT_FUNC(fn, grp, prereqs, postreqs) and for each function from prereqs and 
postreqs, specify per-function attributes via the GCC __attribute__(()) 
directive, like if the function must run before something or may run before 
something etc?
 +
 +Skipping or Replacing a Function or Group
 +-
 +Occassionally, a board may provide a completely seperate implementation
 for +an initialisation function that is provided in the common arch, SoC
 or +common code.
 +
 +SKIP_INIT(fn_or_group)
 +
 +After the initialisation function dependencies are calculated, all
 functions +and groups listed in any SKIP_INITs are removed - This may
 result in +dependent functions being removed - It is up to the board code
 developer +to ensure suitable replacements are in place
 +
 +REPLACE_INIT(old_fn_or_group, new_fn_or_group)
 +
 +Like SKIP_INIT but replaces on function with another (or one group with
 +another)
 +
 +Example: In the SoC code yoy may have

Yoy :)

 +
 +INIT_FUNC(init_cpu_f, RESET, , , );
 +
 +In the board code, you may want a slightly tweaked version, so you might
 +have:
 +
 +int my_new_init_cpu_f(void)
 +{
 + ...
 +}
 +REPLACE_INIT(init_cpu_f, my_new_init_cpu_f);
 diff --git a/include/init_func.h b/include/init_func.h
 new file mode 100644
 index 000..e4366b8
 --- /dev/null
 +++ b/include/init_func.h
 @@ -0,0 +1,37 @@
 +#ifndef __INIT_FUNC_H__
 +#define __INIT_FUNC_H__
 +
 +/*
 + * The requirements for any new initalization function is simple: it is
 + * a function with no parameters which returns an integer return code,
 + * where 0 means continue and != 0 means fatal error, hang the system
 + */
 +typedef int (init_fnc_t) (void);
 +
 +extern init_fnc_t *init_sequence_f[];
 +extern init_fnc_t *init_sequence_f_r[];
 +extern init_fnc_t *init_sequence_r[];
 +
 +#ifdef CONFIG_INIT_FUNC
 +#include linux/compiler.h
 +
 +#define INIT_FUNC(fn, grp, man_reqs, pre_reqs, pst_reqs) \
 + static const char __init_func_ ## fn[] __used \
 + __attribute__((__section__(.initfuncs))) = \
 + (f: #fn : #grp : #man_reqs  |  #pre_reqs  |  #pst_reqs )\n;
 +
 +#define SKIP_INIT(fn_or_group) \
 + static const char __skip_init_ ## fn_or_group[] __used \
 + __attribute__((__section__(.initfuncs))) = \
 + (s: #fn_or_group )\n;
 +
 +#define REPLACE_INIT(old_fn_or_group, new_fn_or_group) \
 + static const char __replace_init_ ## old_fn_or_group[] __used \
 + __attribute__((__section__(.initfuncs))) = \
 + (r: #old_fn_or_group : #new_fn_or_group )\n;
 +#else
 +#define INIT_FUNC(fn, group, man_reqs, pre_reqs, post_reqs)
 +#define SKIP_INIT(fn_or_group)
 +#define REPLACE_INIT(old_fn_or_group, new_fn_or_group)
 +#endif
 +#endif /* !__INIT_FUNC_H__ */
 diff --git a/tools/Makefile 

Re: [U-Boot] msm7630 mainline request

2012-05-02 Thread Marek Vasut
Dear mohamed.han...@lntinfotech.com,

 The patch for msm7630 was released to the u-boot community on 16-feb-2-2012
 can this be mainlined in v2012.07 release.The Patches contain the
 following support * low speed uart for msm7630
 * interprocessor communication
 * qc_mmc microcontroller
 * msm7630 soc
 * msm7630 surf board


It'd be great, CCing albert to review it as we don't have MSM maintainer.

 
 Thanks and regards,
 Mohamed Haneef M.A
 
 The contents of this e-mail and any attachment(s) may contain confidential
 or privileged information for the intended recipient(s). Unintended
 recipients are prohibited from taking action on the basis of information
 in this e-mail and  using or disseminating the information,  and must
 notify the sender and delete it from their system. LT Infotech will not
 accept responsibility or liability for the accuracy or completeness of, or
 the presence of any virus or disabling code in this e-mail
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] U-boot Required

2012-05-02 Thread Marek Vasut
Dear Amber and Sarosh,

  Hi
 
 Can somebody mail us the u-boot files for these PR1 Appliances? ;
 
 Appliance with 2xMT48LC32M8A2P-75 i.e. 64MB SDRAM
 
 Appliance with 2xhy57v56820bt-h

There are memory chips, correct?

 
 The one available on the switchfin site i.e. u-boot-pr1-ub2.30 is only for
 Appliance with 2xMT48LC64M8A2P-75 i.e. 128 MB SDRAM and is not working
 with other devices mentioned above.

Well, it seems to be an out-of-tree port, therefore we can not help you. You 
should contact the company that provided you with the board.

 
 
 
 Waiting for your response.
 
 
 
 Regards
 
 Amber and Sarosh

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


Re: [U-Boot] uboot and ZFS

2012-05-02 Thread Marek Vasut
Dear Jorgen Lundman,

 Sorry if I am posting some kind of FAQ here,
 
 I recently picked up a Cubox (arm) which uses uboot. Added ZFS to Linux and
 made it have a ZFS root filesystem. The only drawback is the small boot
 partition of ext2/fat to read uImage and initrd.
 
 So I am curious about adding ZFS support to uboot. Looking at the sources
 http://git.denx.de/cgi-bin/gitweb.cgi?p=u-boot.git;a=tree
 in particular, the ext2 work, I see it was once imported from GRUB.
 
 Comparing that with
 https://github.com/pendor/grub-zfs/tree/master/grub-core/fs/zfs which is a
 fork for ZFS support to GRUB.
 
 At first glance, it would suggest that it should be feasible to add ZFS to
 uboot. But since I only have 'usage-level knowledge' of both boot systems,
 I am unaware of any show-stoppers.

Oh please study this and submit a patch, I believe at least Pavel (CCed) would 
be glad to see it in :-)

 
 Perhaps memory/object-size is an issue? The ext2 code is some ~1100 lines
 in uboot, but ZFS is 2700 lines in GRUB. Or any of a thousand other issues
 I am unaware about.

Well the porting might be quite a long run indeed, but basic booting from this 
should not be that hard. Besides the code would be fairy separate, so it should 
be OK.

 Anyone already attempted such a project? Any resources available for such
 porting? Will I even be able to run my own version of uboot on the Cubox?

I don't know, sorry.
 
 Lund

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


Re: [U-Boot] [PATCH] tegra2: trivially enable 13 mhz crystal frequency

2012-05-02 Thread Marek Vasut
Dear Lucas Stach,

 This is needed for upcoming Toradex Colibri T20 upstream support.

Neat, you're doing support for this board? That'd be great to have :) Keep me 
in 
CC, I have one and I'd be glad to review patches. (I hope you noticed the work 
of antmicro on the tegra/u-boot)

 
 Signed-off-by: Lucas Stach d...@lynxeye.de
 ---
  arch/arm/cpu/armv7/tegra2/clock.c |5 -
  1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/arch/arm/cpu/armv7/tegra2/clock.c
 b/arch/arm/cpu/armv7/tegra2/clock.c index 39376ab..8084631 100644
 --- a/arch/arm/cpu/armv7/tegra2/clock.c
 +++ b/arch/arm/cpu/armv7/tegra2/clock.c
 @@ -1027,7 +1027,10 @@ void clock_early_init(void)
   clock_set_rate(CLOCK_ID_CGENERAL, 600, 26, 0, 8);
   break;
 
 - case CLOCK_OSC_FREQ_13_0:
 + case CLOCK_OSC_FREQ_13_0: /* OSC is 13Mhz */
 + clock_set_rate(CLOCK_ID_PERIPH, 432, 13, 1, 8);
 + clock_set_rate(CLOCK_ID_CGENERAL, 600, 13, 0, 8);
 + break;
   case CLOCK_OSC_FREQ_19_2:
   default:
   /*

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


Re: [U-Boot] [PATCH] misc:pmic:trats: Correct procedure of enabling/disabling USB regulators

2012-05-02 Thread Minkyu Kang
Dear Marek Vasut,

On 26 April 2012 18:30, Lukasz Majewski l.majew...@samsung.com wrote:
 In the MAX8997, LDO regulators needs to preserve previously set voltage
 values.

 Signed-off-by: Lukasz Majewski l.majew...@samsung.com
 Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
 Cc: Minkyu Kang mk7.k...@samsung.com
 ---
  board/samsung/trats/trats.c |   15 +++
  1 files changed, 11 insertions(+), 4 deletions(-)

On the patchwork, this Lukasz's patch is delegated to you and state is
Change Request.
(http://patchwork.ozlabs.org/patch/155204/)
Is it mistake? or I missed something?
Please let me know. :)

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] exynos5: Add system register structure

2012-05-02 Thread Kyungmin Park
+ Minkyu,

On 5/3/12, Marek Vasut ma...@denx.de wrote:
 Dear Rajeshwari Shinde,

 This patch add structure for SYSREG.

 Ccing Minkyu. Can I get your opinion on these patches please?


 Signed-off-by: Che-Liang Chiou clch...@chromium.org
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 Reviewed-by: Vivek Gautam gautam.vi...@samsung.com
 Reviewed-by: Simon Glass s...@chromium.org
 ---
  arch/arm/include/asm/arch-exynos/sysreg.h |   43
 + 1 files changed, 43 insertions(+), 0
 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h

 diff --git a/arch/arm/include/asm/arch-exynos/sysreg.h
 b/arch/arm/include/asm/arch-exynos/sysreg.h new file mode 100644
 index 000..aca4b2b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-exynos/sysreg.h
 @@ -0,0 +1,43 @@
 +/*
 + * (C) Copyright 2012 Samsung Electronics
 + * Register map for sysreg
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#ifndef __EXYNOS5_SYSREG_H__
 +#define __EXYNOS5_SYSREG_H__
 +
 +#ifndef __ASSEMBLY__
 +/* sysreg map */
 +struct exynos5_sysreg {
 +/* Add registers as and when required */
 +unsigned char   res1[0x214];
 +unsigned intdisp1blk_cfg;
 +unsigned intdispblk_cfg2;
 +unsigned inthdcp_e_fuse_mem_cfg;
 +unsigned intgsclblk_cfg0;
 +unsigned intgsclblk_cfg1;
 +unsigned intispblk_cfg;
 +unsigned intusb20_phy_cfg;
 +unsigned char   res2[0x29c];
 +unsigned intmipi_dphy;
 +unsigned intdptx_phy;
 +unsigned intphyclk_sel;
 +};
 +#endif
 +
 +#endif

 Best regards,
 Marek Vasut
 ___
 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 0/5] exynos5: usb: Enable USB 2.0 support

2012-05-02 Thread Kyungmin Park
Hi,

Can you share the purpose of USB host support at bootloader?

Just curious.

Thank you,
Kyungmin Park

On 5/2/12, Rajeshwari Shinde rajeshwar...@samsung.com wrote:
 This patchset series adds support to enable USB 2.0 on smdk5250.
 It includes addition of system and power management registers,
 functions to enable and disable power to the USB host controller.

 This patchset is based on:
 USB: S5P: Add ehci support.patch

 Rajeshwari Shinde (5):
   exynos5: Add system register structure
   exynos5: Add structure for PMU register
   exynos5: Add power Enable/Disable for USB-EHCI
   exynos5: usb: Fix incorrect USB base addresses
   exynos5: usb: Enable USB 2.0 on smdk5250

  arch/arm/cpu/armv7/exynos/power.c |   59 +++
  arch/arm/include/asm/arch-exynos/cpu.h|5 +-
  arch/arm/include/asm/arch-exynos/power.h  |  627
 +
  arch/arm/include/asm/arch-exynos/sysreg.h |   44 ++
  drivers/usb/host/ehci-s5p.c   |3 +
  include/configs/smdk5250.h|6 +
  6 files changed, 742 insertions(+), 2 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h

 --
 1.7.4.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


[U-Boot] [PATCH 1/1] fat: FAT sector offsets overflow on large disks and/or FAT partitions

2012-05-02 Thread Aaron Williams
This patch fixes several issues where sector offsets can overflow due to
being limited to 16-bits.  There are many cases which can cause an
overflow, including large FAT32 partitions and partitions that start at
a sufficiently large offset on the storage device.

Numerous issues were observed and fixed when a 64GB FAT32 filesystem was
accessed due to truncation.

Signed-off-by: Aaron Williams aaron.willi...@caviumnetworks.com
---
 include/fat.h |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/fat.h b/include/fat.h
index 4c92442..7215628 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -178,12 +178,12 @@ typedef struct dir_slot {
 typedef struct {
__u8*fatbuf;/* Current FAT buffer */
int fatsize;/* Size of FAT in bits */
-   __u16   fatlength;  /* Length of FAT in sectors */
-   __u16   fat_sect;   /* Starting sector of the FAT */
-   __u16   rootdir_sect;   /* Start sector of root directory */
-   __u16   sect_size;  /* Size of sectors in bytes */
+   __u32   fat_sect;   /* Starting sector of the FAT */
+   __u32   rootdir_sect;   /* Start sector of root directory */
+   __u32   fatlength;  /* Length of FAT in sectors */
__u16   clust_size; /* Size of clusters in sectors */
-   short   data_begin; /* The sector of the first cluster, can be 
negative */
+   __u16   sect_size;  /* Size of sectors in bytes */
+   int data_begin; /* The sector of the first cluster, can be 
negative */
int fatbufnum;  /* Used by get_fatent, init to -1 */
 } fsdata;
 
-- 
1.7.7


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


Re: [U-Boot] [PATCH 0/5] exynos5: usb: Enable USB 2.0 support

2012-05-02 Thread Marek Vasut
Dear Kyungmin Park,

 Hi,
 
 Can you share the purpose of USB host support at bootloader?

You can boot the system completely off a USB stick ...

 
 Just curious.
 
 Thank you,
 Kyungmin Park
 
 On 5/2/12, Rajeshwari Shinde rajeshwar...@samsung.com wrote:
  This patchset series adds support to enable USB 2.0 on smdk5250.
  It includes addition of system and power management registers,
  functions to enable and disable power to the USB host controller.
  
  This patchset is based on:
  USB: S5P: Add ehci support.patch
  
  Rajeshwari Shinde (5):
exynos5: Add system register structure
exynos5: Add structure for PMU register
exynos5: Add power Enable/Disable for USB-EHCI
exynos5: usb: Fix incorrect USB base addresses
exynos5: usb: Enable USB 2.0 on smdk5250
   
   arch/arm/cpu/armv7/exynos/power.c |   59 +++
   arch/arm/include/asm/arch-exynos/cpu.h|5 +-
   arch/arm/include/asm/arch-exynos/power.h  |  627
  
  +
  
   arch/arm/include/asm/arch-exynos/sysreg.h |   44 ++
   drivers/usb/host/ehci-s5p.c   |3 +
   include/configs/smdk5250.h|6 +
   6 files changed, 742 insertions(+), 2 deletions(-)
   create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h
  
  --
  1.7.4.4
  
  ___
  U-Boot mailing list
  U-Boot@lists.denx.de
  http://lists.denx.de/mailman/listinfo/u-boot

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


Re: [U-Boot] [PATCH 1/3] init_func: Add fundamental framework

2012-05-02 Thread Graeme Russ
Hi Marek,

Thanks for taking a look


 +The INIT_FUNC macro allows initialisation functions (i.e. functions which
 are +executed before the main loop) to be easily added to the init
 sequence +
 +
 +Specifying an Initialisation Function and is Dependencies
 +-
 +The format of the INIT_FUNC macro is:
 +
 +INIT_FUNC(fn, grp, man_reqs, pre_reqs, pst_reqs)
 +
 +fn is the name of the init function to call. This function must have the
 +following prototype:
 +
 +int foo(void);

 What if I want to pass some data to such a func ? Clearly, I can think of this
 being doable, but extra hard.

The idea is that no changes are being made to the existing init methodology.

 +
 +Each init function must return 0 to indicate success - any other return
 value +indicates failure and the init sequence will stop
 +
 +grp is the name of the group that the init function belongs to. grp may be
 +the same as fn for any individual init function, but between init
 functions, +fn and grp must be unique.
 +
 +The purpose of groups is to allow functions to be grouped together so
 other +functions can specify the group as a whole as a dependency rather
 than having +to list every function in the group in the dependency list
 +
 +man_reqs is a space seperated list of functions or groups that MUST exist
 and +MUST run BEFORE fn
 +
 +pre_reqs is a space seperated list of functions or groups that MAY exist
 and +(if they do) MUST run BEFORE fn
 +
 +pst_reqs is a space seperated list of functions or groups that MAY exist
 and +(if they do) MUST run AFTER fn

 What's the point? Can't you create a kind of proxy object that the pst_reqs 
 will
 have as a pre_req ?

 Maybe you should create this:

 INIT_FUNC(fn, grp, prereqs, postreqs) and for each function from prereqs and
 postreqs, specify per-function attributes via the GCC __attribute__(())
 directive, like if the function must run before something or may run before
 something etc?

Eep, I would like to see that implemented - I'm sure it would be
'interesting'

The way INIT_FUNC and friends work is to simply build a list of static
strings (which we just happen to shove in a seperate section so they can
be filtered in/out based on the link stage)

 +
 +Skipping or Replacing a Function or Group
 +-
 +Occassionally, a board may provide a completely seperate implementation
 for +an initialisation function that is provided in the common arch, SoC
 or +common code.
 +
 +SKIP_INIT(fn_or_group)
 +
 +After the initialisation function dependencies are calculated, all
 functions +and groups listed in any SKIP_INITs are removed - This may
 result in +dependent functions being removed - It is up to the board code
 developer +to ensure suitable replacements are in place
 +
 +REPLACE_INIT(old_fn_or_group, new_fn_or_group)
 +
 +Like SKIP_INIT but replaces on function with another (or one group with
 +another)
 +
 +Example: In the SoC code yoy may have

 Yoy :)

Yes. The ultimate goal is to remove a heap of '#ifdef mess' and delegate
the selection of initialiasation functions to where is is most appropriate.
CPU init in ARCH code with board specific init in board code with the
ARCH code 100% unaware of what the board is doing. This will also make it
a lot easier for vendors to implement multi-arch solutions :)

 +
 +INIT_FUNC(init_cpu_f, RESET, , , );
 +
 +In the board code, you may want a slightly tweaked version, so you might
 +have:
 +
 +int my_new_init_cpu_f(void)
 +{
 +     ...
 +}
 +REPLACE_INIT(init_cpu_f, my_new_init_cpu_f);

[snip]

 diff --git a/tools/mkinitseq.c b/tools/mkinitseq.c
 new file mode 100644
 index 000..b150de4
 --- /dev/null
 +++ b/tools/mkinitseq.c
 @@ -0,0 +1,1512 @@

 Ok, this is the worst part. I think this could be reimplemented in shell ;-)

Be my guest :) - Have a really good look at what is happening behind the
scenes - Lots of list processing and checking. In particular, the processing
of the REPLACE and SKIP macros would be particularly nasty.

I have no problem with this being done in shell code. BUT if I have to do
so in order for it to be accepted, then I'll bin this patch series right
now. I'm more than happy to integrate somebody elses shell-based tool into
the series. Sorry to be so blunt, but I do not have the time or energy to
re-implement this myself.

My argument is that this is a black-box tool like gcc/ld. Once we prove it
to do what it does correctly, we can 'leave it alone'(tm) and test cases
are fairly trivial. You can even mock-up the input file in vi :)

And is a shell based implementation going to be any easier to understand,
modify, debug, etc?

 +/*
 + * (C) Copyright 2012
 + * Graeme Russ graeme.r...@gmail.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 

Re: [U-Boot] [PATCH 1/3] init_func: Add fundamental framework

2012-05-02 Thread Marek Vasut
Dear Graeme Russ,

 Hi Marek,
 
 Thanks for taking a look
 
  +The INIT_FUNC macro allows initialisation functions (i.e. functions
  which are +executed before the main loop) to be easily added to the
  init sequence +
  +
  +Specifying an Initialisation Function and is Dependencies
  +-
  +The format of the INIT_FUNC macro is:
  +
  +INIT_FUNC(fn, grp, man_reqs, pre_reqs, pst_reqs)
  +
  +fn is the name of the init function to call. This function must have
  the +following prototype:
  +
  +int foo(void);
  
  What if I want to pass some data to such a func ? Clearly, I can think of
  this being doable, but extra hard.
 
 The idea is that no changes are being made to the existing init
 methodology.

Well ... what if I want to pass eg. pdata?

 
  +
  +Each init function must return 0 to indicate success - any other return
  value +indicates failure and the init sequence will stop
  +
  +grp is the name of the group that the init function belongs to. grp may
  be +the same as fn for any individual init function, but between init
  functions, +fn and grp must be unique.
  +
  +The purpose of groups is to allow functions to be grouped together so
  other +functions can specify the group as a whole as a dependency rather
  than having +to list every function in the group in the dependency list
  +
  +man_reqs is a space seperated list of functions or groups that MUST
  exist and +MUST run BEFORE fn
  +
  +pre_reqs is a space seperated list of functions or groups that MAY
  exist and +(if they do) MUST run BEFORE fn
  +
  +pst_reqs is a space seperated list of functions or groups that MAY
  exist and +(if they do) MUST run AFTER fn
  
  What's the point? Can't you create a kind of proxy object that the
  pst_reqs will have as a pre_req ?
  
  Maybe you should create this:
  
  INIT_FUNC(fn, grp, prereqs, postreqs) and for each function from prereqs
  and postreqs, specify per-function attributes via the GCC
  __attribute__(()) directive, like if the function must run before
  something or may run before something etc?
 
 Eep, I would like to see that implemented - I'm sure it would be
 'interesting'

Pervy and sadistic at least :-)

 The way INIT_FUNC and friends work is to simply build a list of static
 strings (which we just happen to shove in a seperate section so they can
 be filtered in/out based on the link stage)

Yes, I got the understanding of it. I was more bothered by the man_reqs and 
pre_reqs, what if we soon need functions that are executed under another weird 
condition? And if you look at it the other way -- if you need function that's 
executed conditionally, why not wrap the condition into the pre_req (or some 
proxy object, whatever).

 
  +
  +Skipping or Replacing a Function or Group
  +-
  +Occassionally, a board may provide a completely seperate implementation
  for +an initialisation function that is provided in the common arch, SoC
  or +common code.
  +
  +SKIP_INIT(fn_or_group)
  +
  +After the initialisation function dependencies are calculated, all
  functions +and groups listed in any SKIP_INITs are removed - This may
  result in +dependent functions being removed - It is up to the board
  code developer +to ensure suitable replacements are in place
  +
  +REPLACE_INIT(old_fn_or_group, new_fn_or_group)
  +
  +Like SKIP_INIT but replaces on function with another (or one group with
  +another)
  +
  +Example: In the SoC code yoy may have
  
  Yoy :)
 
 Yes. The ultimate goal is to remove a heap of '#ifdef mess' and delegate
 the selection of initialiasation functions to where is is most appropriate.
 CPU init in ARCH code with board specific init in board code with the
 ARCH code 100% unaware of what the board is doing. This will also make it
 a lot easier for vendors to implement multi-arch solutions :)

Correct, alongside kbuild and driver model, we'll make an awesome bootloader. 
But fix that s/yoy/you/ please ;-)

  +
  +INIT_FUNC(init_cpu_f, RESET, , , );
  +
  +In the board code, you may want a slightly tweaked version, so you
  might +have:
  +
  +int my_new_init_cpu_f(void)
  +{
  + ...
  +}
  +REPLACE_INIT(init_cpu_f, my_new_init_cpu_f);
 
 [snip]
 
  diff --git a/tools/mkinitseq.c b/tools/mkinitseq.c
  new file mode 100644
  index 000..b150de4
  --- /dev/null
  +++ b/tools/mkinitseq.c
  @@ -0,0 +1,1512 @@
  
  Ok, this is the worst part. I think this could be reimplemented in shell
  ;-)
 
 Be my guest :) - Have a really good look at what is happening behind the
 scenes - Lots of list processing and checking. In particular, the
 processing of the REPLACE and SKIP macros would be particularly nasty.

That's what sed can do for you, can't it ?

 I have no problem with this being done in shell code. BUT if I have to do
 so in order for it to be accepted, then I'll bin this patch series right
 now. I'm more than happy to integrate somebody elses shell-based tool into
 the 

Re: [U-Boot] [PATCH] checkpatch: warn of whitespace before semicolon at end of line.

2012-05-02 Thread Eric Nelson

On 05/02/2012 08:00 PM, Mike Frysinger wrote:

On Tuesday 01 May 2012 18:06:16 Eric Nelson wrote:

  tools/checkpatch.pl |6 ++
  1 files changed, 6 insertions(+), 0 deletions(-)


should be sent to lkml/kbuild lists ...
-mike


Thanks for the pointer Mike.

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


[U-Boot] [PATCH] checkpatch: add check for whitespace before semicolon at end-of-line

2012-05-02 Thread Eric Nelson
This tests for a bad habits of mine like this:

return 0 ;

Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
---
 scripts/checkpatch.pl |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a3b9782..0e6977e 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3227,6 +3227,12 @@ sub process {
 Statements terminations use 1 semicolon\n . 
$herecurr);
}
 
+# check for whitespace before semicolon - not allowed at end-of-line
+   if ($line =~ /\s+;$/) {
+   WARN(SPACEBEFORE_SEMICOLON,
+Whitespace before semicolon\n . $herecurr);
+   }
+
 # check for gcc specific __FUNCTION__
if ($line =~ /__FUNCTION__/) {
WARN(USE_FUNC,
-- 
1.7.9

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


[U-Boot] [PATCH] Add gc-section support for ARM

2012-05-02 Thread Charles Manning
Seems odd that this hasn't been done yet.
Shaves 5k off an omap overo build.

Signed-off-by: Charles Manning cdhmann...@gmail.com
---
 arch/arm/config.mk |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 45f9dca..73e0cce 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -55,6 +55,10 @@ PF_CPPFLAGS_ABI := $(call cc-option,\
)
 PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARM) $(PF_CPPFLAGS_ABI)
 
+PLATFORM_RELFLAGS += -ffunction-sections
+
+LDFLAGS_FINAL += --gc-sections
+
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
 # This file is parsed many times, so the string may get added multiple
-- 
1.7.1

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


Re: [U-Boot] [PATCH] powerpc/85xx: fix NAND boot linker scripts for -fpic

2012-05-02 Thread Chunhe Lan



Scott Wood wrote:

GOT is now handled the way the main u-boot.lds does it.  Without this,
the boot hangs when built with newer GCC (since 4.6).  Older toolchains
hid the issue by converting -fpic to -fPIC.

Signed-off-by: Scott Wood scottw...@freescale.com
  

Tested-by: Chunhe Lan chunhe@freescale.com


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


Re: [U-Boot] Porting u-boot for MPC8280 based board.

2012-05-02 Thread Thirumalesha N
On Wed, May 2, 2012 at 7:15 PM, Wolfgang Denk w...@denx.de wrote:

 Dear Thirumalesha N,

 Please keep the mailing list on Cc:

 In message 
 cao1rv-ayvvrd1urk3eq3asyqz2rrddpyyaexstktjh7tbuq...@mail.gmail.com you
 wrote:
 
   Unable to get a BDI tool. Am trying to do directly.

 Please feel free to contact off...@denx.de for a quotation.


   Thank you sir, i will contact shortly


   Please can you explain me where the u-boot starts execution ? means
  not address. In source code which line or file executes first?

 U-Boot starts at the reset vector; in code, see label _start in
 arch/powerpc/cpu/mpc8260/start.S


   To enable console on SMC( There are 2 SMC in MPC8280, we using SMC2
means Pin no. PA9 ( Tx ) and PA8 (Rx) ).
   I modified as follows

+ /* PA9  */ { 1,  1,   0,   1,   0,   0 }, /* SMC Tx */
+ /* PA8  */ { 1,  1,   0,   0,   0,   0 }, /* SMC Rx */

 */
+#define CONFIG_CONS_ON_SMC /* define if console on SMC */
+#undef CONFIG_CONS_ON_SCC /* define if console on SCC */
+#undef CONFIG_CONS_NONE /* define if console on something else */
+#define CONFIG_CONS_INDEX 2 /* which serial channel for console */


+#define CONFIG_HARD_I2C   1
+# define CFG_I2C_SPEED 5
+# define CFG_I2C_SLAVE 0xFE

+/* system clock rate (CLKIN) - equal to the 60x and local bus speed */
+#define CONFIG_8260_CLKIN 1 /* in Hz */
+
+#define CONFIG_BAUDRATE 115200

Still am not getting any think on console, The SMC ports are inbuilt,  it
needs any serial driver to modify or any other files?
Please suggest me to come out of this problem.

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


Re: [U-Boot] [PATCH] checkpatch: add check for whitespace before semicolon at end-of-line

2012-05-02 Thread Joe Perches
On Wed, 2012-05-02 at 20:32 -0700, Eric Nelson wrote:
 This tests for a bad habits of mine like this:
 
   return 0 ;
 
 Signed-off-by: Eric Nelson eric.nel...@boundarydevices.com
 ---
  scripts/checkpatch.pl |6 ++
  1 files changed, 6 insertions(+), 0 deletions(-)
 
 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
 index a3b9782..0e6977e 100755
 --- a/scripts/checkpatch.pl
 +++ b/scripts/checkpatch.pl
 @@ -3227,6 +3227,12 @@ sub process {
Statements terminations use 1 semicolon\n . 
 $herecurr);
   }
  
 +# check for whitespace before semicolon - not allowed at end-of-line
 + if ($line =~ /\s+;$/) {

if ($line =~ /\s+;\s*$/)

 + WARN(SPACEBEFORE_SEMICOLON,

WARN(SPACING,

 +  Whitespace before semicolon\n . $herecurr);
 + }
 +


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


Re: [U-Boot] uboot and ZFS

2012-05-02 Thread Jorgen Lundman

At first glance, it would suggest that it should be feasible to add ZFS to
uboot. But since I only have 'usage-level knowledge' of both boot systems,
I am unaware of any show-stoppers.


Oh please study this and submit a patch, I believe at least Pavel (CCed) would
be glad to see it in :-)


Well the porting might be quite a long run indeed, but basic booting from this
should not be that hard. Besides the code would be fairy separate, so it should
be OK.


I took the existing CuBox u-boot, and compiled. Then found the EXT4 patches 
done by Siemens, and practised merging that in, compiling, and flashing the 
cubox. I can now boot EXT4. So that is encouraging.


Looking at GRUB zfs, it defines similar functions, namely open(), mount(), 
read(), close() and list(). So perhaps I can get something done. Is there 
quicker ways to test uboot than to flash the hardware every time?


What is the general patch acceptance around, I see ext4 wasn't accepted, 
what are the chances my patches would be?


Lund





--
Jorgen Lundman   | lund...@lundman.net
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo| +81 (0)90-5578-8500  (cell)
Japan| +81 (0)3 -3375-1767  (home)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] uboot and ZFS

2012-05-02 Thread Jorgen Lundman




done by Siemens, and practised merging that in, compiling, and flashing the


Samsung! My bad, credits where due!


--
Jorgen Lundman   | lund...@lundman.net
Unix Administrator   | +81 (0)3 -5456-2687 ext 1017 (work)
Shibuya-ku, Tokyo| +81 (0)90-5578-8500  (cell)
Japan| +81 (0)3 -3375-1767  (home)
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/5] exynos5: Add system register structure

2012-05-02 Thread Chander Kashyap
Dear Rajeshwari,

On 2 May 2012 21:23, Marek Vasut ma...@denx.de wrote:
 Dear Rajeshwari Shinde,

 This patch add structure for SYSREG.

 Ccing Minkyu. Can I get your opinion on these patches please?


 Signed-off-by: Che-Liang Chiou clch...@chromium.org
 Signed-off-by: Rajeshwari Shinde rajeshwar...@samsung.com
 Reviewed-by: Vivek Gautam gautam.vi...@samsung.com
 Reviewed-by: Simon Glass s...@chromium.org
 ---
  arch/arm/include/asm/arch-exynos/sysreg.h |   43
 + 1 files changed, 43 insertions(+), 0
 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/sysreg.h

 diff --git a/arch/arm/include/asm/arch-exynos/sysreg.h
 b/arch/arm/include/asm/arch-exynos/sysreg.h new file mode 100644
 index 000..aca4b2b
 --- /dev/null
 +++ b/arch/arm/include/asm/arch-exynos/sysreg.h
 @@ -0,0 +1,43 @@
 +/*
 + * (C) Copyright 2012 Samsung Electronics
 + * Register map for sysreg
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License as
 + * published by the Free Software Foundation; either version 2 of
 + * the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 + * MA 02111-1307 USA
 + */
 +
 +#ifndef __EXYNOS5_SYSREG_H__
 +#define __EXYNOS5_SYSREG_H__
 +
 +#ifndef __ASSEMBLY__
 +/* sysreg map */
 +struct exynos5_sysreg {
 +     /* Add registers as and when required */
 +     unsigned char   res1[0x214];
 +     unsigned int    disp1blk_cfg;
 +     unsigned int    dispblk_cfg2;
 +     unsigned int    hdcp_e_fuse_mem_cfg;
 +     unsigned int    gsclblk_cfg0;
 +     unsigned int    gsclblk_cfg1;
 +     unsigned int    ispblk_cfg;
 +     unsigned int    usb20_phy_cfg;
 +     unsigned char   res2[0x29c];
 +     unsigned int    mipi_dphy;
 +     unsigned int    dptx_phy;
 +     unsigned int    phyclk_sel;
 +};
 +#endif
 +
 +#endif

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

Acked-by: Chander kashyap chander.kash...@linaro.org


-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot