Re: [U-Boot] [PATCH v2] 83xx: add support for ve8313 board

2010-07-06 Thread Heiko Schocher
Hello Stefan,

Stefan Roese wrote:
> On Wednesday 07 July 2010 06:28:21 Heiko Schocher wrote:
>> This patch add support for the ve8313 board based on
>> Freescale MPC8313 CPU.
>>
>> - serial console on UART 1
>> - 128 MB DDR RAM
>> - 32 MB NOR Flash
>> - 16 MB NAND Flash
> 
> Just checking: Is this really *only* 16 MiB NAND flash?

Yep, it is a NAND128W3A2BN6E from Numonyx

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


[U-Boot] [PATCH v1]ppc4xx/Canyonlands added USB board callbacks

2010-07-06 Thread Rupjyoti Sarmah
Functions added to support board callbacks for USB init. This
isolates USB manipulations such that it is only touched if USB is
used by U-Boot.

Signed-off-by: Dave Mitchell 
Signed-off-by: Rupjyoti Sarmah 
---
This patch incorporates the changes advised.

 board/amcc/canyonlands/canyonlands.c |   64 +-
 include/configs/canyonlands.h|   13 +++
 2 files changed, 68 insertions(+), 9 deletions(-)

diff --git a/board/amcc/canyonlands/canyonlands.c 
b/board/amcc/canyonlands/canyonlands.c
index 23874d2..ce3ddc2 100644
--- a/board/amcc/canyonlands/canyonlands.c
+++ b/board/amcc/canyonlands/canyonlands.c
@@ -34,7 +34,17 @@ extern flash_info_t flash_info[CONFIG_SYS_MAX_FLASH_BANKS]; 
/* info for FLASH ch
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define CONFIG_SYS_BCSR3_PCIE  0x10
+   struct ep460c_bcsr {
+   u8  board_id;
+   u8  cpld_rev;
+   u8  led_user;
+   u8  board_status;
+   u8  reset_ctrl;
+   u8  flash_ctrl;
+   u8  eth_ctrl;
+   u8  usb_ctrl;
+   u8  irq_ctrl;
+};
 
 #define BOARD_CANYONLANDS_PCIE 1
 #define BOARD_CANYONLANDS_SATA 2
@@ -112,6 +122,9 @@ int board_early_init_f(void)
 {
 #if !defined(CONFIG_ARCHES)
u32 sdr0_cust0;
+   struct ep460c_bcsr *bcsr_data =
+   (struct ep460c_bcsr *)CONFIG_SYS_BCSR_BASE;
+
 #endif
 
/*
@@ -172,14 +185,10 @@ int board_early_init_f(void)
 
 #if !defined(CONFIG_ARCHES)
/* Enable ethernet and take out of reset */
-   out_8((void *)CONFIG_SYS_BCSR_BASE + 6, 0);
+   out_8(&bcsr_data->eth_ctrl, 0) ;
 
/* Remove NOR-FLASH, NAND-FLASH & EEPROM hardware write protection */
-   out_8((void *)CONFIG_SYS_BCSR_BASE + 5, 0);
-
-   /* Enable USB host & USB-OTG */
-   out_8((void *)CONFIG_SYS_BCSR_BASE + 7, 0);
-
+   out_8(&bcsr_data->flash_ctrl, 0) ;
mtsdr(SDR0_SRST1, 0);   /* Pull AHB out of reset default=1 */
 
/* Setup PLB4-AHB bridge based on the system address map */
@@ -201,6 +210,41 @@ int board_early_init_f(void)
return 0;
 }
 
+#if defined(CONFIG_USB_OHCI_NEW) && defined(CONFIG_SYS_USB_OHCI_BOARD_INIT)
+int usb_board_init(void)
+{
+   struct ep460c_bcsr *bcsr_data =
+   (struct ep460c_bcsr *)CONFIG_SYS_BCSR_BASE;
+   u8 val;
+
+   /* Enable USB host & USB-OTG */
+   val = in_8(&bcsr_data->usb_ctrl);
+   val &= ~(BCSR_USBCTRL_OTG_RST | BCSR_USBCTRL_HOST_RST);
+   out_8(&bcsr_data->usb_ctrl, val);
+
+   return 0;
+}
+
+int usb_board_stop(void)
+{
+   struct ep460c_bcsr *bcsr_data =
+   (struct ep460c_bcsr *)CONFIG_SYS_BCSR_BASE;
+   u8 val;
+
+   /* Disable USB host & USB-OTG */
+   val = in_8(&bcsr_data->usb_ctrl);
+   val |= (BCSR_USBCTRL_OTG_RST | BCSR_USBCTRL_HOST_RST);
+   out_8(&bcsr_data->usb_ctrl, val);
+
+   return 0;
+}
+
+int usb_board_init_fail(void)
+{
+   return usb_board_stop();
+}
+#endif /* CONFIG_USB_OHCI_NEW && CONFIG_SYS_USB_OHCI_BOARD_INIT */
+
 #if !defined(CONFIG_ARCHES)
 static void canyonlands_sata_init(int board_type)
 {
@@ -244,11 +288,13 @@ int get_cpu_num(void)
 #if !defined(CONFIG_ARCHES)
 int checkboard(void)
 {
+   struct ep460c_bcsr *bcsr_data =
+   (struct ep460c_bcsr *)CONFIG_SYS_BCSR_BASE;
char *s = getenv("serial#");
 
if (pvr_460ex()) {
printf("Board: Canyonlands - AMCC PPC460EX Evaluation Board");
-   if (in_8((void *)(CONFIG_SYS_BCSR_BASE + 3)) & 
CONFIG_SYS_BCSR3_PCIE)
+   if (bcsr_data->board_status & CONFIG_SYS_BCSR3_PCIE)
gd->board_type = BOARD_CANYONLANDS_PCIE;
else
gd->board_type = BOARD_CANYONLANDS_SATA;
@@ -268,7 +314,7 @@ int checkboard(void)
break;
}
 
-   printf(", Rev. %X", in_8((void *)(CONFIG_SYS_BCSR_BASE + 0)));
+   printf(", Rev. %X", bcsr_data->cpld_rev);
 
if (s != NULL) {
puts(", serial# ");
diff --git a/include/configs/canyonlands.h b/include/configs/canyonlands.h
index ac9b3c5..e0ac3a2 100644
--- a/include/configs/canyonlands.h
+++ b/include/configs/canyonlands.h
@@ -77,6 +77,18 @@
 #define CONFIG_SYS_PCIE0_XCFGBASE  0xc300
 #define CONFIG_SYS_PCIE1_XCFGBASE  0xc3001000
 
+/*
+ * BCSR bits as defined in the ep460c board user manual
+ */
+#define BCSR_CPLDREV   0x00
+#define BCSR_BRDSTS0x03
+#define BCSR_FLASHCTRL 0x05
+#define BCSR_ETHCTRL   0x06
+#define BCSR_USBCTRL   0x07
+#define BCSR_USBCTRL_OTG_RST   0x32
+#define BCSR_USBCTRL_HOST_RST  0x01
+#define CONFIG_SYS_BCSR3_PCIE  0x10
+
 #defineCONFIG_SYS_PCIE0_UTLBASE0xc0801ULL  /* 36bit 
physical addr  */
 
 /* base address of inbound PCIe window */
@@ -417,6 +429,7 @@
 #define CONFIG_SYS_USB_OHCI_REGS_BASE  (CONFIG_SYS_AHB_BASE | 0xd00

Re: [U-Boot] [PATCH v2] 83xx: add support for ve8313 board

2010-07-06 Thread Stefan Roese
Hi Heiko,

On Wednesday 07 July 2010 06:28:21 Heiko Schocher wrote:
> This patch add support for the ve8313 board based on
> Freescale MPC8313 CPU.
> 
> - serial console on UART 1
> - 128 MB DDR RAM
> - 32 MB NOR Flash
> - 16 MB NAND Flash

Just checking: Is this really *only* 16 MiB NAND flash?

Cheers,
Stefan

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


Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-06 Thread Reinhard Meyer
Andrew Dyer wrote:
> NAK.
>
> I2C_TRISTATE is supposed to be persistent until I2C_ACTIVE is called,
> so in the original code it should still be in effect when I2C_SDA(1)
> is executed and there should be no contention.  This patch causes the
> code to actively drive SDA high at the same time the addressed device
> might be driving it low, causing contention until the I2C_TRISTATE
> takes effect.
>   
Right.
Whenever possible by the hardware, I make I2C_SDA/SCL(1) do a tri-state and
I2C_TRISTATE and I2C_ACTIVE are empty.
> In some sense the code is misleadingly written, as it is not allowed
> in the spec to actively drive a '1' on the bus, a chip is only
> supposed to drive 'z' or '0', and the platform is supposed to provide
> the pullup current.  This comes more into play if the i2c bus supports
> clock stretching or arbitration among multiple masters.
>   
I might point out that the soft I2C as it is does not support clock 
stretching. Unless you
add the wait for SCL high into I2C_SCL(1) yourself.

Reinhard


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


Re: [U-Boot] [PATCH] i2c: fix SDA contention in read_byte()

2010-07-06 Thread Andrew Dyer
On Tue, Jul 6, 2010 at 1:14 AM, Thomas Chou  wrote:
> We should not set SDA after TRISTATE, as it results in contention.
>
> Signed-off-by: Thomas Chou 
> ---
>  drivers/i2c/soft_i2c.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/i2c/soft_i2c.c b/drivers/i2c/soft_i2c.c
> index 847db76..344b7f8 100644
> --- a/drivers/i2c/soft_i2c.c
> +++ b/drivers/i2c/soft_i2c.c
> @@ -305,8 +305,8 @@ static uchar read_byte(int ack)
>        /*
>         * Read 8 bits, MSB first.
>         */
> -       I2C_TRISTATE;
>        I2C_SDA(1);
> +       I2C_TRISTATE;
>        data = 0;
>        for(j = 0; j < 8; j++) {
>                I2C_SCL(0);
> --

NAK.

I2C_TRISTATE is supposed to be persistent until I2C_ACTIVE is called,
so in the original code it should still be in effect when I2C_SDA(1)
is executed and there should be no contention.  This patch causes the
code to actively drive SDA high at the same time the addressed device
might be driving it low, causing contention until the I2C_TRISTATE
takes effect.

In some sense the code is misleadingly written, as it is not allowed
in the spec to actively drive a '1' on the bus, a chip is only
supposed to drive 'z' or '0', and the platform is supposed to provide
the pullup current.  This comes more into play if the i2c bus supports
clock stretching or arbitration among multiple masters.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH v2] 83xx: add support for ve8313 board

2010-07-06 Thread Heiko Schocher
This patch add support for the ve8313 board based on
Freescale MPC8313 CPU.

- serial console on UART 1
- 128 MB DDR RAM
- 32 MB NOR Flash
- 16 MB NAND Flash
- Ethernet MII Mode over on TSEC0
- micrel ksz804 phy
- Hardware WDT MAX824

Signed-off-by: Heiko Schocher 
---
changes since v1
- environment size = sector size
- use red. environment
- add comments from Kim Phillips
  - add MAKEALL, MAINTAINERS entry
  - Codingstyle issues fixed
  - inserted original Copyrights
  - PCI subsys vendor ID changed from 0x1057 (Motorola)
to 0x1957 (Freescale)

 MAINTAINERS  |1 +
 MAKEALL  |1 +
 board/ve8313/Makefile|   50 +
 board/ve8313/config.mk   |7 +
 board/ve8313/ve8313.c|  215 +++
 boards.cfg   |1 +
 include/configs/ve8313.h |  534 ++
 7 files changed, 809 insertions(+), 0 deletions(-)
 create mode 100644 board/ve8313/Makefile
 create mode 100644 board/ve8313/config.mk
 create mode 100644 board/ve8313/ve8313.c
 create mode 100644 include/configs/ve8313.h

diff --git a/MAINTAINERS b/MAINTAINERS
index d7aec98..88a3d79 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -427,6 +427,7 @@ Heiko Schocher 
sc3 PPC405GP
suen3   ARM926EJS (Kirkwood SoC)
uc101   MPC5200
+   ve8313  MPC8313

 Peter De Schrijver 

diff --git a/MAKEALL b/MAKEALL
index 27f8bd1..eedae60 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -379,6 +379,7 @@ LIST_83xx=" \
sbc8349 \
SIMPC8313_LP\
TQM834x \
+   ve8313  \
vme8349 \
 "

diff --git a/board/ve8313/Makefile b/board/ve8313/Makefile
new file mode 100644
index 000..c95f90e
--- /dev/null
+++ b/board/ve8313/Makefile
@@ -0,0 +1,50 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).a
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(AR) $(ARFLAGS) $@ $(OBJS)
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/ve8313/config.mk b/board/ve8313/config.mk
new file mode 100644
index 000..02dd33e
--- /dev/null
+++ b/board/ve8313/config.mk
@@ -0,0 +1,7 @@
+ifndef NAND_SPL
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
+endif
+
+ifndef TEXT_BASE
+TEXT_BASE = 0xfe00
+endif
diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c
new file mode 100644
index 000..7dfacfb
--- /dev/null
+++ b/board/ve8313/ve8313.c
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) Freescale Semiconductor, Inc. 2006-2007
+ *
+ * Author: Scott Wood 
+ *
+ * (C) Copyright 2010
+ * Heiko Schocher, DENX Software Engineering, h...@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 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+DECLARE_GLOBAL_DATA_PTR;
+
+extern void disable_addr_trans (void);
+extern void enable_addr_trans (void)

Re: [U-Boot] 83xx: add support for ve8313 board

2010-07-06 Thread Heiko Schocher
Hello Kim,

Kim Phillips wrote:
> On Mon, 5 Jul 2010 12:23:10 +0200
> Heiko Schocher  wrote:
> 
>> ---
>>  board/ve8313/Makefile|   50 +
>>  board/ve8313/config.mk   |   10 +
>>  board/ve8313/ve8313.c|  212 ++
>>  boards.cfg   |1 +
>>  include/configs/ve8313.h |  534 
>> ++
>>  5 files changed, 807 insertions(+), 0 deletions(-)
> 
> missing MAKEALL, MAINTAINERS entries, and, if there's anything unique
> about this board, a doc/README.ve8313.

There is nothing unique on this board, so don;t think a
doc/README.ve8313 is useful.

>> diff --git a/board/ve8313/config.mk b/board/ve8313/config.mk
> 
>> +ifndef TEXT_BASE
>> +#TEXT_BASE = 0x10
>> +TEXT_BASE = 0xfe00
>> +endif
>> +
>> +#PLATFORM_CPPFLAGS += -DDEBUG
> 
> please clean this up - remove commented out code.

fixed.

>> diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c
>> new file mode 100644
>> index 000..b13d1f3
>> --- /dev/null
>> +++ b/board/ve8313/ve8313.c
>> @@ -0,0 +1,212 @@
>> +/*
>> + * (C) Copyright 2010
>> + * Heiko Schocher, DENX Software Engineering, h...@denx.de.
> 
> this file contains code that looks like it was copied from files with
> Freescale copyrights; why are you deleting Freescale's copyrights?

Hups, Sorry for that.

>> +#if defined(CONFIG_OF_LIBFDT)
>> +#include 
>> +#endif
> 
> I realise this was copied in, but we don't need the ifdef anymore.

done.

>> +/* Fixed sdram init -- doesn't use serial presence detect.
>> + *
>> + * This is useful for faster booting in configs where the RAM is unlikely
>> + * to be changed, or for things like NAND booting where space is tight.
>> + */
> 
> Is the memory soldered on to the board?  If not, does the serial
> presence detect code not work for you?

It is soldered.

>> +#if defined(CONFIG_HW_WATCHDOG)
>> +clrbits_be32(&gpio->dat, (VE8313_WDT_EN | VE8313_WDT_TRIG));
>> +/* set WDT pins as output */
>> +setbits_be32(&gpio->dir, (VE8313_WDT_EN | VE8313_WDT_TRIG));
>> +#else
>> +/* disable WDT */
>> +setbits_be32(&gpio->dat, (VE8313_WDT_EN | VE8313_WDT_TRIG));
> 
> inner parens not necessary, also the last WDT_EN bit setting doesn't
> match the comment above it (ENable vs. disable) - perhaps nothing
> need be done if HW_WATCHDOG is not set?

I must explicitely disable the WDT.

>> +setbits_be32(&gpio->dat, (VE8313_WDT_TRIG));
>> +clrbits_be32(&gpio->dat, (VE8313_WDT_TRIG));
> 
> inner parens not necessary.

done.

> 
>> +#undef CONFIG_HW_WATCHDOG
> 
> no #undefs please.

removed.

>> +#define CONFIG_SYS_LBC_LBCR (0x0004)
> 
> parens not necessary.

fixed.

>> +#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057   /* Motorola */
> 
> It's Freescale: 0x1957.

fixed.

Thanks for your review.

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


Re: [U-Boot] 83xx: add support for ve8313 board

2010-07-06 Thread Kim Phillips
On Mon, 5 Jul 2010 12:23:10 +0200
Heiko Schocher  wrote:

> ---
>  board/ve8313/Makefile|   50 +
>  board/ve8313/config.mk   |   10 +
>  board/ve8313/ve8313.c|  212 ++
>  boards.cfg   |1 +
>  include/configs/ve8313.h |  534 
> ++
>  5 files changed, 807 insertions(+), 0 deletions(-)

missing MAKEALL, MAINTAINERS entries, and, if there's anything unique
about this board, a doc/README.ve8313.

> diff --git a/board/ve8313/config.mk b/board/ve8313/config.mk

> +ifndef TEXT_BASE
> +#TEXT_BASE = 0x10
> +TEXT_BASE = 0xfe00
> +endif
> +
> +#PLATFORM_CPPFLAGS += -DDEBUG

please clean this up - remove commented out code.

> diff --git a/board/ve8313/ve8313.c b/board/ve8313/ve8313.c
> new file mode 100644
> index 000..b13d1f3
> --- /dev/null
> +++ b/board/ve8313/ve8313.c
> @@ -0,0 +1,212 @@
> +/*
> + * (C) Copyright 2010
> + * Heiko Schocher, DENX Software Engineering, h...@denx.de.

this file contains code that looks like it was copied from files with
Freescale copyrights; why are you deleting Freescale's copyrights?

> +#if defined(CONFIG_OF_LIBFDT)
> +#include 
> +#endif

I realise this was copied in, but we don't need the ifdef anymore.

> +/* Fixed sdram init -- doesn't use serial presence detect.
> + *
> + * This is useful for faster booting in configs where the RAM is unlikely
> + * to be changed, or for things like NAND booting where space is tight.
> + */

Is the memory soldered on to the board?  If not, does the serial
presence detect code not work for you?

> +#if defined(CONFIG_HW_WATCHDOG)
> + clrbits_be32(&gpio->dat, (VE8313_WDT_EN | VE8313_WDT_TRIG));
> + /* set WDT pins as output */
> + setbits_be32(&gpio->dir, (VE8313_WDT_EN | VE8313_WDT_TRIG));
> +#else
> + /* disable WDT */
> + setbits_be32(&gpio->dat, (VE8313_WDT_EN | VE8313_WDT_TRIG));

inner parens not necessary, also the last WDT_EN bit setting doesn't
match the comment above it (ENable vs. disable) - perhaps nothing
need be done if HW_WATCHDOG is not set?

> + setbits_be32(&gpio->dat, (VE8313_WDT_TRIG));
> + clrbits_be32(&gpio->dat, (VE8313_WDT_TRIG));

inner parens not necessary.

> +#undef CONFIG_HW_WATCHDOG

no #undefs please.

> +#define CONFIG_SYS_LBC_LBCR  (0x0004)

parens not necessary.

> +#define CONFIG_SYS_PCI_SUBSYS_VENDORID 0x1057/* Motorola */

It's Freescale: 0x1957.

Thanks,

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


Re: [U-Boot] [PATCH 03/35] Blackfin: expand EVT1 usage documentation a bit more

2010-07-06 Thread Aldo Cedillo
>  #ifdef CONFIG_BFIN_BOOTROM_USES_EVT1
>        serial_putc('I');
> -       /* tell the bootrom where our entry point is */
> +       /* Tell the bootrom where our entry point is so that it knows
> +        * where to jump to when finishing processing the LDR.  This
> +        * allows us to avoid small jump blocks in the LDR, and also
> +        * works around anomaly 05000389 (init address in external
> +        * memory causes bootrom to trigger external addressing IVHW).
> +        */
>        if (CONFIG_BFIN_BOOT_MODE != BFIN_BOOT_BYPASS)
>                bfin_write_EVT1(CONFIG_SYS_MONITOR_BASE);
>  #endif

The comment format is like the kernel's one.

/*
 * Comment
 */

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


Re: [U-Boot] [PATCH 3/5] PXA: Voipac PXA270 Support

2010-07-06 Thread Marek Vasut
Dne Út 6. července 2010 20:41:56 Ben Warren napsal(a):
> Hi Marek,
> 
> On 7/5/2010 6:16 PM, Marek Vasut wrote:
> > This patch adds support for the Voipac PXA270 board. The support
> > includes: - Ethernet
> > - USB
> > - MMC
> > - NOR Booting
> > - OneNAND Booting
> > - LCD
> > - HDD
> > 
> > Signed-off-by: Marek Vasut
> > ---
> 
> 
> 
> > +#defineCONFIG_NETMASK  255.255.255.0
> > +#defineCONFIG_IPADDR   192.168.1.52
> > +#defineCONFIG_SERVERIP 192.168.1.51
> > +#defineCONFIG_ETHADDR  00:11:22:33:44:55
> > +#endif
> > +
> 
> Please remove these.  The same goes for the other boards.

Ok, removed. I pushed the new patches without this into -next-plat. Thanks
> 
> regards,
> Ben
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 3/5] PXA: Voipac PXA270 Support

2010-07-06 Thread Ben Warren
Hi Marek,

On 7/5/2010 6:16 PM, Marek Vasut wrote:
> This patch adds support for the Voipac PXA270 board. The support includes:
> - Ethernet
> - USB
> - MMC
> - NOR Booting
> - OneNAND Booting
> - LCD
> - HDD
>
> Signed-off-by: Marek Vasut
> ---
>

> +#define  CONFIG_NETMASK  255.255.255.0
> +#define  CONFIG_IPADDR   192.168.1.52
> +#define  CONFIG_SERVERIP 192.168.1.51
> +#define  CONFIG_ETHADDR  00:11:22:33:44:55
> +#endif
> +
>
Please remove these.  The same goes for the other boards.

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


Re: [U-Boot] [PATCH 15/35] Blackfin: bfin_nand: convert to portmux framework

2010-07-06 Thread Scott Wood
On Mon, Jul 05, 2010 at 05:30:20AM -0400, Mike Frysinger wrote:
> Rather than bang MMRs directly, use the new portmux framework to handle
> the details.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  drivers/mtd/nand/bfin_nand.c |   16 
>  1 files changed, 8 insertions(+), 8 deletions(-)

Acked-by: Scott Wood 

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


Re: [U-Boot] Need Help in bulding U-boot-2010-06 for OpenRD client

2010-07-06 Thread Albert ARIBAUD
Le 06/07/2010 17:47, kalyan karnati a écrit :
> Hi Albert,
> Thanks for your reply.
>
> I compiled U-boot with the patch that enables support for
> OpenRD_client and OpenRD_ultimate given by Tanmay.
> OpenRD Client is connected to PC/Host with FTDI programmed for Channel
> A as CPU FIFO.
>
> I'm using the binary for OpenOCD that I got from Marvell to tranfer
> uboot.bin into board's NAND.
> I copied the 'u-boot-2010.06.bin' in to
> ~\openocd\openocd.binaries.libftdi/bin as 'uboot.bin'.
> Then executed the command ' ./openocd –f target/board/openrd.cfg –c
> init -c openrd_reflash_uboot'
>
> Logs show:
> wrote file uboot.bin to NAND flash 0 up to offset 0x0004e800 in 50.190395s
> Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3
> (Manufacturer: 0x1e9, Part: 0x0a02, Version: 0x2)
> Info : JTAG Tap/device matched
>
> But then the board doesn't boot and the console is all blank :(
> Please let me know if I'm doing something wrong..
>
> Thanks,
> Kalyan.

Hi Kalyan,

At the moment the openrd image will only run if loaded into RAM through 
openocd.

I'd discussed with Tanmay about running the openrd binary: I'd tried to 
load it into RAM from the resident u-boot via TFTP, and that fails too.

In your case it will also certainly fail because the board config file 
contains #define CONFIG_SKIP_LOWLEVEL_INIT, which as the name implies 
skips very early and critical initialization code -- and without this 
code u-boot won't start from Flash (this config option is used precisely 
when running u-boot from RAM).

Can you try removing the #define and let us know if that fixes things up?

I'm not sure it will, though, because it fails when run in RAM from 
u-boot with the #define, which means it probably does not do some 
critical init --one that openocd does when it runs u-voot from RAM, 
since in that case it works.

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


[U-Boot] [PATCH V2 3/3] edmini: add IDE support

2010-07-06 Thread Albert Aribaud

Signed-off-by: Albert Aribaud 
---
 board/LaCie/edminiv2/edminiv2.c |   26 ++
 include/configs/edminiv2.h  |   29 +++--
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/board/LaCie/edminiv2/edminiv2.c b/board/LaCie/edminiv2/edminiv2.c
index 54c0ffe..84375c2 100644
--- a/board/LaCie/edminiv2/edminiv2.c
+++ b/board/LaCie/edminiv2/edminiv2.c
@@ -80,13 +80,39 @@ ulong board_flash_get_legacy(ulong base, int banknum, 
flash_info_t *info)
 }
 #endif /* CONFIG_SYS_FLASH_CFI */
 
+/*
+ * ED Mini V2 uses SATA PORT1. Initialize this port and
+ * disable low power on it.
+ */
+
+/* mask for isolating IPM and DET fields in SControl register */
+#define EDMINIV2_SCONTROL_MASK (ORION5X_SATA_SCONTROL_DET_MASK \
+   || ORION5X_SATA_SCONTROL_IMP_MASK)
+
+/* IPM and DET values for initializing link */
+#define EDMINIV2_PORT_INIT (ORION5X_SATA_SCONTROL_DET_INIT \
+   || ORION5X_SATA_SCONTROL_IMP_NO_LP_ALLOWED)
+
+/* IPM and DET values to use link once initialized */
+#define EDMINIV2_PORT_USE (ORION5X_SATA_SCONTROL_DET_NONE \
+   || ORION5X_SATA_SCONTROL_IMP_NO_LP_ALLOWED)
+
 int board_init(void)
 {
+   u32 reg;
+
/* arch number of board */
gd->bd->bi_arch_number = MACH_TYPE_EDMINI_V2;
 
/* boot parameter start at 256th byte of RAM base */
gd->bd->bi_boot_params = gd->bd->bi_dram[0].start + 0x100;
 
+   /* reset port 1 of SATAHC controller */
+   reg = readl(ORION5X_SATA_PORT1_SCONTROL_REG);
+   reg = (reg & ~EDMINIV2_SCONTROL_MASK) | EDMINIV2_PORT_INIT;
+   writel(reg, ORION5X_SATA_PORT1_SCONTROL_REG);
+   reg = (reg & ~EDMINIV2_SCONTROL_MASK) | EDMINIV2_PORT_USE;
+   writel(reg, ORION5X_SATA_PORT1_SCONTROL_REG);
+
return 0;
 }
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h
index c3d95a0..5c328c8 100644
--- a/include/configs/edminiv2.h
+++ b/include/configs/edminiv2.h
@@ -52,6 +52,12 @@
 #define CONFIG_SYS_HZ  1000
 
 /*
+ * __io is necessary for cmd_ide to compile
+ */
+
+#define __io
+
+/*
  * Board-specific values for Orion5x MPP low level init:
  * - MPPs 12 to 15 are SATA LEDs (mode 5)
  * - Others are GPIO/unused (mode 3 for MPP0, mode 5 for
@@ -60,7 +66,7 @@
 
 #define ORION5X_MPP0_7 0x0003
 #define ORION5X_MPP8_150x
-#define ORION5X_MPP16_23   0x
+#define ORION5X_MPP16_23   0x
 
 /*
  * Board-specific values for Orion5x GPIO low level init:
@@ -74,7 +80,6 @@
  */
 
 #define ORION5X_GPIO_OUT_ENABLE0x03fc
-#define ORION5X_GPIO_OUT_VALUE 0x03fc
 
 /*
  * NS16550 Configuration
@@ -131,6 +136,7 @@
  * Commands configuration - using default command set for now
  */
 #include 
+
 /*
  * Disabling some default commands for staggered bring-up
  */
@@ -139,6 +145,25 @@
 #undef CONFIG_CMD_NFS  /* no NFS since no net */
 
 /*
+ * ED Mini has a connector for SATA Port 1
+ */
+
+#define CONFIG_CMD_IDE
+#define CONFIG_DOS_PARTITION
+#define CONFIG_CMD_EXT2
+
+#define CONFIG_LIBATA
+#define CONFIG_SYS_IDE_MAXBUS  1
+#define CONFIG_SYS_IDE_MAXDEVICE   1
+#define CONFIG_SYS_ATA_BASE_ADDR   ORION5X_SATA_BASE
+#define CONFIG_SYS_ATA_IDE0_OFFSET ORION5X_SATA_PORT1_OFFSET
+#define CONFIG_SYS_ATA_DATA_OFFSET (0x0100)
+#define CONFIG_SYS_ATA_REG_OFFSET  (0x0100)
+#define CONFIG_SYS_ATA_ALT_OFFSET  (0x0100)
+#define CONFIG_SYS_ATA_STRIDE  4
+#define CONFIG_LBA48
+
+/*
  *  Environment variables configurations
  */
 #define CONFIG_ENV_IS_IN_FLASH 1
-- 
1.6.4.4

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


[U-Boot] [PATCH V2 2/3] orion5x: add ide support for Marvell SATA

2010-07-06 Thread Albert Aribaud

Signed-off-by: Albert Aribaud 
---
 arch/arm/include/asm/arch-orion5x/orion5x.h |   20 
 common/cmd_ide.c|4 
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-orion5x/orion5x.h 
b/arch/arm/include/asm/arch-orion5x/orion5x.h
index 4008c84..11de968 100644
--- a/arch/arm/include/asm/arch-orion5x/orion5x.h
+++ b/arch/arm/include/asm/arch-orion5x/orion5x.h
@@ -55,6 +55,26 @@
 #define ORION5X_USB20_PORT0_BASE   (ORION5X_REGISTER(0x5))
 #define ORION5X_USB20_PORT1_BASE   (ORION5X_REGISTER(0xA))
 #define ORION5X_EGIGA_BASE (ORION5X_REGISTER(0x72000))
+#define ORION5X_SATA_BASE  (ORION5X_REGISTER(0x8))
+#define ORION5X_SATA_PORT0_OFFSET  0x2000
+#define ORION5X_SATA_PORT1_OFFSET  0x4000
+
+/*
+ * SATA definitions needed for controller initialization
+ */
+/* SControl register address */
+#define ORION5X_SATA_PORT1_SCONTROL_REG \
+   (ORION5X_SATA_BASE+ORION5X_SATA_PORT1_OFFSET+0x308)
+/* Mask and values for device DETection and link initialization */
+#define ORION5X_SATA_SCONTROL_DET_MASK 0x000F
+#define ORION5X_SATA_SCONTROL_DET_NONE 0x
+#define ORION5X_SATA_SCONTROL_DET_INIT 0x0001
+/* Mask and values for device Interface Power Management */
+#define ORION5X_SATA_SCONTROL_IMP_MASK 0x0F00
+#define ORION5X_SATA_SCONTROL_IMP_NO_LP_ALLOWED0x0300
+
+/* Orion5x will need byte-swapping if using ATA registers */
+#define CONFIG_IDE_SWAP_IO
 
 #define CONFIG_MAX_RAM_BANK_SIZE   (64*1024*1024)
 
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index 9292a5b..7f98ebb 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -45,6 +45,10 @@
 #include 
 #endif
 
+#ifdef CONFIG_ORION5X
+#include 
+#endif
+
 #include 
 #include 
 
-- 
1.6.4.4

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


[U-Boot] [PATCH V2 1/3] ide: add configuration CONFIG_IDE_SWAP_IO

2010-07-06 Thread Albert Aribaud

Signed-off-by: Albert Aribaud 
---
This patch set introduces CONFIG_IDE_SWAP_IO as suggested by
Wolfgang Denk, adds orion5x support to cmd_ide.c and adds IDE
support to edminiv2.

Patchset history:

V1: Initial 4-patch set -- not cleanly submitted (does
not appear on gmane for instance) and contained some
unrelated changes.

V2: Slimmed down to 3 patches and removed unrelated
changes.

 arch/powerpc/include/asm/config.h |3 +++
 common/cmd_ide.c  |   18 +-
 doc/README.PXA_CF |8 
 include/configs/ap325rxa.h|1 +
 include/configs/ms7720se.h|1 +
 include/configs/r2dplus.h |1 +
 include/configs/r7780mp.h |1 +
 7 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/include/asm/config.h 
b/arch/powerpc/include/asm/config.h
index fc3facb..371989d 100644
--- a/arch/powerpc/include/asm/config.h
+++ b/arch/powerpc/include/asm/config.h
@@ -76,4 +76,7 @@
 /* Relocation to SDRAM works on all PPC boards */
 #define CONFIG_RELOC_FIXUP_WORKS
 
+/* All PPC boards must swap IDE bytes */
+#define CONFIG_IDE_SWAP_IO
+
 #endif /* _ASM_CONFIG_H_ */
diff --git a/common/cmd_ide.c b/common/cmd_ide.c
index d486697..9292a5b 100644
--- a/common/cmd_ide.c
+++ b/common/cmd_ide.c
@@ -853,7 +853,7 @@ input_swap_data(int dev, ulong *sect_buf, int words)
 #endif /* __LITTLE_ENDIAN || CONFIG_AU1X00 */
 
 
-#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA) || defined(CONFIG_SH)
+#if defined(CONFIG_IDE_SWAP_IO)
 static void
 output_data(int dev, ulong *sect_buf, int words)
 {
@@ -897,15 +897,15 @@ output_data(int dev, ulong *sect_buf, int words)
}
 #endif
 }
-#else  /* ! __PPC__ */
+#else  /* ! CONFIG_IDE_SWAP_IO */
 static void
 output_data(int dev, ulong *sect_buf, int words)
 {
outsw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words<<1);
 }
-#endif /* __PPC__ */
+#endif /* CONFIG_IDE_SWAP_IO */
 
-#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA) || defined(CONFIG_SH)
+#if defined(CONFIG_IDE_SWAP_IO)
 static void
 input_data(int dev, ulong *sect_buf, int words)
 {
@@ -955,14 +955,14 @@ input_data(int dev, ulong *sect_buf, int words)
}
 #endif
 }
-#else  /* ! __PPC__ */
+#else  /* ! CONFIG_IDE_SWAP_IO */
 static void
 input_data(int dev, ulong *sect_buf, int words)
 {
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, words << 1);
 }
 
-#endif /* __PPC__ */
+#endif /* CONFIG_IDE_SWAP_IO */
 
 /* -
  */
@@ -1579,7 +1579,7 @@ int ide_device_present(int dev)
  * ATAPI Support
  */
 
-#if defined(__PPC__) || defined(CONFIG_PXA_PCMCIA)
+#if defined(CONFIG_IDE_SWAP_IO)
 /* since ATAPI may use commands with not 4 bytes alligned length
  * we have our own transfer functions, 2 bytes alligned */
 static void
@@ -1646,7 +1646,7 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
 #endif
 }
 
-#else  /* ! __PPC__ */
+#else  /* ! CONFIG_IDE_SWAP_IO */
 static void
 output_data_shorts(int dev, ushort *sect_buf, int shorts)
 {
@@ -1659,7 +1659,7 @@ input_data_shorts(int dev, ushort *sect_buf, int shorts)
insw(ATA_CURR_BASE(dev)+ATA_DATA_REG, sect_buf, shorts);
 }
 
-#endif /* __PPC__ */
+#endif /* CONFIG_IDE_SWAP_IO */
 
 /*
  * Wait until (Status & mask) == res, or timeout (in ms)
diff --git a/doc/README.PXA_CF b/doc/README.PXA_CF
index 6a0f236..1d76b32 100644
--- a/doc/README.PXA_CF
+++ b/doc/README.PXA_CF
@@ -6,6 +6,14 @@ follow the connections of the standard lubbock. Anyway just 
the block
 marked memory configuration should be touched since the other parameters
 are imposed by the PXA architecture.
 
+EDIT 2010-07-01: in common/cmd_ide.c, having CONFIG_PXA_PCMCIA defined
+would cause looping on inw()/outw() rather than using insw()/outsw(),
+thus making sure IDE / ATA bytes are properly swapped. This behaviour
+is now controlled by CONFIG_IDE_SWAP_IO, therefore PXA boards with
+PCMCIA should #define CONFIG_IDE_SWAP_IO.
+
+#define CONFIG_IDE_SWAP_IO
+
 #define CONFIG_PXA_PCMCIA 1
 #define CONFIG_PXA_IDE 1
 
diff --git a/include/configs/ap325rxa.h b/include/configs/ap325rxa.h
index 70dd47e..80a5797 100644
--- a/include/configs/ap325rxa.h
+++ b/include/configs/ap325rxa.h
@@ -138,6 +138,7 @@
 #define CONFIG_SYS_ATA_DATA_OFFSET 0x200   /* data reg offset */
 #define CONFIG_SYS_ATA_REG_OFFSET  0x200   /* reg offset */
 #define CONFIG_SYS_ATA_ALT_OFFSET  0x210   /* alternate register offset */
+#define CONFIG_IDE_SWAP_IO
 
 /* if you use all NOR Flash , you change dip-switch. Please see Manual. */
 #define CONFIG_SYS_MAX_FLASH_BANKS 1
diff --git a/include/configs/ms7720se.h b/include/configs/ms7720se.h
index ba0a3f8..0ea3527 100644
--- a/include/configs/ms7720se.h
+++ b/include/configs/ms7720se.h
@@ -122,5 +122,6 @@
 #define CONFIG_SYS_ATA_DATA_OFFSET 0   /* data reg offset */
 #define CONFIG_SYS_ATA_REG_OFFSET  0   /* reg offset */
 #define CONFIG_S

Re: [U-Boot] Need Help in bulding U-boot-2010-06 for OpenRD client

2010-07-06 Thread kalyan karnati
Hi Albert,
Thanks for your reply.

I compiled U-boot with the patch that enables support for
OpenRD_client and OpenRD_ultimate given by Tanmay.
OpenRD Client is connected to PC/Host with FTDI programmed for Channel
A as CPU FIFO.

I'm using the binary for OpenOCD that I got from Marvell to tranfer
uboot.bin into board's NAND.
I copied the 'u-boot-2010.06.bin' in to
~\openocd\openocd.binaries.libftdi/bin as 'uboot.bin'.
Then executed the command ' ./openocd –f target/board/openrd.cfg –c
init -c openrd_reflash_uboot'

Logs show:
wrote file uboot.bin to NAND flash 0 up to offset 0x0004e800 in 50.190395s
Info : JTAG tap: feroceon.cpu tap/device found: 0x20a023d3
(Manufacturer: 0x1e9, Part: 0x0a02, Version: 0x2)
Info : JTAG Tap/device matched

But then the board doesn't boot and the console is all blank :(
Please let me know if I'm doing something wrong..

Thanks,
Kalyan.

Hi Kalyan,

I've successfully used the base config for a client board, as well as
used a patch recently sent to this list that adds client and ultimate
support. You can search the list for 'ultimate' for instance:

http://lists.denx.de/mailman/listinfo/u-boot

Re: your issue, can you detail exactly how you load and run u-boot via
openocd? What operations do you perform on the board, and what commands
do you issue on your debugging host to launch openocd?

Amicalement,
-- 
Albert.




On Thu, Jul 1, 2010 at 9:44 AM, kalyan karnati wrote:

> Hello,
>
> I'm trying to build uboot.bin for Marvell OpenRD client from uboot-2010-06
> source file.
> I noticed that there is no config file for OpenRD_client. So I compiled
> openrd_base and sent the binary to the board using OpenOCD. But the board
> doesn't even boot.
> Can you please let me know if there is another board config specific to
> OpenRD_Client or am I missing something ??
>
> Thanks for you help,
>
> Best Regards,
> Kalyan.
>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] net: dm9000x: re-add casts to I/O pointers to fix gcc warnings

2010-07-06 Thread Thomas Weber
Am 05.07.2010 08:29, schrieb Mike Frysinger:
> The DM9000 in/out helper functions were casting the register address when
> it was accessing things directly (pre commit a45dde2293c816138e53c).  But
> when it was changed to using the in/out helpers, those casts were dropped
> because those functions don't take pointers.  Even more recently, those
> functions were then changed to use the read/write helpers, but the casts
> were not re-added.  This is necessary because the read/write helpers do
> take pointers.  Otherwise we get a lot of warnings like:
> dm9000x.c: In function 'dm9000_inblk_8bit':
> dm9000x.c:172: warning: passing argument 1 of 'readb'
>   makes pointer from integer without a cast
> 
> Signed-off-by: Mike Frysinger 
> ---
>  drivers/net/dm9000x.c |   12 ++--
>  1 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
> index 137e41f..709f67a 100644
> --- a/drivers/net/dm9000x.c
> +++ b/drivers/net/dm9000x.c
> @@ -117,12 +117,12 @@ static void DM9000_iow(int reg, u8 value);
>  
>  /* DM9000 network board routine  */
>  
> -#define DM9000_outb(d,r) writeb(d, r)
> -#define DM9000_outw(d,r) writew(d, r)
> -#define DM9000_outl(d,r) writel(d, r)
> -#define DM9000_inb(r) readb(r)
> -#define DM9000_inw(r) readw(r)
> -#define DM9000_inl(r) readl(r)
> +#define DM9000_outb(d,r) writeb(d, (volatile u8 *)(r))
> +#define DM9000_outw(d,r) writew(d, (volatile u16 *)(r))
> +#define DM9000_outl(d,r) writel(d, (volatile u32 *)(r))
> +#define DM9000_inb(r) readb((volatile u8 *)(r))
> +#define DM9000_inw(r) readw((volatile u16 *)(r))
> +#define DM9000_inl(r) readl((volatile u32 *)(r))
>  
>  #ifdef CONFIG_DM9000_DEBUG
>  static void

Hello,

tested on Devkit8000.

Thomas

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


[U-Boot] [PATCH 2/2] s5p_goni: enable mmc0

2010-07-06 Thread Minkyu Kang
Adds the board_mmc_init function and enable the mmc command

Signed-off-by: Minkyu Kang 
Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
---
 board/samsung/goni/goni.c  |   37 +
 include/configs/s5p_goni.h |6 ++
 2 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/board/samsung/goni/goni.c b/board/samsung/goni/goni.c
index e512c59..060d5d1 100644
--- a/board/samsung/goni/goni.c
+++ b/board/samsung/goni/goni.c
@@ -23,11 +23,18 @@
  */
 
 #include 
+#include 
+#include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+static struct s5pc110_gpio *s5pc110_gpio;
+
 int board_init(void)
 {
+   /* Set Initial global variables */
+   s5pc110_gpio = (struct s5pc110_gpio *)S5PC110_GPIO_BASE;
+
gd->bd->bi_arch_number = MACH_TYPE_GONI;
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
@@ -53,3 +60,33 @@ int checkboard(void)
return 0;
 }
 #endif
+
+#ifdef CONFIG_GENERIC_MMC
+int board_mmc_init(bd_t *bis)
+{
+   int i;
+
+   /* MASSMEMORY_EN: XMSMDATA7: GPJ2[7] output high */
+   gpio_direction_output(&s5pc110_gpio->gpio_j2, 7, 1);
+
+   /*
+* MMC0 GPIO
+* GPG0[0]  SD_0_CLK
+* GPG0[1]  SD_0_CMD
+* GPG0[2]  SD_0_CDn-> Not used
+* GPG0[3:6]SD_0_DATA[0:3]
+*/
+   for (i = 0; i < 7; i++) {
+   if (i == 2)
+   continue;
+   /* GPG0[0:6] special function 2 */
+   gpio_cfg_pin(&s5pc110_gpio->gpio_g0, i, 0x2);
+   /* GPG0[0:6] pull disable */
+   gpio_set_pull(&s5pc110_gpio->gpio_g0, i, GPIO_PULL_NONE);
+   /* GPG0[0:6] drv 4x */
+   gpio_set_drv(&s5pc110_gpio->gpio_g0, i, GPIO_DRV_4X);
+   }
+
+   return s5p_mmc_init(0);
+}
+#endif
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 171ec94..b2bf96a 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -67,6 +67,11 @@
 #define CONFIG_SERIAL_MULTI1
 #define CONFIG_BAUDRATE115200
 
+/* MMC */
+#define CONFIG_GENERIC_MMC 1
+#define CONFIG_MMC 1
+#define CONFIG_S5P_MMC 1
+
 /* It should define before config_cmd_default.h */
 #define CONFIG_SYS_NO_FLASH1
 
@@ -82,6 +87,7 @@
 #define CONFIG_CMD_REGINFO
 #define CONFIG_CMD_ONENAND
 #define CONFIG_CMD_MTDPARTS
+#define CONFIG_CMD_MMC
 
 #define CONFIG_BOOTDELAY   1
 #define CONFIG_ZERO_BOOTDELAY_CHECK
-- 
1.6.3.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] S5P: support mmc driver

2010-07-06 Thread Minkyu Kang
This patch adds support mmc driver for s5p SoC

Signed-off-by: Minkyu Kang 
Signed-off-by: Jaehoon Chung 
Signed-off-by: Kyungmin Park 
---
 arch/arm/include/asm/arch-s5pc1xx/cpu.h |2 +
 arch/arm/include/asm/arch-s5pc1xx/mmc.h |   71 +
 drivers/mmc/Makefile|1 +
 drivers/mmc/s5p_mmc.c   |  478 +++
 4 files changed, 552 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-s5pc1xx/mmc.h
 create mode 100644 drivers/mmc/s5p_mmc.c

diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h 
b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
index 90485aa..b3af8cc 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
@@ -38,6 +38,7 @@
 #define S5PC100_PWMTIMER_BASE  0xEA00
 #define S5PC100_WATCHDOG_BASE  0xEA20
 #define S5PC100_UART_BASE  0xEC00
+#define S5PC100_MMC_BASE   0xED80
 
 /* S5PC110 */
 #define S5PC110_GPIO_BASE  0xE020
@@ -45,6 +46,7 @@
 #define S5PC110_WATCHDOG_BASE  0xE270
 #define S5PC110_UART_BASE  0xE290
 #define S5PC110_SROMC_BASE 0xE800
+#define S5PC110_MMC_BASE   0xEB00
 #define S5PC110_DMC0_BASE  0xF000
 #define S5PC110_DMC1_BASE  0xF140
 #define S5PC110_VIC0_BASE  0xF200
diff --git a/arch/arm/include/asm/arch-s5pc1xx/mmc.h 
b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
new file mode 100644
index 000..ac560c2
--- /dev/null
+++ b/arch/arm/include/asm/arch-s5pc1xx/mmc.h
@@ -0,0 +1,71 @@
+/*
+ * (C) Copyright 2009 SAMSUNG Electronics
+ * Minkyu Kang 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ */
+
+#ifndef __ASM_ARCH_MMC_H_
+#define __ASM_ARCH_MMC_H_
+
+#ifndef __ASSEMBLY__
+struct s5p_mmc {
+   unsigned intsysad;
+   unsigned short  blksize;
+   unsigned short  blkcnt;
+   unsigned intargument;
+   unsigned short  trnmod;
+   unsigned short  cmdreg;
+   unsigned intrspreg0;
+   unsigned intrspreg1;
+   unsigned intrspreg2;
+   unsigned intrspreg3;
+   unsigned intbdata;
+   unsigned intprnsts;
+   unsigned char   hostctl;
+   unsigned char   pwrcon;
+   unsigned char   blkgap;
+   unsigned char   wakcon;
+   unsigned short  clkcon;
+   unsigned char   timeoutcon;
+   unsigned char   swrst;
+   unsigned intnorintsts;  /* errintsts */
+   unsigned intnorintstsen;/* errintstsen */
+   unsigned intnorintsigen;/* errintsigen */
+   unsigned short  acmd12errsts;
+   unsigned char   res1[2];
+   unsigned intcapareg;
+   unsigned char   res2[4];
+   unsigned intmaxcurr;
+   unsigned char   res3[0x34];
+   unsigned intcontrol2;
+   unsigned intcontrol3;
+   unsigned intcontrol4;
+   unsigned char   res4[0x6e];
+   unsigned short  hcver;
+   unsigned char   res5[0xFFF00];
+};
+
+struct mmc_host {
+   struct s5p_mmc *reg;
+   unsigned int version;   /* SDHCI spec. version */
+   unsigned int clock; /* Current clock (MHz) */
+};
+
+int s5p_mmc_init(int dev_index);
+
+#endif /* __ASSEMBLY__ */
+#endif
diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
index 6fa04b8..8dfd8a3 100644
--- a/drivers/mmc/Makefile
+++ b/drivers/mmc/Makefile
@@ -32,6 +32,7 @@ COBJS-$(CONFIG_OMAP3_MMC) += omap3_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
 COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
 COBJS-$(CONFIG_PXA_MMC) += pxa_mmc.o
+COBJS-$(CONFIG_S5P_MMC) += s5p_mmc.o
 
 COBJS  := $(COBJS-y)
 SRCS   := $(COBJS:.o=.c)
diff --git a/drivers/mmc/s5p_mmc.c b/drivers/mmc/s5p_mmc.c
new file mode 100644
index 000..669b1d0
--- /dev/null
+++ b/drivers/mmc/s5p_mmc.c
@@ -0,0 +1,478 @@
+/*
+ * (C) Copyright 2009 SAMSUNG Electronics
+ * Minkyu Kang 
+ * Jaehoon Chung 
+ *
+ * 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

[U-Boot] SAMSUNG: serial: remove compiler warnings

2010-07-06 Thread Minkyu Kang
remove below warnings
serial_s5p.c: In function 'serial_getc_dev':
serial_s5p.c:136: warning: dereferencing type-punned pointer will break 
strict-aliasing rules
serial_s5p.c: In function 'serial_putc_dev':
serial_s5p.c:152: warning: dereferencing type-punned pointer will break 
strict-aliasing rules

Signed-off-by: Minkyu Kang 
Signed-off-by: Kyungmin Park 
---
 drivers/serial/serial_s5p.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/serial/serial_s5p.c b/drivers/serial/serial_s5p.c
index 9747db3..e0d4e80 100644
--- a/drivers/serial/serial_s5p.c
+++ b/drivers/serial/serial_s5p.c
@@ -133,7 +133,7 @@ int serial_getc_dev(const int dev_index)
return 0;
}
 
-   return (int)(readl(&uart->urxh) & 0xff);
+   return (int)(readb(&uart->urxh) & 0xff);
 }
 
 /*
@@ -149,7 +149,7 @@ void serial_putc_dev(const char c, const int dev_index)
return;
}
 
-   writel(c, &uart->utxh);
+   writeb(c, &uart->utxh);
 
/* If \n, also do \r */
if (c == '\n')
-- 
1.6.3.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] da850 evm: Fix definition of 'pinmux' macro

2010-07-06 Thread Prakash PM
Usage of parenthesis in pinmux macro definition changes the
definition of the macro and raises the precedence of '&'
operator inadvertently over '[]'.

Signed-off-by: Prakash PM 
---
 board/davinci/da8xxevm/da850evm.c |   22 +++---
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/board/davinci/da8xxevm/da850evm.c 
b/board/davinci/da8xxevm/da850evm.c
index 959b2c6..eeb456c 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -30,28 +30,28 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux (&davinci_syscfg_regs->pinmux)
+#define pinmux(x)  (&davinci_syscfg_regs->pinmux[x])
 
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi1_pins[] = {
-   { pinmux[5], 1, 1 },
-   { pinmux[5], 1, 2 },
-   { pinmux[5], 1, 4 },
-   { pinmux[5], 1, 5 }
+   { pinmux(5), 1, 1 },
+   { pinmux(5), 1, 2 },
+   { pinmux(5), 1, 4 },
+   { pinmux(5), 1, 5 }
 };
 
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
-   { pinmux[0], 4, 6 },
-   { pinmux[0], 4, 7 },
-   { pinmux[4], 2, 4 },
-   { pinmux[4], 2, 5 }
+   { pinmux(0), 4, 6 },
+   { pinmux(0), 4, 7 },
+   { pinmux(4), 2, 4 },
+   { pinmux(4), 2, 5 }
 };
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[4], 2, 2 },
-   { pinmux[4], 2, 3 }
+   { pinmux(4), 2, 2 },
+   { pinmux(4), 2, 3 }
 };
 
 static const struct pinmux_resource pinmuxes[] = {
-- 
1.5.6

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


[U-Boot] [PATCH] da830 evm: Fix checkpatch error on 'pinmux' macro

2010-07-06 Thread Prakash PM
Existing code returns checkpatch error on pinmux macro definition for
not enclosing the definition in parenthesis. The error can be observed in
the patch generated from commit id bdc9c6c7f77a9a63349ecb9f54b20ad34033a2ae.
So macro implementation is modified to fix the error.

Signed-off-by: Prakash PM 
---
 board/davinci/da8xxevm/da830evm.c |   68 ++--
 1 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/board/davinci/da8xxevm/da830evm.c 
b/board/davinci/da8xxevm/da830evm.c
index 57506d6..6baa860 100644
--- a/board/davinci/da8xxevm/da830evm.c
+++ b/board/davinci/da8xxevm/da830evm.c
@@ -45,63 +45,63 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux &davinci_syscfg_regs->pinmux
+#define pinmux(x)  (&davinci_syscfg_regs->pinmux[x])
 
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi0_pins[] = {
-   { pinmux[7], 1, 3 },
-   { pinmux[7], 1, 4 },
-   { pinmux[7], 1, 5 },
-   { pinmux[7], 1, 6 },
-   { pinmux[7], 1, 7 }
+   { pinmux(7), 1, 3 },
+   { pinmux(7), 1, 4 },
+   { pinmux(7), 1, 5 },
+   { pinmux(7), 1, 6 },
+   { pinmux(7), 1, 7 }
 };
 
 /* EMIF-A bus pins for 8-bit NAND support on CS3 */
 static const struct pinmux_config emifa_nand_pins[] = {
-   { pinmux[13], 1, 6 },
-   { pinmux[13], 1, 7 },
-   { pinmux[14], 1, 0 },
-   { pinmux[14], 1, 1 },
-   { pinmux[14], 1, 2 },
-   { pinmux[14], 1, 3 },
-   { pinmux[14], 1, 4 },
-   { pinmux[14], 1, 5 },
-   { pinmux[15], 1, 7 },
-   { pinmux[16], 1, 0 },
-   { pinmux[18], 1, 1 },
-   { pinmux[18], 1, 4 },
-   { pinmux[18], 1, 5 },
+   { pinmux(13), 1, 6 },
+   { pinmux(13), 1, 7 },
+   { pinmux(14), 1, 0 },
+   { pinmux(14), 1, 1 },
+   { pinmux(14), 1, 2 },
+   { pinmux(14), 1, 3 },
+   { pinmux(14), 1, 4 },
+   { pinmux(14), 1, 5 },
+   { pinmux(15), 1, 7 },
+   { pinmux(16), 1, 0 },
+   { pinmux(18), 1, 1 },
+   { pinmux(18), 1, 4 },
+   { pinmux(18), 1, 5 },
 };
 
 /* EMAC PHY interface pins */
 static const struct pinmux_config emac_pins[] = {
-   { pinmux[9], 0, 5 },
-   { pinmux[10], 2, 1 },
-   { pinmux[10], 2, 2 },
-   { pinmux[10], 2, 3 },
-   { pinmux[10], 2, 4 },
-   { pinmux[10], 2, 5 },
-   { pinmux[10], 2, 6 },
-   { pinmux[10], 2, 7 },
-   { pinmux[11], 2, 0 },
-   { pinmux[11], 2, 1 },
+   { pinmux(9), 0, 5 },
+   { pinmux(10), 2, 1 },
+   { pinmux(10), 2, 2 },
+   { pinmux(10), 2, 3 },
+   { pinmux(10), 2, 4 },
+   { pinmux(10), 2, 5 },
+   { pinmux(10), 2, 6 },
+   { pinmux(10), 2, 7 },
+   { pinmux(11), 2, 0 },
+   { pinmux(11), 2, 1 },
 };
 
 /* UART pin muxer settings */
 static const struct pinmux_config uart_pins[] = {
-   { pinmux[8], 2, 7 },
-   { pinmux[9], 2, 0 }
+   { pinmux(8), 2, 7 },
+   { pinmux(9), 2, 0 }
 };
 
 /* I2C pin muxer settings */
 static const struct pinmux_config i2c_pins[] = {
-   { pinmux[8], 2, 3 },
-   { pinmux[8], 2, 4 }
+   { pinmux(8), 2, 3 },
+   { pinmux(8), 2, 4 }
 };
 
 /* USB0_DRVVBUS pin muxer settings */
 static const struct pinmux_config usb_pins[] = {
-   { pinmux[9], 1, 1 }
+   { pinmux(9), 1, 1 }
 };
 
 static const struct pinmux_resource pinmuxes[] = {
-- 
1.5.6

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