Re: [U-Boot] [PATCH v2 04/10] arm, davinci: add support for new spl framework

2011-10-05 Thread Christian Riesch
Hello Heiko,

On Wed, Oct 5, 2011 at 4:28 PM, Heiko Schocher  wrote:
> Signed-off-by: Heiko Schocher 
> Cc: Albert ARIBAUD 
> Cc: Sandeep Paulraj 
> ---
>  Makefile                                  |    8 +++-
>  arch/arm/cpu/arm926ejs/davinci/Makefile   |    8 
>  arch/arm/cpu/arm926ejs/davinci/spl.c      |   63 
> +
>  arch/arm/cpu/arm926ejs/davinci/spl_nand.c |   57 ++
>  arch/arm/cpu/arm926ejs/start.S            |   25 +++-
>  5 files changed, 158 insertions(+), 3 deletions(-)
>  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl.c
>  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c

[...]

> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
> b/arch/arm/cpu/arm926ejs/davinci/spl.c
> new file mode 100644
> index 000..d9b9398
> --- /dev/null
> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c

[...]

> +void puts(const char *str)
> +{
> +       while (*str)
> +               putc(*str++);
> +}
> +
> +void putc(char c)
> +{
> +       if (c == '\n')
> +               NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
> +
> +       NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
> +}
> +

Are these functions really required? I am currently also working on an
SPL for davinci (the AM1808 SoC) and had a look at the code in
arch/arm/cpu/armv7/omap-common/spl.c:

gd = &gdata;
gd->bd = &bdata;
gd->flags |= GD_FLG_RELOC;
gd->baudrate = CONFIG_BAUDRATE;

serial_init();  /* serial communications setup */

After that they use putc, printf... from common/console.c

However, I had to add a gd->have_console = true; to the code above
since this is required due to commit
e3e454cd72f319908355427b1a3ae54b3dd53356.

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


[U-Boot] u-boot problem on FADS board: FEC not working

2011-10-05 Thread Davide Gallo Cassarino
Hi all,


I was able to compile u-boot (I retrieved the last revision by git) for FADS 
board, load it on the board and then to boot it on the board!
Then I set a ethernet address, IP address, mask ...

I had a problem with the fast ethernet controller (FEC): after launching the 
ping command the printout
on the COM was:

" FEC_RESET_DELAY timeout"
"mii_send STUCK!"


I found out that the problem is in fec_init function in 
.../arch/powerpc/cpu/mpc8xx/fec.c in the line:

if (fec_reset(fecp) < 0)
        printf ("FEC_RESET_DELAY timeout\n");


What is the problem with FEC reset? Is there some problem with MII (see 
mii_send function always in fec.c)


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


[U-Boot] watchdog and tcm-bf537

2011-10-05 Thread Denis Konstantinov
Hello!

I am trying to activate watchdog timer on my tcm-bf537 platform, but when I do 
this, I have a copmpiling error. And I really don't know what to do.

u-Boot: u-boot-2011.09

---
My steps are:

1. Add
#define CONFIG_WATCHDOG
to ./include/configs/tcm-bf537.h

2. make tcm-bf537
--

The errors are:

/opt/uClinux/u-boot-2011.09/arch/blackfin/lib/board.c:223: undefined reference 
to 'watchdog_init'
/opt/uClinux/u-boot-2011.09/arch/blackfin/lib/board.c:223: relocation truncated 
to fit: R_BFIN_PCREL24 against undefined symbol 'watchdog_init'
arc/blackfin/cpu/libblackfin.o: Infunction '_udelay':
/opt/uClinux/u-boot-2011.09/arch/blcakfin/cpu/interrupts.c:74: undefined 
reference to 'watchdog_reset'
/opt/uClinux/u-boot-2011.09/arch/blcakfin/cpu/interrupts.c:74: relocation 
truncated to fit: R_BFIN_PCREL24 against undefined symbol 'watchdog_reset'

and so on...
What can i do?

Thanks.

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


Re: [U-Boot] [PATCH 2/7] CFI: fix warning: variable ... set but not used

2011-10-05 Thread Stefan Roese
Hi Wolfgang,

On Wednesday 05 October 2011 23:17:28 Wolfgang Denk wrote:
> Fix:
> cfi_mtd.c: In function 'cfi_mtd_init':
> cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used
> [-Wunused-but-set-variable] cfi_mtd.c: In function 'cfi_mtd_init':
> cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used
> [-Wunused-but-set-variable]
>
> Signed-off-by: Wolfgang Denk 
> Cc: Stefan Roese 

Acked-by: Stefan Roese 

Feel free to apply directly if this is easier for you.

Thanks,
Stefan

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


[U-Boot] [PATCH 05/10 v3] spl, nand: add 4bit HW ecc oob first nand_read_page function

2011-10-05 Thread Heiko Schocher
similiar to commit dc7cd8e59ba077f3b4c1a4557c9cd86a31b9ab1f, only
adapted for the new spl framework.

Signed-off-by: Heiko Schocher 
Cc: Scott Wood 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 

---
changes for v3:
- add comment from Scott Wood:
  as BSS is cleared, no need for intializing vars with 0
  remove this.

 drivers/mtd/nand/nand_spl_simple.c |   43 +++-
 1 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/nand_spl_simple.c 
b/drivers/mtd/nand/nand_spl_simple.c
index 71491d4..622a9b5 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -140,6 +140,47 @@ static int nand_is_bad_block(int block)
return 0;
 }
 
+#if defined(CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST)
+static int nand_read_page(int block, int page, uchar *dst)
+{
+   struct nand_chip *this = mtd.priv;
+   u_char *ecc_calc;
+   u_char *ecc_code;
+   u_char *oob_data;
+   int i;
+   int eccsize = CONFIG_SYS_NAND_ECCSIZE;
+   int eccbytes = CONFIG_SYS_NAND_ECCBYTES;
+   int eccsteps = CONFIG_SYS_NAND_ECCSTEPS;
+   uint8_t *p = dst;
+   int stat;
+
+   /*
+* No malloc available for now, just use some temporary locations
+* in SDRAM
+*/
+   ecc_calc = (u_char *)(CONFIG_SYS_SDRAM_BASE + 0x1);
+   ecc_code = ecc_calc + 0x100;
+   oob_data = ecc_calc + 0x200;
+
+   nand_command(block, page, 0, NAND_CMD_READOOB);
+   this->read_buf(&mtd, oob_data, CONFIG_SYS_NAND_OOBSIZE);
+   nand_command(block, page, 0, NAND_CMD_READ0);
+
+   /* Pick the ECC bytes out of the oob data */
+   for (i = 0; i < CONFIG_SYS_NAND_ECCTOTAL; i++)
+   ecc_code[i] = oob_data[nand_ecc_pos[i]];
+
+
+   for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
+   this->ecc.hwctl(&mtd, NAND_ECC_READ);
+   this->read_buf(&mtd, p, eccsize);
+   this->ecc.calculate(&mtd, p, &ecc_calc[i]);
+   stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
+   }
+
+   return 0;
+}
+#else
 static int nand_read_page(int block, int page, void *dst)
 {
struct nand_chip *this = mtd.priv;
@@ -186,6 +227,7 @@ static int nand_read_page(int block, int page, void *dst)
 
return 0;
 }
+#endif
 
 int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
 {
@@ -230,7 +272,6 @@ void nand_init(void)
mtd.priv = &nand_chip;
nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
(void  __iomem *)CONFIG_SYS_NAND_BASE;
-   nand_chip.options = 0;
board_nand_init(&nand_chip);
 
if (nand_chip.select_chip)
-- 
1.7.6.2

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


Re: [U-Boot] [PATCH v2 05/10] spl, nand: add 4bit HW ecc oob first nand_read_page function

2011-10-05 Thread Heiko Schocher
Hello Scott,

Scott Wood wrote:
> On 10/05/2011 09:28 AM, Heiko Schocher wrote:
>> similiar to commit dc7cd8e59ba077f3b4c1a4557c9cd86a31b9ab1f, only
>> adapted for the new spl framework.
>>
>> Signed-off-by: Heiko Schocher 
>> Cc: Scott Wood 
>> Cc: Albert ARIBAUD 
>> Cc: Sandeep Paulraj 
>> ---
>>  drivers/mtd/nand/nand_spl_simple.c |   43 
>> 
>>  1 files changed, 43 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/nand_spl_simple.c 
>> b/drivers/mtd/nand/nand_spl_simple.c
>> index 71491d4..7ab332f 100644
>> --- a/drivers/mtd/nand/nand_spl_simple.c
>> +++ b/drivers/mtd/nand/nand_spl_simple.c
[...]
>> @@ -186,6 +227,7 @@ static int nand_read_page(int block, int page, void *dst)
>>  
>>  return 0;
>>  }
>> +#endif
>>  
>>  int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
>>  {
> 
> ACK this part

great!

>> @@ -231,6 +273,7 @@ void nand_init(void)
>>  nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
>>  (void  __iomem *)CONFIG_SYS_NAND_BASE;
>>  nand_chip.options = 0;
>> +nand_chip.dev_ready = NULL;
>>  board_nand_init(&nand_chip);
>>  
>>  if (nand_chip.select_chip)
> 
> This looks unrelated, and if it makes a difference suggests that the BSS
> isn't being cleared.

BSS is cleared at this point, so you are right, above two lines are
not necessary, remove them.

Thanks!

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 1/2] SPL: Allow user to disable CPU support library

2011-10-05 Thread Marek Vasut
Introduce CONFIG_SPL_NO_CPU_SUPPORT_CODE to avoid compiling the CPU support
library. This can be useful on some setups.

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
Cc: Detlev Zundel 
Cc: Scott Wood 
---
 spl/Makefile |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index 91dd11a..fc9360f 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -18,6 +18,11 @@
 CONFIG_SPL_BUILD := y
 export CONFIG_SPL_BUILD
 
+# In case we want to avoid the CPU support code, we need to define this:
+ifdef CONFIG_SPL_NO_CPU_SUPPORT_CODE
+export CONFIG_SPL_NO_CPU_SUPPORT_CODE
+endif
+
 include $(TOPDIR)/config.mk
 
 # We want the final binaries in this directory
-- 
1.7.6.3

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


[U-Boot] [PATCH 2/2] SPL: Allow ARM926EJS to avoid compiling in the CPU support code

2011-10-05 Thread Marek Vasut
This allows the SPL to avoid compiling in the CPU support code.

Signed-off-by: Marek Vasut 
Cc: Stefano Babic 
Cc: Wolfgang Denk 
Cc: Detlev Zundel 
Cc: Scott Wood 
---
 arch/arm/cpu/arm926ejs/Makefile |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/Makefile b/arch/arm/cpu/arm926ejs/Makefile
index 930e0d1..3f9b0f1 100644
--- a/arch/arm/cpu/arm926ejs/Makefile
+++ b/arch/arm/cpu/arm926ejs/Makefile
@@ -28,6 +28,13 @@ LIB  = $(obj)lib$(CPU).o
 START  = start.o
 COBJS  = cpu.o
 
+ifdef  CONFIG_SPL_BUILD
+ifdef  CONFIG_SPL_NO_CPU_SUPPORT_CODE
+START  :=
+COBJS  :=
+endif
+endif
+
 SRCS   := $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS   := $(addprefix $(obj),$(COBJS) $(SOBJS))
 START  := $(addprefix $(obj),$(START))
-- 
1.7.6.3

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


[U-Boot] [PATCH 4/6] davinci_emac: fix for running with dcache enabled

2011-10-05 Thread Ilya Yanok
DaVinci EMAC is present on TI AM35xx SoCs (ARMv7) which run with D-Cache
enabled by default. So we have to take care and flush/invalidate the
cache before/after the DMA operations.

Signed-off-by: Ilya Yanok 
---
 drivers/net/davinci_emac.c |   47 
 1 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 222a0d0..b787213 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -96,6 +96,40 @@ static volatile u_int8_t active_phy_addr = 0xff;
 
 phy_t  phy;
 
+#ifdef DAVINCI_EMAC_DCACHE
+static inline void davinci_flush(void *addr, int size)
+{
+   flush_dcache_range((unsigned long)addr,
+   (unsigned long)addr + size);
+}
+
+static inline void davinci_invalidate(void *addr, int size)
+{
+   invalidate_dcache_range((unsigned long)addr,
+   (unsigned long)addr + size);
+}
+#else
+#define davinci_flush(addr, size)  do {} while (0)
+#define davinci_invalidate(addr, size) do {} while (0)
+#endif
+
+static inline void davinci_flush_rx_descs(void)
+{
+   davinci_flush((void *)emac_rx_desc, EMAC_MAX_RX_BUFFERS *
+   sizeof(emac_desc));
+}
+
+static inline void davinci_invalidate_rx_descs(void)
+{
+   davinci_invalidate((void *)emac_rx_desc, EMAC_MAX_RX_BUFFERS *
+   sizeof(emac_desc));
+}
+
+static inline void davinci_flush_desc(emac_desc *desc)
+{
+   davinci_flush((void *)desc, sizeof(*desc));
+}
+
 static int davinci_eth_set_mac_addr(struct eth_device *dev)
 {
unsigned long   mac_hi;
@@ -412,6 +446,8 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
emac_rx_active_tail = rx_desc;
emac_rx_queue_active = 1;
 
+   davinci_flush_rx_descs();
+
/* Enable TX/RX */
writel(EMAC_MAX_ETHERNET_PKT_SIZE, &adap_emac->RXMAXLEN);
writel(0, &adap_emac->RXBUFFEROFFSET);
@@ -568,6 +604,10 @@ static int davinci_eth_send_packet (struct eth_device *dev,
  EMAC_CPPI_SOP_BIT |
  EMAC_CPPI_OWNERSHIP_BIT |
  EMAC_CPPI_EOP_BIT);
+
+   davinci_flush((void *)packet, length);
+   davinci_flush_desc(emac_tx_desc);
+
/* Send the packet */
writel(BD_TO_HW((unsigned long)emac_tx_desc), &adap_emac->TX0HDP);
 
@@ -600,6 +640,8 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
volatile emac_desc *tail_desc;
int status, ret = -1;
 
+   davinci_invalidate_rx_descs();
+
rx_curr_desc = emac_rx_active_head;
status = rx_curr_desc->pkt_flag_len;
if ((rx_curr_desc) && ((status & EMAC_CPPI_OWNERSHIP_BIT) == 0)) {
@@ -607,6 +649,8 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
/* Error in packet - discard it and requeue desc */
printf ("WARN: emac_rcv_pkt: Error in packet\n");
} else {
+   davinci_invalidate(rx_curr_desc->buffer,
+   rx_curr_desc->buff_off_len & 0x);
NetReceive (rx_curr_desc->buffer,
(rx_curr_desc->buff_off_len & 0x));
ret = rx_curr_desc->buff_off_len & 0x;
@@ -632,6 +676,7 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
rx_curr_desc->buff_off_len = EMAC_MAX_ETHERNET_PKT_SIZE;
rx_curr_desc->pkt_flag_len = EMAC_CPPI_OWNERSHIP_BIT;
rx_curr_desc->next = 0;
+   davinci_flush_desc(rx_curr_desc);
 
if (emac_rx_active_head == 0) {
printf ("INFO: emac_rcv_pkt: active queue head = 0\n");
@@ -649,11 +694,13 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
tail_desc->next = BD_TO_HW((unsigned int) curr_desc);
status = tail_desc->pkt_flag_len;
if (status & EMAC_CPPI_EOQ_BIT) {
+   davinci_flush_desc(tail_desc);
writel(BD_TO_HW((unsigned long)curr_desc),
   &adap_emac->RX0HDP);
status &= ~EMAC_CPPI_EOQ_BIT;
tail_desc->pkt_flag_len = status;
}
+   davinci_flush_desc(tail_desc);
}
return (ret);
}
-- 
1.7.6.2

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


[U-Boot] [PATCH 2/6] davinci_emac: use internal addresses in buffer descriptors

2011-10-05 Thread Ilya Yanok
On AM35xx CPPI RAM had different addresses when accessed from the CPU
and from the EMAC. We need to account this to deal with the buffer
descriptors correctly.

Signed-off-by: Ilya Yanok 
---
 drivers/net/davinci_emac.c |   28 +++-
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 0e980ec..7eb37c7 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -48,6 +48,16 @@
 unsigned int   emac_dbg = 0;
 #define debug_emac(fmt,args...)if (emac_dbg) printf(fmt,##args)
 
+#ifdef EMAC_HW_RAM_ADDR
+#define BD_TO_HW(x)\
+   ( ( (x) == 0) ? 0 : ( (x) - EMAC_WRAPPER_RAM_ADDR + EMAC_HW_RAM_ADDR ))
+#define HW_TO_BD(x)\
+   ( ( (x) == 0) ? 0 : ( (x) - EMAC_HW_RAM_ADDR + EMAC_WRAPPER_RAM_ADDR ))
+#else
+#define BD_TO_HW(x)(x)
+#define HW_TO_BD(x)(x)
+#endif
+
 #ifdef DAVINCI_EMAC_GIG_ENABLE
 #define emac_gigabit_enable()  davinci_eth_gigabit_enable()
 #else
@@ -389,7 +399,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
/* Create RX queue and set receive process in place */
emac_rx_active_head = emac_rx_desc;
for (cnt = 0; cnt < EMAC_MAX_RX_BUFFERS; cnt++) {
-   rx_desc->next = (u_int32_t)(rx_desc + 1);
+   rx_desc->next = BD_TO_HW((u_int32_t)(rx_desc + 1));
rx_desc->buffer = &emac_rx_buffers[cnt * 
(EMAC_MAX_ETHERNET_PKT_SIZE + EMAC_PKT_ALIGN)];
rx_desc->buff_off_len = EMAC_MAX_ETHERNET_PKT_SIZE;
rx_desc->pkt_flag_len = EMAC_CPPI_OWNERSHIP_BIT;
@@ -441,7 +451,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
emac_gigabit_enable();
 
/* Start receive process */
-   writel((u_int32_t)emac_rx_desc, &adap_emac->RX0HDP);
+   writel(BD_TO_HW((u_int32_t)emac_rx_desc), &adap_emac->RX0HDP);
 
debug_emac("- emac_open\n");
 
@@ -559,7 +569,7 @@ static int davinci_eth_send_packet (struct eth_device *dev,
  EMAC_CPPI_OWNERSHIP_BIT |
  EMAC_CPPI_EOP_BIT);
/* Send the packet */
-   writel((unsigned long)emac_tx_desc, &adap_emac->TX0HDP);
+   writel(BD_TO_HW((unsigned long)emac_tx_desc), &adap_emac->TX0HDP);
 
/* Wait for packet to complete or link down */
while (1) {
@@ -603,14 +613,14 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
}
 
/* Ack received packet descriptor */
-   writel((unsigned long)rx_curr_desc, &adap_emac->RX0CP);
+   writel(BD_TO_HW((unsigned long)rx_curr_desc), 
&adap_emac->RX0CP);
curr_desc = rx_curr_desc;
emac_rx_active_head =
-   (volatile emac_desc *) rx_curr_desc->next;
+   (volatile emac_desc *) (HW_TO_BD(rx_curr_desc->next));
 
if (status & EMAC_CPPI_EOQ_BIT) {
if (emac_rx_active_head) {
-   writel((unsigned long)emac_rx_active_head,
+   writel(BD_TO_HW((unsigned 
long)emac_rx_active_head),
   &adap_emac->RX0HDP);
} else {
emac_rx_queue_active = 0;
@@ -628,7 +638,7 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
emac_rx_active_head = curr_desc;
emac_rx_active_tail = curr_desc;
if (emac_rx_queue_active != 0) {
-   writel((unsigned long)emac_rx_active_head,
+   writel(BD_TO_HW((unsigned 
long)emac_rx_active_head),
   &adap_emac->RX0HDP);
printf ("INFO: emac_rcv_pkt: active queue head 
= 0, HDP fired\n");
emac_rx_queue_active = 1;
@@ -636,10 +646,10 @@ static int davinci_eth_rcv_packet (struct eth_device *dev)
} else {
tail_desc = emac_rx_active_tail;
emac_rx_active_tail = curr_desc;
-   tail_desc->next = (unsigned int) curr_desc;
+   tail_desc->next = BD_TO_HW((unsigned int) curr_desc);
status = tail_desc->pkt_flag_len;
if (status & EMAC_CPPI_EOQ_BIT) {
-   writel((unsigned long)curr_desc,
+   writel(BD_TO_HW((unsigned long)curr_desc),
   &adap_emac->RX0HDP);
status &= ~EMAC_CPPI_EOQ_BIT;
tail_desc->pkt_flag_len = status;
-- 
1.7.6.2

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


[U-Boot] [PATCH 3/6] davinci_emac: conditionally compile specific PHY support

2011-10-05 Thread Ilya Yanok
Signed-off-by: Ilya Yanok 
---
 drivers/net/davinci_emac.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 7eb37c7..222a0d0 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -725,6 +725,7 @@ int davinci_emac_initialize(void)
phy_id |= tmp & 0x;
 
switch (phy_id) {
+#ifdef PHY_KSZ8873
case PHY_KSZ8873:
sprintf(phy.name, "KSZ8873 @ 0x%02x", active_phy_addr);
phy.init = ksz8873_init_phy;
@@ -732,6 +733,8 @@ int davinci_emac_initialize(void)
phy.get_link_speed = ksz8873_get_link_speed;
phy.auto_negotiate = ksz8873_auto_negotiate;
break;
+#endif
+#ifdef PHY_LXT972
case PHY_LXT972:
sprintf(phy.name, "LXT972 @ 0x%02x", active_phy_addr);
phy.init = lxt972_init_phy;
@@ -739,6 +742,8 @@ int davinci_emac_initialize(void)
phy.get_link_speed = lxt972_get_link_speed;
phy.auto_negotiate = lxt972_auto_negotiate;
break;
+#endif
+#ifdef PHY_DP83848
case PHY_DP83848:
sprintf(phy.name, "DP83848 @ 0x%02x", active_phy_addr);
phy.init = dp83848_init_phy;
@@ -746,6 +751,8 @@ int davinci_emac_initialize(void)
phy.get_link_speed = dp83848_get_link_speed;
phy.auto_negotiate = dp83848_auto_negotiate;
break;
+#endif
+#ifdef PHY_ET1011C
case PHY_ET1011C:
sprintf(phy.name, "ET1011C @ 0x%02x", active_phy_addr);
phy.init = gen_init_phy;
@@ -753,6 +760,7 @@ int davinci_emac_initialize(void)
phy.get_link_speed = et1011c_get_link_speed;
phy.auto_negotiate = gen_auto_negotiate;
break;
+#endif
default:
sprintf(phy.name, "GENERIC @ 0x%02x", active_phy_addr);
phy.init = gen_init_phy;
-- 
1.7.6.2

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


[U-Boot] [PATCH 6/6] AM35xx: add EMAC defines

2011-10-05 Thread Ilya Yanok
AM35xx has DaVinci-compatible EMAC.

Signed-off-by: Ilya Yanok 
---
 arch/arm/include/asm/arch-omap3/emac_defs.h |   57 +++
 1 files changed, 57 insertions(+), 0 deletions(-)
 create mode 100755 arch/arm/include/asm/arch-omap3/emac_defs.h

diff --git a/arch/arm/include/asm/arch-omap3/emac_defs.h 
b/arch/arm/include/asm/arch-omap3/emac_defs.h
new file mode 100755
index 000..cd54bd0
--- /dev/null
+++ b/arch/arm/include/asm/arch-omap3/emac_defs.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007 Sergey Kubushyn 
+ *
+ * Based on:
+ *
+ * 
+ *
+ * dm644x_emac.h
+ *
+ * TI DaVinci (DM644X) EMAC peripheral driver header for DV-EVM
+ *
+ * Copyright (C) 2005 Texas Instruments.
+ *
+ * 
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+
+ * Modifications:
+ * ver. 1.0: Sep 2005, TI PSP Team - Created EMAC version for uBoot.
+ *
+ */
+
+#ifndef _AM3517_EMAC_H_
+#define _AM3517_EMAC_H_
+
+#define EMAC_BASE_ADDR 0x5C01
+#define EMAC_WRAPPER_BASE_ADDR 0x5C00
+#define EMAC_WRAPPER_RAM_ADDR  0x5C02
+#define EMAC_MDIO_BASE_ADDR0x5C03
+#define EMAC_HW_RAM_ADDR   0x01E2
+
+#define EMAC_MDIO_BUS_FREQ 16600   /* 166 MHZ check */
+#define EMAC_MDIO_CLOCK_FREQ   100 /* 2.0 MHz */
+
+/* SOFTRESET macro definition interferes with emac_regs structure definition */
+#undef SOFTRESET
+
+typedef volatile unsigned int  dv_reg;
+typedef volatile unsigned int *dv_reg_p;
+
+#define DAVINCI_EMAC_VERSION2
+#define DAVINCI_EMAC_DCACHE
+
+#endif  /* _AM3517_EMAC_H_ */
-- 
1.7.6.2

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


[U-Boot] [RFC PATCH 0/0] Support for DaVinci EMAC on TI AM35xx

2011-10-05 Thread Ilya Yanok
Hi,

These series bring support of DaVinci EMAC interface on TI AM35xx
processors.
Changes:
 1. Common defines and register definitions moved to
drivers/net/davinci_emac.h
 2. Added coding/decoding of internal RAM addresses.
 3. DaVinci-specific PHY parts moved under #ifdefs.
 4. Added support for running with D-Cache enabled. Actually
this part is broken as of cabe287 commit and I need your guidance how
to proceed there. Should I check the cache line size and care about
alignment from the driver? Shouldn't this be abstracted by some sort
of API?
 5. Speed is hardcoded to 100Mbps. This definetely needs a better
solution but somehow existing code causes troubles.
 6. AM35xx-specific defines added into the separate header.

I'm not sure if I should just squash all the patches into one.

Thanks.

Signed-off-by: Ilya Yanok 

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


[U-Boot] [PATCH 1/6] davinci_emac: move arch-independent defines to separate header

2011-10-05 Thread Ilya Yanok
DaVinci EMAC is found not only on DaVinci SoCs but on some OMAP3 SoCs
also. This patch moves common defines from arch-davinci/emac_defs.h to
drivers/net/davinci_emac.h

Signed-off-by: Ilya Yanok 
---
 arch/arm/include/asm/arch-davinci/emac_defs.h |  293 ---
 drivers/net/davinci_emac.c|1 +
 drivers/net/davinci_emac.h|  317 +
 3 files changed, 318 insertions(+), 293 deletions(-)
 create mode 100644 drivers/net/davinci_emac.h

diff --git a/arch/arm/include/asm/arch-davinci/emac_defs.h 
b/arch/arm/include/asm/arch-davinci/emac_defs.h
index 294a9a8..8a17de9 100644
--- a/arch/arm/include/asm/arch-davinci/emac_defs.h
+++ b/arch/arm/include/asm/arch-davinci/emac_defs.h
@@ -84,299 +84,6 @@
 #define EMAC_MDIO_CLOCK_FREQ   200 /* 2.0 MHz */
 #endif
 
-/* PHY mask - set only those phy number bits where phy is/can be connected */
-#define EMAC_MDIO_PHY_NUM   CONFIG_EMAC_MDIO_PHY_NUM
-#define EMAC_MDIO_PHY_MASK  (1 << EMAC_MDIO_PHY_NUM)
-
-/* Ethernet Min/Max packet size */
-#define EMAC_MIN_ETHERNET_PKT_SIZE 60
-#define EMAC_MAX_ETHERNET_PKT_SIZE 1518
-#define EMAC_PKT_ALIGN 18  /* 1518 + 18 = 1536 (packet 
aligned on 32 byte boundry) */
-
-/* Number of RX packet buffers
- * NOTE: Only 1 buffer supported as of now
- */
-#define EMAC_MAX_RX_BUFFERS10
-
-
-/***
-  Internally used macros ***
- ***/
-
-#define EMAC_CH_TX 1
-#define EMAC_CH_RX 0
-
-/* Each descriptor occupies 4 words, lets start RX desc's at 0 and
- * reserve space for 64 descriptors max
- */
-#define EMAC_RX_DESC_BASE  0x0
-#define EMAC_TX_DESC_BASE  0x1000
-
-/* EMAC Teardown value */
-#define EMAC_TEARDOWN_VALUE0xfffc
-
-/* MII Status Register */
-#define MII_STATUS_REG 1
-
-/* Number of statistics registers */
-#define EMAC_NUM_STATS 36
-
-
-/* EMAC Descriptor */
-typedef volatile struct _emac_desc
-{
-   u_int32_t   next;   /* Pointer to next descriptor in chain 
*/
-   u_int8_t*buffer;/* Pointer to data buffer */
-   u_int32_t   buff_off_len;   /* Buffer Offset(MSW) and Length(LSW) */
-   u_int32_t   pkt_flag_len;   /* Packet Flags(MSW) and Length(LSW) */
-} emac_desc;
-
-/* CPPI bit positions */
-#define EMAC_CPPI_SOP_BIT  (0x8000)
-#define EMAC_CPPI_EOP_BIT  (0x4000)
-#define EMAC_CPPI_OWNERSHIP_BIT(0x2000)
-#define EMAC_CPPI_EOQ_BIT  (0x1000)
-#define EMAC_CPPI_TEARDOWN_COMPLETE_BIT(0x0800)
-#define EMAC_CPPI_PASS_CRC_BIT (0x0400)
-
-#define EMAC_CPPI_RX_ERROR_FRAME   (0x03fc)
-
-#define EMAC_MACCONTROL_MIIEN_ENABLE   (0x20)
-#define EMAC_MACCONTROL_FULLDUPLEX_ENABLE  (0x1)
-#define EMAC_MACCONTROL_GIGABIT_ENABLE (1 << 7)
-#define EMAC_MACCONTROL_GIGFORCE   (1 << 17)
-#define EMAC_MACCONTROL_RMIISPEED_100  (1 << 15)
-
-#define EMAC_MAC_ADDR_MATCH(1 << 19)
-#define EMAC_MAC_ADDR_IS_VALID (1 << 20)
-
-#define EMAC_RXMBPENABLE_RXCAFEN_ENABLE(0x20)
-#define EMAC_RXMBPENABLE_RXBROADEN (0x2000)
-
-
-#define MDIO_CONTROL_IDLE  (0x8000)
-#define MDIO_CONTROL_ENABLE(0x4000)
-#define MDIO_CONTROL_FAULT_ENABLE  (0x4)
-#define MDIO_CONTROL_FAULT (0x8)
-#define MDIO_USERACCESS0_GO(0x8000)
-#define MDIO_USERACCESS0_WRITE_READ(0x0)
-#define MDIO_USERACCESS0_WRITE_WRITE   (0x4000)
-#define MDIO_USERACCESS0_ACK   (0x2000)
-
-/* Ethernet MAC Registers Structure */
-typedef struct  {
-   dv_reg  TXIDVER;
-   dv_reg  TXCONTROL;
-   dv_reg  TXTEARDOWN;
-   u_int8_tRSVD0[4];
-   dv_reg  RXIDVER;
-   dv_reg  RXCONTROL;
-   dv_reg  RXTEARDOWN;
-   u_int8_tRSVD1[100];
-   dv_reg  TXINTSTATRAW;
-   dv_reg  TXINTSTATMASKED;
-   dv_reg  TXINTMASKSET;
-   dv_reg  TXINTMASKCLEAR;
-   dv_reg  MACINVECTOR;
-   u_int8_tRSVD2[12];
-   dv_reg  RXINTSTATRAW;
-   dv_reg  RXINTSTATMASKED;
-   dv_reg  RXINTMASKSET;
-   dv_reg  RXINTMASKCLEAR;
-   dv_reg  MACINTSTATRAW;
-   dv_reg  MACINTSTATMASKED;
-   dv_reg  MACINTMASKSET;
-   dv_reg  MACINTMASKCLEAR;
-   u_int8_tRSVD3[64];
-   dv_reg  RXMBPENABLE;
-   dv_reg  RXUNICASTSET;
-   dv_reg  RXUNICASTCLEAR;
-   dv_reg  RXMAXLEN;
-   dv_reg  RXBUFFEROFFSET;
-   dv_reg  RXFILTERLOWTHRESH;
-   u_int8_t  

[U-Boot] [PATCH 5/6] davinci_emac: hardcode 100Mbps for AM35xx and RMII

2011-10-05 Thread Ilya Yanok
For some reason code setting the speed based on the PHY feedback causes
troubles on AM3517 so hardcode 100Mbps for now.

Signed-off-by: Ilya Yanok 
---
 drivers/net/davinci_emac.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index b787213..bac3279 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -462,7 +462,8 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
writel(1, &adap_emac->RXUNICASTSET);
 
/* Enable MII interface and Full duplex mode */
-#ifdef CONFIG_SOC_DA8XX
+#if defined(CONFIG_SOC_DA8XX) || \
+   (defined(CONFIG_OMAP34XX) && defined(CONFIG_DRIVER_TI_EMAC_USE_RMII))
writel((EMAC_MACCONTROL_MIIEN_ENABLE |
EMAC_MACCONTROL_FULLDUPLEX_ENABLE |
EMAC_MACCONTROL_RMIISPEED_100),
-- 
1.7.6.2

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


[U-Boot] [PATCH] mcx: support for HTKW mcx board

2011-10-05 Thread Ilya Yanok
This patch adds support for the HTKW mcx AM3517-based board.
Serial, Ethernet, NAND and MMC are supported.

Signed-off-by: Ilya Yanok 
---
 MAINTAINERS  |4 +
 board/htkw/mcx/Makefile  |   44 +
 board/htkw/mcx/config.mk |   27 +++
 board/htkw/mcx/mcx.c |   98 +++
 board/htkw/mcx/mcx.h |  425 ++
 boards.cfg   |1 +
 include/configs/mcx.h|  351 ++
 7 files changed, 950 insertions(+), 0 deletions(-)
 create mode 100644 board/htkw/mcx/Makefile
 create mode 100644 board/htkw/mcx/config.mk
 create mode 100644 board/htkw/mcx/mcx.c
 create mode 100644 board/htkw/mcx/mcx.h
 create mode 100644 include/configs/mcx.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 3ab38fa..011141f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -878,6 +878,10 @@ Richard Woodruff 
 
omap2420h4  ARM1136EJS
 
+Ilya Yanok 
+
+   mcx ARM ARMV7 (AM35x SoC)
+
 Syed Mohammed Khasim 
 Sughosh Ganu 
 
diff --git a/board/htkw/mcx/Makefile b/board/htkw/mcx/Makefile
new file mode 100644
index 000..5d29458
--- /dev/null
+++ b/board/htkw/mcx/Makefile
@@ -0,0 +1,44 @@
+#
+# Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+#
+# Based on ti/evm/Makefile
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB= $(obj)lib$(BOARD).o
+
+COBJS  := $(BOARD).o
+
+SRCS   := $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+
+$(LIB):$(obj).depend $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+clean:
+   rm -f $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/htkw/mcx/config.mk b/board/htkw/mcx/config.mk
new file mode 100644
index 000..699a317
--- /dev/null
+++ b/board/htkw/mcx/config.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+#
+# Based on ti/evm/config.mk
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# Physical Address:
+# 8000' (bank0)
+# A000/ (bank1)
+# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
+# (mem base + reserved)
+
+# For use with external or internal boots.
+CONFIG_SYS_TEXT_BASE = 0x80008000
diff --git a/board/htkw/mcx/mcx.c b/board/htkw/mcx/mcx.c
new file mode 100644
index 000..aa490f0
--- /dev/null
+++ b/board/htkw/mcx/mcx.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2011 Ilya Yanok, Emcraft Systems
+ *
+ * Based on ti/evm/evm.c
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "mcx.h"
+
+#define AM3517_IP_SW_RESET 0x48002598
+#define CPGMACSS_SW_RST(1 << 1)
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/*
+ * Routine: board_init
+ * Description: Early hardware init.
+ */
+int board_init(void)
+{
+   gpmc_init(); 

[U-Boot] [PATCH 2/2] mpc83xx: Implement interrupt support for mpc83xx

2011-10-05 Thread Joe Hershberger
Signed-off-by: Joe Hershberger 
Cc: Joe Hershberger 
Cc: Kim Phillips 
---
 arch/powerpc/cpu/mpc83xx/interrupts.c  |  447 ++--
 arch/powerpc/include/asm/mpc83xx_irq.h |   72 +
 2 files changed, 499 insertions(+), 20 deletions(-)
 create mode 100644 arch/powerpc/include/asm/mpc83xx_irq.h

diff --git a/arch/powerpc/cpu/mpc83xx/interrupts.c 
b/arch/powerpc/cpu/mpc83xx/interrupts.c
index 446af27..5661421 100644
--- a/arch/powerpc/cpu/mpc83xx/interrupts.c
+++ b/arch/powerpc/cpu/mpc83xx/interrupts.c
@@ -26,17 +26,385 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
 DECLARE_GLOBAL_DATA_PTR;
 
+/*
+ * Some ipic code copied from the linux 2.6 kernel:
+ * /arch/powerpc/sysdev/ipic.*
+ * /arch/powerpc/include/asm/ipic.h
+ */
+static struct ipic_info_t ipic_info[] = {
+   [1] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 16,
+   },
+   [2] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 17,
+   },
+   [3] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 18,
+   },
+   [4] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 19,
+   },
+   [5] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 20,
+   },
+   [6] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 21,
+   },
+   [7] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 22,
+   },
+   [8] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 23,
+   },
+   [IPIC_INT_UART1] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 24,
+   },
+   [IPIC_INT_UART2] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 25,
+   },
+   [IPIC_INT_SEC] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 26,
+   },
+   [IPIC_INT_1588_1] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 27,
+   },
+   [IPIC_INT_1588_2] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 28,
+   },
+   [IPIC_INT_I2C1] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 29,
+   },
+   [IPIC_INT_I2C2] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 30,
+   },
+   [IPIC_INT_SPI] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 31,
+   },
+   [IPIC_INT_IRQ1] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 1,
+   },
+   [IPIC_INT_IRQ2] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 2,
+   },
+   [IPIC_INT_IRQ3] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 3,
+   },
+   [IPIC_INT_IRQ4] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 4,
+   },
+   [21] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 5,
+   },
+   [22] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 6,
+   },
+   [23] = {
+   .ack= IPIC_SEPNR,
+   .mask   = IPIC_SEMSR,
+   .bit= 7,
+   },
+   [IPIC_INT_TSEC1_TX] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 0,
+   },
+   [IPIC_INT_TSEC1_RX] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 1,
+   },
+   [IPIC_INT_TSEC1_ERR] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 2,
+   },
+   [IPIC_INT_TSEC2_TX] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 3,
+   },
+   [IPIC_INT_TSEC2_RX] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 4,
+   },
+   [IPIC_INT_TSEC2_ERR] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 5,
+   },
+   [IPIC_INT_USB_DR] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 6,
+   },
+   [39] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 7,
+   },
+   [40] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 8,
+   },
+   [41] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 9,
+   },
+   [42] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 10,
+   },
+   [43] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 11,
+   },
+   [44] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 12,
+   },
+   [45] = {
+   .mask   = IPIC_SIMSR_H,
+   .bit= 13,
+   },
+   [46] = {
+   .mask   = IPIC_SIMSR_H,
+   .b

[U-Boot] [PATCH 1/2] mpc83xx: Fix ipic structure definition

2011-10-05 Thread Joe Hershberger
Signed-off-by: Joe Hershberger 
Cc: Joe Hershberger 
Cc: Kim Phillips 
---
 arch/powerpc/include/asm/immap_83xx.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/immap_83xx.h 
b/arch/powerpc/include/asm/immap_83xx.h
index cc0293a..8e2a551 100644
--- a/arch/powerpc/include/asm/immap_83xx.h
+++ b/arch/powerpc/include/asm/immap_83xx.h
@@ -154,7 +154,7 @@ typedef struct ipic83xx {
u32 siprr_d;/* System Internal Interrupt Group D Priority 
Register */
u32 simsr_h;/* System Internal Interrupt Mask Register - 
High */
u32 simsr_l;/* System Internal Interrupt Mask Register - 
Low */
-   u8 res1[4];
+   u32 sicnr;  /* System Internal Interrupt Control Register */
u32 sepnr;  /* System External Interrupt Pending Register */
u32 smprr_a;/* System Mixed Interrupt Group A Priority 
Register */
u32 smprr_b;/* System Mixed Interrupt Group B Priority 
Register */
@@ -163,14 +163,14 @@ typedef struct ipic83xx {
u32 sersr;  /* System Error Status Register */
u32 sermr;  /* System Error Mask Register */
u32 sercr;  /* System Error Control Register */
-   u8 res2[4];
+   u8 res1[4];
u32 sifcr_h;/* System Internal Interrupt Force Register - 
High */
u32 sifcr_l;/* System Internal Interrupt Force Register - 
Low */
u32 sefcr;  /* System External Interrupt Force Register */
u32 serfr;  /* System Error Force Register */
u32 scvcr;  /* System Critical Interrupt Vector Register */
u32 smvcr;  /* System Management Interrupt Vector Register 
*/
-   u8 res3[0x98];
+   u8 res2[0x98];
 } ipic83xx_t;
 
 /*
-- 
1.6.0.2

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


Re: [U-Boot] [PATCH V2 1/4] VIDEO: MX5: Switch MX5 to CONFIG_VIDEO

2011-10-05 Thread Anatolij Gustschin
Hi Stefano,

On Wed, 28 Sep 2011 11:21:15 +0200
Stefano Babic  wrote:

> The framebuffer driver for MX5 is based on CONFIG_LCD.
> In the current implementation, there is a serious bug
> because the required memory is allocated before
> relocation, but the driver knows only later which is
> the resolution of the display. The patch switches the driver
> to CONFIG_VIDEO and the memory is allocated by the driver itself.
> 
> Signed-off-by: Stefano Babic 
> CC: Anatolij Gustschin 
> ---
> 
> V2: patchset with modified Marek's patch to select display

thanks for the new patchset, but I think we should make
commits bisectable. Also there were some compile warnings so I
decided to slightly rework this patchset and have just sent v3.
Can you please test it?

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


[U-Boot] [PATCH v3 3/3] MX5: Make IPU display output and pixel format configurable

2011-10-05 Thread Anatolij Gustschin
From: Marek Vasut 

Signed-off-by: Marek Vasut 
Signed-off-by: Stefano Babic 
Signed-off-by: Anatolij Gustschin 
---
V3: rebased to apply on top of previous changes

 board/ttcontrol/vision2/vision2.c |6 +++---
 drivers/video/mxc_ipuv3_fb.c  |   15 ++-
 include/ipu_pixfmt.h  |5 +
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/board/ttcontrol/vision2/vision2.c 
b/board/ttcontrol/vision2/vision2.c
index ca0c100..e496f64 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -39,12 +39,12 @@
 #include 
 #include 
 
+#include 
+
 DECLARE_GLOBAL_DATA_PTR;
 
 static u32 system_rev;
 
-extern int mx51_fb_init(struct fb_videomode *mode);
-
 static struct fb_videomode nec_nl6448bc26_09c = {
"NEC_NL6448BC26-09C",
60, /* Refresh */
@@ -610,7 +610,7 @@ void lcd_enable(void)
gpio_set_value(2, 1);
mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
 
-   ret = mx51_fb_init(&nec_nl6448bc26_09c);
+   ret = mx51_fb_init(&nec_nl6448bc26_09c, 0, IPU_PIX_FMT_RGB666);
if (ret)
puts("LCD cannot be configured\n");
 }
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
index eafacef..1bee54c 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc_ipuv3_fb.c
@@ -44,7 +44,9 @@ static int mxcfb_unmap_video_memory(struct fb_info *fbi);
 
 /* graphics setup */
 static GraphicDevice panel;
-struct fb_videomode *gmode;
+static struct fb_videomode *gmode;
+static uint8_t gdisp;
+static uint32_t gpixfmt;
 
 void fb_videomode_to_var(struct fb_var_screeninfo *var,
 const struct fb_videomode *mode)
@@ -499,7 +501,8 @@ static struct fb_info *mxcfb_init_fbinfo(void)
  *
  * @return  Appropriate error code to the kernel common code
  */
-static int mxcfb_probe(u32 interface_pix_fmt, struct fb_videomode *mode)
+static int mxcfb_probe(u32 interface_pix_fmt, uint8_t disp,
+   struct fb_videomode *mode)
 {
struct fb_info *fbi;
struct mxcfb_info *mxcfbi;
@@ -523,7 +526,7 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct 
fb_videomode *mode)
mxcfbi->blank = FB_BLANK_POWERDOWN;
}
 
-   mxcfbi->ipu_di = 0;
+   mxcfbi->ipu_di = disp;
 
ipu_disp_set_global_alpha(mxcfbi->ipu_ch, 1, 0x80);
ipu_disp_set_color_key(mxcfbi->ipu_ch, 0, 0);
@@ -581,7 +584,7 @@ void *video_hw_init(void)
if (ret)
puts("Error initializing IPU\n");
 
-   ret = mxcfb_probe(IPU_PIX_FMT_RGB666, gmode);
+   ret = mxcfb_probe(gpixfmt, gdisp, gmode);
debug("Framebuffer at 0x%x\n", (unsigned int)panel.frameAdrs);
 
return (void *)&panel;
@@ -596,9 +599,11 @@ void video_set_lut(unsigned int index, /* color number */
return;
 }
 
-int mx51_fb_init(struct fb_videomode *mode)
+int mx51_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt)
 {
gmode = mode;
+   gdisp = disp;
+   gpixfmt = pixfmt;
 
return 0;
 }
diff --git a/include/ipu_pixfmt.h b/include/ipu_pixfmt.h
index 0497bff..656f605 100644
--- a/include/ipu_pixfmt.h
+++ b/include/ipu_pixfmt.h
@@ -28,6 +28,9 @@
 #ifndef __IPU_PIXFMT_H__
 #define __IPU_PIXFMT_H__
 
+#include 
+#include 
+
 /*  IPU Pixel format definitions */
 #define fourcc(a, b, c, d)\
(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
@@ -73,4 +76,6 @@
 #define IPU_PIX_FMT_YVU422P fourcc('Y', 'V', '1', '6') /*< 16 YVU 4:2:2 */
 #define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */
 
+int mx51_fb_init(struct fb_videomode *mode, uint8_t disp, uint32_t pixfmt);
+
 #endif
-- 
1.7.1

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


[U-Boot] [PATCH v3 2/3] VIDEO: MX5: export pix format

2011-10-05 Thread Anatolij Gustschin
From: Stefano Babic 

Pixel format defines must be available for boards to set up
the right display. Move them and export in a new file.

Signed-off-by: Stefano Babic 
CC: Anatolij Gustschin 
CC: Marek Vasut 
---
V3: do not add new prototype of mx51_fb_init() so that this
commit doesn't break compiling

 drivers/video/ipu.h  |   46 +-
 include/ipu_pixfmt.h |   76 ++
 2 files changed, 77 insertions(+), 45 deletions(-)
 create mode 100644 include/ipu_pixfmt.h

diff --git a/drivers/video/ipu.h b/drivers/video/ipu.h
index d8bc287..99a2491 100644
--- a/drivers/video/ipu.h
+++ b/drivers/video/ipu.h
@@ -31,6 +31,7 @@
 #define __ASM_ARCH_IPU_H__
 
 #include 
+#include 
 
 #define IDMA_CHAN_INVALID  0xFF
 #define HIGH_RESOLUTION_WIDTH  1024
@@ -89,51 +90,6 @@ typedef enum {
IPU_PANEL_TFT,
 } ipu_panel_t;
 
-/*  IPU Pixel format definitions */
-#define fourcc(a, b, c, d)\
-   (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
-
-/*
- * Pixel formats are defined with ASCII FOURCC code. The pixel format codes are
- * the same used by V4L2 API.
- */
-
-#define IPU_PIX_FMT_GENERIC fourcc('I', 'P', 'U', '0')
-#define IPU_PIX_FMT_GENERIC_32 fourcc('I', 'P', 'U', '1')
-#define IPU_PIX_FMT_LVDS666 fourcc('L', 'V', 'D', '6')
-#define IPU_PIX_FMT_LVDS888 fourcc('L', 'V', 'D', '8')
-
-#define IPU_PIX_FMT_RGB332  fourcc('R', 'G', 'B', '1') /*<  8  RGB-3-3-2*/
-#define IPU_PIX_FMT_RGB555  fourcc('R', 'G', 'B', 'O') /*< 16  RGB-5-5-5*/
-#define IPU_PIX_FMT_RGB565  fourcc('R', 'G', 'B', 'P') /*< 1 6  RGB-5-6-5   */
-#define IPU_PIX_FMT_RGB666  fourcc('R', 'G', 'B', '6') /*< 18  RGB-6-6-6*/
-#define IPU_PIX_FMT_BGR666  fourcc('B', 'G', 'R', '6') /*< 18  BGR-6-6-6*/
-#define IPU_PIX_FMT_BGR24   fourcc('B', 'G', 'R', '3') /*< 24  BGR-8-8-8*/
-#define IPU_PIX_FMT_RGB24   fourcc('R', 'G', 'B', '3') /*< 24  RGB-8-8-8*/
-#define IPU_PIX_FMT_BGR32   fourcc('B', 'G', 'R', '4') /*< 32  BGR-8-8-8-8  */
-#define IPU_PIX_FMT_BGRA32  fourcc('B', 'G', 'R', 'A') /*< 32  BGR-8-8-8-8  */
-#define IPU_PIX_FMT_RGB32   fourcc('R', 'G', 'B', '4') /*< 32  RGB-8-8-8-8  */
-#define IPU_PIX_FMT_RGBA32  fourcc('R', 'G', 'B', 'A') /*< 32  RGB-8-8-8-8  */
-#define IPU_PIX_FMT_ABGR32  fourcc('A', 'B', 'G', 'R') /*< 32  ABGR-8-8-8-8 */
-
-/* YUV Interleaved Formats */
-#define IPU_PIX_FMT_YUYVfourcc('Y', 'U', 'Y', 'V') /*< 16 YUV 4:2:2 */
-#define IPU_PIX_FMT_UYVYfourcc('U', 'Y', 'V', 'Y') /*< 16 YUV 4:2:2 */
-#define IPU_PIX_FMT_Y41Pfourcc('Y', '4', '1', 'P') /*< 12 YUV 4:1:1 */
-#define IPU_PIX_FMT_YUV444  fourcc('Y', '4', '4', '4') /*< 24 YUV 4:4:4 */
-
-/* two planes -- one Y, one Cb + Cr interleaved  */
-#define IPU_PIX_FMT_NV12fourcc('N', 'V', '1', '2') /* 12  Y/CbCr 4:2:0  */
-
-#define IPU_PIX_FMT_GREYfourcc('G', 'R', 'E', 'Y') /*< 8  Greyscale */
-#define IPU_PIX_FMT_YVU410P fourcc('Y', 'V', 'U', '9') /*< 9  YVU 4:1:0 */
-#define IPU_PIX_FMT_YUV410P fourcc('Y', 'U', 'V', '9') /*< 9  YUV 4:1:0 */
-#define IPU_PIX_FMT_YVU420P fourcc('Y', 'V', '1', '2') /*< 12 YVU 4:2:0 */
-#define IPU_PIX_FMT_YUV420P fourcc('I', '4', '2', '0') /*< 12 YUV 4:2:0 */
-#define IPU_PIX_FMT_YUV420P2 fourcc('Y', 'U', '1', '2')/*< 12 YUV 
4:2:0 */
-#define IPU_PIX_FMT_YVU422P fourcc('Y', 'V', '1', '6') /*< 16 YVU 4:2:2 */
-#define IPU_PIX_FMT_YUV422P fourcc('4', '2', '2', 'P') /*< 16 YUV 4:2:2 */
-
 /*
  * IPU Driver channels definitions.
  * Note these are different from IDMA channels
diff --git a/include/ipu_pixfmt.h b/include/ipu_pixfmt.h
new file mode 100644
index 000..0497bff
--- /dev/null
+++ b/include/ipu_pixfmt.h
@@ -0,0 +1,76 @@
+/*
+ * (C) Copyright 2011
+ * Stefano Babic, DENX Software Engineering, sba...@denx.de
+ *
+ * Based on Linux IPU driver for MX51 (ipu.h):
+ *
+ * (C) Copyright 2005-2010 Freescale Semiconductor, Inc.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __IPU_PIXFMT_H__
+#define __IPU_PIXFMT_H__
+
+/*  IPU Pixel format definitions */
+#define fourcc(a, b, c, d)\
+   (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+
+/*
+ * Pixel formats are defined with ASCII FOURCC code. The pixel format codes 

[U-Boot] [PATCH v3 1/3] VIDEO: MX5: Switch MX5 to CONFIG_VIDEO

2011-10-05 Thread Anatolij Gustschin
From: Stefano Babic 

The framebuffer driver for MX5 is based on CONFIG_LCD.
In the current implementation, there is a serious bug
because the required memory is allocated before
relocation, but the driver knows only later which is
the resolution of the display. The patch switches the driver
to CONFIG_VIDEO and the memory is allocated by the driver itself.

We also need to switch the vision2 board code and config file
in the same commit so that this commit will be bisectable.

Signed-off-by: Stefano Babic 
CC: Anatolij Gustschin 
Signed-off-by: Anatolij Gustschin 
---
V3: patches 1 and 3 of the previous patchset combined to single
patch to make this commit bisectable
V2: patchset with modified Marek's patch to select display

 board/ttcontrol/vision2/vision2.c |   36 +++-
 drivers/video/mxc_ipuv3_fb.c  |  110 -
 include/configs/vision2.h |   11 ++--
 3 files changed, 62 insertions(+), 95 deletions(-)

diff --git a/board/ttcontrol/vision2/vision2.c 
b/board/ttcontrol/vision2/vision2.c
index ebca7b6..ca0c100 100644
--- a/board/ttcontrol/vision2/vision2.c
+++ b/board/ttcontrol/vision2/vision2.c
@@ -600,6 +600,21 @@ int board_mmc_init(bd_t *bis)
 }
 #endif
 
+void lcd_enable(void)
+{
+   int ret;
+
+   mxc_request_iomux(MX51_PIN_DI1_PIN2, IOMUX_CONFIG_ALT0);
+   mxc_request_iomux(MX51_PIN_DI1_PIN3, IOMUX_CONFIG_ALT0);
+
+   gpio_set_value(2, 1);
+   mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
+
+   ret = mx51_fb_init(&nec_nl6448bc26_09c);
+   if (ret)
+   puts("LCD cannot be configured\n");
+}
+
 int board_early_init_f(void)
 {
 
@@ -636,26 +651,15 @@ static void backlight(int on)
}
 }
 
-void lcd_enable(void)
-{
-   int ret;
-
-   mxc_request_iomux(MX51_PIN_DI1_PIN2, IOMUX_CONFIG_ALT0);
-   mxc_request_iomux(MX51_PIN_DI1_PIN3, IOMUX_CONFIG_ALT0);
-
-   gpio_set_value(2, 1);
-   mxc_request_iomux(MX51_PIN_GPIO1_2, IOMUX_CONFIG_ALT0);
-
-   ret = mx51_fb_init(&nec_nl6448bc26_09c);
-   if (ret)
-   puts("LCD cannot be configured\n");
-}
-
 int board_init(void)
 {
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;
 
+   lcd_enable();
+
+   backlight(1);
+
return 0;
 }
 
@@ -676,6 +680,8 @@ int board_late_init(void)
udelay(2000);
 #endif
 
+   setenv("stdout", "serial");
+
return 0;
 }
 
diff --git a/drivers/video/mxc_ipuv3_fb.c b/drivers/video/mxc_ipuv3_fb.c
index a66981c..eafacef 100644
--- a/drivers/video/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc_ipuv3_fb.c
@@ -27,7 +27,6 @@
  * MA 02111-1307 USA
  */
 
-/* #define DEBUG */
 #include 
 #include 
 #include 
@@ -35,43 +34,17 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include "videomodes.h"
 #include "ipu.h"
 #include "mxcfb.h"
 
-DECLARE_GLOBAL_DATA_PTR;
-
-void *lcd_base;/* Start of framebuffer memory  */
-void *lcd_console_address; /* Start of console buffer  */
-
-int lcd_line_length;
-int lcd_color_fg;
-int lcd_color_bg;
-
-short console_col;
-short console_row;
-
-vidinfo_t panel_info;
-
 static int mxcfb_map_video_memory(struct fb_info *fbi);
 static int mxcfb_unmap_video_memory(struct fb_info *fbi);
 
-void lcd_initcolregs(void)
-{
-}
-
-void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue)
-{
-}
-
-void lcd_disable(void)
-{
-}
-
-void lcd_panel_disable(void)
-{
-}
+/* graphics setup */
+static GraphicDevice panel;
+struct fb_videomode *gmode;
 
 void fb_videomode_to_var(struct fb_var_screeninfo *var,
 const struct fb_videomode *mode)
@@ -440,8 +413,8 @@ static int mxcfb_map_video_memory(struct fb_info *fbi)
fbi->fix.line_length;
}
 
-   fbi->screen_base = (char *)lcd_base;
-   fbi->fix.smem_start = (unsigned long)lcd_base;
+   fbi->screen_base = (char *)malloc(fbi->fix.smem_len);
+   fbi->fix.smem_start = (unsigned long)fbi->screen_base;
if (fbi->screen_base == 0) {
puts("Unable to allocate framebuffer memory\n");
fbi->fix.smem_len = 0;
@@ -561,12 +534,12 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct 
fb_videomode *mode)
mxcfb_info[mxcfbi->ipu_di] = fbi;
 
/* Need dummy values until real panel is configured */
-   fbi->var.xres = 640;
-   fbi->var.yres = 480;
-   fbi->var.bits_per_pixel = 16;
 
mxcfbi->ipu_di_pix_fmt = interface_pix_fmt;
fb_videomode_to_var(&fbi->var, mode);
+   fbi->var.bits_per_pixel = 16;
+   fbi->fix.line_length = fbi->var.xres * (fbi->var.bits_per_pixel / 8);
+   fbi->fix.smem_len = fbi->var.yres_virtual * fbi->fix.line_length;
 
mxcfb_check_var(&fbi->var, fbi);
 
@@ -581,19 +554,16 @@ static int mxcfb_probe(u32 interface_pix_fmt, struct 
fb_videomode *mode)
 
mxcfb_set_par(fbi);
 
-   /* Setting panel_info for lcd */
-   pa

Re: [U-Boot] [PATCH] PPC: Cleanup tqm8xx_pcmcia.c

2011-10-05 Thread Marek Vasut
On Wednesday, October 05, 2011 09:52:03 PM Wolfgang Denk wrote:
> In message <20111005184025.2c55118e5...@gemini.denx.de> I wrote:
> > Dear Marek Vasut,
> > 
> > In message <1317819115-9089-1-git-send-email-marek.va...@gmail.com> you 
wrote:
> > > Signed-off-by: Marek Vasut 
> > > ---
> > > 
> > >  drivers/pcmcia/tqm8xx_pcmcia.c |  154
> > >  +--- 1 files changed, 81
> > >  insertions(+), 73 deletions(-)
> > 
> > Tested on TQM823L_LCD and TQM855M (with ARGOSY PnPIDE D5 PCMCIA
> > adapter and IBM-DCXA-21 HDD).
> 
> Funny enough, the build will break for other boards (like TQM860L) due
> to the increased code size.  Will submit a patch and push it before
> this one.
> 
> Best regards,
> 
> Wolfgang Denk

Thanks for testing!

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


Re: [U-Boot] [PATCH 2/2 RESEND] SPL: Allow user to disable CPU support library

2011-10-05 Thread Marek Vasut
On Thursday, October 06, 2011 12:02:17 AM Scott Wood wrote:
> On 10/05/2011 04:44 PM, Tom Rini wrote:
> > On Thu, Sep 22, 2011 at 1:52 AM, Marek Vasut  wrote:
> >> On Wednesday, September 21, 2011 01:31:28 AM Scott Wood wrote:
> >>> Is it really such a burden to put something like
> >>> 
> >>> #define CONFIG_SPL_ARCH_CPU
> >>> 
> >>> in your board config header?
> >> 
> >> Yes it's a burden. It's a burden to add this to all boards but one. It
> >> makes no sense.
> > 
> > Looking at a pile of partially ported TI boards, I wonder if we don't
> > need a few common SPL include files, setting this-and-that and then
> > letting boards opt-out of these defaults (or just going it alone?) as
> > needed.
> 
> A header with common opt-ins would be good -- possibly have a small
> number of common "profiles" for typical types of SPL, and/or high-level
> feature #ifdefs that #define the components required to enable them.
> 
> Also, an opt-out might be more palatable if it is local to this
> particular CPU makefile, and indicates what specifically is being opted
> out of -- what constitutes a "CPU support library" is vague from a
> target-independent view.
> 
> I guess what you're really trying to replace is the initial entry code,
> with something provided under board/?  Only the cpu makefile knows which
> files are initial entry versus other CPU-specific things.
> 
> -Scott

Very well then, who's preparing the profiles?

Also, the CPU-library will then be composed of no files, will the makefiles 
handle empty COBJS ?
Cheers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] TQM8xx: make room for growing code size due to I/O accessor cleanup

2011-10-05 Thread Marek Vasut
On Wednesday, October 05, 2011 10:01:05 PM Wolfgang Denk wrote:
> Dear Wolfgang Denk,
> 
> In message <1317844501-9494-1-git-send-email...@denx.de> you wrote:
> > Commit "PPC: Cleanup tqm8xx_pcmcia.c" will clean up the PCMCIA code
> > to use I/O accessors instead of plain volatile pointer accesses.
> > This will result in about 300 byte bigger code.  Fix custom linker
> > script to make room for this.
> > 
> > While we are at it, drop unmaintained u-boot.lds.debug linker script.
> > 
> > Signed-off-by: Wolfgang Denk 
> > Cc: Marek Vasut 
> > ---
> > 
> >  board/tqc/tqm8xx/u-boot.lds   |3 +-
> >  board/tqc/tqm8xx/u-boot.lds.debug |  135
> >  - 2 files changed, 2 insertions(+),
> >  136 deletions(-)
> >  delete mode 100644 board/tqc/tqm8xx/u-boot.lds.debug
> 
> Applied, thanks.

You're thanking to yourself ? ;-)

Anyway, thanks for this patch!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] cmd_bdinfo: replace print_str() with print_mhz()

2011-10-05 Thread Timur Tabi
The print_str() helper function for cmd_bdinfo can print any string, but it
is only used to print MHz values.  Replace it with print_mhz() that takes
a number and converts it to a string internally.

Signed-off-by: Timur Tabi 
---

This patch applies on top of "powerpc/85xx: don't display address map size
(32-bit vs. 36-bit) during boot".

I've only tested this on PowerPC.

 common/cmd_bdinfo.c |   72 --
 1 files changed, 35 insertions(+), 37 deletions(-)

diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 12863f2..3f7f6e6 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -40,12 +40,11 @@ static void print_lnum(const char *, u64);
 #endif
 
 #if defined(CONFIG_PPC)
-static void print_str(const char *, const char *);
+static void print_mhz(const char *, unsigned long);
 
 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
bd_t *bd = gd->bd;
-   char buf[32];
 
 #ifdef DEBUG
print_num("bd address", (ulong)bd);
@@ -68,32 +67,32 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
defined(CONFIG_440SP) || defined(CONFIG_440SPE) || \
defined(CONFIG_XILINX_405)
-   print_str("procfreq",   strmhz(buf, bd->bi_procfreq));
-   print_str("plb_busfreq",strmhz(buf, bd->bi_plb_busfreq));
+   print_mhz("procfreq",   bd->bi_procfreq);
+   print_mhz("plb_busfreq",bd->bi_plb_busfreq);
 #ifdefined(CONFIG_405EP) || defined(CONFIG_405GP) || \
defined(CONFIG_440EP) || defined(CONFIG_440EPX) || \
defined(CONFIG_440GR) || defined(CONFIG_440GRX) || \
defined(CONFIG_440SPE) || defined(CONFIG_XILINX_405)
-   print_str("pci_busfreq",strmhz(buf, bd->bi_pci_busfreq));
+   print_mhz("pci_busfreq",bd->bi_pci_busfreq);
 #endif
 #else  /* ! CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, 
CONFIG_440EP CONFIG_440GR */
 #if defined(CONFIG_CPM2)
-   print_str("vco",strmhz(buf, bd->bi_vco));
-   print_str("sccfreq",strmhz(buf, bd->bi_sccfreq));
-   print_str("brgfreq",strmhz(buf, bd->bi_brgfreq));
+   print_mhz("vco",bd->bi_vco);
+   print_mhz("sccfreq",bd->bi_sccfreq);
+   print_mhz("brgfreq",bd->bi_brgfreq);
 #endif
-   print_str("intfreq",strmhz(buf, bd->bi_intfreq));
+   print_mhz("intfreq",bd->bi_intfreq);
 #if defined(CONFIG_CPM2)
-   print_str("cpmfreq",strmhz(buf, bd->bi_cpmfreq));
+   print_mhz("cpmfreq",bd->bi_cpmfreq);
 #endif
-   print_str("busfreq",strmhz(buf, bd->bi_busfreq));
+   print_mhz("busfreq",bd->bi_busfreq);
 #endif /* CONFIG_405GP, CONFIG_405CR, CONFIG_405EP, CONFIG_XILINX_405, 
CONFIG_440EP CONFIG_440GR */
 #if defined(CONFIG_MPC8220)
-   print_str("inpfreq",strmhz(buf, bd->bi_inpfreq));
-   print_str("flbfreq",strmhz(buf, bd->bi_flbfreq));
-   print_str("pcifreq",strmhz(buf, bd->bi_pcifreq));
-   print_str("vcofreq",strmhz(buf, bd->bi_vcofreq));
-   print_str("pevfreq",strmhz(buf, bd->bi_pevfreq));
+   print_mhz("inpfreq",bd->bi_inpfreq);
+   print_mhz("flbfreq",bd->bi_flbfreq);
+   print_mhz("pcifreq",bd->bi_pcifreq);
+   print_mhz("vcofreq",bd->bi_vcofreq);
+   print_mhz("pevfreq",bd->bi_pevfreq);
 #endif
 
 #ifdef CONFIG_ENABLE_36BIT_PHYS
@@ -122,7 +121,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * 
const argv[])
 #endif
 
 #ifdef CONFIG_HERMES
-   print_str("ethspeed",   strmhz(buf, bd->bi_ethspeed));
+   print_mhz("ethspeed",   bd->bi_ethspeed);
 #endif
printf("IP addr = %pI4\n", &bd->bi_ip_addr);
printf("baudrate= %6ld bps\n", bd->bi_baudrate);
@@ -214,12 +213,11 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char 
* const argv[])
 
 #elif defined(CONFIG_M68K)
 
-static void print_str(const char *, const char *);
+static void print_mhz(const char *, unsigned long);
 
 int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
bd_t *bd = gd->bd;
-   char buf[32];
 
print_num("memstart",   (ulong)bd->bi_memstart);
print_lnum("memsize",   (u64)bd->bi_memsize);
@@ -233,15 +231,15 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char 
* const argv[])
 #if defined(CONFIG_SYS_MBAR)
print_num("mbar",   bd->bi_mbar_base);
 #endif
-   print_str("cpufreq",strmhz(buf, bd->bi_intfreq));
-   print_str("busfreq",strmhz(buf, bd->bi_busfreq));
+   print_mhz("cpufreq",bd->bi_intfreq);
+   print_mhz("busfreq",bd->bi_busfreq);

Re: [U-Boot] [PATCH 2/2 RESEND] SPL: Allow user to disable CPU support library

2011-10-05 Thread Scott Wood
On 10/05/2011 04:44 PM, Tom Rini wrote:
> On Thu, Sep 22, 2011 at 1:52 AM, Marek Vasut  wrote:
>> On Wednesday, September 21, 2011 01:31:28 AM Scott Wood wrote:
>>> Is it really such a burden to put something like
>>>
>>> #define CONFIG_SPL_ARCH_CPU
>>>
>>> in your board config header?
>>
>> Yes it's a burden. It's a burden to add this to all boards but one. It makes 
>> no
>> sense.
> 
> Looking at a pile of partially ported TI boards, I wonder if we don't need a 
> few
> common SPL include files, setting this-and-that and then letting boards 
> opt-out
> of these defaults (or just going it alone?) as needed.

A header with common opt-ins would be good -- possibly have a small
number of common "profiles" for typical types of SPL, and/or high-level
feature #ifdefs that #define the components required to enable them.

Also, an opt-out might be more palatable if it is local to this
particular CPU makefile, and indicates what specifically is being opted
out of -- what constitutes a "CPU support library" is vague from a
target-independent view.

I guess what you're really trying to replace is the initial entry code,
with something provided under board/?  Only the cpu makefile knows which
files are initial entry versus other CPU-specific things.

-Scott

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


Re: [U-Boot] [PATCH v2 05/10] spl, nand: add 4bit HW ecc oob first nand_read_page function

2011-10-05 Thread Scott Wood
On 10/05/2011 09:28 AM, Heiko Schocher wrote:
> similiar to commit dc7cd8e59ba077f3b4c1a4557c9cd86a31b9ab1f, only
> adapted for the new spl framework.
> 
> Signed-off-by: Heiko Schocher 
> Cc: Scott Wood 
> Cc: Albert ARIBAUD 
> Cc: Sandeep Paulraj 
> ---
>  drivers/mtd/nand/nand_spl_simple.c |   43 
> 
>  1 files changed, 43 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_spl_simple.c 
> b/drivers/mtd/nand/nand_spl_simple.c
> index 71491d4..7ab332f 100644
> --- a/drivers/mtd/nand/nand_spl_simple.c
> +++ b/drivers/mtd/nand/nand_spl_simple.c
> @@ -140,6 +140,47 @@ static int nand_is_bad_block(int block)
>   return 0;
>  }
>  
> +#if defined(CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST)
> +static int nand_read_page(int block, int page, uchar *dst)
> +{
> + struct nand_chip *this = mtd.priv;
> + u_char *ecc_calc;
> + u_char *ecc_code;
> + u_char *oob_data;
> + int i;
> + int eccsize = CONFIG_SYS_NAND_ECCSIZE;
> + int eccbytes = CONFIG_SYS_NAND_ECCBYTES;
> + int eccsteps = CONFIG_SYS_NAND_ECCSTEPS;
> + uint8_t *p = dst;
> + int stat;
> +
> + /*
> +  * No malloc available for now, just use some temporary locations
> +  * in SDRAM
> +  */
> + ecc_calc = (u_char *)(CONFIG_SYS_SDRAM_BASE + 0x1);
> + ecc_code = ecc_calc + 0x100;
> + oob_data = ecc_calc + 0x200;
> +
> + nand_command(block, page, 0, NAND_CMD_READOOB);
> + this->read_buf(&mtd, oob_data, CONFIG_SYS_NAND_OOBSIZE);
> + nand_command(block, page, 0, NAND_CMD_READ0);
> +
> + /* Pick the ECC bytes out of the oob data */
> + for (i = 0; i < CONFIG_SYS_NAND_ECCTOTAL; i++)
> + ecc_code[i] = oob_data[nand_ecc_pos[i]];
> +
> +
> + for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
> + this->ecc.hwctl(&mtd, NAND_ECC_READ);
> + this->read_buf(&mtd, p, eccsize);
> + this->ecc.calculate(&mtd, p, &ecc_calc[i]);
> + stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
> + }
> +
> + return 0;
> +}
> +#else
>  static int nand_read_page(int block, int page, void *dst)
>  {
>   struct nand_chip *this = mtd.priv;
> @@ -186,6 +227,7 @@ static int nand_read_page(int block, int page, void *dst)
>  
>   return 0;
>  }
> +#endif
>  
>  int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
>  {

ACK this part

> @@ -231,6 +273,7 @@ void nand_init(void)
>   nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
>   (void  __iomem *)CONFIG_SYS_NAND_BASE;
>   nand_chip.options = 0;
> + nand_chip.dev_ready = NULL;
>   board_nand_init(&nand_chip);
>  
>   if (nand_chip.select_chip)

This looks unrelated, and if it makes a difference suggests that the BSS
isn't being cleared.

-Scott

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


Re: [U-Boot] [PATCH 2/2 RESEND] SPL: Allow user to disable CPU support library

2011-10-05 Thread Tom Rini
On Thu, Sep 22, 2011 at 1:52 AM, Marek Vasut  wrote:
> On Wednesday, September 21, 2011 01:31:28 AM Scott Wood wrote:
>> On 09/20/2011 04:30 PM, Marek Vasut wrote:
>> > On Tuesday, September 20, 2011 11:23:01 PM Scott Wood wrote:
>> >> On 09/20/2011 04:16 PM, Marek Vasut wrote:
>> >>> On Tuesday, September 20, 2011 09:12:08 PM Scott Wood wrote:
>>  On 09/19/2011 05:31 PM, Marek Vasut wrote:
>> > Then you adjust the makefile there by ifdef CONFIG_SPL_BUILD
>> 
>>  It's not quite that simple, since different SPLs will have different
>>  requirements.  Board config headers will need to define symbols like
>>  CONFIG_SPL_FEATURE and the makefiles will use both CONFIG_SPL_BUILD
>>  and CONFIG_SPL_FEATURE to determine which object files to include.
>> >>>
>> >>> That kind of granularity is there already too -- though on driver
>> >>> level. But so far it seem sufficient.
>> >>
>> >> What's wrong with using that model for arch code as well?
>> >>
>> >> Note that "so far" most of the existing SPL targets have not been
>> >> converted to the new spl/.
>> >
>> > Right, so when you hit the problem, you fix it. No need to overengineer
>> > it right away.
>>
>> It seems you hit the problem already, and you're trying to add an ad hoc
>> workaround rather than apply the same concept to arch code that is to be
>> used with drivers.
>>
>> Wanting to staying consistent and simple is not overengineering.
>>
>> >> It's not about rarity (which is often misjudged, BTW).  It's about
>> >> whether the model for selecting code for the SPL is additive or
>> >> subtractive, and whether we have a consistent mechanism or ad hockery
>> >> from the start.
>> >>
>> >> In nand_spl/ it was fully additive.  I'd like to keep it that way.
>> >
>> > I see your point and I disagree. I'd use the majority vote here -- most
>> > of the boards need it and rare ones don't -- so why put additional
>> > burden on majority in favor of minority ?
>>
>> Is it really such a burden to put something like
>>
>> #define CONFIG_SPL_ARCH_CPU
>>
>> in your board config header?
>
> Yes it's a burden. It's a burden to add this to all boards but one. It makes 
> no
> sense.

Looking at a pile of partially ported TI boards, I wonder if we don't need a few
common SPL include files, setting this-and-that and then letting boards opt-out
of these defaults (or just going it alone?) as needed.

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


[U-Boot] [PATCH 2/2 v1] integrator: enable Vpp and disable flash protection

2011-10-05 Thread Linus Walleij
This enables Vpp and disables the flash protection on the
Integrator when starting U-Boot. The integrator/AP has double
protection mechanisms: this one and the EBI protection bit
(patch earlier), the Integrator/CP has only one line of
protection in these registers.

Signed-off-by: Linus Walleij 
---
 board/armltd/integrator/integrator.c |   20 
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/board/armltd/integrator/integrator.c 
b/board/armltd/integrator/integrator.c
index dd83ca5..a507c09 100644
--- a/board/armltd/integrator/integrator.c
+++ b/board/armltd/integrator/integrator.c
@@ -37,6 +37,7 @@
 #include 
 #include 
 #include "arm-ebi.h"
+#include "integrator-sc.h"
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -76,7 +77,19 @@ extern void cm_remap(void);
cm_remap(); /* remaps writeable memory to 0x */
 #endif
 
+#ifdef CONFIG_ARCH_CINTEGRATOR
/*
+* Flash protection on the Integrator/CP is in a simple register
+*/
+   val = readl(CP_FLASHPROG);
+   val |= (CP_FLASHPROG_FLVPPEN | CP_FLASHPROG_FLWREN);
+   writel(val, CP_FLASHPROG);
+#else
+   /*
+* The Integrator/AP has some special protection mechanisms
+* for the external memories, first the External Bus Interface (EBI)
+* then the system controller (SC).
+*
 * The system comes up with the flash memory non-writable and
 * configuration locked. If we want U-Boot to be used for flash
 * access we cannot have the flash memory locked.
@@ -88,6 +101,13 @@ extern void cm_remap(void);
writel(val, EBI_BASE + EBI_CSR1_REG);
writel(0, EBI_BASE + EBI_LOCK_REG);
 
+   /*
+* Set up the system controller to remove write protection from
+* the flash memory and enable Vpp
+*/
+   writel(SC_CTRL_FLASHVPP | SC_CTRL_FLASHWP, SC_CTRLS);
+#endif
+
icache_enable ();
 
return 0;
-- 
1.7.6.4

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


[U-Boot] [PATCH 1/2 v1] integrator: add system controller header

2011-10-05 Thread Linus Walleij
Break out the AP system controller and CP "CP controller"
registers into a header file, it gives better overview than
hardcoding its values and other disturbing practices.

Signed-off-by: Linus Walleij 
---
 board/armltd/integrator/integrator-sc.h |   91 +++
 1 files changed, 91 insertions(+), 0 deletions(-)
 create mode 100644 board/armltd/integrator/integrator-sc.h

diff --git a/board/armltd/integrator/integrator-sc.h 
b/board/armltd/integrator/integrator-sc.h
new file mode 100644
index 000..279dc55
--- /dev/null
+++ b/board/armltd/integrator/integrator-sc.h
@@ -0,0 +1,91 @@
+/*
+ * (C) Copyright 2011
+ * Linaro
+ * Linus Walleij 
+ * Register definitions for the System Controller (SC) and
+ * the similar "CP Controller" found in the ARM Integrator/AP and
+ * Integrator/CP reference designs
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __ARM_SC_H
+#define __ARM_SC_H
+
+#define SC_BASE0x1100
+
+/*
+ * The system controller registers
+ */
+#define SC_ID_OFFSET   0x00
+#define SC_OSC_OFFSET  0x04
+/* Setting this bit switches to 25 MHz mode, clear means 33 MHz */
+#define SC_OSC_DIVXY   (1 << 8)
+#define SC_CTRLS_OFFSET0x08
+#define SC_CTRLC_OFFSET0x0C
+/* Set bits by writing CTRLS, clear bits by writing CTRLC */
+#define SC_CTRL_SOFTRESET  (1 << 0)
+#define SC_CTRL_FLASHVPP   (1 << 1)
+#define SC_CTRL_FLASHWP(1 << 2)
+#define SC_CTRL_UART1DTR   (1 << 4)
+#define SC_CTRL_UART1RTS   (1 << 5)
+#define SC_CTRL_UART0DTR   (1 << 6)
+#define SC_CTRL_UART0RTS   (1 << 7)
+#define SC_DEC_OFFSET  0x10
+#define SC_ARB_OFFSET  0x14
+#define SC_PCI_OFFSET  0x18
+#define SC_PCI_PCIEN   (1 << 0)
+#define SC_PCI_PCIBINT_CLR (1 << 1)
+#define SC_LOCK_OFFSET 0x1C
+#define SC_LBFADDR_OFFSET  0x20
+#define SC_LBFCODE_OFFSET  0x24
+
+#define SC_ID (SC_BASE + SC_ID_OFFSET)
+#define SC_OSC (SC_BASE + SC_OSC_OFFSET)
+#define SC_CTRLS (SC_BASE + SC_CTRLS_OFFSET)
+#define SC_CTRLC (SC_BASE + SC_CTRLC_OFFSET)
+#define SC_DEC (SC_BASE + SC_DEC_OFFSET)
+#define SC_ARB (SC_BASE + SC_ARB_OFFSET)
+#define SC_PCI (SC_BASE + SC_PCI_OFFSET)
+#define SC_LOCK (SC_BASE + SC_LOCK_OFFSET)
+#define SC_LBFADDR (SC_BASE + SC_LBFADDR_OFFSET)
+#define SC_LBFCODE (SC_BASE + SC_LBFCODE_OFFSET)
+
+/*
+ * The Integrator/CP as a smaller set of registers, at a different
+ * offset - probably not to disturb old software.
+ */
+
+#define CP_BASE0xCB00
+
+#define CP_IDFIELD_OFFSET  0x00
+#define CP_FLASHPROG_OFFSET0x04
+#define CP_FLASHPROG_FLVPPEN   (1 << 0)
+#define CP_FLASHPROG_FLWREN(1 << 1)
+#define CP_FLASHPROG_FLASHSIZE (1 << 2)
+#define CP_FLASHPROG_EXTRABANK (1 << 3)
+#define CP_INTREG_OFFSET   0x08
+#define CP_DECODE_OFFSET   0x0C
+
+#define CP_IDFIELD (CP_BASE + CP_ID_OFFSET)
+#define CP_FLASHPROG (CP_BASE + CP_FLASHPROG_OFFSET)
+#define CP_INTREG (CP_BASE + CP_INTREG_OFFSET)
+#define CP_DECODE (CP_BASE + CP_DECODE_OFFSET)
+
+#endif
-- 
1.7.6.4

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


[U-Boot] [PATCH 0/2] integrator: flash support

2011-10-05 Thread Linus Walleij
The U-Boot seems to always have been started from RAM on
the Integrator, probably using the boot monitor.

When executing U-Boot directly from flash, some things are
not properly set up, so we need to add these to U-Boot.

This builds on top of the earlier submitted Integrator
patches.

Linus Walleij (2):
  integrator: add system controller header
  integrator: enable Vpp and disable flash protection

 board/armltd/integrator/integrator-sc.h |   91 +++
 board/armltd/integrator/integrator.c|   20 +++
 2 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 board/armltd/integrator/integrator-sc.h

-- 
1.7.6.4

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


[U-Boot] [PATCH 1/7] arch/arm/lib/board.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
board.c:445:8: warning: variable 'bd' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Albert ARIBAUD 
---
 arch/arm/lib/board.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 705d4d2..b266f78 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -442,14 +442,12 @@ static char *failed = "*** failed ***\n";
 void board_init_r(gd_t *id, ulong dest_addr)
 {
char *s;
-   bd_t *bd;
ulong malloc_start;
 #if !defined(CONFIG_SYS_NO_FLASH)
ulong flash_size;
 #endif
 
gd = id;
-   bd = gd->bd;
 
gd->flags |= GD_FLG_RELOC;  /* tell others: relocation done */
 
-- 
1.7.6.2

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


[U-Boot] [PATCH 3/7] fs/jffs2/jffs2_1pass.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
jffs2_1pass.c: In function 'jffs2_1pass_read_inode':
jffs2_1pass.c:699:7: warning: variable 'ret' set but not used 
[-Wunused-but-set-variable]
jffs2_1pass.c: In function 'jffs2_1pass_build_lists':
jffs2_1pass.c:1578:14: warning: variable 'empty_start' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 fs/jffs2/jffs2_1pass.c |   14 --
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
index 5ddc2b9..a0b02e4 100644
--- a/fs/jffs2/jffs2_1pass.c
+++ b/fs/jffs2/jffs2_1pass.c
@@ -696,7 +696,6 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char 
*dest)
u32 latestVersion = 0;
uchar *lDest;
uchar *src;
-   long ret;
int i;
u32 counter = 0;
 #ifdef CONFIG_SYS_JFFS2_SORT_FRAGMENTS
@@ -768,28 +767,25 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, 
char *dest)
 #endif
switch (jNode->compr) {
case JFFS2_COMPR_NONE:
-   ret = (unsigned long) ldr_memcpy(lDest, 
src, jNode->dsize);
+   ldr_memcpy(lDest, src, jNode->dsize);
break;
case JFFS2_COMPR_ZERO:
-   ret = 0;
for (i = 0; i < jNode->dsize; i++)
*(lDest++) = 0;
break;
case JFFS2_COMPR_RTIME:
-   ret = 0;
rtime_decompress(src, lDest, 
jNode->csize, jNode->dsize);
break;
case JFFS2_COMPR_DYNRUBIN:
/* this is slow but it works */
-   ret = 0;
dynrubin_decompress(src, lDest, 
jNode->csize, jNode->dsize);
break;
case JFFS2_COMPR_ZLIB:
-   ret = zlib_decompress(src, lDest, 
jNode->csize, jNode->dsize);
+   zlib_decompress(src, lDest, 
jNode->csize, jNode->dsize);
break;
 #if defined(CONFIG_JFFS2_LZO)
case JFFS2_COMPR_LZO:
-   ret = lzo_decompress(src, lDest, 
jNode->csize, jNode->dsize);
+   lzo_decompress(src, lDest, 
jNode->csize, jNode->dsize);
break;
 #endif
default:
@@ -803,7 +799,6 @@ jffs2_1pass_read_inode(struct b_lists *pL, u32 inode, char 
*dest)
 
 #if 0
putLabeledWord("read_inode: totalSize = ", totalSize);
-   putLabeledWord("read_inode: compr ret = ", ret);
 #endif
}
counter++;
@@ -1575,9 +1570,8 @@ jffs2_1pass_build_lists(struct part_info * part)
 
if (*(uint32_t *)(&buf[ofs-buf_ofs]) == 0x) {
uint32_t inbuf_ofs;
-   uint32_t empty_start, scan_end;
+   uint32_t scan_end;
 
-   empty_start = ofs;
ofs += 4;
scan_end = min_t(uint32_t, EMPTY_SCAN_SIZE(
part->sector_size)/8,
-- 
1.7.6.2

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


[U-Boot] [PATCH 6/7] drivers/usb/host/ohci-hcd.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
ohci-hcd.c: In function 'dl_transfer_length':
ohci-hcd.c:968:8: warning: variable 'tdINFO' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Remy Bohmer 
---
 drivers/usb/host/ohci-hcd.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index bc8bb20..c20d706 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -965,10 +965,9 @@ static void td_submit_job(struct usb_device *dev, unsigned 
long pipe,
 
 static void dl_transfer_length(td_t *td)
 {
-   __u32 tdINFO, tdBE, tdCBP;
+   __u32 tdBE, tdCBP;
urb_priv_t *lurb_priv = td->ed->purb;
 
-   tdINFO = m32_swap(td->hwINFO);
tdBE   = m32_swap(td->hwBE);
tdCBP  = m32_swap(td->hwCBP);
 
-- 
1.7.6.2

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


[U-Boot] [PATCH 2/7] CFI: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used 
[-Wunused-but-set-variable]
cfi_mtd.c: In function 'cfi_mtd_init':
cfi_mtd.c:226:19: warning: variable 'mtd_list' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Stefan Roese 
---
 common/cmd_mtdparts.c |9 +++--
 drivers/mtd/cfi_mtd.c |4 
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/common/cmd_mtdparts.c b/common/cmd_mtdparts.c
index 5481c88..2c2e4e0 100644
--- a/common/cmd_mtdparts.c
+++ b/common/cmd_mtdparts.c
@@ -838,7 +838,10 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
struct mtdids *id;
const char *mtd_id;
unsigned int mtd_id_len;
-   const char *p, *pend;
+   const char *p;
+#ifdef DEBUG
+   const char *pend;
+#endif
LIST_HEAD(tmp_list);
struct list_head *entry, *n;
u16 num_parts;
@@ -868,10 +871,12 @@ static int device_parse(const char *const mtd_dev, const 
char **ret, struct mtd_
return 1;
}
 
+#ifdef DEBUG
+   pend = strchr(p, ';');
+#endif
debug("dev type = %d (%s), dev num = %d, mtd-id = %s\n",
id->type, MTD_DEV_TYPE(id->type),
id->num, id->mtd_id);
-   pend = strchr(p, ';');
debug("parsing partitions %.*s\n", (pend ? pend - p : strlen(p)), p);
 
 
diff --git a/drivers/mtd/cfi_mtd.c b/drivers/mtd/cfi_mtd.c
index cbcc165..7796c4c 100644
--- a/drivers/mtd/cfi_mtd.c
+++ b/drivers/mtd/cfi_mtd.c
@@ -223,7 +223,9 @@ int cfi_mtd_init(void)
flash_info_t *fi;
int error, i;
int devices_found = 0;
+#ifdef CONFIG_MTD_CONCAT
struct mtd_info *mtd_list[CONFIG_SYS_MAX_FLASH_BANKS];
+#endif
 
for (i = 0; i < CONFIG_SYS_MAX_FLASH_BANKS; i++) {
fi = &flash_info[i];
@@ -253,7 +255,9 @@ int cfi_mtd_init(void)
if (add_mtd_device(mtd))
return -ENOMEM;
 
+#ifdef CONFIG_MTD_CONCAT
mtd_list[devices_found++] = mtd;
+#endif
}
 
 #ifdef CONFIG_MTD_CONCAT
-- 
1.7.6.2

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


[U-Boot] [PATCH 4/7] drivers/net/smc91111.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
smc9.c: In function 'smc_phy_configure':
smc9.c:1194:6: warning: variable 'failed' set but not used 
[-Wunused-but-set-variable]
smc9.c:1190:7: warning: variable 'phyaddr' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
---
 drivers/net/smc9.c |8 
 1 files changed, 0 insertions(+), 8 deletions(-)

diff --git a/drivers/net/smc9.c b/drivers/net/smc9.c
index ba9c67e..9b8236d 100644
--- a/drivers/net/smc9.c
+++ b/drivers/net/smc9.c
@@ -1187,18 +1187,12 @@ static void smc_wait_ms(unsigned int ms)
 static void smc_phy_configure (struct eth_device *dev)
 {
int timeout;
-   byte phyaddr;
word my_phy_caps;   /* My PHY capabilities */
word my_ad_caps;/* My Advertised capabilities */
word status = 0;/*;my status = 0 */
-   int failed = 0;
 
PRINTK3 ("%s: smc_program_phy()\n", SMC_DEV_NAME);
 
-
-   /* Get the detected phy address */
-   phyaddr = SMC_PHY_ADDR;
-
/* Reset the PHY, setting all other bits to zero */
smc_write_phy_register (dev, PHY_CNTL_REG, PHY_CNTL_RST);
 
@@ -1296,13 +1290,11 @@ static void smc_phy_configure (struct eth_device *dev)
 
if (timeout < 1) {
printf ("%s: PHY auto-negotiate timed out\n", SMC_DEV_NAME);
-   failed = 1;
}
 
/* Fail if we detected an auto-negotiate remote fault */
if (status & PHY_STAT_REM_FLT) {
printf ("%s: PHY remote fault detected\n", SMC_DEV_NAME);
-   failed = 1;
}
 
/* Re-Configure the Receive/Phy Control register */
-- 
1.7.6.2

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


[U-Boot] [PATCH 7/7] common/usb.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
usb.c: In function 'usb_parse_config':
usb.c:331:17: warning: variable 'ch' set but not used 
[-Wunused-but-set-variable]
usb.c: In function 'usb_hub_port_connect_change':
usb.c:1123:29: warning: variable 'portchange' set but not used 
[-Wunused-but-set-variable]
usb.c: In function 'usb_hub_configure':
usb.c:1183:25: warning: variable 'hubsts' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Remy Bohmer 
---
 common/usb.c |   20 +---
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index a401c09..2cd50db 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -328,7 +328,6 @@ int usb_parse_config(struct usb_device *dev, unsigned char 
*buffer, int cfgno)
struct usb_descriptor_header *head;
int index, ifno, epno, curr_if_num;
int i;
-   unsigned char *ch;
 
ifno = -1;
epno = -1;
@@ -386,7 +385,9 @@ int usb_parse_config(struct usb_device *dev, unsigned char 
*buffer, int cfgno)
   head->bDescriptorType);
 
{
-   ch = (unsigned char *)head;
+#ifdef USB_DEBUG
+   unsigned char *ch = (unsigned char *)head;
+#endif
for (i = 0; i < head->bLength; i++)
USB_PRINTF("%02X ", *ch++);
USB_PRINTF("\n\n\n");
@@ -1120,7 +1121,7 @@ void usb_hub_port_connect_change(struct usb_device *dev, 
int port)
 {
struct usb_device *usb;
struct usb_port_status portsts;
-   unsigned short portstatus, portchange;
+   unsigned short portstatus;
 
/* Check status */
if (usb_get_port_status(dev, port + 1, &portsts) < 0) {
@@ -1129,9 +1130,10 @@ void usb_hub_port_connect_change(struct usb_device *dev, 
int port)
}
 
portstatus = le16_to_cpu(portsts.wPortStatus);
-   portchange = le16_to_cpu(portsts.wPortChange);
USB_HUB_PRINTF("portstatus %x, change %x, %s\n",
-   portstatus, portchange, portspeed(portstatus));
+   portstatus,
+   le16_to_cpu(portsts.wPortChange),
+   portspeed(portstatus));
 
/* Clear the connection change status */
usb_clear_port_feature(dev, port + 1, USB_PORT_FEAT_C_CONNECTION);
@@ -1178,11 +1180,13 @@ void usb_hub_port_connect_change(struct usb_device 
*dev, int port)
 
 int usb_hub_configure(struct usb_device *dev)
 {
+   int i;
unsigned char buffer[USB_BUFSIZ], *bitmap;
struct usb_hub_descriptor *descriptor;
-   struct usb_hub_status *hubsts;
-   int i;
struct usb_hub_device *hub;
+#ifdef USB_HUB_DEBUG
+   struct usb_hub_status *hubsts;
+#endif
 
/* "allocate" Hub device */
hub = usb_hub_allocate();
@@ -1284,7 +1288,9 @@ int usb_hub_configure(struct usb_device *dev)
return -1;
}
 
+#ifdef USB_HUB_DEBUG
hubsts = (struct usb_hub_status *)buffer;
+#endif
USB_HUB_PRINTF("get_hub_status returned status %X, change %X\n",
le16_to_cpu(hubsts->wHubStatus),
le16_to_cpu(hubsts->wHubChange));
-- 
1.7.6.2

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


[U-Boot] [PATCH 5/7] common/cmd_usb.c: fix warning: variable ... set but not used

2011-10-05 Thread Wolfgang Denk
Fix:
cmd_usb.c: In function 'usb_show_tree_graph':
cmd_usb.c:284:29: warning: variable 'port' set but not used 
[-Wunused-but-set-variable]

Signed-off-by: Wolfgang Denk 
Cc: Remy Bohmer 
---
 common/cmd_usb.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/common/cmd_usb.c b/common/cmd_usb.c
index cd4d417..8c87265 100644
--- a/common/cmd_usb.c
+++ b/common/cmd_usb.c
@@ -281,7 +281,7 @@ static inline char *portspeed(int speed)
 void usb_show_tree_graph(struct usb_device *dev, char *pre)
 {
int i, index;
-   int has_child, last_child, port;
+   int has_child, last_child;
 
index = strlen(pre);
printf(" %s", pre);
@@ -300,7 +300,6 @@ void usb_show_tree_graph(struct usb_device *dev, char *pre)
/* found our pointer, see if we have a
 * little sister
 */
-   port = i;
while (i++ < dev->parent->maxchild) {
if (dev->parent->children[i] != NULL) {
/* found a sister */
-- 
1.7.6.2

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


[U-Boot] (no subject)

2011-10-05 Thread Mr.Wen Lee



Requesting for your partnership in re-profilling funds. but in sumaring
the funds are coming Via Bank Of Tiapei Tiawan.

Contact me for more details (wen-l...@shqiptar.eu)

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


Re: [U-Boot] [PATCH 3/3] mkimage: adding support for Davinci AIS image

2011-10-05 Thread Wolfgang Denk
Dear Stefano,

In message <20111005185612.c7a1218e5...@gemini.denx.de> I wrote:
> 
> In message <1316166617-11711-3-git-send-email-sba...@denx.de> you wrote:
> > Some Davinci processors supports the Application
> > Image Script (AIS) boot process. The patch adds the generation
> > of the AIS image inside the mkimage tool to make possible
> > to generate a bootable U-boot without external tools
> > (TI Davinci AIS Generator).
> > 
> > Signed-off-by: Stefano Babic 
> > ---
> >  common/image.c   |1 +
> >  include/image.h  |1 +
> >  tools/Makefile   |4 +-
> >  tools/aisimage.c |  453 
> > ++
> >  tools/aisimage.h |   97 
> >  tools/mkimage.c  |2 +
> >  tools/mkimage.h  |1 +
> >  7 files changed, 558 insertions(+), 1 deletions(-)
> >  create mode 100644 tools/aisimage.c
> >  create mode 100644 tools/aisimage.h

This commit causes compile warnings, for example:

-> MAKEALL TQM860L
Configuring for TQM860L board...
aisimage.c: In function 'ais_insert_cmd_header':
aisimage.c:183:11: warning: variable 'len_cmd' set but not used 
[-Wunused-but-set-variable]

1929755f08be8d9779846a69fe2a9daf9eebb5db is the first bad commit
commit 1929755f08be8d9779846a69fe2a9daf9eebb5db
Author: Stefano Babic 
Date:   Thu Sep 15 23:50:17 2011 +

mkimage: adding support for Davinci AIS image

I'm dropping this commit for now.  Please fix and resubmit.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
I think animal testing is a terrible idea; they get all  nervous  and
give the wrong answers.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 RESEND] SPL: Make path to start.S configurable

2011-10-05 Thread Wolfgang Denk
Dear Marek,

In message <20111005200736.8fce418e5...@gemini.denx.de> you wrote:
> 
> No sorry, I backjed out this commit again.  It causes compile
> warnings, for example:
> 
> running MAKEALL TQM860L
> Configuring for TQM860L board...
> aisimage.c: In function 'ais_insert_cmd_header':
> aisimage.c:183:11: warning: variable 'len_cmd' set but not used 
> [-Wunused-but-set-variable]

oops. Sorry, false alarm.  We cannot use "git bisect run MAKEALL" when
only wanrings are issued :-(

Looking manually for the real culprit.

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
Make it right before you make it faster.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 RESEND] SPL: Make path to start.S configurable

2011-10-05 Thread Wolfgang Denk
Dear Wolfgang Denk,

In message <20111005190852.9ad2b18e5...@gemini.denx.de> you wrote:
> Dear Marek Vasut,
> 
> In message <1315800204-19705-2-git-send-email-marek.va...@gmail.com> you 
> wrote:
> > Introduce CONFIG_SPL_START_S_PATH to configure path to start.S file. It's 
> > not
> > always fitting to use CPU's start.S .
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Stefano Babic 
> > Cc: Wolfgang Denk 
> > Cc: Detlev Zundel 
> > Cc: Chander Kashyap 
> > ---
> >  spl/Makefile |   10 --
> >  1 files changed, 8 insertions(+), 2 deletions(-)
> 
> Applied, thanks.

No sorry, I backjed out this commit again.  It causes compile
warnings, for example:

running MAKEALL TQM860L
Configuring for TQM860L board...
aisimage.c: In function 'ais_insert_cmd_header':
aisimage.c:183:11: warning: variable 'len_cmd' set but not used 
[-Wunused-but-set-variable]

5bf222bcf7889c73771b291dbfda6be2567a915d is the first bad commit
commit 5bf222bcf7889c73771b291dbfda6be2567a915d
Author: Marek Vasut 
Date:   Sun Sep 11 17:56:19 2011 +

SPL: Make path to start.S configurable


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
"If God had wanted us to use the metric system, Jesus would have  had
10 apostles."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] TQM8xx: make room for growing code size due to I/O accessor cleanup

2011-10-05 Thread Wolfgang Denk
Dear Wolfgang Denk,

In message <1317844501-9494-1-git-send-email...@denx.de> you wrote:
> Commit "PPC: Cleanup tqm8xx_pcmcia.c" will clean up the PCMCIA code
> to use I/O accessors instead of plain volatile pointer accesses.
> This will result in about 300 byte bigger code.  Fix custom linker
> script to make room for this.
> 
> While we are at it, drop unmaintained u-boot.lds.debug linker script.
> 
> Signed-off-by: Wolfgang Denk 
> Cc: Marek Vasut 
> ---
>  board/tqc/tqm8xx/u-boot.lds   |3 +-
>  board/tqc/tqm8xx/u-boot.lds.debug |  135 
> -
>  2 files changed, 2 insertions(+), 136 deletions(-)
>  delete mode 100644 board/tqc/tqm8xx/u-boot.lds.debug

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"You're just jealous." "What, of an overgrown puppy  with  a  single-
figure IQ?"  - Terry Pratchett, _Moving Pictures_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] TQM8xx: make room for growing code size due to I/O accessor cleanup

2011-10-05 Thread Wolfgang Denk
In message <1317844501-9494-1-git-send-email...@denx.de> I wrote:
> Commit "PPC: Cleanup tqm8xx_pcmcia.c" will clean up the PCMCIA code
> to use I/O accessors instead of plain volatile pointer accesses.
> This will result in about 300 byte bigger code.  Fix custom linker
> script to make room for this.
> 
> While we are at it, drop unmaintained u-boot.lds.debug linker script.
> 
> Signed-off-by: Wolfgang Denk 
> Cc: Marek Vasut 
> ---
>  board/tqc/tqm8xx/u-boot.lds   |3 +-
>  board/tqc/tqm8xx/u-boot.lds.debug |  135 
> -
>  2 files changed, 2 insertions(+), 136 deletions(-)
>  delete mode 100644 board/tqc/tqm8xx/u-boot.lds.debug

Compile tested on FPS850L, FPS860L, TQM823L, TQM823L_LCD, TQM823M,
TQM850L, TQM850M, TQM855L, TQM855M, TQM860L, TQM860M, TQM862L,
TQM862M, TQM866M, TQM885D, TTTech, and wtk.

Tested-by: Wolfgang Denk 

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
Machines take me by surprise with great frequency.  - Alan Turing
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] TQM8xx: make room for growing code size due to I/O accessor cleanup

2011-10-05 Thread Wolfgang Denk
Commit "PPC: Cleanup tqm8xx_pcmcia.c" will clean up the PCMCIA code
to use I/O accessors instead of plain volatile pointer accesses.
This will result in about 300 byte bigger code.  Fix custom linker
script to make room for this.

While we are at it, drop unmaintained u-boot.lds.debug linker script.

Signed-off-by: Wolfgang Denk 
Cc: Marek Vasut 
---
 board/tqc/tqm8xx/u-boot.lds   |3 +-
 board/tqc/tqm8xx/u-boot.lds.debug |  135 -
 2 files changed, 2 insertions(+), 136 deletions(-)
 delete mode 100644 board/tqc/tqm8xx/u-boot.lds.debug

diff --git a/board/tqc/tqm8xx/u-boot.lds b/board/tqc/tqm8xx/u-boot.lds
index f625c3d..4f08be6 100644
--- a/board/tqc/tqm8xx/u-boot.lds
+++ b/board/tqc/tqm8xx/u-boot.lds
@@ -39,7 +39,8 @@ SECTIONS
 board/tqc/tqm8xx/libtqm8xx.o   (.text*)
 disk/libdisk.o (.text*)
 drivers/net/libnet.o   (.text*)
-drivers/pcmcia/libpcmcia.o (.text*)
+drivers/pcmcia/libpcmcia.o (.text.pcmcia_on)
+drivers/pcmcia/libpcmcia.o (.text.pcmcia_hardware_enable)
 drivers/rtc/librtc.o   (.text*)
 drivers/misc/libmisc.o (.text*)
 *(.text.print_buffer)
diff --git a/board/tqc/tqm8xx/u-boot.lds.debug 
b/board/tqc/tqm8xx/u-boot.lds.debug
deleted file mode 100644
index 99c48f2..000
--- a/board/tqc/tqm8xx/u-boot.lds.debug
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * (C) Copyright 2000
- * 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
- */
-
-OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;*/
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash  : { *(.hash)  }
-  .dynsym: { *(.dynsym)}
-  .dynstr: { *(.dynstr)}
-  .rel.text  : { *(.rel.text)  }
-  .rela.text : { *(.rela.text) }
-  .rel.data  : { *(.rel.data)  }
-  .rela.data : { *(.rela.data) }
-  .rel.rodata: { *(.rel.rodata)}
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got   : { *(.rel.got)   }
-  .rela.got  : { *(.rela.got)  }
-  .rel.ctors : { *(.rel.ctors) }
-  .rela.ctors: { *(.rela.ctors)}
-  .rel.dtors : { *(.rel.dtors) }
-  .rela.dtors: { *(.rela.dtors)}
-  .rel.bss   : { *(.rel.bss)   }
-  .rela.bss  : { *(.rela.bss)  }
-  .rel.plt   : { *(.rel.plt)   }
-  .rela.plt  : { *(.rela.plt)  }
-  .init  : { *(.init)  }
-  .plt : { *(.plt) }
-  .text  :
-  {
-/* WARNING - the following is hand-optimized to fit within */
-/* the sector layout of our flash chips!   XXX FIXME XXX   */
-
-arch/powerpc/cpu/mpc8xx/start.o(.text)
-common/dlmalloc.o  (.text)
-lib/vsprintf.o (.text)
-lib/crc32.o(.text)
-
-. = env_offset;
-common/env_embedded.o(.text)
-
-*(.text)
-*(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata:
-  {
-*(.rodata)
-*(.rodata1)
-*(.rodata.str1.4)
-*(.eh_frame)
-  }
-  .fini  : { *(.fini)} =0
-  .ctors : { *(.ctors)   }
-  .dtors : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-*(.got)
-_GOT2_TABLE_ = .;
-*(.got2)
-_FIXUP_TABLE_ = .;
-*(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data:
-  {
-*(.data)
-*(.data1)
-*(.sdata)
-*(.sdata2)
-*(.dynamic)
-CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss   :

Re: [U-Boot] [PATCH] PPC: Cleanup tqm8xx_pcmcia.c

2011-10-05 Thread Wolfgang Denk
In message <20111005184025.2c55118e5...@gemini.denx.de> I wrote:
> Dear Marek Vasut,
> 
> In message <1317819115-9089-1-git-send-email-marek.va...@gmail.com> you wrote:
> > Signed-off-by: Marek Vasut 
> > ---
> >  drivers/pcmcia/tqm8xx_pcmcia.c |  154 
> > +---
> >  1 files changed, 81 insertions(+), 73 deletions(-)
> 
> Tested on TQM823L_LCD and TQM855M (with ARGOSY PnPIDE D5 PCMCIA
> adapter and IBM-DCXA-21 HDD).

Funny enough, the build will break for other boards (like TQM860L) due
to the increased code size.  Will submit a patch and push it before
this one.

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
What about WRITING it first and rationalizing it afterwords?  :-)
   - Larry Wall in <8...@jpl-devvax.jpl.nasa.gov>
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 0/2] SPL improvements

2011-10-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <201110051304.16386.marek.va...@gmail.com> you wrote:
> On Monday, September 12, 2011 06:03:22 AM Marek Vasut wrote:
> > This series introduces a few modifications to the new SPL framework to make
> > it a bit more flexible.
> > 
> > RESEND: Missing Cc-ed people in the patches.
> > 
> > Marek Vasut (2):
> >   SPL: Make path to start.S configurable
> >   SPL: Allow user to disable CPU support library
> > 
> >  spl/Makefile |   17 ++---
> >  1 files changed, 14 insertions(+), 3 deletions(-)
> 
> 
> Wolfgang, can you please apply the series?

I hesitate to apply

[PATCH 2/2 RESEND] SPL: Allow user to disable CPU support library
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/108058

I think no agreement has been reached between you and Scott?

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
And now remains  That we find out the cause of this effect, Or rather
say, the cause of this defect...   -- Hamlet, Act II, Scene 2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2 RESEND] SPL: Make path to start.S configurable

2011-10-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <1315800204-19705-2-git-send-email-marek.va...@gmail.com> you wrote:
> Introduce CONFIG_SPL_START_S_PATH to configure path to start.S file. It's not
> always fitting to use CPU's start.S .
> 
> Signed-off-by: Marek Vasut 
> Cc: Stefano Babic 
> Cc: Wolfgang Denk 
> Cc: Detlev Zundel 
> Cc: Chander Kashyap 
> ---
>  spl/Makefile |   10 --
>  1 files changed, 8 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
C++ is the best example of second-system effect since OS/360.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] MAKEALL: rename coldfire list to m68k to match arch

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317016410-608-2-git-send-email-vap...@gentoo.org> you wrote:
> The m68k tree is the only one where `./MAKEALL ` does not work.
> So rename the existing coldfire list in the MAKEALL script to m68k, and
> add an alias from coldfire to m68k.  This makes scripting around MAKEALL
> easier.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  MAKEALL |3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
We are all agreed that your  theory  is  crazy.  The  question  which
divides  us  is  whether it is crazy enough to have a chance of being
correct. My own feeling is that it is not crazy enough.  - Niels Bohr
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] cmd_sf: Fix compiler warning

2011-10-05 Thread Wolfgang Denk
Dear Kumar Gala,

In message <1317652547-31435-1-git-send-email-ga...@kernel.crashing.org> you 
wrote:
> cmd_sf.c: In function 'do_spi_flash':
> cmd_sf.c:164:9: warning: 'skipped' may be used uninitialized in this function
> 
> Signed-off-by: Kumar Gala 
> ---
>  common/cmd_sf.c |6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Intel's new motto: United we stand. Divided we fall!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/4] board configs: drop NET_MULTI references

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317585688-3396-5-git-send-email-vap...@gentoo.org> you wrote:
> Now that none of the core checks CONFIG_NET_MULTI, there's not much point
> in boards defining it.  So scrub all references to it.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  arch/arm/include/asm/arch-kirkwood/config.h |1 -
>  include/configs/A3000.h |1 -
>  include/configs/ADCIOP.h|1 -
>  include/configs/AP1000.h|1 -
>  include/configs/APC405.h|1 -
>  include/configs/AR405.h |1 -
>  include/configs/ASH405.h|1 -
>  include/configs/Alaska8220.h|1 -
>  include/configs/BAB7xx.h|1 -
>  include/configs/BC3450.h|1 -
>  include/configs/CATcenter.h |1 -
>  include/configs/CMS700.h|1 -
>  include/configs/CPC45.h |1 -
>  include/configs/CPCI405.h   |1 -
>  include/configs/CPCI4052.h  |1 -
>  include/configs/CPCI405AB.h |1 -
>  include/configs/CPCI405DT.h |1 -
>  include/configs/CPCI750.h   |1 -
>  include/configs/CPCIISER4.h |1 -
>  include/configs/CRAYL1.h|1 -
>  include/configs/CU824.h |1 -
>  include/configs/DASA_SIM.h  |1 -
>  include/configs/DB64360.h   |1 -
>  include/configs/DB64460.h   |1 -
>  include/configs/DU405.h |1 -
>  include/configs/DU440.h |1 -
>  include/configs/EB+MCF-EV123.h  |1 -
>  include/configs/ELPPC.h |1 -
>  include/configs/EVB64260.h  |1 -
>  include/configs/EXBITGEN.h  |1 -
>  include/configs/G2000.h |1 -
>  include/configs/HH405.h |1 -
>  include/configs/HIDDEN_DRAGON.h |1 -
>  include/configs/HUB405.h|1 -
>  include/configs/IceCube.h   |1 -
>  include/configs/JSE.h   |1 -
>  include/configs/KAREF.h |1 -
>  include/configs/M5208EVBE.h |1 -
>  include/configs/M5235EVB.h  |1 -
>  include/configs/M5253DEMO.h |1 -
>  include/configs/M5271EVB.h  |1 -
>  include/configs/M5272C3.h   |1 -
>  include/configs/M5275EVB.h  |1 -
>  include/configs/M5282EVB.h  |1 -
>  include/configs/M53017EVB.h |1 -
>  include/configs/M5329EVB.h  |1 -
>  include/configs/M5373EVB.h  |1 -
>  include/configs/M54451EVB.h |1 -
>  include/configs/M54455EVB.h |1 -
>  include/configs/M5475EVB.h  |1 -
>  include/configs/M5485EVB.h  |1 -
>  include/configs/MERGERBOX.h |1 -
>  include/configs/METROBOX.h  |1 -
>  include/configs/MIP405.h|1 -
>  include/configs/MOUSSE.h|1 -
>  include/configs/MPC8308RDB.h|1 -
>  include/configs/MPC8313ERDB.h   |1 -
>  include/configs/MPC8315ERDB.h   |5 -
>  include/configs/MPC8323ERDB.h   |6 --
>  include/configs/MPC832XEMDS.h   |6 --
>  include/configs/MPC8349EMDS.h   |4 
>  include/configs/MPC8349ITX.h|2 --
>  include/configs/MPC8360EMDS.h   |5 -
>  include/configs/MPC8360ERDK.h   |6 --
>  include/configs/MPC837XEMDS.h   |5 -
>  include/configs/MPC837XERDB.h   |2 --
>  include/configs/MPC8536DS.h |5 -
>  include/configs/MPC8540ADS.h|5 -
>  include/configs/MPC8541CDS.h|5 -
>  include/configs/MPC8544DS.h |5 -
>  include/configs/MPC8548CDS.h|5 -
>  include/configs/MPC8555CDS.h|5 -
>  include/configs/MPC8560ADS.h|5 -
>  include/configs/MPC8568MDS.h|5 -
>  include/configs/MPC8569MDS.h|5 -
>  include/configs/MPC8572DS.h |5 -
>  include/configs/MPC8610HPCD.h   |1 -
>  include/configs/MPC8641HPCN.h   |5 -
>  include/configs/MUSENKI.h   |1 -
>  include/configs/MVBC_P.h|1 -
>  include/configs/MVBLM7.h|1 -
>  include/configs/MVBLUE.h|1 -
>  include/configs/MigoR.h |1 -
>  

[U-Boot] [PATCH 2/3] phylib: wait for TN2020 to achieve SERDES lane alignment at startup

2011-10-05 Thread Timur Tabi
Before the Teranetics TN2020 PHY can be used, the SERDES lanes need to be
aligned, so wait for lane alignment before completing the startup sequence.

Note that this process can take up to three seconds.

Signed-off-by: Timur Tabi 
---
 drivers/net/phy/teranetics.c |   32 
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index 5932bf0..97fe5f4 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -43,6 +43,38 @@ int tn2020_config(struct phy_device *phydev)
 
 int tn2020_startup(struct phy_device *phydev)
 {
+   unsigned int timeout = 5 * 1000; /* 5 second timeout */
+
+#define MDIO_PHYXS_LANE_READY (MDIO_PHYXS_LNSTAT_SYNC0 | \
+  MDIO_PHYXS_LNSTAT_SYNC1 | \
+  MDIO_PHYXS_LNSTAT_SYNC2 | \
+  MDIO_PHYXS_LNSTAT_SYNC3 | \
+  MDIO_PHYXS_LNSTAT_ALIGN)
+
+   /*
+* Wait for the XAUI-SERDES lanes to align first.  Under normal
+* circumstances, this can take up to three seconds.
+*/
+   while (--timeout) {
+   int reg = phy_read(phydev, MDIO_MMD_PHYXS, MDIO_PHYXS_LNSTAT);
+   if (reg < 0) {
+   printf("TN2020: Error reading from PHY at "
+  "address %u\n", phydev->addr);
+   break;
+   }
+   if ((reg & MDIO_PHYXS_LANE_READY) == MDIO_PHYXS_LANE_READY)
+   break;
+   udelay(1000);
+   }
+   if (!timeout) {
+   /*
+* A timeout is bad, but it may not be fatal, so don't
+* return an error.  Display a warning instead.
+*/
+   printf("TN2020: Timeout waiting for PHY at address %u to "
+  "align.\n", phydev->addr);
+   }
+
if (phydev->port != PORT_FIBRE)
return gen10g_startup(phydev);
 
-- 
1.7.3.4


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


[U-Boot] [PATCH 3/3] powerpc/85xx: wait for alignment before resetting SERDES RX lanes (SERDES9)

2011-10-05 Thread Timur Tabi
The work-around for P4080 erratum SERDES9 says that the SERDES receiver lanes
should be reset after the XAUI starts tranmitting alignment signals.

Signed-off-by: Timur Tabi 
---
 arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c |   10 --
 board/freescale/corenet_ds/eth_p4080.c|   40 
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c 
b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
index 07e58ed..89ed5b4 100644
--- a/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
+++ b/arch/powerpc/cpu/mpc85xx/fsl_corenet_serdes.c
@@ -504,9 +504,6 @@ void fsl_serdes_init(void)
const char *srds_lpd_arg;
size_t arglen;
 #endif
-#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
-   enum srds_prtcl device;
-#endif
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES_A001
int need_serdes_a001;   /* TRUE == need work-around for SERDES A001 */
 #endif
@@ -787,11 +784,4 @@ void fsl_serdes_init(void)
 SRDS_RSTCTL_SDPD);
}
 #endif
-
-#ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
-   for (device = XAUI_FM1; device <= XAUI_FM2; device++) {
-   if (is_serdes_configured(device))
-   __serdes_reset_rx(srds_regs, cfg, device);
-   }
-#endif
 }
diff --git a/board/freescale/corenet_ds/eth_p4080.c 
b/board/freescale/corenet_ds/eth_p4080.c
index d4657f7..a724ffc 100644
--- a/board/freescale/corenet_ds/eth_p4080.c
+++ b/board/freescale/corenet_ds/eth_p4080.c
@@ -96,18 +96,43 @@ struct mii_dev *mii_dev_for_muxval(u32 muxval)
 #ifdef CONFIG_SYS_P4080_ERRATUM_SERDES9
 int board_phy_config(struct phy_device *phydev)
 {
-   /*
-* If this is the 10G PHY, and we switched it to fiber,
-* we need to reset the serdes link for SERDES9
-*/
-   if ((phydev->port == PORT_FIBRE) && (phydev->drv->uid == 0x00a19410)) {
+#ifdef CONFIG_PHY_TERANETICS
+   extern struct phy_driver tn2020_driver;
+
+   if (phydev->drv->uid == tn2020_driver.uid) {
+   unsigned long timeout = 1 * 1000; /* 1 seconds */
enum srds_prtcl device;
 
+   /*
+* Wait for the XAUI to come out of reset.  This is when it
+* starts transmitting alignment signals.
+*/
+   while (--timeout) {
+   int reg = phy_read(phydev, MDIO_MMD_PHYXS, MDIO_CTRL1);
+   if (reg < 0) {
+   printf("TN2020: Error reading from PHY at "
+  "address %u\n", phydev->addr);
+   break;
+   }
+   /*
+* Note that we've never actually seen
+* MDIO_CTRL1_RESET set to 1.
+*/
+   if ((reg & MDIO_CTRL1_RESET) == 0)
+   break;
+   udelay(1000);
+   }
+
+   if (!timeout) {
+   printf("TN2020: Timeout waiting for PHY at address %u "
+  " to reset.\n", phydev->addr);
+   }
+
switch (phydev->addr) {
-   case 4:
+   case CONFIG_SYS_FM1_10GEC1_PHY_ADDR:
device = XAUI_FM1;
break;
-   case 0:
+   case CONFIG_SYS_FM2_10GEC1_PHY_ADDR:
device = XAUI_FM2;
break;
default:
@@ -116,6 +141,7 @@ int board_phy_config(struct phy_device *phydev)
 
serdes_reset_rx(device);
}
+#endif
 
return 0;
 }
-- 
1.7.3.4


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


[U-Boot] [PATCH 1/3] phylib: Work around bug in Teranetics PHY

2011-10-05 Thread Timur Tabi
From: Andy Fleming 

The Teranetics PHY does not properly report the link state
for fiber connections. The new PHY code actually checked the link,
and so the FM driver would refuse to talk over a linkless PHY.

But the link may actually be up, so now we always report it as up
for fiber connections on the tn2020.

Signed-off-by: Andy Fleming 
---
 drivers/net/phy/teranetics.c |   23 +--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/teranetics.c b/drivers/net/phy/teranetics.c
index a771791..5932bf0 100644
--- a/drivers/net/phy/teranetics.c
+++ b/drivers/net/phy/teranetics.c
@@ -20,7 +20,7 @@
  * author Andy Fleming
  *
  */
-#include 
+#include 
 #include 
 
 #ifndef CONFIG_PHYLIB_10G
@@ -41,6 +41,25 @@ int tn2020_config(struct phy_device *phydev)
return 0;
 }
 
+int tn2020_startup(struct phy_device *phydev)
+{
+   if (phydev->port != PORT_FIBRE)
+   return gen10g_startup(phydev);
+
+   /*
+* The TN2020 only pretends to support fiber.
+* It works, but it doesn't look like it works,
+* so the link status reports no link.
+*/
+   phydev->link = 1;
+
+   /* For now just lie and say it's 10G all the time */
+   phydev->speed = SPEED_1;
+   phydev->duplex = DUPLEX_FULL;
+
+   return 0;
+}
+
 struct phy_driver tn2020_driver = {
.name = "Teranetics TN2020",
.uid = 0x00a19410,
@@ -50,7 +69,7 @@ struct phy_driver tn2020_driver = {
MDIO_DEVS_PHYXS | MDIO_DEVS_AN |
MDIO_DEVS_VEND1 | MDIO_DEVS_VEND2),
.config = &tn2020_config,
-   .startup = &gen10g_startup,
+   .startup = &tn2020_startup,
.shutdown = &gen10g_shutdown,
 };
 
-- 
1.7.3.4


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


Re: [U-Boot] [PATCH 3/4] net: drop !NET_MULTI code

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317585688-3396-4-git-send-email-vap...@gentoo.org> you wrote:
> This is long over due.  All but two net drivers have been converted, but
> those have now been dropped.
> 
> The only thing left to do is actually delete all references to NET_MULTI
> and code that is compiled when that is not defined.  So here we scrub the
> core code.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  README |8 ++---
>  api/api_net.c  |4 --
>  arch/arm/lib/board.c   |2 -
>  arch/avr32/lib/board.c |2 -
>  arch/m68k/lib/board.c  |2 -
>  arch/mips/lib/board.c  |2 -
>  arch/nios2/lib/board.c |2 -
>  arch/powerpc/cpu/mpc8220/fec.c |3 +-
>  arch/powerpc/cpu/mpc8260/ether_fcc.c   |3 +-
>  arch/powerpc/cpu/mpc8260/ether_scc.c   |4 --
>  arch/powerpc/cpu/mpc85xx/ether_fcc.c   |3 +-
>  arch/powerpc/cpu/ppc4xx/miiphy.c   |7 ++--
>  arch/powerpc/include/asm/ppc4xx-emac.h |1 -
>  arch/powerpc/lib/board.c   |2 -
>  arch/sparc/lib/board.c |2 -
>  arch/x86/lib/board.c   |2 -
>  board/BuS/eb_cpux9k2/cpux9k2.c |2 -
>  board/cm-bf537e/cm-bf537e.c|2 -
>  board/cm-bf537u/cm-bf537u.c|2 -
>  board/evb64260/eth.c   |2 +-
>  board/tcm-bf537/tcm-bf537.c|2 -
>  doc/README.m53017evb   |1 -
>  doc/README.m5373evb|1 -
>  doc/README.m54455evb   |1 -
>  doc/README.m5475evb|1 -
>  doc/README.usb |1 -
>  doc/feature-removal-schedule.txt   |   19 
>  drivers/net/4xx_enet.c |4 --
>  drivers/net/mcfmii.c   |4 +-
>  drivers/net/mpc512x_fec.c  |5 ---
>  include/net.h  |   40 --
>  net/eth.c  |   49 +++
>  net/net.c  |   30 ---
>  net/nfs.c  |2 -
>  net/tftp.c |4 --
>  35 files changed, 23 insertions(+), 198 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
FORTRAN? The syntactically incorrect statement "DO 10 I = 1.10"  will
parse  and  generate  code  creating  a  variable, DO10I, as follows:
"DO10I = 1.10" If that doesn't terrify you, it should.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/4] net: drop !NET_MULTI ns7520 driver

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317585688-3396-3-git-send-email-vap...@gentoo.org> you wrote:
> This driver was never converted to NET_MULTI, and no board uses it.
> So punt it and be done.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  drivers/net/Makefile |1 -
>  drivers/net/ns7520_eth.c |  850 
> --
>  include/ns7520_eth.h |  336 --
>  net/eth.c|4 -
>  4 files changed, 0 insertions(+), 1191 deletions(-)
>  delete mode 100644 drivers/net/ns7520_eth.c
>  delete mode 100644 include/ns7520_eth.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Once upon a time, "PC" meant "personal computer".  Now  it  seems  to
only  mean  "Prisoner  of Bill". Alas! All my PCs run Unix, and those
include Intel, Sparc, and other processors.
  -- Tom "Bring back the non-PC meaning of `PC'" Christiansen
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/4] net: drop !NET_MULTI bcm570x/tigon3 drivers

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317585688-3396-2-git-send-email-vap...@gentoo.org> you wrote:
> These drivers have never been converted to NET_MULTI, and they are only
> used by one board (BMW).  So drop the drivers until someone feels like
> rewriting them for NET_MULTI support.
> 
> Rather than punting the BMW board completely, just disable net support
> in its board config.  Seems to build fine without it.
> 
> Signed-off-by: Mike Frysinger 
> ---
>  drivers/net/5701rls.c |   46 -
>  drivers/net/5701rls.h |  198 --
>  drivers/net/Makefile  |6 -
>  drivers/net/bcm570x.c | 1598 
>  drivers/net/bcm570x_autoneg.c |  439 
>  drivers/net/bcm570x_autoneg.h |  408 ---
>  drivers/net/bcm570x_bits.h|   57 -
>  drivers/net/bcm570x_debug.h   |  109 -
>  drivers/net/bcm570x_lm.h  |  434 
>  drivers/net/bcm570x_mm.h  |  158 --
>  drivers/net/bcm570x_queue.h   |  387 ---
>  drivers/net/tigon3.c  | 5697 
> -
>  drivers/net/tigon3.h  | 3339 
>  include/configs/BMW.h |5 +-
>  14 files changed, 2 insertions(+), 12879 deletions(-)
>  delete mode 100644 drivers/net/5701rls.c
>  delete mode 100644 drivers/net/5701rls.h
>  delete mode 100644 drivers/net/bcm570x.c
>  delete mode 100644 drivers/net/bcm570x_autoneg.c
>  delete mode 100644 drivers/net/bcm570x_autoneg.h
>  delete mode 100644 drivers/net/bcm570x_bits.h
>  delete mode 100644 drivers/net/bcm570x_debug.h
>  delete mode 100644 drivers/net/bcm570x_lm.h
>  delete mode 100644 drivers/net/bcm570x_mm.h
>  delete mode 100644 drivers/net/bcm570x_queue.h
>  delete mode 100644 drivers/net/tigon3.c
>  delete mode 100644 drivers/net/tigon3.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
There's nothing  disgusting  about  it  [the  Companion].  It's  just
another life form, that's all. You get used to those things.
-- McCoy, "Metamorphosis", stardate 3219.8
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] mkconfig: start deprecating Makefile config targets

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317500104-1508-1-git-send-email-vap...@gentoo.org> you wrote:
> Now that we've got boards.cfg and most people have converted over,
> start warning people who have yet to so we can phase board configs
> completely out of the Makefile.
> 
> Signed-off-by: Mike Frysinger 
> ---
> v3
>   - add an actual target for board removal
> 
>  doc/feature-removal-schedule.txt |   16 
>  mkconfig |9 +
>  2 files changed, 25 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
But it's real. And if it's real it can be affected ... we may not  be
able  to break it, but, I'll bet you credits to Navy Beans we can put
a dent in it.
-- deSalle, "Catspaw", stardate 3018.2
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] image: push default arch values to arch headers

2011-10-05 Thread Wolfgang Denk
Dear Mike Frysinger,

In message <1317689433-7108-1-git-send-email-vap...@gentoo.org> you wrote:
> This pushes the ugly duplicated arch ifdef lists we maintain in various
> image related files out to the arch headers themselves.
> 
> Acked-by: Nobuhiro Iwamatsu 
> Tested-by: Thomas Chou 
> Signed-off-by: Mike Frysinger 
> ---
> v3
>   - fix typo in fdt-specific code path
> 
>  arch/arm/include/asm/u-boot.h|3 ++
>  arch/avr32/include/asm/u-boot.h  |3 ++
>  arch/blackfin/include/asm/u-boot.h   |3 ++
>  arch/m68k/include/asm/u-boot.h   |3 ++
>  arch/microblaze/include/asm/u-boot.h |2 +
>  arch/mips/include/asm/u-boot.h   |3 ++
>  arch/nios2/include/asm/u-boot.h  |2 +
>  arch/powerpc/include/asm/u-boot.h|4 ++
>  arch/sh/include/asm/u-boot.h |3 ++
>  arch/sparc/include/asm/u-boot.h  |4 ++
>  arch/x86/include/asm/u-boot.h|3 ++
>  common/cmd_bootm.c   |   26 +--
>  include/image.h  |   59 ++---
>  13 files changed, 38 insertions(+), 80 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

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


[U-Boot] Your New Friend Rama .

2011-10-05 Thread mis rama
Hello Dear,

How are you today, Hope all is well with you and your family? My name is Miss 
Rama Djirama. However it really pleases me to write you for a lovely and 
sincere friendship even if we haven't met or seen each other before. I will so 
much appreciate to see your reply soon so that we can share pictures and know 
more about ourselves.
I shall appreciate an urgent responce from you, because i have something to 
discuss with you.

With lots of love from your new friend,
Miss Rama Djirama.

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


Re: [U-Boot] [PATCH 3/3] mkimage: adding support for Davinci AIS image

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1316166617-11711-3-git-send-email-sba...@denx.de> you wrote:
> Some Davinci processors supports the Application
> Image Script (AIS) boot process. The patch adds the generation
> of the AIS image inside the mkimage tool to make possible
> to generate a bootable U-boot without external tools
> (TI Davinci AIS Generator).
> 
> Signed-off-by: Stefano Babic 
> ---
>  common/image.c   |1 +
>  include/image.h  |1 +
>  tools/Makefile   |4 +-
>  tools/aisimage.c |  453 
> ++
>  tools/aisimage.h |   97 
>  tools/mkimage.c  |2 +
>  tools/mkimage.h  |1 +
>  7 files changed, 558 insertions(+), 1 deletions(-)
>  create mode 100644 tools/aisimage.c
>  create mode 100644 tools/aisimage.h

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The Empire didn't encourage its subjects to go far away, in case they
saw things that might disturb them. For the same reason it had  built
a  wall  around  the  entire country, patrolled by the Heavenly Guard
whose main function was to tread heavily on the fingers of any  inha-
bitants who felt they might like to step outside for five minutes for
a breath of fresh air.  - Terry Pratchett, _Mort_
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 2/3] mkimage: Add variable lenght header support

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1316166617-11711-2-git-send-email-sba...@denx.de> you wrote:
> Some images have not a header of fix lenght. The patch will be
> used for the generation of AIS images, because this header has
> a variable lenght. The patch adds also the parameter "-s" (skip)
> to not copy automatically the passed image file.
> 
> Signed-off-by: Stefano Babic 
> ---
>  tools/mkimage.c |   19 ++-
>  tools/mkimage.h |8 
>  2 files changed, 22 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It's not an optical illusion, it just looks like one.   -- Phil White
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V2 1/3] mkimage: ublimage must return if the header is not verified

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1316687112-27380-1-git-send-email-sba...@denx.de> you wrote:
> Each image handler must return a not-zero value if the
> header is not recognized to allow the main program to
> iterate to the next handler.
> 
> Signed-off-by: Stefano Babic 
> CC: Heiko Schocher 
> ---
> 
> Changes since V1:
>   - correct commit message (Heiko Schocher)
> 
>  tools/ublimage.c |5 +
>  1 files changed, 5 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"Confound these ancestors They've stolen our best ideas!"
- Ben Jonson
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 8/8] km_arm: enable POST for these boards

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-9-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> The current km_arm boards have a Power-On test jumper. When this
> jumper is set, this triggers some Power-On tests on the board.
> 
> This patch enables the support of this jumper for starting the
> memory_regions test when the jumper is set.
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Cc: Prafulla Wadaskar 
> ---
> Changes for v2:
>  - adapted to CONFIG_POST_EXTERNAL_WORD_FUNCS
>  - implemented suggestion from Sergei
> Changes for v3:
>  - moved arch_memory_test_prepare from post/board/km_arm to
>board/keymile/km_arm/km_arm.c
> Changes for v4:
>  - moved post_word adress because of conflict with bootcounter
> ---
>  board/keymile/km_arm/km_arm.c |   33 +
>  include/configs/km/km_arm.h   |6 ++
>  2 files changed, 39 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Only two things are infinite,  the universe and human stupidity,  and
I'm not sure about the former. -- Albert Einstein
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 7/8] km_arm: change CONFIG_SYS_TEXT_BASE to end of RAM

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-8-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> This allows to test a larger part of the RAM in the memory tests.
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Cc: Heiko Schocher 
> Cc: Prafulla Wadaskar 
> ---
> Changes for v4:
>  - fixed wrong comment
> ---
>  include/configs/km/km_arm.h |2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What is wanted is not the will to believe,  but the will to find out,
which is the exact opposite.
-- Bertrand Russell, "Skeptical Essays", 1928
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 6/8] POST: add new memory regions test

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-7-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> This test is similar to the actual POST memory test but quicker and
> far less complete. It checks the address and data lines and then only
> tests some regularly placed sub regions of the RAM.
> This can be useful when we want to test the RAM but we do not have enough
> time to run the full memory test.
> 
> The POST memory test code was rearranged in order to avoid code duplication
> between the two tests but the memory test functionnality remains the same.
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Ackey-by: Mike Frysinger 
> ---
> Changes for v3:
>  - cosmetic changes in the test list
> Changes for v4:
>  - rebased on 2011.09-rc1
> ---
>  include/post.h|1 +
>  post/drivers/memory.c |   78 
> +
>  post/tests.c  |   13 
>  3 files changed, 73 insertions(+), 19 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Immortality consists largely of boredom.
-- Zefrem Cochrane, "Metamorphosis", stardate 3219.8
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 5/8] POST: drivers/memory.c coding style cleanup

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-6-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> This is needed for a further patch adding a new memory test.
> 
> Signed-off-by: Valentin Longchamp 
> Acked-by: Mike Frysinger 
> ---
> Changes for v4:
>  - rebased on 2011.09-rc1
> ---
>  post/drivers/memory.c |  113 
> +
>  1 files changed, 57 insertions(+), 56 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Digital computers are themselves more complex than most things people
build: They have very large numbers of states. This makes conceiving,
describing, and testing them hard. Software systems  have  orders-of-
magnitude more states than computers do.   - Fred Brooks, Jr.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 4/8] POST: make env test flags fetching optional

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-5-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> Some boards have the environment variables defined in a slow EEPROM. post_run
> accesses these environment variables to define which tests have to be run (in
> post_get_flags). This is very slow before the code relocation on some boards
> with a slow I2C EEPROM for environement variables.
> 
> This patch adds a config option to skip the fetching of the test flags in the
> environment variables. The test flags assigned to the tests then only are the
> ones statically defined for the test in post/tests.c.
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Acked-by: Mike Frysinger 
> ---
>  post/post.c |   20 +++-
>  1 files changed, 15 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [PATCH v4 3/8] POST: add post_log_res field for post results in global data

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-4-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> The current post_log_word in global data is currently split into 2x
> 16 bits: half for the test start, half for the test success.
> Since we alredy have more than 16 POST tests defined and more could
> be defined, this may result in an overflow and the post_output_backlog
> would not work for the tests defined further of these 16 positions.
> 
> An additional field is added to global data so that we can now support up
> to 32 (depending of architecture) tests. The post_log_word is only used
> to record the start of the test and the new field post_log_res for the
> test success (or failure). The post_output_backlog is for this change
> also adapted.
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Acked-by: Mike Frysinger 
> ---
>  arch/arm/include/asm/global_data.h  |1 +
>  arch/blackfin/include/asm/global_data.h |1 +
>  arch/nios2/include/asm/global_data.h|1 +
>  arch/powerpc/include/asm/global_data.h  |1 +
>  arch/sparc/include/asm/global_data.h|1 +
>  post/post.c |9 +
>  6 files changed, 10 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Remember that Beethoven wrote his first symphony in C ...
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 2/8] POST: allow redefinition of post_word_load/store

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-3-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> The predefinde post_word_load/store functions do not fit all boards,
> so we introduce a way to define post_word_load/store as externs in
> post.h that then can be defined in board specific files. This is done
> with the CONFIG_POST_EXTERNAL_WORD_FUNCS #define
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> ---
>  include/post.h |8 
>  1 files changed, 8 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
PROGRAM - n.  A magic spell cast over a computer  allowing it to turn
one's input into error messages.
v. tr. - To engage in a pastime similar to banging one's head against
a wall, but with fewer opportunities for reward.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v4 1/8] POST/arm: adaptations needed for POST on ARM to work

2011-10-05 Thread Wolfgang Denk
Dear Valentin Longchamp,

In message <1315837122-11952-2-git-send-email-valentin.longch...@keymile.com> 
you wrote:
> For post to run on ARM, 3 things are needed:
> - post_log_word to be defined in gd
> - a post.h include in arch/arm/lib/board.c
> 
> Signed-off-by: Valentin Longchamp 
> Signed-off-by: Holger Brunck 
> Acked-by: Mike Frysinger 
> ---
> Changes for v2:
>  - introduced CONFIG_POST_EXTERNAL_WORD_FUNCS
> Changes for v3:
>  - removed CONFIG_POST_EXTERNAL_WORD_FUNCS. This is now in a separate
>patch
> ---
>  arch/arm/include/asm/global_data.h |4 
>  arch/arm/lib/board.c   |2 ++
>  2 files changed, 6 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
Murder is contrary to the laws of man and God.
-- M-5 Computer, "The Ultimate Computer", stardate 4731.3
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH V5] console: Implement pre-console buffer

2011-10-05 Thread Wolfgang Denk
Dear Graeme Russ,

In message <1314874326-10231-1-git-send-email-graeme.r...@gmail.com> you wrote:
> Allow redirection of console output prior to console initialisation to a
> temporary buffer.
> 
> To enable this functionality, the board (or arch) must define:
>  - CONFIG_PRE_CONSOLE_BUFFER - Enable pre-console buffer
>  - CONFIG_PRE_CON_BUF_ADDR - Base address of pre-console buffer
>  - CONFIG_PRE_CON_BUF_SZ - Size of pre-console buffer (in bytes)
> 
> The pre-console buffer will buffer the last CONFIG_PRE_CON_BUF_SZ bytes
> Any earlier characters are silently dropped.
> 
> Signed-off-by: Graeme Russ 
> ---
> G - Repost of V5 with an SoB. There has to be a better way of
> automating patch updates ;)
> 
> Changes since V4
>  - Fixed typo in README
>  - Made *pre_console* functions in console.c static
>  - Slight tweak to commit message - Some may choose to set the
>configuration defines at the arch level
> 
> Changes since V3
>  - Fixed  blank subject caused by gap between the Cc: list and Date:
> 
> Changes since V2
>  - Cast buffer size to unsigned long to help compilers produce tighter
>code
>  - Use inline stub functions to reduce #ifdef clutter
>  - Add documentation to README
> 
> Changes Since V1
>  - Implemented circular buffer
>  - Trivial code styl corrections
> 
> ---
>  README|   14 +
>  arch/arm/include/asm/global_data.h|3 ++
>  arch/avr32/include/asm/global_data.h  |3 ++
>  arch/blackfin/include/asm/global_data.h   |3 ++
>  arch/m68k/include/asm/global_data.h   |3 ++
>  arch/microblaze/include/asm/global_data.h |3 ++
>  arch/mips/include/asm/global_data.h   |3 ++
>  arch/nios2/include/asm/global_data.h  |3 ++
>  arch/powerpc/include/asm/global_data.h|3 ++
>  arch/sh/include/asm/global_data.h |3 ++
>  arch/sparc/include/asm/global_data.h  |3 ++
>  arch/x86/include/asm/global_data.h|3 ++
>  common/console.c  |   43 +++-
>  13 files changed, 88 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [PATCH 2/2] Makefile: remove mx31pdk exception

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1314701563-27922-2-git-send-email-sba...@denx.de> you wrote:
> An entry in the main Makefile for the mx31pdk board is not
> necessary, and the board is added to boards.cfg as all
> other targets.
> 
> Signed-off-by: Stefano Babic 
> CC: Wolfgang Denk 
> ---
>  Makefile   |   10 --
>  boards.cfg |2 ++
>  2 files changed, 2 insertions(+), 10 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

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


Re: [U-Boot] [PATCH 1/2] Makefile: drop imx31_phycore from general Makefile

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1314701563-27922-1-git-send-email-sba...@denx.de> you wrote:
> Signed-off-by: Stefano Babic 
> ---
>  Makefile   |8 
>  boards.cfg |2 ++
>  2 files changed, 2 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
If a packet hits a pocket on a socket on a port,
And the bus is interrupted as a very last resort,
And the address of the memory makes your floppy disk abort,
Then the socket packet pocket has an error to report! - Ken Burchill?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] Makefile: remove tx25 exception

2011-10-05 Thread Wolfgang Denk
Dear Stefano Babic,

In message <1314629830-32588-1-git-send-email-sba...@denx.de> you wrote:
> An entry in the main Makefile for the tx25 board is not
> necessary, and the board is added to boards.cfg as all
> other targets.
> 
> Signed-off-by: Stefano Babic 
> CC: Wolfgang Denk 
> ---
>  Makefile   |4 
>  boards.cfg |1 +
>  2 files changed, 1 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
"How is this place run - is it an anarchy?"
"No, I wouldn't say so; it is not that well organised..."
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] PPC: Cleanup tqm8xx_pcmcia.c

2011-10-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <1317819115-9089-1-git-send-email-marek.va...@gmail.com> you wrote:
> Signed-off-by: Marek Vasut 
> ---
>  drivers/pcmcia/tqm8xx_pcmcia.c |  154 
> +---
>  1 files changed, 81 insertions(+), 73 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
It is practically impossible to teach good programming style to  stu-
dents that have had prior exposure to BASIC: as potential programmers
they are mentally mutilated beyond hope of regeneration.   - Dijkstra
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH] PPC: Cleanup tqm8xx_pcmcia.c

2011-10-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <1317819115-9089-1-git-send-email-marek.va...@gmail.com> you wrote:
> Signed-off-by: Marek Vasut 
> ---
>  drivers/pcmcia/tqm8xx_pcmcia.c |  154 
> +---
>  1 files changed, 81 insertions(+), 73 deletions(-)

Tested on TQM823L_LCD and TQM855M (with ARGOSY PnPIDE D5 PCMCIA
adapter and IBM-DCXA-21 HDD).

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


Re: [U-Boot] [PATCH] cmd_time: add time command

2011-10-05 Thread Mike Frysinger
On Wednesday 05 October 2011 03:09:15 Che-Liang Chiou wrote:
> The 'time' command runs and reports execution time of commands.

cool

> Sameple usage:

typo: Sample

> --- /dev/null
> +++ b/common/cmd_time.c
>
> +static void report_time(unsigned long int cycles)
> +{
> +#ifdef CONFIG_SYS_HZ

CONFIG_SYS_HZ is required to be defined, so please drop this ifdef check

> + unsigned long int minutes, seconds, milliseconds;
> + unsigned long int total_seconds, remainder;
> +
> + total_seconds = cycles / CONFIG_SYS_HZ;
> + remainder = cycles % CONFIG_SYS_HZ;
> + minutes = total_seconds / 60;
> + seconds = total_seconds % 60;
> + /* approximate millisecond value */
> + milliseconds = (remainder * 1000 + CONFIG_SYS_HZ / 2) / CONFIG_SYS_HZ;
> +
> + printf("time:");
> + if (minutes)
> + printf(" %lu minutes,", minutes);
> + printf(" %lu.%03lu seconds, %lu ticks\n",
> + seconds, milliseconds, cycles);

looks like this could use the new timer api that Graeme is throwing around

> +int do_time(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])

static

> + cmd_tbl_t *target_cmdtp = NULL;

const

> + if (argc == 1) {
> + printf("no command provided\n");
> + return 1;
> + }

return cmd_usage(cmdtp);

> + if (!target_cmdtp) {
> + printf("command not found: %s\n", argv[1]);
> + return 1;
> + }

shells typically display:
%s: command not found

> + if (target_argc > target_cmdtp->maxargs) {
> + printf("maxarags exceeded: %d > %d\n", target_argc,
> + target_cmdtp->maxargs);
> + return 1;
> + }
> ...
> + retval = target_cmdtp->cmd(target_cmdtp, 0, target_argc, argv + 1);

hmm, this looks like we should add a helper like run_command() and put this 
logic there ...

> + putc('\n');
> + report_time(cycles);

why not just integrate that \n into the report_time() code ?
-mike


signature.asc
Description: This is a digitally signed message part.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] Tegra2: Make XTal speed configurable

2011-10-05 Thread Marek Vasut
On Wednesday, October 05, 2011 04:10:56 PM Simon Glass wrote:
> Hi Marek,
> 
> On Fri, Sep 30, 2011 at 5:12 PM, Marek Vasut  wrote:
> > The Toradex T20 module uses 13MHz Xtal, so make the Xtal speed
> > configurable.
> > 
> > Signed-off-by: Marek Vasut 
> > Cc: Simon Glass 
> > Cc: Ben Warren 
> > Cc: Tom Warren 
> > Cc: Stephen Warren 
> > ---
> >  arch/arm/cpu/armv7/tegra2/ap20.c |9 +++--
> >  1 files changed, 7 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c
> > b/arch/arm/cpu/armv7/tegra2/ap20.c index dc5f984..71d9f26 100644
> > --- a/arch/arm/cpu/armv7/tegra2/ap20.c
> > +++ b/arch/arm/cpu/armv7/tegra2/ap20.c
> > @@ -31,6 +31,11 @@
> >  #include 
> >  #include 
> > 
> > +/* The default XTal is 12MHz, some boards might use 13MHz one though */
> > +#ifndefCONFIG_SYS_TEGRA2_XTAL_MHZ
> > +#defineCONFIG_SYS_TEGRA2_XTAL_MHZ  12
> > +#endif
> > +
> >  u32 s_first_boot = 1;
> > 
> >  void init_pllx(void)
> > @@ -46,8 +51,8 @@ void init_pllx(void)
> >/* Set PLLX_MISC */
> >writel(1 << PLL_CPCON_SHIFT, &pll->pll_misc);
> > 
> > -   /* Use 12MHz clock here */
> > -   reg = PLL_BYPASS_MASK | (12 << PLL_DIVM_SHIFT);
> > +   /* Use 13MHz clock here */
> 
> Change comment?
> 
> > +   reg = PLL_BYPASS_MASK | (CONFIG_SYS_TEGRA2_XTAL_MHZ <<
> > PLL_DIVM_SHIFT); reg |= 1000 << PLL_DIVN_SHIFT;
> >writel(reg, &pll->pll_base);
> > 
> > --
> > 1.7.5.4
> 
> Regards,
> Simon

Hi Simon, I'll probably also change the board.c to support this. But then, 
can't 
the board.c be moved to arch/arm/cpu/armv7/tegra... and it's functions exported 
via standard header ? Cheers
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v2 3/4] tegra2: Enable second SD port (J5) on Harmony

2011-10-05 Thread Stephen Warren
Simon Glass wrote at Wednesday, October 05, 2011 8:39 AM:
> Hi Stephen,
> 
> On Tue, Oct 4, 2011 at 10:32 AM, Stephen Warren  wrote:
> > Seaboard uses SDMMC4, SDMMC3. Harmony uses SDMMC4, SDMMC2. Move
> > board_init_mmc and gpio_config_mmc into board-specific files, so boards
> > can choose which ports to set up. Split clock_init_mmc and pin_mux_mmc
> > into per-port functions, and export them for use by boards.
> >
> > Signed-off-by: Stephen Warren 
> 
> I am not thrilled with this patch. It seems to create a lot of new
> functions, moves knowledge of MMC clock speed into the board file

By "board file", do you mean board.c (which already had and still has this
knowledge) or harmony.c/seaboard.c?

> and means that we will always init MMC no matter what the CONFIG
> settings say.

All the MMC init calls are already only enabled based on config settings;
they're wrapped inside:

#ifdef CONFIG_TEGRA2_MMC

> From a boot time perspective we want to init only those periphs that
> we need to use to boot. If we set up clocks and pinmuxes in the board
> init, then this is not possible. We had a discussion on the list a few
> months back about how to minimize this and the answer given was that
> we should only init peripherals when they are used.

Well, nothing in my patch changes anything related to that.

I wasn't subscribed then, so I don't know exactly what was discussed. My
take: It seems reasonable to defer /driver/ initialization to when a
device is first used, but I'm not convinced it's reasonable to defer
system-level initialization such as pinmux/gpio-ownership. By either way,
that's beyond what these patches aim to do.

> Looking ahead to fdt, I think the control point for what gets inited
> and what the pinmux settings are will be in the device tree. My
> understanding of the concept is that drivers will look at their fdt
> node and init accordingly.

Sure.

> We already have a function:
> 
> int tegra2_mmc_init(int dev_index, int bus_width)
> 
> Could this not be enhanced to set the pinmux and clocks? It seems from
> your patch that the pinmux is always fixed but if not it could be a
> parameter.

Yes, it does make perfect sense to pass the GPIOs into this function. I
will rework the patches to do that. Note that the aim of my patches wasn't
to re-factor the driver, but to follow existing practices though. This
would then move the CD handling into the MMC driver. Note however that
the CD function isn't actually used for Tegra; simply removing it may be
the best change at this point?

Perhaps the clock initialization should be moved into the driver too?

For the pinmux, I'm not convinced the MMC driver should be controlling
this. It remains to be seen exactly what the DT binding is for pinmux.
The pinmux information may or may not be related to the MMC nodes in the
DT. I wouldn't want to make the MMC driver control the pinmux until that
question was answered.

Note that there certainly are different pinmuxing options for the MMC
ports, or at least some of them, so the mux settings are board-specific.
It just so happens that for ports that multiple currently-supported
Boards use, all boards happen to use the same pinmux settings for that
port. In the future, I could see say pin_mux_mmc4 being split into e.g.
pin_mux_mmc4_xxx and pin_mux_mmc4_yyy or even just making the pinmux calls
directly from individual board files if we end up supporting a lot of
options.

-- 
nvpublic

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


Re: [U-Boot] [PATCH] PPC: Cleanup tqm8xx_pcmcia.c

2011-10-05 Thread Wolfgang Denk
Dear Marek Vasut,

In message <201110051453.45233.marek.va...@gmail.com> you wrote:
> On Wednesday, October 05, 2011 02:51:55 PM Marek Vasut wrote:
> > Signed-off-by: Marek Vasut 
> > ---
> >  drivers/pcmcia/tqm8xx_pcmcia.c |  154
> > +--- 1 files changed, 81
> > insertions(+), 73 deletions(-)
> > 
> 
> Hi Wolfgang, if you have chance, can you please test if this breaks anything?
> 
> The size growth is from 655 bytes of text to 955 bytes.

Will do ASAP.

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
Ein weiser Herrscher kann in einem großen Land  mehr  Gutes  bewirken
als  in  einem kleinen - ein dummer Herrscher aber auch viel mehr Un-
fug. Da weise Herrscher seltener sind als dumme, war ich schon  immer
gegen große Reiche skeptisch.   - Herbert Rosendorfer
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] U-Boot on LCD monitor (BeagleBoard)?

2011-10-05 Thread Wolfgang Denk
Dear Giorgio Wicklein,

In message <20111005144523.GA8624@wicklein-desktop> you wrote:
> 
> just a question - Is it possible to interact with the U-Boot command line
> (prompt) over an LCD monitor?

No, this is not possible.  A LCD monitor is an output device, and to
enter commands to the command line interface you need an input device.

> As it is now, on boot, I get only an Orange/yellow gradient background on my
> LCD.

As of now, there is no graphics support for OMAP processors in U-Boot
mainline, so you don't even get output.

> Is it really only possible over serial and usb connection, like someone other 
> told me?

With current mainline code, yes.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The more sins you confess, the more books you will sell.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH] ARM: pantheon: enable dcache by default

2011-10-05 Thread Lei Wen
Marvell 88SV331xV5 has its specific arm cp15 opcode, which could
flush out whole dcache by only one line of asm code.

Signed-off-by: Lei Wen 
---
 arch/arm/cpu/arm926ejs/pantheon/cpu.c |   14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/pantheon/cpu.c 
b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
index 2d9c13a..8f94ea9 100644
--- a/arch/arm/cpu/arm926ejs/pantheon/cpu.c
+++ b/arch/arm/cpu/arm926ejs/pantheon/cpu.c
@@ -105,3 +105,17 @@ void i2c_clk_enable(void)
 {
 }
 #endif
+
+#ifndef CONFIG_SYS_DCACHE_OFF
+void enable_caches(void)
+{
+   /* Enable D-cache. I-cache is already enabled in start.S */
+   dcache_enable();
+}
+
+void  flush_cache(unsigned long start, unsigned long size)
+{
+   /* clean & invalidate all D cache */
+   asm("mcr p15, 0, %0, c7, c14, 0" : : "r" (0));
+}
+#endif
-- 
1.7.0.4

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


[U-Boot] [PATCH] USB: gadaget: add Marvell controller support

2011-10-05 Thread Lei Wen
Signed-off-by: Lei Wen 
---
 drivers/usb/gadget/Makefile   |1 +
 drivers/usb/gadget/gadget_chips.h |7 +
 drivers/usb/gadget/mv_udc.c   |  499 +
 include/usb/mv_udc.h  |  151 +++
 4 files changed, 658 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/gadget/mv_udc.c
 create mode 100644 include/usb/mv_udc.h

diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 7d5b504..769b351 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -29,6 +29,7 @@ LIB   := $(obj)libusb_gadget.o
 ifdef CONFIG_USB_ETHER
 COBJS-y += ether.o epautoconf.o config.o usbstring.o
 COBJS-$(CONFIG_USB_ETH_RNDIS) += rndis.o
+COBJS-$(CONFIG_MV_UDC) += mv_udc.o
 else
 # Devices not related to the new gadget layer depend on CONFIG_USB_DEVICE
 ifdef CONFIG_USB_DEVICE
diff --git a/drivers/usb/gadget/gadget_chips.h 
b/drivers/usb/gadget/gadget_chips.h
index 9bb7e2e..5d7b638 100644
--- a/drivers/usb/gadget/gadget_chips.h
+++ b/drivers/usb/gadget/gadget_chips.h
@@ -150,6 +150,11 @@
 #definegadget_is_m66592(g) 0
 #endif
 
+#ifdef CONFIG_USB_GADGET_MV
+#define gadget_is_mv(g)(!strcmp("mv_udc", (g)->name))
+#else
+#define gadget_is_mv(g)0
+#endif
 
 /*
  * CONFIG_USB_GADGET_SX2
@@ -216,5 +221,7 @@ static inline int usb_gadget_controller_number(struct 
usb_gadget *gadget)
return 0x20;
else if (gadget_is_m66592(gadget))
return 0x21;
+   else if (gadget_is_mv(gadget))
+   return 0x22;
return -ENOENT;
 }
diff --git a/drivers/usb/gadget/mv_udc.c b/drivers/usb/gadget/mv_udc.c
new file mode 100644
index 000..cdbdcfa
--- /dev/null
+++ b/drivers/usb/gadget/mv_udc.c
@@ -0,0 +1,499 @@
+/*
+ * Copyright 2011, Marvell Semiconductor Inc.
+ * Lei Wen 
+ *
+ * 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
+ *
+ * Back ported to the 8xx platform (from the 8260 platform) by
+ * murray.jen...@cmst.csiro.au, 27-Jan-01.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef DEBUG
+#define DBG(x...) do {} while (0)
+#else
+#define DBG(x...) printf(x)
+static const char *reqname(unsigned r)
+{
+   switch (r) {
+   case USB_REQ_GET_STATUS: return "GET_STATUS";
+   case USB_REQ_CLEAR_FEATURE: return "CLEAR_FEATURE";
+   case USB_REQ_SET_FEATURE: return "SET_FEATURE";
+   case USB_REQ_SET_ADDRESS: return "SET_ADDRESS";
+   case USB_REQ_GET_DESCRIPTOR: return "GET_DESCRIPTOR";
+   case USB_REQ_SET_DESCRIPTOR: return "SET_DESCRIPTOR";
+   case USB_REQ_GET_CONFIGURATION: return "GET_CONFIGURATION";
+   case USB_REQ_SET_CONFIGURATION: return "SET_CONFIGURATION";
+   case USB_REQ_GET_INTERFACE: return "GET_INTERFACE";
+   case USB_REQ_SET_INTERFACE: return "SET_INTERFACE";
+   default: return "*UNKNOWN*";
+   }
+}
+#endif
+
+#define PAGE_SIZE  4096
+#define QH_MAXNUM  32
+static struct usb_endpoint_descriptor ep0_out_desc = {
+   .bLength = sizeof(struct usb_endpoint_descriptor),
+   .bDescriptorType = USB_DT_ENDPOINT,
+   .bEndpointAddress = 0,
+   .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
+};
+
+static struct usb_endpoint_descriptor ep0_in_desc = {
+   .bLength = sizeof(struct usb_endpoint_descriptor),
+   .bDescriptorType = USB_DT_ENDPOINT,
+   .bEndpointAddress = USB_DIR_IN,
+   .bmAttributes = USB_ENDPOINT_XFER_CONTROL,
+};
+
+struct ept_queue_head *epts;
+struct ept_queue_item *items[2 * NUM_ENDPOINTS];
+static int mv_pullup(struct usb_gadget *gadget, int is_on);
+static int mv_ep_enable(struct usb_ep *ep,
+   const struct usb_endpoint_descriptor *desc);
+static int mv_ep_disable(struct usb_ep *ep);
+static int mv_ep_queue(struct usb_ep *ep,
+   struct usb_request *req, gfp_t gfp_flags);
+static struct usb_request *
+mv_ep_alloc_request(struct usb_ep *ep, unsigned int gfp_flags);
+static void mv_ep_free_request(struct usb_ep *ep, struct usb_request *_req);
+
+static struct usb_gadget_ops mv_udc_ops = {
+   .pullup = mv_pullup,
+};
+
+static struct usb_ep_ops mv_ep_ops = {
+   .enable = mv_ep_enable,
+   .disable= m

[U-Boot] U-Boot on LCD monitor (BeagleBoard)?

2011-10-05 Thread Giorgio Wicklein
Hello everybody,

just a question - Is it possible to interact with the U-Boot command line
(prompt) over an LCD monitor?

I'm using a Beagleboard rev C4 with DVI-D/HDMI and Beagletouch hardware. It
would be nice to interact directly with the bootloader.

As it is now, on boot, I get only an Orange/yellow gradient background on my
LCD.

Is it really only possible over serial and usb connection, like someone other 
told me?

Thanks
Giorgio

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


Re: [U-Boot] [PATCH v2 3/4] tegra2: Enable second SD port (J5) on Harmony

2011-10-05 Thread Simon Glass
Hi Stephen,

On Tue, Oct 4, 2011 at 10:32 AM, Stephen Warren  wrote:
> Seaboard uses SDMMC4, SDMMC3. Harmony uses SDMMC4, SDMMC2. Move
> board_init_mmc and gpio_config_mmc into board-specific files, so boards
> can choose which ports to set up. Split clock_init_mmc and pin_mux_mmc
> into per-port functions, and export them for use by boards.
>
> Signed-off-by: Stephen Warren 

I am not thrilled with this patch. It seems to create a lot of new
functions, moves knowledge of MMC clock speed into the board file and
means that we will always init MMC no matter what the CONFIG settings
say.

>From a boot time perspective we want to init only those periphs that
we need to use to boot. If we set up clocks and pinmuxes in the board
init, then this is not possible. We had a discussion on the list a few
months back about how to minimize this and the answer given was that
we should only init peripherals when they are used.

Looking ahead to fdt, I think the control point for what gets inited
and what the pinmux settings are will be in the device tree. My
understanding of the concept is that drives will look at their fdt
node and init accordingly.

We already have a function:

int tegra2_mmc_init(int dev_index, int bus_width)

Could this not be enhanced to set the pinmux and clocks? It seems from
your patch that the pinmux is always fixed but if not it could be a
parameter.

The same applies in my view to the GPIOs. With this patch in
board_mmc_getcd() we must look up the index and then decide what GPIO
to use. But the GPIO is inited in the board file and could simply be
recorded by the MMC dirver. In fact if we had:

mmc_init_port(unsigned dev_index, enum periph_id mmc_id,
struct tegra2_mmc *reg, int bus_width,
int cd_gpio, int wp_gpio)

or similar, then the GPIO setup and access could be handled by the MMC driver.


> ---
>  board/nvidia/common/board.c      |   77 
> --
>  board/nvidia/common/board.h      |    8 +++-
>  board/nvidia/harmony/harmony.c   |   56 +--
>  board/nvidia/seaboard/seaboard.c |   23 +++
>  drivers/mmc/tegra2_mmc.c         |   18 +
>  5 files changed, 148 insertions(+), 34 deletions(-)
>
> diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
> index 8033612..6c09a4c 100644
> --- a/board/nvidia/common/board.c
> +++ b/board/nvidia/common/board.c
> @@ -102,20 +102,37 @@ static void pin_mux_uart(void)
>
>  #ifdef CONFIG_TEGRA2_MMC
>  /*
> - * Routine: clock_init_mmc
> - * Description: init the PLL and clocks for the SDMMC controllers
> + * Routine: clock_init_mmc4
> + * Description: init the PLL and clocks for SDMMC4 controller
>  */
> -static void clock_init_mmc(void)
> +void clock_init_mmc4(void)
>  {
>        clock_start_periph_pll(PERIPH_ID_SDMMC4, CLOCK_ID_PERIPH, 2000);
> +}
> +
> +/*
> + * Routine: clock_init_mmc3
> + * Description: init the PLL and clocks for SDMMC3 controller
> + */
> +void clock_init_mmc3(void)
> +{
>        clock_start_periph_pll(PERIPH_ID_SDMMC3, CLOCK_ID_PERIPH, 2000);
>  }
>
>  /*
> - * Routine: pin_mux_mmc
> - * Description: setup the pin muxes/tristate values for the SDMMC(s)
> + * Routine: clock_init_mmc2
> + * Description: init the PLL and clocks for SDMMC2 controller
>  */
> -static void pin_mux_mmc(void)
> +void clock_init_mmc2(void)
> +{
> +       clock_start_periph_pll(PERIPH_ID_SDMMC2, CLOCK_ID_PERIPH, 2000);
> +}
> +
> +/*
> + * Routine: pin_mux_mmc4
> + * Description: setup the pin muxes/tristate values for SDMMC4
> + */
> +void pin_mux_mmc4(void)
>  {
>        /* SDMMC4: config 3, x8 on 2nd set of pins */
>        pinmux_set_func(PINGRP_ATB, PMUX_FUNC_SDIO4);
> @@ -125,7 +142,14 @@ static void pin_mux_mmc(void)
>        pinmux_tristate_disable(PINGRP_ATB);
>        pinmux_tristate_disable(PINGRP_GMA);
>        pinmux_tristate_disable(PINGRP_GME);
> +}
>
> +/*
> + * Routine: pin_mux_mmc3
> + * Description: setup the pin muxes/tristate values for SDMMC3
> + */
> +void pin_mux_mmc3(void)
> +{
>        /* SDMMC3: SDIO3_CLK, SDIO3_CMD, SDIO3_DAT[3:0] */
>        pinmux_set_func(PINGRP_SDB, PMUX_FUNC_SDIO3);
>        pinmux_set_func(PINGRP_SDC, PMUX_FUNC_SDIO3);
> @@ -135,6 +159,25 @@ static void pin_mux_mmc(void)
>        pinmux_tristate_disable(PINGRP_SDD);
>        pinmux_tristate_disable(PINGRP_SDB);
>  }
> +
> +/*
> + * Routine: pin_mux_mmc2
> + * Description: setup the pin muxes/tristate values for SDMMC2
> + */
> +void pin_mux_mmc2(void)
> +{
> +       /* SDMMC2: SDIO2_CLK, SDIO2_CMD, SDIO2_DAT[7:0] */
> +       pinmux_set_func(PINGRP_DTA, PMUX_FUNC_SDIO2);
> +       pinmux_set_func(PINGRP_DTD, PMUX_FUNC_SDIO2);
> +
> +       pinmux_tristate_disable(PINGRP_DTA);
> +       pinmux_tristate_disable(PINGRP_DTD);
> +
> +       /* For power GPIO PI6 */
> +       pinmux_tristate_disable(PINGRP_ATA);
> +       /* For power GPIO PT3 */
> +       pinmux_tristate_disable(PINGRP_DTB);
> +}
>  #endif
>
>  /*
> @@ -152,28 +195,6 @@ in

[U-Boot] [PATCH v2 09/10] arm926ejs, davinci: add missing spi defines for dm365

2011-10-05 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 
---
 arch/arm/include/asm/arch-davinci/hardware.h |2 ++
 arch/arm/include/asm/arch-davinci/pll_defs.h |1 +
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index e4be42a..e62142b 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -111,6 +111,8 @@ typedef volatile unsigned int * dv_reg_p;
 #define DAVINCI_ASYNC_EMIF_CNTRL_BASE  0x01d1
 #define DAVINCI_MMC_SD0_BASE   0x01d11000
 #define DAVINCI_DDR_EMIF_CTRL_BASE 0x2000
+#define DAVINCI_SPI0_BASE  0x01c66000
+#define DAVINCI_SPI1_BASE  0x01c66800
 
 #elif defined(CONFIG_SOC_DM646X)
 #define DAVINCI_ASYNC_EMIF_CNTRL_BASE  0x20008000
diff --git a/arch/arm/include/asm/arch-davinci/pll_defs.h 
b/arch/arm/include/asm/arch-davinci/pll_defs.h
index 606ed0b..5c30953 100644
--- a/arch/arm/include/asm/arch-davinci/pll_defs.h
+++ b/arch/arm/include/asm/arch-davinci/pll_defs.h
@@ -78,6 +78,7 @@ struct dv_pll_regs {
 
 #define ARM_PLLDIV (offsetof(struct dv_pll_regs, plldiv2))
 #define DDR_PLLDIV (offsetof(struct dv_pll_regs, plldiv7))
+#define SPI_PLLDIV (offsetof(struct dv_pll_regs, plldiv4))
 
 unsigned int davinci_clk_get(unsigned int div);
 #endif /* _DV_PLL_DEFS_H_ */
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 10/10] arm, davinci: add cam_enc_4xx support

2011-10-05 Thread Heiko Schocher
- DM368 SOC
- booting with spl not with UBL from TI
- before loading u-boot from NAND into RAM, test
  the RAM with the post memory test. If error
  is found, switch all LEDs on and halt system.
- SPI Flash
  Dataflash Typ: M25PE80
- Ethernet DM9161BI
- MMC
- USB

Signed-off-by: Heiko Schocher 
Cc: Sandeep Paulraj 
Cc: Albert ARIBAUD 
---
changes for v2:
- rebase to TOT
- adapted to new spl framework
- add USB support
- MDIO Clk only 1MHz
- LED: set LED in spl code, and clear them after 1 second
- add "bdinfo" command
- add nandrbl board specific command for switching
  between rbl and uboot ecc calculation algorithm

 MAINTAINERS  |1 +
 board/ait/cam_enc_4xx/Makefile   |   52 
 board/ait/cam_enc_4xx/cam_enc_4xx.c  |  455 ++
 board/ait/cam_enc_4xx/config.mk  |   13 +
 board/ait/cam_enc_4xx/u-boot-spl.lds |   73 ++
 board/ait/cam_enc_4xx/ublimage.cfg   |   48 
 boards.cfg   |1 +
 doc/README.davinci.nand_spl  |  141 +++
 include/configs/cam_enc_4xx.h|  449 +
 9 files changed, 1233 insertions(+), 0 deletions(-)
 create mode 100644 board/ait/cam_enc_4xx/Makefile
 create mode 100644 board/ait/cam_enc_4xx/cam_enc_4xx.c
 create mode 100644 board/ait/cam_enc_4xx/config.mk
 create mode 100644 board/ait/cam_enc_4xx/u-boot-spl.lds
 create mode 100644 board/ait/cam_enc_4xx/ublimage.cfg
 create mode 100644 doc/README.davinci.nand_spl
 create mode 100644 include/configs/cam_enc_4xx.h

diff --git a/MAINTAINERS b/MAINTAINERS
index 3ab38fa..980b2db 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -417,6 +417,7 @@ Georg Schardt 
 
 Heiko Schocher 
 
+   cam_enc_4xx davinci/ARM926EJS
charon  MPC5200
ids8247 MPC8247
jupiter MPC5200
diff --git a/board/ait/cam_enc_4xx/Makefile b/board/ait/cam_enc_4xx/Makefile
new file mode 100644
index 000..4804597
--- /dev/null
+++ b/board/ait/cam_enc_4xx/Makefile
@@ -0,0 +1,52 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, w...@denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn 
+#
+# 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  := $(BOARD).o
+SOBJS  :=
+
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):$(obj).depend $(OBJS) $(SOBJS)
+   $(call cmd_link_o_target, $(OBJS) $(SOBJS))
+
+clean:
+   rm -f $(SOBJS) $(OBJS)
+
+distclean: clean
+   rm -f $(LIB) core *.bak $(obj).depend
+
+#
+# This is for $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/board/ait/cam_enc_4xx/cam_enc_4xx.c 
b/board/ait/cam_enc_4xx/cam_enc_4xx.c
new file mode 100644
index 000..059a08a
--- /dev/null
+++ b/board/ait/cam_enc_4xx/cam_enc_4xx.c
@@ -0,0 +1,455 @@
+/*
+ * Copyright (C) 2009 Texas Instruments Incorporated
+ *
+ * Copyright (C) 2011
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#ifdef CONFIG_DAVINCI_MMC
+#include 
+#include 
+#endif
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#ifndef CONFIG_SPL_BUILD
+int dram_init(void)
+{
+   /* dram_init must stor

[U-Boot] [PATCH v2 08/10] arm926ejs, davinci: add cpuinfo for dm365

2011-10-05 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 

---
Changes for v2:
- rebase to TOT

 arch/arm/cpu/arm926ejs/davinci/cpu.c |   27 -
 arch/arm/include/asm/arch-davinci/pll_defs.h |4 +++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/arch/arm/cpu/arm926ejs/davinci/cpu.c 
b/arch/arm/cpu/arm926ejs/davinci/cpu.c
index 02819f6..9ea9785 100644
--- a/arch/arm/cpu/arm926ejs/davinci/cpu.c
+++ b/arch/arm/cpu/arm926ejs/davinci/cpu.c
@@ -146,13 +146,15 @@ static inline unsigned pll_prediv(volatile void *pllbase)
return 8;
else
return pll_div(pllbase, PLLC_PREDIV);
+#elif defined(CONFIG_SOC_DM365)
+   return pll_div(pllbase, PLLC_PREDIV);
 #endif
return 1;
 }
 
 static inline unsigned pll_postdiv(volatile void *pllbase)
 {
-#ifdef CONFIG_SOC_DM355
+#if defined(CONFIG_SOC_DM355) || defined(CONFIG_SOC_DM365)
return pll_div(pllbase, PLLC_POSTDIV);
 #elif defined(CONFIG_SOC_DM6446)
if (pllbase == (volatile void *)DAVINCI_PLL_CNTRL0_BASE)
@@ -171,9 +173,13 @@ static unsigned pll_sysclk_mhz(unsigned pll_addr, unsigned 
div)
 #endif
 
/* the PLL might be bypassed */
-   if (REG(pllbase + PLLC_PLLCTL) & BIT(0)) {
+   if (readl(pllbase + PLLC_PLLCTL) & BIT(0)) {
base /= pll_prediv(pllbase);
+#if defined(CONFIG_SOC_DM365)
+   base *=  2 * (readl(pllbase + PLLC_PLLM) & 0x0ff);
+#else
base *= 1 + (REG(pllbase + PLLC_PLLM) & 0x0ff);
+#endif
base /= pll_postdiv(pllbase);
}
return DIV_ROUND_UP(base, 1000 * pll_div(pllbase, div));
@@ -184,8 +190,13 @@ int print_cpuinfo(void)
/* REVISIT fetch and display CPU ID and revision information
 * too ... that will matter as more revisions appear.
 */
+#if defined(CONFIG_SOC_DM365)
+   printf("Cores: ARM %d MHz",
+   pll_sysclk_mhz(DAVINCI_PLL_CNTRL1_BASE, ARM_PLLDIV));
+#else
printf("Cores: ARM %d MHz",
pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, ARM_PLLDIV));
+#endif
 
 #ifdef DSP_PLLDIV
printf(", DSP %d MHz",
@@ -194,8 +205,13 @@ int print_cpuinfo(void)
 
printf("\nDDR:   %d MHz\n",
/* DDR PHY uses an x2 input clock */
+#if defined(CONFIG_SOC_DM365)
+   pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, DDR_PLLDIV)
+   / 2);
+#else
pll_sysclk_mhz(DAVINCI_PLL_CNTRL1_BASE, DDR_PLLDIV)
/ 2);
+#endif
return 0;
 }
 
@@ -205,6 +221,13 @@ unsigned int davinci_arm_clk_get()
return pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, ARM_PLLDIV) * 100;
 }
 #endif
+
+#if defined(CONFIG_SOC_DM365)
+unsigned int davinci_clk_get(unsigned int div)
+{
+   return pll_sysclk_mhz(DAVINCI_PLL_CNTRL0_BASE, div) * 100;
+}
+#endif
 #endif /* CONFIG_DISPLAY_CPUINFO */
 #endif /* !CONFIG_SOC_DA8XX */
 
diff --git a/arch/arm/include/asm/arch-davinci/pll_defs.h 
b/arch/arm/include/asm/arch-davinci/pll_defs.h
index 5d37616..606ed0b 100644
--- a/arch/arm/include/asm/arch-davinci/pll_defs.h
+++ b/arch/arm/include/asm/arch-davinci/pll_defs.h
@@ -76,4 +76,8 @@ struct dv_pll_regs {
 #define dv_pll0_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL0_BASE)
 #define dv_pll1_regs ((struct dv_pll_regs *)DAVINCI_PLL_CNTRL1_BASE)
 
+#define ARM_PLLDIV (offsetof(struct dv_pll_regs, plldiv2))
+#define DDR_PLLDIV (offsetof(struct dv_pll_regs, plldiv7))
+
+unsigned int davinci_clk_get(unsigned int div);
 #endif /* _DV_PLL_DEFS_H_ */
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 07/10] arm, davinci: add lowlevel function for dm365 soc

2011-10-05 Thread Heiko Schocher
used for booting (for example) from NAND using spl code.

Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 

---
changes for v2:
- fix bug for dm365 if setup A2CR register
- rebase to TOT:
  - rename DM36x_DDR_* to DV_DDR_*
  - add support for new SPL framework

 arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c|  466 
 arch/arm/include/asm/arch-davinci/dm365_lowlevel.h |   43 ++
 2 files changed, 509 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c
 create mode 100644 arch/arm/include/asm/arch-davinci/dm365_lowlevel.h

diff --git a/arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c 
b/arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c
new file mode 100644
index 000..d7c6a3e
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c
@@ -0,0 +1,466 @@
+/*
+ * SoC-specific lowlevel code for tms320dm365 and similar chips
+ * Actually used for booting from NAND with nand_spl.
+ *
+ * Copyright (C) 2011
+ * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+void dm365_waitloop(unsigned long loopcnt)
+{
+   unsigned long   i;
+
+   for (i = 0; i < loopcnt; i++)
+   asm("   NOP");
+}
+
+int dm365_pll1_init(unsigned long pllmult, unsigned long prediv)
+{
+   unsigned int clksrc = 0x0;
+
+   /* Power up the PLL */
+   clrbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLPWRDN);
+
+   clrbits_le32(&dv_pll0_regs->pllctl, PLLCTL_RES_9);
+   setbits_le32(&dv_pll0_regs->pllctl, clksrc << 8);
+
+   /*
+* Set PLLENSRC '0', PLL Enable(PLLEN) selection is controlled
+* through MMR
+*/
+   clrbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLENSRC);
+
+   /* Set PLLEN=0 => PLL BYPASS MODE */
+   clrbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLEN);
+
+   dm365_waitloop(150);
+
+/* PLLRST=1(reset assert) */
+   setbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLRST);
+
+   dm365_waitloop(300);
+
+   /*Bring PLL out of Reset*/
+   clrbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLRST);
+
+   /* Program the Multiper and Pre-Divider for PLL1 */
+   writel(pllmult, &dv_pll0_regs->pllm);
+   writel(prediv, &dv_pll0_regs->prediv);
+
+   /* Assert TENABLE = 1, TENABLEDIV = 1, TINITZ = 1 */
+   writel(PLLSECCTL_STOPMODE | PLLSECCTL_TENABLEDIV | PLLSECCTL_TENABLE |
+   PLLSECCTL_TINITZ, &dv_pll0_regs->secctl);
+   /* Assert TENABLE = 1, TENABLEDIV = 1, TINITZ = 0 */
+   writel(PLLSECCTL_STOPMODE | PLLSECCTL_TENABLEDIV | PLLSECCTL_TENABLE,
+   &dv_pll0_regs->secctl);
+   /* Assert TENABLE = 0, TENABLEDIV = 0, TINITZ = 0 */
+   writel(PLLSECCTL_STOPMODE, &dv_pll0_regs->secctl);
+   /* Assert TENABLE = 0, TENABLEDIV = 0, TINITZ = 1 */
+   writel(PLLSECCTL_STOPMODE | PLLSECCTL_TINITZ, &dv_pll0_regs->secctl);
+
+   /* Program the PostDiv for PLL1 */
+   writel(0x8000, &dv_pll0_regs->postdiv);
+
+   /* Post divider setting for PLL1 */
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV1, &dv_pll0_regs->plldiv1);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV2, &dv_pll0_regs->plldiv2);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV3, &dv_pll0_regs->plldiv3);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV4, &dv_pll0_regs->plldiv4);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV5, &dv_pll0_regs->plldiv5);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV6, &dv_pll0_regs->plldiv6);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV7, &dv_pll0_regs->plldiv7);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV8, &dv_pll0_regs->plldiv8);
+   writel(CONFIG_SYS_DM36x_PLL1_PLLDIV9, &dv_pll0_regs->plldiv9);
+
+   dm365_waitloop(300);
+
+   /* Set the GOSET bit */
+   writel(PLLCMD_GOSET, &dv_pll0_regs->pllcmd); /* Go */
+
+   dm365_waitloop(300);
+
+   /* Wait for PLL to LOCK */
+   while (!((readl(&dv_sys_module_regs->pll0_config) & PLL0_LOCK)
+   == PLL0_LOCK))
+   ;
+
+   /* Enable the PLL Bit of PLLCTL*/
+   setbits_le32(&dv_pll0_regs->pllctl, PLLCTL_PLLEN);
+
+   return 0;
+}
+
+int dm365_pll2_init(unsigned 

[U-Boot] [PATCH v2 06/10] arm, davinci: add header files for dm365

2011-10-05 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 

---
changes for v2:
- rebase to TOT
- add defines for timer 3 and 4
- delete "struct dv_timer_regs" as it is now "davinci_timer"

 arch/arm/include/asm/arch-davinci/aintc_defs.h  |   50 +
 arch/arm/include/asm/arch-davinci/hardware.h|   13 +++
 arch/arm/include/asm/arch-davinci/pll_defs.h|   79 ++
 arch/arm/include/asm/arch-davinci/psc_defs.h|  129 +++
 arch/arm/include/asm/arch-davinci/syscfg_defs.h |   66 
 5 files changed, 337 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-davinci/aintc_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/pll_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/psc_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/syscfg_defs.h

diff --git a/arch/arm/include/asm/arch-davinci/aintc_defs.h 
b/arch/arm/include/asm/arch-davinci/aintc_defs.h
new file mode 100644
index 000..8f37053
--- /dev/null
+++ b/arch/arm/include/asm/arch-davinci/aintc_defs.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2011
+ * 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
+ */
+#ifndef _DV_AINTC_DEFS_H_
+#define _DV_AINTC_DEFS_H_
+
+struct dv_aintc_regs {
+   unsigned intfiq0;   /* 0x00 */
+   unsigned intfiq1;   /* 0x04 */
+   unsigned intirq0;   /* 0x08 */
+   unsigned intirq1;   /* 0x0c */
+   unsigned intfiqentry;   /* 0x10 */
+   unsigned intirqentry;   /* 0x14 */
+   unsigned inteint0;  /* 0x18 */
+   unsigned inteint1;  /* 0x1c */
+   unsigned intintctl; /* 0x20 */
+   unsigned inteabase; /* 0x24 */
+   unsigned char   rsvd0[8];   /* 0x28 */
+   unsigned intintpri0;/* 0x30 */
+   unsigned intintpri1;/* 0x34 */
+   unsigned intintpri2;/* 0x38 */
+   unsigned intintpri3;/* 0x3c */
+   unsigned intintpri4;/* 0x40 */
+   unsigned intintpri5;/* 0x44 */
+   unsigned intintpri6;/* 0x48 */
+   unsigned intintpri7;/* 0x4c */
+};
+
+#define dv_aintc_regs ((struct dv_aintc_regs *)DAVINCI_ARM_INTC_BASE)
+
+#endif /* _DV_AINTC_DEFS_H_ */
diff --git a/arch/arm/include/asm/arch-davinci/hardware.h 
b/arch/arm/include/asm/arch-davinci/hardware.h
index b6a3209..e4be42a 100644
--- a/arch/arm/include/asm/arch-davinci/hardware.h
+++ b/arch/arm/include/asm/arch-davinci/hardware.h
@@ -56,6 +56,7 @@ typedef volatile unsigned int *   dv_reg_p;
 #define DAVINCI_DMA_3PTC1_BASE (0x01c10400)
 #define DAVINCI_UART0_BASE (0x01c2)
 #define DAVINCI_UART1_BASE (0x01c20400)
+#define DAVINCI_TIMER3_BASE(0x01c20800)
 #define DAVINCI_I2C_BASE   (0x01c21000)
 #define DAVINCI_TIMER0_BASE(0x01c21400)
 #define DAVINCI_TIMER1_BASE(0x01c21800)
@@ -63,6 +64,7 @@ typedef volatile unsigned int *   dv_reg_p;
 #define DAVINCI_PWM0_BASE  (0x01c22000)
 #define DAVINCI_PWM1_BASE  (0x01c22400)
 #define DAVINCI_PWM2_BASE  (0x01c22800)
+#define DAVINCI_TIMER4_BASE(0x01c23800)
 #define DAVINCI_SYSTEM_MODULE_BASE (0x01c4)
 #define DAVINCI_PLL_CNTRL0_BASE(0x01c40800)
 #define DAVINCI_PLL_CNTRL1_BASE(0x01c40c00)
@@ -108,6 +110,7 @@ typedef volatile unsigned int * dv_reg_p;
 #define DAVINCI_MMC_SD1_BASE   0x01d0
 #define DAVINCI_ASYNC_EMIF_CNTRL_BASE  0x01d1
 #define DAVINCI_MMC_SD0_BASE   0x01d11000
+#define DAVINCI_DDR_EMIF_CTRL_BASE 0x2000
 
 #elif defined(CONFIG_SOC_DM646X)
 #define DAVINCI_ASYNC_EMIF_CNTRL_BASE  0x20008000
@@ -538,4 +541,14 @@ static inline int get_async3_src(void)
 
 #endif /* CONFIG_SOC_DA8XX */
 
+#if defined(CONFIG_SOC_DM365)
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 

[U-Boot] [PATCH v2 05/10] spl, nand: add 4bit HW ecc oob first nand_read_page function

2011-10-05 Thread Heiko Schocher
similiar to commit dc7cd8e59ba077f3b4c1a4557c9cd86a31b9ab1f, only
adapted for the new spl framework.

Signed-off-by: Heiko Schocher 
Cc: Scott Wood 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 
---
 drivers/mtd/nand/nand_spl_simple.c |   43 
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/nand/nand_spl_simple.c 
b/drivers/mtd/nand/nand_spl_simple.c
index 71491d4..7ab332f 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -140,6 +140,47 @@ static int nand_is_bad_block(int block)
return 0;
 }
 
+#if defined(CONFIG_SYS_NAND_4BIT_HW_ECC_OOBFIRST)
+static int nand_read_page(int block, int page, uchar *dst)
+{
+   struct nand_chip *this = mtd.priv;
+   u_char *ecc_calc;
+   u_char *ecc_code;
+   u_char *oob_data;
+   int i;
+   int eccsize = CONFIG_SYS_NAND_ECCSIZE;
+   int eccbytes = CONFIG_SYS_NAND_ECCBYTES;
+   int eccsteps = CONFIG_SYS_NAND_ECCSTEPS;
+   uint8_t *p = dst;
+   int stat;
+
+   /*
+* No malloc available for now, just use some temporary locations
+* in SDRAM
+*/
+   ecc_calc = (u_char *)(CONFIG_SYS_SDRAM_BASE + 0x1);
+   ecc_code = ecc_calc + 0x100;
+   oob_data = ecc_calc + 0x200;
+
+   nand_command(block, page, 0, NAND_CMD_READOOB);
+   this->read_buf(&mtd, oob_data, CONFIG_SYS_NAND_OOBSIZE);
+   nand_command(block, page, 0, NAND_CMD_READ0);
+
+   /* Pick the ECC bytes out of the oob data */
+   for (i = 0; i < CONFIG_SYS_NAND_ECCTOTAL; i++)
+   ecc_code[i] = oob_data[nand_ecc_pos[i]];
+
+
+   for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize) {
+   this->ecc.hwctl(&mtd, NAND_ECC_READ);
+   this->read_buf(&mtd, p, eccsize);
+   this->ecc.calculate(&mtd, p, &ecc_calc[i]);
+   stat = this->ecc.correct(&mtd, p, &ecc_code[i], &ecc_calc[i]);
+   }
+
+   return 0;
+}
+#else
 static int nand_read_page(int block, int page, void *dst)
 {
struct nand_chip *this = mtd.priv;
@@ -186,6 +227,7 @@ static int nand_read_page(int block, int page, void *dst)
 
return 0;
 }
+#endif
 
 int nand_spl_load_image(uint32_t offs, unsigned int size, void *dst)
 {
@@ -231,6 +273,7 @@ void nand_init(void)
nand_chip.IO_ADDR_R = nand_chip.IO_ADDR_W =
(void  __iomem *)CONFIG_SYS_NAND_BASE;
nand_chip.options = 0;
+   nand_chip.dev_ready = NULL;
board_nand_init(&nand_chip);
 
if (nand_chip.select_chip)
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 04/10] arm, davinci: add support for new spl framework

2011-10-05 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 
---
 Makefile  |8 +++-
 arch/arm/cpu/arm926ejs/davinci/Makefile   |8 
 arch/arm/cpu/arm926ejs/davinci/spl.c  |   63 +
 arch/arm/cpu/arm926ejs/davinci/spl_nand.c |   57 ++
 arch/arm/cpu/arm926ejs/start.S|   25 +++-
 5 files changed, 158 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c

diff --git a/Makefile b/Makefile
index ddcf533..cc4a036 100644
--- a/Makefile
+++ b/Makefile
@@ -396,9 +396,13 @@ $(obj)u-boot.sha1: $(obj)u-boot.bin
 $(obj)u-boot.dis:  $(obj)u-boot
$(OBJDUMP) -d $< > $@
 
-$(obj)u-boot.ubl:   $(obj)u-boot-nand.bin
+$(obj)u-boot.ubl:   $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+   $(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary 
$(obj)spl/u-boot-spl $(obj)spl/u-boot-spl-pad.bin
+   cat $(obj)spl/u-boot-spl-pad.bin $(obj)u-boot.bin > 
$(obj)u-boot-ubl.bin
$(obj)tools/mkimage -n $(UBL_CONFIG) -T ublimage \
-   -e $(CONFIG_SYS_TEXT_BASE) -d $< $@
+   -e $(CONFIG_SYS_TEXT_BASE) -d $(obj)u-boot-ubl.bin 
$(obj)u-boot.ubl
+   rm $(obj)u-boot-ubl.bin
+   rm $(obj)spl/u-boot-spl-pad.bin
 
 GEN_UBOOT = \
UNDEF_SYM=`$(OBJDUMP) -x $(LIBBOARD) $(LIBS) | \
diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile 
b/arch/arm/cpu/arm926ejs/davinci/Makefile
index 0310957..d9e71bc 100644
--- a/arch/arm/cpu/arm926ejs/davinci/Makefile
+++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
@@ -35,6 +35,14 @@ COBJS-$(CONFIG_SOC_DM644X)   += dm644x.o
 COBJS-$(CONFIG_SOC_DM646X) += dm646x.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC) += lxt972.o dp83848.o et1011c.o ksz8873.o
 
+ifdef CONFIG_SPL_BUILD
+COBJS-y+= spl.o
+COBJS-y+= dm365_lowlevel.o
+ifdef CONFIG_SPL_NAND_SUPPORT
+COBJS-y+= spl_nand.o
+endif
+endif
+
 SOBJS  = reset.o
 
 ifndef CONFIG_SKIP_LOWLEVEL_INIT
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c 
b/arch/arm/cpu/arm926ejs/davinci/spl.c
new file mode 100644
index 000..d9b9398
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011
+ * 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 
+
+void puts(const char *str)
+{
+   while (*str)
+   putc(*str++);
+}
+
+void putc(char c)
+{
+   if (c == '\n')
+   NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
+
+   NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
+}
+
+inline void hang(void)
+{
+   puts("### ERROR ### Please RESET the board ###\n");
+   for (;;)
+   ;
+}
+
+void board_init_f(ulong dummy)
+{
+   dm36x_lowlevel_init(0);
+   relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
+}
+
+void board_init_r(gd_t *id, ulong dummy)
+{
+
+   nand_init();
+   puts("Nand boot...\n");
+   nand_boot();
+}
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl_nand.c 
b/arch/arm/cpu/arm926ejs/davinci/spl_nand.c
new file mode 100644
index 000..efc0521
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/davinci/spl_nand.c
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2011
+ * Heiko Schocher, DENX Software Engineering, h...@denx.de.
+ *
+ * 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

[U-Boot] [PATCH v2 03/10] spl: add option for adding post memory test to the SPL framework

2011-10-05 Thread Heiko Schocher
Signed-off-by: Heiko Schocher 
Cc: Albert ARIBAUD 
Cc: Sandeep Paulraj 
---
 doc/README.SPL |1 +
 spl/Makefile   |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/doc/README.SPL b/doc/README.SPL
index d53ef9c..c991aab 100644
--- a/doc/README.SPL
+++ b/doc/README.SPL
@@ -62,3 +62,4 @@ CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
 CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
 CONFIG_SPL_POWER_SUPPORT (drivers/power/libpower.o)
 CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
+(CONFIG_SPL_POST_MEM_SUPPORT (post/drivers/memory.o)
diff --git a/spl/Makefile b/spl/Makefile
index b44e84d..a517b1a 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -48,6 +48,7 @@ LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
 LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
 LIBS-$(CONFIG_SPL_POWER_SUPPORT) += drivers/power/libpower.o
 LIBS-$(CONFIG_SPL_NAND_SUPPORT) += drivers/mtd/nand/libnand.o
+LIBS-$(CONFIG_SPL_POST_MEM_SUPPORT) += post/drivers/memory.o
 
 ifeq ($(SOC),omap3)
 LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 02/10] net, davinci_emac: make clock divider in MDIO control register configurable

2011-10-05 Thread Heiko Schocher
Define CONFIG_SYS_EMAC_TI_CLKDIV for setting the clkdiv value
in the MDIO control register.

Signed-off-by: Heiko Schocher 
cc: Sandeep Paulraj 
cc: Wolfgang Denk 

---
 drivers/net/davinci_emac.c |9 +++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index a8905b8..299f1e1 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -53,6 +53,11 @@ unsigned int emac_dbg = 0;
 #define emac_gigabit_enable()  /* no gigabit to enable */
 #endif
 
+#if !defined(CONFIG_SYS_EMAC_TI_CLKDIV)
+#define CONFIG_SYS_EMAC_TI_CLKDIV  ((EMAC_MDIO_BUS_FREQ / \
+   EMAC_MDIO_CLOCK_FREQ) - 1)
+#endif
+
 static void davinci_eth_mdio_enable(void);
 
 static int gen_init_phy(int phy_addr);
@@ -126,7 +131,7 @@ static void davinci_eth_mdio_enable(void)
 {
u_int32_t   clkdiv;
 
-   clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1;
+   clkdiv = CONFIG_SYS_EMAC_TI_CLKDIV;
 
writel((clkdiv & 0xff) |
   MDIO_CONTROL_ENABLE |
@@ -427,7 +432,7 @@ static int davinci_eth_open(struct eth_device *dev, bd_t 
*bis)
 #endif
 
/* Init MDIO & get link state */
-   clkdiv = (EMAC_MDIO_BUS_FREQ / EMAC_MDIO_CLOCK_FREQ) - 1;
+   clkdiv = CONFIG_SYS_EMAC_TI_CLKDIV;
writel((clkdiv & 0xff) | MDIO_CONTROL_ENABLE | MDIO_CONTROL_FAULT,
   &adap_mdio->CONTROL);
 
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 01/10] arm, usb, davinci: make USBPHY_CTL register configurable

2011-10-05 Thread Heiko Schocher
Define CONFIG_DV_USBPHY_CTL for setting the USB PHY control
register.

Signed-off-by: Heiko Schocher 
Acked-by: Remy Bohmer 
cc: Sandeep Paulraj 
cc: Remy Bohmer 

---
 drivers/usb/musb/davinci.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c
index f56f2df..98c2c62 100644
--- a/drivers/usb/musb/davinci.c
+++ b/drivers/usb/musb/davinci.c
@@ -26,6 +26,10 @@
 #include "davinci.h"
 #include 
 
+#if !defined(CONFIG_DV_USBPHY_CTL)
+#define CONFIG_DV_USBPHY_CTL (USBPHY_SESNDEN | USBPHY_VBDTCTEN)
+#endif
+
 /* MUSB platform configuration */
 struct musb_config musb_cfg = {
.regs   = (struct musb_regs *)MENTOR_USB0_BASE,
@@ -50,7 +54,7 @@ static u8 phy_on(void)
writel(USBPHY_PHY24MHZ | USBPHY_SESNDEN |
USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
 #else
-   writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+   writel(CONFIG_DV_USBPHY_CTL, USBPHY_CTL_PADDR);
 #endif
timeout = musb_cfg.timeout;
 
-- 
1.7.6.2

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


[U-Boot] [PATCH v2 00/10] arm, davinci: add support for dm368 based cam_enc_4xx board

2011-10-05 Thread Heiko Schocher
This is a repost of the cam_enc_4xx board support patches
from http://lists.denx.de/pipermail/u-boot/2011-July/096302.html

changes for v2:
- rebased to TOT
- support new spl framework
- add USB support
- add MMC support
- add bdinfo command
- add board specific nandrbl function for switching
  between rbl/uboot ecc calculation algorithm

Patches are checkpatch clean

"./MAKEALL -a arm --soc davinci" compiles clean

Also needed patches:

arm, arm926: fix missing symbols in NAND_SPL mode
http://patchwork.ozlabs.org/patch/104942/

arm, davinci: replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
http://patchwork.ozlabs.org/patch/106983/

arm, logbuffer: make it compileclean
http://patchwork.ozlabs.org/patch/114740/

post, arm: make post support for arm compile clean
http://patchwork.ozlabs.org/patch/114741/

cosmetic, post: Codingstyle cleanup
http://patchwork.ozlabs.org/patch/114742/

arm, post: add missing post_time_ms for arm
http://patchwork.ozlabs.org/patch/114743/

Cc: Sandeep Paulraj 
Cc: Albert ARIBAUD 

Heiko Schocher (10):
  arm, usb, davinci: make USBPHY_CTL register configurable
  net, davinci_emac: make clock divider in MDIO control register
configurable
  spl: add option for adding post memory test to the SPL framework
  arm, davinci: add support for new spl framework
  spl, nand: add 4bit HW ecc oob first nand_read_page function
  arm, davinci: add header files for dm365
  arm, davinci: add lowlevel function for dm365 soc
  arm926ejs, davinci: add cpuinfo for dm365
  arm926ejs, davinci: add missing spi defines for dm365
  arm, davinci: add cam_enc_4xx support

 MAINTAINERS|1 +
 Makefile   |8 +-
 arch/arm/cpu/arm926ejs/davinci/Makefile|8 +
 arch/arm/cpu/arm926ejs/davinci/cpu.c   |   27 +-
 arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c|  466 
 arch/arm/cpu/arm926ejs/davinci/spl.c   |   63 +++
 arch/arm/cpu/arm926ejs/davinci/spl_nand.c  |   57 +++
 arch/arm/cpu/arm926ejs/start.S |   25 +-
 arch/arm/include/asm/arch-davinci/aintc_defs.h |   50 +++
 arch/arm/include/asm/arch-davinci/dm365_lowlevel.h |   43 ++
 arch/arm/include/asm/arch-davinci/hardware.h   |   15 +
 arch/arm/include/asm/arch-davinci/pll_defs.h   |   84 
 arch/arm/include/asm/arch-davinci/psc_defs.h   |  129 ++
 arch/arm/include/asm/arch-davinci/syscfg_defs.h|   66 +++
 board/ait/cam_enc_4xx/Makefile |   52 +++
 board/ait/cam_enc_4xx/cam_enc_4xx.c|  455 +++
 board/ait/cam_enc_4xx/config.mk|   13 +
 board/ait/cam_enc_4xx/u-boot-spl.lds   |   73 +++
 board/ait/cam_enc_4xx/ublimage.cfg |   48 ++
 boards.cfg |1 +
 doc/README.SPL |1 +
 doc/README.davinci.nand_spl|  141 ++
 drivers/mtd/nand/nand_spl_simple.c |   43 ++
 drivers/net/davinci_emac.c |9 +-
 drivers/usb/musb/davinci.c |6 +-
 include/configs/cam_enc_4xx.h  |  449 +++
 spl/Makefile   |1 +
 27 files changed, 2326 insertions(+), 8 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/dm365_lowlevel.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl.c
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c
 create mode 100644 arch/arm/include/asm/arch-davinci/aintc_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/dm365_lowlevel.h
 create mode 100644 arch/arm/include/asm/arch-davinci/pll_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/psc_defs.h
 create mode 100644 arch/arm/include/asm/arch-davinci/syscfg_defs.h
 create mode 100644 board/ait/cam_enc_4xx/Makefile
 create mode 100644 board/ait/cam_enc_4xx/cam_enc_4xx.c
 create mode 100644 board/ait/cam_enc_4xx/config.mk
 create mode 100644 board/ait/cam_enc_4xx/u-boot-spl.lds
 create mode 100644 board/ait/cam_enc_4xx/ublimage.cfg
 create mode 100644 doc/README.davinci.nand_spl
 create mode 100644 include/configs/cam_enc_4xx.h

-- 
1.7.6.2

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


Re: [U-Boot] [PATCH 1/2] Tegra2: Make XTal speed configurable

2011-10-05 Thread Simon Glass
Hi Marek,

On Fri, Sep 30, 2011 at 5:12 PM, Marek Vasut  wrote:
> The Toradex T20 module uses 13MHz Xtal, so make the Xtal speed configurable.
>
> Signed-off-by: Marek Vasut 
> Cc: Simon Glass 
> Cc: Ben Warren 
> Cc: Tom Warren 
> Cc: Stephen Warren 
> ---
>  arch/arm/cpu/armv7/tegra2/ap20.c |    9 +++--
>  1 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c 
> b/arch/arm/cpu/armv7/tegra2/ap20.c
> index dc5f984..71d9f26 100644
> --- a/arch/arm/cpu/armv7/tegra2/ap20.c
> +++ b/arch/arm/cpu/armv7/tegra2/ap20.c
> @@ -31,6 +31,11 @@
>  #include 
>  #include 
>
> +/* The default XTal is 12MHz, some boards might use 13MHz one though */
> +#ifndef        CONFIG_SYS_TEGRA2_XTAL_MHZ
> +#define        CONFIG_SYS_TEGRA2_XTAL_MHZ      12
> +#endif
> +
>  u32 s_first_boot = 1;
>
>  void init_pllx(void)
> @@ -46,8 +51,8 @@ void init_pllx(void)
>        /* Set PLLX_MISC */
>        writel(1 << PLL_CPCON_SHIFT, &pll->pll_misc);
>
> -       /* Use 12MHz clock here */
> -       reg = PLL_BYPASS_MASK | (12 << PLL_DIVM_SHIFT);
> +       /* Use 13MHz clock here */

Change comment?

> +       reg = PLL_BYPASS_MASK | (CONFIG_SYS_TEGRA2_XTAL_MHZ << 
> PLL_DIVM_SHIFT);
>        reg |= 1000 << PLL_DIVN_SHIFT;
>        writel(reg, &pll->pll_base);
>
> --
> 1.7.5.4
>
>

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


Re: [U-Boot] [PATCH 13/13] Davinci: ea20: use gpio framework to access gpios

2011-10-05 Thread Stefano Babic
On 10/05/2011 03:14 PM, Laurence Withers wrote:
> On Wed, Oct 05, 2011 at 03:08:24PM +0200, Stefano Babic wrote:
>> Drop direct access to SOC's registers and use
>> the function of the GPIO driver for da8xx.
> 
> Dear Stefano,
> 
> The da8xx GPIO driver also configures the pinmux for you.
> 
> Bye for now,

That's true, but this was wanted. IMHO is the usage of the functions
gpio_request() and gpio_free() optional.

I decided to program myself the pinmux also for the gpio together with
the setup of the pinmux for the other controllers of the SOC, everything
in the ea20.c file.
this allows to see all code managing the pinmux on this board in one place.

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


  1   2   >