From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mlbe2k2.cs.myharris.net (mlbe2k2.cs.myharris.net [137.237.90.89]) by ozlabs.org (Postfix) with ESMTP id 534B6DDED2 for ; Tue, 12 Aug 2008 00:05:16 +1000 (EST) Message-ID: <48A04717.4040102@harris.com> Date: Mon, 11 Aug 2008 10:05:11 -0400 From: "Steven A. Falco" MIME-Version: 1.0 To: benh@kernel.crashing.org Subject: Re: Device tree question References: <489B5350.6050009@harris.com> <1218267682.24157.366.camel@pasglop> In-Reply-To: <1218267682.24157.366.camel@pasglop> Content-Type: multipart/alternative; boundary="------------010704040501070505050200" Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is a multi-part message in MIME format. --------------010704040501070505050200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Benjamin Herrenschmidt wrote: > On Thu, 2008-08-07 at 15:56 -0400, Steven A. Falco wrote: > >> I have added a compact flash to the external bus of a Sequoia >> (PPC440EPx) evaluation board. It is wired to CS1, and U-boot is set to >> configure CS1 to be at address 0xc1000000. U-boot can access the >> device, and reports the correct partition table, etc. so I believe the >> hardware is ok. >> >> I've created a device-tree entry under the EBC0 section of the >> sequoia.dts file: >> >> pata@1,0 { >> compatible = "harris,hydra_temp-pata", "ata-generic"; >> bank-width = <2>; >> reg = <1 0 20 1 80 20>; >> reg-shift = <4>; >> pio-mode = <4>; >> interrupts = <27 4>; >> interrupt-parent = <&UIC0>; >> }; >> }; >> >> This seems to be correct, because if I turn on debug in prom_parse, I >> see a translation that looks reasonable: >> > > Did you check that the resulting physical address was indeed where you > device is supposed to be addressed ? > > Ben > They were wrong - I misinterpreted the reg-shift to be like the "stride" used by u-boot. But u-boot uses it as a multiplier, and reg-shift is truly a shift. So, I changed the shift to "2", and now the addresses are correct. I'm still having problems, but I'll start a new thread, because the new problem concerns interrupts. Thanks, Steve --------------010704040501070505050200 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Benjamin Herrenschmidt wrote:
On Thu, 2008-08-07 at 15:56 -0400, Steven A. Falco wrote:
  
I have added a compact flash to the external bus of a Sequoia
(PPC440EPx) evaluation board.  It is wired to CS1, and U-boot is set to
configure CS1 to be at address 0xc1000000.  U-boot can access the
device, and reports the correct partition table, etc. so I believe the
hardware is ok.

I've created a device-tree entry under the EBC0 section of the
sequoia.dts file:

                pata@1,0 {
                    compatible = "harris,hydra_temp-pata", "ata-generic";
                    bank-width = <2>;
                    reg = <1 0 20 1 80 20>;
                    reg-shift = <4>;
                    pio-mode = <4>;
                    interrupts = <27 4>;
                    interrupt-parent = <&UIC0>;
                };
            };

This seems to be correct, because if I turn on debug in prom_parse, I
see a translation that looks reasonable:
    

Did you check that the resulting physical address was indeed where you
device is supposed to be addressed ?

Ben
  

They were wrong - I misinterpreted the reg-shift to be like the "stride" used by u-boot.  But u-boot uses it as a multiplier, and reg-shift is truly a shift.  So, I changed the shift to "2", and now the addresses are correct.  I'm still having problems, but I'll start a new thread, because the new problem concerns interrupts.

    Thanks,
    Steve

--------------010704040501070505050200--