Return-Path: Received: from web51406.mail.re2.yahoo.com (web51406.mail.re2.yahoo.com [206.190.38.185]) by ozlabs.org (Postfix) with SMTP id A85F8DDF1D for ; Fri, 10 Oct 2008 11:03:08 +1100 (EST) Date: Thu, 9 Oct 2008 16:56:26 -0700 (PDT) From: Nguyen Duc Quan Subject: RE: API access I2C To: Duy-Ky Nguyen , linuxppc-embedded@ozlabs.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1896715470-1223596586=:78574" Message-ID: <243068.78574.qm@web51406.mail.re2.yahoo.com> List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-1896715470-1223596586=:78574 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable I think I2C-tools is what you need as sample code to access I2C in Linux. H= ere is the link=0Ahttp://dl.lm-sensors.org/i2c-tools/releases/i2c-tools-3.0= .1.tar.bz2=0AThere are a lot of tools to access, set/get/dump register, rea= d/write the I2C eeprom...=0ABut please use them with care, especially when = you try to read/write the device at address 0x50 ( it's is bootstrap eeprom= ). =0AYou might not boot up your board after playing with this device :-)= =0AQuan Nguyen=0A=0A=0A=0A----- Th=C6=B0 g=E1=BB=91c ----=0AT=E1=BB=AB: Duy= -Ky Nguyen =0A=C4=90=E1=BA=BFn: linuxppc-embedded@= ozlabs.org=0AG=E1=BB=ADi ng=C3=A0y: Th=E1=BB=A9 S=C3=A1u, 10 th=C3=A1ng 10,= 2008 6:11:22=0ACh=E1=BB=A7 =C4=91=E1=BB=81: API access I2C=0A=0AHello,=0A= =0AI have an eva board MPC8313E-RDB with 3 I2C device at address 48, 50, 68= .=0AI'm able to read data from those 3 devices=0A=0AI follow linux/Document= ation/i2c/dev-interface to create a C code to access =0Athose 3 devices in = Linux env, but all are failed !!!=0A=0AI really appreciate your help where = to find info or sample code running in =0ALinyux to access I2C devices=0A= =0AThanks so much,=0A=0ADuy-Ky=0A=0A----- Original Message ----- =0AFrom: <= linuxppc-embedded-request@ozlabs.org>=0ATo: = =0ASent: Thursday, October 09, 2008 2:05 PM=0ASubject: Linuxppc-embedded Di= gest, Vol 50, Issue 14=0A=0A=0A> Send Linuxppc-embedded mailing list submis= sions to=0A> linuxppc-embedded@ozlabs.org=0A>=0A> To subscribe or unsubscri= be via the World Wide Web, visit=0A> https://ozlabs.org/mailman/listinfo/li= nuxppc-embedded=0A> or, via email, send a message with subject or body 'hel= p' to=0A> linuxppc-embedded-request@ozlabs.org=0A>=0A> You can reach the pe= rson managing the list at=0A> linuxppc-embedded-owner@ozlabs.org=0A>=0A> Wh= en replying, please edit your Subject line so it is more specific=0A> than = "Re: Contents of Linuxppc-embedded digest..."=0A>=0A>=0A> Today's Topics:= =0A>=0A> 1. Re: performance: memcpy vs. __copy_tofrom_user (Leon Woestenb= erg)=0A> 2. Re: performance: memcpy vs. __copy_tofrom_user (Matt Sealey)= =0A> 3. Toolchain for ppc-440 without FPU (Ademir Zanetti Junior)=0A> 4= . Re: FS_ENET ERROR(s) 0x12 at second NFS RPC port lookup=0A> (100005/= 1) (Remi Lefevre)=0A> 5. MTD map drivers (FSL UPM NAND) (Alemao)=0A> 6.= RE: Toolchain for ppc-440 without FPU (Ayman El-Khashab)=0A>=0A>=0A> -----= -----------------------------------------------------------------=0A>=0A> M= essage: 1=0A> Date: Thu, 9 Oct 2008 14:04:53 +0200=0A> From: "Leon Woestenb= erg" =0A> Subject: Re: performance: memcpy vs. = __copy_tofrom_user=0A> To: "Dominik Bozek" =0A> Cc: l= inuxppc-dev@ozlabs.org, Paul Mackerras ,=0A> linuxppc-emb= edded@ozlabs.org=0A> Message-ID:=0A> =0A> Content-Type: text/plain; charset=3DISO-8859-1= =0A>=0A> Hello all,=0A>=0A> On Thu, Oct 9, 2008 at 1:41 PM, Dominik Bozek <= domino@mikroswiat.pl> =0A> wrote:=0A>> Paul Mackerras wrote:=0A>>> Dominik = Bozek writes:=0A>>>> Actually I made couple of other tests on that mpc8313.= Most of them are=0A>>>> to ugly to publish them, but... My problem is that= I have to boost the=0A>>>> gigabit interface on the mpc8313. I made simple= substitution and=0A>>>=0A>>> Very interesting. Can you work out where mem= cpy is being called on=0A>>> the network data? I wouldn't have expected th= at.=0A>>>=0A>=0A> Also see this recent thread David Jander on August 25th, = "Efficient=0A> memcpy()/memmove() for G2/G3 cores..."=0A> on linuxppc-dev@o= zlabs.org.=0A>=0A> http://ozlabs.org/pipermail/linuxppc-dev/2008-September/= 062449.html=0A>=0A> BTW, I am interested in this work as well, I'm currentl= y working with=0A> a 8313 and 8315 design, both are e300 cores.=0A>=0A> My = current goal is PCIe though, but I need fast GbE performance as well.=0A>= =0A> Also, did you test Freescale's 2.6.24.3 patches that tune the gianfar= =0A> interfaces for higher performance?=0A>=0A> Regards,=0A> -- =0A> Leon= =0A>=0A>=0A> ------------------------------=0A>=0A> Message: 2=0A> Date: Th= u, 09 Oct 2008 10:37:55 -0500=0A> From: Matt Sealey = =0A> Subject: Re: performance: memcpy vs. __copy_tofrom_user=0A> To: Paul M= ackerras =0A> Cc: linuxppc-dev@ozlabs.org, Dominik Bozek = ,=0A> linuxppc-embedded@ozlabs.org=0A> Message-ID: <4= 8EE2553.30903@genesi-usa.com>=0A> Content-Type: text/plain; charset=3DUTF-8= ; format=3Dflowed=0A>=0A> Paul Mackerras wrote:=0A>> Dominik Bozek writes:= =0A>>=0A>>> Actually I made couple of other tests on that mpc8313. Most of = them are=0A>>> to ugly to publish them, but... My problem is that I have to= boost the=0A>>> gigabit interface on the mpc8313. I made simple substituti= on and=0A>>> __copy_tofrom_user was used instead of memcpy. I know, it's wr= ong, but I=0A>>> speedup that way the network interface for about 10%.=0A>>= =0A>> Very interesting. Can you work out where memcpy is being called on= =0A>> the network data? I wouldn't have expected that.=0A>=0A> It probably= is somewhere.. through some weird and wonderful code path that=0A> needs s= ome serious digging to find. At least in 2.4 memcpy was used and=0A> optimi= zing it (see Freescale's libmotovec benchmarks) did produce a =0A> sizable= =0A> performance improvement. That, and offloading TCP checksumming to Alti= Vec=0A> helped a lot.=0A>=0A> No help at all on an 8313 but, relevant anywa= y.=0A>=0A> Since then zero copy networking and other fancy things like the = DMA=0A> engine API (for intel ioat at least but also there is fsl dma suppo= rt)=0A> there's less to actually optimize now so you're less likely to see = the=0A> same benefits. All these got into mainline because it's essential t= o=0A> have this kind of architecture to get reasonable speeds out of >gigab= it=0A> network links.=0A>=0A>> There is actually no strong reason not to us= e __copy_tofrom_user as=0A>> memcpy, in fact, as long as we are sure that s= ource and destination=0A>> are both cacheable.=0A>=0A> I do think there is = probably a good benefit in doing things like zeroing=0A> pages in AltiVec a= nd copying entire pages with AltiVec (for instance=0A> when copy-on-write h= appens in an application) - NetBSD and QNX implement=0A> at least this beca= use it's faster than using the cache management and=0A> works fine on uncac= heable pages too (also since you're always aligned to=0A> a page, zeroing 4= kb aligned to a 4kb boundary - or whatever your page=0A> size happens to be= , the number of errors that can occur are absolutely=0A> tiny and performan= ce can go through the roof).=0A>=0A> Ahem, but nobody here wants AltiVec in= the kernel do they?=0A>=0A> -- =0A> Matt Sealey =0A> = Genesi, Manager, Developer Relations=0A>=0A>=0A> --------------------------= ----=0A>=0A> Message: 3=0A> Date: Thu, 9 Oct 2008 16:08:18 -0300=0A> From: = "Ademir Zanetti Junior" =0A> Subject: Toolchain fo= r ppc-440 without FPU=0A> To: linuxppc-embedded@ozlabs.org=0A> Message-ID:= =0A> <2204d6480810091208u1776e81fx6597719734751edb@mail.gmail.com>=0A> Cont= ent-Type: text/plain; charset=3D"utf-8"=0A>=0A> Hello all,=0A>=0A> I am try= ing to create a toolchain by hand and I am facing some problems =0A> when= =0A> I try to configure the glibc 2.7 for a powerpc. When I try to configur= e =0A> the=0A> glibc to install the headers I get the following error:=0A>= =0A> configure --prefix=3D/usr --host=3Dpowerpc-440-linux-gnu=0A> --with-he= aders=3D${SYSROOT}/usr/include --disable-shared --without-cvs=0A> --with-bi= nutils=3D/home/azanetti/ml507/powerpc/bin/=0A>=0A> checking build system ty= pe... i686-pc-linux-gnu=0A> checking host system type... i686-pc-linux-gnu= =0A> configure: running configure fragment for add-on nptl=0A> checking sys= dep dirs... sysdeps/i386/elf=0A> nptl/sysdeps/unix/sysv/linux/i386/i686 npt= l/sysdeps/unix/sysv/linux/i386=0A> sysdeps/unix/sysv/linux/i386 nptl/sysdep= s/unix/sysv/linux=0A> nptl/sysdeps/pthread sysdeps/pthread sysdeps/unix/sys= v/linux sysdeps/gnu=0A> sysdeps/unix/common sysdeps/unix/mman sysdeps/unix/= inet=0A> sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv sysdeps/unix/sysv=0A= > sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix sysdeps/posix=0A> sysdep= s/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/i386/i686=0A> sysdeps/i386/i= 486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu =0A> nptl/sysdeps/i386=0A> sysd= eps/i386 sysdeps/wordsize-32 sysdeps/ieee754/ldbl-96=0A> sysdeps/ieee754/db= l-64 sysdeps/ieee754/flt-32 sysdeps/ieee754=0A> sysdeps/generic/elf sysdeps= /generic=0A> checking for a BSD-compatible install... /usr/bin/install -c= =0A> checking whether ln -s works... yes=0A> checking for gcc... gcc=0A> ch= ecking for suffix of object files... o=0A> checking whether we are using th= e GNU C compiler... yes=0A> checking whether gcc accepts -g... yes=0A> chec= king for gcc option to accept ISO C89... none needed=0A> checking how to ru= n the C preprocessor... gcc -E=0A> checking for g++... g++=0A>=0A> .=0A> .= =0A> .=0A> checking for long double... yes=0A> checking size of long double= ... 12=0A> running configure fragment for sysdeps/powerpc/powerpc32/elf=0A>= checking for powerpc32 TLS support... no=0A> running configure fragment fo= r sysdeps/unix/sysv/linux/powerpc=0A> checking whether gcc -B/home/azanetti= /ml507/powerpc/bin/ -g -O2=0A> -mlong-double-128 uses IBM extended format..= . no=0A> checking whether gcc -B/home/azanetti/ml507/powerpc/bin/ -g -O2 su= pports=0A> -mabi=3Dibmlongdouble... no=0A> configure: error: this configura= tion requires -mlong-double-128 IBM =0A> extended=0A> format support=0A>=0A= >=0A> I already have the binutils 2.18 compiled on my PATH. I know that it = is=0A> easier to use a script like crosstool to compile it but I do want to= =0A> understand what is happening behind the scenes.=0A>=0A> Regards.=0A>= =0A> Ademir=0A> -------------- next part --------------=0A> An HTML attachm= ent was scrubbed...=0A> URL: =0A> =0A>=0A> ----------= --------------------=0A>=0A> Message: 4=0A> Date: Thu, 9 Oct 2008 21:46:42 = +0200=0A> From: "Remi Lefevre" =0A> Subject: Re: FS_ENE= T ERROR(s) 0x12 at second NFS RPC port lookup=0A> (100005/1)=0A> To: "Scott= Wood" =0A> Cc: linuxppc-embedded@ozlabs.org=0A> M= essage-ID:=0A> <4e0b9cb00810091246i2f200dbn9f8dc9877800e629@mail.gmail.com>= =0A> Content-Type: text/plain; charset=3DISO-8859-1=0A>=0A> Ok, I'm sorry, = I have incorrectly set the 60x pipeline depth to 0=0A> instead of 1 in BCR = register.=0A> It works fine now. The side effect is interesting to know...= =0A>=0A> regards,=0A> r?mi=0A>=0A>=0A> ------------------------------=0A>= =0A> Message: 5=0A> Date: Thu, 9 Oct 2008 18:04:25 -0300=0A> From: Alemao <= xcarandiru@gmail.com>=0A> Subject: MTD map drivers (FSL UPM NAND)=0A> To: l= inuxppc-embedded@ozlabs.org=0A> Message-ID:=0A> =0A> Content-Type: text/plain; charset=3D= ISO-8859-1=0A>=0A> Hi all,=0A>=0A> Im trying to use a physmap driver for NO= R and NAND flash devices.=0A>=0A> With NOR, everything ok. It uses CFI driv= er.=0A>=0A> The problem is with NAND, cause it is connected at Freescale=0A= > LocalBus UPM, and at a first look, the UPM driver is loading after the=0A= > physmap (lines 14-15 in kernel output)=0A>=0A> Here some outputs from the= board:=0A>=0A> Bootloader (U-Boot 1.2.0):=0A>=0A> CPU: e300c1, MPC8360E,= Rev: 21 at 499.999 MHz, CSB: 333 MHz=0A> Board: MPC8360KTX=0A> I2C: rea= dy=0A> DDR RAM: 128 MB=0A> FLASH: 16 MB=0A> NAND: 64 MiB=0A> In: serial= =0A> Out: serial=0A> Err: serial=0A>=0A>=0A> Kernel (linux-2.6.17):=0A>= =0A> 1 physmap nor flash device: 1000000 at ff000000=0A> 2 = NOR flash: Found 1 x16 devices at 0x0 in 16-bit bank=0A> 3 = Amd/Fujitsu Extended Query Table at 0x0040=0A> 4 = number of CFI chips: 1=0A> 5 Using physmap partition definiti= on=0A> 6 Creating 6 MTD partitions on "NOR flash":=0A> 7 = 0x00000000-0x00040000 : "u-boot"=0A> 8 0x00040000-0= x00060000 : "env."=0A> 9 0x00060000-0x00080000 : "sys"=0A> 10= 0x00080000-0x000c0000 : "logs"=0A> 11 0x000c0000= -0x00860000 : "admin"=0A> 12 0x00860000-0x01000000 : "users"= =0A> 13=0A> 14 physmap nand flash device: 4000000 at 60000000= =0A> 15 UPM: User-Programmable Machine NAND driver=0A>=0A>=0A>= Device Tree Source:=0A>=0A> localbus@e0005000 {=0A> compatible =3D "fsl,b= oard-localbus";=0A> #address-cells =3D <2>;=0A> #size-cells =3D <1>;=0A> = reg =3D ; // BRx, ORx, etc=0A>=0A> ranges =3D <0 0 ff0000= 00 1000000 // nor flash, 16 MB=0A> 1 0 60000000 400= 0000>; // nand flash, 64 MB=0A>=0A> flash@0,0 {=0A> compatible =3D = "atmel,29LV256", "cfi-flash";=0A> reg =3D <0 0 1000000>;=0A> bank= -width =3D <2>;=0A> device-width =3D <1>;=0A> };=0A>=0A> nand@1,0 {= =0A> compatible =3D "stmicro,NAND512W3A", "fsl,upm-nand";=0A> reg= =3D <1 0 4000000>; //reg =3D <1 0 1>;=0A> width =3D <1>;=0A> u= pm =3D "A";=0A> upm-addr-offset =3D <16>;=0A> upm-cmd-offset =3D = <8>;=0A> gpios =3D <4 18>;=0A> gpio-parent =3D <&qe_pio>;=0A> = wait-pattern;=0A> wait-write;=0A> };=0A> };=0A>=0A> The CFI driver = is at linux/drivers/mtd/chips=0A> The UPM driver is at linux/drivers/mtd/na= nd=0A>=0A> So, how can I load the UPM driver before physmap?=0A>=0A> Thanks= in advance,=0A>=0A> --=0A> Alemao=0A>=0A>=0A> ----------------------------= --=0A>=0A> Message: 6=0A> Date: Thu, 9 Oct 2008 16:05:47 -0500=0A> From: "A= yman El-Khashab" =0A> Subject: RE: Toolchain for ppc-44= 0 without FPU=0A> To: "Ademir Zanetti Junior" ,=0A= > =0A> Message-ID:=0A> <16691A8B34B5D9458EA3A= 1C37A11555A0137F80B@tanisys-ex2.Tanisys.Local>=0A> Content-Type: text/plain= ; charset=3D"us-ascii"=0A>=0A> I was compiling for the 440FP under cygwin, = I believe that I had to use=0A> --enable-long-long when I configured gcc in= order to build glibc.=0A>=0A> ________________________________=0A>=0A> Fro= m: linuxppc-embedded-bounces+aymane=3Dtanisys.com@ozlabs.org=0A> [mailto:li= nuxppc-embedded-bounces+aymane=3Dtanisys.com@ozlabs.org] On=0A> Behalf Of A= demir Zanetti Junior=0A> Sent: Thursday, October 09, 2008 2:08 PM=0A> To: l= inuxppc-embedded@ozlabs.org=0A> Subject: Toolchain for ppc-440 without FPU= =0A>=0A>=0A> Hello all,=0A>=0A> I am trying to create a toolchain by hand a= nd I am facing some problems=0A> when I try to configure the glibc 2.7 for = a powerpc. When I try to=0A> configure the glibc to install the headers I g= et the following error:=0A>=0A> configure --prefix=3D/usr --host=3Dpowerpc-= 440-linux-gnu=0A> --with-headers=3D${SYSROOT}/usr/include --disable-shared = --without-cvs=0A> --with-binutils=3D/home/azanetti/ml507/powerpc/bin/=0A>= =0A> checking build system type... i686-pc-linux-gnu=0A> checking host syst= em type... i686-pc-linux-gnu=0A> configure: running configure fragment for = add-on nptl=0A> checking sysdep dirs... sysdeps/i386/elf=0A> nptl/sysdeps/u= nix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386=0A> sysdeps/unix= /sysv/linux/i386 nptl/sysdeps/unix/sysv/linux=0A> nptl/sysdeps/pthread sysd= eps/pthread sysdeps/unix/sysv/linux sysdeps/gnu=0A> sysdeps/unix/common sys= deps/unix/mman sysdeps/unix/inet=0A> sysdeps/unix/sysv/i386 nptl/sysdeps/un= ix/sysv sysdeps/unix/sysv=0A> sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/u= nix sysdeps/posix=0A> sysdeps/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/= i386/i686=0A> sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu=0A>= nptl/sysdeps/i386 sysdeps/i386 sysdeps/wordsize-32=0A> sysdeps/ieee754/ldb= l-96 sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32=0A> sysdeps/ieee754 sysd= eps/generic/elf sysdeps/generic=0A> checking for a BSD-compatible install..= . /usr/bin/install -c=0A> checking whether ln -s works... yes=0A> checking = for gcc... gcc=0A> checking for suffix of object files... o=0A> checking wh= ether we are using the GNU C compiler... yes=0A> checking whether gcc accep= ts -g... yes=0A> checking for gcc option to accept ISO C89... none needed= =0A> checking how to run the C preprocessor... gcc -E=0A> checking for g++.= .. g++=0A>=0A> .=0A> .=0A> .=0A> checking for long double... yes=0A> checki= ng size of long double... 12=0A> running configure fragment for sysdeps/pow= erpc/powerpc32/elf=0A> checking for powerpc32 TLS support... no=0A> running= configure fragment for sysdeps/unix/sysv/linux/powerpc=0A> checking whethe= r gcc -B/home/azanetti/ml507/powerpc/bin/ -g -O2=0A> -mlong-double-128 uses= IBM extended format... no=0A> checking whether gcc -B/home/azanetti/ml507/= powerpc/bin/ -g -O2 supports=0A> -mabi=3Dibmlongdouble... no=0A> configure:= error: this configuration requires -mlong-double-128 IBM=0A> extended form= at support=0A>=0A>=0A> I already have the binutils 2.18 compiled on my PATH= . I know that it is=0A> easier to use a script like crosstool to compile it= but I do want to=0A> understand what is happening behind the scenes.=0A>= =0A> Regards.=0A>=0A> Ademir=0A>=0A> -------------- next part -------------= -=0A> An HTML attachment was scrubbed...=0A> URL: =0A> =0A= >=0A> ------------------------------=0A>=0A> ______________________________= _________________=0A> Linuxppc-embedded mailing list=0A> Linuxppc-embedded@= ozlabs.org=0A> https://ozlabs.org/mailman/listinfo/linuxppc-embedded=0A>=0A= > End of Linuxppc-embedded Digest, Vol 50, Issue 14=0A> *******************= ******************************=0A> =0A=0A__________________________________= _____________=0ALinuxppc-embedded mailing list=0ALinuxppc-embedded@ozlabs.o= rg=0Ahttps://ozlabs.org/mailman/listinfo/linuxppc-embedded=0A=0A=0A=0A = B=E1=BA=A1n c=C3=B3 =C3=BD ki=E1=BA=BFn v=E1=BB=81 M=E1=BB=B9 T=C3=A2m?=0A= H=C3=A3y c=C3=B9ng chia s=E1=BA=BB v=E1=BB=9Bi m=E1=BB=8Di ng=C6=B0=E1=BB= =9Di t=E1=BA=A1i Yahoo! Vi=E1=BB=87t Nam Music=0Ahttp://vn.music.yahoo.com/= artist/100000056? --0-1896715470-1223596586=:78574 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
I think I2C-tools is what you need as sample code to a= ccess I2C in Linux. Here is the link
http://dl.lm-sensors.org/i2c-tools/= releases/i2c-tools-3.0.1.tar.bz2
There are a lot of tools to access, set= /get/dump register, read/write the I2C eeprom...
But please use them wit= h care, especially when you try to read/write the device at address 0x50 ( = it's is bootstrap eeprom).
You might not boot up your board after playi= ng with this device :-)
Quan Nguyen

----- Th=C6=B0 g= =E1=BB=91c ----
T=E1=BB=AB: Duy-Ky Nguyen <duykynguyen@hotmail.com>= ;
=C4=90=E1=BA=BFn: linuxppc-embedded@ozlabs.org
G=E1=BB=ADi ng=C3=A0= y: Th=E1=BB=A9 S=C3=A1u, 10 th=C3=A1ng 10, 2008 6:11:22
Ch=E1=BB=A7 =C4=91=E1=BB=81: API access I2C

Hello,
I have an eva board MPC8313E-RDB with 3 I2C device at address 48, 50, 68.=
I'm able to read data from those 3 devices

I follow linux/Docume= ntation/i2c/dev-interface to create a C code to access
those 3 devices = in Linux env, but all are failed !!!

I really appreciate your help w= here to find  info or sample code running in
Linyux to access I2C = devices

Thanks so much,

Duy-Ky

----- Original Message = -----
From: <linuxppc-embedded-= request@ozlabs.org>
To: <linuxppc-embedde= d@ozlabs.org>
Sent: Thursday, October 09, 2008 2:05 PM
Subject= : Linuxppc-embedded Digest, Vol 50, Issue 14


> Send Linuxppc-= embedded mailing list submissions to
> linuxppc-embedded@ozlabs.= org
>
> To subscribe or unsubscribe via the World Wide Web,= visit
> https://ozlabs.org/mailman/listinfo/linuxppc-embedd= ed
> or, via email, send a message with subject or body 'help' to=
> linuxppc-embedded-request@ozl= abs.org
>
> You can reach the person managing the list at> linuxppc-embedded-owner@ozlabs.org<= /a>
>
> When replying, please edit your Subject line so it is m= ore specific
> than "Re: Contents of Linuxppc-embedded digest..."
>
>
> Today's Topics:
>
>  = 1. Re: performance: memcpy vs. __copy_tofrom_user (Leon Woestenberg)
>= ;  2. Re: performance: memcpy vs. __copy_tofrom_user (Matt Sealey)>  3. Toolchain for ppc-440 without FPU (Ademir Zanetti Junior)>  4. Re: FS_ENET ERROR(s) 0x12 at second NFS RPC port lookup>      (100005/1) (Remi Lefevre)
>  5. MTD m= ap drivers (FSL UPM NAND) (Alemao)
>  6. RE: Toolchain for ppc-= 440 without FPU (Ayman El-Khashab)
>
>
> ----------------= ------------------------------------------------------
>
> Mess= age: 1
> Date: Thu, 9 Oct 2008 14:04:53 +0200
> From: "Leon Woe= stenberg" <
leon.woestenberg@gmail.com>
> S= ubject: Re: performance: memcpy vs. __copy_tofrom_user
> To: "Dominik Bozek" <domino@mikroswiat.pl>
> Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>,> linuxppc-embedded@ozlabs.org
> Messag= e-ID:
> <c384c5ea0810090504x570cb6aai6d136a150e74ac05@mail= .gmail.com>
> Content-Type: text/plain; charset=3DISO-8859-1>
> Hello all,
>
> On Thu, Oct 9, 2008 at 1:41 PM, D= ominik Bozek <domino@mikroswiat.pl>
>= wrote:
>> Paul Mackerras wrote:
>>> Dominik Bozek wri= tes:
>>>> Actually I made couple of other tests on that mpc8= 313. Most of them are
>>>> to ugly to publish them, but... M= y problem is that I have to boost the
>>>> gigabit interface= on the mpc8313. I made simple substitution and
>>>
>>= > Very interesting.  Can you work out where memcpy is being called = on
>>> the network data?  I wouldn't have expected that.>>>
>
> Also see this recent thread David Jander on = August 25th, "Efficient
> memcpy()/memmove() for G2/G3 cores..."
&= gt; on linuxppc-dev@ozlabs.org.
>
> http://ozlabs.org/pipermail/linuxppc-dev/2008-September/= 062449.html
>
> BTW, I am interested in this work as well, = I'm currently working with
> a 8313 and 8315 design, both are e300 co= res.
>
> My current goal is PCIe though, but I need fast GbE pe= rformance as well.
>
> Also, did you test Freescale's 2.6.24.3 = patches that tune the gianfar
> interfaces for higher performance?>
> Regards,
> --
> Leon
>
>
> ---= ---------------------------
>
> Message: 2
> Date: Thu, 0= 9 Oct 2008 10:37:55 -0500
> From: Matt Sealey <matt@genesi-usa.= com>
> Subject: Re: performance: memcpy vs. __copy_tofrom_user=
> To: Paul Mackerras <paulus@samba.org>
> Cc: linuxppc-dev@ozlabs.org, Dominik Bozek <domino@mikrosw= iat.pl>,
> linuxppc-embedded@ozlabs.org
> Message-ID: <
48EE2553.30903@genesi-usa= .com>
> Content-Type: text/plain; charset=3DUTF-8; format=3Dfl= owed
>
> Paul Mackerras wrote:
>> Dominik Bozek writes= :
>>
>>> Actually I made couple of other tests on that= mpc8313. Most of them are
>>> to ugly to publish them, but... = My problem is that I have to boost the
>>> gigabit interface on= the mpc8313. I made simple substitution and
>>> __copy_tofrom_= user was used instead of memcpy. I know, it's wrong, but I
>>> speedup that = way the network interface for about 10%.
>>
>> Very inter= esting.  Can you work out where memcpy is being called on
>> = the network data?  I wouldn't have expected that.
>
> It p= robably is somewhere.. through some weird and wonderful code path that
&= gt; needs some serious digging to find. At least in 2.4 memcpy was used and=
> optimizing it (see Freescale's libmotovec benchmarks) did produce = a
> sizable
> performance improvement. That, and offloading TC= P checksumming to AltiVec
> helped a lot.
>
> No help at = all on an 8313 but, relevant anyway.
>
> Since then zero copy n= etworking and other fancy things like the DMA
> engine API (for intel= ioat at least but also there is fsl dma support)
> there's less to a= ctually optimize now so you're less likely to see the
> same benefits. All these got into mainline because it's essential to
> ha= ve this kind of architecture to get reasonable speeds out of >gigabit> network links.
>
>> There is actually no strong reason= not to use __copy_tofrom_user as
>> memcpy, in fact, as long as w= e are sure that source and destination
>> are both cacheable.
&= gt;
> I do think there is probably a good benefit in doing things lik= e zeroing
> pages in AltiVec and copying entire pages with AltiVec (f= or instance
> when copy-on-write happens in an application) - NetBSD = and QNX implement
> at least this because it's faster than using the = cache management and
> works fine on uncacheable pages too (also sinc= e you're always aligned to
> a page, zeroing 4kb aligned to a 4kb bou= ndary - or whatever your page
> size happens to be, the number of err= ors that can occur are absolutely
> tiny and performance can go through the roof).
>
> Ahem, but nobody here wants AltiVec = in the kernel do they?
>
> --
> Matt Sealey <matt@= genesi-usa.com>
> Genesi, Manager, Developer Relations
>=
>
> ------------------------------
>
> Message: 3<= br>> Date: Thu, 9 Oct 2008 16:08:18 -0300
> From: "Ademir Zanetti = Junior" <ademirzanetti@gmail.com>
> Subject: Too= lchain for ppc-440 without FPU
> To: linuxppc-em= bedded@ozlabs.org
> Message-ID:
> <2204d6480810091208u1776e81fx6597719734751edb@mail.gmail.com>
&g= t; Content-Type: text/plain; charset=3D"utf-8"
>
> Hello all,>
> I am trying to create a toolchain by hand and I am facing so= me problems
> when
> I try to configure the glibc 2.7 for a po= werpc. When I try to configure
> the
> glibc to install the he= aders I get the following error:
>
> configure --prefix=3D/usr = --host=3Dpowerpc-440-linux-gnu
> --with-headers=3D${SYSROOT}/usr/incl= ude --disable-shared --without-cvs
> --with-binutils=3D/home/azanetti= /ml507/powerpc/bin/
>
> checking build system type... i686-pc-l= inux-gnu
> checking host system type... i686-pc-linux-gnu
> con= figure: running configure fragment for add-on nptl
> checking sysdep = dirs... sysdeps/i386/elf
> nptl/sysdeps/unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386
> sysdeps/unix/sysv/linux/i386 npt= l/sysdeps/unix/sysv/linux
> nptl/sysdeps/pthread sysdeps/pthread sysd= eps/unix/sysv/linux sysdeps/gnu
> sysdeps/unix/common sysdeps/unix/mm= an sysdeps/unix/inet
> sysdeps/unix/sysv/i386 nptl/sysdeps/unix/sysv = sysdeps/unix/sysv
> sysdeps/unix/i386 nptl/sysdeps/unix sysdeps/unix = sysdeps/posix
> sysdeps/i386/i686/fpu nptl/sysdeps/i386/i686 sysdeps/= i386/i686
> sysdeps/i386/i486 nptl/sysdeps/i386/i486 sysdeps/i386/fpu=
> nptl/sysdeps/i386
> sysdeps/i386 sysdeps/wordsize-32 sysdep= s/ieee754/ldbl-96
> sysdeps/ieee754/dbl-64 sysdeps/ieee754/flt-32 sys= deps/ieee754
> sysdeps/generic/elf sysdeps/generic
> checking f= or a BSD-compatible install... /usr/bin/install -c
> checking whether= ln -s works... yes
> checking for gcc... gcc
> checking for su= ffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
&g= t; checking for gcc option to accept ISO C89... none needed
> checkin= g how to run the C preprocessor... gcc -E
> checking for g++... g++>
> .
> .
> .
> checking for long double... ye= s
> checking size of long double... 12
> running configure frag= ment for sysdeps/powerpc/powerpc32/elf
> checking for powerpc32 TLS s= upport... no
> running configure fragment for sysdeps/unix/sysv/linux= /powerpc
> checking whether gcc -B/home/azanetti/ml507/powerpc/bin/ -= g -O2
> -mlong-double-128 uses IBM extended format... no
> chec= king whether gcc -B/home/azanetti/ml507/powerpc/bin/ -g -O2 supports
>= ; -mabi=3Dibmlongdouble... no
> configure: error: this configuration = requires -mlong-double-128 IBM
> extended
> format support
= >
>
> I already have the binutils 2.18 compiled on my PATH. I know that it is
> easier to use a script like crosstool to c= ompile it but I do want to
> understand what is happening behind the = scenes.
>
> Regards.
>
> Ademir
> -----------= --- next part --------------
> An HTML attachment was scrubbed...
= > URL:
> <h= ttp://ozlabs.org/pipermail/linuxppc-embedded/attachments/20081009/a3dd71d6/= attachment-0001.htm>
>
> ------------------------------<= br>>
> Message: 4
> Date: Thu, 9 Oct 2008 21:46:42 +0200
= > From: "Remi Lefevre" <rlefevre@gmail.com>
> Subject: = Re: FS_ENET ERROR(s) 0x12 at second NFS RPC port lookup
> (100005/1)<= br>> To: "Scott Wood" <scottwood@freescale.com>> Cc: linuxppc-embedded@ozlabs.org
> Mes= sage-ID:
> <4e0b9cb00810091246i2f200dbn9f8dc9877800e629@mail= .gmail.com>
> Content-Type: text/plain; charset=3DISO-8859-1>
> Ok, I'm sorry, I have incorrectly set the 60x pipeline depth= to 0
> instead of 1 in BCR register.
> It works fine now. The = side effect is interesting to know...
>
> regards,
> r?mi=
>
>
> ------------------------------
>
> Mes= sage: 5
> Date: Thu, 9 Oct 2008 18:04:25 -0300
> From: Alemao &= lt;xcarandiru@gmail.com>
> = Subject: MTD map drivers (FSL UPM NAND)
> To: li= nuxppc-embedded@ozlabs.org
> Message-ID:
> <d9= 70ff420810091404j49492e80xcd9250d0ffdcd592@mail.gmail.com>
> C= ontent-Type: text/plain; charset=3DISO-8859-1
>
> Hi all,
&g= t;
> Im trying to use a physmap driver for NOR and NAND flash devices= .
>
> With NOR, everything ok. It uses CFI driver.
>
&= gt; The problem is with NAND, cause it is connected at Freescale
> Lo= calBus UPM, and at a first look, the UPM driver is loading after the
>= ; physmap (lines 14-15 in kernel output)
>
> Here some outputs = from the board:
>
> Bootloader (U-Boot 1.2.0):
>
> CPU:=   e300c1, MPC8360E, Rev: 21 at 499.999 MHz, CSB:  333 MHz
>= ; Board: MPC8360KTX
> I2C:  ready
> DDR RAM: 128 MB
&g= t; FLASH: 16 MB
> NAND:  64 MiB
> In:    serial<= br>> Out:  serial
> Err:  serial
>
>
&g= t; Kernel (linux-2.6.17):
>
> 1        &nbs= p;     physmap nor flash device: 1000000 at ff000000
> 2&n= bsp;             NOR flash: Found 1 x16 devi= ces at 0x0 in 16-bit bank
> 3           = ;     Amd/Fujitsu Extended Query Table at 0x0040
> 4  =               number of CFI chips: 1
= > 5              Using physmap parti= tion definition
> 6              Creating 6 MTD partitions on "NOR flash":
> 7    &= nbsp;         0x00000000-0x00040000 : "u-boot"
>= 8              0x00040000-0x00060000 := "env."
> 9              0x000600= 00-0x00080000 : "sys"
> 10            &= nbsp; 0x00080000-0x000c0000 : "logs"
> 11        =       0x000c0000-0x00860000 : "admin"
> 12   = ;           0x00860000-0x01000000 : "users"
>= ; 13
> 14              physmap nan= d flash device: 4000000 at 60000000
> 15        &= nbsp;     UPM: User-Programmable Machine NAND driver
>
&= gt;
> Device Tree Source:
>
> localbus@e0005000 {
>=   compatible =3D "fsl,board-localbus";
>  #address-cells =3D <2>;
>  #size-cells =3D <1>;
= >  reg =3D <e0005000 d8>;    // BRx, ORx, etc
&g= t;
>  ranges =3D <0 0 ff000000 1000000    // nor f= lash,  16 MB
>              &= nbsp;     1 0 60000000 4000000>;  // nand flash, 64 MB>
>  flash@0,0 {
>      compatible =3D= "atmel,29LV256", "cfi-flash";
>      reg =3D <0 0 = 1000000>;
>      bank-width =3D <2>;
>&= nbsp;     device-width =3D <1>;
>  };
>>  nand@1,0 {
>      compatible =3D "stmicro,= NAND512W3A", "fsl,upm-nand";
>      reg =3D <1 0 40= 00000>;  //reg =3D <1 0 1>;
>      widt= h =3D <1>;
>      upm =3D "A";
>  &nb= sp;   upm-addr-offset =3D <16>;
>      upm-cmd-offset= =3D <8>;
>      gpios =3D <4 18>;
>=       gpio-parent =3D <&qe_pio>;
>  &nb= sp;   wait-pattern;
>      wait-write;
>&nb= sp; };
> };
>
> The CFI driver is at linux/drivers/mtd/ch= ips
> The UPM driver is at linux/drivers/mtd/nand
>
> So,= how can I load the UPM driver before physmap?
>
> Thanks in ad= vance,
>
> --
> Alemao
>
>
> ----------= --------------------
>
> Message: 6
> Date: Thu, 9 Oct 20= 08 16:05:47 -0500
> From: "Ayman El-Khashab" <AymanE@tanisys.com<= /a>>
> Subject: RE: Toolchain for ppc-440 without FPU
> To: = "Ademir Zanetti Junior" <
ademirzanetti@gmail.com>,> <linuxppc-embedded@ozlabs.org>
>= ; Message-ID:
> <16691A8B34B5D9458EA3A1C37A1= 1555A0137F80B@tanisys-ex2.Tanisys.Local>
> Content-Type: text/= plain; charset=3D"us-ascii"
>
> I was compiling for the 440FP u= nder cygwin, I believe that I had to use
> --enable-long-long when I = configured gcc in order to build glibc.
>
> ___________________= _____________
>
> From: linuxppc-embedded-bounces+aymane=3Dtanisys.com@ozlabs.org
> [mailto:linuxppc-embedded-bounces+a= ymane=3Dtanisys.com@ozlabs.org] On
> Behalf Of Ademir Zanetti Juni= or
> Sent: Thursday, October 09, 2008 2:08 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: Toolchain for = ppc-440 without FPU
>
>
> Hello all,
>
> I am= trying to create a toolchain by hand and I am facing some problems
>= when I try to configure the glibc 2.7 for a powerpc. When I try to
>= configure the glibc to install the headers I get the following error:
&= gt;
> configure --prefix=3D/usr --host=3Dpowerpc-440-linux-gnu
>= ; --with-headers=3D${SYSROOT}/usr/include --disable-shared --without-cvs> --with-binutils=3D/home/azanetti/ml507/powerpc/bin/
>
> c= hecking build system type... i686-pc-linux-gnu
> checking host system= type... i686-pc-linux-gnu
> configure: running configure fragment for add-on= nptl
> checking sysdep dirs... sysdeps/i386/elf
> nptl/sysdeps= /unix/sysv/linux/i386/i686 nptl/sysdeps/unix/sysv/linux/i386
> sysdep= s/unix/sysv/linux/i386 nptl/sysdeps/unix/sysv/linux
> nptl/sysdeps/pt= hread sysdeps/pthread sysdeps/unix/sysv/linux sysdeps/gnu
> sysdeps/u= nix/common sysdeps/unix/mman sysdeps/unix/inet
> sysdeps/unix/sysv/i3= 86 nptl/sysdeps/unix/sysv sysdeps/unix/sysv
> sysdeps/unix/i386 nptl/= sysdeps/unix sysdeps/unix sysdeps/posix
> sysdeps/i386/i686/fpu nptl/= sysdeps/i386/i686 sysdeps/i386/i686
> sysdeps/i386/i486 nptl/sysdeps/= i386/i486 sysdeps/i386/fpu
> nptl/sysdeps/i386 sysdeps/i386 sysdeps/w= ordsize-32
> sysdeps/ieee754/ldbl-96 sysdeps/ieee754/dbl-64 sysdeps/i= eee754/flt-32
> sysdeps/ieee754 sysdeps/generic/elf sysdeps/generic> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether ln -s works... yes
> checking for gcc...= gcc
> checking for suffix of object files... o
> checking whet= her we are using the GNU C compiler... yes
> checking whether gcc acc= epts -g... yes
> checking for gcc option to accept ISO C89... none ne= eded
> checking how to run the C preprocessor... gcc -E
> check= ing for g++... g++
>
> .
> .
> .
> checking f= or long double... yes
> checking size of long double... 12
> ru= nning configure fragment for sysdeps/powerpc/powerpc32/elf
> checking= for powerpc32 TLS support... no
> running configure fragment for sys= deps/unix/sysv/linux/powerpc
> checking whether gcc -B/home/azanetti/= ml507/powerpc/bin/ -g -O2
> -mlong-double-128 uses IBM extended forma= t... no
> checking whether gcc -B/home/azanetti/ml507/powerpc/bin/ -g= -O2 supports
> -mabi=3Dibmlongdouble... no
> configure: error: this configuration requires -mlong-double-128 IBM
> extended = format support
>
>
> I already have the binutils 2.18 com= piled on my PATH. I know that it is
> easier to use a script like cro= sstool to compile it but I do want to
> understand what is happening = behind the scenes.
>
> Regards.
>
> Ademir
><= br>> -------------- next part --------------
> An HTML attachment = was scrubbed...
> URL:
> <http://ozlabs.org/pipermail/linuxppc-embedded/attachments/2008= 1009/c91ac7a9/attachment.htm>
>
> ----------------------= --------
>
> _______________________________________________> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org<= /a>
>
https://ozlabs.org/mailman/listinfo/linuxppc-embedded<= /a>
>
> End of Linuxppc-embedded Digest, Vol 50, Issue 14
&g= t; *************************************************
>

______= _________________________________________
Linuxppc-embedded mailing list=
Linuxppc-embedded@ozlabs.org
https= ://ozlabs.org/mailman/listinfo/linuxppc-embedded
<= br>=0A
N=C6=B0=E1=BB=9Bc n= =C3=A0o th=C6=B0=E1=BB=9Dng cho nhi=E1=BB=81u h=E1=BB=8Dc b=E1=BB=95ng du h= =E1=BB=8Dc? Kh=C3=A1m ph=C3=A1 t=E1=BA=A1i Yahoo! H=E1=BB=8Fi & =C4= =90=C3=A1p --0-1896715470-1223596586=:78574--