LTIB for mpc8349itx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LTIB for mpc8349itx

17,545 Views
fjpse
Contributor I
I want to make a hello driver for this platform using LTIB.

First, I execute this commands to get the kernel source and to compile the kernel

./ltib -p kernel -m prep
./ltib -p kernel -m scbuild

Now I get the kernel source in rpm/BUILD/linux

I create a subdir rpm/BUILD/test with two files: test.c (my hello driver) and Makefile (attached with extension  .txt)

To compile the driver, I use LTIB in shell mode:

./ltib -m shell
LTIB>cd rpm/BUILD/test
LTIB>make

But the compiler fail because it can't found <platforms/83xx/mpc8349_itx.h> (this file exist) in the linux kernel source (attached the file result.txt with the output of the make command).

What is the problem? How to build a driver using the LTIB?
Thanks.

result.txt
Makefile.txt
test.c
Message Edited by t.dowe on 2009-09-04 12:43 PM
0 Kudos
25 Replies

2,685 Views
roopesh
Contributor I
hi mii
    how to compile a driver with ltib actually i tried the command make v=1
 and output is error:
 HOSTCC  scripts/basic/fixdep
/bin/sh: scripts/basic/fixdep: cannot execute binary file
make[2]: *** [scripts/basic/fixdep] Error 126
make[1]: *** [scripts_basic] Error 2
make: *** [include/config/auto.conf] Error 2

2> and o/p of gcc -V
[root@localhost linux-2.6.20]# gcc -v
Using built-in specs.
Target: powerpc-e300c2-linux
Configured with: /usr/src/redhat/BUILD/crosstool/source/gcc-4.0.2/configure --target=powerpc-e300c2-linux --host=i686-host_pc-linux-gnu --prefix=/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c2-linux --with-cpu=e300c2 --enable-cxx-flags=-mcpu=e300c2 --nfp --with-headers=/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c2-linux/powerpc-e300c2-linux/include --with-local-prefix=/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c2-linux/powerpc-e300c2-linux --disable-nls --enable-threads=posix --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++ --enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.0.2 20060628 (Wasabi)
 
##i want insert ralink RT2560 wifi module which is depends upon PCI_HERMES in mpc 8323ERDB ltib packege .
thank you
roopesh
0 Kudos

2,685 Views
gleb_itech
Contributor I
This command will unpack your module package from /opt/ltib/pkgs/hello_mod-1.1 to /home/user/ltib/rpm/BUILD/hello_mod-1.1:
./ltib -m prep -p hello_mod

This command compiles the module:
./ltib -m scbuild -p hello_mod

And this will pack an image:
./ltib -m scinstall -p hello_mod
./ltib -m scdeploy -p hello_mod

This is it :smileyhappy:
Message Edited by gleb.itech on 06-08-2009 11:22 AM
0 Kudos

2,685 Views
cathy
Contributor I
 
 
Hi fjpse,
 
I tried compiling the "hello" module as you said and I have test.ko under the directory rpm/build/test/ .  How do I add this module into root file system.  I am using Ltib
 and linux kernel 2.6.13.4.
 
Aurelihein, I also have tried compiling the "hello" module as you descripted as followings:
 
./ltib -m prep -p kernel
now your kernel is decompressed into the rpm/BUILD directory(things that you already did)
cd rpm/BUILD/linux-2.6.13/drivers/
mkdir test
cd test
copy into this director your test.c and the Makefile i gave you before
cd ..
now your are in the drivers' directory, change the makefile to add the line i gave :
obj-m += test/
return into your ltib directory and do
./ltib

I did ./ltib -p kernel -m scbuild and ./ltib -p kernel -m scdeploy.

I could not find test.ko under the root file system.  There is one warning message:

+ make ARCH=ppc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' DEPMOD=/bin/true INSTALL_MOD_PATH=/home/xxx/ltib-mpc8349itx-gp-20061024/tmp/kernel//opt/freescale/rootfs/ppc modules_install

Warning: you may need to install module-init-tools.

Thanks very much for helps!

Happy Holiday!

 

 


0 Kudos

2,685 Views
aurelihein
Contributor I
Hey,
It's wierd! I don't know what this warning means
Have you checked for your test.ko in the ltib/rootfs/lib/modules/2.6.13.4/. . .
Apparently ltib can't handle module, so you can just include your driver in the kernel tree natively, to do that obj-m=... have to change into obj-y=...
Else you should look for the package module-init-tools . . .
good luck,
thanks to keep us update

aurélien
0 Kudos

2,685 Views
Rekha
Contributor I
We have compiled the ltib for the powerpc mpc8343.
 
Its work fine.
 
Now we need to add a temperature sensor module to the existing ltib. (we have MPC1023 temperature sensor in our board, which is not supported by the ltib)
 
Can any one tell me the steps to add the new module ot the ltib.
 
Note: I am new to the kernel development process
0 Kudos

2,685 Views
aurelihein
Contributor I
you have to find a driver for your device or just make it and add your driver to the kernel tree, it doesn't depend of LTIB but the kernel.
To add your driver you have to read what i posted before on this section.
Good luck,
aurelien
0 Kudos

2,685 Views
aurelihein
Contributor I
sorry fjpse, I figured out that i didn't answer your question actually ! But what you did will help me !
To add your module in the final rootfs.ext2.gz that you will download into your board you have to add your directory "test" into the kernel drivers's folder
I will try to explain the whole method :
when you are in your ltib folder do
./ltib -m prep -p kernel
now your kernel is decompressed into the rpm/BUILD directory(things that you already did)
cd rpm/BUILD/linux-2.6.13/drivers/
mkdir test
cd test
copy into this director your test.c and the Makefile i gave you before
cd ..
now your are in the drivers' directory, change the makefile to add the line i gave :
obj-m += test/
return into your ltib directory and do
./ltib
when it will be finished you should find your module into the /lib/modules.../test/test.ko

let me know if you have trouble, I was kinda busy sorry if i didn't help you earlier

0 Kudos

2,685 Views
cathy
Contributor I
Hi aurelihein,
 
I am new for Ltib. 
 
Can you send me the make file?  Thanks very much!
 
Cathy
0 Kudos

2,686 Views
aurelihein
Contributor I
Hi,
Google is your friend don't forget it ! you can download the file here http://download.savannah.nongnu.org/releases/ltib/ltib-6.2.2-sv.tar.gz afterwards you should read the README and the documents in generale...
good luck,
aurelien
0 Kudos

2,686 Views
fjpse
Contributor I
aurelihein, I haven't any problem adding the module to the root filesystem. Thanks for your explains.

Now, I'm trying to access to the IMMR. The register IMMRBAR (offset 0h) indicates the physical address of the IMMR block, and the register SPRIDR (offset 108h) indicates the chip model and revision.

I do this using VIRT_IMMRBAR, the virtual address associated with the IMMR.

I've attached the new test.c file that do it.

It works!. The physical address of IMMR is E0000000H, defined in the u-boot file include/configs/MPC8349ITX.h (CFG_IMMRBAR)

test.c
Message Edited by t.dowe on 2009-09-04 12:44 PM
0 Kudos

2,686 Views
mii
Contributor I
aurelihein, thanks, it's OK for me too. Thetest.ko file is in the root file system.
Thanks you for your explain.
fjpse, thanks too. I will try your test.c
Mii
 
PS : I have post a other message on the subject "Add a PCI card on MPC8349E-mITX-GP board "
 
 
0 Kudos

2,686 Views
aurelihein
Contributor I
Thank you all !
It's working perfectly, I can change the register that i wan't !!!
I'm glad i helped,
We should keep update of what we are all able to do with our board
:smileywink:
I already change the state of GPIOs with your help
The next step will be the local bus with all the parameters


0 Kudos

2,686 Views
aurelihein
Contributor I
I already had your problem in doing driver with ltib, I'm gonna try to explain you how i did.
First of all you have to add your module in the kernel subdirectory, for example if you want to add test, you can put it under drivers :
linux-XXXX/drivers/test/
there you can copy your test.c file and add a Makefile with written in it  :
Code:
obj-m += test.o
you have to add your path at the end of the Makefile under the directory drivers :
Code:
obj-m += test/

just recompile with ltib : ./ltib
load the rootfs.ext2.gz
and if you want to load your module go into /lib/modules/.../test and do insmod test.ko
enjoy
let me know if you have troubles
I would appreciate to know more what you implemented on your mpc8349 platform, because I am trying unsuccessfully to change the value of registers but I can't . . .

Message Edited by aurelihein on 2007-04-1801:01 PM

0 Kudos

2,686 Views
Rekha
Contributor I
I have the ltib implemented in my board MPC8343

Now I have to activate the temperature sensor(partno. EMC1023) for our board.

At present ltib have the support for the some other temperature sensor. I need to make it compactable to my board. For that what I need to do?
0 Kudos

2,686 Views
mii
Contributor I
Hi,
I have the same problem.
Can you send your Makefile, please ?
Thanks
0 Kudos

2,686 Views
mii
Contributor I
please, help me.
I have problem to create a module with ltib.
How to compile ?
Thanks
0 Kudos

2,686 Views
fjpse
Contributor I
mii,

the makefile that I use is attached to the first message I sent (but renamed to Makefile.txt because it's not possible to attach a file without extension).

Well, I have been doing some probes.

If I execute "make V=1" (see Makefile in linux source directory) instead of "make" (inside LTIB), I can see the commands that will be executed. I get the next output:

gcc -m32 -Wp,-MD,/home/javier/ltib/rpm/BUILD/test/.test.o.d  -nostdinc -isystem /opt/mtwk/usr/local/powerpc-linux/gcc-3.4.3-glibc-2.3.3/lib/gcc/powerpc-linux/3.4.3/include -D__KERNEL__ -Iinclude  -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2     -fomit-frame-pointer -pipe -msoft-float  -fno-unit-at-a-time  -Iinclude/asm-i386/mach-default -Wdeclaration-after-statement    -DMODULE -DKBUILD_BASENAME=test -DKBUILD_MODNAME=test -c -o /home/javier/ltib/rpm/BUILD/test/.tmp_test.o /home/javier/ltib/rpm/BUILD/test/test.c

One strange thing is the flag -Iinclude/asm-i386/mach-default.

My host is a i386, but my target is a POWERPC.
Well, then I try this "make V=1 ARCH=ppc" and.....voilà!

IT'S COMPILE OK!!!!

The command is gcc instead of powerpc-linux-gcc or some similar, strange, but I can load and unload the driver in the mpc8349itx platform (and the messages are output). I suppose that inside LTIB, gcc is really the powerpc compiler.

Now, I want to make a driver that manipulates a hardware timer and its interrupt.

0 Kudos

2,686 Views
Rekha
Contributor I

fjpse,

I have tried compiling the "hello" module as you said, but I got error while compiling.

I used the your test.c and Makefile only

Error is:

LTIB> cd rpm/BUILD/test/

LTIB> make V=1 ARCH=ppc

make -C ../linux-2.6.10/ M=/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test

make[1]: Entering directory `/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/linux-2.6.10'

mkdir -p /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/.tmp_versions

make -f scripts/Makefile.build obj=/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test

rm -f /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/built-in.o; ar rcs /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/built-in.o

gcc -g2 -gdwarf-2 -m32 -Wp,-MD,/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/.test.o.d -nostdinc -isystem /home/ppc/try/ltib-mpc8349emds-20060414/rootfs/usr/lib//include -D__KERNEL__ -Iinclude -Iarch/ppc -Wall

-Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O1 -fomit-frame-pointer -Iarch/ppc -msoft-float -pipe -ffixed-r2 -mmultiple -mstring -Wa,-maltivec -Wdeclaration-after-statement -DMODULE -DKBUILD_BASENAME=test -DKBUILD_MODNAME=test -c -o /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/test.o /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/test.c

Building modules, stage 2.

make -rR -f /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/linux-2.6.10/scripts/Makefile.modpost

scripts/mod/modpost -i /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/linux-2.6.10/Module.symvers vmlinux /home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/test/test.o

/bin/sh: line 1: scripts/mod/modpost: No such file or directory

make[2]: *** [__modpost] Error 127

make[1]: *** [modules] Error 2

make[1]: Leaving directory `/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/linux-2.6.10'

make: *** [default] Error 2

Can you tell me what mistake I am doing?

0 Kudos

2,686 Views
hrishikesh23
Contributor I

Hi Dear !

 

I am facing the same Problem stated by "Rekha" . Did any one got the solutions .

This is the Error log i get ==>

LTIB> make V=1 ARCH=ppc
make -C ../linux-2.6.23 M=/home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/test
make[1]: Entering directory `/home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/linux-2.6.23'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || (        \
echo;                                \
echo "  ERROR: Kernel configuration is invalid.";        \
echo "         include/linux/autoconf.h or include/config/auto.conf are missing.";    \
echo "         Run 'make oldconfig && make prepare' on kernel src to fix it.";    \
echo;                                \
/bin/false)

  ERROR: Kernel configuration is invalid.
         include/linux/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

mkdir -p /home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/test/.tmp_versions
rm -f /home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/test/.tmp_versions/*

  WARNING: Symbol version dump /home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/linux-2.6.23/Module.symvers
           is missing; modules will have no dependencies and modversions.

make -f scripts/Makefile.build obj=/home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/test
  Building modules, stage 2.
make -f /home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/linux-2.6.23/scripts/Makefile.modpost
/home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/linux-2.6.23/scripts/Makefile.modpost:42: include/config/auto.conf: No such file or directory
make[2]: *** No rule to make target `include/config/auto.conf'.  Stop.
make[1]: *** [modules] Error 2
make[1]: Leaving directory `/home/Admin/Document/MPC8641d/Install/ltib-mpc8641hpcn-20080117/rpm/BUILD/linux-2.6.23'
make: *** [default] Error 2

 

Thanks and Regard's

Hrishikesh.

0 Kudos

2,686 Views
aurelihein
Contributor I
It seems like some files are missing :

/home/ppc/try/ltib-mpc8349emds-20060414/rpm/BUILD/linux-2.6.10/scripts/Makefile.modpost
scripts/mod/modpost

You are under ./ltib -m shell ?

Do you have the last revision of the kernel for this board ? because It's a 2.6.10 and i used a 2.6.14 . . .

I don't remenber if I had to change some options under the kernel to enable to compile modules, like the abitility to load dynamic module . . .

I am just trying to help blindly because I haven't use this board for a while . . .
Let us know how things are going,
good luck

aurelihein
0 Kudos