Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-15 Thread Hayes,Doug
Hi Stefan;
Here's an update on what I've discovered in 2 different areas (I am using an 
older ELDK 4.1.4 for all this code) :
1) SW2 switch configurations that work on Sequoia board with 2011.06 U-boot and 
some that don't since 2009.11-rc1.
2) Compiler error when accessing data from EHCI controller registers.

1 - Sequoia Board Configurations

The following first 4 SW2 dip switch settings will allow the latest 2011.06 
U-Boot to run to the prompt (other settings there is no serial output). The 
last 2 configs. produce no output 2009.11-rc1 onwards. SW2 has labels 4,3,2,1 
and for config. IDs below OFF=0, ON=1.  For example config. ID 5 has 4=OFF, 
3=ON, 2=OFF, 1=ON.  Frequencies (MHz) and boot strap option are shown:
  Config. ID  CPU  PLB  OPB  EBC  PCI  BS-opt  PCI-asyncComments
  0   666  166  83   55   83   H I2C   66Boots with 2011.06
  8   666  166  83   55   41   H I2C   33Boots with 2011.06
  13  533  133  66   66   33   C EBC   33Boots with 2011.06
  14  333  133  66   66   33   B EBC   33Boots with 2011.06
  5   533  133  66   66   66   C EBC No output 
2009.11-rc1 onwards
  6   333  166  66   66   66   B EBC No output 
2009.11-rc1 onwards

Note: Removing the 2 calls to ppc4xx_pci_sync_clock_config() in sequoia.c 
allows configs. 5 & 6 to run as well.  I have not pursued this any further as 
config. 0 gives us a 66 Mhz PCI setting.

2 - Compiler error reading EHCI controller registers

I could not get EHCI devices (high-speed) to be detected on the Sequoia board 
with the 2011.06 release. OHCI worked fine.  I tracked it down to the use of 
the HC_VERSION and HC_LENGTH macros used to extract the version and capability 
length from the hccr->cr_capbase register at 0xE300.  A clue was when I did 
"usb reset" the version showed as "USB EHCI 0.10" instead of "USB EHCI 1.00".  
This is because the code has taken the wrong 16 bits of the register.  For this 
controller the data reads as big endian if a 32-bit read is done.  For 8 & 
16-bit reads the data is returned little endian. For instance, this cr_capbase 
reads as 0x0110 for a 32-bit read, but as "10 00 00 01" as 8-bit reads. At 
the end of usb_low_level_init() in ehci-hcd.c it tries to extract the version 
major number by reading 32 bits, then shifting right 16 bits then shifting 8 
bits. My ELDK 4.1.4 compiler shortcuts this and just does an "lhz" 16-bit read 
(even though the ehci_readl(x) has "volatile u32 *
 ") followed by an 8 bit shift.  The 16-bit read gets 0x0010 instead.  The 
HC_LENGTH macro used in ehci_hcd_init() in ehci-ppc4xx.c had a similar shortcut 
done trying to get the capability length and read the version bytes instead.  
This caused all the "hcor" registers to only be shifted by 1 instead of by 0x10 
thereby causing all those register accesses to be incorrect. The following Diff 
outputs (changes are in ">" file) shows the changes we have made to correct the 
problem - use of volatile and 32-bit operations.  This could obviously cause 
problems for any other code that sub-divides the 32-bit register values for 
devices that behave the same way.  Perhaps newer compilers have fixed this 
problem.  

# diff ehci-hcd.c /work/sandboxes/u-boot-2011.06_rel/drivers/usb/host/
800c800
<   uint32_t reg;
---
>   volatile uint32_t reg;
854,855c854,855
<   reg = HC_VERSION(ehci_readl(&hccr->cr_capbase));
<   printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
---
>   reg = ehci_readl(&hccr->cr_capbase);
>   printf("USB EHCI %x.%02x\n", reg >> 24, (reg >> 16) & 0x00ff);

# diff ehci-ppc4xx.c /work/sandboxes/u-boot-2011.06_rel/drivers/usb/host/
33a34
>   volatile uint32_t reg;
34a36
>   reg = ehci_readl(&hccr->cr_capbase);
36c38
<   HC_LENGTH(ehci_readl(&hccr->cr_capbase)));
---
>   HC_LENGTH(reg));

Hope that is useful.  Thanks for all the help.

Doug

-----Original Message-
From: Stefan Roese [mailto:s...@denx.de] 
Sent: Tuesday, September 13, 2011 4:11 AM
To: Hayes,Doug
Cc: U-Boot-Users
Subject: Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot 
for version 2009.11-rc1 onwards

Doug,

On Friday 09 September 2011 22:04:51 Hayes,Doug wrote:
> I removed the same 2 calls from the latest U-Boot (2011.06) and it boots to
> U-Boot prompt as well. Not sure how to set the card to 33MHz, it may
> already start at 33MHz.  The documentation on SW2 doesn't mention PCI
> settings (our current setting for SW2 is 4321:OFF,ON,OFF,ON?).  We are
> using Bootstrap Option C which comes up at PCI 33 MHz then I assume

Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-13 Thread Stefan Roese
Doug,

On Friday 09 September 2011 22:04:51 Hayes,Doug wrote:
> I removed the same 2 calls from the latest U-Boot (2011.06) and it boots to
> U-Boot prompt as well. Not sure how to set the card to 33MHz, it may
> already start at 33MHz.  The documentation on SW2 doesn't mention PCI
> settings (our current setting for SW2 is 4321:OFF,ON,OFF,ON?).  We are
> using Bootstrap Option C which comes up at PCI 33 MHz then I assume is
> changed to 66MHz by SW?

Hmmm. I checked with exactly your configuration:

U-Boot 2011.06-00588-g49ea2e3 (Sep 09 2011 - 08:20:40)

CPU:   AMCC PowerPC 440EPx Rev. A at 528 MHz (PLB=132 OPB=66 EBC=66 PCI=66 
MHz)
   Security/Kasumi support
   Bootstrap Option C - Boot ROM Location EBC (16 bits)
   Internal PCI arbiter enabled, PCI async ext clock used
   32 kB I-Cache 32 kB D-Cache
Board: Sequoia - AMCC PPC440EPx Evaluation Board, Rev. F, PCI-Async=66 MHz
I2C:   ready
DRAM:  256 MiB
Flash: 64 MiB
NAND:  32 MiB
PCI:   Bus Dev VenId DevId Class Int
USB:   Host(int phy) Device(ext phy)
Net:   ppc_4xx_eth0, ppc_4xx_eth1

Type run flash_nfs to mount root filesystem over NFS

Hit any key to stop autoboot:  0 
=> 

As you can see, I'm using the latest U-Boot source (without modifications). 
And it boots without problems to the prompt. So I'm not really sure why this 
doesn't work on your sequoia board.

You don't have any PCI devices plugged into your board, correct?

Do you have access to another board to test it on a different HW?

> On another note do you know if EHCI is supported for the USB host
> controller on the Sequioa 440EPX in the latest U-Boot. OHCI runs no
> problem but when I compile for EHCI it doesn't see devices when plugged
> in.  There is an errata [USB23] for this device which doesn't appear fixed
> here which may be the cause of this (but the code in U-Boot doesn't match
> the Linux code where the patch comes from).  Just wanted to know if EHCI
> is supported at all (there is some code there).  Thanks.

Yes, EHCI is supported. You need to make sure, that the USB devices connected 
to the Sequoia board are high-speed devices though. Here a log with EHCI 
enabled:

=> usb reset
(Re)start USB...
USB:   Register  NbrPorts 1
USB EHCI 1.00
scanning bus for devices... 2 USB Device(s) found
   scanning bus for storage devices... 1 Storage Device(s) found
=> usb tree

Device Tree:
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Mass Storage (480 Mb/s, 200mA)
   Memorex  Flashdrive 601B  076B02DE06F0

Best regards,
Stefan

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


Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-09 Thread Hayes,Doug
I removed the same 2 calls from the latest U-Boot (2011.06) and it boots to 
U-Boot prompt as well. Not sure how to set the card to 33MHz, it may already 
start at 33MHz.  The documentation on SW2 doesn't mention PCI settings (our 
current setting for SW2 is 4321:OFF,ON,OFF,ON?).  We are using Bootstrap Option 
C which comes up at PCI 33 MHz then I assume is changed to 66MHz by SW?

On another note do you know if EHCI is supported for the USB host controller on 
the Sequioa 440EPX in the latest U-Boot. OHCI runs no problem but when I 
compile for EHCI it doesn't see devices when plugged in.  There is an errata 
[USB23] for this device which doesn't appear fixed here which may be the cause 
of this (but the code in U-Boot doesn't match the Linux code where the patch 
comes from).  Just wanted to know if EHCI is supported at all (there is some 
code there).  Thanks.

Doug

-Original Message-
From: Stefan Roese [mailto:s...@denx.de] 
Sent: Friday, September 09, 2011 10:38 AM
To: Hayes,Doug
Cc: U-Boot-Users
Subject: Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot 
for version 2009.11-rc1 onwards

Doug,

(Please keep the list on CC. Other might have comments or be interested in 
this thread).

On Friday 09 September 2011 15:54:29 Hayes,Doug wrote:
> Removed a 2nd call to ppc4xx_pci_sync_clock_config()  in checkBoard() and
> now I get to the U-Boot prompt.  Perhaps this function has a problem with
> 66MHz PCI or something about the set up of my card?  I will try removing
> those calls in the latest U-boot to see if it will run.  Let me know if
> you have any ideas about this code.  Thanks again.

This reminds me of a problem with PCI clocks on 440EP(x)/GR(x). Please take a 
look at this commit:

---
commit 5e47f9535f53fd4cc05f32fb6166870f976fbb4e
Author: Stefan Roese 
Date:   Mon Oct 19 14:06:23 2009 +0200

ppc4xx: Add function to check and dynamically change PCI sync clock

PPC440EP(x)/PPC440GR(x):
In asynchronous PCI mode, the synchronous PCI clock must meet
certain requirements. The following equation describes the
relationship that must be maintained between the asynchronous PCI
clock and synchronous PCI clock. Select an appropriate PCI:PLB
ratio to maintain the relationship:

AsyncPCIClk - 1MHz <= SyncPCIclock <= (2 * AsyncPCIClk) - 1MHz

This patch now adds a function to check and reconfigure the sync
PCI clock to meet this requirement. This is in preparation for
some AMCC boards (Sequoia/Rainier and Yosemite/Yellowstone) using this
function to not violate the PCI clocking rules.

Signed-off-by: Stefan Roese 
---

This commit is included in v2009.11-rc1. So it definitely seems to point to 
the problem you are seeing on your board. I have to admit though, that I don't 
understand why this doesn't work for your Sequoia.

Could you check if the board boots fine with PCI sync clock forced to 33MHz 
(switch SW2). And please re-check if the equation from the commit text above 
is met in your case.

BTW: Why do you use a fixed strapping (non-bootstrap EEPROM)? You could alwys 
use "chip_config" to configure the EEPROM and configure the board to use the 
EEPROM strapping values.

Best regards,
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
The information contained in this electronic mail transmission 
may be privileged and confidential, and therefore, protected 
from disclosure. If you have received this communication in 
error, please notify us immediately by replying to this 
message and deleting it from your computer without copying 
or disclosing it.


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


Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-09 Thread Stefan Roese
Doug,

(Please keep the list on CC. Other might have comments or be interested in 
this thread).

On Friday 09 September 2011 15:54:29 Hayes,Doug wrote:
> Removed a 2nd call to ppc4xx_pci_sync_clock_config()  in checkBoard() and
> now I get to the U-Boot prompt.  Perhaps this function has a problem with
> 66MHz PCI or something about the set up of my card?  I will try removing
> those calls in the latest U-boot to see if it will run.  Let me know if
> you have any ideas about this code.  Thanks again.

This reminds me of a problem with PCI clocks on 440EP(x)/GR(x). Please take a 
look at this commit:

---
commit 5e47f9535f53fd4cc05f32fb6166870f976fbb4e
Author: Stefan Roese 
Date:   Mon Oct 19 14:06:23 2009 +0200

ppc4xx: Add function to check and dynamically change PCI sync clock

PPC440EP(x)/PPC440GR(x):
In asynchronous PCI mode, the synchronous PCI clock must meet
certain requirements. The following equation describes the
relationship that must be maintained between the asynchronous PCI
clock and synchronous PCI clock. Select an appropriate PCI:PLB
ratio to maintain the relationship:

AsyncPCIClk - 1MHz <= SyncPCIclock <= (2 * AsyncPCIClk) - 1MHz

This patch now adds a function to check and reconfigure the sync
PCI clock to meet this requirement. This is in preparation for
some AMCC boards (Sequoia/Rainier and Yosemite/Yellowstone) using this
function to not violate the PCI clocking rules.

Signed-off-by: Stefan Roese 
---

This commit is included in v2009.11-rc1. So it definitely seems to point to 
the problem you are seeing on your board. I have to admit though, that I don't 
understand why this doesn't work for your Sequoia.

Could you check if the board boots fine with PCI sync clock forced to 33MHz 
(switch SW2). And please re-check if the equation from the commit text above 
is met in your case.

BTW: Why do you use a fixed strapping (non-bootstrap EEPROM)? You could alwys 
use "chip_config" to configure the EEPROM and configure the board to use the 
EEPROM strapping values.

Best regards,
Stefan

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


Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-08 Thread Stefan Roese
Hi Doug,

On Thursday 08 September 2011 22:24:51 Hayes,Doug wrote:
> Has anyone tried the latest U-Boot on the above board lately?  I am
> building the U-Boot image with "sequoia_config" option and have found it
> stops booting after version 2009_08.  I get no text output for the
> versions that I have tried:  2009.11-rc1, 2009.11, 2010.03. latest
> (2011.06).  There were a lot of "4xx" changes in 2009.11-rc1 so perhaps
> one of those has changed how my board comes up.  I am just starting to
> compare code files for differences in order to track it down.
> 
> I am compiling with this ELDK "gcc version 4.0.0 (DENX ELDK 4.1.4.0.0)".
> 
> I anyone has an idea why my U-Boot hangs please let me know.  Thanks for
> any info.

I do test on Sequoia from time-to-time. No problems here:

U-Boot 2011.06-00588-g49ea2e3 (Sep 09 2011 - 08:20:40)

CPU:   AMCC PowerPC 440EPx Rev. A at 330 MHz (PLB=132 OPB=66 EBC=66 PCI=33 
MHz)
   Security/Kasumi support
   Bootstrap Option H - Boot ROM Location I2C (Addr 0x52)
   Internal PCI arbiter enabled, PCI async ext clock used
   32 kB I-Cache 32 kB D-Cache
Board: Sequoia - AMCC PPC440EPx Evaluation Board, Rev. F, PCI-Async=33 MHz
I2C:   ready
DRAM:  256 MiB
Flash: 64 MiB
NAND:  32 MiB
PCI:   Bus Dev VenId DevId Class Int
USB:   Host(int phy) Device(ext phy)
Net:   ppc_4xx_eth0, ppc_4xx_eth1

Type run flash_nfs to mount root filesystem over NFS

Hit any key to stop autoboot:  0 
=> 


This is with ELDK 4.2 (GCC 4.2.2).


On Thursday 08 September 2011 23:31:18 Hayes,Doug wrote:
> Some extra info.  U-Boot dies in get_async_pci_freq() (new feature) called
> from board_early_init_f() when trying to read a byte from 0xC005
> (CONFIG_SYS_BCSR_BASE + 5).

Perhaps your board is too old and doesn't support reading these CPLD 
registers. On mine I get:

=> md.b c000 20
c000: 0f 00 c0 07 00 00 00 80 00 20 00 00 00 00 00 00. ..
c010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

What do you get on your "old", working U-Boot?


Best regards,
Stefan

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


Re: [U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-08 Thread Hayes,Doug
Some extra info.  U-Boot dies in get_async_pci_freq() (new feature) called from 
board_early_init_f() when trying to read a byte from 0xC005 
(CONFIG_SYS_BCSR_BASE + 5).

From: Hayes,Doug
Sent: Thursday, September 08, 2011 4:25 PM
To: 'u-boot@lists.denx.de'
Subject: U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 
2009.11-rc1 onwards

Has anyone tried the latest U-Boot on the above board lately?  I am building 
the U-Boot image with "sequoia_config" option and have found it stops booting 
after version 2009_08.  I get no text output for the versions that I have 
tried:  2009.11-rc1, 2009.11, 2010.03. latest (2011.06).  There were a lot of 
"4xx" changes in 2009.11-rc1 so perhaps one of those has changed how my board 
comes up.  I am just starting to compare code files for differences in order to 
track it down.

I am compiling with this ELDK "gcc version 4.0.0 (DENX ELDK 4.1.4.0.0)".

I anyone has an idea why my U-Boot hangs please let me know.  Thanks for any 
info.

Doug Hayes


The information contained in this electronic mail transmission 
may be privileged and confidential, and therefore, protected 
from disclosure. If you have received this communication in 
error, please notify us immediately by replying to this 
message and deleting it from your computer without copying 
or disclosing it.


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


[U-Boot] U-Boot for AMCC Sequoia Board (PPC440EPX) fails to boot for version 2009.11-rc1 onwards

2011-09-08 Thread Hayes,Doug
Has anyone tried the latest U-Boot on the above board lately?  I am building 
the U-Boot image with "sequoia_config" option and have found it stops booting 
after version 2009_08.  I get no text output for the versions that I have 
tried:  2009.11-rc1, 2009.11, 2010.03. latest (2011.06).  There were a lot of 
"4xx" changes in 2009.11-rc1 so perhaps one of those has changed how my board 
comes up.  I am just starting to compare code files for differences in order to 
track it down.

I am compiling with this ELDK "gcc version 4.0.0 (DENX ELDK 4.1.4.0.0)".

I anyone has an idea why my U-Boot hangs please let me know.  Thanks for any 
info.

Doug Hayes


The information contained in this electronic mail transmission 
may be privileged and confidential, and therefore, protected 
from disclosure. If you have received this communication in 
error, please notify us immediately by replying to this 
message and deleting it from your computer without copying 
or disclosing it.


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